@dxc-technology/halstack-react 0.0.0-090152f → 0.0.0-0a9608a
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/HalstackContext.js +7 -8
- package/accordion/Accordion.js +7 -13
- package/accordion/Accordion.stories.tsx +52 -12
- package/accordion/types.d.ts +1 -0
- package/accordion-group/types.d.ts +1 -0
- package/box/types.d.ts +1 -0
- package/button/Button.js +11 -13
- package/button/Button.stories.tsx +58 -1
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +16 -15
- package/checkbox/Checkbox.stories.tsx +79 -59
- package/checkbox/types.d.ts +4 -0
- package/chip/Chip.js +11 -23
- package/chip/Chip.stories.tsx +41 -9
- package/common/variables.js +130 -126
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +246 -0
- package/date-input/DateInput.js +134 -237
- package/date-input/DateInput.stories.tsx +137 -38
- package/date-input/DateInput.test.js +494 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +132 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +116 -0
- package/date-input/types.d.ts +51 -0
- package/dialog/types.d.ts +1 -0
- package/dropdown/Dropdown.js +38 -37
- package/dropdown/Dropdown.stories.tsx +175 -94
- package/dropdown/Dropdown.test.js +18 -24
- package/dropdown/DropdownMenu.js +8 -18
- package/dropdown/DropdownMenuItem.js +4 -15
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +53 -12
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +38 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +31 -19
- package/flex/types.d.ts +14 -3
- package/footer/types.d.ts +1 -0
- package/header/Header.js +18 -20
- package/header/Header.stories.tsx +34 -1
- package/header/types.d.ts +1 -0
- package/link/Link.js +1 -1
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +7 -12
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +6 -12
- package/paginator/Paginator.test.js +18 -11
- package/password-input/PasswordInput.test.js +13 -12
- package/quick-nav/QuickNav.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +97 -19
- package/radio-group/RadioGroup.js +9 -5
- package/radio-group/RadioGroup.test.js +116 -59
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -107
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +40 -63
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +5 -34
- package/select/Option.js +11 -24
- package/select/Select.js +46 -25
- package/select/Select.stories.tsx +209 -167
- package/select/Select.test.js +284 -231
- package/select/types.d.ts +2 -2
- package/sidenav/Sidenav.js +8 -10
- package/sidenav/Sidenav.stories.tsx +59 -50
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +15 -11
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +2 -2
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +5 -4
- package/switch/types.d.ts +6 -1
- package/table/Table.js +1 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +3 -5
- package/tabs/Tabs.js +3 -3
- package/tabs/Tabs.stories.tsx +7 -5
- package/tabs-nav/NavTabs.stories.tsx +8 -6
- package/tabs-nav/Tab.js +5 -7
- package/text-input/Suggestion.js +32 -5
- package/text-input/TextInput.js +172 -162
- package/text-input/TextInput.stories.tsx +24 -4
- package/text-input/TextInput.test.js +658 -647
- package/text-input/types.d.ts +5 -0
- package/common/RequiredComponent.js +0 -32
package/HalstackContext.js
CHANGED
|
@@ -85,7 +85,7 @@ var parseAdvancedTheme = function parseAdvancedTheme(advancedTheme) {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
var parseTheme = function parseTheme(theme) {
|
|
88
|
-
var _theme$accordion$font, _theme$accordion, _theme$accordion$font2, _theme$accordion2, _theme$accordion$acce, _theme$accordion3, _theme$accordion$acce2, _theme$accordion4, _theme$accordion$acce3, _theme$accordion5, _setOpacity, _theme$accordion6, _theme$button$primary, _theme$button, _theme$button$baseCol, _theme$button2, _theme$button$baseCol2, _theme$button3, _theme$button$seconda, _theme$button4, _theme$button$baseCol3, _theme$button5, _theme$button$baseCol4, _theme$button6, _theme$button$baseCol5, _theme$button7, _subLightness, _theme$button8, _subLightness2, _theme$button9, _subLightness3, _theme$button10, _addLightness, _theme$button11, _addLightness2, _theme$button12, _theme$checkbox$baseC, _theme$checkbox, _theme$checkbox$baseC2, _theme$checkbox2, _theme$checkbox$check, _theme$checkbox3, _theme$checkbox$fontC, _theme$checkbox4, _subLightness4, _theme$checkbox5, _subLightness5, _theme$checkbox6, _theme$chip$baseColor, _theme$chip, _theme$chip$fontColor, _theme$chip2, _theme$chip$fontColor2, _theme$chip3, _theme$dateInput$sele, _theme$dateInput, _theme$dateInput$sele2, _theme$dateInput2, _setOpacity2, _theme$dateInput3, _theme$dropdown$baseC, _theme$dropdown, _theme$dropdown$fontC, _theme$dropdown2, _theme$dropdown$optio, _theme$dropdown3, _theme$dropdown$optio2, _theme$dropdown4, _setOpacity3, _theme$dropdown5, _setOpacity4, _theme$dropdown6, _setOpacity5, _theme$dropdown7, _setOpacity6, _theme$dropdown8, _theme$dropdown$fontC2, _theme$dropdown9, _theme$dropdown$fontC3, _theme$dropdown10, _theme$fileInput$font, _theme$fileInput, _theme$fileInput$font2, _theme$fileInput2, _theme$fileInput$font3, _theme$fileInput3, _theme$fileInput$font4, _theme$fileInput4, _theme$footer$baseCol, _theme$footer, _theme$footer$fontCol, _theme$footer2, _theme$footer$fontCol2, _theme$footer3, _theme$footer$fontCol3, _theme$footer4, _theme$footer$accentC, _theme$footer5, _theme$footer$logo, _theme$footer6, _theme$header$baseCol, _theme$header, _theme$header$accentC, _theme$header2, _theme$header$menuBas, _theme$header3, _theme$header$fontCol, _theme$header4, _theme$header$hamburg, _theme$header5, _setOpacity7, _theme$header6, _theme$header$logo, _theme$header7, _theme$header$logoRes, _theme$header8, _theme$header$content, _theme$header9, _theme$paginator$base, _theme$paginator, _theme$paginator$font, _theme$paginator2, _theme$progressBar$ac, _theme$progressBar, _theme$progressBar$ba, _theme$progressBar2, _theme$progressBar$fo, _theme$progressBar3, _theme$progressBar$fo2, _theme$progressBar4, _theme$progressBar$fo3, _theme$progressBar5, _theme$quickNav$fontC, _theme$quickNav,
|
|
88
|
+
var _theme$accordion$font, _theme$accordion, _theme$accordion$font2, _theme$accordion2, _theme$accordion$acce, _theme$accordion3, _theme$accordion$acce2, _theme$accordion4, _theme$accordion$acce3, _theme$accordion5, _setOpacity, _theme$accordion6, _theme$button$primary, _theme$button, _theme$button$baseCol, _theme$button2, _theme$button$baseCol2, _theme$button3, _theme$button$seconda, _theme$button4, _theme$button$baseCol3, _theme$button5, _theme$button$baseCol4, _theme$button6, _theme$button$baseCol5, _theme$button7, _subLightness, _theme$button8, _subLightness2, _theme$button9, _subLightness3, _theme$button10, _addLightness, _theme$button11, _addLightness2, _theme$button12, _theme$checkbox$baseC, _theme$checkbox, _theme$checkbox$baseC2, _theme$checkbox2, _theme$checkbox$check, _theme$checkbox3, _theme$checkbox$fontC, _theme$checkbox4, _subLightness4, _theme$checkbox5, _subLightness5, _theme$checkbox6, _theme$chip$baseColor, _theme$chip, _theme$chip$fontColor, _theme$chip2, _theme$chip$fontColor2, _theme$chip3, _theme$dateInput$sele, _theme$dateInput, _theme$dateInput$sele2, _theme$dateInput2, _setOpacity2, _theme$dateInput3, _theme$dropdown$baseC, _theme$dropdown, _theme$dropdown$fontC, _theme$dropdown2, _theme$dropdown$optio, _theme$dropdown3, _theme$dropdown$optio2, _theme$dropdown4, _setOpacity3, _theme$dropdown5, _setOpacity4, _theme$dropdown6, _setOpacity5, _theme$dropdown7, _setOpacity6, _theme$dropdown8, _theme$dropdown$fontC2, _theme$dropdown9, _theme$dropdown$fontC3, _theme$dropdown10, _theme$fileInput$font, _theme$fileInput, _theme$fileInput$font2, _theme$fileInput2, _theme$fileInput$font3, _theme$fileInput3, _theme$fileInput$font4, _theme$fileInput4, _theme$footer$baseCol, _theme$footer, _theme$footer$fontCol, _theme$footer2, _theme$footer$fontCol2, _theme$footer3, _theme$footer$fontCol3, _theme$footer4, _theme$footer$accentC, _theme$footer5, _theme$footer$logo, _theme$footer6, _theme$header$baseCol, _theme$header, _theme$header$accentC, _theme$header2, _theme$header$menuBas, _theme$header3, _theme$header$fontCol, _theme$header4, _theme$header$hamburg, _theme$header5, _setOpacity7, _theme$header6, _theme$header$logo, _theme$header7, _theme$header$logoRes, _theme$header8, _theme$header$content, _theme$header9, _theme$paginator$base, _theme$paginator, _theme$paginator$font, _theme$paginator2, _theme$progressBar$ac, _theme$progressBar, _theme$progressBar$ba, _theme$progressBar2, _theme$progressBar$fo, _theme$progressBar3, _theme$progressBar$fo2, _theme$progressBar4, _theme$progressBar$fo3, _theme$progressBar5, _theme$quickNav$fontC, _theme$quickNav, _setOpacity8, _theme$quickNav2, _theme$radioGroup$bas, _theme$radioGroup, _theme$radioGroup$fon, _theme$radioGroup2, _theme$radioGroup$fon2, _theme$radioGroup3, _theme$radioGroup$fon3, _theme$radioGroup4, _theme$select$selecte, _theme$select, _theme$select$fontCol, _theme$select2, _theme$select$fontCol2, _theme$select3, _theme$select$fontCol3, _theme$select4, _theme$select$optionF, _theme$select5, _setOpacity9, _theme$select6, _theme$select$fontCol4, _theme$select7, _subLightness6, _theme$select8, _subLightness7, _theme$select9, _theme$sidenav$baseCo, _theme$sidenav, _theme$slider$fontCol, _theme$slider, _theme$slider$fontCol2, _theme$slider2, _theme$slider$fontCol3, _theme$slider3, _theme$slider$baseCol, _theme$slider4, _theme$slider$baseCol2, _theme$slider5, _theme$slider$baseCol3, _theme$slider6, _theme$slider$baseCol4, _theme$slider7, _subLightness8, _theme$slider8, _subLightness9, _theme$slider9, _setOpacity10, _theme$slider10, _theme$spinner$accent, _theme$spinner, _theme$spinner$baseCo, _theme$spinner2, _theme$spinner$fontCo, _theme$spinner3, _theme$spinner$fontCo2, _theme$spinner4, _theme$switch$checked, _theme$switch, _theme$switch$fontCol, _theme$switch2, _setOpacity11, _theme$switch3, _theme$table$baseColo, _theme$table, _theme$table$headerFo, _theme$table2, _theme$table$cellFont, _theme$table3, _theme$table$headerFo2, _theme$table4, _theme$tabs$baseColor, _theme$tabs, _theme$tabs$baseColor2, _theme$tabs2, _theme$tabs$baseColor3, _theme$tabs3, _theme$tabs$baseColor4, _theme$tabs4, _addLightness3, _theme$tabs5, _addLightness4, _theme$tabs6, _theme$textInput$font, _theme$textInput, _theme$textInput$font2, _theme$textInput2, _theme$textInput$font3, _theme$textInput3, _theme$textInput$font4, _theme$textInput4, _theme$textInput$font5, _theme$textInput5, _theme$textInput$font6, _theme$textInput6, _theme$textInput$font7, _theme$textInput7, _setOpacity12, _theme$textInput8, _setOpacity13, _theme$textInput9, _setOpacity14, _theme$textInput10, _theme$toggleGroup$se, _theme$toggleGroup, _theme$toggleGroup$se2, _theme$toggleGroup2, _theme$toggleGroup$un, _theme$toggleGroup3, _theme$toggleGroup$se3, _theme$toggleGroup4, _theme$toggleGroup$un2, _theme$toggleGroup5, _subLightness10, _theme$toggleGroup6, _subLightness11, _theme$toggleGroup7, _addLightness5, _theme$toggleGroup8, _addLightness6, _theme$toggleGroup9, _subLightness12, _theme$toggleGroup10, _theme$wizard$baseCol, _theme$wizard, _theme$wizard$selecte, _theme$wizard2, _theme$wizard$baseCol2, _theme$wizard3, _theme$wizard$fontCol, _theme$wizard4, _theme$wizard$fontCol2, _theme$wizard5, _theme$wizard$fontCol3, _theme$wizard6, _theme$wizard$fontCol4, _theme$wizard7, _setOpacity15, _theme$wizard8, _setOpacity16, _theme$wizard9, _setOpacity17, _theme$wizard10, _setOpacity18, _theme$wizard11;
|
|
89
89
|
|
|
90
90
|
var componentTokensCopy = JSON.parse(JSON.stringify(_variables.componentTokens));
|
|
91
91
|
var accordionTokens = componentTokensCopy.accordion;
|
|
@@ -167,8 +167,7 @@ var parseTheme = function parseTheme(theme) {
|
|
|
167
167
|
progressBarTokens.helperTextFontColor = (_theme$progressBar$fo3 = theme === null || theme === void 0 ? void 0 : (_theme$progressBar5 = theme.progressBar) === null || _theme$progressBar5 === void 0 ? void 0 : _theme$progressBar5.fontColor) !== null && _theme$progressBar$fo3 !== void 0 ? _theme$progressBar$fo3 : progressBarTokens.helperTextFontColor;
|
|
168
168
|
var quickNavTokens = componentTokensCopy.quickNav;
|
|
169
169
|
quickNavTokens.fontColor = (_theme$quickNav$fontC = theme === null || theme === void 0 ? void 0 : (_theme$quickNav = theme.quickNav) === null || _theme$quickNav === void 0 ? void 0 : _theme$quickNav.fontColor) !== null && _theme$quickNav$fontC !== void 0 ? _theme$quickNav$fontC : quickNavTokens.fontColor;
|
|
170
|
-
quickNavTokens.
|
|
171
|
-
quickNavTokens.hoverFontColor = (_setOpacity8 = setOpacity(theme === null || theme === void 0 ? void 0 : (_theme$quickNav3 = theme.quickNav) === null || _theme$quickNav3 === void 0 ? void 0 : _theme$quickNav3.accentColor, 0.7)) !== null && _setOpacity8 !== void 0 ? _setOpacity8 : quickNavTokens.hoverFontColor;
|
|
170
|
+
quickNavTokens.hoverFontColor = (_setOpacity8 = setOpacity(theme === null || theme === void 0 ? void 0 : (_theme$quickNav2 = theme.quickNav) === null || _theme$quickNav2 === void 0 ? void 0 : _theme$quickNav2.accentColor, 0.7)) !== null && _setOpacity8 !== void 0 ? _setOpacity8 : quickNavTokens.hoverFontColor;
|
|
172
171
|
var radioGroupTokens = componentTokensCopy.radioGroup;
|
|
173
172
|
radioGroupTokens.radioInputColor = (_theme$radioGroup$bas = theme === null || theme === void 0 ? void 0 : (_theme$radioGroup = theme.radioGroup) === null || _theme$radioGroup === void 0 ? void 0 : _theme$radioGroup.baseColor) !== null && _theme$radioGroup$bas !== void 0 ? _theme$radioGroup$bas : radioGroupTokens.radioInputColor;
|
|
174
173
|
radioGroupTokens.labelFontColor = (_theme$radioGroup$fon = theme === null || theme === void 0 ? void 0 : (_theme$radioGroup2 = theme.radioGroup) === null || _theme$radioGroup2 === void 0 ? void 0 : _theme$radioGroup2.fontColor) !== null && _theme$radioGroup$fon !== void 0 ? _theme$radioGroup$fon : radioGroupTokens.labelFontColor;
|
|
@@ -242,12 +241,12 @@ var parseTheme = function parseTheme(theme) {
|
|
|
242
241
|
toggleGroupTokens.unselectedHoverBackgroundColor = (_subLightness12 = subLightness(theme === null || theme === void 0 ? void 0 : (_theme$toggleGroup10 = theme.toggleGroup) === null || _theme$toggleGroup10 === void 0 ? void 0 : _theme$toggleGroup10.unselectedBaseColor, 8)) !== null && _subLightness12 !== void 0 ? _subLightness12 : toggleGroupTokens.unselectedHoverBackgroundColor;
|
|
243
242
|
var wizardTokens = componentTokensCopy.wizard;
|
|
244
243
|
wizardTokens.selectedStepBackgroundColor = (_theme$wizard$baseCol = theme === null || theme === void 0 ? void 0 : (_theme$wizard = theme.wizard) === null || _theme$wizard === void 0 ? void 0 : _theme$wizard.baseColor) !== null && _theme$wizard$baseCol !== void 0 ? _theme$wizard$baseCol : wizardTokens.selectedStepBackgroundColor;
|
|
245
|
-
wizardTokens.selectedStepFontColor = (_theme$wizard$
|
|
244
|
+
wizardTokens.selectedStepFontColor = (_theme$wizard$selecte = theme === null || theme === void 0 ? void 0 : (_theme$wizard2 = theme.wizard) === null || _theme$wizard2 === void 0 ? void 0 : _theme$wizard2.selectedFontColor) !== null && _theme$wizard$selecte !== void 0 ? _theme$wizard$selecte : wizardTokens.selectedStepFontColor;
|
|
246
245
|
wizardTokens.selectedStepBorderColor = (_theme$wizard$baseCol2 = theme === null || theme === void 0 ? void 0 : (_theme$wizard3 = theme.wizard) === null || _theme$wizard3 === void 0 ? void 0 : _theme$wizard3.baseColor) !== null && _theme$wizard$baseCol2 !== void 0 ? _theme$wizard$baseCol2 : wizardTokens.selectedStepBorderColor;
|
|
247
|
-
wizardTokens.visitedLabelFontColor = (_theme$wizard$
|
|
248
|
-
wizardTokens.selectedLabelFontColor = (_theme$wizard$
|
|
249
|
-
wizardTokens.visitedHelperTextFontColor = (_theme$wizard$
|
|
250
|
-
wizardTokens.selectedHelperTextFontColor = (_theme$wizard$
|
|
246
|
+
wizardTokens.visitedLabelFontColor = (_theme$wizard$fontCol = theme === null || theme === void 0 ? void 0 : (_theme$wizard4 = theme.wizard) === null || _theme$wizard4 === void 0 ? void 0 : _theme$wizard4.fontColor) !== null && _theme$wizard$fontCol !== void 0 ? _theme$wizard$fontCol : wizardTokens.visitedLabelFontColor;
|
|
247
|
+
wizardTokens.selectedLabelFontColor = (_theme$wizard$fontCol2 = theme === null || theme === void 0 ? void 0 : (_theme$wizard5 = theme.wizard) === null || _theme$wizard5 === void 0 ? void 0 : _theme$wizard5.fontColor) !== null && _theme$wizard$fontCol2 !== void 0 ? _theme$wizard$fontCol2 : wizardTokens.selectedLabelFontColor;
|
|
248
|
+
wizardTokens.visitedHelperTextFontColor = (_theme$wizard$fontCol3 = theme === null || theme === void 0 ? void 0 : (_theme$wizard6 = theme.wizard) === null || _theme$wizard6 === void 0 ? void 0 : _theme$wizard6.fontColor) !== null && _theme$wizard$fontCol3 !== void 0 ? _theme$wizard$fontCol3 : wizardTokens.visitedHelperTextFontColor;
|
|
249
|
+
wizardTokens.selectedHelperTextFontColor = (_theme$wizard$fontCol4 = theme === null || theme === void 0 ? void 0 : (_theme$wizard7 = theme.wizard) === null || _theme$wizard7 === void 0 ? void 0 : _theme$wizard7.fontColor) !== null && _theme$wizard$fontCol4 !== void 0 ? _theme$wizard$fontCol4 : wizardTokens.selectedHelperTextFontColor;
|
|
251
250
|
wizardTokens.unvisitedStepBorderColor = (_setOpacity15 = setOpacity(theme === null || theme === void 0 ? void 0 : (_theme$wizard8 = theme.wizard) === null || _theme$wizard8 === void 0 ? void 0 : _theme$wizard8.fontColor, 0.6)) !== null && _setOpacity15 !== void 0 ? _setOpacity15 : wizardTokens.unvisitedStepBorderColor;
|
|
252
251
|
wizardTokens.unvisitedStepFontColor = (_setOpacity16 = setOpacity(theme === null || theme === void 0 ? void 0 : (_theme$wizard9 = theme.wizard) === null || _theme$wizard9 === void 0 ? void 0 : _theme$wizard9.fontColor, 0.6)) !== null && _setOpacity16 !== void 0 ? _setOpacity16 : wizardTokens.unvisitedStepFontColor;
|
|
253
252
|
wizardTokens.unvisitedLabelFontColor = (_setOpacity17 = setOpacity(theme === null || theme === void 0 ? void 0 : (_theme$wizard10 = theme.wizard) === null || _theme$wizard10 === void 0 ? void 0 : _theme$wizard10.fontColor, 0.6)) !== null && _setOpacity17 !== void 0 ? _setOpacity17 : wizardTokens.unvisitedLabelFontColor;
|
package/accordion/Accordion.js
CHANGED
|
@@ -31,7 +31,7 @@ var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
|
31
31
|
|
|
32
32
|
var _uuid = require("uuid");
|
|
33
33
|
|
|
34
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
35
35
|
|
|
36
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
37
|
|
|
@@ -110,7 +110,7 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
110
110
|
disabled: disabled
|
|
111
111
|
}, /*#__PURE__*/_react["default"].createElement(AccordionLabel, null, icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
112
112
|
disabled: disabled
|
|
113
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(
|
|
113
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
114
114
|
src: icon
|
|
115
115
|
}) : icon), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
116
116
|
color: disabled ? colorsTheme.accordion.disabledTitleLabelFontColor : colorsTheme.accordion.titleLabelFontColor,
|
|
@@ -195,25 +195,19 @@ var AccordionLabel = _styledComponents["default"].span(_templateObject5 || (_tem
|
|
|
195
195
|
return props.theme.titleLabelPaddingLeft;
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
var IconContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n
|
|
199
|
-
return props.theme.iconSize;
|
|
200
|
-
}, function (props) {
|
|
201
|
-
return props.theme.iconSize;
|
|
202
|
-
}, function (props) {
|
|
198
|
+
var IconContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-left: ", ";\n margin-right: ", ";\n color: ", ";\n\n svg,\n img {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
|
|
203
199
|
return props.theme.iconMarginLeft;
|
|
204
200
|
}, function (props) {
|
|
205
201
|
return props.theme.iconMarginRigth;
|
|
206
202
|
}, function (props) {
|
|
207
203
|
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
var IconImg = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n"])), function (props) {
|
|
204
|
+
}, function (props) {
|
|
211
205
|
return props.theme.iconSize;
|
|
212
206
|
}, function (props) {
|
|
213
207
|
return props.theme.iconSize;
|
|
214
208
|
});
|
|
215
209
|
|
|
216
|
-
var AccordionAssistiveText = _styledComponents["default"].span(
|
|
210
|
+
var AccordionAssistiveText = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n min-width: ", ";\n padding-left: ", ";\n padding-right: ", ";\n"])), function (props) {
|
|
217
211
|
return props.theme.assistiveTextMinWidth;
|
|
218
212
|
}, function (props) {
|
|
219
213
|
return props.theme.assistiveTextPaddingLeft;
|
|
@@ -221,11 +215,11 @@ var AccordionAssistiveText = _styledComponents["default"].span(_templateObject8
|
|
|
221
215
|
return props.theme.assistiveTextPaddingRight;
|
|
222
216
|
});
|
|
223
217
|
|
|
224
|
-
var CollapseIndicator = _styledComponents["default"].span(
|
|
218
|
+
var CollapseIndicator = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n color: ", ";\n"])), function (props) {
|
|
225
219
|
return props.disabled ? props.theme.disabledArrowColor : props.theme.arrowColor;
|
|
226
220
|
});
|
|
227
221
|
|
|
228
|
-
var AccordionPanel = _styledComponents["default"].div(
|
|
222
|
+
var AccordionPanel = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (props) {
|
|
229
223
|
return props.theme.borderRadius;
|
|
230
224
|
}, function (props) {
|
|
231
225
|
return props.theme.borderRadius;
|
|
@@ -30,10 +30,33 @@ const folderIcon = (
|
|
|
30
30
|
</svg>
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
35
|
-
<path d="
|
|
36
|
-
|
|
33
|
+
const smallIcon = (
|
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20">
|
|
35
|
+
<path d="m7.646 18.333-.313-2.625q-.208-.125-.458-.27-.25-.146-.458-.271l-2.438 1.021-2.354-4.063 2.083-1.583V9.458L1.625 7.875l2.354-4.063 2.438 1.021q.208-.125.458-.27.25-.146.458-.271l.313-2.625h4.708l.313 2.625q.208.125.458.271.25.145.458.27l2.438-1.021 2.354 4.063-2.063 1.583v1.084l2.063 1.583-2.354 4.063-2.438-1.021q-.208.125-.458.271-.25.145-.458.27l-.313 2.625ZM10 12.979q1.229 0 2.104-.875T12.979 10q0-1.229-.875-2.104T10 7.021q-1.229 0-2.104.875T7.021 10q0 1.229.875 2.104t2.104.875Zm0-1.75q-.5 0-.865-.364-.364-.365-.364-.865t.364-.865q.365-.364.865-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.166q.605-.167 1.167-.5.562-.334 1.021-.792l2.021.854.833-1.375-1.771-1.354q.104-.292.146-.604.042-.313.042-.646 0-.292-.042-.594t-.125-.635l1.771-1.375-.834-1.375-2.02.875q-.48-.479-1.032-.802-.552-.323-1.156-.49l-.271-2.187H9.167l-.271 2.187q-.604.167-1.156.49-.552.323-1.011.781l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.459.458 1.011.781.552.323 1.156.49Z" />
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const facebookIcon = (
|
|
40
|
+
<svg
|
|
41
|
+
version="1.1"
|
|
42
|
+
id="Capa_1"
|
|
43
|
+
x="0px"
|
|
44
|
+
y="0px"
|
|
45
|
+
width="438.536px"
|
|
46
|
+
height="438.536px"
|
|
47
|
+
viewBox="0 0 438.536 438.536"
|
|
48
|
+
fill="currentColor"
|
|
49
|
+
>
|
|
50
|
+
<g>
|
|
51
|
+
<path
|
|
52
|
+
d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
|
|
53
|
+
C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
|
|
54
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
55
|
+
C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
|
|
56
|
+
c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
|
|
57
|
+
c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
|
|
58
|
+
/>
|
|
59
|
+
</g>
|
|
37
60
|
</svg>
|
|
38
61
|
);
|
|
39
62
|
|
|
@@ -78,8 +101,30 @@ export const Chromatic = () => (
|
|
|
78
101
|
</DxcAccordion>
|
|
79
102
|
</ExampleContainer>
|
|
80
103
|
<ExampleContainer>
|
|
81
|
-
<Title title="With
|
|
82
|
-
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon={
|
|
104
|
+
<Title title="With smaller icon" theme="light" level={4} />
|
|
105
|
+
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon={smallIcon}>
|
|
106
|
+
<div>
|
|
107
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
108
|
+
lobortis eget.
|
|
109
|
+
</div>
|
|
110
|
+
</DxcAccordion>
|
|
111
|
+
</ExampleContainer>
|
|
112
|
+
<ExampleContainer>
|
|
113
|
+
<Title title="With bigger icon (SVG)" theme="light" level={4} />
|
|
114
|
+
<DxcAccordion label="Accordion" assistiveText="Assistive text" icon={facebookIcon}>
|
|
115
|
+
<div>
|
|
116
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
117
|
+
lobortis eget.
|
|
118
|
+
</div>
|
|
119
|
+
</DxcAccordion>
|
|
120
|
+
</ExampleContainer>
|
|
121
|
+
<ExampleContainer>
|
|
122
|
+
<Title title="With bigger icon (image)" theme="light" level={4} />
|
|
123
|
+
<DxcAccordion
|
|
124
|
+
label="Accordion"
|
|
125
|
+
assistiveText="Assistive text"
|
|
126
|
+
icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
|
|
127
|
+
>
|
|
83
128
|
<div>
|
|
84
129
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
|
|
85
130
|
lobortis eget.
|
|
@@ -134,12 +179,7 @@ export const Chromatic = () => (
|
|
|
134
179
|
padding="medium"
|
|
135
180
|
>
|
|
136
181
|
<div style={{ display: "flex", flexDirection: "column", gap: "36px" }}>
|
|
137
|
-
<DxcTextInput
|
|
138
|
-
label="Label"
|
|
139
|
-
helperText="HelperText"
|
|
140
|
-
placeholder="Placeholder"
|
|
141
|
-
size="fillParent"
|
|
142
|
-
/>
|
|
182
|
+
<DxcTextInput label="Label" helperText="HelperText" placeholder="Placeholder" size="fillParent" />
|
|
143
183
|
<DxcButton label="Submit" size="medium" />
|
|
144
184
|
</div>
|
|
145
185
|
</DxcAccordion>
|
package/accordion/types.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare type Props = {
|
|
|
56
56
|
*/
|
|
57
57
|
margin?: Space | Margin;
|
|
58
58
|
/**
|
|
59
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
59
60
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
60
61
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
61
62
|
*/
|
|
@@ -31,6 +31,7 @@ export declare type AccordionPropsType = {
|
|
|
31
31
|
*/
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/box/types.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare type Props = {
|
|
|
31
31
|
*/
|
|
32
32
|
margin?: Space | Margin;
|
|
33
33
|
/**
|
|
34
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
34
35
|
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
36
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
37
|
*/
|
package/button/Button.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
25
25
|
|
|
26
26
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
27
27
|
|
|
28
|
-
var _templateObject, _templateObject2, _templateObject3
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -69,12 +69,6 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
69
69
|
|
|
70
70
|
var colorsTheme = (0, _useTheme["default"])();
|
|
71
71
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
72
|
-
|
|
73
|
-
var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
74
|
-
icon: icon,
|
|
75
|
-
iconPosition: iconPosition
|
|
76
|
-
}, label);
|
|
77
|
-
|
|
78
72
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
79
73
|
theme: colorsTheme.button
|
|
80
74
|
}, /*#__PURE__*/_react["default"].createElement(Button, {
|
|
@@ -89,12 +83,18 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
89
83
|
onClick: function onClick() {
|
|
90
84
|
_onClick();
|
|
91
85
|
}
|
|
92
|
-
}, label && iconPosition === "after" &&
|
|
86
|
+
}, label && iconPosition === "after" && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
87
|
+
icon: icon,
|
|
88
|
+
iconPosition: iconPosition
|
|
89
|
+
}, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
93
90
|
label: label,
|
|
94
91
|
iconPosition: iconPosition
|
|
95
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(
|
|
92
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
96
93
|
src: icon
|
|
97
|
-
}) : icon), label && iconPosition === "before" &&
|
|
94
|
+
}) : icon), label && iconPosition === "before" && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
95
|
+
icon: icon,
|
|
96
|
+
iconPosition: iconPosition
|
|
97
|
+
}, label)));
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
var Button = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-flex;\n width: ", ";\n height: 40px;\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n align-items: center;\n justify-content: center;\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n cursor: pointer;\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px\n ", ";\n }\n ", "\n"])), function (props) {
|
|
@@ -144,13 +144,11 @@ var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_tem
|
|
|
144
144
|
return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
var IconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
147
|
+
var IconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-left: ", ";\n margin-right: ", ";\n\n img,\n svg {\n height: 24px;\n width: 24px;\n }\n"])), function (props) {
|
|
148
148
|
return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
|
|
149
149
|
}, function (props) {
|
|
150
150
|
return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
var ButtonIcon = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])));
|
|
154
|
-
|
|
155
153
|
var _default = DxcButton;
|
|
156
154
|
exports["default"] = _default;
|
|
@@ -12,11 +12,42 @@ export default {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const iconSVG = (
|
|
15
|
-
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
15
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="currentColor">
|
|
16
16
|
<path d="M0 0h24v24H0z" fill="none" />
|
|
17
17
|
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
|
|
18
18
|
</svg>
|
|
19
19
|
);
|
|
20
|
+
|
|
21
|
+
const facebookIcon = (
|
|
22
|
+
<svg
|
|
23
|
+
version="1.1"
|
|
24
|
+
id="Capa_1"
|
|
25
|
+
x="0px"
|
|
26
|
+
y="0px"
|
|
27
|
+
width="438.536px"
|
|
28
|
+
height="438.536px"
|
|
29
|
+
viewBox="0 0 438.536 438.536"
|
|
30
|
+
fill="currentColor"
|
|
31
|
+
>
|
|
32
|
+
<g>
|
|
33
|
+
<path
|
|
34
|
+
d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
|
|
35
|
+
C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
|
|
36
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
37
|
+
C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
|
|
38
|
+
c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
|
|
39
|
+
c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
|
|
40
|
+
/>
|
|
41
|
+
</g>
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const smallIcon = (
|
|
46
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20" fill="currentColor">
|
|
47
|
+
<path d="m7.646 18.333-.313-2.625q-.208-.125-.458-.27-.25-.146-.458-.271l-2.438 1.021-2.354-4.063 2.083-1.583V9.458L1.625 7.875l2.354-4.063 2.438 1.021q.208-.125.458-.27.25-.146.458-.271l.313-2.625h4.708l.313 2.625q.208.125.458.271.25.145.458.27l2.438-1.021 2.354 4.063-2.063 1.583v1.084l2.063 1.583-2.354 4.063-2.438-1.021q-.208.125-.458.271-.25.145-.458.27l-.313 2.625ZM10 12.979q1.229 0 2.104-.875T12.979 10q0-1.229-.875-2.104T10 7.021q-1.229 0-2.104.875T7.021 10q0 1.229.875 2.104t2.104.875Zm0-1.75q-.5 0-.865-.364-.364-.365-.364-.865t.364-.865q.365-.364.865-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.166q.605-.167 1.167-.5.562-.334 1.021-.792l2.021.854.833-1.375-1.771-1.354q.104-.292.146-.604.042-.313.042-.646 0-.292-.042-.594t-.125-.635l1.771-1.375-.834-1.375-2.02.875q-.48-.479-1.032-.802-.552-.323-1.156-.49l-.271-2.187H9.167l-.271 2.187q-.604.167-1.156.49-.552.323-1.011.781l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.459.458 1.011.781.552.323 1.156.49Z" />
|
|
48
|
+
</svg>
|
|
49
|
+
);
|
|
50
|
+
|
|
20
51
|
export const Chromatic = () => (
|
|
21
52
|
<>
|
|
22
53
|
<Title title="Primary" theme="light" level={2} />
|
|
@@ -52,6 +83,18 @@ export const Chromatic = () => (
|
|
|
52
83
|
<Title title="Only icon" theme="light" level={4} />
|
|
53
84
|
<DxcButton icon={iconSVG} />
|
|
54
85
|
</ExampleContainer>
|
|
86
|
+
<ExampleContainer>
|
|
87
|
+
<Title title="Big icon (SVG)" theme="light" level={4} />
|
|
88
|
+
<DxcButton icon={facebookIcon} />
|
|
89
|
+
</ExampleContainer>
|
|
90
|
+
<ExampleContainer>
|
|
91
|
+
<Title title="Big icon (image)" theme="light" level={4} />
|
|
92
|
+
<DxcButton icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png" />
|
|
93
|
+
</ExampleContainer>
|
|
94
|
+
<ExampleContainer>
|
|
95
|
+
<Title title="Small icon" theme="light" level={4} />
|
|
96
|
+
<DxcButton icon={smallIcon} />
|
|
97
|
+
</ExampleContainer>
|
|
55
98
|
<Title title="Secondary" theme="light" level={2} />
|
|
56
99
|
<ExampleContainer>
|
|
57
100
|
<Title title="Enabled" theme="light" level={4} />
|
|
@@ -77,6 +120,13 @@ export const Chromatic = () => (
|
|
|
77
120
|
<Title title="With icon" theme="light" level={4} />
|
|
78
121
|
<DxcButton mode="secondary" label="Secondary" icon={iconSVG} />
|
|
79
122
|
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Only icon (image)" theme="light" level={4} />
|
|
125
|
+
<DxcButton
|
|
126
|
+
mode="secondary"
|
|
127
|
+
icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
|
|
128
|
+
/>
|
|
129
|
+
</ExampleContainer>
|
|
80
130
|
<Title title="Text" theme="light" level={2} />
|
|
81
131
|
<ExampleContainer>
|
|
82
132
|
<Title title="Enabled" theme="light" level={4} />
|
|
@@ -102,6 +152,13 @@ export const Chromatic = () => (
|
|
|
102
152
|
<Title title="With icon" theme="light" level={4} />
|
|
103
153
|
<DxcButton label="Text" mode="text" icon={iconSVG} />
|
|
104
154
|
</ExampleContainer>
|
|
155
|
+
<ExampleContainer>
|
|
156
|
+
<Title title="Only icon (image)" theme="light" level={4} />
|
|
157
|
+
<DxcButton
|
|
158
|
+
mode="text"
|
|
159
|
+
icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
|
|
160
|
+
/>
|
|
161
|
+
</ExampleContainer>
|
|
105
162
|
<BackgroundColorProvider color="#333333">
|
|
106
163
|
<DarkContainer>
|
|
107
164
|
<Title title="Primary" theme="dark" level={2} />
|
package/card/types.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ declare type Props = {
|
|
|
47
47
|
*/
|
|
48
48
|
margin?: Space | Size;
|
|
49
49
|
/**
|
|
50
|
+
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
50
51
|
* Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
51
52
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
52
53
|
*/
|
package/checkbox/Checkbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import CheckboxPropsType from "./types";
|
|
3
|
-
declare const DxcCheckbox:
|
|
3
|
+
declare const DxcCheckbox: React.ForwardRefExoticComponent<CheckboxPropsType & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default DxcCheckbox;
|
package/checkbox/Checkbox.js
CHANGED
|
@@ -46,7 +46,7 @@ var checkedIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
|
46
46
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
47
47
|
}));
|
|
48
48
|
|
|
49
|
-
var DxcCheckbox = function
|
|
49
|
+
var DxcCheckbox = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
50
50
|
var checked = _ref.checked,
|
|
51
51
|
_ref$defaultChecked = _ref.defaultChecked,
|
|
52
52
|
defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
|
|
@@ -109,7 +109,8 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
109
109
|
margin: margin,
|
|
110
110
|
size: size,
|
|
111
111
|
checked: checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
112
|
-
backgroundType: backgroundType
|
|
112
|
+
backgroundType: backgroundType,
|
|
113
|
+
ref: ref
|
|
113
114
|
}, label && labelPosition === "before" && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
114
115
|
id: labelId,
|
|
115
116
|
disabled: disabled,
|
|
@@ -139,7 +140,7 @@ var DxcCheckbox = function DxcCheckbox(_ref) {
|
|
|
139
140
|
disabled: disabled,
|
|
140
141
|
backgroundType: backgroundType
|
|
141
142
|
}, optional && "".concat(translatedLabels.formFields.optionalLabel, " "), label)));
|
|
142
|
-
};
|
|
143
|
+
});
|
|
143
144
|
|
|
144
145
|
var sizes = {
|
|
145
146
|
small: "120px",
|
|
@@ -173,7 +174,7 @@ var getDisabledColor = function getDisabledColor(props, element) {
|
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
|
|
176
|
-
var
|
|
177
|
+
var getEnabledColor = function getEnabledColor(props, element) {
|
|
177
178
|
switch (element) {
|
|
178
179
|
case "check":
|
|
179
180
|
return props.backgroundType && props.backgroundType === "dark" ? props.theme.checkColorOnDark : props.theme.checkColor;
|
|
@@ -196,7 +197,7 @@ var getNotDisabledColor = function getNotDisabledColor(props, element) {
|
|
|
196
197
|
};
|
|
197
198
|
|
|
198
199
|
var LabelContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
199
|
-
return props.disabled ? getDisabledColor(props, "label") :
|
|
200
|
+
return props.disabled ? getDisabledColor(props, "label") : getEnabledColor(props, "label");
|
|
200
201
|
}, function (props) {
|
|
201
202
|
return props.theme.fontFamily;
|
|
202
203
|
}, function (props) {
|
|
@@ -209,19 +210,21 @@ var ValueInput = _styledComponents["default"].input(_templateObject2 || (_templa
|
|
|
209
210
|
|
|
210
211
|
var CheckboxContainer = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n"])));
|
|
211
212
|
|
|
212
|
-
var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 18px;\n width: 18px;\n border: solid
|
|
213
|
-
return props.disabled ? getDisabledColor(props, "border") :
|
|
213
|
+
var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 18px;\n width: 18px;\n border: 2px solid\n ", ";\n border-radius: 2px;\n background-color: ", ";\n color: ", ";\n\n &:focus {\n outline: 2px solid\n ", ";\n outline-offset: 2px;\n }\n svg {\n position: absolute;\n width: 22px;\n height: 22px;\n }\n ", "\n"])), function (props) {
|
|
214
|
+
return props.disabled ? getDisabledColor(props, "border") : getEnabledColor(props, "border");
|
|
214
215
|
}, function (props) {
|
|
215
|
-
return props.checked ? props.disabled ? getDisabledColor(props, "check") :
|
|
216
|
+
return props.checked ? props.disabled ? getDisabledColor(props, "check") : getEnabledColor(props, "check") : "transparent";
|
|
216
217
|
}, function (props) {
|
|
217
|
-
return props.disabled ? getDisabledColor(props, "background") :
|
|
218
|
+
return props.disabled ? getDisabledColor(props, "background") : getEnabledColor(props, "background");
|
|
218
219
|
}, function (props) {
|
|
219
220
|
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
220
221
|
}, function (props) {
|
|
221
222
|
return props.disabled && "pointer-events: none;";
|
|
222
223
|
});
|
|
223
224
|
|
|
224
|
-
var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n
|
|
225
|
+
var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n cursor: ", ";\n\n &:hover ", " {\n border: 2px solid\n ", ";\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
226
|
+
return props.theme.checkLabelSpacing;
|
|
227
|
+
}, function (props) {
|
|
225
228
|
return calculateWidth(props.margin, props.size);
|
|
226
229
|
}, function (props) {
|
|
227
230
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -235,14 +238,12 @@ var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templ
|
|
|
235
238
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
236
239
|
}, function (props) {
|
|
237
240
|
return props.disabled ? "not-allowed" : "pointer";
|
|
238
|
-
}, function (props) {
|
|
239
|
-
return props.theme.checkLabelSpacing;
|
|
240
241
|
}, Checkbox, function (props) {
|
|
241
|
-
return props.disabled ? getDisabledColor(props, "border") :
|
|
242
|
+
return props.disabled ? getDisabledColor(props, "border") : getEnabledColor(props, "hoverBorder");
|
|
242
243
|
}, function (props) {
|
|
243
|
-
return props.checked ? props.disabled ? getDisabledColor(props, "check") :
|
|
244
|
+
return props.checked ? props.disabled ? getDisabledColor(props, "check") : getEnabledColor(props, "check") : "transparent";
|
|
244
245
|
}, function (props) {
|
|
245
|
-
return props.disabled ? getDisabledColor(props, "background") :
|
|
246
|
+
return props.disabled ? getDisabledColor(props, "background") : getEnabledColor(props, "hoverBackground");
|
|
246
247
|
});
|
|
247
248
|
|
|
248
249
|
var _default = DxcCheckbox;
|