@elliemae/ds-slider-v2 3.26.0-next.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/dist/cjs/DSSliderV2.js +50 -0
  2. package/dist/cjs/DSSliderV2.js.map +7 -0
  3. package/dist/cjs/DSSliderV2CTX.js +40 -0
  4. package/dist/cjs/DSSliderV2CTX.js.map +7 -0
  5. package/dist/cjs/config/useSliderV2.js +70 -0
  6. package/dist/cjs/config/useSliderV2.js.map +7 -0
  7. package/dist/cjs/config/useTickMarksValues.js +51 -0
  8. package/dist/cjs/config/useTickMarksValues.js.map +7 -0
  9. package/dist/cjs/config/useValidateProps.js +45 -0
  10. package/dist/cjs/config/useValidateProps.js.map +7 -0
  11. package/dist/cjs/constants/index.js +50 -0
  12. package/dist/cjs/constants/index.js.map +7 -0
  13. package/dist/cjs/index.js +42 -0
  14. package/dist/cjs/index.js.map +7 -0
  15. package/dist/cjs/package.json +7 -0
  16. package/dist/cjs/parts/MainContent.js +95 -0
  17. package/dist/cjs/parts/MainContent.js.map +7 -0
  18. package/dist/cjs/parts/Thumb.js +82 -0
  19. package/dist/cjs/parts/Thumb.js.map +7 -0
  20. package/dist/cjs/parts/TickMarks.js +67 -0
  21. package/dist/cjs/parts/TickMarks.js.map +7 -0
  22. package/dist/cjs/parts/TickMarksValues.js +67 -0
  23. package/dist/cjs/parts/TickMarksValues.js.map +7 -0
  24. package/dist/cjs/parts/Track.js +71 -0
  25. package/dist/cjs/parts/Track.js.map +7 -0
  26. package/dist/cjs/react-desc-prop-types.js +64 -0
  27. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  28. package/dist/cjs/styles.js +122 -0
  29. package/dist/cjs/styles.js.map +7 -0
  30. package/dist/cjs/typescript-testing/typescript-slider-v2-valid.js +95 -0
  31. package/dist/cjs/typescript-testing/typescript-slider-v2-valid.js.map +7 -0
  32. package/dist/cjs/utils/inRange.js +42 -0
  33. package/dist/cjs/utils/inRange.js.map +7 -0
  34. package/dist/cjs/utils/thumbLabels.js +51 -0
  35. package/dist/cjs/utils/thumbLabels.js.map +7 -0
  36. package/dist/esm/DSSliderV2.js +20 -0
  37. package/dist/esm/DSSliderV2.js.map +7 -0
  38. package/dist/esm/DSSliderV2CTX.js +10 -0
  39. package/dist/esm/DSSliderV2CTX.js.map +7 -0
  40. package/dist/esm/config/useSliderV2.js +40 -0
  41. package/dist/esm/config/useSliderV2.js.map +7 -0
  42. package/dist/esm/config/useTickMarksValues.js +21 -0
  43. package/dist/esm/config/useTickMarksValues.js.map +7 -0
  44. package/dist/esm/config/useValidateProps.js +15 -0
  45. package/dist/esm/config/useValidateProps.js.map +7 -0
  46. package/dist/esm/constants/index.js +20 -0
  47. package/dist/esm/constants/index.js.map +7 -0
  48. package/dist/esm/index.js +12 -0
  49. package/dist/esm/index.js.map +7 -0
  50. package/dist/esm/package.json +7 -0
  51. package/dist/esm/parts/MainContent.js +65 -0
  52. package/dist/esm/parts/MainContent.js.map +7 -0
  53. package/dist/esm/parts/Thumb.js +52 -0
  54. package/dist/esm/parts/Thumb.js.map +7 -0
  55. package/dist/esm/parts/TickMarks.js +37 -0
  56. package/dist/esm/parts/TickMarks.js.map +7 -0
  57. package/dist/esm/parts/TickMarksValues.js +37 -0
  58. package/dist/esm/parts/TickMarksValues.js.map +7 -0
  59. package/dist/esm/parts/Track.js +41 -0
  60. package/dist/esm/parts/Track.js.map +7 -0
  61. package/dist/esm/react-desc-prop-types.js +39 -0
  62. package/dist/esm/react-desc-prop-types.js.map +7 -0
  63. package/dist/esm/styles.js +92 -0
  64. package/dist/esm/styles.js.map +7 -0
  65. package/dist/esm/typescript-testing/typescript-slider-v2-valid.js +72 -0
  66. package/dist/esm/typescript-testing/typescript-slider-v2-valid.js.map +7 -0
  67. package/dist/esm/utils/inRange.js +12 -0
  68. package/dist/esm/utils/inRange.js.map +7 -0
  69. package/dist/esm/utils/thumbLabels.js +21 -0
  70. package/dist/esm/utils/thumbLabels.js.map +7 -0
  71. package/dist/types/DSSliderV2.d.ts +7 -0
  72. package/dist/types/DSSliderV2CTX.d.ts +5 -0
  73. package/dist/types/config/useSliderV2.d.ts +20 -0
  74. package/dist/types/config/useTickMarksValues.d.ts +2 -0
  75. package/dist/types/config/useValidateProps.d.ts +5 -0
  76. package/dist/types/constants/index.d.ts +12 -0
  77. package/dist/types/index.d.ts +3 -0
  78. package/dist/types/parts/MainContent.d.ts +1 -0
  79. package/dist/types/parts/Thumb.d.ts +2 -0
  80. package/dist/types/parts/TickMarks.d.ts +1 -0
  81. package/dist/types/parts/TickMarksValues.d.ts +1 -0
  82. package/dist/types/parts/Track.d.ts +2 -0
  83. package/dist/types/react-desc-prop-types.d.ts +30 -0
  84. package/dist/types/styles.d.ts +21 -0
  85. package/dist/types/tests/axe-core.test.d.ts +1 -0
  86. package/dist/types/tests/events.test.d.ts +1 -0
  87. package/dist/types/tests/render.test.d.ts +1 -0
  88. package/dist/types/typescript-testing/typescript-slider-v2-valid.d.ts +1 -0
  89. package/dist/types/utils/inRange.d.ts +1 -0
  90. package/dist/types/utils/thumbLabels.d.ts +7 -0
  91. package/package.json +78 -0
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var TickMarks_exports = {};
30
+ __export(TickMarks_exports, {
31
+ TickMarks: () => TickMarks
32
+ });
33
+ module.exports = __toCommonJS(TickMarks_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_styles = require("../styles.js");
38
+ var import_inRange = require("../utils/inRange.js");
39
+ var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
40
+ const TickMarks = () => {
41
+ const {
42
+ propsWithDefault: { step, minValue, maxValue },
43
+ rangeValues,
44
+ getOwnerProps,
45
+ getOwnerPropsArguments
46
+ } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
47
+ const dots = (0, import_react.useMemo)(() => {
48
+ const dotsArr = [];
49
+ for (let value = minValue; value <= maxValue; value += step) {
50
+ const isActive = (0, import_inRange.inRange)(value, rangeValues);
51
+ dotsArr.push(
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_styles.StyledDot,
54
+ {
55
+ isActive,
56
+ getOwnerProps,
57
+ getOwnerPropsArguments
58
+ },
59
+ value
60
+ )
61
+ );
62
+ }
63
+ return dotsArr;
64
+ }, [getOwnerProps, getOwnerPropsArguments, maxValue, minValue, rangeValues, step]);
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledDotsContainer, { getOwnerProps, getOwnerPropsArguments, children: dots });
66
+ };
67
+ //# sourceMappingURL=TickMarks.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/TickMarks.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { StyledDot, StyledDotsContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarks = () => {\n const {\n propsWithDefault: { step, minValue, maxValue },\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const dots = useMemo(() => {\n const dotsArr = [];\n\n for (let value = minValue; value <= maxValue; value += step) {\n const isActive = inRange(value, rangeValues);\n dotsArr.push(\n <StyledDot\n isActive={isActive}\n key={value}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />,\n );\n }\n\n return dotsArr;\n }, [getOwnerProps, getOwnerPropsArguments, maxValue, minValue, rangeValues, step]);\n\n return (\n <StyledDotsContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {dots}\n </StyledDotsContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBf;AAnBR,mBAA2C;AAC3C,oBAA+C;AAC/C,qBAAwB;AACxB,2BAA8B;AAEvB,MAAM,YAAY,MAAM;AAC7B,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,UAAU,SAAS;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,WAAO,sBAAQ,MAAM;AACzB,UAAM,UAAU,CAAC;AAEjB,aAAS,QAAQ,UAAU,SAAS,UAAU,SAAS,MAAM;AAC3D,YAAM,eAAW,wBAAQ,OAAO,WAAW;AAC3C,cAAQ;AAAA,QACN;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YAEA;AAAA,YACA;AAAA;AAAA,UAFK;AAAA,QAGP;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,wBAAwB,UAAU,UAAU,aAAa,IAAI,CAAC;AAEjF,SACE,4CAAC,qCAAoB,eAA8B,wBAChD,gBACH;AAEJ;",
6
+ "names": ["DSSliderV2Context"]
7
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var TickMarksValues_exports = {};
30
+ __export(TickMarksValues_exports, {
31
+ TickMarksValues: () => TickMarksValues
32
+ });
33
+ module.exports = __toCommonJS(TickMarksValues_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_styles = require("../styles.js");
38
+ var import_inRange = require("../utils/inRange.js");
39
+ var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
40
+ const TickMarksValues = () => {
41
+ const {
42
+ propsWithDefault: { customTickMarksValues },
43
+ rangeValues,
44
+ tickMarkPositions,
45
+ instanceUid,
46
+ getOwnerProps,
47
+ getOwnerPropsArguments
48
+ } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
49
+ const markValues = (0, import_react.useMemo)(
50
+ () => tickMarkPositions.map((value, index) => {
51
+ const isSelected = (0, import_inRange.inRange)(value, rangeValues);
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_styles.StyledTickMarkValue,
54
+ {
55
+ isSelected,
56
+ getOwnerProps,
57
+ getOwnerPropsArguments,
58
+ children: customTickMarksValues[index] ?? value
59
+ },
60
+ `${instanceUid}-${value}`
61
+ );
62
+ }),
63
+ [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues]
64
+ );
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTickMarksContainer, { getOwnerProps, getOwnerPropsArguments, children: markValues });
66
+ };
67
+ //# sourceMappingURL=TickMarksValues.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/TickMarksValues.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n return (\n <StyledTickMarkValue\n key={`${instanceUid}-${value}`}\n isSelected={isSelected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customTickMarksValues[index] ?? value}\n </StyledTickMarkValue>\n );\n }),\n [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues],\n );\n\n return (\n <StyledTickMarksContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBb;AApBV,mBAA2C;AAC3C,oBAA8D;AAC9D,qBAAwB;AACxB,2BAA8B;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,sBAAsB;AAAA,IAC1C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,iBAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,iBAAa,wBAAQ,OAAO,WAAW;AAC7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,eAAe;AAAA,MAMzB;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE,4CAAC,0CAAyB,eAA8B,wBACrD,sBACH;AAEJ;",
6
+ "names": ["DSSliderV2Context"]
7
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Track_exports = {};
30
+ __export(Track_exports, {
31
+ Track: () => Track
32
+ });
33
+ module.exports = __toCommonJS(Track_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_TickMarks = require("./TickMarks.js");
38
+ var import_TickMarksValues = require("./TickMarksValues.js");
39
+ var import_styles = require("../styles.js");
40
+ var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
41
+ const Track = ({ children, props, disabled }) => {
42
+ const {
43
+ propsWithDefault: { minValue, maxValue, withTickMarksValues, withTickMarks },
44
+ rangeValues,
45
+ getOwnerProps,
46
+ getOwnerPropsArguments
47
+ } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
48
+ const { ref, ...rest } = props;
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
51
+ import_styles.StyledTrack,
52
+ {
53
+ ...rest,
54
+ innerRef: ref,
55
+ disabled,
56
+ minValue,
57
+ maxValue,
58
+ rangeValues,
59
+ multiple: rangeValues.length === 2,
60
+ getOwnerProps,
61
+ getOwnerPropsArguments,
62
+ children: [
63
+ children,
64
+ withTickMarks && !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TickMarks.TickMarks, {})
65
+ ]
66
+ }
67
+ ),
68
+ withTickMarksValues && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TickMarksValues.TickMarksValues, {})
69
+ ] });
70
+ };
71
+ //# sourceMappingURL=Track.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/Track.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useContext } from 'react';\nimport { TickMarks } from './TickMarks.js';\nimport { TickMarksValues } from './TickMarksValues.js';\nimport { StyledTrack } from '../styles.js';\nimport type { IRenderTrackParams } from 'react-range/lib/types.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const Track = ({ children, props, disabled }: IRenderTrackParams) => {\n const {\n propsWithDefault: { minValue, maxValue, withTickMarksValues, withTickMarks },\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { ref, ...rest } = props;\n\n return (\n <>\n <StyledTrack\n {...rest} // This is needed because it's received from the library\n innerRef={ref}\n disabled={disabled}\n minValue={minValue}\n maxValue={maxValue}\n rangeValues={rangeValues}\n multiple={rangeValues.length === 2}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n {withTickMarks && !disabled && <TickMarks />}\n </StyledTrack>\n {withTickMarksValues && <TickMarksValues />}\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBnB;AAlBJ,mBAAkC;AAClC,uBAA0B;AAC1B,6BAAgC;AAChC,oBAA4B;AAE5B,2BAA8B;AAEvB,MAAM,QAAQ,CAAC,EAAE,UAAU,OAAO,SAAS,MAA0B;AAC1E,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,UAAU,qBAAqB,cAAc;AAAA,IAC3E;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AAEzB,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,YAAY,WAAW;AAAA,QACjC;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,iBAAiB,CAAC,YAAY,4CAAC,8BAAU;AAAA;AAAA;AAAA,IAC5C;AAAA,IACC,uBAAuB,4CAAC,0CAAgB;AAAA,KAC3C;AAEJ;",
6
+ "names": ["DSSliderV2Context"]
7
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSSliderV2PropTypes: () => DSSliderV2PropTypes,
32
+ DSSliderV2PropTypesSchema: () => DSSliderV2PropTypesSchema,
33
+ defaultProps: () => defaultProps
34
+ });
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_constants = require("./constants/index.js");
39
+ const defaultProps = {
40
+ disabled: false,
41
+ step: 5,
42
+ onValueChange: () => {
43
+ },
44
+ withTickMarks: false,
45
+ withTickMarksValues: false,
46
+ customTickMarksValues: [],
47
+ multiple: false
48
+ };
49
+ const DSSliderV2PropTypes = {
50
+ ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSSliderV2Name, import_constants.SLIDER_V2_SLOTS),
51
+ ...import_ds_props_helpers.globalAttributesPropTypes,
52
+ ...import_ds_props_helpers.xstyledPropTypes,
53
+ disabled: import_ds_props_helpers.PropTypes.bool.description("disable slider").defaultValue(false),
54
+ minValue: import_ds_props_helpers.PropTypes.number.description("min value for slider").defaultValue(0),
55
+ maxValue: import_ds_props_helpers.PropTypes.number.description("max value for slider").defaultValue(100),
56
+ step: import_ds_props_helpers.PropTypes.number.description("steps of values from min to max").defaultValue(5),
57
+ onValueChange: import_ds_props_helpers.PropTypes.func.description("change handler").defaultValue(() => {
58
+ }),
59
+ withTickMarks: import_ds_props_helpers.PropTypes.bool.description("add tick marks between steps").defaultValue(false),
60
+ withTickMarksValues: import_ds_props_helpers.PropTypes.bool.description("add step value to tickmark").defaultValue(false),
61
+ customTickMarksValues: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.number])).description("Explicitly set tickmark values for custom tickmarks").defaultValue([])
62
+ };
63
+ const DSSliderV2PropTypesSchema = DSSliderV2PropTypes;
64
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerSlotPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSSliderV2T {\n export type ValueType<TMultiple extends boolean> = TMultiple extends true\n ? [number, number]\n : TMultiple extends false\n ? number\n : number | [number, number];\n\n export interface RequiredProps<TMultiple extends boolean> {\n value: ValueType<TMultiple>;\n minValue: number;\n maxValue: number;\n }\n\n export interface DefaultProps<TMultiple extends boolean> {\n multiple: TMultiple;\n disabled: boolean;\n step: number;\n onValueChange: (newValue: ValueType<TMultiple>) => void;\n withTickMarks: boolean;\n withTickMarksValues: boolean;\n customTickMarksValues: string[];\n }\n\n export interface OptionalProps extends PropsForGlobalOnSlots<typeof DSSliderV2Name, typeof SLIDER_V2_SLOTS> {\n className?: string;\n }\n\n export interface Props<TMultiple extends boolean = false>\n extends Partial<DefaultProps<TMultiple>>,\n OptionalProps,\n XstyledProps,\n RequiredProps<TMultiple> {}\n\n export interface InternalProps<TMultiple extends boolean = false>\n extends DefaultProps<TMultiple>,\n OptionalProps,\n XstyledProps,\n RequiredProps<TMultiple> {}\n}\n\nexport const defaultProps: DSSliderV2T.DefaultProps<boolean> = {\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n multiple: false as boolean,\n};\n\nexport const DSSliderV2PropTypes: DSPropTypesSchema<DSSliderV2T.Props<boolean>> = {\n ...getPropsPerSlotPropTypes(DSSliderV2Name, SLIDER_V2_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n disabled: PropTypes.bool.description('disable slider').defaultValue(false),\n minValue: PropTypes.number.description('min value for slider').defaultValue(0),\n maxValue: PropTypes.number.description('max value for slider').defaultValue(100),\n step: PropTypes.number.description('steps of values from min to max').defaultValue(5),\n onValueChange: PropTypes.func.description('change handler').defaultValue(() => {}),\n withTickMarks: PropTypes.bool.description('add tick marks between steps').defaultValue(false),\n withTickMarksValues: PropTypes.bool.description('add step value to tickmark').defaultValue(false),\n customTickMarksValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n .description('Explicitly set tickmark values for custom tickmarks')\n .defaultValue([]),\n};\n\nexport const DSSliderV2PropTypesSchema = DSSliderV2PropTypes as unknown as WeakValidationMap<\n DSSliderV2T.Props<boolean>\n>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,uBAAgD;AA2CzC,MAAM,eAAkD;AAAA,EAC7D,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,UAAU;AACZ;AAEO,MAAM,sBAAqE;AAAA,EAChF,OAAG,kDAAyB,iCAAgB,gCAAe;AAAA,EAC3D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,KAAK;AAAA,EACzE,UAAU,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,CAAC;AAAA,EAC7E,UAAU,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,GAAG;AAAA,EAC/E,MAAM,kCAAU,OAAO,YAAY,iCAAiC,EAAE,aAAa,CAAC;AAAA,EACpF,eAAe,kCAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACjF,eAAe,kCAAU,KAAK,YAAY,8BAA8B,EAAE,aAAa,KAAK;AAAA,EAC5F,qBAAqB,kCAAU,KAAK,YAAY,4BAA4B,EAAE,aAAa,KAAK;AAAA,EAChG,uBAAuB,kCAAU,QAAQ,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC,EAC/F,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AACpB;AAEO,MAAM,4BAA4B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styles_exports = {};
30
+ __export(styles_exports, {
31
+ StyledDot: () => StyledDot,
32
+ StyledDotsContainer: () => StyledDotsContainer,
33
+ StyledRangeWrapper: () => StyledRangeWrapper,
34
+ StyledThumb: () => StyledThumb,
35
+ StyledTickMarkValue: () => StyledTickMarkValue,
36
+ StyledTickMarksContainer: () => StyledTickMarksContainer,
37
+ StyledTrack: () => StyledTrack,
38
+ StyledWrapper: () => StyledWrapper
39
+ });
40
+ module.exports = __toCommonJS(styles_exports);
41
+ var React = __toESM(require("react"));
42
+ var import_react_range = require("react-range");
43
+ var import_ds_grid = require("@elliemae/ds-grid");
44
+ var import_ds_system = require("@elliemae/ds-system");
45
+ var import_constants = require("./constants/index.js");
46
+ const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.ROOT })``;
47
+ const StyledRangeWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.RANGE_WRAPPER })``;
48
+ const StyledTrack = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.TRACK })`
49
+ position: relative;
50
+ height: ${(props) => props.theme.space.xxxs};
51
+ width: 100%;
52
+ min-width: ${(props) => props.theme.space.xl};
53
+ border-radius: ${(props) => props.theme.space.xxxs};
54
+ background: ${(props) => props.disabled ? props.theme.colors.neutral[100] : (0, import_react_range.getTrackBackground)({
55
+ values: props.rangeValues,
56
+ colors: props.multiple ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]] : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],
57
+ min: props.minValue,
58
+ max: props.maxValue
59
+ })};
60
+ `;
61
+ const StyledDot = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.DOT })`
62
+ &:after {
63
+ content: '';
64
+ background: ${(props) => props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400]};
65
+ border-radius: ${(props) => props.theme.space.xxxs};
66
+ display: block;
67
+ position: relative;
68
+ width: 2px;
69
+ height: 2px;
70
+ }
71
+ `;
72
+ const StyledDotsContainer = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.DOT_CONTAINER })`
73
+ padding: 0 2px;
74
+ align-items: center;
75
+ display: flex;
76
+ justify-content: space-between;
77
+ pointer-events: none;
78
+ position: absolute;
79
+ top: 0;
80
+ left: 0;
81
+ right: 0;
82
+ bottom: 0;
83
+ z-index: ${(props) => props.theme.zIndex.tooltip - 1};
84
+ `;
85
+ const StyledTickMarkValue = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.TICK_MARK_VALUE })`
86
+ display: flex;
87
+ justify-content: center;
88
+ text-align: center;
89
+ min-height: ${(props) => props.theme.space.xs};
90
+ overflow: visible;
91
+ width: ${(props) => props.theme.space.xxxs};
92
+ color: ${(props) => props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500]};
93
+ `;
94
+ const StyledTickMarksContainer = (0, import_ds_system.styled)("div", {
95
+ name: import_constants.DSSliderV2Name,
96
+ slot: import_constants.SLIDER_V2_SLOTS.TICK_MARK_CONTAINER
97
+ })`
98
+ display: flex;
99
+ justify-content: space-between;
100
+ // this next property-value rever the sanitize.css value
101
+ overflow-wrap: normal;
102
+ `;
103
+ const StyledThumb = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.THUMB })`
104
+ height: 20px;
105
+ width: 20px;
106
+ top: 0;
107
+ background-color: ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral["000"]};
108
+ border-radius: 10px;
109
+ border: 1px solid ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};
110
+
111
+ :focus {
112
+ border: 2px solid brand-700;
113
+ outline: unset;
114
+ }
115
+
116
+ :hover {
117
+ background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[100] : theme.colors.brand[200]};
118
+ }
119
+
120
+ z-index: ${(props) => props.theme.zIndex.tooltip};
121
+ `;
122
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { getTrackBackground } from 'react-range';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;\n\nexport const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<{\n disabled: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}>`\n position: relative;\n height: ${(props) => props.theme.space.xxxs};\n width: 100%;\n min-width: ${(props) => props.theme.space.xl};\n border-radius: ${(props) => props.theme.space.xxxs};\n background: ${(props) =>\n props.disabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.multiple\n ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })<{ isActive: boolean }>`\n &:after {\n content: '';\n background: ${(props) => (props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400])};\n border-radius: ${(props) => props.theme.space.xxxs};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nexport const StyledDotsContainer = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT_CONTAINER })`\n padding: 0 2px;\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip - 1};\n`;\n\nexport const StyledTickMarkValue = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TICK_MARK_VALUE })<{\n isSelected: boolean;\n}>`\n display: flex;\n justify-content: center;\n text-align: center;\n min-height: ${(props) => props.theme.space.xs};\n overflow: visible;\n width: ${(props) => props.theme.space.xxxs};\n color: ${(props) => (props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500])};\n`;\n\nexport const StyledTickMarksContainer = styled('div', {\n name: DSSliderV2Name,\n slot: SLIDER_V2_SLOTS.TICK_MARK_CONTAINER,\n})`\n display: flex;\n justify-content: space-between;\n // this next property-value rever the sanitize.css value\n overflow-wrap: normal;\n`;\n\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<{ disabled: boolean }>`\n height: 20px;\n width: 20px;\n top: 0;\n background-color: ${(props) =>\n props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid ${(props) => (props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400])};\n\n :focus {\n border: 2px solid brand-700;\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[100] : theme.colors.brand[200])};\n }\n\n z-index: ${(props) => props.theme.zIndex.tooltip};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmC;AACnC,qBAAqB;AACrB,uBAAuB;AACvB,uBAAgD;AAEzC,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,KAAK,CAAC;AAEvF,MAAM,yBAAqB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,cAAc,CAAC;AAErG,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA,YAQlF,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,eAE1B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBACzB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,gBAChC,CAAC,UACb,MAAM,WACF,MAAM,MAAM,OAAO,QAAQ,GAAG,QAC9B,uCAAmB;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM,WACV,CAAC,MAAM,MAAM,OAAO,QAAQ,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC,IAChG,CAAC,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACnE,KAAK,MAAM;AAAA,EACX,KAAK,MAAM;AACb,CAAC;AAAA;AAGF,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,IAAI,CAAC;AAAA;AAAA;AAAA,kBAGxE,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,qBACxF,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ3C,MAAM,0BAAsB,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWjG,CAAC,UAAU,MAAM,MAAM,OAAO,UAAU;AAAA;AAG9C,MAAM,0BAAsB,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA,gBAMhG,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,WAElC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WAC7B,CAAC,UAAW,MAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAGnG,MAAM,+BAA2B,yBAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA,sBAIxE,CAAC,UACnB,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA,sBAEjE,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQ3F,CAAC,EAAE,UAAU,MAAM,MAAO,WAAW,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,aAGlG,CAAC,UAAU,MAAM,MAAM,OAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import__ = require("../index.js");
27
+ const testRequiredProps = {
28
+ value: 0,
29
+ minValue: 0,
30
+ maxValue: 100
31
+ };
32
+ const testOptionalProps = {};
33
+ const testPartialDefaults = {
34
+ multiple: false
35
+ };
36
+ const testProps = {
37
+ ...testRequiredProps,
38
+ ...testOptionalProps,
39
+ ...testPartialDefaults
40
+ };
41
+ const testPropsAsSyntax = {
42
+ ...testRequiredProps,
43
+ ...testOptionalProps,
44
+ ...testPartialDefaults
45
+ };
46
+ const testCompleteDefaults = {
47
+ multiple: false,
48
+ disabled: false,
49
+ step: 5,
50
+ onValueChange: () => {
51
+ },
52
+ withTickMarks: false,
53
+ withTickMarksValues: false,
54
+ customTickMarksValues: []
55
+ };
56
+ const testInternalProps = {
57
+ ...testRequiredProps,
58
+ ...testOptionalProps,
59
+ ...testCompleteDefaults
60
+ };
61
+ const testInternalPropsAsSyntax = {
62
+ ...testRequiredProps,
63
+ ...testOptionalProps,
64
+ ...testCompleteDefaults
65
+ };
66
+ const testExplicitDefinition = {
67
+ value: 0,
68
+ minValue: 0,
69
+ maxValue: 100,
70
+ multiple: false
71
+ };
72
+ const testInferedTypeCompatibility = {
73
+ value: 0,
74
+ minValue: 0,
75
+ maxValue: 100,
76
+ multiple: false
77
+ };
78
+ const testDefinitionAsConst = {
79
+ value: 0,
80
+ minValue: 0,
81
+ maxValue: 100,
82
+ multiple: false
83
+ };
84
+ const onSingleValueChange = (value) => {
85
+ };
86
+ const onMultipleValueChange = (value) => {
87
+ };
88
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testExplicitDefinition }),
90
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testInferedTypeCompatibility }),
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testDefinitionAsConst }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange: onSingleValueChange }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange: onMultipleValueChange })
94
+ ] });
95
+ //# sourceMappingURL=typescript-slider-v2-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-slider-v2-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSSliderV2 } from '../index.js';\nimport type { DSSliderV2T } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSSliderV2T.Props<boolean>;\ntype ComponentPropsInternals = DSSliderV2T.InternalProps<boolean>;\ntype ComponentPropsDefaultProps = DSSliderV2T.DefaultProps<boolean>;\ntype ComponentPropsOptionalProps = DSSliderV2T.OptionalProps;\ntype ComponentPropsRequiredProps = DSSliderV2T.RequiredProps<boolean>;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n value: 0,\n minValue: 0,\n maxValue: 100,\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n multiple: false,\n};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n multiple: false,\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n value: 0,\n minValue: 0,\n maxValue: 100,\n multiple: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n value: 0,\n minValue: 0,\n maxValue: 100,\n multiple: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n value: 0,\n minValue: 0,\n maxValue: 100,\n multiple: false,\n} as const;\n\nconst onSingleValueChange = (value: number) => {};\nconst onMultipleValueChange = (value: [number, number]) => {};\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSSliderV2 {...testExplicitDefinition} />\n <DSSliderV2 {...testInferedTypeCompatibility} />\n <DSSliderV2 {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSSliderV2 value={0} minValue={0} maxValue={100} onValueChange={onSingleValueChange} />\n {/* multiple auto inference works */}\n <DSSliderV2 multiple value={[0, 100]} minValue={0} maxValue={100} onValueChange={onMultipleValueChange} />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACiFrB;AAhFF,eAA2B;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AACZ;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,uBAAuB,CAAC;AAC1B;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,sBAAsB,CAAC,UAAkB;AAAC;AAChD,MAAM,wBAAwB,CAAC,UAA4B;AAAC;AAE5D,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC,4CAAC,uBAAW,OAAO,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,qBAAqB;AAAA,EAEtF,4CAAC,uBAAW,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,uBAAuB;AAAA,GAC1G;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var inRange_exports = {};
30
+ __export(inRange_exports, {
31
+ inRange: () => inRange
32
+ });
33
+ module.exports = __toCommonJS(inRange_exports);
34
+ var React = __toESM(require("react"));
35
+ const inRange = (value, range) => {
36
+ const [left, right] = range;
37
+ if (right === void 0) {
38
+ return value === left;
39
+ }
40
+ return left <= value && value <= right;
41
+ };
42
+ //# sourceMappingURL=inRange.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utils/inRange.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const inRange = (value: number, range: [number] | [number, number]) => {\n const [left, right] = range;\n\n if (right === undefined) {\n return value === left;\n }\n return left <= value && value <= right;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,UAAU,CAAC,OAAe,UAAuC;AAC5E,QAAM,CAAC,MAAM,KAAK,IAAI;AAEtB,MAAI,UAAU,QAAW;AACvB,WAAO,UAAU;AAAA,EACnB;AACA,SAAO,QAAQ,SAAS,SAAS;AACnC;",
6
+ "names": []
7
+ }