@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
|
@@ -2,64 +2,59 @@ import { _ as __rest } from "./tslib.es6-c-7TIv71.mjs";
|
|
|
2
2
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
|
-
import React, { useRef, useMemo, useCallback, useEffect } from "react";
|
|
5
|
+
import React, { useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
6
6
|
|
|
7
7
|
import { useObserveResize } from "../hooks/useObserveResize.mjs";
|
|
8
8
|
|
|
9
|
-
import { p as pointerPosition } from "./misc-
|
|
9
|
+
import { p as pointerPosition } from "./misc-N8KLjOXc.mjs";
|
|
10
|
+
|
|
11
|
+
import { d as debounce } from "./debounce-Bst1jxMS.mjs";
|
|
10
12
|
|
|
11
13
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
* General debounce utility with delay setting and cancel/flush methods
|
|
15
|
-
* to clear a "debounce" or immediately "execute" the debounced function
|
|
16
|
-
*/ var 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";
|
|
15
|
+
var 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";
|
|
17
16
|
|
|
18
|
-
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:
|
|
17
|
+
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");
|
|
19
18
|
|
|
20
19
|
const Slider = React.memo(props => {
|
|
21
|
-
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 = __rest(props, [ "value", "scaleMin", "scaleMax", "width", "height", "touchHeight", "trackHeadSize", "cursor", "headColor", "trackColor", "progressColor", "onChange", "onDragChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = useRef(null), track = useRef(null), head = useRef(null), absProgressRef = useRef(value), relativeProgressRef = useRef(
|
|
20
|
+
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 = __rest(props, [ "value", "scaleMin", "scaleMax", "width", "height", "touchHeight", "trackHeadSize", "cursor", "headColor", "trackColor", "progressColor", "onChange", "onDragChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = useRef(null), track = useRef(null), head = useRef(null), [currentValue, setCurrentValue] = useState(value), absProgressRef = useRef(value), relativeProgressRef = useRef(0), didMount = useRef(!1), size = useObserveResize(ref, {
|
|
22
21
|
ignore: "height"
|
|
23
|
-
}), debouncedOnChange =
|
|
24
|
-
let timeoutId = null, lastArgs = null;
|
|
25
|
-
const debounced = function(...args) {
|
|
26
|
-
lastArgs = args, null !== timeoutId && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
|
|
27
|
-
func.apply(this, null != lastArgs ? lastArgs : []), timeoutId = null, lastArgs = null;
|
|
28
|
-
}, delay);
|
|
29
|
-
};
|
|
30
|
-
return debounced.cancel = () => {
|
|
31
|
-
null !== timeoutId && (clearTimeout(timeoutId), timeoutId = null, lastArgs = null);
|
|
32
|
-
}, debounced.flush = function() {
|
|
33
|
-
null !== timeoutId && null !== lastArgs && (clearTimeout(timeoutId), func.apply(this, lastArgs),
|
|
34
|
-
timeoutId = null, lastArgs = null);
|
|
35
|
-
}, debounced;
|
|
36
|
-
}((value, percent) => {
|
|
22
|
+
}), debouncedOnChange = debounce((value, percent) => {
|
|
37
23
|
onChange(value, percent);
|
|
38
|
-
}, 0), padding = useMemo(() => trackHeadSize ? Math.ceil(trackHeadSize / 2) : 0, [ trackHeadSize ]),
|
|
24
|
+
}, 0), padding = useMemo(() => trackHeadSize ? Math.ceil(trackHeadSize / 2) : 0, [ trackHeadSize ]), clampValue = useCallback(nextValue => Math.min(scaleMax, Math.max(scaleMin, nextValue)), [ scaleMax, scaleMin ]), valueToPercent = useCallback(nextValue => {
|
|
25
|
+
const range = scaleMax - scaleMin;
|
|
26
|
+
return range <= 0 ? 0 : (nextValue - scaleMin) / range;
|
|
27
|
+
}, [ scaleMax, scaleMin ]), setTrackAndHead = useCallback(pixelPos => {
|
|
39
28
|
const hd = head.current, tr = track.current;
|
|
40
29
|
hd && (hd.style.left = `${pixelPos}px`), tr && (tr.style.width = `${pixelPos}px`),
|
|
41
30
|
didMount.current = !0;
|
|
42
31
|
}, []), initialProgress = useCallback(current => {
|
|
43
32
|
if (!(null == ref ? void 0 : ref.current)) return;
|
|
44
|
-
const sliderWidth = ref.current.getBoundingClientRect().width;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
adjustedCurrent = (scaleMax - scaleMin) / 2);
|
|
48
|
-
const normalized = (adjustedCurrent - scaleMin) / (scaleMax - scaleMin), pixelPos = normalized * sliderWidth;
|
|
33
|
+
const sliderWidth = ref.current.getBoundingClientRect().width, adjustedCurrent = clampValue(current);
|
|
34
|
+
adjustedCurrent !== current && console.warn("Slider outside range. Adjusted to nearest bound.");
|
|
35
|
+
const normalized = valueToPercent(adjustedCurrent), pixelPos = normalized * sliderWidth;
|
|
49
36
|
absProgressRef.current = adjustedCurrent, relativeProgressRef.current = normalized,
|
|
50
|
-
setTrackAndHead(pixelPos), didMount.current = !0;
|
|
51
|
-
}, [
|
|
37
|
+
setCurrentValue(adjustedCurrent), setTrackAndHead(pixelPos), didMount.current = !0;
|
|
38
|
+
}, [ clampValue, valueToPercent, setTrackAndHead ]), progress = useCallback(posX => {
|
|
52
39
|
const el = null == ref ? void 0 : ref.current;
|
|
53
40
|
if (!el) return {
|
|
54
41
|
value: 0,
|
|
55
42
|
percent: 0
|
|
56
43
|
};
|
|
57
44
|
const sliderWidth = el.getBoundingClientRect().width;
|
|
58
|
-
relativeProgressRef.current = posX / sliderWidth, absProgressRef.current = scaleMin + relativeProgressRef.current * (scaleMax - scaleMin)
|
|
59
|
-
|
|
45
|
+
relativeProgressRef.current = sliderWidth > 0 ? posX / sliderWidth : 0, absProgressRef.current = scaleMin + relativeProgressRef.current * (scaleMax - scaleMin),
|
|
46
|
+
setCurrentValue(absProgressRef.current);
|
|
47
|
+
}, [ scaleMax, scaleMin ]), commitValue = useCallback((nextValue, notify = "change") => {
|
|
48
|
+
const el = ref.current;
|
|
49
|
+
if (!el) return;
|
|
50
|
+
const sliderWidth = el.getBoundingClientRect().width, clampedValue = clampValue(nextValue), percent = valueToPercent(clampedValue);
|
|
51
|
+
absProgressRef.current = clampedValue, relativeProgressRef.current = percent, setCurrentValue(clampedValue),
|
|
52
|
+
setTrackAndHead(percent * sliderWidth), "change" !== notify && "both" !== notify || onChange(clampedValue, percent),
|
|
53
|
+
"drag" !== notify && "both" !== notify || onDragChange(clampedValue, percent);
|
|
54
|
+
}, [ clampValue, valueToPercent, setTrackAndHead, onChange, onDragChange ]), updateSlider = useCallback(e => {
|
|
60
55
|
const newPos = pointerPosition(e), el = null == ref ? void 0 : ref.current;
|
|
61
56
|
if (!el) return 0;
|
|
62
|
-
const rect = el.getBoundingClientRect(), sliderWidth =
|
|
57
|
+
const rect = el.getBoundingClientRect(), sliderWidth = rect.width;
|
|
63
58
|
let pos = newPos - rect.x;
|
|
64
59
|
return pos > sliderWidth ? pos = sliderWidth : pos < 0 && (pos = 0), setTrackAndHead(pos),
|
|
65
60
|
pos;
|
|
@@ -78,7 +73,39 @@ const Slider = React.memo(props => {
|
|
|
78
73
|
}
|
|
79
74
|
globalThis.removeEventListener("mousemove", handleMouseMove, !1), globalThis.removeEventListener("touchmove", handleMouseMove, !1),
|
|
80
75
|
globalThis.removeEventListener("mouseup", handleMouseUp, !1), globalThis.removeEventListener("touchend", handleMouseUp, !1);
|
|
81
|
-
}, [ handleMouseMove, progress, updateSlider, debouncedOnChange, onDragChange, onChange ]),
|
|
76
|
+
}, [ handleMouseMove, progress, updateSlider, debouncedOnChange, onDragChange, onChange ]), handleKeyDown = useCallback(event => {
|
|
77
|
+
const range = scaleMax - scaleMin;
|
|
78
|
+
if (range <= 0) return;
|
|
79
|
+
const step = Number.isInteger(scaleMin) && Number.isInteger(scaleMax) ? 1 : Math.max(range / 100, .01), pageStep = Math.max(step, range / 10);
|
|
80
|
+
let nextValue = null;
|
|
81
|
+
switch (event.key) {
|
|
82
|
+
case "ArrowRight":
|
|
83
|
+
case "ArrowUp":
|
|
84
|
+
nextValue = absProgressRef.current + step;
|
|
85
|
+
break;
|
|
86
|
+
|
|
87
|
+
case "ArrowLeft":
|
|
88
|
+
case "ArrowDown":
|
|
89
|
+
nextValue = absProgressRef.current - step;
|
|
90
|
+
break;
|
|
91
|
+
|
|
92
|
+
case "PageUp":
|
|
93
|
+
nextValue = absProgressRef.current + pageStep;
|
|
94
|
+
break;
|
|
95
|
+
|
|
96
|
+
case "PageDown":
|
|
97
|
+
nextValue = absProgressRef.current - pageStep;
|
|
98
|
+
break;
|
|
99
|
+
|
|
100
|
+
case "Home":
|
|
101
|
+
nextValue = scaleMin;
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case "End":
|
|
105
|
+
nextValue = scaleMax;
|
|
106
|
+
}
|
|
107
|
+
null !== nextValue && (event.preventDefault(), debouncedOnChange.cancel(), commitValue(nextValue, "change"));
|
|
108
|
+
}, [ scaleMin, scaleMax, debouncedOnChange, commitValue ]), handleMouseDown = useCallback(e => {
|
|
82
109
|
e.preventDefault(), e.stopPropagation(), globalThis.addEventListener("mousemove", handleMouseMove, !1),
|
|
83
110
|
globalThis.addEventListener("touchmove", handleMouseMove, !1), globalThis.addEventListener("mouseup", handleMouseUp, !1),
|
|
84
111
|
globalThis.addEventListener("touchend", handleMouseUp, !1);
|
|
@@ -125,6 +152,14 @@ const Slider = React.memo(props => {
|
|
|
125
152
|
children: jsxs("div", {
|
|
126
153
|
ref: ref,
|
|
127
154
|
className: css_trackWrapper,
|
|
155
|
+
role: "slider",
|
|
156
|
+
tabIndex: 0,
|
|
157
|
+
"aria-label": "Slider",
|
|
158
|
+
"aria-valuemin": scaleMin,
|
|
159
|
+
"aria-valuemax": scaleMax,
|
|
160
|
+
"aria-valuenow": currentValue,
|
|
161
|
+
"aria-orientation": "horizontal",
|
|
162
|
+
onKeyDown: handleKeyDown,
|
|
128
163
|
children: [ jsx("div", {
|
|
129
164
|
className: css_trackBg,
|
|
130
165
|
children: jsx("div", {
|
|
@@ -10,7 +10,7 @@ import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
|
10
10
|
|
|
11
11
|
var css_wrapper = "Switch-module_wrapper__kudO9 flexBox-module_row__z24tF", css_knob = "Switch-module_knob__vKNOc flexBox-module_row__z24tF";
|
|
12
12
|
|
|
13
|
-
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");
|
|
13
|
+
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");
|
|
14
14
|
|
|
15
15
|
const Switch = React.memo(props => {
|
|
16
16
|
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 = __rest(props, [ "state", "height", "width", "padding", "bgColorOn", "bgColorOff", "knobColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [on, setOn] = useState(state);
|
|
@@ -29,11 +29,14 @@ const Switch = React.memo(props => {
|
|
|
29
29
|
"--switch-knob-color": knobColor,
|
|
30
30
|
"--switch-bg-color": on ? bgColorOn : bgColorOff
|
|
31
31
|
}), [ width, height, padding, bgColorOff, bgColorOn, on, knobColor ]);
|
|
32
|
-
return jsx(motion.
|
|
32
|
+
return jsx(motion.button, Object.assign({
|
|
33
33
|
id: divId,
|
|
34
|
+
type: "button",
|
|
34
35
|
className: `${css_wrapper}${divClass}`,
|
|
35
36
|
style: Object.assign(Object.assign(Object.assign({}, divStyle), justify), cssVars),
|
|
36
|
-
onClick: handleClick
|
|
37
|
+
onClick: handleClick,
|
|
38
|
+
role: "switch",
|
|
39
|
+
"aria-checked": on
|
|
37
40
|
}, rest, {
|
|
38
41
|
children: jsx(motion.div, {
|
|
39
42
|
className: css_knob,
|
|
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-c-7TIv71.mjs";
|
|
|
2
2
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
|
-
import React, { useState, useEffect, useCallback, useMemo
|
|
5
|
+
import React, { useState, useRef, useEffect, useCallback, useMemo } from "react";
|
|
6
6
|
|
|
7
7
|
import { useTheme } from "../hooks/useTheme.mjs";
|
|
8
8
|
|
|
@@ -12,9 +12,9 @@ import "../hooks/useWindow.mjs";
|
|
|
12
12
|
|
|
13
13
|
import { B as Badge } from "./Badge-DyICxZP2.mjs";
|
|
14
14
|
|
|
15
|
-
import { I as Icon } from "./
|
|
15
|
+
import { I as Icon } from "./Icon-C92f63Ib.mjs";
|
|
16
16
|
|
|
17
|
-
import { I as IconButton } from "./IconButton-
|
|
17
|
+
import { I as IconButton } from "./IconButton-4O5S9S9G.mjs";
|
|
18
18
|
|
|
19
19
|
import { T as ToolTipType } from "./sharedTypes-tn9-uJvb.mjs";
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
|
22
22
|
|
|
23
23
|
var css_wrapper = "TabBar-module_wrapper__cyOR1 flexBox-module_rowStart__4tcxS", css_option = "TabBar-module_option__gYjDf flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_icon = "TabBar-module_icon__JDgG3 flexBox-module_row__z24tF", css_close = "TabBar-module_close__bvSBh flexBox-module_row__z24tF";
|
|
24
24
|
|
|
25
|
-
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.TabBar-module_wrapper__cyOR1 {\n\tgap: var(--tab-bar-gap);\n\tborder-bottom: var(--tab-bar-border-bottom) solid var(--core-outline-primary);\n\theight: var(--tab-bar-height);\n\twidth: var(--tab-bar-width);\n\tcursor: pointer;\n}\n\n.TabBar-module_option__gYjDf {\n\tgap: var(--tab-bar-option-gap);\n\tcolor: var(--tab-bar-option-color);\n\tpadding: var(--tab-bar-option-padding) !important;\n\theight: 100%;\n\twidth: var(--tab-bar-option-width);\n\tflex: var(--tab-bar-option-flex);\n\twhite-space: nowrap;\n\tbox-shadow: 0 var(--tab-bar-option-border) 0 0 var(--core-text-special);\n\tcursor: var(--tab-bar-option-cursor);\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.TabBar-module_icon__JDgG3 {\n\tmax-height: var(--tab-bar-icon-size);\n\tmin-height: var(--tab-bar-icon-size);\n\tmax-width: var(--tab-bar-icon-size);\n\tmin-width: var(--tab-bar-icon-size);\n}\n\n.TabBar-module_close__bvSBh {\n\theight: 100%;\n\tpadding: var(--tab-bar-close-padding) !important;\n\tborder-left: 1px solid var(--core-outline-primary);\n\twidth: min-content;\n}\n");
|
|
25
|
+
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.TabBar-module_wrapper__cyOR1 {\n\tgap: var(--tab-bar-gap);\n\tborder-bottom: var(--tab-bar-border-bottom) solid var(--core-outline-primary);\n\theight: var(--tab-bar-height);\n\twidth: var(--tab-bar-width);\n\tcursor: pointer;\n}\n\n.TabBar-module_option__gYjDf {\n\tgap: var(--tab-bar-option-gap);\n\tcolor: var(--tab-bar-option-color);\n\tpadding: var(--tab-bar-option-padding) !important;\n\theight: 100%;\n\twidth: var(--tab-bar-option-width);\n\tflex: var(--tab-bar-option-flex);\n\twhite-space: nowrap;\n\tbox-shadow: 0 var(--tab-bar-option-border) 0 0 var(--core-text-special);\n\tcursor: var(--tab-bar-option-cursor);\n\t-webkit-user-select: none;\n\tuser-select: none;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\tbackground-color: transparent;\n\tborder: 0;\n\toutline: none;\n\ttext-align: left;\n}\n\n.TabBar-module_icon__JDgG3 {\n\tmax-height: var(--tab-bar-icon-size);\n\tmin-height: var(--tab-bar-icon-size);\n\tmax-width: var(--tab-bar-icon-size);\n\tmin-width: var(--tab-bar-icon-size);\n}\n\n.TabBar-module_close__bvSBh {\n\theight: 100%;\n\tpadding: var(--tab-bar-close-padding) !important;\n\tborder-left: 1px solid var(--core-outline-primary);\n\twidth: min-content;\n}\n");
|
|
26
26
|
|
|
27
27
|
const placeholderOptions = [ {
|
|
28
28
|
name: "Option 1",
|
|
@@ -33,7 +33,7 @@ const placeholderOptions = [ {
|
|
|
33
33
|
value: "Option 2",
|
|
34
34
|
icon: "wallet"
|
|
35
35
|
} ], TabBar = React.memo(props => {
|
|
36
|
-
const {options: options = placeholderOptions, selected: selected = 0, border: border = !0, underline: underline = !0, height: height = "100%", width: width = "100%", tabWidth: tabWidth = "distribute", padding: padding = 8, iconSize: iconSize = 20, iconGap: iconGap = 8, tabGap: tabGap = 0, disabled: disabled = !1, hasClose: hasClose = !1, closeWidth: closeWidth = "auto", selectedValue: selectedValue = null, onChange: onChange = () => null, onTabChange: onTabChange = () => null, onClose: onClose = () => null, onToolTip: onToolTip = () => null} = props, divAttributes = __rest(props, [ "options", "selected", "border", "underline", "height", "width", "tabWidth", "padding", "iconSize", "iconGap", "tabGap", "disabled", "hasClose", "closeWidth", "selectedValue", "onChange", "onTabChange", "onClose", "onToolTip" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [index, setIndex] = useState(selected);
|
|
36
|
+
const {options: options = placeholderOptions, selected: selected = 0, border: border = !0, underline: underline = !0, height: height = "100%", width: width = "100%", tabWidth: tabWidth = "distribute", padding: padding = 8, iconSize: iconSize = 20, iconGap: iconGap = 8, tabGap: tabGap = 0, disabled: disabled = !1, hasClose: hasClose = !1, closeWidth: closeWidth = "auto", selectedValue: selectedValue = null, onChange: onChange = () => null, onTabChange: onTabChange = () => null, onClose: onClose = () => null, onToolTip: onToolTip = () => null} = props, divAttributes = __rest(props, [ "options", "selected", "border", "underline", "height", "width", "tabWidth", "padding", "iconSize", "iconGap", "tabGap", "disabled", "hasClose", "closeWidth", "selectedValue", "onChange", "onTabChange", "onClose", "onToolTip" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [index, setIndex] = useState(selected), optionRefs = useRef([]);
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
let selectedIndex = 0;
|
|
39
39
|
selectedValue && options ? (selectedIndex = options.findIndex(option => option.value === selectedValue),
|
|
@@ -43,7 +43,32 @@ const placeholderOptions = [ {
|
|
|
43
43
|
setIndex(i), onChange(i), onTabChange(options[i]);
|
|
44
44
|
}, [ onChange, onTabChange, options ]), handleOptionClick = useCallback(i => {
|
|
45
45
|
onToolTip(null), handleClick(i);
|
|
46
|
-
}, [ onToolTip, handleClick ]),
|
|
46
|
+
}, [ onToolTip, handleClick ]), focusOption = useCallback(nextIndex => {
|
|
47
|
+
var _a;
|
|
48
|
+
null === (_a = optionRefs.current[nextIndex]) || void 0 === _a || _a.focus();
|
|
49
|
+
}, []), handleOptionKeyDown = useCallback((event, optionIndex) => {
|
|
50
|
+
if (options.length < 1) return;
|
|
51
|
+
let nextIndex = null;
|
|
52
|
+
switch (event.key) {
|
|
53
|
+
case "ArrowRight":
|
|
54
|
+
case "ArrowDown":
|
|
55
|
+
nextIndex = (optionIndex + 1) % options.length;
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
case "ArrowLeft":
|
|
59
|
+
case "ArrowUp":
|
|
60
|
+
nextIndex = (optionIndex - 1 + options.length) % options.length;
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
case "Home":
|
|
64
|
+
nextIndex = 0;
|
|
65
|
+
break;
|
|
66
|
+
|
|
67
|
+
case "End":
|
|
68
|
+
nextIndex = options.length - 1;
|
|
69
|
+
}
|
|
70
|
+
null !== nextIndex && (event.preventDefault(), handleOptionClick(nextIndex), focusOption(nextIndex));
|
|
71
|
+
}, [ options.length, handleOptionClick, focusOption ]), renderedOptions = useMemo(() => options.map((option, i) => jsx(Option, {
|
|
47
72
|
label: option.name,
|
|
48
73
|
value: i,
|
|
49
74
|
showToolTip: option.toolTip,
|
|
@@ -55,10 +80,14 @@ const placeholderOptions = [ {
|
|
|
55
80
|
disabled: disabled,
|
|
56
81
|
count: option.count,
|
|
57
82
|
onClick: handleOptionClick,
|
|
83
|
+
onKeyDown: handleOptionKeyDown,
|
|
58
84
|
onToolTip: onToolTip,
|
|
59
85
|
underline: underline,
|
|
60
|
-
tabWidth: tabWidth
|
|
61
|
-
|
|
86
|
+
tabWidth: tabWidth,
|
|
87
|
+
buttonRef: element => {
|
|
88
|
+
optionRefs.current[i] = element;
|
|
89
|
+
}
|
|
90
|
+
}, `${i}_option_${option.name}`)), [ options, index, padding, iconSize, iconGap, disabled, underline, tabWidth, onToolTip, handleOptionClick, handleOptionKeyDown ]), setStyle = useCallback(value => "string" == typeof value ? value : `${value}px`, []), cssVars = useMemo(() => ({
|
|
62
91
|
"--tab-bar-gap": `${tabGap}px`,
|
|
63
92
|
"--tab-bar-height": `${setStyle(height)}px`,
|
|
64
93
|
"--tab-bar-width": setStyle(width),
|
|
@@ -69,7 +98,9 @@ const placeholderOptions = [ {
|
|
|
69
98
|
return jsxs("div", Object.assign({
|
|
70
99
|
id: divId,
|
|
71
100
|
className: `${css_wrapper}${divClass}`,
|
|
72
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
101
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
102
|
+
role: "tablist",
|
|
103
|
+
"aria-orientation": "horizontal"
|
|
73
104
|
}, rest, {
|
|
74
105
|
children: [ renderedOptions, hasClose && jsx("div", {
|
|
75
106
|
className: css_close,
|
|
@@ -88,7 +119,7 @@ const placeholderOptions = [ {
|
|
|
88
119
|
TabBar.displayName = "TabBar";
|
|
89
120
|
|
|
90
121
|
const Option = React.memo(props => {
|
|
91
|
-
const theme = useTheme(), {label: label = "Option", value: value = 0, icon: icon = null, selected: selected = !1, onClick: onClick = () => null, onToolTip: onToolTip = () => null, padding: padding = 8, iconSize: iconSize = 20, iconGap: iconGap = 6, disabled: disabled = !1, showToolTip: showToolTip = null, underline: underline = !0, tabWidth: tabWidth = "distribute", count: count = 0} = props, ref = useRef(null), strokeColor = useMemo(() => !disabled && selected ? theme.current.colors["core-text-special"] : disabled ? theme.current.colors["core-text-disabled"] : theme.current.colors["core-text-primary"], [ disabled, selected, theme ]), handleMouseOver = useCallback(e => {
|
|
122
|
+
const theme = useTheme(), {label: label = "Option", value: value = 0, icon: icon = null, selected: selected = !1, onClick: onClick = () => null, onToolTip: onToolTip = () => null, padding: padding = 8, iconSize: iconSize = 20, iconGap: iconGap = 6, disabled: disabled = !1, showToolTip: showToolTip = null, underline: underline = !0, tabWidth: tabWidth = "distribute", count: count = 0, onKeyDown: onKeyDown = () => null, buttonRef: buttonRef} = props, ref = useRef(null), strokeColor = useMemo(() => !disabled && selected ? theme.current.colors["core-text-special"] : disabled ? theme.current.colors["core-text-disabled"] : theme.current.colors["core-text-primary"], [ disabled, selected, theme ]), handleMouseOver = useCallback(e => {
|
|
92
123
|
if (onToolTip(null), showToolTip && ref.current) {
|
|
93
124
|
const tip = {
|
|
94
125
|
type: ToolTipType.button,
|
|
@@ -112,15 +143,20 @@ const Option = React.memo(props => {
|
|
|
112
143
|
"--tab-bar-option-width": setTabWidth,
|
|
113
144
|
"--tab-bar-option-flex": setTabFlex
|
|
114
145
|
}), [ padding, iconSize, disabled, textColor, iconGap, setTabFlex, setTabWidth, setUnderline ]);
|
|
115
|
-
return jsxs("
|
|
146
|
+
return jsxs("button", {
|
|
147
|
+
type: "button",
|
|
116
148
|
className: css_option,
|
|
117
149
|
style: cssVars,
|
|
118
|
-
ref:
|
|
150
|
+
ref: element => {
|
|
151
|
+
ref.current = element, null == buttonRef || buttonRef(element);
|
|
152
|
+
},
|
|
153
|
+
role: "tab",
|
|
119
154
|
"aria-selected": selected,
|
|
155
|
+
tabIndex: selected ? 0 : -1,
|
|
120
156
|
onMouseEnter: handleMouseOver,
|
|
121
157
|
onMouseLeave: handleMouseLeave,
|
|
122
158
|
onClick: () => onClick(value),
|
|
123
|
-
onKeyDown:
|
|
159
|
+
onKeyDown: e => onKeyDown(e, value),
|
|
124
160
|
children: [ icon && jsx("div", {
|
|
125
161
|
className: css_icon,
|
|
126
162
|
children: jsx(Icon, {
|
|
@@ -4,7 +4,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
4
4
|
|
|
5
5
|
import React, { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
6
6
|
|
|
7
|
-
import { B as Button } from "./Button-
|
|
7
|
+
import { B as Button } from "./Button-DAvVj4YV.mjs";
|
|
8
8
|
|
|
9
9
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
10
10
|
|
|
@@ -12,11 +12,11 @@ import "../theme/colors.mjs";
|
|
|
12
12
|
|
|
13
13
|
import "../hooks/useWindow.mjs";
|
|
14
14
|
|
|
15
|
-
import { B as Button } from "./Button-
|
|
15
|
+
import { B as Button } from "./Button-DAvVj4YV.mjs";
|
|
16
16
|
|
|
17
|
-
import { I as Icon } from "./
|
|
17
|
+
import { I as Icon } from "./Icon-C92f63Ib.mjs";
|
|
18
18
|
|
|
19
|
-
import { I as IconButton } from "./IconButton-
|
|
19
|
+
import { I as IconButton } from "./IconButton-4O5S9S9G.mjs";
|
|
20
20
|
|
|
21
21
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
22
22
|
|
|
@@ -26,12 +26,13 @@ var css = {
|
|
|
26
26
|
label: "TextField-module_label__jD8MR flexBox-module_rowStart__4tcxS",
|
|
27
27
|
input: "TextField-module_input__AkWBQ",
|
|
28
28
|
showPassword: "TextField-module_showPassword__4Ecfo flexBox-module_row__z24tF",
|
|
29
|
+
clearButton: "TextField-module_clearButton__O9ed3 flexBox-module_row__z24tF",
|
|
29
30
|
s: "TextField-module_s__0qm83 type-module_body-s-regular__vRHSP",
|
|
30
31
|
m: "TextField-module_m__M-tLl type-module_body-m-regular__LuQBA",
|
|
31
32
|
l: "TextField-module_l__gbNRz type-module_body-l-regular__lOYbg"
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
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.TextField-module_wrapper__qZ-p- {\n\tposition: relative;\n\tpadding: var(--tf-padding) !important;\n\tgap: 8px;\n\toverflow: visible;\n\twidth: var(--tf-width);\n\theight: var(--tf-height);\n\tborder-radius: var(--tf-border-radius);\n\tbackground: var(--tf-bg);\n\tbox-shadow: var(--tf-box-shadow);\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n}\n\n.TextField-module_container__5U9yK {\n\tflex: 1;\n\theight: 100%;\n\tgap: 8px;\n}\n\n.TextField-module_label__jD8MR {\n\tcolor: var(--tf-label-color);\n\theight: auto;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.TextField-module_input__AkWBQ {\n\tcolor: var(--tf-text-color);\n\tbackground-color: transparent;\n\tbox-sizing: border-box;\n\toutline: none;\n\tborder: 0;\n\theight: 100%;\n\twidth:
|
|
35
|
+
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.TextField-module_wrapper__qZ-p- {\n\tposition: relative;\n\tpadding: var(--tf-padding) !important;\n\tgap: 8px;\n\toverflow: visible;\n\twidth: var(--tf-width);\n\theight: var(--tf-height);\n\tborder-radius: var(--tf-border-radius);\n\tbackground: var(--tf-bg);\n\tbox-shadow: var(--tf-box-shadow);\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n}\n\n.TextField-module_container__5U9yK {\n\tflex: 1;\n\theight: 100%;\n\tgap: 8px;\n}\n\n.TextField-module_label__jD8MR {\n\tcolor: var(--tf-label-color);\n\theight: auto;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.TextField-module_input__AkWBQ {\n\tcolor: var(--tf-text-color);\n\tbackground-color: transparent;\n\tbox-sizing: border-box;\n\toutline: none;\n\tborder: 0;\n\theight: 100%;\n\twidth: var(--tf-input-width);\n\tfield-sizing: var(--tf-field-size);\n\ttext-align: var(--tf-text-align);\n\t&::placeholder {\n\t\tcolor: var(--tf-placeholder-color);\n\t}\n\t&:focus::placeholder {\n\t\tcolor: var(--tf-placeholder-color);\n\t}\n\t&:disabled {\n\t\tcolor: var(--core-text-disabled);\n\t}\n\t&:-webkit-autofill,\n\t&:-webkit-autofill:hover,\n\t&:-webkit-autofill:focus,\n\t&:-webkit-autofill:active {\n\t\tbox-shadow: 0 0 0 50px var(--core-button-disabled) inset !important;\n\t\t-webkit-text-fill-color: var(--core-text-primary);\n\t}\n}\n\n.TextField-module_showPassword__4Ecfo {\n\tmin-height: 18px;\n\tmin-width: 18px;\n\tmax-height: 18px;\n\tmax-width: 18px;\n\topacity: var(--tf-show-opacity);\n\t&:hover {\n\t\topacity: var(--tf-show-opacity-hover);\n\t}\n}\n\n.TextField-module_clearButton__O9ed3 {\n\tposition: absolute;\n\tright: 8px;\n\ttop: 50%;\n\tborder: 0;\n\ttransform: translateY(-50%);\n\tbackground: transparent;\n\tappearance: none;\n\t-webkit-appearance: none;\n\toutline: none;\n\tcursor: pointer;\n\tz-index: 1;\n}\n\n.TextField-module_s__0qm83 {\n}\n\n.TextField-module_m__M-tLl {\n}\n\n.TextField-module_l__gbNRz {\n}\n");
|
|
35
36
|
|
|
36
37
|
const MOTION_CONFIG = {
|
|
37
38
|
variants: {
|
|
@@ -51,7 +52,7 @@ const MOTION_CONFIG = {
|
|
|
51
52
|
}
|
|
52
53
|
}, TextField = React.memo(props => {
|
|
53
54
|
const theme = useTheme(), {name: name = "input_name", value: value = "", label: label = "", labelSize: labelSize = "m", textSize: textSize = "m", placeholder: placeholder = "placeholder", focused: focused = !1, onSubmit: onSubmit = () => null, onChange: onChange = () => null, onBlur: onBlur = () => null, onFocus: onFocus = () => null, onKeydown: onKeydown = () => null, onAction: onAction = () => null, onPaste: onPaste = () => null, onClear: onClear = () => null, onValidate: onValidate = () => null, actionButton: actionButton = !1, maxLength: maxLength, size: size = {
|
|
54
|
-
width: "
|
|
55
|
+
width: "auto",
|
|
55
56
|
height: "auto"
|
|
56
57
|
}, padding: padding = "8px 16px", borderRadius: borderRadius = 8, editable: editable = !0, textAlign: textAlign = "left", isValid: isValid = !0, inline: inline = !1, noShow: noShow = !1, borderType: borderType = "box", validate: validate = !0, borderColor: borderColor = {
|
|
57
58
|
focused: "var(--core-link-primary)",
|
|
@@ -117,6 +118,8 @@ const MOTION_CONFIG = {
|
|
|
117
118
|
}, [ isFocused, valid, color, validate ]), setTextAlign = useMemo(() => null != textAlign ? textAlign : "left", [ textAlign ]), setShowOpacity = useMemo(() => "password" !== inputType ? "0" : isFocused ? "1" : "0.5", [ inputType, isFocused ]), cssVars = useMemo(() => {
|
|
118
119
|
var _a;
|
|
119
120
|
return {
|
|
121
|
+
"--tf-input-width": "unset" !== size.width && "100%",
|
|
122
|
+
"--tf-field-size": "auto" === size.width ? "content" : "unset",
|
|
120
123
|
"--tf-width": setStyleValue(size.width),
|
|
121
124
|
"--tf-height": setStyleValue(size.height),
|
|
122
125
|
"--tf-padding": setStyleValue(padding),
|
|
@@ -169,7 +172,9 @@ const MOTION_CONFIG = {
|
|
|
169
172
|
maxLength: maxLength
|
|
170
173
|
}), jsx(AnimatePresence, {
|
|
171
174
|
initial: !1,
|
|
172
|
-
children: isFocused && clearButton && "" !== text && jsx(motion.
|
|
175
|
+
children: isFocused && clearButton && "" !== text && jsx(motion.button, {
|
|
176
|
+
type: "button",
|
|
177
|
+
"aria-label": "Clear text",
|
|
173
178
|
className: css.clearButton,
|
|
174
179
|
style: clearButtonStyle,
|
|
175
180
|
variants: MOTION_CONFIG.variants,
|
|
@@ -6,7 +6,7 @@ import { motion } from "motion/react";
|
|
|
6
6
|
|
|
7
7
|
import React, { useState, useRef, useEffect, useMemo } from "react";
|
|
8
8
|
|
|
9
|
-
import { f as filterClasses } from "./misc-
|
|
9
|
+
import { f as filterClasses } from "./misc-N8KLjOXc.mjs";
|
|
10
10
|
|
|
11
11
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
12
12
|
|
|
@@ -12,9 +12,9 @@ import "../theme/colors.mjs";
|
|
|
12
12
|
|
|
13
13
|
import "../hooks/useWindow.mjs";
|
|
14
14
|
|
|
15
|
-
import { s as setStyle, f as filterClasses, a as accessibleKeyDown } from "./misc-
|
|
15
|
+
import { s as setStyle, f as filterClasses, a as accessibleKeyDown } from "./misc-N8KLjOXc.mjs";
|
|
16
16
|
|
|
17
|
-
import { I as Icon } from "./
|
|
17
|
+
import { I as Icon } from "./Icon-C92f63Ib.mjs";
|
|
18
18
|
|
|
19
19
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
20
20
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
|
|
3
|
-
import React, { useState, useRef, useCallback, useMemo } from "react";
|
|
3
|
+
import React, { useState, useRef, useId, useCallback, useMemo } from "react";
|
|
4
4
|
|
|
5
|
-
import { s as setStyle, a as accessibleKeyDown } from "./misc-
|
|
5
|
+
import { s as setStyle, a as accessibleKeyDown } from "./misc-N8KLjOXc.mjs";
|
|
6
6
|
|
|
7
|
-
import { F as FileList } from "./FileList-
|
|
7
|
+
import { F as FileList } from "./FileList-BHCGzX_0.mjs";
|
|
8
8
|
|
|
9
|
-
import { I as Icon } from "./
|
|
9
|
+
import { I as Icon } from "./Icon-C92f63Ib.mjs";
|
|
10
10
|
|
|
11
|
-
import { P as ProgressIndicator } from "./ProgressIndicator-
|
|
11
|
+
import { P as ProgressIndicator } from "./ProgressIndicator-BVwQNOcV.mjs";
|
|
12
12
|
|
|
13
13
|
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
14
14
|
|
|
@@ -36,11 +36,11 @@ var FileTypes;
|
|
|
36
36
|
}(FileTypes || (FileTypes = {}));
|
|
37
37
|
|
|
38
38
|
const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
39
|
-
const {icon: icon = "upload", iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-special)", title: title = "Upload Files", width: width = "100%", height: height = "auto", message: message = "Drag and drop files here or click to upload", busyMessage: busyMessage = "Uploading in progress", iconSize: iconSize = 24, textSize: textSize = "m", border: border = 1, borderStyle: borderStyle = "dashed", borderColor: borderColor = "var(--core-outline-primary)", borderColorHover: borderColorHover = "var(--core-outline-special)", radius: radius = 8, padding: padding = 32, bgColor: bgColor = "var(--core-surface-secondary)", bgColorHover: bgColorHover = "var(--core-surface-special)", acceptedTypes: acceptedTypes = allTypes, multiple: multiple = !0, busy: busy = !1, canRemove: canRemove = !0, showProgress: showProgress = !0, files: files = [], onUpload: onUpload} = props, [hovered, setHovered] = useState(!1), inputRef = useRef(null), dragDepth = useRef(0), handleClickUpload = useCallback(() => {
|
|
39
|
+
const {icon: icon = "upload", iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-special)", title: title = "Upload Files", width: width = "100%", height: height = "auto", message: message = "Drag and drop files here or click to upload", busyMessage: busyMessage = "Uploading in progress", iconSize: iconSize = 24, textSize: textSize = "m", border: border = 1, borderStyle: borderStyle = "dashed", borderColor: borderColor = "var(--core-outline-primary)", borderColorHover: borderColorHover = "var(--core-outline-special)", radius: radius = 8, padding: padding = 32, bgColor: bgColor = "var(--core-surface-secondary)", bgColorHover: bgColorHover = "var(--core-surface-special)", acceptedTypes: acceptedTypes = allTypes, multiple: multiple = !0, busy: busy = !1, canRemove: canRemove = !0, showProgress: showProgress = !0, files: files = [], onUpload: onUpload} = props, [hovered, setHovered] = useState(!1), inputRef = useRef(null), dragDepth = useRef(0), inputId = useId(), titleId = useId(), messageId = useId(), isInteractive = !busy && files.length < 1, handleClickUpload = useCallback(() => {
|
|
40
40
|
var _a;
|
|
41
|
-
|
|
41
|
+
isInteractive && (null == inputRef ? void 0 : inputRef.current) && (inputRef.current.value = "",
|
|
42
42
|
null === (_a = inputRef.current) || void 0 === _a || _a.click());
|
|
43
|
-
}, [
|
|
43
|
+
}, [ isInteractive ]), handleFileInputChange = useCallback(e => {
|
|
44
44
|
busy || e.target.files && (null == onUpload || onUpload(Array.from(e.target.files)));
|
|
45
45
|
}, [ busy, onUpload ]), hasFilesInDrag = useCallback(e => {
|
|
46
46
|
var _a, _b;
|
|
@@ -72,11 +72,13 @@ const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
|
72
72
|
className: css.wrapper,
|
|
73
73
|
style: cssVars,
|
|
74
74
|
ref: ref,
|
|
75
|
-
role: "button",
|
|
76
|
-
"aria-label": "Click to upload files",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
role: isInteractive ? "button" : void 0,
|
|
76
|
+
"aria-label": isInteractive ? "Click to upload files" : void 0,
|
|
77
|
+
"aria-describedby": `${titleId} ${messageId}`,
|
|
78
|
+
"aria-disabled": !isInteractive,
|
|
79
|
+
tabIndex: isInteractive ? 0 : -1,
|
|
80
|
+
onClick: isInteractive ? handleClickUpload : void 0,
|
|
81
|
+
onKeyDown: isInteractive ? e => accessibleKeyDown(e, () => handleClickUpload()) : void 0,
|
|
80
82
|
onDragEnter: handleDragEnter,
|
|
81
83
|
onDragOver: e => {
|
|
82
84
|
e.preventDefault();
|
|
@@ -92,9 +94,11 @@ const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
|
92
94
|
pointer: !1
|
|
93
95
|
})
|
|
94
96
|
}), jsx("div", {
|
|
97
|
+
id: titleId,
|
|
95
98
|
className: css.title,
|
|
96
99
|
children: title
|
|
97
100
|
}), jsxs("div", {
|
|
101
|
+
id: messageId,
|
|
98
102
|
className: `${css.message} ${css[textSize]}`,
|
|
99
103
|
children: [ busy && showProgress && jsx(ProgressIndicator, {
|
|
100
104
|
show: !0,
|
|
@@ -115,6 +119,7 @@ const UploadAreaBase = React.forwardRef((props, ref) => {
|
|
|
115
119
|
canRemove: canRemove
|
|
116
120
|
})
|
|
117
121
|
}), jsx("input", {
|
|
122
|
+
id: inputId,
|
|
118
123
|
ref: inputRef,
|
|
119
124
|
type: "file",
|
|
120
125
|
hidden: !0,
|