@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
|
@@ -1,186 +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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
-
|
|
24
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _Accordion = _interopRequireDefault(require("../accordion/Accordion"));
|
|
29
|
-
|
|
30
|
-
var _utils = require("../common/utils.js");
|
|
31
|
-
|
|
32
|
-
var _variables = require("../common/variables.js");
|
|
33
|
-
|
|
34
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
35
|
-
|
|
36
|
-
function _templateObject() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n cursor: ", ";\n\n & > :not(div:last-child) {\n & > div:first-child {\n border-radius: 0;\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-radius: 0;\n }\n\n & > .MuiButtonBase-root {\n border-radius: 0;\n }\n }\n }\n\n & > div:first-child {\n & > div:first-child {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n\n & > .MuiButtonBase-root {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n }\n }\n\n & > div:last-child {\n & > div:first-child {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n & > .Mui-expanded {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n & > .MuiButtonBase-root {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\n }\n"]);
|
|
38
|
-
|
|
39
|
-
_templateObject = function _templateObject() {
|
|
40
|
-
return data;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var Accordion = function Accordion(_ref) {
|
|
47
|
-
var margin = _ref.margin,
|
|
48
|
-
childProps = (0, _objectWithoutProperties2["default"])(_ref, ["margin"]);
|
|
49
|
-
return _react["default"].createElement(_Accordion["default"], childProps, childProps.children);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var DxcAccordionGroup = function DxcAccordionGroup(_ref2) {
|
|
53
|
-
var _ref2$disabled = _ref2.disabled,
|
|
54
|
-
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
55
|
-
onActiveChange = _ref2.onActiveChange,
|
|
56
|
-
_ref2$indexActive = _ref2.indexActive,
|
|
57
|
-
indexActive = _ref2$indexActive === void 0 ? undefined : _ref2$indexActive,
|
|
58
|
-
margin = _ref2.margin,
|
|
59
|
-
_ref2$children = _ref2.children,
|
|
60
|
-
children = _ref2$children === void 0 ? [] : _ref2$children;
|
|
61
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
62
|
-
|
|
63
|
-
var _React$useState = _react["default"].useState(indexActive),
|
|
64
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
65
|
-
innerIsExpanded = _React$useState2[0],
|
|
66
|
-
setInnerIsExpanded = _React$useState2[1];
|
|
67
|
-
|
|
68
|
-
var handlerActiveChange = function handlerActiveChange(index) {
|
|
69
|
-
if (indexActive === undefined) {
|
|
70
|
-
setInnerIsExpanded(index === innerIsExpanded ? -1 : index);
|
|
71
|
-
} else {
|
|
72
|
-
setInnerIsExpanded(indexActive);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (typeof onActiveChange === "function" && !disabled) {
|
|
76
|
-
onActiveChange(index);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
(0, _react.useEffect)(function () {
|
|
81
|
-
setInnerIsExpanded(indexActive);
|
|
82
|
-
}, [indexActive]);
|
|
83
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
84
|
-
theme: colorsTheme.accordion
|
|
85
|
-
}, _react["default"].createElement(AccordionGroupContainer, {
|
|
86
|
-
margin: margin,
|
|
87
|
-
disabled: disabled
|
|
88
|
-
}, (Array.isArray(children) ? children : [children]).filter(function (el) {
|
|
89
|
-
return el.type === Accordion;
|
|
90
|
-
}).map(function (el, index) {
|
|
91
|
-
return _react["default"].cloneElement(el, {
|
|
92
|
-
onChange: function onChange() {
|
|
93
|
-
handlerActiveChange(index);
|
|
94
|
-
},
|
|
95
|
-
isExpanded: index === innerIsExpanded,
|
|
96
|
-
disabled: disabled || el.props.disabled
|
|
97
|
-
});
|
|
98
|
-
})));
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var calculateWidth = function calculateWidth(margin) {
|
|
102
|
-
return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
var AccordionGroupContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
106
|
-
return calculateWidth(props.margin);
|
|
107
|
-
}, function (_ref3) {
|
|
108
|
-
var margin = _ref3.margin;
|
|
109
|
-
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
110
|
-
}, function (_ref4) {
|
|
111
|
-
var margin = _ref4.margin;
|
|
112
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
|
|
113
|
-
}, function (_ref5) {
|
|
114
|
-
var margin = _ref5.margin;
|
|
115
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
|
|
116
|
-
}, function (_ref6) {
|
|
117
|
-
var margin = _ref6.margin;
|
|
118
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
119
|
-
}, function (_ref7) {
|
|
120
|
-
var margin = _ref7.margin;
|
|
121
|
-
return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
|
|
122
|
-
}, function (props) {
|
|
123
|
-
return props.disabled && "not-allowed" || "pointer";
|
|
124
|
-
}, function (props) {
|
|
125
|
-
return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
|
|
126
|
-
}, function (props) {
|
|
127
|
-
return props.theme.accordionGroupSeparatorBorderColor;
|
|
128
|
-
}, function (props) {
|
|
129
|
-
return props.theme.borderRadius;
|
|
130
|
-
}, function (props) {
|
|
131
|
-
return props.theme.borderRadius;
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.theme.accordionGroupSeparatorBorderColor;
|
|
136
|
-
}, function (props) {
|
|
137
|
-
return props.theme.borderRadius;
|
|
138
|
-
}, function (props) {
|
|
139
|
-
return props.theme.borderRadius;
|
|
140
|
-
}, function (props) {
|
|
141
|
-
return props.theme.borderRadius;
|
|
142
|
-
}, function (props) {
|
|
143
|
-
return props.theme.borderRadius;
|
|
144
|
-
}, function (props) {
|
|
145
|
-
return props.theme.borderRadius;
|
|
146
|
-
}, function (props) {
|
|
147
|
-
return props.theme.borderRadius;
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.theme.borderRadius;
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.theme.borderRadius;
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return props.theme.borderRadius;
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.theme.borderRadius;
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
DxcAccordionGroup.propTypes = {
|
|
159
|
-
disabled: _propTypes["default"].bool,
|
|
160
|
-
onActiveChange: _propTypes["default"].func,
|
|
161
|
-
indexActive: _propTypes["default"].number,
|
|
162
|
-
children: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
163
|
-
label: _propTypes["default"].string,
|
|
164
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
165
|
-
iconSrc: _propTypes["default"].string,
|
|
166
|
-
iconPosition: _propTypes["default"].oneOf(["before", "after"]),
|
|
167
|
-
assistiveText: _propTypes["default"].string,
|
|
168
|
-
disabled: _propTypes["default"].bool,
|
|
169
|
-
children: _propTypes["default"].element,
|
|
170
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
171
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
172
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
173
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
174
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
175
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
176
|
-
})),
|
|
177
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
178
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
179
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
180
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
181
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
182
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
183
|
-
};
|
|
184
|
-
DxcAccordionGroup.Accordion = Accordion;
|
|
185
|
-
var _default = DxcAccordionGroup;
|
|
186
|
-
exports["default"] = _default;
|
|
@@ -1,16 +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
|
-
disabled?: boolean;
|
|
11
|
-
onActiveChange?: void;
|
|
12
|
-
indexActive?: number;
|
|
13
|
-
margin?: Space | Margin;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default function DxcAccordionGroup(props: Props): JSX.Element;
|
package/dist/alert/index.d.ts
DELETED
|
@@ -1,51 +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
|
-
/**
|
|
12
|
-
* Uses on of the available alert types.
|
|
13
|
-
*/
|
|
14
|
-
type?: "info" | "confirm" | "warning" | "error";
|
|
15
|
-
/**
|
|
16
|
-
* Uses on of the available alert modes:
|
|
17
|
-
* 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
|
|
18
|
-
* There is no overlay layer. Position should be decided by the user.
|
|
19
|
-
* 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
|
|
20
|
-
* The onClose function will be executed when the X button or the overlay is clicked. d
|
|
21
|
-
* The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
|
|
22
|
-
*/
|
|
23
|
-
mode?: "inline" | "modal";
|
|
24
|
-
/**
|
|
25
|
-
* Text to display after icon and alert type and before content.
|
|
26
|
-
*/
|
|
27
|
-
inlineText?: string;
|
|
28
|
-
/**
|
|
29
|
-
* This function will be called when the user clicks the close button. If there is no function we should close the alert by default.
|
|
30
|
-
*/
|
|
31
|
-
onClose?: () => void;
|
|
32
|
-
/**
|
|
33
|
-
* The details section of the alert. Can be used to render custom content in this area.
|
|
34
|
-
*/
|
|
35
|
-
children?: React.ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
38
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
39
|
-
*/
|
|
40
|
-
margin?: Space | Margin;
|
|
41
|
-
/**
|
|
42
|
-
* Size of the component ('small' | 'medium' | 'large' | 'fillParent' | 'fitContent').
|
|
43
|
-
*/
|
|
44
|
-
size?: Size;
|
|
45
|
-
/**
|
|
46
|
-
* Tabindex value given to the close button.
|
|
47
|
-
*/
|
|
48
|
-
tabIndex?: number;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default function Alert(props: Props): JSX.Element;
|
package/dist/badge/Badge.js
DELETED
|
@@ -1,63 +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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
19
|
-
|
|
20
|
-
function _templateObject() {
|
|
21
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n display: flex;\n padding-bottom: 1px;\n padding-right: 1px;\n flex-wrap: wrap;\n box-sizing: border-box;\n align-items: center;\n line-height: 1;\n align-content: center;\n flex-direction: row;\n justify-content: center;\n"]);
|
|
22
|
-
|
|
23
|
-
_templateObject = function _templateObject() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var DxcBadge = function DxcBadge(_ref) {
|
|
31
|
-
var notificationText = _ref.notificationText;
|
|
32
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
33
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
34
|
-
theme: colorsTheme.tabs
|
|
35
|
-
}, _react["default"].createElement(StyledDxcBadge, {
|
|
36
|
-
notificationText: notificationText
|
|
37
|
-
}, _react["default"].createElement("span", null, notificationText)));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var StyledDxcBadge = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
41
|
-
return props.theme.badgeBackgroundColor;
|
|
42
|
-
}, function (props) {
|
|
43
|
-
return props.theme.badgeFontFamily;
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return props.theme.badgeFontSize;
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.theme.badgeFontStyle;
|
|
48
|
-
}, function (props) {
|
|
49
|
-
return props.theme.badgeFontWeight;
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return props.theme.badgeFontColor;
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.theme.badgeLetterSpacing;
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.notificationText === true ? props.theme.badgeWidth : props.theme.badgeWidthWithNotificationNumber;
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return props.notificationText === true ? props.theme.badgeHeight : props.theme.badgeHeightWithNotificationNumber;
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return props.notificationText === true ? props.theme.badgeRadius : props.theme.badgeRadiusWithNotificationNumber;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
var _default = DxcBadge;
|
|
63
|
-
exports["default"] = _default;
|
package/dist/box/Box.js
DELETED
|
@@ -1,156 +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 _react = _interopRequireDefault(require("react"));
|
|
19
|
-
|
|
20
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
|
-
var _variables = require("../common/variables.js");
|
|
25
|
-
|
|
26
|
-
var _utils = require("../common/utils.js");
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
31
|
-
|
|
32
|
-
function _templateObject() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject = function _templateObject() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var DxcBox = function DxcBox(_ref) {
|
|
43
|
-
var shadowDepth = _ref.shadowDepth,
|
|
44
|
-
margin = _ref.margin,
|
|
45
|
-
padding = _ref.padding,
|
|
46
|
-
_ref$display = _ref.display,
|
|
47
|
-
display = _ref$display === void 0 ? "inline-flex" : _ref$display,
|
|
48
|
-
children = _ref.children,
|
|
49
|
-
_ref$size = _ref.size,
|
|
50
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
51
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
52
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
53
|
-
theme: colorsTheme.box
|
|
54
|
-
}, _react["default"].createElement(StyledDxcBox, {
|
|
55
|
-
shadowDepth: shadowDepth,
|
|
56
|
-
display: display,
|
|
57
|
-
margin: margin,
|
|
58
|
-
padding: padding,
|
|
59
|
-
size: size
|
|
60
|
-
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
61
|
-
color: colorsTheme.box.backgroundColor
|
|
62
|
-
}, children)));
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var sizes = {
|
|
66
|
-
small: "48px",
|
|
67
|
-
medium: "240px",
|
|
68
|
-
large: "480px",
|
|
69
|
-
fillParent: "100%",
|
|
70
|
-
fitContent: "unset"
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
var calculateWidth = function calculateWidth(margin, size, padding) {
|
|
74
|
-
if (size === "fillParent") {
|
|
75
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), " -\n ").concat((0, _utils.getMargin)(padding, "left"), " - ").concat((0, _utils.getMargin)(padding, "right"), ")");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return sizes[size];
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var StyledDxcBox = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
82
|
-
var display = _ref2.display;
|
|
83
|
-
return display;
|
|
84
|
-
}, function (props) {
|
|
85
|
-
return props.theme.borderRadius;
|
|
86
|
-
}, function (props) {
|
|
87
|
-
return props.theme.borderThickness;
|
|
88
|
-
}, function (props) {
|
|
89
|
-
return props.theme.borderStyle;
|
|
90
|
-
}, function (props) {
|
|
91
|
-
return props.theme.borderColor;
|
|
92
|
-
}, function (props) {
|
|
93
|
-
return props.theme.letterSpacing;
|
|
94
|
-
}, function (props) {
|
|
95
|
-
return calculateWidth(props.margin, props.size, props.padding);
|
|
96
|
-
}, function (props) {
|
|
97
|
-
return props.theme.backgroundColor;
|
|
98
|
-
}, function (props) {
|
|
99
|
-
return props.shadowDepth === 1 ? "".concat(props.theme.oneShadowDepthShadowOffsetX, " ").concat(props.theme.oneShadowDepthShadowOffsetY, " ").concat(props.theme.oneShadowDepthShadowBlur, " ").concat(props.theme.oneShadowDepthShadowSpread, " ").concat(props.theme.oneShadowDepthShadowColor) : props.shadowDepth === 2 ? "".concat(props.theme.twoShadowDepthShadowOffsetX, " ").concat(props.theme.twoShadowDepthShadowOffsetY, " ").concat(props.theme.twoShadowDepthShadowBlur, " ").concat(props.theme.twoShadowDepthShadowSpread, " ").concat(props.theme.twoShadowDepthShadowColor) : "".concat(props.theme.noneShadowDepthShadowOffsetX, " ").concat(props.theme.noneShadowDepthShadowOffsetY, " ").concat(props.theme.noneShadowDepthShadowBlur, " ").concat(props.theme.noneShadowDepthShadowSpread, " ").concat(props.theme.noneShadowDepthShadowColor);
|
|
100
|
-
}, function (_ref3) {
|
|
101
|
-
var margin = _ref3.margin;
|
|
102
|
-
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
103
|
-
}, function (_ref4) {
|
|
104
|
-
var margin = _ref4.margin;
|
|
105
|
-
return margin && margin.top ? _variables.spaces[margin.top] : "";
|
|
106
|
-
}, function (_ref5) {
|
|
107
|
-
var margin = _ref5.margin;
|
|
108
|
-
return margin && margin.right ? _variables.spaces[margin.right] : "";
|
|
109
|
-
}, function (_ref6) {
|
|
110
|
-
var margin = _ref6.margin;
|
|
111
|
-
return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
112
|
-
}, function (_ref7) {
|
|
113
|
-
var margin = _ref7.margin;
|
|
114
|
-
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
115
|
-
}, function (_ref8) {
|
|
116
|
-
var padding = _ref8.padding;
|
|
117
|
-
return padding && (0, _typeof2["default"])(padding) !== "object" ? _variables.spaces[padding] : "0px";
|
|
118
|
-
}, function (_ref9) {
|
|
119
|
-
var padding = _ref9.padding;
|
|
120
|
-
return padding && padding.top ? _variables.spaces[padding.top] : "";
|
|
121
|
-
}, function (_ref10) {
|
|
122
|
-
var padding = _ref10.padding;
|
|
123
|
-
return padding && padding.right ? _variables.spaces[padding.right] : "";
|
|
124
|
-
}, function (_ref11) {
|
|
125
|
-
var padding = _ref11.padding;
|
|
126
|
-
return padding && padding.bottom ? _variables.spaces[padding.bottom] : "";
|
|
127
|
-
}, function (_ref12) {
|
|
128
|
-
var padding = _ref12.padding;
|
|
129
|
-
return padding && padding.left ? _variables.spaces[padding.left] : "";
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
DxcBox.propTypes = {
|
|
133
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
134
|
-
display: _propTypes["default"].string,
|
|
135
|
-
shadowDepth: _propTypes["default"].oneOf([0, 1, 2]),
|
|
136
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
137
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
138
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
139
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
140
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
141
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
142
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
143
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
144
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
145
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
146
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
147
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
148
|
-
};
|
|
149
|
-
DxcBox.defaultProps = {
|
|
150
|
-
shadowDepth: 2,
|
|
151
|
-
display: "inline-flex",
|
|
152
|
-
margin: null,
|
|
153
|
-
padding: null
|
|
154
|
-
};
|
|
155
|
-
var _default = DxcBox;
|
|
156
|
-
exports["default"] = _default;
|
package/dist/box/index.d.ts
DELETED
|
@@ -1,25 +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
|
-
type Padding = {
|
|
10
|
-
top?: Space;
|
|
11
|
-
bottom?: Space;
|
|
12
|
-
left?: Space;
|
|
13
|
-
right?: Space;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type Props = {
|
|
18
|
-
shadowDepth?: 0 | 1 | 2;
|
|
19
|
-
margin?: Space | Margin;
|
|
20
|
-
padging?: Space | Padding;
|
|
21
|
-
display: string;
|
|
22
|
-
size: Size;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function DxcBox(props: Props): JSX.Element;
|