@dxc-technology/halstack-react 0.0.0-ebb089f → 0.0.0-ebf4fe2
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 +10 -0
- package/BackgroundColorContext.js +47 -0
- package/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +226 -0
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +169 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +43 -153
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -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 +61 -0
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -0
- package/bleed/Bleed.stories.tsx +341 -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 +116 -0
- package/box/Box.stories.tsx +132 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/{dist/button → button}/Button.js +33 -97
- package/button/Button.stories.tsx +274 -0
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +53 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +161 -0
- package/card/Card.stories.tsx +201 -0
- package/card/Card.test.js +50 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +52 -94
- package/checkbox/Checkbox.stories.tsx +188 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +64 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +161 -0
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +302 -406
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +80 -108
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +107 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +138 -0
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/Dialog.test.js +40 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +54 -207
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +80 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +593 -0
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +186 -0
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +185 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/{dist/footer → footer}/Icons.js +16 -16
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +303 -0
- package/header/Header.stories.tsx +172 -0
- package/header/Header.test.js +79 -0
- package/header/Icons.d.ts +2 -0
- package/{dist/header → header}/Icons.js +7 -32
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +25 -96
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +60 -0
- package/inline/Inline.stories.tsx +305 -0
- package/inline/types.d.ts +36 -0
- package/inline/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +51 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +11 -0
- package/layout/ApplicationLayout.js +199 -0
- package/layout/ApplicationLayout.stories.tsx +126 -0
- package/layout/Icons.d.ts +5 -0
- package/{dist/layout → layout}/Icons.js +19 -8
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +52 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +136 -0
- package/link/Link.stories.tsx +186 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +89 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +48 -0
- package/{dist/main.js → main.js} +138 -96
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +76 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +506 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +124 -0
- package/number-input/types.js +5 -0
- package/package.json +27 -20
- package/{dist/paginator → paginator}/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +171 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +308 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password-input → password-input}/PasswordInput.js +40 -77
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +180 -0
- package/password-input/types.d.ts +110 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +23 -95
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/ProgressBar.test.js +65 -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 +116 -0
- package/quick-nav/QuickNav.stories.tsx +237 -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 +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +282 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +348 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +175 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +660 -0
- package/select/Select.stories.tsx +626 -0
- package/select/Select.test.js +2162 -0
- package/select/types.d.ts +212 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +147 -0
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +76 -162
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +82 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +4 -0
- package/stack/Stack.js +52 -0
- package/stack/Stack.stories.tsx +225 -0
- package/stack/types.d.ts +28 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +195 -0
- package/switch/Switch.stories.tsx +160 -0
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +62 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +12 -26
- package/table/Table.stories.jsx +277 -0
- package/table/Table.test.js +26 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +211 -0
- package/tabs/Tabs.stories.tsx +112 -0
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +82 -0
- package/tabs/types.js +5 -0
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +183 -0
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.d.ts +4 -0
- package/{dist/text-input → text-input}/TextInput.js +282 -486
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +178 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/{dist/textarea → textarea}/Textarea.js +50 -142
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +137 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +36 -148
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +105 -0
- package/toggle-group/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +292 -0
- package/wizard/Wizard.stories.tsx +214 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -7
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -250
- package/dist/V3Select/V3Select.js +0 -549
- package/dist/V3Select/index.d.ts +0 -27
- package/dist/V3Textarea/V3Textarea.js +0 -264
- package/dist/V3Textarea/index.d.ts +0 -27
- package/dist/accordion/Accordion.js +0 -353
- package/dist/accordion/index.d.ts +0 -28
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/accordion-group/index.d.ts +0 -16
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/box/Box.js +0 -156
- package/dist/box/index.d.ts +0 -25
- package/dist/button/Button.stories.js +0 -27
- package/dist/button/index.d.ts +0 -24
- package/dist/card/Card.js +0 -254
- package/dist/card/index.d.ts +0 -22
- package/dist/checkbox/index.d.ts +0 -24
- package/dist/chip/Chip.js +0 -265
- package/dist/chip/index.d.ts +0 -22
- package/dist/date/Date.js +0 -379
- package/dist/date/index.d.ts +0 -27
- package/dist/date-input/index.d.ts +0 -95
- package/dist/dialog/Dialog.js +0 -218
- package/dist/dialog/index.d.ts +0 -18
- package/dist/dropdown/index.d.ts +0 -26
- package/dist/file-input/FileInput.js +0 -644
- package/dist/file-input/FileItem.js +0 -287
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -421
- package/dist/footer/index.d.ts +0 -25
- package/dist/header/Header.js +0 -470
- package/dist/header/index.d.ts +0 -25
- package/dist/heading/index.d.ts +0 -17
- package/dist/input-text/Icons.js +0 -22
- package/dist/input-text/InputText.js +0 -705
- package/dist/input-text/index.d.ts +0 -36
- package/dist/layout/ApplicationLayout.js +0 -327
- package/dist/link/Link.js +0 -237
- package/dist/link/index.d.ts +0 -23
- package/dist/main.d.ts +0 -40
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -305
- package/dist/paginator/index.d.ts +0 -20
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/index.d.ts +0 -18
- package/dist/radio/Radio.js +0 -209
- package/dist/radio/index.d.ts +0 -23
- package/dist/resultsetTable/index.d.ts +0 -19
- package/dist/select/Select.js +0 -1137
- package/dist/select/index.d.ts +0 -131
- package/dist/sidenav/Sidenav.js +0 -179
- package/dist/sidenav/index.d.ts +0 -13
- package/dist/slider/index.d.ts +0 -29
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/index.d.ts +0 -17
- package/dist/switch/Switch.js +0 -222
- package/dist/switch/index.d.ts +0 -24
- package/dist/table/index.d.ts +0 -13
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/index.d.ts +0 -19
- package/dist/tag/Tag.js +0 -282
- package/dist/tag/index.d.ts +0 -24
- package/dist/text-input/index.d.ts +0 -135
- package/dist/textarea/index.d.ts +0 -117
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/index.d.ts +0 -21
- package/dist/toggle-group/index.d.ts +0 -21
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/Icons.js +0 -40
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/dragAndDropArea/Icons.js +0 -39
- package/dist/upload/file-upload/FileToUpload.js +0 -189
- package/dist/upload/file-upload/Icons.js +0 -66
- package/dist/upload/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/index.d.ts +0 -15
- package/dist/upload/transaction/Icons.js +0 -160
- package/dist/upload/transaction/Transaction.js +0 -148
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Icons.js +0 -65
- package/dist/wizard/Wizard.js +0 -405
- package/dist/wizard/index.d.ts +0 -18
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -395
- package/test/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -83
- package/test/InputText.test.js +0 -239
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -181
- package/test/PasswordInput.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -928
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -731
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3Select.test.js +0 -212
- package/test/V3TextArea.test.js +0 -51
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
package/dist/tabs/Tabs.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
|
|
18
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
19
|
-
|
|
20
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
|
-
var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
|
|
25
|
-
|
|
26
|
-
var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
|
|
27
|
-
|
|
28
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
29
|
-
|
|
30
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
-
|
|
32
|
-
var _variables = require("../common/variables.js");
|
|
33
|
-
|
|
34
|
-
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
35
|
-
|
|
36
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
37
|
-
|
|
38
|
-
function _templateObject9() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject9 = function _templateObject9() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject8() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject8 = function _templateObject8() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject7() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiTabs-root {\n background: white;\n min-height: ", ";\n\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: ", " !important;\n }\n .MuiButtonBase-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n\n padding: ", ";\n height: ", ";\n min-width: 90px;\n max-width: 360px;\n min-height: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n font-weight: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-disabled {\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n font-style: ", ";\n svg {\n color: ", ";\n }\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n .MuiTabs-indicator {\n background-color: ", ";\n height: ", ";\n }\n .MuiTabs-scrollButtons {\n min-width: ", ";\n width: ", ";\n padding: 0;\n }\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject7 = function _templateObject7() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject6() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject6 = function _templateObject6() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject5() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject5 = function _templateObject5() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject4() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject4 = function _templateObject4() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _templateObject3() {
|
|
99
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
100
|
-
|
|
101
|
-
_templateObject3 = function _templateObject3() {
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _templateObject2() {
|
|
109
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n"]);
|
|
110
|
-
|
|
111
|
-
_templateObject2 = function _templateObject2() {
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _templateObject() {
|
|
119
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"]);
|
|
120
|
-
|
|
121
|
-
_templateObject = function _templateObject() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
return data;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var DxcTabs = function DxcTabs(_ref) {
|
|
129
|
-
var activeTabIndex = _ref.activeTabIndex,
|
|
130
|
-
_ref$tabs = _ref.tabs,
|
|
131
|
-
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
132
|
-
onTabClick = _ref.onTabClick,
|
|
133
|
-
onTabHover = _ref.onTabHover,
|
|
134
|
-
margin = _ref.margin,
|
|
135
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
136
|
-
iconPosition = _ref$iconPosition === void 0 ? "left" : _ref$iconPosition,
|
|
137
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
138
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
139
|
-
|
|
140
|
-
var _React$useState = _react["default"].useState(0),
|
|
141
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
142
|
-
innerActiveTabIndex = _React$useState2[0],
|
|
143
|
-
setInnerActiveTabIndex = _React$useState2[1];
|
|
144
|
-
|
|
145
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
146
|
-
var hasLabelAndIcon = tabs && tabs.filter(function (tab) {
|
|
147
|
-
return tab.label && tab.icon;
|
|
148
|
-
}).length > 0;
|
|
149
|
-
|
|
150
|
-
var handleChange = function handleChange(event, newValue) {
|
|
151
|
-
if (activeTabIndex == null) {
|
|
152
|
-
setInnerActiveTabIndex(newValue);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (typeof onTabClick === "function") {
|
|
156
|
-
onTabClick(newValue);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var getTabIndex = function getTabIndex(index, disabled) {
|
|
161
|
-
return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
var getLabelForTab = function getLabelForTab(tab) {
|
|
165
|
-
return _react["default"].createElement(ParentLabelSpan, null, _react["default"].createElement(MainLabelContainer, {
|
|
166
|
-
hasBadge: tab.notificationNumber
|
|
167
|
-
}, _react["default"].createElement(TabLabelContainer, {
|
|
168
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
169
|
-
iconPosition: iconPosition
|
|
170
|
-
}, tab.icon ? _react["default"].createElement(TabIconContainer, {
|
|
171
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
172
|
-
iconPosition: iconPosition
|
|
173
|
-
}, (0, _typeof2["default"])(tab.icon) === "object" ? tab.icon : _react["default"].createElement(tab.icon)) : tab.iconSrc && _react["default"].createElement(TabIcon, {
|
|
174
|
-
src: tab.iconSrc
|
|
175
|
-
}), _react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && _react["default"].createElement(BadgeContainer, {
|
|
176
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
177
|
-
iconPosition: iconPosition
|
|
178
|
-
}, _react["default"].createElement(_Badge["default"], {
|
|
179
|
-
notificationText: tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
|
|
180
|
-
})));
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
184
|
-
theme: colorsTheme.tabs
|
|
185
|
-
}, _react["default"].createElement(DxCTabs, {
|
|
186
|
-
margin: margin,
|
|
187
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
188
|
-
iconPosition: iconPosition
|
|
189
|
-
}, _react["default"].createElement(Underline, null), _react["default"].createElement(_Tabs["default"], {
|
|
190
|
-
value: activeTabIndex != null ? activeTabIndex : innerActiveTabIndex,
|
|
191
|
-
onChange: handleChange,
|
|
192
|
-
variant: "scrollable",
|
|
193
|
-
scrollButtons: "auto"
|
|
194
|
-
}, tabs.map(function (tab, i) {
|
|
195
|
-
var tabContent = _react["default"].forwardRef(function (props, ref) {
|
|
196
|
-
return _react["default"].createElement("div", (0, _extends2["default"])({
|
|
197
|
-
role: "button"
|
|
198
|
-
}, props, {
|
|
199
|
-
ref: ref
|
|
200
|
-
}));
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
return _react["default"].createElement(_Tab["default"], {
|
|
204
|
-
tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
|
|
205
|
-
key: "tab".concat(i).concat(tab.label),
|
|
206
|
-
label: getLabelForTab(tab),
|
|
207
|
-
disabled: tab.isDisabled,
|
|
208
|
-
disableRipple: true,
|
|
209
|
-
onMouseEnter: function onMouseEnter() {
|
|
210
|
-
onTabHover(i);
|
|
211
|
-
},
|
|
212
|
-
onMouseLeave: function onMouseLeave() {
|
|
213
|
-
onTabHover(null);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}))));
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
var ParentLabelSpan = _styledComponents["default"].div(_templateObject());
|
|
220
|
-
|
|
221
|
-
var TabLabelContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
222
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
var LabelTextContainer = _styledComponents["default"].div(_templateObject3());
|
|
226
|
-
|
|
227
|
-
var BadgeContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
228
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "0" || "5px";
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
232
|
-
return props.hasBadge && "35px" || "unset";
|
|
233
|
-
}, function (props) {
|
|
234
|
-
return props.hasBadge && "35px" || "unset";
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
238
|
-
return props.theme.dividerThickness;
|
|
239
|
-
}, function (props) {
|
|
240
|
-
return props.theme.dividerColor;
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
244
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
245
|
-
}, function (props) {
|
|
246
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
247
|
-
}, function (props) {
|
|
248
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
249
|
-
}, function (props) {
|
|
250
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
251
|
-
}, function (props) {
|
|
252
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
253
|
-
}, function (props) {
|
|
254
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
255
|
-
}, function (props) {
|
|
256
|
-
return props.theme.fontTextTransform;
|
|
257
|
-
}, function (props) {
|
|
258
|
-
return props.theme.fontFamily;
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return props.theme.fontSize;
|
|
261
|
-
}, function (props) {
|
|
262
|
-
return props.theme.fontStyle;
|
|
263
|
-
}, function (props) {
|
|
264
|
-
return props.theme.fontWeight;
|
|
265
|
-
}, function (props) {
|
|
266
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
267
|
-
}, function (props) {
|
|
268
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
269
|
-
}, function (props) {
|
|
270
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
271
|
-
}, function (props) {
|
|
272
|
-
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
273
|
-
}, function (props) {
|
|
274
|
-
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
275
|
-
}, function (props) {
|
|
276
|
-
return "".concat(props.theme.pressedFontWeight, " !important");
|
|
277
|
-
}, function (props) {
|
|
278
|
-
return props.theme.unselectedBackgroundColor;
|
|
279
|
-
}, function (props) {
|
|
280
|
-
return props.theme.unselectedFontColor;
|
|
281
|
-
}, function (props) {
|
|
282
|
-
return props.theme.unselectedIconColor;
|
|
283
|
-
}, function (props) {
|
|
284
|
-
return props.theme.selectedBackgroundColor;
|
|
285
|
-
}, function (props) {
|
|
286
|
-
return props.theme.selectedFontColor;
|
|
287
|
-
}, function (props) {
|
|
288
|
-
return props.theme.selectedIconColor;
|
|
289
|
-
}, function (props) {
|
|
290
|
-
return props.theme.disabledFontColor;
|
|
291
|
-
}, function (props) {
|
|
292
|
-
return props.theme.disabledFontStyle;
|
|
293
|
-
}, function (props) {
|
|
294
|
-
return props.theme.disabledIconColor;
|
|
295
|
-
}, function (props) {
|
|
296
|
-
return props.theme.focusOutline;
|
|
297
|
-
}, function (props) {
|
|
298
|
-
return props.theme.selectedUnderlineColor;
|
|
299
|
-
}, function (props) {
|
|
300
|
-
return props.theme.selectedUnderlineThickness;
|
|
301
|
-
}, function (props) {
|
|
302
|
-
return props.theme.scrollButtonsWidth;
|
|
303
|
-
}, function (props) {
|
|
304
|
-
return props.theme.scrollButtonsWidth;
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
var TabIcon = _styledComponents["default"].img(_templateObject8());
|
|
308
|
-
|
|
309
|
-
var TabIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
310
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
|
|
311
|
-
}, function (props) {
|
|
312
|
-
return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
DxcTabs.propTypes = {
|
|
316
|
-
activeTabIndex: _propTypes["default"].number,
|
|
317
|
-
onTabClick: _propTypes["default"].func,
|
|
318
|
-
onTabHover: _propTypes["default"].func,
|
|
319
|
-
tabs: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
320
|
-
label: _propTypes["default"].string,
|
|
321
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
322
|
-
iconSrc: _propTypes["default"].string,
|
|
323
|
-
isDisabled: _propTypes["default"].bool,
|
|
324
|
-
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string, _propTypes["default"].number])
|
|
325
|
-
})),
|
|
326
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
327
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
328
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
329
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
330
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
331
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
332
|
-
iconPosition: _propTypes["default"].oneOf(["top", "left"]),
|
|
333
|
-
tabIndex: _propTypes["default"].number
|
|
334
|
-
};
|
|
335
|
-
DxcTabs.defaultProps = {
|
|
336
|
-
activeTabIndex: null,
|
|
337
|
-
tabs: [],
|
|
338
|
-
onTabClick: function onTabClick() {},
|
|
339
|
-
onTabHover: function onTabHover() {},
|
|
340
|
-
iconPosition: "top"
|
|
341
|
-
};
|
|
342
|
-
var _default = DxcTabs;
|
|
343
|
-
exports["default"] = _default;
|
package/dist/tabs/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
activeTabIndex?: number;
|
|
11
|
-
tabs?: any;
|
|
12
|
-
onTabClick?: void;
|
|
13
|
-
onTabHover?: void;
|
|
14
|
-
iconPosition?: "top" | "left";
|
|
15
|
-
margin?: Space | Margin;
|
|
16
|
-
tabIndex?: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default function DxcTabs(props: Props): JSX.Element;
|
package/dist/tag/Tag.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
|
-
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
-
|
|
30
|
-
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
31
|
-
|
|
32
|
-
function _templateObject8() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex-grow: 1;\n text-align: center;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject8 = function _templateObject8() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject7() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n background: ", ";\n width: ", ";\n height: 100%;\n justify-content: center;\n align-items: center;\n color: ", ";\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject7 = function _templateObject7() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject6() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n\n img,\n svg {\n width: ", ";\n height: ", ";\n }\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject6 = function _templateObject6() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject5() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n width: ", ";\n height: ", ";\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject5 = function _templateObject5() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject4() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background: none;\n border-radius: 4px;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: inherit;\n\n :focus {\n outline: 2px solid ", ";\n }\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject4 = function _templateObject4() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject3() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n border-radius: 4px;\n\n :focus {\n outline: 2px solid ", ";\n outline-offset: 0px;\n }\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject3 = function _templateObject3() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject2() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n flex-direction: ", ";\n width: ", ";\n height: ", ";\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject2 = function _templateObject2() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject = function _templateObject() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var DxcTag = function DxcTag(_ref) {
|
|
113
|
-
var icon = _ref.icon,
|
|
114
|
-
iconSrc = _ref.iconSrc,
|
|
115
|
-
label = _ref.label,
|
|
116
|
-
margin = _ref.margin,
|
|
117
|
-
linkHref = _ref.linkHref,
|
|
118
|
-
onClick = _ref.onClick,
|
|
119
|
-
_ref$iconBgColor = _ref.iconBgColor,
|
|
120
|
-
iconBgColor = _ref$iconBgColor === void 0 ? "#5f249f" : _ref$iconBgColor,
|
|
121
|
-
_ref$labelPosition = _ref.labelPosition,
|
|
122
|
-
labelPosition = _ref$labelPosition === void 0 ? "after" : _ref$labelPosition,
|
|
123
|
-
_ref$newWindow = _ref.newWindow,
|
|
124
|
-
newWindow = _ref$newWindow === void 0 ? false : _ref$newWindow,
|
|
125
|
-
_ref$size = _ref.size,
|
|
126
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
127
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
128
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
129
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
130
|
-
|
|
131
|
-
var _useState = (0, _react.useState)(false),
|
|
132
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
133
|
-
isHovered = _useState2[0],
|
|
134
|
-
changeIsHovered = _useState2[1];
|
|
135
|
-
|
|
136
|
-
var clickHandler = function clickHandler() {
|
|
137
|
-
onClick && onClick();
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
var tagContent = _react["default"].createElement(_Box["default"], {
|
|
141
|
-
size: size,
|
|
142
|
-
shadowDepth: isHovered && (onClick || linkHref) && 2 || 1
|
|
143
|
-
}, _react["default"].createElement(TagContent, {
|
|
144
|
-
labelPosition: labelPosition,
|
|
145
|
-
size: size
|
|
146
|
-
}, _react["default"].createElement(IconContainer, {
|
|
147
|
-
iconBgColor: iconBgColor
|
|
148
|
-
}, icon ? _react["default"].createElement(TagIconContainer, null, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : _react["default"].createElement(TagIcon, {
|
|
149
|
-
src: iconSrc
|
|
150
|
-
})), size !== "small" && _react["default"].createElement(TagLabel, null, label)));
|
|
151
|
-
|
|
152
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
153
|
-
theme: colorsTheme.tag
|
|
154
|
-
}, _react["default"].createElement(StyledDxcTag, {
|
|
155
|
-
margin: margin,
|
|
156
|
-
onMouseEnter: function onMouseEnter() {
|
|
157
|
-
return changeIsHovered(true);
|
|
158
|
-
},
|
|
159
|
-
onMouseLeave: function onMouseLeave() {
|
|
160
|
-
return changeIsHovered(false);
|
|
161
|
-
},
|
|
162
|
-
onClick: clickHandler,
|
|
163
|
-
hasAction: onClick || linkHref
|
|
164
|
-
}, onClick ? _react["default"].createElement(StyledButton, {
|
|
165
|
-
tabIndex: tabIndex
|
|
166
|
-
}, tagContent) : linkHref ? _react["default"].createElement(StyledLink, {
|
|
167
|
-
tabIndex: tabIndex,
|
|
168
|
-
href: linkHref,
|
|
169
|
-
target: newWindow ? "_blank" : "_self"
|
|
170
|
-
}, tagContent) : tagContent));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
var sizes = {
|
|
174
|
-
small: "42px",
|
|
175
|
-
medium: "240px",
|
|
176
|
-
large: "480px",
|
|
177
|
-
fillParent: "100%",
|
|
178
|
-
fitContent: "unset"
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
var calculateWidth = function calculateWidth(size) {
|
|
182
|
-
return sizes[size];
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
var StyledDxcTag = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
186
|
-
var hasAction = _ref2.hasAction;
|
|
187
|
-
return hasAction && "pointer" || "unset";
|
|
188
|
-
}, function (_ref3) {
|
|
189
|
-
var margin = _ref3.margin;
|
|
190
|
-
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
191
|
-
}, function (_ref4) {
|
|
192
|
-
var margin = _ref4.margin;
|
|
193
|
-
return margin && margin.top ? _variables.spaces[margin.top] : "";
|
|
194
|
-
}, function (_ref5) {
|
|
195
|
-
var margin = _ref5.margin;
|
|
196
|
-
return margin && margin.right ? _variables.spaces[margin.right] : "";
|
|
197
|
-
}, function (_ref6) {
|
|
198
|
-
var margin = _ref6.margin;
|
|
199
|
-
return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
200
|
-
}, function (_ref7) {
|
|
201
|
-
var margin = _ref7.margin;
|
|
202
|
-
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
var TagContent = _styledComponents["default"].div(_templateObject2(), function (_ref8) {
|
|
206
|
-
var labelPosition = _ref8.labelPosition;
|
|
207
|
-
return labelPosition === "before" && "row-reverse" || "row";
|
|
208
|
-
}, function (props) {
|
|
209
|
-
return calculateWidth(props.size);
|
|
210
|
-
}, function (props) {
|
|
211
|
-
return props.theme.height;
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
var StyledLink = _styledComponents["default"].a(_templateObject3(), function (props) {
|
|
215
|
-
return props.theme.focusColor;
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
var StyledButton = _styledComponents["default"].button(_templateObject4(), function (props) {
|
|
219
|
-
return props.theme.focusColor;
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
var TagIcon = _styledComponents["default"].img(_templateObject5(), function (props) {
|
|
223
|
-
return props.theme.iconWidth;
|
|
224
|
-
}, function (props) {
|
|
225
|
-
return props.theme.iconHeight;
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
var TagIconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
229
|
-
return props.theme.iconWidth;
|
|
230
|
-
}, function (props) {
|
|
231
|
-
return props.theme.iconHeight;
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
var IconContainer = _styledComponents["default"].div(_templateObject7(), function (_ref9) {
|
|
235
|
-
var iconBgColor = _ref9.iconBgColor;
|
|
236
|
-
return iconBgColor;
|
|
237
|
-
}, function (props) {
|
|
238
|
-
return props.theme.iconSectionWidth;
|
|
239
|
-
}, function (props) {
|
|
240
|
-
return props.theme.iconColor;
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
var TagLabel = _styledComponents["default"].div(_templateObject8(), function (props) {
|
|
244
|
-
return props.theme.fontFamily;
|
|
245
|
-
}, function (props) {
|
|
246
|
-
return props.theme.fontSize;
|
|
247
|
-
}, function (props) {
|
|
248
|
-
return props.theme.fontStyle;
|
|
249
|
-
}, function (props) {
|
|
250
|
-
return props.theme.fontWeight;
|
|
251
|
-
}, function (props) {
|
|
252
|
-
return props.theme.fontColor;
|
|
253
|
-
}, function (props) {
|
|
254
|
-
return props.theme.labelPaddingTop;
|
|
255
|
-
}, function (props) {
|
|
256
|
-
return props.theme.labelPaddingBottom;
|
|
257
|
-
}, function (props) {
|
|
258
|
-
return props.theme.labelPaddingLeft;
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return props.theme.labelPaddingRight;
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
DxcTag.propTypes = {
|
|
264
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
265
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
266
|
-
iconSrc: _propTypes["default"].string,
|
|
267
|
-
iconBgColor: _propTypes["default"].string,
|
|
268
|
-
label: _propTypes["default"].string,
|
|
269
|
-
labelPosition: _propTypes["default"].oneOf(["before", "after"]),
|
|
270
|
-
linkHref: _propTypes["default"].string,
|
|
271
|
-
onClick: _propTypes["default"].func,
|
|
272
|
-
newWindow: _propTypes["default"].bool,
|
|
273
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
274
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
275
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
276
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
277
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
278
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
279
|
-
tabIndex: _propTypes["default"].number
|
|
280
|
-
};
|
|
281
|
-
var _default = DxcTag;
|
|
282
|
-
exports["default"] = _default;
|
package/dist/tag/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
icon?: any;
|
|
12
|
-
iconSrc?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
linkHref?: string;
|
|
15
|
-
onClick?: void,
|
|
16
|
-
iconBgColor?: string;
|
|
17
|
-
labelPosition?: "before" | "after";
|
|
18
|
-
newWindow?: boolean;
|
|
19
|
-
margin?: Space | Margin;
|
|
20
|
-
size?: Size;
|
|
21
|
-
tabIndex?: number;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default function DxcTag(props: Props): JSX.Element;
|