@elliemae/ds-hidden 3.0.0-next.9 → 3.0.1

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/cjs/index.js CHANGED
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var src_exports = {};
29
22
  __export(src_exports, {
30
23
  default: () => src_default,
@@ -33,6 +26,7 @@ __export(src_exports, {
33
26
  useHiddenTransition: () => import_useHiddenTransition2.default,
34
27
  useHiddenTrigger: () => import_useHiddenTrigger2.default
35
28
  });
29
+ module.exports = __toCommonJS(src_exports);
36
30
  var React = __toESM(require("react"));
37
31
  var import_useHiddenProps = __toESM(require("./useHiddenProps"));
38
32
  var import_useHiddenController = __toESM(require("./useHiddenController"));
@@ -48,5 +42,4 @@ var src_default = {
48
42
  useHiddenTransition: import_useHiddenTransition.default,
49
43
  useHiddenTrigger: import_useHiddenTrigger.default
50
44
  };
51
- module.exports = __toCommonJS(src_exports);
52
45
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import useHiddenProps from './useHiddenProps';\nimport useHiddenController from './useHiddenController';\nimport useHiddenTransition from './useHiddenTransition';\nimport useHiddenTrigger from './useHiddenTrigger';\n\nexport { default as useHiddenProps } from './useHiddenProps';\nexport { default as useHiddenController } from './useHiddenController';\nexport { default as useHiddenTransition } from './useHiddenTransition';\nexport { default as useHiddenTrigger } from './useHiddenTrigger';\n\nexport default {\n useHiddenProps,\n useHiddenController,\n useHiddenTransition,\n useHiddenTrigger,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAA2B;AAC3B,iCAAgC;AAChC,iCAAgC;AAChC,8BAA6B;AAE7B,6BAA0C;AAC1C,kCAA+C;AAC/C,kCAA+C;AAC/C,+BAA4C;AAE5C,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAA2B;AAC3B,iCAAgC;AAChC,iCAAgC;AAChC,8BAA6B;AAE7B,6BAA0C;AAC1C,kCAA+C;AAC/C,kCAA+C;AAC/C,+BAA4C;AAE5C,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var useHiddenController_exports = {};
29
22
  __export(useHiddenController_exports, {
30
23
  default: () => useHiddenController_default
31
24
  });
25
+ module.exports = __toCommonJS(useHiddenController_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_react = require("react");
34
28
  const useHiddenController = (initialState = void 0) => {
@@ -44,5 +38,4 @@ const useHiddenController = (initialState = void 0) => {
44
38
  };
45
39
  };
46
40
  var useHiddenController_default = useHiddenController;
47
- module.exports = __toCommonJS(useHiddenController_exports);
48
41
  //# sourceMappingURL=useHiddenController.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useHiddenController.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useCallback, useState } from 'react';\n\nconst useHiddenController = (initialState = undefined) => {\n const [visible, setVisible] = useState(initialState);\n\n const onShow = useCallback(() => setVisible(true), [visible]);\n const onHide = useCallback(() => setVisible(false), [visible]);\n const onToggle = useCallback(() => setVisible(!visible), [visible]);\n\n return {\n onShow,\n onHide,\n onToggle,\n visible: initialState !== undefined ? initialState : visible,\n };\n};\n\nexport default useHiddenController;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AAEtC,MAAM,sBAAsB,CAAC,eAAe,WAAc;AACxD,QAAM,CAAC,SAAS,cAAc,2BAAS;AAEvC,QAAM,SAAS,8BAAY,MAAM,WAAW,OAAO,CAAC;AACpD,QAAM,SAAS,8BAAY,MAAM,WAAW,QAAQ,CAAC;AACrD,QAAM,WAAW,8BAAY,MAAM,WAAW,CAAC,UAAU,CAAC;AAE1D,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,iBAAiB,SAAY,eAAe;AAAA;AAAA;AAIzD,IAAO,8BAAQ;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AAEtC,MAAM,sBAAsB,CAAC,eAAe,WAAc;AACxD,QAAM,CAAC,SAAS,cAAc,2BAAS,YAAY;AAEnD,QAAM,SAAS,8BAAY,MAAM,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC;AAC5D,QAAM,SAAS,8BAAY,MAAM,WAAW,KAAK,GAAG,CAAC,OAAO,CAAC;AAC7D,QAAM,WAAW,8BAAY,MAAM,WAAW,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC;AAElE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,iBAAiB,SAAY,eAAe;AAAA,EACvD;AACF;AAEA,IAAO,8BAAQ;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var useHiddenProps_exports = {};
29
22
  __export(useHiddenProps_exports, {
30
23
  default: () => useHiddenProps_default
31
24
  });
25
+ module.exports = __toCommonJS(useHiddenProps_exports);
32
26
  var React = __toESM(require("react"));
33
27
  function useHiddenProps({ visible = true }) {
34
28
  return {
@@ -37,5 +31,4 @@ function useHiddenProps({ visible = true }) {
37
31
  };
38
32
  }
39
33
  var useHiddenProps_default = useHiddenProps;
40
- module.exports = __toCommonJS(useHiddenProps_exports);
41
34
  //# sourceMappingURL=useHiddenProps.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useHiddenProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["function useHiddenProps({ visible = true }) {\n // element props\n return {\n hidden: !visible,\n 'aria-hidden': !visible,\n };\n}\n\nexport default useHiddenProps;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAwB,EAAE,UAAU,QAAQ;AAE1C,SAAO;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,eAAe,CAAC;AAAA;AAAA;AAIpB,IAAO,yBAAQ;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAwB,EAAE,UAAU,QAAQ;AAE1C,SAAO;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,eAAe,CAAC;AAAA,EAClB;AACF;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
24
  var __objRest = (source, exclude) => {
26
25
  var target = {};
27
26
  for (var prop in source)
@@ -38,26 +37,21 @@ var __export = (target, all) => {
38
37
  for (var name in all)
39
38
  __defProp(target, name, { get: all[name], enumerable: true });
40
39
  };
41
- var __reExport = (target, module2, copyDefault, desc) => {
42
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
43
- for (let key of __getOwnPropNames(module2))
44
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
45
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
45
  }
47
- return target;
48
- };
49
- var __toESM = (module2, isNodeMode) => {
50
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
46
+ return to;
51
47
  };
52
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
53
- return (module2, temp) => {
54
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
55
- };
56
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
49
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
50
  var useHiddenTransition_exports = {};
58
51
  __export(useHiddenTransition_exports, {
59
52
  default: () => useHiddenTransition
60
53
  });
54
+ module.exports = __toCommonJS(useHiddenTransition_exports);
61
55
  var React = __toESM(require("react"));
62
56
  var import_react = require("react");
63
57
  var import_web = require("react-spring/web");
@@ -102,5 +96,4 @@ function useHiddenTransition(_a) {
102
96
  destroyed: destroyed || void 0
103
97
  });
104
98
  }
105
- module.exports = __toCommonJS(useHiddenTransition_exports);
106
99
  //# sourceMappingURL=useHiddenTransition.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useHiddenTransition.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useState, useEffect } from 'react';\nimport { useSpring } from 'react-spring/web';\nimport useHiddenProps from './useHiddenProps';\n\nconst growTo = (from, to) => [\n { opacity: 1, transform: `scale(${to})` },\n { opacity: 0, transform: `scale(${from})` },\n];\n\nexport default function useHiddenTransition({\n animationState = growTo(0, 1),\n visible = false,\n duration = 150,\n ...otherProps\n}) {\n const { hidden, ...hiddenProps } = useHiddenProps({ visible });\n const [resting, setResting] = useState(false);\n const [destroyed, setDestroyed] = useState(true);\n const [animationStyles, set] = useSpring(() => ({\n ...animationState[0],\n config: { duration },\n onStart: () => {\n setResting(false);\n setDestroyed(false);\n },\n immediate: !visible,\n onRest: () => setResting(true),\n }));\n\n useEffect(() => {\n set(\n visible\n ? { ...animationState[0], immediate: false }\n : { ...animationState[1] },\n );\n }, [visible]);\n\n useEffect(() => {\n if (!visible && resting) setDestroyed(true);\n }, [resting]);\n\n // element props\n return {\n ...otherProps,\n ...hiddenProps,\n style: {\n ...otherProps.style,\n pointerEvents: !visible && 'none',\n ...animationStyles,\n },\n destroyed: destroyed || undefined,\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,iBAA0B;AAC1B,4BAA2B;AAE3B,MAAM,SAAS,CAAC,MAAM,OAAO;AAAA,EAC3B,EAAE,SAAS,GAAG,WAAW,SAAS;AAAA,EAClC,EAAE,SAAS,GAAG,WAAW,SAAS;AAAA;AAGrB,6BAA6B,IAKzC;AALyC,eAC1C;AAAA,qBAAiB,OAAO,GAAG;AAAA,IAC3B,UAAU;AAAA,IACV,WAAW;AAAA,MAH+B,IAIvC,uBAJuC,IAIvC;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAmC,yCAAe,EAAE,YAA5C,aAA2B,KAAhB,wBAAgB,KAAhB,CAAX;AACR,QA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AW,gBAAgB,2BAAS,IAAI;AAC/C,QAAM,CAAC,iBAAiB,OAAO,0BAAU,MAAO,iCAC3C,eAAe,KAD4B;AAAA,IAE9C,QAAQ,EAAE,SAAS;AAAA,IACnB,SAAS,MAAM;AACb,iBAAW,KAAK;AAChB,mBAAa,KAAK;AAAA,IACpB;AAAA,IACA,WAAW,CAAC;AAAA,IACZ,QAAQ,MAAM,WAAW,IAAI;AAAA,EAC/B,EAAE;AAEF,8BAAU,MAAM;AACd,QACE,UACI,iCAAK,eAAe,KAApB,EAAwB,WAAW,MAAM,KACzC,mBAAK,eAAe,GAC1B;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AAEZ,8BAAU,MAAM;AACd,QAAI,CAAC,WAAW;AAAS,mBAAa,IAAI;AAAA,EAC5C,GAAG,CAAC,OAAO,CAAC;AAGZ,SAAO,gDACF,aACA,cAFE;AAAA,IAGL,OAAO,gDACF,WAAW,QADT;AAAA,MAEL,eAAe,CAAC,WAAW;AAAA,QACxB;AAAA,IAEL,WAAW,aAAa;AAAA,EAC1B;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var useHiddenTrigger_exports = {};
29
22
  __export(useHiddenTrigger_exports, {
30
23
  default: () => useHiddenTrigger_default
31
24
  });
25
+ module.exports = __toCommonJS(useHiddenTrigger_exports);
32
26
  var React = __toESM(require("react"));
33
27
  function useHiddenTrigger({ visible, hiddenId }) {
34
28
  return {
@@ -37,5 +31,4 @@ function useHiddenTrigger({ visible, hiddenId }) {
37
31
  };
38
32
  }
39
33
  var useHiddenTrigger_default = useHiddenTrigger;
40
- module.exports = __toCommonJS(useHiddenTrigger_exports);
41
34
  //# sourceMappingURL=useHiddenTrigger.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useHiddenTrigger.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["function useHiddenTrigger({ visible, hiddenId }) {\n return {\n 'aria-expanded': visible,\n 'aria-controls': hiddenId,\n };\n}\n\nexport default useHiddenTrigger;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B,EAAE,SAAS,YAAY;AAC/C,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,iBAAiB;AAAA;AAAA;AAIrB,IAAO,2BAAQ;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA0B,EAAE,SAAS,YAAY;AAC/C,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,EACnB;AACF;AAEA,IAAO,2BAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import useHiddenProps from './useHiddenProps';\nimport useHiddenController from './useHiddenController';\nimport useHiddenTransition from './useHiddenTransition';\nimport useHiddenTrigger from './useHiddenTrigger';\n\nexport { default as useHiddenProps } from './useHiddenProps';\nexport { default as useHiddenController } from './useHiddenController';\nexport { default as useHiddenTransition } from './useHiddenTransition';\nexport { default as useHiddenTrigger } from './useHiddenTrigger';\n\nexport default {\n useHiddenProps,\n useHiddenController,\n useHiddenTransition,\n useHiddenTrigger,\n};\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/useHiddenController.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useState } from 'react';\n\nconst useHiddenController = (initialState = undefined) => {\n const [visible, setVisible] = useState(initialState);\n\n const onShow = useCallback(() => setVisible(true), [visible]);\n const onHide = useCallback(() => setVisible(false), [visible]);\n const onToggle = useCallback(() => setVisible(!visible), [visible]);\n\n return {\n onShow,\n onHide,\n onToggle,\n visible: initialState !== undefined ? initialState : visible,\n };\n};\n\nexport default useHiddenController;\n"],
5
- "mappings": "AAAA;ACAA;AAEA,MAAM,sBAAsB,CAAC,eAAe,WAAc;AACxD,QAAM,CAAC,SAAS,cAAc,SAAS;AAEvC,QAAM,SAAS,YAAY,MAAM,WAAW,OAAO,CAAC;AACpD,QAAM,SAAS,YAAY,MAAM,WAAW,QAAQ,CAAC;AACrD,QAAM,WAAW,YAAY,MAAM,WAAW,CAAC,UAAU,CAAC;AAE1D,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,iBAAiB,SAAY,eAAe;AAAA;AAAA;AAIzD,IAAO,8BAAQ;",
5
+ "mappings": "AAAA;ACAA;AAEA,MAAM,sBAAsB,CAAC,eAAe,WAAc;AACxD,QAAM,CAAC,SAAS,cAAc,SAAS,YAAY;AAEnD,QAAM,SAAS,YAAY,MAAM,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC;AAC5D,QAAM,SAAS,YAAY,MAAM,WAAW,KAAK,GAAG,CAAC,OAAO,CAAC;AAC7D,QAAM,WAAW,YAAY,MAAM,WAAW,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC;AAElE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,iBAAiB,SAAY,eAAe;AAAA,EACvD;AACF;AAEA,IAAO,8BAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/useHiddenProps.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function useHiddenProps({ visible = true }) {\n // element props\n return {\n hidden: !visible,\n 'aria-hidden': !visible,\n };\n}\n\nexport default useHiddenProps;\n"],
5
- "mappings": "AAAA;ACAA,wBAAwB,EAAE,UAAU,QAAQ;AAE1C,SAAO;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,eAAe,CAAC;AAAA;AAAA;AAIpB,IAAO,yBAAQ;",
5
+ "mappings": "AAAA;ACAA,wBAAwB,EAAE,UAAU,QAAQ;AAE1C,SAAO;AAAA,IACL,QAAQ,CAAC;AAAA,IACT,eAAe,CAAC;AAAA,EAClB;AACF;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/useHiddenTransition.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useState, useEffect } from 'react';\nimport { useSpring } from 'react-spring/web';\nimport useHiddenProps from './useHiddenProps';\n\nconst growTo = (from, to) => [\n { opacity: 1, transform: `scale(${to})` },\n { opacity: 0, transform: `scale(${from})` },\n];\n\nexport default function useHiddenTransition({\n animationState = growTo(0, 1),\n visible = false,\n duration = 150,\n ...otherProps\n}) {\n const { hidden, ...hiddenProps } = useHiddenProps({ visible });\n const [resting, setResting] = useState(false);\n const [destroyed, setDestroyed] = useState(true);\n const [animationStyles, set] = useSpring(() => ({\n ...animationState[0],\n config: { duration },\n onStart: () => {\n setResting(false);\n setDestroyed(false);\n },\n immediate: !visible,\n onRest: () => setResting(true),\n }));\n\n useEffect(() => {\n set(\n visible\n ? { ...animationState[0], immediate: false }\n : { ...animationState[1] },\n );\n }, [visible]);\n\n useEffect(() => {\n if (!visible && resting) setDestroyed(true);\n }, [resting]);\n\n // element props\n return {\n ...otherProps,\n ...hiddenProps,\n style: {\n ...otherProps.style,\n pointerEvents: !visible && 'none',\n ...animationStyles,\n },\n destroyed: destroyed || undefined,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAEA,MAAM,SAAS,CAAC,MAAM,OAAO;AAAA,EAC3B,EAAE,SAAS,GAAG,WAAW,SAAS;AAAA,EAClC,EAAE,SAAS,GAAG,WAAW,SAAS;AAAA;AAGrB,6BAA6B,IAKzC;AALyC,eAC1C;AAAA,qBAAiB,OAAO,GAAG;AAAA,IAC3B,UAAU;AAAA,IACV,WAAW;AAAA,MAH+B,IAIvC,uBAJuC,IAIvC;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAmC,qBAAe,EAAE,YAA5C,aAA2B,KAAhB,wBAAgB,KAAhB,CAAX;AACR,QAAM,CAAC,SAAS,cAAc,SAAS;AACvC,QAAM,CAAC,WAAW,gBAAgB,SAAS;AAC3C,QAAM,CAAC,iBAAiB,OAAO,UAAU,MAAO,iCAC3C,eAAe,KAD4B;AAAA,IAE9C,QAAQ,EAAE;AAAA,IACV,SAAS,MAAM;AACb,iBAAW;AACX,mBAAa;AAAA;AAAA,IAEf,WAAW,CAAC;AAAA,IACZ,QAAQ,MAAM,WAAW;AAAA;AAG3B,YAAU,MAAM;AACd,QACE,UACI,iCAAK,eAAe,KAApB,EAAwB,WAAW,WACnC,mBAAK,eAAe;AAAA,KAEzB,CAAC;AAEJ,YAAU,MAAM;AACd,QAAI,CAAC,WAAW;AAAS,mBAAa;AAAA,KACrC,CAAC;AAGJ,SAAO,gDACF,aACA,cAFE;AAAA,IAGL,OAAO,gDACF,WAAW,QADT;AAAA,MAEL,eAAe,CAAC,WAAW;AAAA,QACxB;AAAA,IAEL,WAAW,aAAa;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAEA,MAAM,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
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function useHiddenTrigger({ visible, hiddenId }) {\n return {\n 'aria-expanded': visible,\n 'aria-controls': hiddenId,\n };\n}\n\nexport default useHiddenTrigger;\n"],
5
- "mappings": "AAAA;ACAA,0BAA0B,EAAE,SAAS,YAAY;AAC/C,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,iBAAiB;AAAA;AAAA;AAIrB,IAAO,2BAAQ;",
5
+ "mappings": "AAAA;ACAA,0BAA0B,EAAE,SAAS,YAAY;AAC/C,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,EACnB;AACF;AAEA,IAAO,2BAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-hidden",
3
- "version": "3.0.0-next.9",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Hidden",
6
6
  "files": [
@@ -50,6 +50,13 @@
50
50
  "reportFile": "tests.xml",
51
51
  "indent": 4
52
52
  },
53
+ "scripts": {
54
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
55
+ "test": "node ../../scripts/testing/test.mjs",
56
+ "lint": "node ../../scripts/lint.mjs",
57
+ "dts": "node ../../scripts/dts.mjs",
58
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
59
+ },
53
60
  "dependencies": {
54
61
  "react-spring": "~8.0.27"
55
62
  },
@@ -59,12 +66,5 @@
59
66
  "publishConfig": {
60
67
  "access": "public",
61
68
  "typeSafety": false
62
- },
63
- "scripts": {
64
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
65
- "test": "node ../../scripts/testing/test.mjs",
66
- "lint": "node ../../scripts/lint.mjs",
67
- "dts": "node ../../scripts/dts.mjs",
68
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
69
69
  }
70
- }
70
+ }