@dxc-technology/halstack-react 0.0.0-da90bf9 → 0.0.0-da9270d
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/BackgroundColorContext.d.ts +1 -0
- package/BackgroundColorContext.js +8 -24
- package/HalstackContext.d.ts +1235 -0
- package/HalstackContext.js +310 -0
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +120 -291
- package/accordion/Accordion.stories.tsx +283 -0
- package/accordion/Accordion.test.js +56 -0
- package/accordion/types.d.ts +57 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +8 -0
- package/accordion-group/AccordionGroup.js +57 -142
- package/accordion-group/AccordionGroup.stories.tsx +252 -0
- package/accordion-group/AccordionGroup.test.js +98 -0
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/types.d.ts +67 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +55 -204
- package/alert/Alert.stories.tsx +198 -0
- package/alert/Alert.test.js +75 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +15 -30
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +43 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +35 -116
- package/box/Box.stories.tsx +119 -0
- package/box/Box.test.js +13 -0
- package/box/types.d.ts +32 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +89 -0
- package/bulleted-list/BulletedList.stories.tsx +115 -0
- package/bulleted-list/types.d.ts +38 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +67 -185
- package/button/Button.stories.tsx +344 -0
- package/button/Button.test.js +36 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +60 -194
- package/card/Card.stories.tsx +171 -0
- package/card/Card.test.js +39 -0
- package/card/types.d.ts +62 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +147 -231
- package/checkbox/Checkbox.stories.tsx +222 -0
- package/checkbox/Checkbox.test.js +199 -0
- package/checkbox/types.d.ts +72 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +50 -194
- package/chip/Chip.stories.tsx +214 -0
- package/chip/Chip.test.js +41 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +6 -12
- package/common/variables.d.ts +1381 -0
- package/common/variables.js +1006 -1319
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +214 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +179 -356
- package/date-input/DateInput.stories.tsx +285 -0
- package/date-input/DateInput.test.js +808 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +115 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +58 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +100 -0
- package/date-input/types.d.ts +164 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +70 -184
- package/dialog/Dialog.stories.tsx +365 -0
- package/dialog/Dialog.test.js +307 -0
- package/dialog/types.d.ts +36 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +247 -457
- package/dropdown/Dropdown.stories.tsx +438 -0
- package/dropdown/Dropdown.test.js +599 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +63 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +67 -0
- package/dropdown/types.d.ts +98 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +297 -462
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +459 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +61 -213
- package/file-input/types.d.ts +129 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +57 -0
- package/flex/Flex.stories.tsx +112 -0
- package/flex/types.d.ts +97 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +64 -360
- package/footer/Footer.stories.tsx +152 -0
- package/footer/Footer.test.js +85 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +16 -21
- package/footer/types.d.ts +58 -0
- package/footer/types.js +5 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +8 -0
- package/header/Header.js +122 -372
- package/header/Header.stories.tsx +251 -0
- package/header/Header.test.js +66 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +9 -39
- package/header/types.d.ts +33 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +31 -124
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +169 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +127 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +43 -0
- package/inset/Inset.stories.tsx +230 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +20 -0
- package/layout/ApplicationLayout.js +85 -278
- package/layout/ApplicationLayout.stories.tsx +162 -0
- package/layout/Icons.d.ts +8 -0
- package/layout/Icons.js +51 -48
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +13 -0
- package/layout/types.d.ts +41 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +67 -189
- package/link/Link.stories.tsx +253 -0
- package/link/Link.test.js +63 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +46 -40
- package/main.js +117 -140
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +90 -0
- package/nav-tabs/NavTabs.stories.tsx +274 -0
- package/nav-tabs/NavTabs.test.js +75 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +117 -0
- package/nav-tabs/types.d.ts +52 -0
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.d.ts +11 -0
- package/number-input/NumberInput.js +32 -101
- package/number-input/NumberInput.stories.tsx +131 -0
- package/number-input/NumberInput.test.js +830 -0
- package/number-input/types.d.ts +130 -0
- package/number-input/types.js +5 -0
- package/package.json +53 -49
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +26 -52
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +41 -211
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +335 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +5 -0
- package/paragraph/Paragraph.js +22 -0
- package/paragraph/Paragraph.stories.tsx +27 -0
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +66 -172
- package/password-input/PasswordInput.stories.tsx +99 -0
- package/password-input/PasswordInput.test.js +198 -0
- package/password-input/types.d.ts +111 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +76 -174
- package/progress-bar/ProgressBar.stories.tsx +93 -0
- package/progress-bar/ProgressBar.test.js +93 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +94 -0
- package/quick-nav/QuickNav.stories.tsx +356 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +124 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +235 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +756 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultset-table/Icons.d.ts +7 -0
- package/resultset-table/Icons.js +47 -0
- package/resultset-table/ResultsetTable.d.ts +4 -0
- package/resultset-table/ResultsetTable.js +159 -0
- package/resultset-table/ResultsetTable.stories.tsx +300 -0
- package/resultset-table/ResultsetTable.test.js +305 -0
- package/resultset-table/types.d.ts +67 -0
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +89 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +143 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +80 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +294 -849
- package/select/Select.stories.tsx +971 -0
- package/select/Select.test.js +2370 -0
- package/select/types.d.ts +209 -0
- package/select/types.js +5 -0
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +47 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +134 -117
- package/sidenav/Sidenav.stories.tsx +282 -0
- package/sidenav/Sidenav.test.js +37 -0
- package/sidenav/types.d.ts +76 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +172 -291
- package/slider/Slider.test.js +254 -0
- package/slider/types.d.ts +86 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +66 -241
- package/spinner/Spinner.stories.tsx +129 -0
- package/spinner/Spinner.test.js +55 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +153 -161
- package/switch/Switch.stories.tsx +137 -0
- package/switch/Switch.test.js +180 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +14 -50
- package/table/Table.stories.tsx +356 -0
- package/table/Table.test.js +21 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +113 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +322 -281
- package/tabs/Tabs.stories.tsx +226 -0
- package/tabs/Tabs.test.js +294 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +61 -192
- package/tag/Tag.stories.tsx +155 -0
- package/tag/Tag.test.js +49 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +56 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +67 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +84 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +360 -757
- package/text-input/TextInput.stories.tsx +465 -0
- package/text-input/TextInput.test.js +1739 -0
- package/text-input/types.d.ts +205 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +105 -240
- package/textarea/Textarea.stories.tsx +174 -0
- package/textarea/Textarea.test.js +406 -0
- package/textarea/types.d.ts +141 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +107 -233
- package/toggle-group/ToggleGroup.stories.tsx +218 -0
- package/toggle-group/ToggleGroup.test.js +137 -0
- package/toggle-group/types.d.ts +114 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +23 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.d.ts +1134 -0
- package/useTheme.js +4 -11
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +14 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +94 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +121 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +138 -293
- package/wizard/Wizard.stories.tsx +253 -0
- package/wizard/Wizard.test.js +114 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/ThemeContext.js +0 -250
- package/V3Select/V3Select.js +0 -549
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -264
- package/V3Textarea/index.d.ts +0 -27
- package/accordion/index.d.ts +0 -28
- package/accordion-group/index.d.ts +0 -16
- package/alert/index.d.ts +0 -51
- package/box/index.d.ts +0 -25
- package/button/Button.stories.js +0 -27
- package/button/index.d.ts +0 -24
- package/card/index.d.ts +0 -22
- package/checkbox/index.d.ts +0 -24
- package/chip/index.d.ts +0 -22
- package/common/RequiredComponent.js +0 -40
- package/date/Date.js +0 -379
- package/date/index.d.ts +0 -27
- package/date-input/index.d.ts +0 -95
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -705
- package/input-text/index.d.ts +0 -36
- package/link/index.d.ts +0 -23
- package/number-input/NumberInputContext.js +0 -16
- package/number-input/index.d.ts +0 -113
- package/paginator/index.d.ts +0 -20
- package/password-input/index.d.ts +0 -94
- package/progress-bar/index.d.ts +0 -18
- package/radio/Radio.js +0 -209
- package/radio/index.d.ts +0 -23
- package/resultsetTable/ResultsetTable.js +0 -358
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/slider/index.d.ts +0 -29
- package/spinner/index.d.ts +0 -17
- package/switch/index.d.ts +0 -24
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -220
- package/toggle/index.d.ts +0 -21
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -205
- package/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -189
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -123
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -148
- package/upload/transactions/Transactions.js +0 -138
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
package/alert/Alert.js
CHANGED
|
@@ -1,254 +1,133 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
11
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
|
|
20
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
31
|
-
|
|
32
|
-
function _templateObject10() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n border: 1px solid transparent;\n border-radius: 2px;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n margin-left: 12px;\n background-color: transparent;\n color: #000000;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject10 = function _templateObject10() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject9() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n overflow-y: auto;\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject9 = function _templateObject9() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject8() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n align-items: center;\n overflow: hidden;\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject8 = function _templateObject8() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject7() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 12px;\n padding-right: ", ";\n padding-left: ", ";\n\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject7 = function _templateObject7() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject6() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 8px;\n padding-right: ", ";\n padding-left: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject6 = function _templateObject6() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject5() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 8px;\n padding-right: ", ";\n padding-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject5 = function _templateObject5() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject4() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: calc(48px - calc(", " * 2));\n align-items: center;\n width: 100%;\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject4 = function _templateObject4() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject3() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n padding-left: 12px;\n padding-right: 12px;\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n z-index: ", ";\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject3 = function _templateObject3() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _templateObject2() {
|
|
113
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"]);
|
|
114
|
-
|
|
115
|
-
_templateObject2 = function _templateObject2() {
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return data;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _templateObject() {
|
|
123
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n width: ", ";\n height: ", ";\n justify-content: ", ";\n align-items: ", ";\n top: ", ";\n left: ", ";\n position: ", ";\n display: ", ";\n z-index: ", ";\n"]);
|
|
124
|
-
|
|
125
|
-
_templateObject = function _templateObject() {
|
|
126
|
-
return data;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return data;
|
|
130
|
-
}
|
|
131
|
-
|
|
13
|
+
var _variables = require("../common/variables");
|
|
14
|
+
var _utils = require("../common/utils");
|
|
15
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
16
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
17
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
132
20
|
var alertIcons = {
|
|
133
|
-
close: _react["default"].createElement("svg", {
|
|
21
|
+
close: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
134
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
135
23
|
width: "20",
|
|
136
24
|
height: "20",
|
|
137
25
|
viewBox: "0 0 24 24",
|
|
138
26
|
fill: "currentColor"
|
|
139
|
-
}, _react["default"].createElement("path", {
|
|
27
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
140
28
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
141
|
-
}), _react["default"].createElement("path", {
|
|
29
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
142
30
|
d: "M0 0h24v24H0z",
|
|
143
31
|
fill: "none"
|
|
144
32
|
})),
|
|
145
|
-
info: _react["default"].createElement("svg", {
|
|
33
|
+
info: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
146
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
147
35
|
width: "23",
|
|
148
36
|
height: "23",
|
|
149
37
|
viewBox: "0 0 24 24",
|
|
150
38
|
fill: "currentColor"
|
|
151
|
-
}, _react["default"].createElement("path", {
|
|
39
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
152
40
|
d: "M0 0h24v24H0z",
|
|
153
41
|
fill: "none"
|
|
154
|
-
}), _react["default"].createElement("path", {
|
|
42
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
155
43
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"
|
|
156
44
|
})),
|
|
157
|
-
success: _react["default"].createElement("svg", {
|
|
45
|
+
success: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
158
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
159
47
|
width: "23",
|
|
160
48
|
height: "23",
|
|
161
49
|
viewBox: "0 0 24 24",
|
|
162
50
|
fill: "currentColor"
|
|
163
|
-
}, _react["default"].createElement("path", {
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
164
52
|
d: "M0 0h24v24H0z",
|
|
165
53
|
fill: "none"
|
|
166
|
-
}), _react["default"].createElement("path", {
|
|
54
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
167
55
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
168
56
|
})),
|
|
169
|
-
warning: _react["default"].createElement("svg", {
|
|
57
|
+
warning: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
170
58
|
xmlns: "http://www.w3.org/2000/svg",
|
|
171
59
|
width: "23",
|
|
172
60
|
height: "23",
|
|
173
61
|
viewBox: "0 0 24 24",
|
|
174
62
|
fill: "currentColor"
|
|
175
|
-
}, _react["default"].createElement("path", {
|
|
63
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
176
64
|
d: "M0 0h24v24H0z",
|
|
177
65
|
fill: "none"
|
|
178
|
-
}), _react["default"].createElement("path", {
|
|
66
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
179
67
|
d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
|
|
180
68
|
})),
|
|
181
|
-
error: _react["default"].createElement("svg", {
|
|
69
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
182
70
|
xmlns: "http://www.w3.org/2000/svg",
|
|
183
71
|
width: "23",
|
|
184
72
|
height: "23",
|
|
185
73
|
viewBox: "0 0 24 24",
|
|
186
74
|
fill: "currentColor"
|
|
187
|
-
}, _react["default"].createElement("path", {
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
188
76
|
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",
|
|
189
77
|
fill: "currentColor"
|
|
190
|
-
}), _react["default"].createElement("path", {
|
|
78
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
191
79
|
d: "M0 0h24v24H0z",
|
|
192
80
|
fill: "none"
|
|
193
81
|
}))
|
|
194
82
|
};
|
|
195
|
-
|
|
196
83
|
var DxcAlert = function DxcAlert(_ref) {
|
|
197
84
|
var _ref$type = _ref.type,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
85
|
+
type = _ref$type === void 0 ? "info" : _ref$type,
|
|
86
|
+
_ref$mode = _ref.mode,
|
|
87
|
+
mode = _ref$mode === void 0 ? "inline" : _ref$mode,
|
|
88
|
+
_ref$inlineText = _ref.inlineText,
|
|
89
|
+
inlineText = _ref$inlineText === void 0 ? "" : _ref$inlineText,
|
|
90
|
+
onClose = _ref.onClose,
|
|
91
|
+
children = _ref.children,
|
|
92
|
+
margin = _ref.margin,
|
|
93
|
+
_ref$size = _ref.size,
|
|
94
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
95
|
+
tabIndex = _ref.tabIndex;
|
|
209
96
|
var colorsTheme = (0, _useTheme["default"])();
|
|
210
|
-
|
|
97
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
211
98
|
var getTypeText = function getTypeText() {
|
|
212
|
-
return type === "info" ?
|
|
99
|
+
return type === "info" ? translatedLabels.alert.infoTitleText : type === "confirm" ? translatedLabels.alert.successTitleText : type === "warning" ? translatedLabels.alert.warningTitleText : translatedLabels.alert.errorTitleText;
|
|
213
100
|
};
|
|
214
|
-
|
|
215
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
216
102
|
theme: colorsTheme.alert
|
|
217
|
-
}, _react["default"].createElement(AlertModal, {
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement(AlertModal, {
|
|
218
104
|
mode: mode
|
|
219
|
-
}, mode === "modal" && _react["default"].createElement(OverlayContainer, {
|
|
105
|
+
}, mode === "modal" && /*#__PURE__*/_react["default"].createElement(OverlayContainer, {
|
|
220
106
|
mode: mode,
|
|
221
107
|
onClick: onClose
|
|
222
|
-
}), _react["default"].createElement(AlertContainer, {
|
|
108
|
+
}), /*#__PURE__*/_react["default"].createElement(AlertContainer, {
|
|
223
109
|
mode: mode,
|
|
224
110
|
type: type,
|
|
225
111
|
margin: margin,
|
|
226
112
|
size: size
|
|
227
|
-
}, _react["default"].createElement(AlertInfo, null, _react["default"].createElement(AlertIcon, {
|
|
228
|
-
type: type
|
|
229
|
-
}, type === "info" && alertIcons.info || type === "confirm" && alertIcons.success || type === "warning" && alertIcons.warning || type === "error" && alertIcons.error), _react["default"].createElement(AlertText, null, _react["default"].createElement(AlertTitle, {
|
|
113
|
+
}, /*#__PURE__*/_react["default"].createElement(AlertInfo, null, /*#__PURE__*/_react["default"].createElement(AlertIcon, {
|
|
230
114
|
type: type
|
|
231
|
-
}, getTypeText(
|
|
115
|
+
}, type === "info" && alertIcons.info || type === "confirm" && alertIcons.success || type === "warning" && alertIcons.warning || type === "error" && alertIcons.error), /*#__PURE__*/_react["default"].createElement(AlertText, null, /*#__PURE__*/_react["default"].createElement(AlertTitle, null, getTypeText()), inlineText && inlineText !== "" && "-", /*#__PURE__*/_react["default"].createElement(AlertInlineText, null, inlineText)), onClose && /*#__PURE__*/_react["default"].createElement(AlertCloseAction, {
|
|
232
116
|
onClick: onClose,
|
|
233
117
|
tabIndex: tabIndex
|
|
234
|
-
}, alertIcons.close)), children && _react["default"].createElement(AlertContent, null,
|
|
235
|
-
color: type === "info" && colorsTheme.alert.infoBackgroundColor || type === "confirm" && colorsTheme.alert.successBackgroundColor || type === "warning" && colorsTheme.alert.warningBackgroundColor || type === "error" && colorsTheme.alert.errorBackgroundColor
|
|
236
|
-
}, children)))));
|
|
118
|
+
}, alertIcons.close)), children && /*#__PURE__*/_react["default"].createElement(AlertContent, null, children))));
|
|
237
119
|
};
|
|
238
|
-
|
|
239
120
|
var sizes = {
|
|
240
121
|
small: "280px",
|
|
241
122
|
medium: "480px",
|
|
242
123
|
large: "820px",
|
|
243
124
|
fillParent: "100%",
|
|
244
|
-
fitContent: "
|
|
125
|
+
fitContent: "fit-content"
|
|
245
126
|
};
|
|
246
|
-
|
|
247
127
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
248
128
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
249
129
|
};
|
|
250
|
-
|
|
251
|
-
var AlertModal = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
130
|
+
var AlertModal = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n width: ", ";\n height: ", ";\n justify-content: ", ";\n align-items: ", ";\n top: ", ";\n left: ", ";\n position: ", ";\n display: ", ";\n z-index: ", ";\n"])), function (props) {
|
|
252
131
|
return props.theme.fontSizeBase;
|
|
253
132
|
}, function (props) {
|
|
254
133
|
return props.mode === "modal" ? "100%" : "";
|
|
@@ -269,8 +148,7 @@ var AlertModal = _styledComponents["default"].div(_templateObject(), function (p
|
|
|
269
148
|
}, function (props) {
|
|
270
149
|
return props.mode === "modal" ? "1200" : "";
|
|
271
150
|
});
|
|
272
|
-
|
|
273
|
-
var OverlayContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
151
|
+
var OverlayContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n position: ", ";\n top: ", ";\n bottom: ", ";\n left: ", ";\n right: ", ";\n"])), function (props) {
|
|
274
152
|
return props.mode === "modal" ? "".concat(props.theme.overlayColor) : "transparent";
|
|
275
153
|
}, function (props) {
|
|
276
154
|
return props.mode === "modal" ? "fixed" : "";
|
|
@@ -283,8 +161,7 @@ var OverlayContainer = _styledComponents["default"].div(_templateObject2(), func
|
|
|
283
161
|
}, function (props) {
|
|
284
162
|
return props.mode === "modal" ? "0" : "";
|
|
285
163
|
});
|
|
286
|
-
|
|
287
|
-
var AlertContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
164
|
+
var AlertContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: ", ";\n overflow: hidden;\n box-sizing: border-box;\n\n background-color: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n\n padding-left: 12px;\n padding-right: 12px;\n justify-content: ", ";\n align-items: ", ";\n max-width: ", ";\n width: ", ";\n z-index: ", ";\n"])), function (props) {
|
|
288
165
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
289
166
|
}, function (props) {
|
|
290
167
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -317,12 +194,10 @@ var AlertContainer = _styledComponents["default"].div(_templateObject3(), functi
|
|
|
317
194
|
}, function (props) {
|
|
318
195
|
return props.mode === "modal" ? "1300" : "";
|
|
319
196
|
});
|
|
320
|
-
|
|
321
|
-
var AlertInfo = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
197
|
+
var AlertInfo = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n height: calc(48px - calc(", " * 2));\n align-items: center;\n width: 100%;\n"])), function (props) {
|
|
322
198
|
return props.theme.borderThickness;
|
|
323
199
|
});
|
|
324
|
-
|
|
325
|
-
var AlertTitle = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
200
|
+
var AlertTitle = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 8px;\n padding-right: ", ";\n padding-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n"])), function (props) {
|
|
326
201
|
return props.theme.titlePaddingRight;
|
|
327
202
|
}, function (props) {
|
|
328
203
|
return props.theme.titlePaddingLeft;
|
|
@@ -339,8 +214,7 @@ var AlertTitle = _styledComponents["default"].div(_templateObject5(), function (
|
|
|
339
214
|
}, function (props) {
|
|
340
215
|
return props.theme.titleTextTransform;
|
|
341
216
|
});
|
|
342
|
-
|
|
343
|
-
var AlertInlineText = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
217
|
+
var AlertInlineText = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 8px;\n padding-right: ", ";\n padding-left: ", ";\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
|
|
344
218
|
return props.theme.inlineTextPaddingRight;
|
|
345
219
|
}, function (props) {
|
|
346
220
|
return props.theme.inlineTextPaddingLeft;
|
|
@@ -355,8 +229,7 @@ var AlertInlineText = _styledComponents["default"].div(_templateObject6(), funct
|
|
|
355
229
|
}, function (props) {
|
|
356
230
|
return props.theme.inlineTextFontColor;
|
|
357
231
|
});
|
|
358
|
-
|
|
359
|
-
var AlertIcon = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
232
|
+
var AlertIcon = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 12px;\n padding-right: ", ";\n padding-left: ", ";\n\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
360
233
|
return props.theme.iconPaddingRight;
|
|
361
234
|
}, function (props) {
|
|
362
235
|
return props.theme.iconPaddingLeft;
|
|
@@ -367,37 +240,15 @@ var AlertIcon = _styledComponents["default"].span(_templateObject7(), function (
|
|
|
367
240
|
}, function (props) {
|
|
368
241
|
return props.theme.iconSize;
|
|
369
242
|
});
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
|
|
373
|
-
var AlertContent = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
243
|
+
var AlertText = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n align-items: center;\n overflow: hidden;\n"])));
|
|
244
|
+
var AlertContent = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1 1 auto;\n padding: ", ";\n overflow-y: auto;\n"])), function (props) {
|
|
374
245
|
return "".concat(props.theme.contentPaddingTop, " ").concat(props.theme.contentPaddingRight, " ").concat(props.theme.contentPaddingBottom, " ").concat(props.theme.contentPaddingLeft);
|
|
375
246
|
});
|
|
376
|
-
|
|
377
|
-
var AlertCloseAction = _styledComponents["default"].button(_templateObject10(), function (props) {
|
|
247
|
+
var AlertCloseAction = _styledComponents["default"].button(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n border: 1px solid transparent;\n border-radius: 2px;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n margin-left: 12px;\n background-color: transparent;\n color: #000000;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n &:focus,\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
378
248
|
return props.theme.hoverActionBackgroundColor;
|
|
379
249
|
}, function (props) {
|
|
380
250
|
return props.theme.focusActionBorderColor;
|
|
381
|
-
}, function (props) {
|
|
382
|
-
return props.theme.focusActionBorderColor;
|
|
383
251
|
}, function (props) {
|
|
384
252
|
return props.theme.activeActionBackgroundColor;
|
|
385
253
|
});
|
|
386
|
-
|
|
387
|
-
DxcAlert.propTypes = {
|
|
388
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
389
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
390
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
391
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
392
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
393
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
394
|
-
type: _propTypes["default"].oneOf(["info", "confirm", "warning", "error"]),
|
|
395
|
-
mode: _propTypes["default"].oneOf(["inline", "modal"]),
|
|
396
|
-
inlineText: _propTypes["default"].string,
|
|
397
|
-
onClose: _propTypes["default"].func,
|
|
398
|
-
children: _propTypes["default"].element,
|
|
399
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
400
|
-
tabIndex: _propTypes["default"].number
|
|
401
|
-
};
|
|
402
|
-
var _default = DxcAlert;
|
|
403
|
-
exports["default"] = _default;
|
|
254
|
+
var _default = exports["default"] = DxcAlert;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcAlert from "./Alert";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Alert",
|
|
9
|
+
component: DxcAlert,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const opinionatedTheme = {
|
|
13
|
+
alert: {
|
|
14
|
+
baseColor: "#e6f4ff",
|
|
15
|
+
accentColor: "#0067b3",
|
|
16
|
+
overlayColor: "#000000b3",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Chromatic = () => (
|
|
21
|
+
<>
|
|
22
|
+
<ExampleContainer>
|
|
23
|
+
<Title title="Info" theme="light" level={4} />
|
|
24
|
+
<DxcAlert inlineText="Info type alert with inline text." />
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<ExampleContainer>
|
|
27
|
+
<Title title="Confirm" theme="light" level={4} />
|
|
28
|
+
<DxcAlert type="confirm" inlineText="Confirm type alert with inline text." />
|
|
29
|
+
</ExampleContainer>
|
|
30
|
+
<ExampleContainer>
|
|
31
|
+
<Title title="Warning" theme="light" level={4} />
|
|
32
|
+
<DxcAlert type="warning" inlineText="Warning type alert with inline text." />
|
|
33
|
+
</ExampleContainer>
|
|
34
|
+
<ExampleContainer>
|
|
35
|
+
<Title title="Error" theme="light" level={4} />
|
|
36
|
+
<DxcAlert type="error" inlineText="Error type alert with inline text." />
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<ExampleContainer>
|
|
39
|
+
<Title title="With close button" theme="light" level={4} />
|
|
40
|
+
<DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
|
|
41
|
+
</ExampleContainer>
|
|
42
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
43
|
+
<Title title="With hovered close button" theme="light" level={4} />
|
|
44
|
+
<DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
|
|
45
|
+
</ExampleContainer>
|
|
46
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
47
|
+
<Title title="With focused close button" theme="light" level={4} />
|
|
48
|
+
<DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
|
|
49
|
+
</ExampleContainer>
|
|
50
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
51
|
+
<Title title="With actived close button" theme="light" level={4} />
|
|
52
|
+
<DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
|
|
53
|
+
</ExampleContainer>
|
|
54
|
+
<ExampleContainer>
|
|
55
|
+
<Title title="With children" theme="light" level={4} />
|
|
56
|
+
<DxcAlert>
|
|
57
|
+
<div>
|
|
58
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
59
|
+
lobortis eget.
|
|
60
|
+
</div>
|
|
61
|
+
</DxcAlert>
|
|
62
|
+
</ExampleContainer>
|
|
63
|
+
<ExampleContainer>
|
|
64
|
+
<Title title="With inline text and children" theme="light" level={4} />
|
|
65
|
+
<DxcAlert inlineText="Info type alert with inline text.">
|
|
66
|
+
<div>
|
|
67
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
68
|
+
lobortis eget.
|
|
69
|
+
</div>
|
|
70
|
+
</DxcAlert>
|
|
71
|
+
</ExampleContainer>
|
|
72
|
+
<Title title="Margins" theme="light" level={2} />
|
|
73
|
+
<ExampleContainer>
|
|
74
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
75
|
+
<DxcAlert margin="xxsmall" inlineText="Info type alert with inline text and xxsmall margin." />
|
|
76
|
+
</ExampleContainer>
|
|
77
|
+
<ExampleContainer>
|
|
78
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
79
|
+
<DxcAlert margin="xsmall" inlineText="Info type alert with inline text and xsmall margin." />
|
|
80
|
+
</ExampleContainer>
|
|
81
|
+
<ExampleContainer>
|
|
82
|
+
<Title title="Small" theme="light" level={4} />
|
|
83
|
+
<DxcAlert margin="small" inlineText="Info type alert with inline text and small margin." />
|
|
84
|
+
</ExampleContainer>
|
|
85
|
+
<ExampleContainer>
|
|
86
|
+
<Title title="Medium" theme="light" level={4} />
|
|
87
|
+
<DxcAlert margin="medium" inlineText="Info type alert with inline text and medium margin." />
|
|
88
|
+
</ExampleContainer>
|
|
89
|
+
<ExampleContainer>
|
|
90
|
+
<Title title="Large" theme="light" level={4} />
|
|
91
|
+
<DxcAlert margin="large" inlineText="Info type alert with inline text and large margin." />
|
|
92
|
+
</ExampleContainer>
|
|
93
|
+
<ExampleContainer>
|
|
94
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
95
|
+
<DxcAlert margin="xlarge" inlineText="Info type alert with inline text and xlarge margin." />
|
|
96
|
+
</ExampleContainer>
|
|
97
|
+
<ExampleContainer>
|
|
98
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
99
|
+
<DxcAlert margin="xxlarge" inlineText="Info type alert with inline text and xxlarge margin." />
|
|
100
|
+
</ExampleContainer>
|
|
101
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
102
|
+
<ExampleContainer>
|
|
103
|
+
<Title title="FitContent" theme="light" level={4} />
|
|
104
|
+
<DxcAlert
|
|
105
|
+
size="fitContent"
|
|
106
|
+
inlineText="Info type alert with inline text, children, close button and fitContent size."
|
|
107
|
+
onClose={() => {}}
|
|
108
|
+
>
|
|
109
|
+
<div>
|
|
110
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
111
|
+
lobortis eget.
|
|
112
|
+
</div>
|
|
113
|
+
</DxcAlert>
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Small" theme="light" level={4} />
|
|
117
|
+
<DxcAlert
|
|
118
|
+
size="small"
|
|
119
|
+
inlineText="Info type alert with inline text, children, close button and small size."
|
|
120
|
+
onClose={() => {}}
|
|
121
|
+
>
|
|
122
|
+
<div>
|
|
123
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
124
|
+
lobortis eget.
|
|
125
|
+
</div>
|
|
126
|
+
</DxcAlert>
|
|
127
|
+
</ExampleContainer>
|
|
128
|
+
<ExampleContainer>
|
|
129
|
+
<Title title="Medium" theme="light" level={4} />
|
|
130
|
+
<DxcAlert
|
|
131
|
+
size="medium"
|
|
132
|
+
inlineText="Info type alert with inline text, children, close button and medium size."
|
|
133
|
+
onClose={() => {}}
|
|
134
|
+
>
|
|
135
|
+
<div>
|
|
136
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
137
|
+
lobortis eget.
|
|
138
|
+
</div>
|
|
139
|
+
</DxcAlert>
|
|
140
|
+
</ExampleContainer>
|
|
141
|
+
<ExampleContainer>
|
|
142
|
+
<Title title="Large" theme="light" level={4} />
|
|
143
|
+
<DxcAlert
|
|
144
|
+
size="large"
|
|
145
|
+
inlineText="Info type alert with inline text, children, close button and large size."
|
|
146
|
+
onClose={() => {}}
|
|
147
|
+
>
|
|
148
|
+
<div>
|
|
149
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
150
|
+
lobortis eget.
|
|
151
|
+
</div>
|
|
152
|
+
</DxcAlert>
|
|
153
|
+
</ExampleContainer>
|
|
154
|
+
<ExampleContainer>
|
|
155
|
+
<Title title="FillParent" theme="light" level={4} />
|
|
156
|
+
<DxcAlert
|
|
157
|
+
size="fillParent"
|
|
158
|
+
inlineText="Info type alert with inline text, children, close button and fillParent size."
|
|
159
|
+
onClose={() => {}}
|
|
160
|
+
>
|
|
161
|
+
<div>
|
|
162
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
163
|
+
lobortis eget.
|
|
164
|
+
</div>
|
|
165
|
+
</DxcAlert>
|
|
166
|
+
</ExampleContainer>
|
|
167
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
168
|
+
<ExampleContainer>
|
|
169
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
170
|
+
<DxcAlert inlineText="Info type alert with inline text." />
|
|
171
|
+
</HalstackProvider>
|
|
172
|
+
</ExampleContainer>
|
|
173
|
+
</>
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
export const ModalAlert = () => (
|
|
177
|
+
<ExampleContainer>
|
|
178
|
+
<DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
|
|
179
|
+
<div>
|
|
180
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
181
|
+
lobortis eget.
|
|
182
|
+
</div>
|
|
183
|
+
</DxcAlert>
|
|
184
|
+
</ExampleContainer>
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
export const ModalAlertOpinionated = () => (
|
|
188
|
+
<ExampleContainer>
|
|
189
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
190
|
+
<DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
|
|
191
|
+
<div>
|
|
192
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
193
|
+
lobortis eget.
|
|
194
|
+
</div>
|
|
195
|
+
</DxcAlert>
|
|
196
|
+
</HalstackProvider>
|
|
197
|
+
</ExampleContainer>
|
|
198
|
+
);
|