@spaced-out/ui-design-system 0.5.11 → 0.5.12
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/CHANGELOG.md +17 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -0
- package/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.js +29 -4
- package/lib/components/Accordion/AccordionGroup.d.ts +2 -1
- package/lib/components/Accordion/AccordionGroup.d.ts.map +1 -1
- package/lib/components/Accordion/AccordionGroup.js +13 -2
- package/lib/components/Avatar/Avatar.d.ts +3 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +58 -11
- package/lib/components/AvatarGroup/AvatarGroup.d.ts +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +27 -3
- package/lib/components/Badge/Badge.d.ts +1 -0
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +22 -5
- package/lib/components/BadgedIcon/BadgedIcon.d.ts +2 -1
- package/lib/components/BadgedIcon/BadgedIcon.d.ts.map +1 -1
- package/lib/components/BadgedIcon/BadgedIcon.js +20 -4
- package/lib/components/Banner/Banner.d.ts +1 -0
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +2 -0
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts +1 -0
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbLink/BreadcrumbLink.js +6 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +31 -11
- package/lib/components/Button/Button.d.ts +1 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +50 -6
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts +1 -0
- package/lib/components/ButtonDropdown/ButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/ButtonDropdown.js +22 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts +1 -0
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.js +2 -0
- package/lib/components/ChatBubble/ChatBubble.d.ts +13 -6
- package/lib/components/ChatBubble/ChatBubble.d.ts.map +1 -1
- package/lib/components/ChatBubble/ChatBubble.js +57 -14
- package/lib/components/Checkbox/Checkbox.d.ts +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +34 -5
- package/lib/components/Checkbox/CheckboxGroup.d.ts +1 -0
- package/lib/components/Checkbox/CheckboxGroup.d.ts.map +1 -1
- package/lib/components/Checkbox/CheckboxGroup.js +21 -2
- package/lib/components/Chip/Chip.d.ts +1 -0
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.js +24 -3
- package/lib/components/CollapsibleCard/CollapsibleCard.d.ts +5 -2
- package/lib/components/CollapsibleCard/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/CollapsibleCard/CollapsibleCard.js +46 -7
- package/lib/components/Dialog/Dialog.d.ts +10 -5
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +76 -11
- package/lib/components/Dropdown/Dropdown.d.ts +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +19 -2
- package/lib/components/Dropdown/SimpleDropdown.d.ts +1 -0
- package/lib/components/Dropdown/SimpleDropdown.d.ts.map +1 -1
- package/lib/components/Dropdown/SimpleDropdown.js +2 -0
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts +1 -0
- package/lib/components/FileUpload/FileBlock/FileBlock.d.ts.map +1 -1
- package/lib/components/FileUpload/FileBlock/FileBlock.js +58 -10
- package/lib/components/FileUpload/FileUpload.d.ts +1 -0
- package/lib/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/lib/components/FileUpload/FileUpload.js +30 -4
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts +2 -0
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts.map +1 -1
- package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.js +11 -1
- package/lib/components/FormTitleWrapper/FormTitleWrapper.d.ts +1 -0
- package/lib/components/FormTitleWrapper/FormTitleWrapper.d.ts.map +1 -1
- package/lib/components/FormTitleWrapper/FormTitleWrapper.js +24 -3
- package/lib/components/Icon/ClickableIcon.d.ts +2 -0
- package/lib/components/Icon/ClickableIcon.d.ts.map +1 -1
- package/lib/components/Icon/ClickableIcon.js +13 -1
- package/lib/components/Icon/Icon.docs.d.ts +11 -0
- package/lib/components/Icon/Icon.docs.d.ts.map +1 -1
- package/lib/components/Icon/Icon.docs.js +11 -0
- package/lib/components/Icon/SemanticIcon.d.ts +2 -1
- package/lib/components/Icon/SemanticIcon.d.ts.map +1 -1
- package/lib/components/Icon/SemanticIcon.js +11 -1
- package/lib/components/InContextAlert/InContextAlert.d.ts +3 -1
- package/lib/components/InContextAlert/InContextAlert.d.ts.map +1 -1
- package/lib/components/InContextAlert/InContextAlert.js +58 -10
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts +1 -0
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.d.ts.map +1 -1
- package/lib/components/InContextAlertWithMultipleActions/InContextAlertWithMultipleActions.js +30 -3
- package/lib/components/KPIBox/KPIBox.d.ts +1 -0
- package/lib/components/KPIBox/KPIBox.d.ts.map +1 -1
- package/lib/components/KPIBox/KPIBox.js +27 -2
- package/lib/components/Link/Link.d.ts +1 -0
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +24 -2
- package/lib/components/Menu/Menu.d.ts +2 -0
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +64 -7
- package/lib/components/Menu/MenuOptionButton.d.ts +1 -0
- package/lib/components/Menu/MenuOptionButton.d.ts.map +1 -1
- package/lib/components/Menu/MenuOptionButton.js +84 -8
- package/lib/components/Modal/Modal.d.ts +9 -5
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +48 -5
- package/lib/components/Notification/Notification.d.ts +1 -0
- package/lib/components/Notification/Notification.d.ts.map +1 -1
- package/lib/components/Notification/Notification.js +24 -4
- package/lib/components/PageTitle/PageTitle.d.ts +7 -3
- package/lib/components/PageTitle/PageTitle.d.ts.map +1 -1
- package/lib/components/PageTitle/PageTitle.js +41 -4
- package/lib/components/Panel/Panel.d.ts +7 -3
- package/lib/components/Panel/Panel.d.ts.map +1 -1
- package/lib/components/Panel/Panel.js +34 -4
- package/lib/components/ProgressDonut/ProgressDonut.d.ts +1 -0
- package/lib/components/ProgressDonut/ProgressDonut.d.ts.map +1 -1
- package/lib/components/ProgressDonut/ProgressDonut.js +11 -2
- package/lib/components/PromptChip/PromptChip.d.ts +1 -0
- package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.js +42 -5
- package/lib/components/PromptInput/PromptInput.d.ts +1 -0
- package/lib/components/PromptInput/PromptInput.d.ts.map +1 -1
- package/lib/components/PromptInput/PromptInput.js +24 -3
- package/lib/components/RadioButton/RadioButton.d.ts +1 -0
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js +14 -0
- package/lib/components/RadioButton/RadioGroup.d.ts +1 -0
- package/lib/components/RadioButton/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioGroup.js +17 -2
- package/lib/components/RadioTile/RadioTile.d.ts +1 -0
- package/lib/components/RadioTile/RadioTile.d.ts.map +1 -1
- package/lib/components/RadioTile/RadioTile.js +31 -6
- package/lib/components/RangeSlider/RangeSlider.d.ts +1 -0
- package/lib/components/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/lib/components/RangeSlider/RangeSlider.js +33 -4
- package/lib/components/Rating/Rating.d.ts +1 -0
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js +22 -3
- package/lib/components/ScoreBar/ScoreBar.d.ts +1 -0
- package/lib/components/ScoreBar/ScoreBar.d.ts.map +1 -1
- package/lib/components/ScoreBar/ScoreBar.js +16 -2
- package/lib/components/SearchInput/SearchInput.d.ts +1 -0
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +20 -2
- package/lib/components/SideMenuLink/SideMenuLink.d.ts +1 -0
- package/lib/components/SideMenuLink/SideMenuLink.d.ts.map +1 -1
- package/lib/components/SideMenuLink/SideMenuLink.js +33 -3
- package/lib/components/Stepper/Step/Step.d.ts +1 -0
- package/lib/components/Stepper/Step/Step.d.ts.map +1 -1
- package/lib/components/Stepper/Step/Step.js +30 -4
- package/lib/components/Stepper/Step/StepContent.d.ts +2 -1
- package/lib/components/Stepper/Step/StepContent.d.ts.map +1 -1
- package/lib/components/Stepper/Step/StepContent.js +7 -1
- package/lib/components/Stepper/Step/StepLabel.d.ts +2 -1
- package/lib/components/Stepper/Step/StepLabel.d.ts.map +1 -1
- package/lib/components/Stepper/Step/StepLabel.js +7 -1
- package/lib/components/Stepper/Stepper.d.ts +1 -0
- package/lib/components/Stepper/Stepper.d.ts.map +1 -1
- package/lib/components/Stepper/Stepper.js +13 -2
- package/lib/components/SubMenu/SubMenu.d.ts +1 -0
- package/lib/components/SubMenu/SubMenu.d.ts.map +1 -1
- package/lib/components/SubMenu/SubMenu.js +21 -3
- package/lib/components/TextTile/TextTile.d.ts +1 -0
- package/lib/components/TextTile/TextTile.d.ts.map +1 -1
- package/lib/components/TextTile/TextTile.js +24 -3
- package/lib/components/Textarea/Textarea.d.ts +1 -0
- package/lib/components/Textarea/Textarea.d.ts.map +1 -1
- package/lib/components/Textarea/Textarea.js +38 -0
- package/lib/components/Timeline/Timeline.d.ts +1 -0
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +15 -4
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts +2 -0
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem/TimelineItem.js +46 -4
- package/lib/components/Toast/Toast.d.ts +6 -2
- package/lib/components/Toast/Toast.d.ts.map +1 -1
- package/lib/components/Toast/Toast.js +81 -14
- package/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +23 -1
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.d.ts +2 -1
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.d.ts.map +1 -1
- package/lib/components/TruncatedTextWithTooltip/TruncatedTextWithTooltip.js +15 -1
- package/lib/components/Typeahead/SimpleTypeahead.d.ts +1 -0
- package/lib/components/Typeahead/SimpleTypeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/SimpleTypeahead.js +3 -1
- package/lib/components/Typeahead/Typeahead.d.ts +1 -0
- package/lib/components/Typeahead/Typeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.js +19 -2
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts +1 -0
- package/lib/components/WeekdayPicker/WeekdayPicker.d.ts.map +1 -1
- package/lib/components/WeekdayPicker/WeekdayPicker.js +16 -4
- package/package.json +1 -1
|
@@ -59,6 +59,7 @@ export interface BaseLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAncho
|
|
|
59
59
|
iconRightName?: string;
|
|
60
60
|
iconRightSize?: IconSize;
|
|
61
61
|
iconRightType?: IconType;
|
|
62
|
+
testId?: string;
|
|
62
63
|
/**
|
|
63
64
|
* IMPORTANT: If you are using `to` make sure to provide link component from your router
|
|
64
65
|
* if you want to prevent full page reloads in a Single Page Application (SPA).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAMrD,OAAO,KAAK,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAM5D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;EAiBlB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE5D,eAAO,MAAM,UAAU;;;;;;;;;;;;;EAarB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE,eAAO,MAAM,aAAa;;;;;;EAMxB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE9E,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,KAAK,CAAC,oBAAo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BAAiB,CACvC,SAAS,EACT,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAiHrC,CAAC"}
|
|
@@ -7,6 +7,7 @@ exports.Link = exports.LINK_AS = exports.ANCHOR_TARGET = exports.ANCHOR_REL = vo
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _typography = require("../../types/typography");
|
|
9
9
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
10
|
+
var _qa = require("../../utils/qa");
|
|
10
11
|
var _ConditionalWrapper = require("../ConditionalWrapper");
|
|
11
12
|
var _Icon = require("../Icon");
|
|
12
13
|
var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
|
|
@@ -62,6 +63,7 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
62
63
|
tabIndex = 0,
|
|
63
64
|
disabled,
|
|
64
65
|
onClick,
|
|
66
|
+
testId,
|
|
65
67
|
linkComponent: LinkComponent = DefaultLink,
|
|
66
68
|
iconLeftName,
|
|
67
69
|
iconLeftSize = _Icon.ICON_SIZE.small,
|
|
@@ -101,7 +103,10 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
101
103
|
...props,
|
|
102
104
|
tabIndex: disabled ? -1 : tabIndex,
|
|
103
105
|
ref: linkRef,
|
|
104
|
-
|
|
106
|
+
testId: (0, _qa.generateTestId)({
|
|
107
|
+
base: testId,
|
|
108
|
+
slot: 'root'
|
|
109
|
+
}),
|
|
105
110
|
className: (0, _classify.default)(_typographyModule.default.link, _typographyModule.default[as], _typographyModule.default[color], {
|
|
106
111
|
[_typographyModule.default.underline]: underline && !(iconLeftName || iconRightName),
|
|
107
112
|
[_typographyModule.default.disabled]: disabled
|
|
@@ -114,6 +119,10 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
114
119
|
type: iconLeftType,
|
|
115
120
|
className: (0, _classify.default)(_typographyModule.default[color], {
|
|
116
121
|
[_typographyModule.default.disabled]: disabled
|
|
122
|
+
}),
|
|
123
|
+
testId: (0, _qa.generateTestId)({
|
|
124
|
+
base: testId,
|
|
125
|
+
slot: 'icon-left'
|
|
117
126
|
})
|
|
118
127
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
|
|
119
128
|
condition: Boolean(iconLeftName || iconRightName),
|
|
@@ -121,6 +130,10 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
121
130
|
className: (0, _classify.default)({
|
|
122
131
|
[_typographyModule.default.underline]: underline
|
|
123
132
|
}),
|
|
133
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
134
|
+
base: testId,
|
|
135
|
+
slot: 'text'
|
|
136
|
+
}),
|
|
124
137
|
children: children
|
|
125
138
|
}),
|
|
126
139
|
children: children
|
|
@@ -128,7 +141,11 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
128
141
|
name: iconRightName,
|
|
129
142
|
size: iconRightSize,
|
|
130
143
|
type: iconRightType,
|
|
131
|
-
className: _typographyModule.default[color]
|
|
144
|
+
className: _typographyModule.default[color],
|
|
145
|
+
testId: (0, _qa.generateTestId)({
|
|
146
|
+
base: testId,
|
|
147
|
+
slot: 'icon-right'
|
|
148
|
+
})
|
|
132
149
|
})]
|
|
133
150
|
});
|
|
134
151
|
});
|
|
@@ -137,6 +154,7 @@ const DefaultLink = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
137
154
|
children,
|
|
138
155
|
href,
|
|
139
156
|
to,
|
|
157
|
+
testId,
|
|
140
158
|
...props
|
|
141
159
|
} = _ref2;
|
|
142
160
|
const resolvedHref = to ?? href;
|
|
@@ -144,6 +162,10 @@ const DefaultLink = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
144
162
|
...props,
|
|
145
163
|
href: resolvedHref,
|
|
146
164
|
ref: ref,
|
|
165
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
166
|
+
base: testId,
|
|
167
|
+
slot: 'root'
|
|
168
|
+
}),
|
|
147
169
|
children: children
|
|
148
170
|
});
|
|
149
171
|
});
|
|
@@ -26,6 +26,7 @@ export interface MenuOption {
|
|
|
26
26
|
optionVariant?: MenuOptionsVariant;
|
|
27
27
|
keepMenuOpenOnOptionSelect?: boolean;
|
|
28
28
|
indeterminate?: boolean;
|
|
29
|
+
testId?: string;
|
|
29
30
|
}
|
|
30
31
|
export interface BaseMenuProps {
|
|
31
32
|
onSelect?: (option: MenuOption, arg2?: React.SyntheticEvent<HTMLElement> | null | undefined) => unknown;
|
|
@@ -52,6 +53,7 @@ export interface BaseMenuProps {
|
|
|
52
53
|
};
|
|
53
54
|
showLabelTooltip?: MenuLabelTooltip;
|
|
54
55
|
allowWrap?: boolean;
|
|
56
|
+
testId?: string;
|
|
55
57
|
}
|
|
56
58
|
export interface MenuOptionTypes {
|
|
57
59
|
options?: Array<MenuOption>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAGrD,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAGrD,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAYrE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAQvD,KAAK,UAAU,GAAG,c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K,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,eAAe;CAAG;AAEpE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAsOD,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,cAAc,CAmF/D,CAAC"}
|
|
@@ -8,6 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactWindow = require("react-window");
|
|
9
9
|
var _classify = require("../../utils/classify");
|
|
10
10
|
var _menu = require("../../utils/menu");
|
|
11
|
+
var _qa = require("../../utils/qa");
|
|
11
12
|
var _MenuOptionButton = require("./MenuOptionButton");
|
|
12
13
|
var _SearchInput = require("../SearchInput");
|
|
13
14
|
var _Text = require("../Text");
|
|
@@ -29,6 +30,7 @@ const RenderOption = _ref => {
|
|
|
29
30
|
classNames,
|
|
30
31
|
searchText = '',
|
|
31
32
|
showResultText = true,
|
|
33
|
+
testId,
|
|
32
34
|
staticLabels = {
|
|
33
35
|
RESULT: 'result',
|
|
34
36
|
RESULTS: 'results',
|
|
@@ -57,6 +59,10 @@ const RenderOption = _ref => {
|
|
|
57
59
|
children: [allowSearch && showResultText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.FormLabelSmall, {
|
|
58
60
|
className: _MenuModule.default.filterOptionsResultText,
|
|
59
61
|
color: "tertiary",
|
|
62
|
+
testId: (0, _qa.generateTestId)({
|
|
63
|
+
base: testId,
|
|
64
|
+
slot: 'result-text'
|
|
65
|
+
}),
|
|
60
66
|
children: finalResultText
|
|
61
67
|
}), virtualization && isVirtualizationEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactWindow.FixedSizeList, {
|
|
62
68
|
height: menuHeight || (size === 'medium' ? menuSizeMedium : menuSizeSmall),
|
|
@@ -75,7 +81,12 @@ const RenderOption = _ref => {
|
|
|
75
81
|
classNames: classNames,
|
|
76
82
|
style: style,
|
|
77
83
|
...restProps,
|
|
78
|
-
isLastItem: idx === optionsFiltered.length - 1
|
|
84
|
+
isLastItem: idx === optionsFiltered.length - 1,
|
|
85
|
+
testId: (0, _qa.generateTestId)({
|
|
86
|
+
base: testId,
|
|
87
|
+
slot: 'option',
|
|
88
|
+
index: idx.toString()
|
|
89
|
+
})
|
|
79
90
|
})
|
|
80
91
|
}, buttonOption.key);
|
|
81
92
|
}
|
|
@@ -84,7 +95,12 @@ const RenderOption = _ref => {
|
|
|
84
95
|
option: option,
|
|
85
96
|
classNames: classNames,
|
|
86
97
|
...restProps,
|
|
87
|
-
isLastItem: idx === optionsFiltered.length - 1
|
|
98
|
+
isLastItem: idx === optionsFiltered.length - 1,
|
|
99
|
+
testId: (0, _qa.generateTestId)({
|
|
100
|
+
base: testId,
|
|
101
|
+
slot: 'option',
|
|
102
|
+
index: idx.toString()
|
|
103
|
+
})
|
|
88
104
|
})
|
|
89
105
|
}, option.key))]
|
|
90
106
|
});
|
|
@@ -96,6 +112,10 @@ const RenderOption = _ref => {
|
|
|
96
112
|
children: [allowSearch && showResultText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.FormLabelSmall, {
|
|
97
113
|
className: _MenuModule.default.filterOptionsResultText,
|
|
98
114
|
color: "tertiary",
|
|
115
|
+
testId: (0, _qa.generateTestId)({
|
|
116
|
+
base: testId,
|
|
117
|
+
slot: 'result-text'
|
|
118
|
+
}),
|
|
99
119
|
children: finalResultText
|
|
100
120
|
}), optionsFiltered.map((composeMenuOptions, index) =>
|
|
101
121
|
/*#__PURE__*/
|
|
@@ -107,7 +127,12 @@ const RenderOption = _ref => {
|
|
|
107
127
|
option: option,
|
|
108
128
|
classNames: classNames,
|
|
109
129
|
...restProps,
|
|
110
|
-
isLastItem: index === optionsFiltered.length - 1 && idx === composeMenuOptions.length - 1
|
|
130
|
+
isLastItem: index === optionsFiltered.length - 1 && idx === composeMenuOptions.length - 1,
|
|
131
|
+
testId: (0, _qa.generateTestId)({
|
|
132
|
+
base: testId,
|
|
133
|
+
slot: 'option',
|
|
134
|
+
index: `${index}-${idx}`
|
|
135
|
+
})
|
|
111
136
|
})
|
|
112
137
|
}, option.key))
|
|
113
138
|
}, index))]
|
|
@@ -120,6 +145,10 @@ const RenderOption = _ref => {
|
|
|
120
145
|
children: [allowSearch && showResultText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.FormLabelSmall, {
|
|
121
146
|
className: _MenuModule.default.filterOptionsResultText,
|
|
122
147
|
color: "tertiary",
|
|
148
|
+
testId: (0, _qa.generateTestId)({
|
|
149
|
+
base: testId,
|
|
150
|
+
slot: 'result-text'
|
|
151
|
+
}),
|
|
123
152
|
children: finalResultText
|
|
124
153
|
}), optionsFiltered.map((optionsGroup, index) =>
|
|
125
154
|
/*#__PURE__*/
|
|
@@ -127,13 +156,23 @@ const RenderOption = _ref => {
|
|
|
127
156
|
(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
128
157
|
children: [!!optionsGroup.groupTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
129
158
|
className: (0, _classify.classify)(_MenuModule.default.groupTitleWrapper, classNames?.groupTitle),
|
|
159
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
160
|
+
base: testId,
|
|
161
|
+
slot: 'group-title',
|
|
162
|
+
index: index.toString()
|
|
163
|
+
}),
|
|
130
164
|
children: optionsGroup.groupTitle
|
|
131
165
|
}), optionsGroup.options?.map((option, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
132
166
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuOptionButton.MenuOptionButton, {
|
|
133
167
|
option: option,
|
|
134
168
|
classNames: classNames,
|
|
135
169
|
...restProps,
|
|
136
|
-
isLastItem: index === optionsFiltered.length - 1 && idx === (optionsGroup.options && optionsGroup.options.length - 1)
|
|
170
|
+
isLastItem: index === optionsFiltered.length - 1 && idx === (optionsGroup.options && optionsGroup.options.length - 1),
|
|
171
|
+
testId: (0, _qa.generateTestId)({
|
|
172
|
+
base: testId,
|
|
173
|
+
slot: 'option',
|
|
174
|
+
index: `${index}-${idx}`
|
|
175
|
+
})
|
|
137
176
|
})
|
|
138
177
|
}, option.key))]
|
|
139
178
|
}, index))]
|
|
@@ -155,7 +194,8 @@ const Menu = exports.Menu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
155
194
|
},
|
|
156
195
|
header,
|
|
157
196
|
footer,
|
|
158
|
-
staticLabels
|
|
197
|
+
staticLabels,
|
|
198
|
+
testId
|
|
159
199
|
} = props;
|
|
160
200
|
const [searchText, setSearchText] = React.useState('');
|
|
161
201
|
const {
|
|
@@ -182,20 +222,37 @@ const Menu = exports.Menu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
182
222
|
maxHeight: menuHeight ? menuHeight + 'px' : ''
|
|
183
223
|
},
|
|
184
224
|
ref: ref,
|
|
225
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
226
|
+
base: testId,
|
|
227
|
+
slot: 'wrapper'
|
|
228
|
+
}),
|
|
185
229
|
children: [hasHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
186
230
|
className: (0, _classify.classify)(_MenuModule.default.menuHeader, classNames?.header),
|
|
231
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
232
|
+
base: testId,
|
|
233
|
+
slot: 'header'
|
|
234
|
+
}),
|
|
187
235
|
children: header
|
|
188
236
|
}), allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchInput.SearchInput, {
|
|
189
237
|
value: searchText,
|
|
190
238
|
onChange: e => setSearchText(e.target.value),
|
|
191
239
|
onClear: () => setSearchText(''),
|
|
192
240
|
size: size,
|
|
193
|
-
placeholder: staticLabels?.SEARCH_PLACEHOLDER ?? 'Search...'
|
|
241
|
+
placeholder: staticLabels?.SEARCH_PLACEHOLDER ?? 'Search...',
|
|
242
|
+
testId: (0, _qa.generateTestId)({
|
|
243
|
+
base: testId,
|
|
244
|
+
slot: 'search'
|
|
245
|
+
})
|
|
194
246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(RenderOption, {
|
|
195
247
|
...props,
|
|
196
|
-
searchText: searchText
|
|
248
|
+
searchText: searchText,
|
|
249
|
+
testId: testId
|
|
197
250
|
}), hasFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
198
251
|
className: (0, _classify.classify)(_MenuModule.default.menuFooter, classNames?.footer),
|
|
252
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
253
|
+
base: testId,
|
|
254
|
+
slot: 'footer'
|
|
255
|
+
}),
|
|
199
256
|
children: footer
|
|
200
257
|
})]
|
|
201
258
|
});
|
|
@@ -5,6 +5,7 @@ export interface MenuOptionProps extends Omit<BaseMenuProps, 'option' | 'isLastI
|
|
|
5
5
|
option: MenuOption;
|
|
6
6
|
isLastItem?: boolean;
|
|
7
7
|
style?: CSSProperties | undefined;
|
|
8
|
+
testId?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const MenuOptionButton: (props: MenuOptionProps) => React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=MenuOptionButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuOptionButton.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuOptionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuOptionButton.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/MenuOptionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AASzC,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAQxE,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;IAC9D,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,eAAe,sBA+MtD,CAAC"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.MenuOptionButton = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = require("../../utils/classify");
|
|
9
|
+
var _qa = require("../../utils/qa");
|
|
9
10
|
var _Button = require("../Button");
|
|
10
11
|
var _Checkbox = require("../Checkbox");
|
|
11
12
|
var _Icon = require("../Icon");
|
|
@@ -33,7 +34,8 @@ const MenuOptionButton = props => {
|
|
|
33
34
|
resolveSecondaryLabel,
|
|
34
35
|
style,
|
|
35
36
|
showLabelTooltip,
|
|
36
|
-
allowWrap = false
|
|
37
|
+
allowWrap = false,
|
|
38
|
+
testId
|
|
37
39
|
} = props;
|
|
38
40
|
const {
|
|
39
41
|
key,
|
|
@@ -48,7 +50,8 @@ const MenuOptionButton = props => {
|
|
|
48
50
|
disabled,
|
|
49
51
|
optionSize,
|
|
50
52
|
optionVariant = optionsVariant,
|
|
51
|
-
indeterminate = false
|
|
53
|
+
indeterminate = false,
|
|
54
|
+
testId: optionTestId
|
|
52
55
|
} = option;
|
|
53
56
|
const [buttonSize, setButtonSize] = React.useState(optionSize || size);
|
|
54
57
|
const resolvedLabel = resolveLabel ? resolveLabel(option) : label;
|
|
@@ -87,6 +90,11 @@ const MenuOptionButton = props => {
|
|
|
87
90
|
disabled: menuDisabled || disabled,
|
|
88
91
|
onClick: e => onSelect && onSelect(option, e),
|
|
89
92
|
autoFocus: selectedOption?.key === key,
|
|
93
|
+
testId: (0, _qa.generateTestId)({
|
|
94
|
+
base: testId || optionTestId,
|
|
95
|
+
slot: 'option-button',
|
|
96
|
+
index: key
|
|
97
|
+
}),
|
|
90
98
|
...(isLastItem ? {
|
|
91
99
|
ref: lastMenuItemRef
|
|
92
100
|
} : {}),
|
|
@@ -94,25 +102,66 @@ const MenuOptionButton = props => {
|
|
|
94
102
|
tabIndex: -1,
|
|
95
103
|
disabled: menuDisabled || disabled,
|
|
96
104
|
checked: isSelected(),
|
|
97
|
-
indeterminate: indeterminate
|
|
105
|
+
indeterminate: indeterminate,
|
|
106
|
+
testId: (0, _qa.generateTestId)({
|
|
107
|
+
base: testId || optionTestId,
|
|
108
|
+
slot: 'checkbox',
|
|
109
|
+
index: key
|
|
110
|
+
})
|
|
98
111
|
}), optionVariant === 'radio' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadioButton.RadioButton, {
|
|
99
112
|
disabled: menuDisabled || disabled,
|
|
100
113
|
value: option.key,
|
|
101
114
|
selectedValue: selectedKeys?.[0],
|
|
102
|
-
tabIndex: -1
|
|
115
|
+
tabIndex: -1,
|
|
116
|
+
testId: (0, _qa.generateTestId)({
|
|
117
|
+
base: testId || optionTestId,
|
|
118
|
+
slot: 'radio-button',
|
|
119
|
+
index: key
|
|
120
|
+
})
|
|
103
121
|
}), !!iconLeft && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
104
122
|
name: iconLeft,
|
|
105
123
|
type: iconLeftType,
|
|
106
124
|
size: "small",
|
|
107
|
-
className: _MenuModule.default.icon
|
|
125
|
+
className: _MenuModule.default.icon,
|
|
126
|
+
testId: (0, _qa.generateTestId)({
|
|
127
|
+
base: testId || optionTestId,
|
|
128
|
+
slot: 'icon-left',
|
|
129
|
+
index: key
|
|
130
|
+
})
|
|
108
131
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
109
132
|
className: (0, _classify.classify)(_MenuModule.default.optionTextContainer, classNames?.optionTextContainer),
|
|
133
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
134
|
+
base: testId || optionTestId,
|
|
135
|
+
slot: 'text-container',
|
|
136
|
+
index: key
|
|
137
|
+
}),
|
|
110
138
|
children: [/*#__PURE__*/React.isValidElement(customComponent) ? customComponent : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
111
139
|
className: (0, _classify.classify)(_MenuModule.default.optionTextLabel, classNames?.optionTextLabel),
|
|
112
|
-
|
|
140
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
141
|
+
base: testId || optionTestId,
|
|
142
|
+
slot: 'label',
|
|
143
|
+
index: key
|
|
144
|
+
}),
|
|
145
|
+
children: renderLabel({
|
|
146
|
+
label: resolvedLabel,
|
|
147
|
+
allowWrap,
|
|
148
|
+
showLabelTooltip,
|
|
149
|
+
testId: testId || optionTestId,
|
|
150
|
+
key
|
|
151
|
+
})
|
|
113
152
|
}), !!secondaryLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
114
153
|
className: _MenuModule.default.optionTextSecondaryLabel,
|
|
154
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
155
|
+
base: testId || optionTestId,
|
|
156
|
+
slot: 'secondary-label',
|
|
157
|
+
index: key
|
|
158
|
+
}),
|
|
115
159
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
160
|
+
testId: (0, _qa.generateTestId)({
|
|
161
|
+
base: testId || optionTestId,
|
|
162
|
+
slot: 'secondary-label-text',
|
|
163
|
+
index: key
|
|
164
|
+
}),
|
|
116
165
|
children: resolvedSecondaryLabel
|
|
117
166
|
})
|
|
118
167
|
})]
|
|
@@ -120,12 +169,24 @@ const MenuOptionButton = props => {
|
|
|
120
169
|
name: iconRight,
|
|
121
170
|
type: iconRightType,
|
|
122
171
|
size: "small",
|
|
123
|
-
className: (0, _classify.classify)(_MenuModule.default.icon, _MenuModule.default.rightIcon)
|
|
172
|
+
className: (0, _classify.classify)(_MenuModule.default.icon, _MenuModule.default.rightIcon),
|
|
173
|
+
testId: (0, _qa.generateTestId)({
|
|
174
|
+
base: testId || optionTestId,
|
|
175
|
+
slot: 'icon-right',
|
|
176
|
+
index: key
|
|
177
|
+
})
|
|
124
178
|
})]
|
|
125
179
|
});
|
|
126
180
|
};
|
|
127
181
|
exports.MenuOptionButton = MenuOptionButton;
|
|
128
|
-
const renderLabel =
|
|
182
|
+
const renderLabel = _ref => {
|
|
183
|
+
let {
|
|
184
|
+
label,
|
|
185
|
+
allowWrap,
|
|
186
|
+
showLabelTooltip,
|
|
187
|
+
testId,
|
|
188
|
+
key
|
|
189
|
+
} = _ref;
|
|
129
190
|
if (showLabelTooltip) {
|
|
130
191
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TruncatedTextWithTooltip.TruncatedTextWithTooltip, {
|
|
131
192
|
tooltip: {
|
|
@@ -133,6 +194,11 @@ const renderLabel = (label, allowWrap, showLabelTooltip) => {
|
|
|
133
194
|
delayMotionDuration: 'normal'
|
|
134
195
|
},
|
|
135
196
|
line: 3,
|
|
197
|
+
testId: (0, _qa.generateTestId)({
|
|
198
|
+
base: testId,
|
|
199
|
+
slot: 'label-tooltip',
|
|
200
|
+
index: key
|
|
201
|
+
}),
|
|
136
202
|
children: label
|
|
137
203
|
});
|
|
138
204
|
}
|
|
@@ -143,10 +209,20 @@ const renderLabel = (label, allowWrap, showLabelTooltip) => {
|
|
|
143
209
|
delayMotionDuration: 'normal'
|
|
144
210
|
},
|
|
145
211
|
line: 3,
|
|
212
|
+
testId: (0, _qa.generateTestId)({
|
|
213
|
+
base: testId,
|
|
214
|
+
slot: 'label-wrap-tooltip',
|
|
215
|
+
index: key
|
|
216
|
+
}),
|
|
146
217
|
children: label
|
|
147
218
|
});
|
|
148
219
|
}
|
|
149
220
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
221
|
+
testId: (0, _qa.generateTestId)({
|
|
222
|
+
base: testId,
|
|
223
|
+
slot: 'label-text',
|
|
224
|
+
index: key
|
|
225
|
+
}),
|
|
150
226
|
children: label
|
|
151
227
|
});
|
|
152
228
|
};
|
|
@@ -19,6 +19,7 @@ export interface ModalProps {
|
|
|
19
19
|
allowBackgroundInteraction?: boolean;
|
|
20
20
|
initialFocus?: number;
|
|
21
21
|
customAnimation?: UseTransitionStylesProps;
|
|
22
|
+
testId?: string;
|
|
22
23
|
}
|
|
23
24
|
export type ModalSize = 'small' | 'medium' | 'large';
|
|
24
25
|
export interface BaseModalProps extends Omit<ModalProps, 'size'> {
|
|
@@ -29,19 +30,22 @@ export interface ModalHeaderProps {
|
|
|
29
30
|
hideCloseBtn?: boolean;
|
|
30
31
|
onCloseButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
31
32
|
className?: string;
|
|
33
|
+
testId?: string;
|
|
32
34
|
}
|
|
33
35
|
export interface ModalFooterProps {
|
|
34
36
|
children?: React.ReactNode;
|
|
35
37
|
classNames?: FooterClassNames;
|
|
38
|
+
testId?: string;
|
|
36
39
|
}
|
|
37
40
|
export interface ModalBodyProps {
|
|
38
41
|
children?: React.ReactNode;
|
|
39
42
|
className?: string;
|
|
43
|
+
testId?: string;
|
|
40
44
|
}
|
|
41
|
-
export declare const ModalHeader: ({ children, hideCloseBtn, onCloseButtonClick, className, }: ModalHeaderProps) => React.JSX.Element;
|
|
42
|
-
export declare const ModalBody: ({ children, className }: ModalBodyProps) => React.JSX.Element;
|
|
43
|
-
export declare const ModalFooter: ({ children, classNames }: ModalFooterProps) => React.JSX.Element;
|
|
44
|
-
export declare const Modal: ({ classNames, children, isOpen, onClose, hideBackdrop, tapOutsideToClose, initialFocus, customAnimation, allowBackgroundInteraction, size, }: BaseModalProps) => React.ReactPortal | null;
|
|
45
|
-
export declare const FullScreenModal: ({ classNames, ...props }: ModalProps) => React.JSX.Element;
|
|
45
|
+
export declare const ModalHeader: ({ children, hideCloseBtn, onCloseButtonClick, className, testId, }: ModalHeaderProps) => React.JSX.Element;
|
|
46
|
+
export declare const ModalBody: ({ children, className, testId }: ModalBodyProps) => React.JSX.Element;
|
|
47
|
+
export declare const ModalFooter: ({ children, classNames, testId, }: ModalFooterProps) => React.JSX.Element;
|
|
48
|
+
export declare const Modal: ({ classNames, children, isOpen, onClose, hideBackdrop, tapOutsideToClose, initialFocus, customAnimation, allowBackgroundInteraction, testId, size, }: BaseModalProps) => React.ReactPortal | null;
|
|
49
|
+
export declare const FullScreenModal: ({ classNames, testId, ...props }: ModalProps) => React.JSX.Element;
|
|
46
50
|
export {};
|
|
47
51
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,oBAAoB,CAAC;AAyBjE,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEH,KAAK,gBAAgB,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EA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MAAM,WAAW,GAAI,oEAMzB,gBAAgB,sBAwBlB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,iCAA+B,cAAc,sBAOtE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,mCAIzB,gBAAgB,sBAgBlB,CAAC;AAuDF,eAAO,MAAM,KAAK,GAAI,sJAanB,cAAc,6BAmJhB,CAAC;AAGF,eAAO,MAAM,eAAe,GAAI,kCAAgC,UAAU,sBASzE,CAAC"}
|
|
@@ -13,6 +13,7 @@ var _opacity = require("../../styles/variables/_opacity");
|
|
|
13
13
|
var _space = require("../../styles/variables/_space");
|
|
14
14
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
15
15
|
var _helpers = require("../../utils/helpers");
|
|
16
|
+
var _qa = require("../../utils/qa");
|
|
16
17
|
var _Button = require("../Button/Button");
|
|
17
18
|
var _Truncate = require("../Truncate/Truncate");
|
|
18
19
|
var _ModalModule = _interopRequireDefault(require("./Modal.module.css"));
|
|
@@ -42,21 +43,34 @@ const ModalHeader = _ref => {
|
|
|
42
43
|
children,
|
|
43
44
|
hideCloseBtn,
|
|
44
45
|
onCloseButtonClick,
|
|
45
|
-
className
|
|
46
|
+
className,
|
|
47
|
+
testId
|
|
46
48
|
} = _ref;
|
|
47
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
48
50
|
children: React.Children.count(children) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
49
51
|
className: (0, _classify.default)(_ModalModule.default.modalHeader, className),
|
|
52
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
53
|
+
base: testId,
|
|
54
|
+
slot: 'wrapper'
|
|
55
|
+
}),
|
|
50
56
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
57
|
className: _ModalModule.default.headerContent,
|
|
52
58
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
59
|
+
testId: (0, _qa.generateTestId)({
|
|
60
|
+
base: testId,
|
|
61
|
+
slot: 'title'
|
|
62
|
+
}),
|
|
53
63
|
children: children
|
|
54
64
|
})
|
|
55
65
|
}), !hideCloseBtn && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
56
66
|
iconLeftName: "xmark",
|
|
57
67
|
type: "ghost",
|
|
58
68
|
onClick: onCloseButtonClick,
|
|
59
|
-
ariaLabel: "Close Button"
|
|
69
|
+
ariaLabel: "Close Button",
|
|
70
|
+
testId: (0, _qa.generateTestId)({
|
|
71
|
+
base: testId,
|
|
72
|
+
slot: 'close-button'
|
|
73
|
+
})
|
|
60
74
|
})]
|
|
61
75
|
})
|
|
62
76
|
});
|
|
@@ -65,10 +79,15 @@ exports.ModalHeader = ModalHeader;
|
|
|
65
79
|
const ModalBody = _ref2 => {
|
|
66
80
|
let {
|
|
67
81
|
children,
|
|
68
|
-
className
|
|
82
|
+
className,
|
|
83
|
+
testId
|
|
69
84
|
} = _ref2;
|
|
70
85
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
86
|
className: (0, _classify.default)(_ModalModule.default.modalBody, className),
|
|
87
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
88
|
+
base: testId,
|
|
89
|
+
slot: 'wrapper'
|
|
90
|
+
}),
|
|
72
91
|
children: children
|
|
73
92
|
});
|
|
74
93
|
};
|
|
@@ -76,13 +95,22 @@ exports.ModalBody = ModalBody;
|
|
|
76
95
|
const ModalFooter = _ref3 => {
|
|
77
96
|
let {
|
|
78
97
|
children,
|
|
79
|
-
classNames
|
|
98
|
+
classNames,
|
|
99
|
+
testId
|
|
80
100
|
} = _ref3;
|
|
81
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
82
102
|
children: React.Children.count(children) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
103
|
className: (0, _classify.default)(_ModalModule.default.modalFooter, classNames?.wrapper),
|
|
104
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
105
|
+
base: testId,
|
|
106
|
+
slot: 'wrapper'
|
|
107
|
+
}),
|
|
84
108
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
109
|
className: (0, _classify.default)(_ModalModule.default.modalFooterActions, classNames?.actions),
|
|
110
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
111
|
+
base: testId,
|
|
112
|
+
slot: 'actions'
|
|
113
|
+
}),
|
|
86
114
|
children: children
|
|
87
115
|
})
|
|
88
116
|
})
|
|
@@ -145,6 +173,7 @@ const Modal = _ref4 => {
|
|
|
145
173
|
initialFocus = -1,
|
|
146
174
|
customAnimation,
|
|
147
175
|
allowBackgroundInteraction = false,
|
|
176
|
+
testId,
|
|
148
177
|
// Size is not set to default for backward compatibility. Don't change if you don't know this.
|
|
149
178
|
size
|
|
150
179
|
} = _ref4;
|
|
@@ -233,6 +262,10 @@ const Modal = _ref4 => {
|
|
|
233
262
|
[_ModalModule.default.in]: isTransitioning,
|
|
234
263
|
[_ModalModule.default.open]: isOpen
|
|
235
264
|
}, classNames?.container),
|
|
265
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
266
|
+
base: testId,
|
|
267
|
+
slot: 'container'
|
|
268
|
+
}),
|
|
236
269
|
children: [!allowBackgroundInteraction && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
237
270
|
className: (0, _classify.default)(_ModalModule.default.backdrop, {
|
|
238
271
|
[_ModalModule.default.darkBackdrop]: !hideBackdrop
|
|
@@ -241,7 +274,11 @@ const Modal = _ref4 => {
|
|
|
241
274
|
style: {
|
|
242
275
|
opacity: styles?.opacity,
|
|
243
276
|
transition: styles?.transition
|
|
244
|
-
}
|
|
277
|
+
},
|
|
278
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
279
|
+
base: testId,
|
|
280
|
+
slot: 'backdrop'
|
|
281
|
+
})
|
|
245
282
|
}), isMounted && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
246
283
|
className: (0, _classify.default)(_ModalModule.default.modal, {
|
|
247
284
|
[_ModalModule.default.small]: size === 'small',
|
|
@@ -253,6 +290,10 @@ const Modal = _ref4 => {
|
|
|
253
290
|
// Transition styles
|
|
254
291
|
...styles
|
|
255
292
|
},
|
|
293
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
294
|
+
base: testId,
|
|
295
|
+
slot: 'content'
|
|
296
|
+
}),
|
|
256
297
|
children: children
|
|
257
298
|
})]
|
|
258
299
|
})
|
|
@@ -264,6 +305,7 @@ exports.Modal = Modal;
|
|
|
264
305
|
const FullScreenModal = _ref5 => {
|
|
265
306
|
let {
|
|
266
307
|
classNames,
|
|
308
|
+
testId,
|
|
267
309
|
...props
|
|
268
310
|
} = _ref5;
|
|
269
311
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Modal, {
|
|
@@ -271,6 +313,7 @@ const FullScreenModal = _ref5 => {
|
|
|
271
313
|
...classNames,
|
|
272
314
|
content: (0, _classify.default)(_ModalModule.default.fullscreenModalContainer, classNames?.content)
|
|
273
315
|
},
|
|
316
|
+
testId: testId,
|
|
274
317
|
...props
|
|
275
318
|
});
|
|
276
319
|
};
|