@loomhq/lens 10.63.3 → 10.63.5

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.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  function SvgPinFill(props) {
3
- return (React.createElement("svg", Object.assign({ style: { '--shapeWidth': 16 }, viewBox: "0 0 24 24", fill: "none" }, props),
3
+ return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
4
4
  React.createElement("path", { clipRule: "evenodd", d: "m17.6715 3.98605-1.5123 2.7192v2.54571c1.7588.78714 3.0316 2.13554 3.3321 4.25134.0777.5468-.3797.9977-.932.9977h-3.805l-1.7928 6.2747c-.1227.4293-.515.7253-.9615.7253s-.8389-.296-.9615-.7253l-1.79283-6.2747h-3.80502c-.55229 0-1.00969-.4509-.93202-.9977.31058-2.1863 1.65931-3.55321 3.50969-4.32819v-2.46852l-1.51251-2.71954c-.37071-.66654.11124-1.48605.87393-1.48605h9.41776c.7627 0 1.2447.81951.874 1.48605z", fill: "currentColor", fillRule: "evenodd" })));
5
5
  }
6
6
  export default SvgPinFill;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  function SvgPin(props) {
3
- return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", style: { '--shapeWidth': 16 } }, props),
3
+ return (React.createElement("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none" }, props),
4
4
  React.createElement("path", { clipRule: "evenodd", d: "m15.0971 4.5-.9379 1.6865v4.3605l1.183.5295c.7848.3512 1.3635.8089 1.7325 1.4235h-10.14909c.38822-.6465 1.00982-1.1228 1.86533-1.4812l1.22736-.514v-4.31796l-.93814-1.68684zm2.5744-.51395-1.5123 2.7192v2.54571c1.7588.78714 3.0316 2.13554 3.3321 4.25134.0777.5468-.3797.9977-.932.9977h-3.805l-1.7928 6.2747c-.1227.4293-.515.7253-.9615.7253s-.8389-.296-.9615-.7253l-1.79283-6.2747h-3.80502c-.55229 0-1.00969-.4509-.93202-.9977.31058-2.1863 1.65931-3.55321 3.50969-4.32819v-2.46852l-1.51251-2.71954c-.37071-.66654.11124-1.48605.87393-1.48605h9.41776c.7627 0 1.2447.81951.874 1.48605zm-6.3458 10.51395.6743 2.3599.6742-2.3599z", fill: "currentColor", fillRule: "evenodd" })));
5
5
  }
6
6
  export default SvgPin;
@@ -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';
@@ -60,6 +60,14 @@ const SwitchLabel = styled.label `
60
60
  const SwitchInput = styled.input `
61
61
  position: absolute;
62
62
  opacity: 0;
63
+ cursor: pointer;
64
+
65
+ // to overlap SwitchBox and occupy the same space
66
+ z-index: 1;
67
+ margin: 0;
68
+ width: ${props => sizes[props.switchSize].switchWidth}px;
69
+ height: ${props => sizes[props.switchSize].switchHeight}px;
70
+
63
71
  &:focus-visible ~ .SwitchBox {
64
72
  ${getFocusRing()};
65
73
  }
@@ -108,9 +116,12 @@ const SwitchBox = styled.div `
108
116
  }
109
117
  `;
110
118
  const Switch = (_a) => {
111
- var { isActive, isDisabled, onChange, size = 'medium' } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange", "size"]);
119
+ var { isActive, isDisabled, onChange, size = 'medium', ariaLabelledby, ariaLabel } = _a, props = __rest(_a, ["isActive", "isDisabled", "onChange", "size", "ariaLabelledby", "ariaLabel"]);
120
+ if (ariaLabelledby && ariaLabel) {
121
+ 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.');
122
+ }
112
123
  return (React.createElement(SwitchLabel, null,
113
- React.createElement(SwitchInput, Object.assign({}, props, { checked: isActive, disabled: isDisabled, onChange: onChange, type: "checkbox", switchSize: size })),
124
+ React.createElement(SwitchInput, Object.assign({}, props, { checked: isActive, disabled: isDisabled, onChange: onChange, type: "checkbox", switchSize: size, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-checked": isActive })),
114
125
  React.createElement(SwitchBox, { className: "SwitchBox", isDisabled: isDisabled, isActive: isActive, switchSize: size })));
115
126
  };
116
127
  export default Switch;
@@ -18,7 +18,7 @@ declare type TooltipProps = {
18
18
  children?: React.ReactNode;
19
19
  container?: HTMLElement | (() => HTMLElement) | string;
20
20
  content?: React.ReactNode;
21
- shortcut?: [];
21
+ shortcut?: string[];
22
22
  isDisabled?: boolean;
23
23
  isInline?: boolean;
24
24
  keepOpen?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.63.3",
3
+ "version": "10.63.5",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",