@sberbusiness/triplex-next 0.1.9 → 1.1.0
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-Dp7FRT9y.js +39 -0
- package/chunks/Card.module-Ddt7TQ9Z.js +17 -0
- package/chunks/DropdownListItem-y6Rvj_dd.js +56 -0
- package/chunks/DropdownMobile.module-DrQkghxs.js +19 -0
- package/chunks/Footer.module-CKfl241m.js +11 -0
- package/chunks/FormFieldInput-apk1b0w6.js +63 -0
- package/chunks/HeaderLayoutSidebar.module-DTXnksBK.js +9 -0
- package/chunks/HeaderTabs.module-DVh6MotJ.js +9 -0
- package/chunks/HeaderTitle.module-DOeVL9zC.js +9 -0
- package/chunks/{ListItemControlsButton-BtMEMrGK.js → ListItemControlsButton-Cn3Vmrsn.js} +8 -8
- package/chunks/ListItemTail.module-BnbT61OM.js +12 -0
- package/chunks/ListMasterFooter.module-C6QFamKQ.js +10 -0
- package/chunks/Overlay.module-BTSQ5G6t.js +18 -0
- package/chunks/Page.module-DfMBQJob.js +16 -0
- package/chunks/TabsExtended.module-okOlTNQG.js +13 -0
- package/chunks/{TabsExtendedUtils-BOHZcNx8.js → TabsExtendedUtils-NCwWiX7O.js} +6 -6
- package/chunks/TooltipDesktop.module-DTbnIWo1.js +19 -0
- package/chunks/UploadZoneInput-R9729LZY.js +33 -0
- package/chunks/utils-B0khB-Lq.js +36 -0
- package/chunks/{vendor-CF2m175I.js → vendor-D-uL_icH.js} +38 -34
- package/components/Alert/AlertContext/AlertContext.js +10 -10
- package/components/Alert/AlertProcess/AlertProcess.js +3 -3
- package/components/Alert/AlertProcess/components/AlertProcessSpoiler.js +2 -2
- package/components/Body/Body.js +6 -6
- 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 +2 -2
- package/components/Button/enums.js +5 -4
- package/components/Button/index.js +14 -12
- package/components/Card/CardAction.js +26 -26
- 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 +7 -7
- package/components/Checkbox/CheckboxXGroup.js +11 -11
- package/components/Checkbox/CheckboxYGroup.js +2 -2
- package/components/Col/Col.js +146 -146
- 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 +53 -52
- package/components/FormField/FormFieldContext.js +8 -8
- package/components/FormField/components/FormFieldClear.js +13 -12
- package/components/FormField/components/FormFieldCounter.js +5 -5
- package/components/FormField/components/FormFieldDescription.js +5 -5
- 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 +7 -7
- package/components/FormField/components/FormFieldPrefix.js +5 -5
- 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 +11 -11
- 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 +27 -27
- package/components/List/List.js +3 -3
- package/components/List/ListSortable.js +1 -1
- package/components/List/components/ListEmptyState.js +6 -6
- package/components/List/components/ListItem.js +1 -1
- package/components/List/components/ListItemContent.js +7 -7
- package/components/List/components/ListItemControls.js +7 -7
- package/components/List/components/ListItemControlsButton.js +2 -2
- package/components/List/components/ListItemControlsButtonDropdown.js +98 -15
- package/components/List/components/ListItemLoading.js +2 -2
- package/components/List/components/ListItemSelectable.js +9 -9
- 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 +6 -6
- 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 +5 -5
- 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 +7 -7
- package/components/ListMaster/components/SelectionControls.js +3 -3
- package/components/Loader/LoaderMiddle/LoaderMiddle.js +7 -7
- package/components/Loader/LoaderSmall/LoaderSmall.js +16 -16
- package/components/LoaderWidget/LoaderWidget.js +9 -9
- 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 +6 -6
- package/components/Pagination/components/PaginationNavigationExtended.js +2 -2
- package/components/Pagination/components/PaginationPageButton.js +6 -6
- package/components/Pagination/components/PaginationPageEllipsis.js +2 -2
- package/components/Pagination/components/PaginationSelect.js +12 -12
- package/components/Pagination/utils/paginationUtils.js +10 -10
- package/components/Radio/Radio.js +3 -3
- package/components/Radio/RadioXGroup.js +10 -10
- package/components/Radio/RadioYGroup.js +9 -9
- package/components/Row/Row.js +10 -10
- 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 +10 -10
- package/components/SwipeableArea/SwipeableArea.js +13 -13
- 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 +10 -10
- 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 +10 -10
- package/components/Typography/Caption.js +15 -15
- package/components/Typography/Text.js +24 -24
- package/components/Typography/Title.js +13 -13
- 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/AlertProcessSpoiler-BPbAJJFo.js +0 -39
- package/chunks/Card.module-Oqawy8hF.js +0 -17
- package/chunks/DropdownListItem-CW2MmFpw.js +0 -56
- package/chunks/DropdownMobile.module-DyunEp10.js +0 -19
- package/chunks/Footer.module-o57OEPdy.js +0 -11
- package/chunks/FormFieldInput-C2qWOLr3.js +0 -62
- package/chunks/HeaderLayoutSidebar.module-CzpXvDdH.js +0 -9
- package/chunks/HeaderTabs.module-CC0WAcoC.js +0 -9
- package/chunks/HeaderTitle.module-CH7eRK8R.js +0 -9
- package/chunks/ListItemTail.module-BBV_gvLd.js +0 -12
- package/chunks/ListMasterFooter.module-Cw1r4pz-.js +0 -10
- package/chunks/Overlay.module-08zZh8Y9.js +0 -18
- package/chunks/Page.module-Ccvf_vDR.js +0 -16
- package/chunks/TabsExtended.module-yT8L2ZYS.js +0 -13
- package/chunks/TooltipDesktop.module-CvcpQSlC.js +0 -19
- package/chunks/index-CAZEh1iw.js +0 -931
- package/chunks/utils-9a4dp5-W.js +0 -36
|
@@ -3,12 +3,12 @@ import x from "react";
|
|
|
3
3
|
import { EAlertType as e } from "../EAlertType.js";
|
|
4
4
|
import { alertTypeToClassNameMap as m } from "../AlertTypeUtils.js";
|
|
5
5
|
import { Text as y } from "../../Typography/Text.js";
|
|
6
|
-
import { EFontType as r, ETextSize as
|
|
7
|
-
import { SystemStrokeStsIcon16 as
|
|
8
|
-
import { c as
|
|
9
|
-
const
|
|
10
|
-
alertContext:
|
|
11
|
-
alertContextText:
|
|
6
|
+
import { EFontType as r, ETextSize as f } from "../../Typography/enums.js";
|
|
7
|
+
import { SystemStrokeStsIcon16 as I, ErrorStrokeStsIcon16 as S, WarningStrokeStsIcon16 as i, InfoStrokeStsIcon16 as R } from "@sberbusiness/icons-next";
|
|
8
|
+
import { c as d } from "../../../chunks/vendor-D-uL_icH.js";
|
|
9
|
+
const N = "alertContext__afadde77", _ = "alertContextText__9688d2fb", E = "alertTypeError__21ee01db", C = "alertTypeInfo__562cff29", u = "alertTypeWarning__cc78b22b", A = "alertTypeSystem__686ce089", n = {
|
|
10
|
+
alertContext: N,
|
|
11
|
+
alertContextText: _,
|
|
12
12
|
alertTypeError: E,
|
|
13
13
|
alertTypeInfo: C,
|
|
14
14
|
alertTypeWarning: u,
|
|
@@ -22,7 +22,7 @@ const _ = "alertContext__518ef46d", d = "alertContextText__318543c8", E = "alert
|
|
|
22
22
|
case e.ERROR:
|
|
23
23
|
return /* @__PURE__ */ t(S, { paletteIndex: 1 });
|
|
24
24
|
case e.SYSTEM:
|
|
25
|
-
return /* @__PURE__ */ t(
|
|
25
|
+
return /* @__PURE__ */ t(I, { paletteIndex: 4 });
|
|
26
26
|
}
|
|
27
27
|
}, W = {
|
|
28
28
|
[e.INFO]: r.INFO,
|
|
@@ -34,13 +34,13 @@ const _ = "alertContext__518ef46d", d = "alertContextText__318543c8", E = "alert
|
|
|
34
34
|
"span",
|
|
35
35
|
{
|
|
36
36
|
role: "alert",
|
|
37
|
-
className:
|
|
37
|
+
className: d(n.alertContext, m[a](n), l),
|
|
38
38
|
...p,
|
|
39
|
-
"data-tx": "
|
|
39
|
+
"data-tx": "1.1.0",
|
|
40
40
|
ref: c,
|
|
41
41
|
children: [
|
|
42
42
|
s || O(a),
|
|
43
|
-
/* @__PURE__ */ t(y, { size:
|
|
43
|
+
/* @__PURE__ */ t(y, { size: f.B4, type: W[a], className: n.alertContextText, children: o })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -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-Dp7FRT9y.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": "
|
|
41
|
+
"data-tx": "1.1.0",
|
|
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-Dp7FRT9y.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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
body:
|
|
6
|
-
bodyInner:
|
|
7
|
-
}, b =
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { c as a } from "../../chunks/vendor-D-uL_icH.js";
|
|
4
|
+
const y = "body__c40b4d76", c = "bodyInner__f6413115", d = {
|
|
5
|
+
body: y,
|
|
6
|
+
bodyInner: c
|
|
7
|
+
}, b = t.forwardRef(({ children: r, className: s, ...e }, n) => /* @__PURE__ */ o("div", { className: a(d.body, s), ...e, "data-tx": "1.1.0", ref: n, children: /* @__PURE__ */ o("div", { className: d.bodyInner, children: r }) }));
|
|
8
8
|
b.displayName = "Body";
|
|
9
9
|
export {
|
|
10
10
|
b as Body
|
|
@@ -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 p } from "../../chunks/vendor-D-uL_icH.js";
|
|
4
|
+
import { LoaderSmall as B } from "../Loader/LoaderSmall/LoaderSmall.js";
|
|
5
|
+
import { ELoaderSmallTheme as b, 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 o, EButtonTheme as d } from "./enums.js";
|
|
9
|
+
const A = "general__9c32ef5c", C = "expanded__ca1182dd", f = {
|
|
10
|
+
general: A,
|
|
11
|
+
expanded: C
|
|
12
|
+
}, G = "secondary__2d95d7d5", T = "expanded__ca1182dd", h = {
|
|
13
|
+
secondary: G,
|
|
14
|
+
expanded: T
|
|
15
|
+
}, M = "secondaryLight__85baabf7", z = "expanded__ca1182dd", x = {
|
|
16
|
+
secondaryLight: M,
|
|
17
|
+
expanded: z
|
|
18
|
+
}, I = "danger__d7381d83", v = "expanded__ca1182dd", S = {
|
|
19
|
+
danger: I,
|
|
20
|
+
expanded: v
|
|
21
|
+
}, O = "link__fa06516f", y = {
|
|
22
|
+
link: O
|
|
23
|
+
}, Y = "button__5a77b748", w = "sm__5ef4f406", $ = "icon__bd8debbd", j = "md__0dbdfe5e", H = "lg__7146f580", K = "block__64ed43ef", U = "content__db7f6cf0", q = "loading__a831dcc2", F = "loader__3bfd1b31", J = "hidden__4f055ac6", 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 d.GENERAL:
|
|
37
|
+
return { [f.general]: !0, [f.expanded]: e };
|
|
38
|
+
case d.SECONDARY:
|
|
39
|
+
return {
|
|
40
|
+
[h.secondary]: !0,
|
|
41
|
+
[h.expanded]: e
|
|
42
|
+
};
|
|
43
|
+
case d.SECONDARY_LIGHT:
|
|
44
|
+
return {
|
|
45
|
+
[x.secondaryLight]: !0,
|
|
46
|
+
[x.expanded]: e
|
|
47
|
+
};
|
|
48
|
+
case d.DANGER:
|
|
49
|
+
return {
|
|
50
|
+
[S.danger]: !0,
|
|
51
|
+
[S.expanded]: e
|
|
52
|
+
};
|
|
53
|
+
case d.LINK:
|
|
54
|
+
return {
|
|
55
|
+
[y.link]: !0,
|
|
56
|
+
[y.expanded]: e
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}, Q = (t) => {
|
|
60
|
+
switch (t) {
|
|
61
|
+
case o.LG:
|
|
62
|
+
return n.lg;
|
|
63
|
+
case o.MD:
|
|
64
|
+
return n.md;
|
|
65
|
+
case o.SM:
|
|
66
|
+
return n.sm;
|
|
67
|
+
}
|
|
68
|
+
}, V = (t, e) => {
|
|
69
|
+
const s = [d.SECONDARY, d.SECONDARY_LIGHT].includes(t) ? b.BRAND : b.NEUTRAL, a = e === o.SM ? r.SM : e === o.LG ? r.LG : r.MD;
|
|
70
|
+
return /* @__PURE__ */ L(B, { theme: s, size: a });
|
|
71
|
+
}, W = R.forwardRef((t, e) => {
|
|
72
|
+
const { children: s, className: a, disabled: l, theme: i, size: _ = o.MD, block: N, loading: c, icon: m, ...E } = t, { "aria-expanded": u } = t, k = p(
|
|
73
|
+
n.button,
|
|
74
|
+
P(i, !!u),
|
|
75
|
+
Q(_),
|
|
76
|
+
{ [n.block]: !!N, [n.loading]: !!c },
|
|
77
|
+
{ [n.icon]: !!m && !s },
|
|
78
|
+
// Классы для иконок, начало.
|
|
79
|
+
"hoverable",
|
|
80
|
+
{
|
|
81
|
+
active: !!u,
|
|
82
|
+
disabled: !!l
|
|
83
|
+
},
|
|
84
|
+
// Классы для иконок, конец.
|
|
85
|
+
a
|
|
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
|
+
s
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ L("div", { className: p(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": "
|
|
3
|
+
const r = e.forwardRef((t, o) => /* @__PURE__ */ a("button", { type: "button", ...t, "data-tx": "1.1.0", 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 l } 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 ce } 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 ae = "buttonDropdown__ffa6ca0e", se = "block__64ed43ef", ie = "buttonDropdownTarget__bc0d87b0", le = "caretIcon__a81e06f0", de = "active__99cc088e", ue = "buttonDropdownMenuItem__fbe01200", n = {
|
|
22
|
+
buttonDropdown: ae,
|
|
23
|
+
block: se,
|
|
24
|
+
buttonDropdownTarget: ie,
|
|
25
|
+
caretIcon: le,
|
|
26
|
+
active: de,
|
|
27
|
+
buttonDropdownMenuItem: ue
|
|
28
|
+
}, me = (d) => {
|
|
29
|
+
switch (d) {
|
|
30
|
+
case l.SM:
|
|
31
|
+
return S.SM;
|
|
32
|
+
case l.MD:
|
|
33
|
+
return S.MD;
|
|
34
|
+
case l.LG:
|
|
35
|
+
return S.LG;
|
|
36
|
+
default:
|
|
37
|
+
return S.MD;
|
|
38
|
+
}
|
|
39
|
+
}, De = (d) => {
|
|
40
|
+
switch (d) {
|
|
41
|
+
case l.SM:
|
|
42
|
+
return N.SM;
|
|
43
|
+
case l.MD:
|
|
44
|
+
return N.MD;
|
|
45
|
+
case l.LG:
|
|
46
|
+
return N.LG;
|
|
47
|
+
default:
|
|
48
|
+
return N.MD;
|
|
49
|
+
}
|
|
50
|
+
}, fe = V.forwardRef(
|
|
51
|
+
(d, f) => {
|
|
52
|
+
const { buttonAttributes: M, children: T, className: Y, theme: p, size: w, options: A, selected: s, block: _, disabled: C, ...W } = d, 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 c = b(n.buttonDropdownTarget, "hoverable", {
|
|
54
|
+
[n.active]: e,
|
|
55
|
+
[n.block]: !!_
|
|
56
|
+
});
|
|
57
|
+
return /* @__PURE__ */ I(
|
|
58
|
+
B,
|
|
59
|
+
{
|
|
60
|
+
className: c,
|
|
61
|
+
theme: p,
|
|
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 c = b(n.buttonDropdownTarget, "hoverable", {
|
|
80
|
+
[n.active]: e,
|
|
81
|
+
[n.block]: !!_
|
|
82
|
+
});
|
|
83
|
+
return /* @__PURE__ */ r(
|
|
84
|
+
B,
|
|
85
|
+
{
|
|
86
|
+
className: c,
|
|
87
|
+
theme: p === 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 }) => (c) => {
|
|
102
|
+
const { key: a } = c;
|
|
103
|
+
(D(a, "SPACE") || D(a, "ARROW_UP") || D(a, "ARROW_DOWN")) && c.preventDefault(), !e && (D(a, "ARROW_UP") || D(a, "ARROW_DOWN")) && o(!0);
|
|
104
|
+
}, U = () => {
|
|
105
|
+
switch (p) {
|
|
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: c }) => {
|
|
118
|
+
const a = b(n.buttonDropdownMenu, c);
|
|
119
|
+
return /* @__PURE__ */ r(Z.Provider, { value: { activeDescendant: R, setActiveDescendant: P }, children: /* @__PURE__ */ r(
|
|
120
|
+
z.Dropdown,
|
|
121
|
+
{
|
|
122
|
+
size: me(w),
|
|
123
|
+
className: a,
|
|
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: ce.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 f == "function" ? f(e) : f && (f.current = e);
|
|
167
|
+
};
|
|
168
|
+
return /* @__PURE__ */ r(
|
|
169
|
+
z,
|
|
170
|
+
{
|
|
171
|
+
className: H,
|
|
172
|
+
renderButton: [m.DOTS_SECONDARY, m.DOTS_SECONDARY_LIGHT].includes(
|
|
173
|
+
p
|
|
174
|
+
) ? j : K,
|
|
175
|
+
renderDropdown: q,
|
|
176
|
+
dropdownRef: k,
|
|
177
|
+
closeOnTab: !0,
|
|
178
|
+
...W
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
fe.displayName = "ButtonDropdown";
|
|
22
184
|
export {
|
|
23
|
-
|
|
24
|
-
k as dotsTheme
|
|
185
|
+
fe 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__015548a1", S = "buttonDropdownExtendedBlock__c59ea7ee", E = {
|
|
8
|
+
buttonDropdownExtended: K,
|
|
9
|
+
buttonDropdownExtendedBlock: S
|
|
10
|
+
}, D = (s) => {
|
|
11
|
+
const { className: v, opened: x, setOpened: c, renderButton: k, renderDropdown: b, 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 ? !!x : 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, v);
|
|
39
|
+
return /* @__PURE__ */ h("div", { className: B, ref: u, ...L, children: [
|
|
40
|
+
k({ opened: e, setOpened: o }),
|
|
41
|
+
b({
|
|
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__45287fac", f = "circle__f2df5872", p = "squircle__26105e3b", o = {
|
|
6
6
|
buttonIcon: I,
|
|
7
7
|
circle: f,
|
|
8
8
|
squircle: p
|
|
@@ -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
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (c, i, e) =>
|
|
4
|
-
import { jsx as
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var y = (c, i, e) => i in c ? N(c, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[i] = e;
|
|
3
|
+
var o = (c, i, e) => y(c, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
5
5
|
import u from "react";
|
|
6
|
-
import { CardContent as
|
|
7
|
-
import { CardMedia as
|
|
6
|
+
import { CardContent as T } from "./components/CardContent/CardContent.js";
|
|
7
|
+
import { CardMedia as _ } from "./components/CardMedia.js";
|
|
8
8
|
import { ECardRoundingSize as M, ECardTheme as w } from "./enums.js";
|
|
9
9
|
import { EFocusSource as r } from "../../enums/EFocusSource.js";
|
|
10
10
|
import { mapCardRoundingSizeToCssClass as x, mapCardThemeToCssClass as K } from "./utils.js";
|
|
11
|
-
import { isKey as
|
|
12
|
-
import { c as k } from "../../chunks/vendor-
|
|
13
|
-
import { c as B } from "../../chunks/Card.module-
|
|
14
|
-
const O = "
|
|
11
|
+
import { isKey as f } from "../../utils/keyboard.js";
|
|
12
|
+
import { c as k } from "../../chunks/vendor-D-uL_icH.js";
|
|
13
|
+
import { c as B } from "../../chunks/Card.module-Ddt7TQ9Z.js";
|
|
14
|
+
const O = "action__6afb3582", F = "selected__368fb28b", V = "focusVisible__3b81cf1c", a = {
|
|
15
15
|
action: O,
|
|
16
16
|
selected: F,
|
|
17
17
|
focusVisible: V
|
|
@@ -35,19 +35,19 @@ class l extends u.Component {
|
|
|
35
35
|
});
|
|
36
36
|
o(this, "handleKeyDown", (e) => {
|
|
37
37
|
const { onKeyDown: s } = this.props;
|
|
38
|
-
s == null || s(e),
|
|
38
|
+
s == null || s(e), f(e.keyCode, "SPACE") ? (e.preventDefault(), this.handleToggle()) : f(e.keyCode, "ENTER") && this.handleToggle();
|
|
39
39
|
});
|
|
40
40
|
o(this, "handleFocus", (e) => {
|
|
41
|
-
const { onFocus: s } = this.props, { focusSource: t } = this.state, { current:
|
|
42
|
-
s == null || s(e), !t &&
|
|
41
|
+
const { onFocus: s } = this.props, { focusSource: t } = this.state, { current: n } = this.ref;
|
|
42
|
+
s == null || s(e), !t && n === e.target && this.setState({ focusSource: r.KEYBOARD });
|
|
43
43
|
});
|
|
44
44
|
o(this, "handleBlur", (e) => {
|
|
45
45
|
const { onBlur: s } = this.props, { current: t } = this.ref;
|
|
46
46
|
s == null || s(e), t !== document.activeElement && t === e.target && this.setState({ focusSource: r.NONE });
|
|
47
47
|
});
|
|
48
48
|
o(this, "handleToggle", () => {
|
|
49
|
-
const { toggle: e, selected: s, onToggle: t } = this.props, { isControlled:
|
|
50
|
-
|
|
49
|
+
const { toggle: e, selected: s, onToggle: t } = this.props, { isControlled: n, isSelected: d } = this.state;
|
|
50
|
+
n ? e == null || e(!s) : this.setState(
|
|
51
51
|
(h) => ({ isSelected: !h.isSelected }),
|
|
52
52
|
() => t == null ? void 0 : t(!d)
|
|
53
53
|
);
|
|
@@ -62,31 +62,31 @@ class l extends u.Component {
|
|
|
62
62
|
children: e,
|
|
63
63
|
className: s,
|
|
64
64
|
onClick: t,
|
|
65
|
-
onMouseDown:
|
|
65
|
+
onMouseDown: n,
|
|
66
66
|
onKeyDown: d,
|
|
67
67
|
onFocus: h,
|
|
68
68
|
onBlur: z,
|
|
69
|
-
roundingSize:
|
|
69
|
+
roundingSize: p = M.MD,
|
|
70
70
|
onToggle: A,
|
|
71
71
|
selected: m,
|
|
72
72
|
toggle: U,
|
|
73
73
|
theme: S = w.GENERAL,
|
|
74
74
|
...C
|
|
75
|
-
} = this.props, { isControlled: E, isSelected:
|
|
75
|
+
} = this.props, { isControlled: E, isSelected: b, focusSource: g } = this.state, D = k(
|
|
76
76
|
B.card,
|
|
77
|
-
|
|
77
|
+
a.action,
|
|
78
78
|
K[S],
|
|
79
|
-
x[
|
|
79
|
+
x[p],
|
|
80
80
|
{
|
|
81
|
-
[
|
|
82
|
-
[
|
|
81
|
+
[a.focusVisible]: g === r.KEYBOARD,
|
|
82
|
+
[a.selected]: E ? !!m : b
|
|
83
83
|
},
|
|
84
84
|
s
|
|
85
85
|
);
|
|
86
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ R(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
className:
|
|
89
|
+
className: D,
|
|
90
90
|
tabIndex: 0,
|
|
91
91
|
onClick: this.handleClick,
|
|
92
92
|
onMouseDown: this.handleMouseDown,
|
|
@@ -96,13 +96,13 @@ class l extends u.Component {
|
|
|
96
96
|
role: "button",
|
|
97
97
|
...C,
|
|
98
98
|
ref: this.ref,
|
|
99
|
-
"data-tx": "
|
|
99
|
+
"data-tx": "1.1.0",
|
|
100
100
|
children: e
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
o(l, "displayName", "CardAction"), o(l, "Content",
|
|
105
|
+
o(l, "displayName", "CardAction"), o(l, "Content", T), o(l, "Media", _);
|
|
106
106
|
export {
|
|
107
107
|
l as CardAction
|
|
108
108
|
};
|