@zohodesk/components 1.0.0-temp-252.3 → 1.0.0-temp-252.4

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.
Files changed (51) hide show
  1. package/README.md +4 -3
  2. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +0 -3
  3. package/assets/Appearance/light/mode/Component_LightMode.module.css +0 -3
  4. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +0 -3
  5. package/es/Select/Select.js +77 -88
  6. package/es/Select/Select.module.css +10 -37
  7. package/es/Select/props/defaultProps.js +1 -2
  8. package/es/Select/props/propTypes.js +2 -4
  9. package/es/v1/Button/Button.js +5 -3
  10. package/es/v1/Button/__tests__/Button.spec.js +5 -2
  11. package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
  12. package/es/v1/Button/css/cssJSLogic.js +7 -2
  13. package/es/v1/helpers/colorHelpers/colorHelper.js +8 -5
  14. package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
  15. package/es/v1/{Button/_shared → shared}/Loader/Loader.js +3 -3
  16. package/es/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
  17. package/es/v1/shared/Loader/props/defaultProps.js +5 -0
  18. package/es/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
  19. package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +3 -3
  20. package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
  21. package/es/v1/shared/SuccessTick/props/defaultProps.js +5 -0
  22. package/es/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
  23. package/lib/Select/Select.js +77 -89
  24. package/lib/Select/Select.module.css +10 -37
  25. package/lib/Select/props/defaultProps.js +1 -2
  26. package/lib/Select/props/propTypes.js +2 -4
  27. package/lib/v1/Button/Button.js +5 -3
  28. package/lib/v1/Button/__tests__/Button.spec.js +5 -2
  29. package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
  30. package/lib/v1/Button/css/cssJSLogic.js +9 -5
  31. package/lib/v1/helpers/colorHelpers/colorHelper.js +8 -5
  32. package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
  33. package/lib/v1/{Button/_shared → shared}/Loader/Loader.js +5 -5
  34. package/lib/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
  35. package/lib/v1/{Button/_shared/SuccessTick → shared/Loader}/props/defaultProps.js +4 -1
  36. package/lib/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
  37. package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +5 -5
  38. package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
  39. package/lib/v1/{Button/_shared/Loader → shared/SuccessTick}/props/defaultProps.js +4 -1
  40. package/lib/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
  41. package/package.json +4 -4
  42. package/es/v1/Button/_shared/Loader/props/defaultProps.js +0 -4
  43. package/es/v1/Button/_shared/SuccessTick/props/defaultProps.js +0 -4
  44. /package/es/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
  45. /package/es/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
  46. /package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
  47. /package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
  48. /package/lib/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
  49. /package/lib/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
  50. /package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
  51. /package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
package/README.md CHANGED
@@ -4,9 +4,10 @@ Dot UI is a customizable React component library built to deliver a clean, acces
4
4
 
5
5
  # 1.6.14
6
6
 
7
- - **Select**
8
- - Added `renderCustomDropBoxHeader` prop to render a custom node at the top of the dropdown, above the suggestions list.
9
- - Added `customDropBoxHeader` key under the `customClass` prop to style the custom header wrapper.
7
+ - **v1/Button**
8
+ - `Loader` and `SuccessTick` components moved from `v1/Button/_shared/` to new `v1/shared/` to make them reusable across v1.
9
+ - **colorHelper**
10
+ - Updated `colorHelper` logic to fix text color issues in bg on `onHover` and `isSelected` state combinations.
10
11
 
11
12
  # 1.6.13
12
13
 
@@ -258,9 +258,6 @@
258
258
  /* select */
