@elliemae/ds-form-toggle 3.0.0-next.44 → 3.0.0-next.47
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/ControlledToggle.js +9 -16
- package/dist/cjs/ControlledToggle.js.map +1 -1
- package/dist/cjs/defaultProps.js +9 -16
- package/dist/cjs/defaultProps.js.map +1 -1
- package/dist/cjs/index.d.js +9 -16
- package/dist/cjs/index.d.js.map +1 -1
- package/dist/cjs/index.js +11 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/propTypes.js +9 -16
- package/dist/cjs/propTypes.js.map +1 -1
- package/dist/cjs/styles.js +9 -16
- package/dist/cjs/styles.js.map +1 -1
- package/dist/cjs/utils/addTooltipOnReadOnly.js +9 -16
- package/dist/cjs/utils/addTooltipOnReadOnly.js.map +1 -1
- package/dist/cjs/utils/styleHelpers.js +9 -16
- package/dist/cjs/utils/styleHelpers.js.map +1 -1
- package/package.json +5 -5
|
@@ -18,32 +18,26 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
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));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var ControlledToggle_exports = {};
|
|
43
36
|
__export(ControlledToggle_exports, {
|
|
44
37
|
DSControlledToggle: () => DSControlledToggle,
|
|
45
38
|
DSControlledToggleWithSchema: () => DSControlledToggleWithSchema
|
|
46
39
|
});
|
|
40
|
+
module.exports = __toCommonJS(ControlledToggle_exports);
|
|
47
41
|
var React = __toESM(require("react"));
|
|
48
42
|
var import_react = __toESM(require("react"));
|
|
49
43
|
var import_uid = require("uid");
|
|
@@ -143,5 +137,4 @@ DSControlledToggle.defaultProps = import_defaultProps.defaultProps;
|
|
|
143
137
|
DSControlledToggle.propTypes = import_propTypes.propTypes;
|
|
144
138
|
const DSControlledToggleWithSchema = (0, import_react_desc.describe)(DSControlledToggle);
|
|
145
139
|
DSControlledToggleWithSchema.propTypes = import_propTypes.propTypes;
|
|
146
|
-
module.exports = __toCommonJS(ControlledToggle_exports);
|
|
147
140
|
//# sourceMappingURL=ControlledToggle.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ControlledToggle.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useState, useMemo, useRef, useEffect, useCallback } from 'react';\nimport { uid } from 'uid';\nimport { describe } from 'react-desc';\nimport { propTypes } from './propTypes';\nimport {\n StyledContainer,\n StyledInput,\n StyledLabel,\n StyledVisibleContent,\n StyledCircle,\n StyledText,\n SetLabelWidth,\n} from './styles';\nimport { defaultProps } from './defaultProps';\nimport type { DSControlledTogglePropsT } from './index.d';\nimport { addTooltipOnReadOnly } from './utils/addTooltipOnReadOnly';\n\nconst DSControlledToggle = ({\n labelOn,\n labelOff,\n name,\n value,\n checked,\n onChange,\n size,\n readOnly,\n active,\n disabled,\n containerProps,\n id,\n}: DSControlledTogglePropsT): JSX.Element => {\n const [isLongerTextRendering, setIsLongerTextRendering] = useState<boolean>(false);\n const [width, setWidth] = useState<number>(0);\n const labelTextRef = useRef<HTMLDivElement | null>(null);\n const widthTextRef = useRef<HTMLDivElement | null>(null);\n\n const longerText = useMemo(() => (labelOn.length > labelOff.length ? labelOn : labelOff), [labelOff, labelOn]);\n\n const instanceUID = useMemo(() => uid(5), []);\n\n useEffect(() => {\n if (labelTextRef.current) {\n setIsLongerTextRendering(labelTextRef.current.innerText === longerText);\n }\n }, [labelTextRef, longerText, checked]);\n\n useEffect(() => {\n if (widthTextRef.current) {\n setWidth(widthTextRef.current.clientWidth);\n }\n }, [widthTextRef]);\n\n const handleOnChange = useCallback(() => {\n if (disabled || readOnly) return;\n onChange();\n }, [disabled, readOnly, onChange]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled || readOnly) {\n e.preventDefault();\n }\n if (e.key === 'Enter') {\n e.preventDefault();\n onChange();\n }\n },\n [disabled, onChange, readOnly],\n );\n\n return addTooltipOnReadOnly(\n <StyledContainer size={size} data-testid=\"ds-controlled-toggle\" {...containerProps}>\n <StyledInput\n type=\"checkbox\"\n name={name}\n value={value}\n checked={checked}\n data-testid=\"ds-controlled-toggle-checkbox\"\n id={id || instanceUID}\n aria-disabled={disabled}\n aria-checked={checked}\n tabIndex={0}\n onChange={handleOnChange}\n onKeyDown={handleKeyDown}\n />\n <StyledLabel checked={checked} size={size} width={width}>\n <StyledVisibleContent\n checked={checked}\n size={size}\n readOnly={readOnly}\n active={active}\n disabled={disabled}\n htmlFor={id ? undefined : instanceUID}\n as={id ? 'p' : 'label'}\n >\n <StyledCircle checked={checked} size={size} readOnly={readOnly} disabled={disabled} />\n <StyledText\n ref={labelTextRef}\n isLongerTextRendering={isLongerTextRendering}\n checked={checked}\n size={size}\n disabled={disabled}\n >\n {checked ? labelOn : labelOff}\n </StyledText>\n </StyledVisibleContent>\n </StyledLabel>\n <SetLabelWidth size={size} ref={widthTextRef}>\n {longerText}\n </SetLabelWidth>\n </StyledContainer>,\n readOnly,\n );\n};\n\nDSControlledToggle.defaultProps = defaultProps;\nDSControlledToggle.propTypes = propTypes;\nconst DSControlledToggleWithSchema = describe(DSControlledToggle);\nDSControlledToggleWithSchema.propTypes = propTypes;\n\nexport { DSControlledToggle, DSControlledToggleWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyE;AACzE,iBAAoB;AACpB,wBAAyB;AACzB,uBAA0B;AAC1B,oBAQO;AACP,0BAA6B;AAE7B,kCAAqC;AAErC,MAAM,qBAAqB,CAAC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAC2C;AAC3C,QAAM,CAAC,uBAAuB,4BAA4B,2BAAkB,KAAK;AACjF,QAAM,CAAC,OAAO,YAAY,2BAAiB,CAAC;AAC5C,QAAM,eAAe,yBAA8B,IAAI;AACvD,QAAM,eAAe,yBAA8B,IAAI;AAEvD,QAAM,aAAa,0BAAQ,MAAO,QAAQ,SAAS,SAAS,SAAS,UAAU,UAAW,CAAC,UAAU,OAAO,CAAC;AAE7G,QAAM,cAAc,0BAAQ,MAAM,oBAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,8BAAU,MAAM;AACd,QAAI,aAAa,SAAS;AACxB,+BAAyB,aAAa,QAAQ,cAAc,UAAU;AAAA,IACxE;AAAA,EACF,GAAG,CAAC,cAAc,YAAY,OAAO,CAAC;AAEtC,8BAAU,MAAM;AACd,QAAI,aAAa,SAAS;AACxB,eAAS,aAAa,QAAQ,WAAW;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,YAAY,CAAC;AAEjB,QAAM,iBAAiB,8BAAY,MAAM;AACvC,QAAI,YAAY;AAAU;AAC1B,aAAS;AAAA,EACX,GAAG,CAAC,UAAU,UAAU,QAAQ,CAAC;AAEjC,QAAM,gBAAgB,8BACpB,CAAC,MAA2B;AAC1B,QAAI,YAAY,UAAU;AACxB,QAAE,eAAe;AAAA,IACnB;AACA,QAAI,EAAE,QAAQ,SAAS;AACrB,QAAE,eAAe;AACjB,eAAS;AAAA,IACX;AAAA,EACF,GACA,CAAC,UAAU,UAAU,QAAQ,CAC/B;AAEA,SAAO,sDACL,mDAAC;AAAA,IAAgB;AAAA,IAAY,eAAY;AAAA,KAA2B,iBAClE,mDAAC;AAAA,IACC,MAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAY;AAAA,IACZ,IAAI,MAAM;AAAA,IACV,iBAAe;AAAA,IACf,gBAAc;AAAA,IACd,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,GACb,GACA,mDAAC;AAAA,IAAY;AAAA,IAAkB;AAAA,IAAY;AAAA,KACzC,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,KAAK,SAAY;AAAA,IAC1B,IAAI,KAAK,MAAM;AAAA,KAEf,mDAAC;AAAA,IAAa;AAAA,IAAkB;AAAA,IAAY;AAAA,IAAoB;AAAA,GAAoB,GACpF,mDAAC;AAAA,IACC,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KAEC,UAAU,UAAU,QACvB,CACF,CACF,GACA,mDAAC;AAAA,IAAc;AAAA,IAAY,KAAK;AAAA,KAC7B,UACH,CACF,GACA,QACF;AACF;AAEA,mBAAmB,eAAe;AAClC,mBAAmB,YAAY;AAC/B,MAAM,+BAA+B,gCAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/defaultProps.js
CHANGED
|
@@ -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
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
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
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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 defaultProps_exports = {};
|
|
29
22
|
__export(defaultProps_exports, {
|
|
30
23
|
defaultProps: () => defaultProps
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(defaultProps_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
const defaultProps = {
|
|
34
28
|
labelOn: "ON",
|
|
@@ -42,5 +36,4 @@ const defaultProps = {
|
|
|
42
36
|
active: false,
|
|
43
37
|
disabled: false
|
|
44
38
|
};
|
|
45
|
-
module.exports = __toCommonJS(defaultProps_exports);
|
|
46
39
|
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/defaultProps.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const defaultProps = {\n labelOn: 'ON',\n labelOff: 'OFF',\n name: '',\n value: '',\n checked: false,\n onClick: () => null,\n size: 'm',\n readonly: false,\n active: false,\n disabled: false,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS,MAAM;AAAA,EACf,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.d.js
CHANGED
|
@@ -4,24 +4,17 @@ 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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var __toESM = (
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
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));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
17
|
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
18
|
module.exports = __toCommonJS(index_d_exports);
|
|
19
|
+
var React = __toESM(require("react"));
|
|
27
20
|
//# sourceMappingURL=index.d.js.map
|
package/dist/cjs/index.d.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.d.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export type ToggleSize = 's' | 'm' | 'l';\n\nexport interface DSControlledTogglePropsT {\n labelOn: string;\n labelOff: string;\n name: string;\n value: string;\n checked: boolean;\n onChange: () => void | null;\n size: ToggleSize;\n readOnly: boolean;\n active: boolean;\n disabled: boolean;\n containerProps: Record<string, unknown>;\n id: string;\n}\n\nexport interface StyledContainerT {\n size: ToggleSize;\n}\n\nexport interface StyledLabelT {\n width: number;\n size: ToggleSize;\n checked: boolean;\n}\n\nexport interface StyledVisibleContentT {\n checked: boolean;\n size: ToggleSize;\n disabled: boolean;\n readOnly: boolean;\n active: boolean;\n as: 'p' | 'label';\n htmlFor: string;\n}\n\nexport interface StyledCircleT {\n size: ToggleSize;\n readOnly: boolean;\n checked: boolean;\n disabled: boolean;\n}\n\nexport interface StyledTextT {\n isLongerTextRendering: boolean;\n size: ToggleSize;\n checked: boolean;\n disabled: boolean;\n}\n\nexport interface SetLabelWidthT {\n size: ToggleSize;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,25 +4,19 @@ 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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
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));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var src_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(src_exports, require("./ControlledToggle"));
|
|
27
19
|
module.exports = __toCommonJS(src_exports);
|
|
20
|
+
var React = __toESM(require("react"));
|
|
21
|
+
__reExport(src_exports, require("./ControlledToggle"), module.exports);
|
|
28
22
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './ControlledToggle';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,+BAAd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/propTypes.js
CHANGED
|
@@ -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
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
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
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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 propTypes_exports = {};
|
|
29
22
|
__export(propTypes_exports, {
|
|
30
23
|
propTypes: () => propTypes
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(propTypes_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react_desc = require("react-desc");
|
|
34
28
|
const propTypes = {
|
|
@@ -45,5 +39,4 @@ const propTypes = {
|
|
|
45
39
|
containerProps: import_react_desc.PropTypes.shape({}).description("Set of properties attached to the main container"),
|
|
46
40
|
id: import_react_desc.PropTypes.string.description("Unique id.")
|
|
47
41
|
};
|
|
48
|
-
module.exports = __toCommonJS(propTypes_exports);
|
|
49
42
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n labelOn: PropTypes.string.description('Label when toggle is checked'),\n labelOff: PropTypes.string.description('Label when toggle is unchecked'),\n value: PropTypes.string.description('Value attribute for toggle'),\n name: PropTypes.string.description('Name attribute for toggle'),\n checked: PropTypes.bool.description('Wether the toggle is checked or not'),\n onchange: PropTypes.func.description('OnClick callback'),\n size: PropTypes.oneOf(['s', 'm', 'l']).description('Size of toggle'),\n readOnly: PropTypes.bool.description('Wether the toggle is readOnly or not'),\n active: PropTypes.bool.description('Wether the toggle has active styles or not'),\n disabled: PropTypes.bool.description('Wether the toggle is disabled or not'),\n containerProps: PropTypes.shape({}).description('Set of properties attached to the main container'),\n id: PropTypes.string.description('Unique id.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,SAAS,4BAAU,OAAO,YAAY,8BAA8B;AAAA,EACpE,UAAU,4BAAU,OAAO,YAAY,gCAAgC;AAAA,EACvE,OAAO,4BAAU,OAAO,YAAY,4BAA4B;AAAA,EAChE,MAAM,4BAAU,OAAO,YAAY,2BAA2B;AAAA,EAC9D,SAAS,4BAAU,KAAK,YAAY,qCAAqC;AAAA,EACzE,UAAU,4BAAU,KAAK,YAAY,kBAAkB;AAAA,EACvD,MAAM,4BAAU,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE,YAAY,gBAAgB;AAAA,EACnE,UAAU,4BAAU,KAAK,YAAY,sCAAsC;AAAA,EAC3E,QAAQ,4BAAU,KAAK,YAAY,4CAA4C;AAAA,EAC/E,UAAU,4BAAU,KAAK,YAAY,sCAAsC;AAAA,EAC3E,gBAAgB,4BAAU,MAAM,CAAC,CAAC,EAAE,YAAY,kDAAkD;AAAA,EAClG,IAAI,4BAAU,OAAO,YAAY,YAAY;AAC/C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.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
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
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
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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 styles_exports = {};
|
|
29
22
|
__export(styles_exports, {
|
|
30
23
|
SetLabelWidth: () => SetLabelWidth,
|
|
@@ -35,6 +28,7 @@ __export(styles_exports, {
|
|
|
35
28
|
StyledText: () => StyledText,
|
|
36
29
|
StyledVisibleContent: () => StyledVisibleContent
|
|
37
30
|
});
|
|
31
|
+
module.exports = __toCommonJS(styles_exports);
|
|
38
32
|
var React = __toESM(require("react"));
|
|
39
33
|
var import_styled_components = __toESM(require("styled-components"));
|
|
40
34
|
var import_styleHelpers = require("./utils/styleHelpers");
|
|
@@ -121,5 +115,4 @@ const SetLabelWidth = import_styled_components.default.div`
|
|
|
121
115
|
white-space: nowrap;
|
|
122
116
|
visibility: hidden;
|
|
123
117
|
`;
|
|
124
|
-
module.exports = __toCommonJS(styles_exports);
|
|
125
118
|
//# sourceMappingURL=styles.js.map
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import styled from 'styled-components';\nimport type {\n StyledContainerT,\n StyledLabelT,\n StyledVisibleContentT,\n StyledCircleT,\n StyledTextT,\n SetLabelWidthT,\n} from './index.d';\nimport {\n containerHeight,\n borderRadius,\n labelHeight,\n handleBorderColor,\n handleBackgroundColor,\n circleValues,\n handleFontSize,\n margin,\n handleCursors,\n} from './utils/styleHelpers';\n\nexport const StyledContainer = styled.div<StyledContainerT>`\n display: inline-flex;\n width: fit-content;\n justify-content: center;\n align-items: center;\n height: ${({ size }) => containerHeight[size]};\n border-radius: ${({ size }) => borderRadius[size]};\n outline: none;\n position: relative;\n border: 2px solid transparent;\n &:hover,\n &:focus-within {\n border: 2px solid ${({ theme }) => theme.colors.brand[300]};\n &:after {\n content: '';\n height: calc(100% + 4px);\n width: calc(100% + 4px);\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n border-radius: 20px;\n position: absolute;\n }\n }\n`;\n\nexport const StyledLabel = styled.div<StyledLabelT>`\n width: ${({ width, size }) => `calc(${width}px + ${margin[size]})`};\n height: ${({ size }) => labelHeight[size]};\n z-index: 2;\n outline: none;\n border-radius: ${({ size }) => labelHeight[size]};\n`;\n\nexport const StyledVisibleContent = styled.label<StyledVisibleContentT>`\n display: flex;\n margin: 0;\n padding: 0;\n align-items: center;\n height: 100%;\n flex-direction: ${({ checked }) => (checked ? 'row-reverse' : 'row')};\n border-radius: ${({ size }) => `calc(${labelHeight[size]} - 4px)`};\n border: ${({ theme, size, checked, disabled, readOnly, active }) =>\n size === 's'\n ? `1px solid ${handleBorderColor(checked, disabled, readOnly, active, theme)}`\n : `\n 2px solid ${handleBorderColor(checked, disabled, readOnly, active, theme)}\n `};\n transition: background-color 0.2s;\n background-color: ${({ theme, checked, disabled, readOnly, active }) =>\n handleBackgroundColor(checked, disabled, readOnly, active, theme)};\n\n &:hover {\n cursor: ${({ disabled, readOnly }) => handleCursors(disabled, readOnly)};\n }\n`;\n\nexport const StyledCircle = styled.div<StyledCircleT>`\n height: ${({ size }) => circleValues[size]};\n width: ${({ size }) => circleValues[size]};\n border-radius: 50%;\n background-color: ${({ theme, readOnly }) => (readOnly ? theme.colors.neutral[100] : theme.colors.neutral['000'])};\n`;\n\nexport const StyledText = styled.div<StyledTextT>`\n display: flex;\n flex-grow: 1;\n line-height: 1;\n margin-bottom: -0.12rem;\n align-items: center;\n justify-content: ${({ isLongerTextRendering }) => (isLongerTextRendering ? 'flex-start' : 'center')};\n font-size: ${({ theme, size }) => handleFontSize(size, theme)};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme, disabled }) => (disabled ? '#5c6574' : theme.colors.neutral['000'])};\n ${({ isLongerTextRendering, checked }) => (isLongerTextRendering && checked ? `margin-left: 6px;` : undefined)}\n ${({ isLongerTextRendering, checked }) => (isLongerTextRendering && !checked ? `margin-left: 4px;` : undefined)}\n`;\n\nexport const StyledInput = styled.input`\n position: absolute;\n opacity: 0;\n z-index: 20;\n height: 100%;\n width: 100%;\n cursor: pointer;\n`;\n\nexport const SetLabelWidth = styled.div<SetLabelWidthT>`\n font-size: ${({ theme, size }) => handleFontSize(size, theme)};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n width: auto;\n position: absolute;\n white-space: nowrap;\n visibility: hidden;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AASnB,0BAUO;AAEA,MAAM,kBAAkB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,YAK1B,CAAC,EAAE,WAAW,oCAAgB;AAAA,mBACvB,CAAC,EAAE,WAAW,iCAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMtB,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,0BAKhC,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAOrD,MAAM,cAAc,iCAAO;AAAA,WACvB,CAAC,EAAE,OAAO,WAAW,QAAQ,aAAa,2BAAO;AAAA,YAChD,CAAC,EAAE,WAAW,gCAAY;AAAA;AAAA;AAAA,mBAGnB,CAAC,EAAE,WAAW,gCAAY;AAAA;AAGtC,MAAM,uBAAuB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMvB,CAAC,EAAE,cAAe,UAAU,gBAAgB;AAAA,mBAC7C,CAAC,EAAE,WAAW,QAAQ,gCAAY;AAAA,YACzC,CAAC,EAAE,OAAO,MAAM,SAAS,UAAU,UAAU,aACrD,SAAS,MACL,aAAa,2CAAkB,SAAS,UAAU,UAAU,QAAQ,KAAK,MACzE;AAAA,gBACQ,2CAAkB,SAAS,UAAU,UAAU,QAAQ,KAAK;AAAA;AAAA;AAAA,sBAGtD,CAAC,EAAE,OAAO,SAAS,UAAU,UAAU,aACzD,+CAAsB,SAAS,UAAU,UAAU,QAAQ,KAAK;AAAA;AAAA;AAAA,cAGtD,CAAC,EAAE,UAAU,eAAe,uCAAc,UAAU,QAAQ;AAAA;AAAA;AAInE,MAAM,eAAe,iCAAO;AAAA,YACvB,CAAC,EAAE,WAAW,iCAAa;AAAA,WAC5B,CAAC,EAAE,WAAW,iCAAa;AAAA;AAAA,sBAEhB,CAAC,EAAE,OAAO,eAAgB,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAAA;AAGrG,MAAM,aAAa,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAMZ,CAAC,EAAE,4BAA6B,wBAAwB,eAAe;AAAA,eAC7E,CAAC,EAAE,OAAO,WAAW,wCAAe,MAAM,KAAK;AAAA,iBAC7C,CAAC,EAAE,YAAY,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,OAAO,eAAgB,WAAW,YAAY,MAAM,OAAO,QAAQ;AAAA,IAC7E,CAAC,EAAE,uBAAuB,cAAe,yBAAyB,UAAU,sBAAsB;AAAA,IAClG,CAAC,EAAE,uBAAuB,cAAe,yBAAyB,CAAC,UAAU,sBAAsB;AAAA;AAGhG,MAAM,cAAc,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3B,MAAM,gBAAgB,iCAAO;AAAA,eACrB,CAAC,EAAE,OAAO,WAAW,wCAAe,MAAM,KAAK;AAAA,iBAC7C,CAAC,EAAE,YAAY,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
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
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
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
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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 addTooltipOnReadOnly_exports = {};
|
|
29
22
|
__export(addTooltipOnReadOnly_exports, {
|
|
30
23
|
addTooltipOnReadOnly: () => addTooltipOnReadOnly
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(addTooltipOnReadOnly_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
var import_react = __toESM(require("react"));
|
|
34
28
|
var import_ds_tooltip = require("@elliemae/ds-tooltip");
|
|
@@ -41,5 +35,4 @@ const addTooltipOnReadOnly = (Component, readOnly) => {
|
|
|
41
35
|
});
|
|
42
36
|
return Component;
|
|
43
37
|
};
|
|
44
|
-
module.exports = __toCommonJS(addTooltipOnReadOnly_exports);
|
|
45
38
|
//# sourceMappingURL=addTooltipOnReadOnly.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/addTooltipOnReadOnly.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { DSTooltipV2 } from '@elliemae/ds-tooltip';\n\nexport const addTooltipOnReadOnly = (Component: JSX.Element, readOnly: boolean): JSX.Element => {\n if (readOnly) return <DSTooltipV2 title=\"Read Only\" offset={[0, 9]} triggerComponent={Component} />;\n return Component;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAA4B;AAErB,MAAM,uBAAuB,CAAC,WAAwB,aAAmC;AAC9F,MAAI;AAAU,WAAO,mDAAC;AAAA,MAAY,OAAM;AAAA,MAAY,QAAQ,CAAC,GAAG,CAAC;AAAA,MAAG,kBAAkB;AAAA,KAAW;AACjG,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
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
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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 styleHelpers_exports = {};
|
|
29
22
|
__export(styleHelpers_exports, {
|
|
30
23
|
borderRadius: () => borderRadius,
|
|
@@ -37,6 +30,7 @@ __export(styleHelpers_exports, {
|
|
|
37
30
|
labelHeight: () => labelHeight,
|
|
38
31
|
margin: () => margin
|
|
39
32
|
});
|
|
33
|
+
module.exports = __toCommonJS(styleHelpers_exports);
|
|
40
34
|
var React = __toESM(require("react"));
|
|
41
35
|
const circleValues = {
|
|
42
36
|
s: "14px",
|
|
@@ -113,5 +107,4 @@ const handleCursors = (disabled, readOnly) => {
|
|
|
113
107
|
} else
|
|
114
108
|
return "pointer";
|
|
115
109
|
};
|
|
116
|
-
module.exports = __toCommonJS(styleHelpers_exports);
|
|
117
110
|
//# sourceMappingURL=styleHelpers.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/styleHelpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import type { ToggleSize } from '../index.d';\n\nexport const circleValues = {\n s: '14px',\n m: '20px',\n l: '28px',\n};\n\nexport const margin = {\n s: '26px',\n m: '34px',\n l: '42px',\n};\n\nexport const containerHeight = {\n s: '20px',\n m: '28px',\n l: '36px',\n};\n\nexport const labelHeight = {\n s: '16px',\n m: '24px',\n l: '32px',\n};\n\nexport const borderRadius = {\n s: '16px',\n m: '20px',\n l: '22px',\n};\n\nexport const handleFontSize = (size: ToggleSize, { fontSizes }): string => {\n switch (size) {\n case 's':\n return fontSizes.microText[200];\n case 'm':\n return '15px';\n case 'l':\n return '20px';\n default:\n return '15px';\n }\n};\nexport const handleBackgroundColor = (\n checked: boolean,\n disabled: boolean,\n readOnly: boolean,\n active: boolean,\n { colors },\n): string => {\n if (disabled) {\n return colors.neutral[100];\n } else if (readOnly) {\n return colors.neutral[500];\n } else if (!active && checked) {\n return colors.brand[600];\n } else if (!active && !checked) {\n return colors.neutral[500];\n } else if (active && checked) {\n return colors.brand[700];\n } else if (active && !checked) {\n return colors.neutral[600];\n }\n};\n\nexport const handleBorderColor = (\n checked: boolean,\n disabled: boolean,\n readOnly: boolean,\n active: boolean,\n { colors },\n): string => {\n if (disabled) {\n return colors.neutral[100];\n } else if (readOnly) {\n return colors.neutral[500];\n } else if (!active && checked) {\n return colors.brand[700];\n } else if (!active && !checked) {\n return colors.neutral[500];\n } else if (active && checked) {\n return colors.brand[800];\n } else if (active && !checked) {\n return colors.neutral[700];\n }\n};\n\nexport const handleCursors = (disabled: boolean, readOnly: boolean): string => {\n if (disabled) {\n return 'not-allowed';\n } else if (readOnly) {\n return 'default';\n } else return 'pointer';\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,eAAe;AAAA,EAC1B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,SAAS;AAAA,EACpB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,eAAe;AAAA,EAC1B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,iBAAiB,CAAC,MAAkB,EAAE,gBAAwB;AACzE,UAAQ;AAAA,SACD;AACH,aAAO,UAAU,UAAU;AAAA,SACxB;AACH,aAAO;AAAA,SACJ;AACH,aAAO;AAAA;AAEP,aAAO;AAAA;AAEb;AACO,MAAM,wBAAwB,CACnC,SACA,UACA,UACA,QACA,EAAE,aACS;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,UAAU;AACnB,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,CAAC,UAAU,SAAS;AAC7B,WAAO,OAAO,MAAM;AAAA,EACtB,WAAW,CAAC,UAAU,CAAC,SAAS;AAC9B,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,UAAU,SAAS;AAC5B,WAAO,OAAO,MAAM;AAAA,EACtB,WAAW,UAAU,CAAC,SAAS;AAC7B,WAAO,OAAO,QAAQ;AAAA,EACxB;AACF;AAEO,MAAM,oBAAoB,CAC/B,SACA,UACA,UACA,QACA,EAAE,aACS;AACX,MAAI,UAAU;AACZ,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,UAAU;AACnB,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,CAAC,UAAU,SAAS;AAC7B,WAAO,OAAO,MAAM;AAAA,EACtB,WAAW,CAAC,UAAU,CAAC,SAAS;AAC9B,WAAO,OAAO,QAAQ;AAAA,EACxB,WAAW,UAAU,SAAS;AAC5B,WAAO,OAAO,MAAM;AAAA,EACtB,WAAW,UAAU,CAAC,SAAS;AAC7B,WAAO,OAAO,QAAQ;AAAA,EACxB;AACF;AAEO,MAAM,gBAAgB,CAAC,UAAmB,aAA8B;AAC7E,MAAI,UAAU;AACZ,WAAO;AAAA,EACT,WAAW,UAAU;AACnB,WAAO;AAAA,EACT;AAAO,WAAO;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-toggle",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.47",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Toggle",
|
|
6
6
|
"files": [
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@elliemae/ds-system": "3.0.0-next.29",
|
|
39
|
-
"@elliemae/ds-tooltip": "3.0.0-next.
|
|
40
|
-
"@elliemae/ds-utilities": "3.0.0-next.
|
|
39
|
+
"@elliemae/ds-tooltip": "3.0.0-next.47",
|
|
40
|
+
"@elliemae/ds-utilities": "3.0.0-next.47",
|
|
41
41
|
"react-desc": "^4.1.3",
|
|
42
42
|
"styled-components": "~5.3.3",
|
|
43
43
|
"uid": "~2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@elliemae/pui-theme": "~2.
|
|
46
|
+
"@elliemae/pui-theme": "~2.4.1",
|
|
47
47
|
"@testing-library/dom": "~8.11.3",
|
|
48
48
|
"@testing-library/jest-dom": "~5.16.2",
|
|
49
49
|
"@testing-library/react": "~12.1.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"styled-system": "~5.1.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@elliemae/pui-theme": "
|
|
55
|
+
"@elliemae/pui-theme": "~2.4.1",
|
|
56
56
|
"react": "^17.0.2",
|
|
57
57
|
"react-dom": "^17.0.2",
|
|
58
58
|
"styled-components": "^5.3.3",
|