@loomhq/lens 10.60.0 → 10.61.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/dist/colors.js
CHANGED
|
@@ -104,12 +104,12 @@ export const hslaBaseColors = {
|
|
|
104
104
|
};
|
|
105
105
|
export const hslaGreys = {
|
|
106
106
|
grey8: { h: 0, s: 0, l: 13, a: 1 },
|
|
107
|
-
grey7: { h:
|
|
107
|
+
grey7: { h: 246, s: 16, l: 26, a: 1 },
|
|
108
108
|
grey6: { h: 252, s: 13, l: 46, a: 1 },
|
|
109
109
|
grey5: { h: 240, s: 7, l: 62, a: 1 },
|
|
110
|
-
grey4: { h:
|
|
111
|
-
grey3: { h:
|
|
112
|
-
grey2: { h:
|
|
110
|
+
grey4: { h: 259, s: 12, l: 75, a: 1 },
|
|
111
|
+
grey3: { h: 260, s: 11, l: 85, a: 1 },
|
|
112
|
+
grey2: { h: 260, s: 11, l: 95, a: 1 },
|
|
113
113
|
grey1: { h: 240, s: 7, l: 97, a: 1 },
|
|
114
114
|
white: { h: 240, s: 7, l: 100, a: 1 },
|
|
115
115
|
};
|
|
@@ -16,7 +16,7 @@ const SvgCheckboxCheck = props => (React.createElement("svg", Object.assign({ wi
|
|
|
16
16
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.707.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-3-3a1 1 0 011.414-1.414L4 6.586 10.293.293a1 1 0 011.414 0z", fill: "currentColor" })));
|
|
17
17
|
const SvgCheckboxMinus = props => (React.createElement("svg", Object.assign({ width: 12, height: 2, viewBox: "0 0 12 2", fill: "none" }, props),
|
|
18
18
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 1a1 1 0 011-1h10a1 1 0 110 2H1a1 1 0 01-1-1z", fill: "currentColor" })));
|
|
19
|
-
const
|
|
19
|
+
const CheckboxWrapper = styled.div `
|
|
20
20
|
display: block;
|
|
21
21
|
position: relative;
|
|
22
22
|
`;
|
|
@@ -85,8 +85,8 @@ const Checkbox = forwardRef((_a, ref) => {
|
|
|
85
85
|
useEffect(() => {
|
|
86
86
|
checkboxRef.current.indeterminate = isIndeterminate;
|
|
87
87
|
});
|
|
88
|
-
return (React.createElement(
|
|
89
|
-
React.createElement(CheckboxInput, Object.assign({ type: "checkbox", disabled: isDisabled, checked: isChecked, onFocus: onFocus, onChange: onChange, onBlur: onBlur, ref: checkboxRef }, props)),
|
|
88
|
+
return (React.createElement(CheckboxWrapper, null,
|
|
89
|
+
React.createElement(CheckboxInput, Object.assign({ role: "checkbox", type: "checkbox", disabled: isDisabled, checked: isChecked, onFocus: onFocus, onChange: onChange, onBlur: onBlur, ref: checkboxRef, "aria-checked": isChecked }, props)),
|
|
90
90
|
React.createElement(CheckboxBox, { className: "CheckboxBox" },
|
|
91
91
|
React.createElement(SvgCheckboxMinus, { className: "Icon IconMinus", color: iconColor }),
|
|
92
92
|
React.createElement(SvgCheckboxCheck, { className: "Icon IconCheck", color: iconColor }))));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const SwitchInput: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, SwitchInputProps, object>;
|
|
3
|
-
declare const Switch: ({ isActive, isDisabled, onChange, size, ...props }: SwitchProps & Omit<React.ComponentProps<typeof SwitchInput>, 'size'>) => JSX.Element;
|
|
3
|
+
declare const Switch: ({ isActive, isDisabled, onChange, size, ariaLabelledby, ariaLabel, ...props }: SwitchProps & Omit<React.ComponentProps<typeof SwitchInput>, 'size'>) => JSX.Element;
|
|
4
4
|
declare type SwitchProps = {
|
|
5
5
|
isActive?: boolean;
|
|
6
6
|
isDisabled?: boolean;
|
|
7
7
|
onChange?: React.ReactEventHandler;
|
|
8
8
|
size?: 'medium' | 'large';
|
|
9
|
+
ariaLabelledby?: string;
|
|
10
|
+
ariaLabel?: string;
|
|
9
11
|
};
|
|
10
12
|
declare type SwitchInputProps = {
|
|
11
13
|
switchSize?: 'medium' | 'large';
|
|
@@ -53,7 +53,7 @@ const getKnobSize = props => {
|
|
|
53
53
|
return (sizes[props.switchSize].switchHeight -
|
|
54
54
|
sizes[props.switchSize].knobOffset * 2);
|
|
55
55
|
};
|
|
56
|
-
const
|
|
56
|
+
const SwitchWrapper = styled.div `
|
|
57
57
|
display: block;
|
|
58
58
|
position: relative;
|
|
59
59
|
`;
|
|
@@ -113,9 +113,12 @@ const SwitchBox = styled.div `
|
|
|
113
113
|
}
|
|
114
114
|
`;
|
|
115
115
|
const Switch = (_a) => {
|
|
116
|
-
var { isActive, isDisabled, onChange, size = 'medium' } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange", "size"]);
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
var { isActive, isDisabled, onChange, size = 'medium', ariaLabelledby, ariaLabel } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange", "size", "ariaLabelledby", "ariaLabel"]);
|
|
117
|
+
if (ariaLabelledby && ariaLabel) {
|
|
118
|
+
throw new Error('ariaLabelledby and ariaLabel serve the same purpose and therefore cannot be used at the same time. Choose the one that best suites your needs. ');
|
|
119
|
+
}
|
|
120
|
+
return (React.createElement(SwitchWrapper, null,
|
|
121
|
+
React.createElement(SwitchInput, Object.assign({}, props, { role: "switch", type: "checkbox", checked: isActive, disabled: isDisabled, onChange: onChange, switchSize: size, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-checked": isActive })),
|
|
119
122
|
React.createElement(SwitchBox, { className: "SwitchBox", isDisabled: isDisabled, isActive: isActive, switchSize: size })));
|
|
120
123
|
};
|
|
121
124
|
export default Switch;
|