@react-spectrum/switch 3.0.0-nightly.1998 → 3.0.0-nightly.2005

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 (2) hide show
  1. package/dist/import.mjs +114 -0
  2. package/package.json +17 -12
@@ -0,0 +1,114 @@
1
+ import "./main.css";
2
+ import {useStyleProps as $8Tpjb$useStyleProps, useFocusableRef as $8Tpjb$useFocusableRef, classNames as $8Tpjb$classNames} from "@react-spectrum/utils";
3
+ import {FocusRing as $8Tpjb$FocusRing} from "@react-aria/focus";
4
+ import $8Tpjb$react, {useRef as $8Tpjb$useRef, forwardRef as $8Tpjb$forwardRef} from "react";
5
+ import {useHover as $8Tpjb$useHover} from "@react-aria/interactions";
6
+ import {useProviderProps as $8Tpjb$useProviderProps} from "@react-spectrum/provider";
7
+ import {useSwitch as $8Tpjb$useSwitch} from "@react-aria/switch";
8
+ import {useToggleState as $8Tpjb$useToggleState} from "@react-stately/toggle";
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+ /*
17
+ * Copyright 2020 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */ /// <reference types="css-module-types" />
27
+ /*
28
+ * Copyright 2020 Adobe. All rights reserved.
29
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
30
+ * you may not use this file except in compliance with the License. You may obtain a copy
31
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
32
+ *
33
+ * Unless required by applicable law or agreed to in writing, software distributed under
34
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
35
+ * OF ANY KIND, either express or implied. See the License for the specific language
36
+ * governing permissions and limitations under the License.
37
+ */
38
+
39
+
40
+ var $dfcff93ab25bb9b3$exports = {};
41
+
42
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch", () => $dfcff93ab25bb9b3$export$89a9162656c0c38c, (v) => $dfcff93ab25bb9b3$export$89a9162656c0c38c = v);
43
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-input", () => $dfcff93ab25bb9b3$export$38df7ea4ffef819a, (v) => $dfcff93ab25bb9b3$export$38df7ea4ffef819a = v);
44
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-switch", () => $dfcff93ab25bb9b3$export$b82d06d1b520a22f, (v) => $dfcff93ab25bb9b3$export$b82d06d1b520a22f = v);
45
+ $parcel$export($dfcff93ab25bb9b3$exports, "focus-ring", () => $dfcff93ab25bb9b3$export$f39a09f249340e2a, (v) => $dfcff93ab25bb9b3$export$f39a09f249340e2a = v);
46
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch-label", () => $dfcff93ab25bb9b3$export$8f1a69021a3897b2, (v) => $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = v);
47
+ $parcel$export($dfcff93ab25bb9b3$exports, "is-hovered", () => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7, (v) => $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = v);
48
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--quiet", () => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4, (v) => $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = v);
49
+ $parcel$export($dfcff93ab25bb9b3$exports, "spectrum-ToggleSwitch--ab", () => $dfcff93ab25bb9b3$export$dc5a33fddabf5882, (v) => $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = v);
50
+ var $dfcff93ab25bb9b3$export$89a9162656c0c38c;
51
+ var $dfcff93ab25bb9b3$export$38df7ea4ffef819a;
52
+ var $dfcff93ab25bb9b3$export$b82d06d1b520a22f;
53
+ var $dfcff93ab25bb9b3$export$f39a09f249340e2a;
54
+ var $dfcff93ab25bb9b3$export$8f1a69021a3897b2;
55
+ var $dfcff93ab25bb9b3$export$b8813cd5d7824ce7;
56
+ var $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4;
57
+ var $dfcff93ab25bb9b3$export$dc5a33fddabf5882;
58
+ $dfcff93ab25bb9b3$export$89a9162656c0c38c = "spectrum-ToggleSwitch_3526dd";
59
+ $dfcff93ab25bb9b3$export$38df7ea4ffef819a = "spectrum-ToggleSwitch-input_3526dd";
60
+ $dfcff93ab25bb9b3$export$b82d06d1b520a22f = "spectrum-ToggleSwitch-switch_3526dd";
61
+ $dfcff93ab25bb9b3$export$f39a09f249340e2a = "focus-ring_3526dd";
62
+ $dfcff93ab25bb9b3$export$8f1a69021a3897b2 = "spectrum-ToggleSwitch-label_3526dd";
63
+ $dfcff93ab25bb9b3$export$b8813cd5d7824ce7 = "is-hovered_3526dd";
64
+ $dfcff93ab25bb9b3$export$ce1b1dcfc10f3df4 = "spectrum-ToggleSwitch--quiet_3526dd";
65
+ $dfcff93ab25bb9b3$export$dc5a33fddabf5882 = "spectrum-ToggleSwitch--ab_3526dd";
66
+
67
+
68
+
69
+
70
+
71
+
72
+ function $8341c396cee1c5fc$var$Switch(props, ref) {
73
+ props = (0, $8Tpjb$useProviderProps)(props);
74
+ let { isEmphasized: isEmphasized = false , isDisabled: isDisabled = false , autoFocus: autoFocus , children: children , ...otherProps } = props;
75
+ let { styleProps: styleProps } = (0, $8Tpjb$useStyleProps)(otherProps);
76
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $8Tpjb$useHover)({
77
+ isDisabled: isDisabled
78
+ });
79
+ let inputRef = (0, $8Tpjb$useRef)(null);
80
+ let domRef = (0, $8Tpjb$useFocusableRef)(ref, inputRef);
81
+ let state = (0, $8Tpjb$useToggleState)(props);
82
+ let { inputProps: inputProps } = (0, $8Tpjb$useSwitch)(props, state, inputRef);
83
+ return /*#__PURE__*/ (0, $8Tpjb$react).createElement("label", {
84
+ ...styleProps,
85
+ ...hoverProps,
86
+ ref: domRef,
87
+ className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch", {
88
+ "spectrum-ToggleSwitch--quiet": !isEmphasized,
89
+ "is-disabled": isDisabled,
90
+ "is-hovered": isHovered
91
+ }, styleProps.className)
92
+ }, /*#__PURE__*/ (0, $8Tpjb$react).createElement((0, $8Tpjb$FocusRing), {
93
+ focusRingClass: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "focus-ring"),
94
+ autoFocus: autoFocus
95
+ }, /*#__PURE__*/ (0, $8Tpjb$react).createElement("input", {
96
+ ...inputProps,
97
+ ref: inputRef,
98
+ className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-input")
99
+ })), /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
100
+ className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-switch")
101
+ }), children && /*#__PURE__*/ (0, $8Tpjb$react).createElement("span", {
102
+ className: (0, $8Tpjb$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($dfcff93ab25bb9b3$exports))), "spectrum-ToggleSwitch-label")
103
+ }, children));
104
+ }
105
+ /**
106
+ * Switches allow users to turn an individual option on or off.
107
+ * They are usually used to activate or deactivate a specific setting.
108
+ */ const $8341c396cee1c5fc$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $8Tpjb$forwardRef)($8341c396cee1c5fc$var$Switch);
109
+
110
+
111
+
112
+
113
+ export {$8341c396cee1c5fc$export$b5d5cf8927ab7262 as Switch};
114
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/switch",
3
- "version": "3.0.0-nightly.1998+72ee92f6d",
3
+ "version": "3.0.0-nightly.2005+93b3c951e",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,19 +36,19 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@react-aria/focus": "3.0.0-nightly.1998+72ee92f6d",
35
- "@react-aria/interactions": "3.0.0-nightly.1998+72ee92f6d",
36
- "@react-aria/switch": "3.0.0-nightly.1998+72ee92f6d",
37
- "@react-aria/utils": "3.0.0-nightly.1998+72ee92f6d",
38
- "@react-spectrum/utils": "3.0.0-nightly.1998+72ee92f6d",
39
- "@react-stately/toggle": "3.0.0-nightly.1998+72ee92f6d",
40
- "@react-types/shared": "3.0.0-nightly.1998+72ee92f6d",
41
- "@react-types/switch": "3.0.0-nightly.1998+72ee92f6d",
42
- "@spectrum-icons/ui": "3.0.0-nightly.1998+72ee92f6d",
39
+ "@react-aria/focus": "3.0.0-nightly.2005+93b3c951e",
40
+ "@react-aria/interactions": "3.0.0-nightly.2005+93b3c951e",
41
+ "@react-aria/switch": "3.0.0-nightly.2005+93b3c951e",
42
+ "@react-aria/utils": "3.0.0-nightly.2005+93b3c951e",
43
+ "@react-spectrum/utils": "3.0.0-nightly.2005+93b3c951e",
44
+ "@react-stately/toggle": "3.0.0-nightly.2005+93b3c951e",
45
+ "@react-types/shared": "3.0.0-nightly.2005+93b3c951e",
46
+ "@react-types/switch": "3.0.0-nightly.2005+93b3c951e",
47
+ "@spectrum-icons/ui": "3.0.0-nightly.2005+93b3c951e",
43
48
  "@swc/helpers": "^0.4.14"
44
49
  },
45
50
  "devDependencies": {
46
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1998+72ee92f6d"
51
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2005+93b3c951e"
47
52
  },
48
53
  "peerDependencies": {
49
54
  "@react-spectrum/provider": "^3.0.0",
@@ -52,5 +57,5 @@
52
57
  "publishConfig": {
53
58
  "access": "public"
54
59
  },
55
- "gitHead": "72ee92f6d497163468a80642ccb96576f822f365"
60
+ "gitHead": "93b3c951eb784b14183f9988f2d188b34de8f42d"
56
61
  }