@zohodesk/components 1.6.13 → 1.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/es/v1/Button/Button.js +5 -3
- package/es/v1/Button/__tests__/Button.spec.js +5 -2
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
- package/es/v1/Button/css/cssJSLogic.js +7 -2
- package/es/v1/helpers/colorHelpers/colorHelper.js +8 -5
- package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
- package/es/v1/{Button/_shared → shared}/Loader/Loader.js +3 -3
- package/es/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
- package/es/v1/shared/Loader/props/defaultProps.js +5 -0
- package/es/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
- package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +3 -3
- package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
- package/es/v1/shared/SuccessTick/props/defaultProps.js +5 -0
- package/es/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
- package/lib/v1/Button/Button.js +5 -3
- package/lib/v1/Button/__tests__/Button.spec.js +5 -2
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +8 -1
- package/lib/v1/Button/css/cssJSLogic.js +9 -5
- package/lib/v1/helpers/colorHelpers/colorHelper.js +8 -5
- package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +30 -30
- package/lib/v1/{Button/_shared → shared}/Loader/Loader.js +5 -5
- package/lib/v1/{Button/_shared → shared}/Loader/__tests__/Loader.spec.js +1 -1
- package/lib/v1/{Button/_shared/SuccessTick → shared/Loader}/props/defaultProps.js +4 -1
- package/lib/v1/{Button/_shared → shared}/Loader/props/propTypes.js +1 -1
- package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick.js +5 -5
- package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/SuccessTick.spec.js +1 -1
- package/lib/v1/{Button/_shared/Loader → shared/SuccessTick}/props/defaultProps.js +4 -1
- package/lib/v1/{Button/_shared → shared}/SuccessTick/props/propTypes.js +1 -1
- package/package.json +10 -9
- package/es/v1/Button/_shared/Loader/props/defaultProps.js +0 -4
- package/es/v1/Button/_shared/SuccessTick/props/defaultProps.js +0 -4
- /package/es/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
- /package/es/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
- /package/es/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
- /package/es/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
- /package/lib/v1/{Button/_shared → shared}/Loader/Loader_v1.module.css +0 -0
- /package/lib/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap +0 -0
- /package/lib/v1/{Button/_shared → shared}/SuccessTick/SuccessTick_v1.module.css +0 -0
- /package/lib/v1/{Button/_shared → shared}/SuccessTick/__tests__/__snapshots__/SuccessTick.spec.js.snap +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
4
|
|
|
5
|
+
# 1.6.14
|
|
6
|
+
|
|
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.
|
|
11
|
+
|
|
5
12
|
# 1.6.13
|
|
6
13
|
|
|
7
14
|
- **Tab**
|
package/es/v1/Button/Button.js
CHANGED
|
@@ -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 "
|
|
15
|
-
import SuccessTick from "
|
|
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
|
|
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
|
|
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
|
-
|
|
140
|
-
|
|
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-
|
|
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 (`
|
|
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: '
|
|
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` | `
|
|
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'` \| `'
|
|
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: '
|
|
281
|
-
| `bgAppearance: '
|
|
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 `'
|
|
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,
|
|
293
|
-
hoverBg,
|
|
294
|
-
focusBg,
|
|
295
|
-
activeBg,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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: '
|
|
315
|
+
bgAppearance: 'default',
|
|
318
316
|
borderAppearance: 'visible',
|
|
319
317
|
paletteShade: 'default',
|
|
320
318
|
});
|
|
321
|
-
// classes.bg → 'bg-blue' (
|
|
319
|
+
// classes.bg → 'bg-blue' (bgAppearance: 'default' + default shade)
|
|
322
320
|
// classes.hoverBg → 'hover:bg-blue'
|
|
323
|
-
// classes.text → 'text-white' (filledTextTone —
|
|
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: '
|
|
332
|
+
bgAppearance: 'default',
|
|
335
333
|
borderAppearance: 'none',
|
|
336
334
|
paletteShade: 'lighter',
|
|
337
335
|
});
|
|
338
|
-
// classes.bg → 'bg-red-light' (
|
|
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 '
|
|
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 '
|
|
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
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import style from "./Loader_v1.module.css";
|
|
3
2
|
import propTypes from "./props/propTypes";
|
|
4
3
|
import defaultProps from "./props/defaultProps";
|
|
4
|
+
import style from "./Loader_v1.module.css";
|
|
5
5
|
|
|
6
6
|
const Loader = props => {
|
|
7
7
|
const {
|
|
8
8
|
customClass
|
|
9
9
|
} = props;
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
wrapper = ''
|
|
12
12
|
} = customClass;
|
|
13
13
|
return /*#__PURE__*/React.createElement("svg", {
|
|
14
|
-
className: `${style.spinner} ${
|
|
14
|
+
className: `${style.spinner} ${wrapper}`,
|
|
15
15
|
viewBox: "0 0 24 24",
|
|
16
16
|
role: "img",
|
|
17
17
|
"aria-hidden": "true"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import style from "./SuccessTick_v1.module.css";
|
|
3
2
|
import propTypes from "./props/propTypes";
|
|
4
3
|
import defaultProps from "./props/defaultProps";
|
|
4
|
+
import style from "./SuccessTick_v1.module.css";
|
|
5
5
|
|
|
6
6
|
const SuccessTick = props => {
|
|
7
7
|
const {
|
|
8
8
|
customClass
|
|
9
9
|
} = props;
|
|
10
10
|
const {
|
|
11
|
-
|
|
11
|
+
wrapper = ''
|
|
12
12
|
} = customClass;
|
|
13
13
|
return /*#__PURE__*/React.createElement("svg", {
|
|
14
|
-
className: `${style.tick} ${
|
|
14
|
+
className: `${style.tick} ${wrapper}`,
|
|
15
15
|
viewBox: "0 0 24 24",
|
|
16
16
|
role: "img",
|
|
17
17
|
"aria-hidden": "true"
|
package/lib/v1/Button/Button.js
CHANGED
|
@@ -27,9 +27,9 @@ var _constants = require("@zohodesk/dotkit/es/utils/constants");
|
|
|
27
27
|
|
|
28
28
|
var _constants2 = require("./constants");
|
|
29
29
|
|
|
30
|
-
var _Loader = _interopRequireDefault(require("
|
|
30
|
+
var _Loader = _interopRequireDefault(require("../shared/Loader/Loader"));
|
|
31
31
|
|
|
32
|
-
var _SuccessTick = _interopRequireDefault(require("
|
|
32
|
+
var _SuccessTick = _interopRequireDefault(require("../shared/SuccessTick/SuccessTick"));
|
|
33
33
|
|
|
34
34
|
var _cssJSLogic = _interopRequireDefault(require("./css/cssJSLogic"));
|
|
35
35
|
|
|
@@ -105,7 +105,8 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function Button(props, ref) {
|
|
|
105
105
|
successOverlayClass = classes.successOverlayClass,
|
|
106
106
|
contentWrapperClass = classes.contentWrapperClass,
|
|
107
107
|
textClassName = classes.textClassName,
|
|
108
|
-
buttonClassName = classes.buttonClassName
|
|
108
|
+
buttonClassName = classes.buttonClassName,
|
|
109
|
+
iconClassName = classes.iconClassName;
|
|
109
110
|
var showIcon = variant !== _constants2.VARIANT.TEXT && (renderIcon || iconName);
|
|
110
111
|
|
|
111
112
|
var _handleClick = function _handleClick(event) {
|
|
@@ -168,6 +169,7 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function Button(props, ref) {
|
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
return /*#__PURE__*/_react["default"].createElement(_Icon["default"], _extends({}, iconProps, {
|
|
172
|
+
iconClass: iconClassName,
|
|
171
173
|
name: iconName,
|
|
172
174
|
size: iconSize,
|
|
173
175
|
tagAttributes: iconTagAttributes,
|
|
@@ -239,11 +239,14 @@ describe('Button - Component', function () {
|
|
|
239
239
|
|
|
240
240
|
expect(asFragment()).toMatchSnapshot();
|
|
241
241
|
});
|
|
242
|
-
test('Should apply customClass to wrapper and
|
|
242
|
+
test('Should apply customClass to wrapper, text and icon', function () {
|
|
243
243
|
var _render25 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
244
|
+
variant: "iconWithText",
|
|
245
|
+
iconName: "ZD-plus",
|
|
244
246
|
customClass: {
|
|
245
247
|
wrapper: 'customButtonClass',
|
|
246
|
-
text: 'customTextClass'
|
|
248
|
+
text: 'customTextClass',
|
|
249
|
+
icon: 'customIconClass'
|
|
247
250
|
}
|
|
248
251
|
}, "Button")),
|
|
249
252
|
asFragment = _render25.asFragment;
|
|
@@ -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
|
|
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
|
>
|
|
@@ -7,7 +7,7 @@ exports["default"] = cssJSLogic;
|
|
|
7
7
|
|
|
8
8
|
var _Button_v1Module = _interopRequireDefault(require("./Button_v1.module.css"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _compileClassNames4 = _interopRequireDefault(require("@zohodesk/utils/es/compileClassNames"));
|
|
11
11
|
|
|
12
12
|
var _semanticButtonModule = _interopRequireDefault(require("../../../semantic/Button/semanticButton.module.css"));
|
|
13
13
|
|
|
@@ -47,7 +47,9 @@ function cssJSLogic(_ref) {
|
|
|
47
47
|
var _customClass$wrapper = customClass.wrapper,
|
|
48
48
|
wrapperClass = _customClass$wrapper === void 0 ? '' : _customClass$wrapper,
|
|
49
49
|
_customClass$text = customClass.text,
|
|
50
|
-
textClassCustom = _customClass$text === void 0 ? '' : _customClass$text
|
|
50
|
+
textClassCustom = _customClass$text === void 0 ? '' : _customClass$text,
|
|
51
|
+
_customClass$icon = customClass.icon,
|
|
52
|
+
iconClassCustom = _customClass$icon === void 0 ? '' : _customClass$icon;
|
|
51
53
|
var isLoading = status === _constants2.STATUS.LOADING;
|
|
52
54
|
var isSuccess = status === _constants2.STATUS.SUCCESS;
|
|
53
55
|
var isInteractive = !isDisabled && !isReadOnly;
|
|
@@ -76,13 +78,15 @@ function cssJSLogic(_ref) {
|
|
|
76
78
|
var sizeClass = size ? _Button_v1Module["default"]["size".concat(capitalize(size))] : '';
|
|
77
79
|
var shapeClass = shape ? _Button_v1Module["default"]["shape".concat(capitalize(shape))] : '';
|
|
78
80
|
var shouldStrike = disabledAppearance === _constants2.DISABLED_APPEARANCE.STRIKE && isDisabled;
|
|
79
|
-
var buttonClassName = (0,
|
|
80
|
-
var textClassName = (0,
|
|
81
|
+
var buttonClassName = (0, _compileClassNames4["default"])((_compileClassNames = {}, _defineProperty(_compileClassNames, _semanticButtonModule["default"].buttonReset, true), _defineProperty(_compileClassNames, _Button_v1Module["default"].button, true), _defineProperty(_compileClassNames, bg, !!bg), _defineProperty(_compileClassNames, hoverBg, !!hoverBg && isInteractive), _defineProperty(_compileClassNames, focusBg, !!focusBg && isInteractive), _defineProperty(_compileClassNames, activeBg, !!activeBg && isInteractive), _defineProperty(_compileClassNames, text, !!text), _defineProperty(_compileClassNames, hoverText, !!hoverText && isInteractive), _defineProperty(_compileClassNames, focusText, !!focusText && isInteractive), _defineProperty(_compileClassNames, activeText, !!activeText && isInteractive), _defineProperty(_compileClassNames, border, !!border), _defineProperty(_compileClassNames, hoverBorder, !!hoverBorder && isInteractive), _defineProperty(_compileClassNames, focusBorder, !!focusBorder && isInteractive), _defineProperty(_compileClassNames, activeBorder, !!activeBorder && isInteractive), _defineProperty(_compileClassNames, sizeClass, !!sizeClass), _defineProperty(_compileClassNames, shapeClass, !!shapeClass), _defineProperty(_compileClassNames, _Button_v1Module["default"].disabledOpac, isReadOnly || isDisabled && disabledAppearance === _constants2.DISABLED_APPEARANCE.DULL), _defineProperty(_compileClassNames, _Button_v1Module["default"].disabledPointer, isReadOnly || isDisabled), _defineProperty(_compileClassNames, _Button_v1Module["default"].loading, isLoading), _defineProperty(_compileClassNames, _Button_v1Module["default"].strike, shouldStrike), _defineProperty(_compileClassNames, wrapperClass, !!wrapperClass), _compileClassNames));
|
|
82
|
+
var textClassName = (0, _compileClassNames4["default"])(_defineProperty({}, textClassCustom, !!textClassCustom));
|
|
83
|
+
var iconClassName = (0, _compileClassNames4["default"])(_defineProperty({}, iconClassCustom, !!iconClassCustom));
|
|
81
84
|
return {
|
|
82
85
|
buttonClassName: buttonClassName,
|
|
83
86
|
textClassName: textClassName,
|
|
84
87
|
contentWrapperClass: overlayActive ? _Button_v1Module["default"].overlayHidden : _Button_v1Module["default"].contentWrapper,
|
|
85
88
|
loaderOverlayClass: _Button_v1Module["default"].loaderOverlay,
|
|
86
|
-
successOverlayClass: _Button_v1Module["default"].successOverlay
|
|
89
|
+
successOverlayClass: _Button_v1Module["default"].successOverlay,
|
|
90
|
+
iconClassName: iconClassName
|
|
87
91
|
};
|
|
88
92
|
}
|
|
@@ -132,7 +132,7 @@ var buildPaletteClasses = function buildPaletteClasses(config, _ref4) {
|
|
|
132
132
|
}) : '',
|
|
133
133
|
text: isSelected ? getTextClass({
|
|
134
134
|
state: 'selected',
|
|
135
|
-
textTone: baseTextTone
|
|
135
|
+
textTone: hasBgState ? stateTextTone : baseTextTone
|
|
136
136
|
}) : getTextClass({
|
|
137
137
|
textTone: baseTextTone
|
|
138
138
|
}),
|
|
@@ -148,11 +148,14 @@ var buildPaletteClasses = function buildPaletteClasses(config, _ref4) {
|
|
|
148
148
|
state: 'active',
|
|
149
149
|
textTone: stateTextTone
|
|
150
150
|
}),
|
|
151
|
-
border: isSelected ? getBorderClass({
|
|
151
|
+
border: isSelected ? !hasBorderState ? getBorderClass({
|
|
152
|
+
tone: 'transparent'
|
|
153
|
+
}) : getBorderClass({
|
|
152
154
|
state: 'selected',
|
|
153
|
-
tone: tone
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
tone: tone
|
|
156
|
+
}) : hasTransparentBorder ? getBorderClass({
|
|
157
|
+
tone: 'transparent'
|
|
158
|
+
}) : getBorderClass({
|
|
156
159
|
tone: tone,
|
|
157
160
|
isLighter: isLighter
|
|
158
161
|
}),
|
|
@@ -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-
|
|
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 (`
|
|
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: '
|
|
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` | `
|
|
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'` \| `'
|
|
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: '
|
|
281
|
-
| `bgAppearance: '
|
|
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 `'
|
|
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,
|
|
293
|
-
hoverBg,
|
|
294
|
-
focusBg,
|
|
295
|
-
activeBg,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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: '
|
|
315
|
+
bgAppearance: 'default',
|
|
318
316
|
borderAppearance: 'visible',
|
|
319
317
|
paletteShade: 'default',
|
|
320
318
|
});
|
|
321
|
-
// classes.bg → 'bg-blue' (
|
|
319
|
+
// classes.bg → 'bg-blue' (bgAppearance: 'default' + default shade)
|
|
322
320
|
// classes.hoverBg → 'hover:bg-blue'
|
|
323
|
-
// classes.text → 'text-white' (filledTextTone —
|
|
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: '
|
|
332
|
+
bgAppearance: 'default',
|
|
335
333
|
borderAppearance: 'none',
|
|
336
334
|
paletteShade: 'lighter',
|
|
337
335
|
});
|
|
338
|
-
// classes.bg → 'bg-red-light' (
|
|
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 '
|
|
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 '
|
|
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
|
|
@@ -7,20 +7,20 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _Loader_v1Module = _interopRequireDefault(require("./Loader_v1.module.css"));
|
|
11
|
-
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("./props/propTypes"));
|
|
13
11
|
|
|
14
12
|
var _defaultProps = _interopRequireDefault(require("./props/defaultProps"));
|
|
15
13
|
|
|
14
|
+
var _Loader_v1Module = _interopRequireDefault(require("./Loader_v1.module.css"));
|
|
15
|
+
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
18
18
|
var Loader = function Loader(props) {
|
|
19
19
|
var customClass = props.customClass;
|
|
20
|
-
var _customClass$
|
|
21
|
-
|
|
20
|
+
var _customClass$wrapper = customClass.wrapper,
|
|
21
|
+
wrapper = _customClass$wrapper === void 0 ? '' : _customClass$wrapper;
|
|
22
22
|
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
23
|
-
className: "".concat(_Loader_v1Module["default"].spinner, " ").concat(
|
|
23
|
+
className: "".concat(_Loader_v1Module["default"].spinner, " ").concat(wrapper),
|
|
24
24
|
viewBox: "0 0 24 24",
|
|
25
25
|
role: "img",
|
|
26
26
|
"aria-hidden": "true"
|
|
@@ -18,7 +18,7 @@ describe('Loader', function () {
|
|
|
18
18
|
test('renders with customClass', function () {
|
|
19
19
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Loader["default"], {
|
|
20
20
|
customClass: {
|
|
21
|
-
|
|
21
|
+
wrapper: 'my-custom-class'
|
|
22
22
|
}
|
|
23
23
|
})),
|
|
24
24
|
asFragment = _render2.asFragment;
|
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _constant = require("@zohodesk/utils/es/constantProps/constant");
|
|
9
|
+
|
|
7
10
|
var defaultProps = {
|
|
8
|
-
customClass:
|
|
11
|
+
customClass: _constant.DUMMY_OBJECT
|
|
9
12
|
};
|
|
10
13
|
var _default = defaultProps;
|
|
11
14
|
exports["default"] = _default;
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var propTypes = {
|
|
13
13
|
customClass: _propTypes["default"].shape({
|
|
14
|
-
|
|
14
|
+
wrapper: _propTypes["default"].string
|
|
15
15
|
})
|
|
16
16
|
};
|
|
17
17
|
var _default = propTypes;
|
|
@@ -7,20 +7,20 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _SuccessTick_v1Module = _interopRequireDefault(require("./SuccessTick_v1.module.css"));
|
|
11
|
-
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("./props/propTypes"));
|
|
13
11
|
|
|
14
12
|
var _defaultProps = _interopRequireDefault(require("./props/defaultProps"));
|
|
15
13
|
|
|
14
|
+
var _SuccessTick_v1Module = _interopRequireDefault(require("./SuccessTick_v1.module.css"));
|
|
15
|
+
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
18
18
|
var SuccessTick = function SuccessTick(props) {
|
|
19
19
|
var customClass = props.customClass;
|
|
20
|
-
var _customClass$
|
|
21
|
-
|
|
20
|
+
var _customClass$wrapper = customClass.wrapper,
|
|
21
|
+
wrapper = _customClass$wrapper === void 0 ? '' : _customClass$wrapper;
|
|
22
22
|
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
23
|
-
className: "".concat(_SuccessTick_v1Module["default"].tick, " ").concat(
|
|
23
|
+
className: "".concat(_SuccessTick_v1Module["default"].tick, " ").concat(wrapper),
|
|
24
24
|
viewBox: "0 0 24 24",
|
|
25
25
|
role: "img",
|
|
26
26
|
"aria-hidden": "true"
|
|
@@ -18,7 +18,7 @@ describe('SuccessTick', function () {
|
|
|
18
18
|
test('renders with customClass', function () {
|
|
19
19
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_SuccessTick["default"], {
|
|
20
20
|
customClass: {
|
|
21
|
-
|
|
21
|
+
wrapper: 'my-custom-class'
|
|
22
22
|
}
|
|
23
23
|
})),
|
|
24
24
|
asFragment = _render2.asFragment;
|
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _constant = require("@zohodesk/utils/es/constantProps/constant");
|
|
9
|
+
|
|
7
10
|
var defaultProps = {
|
|
8
|
-
customClass:
|
|
11
|
+
customClass: _constant.DUMMY_OBJECT
|
|
9
12
|
};
|
|
10
13
|
var _default = defaultProps;
|
|
11
14
|
exports["default"] = _default;
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var propTypes = {
|
|
13
13
|
customClass: _propTypes["default"].shape({
|
|
14
|
-
|
|
14
|
+
wrapper: _propTypes["default"].string
|
|
15
15
|
})
|
|
16
16
|
};
|
|
17
17
|
var _default = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.14",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"download_only": "react-cli clean ./node_modules ./package-lock.json && npm install --legacy-peer-deps",
|
|
47
47
|
"expublish": "node ../publish.js -- exp",
|
|
48
48
|
"css:lineheight:validate": "npx z-node-plugins lineheight:errorcheck ./src/",
|
|
49
|
-
"variable:addignore": "
|
|
50
|
-
"variable:convert": "
|
|
51
|
-
"variable:check": "
|
|
49
|
+
"variable:addignore": "npx css-variable-migrator addignore ./src",
|
|
50
|
+
"variable:convert": "npx css-variable-migrator convert ./src",
|
|
51
|
+
"variable:check": "npx css-variable-migrator check ./src",
|
|
52
52
|
"css:review": " npm run dubCheck && npm run css:lineheight:validate && npm run theme:validate ",
|
|
53
53
|
"theme:validate": "npx z-node-plugins theme:validate ./src ./.cli ./.cli/themeValidate/stringContains.js",
|
|
54
54
|
"theme:addignore": "npx z-node-plugins theme:addignore ./src ./.cli ./.cli/themeValidate/stringContains.js",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"css:layer_config_validate": "npx z-node-plugins css:layer_validate css_layer_config.json ./src/ ./assets",
|
|
62
62
|
"css:build": "npm run css:layer_config_validate && npm run css:layer_generate_order && npm run build",
|
|
63
63
|
"css:layer_remove": "npx z-node-plugins css:layer_remove ./es ./assets css_layer_config.json --rewrite=src=es --rewrite=assets=assets",
|
|
64
|
-
"css:audit": "npx css-audit
|
|
64
|
+
"css:audit:report": "npx css-audit --common-css=../node_modules/@dot-system/css-utility/es/utilities.plain.css --dir src --port 8085 --report",
|
|
65
|
+
"css:audit:css-utility": "npx css-audit --common-css=../node_modules/@dot-system/css-utility/es/utilities.plain.css --error on --dir src",
|
|
65
66
|
"cssVariableConvert": "react-cli variableConverter ./lib ./lib && react-cli variableConverter ./es ./es",
|
|
66
67
|
"publish": "node ../publish.js",
|
|
67
68
|
"check_package": "node ../check_dependencies.js"
|
|
@@ -72,16 +73,16 @@
|
|
|
72
73
|
"@testing-library/react": "^11.2.5",
|
|
73
74
|
"@testing-library/react-hooks": "^7.0.2",
|
|
74
75
|
"@testing-library/user-event": "^13.0.10",
|
|
75
|
-
"@
|
|
76
|
+
"@dot-system/css-audit-tool": "1.0.0",
|
|
76
77
|
"@zohodesk-private/color-variable-preprocessor": "1.3.1",
|
|
77
|
-
"@zohodesk-private/css-variable-migrator": "1.0.
|
|
78
|
+
"@zohodesk-private/css-variable-migrator": "1.0.11",
|
|
78
79
|
"@zohodesk-private/node-plugins": "1.1.14",
|
|
79
80
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
80
81
|
"@zohodesk/a11y": "2.3.9",
|
|
81
82
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
82
83
|
"@zohodesk/dotkit": "1.0.9",
|
|
83
84
|
"@zohodesk/hooks": "2.0.8",
|
|
84
|
-
"@zohodesk/icons": "1.3.
|
|
85
|
+
"@zohodesk/icons": "1.3.3",
|
|
85
86
|
"@zohodesk/layout": "3.1.0",
|
|
86
87
|
"@zohodesk/svg": "1.3.5",
|
|
87
88
|
"@zohodesk/utils": "1.3.16",
|
|
@@ -101,7 +102,7 @@
|
|
|
101
102
|
"selectn": "1.1.2"
|
|
102
103
|
},
|
|
103
104
|
"peerDependencies": {
|
|
104
|
-
"@zohodesk/icons": "1.3.
|
|
105
|
+
"@zohodesk/icons": "1.3.3",
|
|
105
106
|
"@zohodesk/variables": "1.3.1",
|
|
106
107
|
"@zohodesk/svg": "1.3.5",
|
|
107
108
|
"@zohodesk/virtualizer": "1.0.13",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/v1/{Button/_shared → shared}/Loader/__tests__/__snapshots__/Loader.spec.js.snap
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|