@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
|
@@ -7,6 +7,7 @@ exports.DialogHeader = exports.DialogFooter = exports.DialogBody = exports.Dialo
|
|
|
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 _Button = require("../Button");
|
|
11
12
|
var _Icon = require("../Icon");
|
|
12
13
|
var _Modal = require("../Modal");
|
|
@@ -24,55 +25,85 @@ const DIALOG_SEMANTIC = exports.DIALOG_SEMANTIC = Object.freeze({
|
|
|
24
25
|
const DialogIcon = _ref => {
|
|
25
26
|
let {
|
|
26
27
|
semantic,
|
|
27
|
-
iconName
|
|
28
|
+
iconName,
|
|
29
|
+
testId
|
|
28
30
|
} = _ref;
|
|
29
31
|
switch (semantic) {
|
|
30
32
|
case DIALOG_SEMANTIC.neutral:
|
|
31
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
32
34
|
color: _typography.TEXT_COLORS.neutral,
|
|
33
35
|
name: iconName ? iconName : 'face-smile',
|
|
34
|
-
type: "solid"
|
|
36
|
+
type: "solid",
|
|
37
|
+
testId: (0, _qa.generateTestId)({
|
|
38
|
+
base: testId,
|
|
39
|
+
slot: 'icon'
|
|
40
|
+
})
|
|
35
41
|
});
|
|
36
42
|
case DIALOG_SEMANTIC.success:
|
|
37
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
38
44
|
name: iconName ? iconName : 'circle-check',
|
|
39
45
|
color: _typography.TEXT_COLORS.success,
|
|
40
|
-
type: "solid"
|
|
46
|
+
type: "solid",
|
|
47
|
+
testId: (0, _qa.generateTestId)({
|
|
48
|
+
base: testId,
|
|
49
|
+
slot: 'icon'
|
|
50
|
+
})
|
|
41
51
|
});
|
|
42
52
|
case DIALOG_SEMANTIC.information:
|
|
43
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
44
54
|
name: iconName ? iconName : 'circle-info',
|
|
45
55
|
color: _typography.TEXT_COLORS.information,
|
|
46
|
-
type: "solid"
|
|
56
|
+
type: "solid",
|
|
57
|
+
testId: (0, _qa.generateTestId)({
|
|
58
|
+
base: testId,
|
|
59
|
+
slot: 'icon'
|
|
60
|
+
})
|
|
47
61
|
});
|
|
48
62
|
case DIALOG_SEMANTIC.warning:
|
|
49
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
50
64
|
name: iconName ? iconName : 'circle-exclamation',
|
|
51
65
|
color: _typography.TEXT_COLORS.warning,
|
|
52
|
-
type: "solid"
|
|
66
|
+
type: "solid",
|
|
67
|
+
testId: (0, _qa.generateTestId)({
|
|
68
|
+
base: testId,
|
|
69
|
+
slot: 'icon'
|
|
70
|
+
})
|
|
53
71
|
});
|
|
54
72
|
case DIALOG_SEMANTIC.danger:
|
|
55
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
56
74
|
name: iconName ? iconName : 'shield-exclamation',
|
|
57
75
|
color: _typography.TEXT_COLORS.danger,
|
|
58
|
-
type: "solid"
|
|
76
|
+
type: "solid",
|
|
77
|
+
testId: (0, _qa.generateTestId)({
|
|
78
|
+
base: testId,
|
|
79
|
+
slot: 'icon'
|
|
80
|
+
})
|
|
59
81
|
});
|
|
60
82
|
default:
|
|
61
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
62
84
|
color: _typography.TEXT_COLORS.neutral,
|
|
63
85
|
name: iconName ? iconName : 'face-smile',
|
|
64
|
-
type: "solid"
|
|
86
|
+
type: "solid",
|
|
87
|
+
testId: (0, _qa.generateTestId)({
|
|
88
|
+
base: testId,
|
|
89
|
+
slot: 'icon'
|
|
90
|
+
})
|
|
65
91
|
});
|
|
66
92
|
}
|
|
67
93
|
};
|
|
68
94
|
const DialogHeader = _ref2 => {
|
|
69
95
|
let {
|
|
70
96
|
children,
|
|
71
|
-
className
|
|
97
|
+
className,
|
|
98
|
+
testId
|
|
72
99
|
} = _ref2;
|
|
73
100
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
74
101
|
children: React.Children.count(children) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
102
|
className: (0, _classify.default)(_DialogModule.default.dialogHeader, className),
|
|
103
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
104
|
+
base: testId,
|
|
105
|
+
slot: 'header'
|
|
106
|
+
}),
|
|
76
107
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
108
|
className: _DialogModule.default.headerContent,
|
|
78
109
|
children: children
|
|
@@ -84,10 +115,15 @@ exports.DialogHeader = DialogHeader;
|
|
|
84
115
|
const DialogBody = _ref3 => {
|
|
85
116
|
let {
|
|
86
117
|
children,
|
|
87
|
-
className
|
|
118
|
+
className,
|
|
119
|
+
testId
|
|
88
120
|
} = _ref3;
|
|
89
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
122
|
className: (0, _classify.default)(_DialogModule.default.dialogBody, className),
|
|
123
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
124
|
+
base: testId,
|
|
125
|
+
slot: 'body'
|
|
126
|
+
}),
|
|
91
127
|
children: children
|
|
92
128
|
});
|
|
93
129
|
};
|
|
@@ -95,13 +131,22 @@ exports.DialogBody = DialogBody;
|
|
|
95
131
|
const DialogFooter = _ref4 => {
|
|
96
132
|
let {
|
|
97
133
|
children,
|
|
98
|
-
classNames
|
|
134
|
+
classNames,
|
|
135
|
+
testId
|
|
99
136
|
} = _ref4;
|
|
100
137
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
101
138
|
children: React.Children.count(children) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
102
139
|
className: (0, _classify.default)(_DialogModule.default.dialogFooter, classNames?.wrapper),
|
|
140
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
141
|
+
base: testId,
|
|
142
|
+
slot: 'footer'
|
|
143
|
+
}),
|
|
103
144
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
145
|
className: (0, _classify.default)(_DialogModule.default.dialogFooterActions, classNames?.actions),
|
|
146
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
147
|
+
base: testId,
|
|
148
|
+
slot: 'actions'
|
|
149
|
+
}),
|
|
105
150
|
children: children
|
|
106
151
|
})
|
|
107
152
|
})
|
|
@@ -118,6 +163,7 @@ const Dialog = _ref5 => {
|
|
|
118
163
|
iconName = '',
|
|
119
164
|
semantic = 'neutral',
|
|
120
165
|
classNames,
|
|
166
|
+
testId,
|
|
121
167
|
...restDialogProps
|
|
122
168
|
} = _ref5;
|
|
123
169
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Modal.Modal, {
|
|
@@ -125,6 +171,7 @@ const Dialog = _ref5 => {
|
|
|
125
171
|
onClose: onClose,
|
|
126
172
|
hideBackdrop: hideBackdrop,
|
|
127
173
|
tapOutsideToClose: tapOutsideToClose,
|
|
174
|
+
testId: testId,
|
|
128
175
|
...restDialogProps,
|
|
129
176
|
classNames: {
|
|
130
177
|
content: (0, _classify.default)(_DialogModule.default.dialog, classNames?.content),
|
|
@@ -141,9 +188,14 @@ const Dialog = _ref5 => {
|
|
|
141
188
|
[_DialogModule.default.warning]: semantic === DIALOG_SEMANTIC.warning,
|
|
142
189
|
[_DialogModule.default.danger]: semantic === DIALOG_SEMANTIC.danger
|
|
143
190
|
}),
|
|
191
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
192
|
+
base: testId,
|
|
193
|
+
slot: 'icon-container'
|
|
194
|
+
}),
|
|
144
195
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogIcon, {
|
|
145
196
|
semantic: semantic,
|
|
146
|
-
iconName: iconName
|
|
197
|
+
iconName: iconName,
|
|
198
|
+
testId: testId
|
|
147
199
|
})
|
|
148
200
|
})
|
|
149
201
|
}), children]
|
|
@@ -158,23 +210,36 @@ const BasicDialog = _ref6 => {
|
|
|
158
210
|
abortText,
|
|
159
211
|
handleConfirm,
|
|
160
212
|
handleAbort,
|
|
213
|
+
testId,
|
|
161
214
|
...restDialogProps
|
|
162
215
|
} = _ref6;
|
|
163
216
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Dialog, {
|
|
164
217
|
...restDialogProps,
|
|
218
|
+
testId: testId,
|
|
165
219
|
children: [!!heading && /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogHeader, {
|
|
220
|
+
testId: testId,
|
|
166
221
|
children: heading
|
|
167
222
|
}), !!body && /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogBody, {
|
|
223
|
+
testId: testId,
|
|
168
224
|
children: body
|
|
169
225
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DialogFooter, {
|
|
226
|
+
testId: testId,
|
|
170
227
|
children: [!!abortText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
171
228
|
isFluid: true,
|
|
172
229
|
type: "tertiary",
|
|
173
230
|
onClick: handleAbort,
|
|
231
|
+
testId: (0, _qa.generateTestId)({
|
|
232
|
+
base: testId,
|
|
233
|
+
slot: 'abort-button'
|
|
234
|
+
}),
|
|
174
235
|
children: abortText
|
|
175
236
|
}), !!confirmText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
176
237
|
isFluid: true,
|
|
177
238
|
onClick: handleConfirm,
|
|
239
|
+
testId: (0, _qa.generateTestId)({
|
|
240
|
+
base: testId,
|
|
241
|
+
slot: 'confirm-button'
|
|
242
|
+
}),
|
|
178
243
|
children: confirmText
|
|
179
244
|
})]
|
|
180
245
|
})]
|
|
@@ -19,6 +19,7 @@ export interface DropdownProps extends Omit<InputProps, 'classNames' | 'onChange
|
|
|
19
19
|
menu?: MenuProps;
|
|
20
20
|
elevation?: ElevationType;
|
|
21
21
|
clickAwayRef?: React.RefObject<ClickAwayRefType | null>;
|
|
22
|
+
testId?: string;
|
|
22
23
|
}
|
|
23
24
|
export declare const Dropdown: Flow.AbstractComponent<DropdownProps, HTMLInputElement>;
|
|
24
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAK3D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAM1D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,UAAU,EACR,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,aAAa,GACb,oBAAoB,GACpB,mBAAmB,GACnB,MAAM,GACN,WAAW,GACX,cAAc,CACjB;IACD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,UAAU,EAClB,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,KACxD,OAAO,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,gBAAgB,CAgJ1E,CAAC"}
|
|
@@ -11,6 +11,7 @@ var _space = require("../../styles/variables/_space");
|
|
|
11
11
|
var _classify = require("../../utils/classify");
|
|
12
12
|
var _clickAway = require("../../utils/click-away");
|
|
13
13
|
var _mergeRefs = require("../../utils/merge-refs");
|
|
14
|
+
var _qa = require("../../utils/qa");
|
|
14
15
|
var _Input = require("../Input");
|
|
15
16
|
var _Menu = require("../Menu");
|
|
16
17
|
var _Tooltip = require("../Tooltip");
|
|
@@ -31,6 +32,7 @@ const Dropdown = exports.Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
31
32
|
dropdownInputText = '',
|
|
32
33
|
clickAwayRef,
|
|
33
34
|
elevation = 'modal',
|
|
35
|
+
testId,
|
|
34
36
|
...inputProps
|
|
35
37
|
} = _ref;
|
|
36
38
|
const menuRef = React.useRef(null);
|
|
@@ -71,7 +73,10 @@ const Dropdown = exports.Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
71
73
|
} = _ref2;
|
|
72
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
73
75
|
className: (0, _classify.classify)(_DropdownModule.default.dropdownContainer, classNames?.wrapper),
|
|
74
|
-
"data-testid":
|
|
76
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
77
|
+
base: testId,
|
|
78
|
+
slot: 'root'
|
|
79
|
+
}),
|
|
75
80
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.Input, {
|
|
76
81
|
...inputProps,
|
|
77
82
|
onKeyDown: e => {
|
|
@@ -98,7 +103,11 @@ const Dropdown = exports.Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
98
103
|
e.stopPropagation();
|
|
99
104
|
onOpen();
|
|
100
105
|
},
|
|
101
|
-
ref: ref
|
|
106
|
+
ref: ref,
|
|
107
|
+
testId: (0, _qa.generateTestId)({
|
|
108
|
+
base: testId,
|
|
109
|
+
slot: 'input'
|
|
110
|
+
})
|
|
102
111
|
}), isOpen && menu && /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.FloatingPortal, {
|
|
103
112
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.FloatingFocusManager, {
|
|
104
113
|
modal: false,
|
|
@@ -107,6 +116,10 @@ const Dropdown = exports.Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
107
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
117
|
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
109
118
|
className: _DropdownModule.default.menuWrapper,
|
|
119
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
120
|
+
base: testId,
|
|
121
|
+
slot: 'menu-wrapper'
|
|
122
|
+
}),
|
|
110
123
|
style: {
|
|
111
124
|
position: strategy,
|
|
112
125
|
top: y ?? _space.spaceNone,
|
|
@@ -123,6 +136,10 @@ const Dropdown = exports.Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
123
136
|
},
|
|
124
137
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.Menu, {
|
|
125
138
|
...menu,
|
|
139
|
+
testId: (0, _qa.generateTestId)({
|
|
140
|
+
base: testId,
|
|
141
|
+
slot: 'menu'
|
|
142
|
+
}),
|
|
126
143
|
onSelect: (option, e) => {
|
|
127
144
|
onChange?.(option, e);
|
|
128
145
|
if (
|
|
@@ -37,6 +37,7 @@ export interface SimpleDropdownProps extends Omit<InputProps, 'elevation' | 'cla
|
|
|
37
37
|
onMenuClose?: () => unknown;
|
|
38
38
|
resolveLabel?: (option: MenuOption) => string | React.ReactNode;
|
|
39
39
|
resolveSecondaryLabel?: (option: MenuOption) => string | React.ReactNode;
|
|
40
|
+
testId?: string;
|
|
40
41
|
}
|
|
41
42
|
export declare const SimpleDropdown: Flow.AbstractComponent<SimpleDropdownProps, SimpleDropdownRef>;
|
|
42
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/SimpleDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAO3D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAG1D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,W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AAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+GD,eAAO,MAAM,cAAc,EAAE,IAAI,CAAC,iBAAiB,CACjD,mBAAmB,EACnB,iBAAiB,CAGlB,CAAC"}
|
|
@@ -33,6 +33,7 @@ const SimpleDropdownBase = (props, ref) => {
|
|
|
33
33
|
clickAwayRef,
|
|
34
34
|
allowWrap = false,
|
|
35
35
|
staticLabels,
|
|
36
|
+
testId,
|
|
36
37
|
...inputProps
|
|
37
38
|
} = props;
|
|
38
39
|
const [dropdownInputText, setDropdownInputText] = React.useState('');
|
|
@@ -71,6 +72,7 @@ const SimpleDropdownBase = (props, ref) => {
|
|
|
71
72
|
onMenuClose: onMenuClose,
|
|
72
73
|
dropdownInputText: dropdownInputText,
|
|
73
74
|
clickAwayRef: clickAwayRef,
|
|
75
|
+
testId: testId,
|
|
74
76
|
menu: {
|
|
75
77
|
options,
|
|
76
78
|
selectedKeys: dropdownSelectedKeys,
|
|
@@ -9,6 +9,7 @@ export interface FileBlockProps {
|
|
|
9
9
|
onFileRefreshClick?: (file: FileObject) => unknown;
|
|
10
10
|
handleFileClear?: (id: string) => unknown;
|
|
11
11
|
showRemoveFile?: boolean;
|
|
12
|
+
testId?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare const FileBlock: Flow.AbstractComponent<FileBlockProps, HTMLDivElement>;
|
|
14
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileBlock/FileBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"FileBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/FileUpload/FileBlock/FileBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sCAAsC,CAAC;AAQrE,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IACnD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CA0G1E,CAAC"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.FileBlock = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../../utils/classify"));
|
|
9
|
+
var _qa = require("../../../utils/qa");
|
|
9
10
|
var _Icon = require("../../Icon");
|
|
10
11
|
var _LinearLoader = require("../../LinearLoader");
|
|
11
12
|
var _Truncate = require("../../Truncate");
|
|
@@ -19,12 +20,17 @@ const FileBlock = exports.FileBlock = /*#__PURE__*/React.forwardRef((_ref, ref)
|
|
|
19
20
|
fileObject,
|
|
20
21
|
onFileRefreshClick,
|
|
21
22
|
handleFileClear,
|
|
22
|
-
showRemoveFile = true
|
|
23
|
+
showRemoveFile = true,
|
|
24
|
+
testId
|
|
23
25
|
} = _ref;
|
|
24
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
25
27
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
26
28
|
className: (0, _classify.default)(_FileUploadModule.default.file, classNames?.wrapper),
|
|
27
29
|
ref: ref,
|
|
30
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
31
|
+
base: testId,
|
|
32
|
+
slot: 'wrapper'
|
|
33
|
+
}),
|
|
28
34
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
29
35
|
className: _FileUploadModule.default.fileInfo,
|
|
30
36
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -32,22 +38,35 @@ const FileBlock = exports.FileBlock = /*#__PURE__*/React.forwardRef((_ref, ref)
|
|
|
32
38
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
39
|
className: _FileUploadModule.default.icon,
|
|
34
40
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(FileStatusIcon, {
|
|
35
|
-
fileObject: fileObject
|
|
41
|
+
fileObject: fileObject,
|
|
42
|
+
testId: testId
|
|
36
43
|
})
|
|
37
44
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
38
45
|
className: _FileUploadModule.default.fileName,
|
|
39
46
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
47
|
+
testId: (0, _qa.generateTestId)({
|
|
48
|
+
base: testId,
|
|
49
|
+
slot: 'file-name'
|
|
50
|
+
}),
|
|
40
51
|
children: fileObject.file.name
|
|
41
52
|
})
|
|
42
53
|
})]
|
|
43
54
|
}), fileObject.success && !!fileObject.successMessage && !fileObject.progress && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
55
|
className: _FileUploadModule.default.fileSuccess,
|
|
45
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
57
|
+
testId: (0, _qa.generateTestId)({
|
|
58
|
+
base: testId,
|
|
59
|
+
slot: 'success-message'
|
|
60
|
+
}),
|
|
46
61
|
children: fileObject.successMessage
|
|
47
62
|
})
|
|
48
63
|
}), fileObject.reject && !!fileObject.rejectReason && !fileObject.progress && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
49
64
|
className: _FileUploadModule.default.fileError,
|
|
50
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
66
|
+
testId: (0, _qa.generateTestId)({
|
|
67
|
+
base: testId,
|
|
68
|
+
slot: 'error-message'
|
|
69
|
+
}),
|
|
51
70
|
children: fileObject.rejectReason
|
|
52
71
|
})
|
|
53
72
|
}), !!fileObject.progress && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -55,7 +74,11 @@ const FileBlock = exports.FileBlock = /*#__PURE__*/React.forwardRef((_ref, ref)
|
|
|
55
74
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinearLoader.LinearLoader, {
|
|
56
75
|
size: "small",
|
|
57
76
|
value: fileObject.progress === 'indeterminate' ? 0 : fileObject.progress,
|
|
58
|
-
indeterminate: fileObject.progress === 'indeterminate'
|
|
77
|
+
indeterminate: fileObject.progress === 'indeterminate',
|
|
78
|
+
testId: (0, _qa.generateTestId)({
|
|
79
|
+
base: testId,
|
|
80
|
+
slot: 'progress'
|
|
81
|
+
})
|
|
59
82
|
})
|
|
60
83
|
})]
|
|
61
84
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -65,13 +88,21 @@ const FileBlock = exports.FileBlock = /*#__PURE__*/React.forwardRef((_ref, ref)
|
|
|
65
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.ClickableIcon, {
|
|
66
89
|
name: "refresh",
|
|
67
90
|
size: "small",
|
|
68
|
-
onClick: () => onFileRefreshClick?.(fileObject)
|
|
91
|
+
onClick: () => onFileRefreshClick?.(fileObject),
|
|
92
|
+
testId: (0, _qa.generateTestId)({
|
|
93
|
+
base: testId,
|
|
94
|
+
slot: 'refresh-button'
|
|
95
|
+
})
|
|
69
96
|
})
|
|
70
97
|
}), showRemoveFile && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
98
|
className: _FileUploadModule.default.rightBlock,
|
|
72
99
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.CloseIcon, {
|
|
73
100
|
size: "small",
|
|
74
|
-
onClick: () => handleFileClear?.(fileObject.id)
|
|
101
|
+
onClick: () => handleFileClear?.(fileObject.id),
|
|
102
|
+
testId: (0, _qa.generateTestId)({
|
|
103
|
+
base: testId,
|
|
104
|
+
slot: 'remove-button'
|
|
105
|
+
})
|
|
75
106
|
})
|
|
76
107
|
})]
|
|
77
108
|
})]
|
|
@@ -96,7 +127,8 @@ const getFileStatus = fileObject => {
|
|
|
96
127
|
// This component renders the status icon for a file
|
|
97
128
|
const FileStatusIcon = _ref2 => {
|
|
98
129
|
let {
|
|
99
|
-
fileObject
|
|
130
|
+
fileObject,
|
|
131
|
+
testId
|
|
100
132
|
} = _ref2;
|
|
101
133
|
const status = getFileStatus(fileObject);
|
|
102
134
|
switch (status) {
|
|
@@ -104,26 +136,42 @@ const FileStatusIcon = _ref2 => {
|
|
|
104
136
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
105
137
|
size: "small",
|
|
106
138
|
name: "loader",
|
|
107
|
-
color: "tertiary"
|
|
139
|
+
color: "tertiary",
|
|
140
|
+
testId: (0, _qa.generateTestId)({
|
|
141
|
+
base: testId,
|
|
142
|
+
slot: 'status-icon'
|
|
143
|
+
})
|
|
108
144
|
});
|
|
109
145
|
case 'success':
|
|
110
146
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
111
147
|
size: "small",
|
|
112
148
|
name: "check",
|
|
113
|
-
color: "success"
|
|
149
|
+
color: "success",
|
|
150
|
+
testId: (0, _qa.generateTestId)({
|
|
151
|
+
base: testId,
|
|
152
|
+
slot: 'status-icon'
|
|
153
|
+
})
|
|
114
154
|
});
|
|
115
155
|
case 'error':
|
|
116
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
117
157
|
size: "small",
|
|
118
158
|
name: "circle-exclamation",
|
|
119
159
|
color: "danger",
|
|
120
|
-
type: "solid"
|
|
160
|
+
type: "solid",
|
|
161
|
+
testId: (0, _qa.generateTestId)({
|
|
162
|
+
base: testId,
|
|
163
|
+
slot: 'status-icon'
|
|
164
|
+
})
|
|
121
165
|
});
|
|
122
166
|
default:
|
|
123
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
124
168
|
size: "small",
|
|
125
169
|
name: "check",
|
|
126
|
-
color: "success"
|
|
170
|
+
color: "success",
|
|
171
|
+
testId: (0, _qa.generateTestId)({
|
|
172
|
+
base: testId,
|
|
173
|
+
slot: 'status-icon'
|
|
174
|
+
})
|
|
127
175
|
});
|
|
128
176
|
}
|
|
129
177
|
};
|
|
@@ -58,6 +58,7 @@ export interface FileUploadProps extends Omit<FileUploadBaseProps, 'classNames'
|
|
|
58
58
|
required?: boolean;
|
|
59
59
|
handleFileDeletionExternally?: boolean;
|
|
60
60
|
onFileRefreshClick?: (file: FileObject) => unknown;
|
|
61
|
+
testId?: string;
|
|
61
62
|
}
|
|
62
63
|
export declare const FileUpload: Flow.AbstractComponent<FileUploadProps, FileUploadRef>;
|
|
63
64
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAerD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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B;AAuID,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAC7C,eAAe,EACf,aAAa,CACqD,CAAC"}
|
|
@@ -7,6 +7,7 @@ exports.FileUpload = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _useFileUpload = require("../../hooks/useFileUpload");
|
|
9
9
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
10
|
+
var _qa = require("../../utils/qa");
|
|
10
11
|
var _Button = require("../Button");
|
|
11
12
|
var _FileBlock = require("./FileBlock");
|
|
12
13
|
var _Truncate = require("../Truncate");
|
|
@@ -39,7 +40,8 @@ const FileUploadBase = (props, ref) => {
|
|
|
39
40
|
onFileClear,
|
|
40
41
|
onFileRefreshClick,
|
|
41
42
|
maxFiles = 1,
|
|
42
|
-
handleFileDeletionExternally
|
|
43
|
+
handleFileDeletionExternally,
|
|
44
|
+
testId
|
|
43
45
|
} = props;
|
|
44
46
|
|
|
45
47
|
// Get file upload state from useFileUpload hook
|
|
@@ -66,7 +68,6 @@ const FileUploadBase = (props, ref) => {
|
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
// Expose file upload actions to parent component
|
|
69
|
-
|
|
70
71
|
React.useImperativeHandle(ref, () => ({
|
|
71
72
|
moveFileToProgress,
|
|
72
73
|
moveFileToSuccess,
|
|
@@ -82,9 +83,17 @@ const FileUploadBase = (props, ref) => {
|
|
|
82
83
|
const files = [...validFiles, ...rejectedFiles];
|
|
83
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
84
85
|
className: (0, _classify.default)(_FileUploadModule.default.wrapper, classNames?.wrapper),
|
|
86
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
87
|
+
base: testId,
|
|
88
|
+
slot: 'wrapper'
|
|
89
|
+
}),
|
|
85
90
|
children: [Boolean(label) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
86
91
|
className: _FileUploadModule.default.label,
|
|
87
92
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Truncate.Truncate, {
|
|
93
|
+
testId: (0, _qa.generateTestId)({
|
|
94
|
+
base: testId,
|
|
95
|
+
slot: 'label'
|
|
96
|
+
}),
|
|
88
97
|
children: label
|
|
89
98
|
}), required && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
90
99
|
className: _FileUploadModule.default.required,
|
|
@@ -98,8 +107,16 @@ const FileUploadBase = (props, ref) => {
|
|
|
98
107
|
[_FileUploadModule.default.dragActive]: isDragActive,
|
|
99
108
|
[_FileUploadModule.default.error]: error
|
|
100
109
|
}, classNames?.dropZone),
|
|
110
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
111
|
+
base: testId,
|
|
112
|
+
slot: 'dropzone'
|
|
113
|
+
}),
|
|
101
114
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
102
|
-
...getInputProps()
|
|
115
|
+
...getInputProps(),
|
|
116
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
117
|
+
base: testId,
|
|
118
|
+
slot: 'input'
|
|
119
|
+
})
|
|
103
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
121
|
className: (0, _classify.default)(_FileUploadModule.default.instruction, classNames?.instruction),
|
|
105
122
|
children: isDragActive ? draggingInstruction : instruction
|
|
@@ -109,6 +126,10 @@ const FileUploadBase = (props, ref) => {
|
|
|
109
126
|
})]
|
|
110
127
|
}), files.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
111
128
|
className: _FileUploadModule.default.files,
|
|
129
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
130
|
+
base: testId,
|
|
131
|
+
slot: 'files'
|
|
132
|
+
}),
|
|
112
133
|
children: files.map(fileObject => /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
113
134
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileBlock.FileBlock, {
|
|
114
135
|
fileObject: fileObject,
|
|
@@ -116,7 +137,12 @@ const FileUploadBase = (props, ref) => {
|
|
|
116
137
|
handleFileClear: handleFileDeletionExternally ? onFileClear : handleFileClear,
|
|
117
138
|
classNames: {
|
|
118
139
|
wrapper: classNames?.files
|
|
119
|
-
}
|
|
140
|
+
},
|
|
141
|
+
testId: (0, _qa.generateTestId)({
|
|
142
|
+
base: testId,
|
|
143
|
+
slot: 'file-block',
|
|
144
|
+
index: fileObject.id
|
|
145
|
+
})
|
|
120
146
|
})
|
|
121
147
|
}, fileObject.id))
|
|
122
148
|
})]
|
package/lib/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { FocusManagerProps } from '../../components/FocusManager';
|
|
|
4
4
|
export interface SkipElementFromNavigationProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
+
testId?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const SkipElementFromNavigation: Flow.AbstractComponent<SkipElementFromNavigationProps, HTMLDivElement>;
|
|
9
10
|
export interface FocusManagerWithArrowKeyNavigationProps extends Omit<FocusManagerProps, 'cols' | 'orientation' | 'focusItemOnOpen' | 'loop' | 'listReference'> {
|
|
@@ -14,6 +15,7 @@ export interface FocusManagerWithArrowKeyNavigationProps extends Omit<FocusManag
|
|
|
14
15
|
listReference?: {
|
|
15
16
|
current: Array<HTMLElement>;
|
|
16
17
|
};
|
|
18
|
+
testId?: string;
|
|
17
19
|
}
|
|
18
20
|
export declare const FocusManagerWithArrowKeyNavigation: (props: FocusManagerWithArrowKeyNavigationProps) => React.JSX.Element;
|
|
19
21
|
//# sourceMappingURL=FocusManagerWithArrowKeyNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusManagerWithArrowKeyNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"FocusManagerWithArrowKeyNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/FocusManagerWithArrowKeyNavigation/FocusManagerWithArrowKeyNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAOnE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,yBAAyB,EAAE,IAAI,CAAC,iBAAiB,CAC5D,8BAA8B,EAC9B,cAAc,CAgBf,CAAC;AAIF,MAAM,WAAW,uCACf,SAAQ,IAAI,CACV,iBAAiB,EACjB,MAAM,GAAG,aAAa,GAAG,iBAAiB,GAAG,MAAM,GAAG,eAAe,CACtE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;KAC7B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD,eAAO,MAAM,kCAAkC,GAC7C,OAAO,uCAAuC,sBAyH/C,CAAC"}
|