259
259
  --zdt_select_emptystate_text:hsla(217, calc(var(--zd-saturation, 1) * 13.73%), calc(70.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
260
260
  --zdt_select_disable_text:var(--dot_inputDisable);
261
- --zdt_select_wrapper_container_border:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.2 + var(--zdc_alpha_low)));
262
- --zdt_select_wrapper_container_bg:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), 100.00%, 0.03);
263
- --zdt_select_wrapper_dropdown_bg:hsla(217, calc(var(--zd-saturation, 1) * 23.08%), calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
264
261
 
265
262
  /* multiselect */
266
263
  --zdt_multiselect_default_border:var(--dot_inputLine);
@@ -258,9 +258,6 @@
258
258
  /* select */
259
259
  --zdt_select_emptystate_text:hsla(220, calc(var(--zd-saturation, 1) * 10.45%), calc(39.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
260
260
  --zdt_select_disable_text:var(--dot_inputDisable);
261
- --zdt_select_wrapper_container_border:hsla(218, calc(var(--zd-saturation, 1) * 42.22%), calc(91.18% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
262
- --zdt_select_wrapper_container_bg:hsla(216, calc(var(--zd-saturation, 1) * 38.46%), 97.45%, 1);
263
- --zdt_select_wrapper_dropdown_bg:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
264
261
 
265
262
  /* multiselect */
266
263
  --zdt_multiselect_default_border:var(--dot_inputLine);
@@ -258,9 +258,6 @@
258
258
  /* select */
259
259
  --zdt_select_emptystate_text:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), calc(60.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
260
260
  --zdt_select_disable_text:var(--dot_inputDisable);
261
- --zdt_select_wrapper_container_border:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), calc(100.00% + var(--zdc_default_inverse_low)), calc( 0.2 + var(--zdc_alpha_low)));
262
- --zdt_select_wrapper_container_bg:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), 100.00%, 0.03);
263
- --zdt_select_wrapper_dropdown_bg:hsla(0, calc(var(--zd-saturation, 1) * 0.00%), calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
264
261
 
265
262
  /* multiselect */
266
263
  --zdt_multiselect_default_border:var(--dot_inputLine);
@@ -813,8 +813,7 @@ export class SelectComponent extends Component {
813
813
  renderCustomSearchClearComponent,
814
814
  renderCustomSelectedValue,
815
815
  inputFieldLineA11y,
816
- customClass,
817
- renderCustomDropBoxHeader
816
+ customClass
818
817
  } = this.props;
819
818
  let {
820
819
  TextBoxIcon_i18n,
@@ -845,8 +844,7 @@ export class SelectComponent extends Component {
845
844
  } = customProps;
846
845
  const {
847
846
  dropBox: dropBoxClass = '',
848
- cardContent: cardContentClass = '',
849
- customDropBoxHeader: customDropBoxHeaderClass = ''
847
+ cardContent: cardContentClass = ''
850
848
  } = customClass;
851
849
  const inputFieldLineA11yAttributes = this.getInputFieldLineA11y({
852
850
  setAriaId,
@@ -1023,92 +1021,83 @@ export class SelectComponent extends Component {
1023
1021
  isRestrictScroll: isRestrictScroll,
1024
1022
  portalId: dropBoxPortalId,
1025
1023
  customClass: {
1026
- customDropBox: `${dropBoxClass} ${renderCustomDropBoxHeader ? style.dropBoxWithCustomHeader : ''}`
1024
+ customDropBox: dropBoxClass
1027
1025
  }
1028
- }, (() => {
1029
- const dropdownContent = isLoading ? /*#__PURE__*/React.createElement(Container, {
1030
- align: "both",
1031
- className: style.loader
1032
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, !getChildren ? /*#__PURE__*/React.createElement(Box, {
1033
- flexible: true
1034
- }, /*#__PURE__*/React.createElement(Card, {
1035
- onScroll: this.handleScroll
1036
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
1037
- className: `${style.search} ${style[size]}`
1038
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
1039
- a11y: {
1040
- ariaControls: setAriaId,
1041
- ariaAutocomplete: 'list',
1042
- ariaDescribedby: ariaErrorId
1043
- },
1044
- inputRef: this.searchInputRef,
1045
- maxLength: maxLength,
1046
- onChange: this.handleSearch,
1047
- onKeyDown: this.handleKeyDown,
1048
- placeHolder: searchBoxPlaceHolder,
1049
- size: searchBoxSize,
1050
- value: searchStr,
1051
- onClear: this.handleClearSearch,
1052
- dataId: `${dataId}_search`,
1053
- i18nKeys: TextBoxIcon_i18n,
1054
- autoComplete: autoComplete,
1055
- customProps: {
1056
- TextBoxProps: DropdownSearchTextBoxProps
1057
- },
1058
- renderCustomClearComponent: renderCustomSearchClearComponent
1059
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
1060
- shrink: true,
1061
- customClass: `
1026
+ }, isLoading ? /*#__PURE__*/React.createElement(Container, {
1027
+ align: "both",
1028
+ className: style.loader
1029
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, !getChildren ? /*#__PURE__*/React.createElement(Box, {
1030
+ flexible: true
1031
+ }, /*#__PURE__*/React.createElement(Card, {
1032
+ onScroll: this.handleScroll
1033
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
1034
+ className: `${style.search} ${style[size]}`
1035
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
1036
+ a11y: {
1037
+ ariaControls: setAriaId,
1038
+ ariaAutocomplete: 'list',
1039
+ ariaDescribedby: ariaErrorId
1040
+ },
1041
+ inputRef: this.searchInputRef,
1042
+ maxLength: maxLength,
1043
+ onChange: this.handleSearch,
1044
+ onKeyDown: this.handleKeyDown,
1045
+ placeHolder: searchBoxPlaceHolder,
1046
+ size: searchBoxSize,
1047
+ value: searchStr,
1048
+ onClear: this.handleClearSearch,
1049
+ dataId: `${dataId}_search`,
1050
+ i18nKeys: TextBoxIcon_i18n,
1051
+ autoComplete: autoComplete,
1052
+ customProps: {
1053
+ TextBoxProps: DropdownSearchTextBoxProps
1054
+ },
1055
+ renderCustomClearComponent: renderCustomSearchClearComponent
1056
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
1057
+ shrink: true,
1058
+ customClass: `
1062
1059
  ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
1063
- eleRef: this.suggestionContainerRef
1064
- }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
1065
- key: searchStr.trim(),
1066
- activeId: selectedId,
1067
- isVirtualizerEnabled: isVirtualizerEnabled,
1068
- getVirtualizerPublicMethods: this.getVirtualizerPublicMethods,
1069
- setVirtualizerContainerRefFunction: this.setSuggestionsVirtualizerContainerRefFunction,
1070
- suggestions: suggestions,
1071
- getRef: this.suggestionItemRef,
1072
- hoverOption: hoverIndex,
1073
- onClick: this.handleChange,
1074
- onMouseEnter: this.handleMouseEnter,
1075
- dataId: `${dataId}_Options`,
1076
- needTick: needTick,
1077
- needBorder: needListBorder,
1078
- selectedOptions: [selectedId],
1079
- className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
1080
- listItemSize: listItemSize,
1081
- htmlId: setAriaId,
1082
- a11y: {
1083
- ariaParentRole: 'listbox',
1084
- role: 'option'
1085
- }
1086
- }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
1087
- isLoading: isFetchingOptions,
1088
- options: options,
1089
- searchString: searchStr,
1090
- suggestions: suggestions,
1091
- dataId: dataId,
1092
- renderCustomEmptyState: renderCustomEmptyState,
1093
- getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
1094
- i18nKeys: i18nKeys,
1095
- htmlId: ariaErrorId
1096
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1097
- isCover: false,
1098
- align: "both"
1099
- }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)) : /*#__PURE__*/React.createElement(Box, {
1100
- flexible: true
1101
- }, getChildren()));
1102
- return renderCustomDropBoxHeader ? /*#__PURE__*/React.createElement("div", {
1103
- className: style.dropBoxListContainer
1104
- }, /*#__PURE__*/React.createElement("div", {
1105
- className: `${customDropBoxHeaderClass} ${style.customDropBoxHeaderContainer}`
1106
- }, renderNode(renderCustomDropBoxHeader, {
1107
- closePopup: this.handlePopupClose
1108
- })), /*#__PURE__*/React.createElement("div", {
1109
- className: style.dropdownOptions
1110
- }, dropdownContent)) : dropdownContent;
1111
- })());
1060
+ eleRef: this.suggestionContainerRef
1061
+ }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
1062
+ key: searchStr.trim(),
1063
+ activeId: selectedId,
1064
+ isVirtualizerEnabled: isVirtualizerEnabled,
1065
+ getVirtualizerPublicMethods: this.getVirtualizerPublicMethods,
1066
+ setVirtualizerContainerRefFunction: this.setSuggestionsVirtualizerContainerRefFunction,
1067
+ suggestions: suggestions,
1068
+ getRef: this.suggestionItemRef,
1069
+ hoverOption: hoverIndex,
1070
+ onClick: this.handleChange,
1071
+ onMouseEnter: this.handleMouseEnter,
1072
+ dataId: `${dataId}_Options`,
1073
+ needTick: needTick,
1074
+ needBorder: needListBorder,
1075
+ selectedOptions: [selectedId],
1076
+ className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
1077
+ listItemSize: listItemSize,
1078
+ htmlId: setAriaId,
1079
+ a11y: {
1080
+ ariaParentRole: 'listbox',
1081
+ role: 'option'
1082
+ }
1083
+ }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
1084
+ isLoading: isFetchingOptions,
1085
+ options: options,
1086
+ searchString: searchStr,
1087
+ suggestions: suggestions,
1088
+ dataId: dataId,
1089
+ renderCustomEmptyState: renderCustomEmptyState,
1090
+ getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
1091
+ i18nKeys: i18nKeys,
1092
+ htmlId: ariaErrorId
1093
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1094
+ isCover: false,
1095
+ align: "both"
1096
+ }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter({
1097
+ closePopup: this.handlePopupClose
1098
+ })) : null)) : /*#__PURE__*/React.createElement(Box, {
1099
+ flexible: true
1100
+ }, getChildren())));
1112
1101
  }) : null);
