@dxc-technology/halstack-react 7.0.0 → 8.0.0
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/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/common/variables.js +14 -10
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +77 -222
- package/date-input/DateInput.stories.tsx +30 -17
- package/date-input/DateInput.test.js +411 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +53 -0
- package/dropdown/Dropdown.js +32 -29
- package/dropdown/Dropdown.test.js +17 -22
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +166 -216
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +12 -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/link/Link.js +1 -1
- package/number-input/NumberInput.test.js +5 -6
- package/package.json +7 -12
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -105
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +23 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Select.stories.tsx +2 -5
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +5 -4
- package/slider/types.d.ts +4 -0
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +4 -3
- package/switch/types.d.ts +6 -1
- package/table/Table.test.js +1 -1
- package/text-input/TextInput.test.js +469 -616
- 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/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;
|
|
@@ -4,7 +4,7 @@ import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
6
|
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
|
-
import
|
|
7
|
+
import styled from "styled-components";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Checkbox",
|
|
@@ -17,29 +17,33 @@ const Checkbox = () => (
|
|
|
17
17
|
<Title title="Default" theme="light" level={4} />
|
|
18
18
|
<DxcCheckbox label="Checkbox" />
|
|
19
19
|
</ExampleContainer>
|
|
20
|
-
<ExampleContainer>
|
|
21
|
-
<Title title="Focused" theme="light" level={4} />
|
|
22
|
-
<DxcCheckbox label="Focused" />
|
|
23
|
-
</ExampleContainer>
|
|
24
20
|
<ExampleContainer>
|
|
25
21
|
<Title title="Checked" theme="light" level={4} />
|
|
26
22
|
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
27
23
|
</ExampleContainer>
|
|
28
24
|
<ExampleContainer>
|
|
29
|
-
<Title title="
|
|
30
|
-
<DxcCheckbox label="Checkbox"
|
|
25
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
26
|
+
<DxcCheckbox label="Checkbox" disabled />
|
|
31
27
|
</ExampleContainer>
|
|
32
28
|
<ExampleContainer>
|
|
33
|
-
<Title title="Disabled and
|
|
34
|
-
<DxcCheckbox label="Checkbox" disabled defaultChecked />
|
|
29
|
+
<Title title="Disabled, checked and optional" theme="light" level={4} />
|
|
30
|
+
<DxcCheckbox label="Checkbox" disabled defaultChecked optional />
|
|
35
31
|
</ExampleContainer>
|
|
36
|
-
<ExampleContainer>
|
|
37
|
-
<Title title="
|
|
38
|
-
<DxcCheckbox label="
|
|
32
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
33
|
+
<Title title="Focused" theme="light" level={4} />
|
|
34
|
+
<DxcCheckbox label="Focused" />
|
|
35
|
+
</ExampleContainer>
|
|
36
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
37
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
38
|
+
<DxcCheckbox label="Hovered" />
|
|
39
|
+
</ExampleContainer>
|
|
40
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
41
|
+
<Title title="Hovered and checked" theme="light" level={4} />
|
|
42
|
+
<DxcCheckbox label="Hovered" defaultChecked />
|
|
39
43
|
</ExampleContainer>
|
|
40
44
|
<ExampleContainer>
|
|
41
|
-
<Title title="
|
|
42
|
-
<DxcCheckbox label="Checkbox"
|
|
45
|
+
<Title title="Optional" theme="light" level={4} />
|
|
46
|
+
<DxcCheckbox label="Checkbox" optional />
|
|
43
47
|
</ExampleContainer>
|
|
44
48
|
<ExampleContainer>
|
|
45
49
|
<Title title="Label after" theme="light" level={4} />
|
|
@@ -53,25 +57,9 @@ const Checkbox = () => (
|
|
|
53
57
|
<Title title="Optional with label after" theme="light" level={4} />
|
|
54
58
|
<DxcCheckbox label="Checkbox" optional labelPosition="after" />
|
|
55
59
|
</ExampleContainer>
|
|
56
|
-
<ExampleContainer>
|
|
57
|
-
<Title title="Disabled and checked with label after" theme="light" level={4} />
|
|
58
|
-
<DxcCheckbox label="Checkbox" disabled defaultChecked labelPosition="after" />
|
|
59
|
-
</ExampleContainer>
|
|
60
60
|
<ExampleContainer>
|
|
61
61
|
<Title title="Disabled and optional with label after" theme="light" level={4} />
|
|
62
|
-
<DxcCheckbox label="Checkbox" disabled
|
|
63
|
-
</ExampleContainer>
|
|
64
|
-
<ExampleContainer>
|
|
65
|
-
<Title title="Disabled, optional and checked with label after" theme="light" level={4} />
|
|
66
|
-
<DxcCheckbox label="Checkbox" disabled optional defaultChecked labelPosition="after" />
|
|
67
|
-
</ExampleContainer>
|
|
68
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
69
|
-
<Title title="Hovered" theme="light" level={4} />
|
|
70
|
-
<DxcCheckbox label="Hovered" />
|
|
71
|
-
</ExampleContainer>
|
|
72
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
73
|
-
<Title title="Hovered and checked" theme="light" level={4} />
|
|
74
|
-
<DxcCheckbox label="Hovered" defaultChecked />
|
|
62
|
+
<DxcCheckbox label="Checkbox" disabled labelPosition="after" optional />
|
|
75
63
|
</ExampleContainer>
|
|
76
64
|
<BackgroundColorProvider color="#333333">
|
|
77
65
|
<DarkContainer>
|
|
@@ -84,20 +72,28 @@ const Checkbox = () => (
|
|
|
84
72
|
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
85
73
|
</ExampleContainer>
|
|
86
74
|
<ExampleContainer>
|
|
87
|
-
<Title title="
|
|
88
|
-
<DxcCheckbox label="Checkbox"
|
|
75
|
+
<Title title="Disabled" theme="dark" level={4} />
|
|
76
|
+
<DxcCheckbox label="Checkbox" disabled />
|
|
89
77
|
</ExampleContainer>
|
|
90
78
|
<ExampleContainer>
|
|
91
|
-
<Title title="Disabled and
|
|
92
|
-
<DxcCheckbox label="Checkbox" disabled defaultChecked />
|
|
79
|
+
<Title title="Disabled, checked and optional" theme="dark" level={4} />
|
|
80
|
+
<DxcCheckbox label="Checkbox" disabled defaultChecked optional />
|
|
93
81
|
</ExampleContainer>
|
|
94
|
-
<ExampleContainer>
|
|
95
|
-
<Title title="
|
|
96
|
-
<DxcCheckbox label="
|
|
82
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
83
|
+
<Title title="Focused" theme="dark" level={4} />
|
|
84
|
+
<DxcCheckbox label="Focused" />
|
|
85
|
+
</ExampleContainer>
|
|
86
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
87
|
+
<Title title="Hovered" theme="dark" level={4} />
|
|
88
|
+
<DxcCheckbox label="Hovered" />
|
|
89
|
+
</ExampleContainer>
|
|
90
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
91
|
+
<Title title="Hovered and checked" theme="dark" level={4} />
|
|
92
|
+
<DxcCheckbox label="Hovered" defaultChecked />
|
|
97
93
|
</ExampleContainer>
|
|
98
94
|
<ExampleContainer>
|
|
99
|
-
<Title title="
|
|
100
|
-
<DxcCheckbox label="Checkbox"
|
|
95
|
+
<Title title="Optional" theme="dark" level={4} />
|
|
96
|
+
<DxcCheckbox label="Checkbox" optional />
|
|
101
97
|
</ExampleContainer>
|
|
102
98
|
<ExampleContainer>
|
|
103
99
|
<Title title="Label after" theme="dark" level={4} />
|
|
@@ -111,25 +107,9 @@ const Checkbox = () => (
|
|
|
111
107
|
<Title title="Optional with label after" theme="dark" level={4} />
|
|
112
108
|
<DxcCheckbox label="Checkbox" optional labelPosition="after" />
|
|
113
109
|
</ExampleContainer>
|
|
114
|
-
<ExampleContainer>
|
|
115
|
-
<Title title="Disabled and checked with label after" theme="dark" level={4} />
|
|
116
|
-
<DxcCheckbox label="Checkbox" disabled defaultChecked labelPosition="after" />
|
|
117
|
-
</ExampleContainer>
|
|
118
110
|
<ExampleContainer>
|
|
119
111
|
<Title title="Disabled and optional with label after" theme="dark" level={4} />
|
|
120
|
-
<DxcCheckbox label="Checkbox" disabled
|
|
121
|
-
</ExampleContainer>
|
|
122
|
-
<ExampleContainer>
|
|
123
|
-
<Title title="Disabled, optional and checked with label after" theme="dark" level={4} />
|
|
124
|
-
<DxcCheckbox label="Checkbox" disabled optional defaultChecked labelPosition="after" />
|
|
125
|
-
</ExampleContainer>
|
|
126
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
127
|
-
<Title title="Hovered" theme="dark" level={4} />
|
|
128
|
-
<DxcCheckbox label="Hovered" />
|
|
129
|
-
</ExampleContainer>
|
|
130
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
131
|
-
<Title title="Hovered and checked" theme="dark" level={4} />
|
|
132
|
-
<DxcCheckbox label="Hovered" defaultChecked />
|
|
112
|
+
<DxcCheckbox label="Checkbox" disabled labelPosition="after" optional />
|
|
133
113
|
</ExampleContainer>
|
|
134
114
|
</DarkContainer>
|
|
135
115
|
</BackgroundColorProvider>
|
|
@@ -178,11 +158,51 @@ const Checkbox = () => (
|
|
|
178
158
|
<Title title="Xxlarge" theme="light" level={4} />
|
|
179
159
|
<DxcCheckbox label="Xxlarge" margin="xxlarge" />
|
|
180
160
|
</ExampleContainer>
|
|
161
|
+
<ExampleContainer>
|
|
162
|
+
<Title title="Overflow container" theme="light" level={4} />
|
|
163
|
+
<ScrollableContainer id="scroll-container">
|
|
164
|
+
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
165
|
+
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
166
|
+
<DxcCheckbox label="Checkbox" />
|
|
167
|
+
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
168
|
+
<DxcCheckbox label="Checkbox" />
|
|
169
|
+
<DxcCheckbox label="Checkbox" />
|
|
170
|
+
<DxcCheckbox label="Checkbox" />
|
|
171
|
+
<DxcCheckbox label="Checkbox" defaultChecked />
|
|
172
|
+
</ScrollableContainer>
|
|
173
|
+
</ExampleContainer>
|
|
174
|
+
<ExampleContainer>
|
|
175
|
+
<Title title="Label overflow" theme="light" level={4} />
|
|
176
|
+
<SmallContainer>
|
|
177
|
+
<DxcCheckbox label="Very long label to check its overflowing" defaultChecked />
|
|
178
|
+
<DxcCheckbox label="Very long label to check its overflowing" labelPosition="after" />
|
|
179
|
+
</SmallContainer>
|
|
180
|
+
</ExampleContainer>
|
|
181
181
|
</>
|
|
182
182
|
);
|
|
183
183
|
|
|
184
184
|
export const Chromatic = Checkbox.bind({});
|
|
185
|
+
|
|
185
186
|
Chromatic.play = async () => {
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
const listEl = document.getElementById("scroll-container");
|
|
188
|
+
listEl?.scrollTo?.({ top: 50 });
|
|
188
189
|
};
|
|
190
|
+
|
|
191
|
+
const ScrollableContainer = styled.div`
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
gap: 14px;
|
|
195
|
+
width: 200px;
|
|
196
|
+
height: 200px;
|
|
197
|
+
border: 1px solid #000;
|
|
198
|
+
padding: 14px;
|
|
199
|
+
overflow: auto;
|
|
200
|
+
`;
|
|
201
|
+
|
|
202
|
+
const SmallContainer = styled.div`
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
gap: 14px;
|
|
206
|
+
width: 150px;
|
|
207
|
+
height: 150px;
|
|
208
|
+
`;
|
package/checkbox/types.d.ts
CHANGED
package/common/variables.js
CHANGED
|
@@ -408,7 +408,7 @@ var componentTokens = {
|
|
|
408
408
|
pickerHoverDateBackgroundColor: globalTokens.hal_purple_l_90,
|
|
409
409
|
pickerSelectedDateColor: globalTokens.hal_white,
|
|
410
410
|
pickerSelectedDateBackgroundColor: globalTokens.hal_purple_s_38,
|
|
411
|
-
pickerActualDateFontColor: globalTokens.
|
|
411
|
+
pickerActualDateFontColor: globalTokens.hal_black,
|
|
412
412
|
pickerYearFontColor: globalTokens.hal_black,
|
|
413
413
|
pickerMonthFontColor: globalTokens.hal_black,
|
|
414
414
|
pickerWeekFontColor: globalTokens.hal_black,
|
|
@@ -416,7 +416,8 @@ var componentTokens = {
|
|
|
416
416
|
pickerMonthArrowsBackgroundColor: globalTokens.transparent,
|
|
417
417
|
pickerFocusColor: globalTokens.hal_blue_l_50,
|
|
418
418
|
pickerHeight: "316px",
|
|
419
|
-
|
|
419
|
+
// not referenced in the actual implementation
|
|
420
|
+
pickerWidth: "292px"
|
|
420
421
|
},
|
|
421
422
|
dialog: {
|
|
422
423
|
overlayColor: globalTokens.hal_black,
|
|
@@ -804,7 +805,6 @@ var componentTokens = {
|
|
|
804
805
|
quickNav: {
|
|
805
806
|
fontColor: globalTokens.hal_grey_s_40,
|
|
806
807
|
hoverFontColor: globalTokens.hal_purple_d_70,
|
|
807
|
-
selectedFontColor: globalTokens.hal_purple_s_38,
|
|
808
808
|
dividerBorderColor: globalTokens.hal_grey_l_75,
|
|
809
809
|
focusBorderColor: globalTokens.hal_blue_l_50,
|
|
810
810
|
focusBorderStyle: globalTokens.border_solid,
|
|
@@ -1025,7 +1025,7 @@ var componentTokens = {
|
|
|
1025
1025
|
trackLineColorOnDark: globalTokens.hal_blue_l_50,
|
|
1026
1026
|
totalLineThickness: "2px",
|
|
1027
1027
|
totalLineVerticalPosition: "50%",
|
|
1028
|
-
totalLineColor:
|
|
1028
|
+
totalLineColor: "#0000001a",
|
|
1029
1029
|
totalLineColorOnDark: globalTokens.hal_grey_l_75,
|
|
1030
1030
|
disabledThumbVerticalPosition: "10px",
|
|
1031
1031
|
disabledThumbBackgroundColor: globalTokens.hal_grey_l_60,
|
|
@@ -1424,6 +1424,9 @@ var defaultTranslatedComponentLabels = {
|
|
|
1424
1424
|
},
|
|
1425
1425
|
logoAlternativeText: "Logo"
|
|
1426
1426
|
},
|
|
1427
|
+
applicationLayout: {
|
|
1428
|
+
visibilityToggleTitle: "Toggle visibility sidenav"
|
|
1429
|
+
},
|
|
1427
1430
|
alert: {
|
|
1428
1431
|
infoTitleText: "information",
|
|
1429
1432
|
successTitleText: "success",
|
|
@@ -1440,7 +1443,8 @@ var defaultTranslatedComponentLabels = {
|
|
|
1440
1443
|
singleButtonLabelDefault: "Select file",
|
|
1441
1444
|
dropAreaButtonLabelDefault: "Select",
|
|
1442
1445
|
multipleDropAreaLabelDefault: "or drop files",
|
|
1443
|
-
singleDropAreaLabelDefault: "or drop a file"
|
|
1446
|
+
singleDropAreaLabelDefault: "or drop a file",
|
|
1447
|
+
deleteFileActionTitle: "Remove file"
|
|
1444
1448
|
},
|
|
1445
1449
|
footer: {
|
|
1446
1450
|
copyrightText: function copyrightText(year) {
|
|
@@ -1497,12 +1501,12 @@ var defaultTranslatedComponentLabels = {
|
|
|
1497
1501
|
},
|
|
1498
1502
|
calendar: {
|
|
1499
1503
|
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
1500
|
-
daysShort: ["
|
|
1504
|
+
daysShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1501
1505
|
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1502
|
-
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
+
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
1507
|
+
previousMonthTitle: "Previous month",
|
|
1508
|
+
nextMonthTitle: "Next month",
|
|
1509
|
+
openCalendar: "Open calendar"
|
|
1506
1510
|
}
|
|
1507
1511
|
};
|
|
1508
1512
|
exports.defaultTranslatedComponentLabels = defaultTranslatedComponentLabels;
|