@dxc-technology/halstack-react 0.0.0-ebb089f → 0.0.0-ec06b53
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 +294 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +245 -0
- package/accordion/Accordion.stories.tsx +306 -0
- package/accordion/Accordion.test.js +71 -0
- package/accordion/types.d.ts +69 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +149 -0
- package/accordion-group/AccordionGroup.stories.tsx +251 -0
- package/accordion-group/AccordionGroup.test.js +126 -0
- package/accordion-group/types.d.ts +79 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +44 -154
- 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 +44 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +156 -0
- package/button/Button.stories.tsx +283 -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 +68 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +250 -0
- package/checkbox/Checkbox.stories.tsx +208 -0
- package/checkbox/Checkbox.test.js +155 -0
- package/checkbox/types.d.ts +68 -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 +363 -425
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +227 -0
- package/date-input/DateInput.stories.tsx +151 -0
- package/date-input/DateInput.test.js +752 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +160 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +162 -0
- package/dialog/Dialog.stories.tsx +267 -0
- package/dialog/Dialog.test.js +70 -0
- package/dialog/types.d.ts +44 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +391 -0
- package/dropdown/Dropdown.stories.tsx +312 -0
- package/dropdown/Dropdown.test.js +585 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +100 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +551 -0
- package/file-input/FileInput.stories.tsx +535 -0
- package/file-input/FileInput.test.js +498 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +161 -0
- 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 +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +185 -0
- package/footer/Footer.stories.tsx +137 -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 +66 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +305 -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 +9 -34
- package/header/types.d.ts +48 -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/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 +20 -0
- package/layout/ApplicationLayout.js +171 -0
- package/layout/ApplicationLayout.stories.tsx +162 -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 +42 -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 +193 -0
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +114 -104
- 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 +542 -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 +36 -33
- 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/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -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 +181 -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/progress-bar/ProgressBar.js +176 -0
- package/progress-bar/ProgressBar.stories.jsx +60 -0
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +36 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +117 -0
- package/quick-nav/QuickNav.stories.tsx +342 -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 +156 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +283 -0
- package/radio-group/RadioGroup.stories.tsx +101 -0
- package/radio-group/RadioGroup.test.js +722 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +195 -0
- package/resultsetTable/ResultsetTable.stories.tsx +300 -0
- package/resultsetTable/ResultsetTable.test.js +330 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/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 +198 -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 +645 -0
- package/select/Select.stories.tsx +627 -0
- package/select/Select.test.js +2233 -0
- package/select/types.d.ts +210 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +268 -0
- package/sidenav/Sidenav.stories.tsx +180 -0
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +73 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +343 -0
- package/slider/Slider.stories.tsx +183 -0
- package/slider/Slider.test.js +250 -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 +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/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +262 -0
- package/switch/Switch.stories.tsx +138 -0
- package/switch/Switch.test.js +225 -0
- package/switch/types.d.ts +66 -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/Tab.d.ts +4 -0
- package/tabs/Tab.js +135 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +467 -0
- package/tabs/Tabs.stories.tsx +186 -0
- package/tabs/Tabs.test.js +351 -0
- package/tabs/types.d.ts +92 -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 +130 -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-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +57 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +677 -0
- package/text-input/TextInput.stories.tsx +481 -0
- package/text-input/TextInput.test.js +1624 -0
- package/text-input/types.d.ts +197 -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/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -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 +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 +285 -0
- package/wizard/Wizard.stories.tsx +233 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +65 -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.js +0 -238
- 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/Checkbox.js +0 -299
- 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/DateInput.js +0 -400
- 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/Dropdown.js +0 -544
- 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/ProgressBar.js +0 -242
- 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/ResultsetTable.js +0 -358
- 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/Slider.js +0 -404
- 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/TextInput.js +0 -974
- 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/button/Button.js
DELETED
|
@@ -1,238 +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 _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
21
|
-
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
|
-
var _utils = require("../common/utils.js");
|
|
29
|
-
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
31
|
-
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
33
|
-
|
|
34
|
-
function _templateObject4() {
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"]);
|
|
36
|
-
|
|
37
|
-
_templateObject4 = function _templateObject4() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject3() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
46
|
-
|
|
47
|
-
_templateObject3 = function _templateObject3() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _templateObject2() {
|
|
55
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
56
|
-
|
|
57
|
-
_templateObject2 = function _templateObject2() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject() {
|
|
65
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n margin-right: ", ";\n margin-left: ", ";\n"]);
|
|
66
|
-
|
|
67
|
-
_templateObject = function _templateObject() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var DxcButton = function DxcButton(_ref) {
|
|
75
|
-
var _ref$label = _ref.label,
|
|
76
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
77
|
-
_ref$mode = _ref.mode,
|
|
78
|
-
mode = _ref$mode === void 0 ? "primary" : _ref$mode,
|
|
79
|
-
_ref$disabled = _ref.disabled,
|
|
80
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
81
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
82
|
-
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
83
|
-
_ref$type = _ref.type,
|
|
84
|
-
type = _ref$type === void 0 ? "button" : _ref$type,
|
|
85
|
-
_ref$iconSrc = _ref.iconSrc,
|
|
86
|
-
iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
|
|
87
|
-
icon = _ref.icon,
|
|
88
|
-
_ref$onClick = _ref.onClick,
|
|
89
|
-
_onClick = _ref$onClick === void 0 ? "" : _ref$onClick,
|
|
90
|
-
margin = _ref.margin,
|
|
91
|
-
size = _ref.size,
|
|
92
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
93
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
94
|
-
|
|
95
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
96
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
97
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
98
|
-
theme: colorsTheme.button
|
|
99
|
-
}, _react["default"].createElement(DxCButton, {
|
|
100
|
-
type: type,
|
|
101
|
-
margin: margin,
|
|
102
|
-
mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
|
|
103
|
-
disabled: disabled,
|
|
104
|
-
iconPosition: iconPosition,
|
|
105
|
-
size: size,
|
|
106
|
-
backgroundType: backgroundType,
|
|
107
|
-
icon: icon
|
|
108
|
-
}, _react["default"].createElement(_Button["default"], {
|
|
109
|
-
disabled: disabled,
|
|
110
|
-
type: type,
|
|
111
|
-
disableRipple: true,
|
|
112
|
-
"aria-disabled": disabled ? true : false,
|
|
113
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
114
|
-
onClick: function onClick() {
|
|
115
|
-
if (_onClick) {
|
|
116
|
-
_onClick();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}, label && _react["default"].createElement(LabelContainer, {
|
|
120
|
-
icon: icon,
|
|
121
|
-
iconPosition: iconPosition
|
|
122
|
-
}, label), icon ? _react["default"].createElement(IconContainer, {
|
|
123
|
-
label: label,
|
|
124
|
-
iconPosition: iconPosition
|
|
125
|
-
}, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(ButtonIcon, {
|
|
126
|
-
label: label,
|
|
127
|
-
iconPosition: iconPosition,
|
|
128
|
-
src: iconSrc
|
|
129
|
-
}))));
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var sizes = {
|
|
133
|
-
small: "42px",
|
|
134
|
-
medium: "120px",
|
|
135
|
-
large: "240px",
|
|
136
|
-
fillParent: "100%",
|
|
137
|
-
fitContent: "unset"
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
141
|
-
if (size === "fillParent") {
|
|
142
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return sizes[size];
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject(), function (props) {
|
|
149
|
-
return props.theme.labelFontLineHeight;
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.theme.fontSize;
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return !props.icon || props.iconPosition === "before" ? "8px" : "0px";
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
var IconContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
159
|
-
return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
|
|
160
|
-
}, function (props) {
|
|
161
|
-
return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
var ButtonIcon = _styledComponents["default"].img(_templateObject3(), function (props) {
|
|
165
|
-
return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
var DxCButton = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
171
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
172
|
-
}, function (props) {
|
|
173
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
178
|
-
}, function (props) {
|
|
179
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return calculateWidth(props.margin, props.size);
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.disabled && "not-allowed" || "pointer";
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.theme.paddingLeft;
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.theme.paddingRight;
|
|
188
|
-
}, function (props) {
|
|
189
|
-
return props.theme.paddingTop;
|
|
190
|
-
}, function (props) {
|
|
191
|
-
return props.theme.paddingBottom;
|
|
192
|
-
}, function (props) {
|
|
193
|
-
return props.iconPosition === "after" && "row" || "row-reverse";
|
|
194
|
-
}, function (props) {
|
|
195
|
-
return props.theme.fontFamily;
|
|
196
|
-
}, function (props) {
|
|
197
|
-
return props.theme.fontSize;
|
|
198
|
-
}, function (props) {
|
|
199
|
-
return props.theme.fontWeight;
|
|
200
|
-
}, function (props) {
|
|
201
|
-
return props.theme.labelLetterSpacing;
|
|
202
|
-
}, function (props) {
|
|
203
|
-
return props.size === "small" && "calc(100% - 22px)" || "unset";
|
|
204
|
-
}, function (props) {
|
|
205
|
-
return props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor;
|
|
206
|
-
}, function (props) {
|
|
207
|
-
var mode = props.mode,
|
|
208
|
-
backgroundType = props.backgroundType;
|
|
209
|
-
|
|
210
|
-
if (mode === "primary") {
|
|
211
|
-
return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled { \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, "!important; \n }\n .MuiButton-label {\n z-index: 5;\n }\n ");
|
|
212
|
-
} else if (mode === "secondary") {
|
|
213
|
-
return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width: ").concat(props.theme.secondaryBorderThickness, ";\n border-style: ").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor, ";\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor, ";\n }\n .MuiButton-label {\n z-index: 5;\n }\n ");
|
|
214
|
-
} else if (mode === "text") {
|
|
215
|
-
return "\n border-radius: ".concat(props.theme.textBorderRadius, ";\n border-width: ").concat(props.theme.textBorderThickness, ";\n border-style: ").concat(props.theme.textBorderStyle, ";\n font-family: ").concat(props.theme.textFontFamily, ";\n font-size: ").concat(props.theme.textFontSize, ";\n font-weight: ").concat(props.theme.textFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor:not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, " !important;\n background-color: ").concat(backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n }\n ");
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
DxcButton.propTypes = {
|
|
220
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
221
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
222
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
223
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
224
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
225
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
226
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
227
|
-
label: _propTypes["default"].string,
|
|
228
|
-
mode: _propTypes["default"].oneOf(["primary", "secondary", "text"]),
|
|
229
|
-
disabled: _propTypes["default"].bool,
|
|
230
|
-
iconPosition: _propTypes["default"].oneOf(["after", "before"]),
|
|
231
|
-
onClick: _propTypes["default"].func,
|
|
232
|
-
iconSrc: _propTypes["default"].string,
|
|
233
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
234
|
-
type: _propTypes["default"].oneOf(["button", "reset", "submit"]),
|
|
235
|
-
tabIndex: _propTypes["default"].number
|
|
236
|
-
};
|
|
237
|
-
var _default = DxcButton;
|
|
238
|
-
exports["default"] = _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Primary = exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _Button = _interopRequireDefault(require("./Button"));
|
|
13
|
-
|
|
14
|
-
var _default = {
|
|
15
|
-
title: "Button",
|
|
16
|
-
component: _Button["default"]
|
|
17
|
-
};
|
|
18
|
-
exports["default"] = _default;
|
|
19
|
-
|
|
20
|
-
var Primary = function Primary() {
|
|
21
|
-
return _react["default"].createElement(_Button["default"], {
|
|
22
|
-
mode: "primary",
|
|
23
|
-
label: "Primary Button"
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.Primary = Primary;
|
package/dist/button/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
|
-
label?: string;
|
|
12
|
-
mode?: "primary" | "secondary" | "text";
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
iconPosition?: "before" | "after";
|
|
15
|
-
type?: "button" | "reset" | "submit";
|
|
16
|
-
iconSrc?: string;
|
|
17
|
-
icon?: any;
|
|
18
|
-
onClick?: void;
|
|
19
|
-
margin?: Space | Margin;
|
|
20
|
-
size?: Size;
|
|
21
|
-
tabIndex?: number;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default function DxcButton(props: Props): JSX.Element;
|
package/dist/card/Card.js
DELETED
|
@@ -1,254 +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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
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 _templateObject6() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject6 = function _templateObject6() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject5() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 35%;\n height: 100%;\n flex-shrink: 0;\n background: ", ";\n justify-content: center;\n align-items: center;\n display: inline-flex;\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject5 = function _templateObject5() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject4() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject4 = function _templateObject4() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject3() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n text-decoration: none;\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject3 = function _templateObject3() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject2() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n height: ", ";\n width: ", ";\n &:hover {\n border-color: ", ";\n }\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject2 = function _templateObject2() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject = function _templateObject() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
var DxcCard = function DxcCard(_ref) {
|
|
93
|
-
var imageSrc = _ref.imageSrc,
|
|
94
|
-
children = _ref.children,
|
|
95
|
-
margin = _ref.margin,
|
|
96
|
-
contentPadding = _ref.contentPadding,
|
|
97
|
-
linkHref = _ref.linkHref,
|
|
98
|
-
onClick = _ref.onClick,
|
|
99
|
-
imageBgColor = _ref.imageBgColor,
|
|
100
|
-
imagePadding = _ref.imagePadding,
|
|
101
|
-
imagePosition = _ref.imagePosition,
|
|
102
|
-
outlined = _ref.outlined,
|
|
103
|
-
imageCover = _ref.imageCover,
|
|
104
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
105
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
106
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
107
|
-
|
|
108
|
-
var _useState = (0, _react.useState)(false),
|
|
109
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
110
|
-
isHovered = _useState2[0],
|
|
111
|
-
changeIsHovered = _useState2[1];
|
|
112
|
-
|
|
113
|
-
var tagContent = _react["default"].createElement(_Box["default"], {
|
|
114
|
-
shadowDepth: outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
|
|
115
|
-
}, _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
116
|
-
theme: colorsTheme.card
|
|
117
|
-
}, _react["default"].createElement(CardContainer, {
|
|
118
|
-
hasAction: onClick || linkHref,
|
|
119
|
-
outlined: outlined,
|
|
120
|
-
imagePosition: imagePosition
|
|
121
|
-
}, imageSrc && _react["default"].createElement(ImageContainer, {
|
|
122
|
-
imageBgColor: imageBgColor
|
|
123
|
-
}, _react["default"].createElement(TagImage, {
|
|
124
|
-
imagePadding: imagePadding,
|
|
125
|
-
cover: imageCover,
|
|
126
|
-
src: imageSrc
|
|
127
|
-
})), _react["default"].createElement(CardContent, {
|
|
128
|
-
contentPadding: contentPadding
|
|
129
|
-
}, children))));
|
|
130
|
-
|
|
131
|
-
return _react["default"].createElement(StyledDxcCard, {
|
|
132
|
-
margin: margin,
|
|
133
|
-
onMouseEnter: function onMouseEnter() {
|
|
134
|
-
return changeIsHovered(true);
|
|
135
|
-
},
|
|
136
|
-
onMouseLeave: function onMouseLeave() {
|
|
137
|
-
return changeIsHovered(false);
|
|
138
|
-
},
|
|
139
|
-
onClick: onClick,
|
|
140
|
-
hasAction: onClick,
|
|
141
|
-
tabIndex: typeof onClick === "function" && !linkHref ? tabIndex : -1
|
|
142
|
-
}, linkHref && _react["default"].createElement(StyledLink, {
|
|
143
|
-
tabIndex: tabIndex,
|
|
144
|
-
href: linkHref
|
|
145
|
-
}, tagContent) || tagContent);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
var StyledDxcCard = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
149
|
-
var hasAction = _ref2.hasAction;
|
|
150
|
-
return hasAction && "pointer" || "unset";
|
|
151
|
-
}, function (_ref3) {
|
|
152
|
-
var hasAction = _ref3.hasAction;
|
|
153
|
-
return !hasAction && "none";
|
|
154
|
-
}, function (_ref4) {
|
|
155
|
-
var margin = _ref4.margin;
|
|
156
|
-
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
157
|
-
}, function (_ref5) {
|
|
158
|
-
var margin = _ref5.margin;
|
|
159
|
-
return margin && margin.top ? _variables.spaces[margin.top] : "";
|
|
160
|
-
}, function (_ref6) {
|
|
161
|
-
var margin = _ref6.margin;
|
|
162
|
-
return margin && margin.right ? _variables.spaces[margin.right] : "";
|
|
163
|
-
}, function (_ref7) {
|
|
164
|
-
var margin = _ref7.margin;
|
|
165
|
-
return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
166
|
-
}, function (_ref8) {
|
|
167
|
-
var margin = _ref8.margin;
|
|
168
|
-
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
var CardContainer = _styledComponents["default"].div(_templateObject2(), function (_ref9) {
|
|
172
|
-
var imagePosition = _ref9.imagePosition;
|
|
173
|
-
return imagePosition === "before" && "row" || "row-reverse";
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.theme.height;
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return props.theme.width;
|
|
178
|
-
}, function (_ref10) {
|
|
179
|
-
var hasAction = _ref10.hasAction;
|
|
180
|
-
return hasAction ? "" : "unset";
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
var StyledLink = _styledComponents["default"].a(_templateObject3());
|
|
184
|
-
|
|
185
|
-
var TagImage = _styledComponents["default"].img(_templateObject4(), function (_ref11) {
|
|
186
|
-
var imagePadding = _ref11.imagePadding;
|
|
187
|
-
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
188
|
-
}, function (_ref12) {
|
|
189
|
-
var imagePadding = _ref12.imagePadding;
|
|
190
|
-
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
191
|
-
}, function (_ref13) {
|
|
192
|
-
var cover = _ref13.cover;
|
|
193
|
-
return cover ? "cover" : "contain";
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
var ImageContainer = _styledComponents["default"].div(_templateObject5(), function (_ref14) {
|
|
197
|
-
var imageBgColor = _ref14.imageBgColor;
|
|
198
|
-
return imageBgColor;
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
var CardContent = _styledComponents["default"].div(_templateObject6(), function (_ref15) {
|
|
202
|
-
var contentPadding = _ref15.contentPadding;
|
|
203
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
|
|
204
|
-
}, function (_ref16) {
|
|
205
|
-
var contentPadding = _ref16.contentPadding;
|
|
206
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
|
|
207
|
-
}, function (_ref17) {
|
|
208
|
-
var contentPadding = _ref17.contentPadding;
|
|
209
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
|
|
210
|
-
}, function (_ref18) {
|
|
211
|
-
var contentPadding = _ref18.contentPadding;
|
|
212
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
|
|
213
|
-
}, function (_ref19) {
|
|
214
|
-
var contentPadding = _ref19.contentPadding;
|
|
215
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.left ? _variables.spaces[contentPadding.left] : "";
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
DxcCard.propTypes = {
|
|
219
|
-
imageSrc: _propTypes["default"].string,
|
|
220
|
-
imageBgColor: _propTypes["default"].string,
|
|
221
|
-
imagePadding: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces))),
|
|
222
|
-
imagePosition: _propTypes["default"].oneOf(["before", "after"]),
|
|
223
|
-
linkHref: _propTypes["default"].string,
|
|
224
|
-
onClick: _propTypes["default"].func,
|
|
225
|
-
outlined: _propTypes["default"].bool,
|
|
226
|
-
imageCover: _propTypes["default"].bool,
|
|
227
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
228
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
229
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
230
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
231
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
232
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
233
|
-
contentPadding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
234
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
235
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
236
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
237
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
238
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
239
|
-
tabIndex: _propTypes["default"].number
|
|
240
|
-
};
|
|
241
|
-
DxcCard.defaultProps = {
|
|
242
|
-
imageSrc: null,
|
|
243
|
-
margin: null,
|
|
244
|
-
contentPadding: null,
|
|
245
|
-
outlined: false,
|
|
246
|
-
imagePadding: null,
|
|
247
|
-
imageCover: false,
|
|
248
|
-
linkHref: null,
|
|
249
|
-
onClick: null,
|
|
250
|
-
imageBgColor: "black",
|
|
251
|
-
imagePosition: "before"
|
|
252
|
-
};
|
|
253
|
-
var _default = DxcCard;
|
|
254
|
-
exports["default"] = _default;
|
package/dist/card/index.d.ts
DELETED
|
@@ -1,22 +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
|
-
imageSrc?: string;
|
|
11
|
-
margin?: Space | Margin;
|
|
12
|
-
contentPadding?: any;
|
|
13
|
-
linkHref?: string;
|
|
14
|
-
onClick?: void;
|
|
15
|
-
imageBgColor?: string;
|
|
16
|
-
imagePadding?: any;
|
|
17
|
-
imagePosition?: "before" | "after";
|
|
18
|
-
outlined?: boolean;
|
|
19
|
-
imageCover?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default function DxcCard(props: Props): JSX.Element;
|