1113
1102
  }
1114
1103
 
@@ -22,12 +22,12 @@
22
22
 
23
23
  .box_small .emptyState {
24
24
  padding-block: var(--zd_size12) ;
25
- padding-inline: var(--zd_size6) ;
25
+ padding-inline:var(--zd_size6) ;
26
26
  }
27
27
 
28
28
  .box_medium .emptyState {
29
29
  padding-block: var(--zd_size12) ;
30
- padding-inline: var(--zd_size15) ;
30
+ padding-inline:var(--zd_size15) ;
31
31
  }
32
32
 
33
33
  .hide {
@@ -45,12 +45,12 @@
45
45
 
46
46
  .small.search {
47
47
  padding-block: 0 ;
48
- padding-inline: var(--zd_size5) ;
48
+ padding-inline:var(--zd_size5) ;
49
49
  }
50
50
 
51
51
  .medium.search {
52
52
  padding-block: var(--zd_size3) 0 ;
53
- padding-inline: var(--zd_size20) ;
53
+ padding-inline:var(--zd_size20) ;
54
54
  }
55
55
 
56
56
  .title {
@@ -59,17 +59,17 @@
59
59
 
60
60
  .groupTitle {
61
61
  margin-block: var(--zd_size6) ;
62
- margin-inline: 0 ;
62
+ margin-inline:0 ;
63
63
  }
64
64
 
65
65
  .listItemContainer {
66
66
  padding-block: var(--zd_size10) ;
67
- padding-inline: 0 ;
67
+ padding-inline:0 ;
68
68
  }
69
69
 
70
70
  .responsivelistItemContainer {
71
71
  padding-block: var(--zd_size10) 0 ;
72
- padding-inline: 0 ;
72
+ padding-inline:0 ;
73
73
  }
74
74
 
75
75
  .readonly {
@@ -111,19 +111,18 @@
111
111
 
112
112
  .dropBoxList {
113
113
  padding-block: var(--zd_size10) ;
114
- padding-inline: 0 ;
114
+ padding-inline:0 ;
115
115
  }
116
116
 
117
117
  .responsivedropBoxList {
118
118
  padding-block: var(--zd_size10) 0 ;
119
- padding-inline: 0 ;
119
+ padding-inline:0 ;
120
120
  }
121
121
 
122
122
  .rotate {
123
123
  transform: rotateX(180deg);
124
124
  }
125
-
126
- .rightPlaceholder {
125
+ .rightPlaceholder{
127
126
  height: 100% ;
128
127
  }
129
128
 
@@ -142,29 +141,3 @@
142
141
  .loader {
143
142
  padding: var(--zd_size10) ;
144
143
  }
145
-
146
- .dropBoxWithCustomHeader {
147
- border-radius: 7px;
148
- }
149
-
150
- .dropBoxListContainer {
151
- width: 100% ;
152
- border-radius: 7px;
153
- padding: var(--zd_size10) ;
154
- border: 1px solid var(--zdt_select_wrapper_container_border);
155
- background: var(--zdt_select_wrapper_container_bg);
156
- box-shadow: var(--zd_bs_statusdropdown_wrapper_container);
157
- }
158
-
159
- .dropdownOptions {
160
- padding-inline: var(--zd_size1) ;
161
- padding-block: var(--zd_size1) ;
162
- background-color: var(--zdt_select_wrapper_dropdown_bg);
163
- border: 1px solid var(--zdt_select_wrapper_container_border);
164
- border-radius: 7px;
165
- }
166
-
167
- .customDropBoxHeaderContainer {
168
- margin-block-end: var(--zd_size6) ;
169
- margin-inline: var(--zd_size1) ;
170
- }
@@ -38,8 +38,7 @@ export const Select_defaultProps = {
38
38
  isAbsolutePositioningNeeded: true,
39
39
  allowValueFallback: true,
40
40
  inputFieldLineA11y: {},
41
- customClass: {},
42
- renderCustomDropBoxHeader: null
41
+ customClass: {}
43
42
  };
44
43
  export const GroupSelect_defaultProps = {
45
44
  animationStyle: 'bounce',
@@ -107,10 +107,8 @@ export const Select_propTypes = {
107
107
  inputFieldLineA11y: PropTypes.object,
108
108
  customClass: PropTypes.shape({
109
109
  dropBox: PropTypes.string,
110
- cardContent: PropTypes.string,
111
- customDropBoxHeader: PropTypes.string
112
- }),
113
- renderCustomDropBoxHeader: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
110
+ cardContent: PropTypes.string
111
+ })
114
112
  };
115
113
  export const GroupSelect_propTypes = {
116
114
  groupedOptions: PropTypes.arrayOf(PropTypes.shape({
@@ -11,8 +11,8 @@ import propTypes from "./props/propTypes";
11
11
  import defaultProps from "./props/defaultProps";
12
12
  import { DUMMY_OBJECT } from '@zohodesk/dotkit/es/utils/constants';
13
13
  import { ICON_PLACEMENT, LOADER_PLACEMENT, STATUS, TYPOGRAPHY_SIZE_MAP, VARIANT } from "./constants";
14
- import Loader from "./_shared/Loader/Loader";
15
- import SuccessTick from "./_shared/SuccessTick/SuccessTick";
14
+ import Loader from "../shared/Loader/Loader";
15
+ import SuccessTick from "../shared/SuccessTick/SuccessTick";
16
16
  import cssJSLogic from "./css/cssJSLogic";
17
17
 
18
18
  const getTypographySize = size => TYPOGRAPHY_SIZE_MAP[size] || '13';
@@ -70,7 +70,8 @@ const Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
70
70
  successOverlayClass,
71
71
  contentWrapperClass,
72
72
  textClassName,
73
- buttonClassName
73
+ buttonClassName,
74
+ iconClassName
74
75
  } = classes;
75
76
  const showIcon = variant !== VARIANT.TEXT && (renderIcon || iconName);
76
77
 
@@ -134,6 +135,7 @@ const Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
134
135
  }
135
136
 
136
137
  return /*#__PURE__*/React.createElement(Icon, _extends({}, iconProps, {
138
+ iconClass: iconClassName,
137
139
  name: iconName,
138
140
  size: iconSize,
139
141
  tagAttributes: iconTagAttributes,
@@ -218,13 +218,16 @@ describe('Button - Component', () => {
218
218
  }));
219
219
  expect(asFragment()).toMatchSnapshot();
220
220
  });
221
- test('Should apply customClass to wrapper and text', () => {
221
+ test('Should apply customClass to wrapper, text and icon', () => {
222
222
  const {
223
223
  asFragment
224
224
  } = render( /*#__PURE__*/React.createElement(Button, {
225
+ variant: "iconWithText",
226
+ iconName: "ZD-plus",
225
227
  customClass: {
226
228
  wrapper: 'customButtonClass',
227
- text: 'customTextClass'
229
+ text: 'customTextClass',
230
+ icon: 'customIconClass'
228
231
  }
229
232
  }, "Button"));
230
233
  expect(asFragment()).toMatchSnapshot();
@@ -27,7 +27,7 @@ exports[`Button - Component Should apply a11yAttributes to the button 1`] = `
27
27
  </DocumentFragment>
28
28
  `;
29
29
 
30
- exports[`Button - Component Should apply customClass to wrapper and text 1`] = `
30
+ exports[`Button - Component Should apply customClass to wrapper, text and icon 1`] = `
31
31
  <DocumentFragment>
32
32
  <button
33
33
  aria-busy="false"
@@ -42,6 +42,13 @@ exports[`Button - Component Should apply customClass to wrapper and text 1`] = `
42
42
  data-id="flex"
43
43
  data-test-id="flex"
44
44
  >
45
+ <i
46
+ aria-hidden="true"
47
+ class="zd_font_icons basic icon-plus customIconClass "
48
+ data-id="fontIcon"
49
+ data-selector-id="fontIcon"
50
+ style="--zd-iconfont-size: var(--zd_font_size16);"
51
+ />
45
52
  <div
46
53
  class="dotted size13 customTextClass"
47
54
  >
@@ -31,7 +31,8 @@ export default function cssJSLogic(_ref) {
31
31
  } = props;
32
32
  const {
33
33
  wrapper: wrapperClass = '',
34
- text: textClassCustom = ''
34
+ text: textClassCustom = '',
35
+ icon: iconClassCustom = ''
35
36
  } = customClass;
36
37
  const isLoading = status === STATUS.LOADING;
37
38
  const isSuccess = status === STATUS.SUCCESS;
@@ -86,11 +87,15 @@ export default function cssJSLogic(_ref) {
86
87
  const textClassName = compileClassNames({
87
88
  [textClassCustom]: !!textClassCustom
88
89
  });
90
+ const iconClassName = compileClassNames({
91
+ [iconClassCustom]: !!iconClassCustom
92
+ });
89
93
  return {
90
94
  buttonClassName,
91
95
  textClassName,
92
96
  contentWrapperClass: overlayActive ? style.overlayHidden : style.contentWrapper,
93
97
  loaderOverlayClass: style.loaderOverlay,
94
- successOverlayClass: style.successOverlay
98
+ successOverlayClass: style.successOverlay,
99
+ iconClassName
95
100
  };
96
101
  }
@@ -117,7 +117,7 @@ const buildPaletteClasses = (config, _ref4) => {
117
117
  }) : '',
118
118
  text: isSelected ? getTextClass({
119
119
  state: 'selected',
120
- textTone: baseTextTone
120
+ textTone: hasBgState ? stateTextTone : baseTextTone
121
121
  }) : getTextClass({
122
122
  textTone: baseTextTone
123
123
  }),
@@ -133,11 +133,14 @@ const buildPaletteClasses = (config, _ref4) => {
133
133
  state: 'active',
134
134
  textTone: stateTextTone
135
135
  }),
136
- border: isSelected ? getBorderClass({
136
+ border: isSelected ? !hasBorderState ? getBorderClass({
137
+ tone: 'transparent'
138
+ }) : getBorderClass({
137
139
  state: 'selected',
138
- tone,
139
- isLighter
140
- }) : hasTransparentBorder ? paletteBorderStyle['border-transparent'] : getBorderClass({
140
+ tone
141
+ }) : hasTransparentBorder ? getBorderClass({
142
+ tone: 'transparent'
143
+ }) : getBorderClass({
141
144
  tone,
142
145
  isLighter
143
146
  }),
@@ -71,7 +71,7 @@ Per color (`default`, `grey`, `blue`, `green`, `orange`, `red`, `yellow`):
71
71
  | `.active\:text-{color}:active` | Active state |
72
72
  | `.selected\:text-{color}` | Selected state |
73
73
 
74
- **Special:** `.text-default-filled` (+ hover/focus/active/selected) — uses `--zdt_v1_palette_default_filled_text` for filled default backgrounds.
74
+ **Special:** `.text-brand-filled` (+ hover/focus/active/selected) — uses `--zdt_v1_palette_default_filled_text` for filled default backgrounds.
75
75
 
76
76
  **Utility classes:** `.text-transparent`, `.text-white`, `.text-black`
77
77
 
@@ -204,7 +204,7 @@ Returns a text CSS class from `textColor.module.css`.
204
204
 
205
205
  | Parameter | Type | Required | Description |
206
206
  |-----------|------|----------|-------------|
207
- | `textTone` | `string` | Yes | Text tone (`default`, `grey`, `blue`, `green`, `orange`, `red`, `yellow`, `white`, `black`, `default-filled`) |
207
+ | `textTone` | `string` | Yes | Text tone (`brand`, `grey`, `blue`, `green`, `orange`, `red`, `yellow`, `white`, `black`, `brand-filled`) |
208
208
  | `state` | `string` | No | State prefix (`hover`, `focus`, `active`, `selected`). Omit for base class. |
209
209
 
210
210
  > **Note:** `textTone` has no `isLighter` equivalent. Use `filledTextTone` (e.g. `white`) directly when needed.
@@ -214,7 +214,7 @@ Returns a text CSS class from `textColor.module.css`.
214
214
  ```javascript
215
215
  getTextClass({ textTone: 'green' }) // → paletteTextStyle['text-green']
216
216
  getTextClass({ state: 'hover', textTone: 'white' }) // → paletteTextStyle['hover:text-white']
217
- getTextClass({ textTone: 'default-filled' }) // → paletteTextStyle['text-default-filled']
217
+ getTextClass({ textTone: 'brand-filled' }) // → paletteTextStyle['text-brand-filled']
218
218
  ```
219
219
 
220
220
  #### `getBorderClass({ state?, tone, isLighter? })`
@@ -254,7 +254,7 @@ import getPaletteClasses from './colorHelper';
254
254
 
255
255
  | Palette | Tone (bg/border) | Text Tone | Filled Text Tone |
256
256
  |---------|-------------------|-----------|-------------------|
257
- | `default` | `default` | `default` | `default-filled` |
257
+ | `default` | `brand` | `brand` | `brand-filled` |
258
258
  | `primary` | `blue` | `blue` | `white` |
259
259
  | `secondary` | `grey` | `grey` | `white` |
260
260
  | `danger` | `red` | `red` | `white` |
@@ -267,7 +267,8 @@ Unknown palettes return `DUMMY_OBJECT` (empty frozen object).
267
267
  | Parameter | Values | Effect |
268
268
  |-----------|--------|--------|
269
269
  | `palette` | `default` \| `primary` \| `secondary` \| `danger` \| `success` | Selects the color tone config from `PALETTE_CONFIG` |
270
- | `bgAppearance` | `'none'` \| `'filled'` \| other | `'filled'` → base bg + state bg; `'none'` → no bg, no state bg, no filled text logic; other → no base bg but state bg + filled text logic |
270
+ | `bgAppearance` | `'none'` \| `'default'` \| other | `'default'` → base bg + state bg; `'none'` → no bg, no state bg, no filled text logic; other → no base bg but state bg + filled text logic |
271
+ | `isSelected` | `boolean` | `true` → folds selected-state classes into `bg`, `text`, and `border` (replaces their resting values with the `selected` state class) |
271
272
  | `borderAppearance` | `'none'` \| `'onHover'` \| other | `'none'` → transparent base, no state borders; `'onHover'` → transparent base, with state borders; other → visible base + state borders |
272
273
  | `paletteShade` | `'lighter'` \| other | `'lighter'` → `-light` variant for bg and base border; also keeps text as `textTone` instead of `filledTextTone` |
273
274
 
@@ -277,33 +278,30 @@ The text color depends on both `bgAppearance` and `paletteShade`:
277
278
 
278
279
  | Condition | Base text (`text`) | State text (`hoverText`, etc.) |
279
280
  |---|---|---|
280
- | `bgAppearance: 'filled'` + default shade | `filledTextTone` (e.g. `white`) | `filledTextTone` |
281
- | `bgAppearance: 'filled'` + `'lighter'` shade | `textTone` (e.g. `blue`) | `textTone` |
281
+ | `bgAppearance: 'default'` + default shade | `filledTextTone` (e.g. `white`) | `filledTextTone` |
282
+ | `bgAppearance: 'default'` + `'lighter'` shade | `textTone` (e.g. `blue`) | `textTone` |
282
283
  | `bgAppearance:` other (not `'none'`) + default shade | `textTone` | `filledTextTone` |
283
284
  | `bgAppearance:` other (not `'none'`) + `'lighter'` shade | `textTone` | `textTone` |
284
285
  | `bgAppearance: 'none'` | `textTone` | `textTone` |
285
286
 
286
- > **Key insight:** `baseTextTone = isFilledBg && !isLighter ? filledTextTone : textTone`. `stateTextTone = hasBgState && !isLighter ? filledTextTone : textTone`. This means state text can differ from base text when `bgAppearance` is not `'filled'` but also not `'none'`.
287
+ > **Key insight:** `baseTextTone = isFilledBg && !isLighter ? filledTextTone : textTone`. `stateTextTone = hasBgState && !isLighter ? filledTextTone : textTone`. This means state text can differ from base text when `bgAppearance` is not `'default'` but also not `'none'`.
287
288
 
288
289
  #### Return Value
289
290
 
290
291
  ```javascript
291
292
  {
292
- bg, // getBgClass({ tone, isLighter }) only if bgAppearance === 'filled'
293
- hoverBg, // getBgClass({ state: 'hover', tone, isLighter }) — if bgAppearance !== 'none'
294
- focusBg, // getBgClass({ state: 'focus', tone, isLighter }) — if bgAppearance !== 'none'
295
- activeBg, // getBgClass({ state: 'active', tone, isLighter }) — if bgAppearance !== 'none'
296
- selectedBg, // getBgClass({ state: 'selected', tone, isLighter }) if bgAppearance !== 'none'
297
- text, // getTextClass({ textTone: baseTextTone })
298
- hoverText, // getTextClass({ state: 'hover', textTone: stateTextTone })
299
- focusText, // getTextClass({ state: 'focus', textTone: stateTextTone })
300
- activeText, // getTextClass({ state: 'active', textTone: stateTextTone })
301
- selectedText, // getTextClass({ state: 'selected', textTone: stateTextTone })
302
- border, // 'border-transparent' if onHover/noneelse getBorderClass({ tone, isLighter })
303
- hoverBorder, // getBorderClass({ state: 'hover', tone }) — if borderAppearance !== 'none'
304
- focusBorder, // getBorderClass({ state: 'focus', tone }) — if borderAppearance !== 'none'
305
- activeBorder, // getBorderClass({ state: 'active', tone }) — if borderAppearance !== 'none'
306
- selectedBorder // getBorderClass({ state: 'selected', tone }) — if borderAppearance !== 'none'
293
+ bg, // isSelected → selected bg (if bgAppearance !== 'none'); else base bg (only if bgAppearance === 'default')
294
+ hoverBg, // getBgClass({ state: 'hover', tone, isLighter }) — if bgAppearance !== 'none'
295
+ focusBg, // getBgClass({ state: 'focus', tone, isLighter }) — if bgAppearance !== 'none'
296
+ activeBg, // getBgClass({ state: 'active', tone, isLighter }) — if bgAppearance !== 'none'
297
+ text, // isSelected selected text class; else getTextClass({ textTone: baseTextTone })
298
+ hoverText, // getTextClass({ state: 'hover', textTone: stateTextTone })
299
+ focusText, // getTextClass({ state: 'focus', textTone: stateTextTone })
300
+ activeText, // getTextClass({ state: 'active', textTone: stateTextTone })
301
+ border, // isSelected → selected border (if borderAppearance !== 'none'); else resting border
302
+ hoverBorder, // getBorderClass({ state: 'hover', tone }) — if borderAppearance !== 'none'
303
+ focusBorder, // getBorderClass({ state: 'focus', tone })if borderAppearance !== 'none'
304
+ activeBorder // getBorderClass({ state: 'active', tone }) — if borderAppearance !== 'none'
307
305
  }
308
306
  ```
309
307
 
@@ -314,13 +312,13 @@ The text color depends on both `bgAppearance` and `paletteShade`:
314
312
  ```javascript
315
313
  const classes = getPaletteClasses({
316
314
  palette: 'primary',
317
- bgAppearance: 'filled',
315
+ bgAppearance: 'default',
318
316
  borderAppearance: 'visible',
319
317
  paletteShade: 'default',
320
318
  });
321
- // classes.bg → 'bg-blue' (filled + default shade)
319
+ // classes.bg → 'bg-blue' (bgAppearance: 'default' + default shade)
322
320
  // classes.hoverBg → 'hover:bg-blue'
323
- // classes.text → 'text-white' (filledTextTone — filled + not lighter)
321
+ // classes.text → 'text-white' (filledTextTone — bgAppearance: 'default' + not lighter)
324
322
  // classes.hoverText → 'hover:text-white' (filledTextTone — hasBgState + not lighter)
325
323
  // classes.border → 'border-blue' (visible appearance)
326
324
  // classes.hoverBorder → 'hover:border-blue'
@@ -331,11 +329,11 @@ const classes = getPaletteClasses({
331
329
  ```javascript
332
330
  const classes = getPaletteClasses({
333
331
  palette: 'danger',
334
- bgAppearance: 'filled',
332
+ bgAppearance: 'default',
335
333
  borderAppearance: 'none',
336
334
  paletteShade: 'lighter',
337
335
  });
338
- // classes.bg → 'bg-red-light' (filled + lighter shade)
336
+ // classes.bg → 'bg-red-light' (bgAppearance: 'default' + lighter shade)
339
337
  // classes.hoverBg → 'hover:bg-red-light'
340
338
  // classes.text → 'text-red' (textTone — lighter shade overrides filledTextTone)
341
339
  // classes.hoverText → 'hover:text-red' (textTone — lighter shade)
@@ -365,11 +363,11 @@ const classes = getPaletteClasses({
365
363
  ```javascript
366
364
  const classes = getPaletteClasses({
367
365
  palette: 'primary',
368
- bgAppearance: 'hover-fill', // any value that isn't 'none' or 'filled'
366
+ bgAppearance: 'hover-fill', // any value that isn't 'none' or 'default'
369
367
  borderAppearance: 'visible',
370
368
  paletteShade: 'default',
371
369
  });
372
- // classes.bg → undefined (not 'filled' → no base bg)
370
+ // classes.bg → undefined (not 'default' → no base bg)
373
371
  // classes.hoverBg → 'hover:bg-blue' (not 'none' → state bg present)
374
372
  // classes.text → 'text-blue' (baseTextTone — not filled, so textTone)
375
373
  // classes.hoverText → 'hover:text-white' (stateTextTone — hasBgState + not lighter → filledTextTone!)
@@ -379,6 +377,8 @@ const classes = getPaletteClasses({
379
377
 
380
378
  > This shows a key behavior: the base text is the normal tone, but **state text switches to `filledTextTone`** because the hover/state background will be filled (dark).
381
379
 
380
+ > **Note on `isSelected`:** Pass `isSelected: true` to fold the selected state into `bg`, `text`, and `border`. Instead of the resting class, each returns its `selected:` variant class. There are no separate `selectedBg`/`selectedText`/`selectedBorder` return keys.
381
+
382
382
  ---
383
383
 
384
384
  ## Behavior Summary