@sberbusiness/triplex-next 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{AlertProcessSpoiler-JRcPtVtX.js → AlertProcessSpoiler-Caa0745n.js} +11 -11
- package/chunks/Card.module-BRANBAxP.js +17 -0
- package/chunks/{DropdownListItem-Be_BBAWh.js → DropdownListItem-DIIAnvmw.js} +17 -17
- package/chunks/DropdownMobile.module-BUeZuAYr.js +19 -0
- package/chunks/Footer.module-BFo05t5_.js +11 -0
- package/chunks/FormFieldInput-rV5ZVe9k.js +63 -0
- package/chunks/HeaderLayoutSidebar.module-CEqBuRNu.js +9 -0
- package/chunks/HeaderTabs.module-BEaVu2Hx.js +9 -0
- package/chunks/HeaderTitle.module-Db-1fcNm.js +9 -0
- package/chunks/{ListItemControlsButton-DWU_FtH8.js → ListItemControlsButton-Ch-5PQYH.js} +7 -7
- package/chunks/ListItemTail.module-C5-4SAqt.js +12 -0
- package/chunks/ListMasterFooter.module-Dph-_lLg.js +10 -0
- package/chunks/Overlay.module-D6LEz1jT.js +18 -0
- package/chunks/Page.module-Ct9ky9ko.js +16 -0
- package/chunks/TabsExtended.module-CmU9j8zG.js +13 -0
- package/chunks/{TabsExtendedUtils-BLpZL63j.js → TabsExtendedUtils-CkAvE1fA.js} +2 -2
- package/chunks/TooltipDesktop.module-KrPZMfQD.js +19 -0
- package/chunks/UploadZoneInput-CXjerIVV.js +33 -0
- package/chunks/{utils-Ck6y6vsC.js → utils-bbbspEnw.js} +7 -7
- package/chunks/{vendor-CF2m175I.js → vendor-D-uL_icH.js} +38 -34
- package/components/Alert/AlertContext/AlertContext.js +9 -9
- package/components/Alert/AlertProcess/AlertProcess.js +3 -3
- package/components/Alert/AlertProcess/components/AlertProcessSpoiler.js +2 -2
- package/components/Body/Body.js +8 -8
- package/components/Button/Button.js +95 -10
- package/components/Button/ButtonBase.js +1 -1
- package/components/Button/ButtonDropdown.js +184 -23
- package/components/Button/ButtonDropdownExtended.js +50 -6
- package/components/Button/ButtonIcon.js +5 -5
- package/components/Button/enums.js +5 -4
- package/components/Button/index.js +14 -12
- package/components/Card/CardAction.js +20 -20
- package/components/Card/CardStatic.js +3 -3
- package/components/Card/components/CardContent/CardContent.js +2 -2
- package/components/Card/components/CardContent/components/CardContentBody.js +2 -2
- package/components/Card/components/CardContent/components/CardContentFooter.js +2 -2
- package/components/Card/components/CardContent/components/CardContentHeader.js +2 -2
- package/components/Card/components/CardMedia.js +2 -2
- package/components/Card/utils.js +1 -1
- package/components/Checkbox/Checkbox.js +9 -9
- package/components/Checkbox/CheckboxXGroup.js +13 -13
- package/components/Checkbox/CheckboxYGroup.js +2 -2
- package/components/Col/Col.js +143 -143
- package/components/DesignTokens/DesignTokenUtils.js +2 -2
- package/components/DesignTokens/DesignTokensComponents.js +9 -7
- package/components/DesignTokens/DesignTokensComponentsThemeDark.js +15 -13
- package/components/DesignTokens/components/Button.js +27 -0
- package/components/DesignTokens/components/FormField.js +22 -4
- package/components/DesignTokens/components/Island.js +26 -0
- package/components/DesignTokens/components/index.js +17 -14
- package/components/Dropdown/Dropdown.js +22 -7
- package/components/Dropdown/desktop/DropdownDesktop.js +94 -18
- package/components/Dropdown/desktop/DropdownList.js +65 -94
- package/components/Dropdown/desktop/DropdownListItem.js +2 -2
- package/components/Dropdown/index.js +27 -25
- package/components/Dropdown/mobile/DropdownMobile.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileBody.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileClose.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileFooter.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileHeader.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileInner.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileInput.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileList.js +2 -2
- package/components/Dropdown/mobile/DropdownMobileListItem.js +2 -2
- package/components/Footer/Footer.js +3 -3
- package/components/Footer/components/FooterDescription.js +2 -2
- package/components/Footer/components/FooterDescriptionContent.js +2 -2
- package/components/Footer/components/FooterDescriptionControls.js +2 -2
- package/components/FormField/FormField.js +52 -51
- package/components/FormField/FormFieldContext.js +8 -8
- package/components/FormField/components/FormFieldClear.js +16 -15
- package/components/FormField/components/FormFieldCounter.js +4 -4
- package/components/FormField/components/FormFieldDescription.js +9 -9
- package/components/FormField/components/FormFieldInput.js +4 -3
- package/components/FormField/components/FormFieldLabel.js +32 -31
- package/components/FormField/components/FormFieldMaskedInput.js +102 -92
- package/components/FormField/components/FormFieldPostfix.js +6 -6
- package/components/FormField/components/FormFieldPrefix.js +8 -8
- package/components/FormField/components/FormFieldTarget.js +49 -0
- package/components/FormField/components/FormFieldTextarea.js +25 -24
- package/components/FormField/enums.js +3 -2
- package/components/FormField/index.js +19 -16
- package/components/FormField/types.js +2 -0
- package/components/Header/Header.js +10 -10
- package/components/Header/components/HeaderLayoutSidebar/HeaderLayoutSidebar.js +2 -2
- package/components/Header/components/HeaderLayoutSidebar/HeaderLayoutSidebarContent.js +2 -2
- package/components/Header/components/HeaderLayoutSidebar/HeaderLayoutSidebarSidebar.js +2 -2
- package/components/Header/components/HeaderSubheader/HeaderSubheader.js +6 -6
- package/components/Header/components/HeaderTabs/HeaderTabs.js +2 -2
- package/components/Header/components/HeaderTabs/HeaderTabsContent.js +2 -2
- package/components/Header/components/HeaderTabs/HeaderTabsControls.js +2 -2
- package/components/Header/components/HeaderTitle/HeaderTitle.js +2 -2
- package/components/Header/components/HeaderTitle/HeaderTitleContent.js +2 -2
- package/components/Header/components/HeaderTitle/HeaderTitleControls.js +2 -2
- package/components/Island/Island.js +78 -0
- package/components/Island/components/IslandBody.js +10 -0
- package/components/Island/components/IslandFooter.js +10 -0
- package/components/Island/components/IslandHeader.js +10 -0
- package/components/Island/enums.js +7 -0
- package/components/Island/index.js +9 -0
- package/components/KeyDownListener/ComposedKeyDownListener.js +13 -0
- package/components/KeyDownListener/KeyDownListener.js +27 -0
- package/components/KeyDownListener/index.js +7 -0
- package/components/Link/Link.js +17 -17
- package/components/List/List.js +9 -9
- package/components/List/ListSortable.js +1 -1
- package/components/List/components/ListEmptyState.js +2 -2
- package/components/List/components/ListItem.js +1 -1
- package/components/List/components/ListItemContent.js +7 -7
- package/components/List/components/ListItemControls.js +8 -8
- package/components/List/components/ListItemControlsButton.js +2 -2
- package/components/List/components/ListItemControlsButtonDropdown.js +98 -15
- package/components/List/components/ListItemLoading.js +5 -5
- package/components/List/components/ListItemSelectable.js +6 -6
- package/components/List/components/ListItemTable.js +29 -19
- package/components/List/components/ListItemTailLeft.js +2 -2
- package/components/List/components/ListItemTailRight.js +2 -2
- package/components/List/components/ListSortableItem.js +37 -18
- package/components/List/components/ListSortableItemControls.js +2 -2
- package/components/List/components/ListSortableItemTarget.js +9 -9
- package/components/List/index.js +22 -20
- package/components/ListMaster/ListMaster.js +1 -1
- package/components/ListMaster/components/ListMasterBody.js +1 -1
- package/components/ListMaster/components/ListMasterChipGroup.js +6 -6
- package/components/ListMaster/components/ListMasterFooter.js +2 -2
- package/components/ListMaster/components/ListMasterFooterControls.js +2 -2
- package/components/ListMaster/components/ListMasterFooterDescription.js +2 -2
- package/components/ListMaster/components/ListMasterHeader.js +11 -11
- package/components/ListMaster/components/SelectionControls.js +3 -3
- package/components/Loader/LoaderMiddle/LoaderMiddle.js +2 -2
- package/components/Loader/LoaderSmall/LoaderSmall.js +10 -10
- package/components/LoaderWidget/LoaderWidget.js +5 -5
- package/components/Overlay/Overlay.js +2 -2
- package/components/Overlay/OverlayMask.js +2 -2
- package/components/Overlay/OverlayPanel.js +2 -2
- package/components/Page/Page.js +2 -2
- package/components/Page/components/BodyPage.js +2 -2
- package/components/Page/components/FooterPage.js +2 -2
- package/components/Page/components/HeaderPage.js +2 -2
- package/components/Pagination/components/PaginationExtended.js +3 -3
- package/components/Pagination/components/PaginationNavigationButton.js +5 -5
- package/components/Pagination/components/PaginationNavigationExtended.js +2 -2
- package/components/Pagination/components/PaginationPageButton.js +2 -2
- package/components/Pagination/components/PaginationPageEllipsis.js +2 -2
- package/components/Pagination/components/PaginationSelect.js +17 -17
- package/components/Pagination/utils/paginationUtils.js +10 -10
- package/components/Radio/Radio.js +3 -3
- package/components/Radio/RadioXGroup.js +12 -12
- package/components/Radio/RadioYGroup.js +7 -7
- package/components/Row/Row.js +6 -6
- package/components/SegmentedControl/SegmentedControl.js +64 -7
- package/components/SegmentedControl/SegmentedControlContext.js +13 -0
- package/components/SegmentedControl/SegmentedControlSegment.js +68 -8
- package/components/SegmentedControl/index.js +6 -6
- package/components/SelectExtendedField/SelectExtendedField.js +57 -0
- package/components/SelectExtendedField/components/SelectExtendedFieldDropdown.js +25 -0
- package/components/SelectExtendedField/components/SelectExtendedFieldDropdownDefault.js +86 -0
- package/components/SelectExtendedField/components/SelectExtendedFieldTarget.js +101 -0
- package/components/SelectExtendedField/index.js +9 -0
- package/components/Skeleton/Skeleton.js +8 -8
- package/components/SwipeableArea/SwipeableArea.js +19 -19
- package/components/TabsExtended/TabsExtended.js +7 -7
- package/components/TabsExtended/TabsExtendedUtils.js +1 -1
- package/components/TabsExtended/components/TabsExtendedContent.js +11 -11
- package/components/TabsExtended/components/TabsExtendedDropdownWrapper.js +2 -2
- package/components/TabsExtended/components/TabsExtendedTab.js +2 -2
- package/components/TabsExtended/components/TabsExtendedTabButton.js +2 -2
- package/components/TabsExtended/components/TabsExtendedTabsWrapper.js +7 -7
- package/components/TabsExtended/types.js +2 -0
- package/components/TextField/MaskedField.js +6 -89
- package/components/TextField/TextField.js +6 -89
- package/components/TextField/TextFieldBase.js +30 -89
- package/components/TextField/index.js +4 -3
- package/components/ThemeProvider/ThemeProvider.js +8 -8
- package/components/ThemeProvider/components/ThemeProviderView.js +8 -8
- package/components/Tooltip/components/common/TooltipBody.js +7 -7
- package/components/Tooltip/components/common/TooltipLink.js +14 -14
- package/components/Tooltip/components/common/TooltipXButton.js +1 -1
- package/components/Tooltip/components/desktop/components/TooltipDesktopBase.js +2 -2
- package/components/Tooltip/components/desktop/components/TooltipDesktopTip.js +2 -2
- package/components/Tooltip/components/mobile/TooltipMobile.js +9 -9
- package/components/Typography/Caption.js +12 -12
- package/components/Typography/Text.js +22 -22
- package/components/Typography/Title.js +18 -18
- package/components/Typography/utils.js +1 -1
- package/components/UploadZone/UploadZone.js +109 -7
- package/components/UploadZone/UploadZoneContext.js +11 -0
- package/components/UploadZone/components/UploadZoneInput.js +5 -140
- package/components/UploadZone/index.js +2 -3
- package/components/UploadZone/types.js +2 -0
- package/components/index.js +279 -248
- package/index.d.ts +212 -27
- package/index.js +277 -246
- package/package.json +13 -1
- package/styles/triplex-next.css +354 -333
- package/chunks/Card.module-Cr47sRot.js +0 -17
- package/chunks/DropdownMobile.module-PWShExJh.js +0 -19
- package/chunks/Footer.module-Gh9uBYjc.js +0 -11
- package/chunks/FormFieldInput-H-fZrt84.js +0 -62
- package/chunks/HeaderLayoutSidebar.module-MHb8aSSn.js +0 -9
- package/chunks/HeaderTabs.module-Bfiwon3k.js +0 -9
- package/chunks/HeaderTitle.module-xLu0Kmjc.js +0 -9
- package/chunks/ListItemTail.module-DZnDKE1u.js +0 -12
- package/chunks/ListMasterFooter.module-DVmdCqc9.js +0 -10
- package/chunks/Overlay.module-C1GsZR5Z.js +0 -18
- package/chunks/Page.module-kOw5fybr.js +0 -16
- package/chunks/TabsExtended.module-lHzNgwBX.js +0 -13
- package/chunks/TooltipDesktop.module-HNPcWO41.js +0 -19
- package/chunks/index-CgNJLkzr.js +0 -931
|
@@ -5,12 +5,12 @@ import { alertTypeToClassNameMap as m } from "../AlertTypeUtils.js";
|
|
|
5
5
|
import { Text as y } from "../../Typography/Text.js";
|
|
6
6
|
import { EFontType as r, ETextSize as f } from "../../Typography/enums.js";
|
|
7
7
|
import { SystemStrokeStsIcon16 as I, ErrorStrokeStsIcon16 as S, WarningStrokeStsIcon16 as i, InfoStrokeStsIcon16 as R } from "@sberbusiness/icons-next";
|
|
8
|
-
import { c as N } from "../../../chunks/vendor-
|
|
9
|
-
const _ = "
|
|
8
|
+
import { c as N } from "../../../chunks/vendor-D-uL_icH.js";
|
|
9
|
+
const _ = "alertContext__c6b14ba5", d = "alertContextText__ffe826e1", E = "alertTypeError__68fefbb8", C = "alertTypeInfo__10294097", u = "alertTypeWarning__82d4628a", A = "alertTypeSystem__99bcd9dc", n = {
|
|
10
10
|
alertContext: _,
|
|
11
|
-
alertContextText:
|
|
12
|
-
alertTypeError:
|
|
13
|
-
alertTypeInfo:
|
|
11
|
+
alertContextText: d,
|
|
12
|
+
alertTypeError: E,
|
|
13
|
+
alertTypeInfo: C,
|
|
14
14
|
alertTypeWarning: u,
|
|
15
15
|
alertTypeSystem: A
|
|
16
16
|
}, O = (o) => {
|
|
@@ -29,14 +29,14 @@ const _ = "alertContext__ce8127bf", E = "alertContextText__71a34e05", C = "alert
|
|
|
29
29
|
[e.WARNING]: r.WARNING,
|
|
30
30
|
[e.ERROR]: r.ERROR,
|
|
31
31
|
[e.SYSTEM]: r.SECONDARY
|
|
32
|
-
},
|
|
32
|
+
}, b = x.forwardRef(
|
|
33
33
|
({ children: o, className: l, type: a, renderIcon: s, ...p }, c) => /* @__PURE__ */ T(
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
36
|
role: "alert",
|
|
37
37
|
className: N(n.alertContext, m[a](n), l),
|
|
38
38
|
...p,
|
|
39
|
-
"data-tx": "1.
|
|
39
|
+
"data-tx": "1.1.1",
|
|
40
40
|
ref: c,
|
|
41
41
|
children: [
|
|
42
42
|
s || O(a),
|
|
@@ -45,8 +45,8 @@ const _ = "alertContext__ce8127bf", E = "alertContextText__71a34e05", C = "alert
|
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
);
|
|
48
|
-
|
|
48
|
+
b.displayName = "AlertContext";
|
|
49
49
|
export {
|
|
50
|
-
|
|
50
|
+
b as AlertContext
|
|
51
51
|
};
|
|
52
52
|
//# sourceMappingURL=AlertContext.js.map
|
|
@@ -3,10 +3,10 @@ import P, { useState as n } from "react";
|
|
|
3
3
|
import { EAlertType as t } from "../EAlertType.js";
|
|
4
4
|
import { alertTypeToClassNameMap as k } from "../AlertTypeUtils.js";
|
|
5
5
|
import { ButtonIcon as v } from "../../Button/ButtonIcon.js";
|
|
6
|
-
import { s as r, A as i } from "../../../chunks/AlertProcessSpoiler-
|
|
6
|
+
import { s as r, A as i } from "../../../chunks/AlertProcessSpoiler-Caa0745n.js";
|
|
7
7
|
import { AlertProcessContext as R } from "./AlertProcessContext.js";
|
|
8
8
|
import { CrossStrokeSrvIcon16 as E, DefaulticonStrokePrdIcon20 as T, SystemStrokeStsIcon20 as y, ErrorStrokeStsIcon20 as j, WarningStrokeStsIcon20 as w, InfoStrokeStsIcon20 as B } from "@sberbusiness/icons-next";
|
|
9
|
-
import { c as C } from "../../../chunks/vendor-
|
|
9
|
+
import { c as C } from "../../../chunks/vendor-D-uL_icH.js";
|
|
10
10
|
const O = (o) => {
|
|
11
11
|
switch (o) {
|
|
12
12
|
case t.INFO:
|
|
@@ -38,7 +38,7 @@ const O = (o) => {
|
|
|
38
38
|
d
|
|
39
39
|
),
|
|
40
40
|
...f,
|
|
41
|
-
"data-tx": "1.
|
|
41
|
+
"data-tx": "1.1.1",
|
|
42
42
|
ref: u,
|
|
43
43
|
children: [
|
|
44
44
|
/* @__PURE__ */ e("div", { className: r.themeIcon, children: l || O(a) }),
|
|
@@ -3,8 +3,8 @@ import "react";
|
|
|
3
3
|
import "@sberbusiness/icons-next";
|
|
4
4
|
import "../../../Button/ButtonIcon.js";
|
|
5
5
|
import "../AlertProcessContext.js";
|
|
6
|
-
import { A as l } from "../../../../chunks/AlertProcessSpoiler-
|
|
7
|
-
import "../../../../chunks/vendor-
|
|
6
|
+
import { A as l } from "../../../../chunks/AlertProcessSpoiler-Caa0745n.js";
|
|
7
|
+
import "../../../../chunks/vendor-D-uL_icH.js";
|
|
8
8
|
export {
|
|
9
9
|
l as AlertProcessSpoiler
|
|
10
10
|
};
|
package/components/Body/Body.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
body:
|
|
6
|
-
bodyInner:
|
|
7
|
-
},
|
|
8
|
-
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { c as t } from "../../chunks/vendor-D-uL_icH.js";
|
|
4
|
+
const y = "body__79f29b7d", b = "bodyInner__d4a9b66a", d = {
|
|
5
|
+
body: y,
|
|
6
|
+
bodyInner: b
|
|
7
|
+
}, c = n.forwardRef(({ children: a, className: r, ...s }, e) => /* @__PURE__ */ o("div", { className: t(d.body, r), ...s, "data-tx": "1.1.1", ref: e, children: /* @__PURE__ */ o("div", { className: d.bodyInner, children: a }) }));
|
|
8
|
+
c.displayName = "Body";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
c as Body
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=Body.js.map
|
|
@@ -1,14 +1,99 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../chunks/vendor-
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import "./ButtonIcon.js";
|
|
7
|
-
import "./enums.js";
|
|
8
|
-
import "../Loader/LoaderSmall/LoaderSmall.js";
|
|
9
|
-
import "../Loader/LoaderSmall/enum.js";
|
|
1
|
+
import { jsxs as g, jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import R from "react";
|
|
3
|
+
import { c as f } from "../../chunks/vendor-D-uL_icH.js";
|
|
4
|
+
import { LoaderSmall as B } from "../Loader/LoaderSmall/LoaderSmall.js";
|
|
5
|
+
import { ELoaderSmallTheme as p, ELoaderSmallSize as r } from "../Loader/LoaderSmall/enum.js";
|
|
10
6
|
import "../Loader/LoaderMiddle/LoaderMiddle.js";
|
|
7
|
+
import { ButtonBase as D } from "./ButtonBase.js";
|
|
8
|
+
import { EButtonSize as d, EButtonTheme as o } from "./enums.js";
|
|
9
|
+
const A = "general__f6fa65f1", C = "expanded__5bfd58e9", b = {
|
|
10
|
+
general: A,
|
|
11
|
+
expanded: C
|
|
12
|
+
}, G = "secondary__78f546e3", T = "expanded__5bfd58e9", h = {
|
|
13
|
+
secondary: G,
|
|
14
|
+
expanded: T
|
|
15
|
+
}, M = "secondaryLight__bc7474d0", z = "expanded__5bfd58e9", x = {
|
|
16
|
+
secondaryLight: M,
|
|
17
|
+
expanded: z
|
|
18
|
+
}, I = "danger__0f36bca7", v = "expanded__5bfd58e9", S = {
|
|
19
|
+
danger: I,
|
|
20
|
+
expanded: v
|
|
21
|
+
}, O = "link__26318cd4", y = {
|
|
22
|
+
link: O
|
|
23
|
+
}, Y = "button__e183baaa", w = "sm__8d96d661", $ = "icon__3af77085", j = "md__a40742ce", H = "lg__10a6065a", K = "block__112deaa7", U = "content__484fff48", q = "loading__80bffa80", F = "loader__2bbe5d60", J = "hidden__8ef1dd26", n = {
|
|
24
|
+
button: Y,
|
|
25
|
+
sm: w,
|
|
26
|
+
icon: $,
|
|
27
|
+
md: j,
|
|
28
|
+
lg: H,
|
|
29
|
+
block: K,
|
|
30
|
+
content: U,
|
|
31
|
+
loading: q,
|
|
32
|
+
loader: F,
|
|
33
|
+
hidden: J
|
|
34
|
+
}, P = (t, e) => {
|
|
35
|
+
switch (t) {
|
|
36
|
+
case o.GENERAL:
|
|
37
|
+
return { [b.general]: !0, [b.expanded]: e };
|
|
38
|
+
case o.SECONDARY:
|
|
39
|
+
return {
|
|
40
|
+
[h.secondary]: !0,
|
|
41
|
+
[h.expanded]: e
|
|
42
|
+
};
|
|
43
|
+
case o.SECONDARY_LIGHT:
|
|
44
|
+
return {
|
|
45
|
+
[x.secondaryLight]: !0,
|
|
46
|
+
[x.expanded]: e
|
|
47
|
+
};
|
|
48
|
+
case o.DANGER:
|
|
49
|
+
return {
|
|
50
|
+
[S.danger]: !0,
|
|
51
|
+
[S.expanded]: e
|
|
52
|
+
};
|
|
53
|
+
case o.LINK:
|
|
54
|
+
return {
|
|
55
|
+
[y.link]: !0,
|
|
56
|
+
[y.expanded]: e
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}, Q = (t) => {
|
|
60
|
+
switch (t) {
|
|
61
|
+
case d.LG:
|
|
62
|
+
return n.lg;
|
|
63
|
+
case d.MD:
|
|
64
|
+
return n.md;
|
|
65
|
+
case d.SM:
|
|
66
|
+
return n.sm;
|
|
67
|
+
}
|
|
68
|
+
}, V = (t, e) => {
|
|
69
|
+
const a = [o.SECONDARY, o.SECONDARY_LIGHT].includes(t) ? p.BRAND : p.NEUTRAL, s = e === d.SM ? r.SM : e === d.LG ? r.LG : r.MD;
|
|
70
|
+
return /* @__PURE__ */ L(B, { theme: a, size: s });
|
|
71
|
+
}, W = R.forwardRef((t, e) => {
|
|
72
|
+
const { children: a, className: s, disabled: l, theme: i, size: _ = d.MD, block: N, loading: c, icon: m, ...E } = t, { "aria-expanded": u } = t, k = f(
|
|
73
|
+
n.button,
|
|
74
|
+
P(i, !!u),
|
|
75
|
+
Q(_),
|
|
76
|
+
{ [n.block]: !!N, [n.loading]: !!c },
|
|
77
|
+
{ [n.icon]: !!m && !a },
|
|
78
|
+
// Классы для иконок, начало.
|
|
79
|
+
"hoverable",
|
|
80
|
+
{
|
|
81
|
+
active: !!u,
|
|
82
|
+
disabled: !!l
|
|
83
|
+
},
|
|
84
|
+
// Классы для иконок, конец.
|
|
85
|
+
s
|
|
86
|
+
);
|
|
87
|
+
return /* @__PURE__ */ g(D, { className: k, tabIndex: c ? -1 : void 0, disabled: l, ...E, ref: e, children: [
|
|
88
|
+
/* @__PURE__ */ g("span", { className: n.content, children: [
|
|
89
|
+
m,
|
|
90
|
+
a
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ L("div", { className: f(n.loader, !c && n.hidden), children: V(i, _) })
|
|
93
|
+
] });
|
|
94
|
+
});
|
|
95
|
+
W.displayName = "Button";
|
|
11
96
|
export {
|
|
12
|
-
|
|
97
|
+
W as Button
|
|
13
98
|
};
|
|
14
99
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import e from "react";
|
|
3
|
-
const r = e.forwardRef((t, o) => /* @__PURE__ */ a("button", { type: "button", ...t, "data-tx": "1.
|
|
3
|
+
const r = e.forwardRef((t, o) => /* @__PURE__ */ a("button", { type: "button", ...t, "data-tx": "1.1.1", ref: o }));
|
|
4
4
|
r.displayName = "ButtonBase";
|
|
5
5
|
export {
|
|
6
6
|
r as ButtonBase
|
|
@@ -1,26 +1,187 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "../../
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "../Dropdown/
|
|
12
|
-
import "../Dropdown/mobile/DropdownMobileHeader.js";
|
|
13
|
-
import "../Dropdown/mobile/
|
|
14
|
-
import "../Dropdown/mobile/
|
|
15
|
-
import "../Dropdown/mobile/
|
|
16
|
-
import "../Dropdown/mobile/
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
|
|
1
|
+
import { Button as B } from "./Button.js";
|
|
2
|
+
import "./ButtonBase.js";
|
|
3
|
+
import "./ButtonIcon.js";
|
|
4
|
+
import { jsx as r, jsxs as I, Fragment as F } from "react/jsx-runtime";
|
|
5
|
+
import V, { useRef as E, useState as J, createElement as y } from "react";
|
|
6
|
+
import { c as b, f as Q } from "../../chunks/vendor-D-uL_icH.js";
|
|
7
|
+
import { ButtonDropdownExtended as z } from "./ButtonDropdownExtended.js";
|
|
8
|
+
import { EButtonDotsTheme as m, EButtonTheme as i, EButtonSize as d } from "./enums.js";
|
|
9
|
+
import { DotshorizontalStrokeSrvIcon24 as X, CaretdownStrokeSrvIcon24 as g } from "@sberbusiness/icons-next";
|
|
10
|
+
import { isKey as D } from "../../utils/keyboard.js";
|
|
11
|
+
import { DropdownListContext as Z } from "../Dropdown/DropdownListContext.js";
|
|
12
|
+
import { DropdownMobileHeader as $ } from "../Dropdown/mobile/DropdownMobileHeader.js";
|
|
13
|
+
import { DropdownMobileBody as ee } from "../Dropdown/mobile/DropdownMobileBody.js";
|
|
14
|
+
import { DropdownMobileList as te } from "../Dropdown/mobile/DropdownMobileList.js";
|
|
15
|
+
import { DropdownMobileListItem as oe } from "../Dropdown/mobile/DropdownMobileListItem.js";
|
|
16
|
+
import { DropdownMobileClose as re } from "../Dropdown/mobile/DropdownMobileClose.js";
|
|
17
|
+
import { Text as ne } from "../Typography/Text.js";
|
|
18
|
+
import { ETextSize as ae } from "../Typography/enums.js";
|
|
19
|
+
import { DropdownList as G } from "../Dropdown/desktop/DropdownList.js";
|
|
20
|
+
import { EDropdownSize as S, EDropdownListSize as N } from "../Dropdown/enums.js";
|
|
21
|
+
const ce = "buttonDropdown__387a7658", se = "block__112deaa7", ie = "buttonDropdownTarget__ea5f127b", de = "caretIcon__d3e21d5a", le = "active__a1aa8d91", ue = "buttonDropdownMenuItem__630ff682", n = {
|
|
22
|
+
buttonDropdown: ce,
|
|
23
|
+
block: se,
|
|
24
|
+
buttonDropdownTarget: ie,
|
|
25
|
+
caretIcon: de,
|
|
26
|
+
active: le,
|
|
27
|
+
buttonDropdownMenuItem: ue
|
|
28
|
+
}, me = (l) => {
|
|
29
|
+
switch (l) {
|
|
30
|
+
case d.SM:
|
|
31
|
+
return S.SM;
|
|
32
|
+
case d.MD:
|
|
33
|
+
return S.MD;
|
|
34
|
+
case d.LG:
|
|
35
|
+
return S.LG;
|
|
36
|
+
default:
|
|
37
|
+
return S.MD;
|
|
38
|
+
}
|
|
39
|
+
}, De = (l) => {
|
|
40
|
+
switch (l) {
|
|
41
|
+
case d.SM:
|
|
42
|
+
return N.SM;
|
|
43
|
+
case d.MD:
|
|
44
|
+
return N.MD;
|
|
45
|
+
case d.LG:
|
|
46
|
+
return N.LG;
|
|
47
|
+
default:
|
|
48
|
+
return N.MD;
|
|
49
|
+
}
|
|
50
|
+
}, pe = V.forwardRef(
|
|
51
|
+
(l, p) => {
|
|
52
|
+
const { buttonAttributes: M, children: T, className: Y, theme: f, size: w, options: A, selected: s, block: _, disabled: C, ...W } = l, O = E(null), k = E(null), H = b(n.buttonDropdown, { [n.block]: !!_ }, Y), [R, P] = J(), h = E(Q()), K = ({ opened: e, setOpened: o }) => {
|
|
53
|
+
const a = b(n.buttonDropdownTarget, "hoverable", {
|
|
54
|
+
[n.active]: e,
|
|
55
|
+
[n.block]: !!_
|
|
56
|
+
});
|
|
57
|
+
return /* @__PURE__ */ I(
|
|
58
|
+
B,
|
|
59
|
+
{
|
|
60
|
+
className: a,
|
|
61
|
+
theme: f,
|
|
62
|
+
size: w,
|
|
63
|
+
onKeyDown: L({ opened: e, setOpened: o }),
|
|
64
|
+
onClick: v({ opened: e, setOpened: o }),
|
|
65
|
+
disabled: C,
|
|
66
|
+
"aria-haspopup": "menu",
|
|
67
|
+
"aria-expanded": e,
|
|
68
|
+
"aria-controls": h.current,
|
|
69
|
+
"aria-activedescendant": R,
|
|
70
|
+
...M,
|
|
71
|
+
ref: x,
|
|
72
|
+
children: [
|
|
73
|
+
T,
|
|
74
|
+
U()
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}, j = ({ opened: e, setOpened: o }) => {
|
|
79
|
+
const a = b(n.buttonDropdownTarget, "hoverable", {
|
|
80
|
+
[n.active]: e,
|
|
81
|
+
[n.block]: !!_
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ r(
|
|
84
|
+
B,
|
|
85
|
+
{
|
|
86
|
+
className: a,
|
|
87
|
+
theme: f === m.DOTS_SECONDARY ? i.SECONDARY : i.SECONDARY_LIGHT,
|
|
88
|
+
size: w,
|
|
89
|
+
onKeyDown: L({ opened: e, setOpened: o }),
|
|
90
|
+
onClick: v({ opened: e, setOpened: o }),
|
|
91
|
+
disabled: C,
|
|
92
|
+
"aria-haspopup": "menu",
|
|
93
|
+
"aria-expanded": e,
|
|
94
|
+
"aria-controls": h.current,
|
|
95
|
+
"aria-activedescendant": R,
|
|
96
|
+
...M,
|
|
97
|
+
ref: x,
|
|
98
|
+
icon: /* @__PURE__ */ r(X, { paletteIndex: 0 })
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}, v = ({ opened: e, setOpened: o }) => () => o(!e), L = ({ opened: e, setOpened: o }) => (a) => {
|
|
102
|
+
const { key: c } = a;
|
|
103
|
+
(D(c, "SPACE") || D(c, "ARROW_UP") || D(c, "ARROW_DOWN")) && a.preventDefault(), !e && (D(c, "ARROW_UP") || D(c, "ARROW_DOWN")) && o(!0);
|
|
104
|
+
}, U = () => {
|
|
105
|
+
switch (f) {
|
|
106
|
+
case i.GENERAL:
|
|
107
|
+
case i.DANGER:
|
|
108
|
+
case m.DOTS_SECONDARY:
|
|
109
|
+
case m.DOTS_SECONDARY_LIGHT:
|
|
110
|
+
return /* @__PURE__ */ r(g, { paletteIndex: 7, className: n.caretIcon });
|
|
111
|
+
case i.SECONDARY:
|
|
112
|
+
case i.SECONDARY_LIGHT:
|
|
113
|
+
return /* @__PURE__ */ r(g, { paletteIndex: 0, className: n.caretIcon });
|
|
114
|
+
default:
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}, q = ({ opened: e, setOpened: o, className: a }) => {
|
|
118
|
+
const c = b(n.buttonDropdownMenu, a);
|
|
119
|
+
return /* @__PURE__ */ r(Z.Provider, { value: { activeDescendant: R, setActiveDescendant: P }, children: /* @__PURE__ */ r(
|
|
120
|
+
z.Dropdown,
|
|
121
|
+
{
|
|
122
|
+
size: me(w),
|
|
123
|
+
className: c,
|
|
124
|
+
opened: e,
|
|
125
|
+
setOpened: o,
|
|
126
|
+
targetRef: O,
|
|
127
|
+
ref: k,
|
|
128
|
+
mobileViewProps: {
|
|
129
|
+
children: /* @__PURE__ */ I(F, { children: [
|
|
130
|
+
/* @__PURE__ */ I($, { children: [
|
|
131
|
+
/* @__PURE__ */ r(ne, { tag: "div", size: ae.B3, children: T }),
|
|
132
|
+
/* @__PURE__ */ r(re, { onClick: () => o(!1) })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(te, { children: A.map((t) => /* @__PURE__ */ y(
|
|
135
|
+
oe,
|
|
136
|
+
{
|
|
137
|
+
...t,
|
|
138
|
+
key: t.id,
|
|
139
|
+
selected: t.id === (s == null ? void 0 : s.id),
|
|
140
|
+
onSelect: () => {
|
|
141
|
+
var u;
|
|
142
|
+
(u = t.onSelect) == null || u.call(t), o(!1);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
t.label
|
|
146
|
+
)) }) })
|
|
147
|
+
] })
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ r(G, { dropdownOpened: e, id: h.current, size: De(w), children: A.map((t) => /* @__PURE__ */ y(
|
|
150
|
+
G.Item,
|
|
151
|
+
{
|
|
152
|
+
...t,
|
|
153
|
+
className: n.buttonDropdownMenuItem,
|
|
154
|
+
key: t.id,
|
|
155
|
+
selected: t.id === (s == null ? void 0 : s.id),
|
|
156
|
+
onSelect: () => {
|
|
157
|
+
var u;
|
|
158
|
+
(u = t.onSelect) == null || u.call(t), o(!1);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
t.label
|
|
162
|
+
)) })
|
|
163
|
+
}
|
|
164
|
+
) });
|
|
165
|
+
}, x = (e) => {
|
|
166
|
+
O.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
|
|
167
|
+
};
|
|
168
|
+
return /* @__PURE__ */ r(
|
|
169
|
+
z,
|
|
170
|
+
{
|
|
171
|
+
className: H,
|
|
172
|
+
renderButton: [m.DOTS_SECONDARY, m.DOTS_SECONDARY_LIGHT].includes(
|
|
173
|
+
f
|
|
174
|
+
) ? j : K,
|
|
175
|
+
renderDropdown: q,
|
|
176
|
+
dropdownRef: k,
|
|
177
|
+
closeOnTab: !0,
|
|
178
|
+
...W
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
pe.displayName = "ButtonDropdown";
|
|
22
184
|
export {
|
|
23
|
-
|
|
24
|
-
k as dotsTheme
|
|
185
|
+
pe as ButtonDropdown
|
|
25
186
|
};
|
|
26
187
|
//# sourceMappingURL=ButtonDropdown.js.map
|
|
@@ -1,9 +1,53 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import "../../utils/keyboard.js";
|
|
5
|
-
import "
|
|
1
|
+
import { jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useState as C, useCallback as N, useEffect as R } from "react";
|
|
3
|
+
import { Dropdown as _ } from "../Dropdown/Dropdown.js";
|
|
4
|
+
import { isKey as w } from "../../utils/keyboard.js";
|
|
5
|
+
import { DropdownList as g } from "../Dropdown/desktop/DropdownList.js";
|
|
6
|
+
import { c as A } from "../../chunks/vendor-D-uL_icH.js";
|
|
7
|
+
const K = "buttonDropdownExtended__be47856e", S = "buttonDropdownExtendedBlock__daefeab0", E = {
|
|
8
|
+
buttonDropdownExtended: K,
|
|
9
|
+
buttonDropdownExtendedBlock: S
|
|
10
|
+
}, D = (s) => {
|
|
11
|
+
const { className: b, opened: v, setOpened: c, renderButton: x, renderDropdown: k, dropdownRef: l, closeOnTab: p, ...L } = s, u = f(null), m = f(s.opened !== void 0), [O, y] = C((s.opened === void 0, !1)), e = m.current ? !!v : O, o = N(
|
|
12
|
+
(t) => {
|
|
13
|
+
if (m.current) {
|
|
14
|
+
c && c(t);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
y(t);
|
|
18
|
+
},
|
|
19
|
+
[c]
|
|
20
|
+
);
|
|
21
|
+
R(() => {
|
|
22
|
+
if (!e)
|
|
23
|
+
return;
|
|
24
|
+
const t = (r) => {
|
|
25
|
+
const n = r.code || r.keyCode;
|
|
26
|
+
e && (w(n, "ESCAPE") || p && w(n, "TAB")) && o(!1);
|
|
27
|
+
}, d = (r) => {
|
|
28
|
+
const n = u.current, a = l.current;
|
|
29
|
+
if (e) {
|
|
30
|
+
const i = r.target;
|
|
31
|
+
i && !(n != null && n.contains(i)) && !(a != null && a.contains(i)) && o(!1);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return document.addEventListener("keydown", t), document.addEventListener("mousedown", d), document.addEventListener("touchstart", d), () => {
|
|
35
|
+
document.removeEventListener("keydown", t), document.removeEventListener("mousedown", d), document.removeEventListener("touchstart", d);
|
|
36
|
+
};
|
|
37
|
+
}, [e, p, l, o, u]);
|
|
38
|
+
const B = A(E.buttonDropdownExtended, b);
|
|
39
|
+
return /* @__PURE__ */ h("div", { className: B, ref: u, ...L, children: [
|
|
40
|
+
x({ opened: e, setOpened: o }),
|
|
41
|
+
k({
|
|
42
|
+
className: E.buttonDropdownExtendedBlock,
|
|
43
|
+
opened: e,
|
|
44
|
+
setOpened: o
|
|
45
|
+
})
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
D.Dropdown = _;
|
|
49
|
+
D.DropdownList = g;
|
|
6
50
|
export {
|
|
7
|
-
|
|
51
|
+
D as ButtonDropdownExtended
|
|
8
52
|
};
|
|
9
53
|
//# sourceMappingURL=ButtonDropdownExtended.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { EButtonIconShape as c } from "./enums.js";
|
|
4
|
-
import { c as m } from "../../chunks/vendor-
|
|
5
|
-
const I = "
|
|
4
|
+
import { c as m } from "../../chunks/vendor-D-uL_icH.js";
|
|
5
|
+
const I = "buttonIcon__b2500017", f = "circle__9c03a9d9", p = "squircle__93fa5698", o = {
|
|
6
6
|
buttonIcon: I,
|
|
7
7
|
circle: f,
|
|
8
8
|
squircle: p
|
|
@@ -13,7 +13,7 @@ const I = "buttonIcon__fd887138", f = "circle__7d08c74a", p = "squircle__6da23d0
|
|
|
13
13
|
case c.CIRCLE:
|
|
14
14
|
return o.circle;
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, b = i.forwardRef(
|
|
17
17
|
({ className: t, disabled: e, shape: n = c.SQUIRCLE, active: s, ...r }, a) => {
|
|
18
18
|
const u = m(o.buttonIcon, _(n), "hoverable", t, {
|
|
19
19
|
active: !!s,
|
|
@@ -22,8 +22,8 @@ const I = "buttonIcon__fd887138", f = "circle__7d08c74a", p = "squircle__6da23d0
|
|
|
22
22
|
return /* @__PURE__ */ l("button", { className: u, disabled: e, ...r, ref: a });
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
b.displayName = "ButtonIcon";
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
b as ButtonIcon
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=ButtonIcon.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
var a = /* @__PURE__ */ ((r) => (r.GENERAL = "general", r.SECONDARY = "secondary", r.DANGER = "danger", r.LINK = "link", r))(
|
|
1
|
+
var a = /* @__PURE__ */ ((r) => (r.DOTS_SECONDARY = "dots_secondary", r.DOTS_SECONDARY_LIGHT = "dots_secondary_light", r))(a || {}), d = /* @__PURE__ */ ((r) => (r.GENERAL = "general", r.SECONDARY = "secondary", r.SECONDARY_LIGHT = "secondary_light", r.DANGER = "danger", r.LINK = "link", r))(d || {}), R = /* @__PURE__ */ ((r) => (r.LG = "lg", r.MD = "md", r.SM = "sm", r))(R || {}), _ = /* @__PURE__ */ ((r) => (r.SQUIRCLE = "squircle", r.CIRCLE = "circle", r))(_ || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
a as EButtonDotsTheme,
|
|
4
|
+
_ as EButtonIconShape,
|
|
5
|
+
R as EButtonSize,
|
|
6
|
+
d as EButtonTheme
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ButtonBase as
|
|
3
|
-
import { ButtonIcon as
|
|
4
|
-
import {
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { ButtonBase as r } from "./ButtonBase.js";
|
|
3
|
+
import { ButtonIcon as p } from "./ButtonIcon.js";
|
|
4
|
+
import { ButtonDropdown as m } from "./ButtonDropdown.js";
|
|
5
|
+
import { ButtonDropdownExtended as f } from "./ButtonDropdownExtended.js";
|
|
6
|
+
import { EButtonDotsTheme as d, EButtonIconShape as h, EButtonSize as D, EButtonTheme as a } from "./enums.js";
|
|
5
7
|
export {
|
|
6
8
|
e as Button,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
r as ButtonBase,
|
|
10
|
+
m as ButtonDropdown,
|
|
11
|
+
f as ButtonDropdownExtended,
|
|
12
|
+
p as ButtonIcon,
|
|
13
|
+
d as EButtonDotsTheme,
|
|
14
|
+
h as EButtonIconShape,
|
|
15
|
+
D as EButtonSize,
|
|
16
|
+
a as EButtonTheme
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=index.js.map
|