@westpac/ui 0.38.0 → 0.40.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/CHANGELOG.md +12 -0
- package/dist/component-type.json +1 -1
- package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.js +5 -3
- package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js +5 -3
- package/dist/components/selector/components/selector-checkbox-group/components/selector-checkbox-group-option/selector-checkbox-group-option.component.js +4 -1
- package/dist/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.js +4 -1
- package/package.json +1 -1
- package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.tsx +5 -5
- package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx +4 -4
- package/src/components/selector/components/selector-checkbox-group/components/selector-checkbox-group-option/selector-checkbox-group-option.component.tsx +5 -1
- package/src/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.tsx +5 -1
|
@@ -51,15 +51,17 @@ function BaseCheckbox({ className , hint , label , value , ...props }, ref) {
|
|
|
51
51
|
className
|
|
52
52
|
}),
|
|
53
53
|
ref: ref
|
|
54
|
-
}, React.createElement(VisuallyHidden,
|
|
54
|
+
}, React.createElement(VisuallyHidden, {
|
|
55
|
+
elementType: "span"
|
|
56
|
+
}, React.createElement("input", _extends({}, inputProps, focusProps, {
|
|
55
57
|
ref: localRef
|
|
56
|
-
}))), React.createElement("
|
|
58
|
+
}))), React.createElement("span", {
|
|
57
59
|
className: styles.checkbox()
|
|
58
60
|
}, isSelected && React.createElement(CheckIcon, {
|
|
59
61
|
className: styles.checkIcon(),
|
|
60
62
|
size: size,
|
|
61
63
|
color: isDisabled ? 'border' : 'hero'
|
|
62
|
-
})), React.createElement("
|
|
64
|
+
})), React.createElement("span", {
|
|
63
65
|
className: styles.textWrapper()
|
|
64
66
|
}, React.createElement("span", {
|
|
65
67
|
className: styles.labelText()
|
package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js
CHANGED
|
@@ -37,11 +37,13 @@ function BaseRadioGroupRadio({ className , hint , label , ...props }, ref) {
|
|
|
37
37
|
className
|
|
38
38
|
}),
|
|
39
39
|
ref: ref
|
|
40
|
-
}, React.createElement(VisuallyHidden,
|
|
40
|
+
}, React.createElement(VisuallyHidden, {
|
|
41
|
+
elementType: "span"
|
|
42
|
+
}, React.createElement("input", _extends({}, inputProps, focusProps, {
|
|
41
43
|
ref: localRef
|
|
42
|
-
}))), React.createElement("
|
|
44
|
+
}))), React.createElement("span", {
|
|
43
45
|
className: styles.selector()
|
|
44
|
-
}), React.createElement("
|
|
46
|
+
}), React.createElement("span", {
|
|
45
47
|
className: styles.textWrapper()
|
|
46
48
|
}, React.createElement("span", {
|
|
47
49
|
className: styles.labelText()
|
|
@@ -36,6 +36,9 @@ function BaseSelectorCheckboxGroupOption({ className , children , value , withBo
|
|
|
36
36
|
checkIcon
|
|
37
37
|
});
|
|
38
38
|
const FinalIcon = checkIcon === 'checkbox' ? TickIcon : ArrowRightIcon;
|
|
39
|
+
const onItemClick = ()=>{
|
|
40
|
+
state.toggleValue(value);
|
|
41
|
+
};
|
|
39
42
|
return React.createElement(FlexiCell, {
|
|
40
43
|
after: React.createElement("div", {
|
|
41
44
|
className: "flex gap-2"
|
|
@@ -46,8 +49,8 @@ function BaseSelectorCheckboxGroupOption({ className , children , value , withBo
|
|
|
46
49
|
before: before,
|
|
47
50
|
withBorder: withBorder,
|
|
48
51
|
withArrow: withArrow,
|
|
49
|
-
tag: "label",
|
|
50
52
|
ref: ref,
|
|
53
|
+
onClick: onItemClick,
|
|
51
54
|
className: styles.base({})
|
|
52
55
|
}, React.createElement(VisuallyHidden, null, React.createElement("input", _extends({}, mergeProps(inputProps, focusProps), {
|
|
53
56
|
ref: localRef
|
|
@@ -36,6 +36,9 @@ function BaseSelectorRadioGroupOption({ className , children , value , withBorde
|
|
|
36
36
|
checkIcon
|
|
37
37
|
});
|
|
38
38
|
const FinalIcon = checkIcon === 'checkbox' ? TickIcon : ArrowRightIcon;
|
|
39
|
+
const onItemClick = ()=>{
|
|
40
|
+
state.setSelectedValue(value);
|
|
41
|
+
};
|
|
39
42
|
return React.createElement(FlexiCell, {
|
|
40
43
|
after: React.createElement("div", {
|
|
41
44
|
className: "flex gap-2"
|
|
@@ -46,8 +49,8 @@ function BaseSelectorRadioGroupOption({ className , children , value , withBorde
|
|
|
46
49
|
before: before,
|
|
47
50
|
withBorder: withBorder,
|
|
48
51
|
withArrow: withArrow,
|
|
49
|
-
tag: "label",
|
|
50
52
|
ref: ref,
|
|
53
|
+
onClick: onItemClick,
|
|
51
54
|
className: styles.base({})
|
|
52
55
|
}, React.createElement(VisuallyHidden, null, React.createElement("input", _extends({}, mergeProps(inputProps, focusProps), {
|
|
53
56
|
ref: localRef
|
package/package.json
CHANGED
|
@@ -47,16 +47,16 @@ function BaseCheckbox(
|
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
49
|
<label className={styles.base({ className })} ref={ref}>
|
|
50
|
-
<VisuallyHidden>
|
|
50
|
+
<VisuallyHidden elementType="span">
|
|
51
51
|
<input {...inputProps} {...focusProps} ref={localRef} />
|
|
52
52
|
</VisuallyHidden>
|
|
53
|
-
<
|
|
53
|
+
<span className={styles.checkbox()}>
|
|
54
54
|
{isSelected && <CheckIcon className={styles.checkIcon()} size={size} color={isDisabled ? 'border' : 'hero'} />}
|
|
55
|
-
</
|
|
56
|
-
<
|
|
55
|
+
</span>
|
|
56
|
+
<span className={styles.textWrapper()}>
|
|
57
57
|
<span className={styles.labelText()}>{label}</span>
|
|
58
58
|
{hint && <span className={styles.hintText()}>{hint}</span>}
|
|
59
|
-
</
|
|
59
|
+
</span>
|
|
60
60
|
</label>
|
|
61
61
|
);
|
|
62
62
|
}
|
package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx
CHANGED
|
@@ -17,14 +17,14 @@ function BaseRadioGroupRadio({ className, hint, label, ...props }: RadioGroupRad
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<label className={styles.base({ className })} ref={ref}>
|
|
20
|
-
<VisuallyHidden>
|
|
20
|
+
<VisuallyHidden elementType="span">
|
|
21
21
|
<input {...inputProps} {...focusProps} ref={localRef} />
|
|
22
22
|
</VisuallyHidden>
|
|
23
|
-
<
|
|
24
|
-
<
|
|
23
|
+
<span className={styles.selector()} />
|
|
24
|
+
<span className={styles.textWrapper()}>
|
|
25
25
|
<span className={styles.labelText()}>{label}</span>
|
|
26
26
|
{hint && <span className={styles.hintText()}>{hint}</span>}
|
|
27
|
-
</
|
|
27
|
+
</span>
|
|
28
28
|
</label>
|
|
29
29
|
);
|
|
30
30
|
}
|
|
@@ -38,6 +38,10 @@ function BaseSelectorCheckboxGroupOption(
|
|
|
38
38
|
|
|
39
39
|
const FinalIcon = checkIcon === 'checkbox' ? TickIcon : ArrowRightIcon;
|
|
40
40
|
|
|
41
|
+
const onItemClick = () => {
|
|
42
|
+
state.toggleValue(value);
|
|
43
|
+
};
|
|
44
|
+
|
|
41
45
|
return (
|
|
42
46
|
<FlexiCell
|
|
43
47
|
after={
|
|
@@ -49,8 +53,8 @@ function BaseSelectorCheckboxGroupOption(
|
|
|
49
53
|
before={before}
|
|
50
54
|
withBorder={withBorder}
|
|
51
55
|
withArrow={withArrow}
|
|
52
|
-
tag="label"
|
|
53
56
|
ref={ref}
|
|
57
|
+
onClick={onItemClick}
|
|
54
58
|
className={styles.base({})}
|
|
55
59
|
>
|
|
56
60
|
<VisuallyHidden>
|
|
@@ -32,6 +32,10 @@ function BaseSelectorRadioGroupOption(
|
|
|
32
32
|
|
|
33
33
|
const FinalIcon = checkIcon === 'checkbox' ? TickIcon : ArrowRightIcon;
|
|
34
34
|
|
|
35
|
+
const onItemClick = () => {
|
|
36
|
+
state.setSelectedValue(value);
|
|
37
|
+
};
|
|
38
|
+
|
|
35
39
|
return (
|
|
36
40
|
<FlexiCell
|
|
37
41
|
after={
|
|
@@ -43,8 +47,8 @@ function BaseSelectorRadioGroupOption(
|
|
|
43
47
|
before={before}
|
|
44
48
|
withBorder={withBorder}
|
|
45
49
|
withArrow={withArrow}
|
|
46
|
-
tag="label"
|
|
47
50
|
ref={ref}
|
|
51
|
+
onClick={onItemClick}
|
|
48
52
|
className={styles.base({})}
|
|
49
53
|
>
|
|
50
54
|
<VisuallyHidden>
|