@dxc-technology/halstack-react 0.0.0-ff6c8bf → 0.0.0-ff78514
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/README.md +1 -2
- package/dist/index.d.mts +6589 -0
- package/dist/index.d.ts +6589 -0
- package/dist/index.js +13660 -0
- package/dist/index.mjs +13602 -0
- package/package.json +64 -66
- package/BackgroundColorContext.d.ts +0 -1
- package/BackgroundColorContext.js +0 -30
- package/HalstackContext.d.ts +0 -1246
- package/HalstackContext.js +0 -310
- package/accordion/Accordion.accessibility.test.js +0 -71
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -171
- package/accordion/Accordion.stories.tsx +0 -241
- package/accordion/Accordion.test.js +0 -56
- package/accordion/types.d.ts +0 -57
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.accessibility.test.js +0 -88
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -101
- package/accordion-group/AccordionGroup.stories.tsx +0 -252
- package/accordion-group/AccordionGroup.test.js +0 -98
- package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
- package/accordion-group/AccordionGroupAccordion.js +0 -31
- package/accordion-group/AccordionGroupContext.d.ts +0 -3
- package/accordion-group/AccordionGroupContext.js +0 -8
- package/accordion-group/types.d.ts +0 -67
- package/accordion-group/types.js +0 -5
- package/action-icon/ActionIcon.accessibility.test.js +0 -63
- package/action-icon/ActionIcon.d.ts +0 -4
- package/action-icon/ActionIcon.js +0 -48
- package/action-icon/ActionIcon.stories.tsx +0 -41
- package/action-icon/ActionIcon.test.js +0 -64
- package/action-icon/types.d.ts +0 -26
- package/action-icon/types.js +0 -5
- package/alert/Alert.accessibility.test.js +0 -95
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -203
- package/alert/Alert.stories.tsx +0 -198
- package/alert/Alert.test.js +0 -75
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.accessibility.test.js +0 -129
- package/badge/Badge.d.ts +0 -4
- package/badge/Badge.js +0 -161
- package/badge/Badge.stories.tsx +0 -210
- package/badge/Badge.test.js +0 -30
- package/badge/types.d.ts +0 -54
- package/badge/types.js +0 -5
- package/bleed/Bleed.d.ts +0 -3
- package/bleed/Bleed.js +0 -43
- package/bleed/Bleed.stories.tsx +0 -342
- package/bleed/types.d.ts +0 -37
- package/bleed/types.js +0 -5
- package/box/Box.accessibility.test.js +0 -33
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -75
- package/box/Box.stories.tsx +0 -119
- package/box/Box.test.js +0 -13
- package/box/types.d.ts +0 -32
- package/box/types.js +0 -5
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +0 -96
- package/breadcrumbs/Breadcrumbs.d.ts +0 -4
- package/breadcrumbs/Breadcrumbs.js +0 -79
- package/breadcrumbs/Breadcrumbs.stories.tsx +0 -194
- package/breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.test.js +0 -169
- package/breadcrumbs/Item.d.ts +0 -4
- package/breadcrumbs/Item.js +0 -52
- package/breadcrumbs/dropdownTheme.d.ts +0 -53
- package/breadcrumbs/dropdownTheme.js +0 -62
- package/breadcrumbs/types.d.ts +0 -16
- package/breadcrumbs/types.js +0 -5
- package/bulleted-list/BulletedList.accessibility.test.js +0 -119
- package/bulleted-list/BulletedList.d.ts +0 -7
- package/bulleted-list/BulletedList.js +0 -92
- package/bulleted-list/BulletedList.stories.tsx +0 -115
- package/bulleted-list/types.d.ts +0 -38
- package/bulleted-list/types.js +0 -5
- package/button/Button.accessibility.test.js +0 -127
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -121
- package/button/Button.stories.tsx +0 -325
- package/button/Button.test.js +0 -38
- package/button/types.d.ts +0 -57
- package/button/types.js +0 -5
- package/card/Card.accessibility.test.js +0 -36
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -121
- package/card/Card.stories.tsx +0 -171
- package/card/Card.test.js +0 -39
- package/card/types.d.ts +0 -62
- package/card/types.js +0 -5
- package/checkbox/Checkbox.accessibility.test.js +0 -87
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -215
- package/checkbox/Checkbox.stories.tsx +0 -222
- package/checkbox/Checkbox.test.js +0 -199
- package/checkbox/types.d.ts +0 -72
- package/checkbox/types.js +0 -5
- package/chip/Chip.accessibility.test.js +0 -67
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -126
- package/chip/Chip.stories.tsx +0 -199
- package/chip/Chip.test.js +0 -41
- package/chip/types.d.ts +0 -45
- package/chip/types.js +0 -5
- package/common/coreTokens.d.ts +0 -237
- package/common/coreTokens.js +0 -184
- package/common/utils.d.ts +0 -1
- package/common/utils.js +0 -16
- package/common/variables.d.ts +0 -1392
- package/common/variables.js +0 -1264
- package/container/Container.d.ts +0 -4
- package/container/Container.js +0 -194
- package/container/Container.stories.tsx +0 -214
- package/container/types.d.ts +0 -74
- package/container/types.js +0 -5
- package/contextual-menu/ContextualMenu.accessibility.test.js +0 -97
- package/contextual-menu/ContextualMenu.d.ts +0 -5
- package/contextual-menu/ContextualMenu.js +0 -88
- package/contextual-menu/ContextualMenu.stories.tsx +0 -232
- package/contextual-menu/ContextualMenu.test.js +0 -205
- package/contextual-menu/GroupItem.d.ts +0 -4
- package/contextual-menu/GroupItem.js +0 -67
- package/contextual-menu/ItemAction.d.ts +0 -4
- package/contextual-menu/ItemAction.js +0 -51
- package/contextual-menu/MenuItem.d.ts +0 -4
- package/contextual-menu/MenuItem.js +0 -29
- package/contextual-menu/SingleItem.d.ts +0 -4
- package/contextual-menu/SingleItem.js +0 -38
- package/contextual-menu/types.d.ts +0 -58
- package/contextual-menu/types.js +0 -5
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -214
- package/date-input/DateInput.accessibility.test.js +0 -228
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -222
- package/date-input/DateInput.stories.tsx +0 -292
- package/date-input/DateInput.test.js +0 -808
- package/date-input/DatePicker.d.ts +0 -4
- package/date-input/DatePicker.js +0 -121
- package/date-input/YearPicker.d.ts +0 -4
- package/date-input/YearPicker.js +0 -100
- package/date-input/types.d.ts +0 -164
- package/date-input/types.js +0 -5
- package/dialog/Dialog.accessibility.test.js +0 -69
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -93
- package/dialog/Dialog.stories.tsx +0 -371
- package/dialog/Dialog.test.js +0 -307
- package/dialog/types.d.ts +0 -36
- package/dialog/types.js +0 -5
- package/divider/Divider.accessibility.test.js +0 -33
- package/divider/Divider.d.ts +0 -4
- package/divider/Divider.js +0 -36
- package/divider/Divider.stories.tsx +0 -223
- package/divider/Divider.test.js +0 -38
- package/divider/types.d.ts +0 -21
- package/divider/types.js +0 -5
- package/dropdown/Dropdown.accessibility.test.js +0 -180
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -321
- package/dropdown/Dropdown.stories.tsx +0 -427
- package/dropdown/Dropdown.test.js +0 -599
- package/dropdown/DropdownMenu.d.ts +0 -4
- package/dropdown/DropdownMenu.js +0 -63
- package/dropdown/DropdownMenuItem.d.ts +0 -4
- package/dropdown/DropdownMenuItem.js +0 -71
- package/dropdown/types.d.ts +0 -96
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.accessibility.test.js +0 -160
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -443
- package/file-input/FileInput.stories.tsx +0 -618
- package/file-input/FileInput.test.js +0 -396
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -125
- package/file-input/types.d.ts +0 -129
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -57
- package/flex/Flex.stories.tsx +0 -112
- package/flex/types.d.ts +0 -97
- package/flex/types.js +0 -5
- package/footer/Footer.accessibility.test.js +0 -125
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -140
- package/footer/Footer.stories.tsx +0 -208
- package/footer/Footer.test.js +0 -85
- package/footer/Icons.d.ts +0 -3
- package/footer/Icons.js +0 -108
- package/footer/types.d.ts +0 -64
- package/footer/types.js +0 -5
- package/grid/Grid.d.ts +0 -7
- package/grid/Grid.js +0 -76
- package/grid/Grid.stories.tsx +0 -219
- package/grid/types.d.ts +0 -115
- package/grid/types.js +0 -5
- package/header/Header.accessibility.test.js +0 -93
- package/header/Header.d.ts +0 -8
- package/header/Header.js +0 -210
- package/header/Header.stories.tsx +0 -267
- package/header/Header.test.js +0 -66
- package/header/Icons.d.ts +0 -2
- package/header/Icons.js +0 -24
- package/header/types.d.ts +0 -33
- package/header/types.js +0 -5
- package/heading/Heading.accessibility.test.js +0 -33
- package/heading/Heading.d.ts +0 -4
- package/heading/Heading.js +0 -137
- package/heading/Heading.stories.tsx +0 -54
- package/heading/Heading.test.js +0 -169
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- package/icon/Icon.accessibility.test.js +0 -30
- package/icon/Icon.d.ts +0 -4
- package/icon/Icon.js +0 -33
- package/icon/Icon.stories.tsx +0 -28
- package/icon/types.d.ts +0 -4
- package/icon/types.js +0 -5
- package/image/Image.accessibility.test.js +0 -56
- package/image/Image.d.ts +0 -4
- package/image/Image.js +0 -70
- package/image/Image.stories.tsx +0 -129
- package/image/types.d.ts +0 -72
- package/image/types.js +0 -5
- package/inset/Inset.d.ts +0 -3
- package/inset/Inset.js +0 -43
- package/inset/Inset.stories.tsx +0 -230
- package/inset/types.d.ts +0 -37
- package/inset/types.js +0 -5
- package/layout/ApplicationLayout.d.ts +0 -20
- package/layout/ApplicationLayout.js +0 -137
- package/layout/ApplicationLayout.stories.tsx +0 -162
- package/layout/Icons.d.ts +0 -7
- package/layout/Icons.js +0 -48
- package/layout/types.d.ts +0 -41
- package/layout/types.js +0 -5
- package/link/Link.accessibility.test.js +0 -108
- package/link/Link.d.ts +0 -4
- package/link/Link.js +0 -117
- package/link/Link.stories.tsx +0 -253
- package/link/Link.test.js +0 -63
- package/link/types.d.ts +0 -54
- package/link/types.js +0 -5
- package/main.d.ts +0 -50
- package/main.js +0 -364
- package/nav-tabs/NavTabs.accessibility.test.js +0 -44
- package/nav-tabs/NavTabs.d.ts +0 -7
- package/nav-tabs/NavTabs.js +0 -93
- package/nav-tabs/NavTabs.stories.tsx +0 -279
- package/nav-tabs/NavTabs.test.js +0 -77
- package/nav-tabs/NavTabsContext.d.ts +0 -3
- package/nav-tabs/NavTabsContext.js +0 -8
- package/nav-tabs/Tab.d.ts +0 -4
- package/nav-tabs/Tab.js +0 -117
- package/nav-tabs/types.d.ts +0 -52
- package/nav-tabs/types.js +0 -5
- package/number-input/NumberInput.accessibility.test.js +0 -228
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -86
- package/number-input/NumberInput.stories.tsx +0 -131
- package/number-input/NumberInput.test.js +0 -989
- package/number-input/NumberInputContext.d.ts +0 -3
- package/number-input/NumberInputContext.js +0 -8
- package/number-input/types.d.ts +0 -136
- package/number-input/types.js +0 -5
- package/paginator/Paginator.accessibility.test.js +0 -79
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -138
- package/paginator/Paginator.stories.tsx +0 -87
- package/paginator/Paginator.test.js +0 -335
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/paragraph/Paragraph.accessibility.test.js +0 -28
- package/paragraph/Paragraph.d.ts +0 -5
- package/paragraph/Paragraph.js +0 -22
- package/paragraph/Paragraph.stories.tsx +0 -27
- package/password-input/PasswordInput.accessibility.test.js +0 -153
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -97
- package/password-input/PasswordInput.stories.tsx +0 -99
- package/password-input/PasswordInput.test.js +0 -198
- package/password-input/types.d.ts +0 -111
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.accessibility.test.js +0 -35
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -146
- package/progress-bar/ProgressBar.stories.tsx +0 -93
- package/progress-bar/ProgressBar.test.js +0 -93
- package/progress-bar/types.d.ts +0 -37
- package/progress-bar/types.js +0 -5
- package/quick-nav/QuickNav.accessibility.test.js +0 -57
- package/quick-nav/QuickNav.d.ts +0 -4
- package/quick-nav/QuickNav.js +0 -94
- package/quick-nav/QuickNav.stories.tsx +0 -356
- package/quick-nav/types.d.ts +0 -21
- package/quick-nav/types.js +0 -5
- package/radio-group/Radio.d.ts +0 -4
- package/radio-group/Radio.js +0 -124
- package/radio-group/RadioGroup.accessibility.test.js +0 -97
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -236
- package/radio-group/RadioGroup.stories.tsx +0 -214
- package/radio-group/RadioGroup.test.js +0 -756
- package/radio-group/types.d.ts +0 -114
- package/radio-group/types.js +0 -5
- package/resultset-table/Icons.d.ts +0 -7
- package/resultset-table/Icons.js +0 -47
- package/resultset-table/ResultsetTable.accessibility.test.js +0 -285
- package/resultset-table/ResultsetTable.d.ts +0 -7
- package/resultset-table/ResultsetTable.js +0 -171
- package/resultset-table/ResultsetTable.stories.tsx +0 -413
- package/resultset-table/ResultsetTable.test.js +0 -381
- package/resultset-table/types.d.ts +0 -100
- package/resultset-table/types.js +0 -5
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -155
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -89
- package/select/Select.accessibility.test.js +0 -228
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -602
- package/select/Select.stories.tsx +0 -919
- package/select/Select.test.js +0 -2265
- package/select/types.d.ts +0 -209
- package/select/types.js +0 -5
- package/sidenav/Sidenav.accessibility.test.js +0 -59
- package/sidenav/Sidenav.d.ts +0 -10
- package/sidenav/Sidenav.js +0 -201
- package/sidenav/Sidenav.stories.tsx +0 -277
- package/sidenav/Sidenav.test.js +0 -37
- package/sidenav/SidenavContext.d.ts +0 -5
- package/sidenav/SidenavContext.js +0 -13
- package/sidenav/types.d.ts +0 -76
- package/sidenav/types.js +0 -5
- package/slider/Slider.accessibility.test.js +0 -104
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -286
- package/slider/Slider.stories.tsx +0 -180
- package/slider/Slider.test.js +0 -254
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- package/spinner/Spinner.accessibility.test.js +0 -96
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -210
- package/spinner/Spinner.stories.tsx +0 -129
- package/spinner/Spinner.test.js +0 -55
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/status-light/StatusLight.accessibility.test.js +0 -157
- package/status-light/StatusLight.d.ts +0 -4
- package/status-light/StatusLight.js +0 -51
- package/status-light/StatusLight.stories.tsx +0 -74
- package/status-light/StatusLight.test.js +0 -25
- package/status-light/types.d.ts +0 -17
- package/status-light/types.js +0 -5
- package/switch/Switch.accessibility.test.js +0 -98
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -214
- package/switch/Switch.stories.tsx +0 -149
- package/switch/Switch.test.js +0 -180
- package/switch/types.d.ts +0 -66
- package/switch/types.js +0 -5
- package/table/DropdownTheme.js +0 -62
- package/table/Table.accessibility.test.js +0 -93
- package/table/Table.d.ts +0 -8
- package/table/Table.js +0 -161
- package/table/Table.stories.tsx +0 -663
- package/table/Table.test.js +0 -113
- package/table/types.d.ts +0 -49
- package/table/types.js +0 -5
- package/tabs/Tab.d.ts +0 -4
- package/tabs/Tab.js +0 -117
- package/tabs/Tabs.accessibility.test.js +0 -56
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -373
- package/tabs/Tabs.stories.tsx +0 -230
- package/tabs/Tabs.test.js +0 -276
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- package/tag/Tag.accessibility.test.js +0 -69
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -151
- package/tag/Tag.stories.tsx +0 -152
- package/tag/Tag.test.js +0 -41
- package/tag/types.d.ts +0 -69
- package/tag/types.js +0 -5
- package/text-input/Suggestion.d.ts +0 -4
- package/text-input/Suggestion.js +0 -67
- package/text-input/Suggestions.d.ts +0 -4
- package/text-input/Suggestions.js +0 -94
- package/text-input/TextInput.accessibility.test.js +0 -321
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -571
- package/text-input/TextInput.stories.tsx +0 -474
- package/text-input/TextInput.test.js +0 -1756
- package/text-input/types.d.ts +0 -205
- package/text-input/types.js +0 -5
- package/textarea/Textarea.accessibility.test.js +0 -155
- package/textarea/Textarea.d.ts +0 -4
- package/textarea/Textarea.js +0 -235
- package/textarea/Textarea.stories.tsx +0 -174
- package/textarea/Textarea.test.js +0 -406
- package/textarea/types.d.ts +0 -141
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -202
- package/toggle-group/ToggleGroup.stories.tsx +0 -218
- package/toggle-group/ToggleGroup.test.js +0 -137
- package/toggle-group/types.d.ts +0 -114
- package/toggle-group/types.js +0 -5
- package/typography/Typography.accessibility.test.js +0 -339
- package/typography/Typography.d.ts +0 -4
- package/typography/Typography.js +0 -23
- package/typography/Typography.stories.tsx +0 -198
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -1145
- package/useTheme.js +0 -15
- package/useTranslatedLabels.d.ts +0 -85
- package/useTranslatedLabels.js +0 -14
- package/utils/BaseTypography.d.ts +0 -21
- package/utils/BaseTypography.js +0 -94
- package/utils/FocusLock.d.ts +0 -13
- package/utils/FocusLock.js +0 -124
- package/wizard/Wizard.accessibility.test.js +0 -55
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -239
- package/wizard/Wizard.stories.tsx +0 -272
- package/wizard/Wizard.test.js +0 -114
- package/wizard/types.d.ts +0 -64
- package/wizard/types.js +0 -5
package/bleed/Bleed.stories.tsx
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import Title from "../../.storybook/components/Title";
|
|
4
|
-
import DxcBleed from "./Bleed";
|
|
5
|
-
import DxcFlex from "../flex/Flex";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Bleed",
|
|
9
|
-
component: DxcBleed,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const Chromatic = () => (
|
|
13
|
-
<>
|
|
14
|
-
<Title title="Space = none" theme="light" level={4} />
|
|
15
|
-
<Container>
|
|
16
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
17
|
-
<Placeholder></Placeholder>
|
|
18
|
-
<DxcBleed space="0rem">
|
|
19
|
-
<Placeholder></Placeholder>
|
|
20
|
-
</DxcBleed>
|
|
21
|
-
<Placeholder></Placeholder>
|
|
22
|
-
</DxcFlex>
|
|
23
|
-
</Container>
|
|
24
|
-
<Title title="Space = xxxsmall" theme="light" level={4} />
|
|
25
|
-
<Container>
|
|
26
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
27
|
-
<Placeholder></Placeholder>
|
|
28
|
-
<DxcBleed space="0.125rem">
|
|
29
|
-
<Placeholder></Placeholder>
|
|
30
|
-
</DxcBleed>
|
|
31
|
-
<Placeholder></Placeholder>
|
|
32
|
-
</DxcFlex>
|
|
33
|
-
</Container>
|
|
34
|
-
<Title title="Space = xxsmall" theme="light" level={4} />
|
|
35
|
-
<Container>
|
|
36
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
37
|
-
<Placeholder></Placeholder>
|
|
38
|
-
<DxcBleed space="0.25rem">
|
|
39
|
-
<Placeholder></Placeholder>
|
|
40
|
-
</DxcBleed>
|
|
41
|
-
<Placeholder></Placeholder>
|
|
42
|
-
</DxcFlex>
|
|
43
|
-
</Container>
|
|
44
|
-
<Title title="Space = xsmall" theme="light" level={4} />
|
|
45
|
-
<Container>
|
|
46
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
47
|
-
<Placeholder></Placeholder>
|
|
48
|
-
<DxcBleed space="0.5rem">
|
|
49
|
-
<Placeholder></Placeholder>
|
|
50
|
-
</DxcBleed>
|
|
51
|
-
<Placeholder></Placeholder>
|
|
52
|
-
</DxcFlex>
|
|
53
|
-
</Container>
|
|
54
|
-
<Title title="Space = small" theme="light" level={4} />
|
|
55
|
-
<Container>
|
|
56
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
57
|
-
<Placeholder></Placeholder>
|
|
58
|
-
<DxcBleed space="1rem">
|
|
59
|
-
<Placeholder></Placeholder>
|
|
60
|
-
</DxcBleed>
|
|
61
|
-
<Placeholder></Placeholder>
|
|
62
|
-
</DxcFlex>
|
|
63
|
-
</Container>
|
|
64
|
-
<Title title="Space = medium" theme="light" level={4} />
|
|
65
|
-
<Container>
|
|
66
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
67
|
-
<Placeholder></Placeholder>
|
|
68
|
-
<DxcBleed space="1.5rem">
|
|
69
|
-
<Placeholder></Placeholder>
|
|
70
|
-
</DxcBleed>
|
|
71
|
-
<Placeholder></Placeholder>
|
|
72
|
-
</DxcFlex>
|
|
73
|
-
</Container>
|
|
74
|
-
<Title title="Space = large" theme="light" level={4} />
|
|
75
|
-
<Container>
|
|
76
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
77
|
-
<Placeholder></Placeholder>
|
|
78
|
-
<DxcBleed space="2rem">
|
|
79
|
-
<Placeholder></Placeholder>
|
|
80
|
-
</DxcBleed>
|
|
81
|
-
<Placeholder></Placeholder>
|
|
82
|
-
</DxcFlex>
|
|
83
|
-
</Container>
|
|
84
|
-
<Title title="Space = xlarge" theme="light" level={4} />
|
|
85
|
-
<Container>
|
|
86
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
87
|
-
<Placeholder></Placeholder>
|
|
88
|
-
<DxcBleed space="3rem">
|
|
89
|
-
<Placeholder></Placeholder>
|
|
90
|
-
</DxcBleed>
|
|
91
|
-
<Placeholder></Placeholder>
|
|
92
|
-
</DxcFlex>
|
|
93
|
-
</Container>
|
|
94
|
-
<Title title="Space = xxlarge" theme="light" level={4} />
|
|
95
|
-
<Container>
|
|
96
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
97
|
-
<Placeholder></Placeholder>
|
|
98
|
-
<DxcBleed space="4rem">
|
|
99
|
-
<Placeholder></Placeholder>
|
|
100
|
-
</DxcBleed>
|
|
101
|
-
<Placeholder></Placeholder>
|
|
102
|
-
</DxcFlex>
|
|
103
|
-
</Container>
|
|
104
|
-
<Title title="Space = xxxlarge" theme="light" level={4} />
|
|
105
|
-
<Container>
|
|
106
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
107
|
-
<Placeholder></Placeholder>
|
|
108
|
-
<DxcBleed space="5rem">
|
|
109
|
-
<Placeholder></Placeholder>
|
|
110
|
-
</DxcBleed>
|
|
111
|
-
<Placeholder></Placeholder>
|
|
112
|
-
</DxcFlex>
|
|
113
|
-
</Container>
|
|
114
|
-
|
|
115
|
-
<Title title="Horizontal = none" theme="light" level={4} />
|
|
116
|
-
<Container>
|
|
117
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
118
|
-
<Placeholder></Placeholder>
|
|
119
|
-
<DxcBleed horizontal="0rem">
|
|
120
|
-
<Placeholder></Placeholder>
|
|
121
|
-
</DxcBleed>
|
|
122
|
-
<Placeholder></Placeholder>
|
|
123
|
-
</DxcFlex>
|
|
124
|
-
</Container>
|
|
125
|
-
<Title title="Horizontal = xxxsmall" theme="light" level={4} />
|
|
126
|
-
<Container>
|
|
127
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
128
|
-
<Placeholder></Placeholder>
|
|
129
|
-
<DxcBleed horizontal="0.125rem">
|
|
130
|
-
<Placeholder></Placeholder>
|
|
131
|
-
</DxcBleed>
|
|
132
|
-
<Placeholder></Placeholder>
|
|
133
|
-
</DxcFlex>
|
|
134
|
-
</Container>
|
|
135
|
-
<Title title="Horizontal = xxsmall" theme="light" level={4} />
|
|
136
|
-
<Container>
|
|
137
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
138
|
-
<Placeholder></Placeholder>
|
|
139
|
-
<DxcBleed horizontal="0.25rem">
|
|
140
|
-
<Placeholder></Placeholder>
|
|
141
|
-
</DxcBleed>
|
|
142
|
-
<Placeholder></Placeholder>
|
|
143
|
-
</DxcFlex>
|
|
144
|
-
</Container>
|
|
145
|
-
<Title title="Horizontal = xsmall" theme="light" level={4} />
|
|
146
|
-
<Container>
|
|
147
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
148
|
-
<Placeholder></Placeholder>
|
|
149
|
-
<DxcBleed horizontal="0.5rem">
|
|
150
|
-
<Placeholder></Placeholder>
|
|
151
|
-
</DxcBleed>
|
|
152
|
-
<Placeholder></Placeholder>
|
|
153
|
-
</DxcFlex>
|
|
154
|
-
</Container>
|
|
155
|
-
<Title title="Horizontal = small" theme="light" level={4} />
|
|
156
|
-
<Container>
|
|
157
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
158
|
-
<Placeholder></Placeholder>
|
|
159
|
-
<DxcBleed horizontal="1rem">
|
|
160
|
-
<Placeholder></Placeholder>
|
|
161
|
-
</DxcBleed>
|
|
162
|
-
<Placeholder></Placeholder>
|
|
163
|
-
</DxcFlex>
|
|
164
|
-
</Container>
|
|
165
|
-
<Title title="Horizontal = medium" theme="light" level={4} />
|
|
166
|
-
<Container>
|
|
167
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
168
|
-
<Placeholder></Placeholder>
|
|
169
|
-
<DxcBleed horizontal="1.5rem">
|
|
170
|
-
<Placeholder></Placeholder>
|
|
171
|
-
</DxcBleed>
|
|
172
|
-
<Placeholder></Placeholder>
|
|
173
|
-
</DxcFlex>
|
|
174
|
-
</Container>
|
|
175
|
-
<Title title="Horizontal = large" theme="light" level={4} />
|
|
176
|
-
<Container>
|
|
177
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
178
|
-
<Placeholder></Placeholder>
|
|
179
|
-
<DxcBleed horizontal="2rem">
|
|
180
|
-
<Placeholder></Placeholder>
|
|
181
|
-
</DxcBleed>
|
|
182
|
-
<Placeholder></Placeholder>
|
|
183
|
-
</DxcFlex>
|
|
184
|
-
</Container>
|
|
185
|
-
<Title title="Horizontal = xlarge" theme="light" level={4} />
|
|
186
|
-
<Container>
|
|
187
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
188
|
-
<Placeholder></Placeholder>
|
|
189
|
-
<DxcBleed horizontal="3rem">
|
|
190
|
-
<Placeholder></Placeholder>
|
|
191
|
-
</DxcBleed>
|
|
192
|
-
<Placeholder></Placeholder>
|
|
193
|
-
</DxcFlex>
|
|
194
|
-
</Container>
|
|
195
|
-
<Title title="Horizontal = xxlarge" theme="light" level={4} />
|
|
196
|
-
<Container>
|
|
197
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
198
|
-
<Placeholder></Placeholder>
|
|
199
|
-
<DxcBleed horizontal="4rem">
|
|
200
|
-
<Placeholder></Placeholder>
|
|
201
|
-
</DxcBleed>
|
|
202
|
-
<Placeholder></Placeholder>
|
|
203
|
-
</DxcFlex>
|
|
204
|
-
</Container>
|
|
205
|
-
<Title title="Horizontal = xxxlarge" theme="light" level={4} />
|
|
206
|
-
<Container>
|
|
207
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
208
|
-
<Placeholder></Placeholder>
|
|
209
|
-
<DxcBleed horizontal="5rem">
|
|
210
|
-
<Placeholder></Placeholder>
|
|
211
|
-
</DxcBleed>
|
|
212
|
-
<Placeholder></Placeholder>
|
|
213
|
-
</DxcFlex>
|
|
214
|
-
</Container>
|
|
215
|
-
|
|
216
|
-
<Title title="Vertical = none" theme="light" level={4} />
|
|
217
|
-
<Container>
|
|
218
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
219
|
-
<Placeholder></Placeholder>
|
|
220
|
-
<DxcBleed vertical="0rem">
|
|
221
|
-
<Placeholder></Placeholder>
|
|
222
|
-
</DxcBleed>
|
|
223
|
-
<Placeholder></Placeholder>
|
|
224
|
-
</DxcFlex>
|
|
225
|
-
</Container>
|
|
226
|
-
<Title title="Vertical = xxxsmall" theme="light" level={4} />
|
|
227
|
-
<Container>
|
|
228
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
229
|
-
<Placeholder></Placeholder>
|
|
230
|
-
<DxcBleed vertical="0.125rem">
|
|
231
|
-
<Placeholder></Placeholder>
|
|
232
|
-
</DxcBleed>
|
|
233
|
-
<Placeholder></Placeholder>
|
|
234
|
-
</DxcFlex>
|
|
235
|
-
</Container>
|
|
236
|
-
<Title title="Vertical = xxsmall" theme="light" level={4} />
|
|
237
|
-
<Container>
|
|
238
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
239
|
-
<Placeholder></Placeholder>
|
|
240
|
-
<DxcBleed vertical="0.25rem">
|
|
241
|
-
<Placeholder></Placeholder>
|
|
242
|
-
</DxcBleed>
|
|
243
|
-
<Placeholder></Placeholder>
|
|
244
|
-
</DxcFlex>
|
|
245
|
-
</Container>
|
|
246
|
-
<Title title="Vertical = xsmall" theme="light" level={4} />
|
|
247
|
-
<Container>
|
|
248
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
249
|
-
<Placeholder></Placeholder>
|
|
250
|
-
<DxcBleed vertical="0.5rem">
|
|
251
|
-
<Placeholder></Placeholder>
|
|
252
|
-
</DxcBleed>
|
|
253
|
-
<Placeholder></Placeholder>
|
|
254
|
-
</DxcFlex>
|
|
255
|
-
</Container>
|
|
256
|
-
<Title title="Vertical = small" theme="light" level={4} />
|
|
257
|
-
<Container>
|
|
258
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
259
|
-
<Placeholder></Placeholder>
|
|
260
|
-
<DxcBleed vertical="1rem">
|
|
261
|
-
<Placeholder></Placeholder>
|
|
262
|
-
</DxcBleed>
|
|
263
|
-
<Placeholder></Placeholder>
|
|
264
|
-
</DxcFlex>
|
|
265
|
-
</Container>
|
|
266
|
-
<Title title="Vertical = medium" theme="light" level={4} />
|
|
267
|
-
<Container>
|
|
268
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
269
|
-
<Placeholder></Placeholder>
|
|
270
|
-
<DxcBleed vertical="1.5rem">
|
|
271
|
-
<Placeholder></Placeholder>
|
|
272
|
-
</DxcBleed>
|
|
273
|
-
<Placeholder></Placeholder>
|
|
274
|
-
</DxcFlex>
|
|
275
|
-
</Container>
|
|
276
|
-
<Title title="Vertical = large" theme="light" level={4} />
|
|
277
|
-
<Container>
|
|
278
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
279
|
-
<Placeholder></Placeholder>
|
|
280
|
-
<DxcBleed vertical="2rem">
|
|
281
|
-
<Placeholder></Placeholder>
|
|
282
|
-
</DxcBleed>
|
|
283
|
-
<Placeholder></Placeholder>
|
|
284
|
-
</DxcFlex>
|
|
285
|
-
</Container>
|
|
286
|
-
<Title title="Vertical = xlarge" theme="light" level={4} />
|
|
287
|
-
<Container>
|
|
288
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
289
|
-
<Placeholder></Placeholder>
|
|
290
|
-
<DxcBleed vertical="3rem">
|
|
291
|
-
<Placeholder></Placeholder>
|
|
292
|
-
</DxcBleed>
|
|
293
|
-
<Placeholder></Placeholder>
|
|
294
|
-
</DxcFlex>
|
|
295
|
-
</Container>
|
|
296
|
-
<Title title="Vertical = xxlarge" theme="light" level={4} />
|
|
297
|
-
<Container>
|
|
298
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
299
|
-
<Placeholder></Placeholder>
|
|
300
|
-
<DxcBleed vertical="4rem">
|
|
301
|
-
<Placeholder></Placeholder>
|
|
302
|
-
</DxcBleed>
|
|
303
|
-
<Placeholder></Placeholder>
|
|
304
|
-
</DxcFlex>
|
|
305
|
-
</Container>
|
|
306
|
-
<Title title="Vertical = xxxlarge" theme="light" level={4} />
|
|
307
|
-
<Container>
|
|
308
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
309
|
-
<Placeholder></Placeholder>
|
|
310
|
-
<DxcBleed vertical="5rem">
|
|
311
|
-
<Placeholder></Placeholder>
|
|
312
|
-
</DxcBleed>
|
|
313
|
-
<Placeholder></Placeholder>
|
|
314
|
-
</DxcFlex>
|
|
315
|
-
</Container>
|
|
316
|
-
|
|
317
|
-
<Title title="Top = xsmall, right = small, bottom = medium and left = large" theme="light" level={4} />
|
|
318
|
-
<Container>
|
|
319
|
-
<DxcFlex direction="column" gap="1.5rem">
|
|
320
|
-
<Placeholder></Placeholder>
|
|
321
|
-
<DxcBleed top="0.5rem" right="1rem" bottom="1.5rem" left="2rem">
|
|
322
|
-
<Placeholder></Placeholder>
|
|
323
|
-
</DxcBleed>
|
|
324
|
-
<Placeholder></Placeholder>
|
|
325
|
-
</DxcFlex>
|
|
326
|
-
</Container>
|
|
327
|
-
</>
|
|
328
|
-
);
|
|
329
|
-
|
|
330
|
-
const Container = styled.div`
|
|
331
|
-
background: #f2eafa;
|
|
332
|
-
padding: 5rem;
|
|
333
|
-
margin: 2.5rem;
|
|
334
|
-
`;
|
|
335
|
-
|
|
336
|
-
const Placeholder = styled.div`
|
|
337
|
-
min-height: 40px;
|
|
338
|
-
min-width: 120px;
|
|
339
|
-
border: 1px solid #a46ede;
|
|
340
|
-
border-radius: 0.5rem;
|
|
341
|
-
background-color: #e5d5f6;
|
|
342
|
-
`;
|
package/bleed/types.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type Spacing = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
3
|
-
type Props = {
|
|
4
|
-
/**
|
|
5
|
-
* Applies the spacing scale to all sides.
|
|
6
|
-
*/
|
|
7
|
-
space?: Spacing;
|
|
8
|
-
/**
|
|
9
|
-
* Applies the spacing scale to the left and right sides.
|
|
10
|
-
*/
|
|
11
|
-
horizontal?: Spacing;
|
|
12
|
-
/**
|
|
13
|
-
* Applies the spacing scale to the top and bottom sides.
|
|
14
|
-
*/
|
|
15
|
-
vertical?: Spacing;
|
|
16
|
-
/**
|
|
17
|
-
* Applies the spacing scale to the top side.
|
|
18
|
-
*/
|
|
19
|
-
top?: Spacing;
|
|
20
|
-
/**
|
|
21
|
-
* Applies the spacing scale to the right side.
|
|
22
|
-
*/
|
|
23
|
-
right?: Spacing;
|
|
24
|
-
/**
|
|
25
|
-
* Applies the spacing scale to the bottom side.
|
|
26
|
-
*/
|
|
27
|
-
bottom?: Spacing;
|
|
28
|
-
/**
|
|
29
|
-
* Applies the spacing scale to the left side.
|
|
30
|
-
*/
|
|
31
|
-
left?: Spacing;
|
|
32
|
-
/**
|
|
33
|
-
* Custom content inside the bleed.
|
|
34
|
-
*/
|
|
35
|
-
children: React.ReactNode;
|
|
36
|
-
};
|
|
37
|
-
export default Props;
|
package/bleed/types.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
-
var _Box = _interopRequireDefault(require("../box/Box.tsx"));
|
|
10
|
-
describe("Box component accessibility tests", function () {
|
|
11
|
-
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
12
|
-
var _render, container, results;
|
|
13
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
14
|
-
while (1) switch (_context.prev = _context.next) {
|
|
15
|
-
case 0:
|
|
16
|
-
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
17
|
-
shadowDepth: 0,
|
|
18
|
-
margin: "medium",
|
|
19
|
-
size: "small",
|
|
20
|
-
display: "flex"
|
|
21
|
-
}, "Box")), container = _render.container;
|
|
22
|
-
_context.next = 3;
|
|
23
|
-
return (0, _axeHelper.axe)(container);
|
|
24
|
-
case 3:
|
|
25
|
-
results = _context.sent;
|
|
26
|
-
expect(results).toHaveNoViolations();
|
|
27
|
-
case 5:
|
|
28
|
-
case "end":
|
|
29
|
-
return _context.stop();
|
|
30
|
-
}
|
|
31
|
-
}, _callee);
|
|
32
|
-
})));
|
|
33
|
-
});
|
package/box/Box.d.ts
DELETED
package/box/Box.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
var _variables = require("../common/variables");
|
|
14
|
-
var _utils = require("../common/utils");
|
|
15
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
16
|
-
var _templateObject;
|
|
17
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
|
-
var DxcBox = function DxcBox(_ref) {
|
|
20
|
-
var _ref$shadowDepth = _ref.shadowDepth,
|
|
21
|
-
shadowDepth = _ref$shadowDepth === void 0 ? 2 : _ref$shadowDepth,
|
|
22
|
-
_ref$display = _ref.display,
|
|
23
|
-
display = _ref$display === void 0 ? "inline-flex" : _ref$display,
|
|
24
|
-
children = _ref.children,
|
|
25
|
-
margin = _ref.margin,
|
|
26
|
-
_ref$size = _ref.size,
|
|
27
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
28
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
29
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
30
|
-
theme: colorsTheme.box
|
|
31
|
-
}, /*#__PURE__*/_react["default"].createElement(Box, {
|
|
32
|
-
shadowDepth: shadowDepth,
|
|
33
|
-
display: display,
|
|
34
|
-
margin: margin,
|
|
35
|
-
size: size
|
|
36
|
-
}, children));
|
|
37
|
-
};
|
|
38
|
-
var sizes = {
|
|
39
|
-
small: "48px",
|
|
40
|
-
medium: "240px",
|
|
41
|
-
large: "480px",
|
|
42
|
-
fillParent: "100%",
|
|
43
|
-
fitContent: "fit-content"
|
|
44
|
-
};
|
|
45
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
46
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
47
|
-
};
|
|
48
|
-
var Box = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\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"])), function (props) {
|
|
49
|
-
return props.display;
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return props.theme.borderRadius;
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.theme.borderThickness;
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.theme.borderStyle;
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return props.theme.borderColor;
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return calculateWidth(props.margin, props.size);
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return props.theme.backgroundColor;
|
|
62
|
-
}, function (props) {
|
|
63
|
-
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);
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
66
|
-
}, function (props) {
|
|
67
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
68
|
-
}, function (props) {
|
|
69
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
70
|
-
}, function (props) {
|
|
71
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
72
|
-
}, function (props) {
|
|
73
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
74
|
-
});
|
|
75
|
-
var _default = exports["default"] = DxcBox;
|
package/box/Box.stories.tsx
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Title from "../../.storybook/components/Title";
|
|
3
|
-
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
-
import DxcBox from "./Box";
|
|
5
|
-
import DxcInset from "../inset/Inset";
|
|
6
|
-
import { HalstackProvider } from "../HalstackContext";
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: "Box ",
|
|
10
|
-
component: DxcBox,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const opinionatedTheme = {
|
|
14
|
-
box: {
|
|
15
|
-
baseColor: "#ffffff",
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Chromatic = () => (
|
|
20
|
-
<>
|
|
21
|
-
<Title title="Display flex" theme="light" level={2} />
|
|
22
|
-
<ExampleContainer>
|
|
23
|
-
<DxcBox display="flex">
|
|
24
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
25
|
-
</DxcBox>
|
|
26
|
-
</ExampleContainer>
|
|
27
|
-
<Title title="ShadowDepth" theme="light" level={2} />
|
|
28
|
-
<ExampleContainer>
|
|
29
|
-
<Title title="ShadowDepth 0" theme="light" level={4} />
|
|
30
|
-
<DxcBox shadowDepth={0} margin="medium">
|
|
31
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
32
|
-
</DxcBox>
|
|
33
|
-
</ExampleContainer>
|
|
34
|
-
<ExampleContainer>
|
|
35
|
-
<Title title="ShadowDepth 1" theme="light" level={4} />
|
|
36
|
-
<DxcBox shadowDepth={1} margin="medium">
|
|
37
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
38
|
-
</DxcBox>
|
|
39
|
-
</ExampleContainer>
|
|
40
|
-
<ExampleContainer>
|
|
41
|
-
<Title title="ShadowDepth 2" theme="light" level={4} />
|
|
42
|
-
<DxcBox shadowDepth={2} margin="medium">
|
|
43
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
44
|
-
</DxcBox>
|
|
45
|
-
</ExampleContainer>
|
|
46
|
-
<Title title="Margins" theme="light" level={2} />
|
|
47
|
-
<ExampleContainer>
|
|
48
|
-
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
49
|
-
<DxcBox margin="xxsmall">
|
|
50
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
51
|
-
</DxcBox>
|
|
52
|
-
</ExampleContainer>
|
|
53
|
-
<ExampleContainer>
|
|
54
|
-
<Title title="Xsmall margin" theme="light" level={4} />
|
|
55
|
-
<DxcBox margin="xsmall">
|
|
56
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
57
|
-
</DxcBox>
|
|
58
|
-
</ExampleContainer>
|
|
59
|
-
<ExampleContainer>
|
|
60
|
-
<Title title="Small margin" theme="light" level={4} />
|
|
61
|
-
<DxcBox margin="small">
|
|
62
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
63
|
-
</DxcBox>
|
|
64
|
-
</ExampleContainer>
|
|
65
|
-
<ExampleContainer>
|
|
66
|
-
<Title title="Medium margin" theme="light" level={4} />
|
|
67
|
-
<DxcBox margin="medium">
|
|
68
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
69
|
-
</DxcBox>
|
|
70
|
-
</ExampleContainer>
|
|
71
|
-
<ExampleContainer>
|
|
72
|
-
<Title title="Large margin" theme="light" level={4} />
|
|
73
|
-
<DxcBox margin="large">
|
|
74
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
75
|
-
</DxcBox>
|
|
76
|
-
</ExampleContainer>
|
|
77
|
-
<ExampleContainer>
|
|
78
|
-
<Title title="Xlarge margin" theme="light" level={4} />
|
|
79
|
-
<DxcBox margin="xlarge">
|
|
80
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
81
|
-
</DxcBox>
|
|
82
|
-
</ExampleContainer>
|
|
83
|
-
<ExampleContainer>
|
|
84
|
-
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
85
|
-
<DxcBox margin="xxlarge">
|
|
86
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
87
|
-
</DxcBox>
|
|
88
|
-
</ExampleContainer>
|
|
89
|
-
<Title title="Sizes" theme="light" level={2} />
|
|
90
|
-
<ExampleContainer>
|
|
91
|
-
<Title title="Small size" theme="light" level={4} />
|
|
92
|
-
<DxcBox size="small">Box</DxcBox>
|
|
93
|
-
</ExampleContainer>
|
|
94
|
-
<ExampleContainer>
|
|
95
|
-
<Title title="Medium size" theme="light" level={4} />
|
|
96
|
-
<DxcBox size="medium">Box</DxcBox>
|
|
97
|
-
</ExampleContainer>
|
|
98
|
-
<ExampleContainer>
|
|
99
|
-
<Title title="Large size" theme="light" level={4} />
|
|
100
|
-
<DxcBox size="large">Box</DxcBox>
|
|
101
|
-
</ExampleContainer>
|
|
102
|
-
<ExampleContainer>
|
|
103
|
-
<Title title="FillParent size" theme="light" level={4} />
|
|
104
|
-
<DxcBox size="fillParent">Box</DxcBox>
|
|
105
|
-
</ExampleContainer>
|
|
106
|
-
<ExampleContainer>
|
|
107
|
-
<Title title="FitContent" theme="light" level={4} />
|
|
108
|
-
<DxcBox size="fitContent">Box</DxcBox>
|
|
109
|
-
</ExampleContainer>
|
|
110
|
-
<Title title="Opinionated theme" theme="light" level={2} />
|
|
111
|
-
<ExampleContainer>
|
|
112
|
-
<HalstackProvider theme={opinionatedTheme}>
|
|
113
|
-
<DxcBox display="flex">
|
|
114
|
-
<DxcInset space="2rem">Box</DxcInset>
|
|
115
|
-
</DxcBox>
|
|
116
|
-
</HalstackProvider>
|
|
117
|
-
</ExampleContainer>
|
|
118
|
-
</>
|
|
119
|
-
);
|
package/box/Box.test.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
var _Card = _interopRequireDefault(require("../card/Card.tsx"));
|
|
7
|
-
describe("Box component tests", function () {
|
|
8
|
-
test("Box renders with correct text", function () {
|
|
9
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Card["default"], null, "test-box")),
|
|
10
|
-
getByText = _render.getByText;
|
|
11
|
-
expect(getByText("test-box")).toBeTruthy();
|
|
12
|
-
});
|
|
13
|
-
});
|
package/box/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
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 Props = {
|
|
10
|
-
/**
|
|
11
|
-
* The size of the shadow to be displayed around the box.
|
|
12
|
-
*/
|
|
13
|
-
shadowDepth?: 0 | 1 | 2;
|
|
14
|
-
/**
|
|
15
|
-
* Changes the display CSS property of the box div.
|
|
16
|
-
*/
|
|
17
|
-
display?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Custom content that will be placed in the box component.
|
|
20
|
-
*/
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
24
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
25
|
-
*/
|
|
26
|
-
margin?: Space | Margin;
|
|
27
|
-
/**
|
|
28
|
-
* Size of the component.
|
|
29
|
-
*/
|
|
30
|
-
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
31
|
-
};
|
|
32
|
-
export default Props;
|