@bikdotai/bik-component-library 0.0.840-beta.0 → 0.0.840-tools-beta.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/dist/cjs/assets/icons/BigCommerce.svg.js +2 -0
- package/dist/cjs/assets/icons/BigCommerce.svg.js.map +1 -0
- package/dist/cjs/assets/icons/ShipStation.svg.js +2 -0
- package/dist/cjs/assets/icons/ShipStation.svg.js.map +1 -0
- package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
- package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/cjs/components/SearchFilter/index.js +1 -1
- package/dist/cjs/components/SearchFilter/index.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +39 -51
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +2 -2
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/DiscardModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/DiscardModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +22 -22
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/StepSectionHeader.js +1 -1
- package/dist/cjs/components/agent-builder/components/StepSectionHeader.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +1 -3
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +3 -5
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
- package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/components/agent-listing/DeleteAgentModal.js +1 -1
- package/dist/cjs/components/agent-listing/DeleteAgentModal.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
- package/dist/cjs/components/button/Button.styled.js +0 -1
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/button/themes.js +11 -11
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
- package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/cjs/components/radioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/radioList/RadioList.js +1 -1
- package/dist/cjs/components/radioList/RadioList.js.map +1 -1
- package/dist/cjs/components/searchBar/searchBar.js +1 -1
- package/dist/cjs/components/searchBar/searchBar.js.map +1 -1
- package/dist/cjs/components/side-modal/SideModal.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.js.map +1 -1
- package/dist/cjs/components/star-rating/Star.js +1 -1
- package/dist/cjs/components/star-rating/Star.js.map +1 -1
- package/dist/cjs/components/star-rating/StarRating.js +2 -2
- package/dist/cjs/components/star-rating/StarRating.js.map +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js.map +1 -1
- package/dist/cjs/components/thumbnail/Thumbnail.js +1 -1
- package/dist/cjs/components/thumbnail/Thumbnail.js.map +1 -1
- package/dist/cjs/components/zeroState/ZeroState.js +3 -3
- package/dist/cjs/components/zeroState/ZeroState.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +54 -97
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js +3 -3
- package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
- package/dist/cjs/icons/index.js +1 -1
- package/dist/esm/assets/icons/BigCommerce.svg.js +6 -0
- package/dist/esm/assets/icons/BigCommerce.svg.js.map +1 -0
- package/dist/esm/assets/icons/ShipStation.svg.js +6 -0
- package/dist/esm/assets/icons/ShipStation.svg.js.map +1 -0
- package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +61 -66
- package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/esm/components/SearchFilter/index.js +10 -11
- package/dist/esm/components/SearchFilter/index.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +102 -106
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +7 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +6 -3
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +106 -118
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js +21 -29
- package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js +26 -27
- package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +25 -25
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +23 -24
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/DiscardModal.d.ts +1 -3
- package/dist/esm/components/agent-builder/components/DiscardModal.js +24 -33
- package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/GoLiveModal.js +21 -23
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.js +19 -19
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +147 -177
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +0 -2
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +105 -111
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +4 -13
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +148 -173
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/components/StepSectionHeader.js +7 -7
- package/dist/esm/components/agent-builder/components/StepSectionHeader.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/tools.d.ts +2 -0
- package/dist/esm/components/agent-builder/constants/tools.js +22 -17
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +103 -104
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +102 -101
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +142 -144
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +79 -23
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +23 -35
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +20 -16
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListing.js +65 -70
- package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTable.d.ts +0 -2
- package/dist/esm/components/agent-listing/AgentTable.js +15 -16
- package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableRow.js +11 -11
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/components/agent-listing/DeleteAgentModal.js +8 -8
- package/dist/esm/components/agent-listing/DeleteAgentModal.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +10 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
- package/dist/esm/components/button/Button.styled.js +19 -25
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/button/themes.d.ts +0 -1
- package/dist/esm/components/button/themes.js +51 -61
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +21 -28
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
- package/dist/esm/components/dropdown/Dropdown.js +13 -18
- package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/dropdown-button/DropdownButton.js +13 -13
- package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/esm/components/input/Input.js +34 -35
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.model.d.ts +0 -1
- package/dist/esm/components/multi-level-dropdown/MenuItem.js +27 -28
- package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
- package/dist/esm/components/radioButton/RadioButton.js +9 -10
- package/dist/esm/components/radioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/radioList/RadioList.js +19 -28
- package/dist/esm/components/radioList/RadioList.js.map +1 -1
- package/dist/esm/components/searchBar/searchBar.js +10 -11
- package/dist/esm/components/searchBar/searchBar.js.map +1 -1
- package/dist/esm/components/side-modal/SideModal.js +5 -13
- package/dist/esm/components/side-modal/SideModal.js.map +1 -1
- package/dist/esm/components/star-rating/Star.d.ts +0 -1
- package/dist/esm/components/star-rating/Star.js +27 -32
- package/dist/esm/components/star-rating/Star.js.map +1 -1
- package/dist/esm/components/star-rating/StarRating.js +16 -17
- package/dist/esm/components/star-rating/StarRating.js.map +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.js +40 -41
- package/dist/esm/components/template-preview/TemplatePreview.js.map +1 -1
- package/dist/esm/components/thumbnail/Thumbnail.js +3 -3
- package/dist/esm/components/thumbnail/Thumbnail.js.map +1 -1
- package/dist/esm/components/zeroState/ZeroState.js +13 -20
- package/dist/esm/components/zeroState/ZeroState.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +160 -173
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.d.ts +3 -20
- package/dist/esm/editor/BikEditor.styles.js +57 -102
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.d.ts +8 -5
- package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js +68 -87
- package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
- package/dist/esm/icons/Media/Visual/index.d.ts +0 -2
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +416 -420
- package/dist/esm/icons/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/agent-listing/AgentTableShimmer.js +0 -2
- package/dist/cjs/components/agent-listing/AgentTableShimmer.js.map +0 -1
- package/dist/cjs/icons/Media/Visual/FormkitNeutral.js +0 -2
- package/dist/cjs/icons/Media/Visual/FormkitNeutral.js.map +0 -1
- package/dist/cjs/icons/Media/Visual/FormkitSad.js +0 -2
- package/dist/cjs/icons/Media/Visual/FormkitSad.js.map +0 -1
- package/dist/esm/components/agent-builder/__fixtures__/agentValue.d.ts +0 -11
- package/dist/esm/components/agent-listing/AgentTableShimmer.d.ts +0 -12
- package/dist/esm/components/agent-listing/AgentTableShimmer.js +0 -20
- package/dist/esm/components/agent-listing/AgentTableShimmer.js.map +0 -1
- package/dist/esm/components/agent-listing/__fixtures__/agents.d.ts +0 -3
- package/dist/esm/icons/Media/Visual/FormkitNeutral.js +0 -58
- package/dist/esm/icons/Media/Visual/FormkitNeutral.js.map +0 -1
- package/dist/esm/icons/Media/Visual/FormkitSad.js +0 -61
- package/dist/esm/icons/Media/Visual/FormkitSad.js.map +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsxs as c, jsx as n, Fragment as T } from "react/jsx-runtime";
|
|
2
2
|
import P from "../../assets/icons/chevronRight2.svg.js";
|
|
3
|
-
import u, { useRef as
|
|
3
|
+
import u, { useRef as B } from "react";
|
|
4
4
|
import { COLORS as t } from "../../constants/Theme.js";
|
|
5
|
-
import { BodyCaption as
|
|
6
|
-
import { MenuItemWrapper as
|
|
5
|
+
import { BodyCaption as H, BodyTiny as L } from "../TypographyStyle.js";
|
|
6
|
+
import { MenuItemWrapper as W, MenuItemContainer as j, ContentContainer as k, LeadingIconContainer as E, TrailingIconContainer as p, SubMenuContainer as _, StyledSubMenuWrapper as w, SubMenuListContainer as D } from "./MultiLevelDropdown.styled.js";
|
|
7
7
|
const J = ({
|
|
8
8
|
width: o,
|
|
9
9
|
onDropdownItemClick: f,
|
|
10
10
|
option: e,
|
|
11
|
-
parents:
|
|
11
|
+
parents: h,
|
|
12
12
|
allowParentSelection: y,
|
|
13
|
-
maxLevels:
|
|
13
|
+
maxLevels: m,
|
|
14
14
|
currentLevel: b,
|
|
15
15
|
renderNestedMenu: I,
|
|
16
16
|
version: r
|
|
17
17
|
}) => {
|
|
18
|
-
const [g, M] = u.useState(!1), [
|
|
18
|
+
const [g, M] = u.useState(!1), [l, S] = u.useState(!1), [C, v] = u.useState({
|
|
19
19
|
top: 0,
|
|
20
20
|
left: 0
|
|
21
|
-
}), x =
|
|
22
|
-
!f || (e.disabled ?? !1) || (!i || y) && f(e,
|
|
21
|
+
}), x = B({ top: 0, left: 0 }), i = !!e.children && e.children.length > 0, d = i && (m === void 0 || b < m), O = () => {
|
|
22
|
+
!f || (e.disabled ?? !1) || (!i || y) && f(e, h);
|
|
23
23
|
}, R = (s) => {
|
|
24
|
-
const
|
|
24
|
+
const a = s.currentTarget.getBoundingClientRect();
|
|
25
25
|
v({
|
|
26
|
-
top:
|
|
27
|
-
left:
|
|
26
|
+
top: a.top,
|
|
27
|
+
left: a.right
|
|
28
28
|
}), x.current = {
|
|
29
|
-
top:
|
|
30
|
-
left:
|
|
29
|
+
top: a.top,
|
|
30
|
+
left: a.right
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
return /* @__PURE__ */ c(
|
|
34
|
-
|
|
34
|
+
W,
|
|
35
35
|
{
|
|
36
36
|
version: r,
|
|
37
37
|
onMouseEnter: (s) => {
|
|
@@ -44,7 +44,6 @@ const J = ({
|
|
|
44
44
|
s.stopPropagation(), O();
|
|
45
45
|
},
|
|
46
46
|
id: "menuItemWrapper",
|
|
47
|
-
"data-testid": "menuItemWrapper",
|
|
48
47
|
style: {
|
|
49
48
|
cursor: e.disabled ?? !1 ? "not-allowed" : "pointer",
|
|
50
49
|
backgroundColor: e.disabled ?? !1 ? t.surface.standard : "transparent"
|
|
@@ -55,7 +54,7 @@ const J = ({
|
|
|
55
54
|
{
|
|
56
55
|
isSelected: e.selected,
|
|
57
56
|
isSubMenuOpen: g,
|
|
58
|
-
isHovered:
|
|
57
|
+
isHovered: l,
|
|
59
58
|
isDisabled: e.disabled ?? !1,
|
|
60
59
|
version: r,
|
|
61
60
|
children: [
|
|
@@ -63,19 +62,19 @@ const J = ({
|
|
|
63
62
|
e.leadingIcon && /* @__PURE__ */ n(E, { children: e.leadingIcon }),
|
|
64
63
|
/* @__PURE__ */ c("div", { children: [
|
|
65
64
|
/* @__PURE__ */ n(
|
|
66
|
-
|
|
65
|
+
H,
|
|
67
66
|
{
|
|
68
67
|
style: {
|
|
69
|
-
color: e.disabled ?? !1 ? t.content.inactive : e.selected ||
|
|
68
|
+
color: e.disabled ?? !1 ? t.content.inactive : e.selected || l ? r === "3.0" ? t.text.primary : t.content.positive : t.content.primary
|
|
70
69
|
},
|
|
71
70
|
children: e.label
|
|
72
71
|
}
|
|
73
72
|
),
|
|
74
73
|
e.subText && /* @__PURE__ */ n(
|
|
75
|
-
|
|
74
|
+
L,
|
|
76
75
|
{
|
|
77
76
|
style: {
|
|
78
|
-
color: e.disabled ?? !1 ? t.content.inactive : e.selected ||
|
|
77
|
+
color: e.disabled ?? !1 ? t.content.inactive : e.selected || l ? r === "3.0" ? t.text.primary : t.content.positive : t.content.secondary,
|
|
79
78
|
marginTop: "2px"
|
|
80
79
|
},
|
|
81
80
|
children: e.subText
|
|
@@ -83,14 +82,14 @@ const J = ({
|
|
|
83
82
|
)
|
|
84
83
|
] })
|
|
85
84
|
] }),
|
|
86
|
-
i ? /* @__PURE__ */ n(
|
|
85
|
+
i ? /* @__PURE__ */ n(p, { children: /* @__PURE__ */ n(
|
|
87
86
|
P,
|
|
88
87
|
{
|
|
89
88
|
width: 16,
|
|
90
89
|
height: 16,
|
|
91
|
-
color: !d || (e.disabled ?? !1) ? t.content.inactive : e.selected ||
|
|
90
|
+
color: !d || (e.disabled ?? !1) ? t.content.inactive : e.selected || l ? r === "3.0" ? t.text.primary : t.content.positive : t.content.primary
|
|
92
91
|
}
|
|
93
|
-
) }) : e.trailingIcon ? /* @__PURE__ */ n(
|
|
92
|
+
) }) : e.trailingIcon ? /* @__PURE__ */ n(p, { children: e.trailingIcon }) : /* @__PURE__ */ n(T, {})
|
|
94
93
|
]
|
|
95
94
|
}
|
|
96
95
|
),
|
|
@@ -99,17 +98,17 @@ const J = ({
|
|
|
99
98
|
{
|
|
100
99
|
width: o,
|
|
101
100
|
className: "submenu",
|
|
102
|
-
onMouseEnter: () =>
|
|
103
|
-
onMouseLeave: () =>
|
|
101
|
+
onMouseEnter: () => S(!0),
|
|
102
|
+
onMouseLeave: () => S(!1),
|
|
104
103
|
children: /* @__PURE__ */ n(
|
|
105
104
|
w,
|
|
106
105
|
{
|
|
107
106
|
width: o,
|
|
108
|
-
top:
|
|
109
|
-
left:
|
|
107
|
+
top: C.top,
|
|
108
|
+
left: C.left,
|
|
110
109
|
children: /* @__PURE__ */ n(D, { version: r, children: I(
|
|
111
110
|
e.children,
|
|
112
|
-
[...
|
|
111
|
+
[...h, e],
|
|
113
112
|
b + 1
|
|
114
113
|
) })
|
|
115
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../src/components/multi-level-dropdown/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight2.svg';\nimport React, { useRef } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { BodyCaption, BodyTiny } from '../TypographyStyle';\nimport {\n\tContentContainer,\n\tLeadingIconContainer,\n\tMenuItemContainer,\n\tMenuItemWrapper,\n\tStyledSubMenuWrapper,\n\tSubMenuContainer,\n\tSubMenuListContainer,\n\tTrailingIconContainer,\n} from './MultiLevelDropdown.styled';\nimport {\n\tMultiLevelDropdownOption,\n\tRenderNestedMenu,\n\tSingleOption,\n} from './type';\n\nexport const MenuItem: React.FC<{\n\twidth: string;\n\tonDropdownItemClick?: (\n\t\toption: MultiLevelDropdownOption,\n\t\tparents: MultiLevelDropdownOption[],\n\t) => void;\n\toption: SingleOption;\n\tparents: MultiLevelDropdownOption[];\n\tallowParentSelection?: boolean;\n\tmaxLevels?: number;\n\tcurrentLevel: number;\n\trenderNestedMenu: RenderNestedMenu;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({\n\twidth,\n\tonDropdownItemClick,\n\toption,\n\tparents,\n\tallowParentSelection,\n\tmaxLevels,\n\tcurrentLevel,\n\trenderNestedMenu,\n\tversion,\n}) => {\n\tconst [isSubMenuOpen, setIsSubMenuOpen] = React.useState(false);\n\tconst [isSubMenuHovered, setIsSubMenuHovered] = React.useState(false);\n\tconst [subMenuPosition, setSubMenuPosition] = React.useState({\n\t\ttop: 0,\n\t\tleft: 0,\n\t});\n\tconst positionRef = useRef<any>({ top: 0, left: 0 });\n\tconst hasChildren = !!option.children && option.children.length > 0;\n\tconst canOpenSubMenu =\n\t\thasChildren && (maxLevels === undefined || currentLevel < maxLevels);\n\n\tconst handleDropdownOptionClick = () => {\n\t\tif (!onDropdownItemClick || (option.disabled ?? false)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!hasChildren || allowParentSelection) {\n\t\t\tonDropdownItemClick(option, parents);\n\t\t}\n\t};\n\n\tconst calculateSubMenuPosition = (event: React.MouseEvent) => {\n\t\tconst rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n\t\tsetSubMenuPosition({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t});\n\t\tpositionRef.current = {\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t};\n\t};\n\n\treturn (\n\t\t<MenuItemWrapper\n\t\t\tversion={version}\n\t\t\tonMouseEnter={(event) => {\n\t\t\t\tif (canOpenSubMenu) {\n\t\t\t\t\tsetIsSubMenuOpen(true);\n\t\t\t\t\tcalculateSubMenuPosition(event);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetIsSubMenuOpen(false);\n\t\t\t}}\n\t\t\tonClick={(e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\thandleDropdownOptionClick();\n\t\t\t}}\n\t\t\tid=\"menuItemWrapper\"\n\t\t\tdata-testid=\"menuItemWrapper\"\n\t\t\tstyle={{\n\t\t\t\tcursor: option.disabled ?? false ? 'not-allowed' : 'pointer',\n\t\t\t\tbackgroundColor:\n\t\t\t\t\toption.disabled ?? false ? COLORS.surface.standard : 'transparent',\n\t\t\t}}\n\t\t>\n\t\t\t{option.customComponent ? (\n\t\t\t\toption.customComponent\n\t\t\t) : (\n\t\t\t\t<MenuItemContainer\n\t\t\t\t\tisSelected={option.selected}\n\t\t\t\t\tisSubMenuOpen={isSubMenuOpen}\n\t\t\t\t\tisHovered={isSubMenuHovered}\n\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\tversion={version}\n\t\t\t\t>\n\t\t\t\t\t<ContentContainer>\n\t\t\t\t\t\t{option.leadingIcon && (\n\t\t\t\t\t\t\t<LeadingIconContainer>{option.leadingIcon}</LeadingIconContainer>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{option.subText && (\n\t\t\t\t\t\t\t\t<BodyTiny\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t\tmarginTop: '2px',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{option.subText}\n\t\t\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ContentContainer>\n\t\t\t\t\t{hasChildren ? (\n\t\t\t\t\t\t<TrailingIconContainer>\n\t\t\t\t\t\t\t<ChevronRightIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t!canOpenSubMenu || (option.disabled ?? false)\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TrailingIconContainer>\n\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t<TrailingIconContainer>{option.trailingIcon}</TrailingIconContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t</MenuItemContainer>\n\t\t\t)}\n\n\t\t\t{!(option.disabled ?? false) &&\n\t\t\t\toption.children &&\n\t\t\t\toption.children.length > 0 &&\n\t\t\t\tcanOpenSubMenu &&\n\t\t\t\tisSubMenuOpen && (\n\t\t\t\t\t<SubMenuContainer\n\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\tclassName=\"submenu\"\n\t\t\t\t\t\tonMouseEnter={() => setIsSubMenuHovered(true)}\n\t\t\t\t\t\tonMouseLeave={() => setIsSubMenuHovered(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StyledSubMenuWrapper\n\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\ttop={subMenuPosition.top}\n\t\t\t\t\t\t\tleft={subMenuPosition.left}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SubMenuListContainer version={version}>\n\t\t\t\t\t\t\t\t{renderNestedMenu(\n\t\t\t\t\t\t\t\t\toption.children,\n\t\t\t\t\t\t\t\t\t[...parents, option],\n\t\t\t\t\t\t\t\t\tcurrentLevel + 1,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</SubMenuListContainer>\n\t\t\t\t\t\t</StyledSubMenuWrapper>\n\t\t\t\t\t</SubMenuContainer>\n\t\t\t\t)}\n\t\t</MenuItemWrapper>\n\t);\n};\n"],"names":["MenuItem","width","onDropdownItemClick","option","parents","allowParentSelection","maxLevels","currentLevel","renderNestedMenu","version","isSubMenuOpen","setIsSubMenuOpen","React","isSubMenuHovered","setIsSubMenuHovered","subMenuPosition","setSubMenuPosition","positionRef","useRef","hasChildren","canOpenSubMenu","handleDropdownOptionClick","calculateSubMenuPosition","event","rect","jsxs","MenuItemWrapper","e","COLORS","MenuItemContainer","ContentContainer","jsx","LeadingIconContainer","BodyCaption","BodyTiny","TrailingIconContainer","ChevronRightIcon","Fragment","SubMenuContainer","StyledSubMenuWrapper","SubMenuListContainer"],"mappings":";;;;;;AAoBO,MAAMA,IAaR,C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,gBAAA;AAAA,kBACA,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,OACC,CAAChB,MAAmBjB,EAAO,YAAY,MACpCyB,EAAO,QAAQ,WACfzB,EAAO,YAAYU,IACnBJ,MAAY,QACXmB,EAAO,KAAK,UACZA,EAAO,QAAQ,WAChBA,EAAO,QAAQ;AAAA,gBAAA;AAAA,cAAA,EAEpB,CACD,IACGzB,EAAO,iCACTgC,GAAA,EAAuB,UAAAhC,EAAO,aAAA,CAAa,IAE5C,gBAAA4B,EAAAM,GAAA,CAAA,CAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAKJ,EAAElC,EAAO,YAAY,OACrBA,EAAO,YACPA,EAAO,SAAS,SAAS,KACzBiB,KACAV,KACC,gBAAAqB;AAAA,UAACO;AAAA,UAAA;AAAA,YACA,OAAArC;AAAA,YACA,WAAU;AAAA,YACV,cAAc,MAAMa,EAAoB,EAAI;AAAA,YAC5C,cAAc,MAAMA,EAAoB,EAAK;AAAA,YAE7C,UAAA,gBAAAiB;AAAA,cAACQ;AAAA,cAAA;AAAA,gBACA,OAAAtC;AAAA,gBACA,KAAKc,EAAgB;AAAA,gBACrB,MAAMA,EAAgB;AAAA,gBAEtB,UAAA,gBAAAgB,EAACS,KAAqB,SAAA/B,GACpB,UAAAD;AAAA,kBACAL,EAAO;AAAA,kBACP,CAAC,GAAGC,GAASD,CAAM;AAAA,kBACnBI,IAAe;AAAA,gBAAA,EAChB,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACD;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAIL;"}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../src/components/multi-level-dropdown/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight2.svg';\nimport React, { useRef } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { BodyCaption, BodyTiny } from '../TypographyStyle';\nimport {\n\tContentContainer,\n\tLeadingIconContainer,\n\tMenuItemContainer,\n\tMenuItemWrapper,\n\tStyledSubMenuWrapper,\n\tSubMenuContainer,\n\tSubMenuListContainer,\n\tTrailingIconContainer,\n} from './MultiLevelDropdown.styled';\nimport {\n\tMultiLevelDropdownOption,\n\tRenderNestedMenu,\n\tSingleOption,\n} from './type';\n\nexport const MenuItem: React.FC<{\n\twidth: string;\n\tonDropdownItemClick?: (\n\t\toption: MultiLevelDropdownOption,\n\t\tparents: MultiLevelDropdownOption[],\n\t) => void;\n\toption: SingleOption;\n\tparents: MultiLevelDropdownOption[];\n\tallowParentSelection?: boolean;\n\tmaxLevels?: number;\n\tcurrentLevel: number;\n\trenderNestedMenu: RenderNestedMenu;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({\n\twidth,\n\tonDropdownItemClick,\n\toption,\n\tparents,\n\tallowParentSelection,\n\tmaxLevels,\n\tcurrentLevel,\n\trenderNestedMenu,\n\tversion,\n}) => {\n\tconst [isSubMenuOpen, setIsSubMenuOpen] = React.useState(false);\n\tconst [isSubMenuHovered, setIsSubMenuHovered] = React.useState(false);\n\tconst [subMenuPosition, setSubMenuPosition] = React.useState({\n\t\ttop: 0,\n\t\tleft: 0,\n\t});\n\tconst positionRef = useRef<any>({ top: 0, left: 0 });\n\tconst hasChildren = !!option.children && option.children.length > 0;\n\tconst canOpenSubMenu =\n\t\thasChildren && (maxLevels === undefined || currentLevel < maxLevels);\n\n\tconst handleDropdownOptionClick = () => {\n\t\tif (!onDropdownItemClick || (option.disabled ?? false)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!hasChildren || allowParentSelection) {\n\t\t\tonDropdownItemClick(option, parents);\n\t\t}\n\t};\n\n\tconst calculateSubMenuPosition = (event: React.MouseEvent) => {\n\t\tconst rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n\t\tsetSubMenuPosition({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t});\n\t\tpositionRef.current = {\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t};\n\t};\n\n\treturn (\n\t\t<MenuItemWrapper\n\t\t\tversion={version}\n\t\t\tonMouseEnter={(event) => {\n\t\t\t\tif (canOpenSubMenu) {\n\t\t\t\t\tsetIsSubMenuOpen(true);\n\t\t\t\t\tcalculateSubMenuPosition(event);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetIsSubMenuOpen(false);\n\t\t\t}}\n\t\t\tonClick={(e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\thandleDropdownOptionClick();\n\t\t\t}}\n\t\t\tid=\"menuItemWrapper\"\n\t\t\tstyle={{\n\t\t\t\tcursor: option.disabled ?? false ? 'not-allowed' : 'pointer',\n\t\t\t\tbackgroundColor:\n\t\t\t\t\toption.disabled ?? false ? COLORS.surface.standard : 'transparent',\n\t\t\t}}\n\t\t>\n\t\t\t{option.customComponent ? (\n\t\t\t\toption.customComponent\n\t\t\t) : (\n\t\t\t\t<MenuItemContainer\n\t\t\t\t\tisSelected={option.selected}\n\t\t\t\t\tisSubMenuOpen={isSubMenuOpen}\n\t\t\t\t\tisHovered={isSubMenuHovered}\n\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\tversion={version}\n\t\t\t\t>\n\t\t\t\t\t<ContentContainer>\n\t\t\t\t\t\t{option.leadingIcon && (\n\t\t\t\t\t\t\t<LeadingIconContainer>{option.leadingIcon}</LeadingIconContainer>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{option.subText && (\n\t\t\t\t\t\t\t\t<BodyTiny\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t\tmarginTop: '2px',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{option.subText}\n\t\t\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ContentContainer>\n\t\t\t\t\t{hasChildren ? (\n\t\t\t\t\t\t<TrailingIconContainer>\n\t\t\t\t\t\t\t<ChevronRightIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t!canOpenSubMenu || (option.disabled ?? false)\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TrailingIconContainer>\n\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t<TrailingIconContainer>{option.trailingIcon}</TrailingIconContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t</MenuItemContainer>\n\t\t\t)}\n\n\t\t\t{!(option.disabled ?? false) &&\n\t\t\t\toption.children &&\n\t\t\t\toption.children.length > 0 &&\n\t\t\t\tcanOpenSubMenu &&\n\t\t\t\tisSubMenuOpen && (\n\t\t\t\t\t<SubMenuContainer\n\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\tclassName=\"submenu\"\n\t\t\t\t\t\tonMouseEnter={() => setIsSubMenuHovered(true)}\n\t\t\t\t\t\tonMouseLeave={() => setIsSubMenuHovered(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StyledSubMenuWrapper\n\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\ttop={subMenuPosition.top}\n\t\t\t\t\t\t\tleft={subMenuPosition.left}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SubMenuListContainer version={version}>\n\t\t\t\t\t\t\t\t{renderNestedMenu(\n\t\t\t\t\t\t\t\t\toption.children,\n\t\t\t\t\t\t\t\t\t[...parents, option],\n\t\t\t\t\t\t\t\t\tcurrentLevel + 1,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</SubMenuListContainer>\n\t\t\t\t\t\t</StyledSubMenuWrapper>\n\t\t\t\t\t</SubMenuContainer>\n\t\t\t\t)}\n\t\t</MenuItemWrapper>\n\t);\n};\n"],"names":["MenuItem","width","onDropdownItemClick","option","parents","allowParentSelection","maxLevels","currentLevel","renderNestedMenu","version","isSubMenuOpen","setIsSubMenuOpen","React","isSubMenuHovered","setIsSubMenuHovered","subMenuPosition","setSubMenuPosition","positionRef","useRef","hasChildren","canOpenSubMenu","handleDropdownOptionClick","calculateSubMenuPosition","event","rect","jsxs","MenuItemWrapper","e","COLORS","MenuItemContainer","ContentContainer","jsx","LeadingIconContainer","BodyCaption","BodyTiny","TrailingIconContainer","ChevronRightIcon","Fragment","SubMenuContainer","StyledSubMenuWrapper","SubMenuListContainer"],"mappings":";;;;;;AAoBO,MAAMA,IAaR,CAAC;AAAA,EACL,OAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAM,SAAS,EAAK,GACxD,CAACC,GAAkBC,CAAmB,IAAIF,EAAM,SAAS,EAAK,GAC9D,CAACG,GAAiBC,CAAkB,IAAIJ,EAAM,SAAS;AAAA,IAC5D,KAAK;AAAA,IACL,MAAM;AAAA,EAAA,CACN,GACKK,IAAcC,EAAY,EAAE,KAAK,GAAG,MAAM,GAAG,GAC7CC,IAAc,CAAC,CAAChB,EAAO,YAAYA,EAAO,SAAS,SAAS,GAC5DiB,IACLD,MAAgBb,MAAc,UAAaC,IAAeD,IAErDe,IAA4B,MAAM;AACvC,IAAI,CAACnB,MAAwBC,EAAO,YAAY,QAI5C,CAACgB,KAAed,MACnBH,EAAoBC,GAAQC,CAAO;AAAA,EAErC,GAEMkB,IAA2B,CAACC,MAA4B;AAC7D,UAAMC,IAAQD,EAAM,cAA8B,sBAAA;AAClD,IAAAP,EAAmB;AAAA,MAClB,KAAKQ,EAAK;AAAA,MACV,MAAMA,EAAK;AAAA,IAAA,CACX,GACDP,EAAY,UAAU;AAAA,MACrB,KAAKO,EAAK;AAAA,MACV,MAAMA,EAAK;AAAA,IAAA;AAAA,EAEb;AAEA,SACC,gBAAAC;AAAA,IAACC;AAAA,IAAA;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AA;AAAA,EAAA;AAIL;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as c, jsx as t, Fragment as
|
|
2
|
-
import { useState as n, useEffect as
|
|
1
|
+
import { jsxs as c, jsx as t, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as n, useEffect as h, useMemo as r } from "react";
|
|
3
3
|
import { RadioButtonContainer as S, RadioButtonIcon as y } from "./RadioButton.styled.js";
|
|
4
|
-
import { BodyCaption as m, TitleSmall as
|
|
4
|
+
import { BodyCaption as m, TitleSmall as C, BodySecondary as k, BodyPrimary as D } from "../TypographyStyle.js";
|
|
5
5
|
import { COLORS as i } from "../../constants/Theme.js";
|
|
6
6
|
const g = (e) => {
|
|
7
7
|
const l = r(
|
|
@@ -33,7 +33,6 @@ const g = (e) => {
|
|
|
33
33
|
e.isActive && /* @__PURE__ */ t(
|
|
34
34
|
"circle",
|
|
35
35
|
{
|
|
36
|
-
"data-test": "radio-checked-indicator",
|
|
37
36
|
cx: e.isSmall ? "8" : "10",
|
|
38
37
|
cy: e.isSmall ? "8" : "10",
|
|
39
38
|
r: e.isSmall ? 3 : 5,
|
|
@@ -50,11 +49,11 @@ const g = (e) => {
|
|
|
50
49
|
a(o), e.onValueChange?.(o, e.value);
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
|
-
|
|
52
|
+
h(() => {
|
|
54
53
|
a(e.isActive);
|
|
55
54
|
}, [e.isActive]);
|
|
56
|
-
const
|
|
57
|
-
|
|
55
|
+
const u = () => e.label ? e.boldOnChecked && l || e.alwaysBold ? /* @__PURE__ */ t(
|
|
56
|
+
C,
|
|
58
57
|
{
|
|
59
58
|
color: e.isDisabled ? i.text.disabled : i.text.primary,
|
|
60
59
|
children: e.label
|
|
@@ -66,7 +65,7 @@ const g = (e) => {
|
|
|
66
65
|
children: e.label
|
|
67
66
|
}
|
|
68
67
|
) : e.labelSize === "MEDIUM" ? /* @__PURE__ */ t(
|
|
69
|
-
|
|
68
|
+
k,
|
|
70
69
|
{
|
|
71
70
|
color: e.isDisabled ? i.text.disabled : i.text.primary,
|
|
72
71
|
children: e.label
|
|
@@ -77,7 +76,7 @@ const g = (e) => {
|
|
|
77
76
|
color: e.isDisabled ? i.text.disabled : i.text.primary,
|
|
78
77
|
children: e.label
|
|
79
78
|
}
|
|
80
|
-
) : /* @__PURE__ */ t(
|
|
79
|
+
) : /* @__PURE__ */ t(x, {});
|
|
81
80
|
return /* @__PURE__ */ c(
|
|
82
81
|
S,
|
|
83
82
|
{
|
|
@@ -118,7 +117,7 @@ const g = (e) => {
|
|
|
118
117
|
gap: e.gapBetweenBodyAndCaption || "0px"
|
|
119
118
|
},
|
|
120
119
|
children: [
|
|
121
|
-
|
|
120
|
+
u(),
|
|
122
121
|
e.caption && /* @__PURE__ */ t(
|
|
123
122
|
m,
|
|
124
123
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.js","sources":["../../../../src/components/radioButton/RadioButton.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport {\n\tRadioButtonContainer,\n\tRadioButtonIcon,\n} from '@src/components/radioButton/RadioButton.styled';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type RadioButtonProps = {\n\tisActive: boolean;\n\tisDisabled?: boolean;\n\tvalue?: string;\n\tlabel?: string;\n\tcaption?: string;\n\tonValueChange: (checked: boolean, value?: string) => void;\n\tskipHoverState?: boolean;\n\tsize?: 'DEFAULT' | 'SMALL';\n\tskipSelectingOff?: boolean;\n\tlabelSize?: 'DEFAULT' | 'MEDIUM';\n\tboldOnChecked?: boolean;\n\talwaysBold?: boolean;\n\tactiveColor?: string;\n\tgapBetweenBodyAndCaption?: string;\n\t'data-test'?: string;\n};\n\nconst CheckMark: React.FC<{\n\tisActive: boolean;\n\tisDisabled: boolean;\n\tisSmall: boolean;\n\tactiveColor?: string;\n}> = (props) => {\n\tconst fillColor = useMemo(\n\t\t() => props?.activeColor || COLORS.background.positive.vibrant,\n\t\t[props.activeColor],\n\t);\n\n\tconst strokeColor = useMemo(\n\t\t() =>\n\t\t\tprops.isDisabled\n\t\t\t\t? COLORS.content.inactive\n\t\t\t\t: props.isActive\n\t\t\t\t? fillColor\n\t\t\t\t: COLORS.content.primary,\n\t\t[props.isDisabled, props.isActive, fillColor],\n\t);\n\n\treturn (\n\t\t<svg\n\t\t\twidth={props.isSmall ? '16' : '20'}\n\t\t\theight={props.isSmall ? '16' : '20'}\n\t\t\tviewBox={props.isSmall ? '0 0 16 16' : '0 0 20 20'}\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<circle\n\t\t\t\tcx={props.isSmall ? '8' : '10'}\n\t\t\t\tcy={props.isSmall ? '8' : '10'}\n\t\t\t\tr={props.isSmall ? 6 : 9}\n\t\t\t\tstroke={strokeColor}\n\t\t\t\tstrokeWidth={props.isSmall ? 1.5 : 2}\n\t\t\t/>\n\t\t\t{props.isActive && (\n\t\t\t\t<circle\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sources":["../../../../src/components/radioButton/RadioButton.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport {\n\tRadioButtonContainer,\n\tRadioButtonIcon,\n} from '@src/components/radioButton/RadioButton.styled';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport type RadioButtonProps = {\n\tisActive: boolean;\n\tisDisabled?: boolean;\n\tvalue?: string;\n\tlabel?: string;\n\tcaption?: string;\n\tonValueChange: (checked: boolean, value?: string) => void;\n\tskipHoverState?: boolean;\n\tsize?: 'DEFAULT' | 'SMALL';\n\tskipSelectingOff?: boolean;\n\tlabelSize?: 'DEFAULT' | 'MEDIUM';\n\tboldOnChecked?: boolean;\n\talwaysBold?: boolean;\n\tactiveColor?: string;\n\tgapBetweenBodyAndCaption?: string;\n\t'data-test'?: string;\n};\n\nconst CheckMark: React.FC<{\n\tisActive: boolean;\n\tisDisabled: boolean;\n\tisSmall: boolean;\n\tactiveColor?: string;\n}> = (props) => {\n\tconst fillColor = useMemo(\n\t\t() => props?.activeColor || COLORS.background.positive.vibrant,\n\t\t[props.activeColor],\n\t);\n\n\tconst strokeColor = useMemo(\n\t\t() =>\n\t\t\tprops.isDisabled\n\t\t\t\t? COLORS.content.inactive\n\t\t\t\t: props.isActive\n\t\t\t\t? fillColor\n\t\t\t\t: COLORS.content.primary,\n\t\t[props.isDisabled, props.isActive, fillColor],\n\t);\n\n\treturn (\n\t\t<svg\n\t\t\twidth={props.isSmall ? '16' : '20'}\n\t\t\theight={props.isSmall ? '16' : '20'}\n\t\t\tviewBox={props.isSmall ? '0 0 16 16' : '0 0 20 20'}\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<circle\n\t\t\t\tcx={props.isSmall ? '8' : '10'}\n\t\t\t\tcy={props.isSmall ? '8' : '10'}\n\t\t\t\tr={props.isSmall ? 6 : 9}\n\t\t\t\tstroke={strokeColor}\n\t\t\t\tstrokeWidth={props.isSmall ? 1.5 : 2}\n\t\t\t/>\n\t\t\t{props.isActive && (\n\t\t\t\t<circle\n\t\t\t\t\tcx={props.isSmall ? '8' : '10'}\n\t\t\t\t\tcy={props.isSmall ? '8' : '10'}\n\t\t\t\t\tr={props.isSmall ? 3 : 5}\n\t\t\t\t\tfill={props.isDisabled ? COLORS.content.inactive : fillColor}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</svg>\n\t);\n};\n\nexport const RadioButton: React.FC<RadioButtonProps> = (props) => {\n\tconst [isActive, setIsActive] = useState(props.isActive || false);\n\tconst [isHovered, setIsHovered] = useState(false);\n\tconst [isClicked, setIsClicked] = useState(false);\n\n\tconst handleCheck = () => {\n\t\tif (props.skipSelectingOff) {\n\t\t\treturn;\n\t\t}\n\t\tif (!props.isDisabled) {\n\t\t\tconst newVal = !isActive;\n\t\t\tsetIsActive(newVal);\n\t\t\tprops.onValueChange?.(newVal, props.value);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tsetIsActive(props.isActive);\n\t}, [props.isActive]);\n\n\tconst renderLabel = () => {\n\t\tif (!props.label) {\n\t\t\treturn <></>;\n\t\t}\n\n\t\tif ((props.boldOnChecked && isActive) || props.alwaysBold) {\n\t\t\treturn (\n\t\t\t\t<TitleSmall\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</TitleSmall>\n\t\t\t);\n\t\t}\n\n\t\tif (props.size === 'SMALL') {\n\t\t\treturn (\n\t\t\t\t<BodyCaption\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodyCaption>\n\t\t\t);\n\t\t}\n\n\t\tif (props.labelSize === 'MEDIUM') {\n\t\t\treturn (\n\t\t\t\t<BodySecondary\n\t\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t\t>\n\t\t\t\t\t{props.label}\n\t\t\t\t</BodySecondary>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BodyPrimary\n\t\t\t\tcolor={props.isDisabled ? COLORS.text.disabled : COLORS.text.primary}\n\t\t\t>\n\t\t\t\t{props.label}\n\t\t\t</BodyPrimary>\n\t\t);\n\t};\n\n\treturn (\n\t\t<RadioButtonContainer\n\t\t\tdata-test={props['data-test']}\n\t\t\tonClick={handleCheck}\n\t\t\tonMouseEnter={() => setIsHovered(!props.skipHoverState)}\n\t\t\tonMouseLeave={() => setIsHovered(false)}\n\t\t\tonMouseDown={() => setIsClicked(!props.skipHoverState)}\n\t\t\tonMouseUp={() => setIsClicked(false)}\n\t\t\tstyle={props.caption ? { alignItems: 'flex-start' } : {}}\n\t\t>\n\t\t\t<RadioButtonIcon\n\t\t\t\tchecked={isActive}\n\t\t\t\thovered={isHovered}\n\t\t\t\tclicked={isClicked}\n\t\t\t\tisDisabled={props.isDisabled || false}\n\t\t\t\tsize={props.size}\n\t\t\t\tstyle={props.caption ? { margin: '2px 0' } : {}}\n\t\t\t>\n\t\t\t\t<CheckMark\n\t\t\t\t\tisSmall={props.size === 'SMALL'}\n\t\t\t\t\tisActive={isActive}\n\t\t\t\t\tisDisabled={props.isDisabled || false}\n\t\t\t\t\tactiveColor={props.activeColor}\n\t\t\t\t/>\n\t\t\t</RadioButtonIcon>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tgap: props.gapBetweenBodyAndCaption || '0px',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{renderLabel()}\n\t\t\t\t{props.caption && (\n\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\tprops.isDisabled ? COLORS.text.disabled : COLORS.text.secondary\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.caption}\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</RadioButtonContainer>\n\t);\n};\n"],"names":["CheckMark","props","fillColor","useMemo","COLORS","strokeColor","jsxs","jsx","RadioButton","isActive","setIsActive","useState","isHovered","setIsHovered","isClicked","setIsClicked","handleCheck","newVal","useEffect","renderLabel","TitleSmall","BodyCaption","BodySecondary","BodyPrimary","Fragment","RadioButtonContainer","RadioButtonIcon"],"mappings":";;;;;AA+BA,MAAMA,IAKD,CAACC,MAAU;AACf,QAAMC,IAAYC;AAAA,IACjB,MAAMF,GAAO,eAAeG,EAAO,WAAW,SAAS;AAAA,IACvD,CAACH,EAAM,WAAW;A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A,IAAiB,CAAA;AAAA,MAEtD,UAAA;AAAA,QAAA,gBAAAM;AAAA,UAACmB;AAAA,UAAA;AAAA,YACA,SAASjB;AAAA,YACT,SAASG;AAAA,YACT,SAASE;AAAA,YACT,YAAYb,EAAM,cAAc;AAAA,YAChC,MAAMA,EAAM;AAAA,YACZ,OAAOA,EAAM,UAAU,EAAE,QAAQ,QAAA,IAAY,CAAA;AAAA,YAE7C,UAAA,gBAAAM;AAAA,cAACP;AAAA,cAAA;AAAA,gBACA,SAASC,EAAM,SAAS;AAAA,gBACxB,UAAAQ;AAAA,gBACA,YAAYR,EAAM,cAAc;AAAA,gBAChC,aAAaA,EAAM;AAAA,cAAA;AAAA,YAAA;AAAA,UACpB;AAAA,QAAA;AAAA,QAED,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,OAAO;AAAA,cACN,SAAS;AAAA,cACT,eAAe;AAAA,cACf,KAAKL,EAAM,4BAA4B;AAAA,YAAA;AAAA,YAGvC,UAAA;AAAA,cAAAkB,EAAA;AAAA,cACAlB,EAAM,WACN,gBAAAM;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBACA,OACCpB,EAAM,aAAaG,EAAO,KAAK,WAAWA,EAAO,KAAK;AAAA,kBAGtD,UAAAH,EAAM;AAAA,gBAAA;AAAA,cAAA;AAAA,YACR;AAAA,UAAA;AAAA,QAAA;AAAA,MAEF;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useEffect as u } from "react";
|
|
3
3
|
import { RadioListStyled as f } from "./RadioList.styled.js";
|
|
4
4
|
import { TitleRegular as h, BodySecondary as O } from "../TypographyStyle.js";
|
|
5
|
-
import { COLORS as
|
|
6
|
-
import { RadioButton as
|
|
5
|
+
import { COLORS as C } from "../../constants/Theme.js";
|
|
6
|
+
import { RadioButton as v } from "../radioButton/RadioButton.js";
|
|
7
7
|
const T = (t) => {
|
|
8
8
|
const [n, s] = m(
|
|
9
9
|
t.listItems
|
|
@@ -12,35 +12,26 @@ const T = (t) => {
|
|
|
12
12
|
s(t.listItems);
|
|
13
13
|
}, [t.listItems]);
|
|
14
14
|
const d = (e, r) => {
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
i.value === r ? (
|
|
19
|
-
}), s(
|
|
15
|
+
let o;
|
|
16
|
+
const c = [...n];
|
|
17
|
+
c.forEach((i) => {
|
|
18
|
+
i.value === r ? (o = i, i.isActive = e) : i.isActive = !e;
|
|
19
|
+
}), s(c), t.onChange(o);
|
|
20
20
|
};
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
(t.title || t.subTitle) && /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ a(f, { children: [
|
|
22
|
+
(t.title || t.subTitle) && /* @__PURE__ */ a("div", { className: "title__container", children: [
|
|
23
23
|
t.title && /* @__PURE__ */ l(h, { children: t.title }),
|
|
24
|
-
t.subTitle && /* @__PURE__ */ l(O, { color:
|
|
24
|
+
t.subTitle && /* @__PURE__ */ l(O, { color: C.text.secondary, children: t.subTitle })
|
|
25
25
|
] }),
|
|
26
|
-
/* @__PURE__ */ l(
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ l("div", { style: t.listContainerStyles ?? {}, className: "list__container", children: n.map((e) => /* @__PURE__ */ l(
|
|
27
|
+
v,
|
|
28
28
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"data-test": e.value,
|
|
36
|
-
...e,
|
|
37
|
-
onValueChange: d,
|
|
38
|
-
boldOnChecked: t.boldOnChecked
|
|
39
|
-
},
|
|
40
|
-
e.value
|
|
41
|
-
))
|
|
42
|
-
}
|
|
43
|
-
)
|
|
29
|
+
...e,
|
|
30
|
+
onValueChange: d,
|
|
31
|
+
boldOnChecked: t.boldOnChecked
|
|
32
|
+
},
|
|
33
|
+
e.value
|
|
34
|
+
)) })
|
|
44
35
|
] });
|
|
45
36
|
};
|
|
46
37
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioList.js","sources":["../../../../src/components/radioList/RadioList.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { RadioButton, RadioButtonProps } from '@src/components/radioButton';\nimport { RadioListStyled } from '@src/components/radioList/RadioList.styled';\nimport { BodySecondary, TitleRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\ntype RadioListItem = Omit<RadioButtonProps, 'onValueChange'> & {\n\tvalue: string;\n};\n\nexport type RadioListProps = {\n\ttitle?: string;\n\tsubTitle?: string;\n\tlistItems: RadioListItem[];\n\tonChange: (option: RadioListItem) => void;\n\tlistContainerStyles?: React.CSSProperties;\n\tboldOnChecked?: boolean;\n};\n\nexport const RadioList: React.FC<RadioListProps> = (props) => {\n\tconst [listOptions, setListOptions] = useState<RadioListItem[]>(\n\t\tprops.listItems,\n\t);\n\n\tuseEffect(() => {\n\t\tsetListOptions(props.listItems);\n\t}, [props.listItems]);\n\n\tconst onOptionClicked = (checked: boolean, value: string | undefined) => {\n\t\tlet selectedOption;\n\t\tconst temptListOptions = [...listOptions];\n\t\ttemptListOptions.forEach((option) => {\n\t\t\tif (option.value === value) {\n\t\t\t\tselectedOption = option;\n\t\t\t\toption['isActive'] = checked;\n\t\t\t} else {\n\t\t\t\toption['isActive'] = !checked;\n\t\t\t}\n\t\t});\n\t\tsetListOptions(temptListOptions);\n\t\tprops.onChange(selectedOption);\n\t};\n\n\treturn (\n\t\t<RadioListStyled>\n\t\t\t{(props.title || props.subTitle) && (\n\t\t\t\t<div className=\"title__container\">\n\t\t\t\t\t{props.title && <TitleRegular>{props.title}</TitleRegular>}\n\t\t\t\t\t{props.subTitle && (\n\t\t\t\t\t\t<BodySecondary color={COLORS.text.secondary}>\n\t\t\t\t\t\t\t{props.subTitle}\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div
|
|
1
|
+
{"version":3,"file":"RadioList.js","sources":["../../../../src/components/radioList/RadioList.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { RadioButton, RadioButtonProps } from '@src/components/radioButton';\nimport { RadioListStyled } from '@src/components/radioList/RadioList.styled';\nimport { BodySecondary, TitleRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\ntype RadioListItem = Omit<RadioButtonProps, 'onValueChange'> & {\n\tvalue: string;\n};\n\nexport type RadioListProps = {\n\ttitle?: string;\n\tsubTitle?: string;\n\tlistItems: RadioListItem[];\n\tonChange: (option: RadioListItem) => void;\n\tlistContainerStyles?: React.CSSProperties;\n\tboldOnChecked?: boolean;\n};\n\nexport const RadioList: React.FC<RadioListProps> = (props) => {\n\tconst [listOptions, setListOptions] = useState<RadioListItem[]>(\n\t\tprops.listItems,\n\t);\n\n\tuseEffect(() => {\n\t\tsetListOptions(props.listItems);\n\t}, [props.listItems]);\n\n\tconst onOptionClicked = (checked: boolean, value: string | undefined) => {\n\t\tlet selectedOption;\n\t\tconst temptListOptions = [...listOptions];\n\t\ttemptListOptions.forEach((option) => {\n\t\t\tif (option.value === value) {\n\t\t\t\tselectedOption = option;\n\t\t\t\toption['isActive'] = checked;\n\t\t\t} else {\n\t\t\t\toption['isActive'] = !checked;\n\t\t\t}\n\t\t});\n\t\tsetListOptions(temptListOptions);\n\t\tprops.onChange(selectedOption);\n\t};\n\n\treturn (\n\t\t<RadioListStyled>\n\t\t\t{(props.title || props.subTitle) && (\n\t\t\t\t<div className=\"title__container\">\n\t\t\t\t\t{props.title && <TitleRegular>{props.title}</TitleRegular>}\n\t\t\t\t\t{props.subTitle && (\n\t\t\t\t\t\t<BodySecondary color={COLORS.text.secondary}>\n\t\t\t\t\t\t\t{props.subTitle}\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div style={props.listContainerStyles ?? {}} className=\"list__container\">\n\t\t\t\t{listOptions.map((listItem) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tkey={listItem.value}\n\t\t\t\t\t\t\t{...listItem}\n\t\t\t\t\t\t\tonValueChange={onOptionClicked}\n\t\t\t\t\t\t\tboldOnChecked={props.boldOnChecked}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</RadioListStyled>\n\t);\n};\n"],"names":["RadioList","props","listOptions","setListOptions","useState","useEffect","onOptionClicked","checked","value","selectedOption","temptListOptions","option","RadioListStyled","jsxs","jsx","TitleRegular","BodySecondary","COLORS","listItem","RadioButton"],"mappings":";;;;;;AAmBO,MAAMA,IAAsC,CAACC,MAAU;AAC7D,QAAM,CAACC,GAAaC,CAAc,IAAIC;AAAA,IACrCH,EAAM;AAAA,EAAA;AAGP,EAAAI,EAAU,MAAM;AACf,IAAAF,EAAeF,EAAM,SAAS;AAAA,EAC/B,GAAG,CAACA,EAAM,SAAS,CAAC;AAEpB,QAAMK,IAAkB,CAACC,GAAkBC,MAA8B;AACxE,QAAIC;AACJ,UAAMC,IAAmB,CAAC,GAAGR,CAAW;AACxC,IAAAQ,EAAiB,QAAQ,CAACC,MAAW;AACpC,MAAIA,EAAO,UAAUH,KACpBC,IAAiBE,GACjBA,EAAO,WAAcJ,KAErBI,EAAO,WAAc,CAACJ;AAAA,IAExB,CAAC,GACDJ,EAAeO,CAAgB,GAC/BT,EAAM,SAASQ,CAAc;AAAA,EAC9B;AAEA,2BACEG,GAAA,EACE,UAAA;AAAA,KAAAX,EAAM,SAASA,EAAM,aACtB,gBAAAY,EAAC,OAAA,EAAI,WAAU,oBACb,UAAA;AAAA,MAAAZ,EAAM,SAAS,gBAAAa,EAACC,GAAA,EAAc,UAAAd,EAAM,OAAM;AAAA,MAC1CA,EAAM,YACN,gBAAAa,EAACE,GAAA,EAAc,OAAOC,EAAO,KAAK,WAChC,UAAAhB,EAAM,SAAA,CACR;AAAA,IAAA,GAEF;AAAA,IAED,gBAAAa,EAAC,OAAA,EAAI,OAAOb,EAAM,uBAAuB,CAAA,GAAI,WAAU,mBACrD,UAAAC,EAAY,IAAI,CAACgB,MAEhB,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QAEC,GAAGD;AAAA,QACJ,eAAeZ;AAAA,QACf,eAAeL,EAAM;AAAA,MAAA;AAAA,MAHhBiB,EAAS;AAAA,IAAA,CAMhB,EAAA,CACF;AAAA,EAAA,GACD;AAEF;"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as B } from "react/jsx-runtime";
|
|
2
2
|
import { SearchIcon as E } from "../../assets/icons/searchIcon.js";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as c, useEffect as d } from "react";
|
|
4
4
|
import w from "../../assets/icons/cross.svg.js";
|
|
5
5
|
import { Input as x } from "../input/Input.js";
|
|
6
6
|
const O = (e) => {
|
|
7
7
|
const {
|
|
8
|
-
isEnabled:
|
|
8
|
+
isEnabled: o,
|
|
9
9
|
onEnter: h,
|
|
10
10
|
placeholder: C,
|
|
11
11
|
width: v,
|
|
12
12
|
variant: b,
|
|
13
13
|
validate: S,
|
|
14
14
|
isActive: i
|
|
15
|
-
} = e, [f, t] =
|
|
16
|
-
i ? "active" :
|
|
17
|
-
), [l, r] =
|
|
15
|
+
} = e, [f, t] = c("search"), [m, s] = c("default"), [k, n] = c(
|
|
16
|
+
i ? "active" : o ? "none" : "disabled"
|
|
17
|
+
), [l, r] = c(
|
|
18
18
|
e.initialValue || e.searchValue || ""
|
|
19
19
|
);
|
|
20
20
|
d(() => {
|
|
21
21
|
r(e.searchValue ?? ""), e.searchValue?.trim()?.length ? t("cross") : t("search");
|
|
22
22
|
}, [e.searchValue]), d(() => {
|
|
23
|
-
n(i ? "active" :
|
|
24
|
-
}, [
|
|
23
|
+
n(i ? "active" : o ? "none" : "disabled");
|
|
24
|
+
}, [o, i]), d(() => {
|
|
25
25
|
e.reset && g();
|
|
26
26
|
}, [e?.reset]);
|
|
27
27
|
const I = (a, u) => {
|
|
@@ -31,7 +31,7 @@ const O = (e) => {
|
|
|
31
31
|
}
|
|
32
32
|
a.trim().length ? t("cross") : t("search");
|
|
33
33
|
}, V = (a) => {
|
|
34
|
-
|
|
34
|
+
o && h(a);
|
|
35
35
|
}, g = () => {
|
|
36
36
|
t("search"), s("default"), r(""), e.onChange(""), n("none"), h("");
|
|
37
37
|
};
|
|
@@ -42,7 +42,7 @@ const O = (e) => {
|
|
|
42
42
|
id: "search-bar",
|
|
43
43
|
validate: S,
|
|
44
44
|
onFocus: () => {
|
|
45
|
-
l.length && t("cross"), m === "default" &&
|
|
45
|
+
l.length && t("cross"), m === "default" && o && (s("clicked"), n("active"));
|
|
46
46
|
},
|
|
47
47
|
width: v,
|
|
48
48
|
state: k,
|
|
@@ -53,8 +53,7 @@ const O = (e) => {
|
|
|
53
53
|
icon: w,
|
|
54
54
|
callback: () => {
|
|
55
55
|
g(), e.onClickCross && e.onClickCross();
|
|
56
|
-
}
|
|
57
|
-
"data-test": "search-clear-icon"
|
|
56
|
+
}
|
|
58
57
|
} : void 0,
|
|
59
58
|
onChangeText: I,
|
|
60
59
|
placeholder: C,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchBar.js","sources":["../../../../src/components/searchBar/searchBar.tsx"],"sourcesContent":["import { SearchIcon } from '@src/assets/icons/searchIcon';\nimport { useEffect, useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { ButtonProps } from '../button/model';\nimport { Input } from '../input/Input';\nimport { InputVariant } from '../input/Input.model';\n\nexport interface SearchBarProps {\n\twidth: string;\n\tisEnabled: boolean;\n\tonChange: (searchText: string) => void;\n\tonEnter: (searchText: string) => void;\n\tplaceholder: string;\n\tvariant: InputVariant;\n\tvalidate?: (input?: string | number) => [boolean, string];\n\tinitialValue?: string;\n\treset?: boolean;\n\tonClickCross?: () => void;\n\tisActive?: boolean;\n\tsuffixButton?: ButtonProps;\n\tsearchValue?: string;\n\t'data-test'?: string;\n}\n\ntype ActiveStates = 'none' | 'disabled' | 'active';\ntype Mode = 'default' | 'clicked';\n\nexport const SearchBar = (props: SearchBarProps) => {\n\tconst {\n\t\tisEnabled,\n\t\tonEnter,\n\t\tplaceholder,\n\t\twidth,\n\t\tvariant,\n\t\tvalidate,\n\t\tisActive,\n\t} = props;\n\tconst [icon, setIcon] = useState<string>('search');\n\tconst [mode, setMode] = useState<Mode>('default');\n\tconst [inputState, setInputState] = useState<ActiveStates>(\n\t\tisActive ? 'active' : isEnabled ? 'none' : 'disabled',\n\t);\n\tconst [value, setValue] = useState<string>(\n\t\tprops.initialValue || props.searchValue || '',\n\t);\n\n\tuseEffect(() => {\n\t\tsetValue(props.searchValue ?? '');\n\t\tif (props.searchValue?.trim()?.length) {\n\t\t\tsetIcon('cross');\n\t\t} else {\n\t\t\tsetIcon('search');\n\t\t}\n\t}, [props.searchValue]);\n\n\tuseEffect(() => {\n\t\tisActive\n\t\t\t? setInputState('active')\n\t\t\t: isEnabled\n\t\t\t? setInputState('none')\n\t\t\t: setInputState('disabled');\n\t}, [isEnabled, isActive]);\n\n\tuseEffect(() => {\n\t\tprops.reset && resetSearch();\n\t}, [props?.reset]);\n\n\tconst handleOnChange = (searchText: string, event: any) => {\n\t\tprops.onChange(searchText);\n\t\tsetValue(searchText);\n\n\t\tif (\n\t\t\tevent?.type === 'keydown' &&\n\t\t\t(event.which === 13 || event.keyCode === 13)\n\t\t) {\n\t\t\thandleEnter(searchText);\n\t\t\treturn;\n\t\t}\n\n\t\tif (searchText.trim().length) {\n\t\t\tsetIcon('cross');\n\t\t} else {\n\t\t\tsetIcon('search');\n\t\t}\n\t};\n\n\tconst handleEnter = (searchText: string) => {\n\t\tisEnabled && onEnter(searchText);\n\t};\n\n\tconst resetSearch = () => {\n\t\tsetIcon('search');\n\t\tsetMode('default');\n\t\tsetValue('');\n\t\tprops.onChange('');\n\t\tsetInputState('none');\n\t\tonEnter('');\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tdata-test={props['data-test']}\n\t\t\tid=\"search-bar\"\n\t\t\tvalidate={validate}\n\t\t\tonFocus={() => {\n\t\t\t\tif (value.length) setIcon('cross');\n\t\t\t\tif (mode === 'default') {\n\t\t\t\t\tif (isEnabled) {\n\t\t\t\t\t\tsetMode('clicked');\n\t\t\t\t\t\tsetInputState('active');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t\twidth={width}\n\t\t\tstate={inputState}\n\t\t\tleftIcon={\n\t\t\t\ticon === 'search' && mode === 'default'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ticon: SearchIcon,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trightIcon={\n\t\t\t\ticon === 'cross' && !props.suffixButton\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ticon: CrossIcon,\n\t\t\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\t\t\tresetSearch();\n\t\t\t\t\t\t\t\tprops.onClickCross && props.onClickCross();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t
|
|
1
|
+
{"version":3,"file":"searchBar.js","sources":["../../../../src/components/searchBar/searchBar.tsx"],"sourcesContent":["import { SearchIcon } from '@src/assets/icons/searchIcon';\nimport { useEffect, useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { ButtonProps } from '../button/model';\nimport { Input } from '../input/Input';\nimport { InputVariant } from '../input/Input.model';\n\nexport interface SearchBarProps {\n\twidth: string;\n\tisEnabled: boolean;\n\tonChange: (searchText: string) => void;\n\tonEnter: (searchText: string) => void;\n\tplaceholder: string;\n\tvariant: InputVariant;\n\tvalidate?: (input?: string | number) => [boolean, string];\n\tinitialValue?: string;\n\treset?: boolean;\n\tonClickCross?: () => void;\n\tisActive?: boolean;\n\tsuffixButton?: ButtonProps;\n\tsearchValue?: string;\n\t'data-test'?: string;\n}\n\ntype ActiveStates = 'none' | 'disabled' | 'active';\ntype Mode = 'default' | 'clicked';\n\nexport const SearchBar = (props: SearchBarProps) => {\n\tconst {\n\t\tisEnabled,\n\t\tonEnter,\n\t\tplaceholder,\n\t\twidth,\n\t\tvariant,\n\t\tvalidate,\n\t\tisActive,\n\t} = props;\n\tconst [icon, setIcon] = useState<string>('search');\n\tconst [mode, setMode] = useState<Mode>('default');\n\tconst [inputState, setInputState] = useState<ActiveStates>(\n\t\tisActive ? 'active' : isEnabled ? 'none' : 'disabled',\n\t);\n\tconst [value, setValue] = useState<string>(\n\t\tprops.initialValue || props.searchValue || '',\n\t);\n\n\tuseEffect(() => {\n\t\tsetValue(props.searchValue ?? '');\n\t\tif (props.searchValue?.trim()?.length) {\n\t\t\tsetIcon('cross');\n\t\t} else {\n\t\t\tsetIcon('search');\n\t\t}\n\t}, [props.searchValue]);\n\n\tuseEffect(() => {\n\t\tisActive\n\t\t\t? setInputState('active')\n\t\t\t: isEnabled\n\t\t\t? setInputState('none')\n\t\t\t: setInputState('disabled');\n\t}, [isEnabled, isActive]);\n\n\tuseEffect(() => {\n\t\tprops.reset && resetSearch();\n\t}, [props?.reset]);\n\n\tconst handleOnChange = (searchText: string, event: any) => {\n\t\tprops.onChange(searchText);\n\t\tsetValue(searchText);\n\n\t\tif (\n\t\t\tevent?.type === 'keydown' &&\n\t\t\t(event.which === 13 || event.keyCode === 13)\n\t\t) {\n\t\t\thandleEnter(searchText);\n\t\t\treturn;\n\t\t}\n\n\t\tif (searchText.trim().length) {\n\t\t\tsetIcon('cross');\n\t\t} else {\n\t\t\tsetIcon('search');\n\t\t}\n\t};\n\n\tconst handleEnter = (searchText: string) => {\n\t\tisEnabled && onEnter(searchText);\n\t};\n\n\tconst resetSearch = () => {\n\t\tsetIcon('search');\n\t\tsetMode('default');\n\t\tsetValue('');\n\t\tprops.onChange('');\n\t\tsetInputState('none');\n\t\tonEnter('');\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tdata-test={props['data-test']}\n\t\t\tid=\"search-bar\"\n\t\t\tvalidate={validate}\n\t\t\tonFocus={() => {\n\t\t\t\tif (value.length) setIcon('cross');\n\t\t\t\tif (mode === 'default') {\n\t\t\t\t\tif (isEnabled) {\n\t\t\t\t\t\tsetMode('clicked');\n\t\t\t\t\t\tsetInputState('active');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t\twidth={width}\n\t\t\tstate={inputState}\n\t\t\tleftIcon={\n\t\t\t\ticon === 'search' && mode === 'default'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ticon: SearchIcon,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trightIcon={\n\t\t\t\ticon === 'cross' && !props.suffixButton\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ticon: CrossIcon,\n\t\t\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\t\t\tresetSearch();\n\t\t\t\t\t\t\t\tprops.onClickCross && props.onClickCross();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonChangeText={handleOnChange}\n\t\t\tplaceholder={placeholder}\n\t\t\tvariant={variant}\n\t\t\tvalue={value}\n\t\t\tonBlur={() => {\n\t\t\t\tif (!value.length) {\n\t\t\t\t\tsetMode('default');\n\t\t\t\t}\n\t\t\t\tsetInputState('none');\n\t\t\t}}\n\t\t\tbutton={{ text: '', buttonProps: props.suffixButton }}\n\t\t/>\n\t);\n};\n"],"names":["SearchBar","props","isEnabled","onEnter","placeholder","width","variant","validate","isActive","icon","setIcon","useState","mode","setMode","inputState","setInputState","value","setValue","useEffect","resetSearch","handleOnChange","searchText","event","handleEnter","jsx","Input","SearchIcon","CrossIcon"],"mappings":";;;;;AA2BO,MAAMA,IAAY,CAACC,MAA0B;AACnD,QAAM;AAAA,IACL,WAAAC;AAAA,IACA,SAA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M,SAAS,EAAE,GACjBc,EAAc,MAAM,GACpBZ,EAAQ,EAAE;AAAA,EACX;AAEA,SACC,gBAAAqB;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,aAAWxB,EAAM,WAAW;AAAA,MAC5B,IAAG;AAAA,MACH,UAAAM;AAAA,MACA,SAAS,MAAM;AACd,QAAIS,EAAM,UAAQN,EAAQ,OAAO,GAC7BE,MAAS,aACRV,MACHW,EAAQ,SAAS,GACjBE,EAAc,QAAQ;AAAA,MAGzB;AAAA,MACA,OAAAV;AAAA,MACA,OAAOS;AAAA,MACP,UACCL,MAAS,YAAYG,MAAS,YAC3B;AAAA,QACA,MAAMc;AAAA,MAAA,IAEN;AAAA,MAEJ,WACCjB,MAAS,WAAW,CAACR,EAAM,eACxB;AAAA,QACA,MAAM0B;AAAAA,QACN,UAAU,MAAM;AACf,UAAAR,EAAA,GACAlB,EAAM,gBAAgBA,EAAM,aAAA;AAAA,QAC7B;AAAA,MAAA,IAEA;AAAA,MAEJ,cAAcmB;AAAA,MACd,aAAAhB;AAAA,MACA,SAAAE;AAAA,MACA,OAAAU;AAAA,MACA,QAAQ,MAAM;AACb,QAAKA,EAAM,UACVH,EAAQ,SAAS,GAElBE,EAAc,MAAM;AAAA,MACrB;AAAA,MACA,QAAQ,EAAE,MAAM,IAAI,aAAad,EAAM,aAAA;AAAA,IAAa;AAAA,EAAA;AAGvD;"}
|
|
@@ -3,7 +3,7 @@ import { useEffect as a } from "react";
|
|
|
3
3
|
import m from "react-dom";
|
|
4
4
|
import u from "../../assets/icons/cross.svg.js";
|
|
5
5
|
import { TitleMedium as h } from "../TypographyStyle.js";
|
|
6
|
-
import { SideModalStyle as f, SideModalContainer as y, SideModalHeader as
|
|
6
|
+
import { SideModalStyle as f, SideModalContainer as y, SideModalHeader as S, SideModalBody as C, SideModalFooter as s, FooterButtonWrapper as B } from "./SideModal.style.js";
|
|
7
7
|
import { Button as i } from "../button/Button.js";
|
|
8
8
|
const D = (e) => {
|
|
9
9
|
const { closeOnEscapeKey: n, onClose: d } = e;
|
|
@@ -18,28 +18,20 @@ const D = (e) => {
|
|
|
18
18
|
}, [n, d]), m.createPortal(
|
|
19
19
|
/* @__PURE__ */ t(f, { zIndex: e.zIndex, children: /* @__PURE__ */ o(y, { width: e.width, children: [
|
|
20
20
|
/* @__PURE__ */ o(
|
|
21
|
-
|
|
21
|
+
S,
|
|
22
22
|
{
|
|
23
23
|
headerStyle: {
|
|
24
24
|
...e.headerStyle
|
|
25
25
|
},
|
|
26
26
|
children: [
|
|
27
27
|
e?.headerCustomComponent || /* @__PURE__ */ t(h, { children: e.header }),
|
|
28
|
-
!e.hideCrossButton && /* @__PURE__ */ t(
|
|
29
|
-
u,
|
|
30
|
-
{
|
|
31
|
-
width: 24,
|
|
32
|
-
height: 24,
|
|
33
|
-
onClick: e.onClose,
|
|
34
|
-
"data-test": "side-modal-close-button"
|
|
35
|
-
}
|
|
36
|
-
),
|
|
28
|
+
!e.hideCrossButton && /* @__PURE__ */ t(u, { width: 24, height: 24, onClick: e.onClose }),
|
|
37
29
|
" "
|
|
38
30
|
]
|
|
39
31
|
}
|
|
40
32
|
),
|
|
41
33
|
/* @__PURE__ */ o(
|
|
42
|
-
|
|
34
|
+
C,
|
|
43
35
|
{
|
|
44
36
|
hideFooter: e.hideFooter,
|
|
45
37
|
bodyStyle: {
|
|
@@ -52,7 +44,7 @@ const D = (e) => {
|
|
|
52
44
|
}
|
|
53
45
|
),
|
|
54
46
|
e.hideFooter === !0 ? null : /* @__PURE__ */ o(
|
|
55
|
-
|
|
47
|
+
s,
|
|
56
48
|
{
|
|
57
49
|
footerDirection: e.footerDirection,
|
|
58
50
|
footerStyle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideModal.js","sources":["../../../../src/components/side-modal/SideModal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport ReactDOM from 'react-dom';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { TitleMedium } from '../TypographyStyle';\nimport {\n\tFooterButtonWrapper,\n\tSideModalBody,\n\tSideModalContainer,\n\tSideModalFooter,\n\tSideModalHeader,\n\tSideModalStyle,\n} from './SideModal.style';\n\nexport interface SideModalProps {\n\theader: string;\n\tchildren: React.ReactNode;\n\theaderCustomComponent?: React.ReactNode;\n\tfooterCustomComponent?: React.ReactNode;\n\tfooterDirection?: 'row' | 'row-reverse';\n\thideCrossButton?: boolean;\n\twidth?: string;\n\tsaveButtonProps?: ButtonProps;\n\tcancelButtonProps?: ButtonProps;\n\tonClose: () => void;\n\tzIndex?: number;\n\thideFooter?: boolean;\n\tbodyStyle?: React.CSSProperties;\n\telement?: Element | DocumentFragment;\n\theaderStyle?: React.CSSProperties;\n\tfooterStyle?: React.CSSProperties;\n\tcloseOnEscapeKey?: boolean;\n}\n\nexport const SideModal: React.FC<SideModalProps> = (props) => {\n\tconst { closeOnEscapeKey, onClose } = props;\n\n\t// Escape key handler - enabled by default\n\tuseEffect(() => {\n\t\t// Guard: Escape key must be enabled (default: true)\n\n\t\tconst escapeEnabled = closeOnEscapeKey ?? true;\n\t\tif (!escapeEnabled) return;\n\n\t\tconst handleEscapeKey = (event: KeyboardEvent) => {\n\t\t\tif (event.key !== 'Escape') return;\n\n\t\t\tonClose();\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleEscapeKey);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('keydown', handleEscapeKey);\n\t\t};\n\t}, [closeOnEscapeKey, onClose]);\n\n\treturn ReactDOM.createPortal(\n\t\t<SideModalStyle zIndex={props.zIndex}>\n\t\t\t<SideModalContainer width={props.width}>\n\t\t\t\t<SideModalHeader\n\t\t\t\t\theaderStyle={{\n\t\t\t\t\t\t...props.headerStyle,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{props?.headerCustomComponent || (\n\t\t\t\t\t\t<TitleMedium>{props.header}</TitleMedium>\n\t\t\t\t\t)}\n\t\t\t\t\t{!props.hideCrossButton && (\n\t\t\t\t\t\t<CrossIcon
|
|
1
|
+
{"version":3,"file":"SideModal.js","sources":["../../../../src/components/side-modal/SideModal.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport ReactDOM from 'react-dom';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { TitleMedium } from '../TypographyStyle';\nimport {\n\tFooterButtonWrapper,\n\tSideModalBody,\n\tSideModalContainer,\n\tSideModalFooter,\n\tSideModalHeader,\n\tSideModalStyle,\n} from './SideModal.style';\n\nexport interface SideModalProps {\n\theader: string;\n\tchildren: React.ReactNode;\n\theaderCustomComponent?: React.ReactNode;\n\tfooterCustomComponent?: React.ReactNode;\n\tfooterDirection?: 'row' | 'row-reverse';\n\thideCrossButton?: boolean;\n\twidth?: string;\n\tsaveButtonProps?: ButtonProps;\n\tcancelButtonProps?: ButtonProps;\n\tonClose: () => void;\n\tzIndex?: number;\n\thideFooter?: boolean;\n\tbodyStyle?: React.CSSProperties;\n\telement?: Element | DocumentFragment;\n\theaderStyle?: React.CSSProperties;\n\tfooterStyle?: React.CSSProperties;\n\tcloseOnEscapeKey?: boolean;\n}\n\nexport const SideModal: React.FC<SideModalProps> = (props) => {\n\tconst { closeOnEscapeKey, onClose } = props;\n\n\t// Escape key handler - enabled by default\n\tuseEffect(() => {\n\t\t// Guard: Escape key must be enabled (default: true)\n\n\t\tconst escapeEnabled = closeOnEscapeKey ?? true;\n\t\tif (!escapeEnabled) return;\n\n\t\tconst handleEscapeKey = (event: KeyboardEvent) => {\n\t\t\tif (event.key !== 'Escape') return;\n\n\t\t\tonClose();\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleEscapeKey);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('keydown', handleEscapeKey);\n\t\t};\n\t}, [closeOnEscapeKey, onClose]);\n\n\treturn ReactDOM.createPortal(\n\t\t<SideModalStyle zIndex={props.zIndex}>\n\t\t\t<SideModalContainer width={props.width}>\n\t\t\t\t<SideModalHeader\n\t\t\t\t\theaderStyle={{\n\t\t\t\t\t\t...props.headerStyle,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{props?.headerCustomComponent || (\n\t\t\t\t\t\t<TitleMedium>{props.header}</TitleMedium>\n\t\t\t\t\t)}\n\t\t\t\t\t{!props.hideCrossButton && (\n\t\t\t\t\t\t<CrossIcon width={24} height={24} onClick={props.onClose} />\n\t\t\t\t\t)}{' '}\n\t\t\t\t</SideModalHeader>\n\t\t\t\t<SideModalBody\n\t\t\t\t\thideFooter={props.hideFooter}\n\t\t\t\t\tbodyStyle={{\n\t\t\t\t\t\t...props.bodyStyle,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{props.children}{' '}\n\t\t\t\t</SideModalBody>\n\t\t\t\t{props.hideFooter === true ? null : (\n\t\t\t\t\t<SideModalFooter\n\t\t\t\t\t\tfooterDirection={props.footerDirection}\n\t\t\t\t\t\tfooterStyle={{\n\t\t\t\t\t\t\t...props.footerStyle,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{(props.saveButtonProps || props.cancelButtonProps) && (\n\t\t\t\t\t\t\t<FooterButtonWrapper footerDirection={props.footerDirection}>\n\t\t\t\t\t\t\t\t{props.saveButtonProps && <Button {...props.saveButtonProps} />}\n\t\t\t\t\t\t\t\t{props.cancelButtonProps && (\n\t\t\t\t\t\t\t\t\t<Button {...props.cancelButtonProps} />\n\t\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t</FooterButtonWrapper>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.footerCustomComponent ? props.footerCustomComponent : <></>}{' '}\n\t\t\t\t\t</SideModalFooter>\n\t\t\t\t)}{' '}\n\t\t\t</SideModalContainer>\n\t\t</SideModalStyle>,\n\t\tprops.element ?? document.body,\n\t);\n};\n"],"names":["SideModal","props","closeOnEscapeKey","onClose","useEffect","handleEscapeKey","event","ReactDOM","jsx","SideModalStyle","jsxs","SideModalContainer","SideModalHeader","TitleMedium","CrossIcon","SideModalBody","SideModalFooter","FooterButtonWrapper","Button","Fragment"],"mappings":";;;;;;;AAmCO,MAAMA,IAAsC,CAACC,MAAU;AAC7D,QAAM,EAAE,kBAAAC,GAAkB,SAAAC,EAAA,IAAYF;AAGtC,SAAAG,EAAU,MAAM;AAIf,QAAI,EADkBF,KAAoB,IACtB;AAEpB,UAAMG,IAAkB,CAACC,MAAyB;AACjD,MAAIA,EAAM,QAAQ,YAElBH,EAAA;AAAA,IACD;AAEA,oBAAS,iBAAiB,WAAWE,CAAe,GAE7C,MAAM;AACZ,eAAS,oBAAoB,WAAWA,CAAe;AAAA,IACxD;AAAA,EACD,GAAG,CAACH,GAAkBC,CAAO,CAAC,GAEvBI,EAAS;AAAA,IACf,gBAAAC,EAACC,KAAe,QAAQR,EAAM,QAC7B,UAAA,gBAAAS,EAACC,GAAA,EAAmB,OAAOV,EAAM,OAChC,UAAA;AAAA,MAAA,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACA,aAAa;AAAA,YACZ,GAAGX,EAAM;AAAA,UAAA;AAAA,UAGT,UAAA;AAAA,YAAAA,GAAO,yBACP,gBAAAO,EAACK,GAAA,EAAa,UAAAZ,EAAM,QAAO;AAAA,YAE3B,CAACA,EAAM,mBACP,gBAAAO,EAACM,GAAA,EAAU,OAAO,IAAI,QAAQ,IAAI,SAASb,EAAM,QAAA,CAAS;AAAA,YACxD;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJ,gBAAAS;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,YAAYd,EAAM;AAAA,UAClB,WAAW;AAAA,YACV,GAAGA,EAAM;AAAA,UAAA;AAAA,UAGT,UAAA;AAAA,YAAAA,EAAM;AAAA,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEjBA,EAAM,eAAe,KAAO,OAC5B,gBAAAS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