@elliemae/ds-slider-v2 3.62.1 → 3.70.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/cjs/DSSliderV2.js.map +2 -2
  2. package/dist/cjs/DSSliderV2CTX.js.map +2 -2
  3. package/dist/cjs/config/useSliderV2.js +1 -4
  4. package/dist/cjs/config/useSliderV2.js.map +2 -2
  5. package/dist/cjs/config/useTickMarksValues.js.map +2 -2
  6. package/dist/cjs/config/useValidateProps.js +13 -0
  7. package/dist/cjs/config/useValidateProps.js.map +2 -2
  8. package/dist/cjs/parts/MainContent.js +40 -19
  9. package/dist/cjs/parts/MainContent.js.map +2 -2
  10. package/dist/cjs/parts/Thumb.js +79 -46
  11. package/dist/cjs/parts/Thumb.js.map +2 -2
  12. package/dist/cjs/parts/TickMarks.js +10 -27
  13. package/dist/cjs/parts/TickMarks.js.map +2 -2
  14. package/dist/cjs/parts/TickMarksValues.js +15 -19
  15. package/dist/cjs/parts/TickMarksValues.js.map +2 -2
  16. package/dist/cjs/parts/Track.js +14 -8
  17. package/dist/cjs/parts/Track.js.map +2 -2
  18. package/dist/cjs/{styles.js → parts/styles.js} +54 -25
  19. package/dist/cjs/parts/styles.js.map +7 -0
  20. package/dist/cjs/react-desc-prop-types.js +9 -3
  21. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  22. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-auto-polymorph-multiple.js +96 -0
  23. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-auto-polymorph-multiple.js.map +7 -0
  24. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-auto-polymorph-single.js +97 -0
  25. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-auto-polymorph-single.js.map +7 -0
  26. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-multiple.js +98 -0
  27. package/dist/cjs/typescript-testing/typescript-slider-v2-valid-multiple.js.map +7 -0
  28. package/dist/cjs/typescript-testing/{typescript-slider-v2-valid.js → typescript-slider-v2-valid-single.js} +2 -5
  29. package/dist/cjs/typescript-testing/{typescript-slider-v2-valid.js.map → typescript-slider-v2-valid-single.js.map} +3 -3
  30. package/dist/esm/DSSliderV2.js.map +2 -2
  31. package/dist/esm/DSSliderV2CTX.js.map +2 -2
  32. package/dist/esm/config/useSliderV2.js +1 -4
  33. package/dist/esm/config/useSliderV2.js.map +2 -2
  34. package/dist/esm/config/useTickMarksValues.js.map +2 -2
  35. package/dist/esm/config/useValidateProps.js +13 -0
  36. package/dist/esm/config/useValidateProps.js.map +2 -2
  37. package/dist/esm/parts/MainContent.js +41 -20
  38. package/dist/esm/parts/MainContent.js.map +2 -2
  39. package/dist/esm/parts/Thumb.js +78 -45
  40. package/dist/esm/parts/Thumb.js.map +2 -2
  41. package/dist/esm/parts/TickMarks.js +11 -28
  42. package/dist/esm/parts/TickMarks.js.map +2 -2
  43. package/dist/esm/parts/TickMarksValues.js +15 -19
  44. package/dist/esm/parts/TickMarksValues.js.map +2 -2
  45. package/dist/esm/parts/Track.js +15 -9
  46. package/dist/esm/parts/Track.js.map +2 -2
  47. package/dist/esm/{styles.js → parts/styles.js} +55 -26
  48. package/dist/esm/parts/styles.js.map +7 -0
  49. package/dist/esm/react-desc-prop-types.js +9 -3
  50. package/dist/esm/react-desc-prop-types.js.map +2 -2
  51. package/dist/esm/typescript-testing/typescript-slider-v2-valid-auto-polymorph-multiple.js +73 -0
  52. package/dist/esm/typescript-testing/typescript-slider-v2-valid-auto-polymorph-multiple.js.map +7 -0
  53. package/dist/esm/typescript-testing/typescript-slider-v2-valid-auto-polymorph-single.js +74 -0
  54. package/dist/esm/typescript-testing/typescript-slider-v2-valid-auto-polymorph-single.js.map +7 -0
  55. package/dist/esm/typescript-testing/typescript-slider-v2-valid-multiple.js +75 -0
  56. package/dist/esm/typescript-testing/typescript-slider-v2-valid-multiple.js.map +7 -0
  57. package/dist/esm/typescript-testing/{typescript-slider-v2-valid.js → typescript-slider-v2-valid-single.js} +2 -5
  58. package/dist/esm/typescript-testing/{typescript-slider-v2-valid.js.map → typescript-slider-v2-valid-single.js.map} +3 -3
  59. package/dist/types/DSSliderV2.d.ts +3 -2
  60. package/dist/types/DSSliderV2CTX.d.ts +1 -1
  61. package/dist/types/config/useSliderV2.d.ts +6 -6
  62. package/dist/types/config/useTickMarksValues.d.ts +1 -1
  63. package/dist/types/config/useValidateProps.d.ts +1 -1
  64. package/dist/types/parts/MainContent.d.ts +1 -1
  65. package/dist/types/parts/Thumb.d.ts +8 -1
  66. package/dist/types/parts/TickMarks.d.ts +1 -1
  67. package/dist/types/parts/TickMarksValues.d.ts +1 -1
  68. package/dist/types/parts/Track.d.ts +1 -1
  69. package/dist/types/{styles.d.ts → parts/styles.d.ts} +12 -9
  70. package/dist/types/react-desc-prop-types.d.ts +36 -16
  71. package/package.json +12 -12
  72. package/dist/cjs/styles.js.map +0 -7
  73. package/dist/cjs/utils/thumbLabels.js +0 -51
  74. package/dist/cjs/utils/thumbLabels.js.map +0 -7
  75. package/dist/esm/styles.js.map +0 -7
  76. package/dist/esm/utils/thumbLabels.js +0 -21
  77. package/dist/esm/utils/thumbLabels.js.map +0 -7
  78. package/dist/types/tests/DSSliderV2.PUI-15228.test.d.ts +0 -1
  79. package/dist/types/tests/DSSliderV2.PUI-15992.test.d.ts +0 -1
  80. package/dist/types/tests/DSSliderV2.a11y.test.d.ts +0 -1
  81. package/dist/types/tests/DSSliderV2.clickjump.test.d.ts +0 -1
  82. package/dist/types/tests/DSSliderV2.data-testid.test.d.ts +0 -1
  83. package/dist/types/tests/DSSliderV2.events.test.d.ts +0 -1
  84. package/dist/types/tests/DSSliderV2.exports.test.d.ts +0 -1
  85. package/dist/types/tests/DSSliderV2.keyboard.test.d.ts +0 -1
  86. package/dist/types/tests/DSSliderv2.api.test.d.ts +0 -1
  87. package/dist/types/tests/axe-core.test.d.ts +0 -1
  88. package/dist/types/typescript-testing/typescript-slider-v2-valid.d.ts +0 -1
  89. package/dist/types/utils/thumbLabels.d.ts +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TickMarksValues.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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, maxValue, minValue },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { columnWidth } = useMemo(() => {\n const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);\n const calculatedColumnWidthPercentage = `${(distanceBetweenDots / (maxValue - minValue)) * 100}%`;\n return { columnWidth: calculatedColumnWidthPercentage };\n }, [maxValue, minValue, tickMarkPositions.length]);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n\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\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n columnCount={tickMarkPositions.length}\n columnWidth={columnWidth}\n >\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2Bb;AA3BV,SAAgB,YAAY,eAAe;AAC3C,SAAS,qBAAqB,gCAAgC;AAC9D,SAAS,eAAe;AACxB,OAAO,uBAAuB;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,uBAAuB,UAAU,SAAS;AAAA,IAC9D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,EAAE,YAAY,IAAI,QAAQ,MAAM;AACpC,UAAM,uBAAuB,WAAW,aAAa,kBAAkB,SAAS;AAChF,UAAM,kCAAkC,GAAI,uBAAuB,WAAW,YAAa,GAAG;AAC9F,WAAO,EAAE,aAAa,gCAAgC;AAAA,EACxD,GAAG,CAAC,UAAU,UAAU,kBAAkB,MAAM,CAAC;AAEjD,QAAM,aAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,aAAa,QAAQ,OAAO,WAAW;AAE7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,MAM9B;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,aAAa,kBAAkB;AAAA,MAC/B;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { inRange } from '../utils/inRange.js';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from './styles.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues, maxValue, minValue },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { columnWidth } = useMemo(() => {\n const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);\n const calculatedColumnWidthPercentage = `${(distanceBetweenDots / (maxValue - minValue)) * 100}%`;\n return { columnWidth: calculatedColumnWidthPercentage };\n }, [maxValue, minValue, tickMarkPositions.length]);\n\n return (\n <StyledTickMarksContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n columnCount={tickMarkPositions.length}\n columnWidth={columnWidth}\n >\n {tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n\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 </StyledTickMarksContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgCb;AAhCV,SAAS,YAAY,eAAe;AACpC,OAAO,uBAAuB;AAC9B,SAAS,eAAe;AACxB,SAAS,qBAAqB,gCAAgC;AAEvD,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,uBAAuB,UAAU,SAAS;AAAA,IAC9D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,EAAE,YAAY,IAAI,QAAQ,MAAM;AACpC,UAAM,uBAAuB,WAAW,aAAa,kBAAkB,SAAS;AAChF,UAAM,kCAAkC,GAAI,uBAAuB,WAAW,YAAa,GAAG;AAC9F,WAAO,EAAE,aAAa,gCAAgC;AAAA,EACxD,GAAG,CAAC,UAAU,UAAU,kBAAkB,MAAM,CAAC;AAEjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,aAAa,kBAAkB;AAAA,MAC/B;AAAA,MAEC,4BAAkB,IAAI,CAAC,OAAO,UAAU;AACvC,cAAM,aAAa,QAAQ,OAAO,WAAW;AAE7C,eACE;AAAA,UAAC;AAAA;AAAA,YAEC;AAAA,YACA;AAAA,YACA;AAAA,YAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,UAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,QAM9B;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,30 +1,36 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import { useContext, useMemo } from "react";
4
+ import DSSliderV2Context from "../DSSliderV2CTX.js";
4
5
  import { TickMarks } from "./TickMarks.js";
5
6
  import { TickMarksValues } from "./TickMarksValues.js";
6
- import { StyledTrack } from "../styles.js";
7
- import DSSliderV2Context from "../DSSliderV2CTX.js";
8
- const Track = ({ children, props, disabled }) => {
7
+ import { StyledTrack } from "./styles.js";
8
+ const Track = ({ children, props: reactRangeOpinionatedProps, disabled }) => {
9
9
  const {
10
- propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, withTickMarksValues, withTickMarks },
10
+ propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, withTickMarksValues, withTickMarks, multiple },
11
11
  rangeValues,
12
12
  getOwnerProps,
13
13
  getOwnerPropsArguments
14
14
  } = useContext(DSSliderV2Context);
15
- const { ref, ...rest } = props;
15
+ const { ref, style: trackStyle, ...propsFromReactRangeTookAsIsForTheTrack } = reactRangeOpinionatedProps;
16
+ const sanitizedStyle = useMemo(() => {
17
+ if (disabled || applyAriaDisabled || readOnly) return { ...trackStyle, cursor: "not-allowed" };
18
+ return trackStyle;
19
+ }, [applyAriaDisabled, disabled, readOnly, trackStyle]);
16
20
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17
21
  /* @__PURE__ */ jsxs(
18
22
  StyledTrack,
19
23
  {
20
- ...rest,
24
+ style: sanitizedStyle,
25
+ ...propsFromReactRangeTookAsIsForTheTrack,
21
26
  innerRef: ref,
22
27
  disabled,
23
- applyAriaDisabled: applyAriaDisabled || readOnly,
28
+ $readOnly: readOnly,
29
+ $applyAriaDisabled: applyAriaDisabled,
24
30
  minValue,
25
31
  maxValue,
26
32
  rangeValues,
27
- multiple: rangeValues.length === 2,
33
+ multiple,
28
34
  getOwnerProps,
29
35
  getOwnerPropsArguments,
30
36
  children: [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Track.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport type { IRenderTrackParams } from 'react-range/lib/types.js';\nimport { TickMarks } from './TickMarks.js';\nimport { TickMarksValues } from './TickMarksValues.js';\nimport { StyledTrack } from '../styles.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const Track = ({ children, props, disabled }: IRenderTrackParams) => {\n const {\n propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, 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 applyAriaDisabled={applyAriaDisabled || readOnly}\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 || !applyAriaDisabled) && <TickMarks />}\n </StyledTrack>\n {withTickMarksValues && <TickMarksValues />}\n </>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkBnB,mBAc2D,KAbzD,YADF;AAlBJ,SAAgB,kBAAkB;AAElC,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,OAAO,uBAAuB;AAEvB,MAAM,QAAQ,CAAC,EAAE,UAAU,OAAO,SAAS,MAA0B;AAC1E,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,UAAU,mBAAmB,UAAU,qBAAqB,cAAc;AAAA,IACxG;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AAEzB,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,UAAU;AAAA,QACV;AAAA,QACA,mBAAmB,qBAAqB;AAAA,QACxC;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,YAAY,WAAW;AAAA,QACjC;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,kBAAkB,CAAC,YAAY,CAAC,sBAAsB,oBAAC,aAAU;AAAA;AAAA;AAAA,IACpE;AAAA,IACC,uBAAuB,oBAAC,mBAAgB;AAAA,KAC3C;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport type { IRenderTrackParams } from 'react-range/lib/types.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { TickMarks } from './TickMarks.js';\nimport { TickMarksValues } from './TickMarksValues.js';\nimport { StyledTrack } from './styles.js';\n\nexport const Track = ({ children, props: reactRangeOpinionatedProps, disabled }: IRenderTrackParams) => {\n const {\n propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, withTickMarksValues, withTickMarks, multiple },\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { ref, style: trackStyle, ...propsFromReactRangeTookAsIsForTheTrack } = reactRangeOpinionatedProps;\n\n const sanitizedStyle = useMemo(() => {\n // we want to keep the cursor but when disabled, we want it to show as 'not-allowed'\n if (disabled || applyAriaDisabled || readOnly) return { ...trackStyle, cursor: 'not-allowed' };\n return trackStyle;\n }, [applyAriaDisabled, disabled, readOnly, trackStyle]);\n\n return (\n <>\n <StyledTrack\n style={sanitizedStyle}\n {...propsFromReactRangeTookAsIsForTheTrack} // This is needed because it's received from the library\n innerRef={ref}\n disabled={disabled}\n $readOnly={readOnly}\n $applyAriaDisabled={applyAriaDisabled}\n minValue={minValue}\n maxValue={maxValue}\n rangeValues={rangeValues}\n multiple={multiple}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n {withTickMarks && (!disabled || !applyAriaDisabled) && <TickMarks />}\n </StyledTrack>\n {withTickMarksValues && <TickMarksValues />}\n </>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwBnB,mBAgB2D,KAfzD,YADF;AAxBJ,SAAS,YAAY,eAAe;AAEpC,OAAO,uBAAuB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAErB,MAAM,QAAQ,CAAC,EAAE,UAAU,OAAO,4BAA4B,SAAS,MAA0B;AACtG,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,UAAU,mBAAmB,UAAU,qBAAqB,eAAe,SAAS;AAAA,IAClH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,EAAE,KAAK,OAAO,YAAY,GAAG,uCAAuC,IAAI;AAE9E,QAAM,iBAAiB,QAAQ,MAAM;AAEnC,QAAI,YAAY,qBAAqB,SAAU,QAAO,EAAE,GAAG,YAAY,QAAQ,cAAc;AAC7F,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,UAAU,UAAU,UAAU,CAAC;AAEtD,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACN,GAAG;AAAA,QACJ,UAAU;AAAA,QACV;AAAA,QACA,WAAW;AAAA,QACX,oBAAoB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,kBAAkB,CAAC,YAAY,CAAC,sBAAsB,oBAAC,aAAU;AAAA;AAAA;AAAA,IACpE;AAAA,IACC,uBAAuB,oBAAC,mBAAgB;AAAA,KAC3C;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,27 +1,38 @@
1
1
  import * as React from "react";
2
- import { getTrackBackground } from "react-range";
3
2
  import { Grid } from "@elliemae/ds-grid";
4
- import { styled } from "@elliemae/ds-system";
5
- import { DSSliderV2Name, SLIDER_V2_SLOTS } from "./constants/index.js";
3
+ import { css, styled } from "@elliemae/ds-system";
4
+ import { getTrackBackground } from "react-range";
5
+ import { DSSliderV2Name, SLIDER_V2_SLOTS } from "../constants/index.js";
6
6
  const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;
7
7
  const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;
8
+ const TrackStates = css`
9
+ ${({ theme, disabled, $applyAriaDisabled, $readOnly, rangeValues, multiple, minValue, maxValue }) => {
10
+ if (disabled) return `background: ${theme.colors.neutral[400]};`;
11
+ let trackColorSelected = theme.colors.brand[600];
12
+ const trackColorUnselected = theme.colors.neutral[400];
13
+ if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];
14
+ const reactRangeColors = multiple ? [trackColorUnselected, trackColorSelected, trackColorUnselected] : [trackColorSelected, trackColorUnselected];
15
+ if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];
16
+ return `background: ${getTrackBackground({
17
+ values: rangeValues,
18
+ colors: reactRangeColors,
19
+ min: minValue,
20
+ max: maxValue
21
+ })};`;
22
+ }}
23
+ `;
8
24
  const StyledTrack = styled("div", { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })`
9
25
  position: relative;
10
26
  height: ${(props) => props.theme.space.xxxs};
11
27
  width: 100%;
12
28
  min-width: ${(props) => props.theme.space.xl};
13
29
  border-radius: ${(props) => props.theme.space.xxxs};
14
- background: ${(props) => props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : getTrackBackground({
15
- values: props.rangeValues,
16
- 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]],
17
- min: props.minValue,
18
- max: props.maxValue
19
- })};
30
+ ${TrackStates}
20
31
  `;
21
32
  const StyledDot = styled("div", { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })`
22
33
  &:after {
23
34
  content: '';
24
- background: ${(props) => props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400]};
35
+ background: ${(props) => props.theme.colors.neutral["000"]};
25
36
  border-radius: ${(props) => props.theme.space.xxxs};
26
37
  display: block;
27
38
  position: relative;
@@ -66,27 +77,45 @@ const StyledTickMarksContainer = styled("div", {
66
77
  // this next property-value reverts the sanitize.css value
67
78
  overflow-wrap: normal;
68
79
  `;
80
+ const ThumbStates = css`
81
+ ${({ theme, disabled, $applyAriaDisabled, $readOnly }) => {
82
+ if (disabled)
83
+ return `
84
+ background-color: ${theme.colors.neutral[400]};
85
+ `;
86
+ const standardBgColorAndBorder = `
87
+ background-color: ${theme.colors.neutral["000"]};
88
+ border: 1px solid ${theme.colors.neutral[400]};
89
+ `;
90
+ const standardFocusRing = `:focus {
91
+ border: 2px solid ${theme.colors.brand[700]};
92
+ outline: unset;
93
+ }`;
94
+ if ($applyAriaDisabled || $readOnly)
95
+ return `
96
+ ${standardBgColorAndBorder}
97
+ :hover{
98
+ background-color: ${theme.colors.neutral["050"]};
99
+ }
100
+ ${standardFocusRing}`;
101
+ return `
102
+ ${standardBgColorAndBorder}
103
+ :hover{
104
+ background-color: ${theme.colors.brand[200]};
105
+ }
106
+ :hover:not(:focus){
107
+ border: 1px solid ${theme.colors.brand[600]};
108
+ }
109
+ ${standardFocusRing}`;
110
+ }}
111
+ `;
69
112
  const StyledThumb = styled("div", { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })`
70
113
  height: 20px;
71
114
  width: 20px;
115
+ border-radius: 50%;
72
116
  top: 0;
73
- background-color: ${(props) => props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral["000"]};
74
- border-radius: 10px;
75
- border: 1px solid
76
- ${(props) => props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};
77
-
78
- :focus {
79
- border: 2px solid brand-700;
80
- outline: unset;
81
- }
82
-
83
- :hover {
84
- background-color: ${({ disabled, applyAriaDisabled, theme }) => disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};
85
- }
86
-
87
- cursor: ${({ disabled, applyAriaDisabled }) => disabled || applyAriaDisabled ? "not-allowed" : void 0};
88
-
89
117
  z-index: ${(props) => props.theme.zIndex.tooltip};
118
+ ${ThumbStates}
90
119
  `;
91
120
  export {
92
121
  StyledDot,
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/styles.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Grid } from '@elliemae/ds-grid';\nimport { css, styled } from '@elliemae/ds-system';\nimport { getTrackBackground } from 'react-range';\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\ninterface TrackProps {\n disabled: boolean;\n $applyAriaDisabled: boolean;\n $readOnly: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}\n\nconst TrackStates = css<TrackProps>`\n ${({ theme, disabled, $applyAriaDisabled, $readOnly, rangeValues, multiple, minValue, maxValue }) => {\n if (disabled) return `background: ${theme.colors.neutral[400]};`;\n\n let trackColorSelected = theme.colors.brand[600];\n const trackColorUnselected = theme.colors.neutral[400];\n\n if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];\n\n const reactRangeColors = multiple\n ? [trackColorUnselected, trackColorSelected, trackColorUnselected]\n : [trackColorSelected, trackColorUnselected];\n\n if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];\n\n return `background: ${getTrackBackground({\n values: rangeValues,\n colors: reactRangeColors,\n min: minValue,\n max: maxValue,\n })};`;\n }}\n`;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<TrackProps>`\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 ${TrackStates}\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })`\n &:after {\n content: '';\n background: ${(props) => props.theme.colors.neutral['000']};\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 color: ${(props) => (props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500])};\n place-self: baseline;\n transform: translateX(-50%);\n white-space: normal;\n overflow-wrap: break-word;\n word-break: break-word;\n`;\n\nexport const StyledTickMarksContainer = styled('div', {\n name: DSSliderV2Name,\n slot: SLIDER_V2_SLOTS.TICK_MARK_CONTAINER,\n})<{ columnCount: number; columnWidth: string }>`\n display: grid;\n grid-template-columns: repeat(${(props) => props.columnCount}, calc(${(props) => props.columnWidth} - 4px));\n gap: 4px;\n justify-content: space-between;\n // this next property-value reverts the sanitize.css value\n overflow-wrap: normal;\n`;\n\ninterface ThumbProps {\n disabled: boolean;\n $applyAriaDisabled: boolean;\n $readOnly: boolean;\n}\nconst ThumbStates = css<ThumbProps>`\n ${({ theme, disabled, $applyAriaDisabled, $readOnly }) => {\n // ---------------------------------------------------------\n // THE CURSOR IS HANDLED BY THE LIBRARY VIA INLINE STYLES\n // ---------------------------------------------------------\n if (disabled)\n return `\n background-color: ${theme.colors.neutral[400]};\n `;\n\n const standardBgColorAndBorder = `\n background-color: ${theme.colors.neutral['000']};\n border: 1px solid ${theme.colors.neutral[400]};\n `;\n const standardFocusRing = `:focus {\n border: 2px solid ${theme.colors.brand[700]};\n outline: unset;\n }`;\n\n if ($applyAriaDisabled || $readOnly)\n return `\n ${standardBgColorAndBorder}\n :hover{\n background-color: ${theme.colors.neutral['050']};\n }\n ${standardFocusRing}`;\n\n return `\n ${standardBgColorAndBorder}\n :hover{\n background-color: ${theme.colors.brand[200]};\n }\n :hover:not(:focus){\n border: 1px solid ${theme.colors.brand[600]};\n }\n ${standardFocusRing}`;\n }}\n`;\n\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<ThumbProps>`\n height: 20px;\n width: 20px;\n border-radius: 50%;\n top: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip};\n ${ThumbStates}\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY;AACrB,SAAS,KAAK,cAAc;AAC5B,SAAS,0BAA0B;AACnC,SAAS,gBAAgB,uBAAuB;AAEzC,MAAM,gBAAgB,OAAO,MAAM,EAAE,MA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M,GAAG,CAAC;AAAA;AAAA;AAAA,4BAGvB,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,QAE3C,iBAAiB;AACvB,CAAC;AAAA;AAGI,MAAM,cAAc,OAAO,OAAO,EAAE,MAAM,gBAAgB,MAAM,gBAAgB,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAKjF,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA,IAC9C,WAAW;AAAA;",
6
+ "names": []
7
+ }
@@ -22,12 +22,15 @@ const DSSliderV2PropTypes = {
22
22
  ...getPropsPerSlotPropTypes(DSSliderV2Name, SLIDER_V2_SLOTS),
23
23
  ...globalAttributesPropTypes,
24
24
  ...xstyledPropTypes,
25
+ value: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]).description(
26
+ "The current value of the slider. Can be a single number or an array of two numbers for multiple sliders."
27
+ ).isRequired,
28
+ onValueChange: PropTypes.func.description("change handler, if multiple is true it will receive an array of two numbers").signature("(value: number) => void | (value: [number, number]) => void").defaultValue(() => {
29
+ }),
25
30
  disabled: PropTypes.bool.description("disable slider").defaultValue(false),
26
31
  minValue: PropTypes.number.description("min value for slider").defaultValue(0),
27
32
  maxValue: PropTypes.number.description("max value for slider").defaultValue(100),
28
33
  step: PropTypes.number.description("steps of values from min to max").defaultValue(5),
29
- onValueChange: PropTypes.func.description("change handler").defaultValue(() => {
30
- }),
31
34
  withTickMarks: PropTypes.bool.description("add tick marks between steps").defaultValue(false),
32
35
  withTickMarksValues: PropTypes.bool.description("add step value to tickmark").defaultValue(false),
33
36
  customTickMarksValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])).description("Explicitly set tickmark values for custom tickmarks").defaultValue([]),
@@ -36,7 +39,10 @@ const DSSliderV2PropTypes = {
36
39
  ).defaultValue(false),
37
40
  readOnly: PropTypes.bool.description(
38
41
  "Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
39
- ).defaultValue(false)
42
+ ).defaultValue(false),
43
+ minRange: PropTypes.number.description(
44
+ "In a multiple selection scenario, this defines the minimum range that must be maintained between the two values."
45
+ ).defaultValue(0)
40
46
  };
41
47
  const DSSliderV2PropTypesSchema = DSSliderV2PropTypes;
42
48
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\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 applyAriaDisabled: boolean;\n readOnly: 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\n extends TypescriptHelpersT.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 Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>,\n XstyledProps,\n RequiredProps<TMultiple> {}\n\n export interface InternalProps<TMultiple extends boolean = false>\n extends DefaultProps<TMultiple>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>,\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 applyAriaDisabled: false,\n readOnly: false,\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 applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n readOnly: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSSliderV2PropTypesSchema = DSSliderV2PropTypes as unknown as ValidationMap<DS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ourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport declare namespace DSSliderV2T {\n /* **************************************************************************************************************\n * SLIDER V2 IS POLYMORPHIC *\n ****************************************************************************************************************\n * DEFINE COMMONS INTERFACES *\n ************************************************************************************************************** */\n export type CommonRequiredProps = {\n minValue: number;\n maxValue: number;\n };\n export type CommonDefaultProps = {\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n step: number;\n withTickMarks: boolean;\n withTickMarksValues: boolean;\n customTickMarksValues: string[];\n };\n export interface CommonOptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSSliderV2Name,\n typeof SLIDER_V2_SLOTS\n > {\n className?: string;\n }\n\n /* **************************************************************************************************************\n * DEFINE EACH POLYMORPH INTERFACE *\n ****************************************************************************************************************\n * make sure to expand the relevant commons interfaces!!! *\n ************************************************************************************************************** */\n\n /* **************************************************************************************************************\n * MULTIPLE(range version) *\n ************************************************************************************************************** */\n\n // MULTIPLE POLYMORPH TYPES\n export type RequiredPropsMultiple = CommonRequiredProps & {\n value: [number, number];\n };\n export type DefaultPropsMultiple = CommonDefaultProps & {\n multiple: true; // this must be ACTUALLY true, it's used as the distinguisher from typescript\n onValueChange: (newValue: [number, number]) => void;\n minRange: number; // for the \"multiple\" version, the minimum range is a default prop\n };\n export type OptionalPropsMultiple = CommonOptionalProps;\n /* **************************************************************************************************************\n * each polimorphism needs it's own \"Props\" and \"InternalProps\" defined!!! *\n ************************************************************************************************************** */\n export type PropsMultiple = Partial<DefaultPropsMultiple> &\n OptionalPropsMultiple &\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultPropsMultiple | keyof OptionalPropsMultiple | keyof XstyledProps | keyof RequiredPropsMultiple\n > &\n XstyledProps &\n RequiredPropsMultiple;\n export type InternalPropsMultiple = DefaultPropsMultiple &\n OptionalPropsMultiple &\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultPropsMultiple | keyof OptionalPropsMultiple | keyof XstyledProps | keyof RequiredPropsMultiple\n > &\n XstyledProps &\n RequiredPropsMultiple;\n\n /* **************************************************************************************************************\n * SINGLE(number picker version) *\n ************************************************************************************************************** */\n // SINGLE POLYMORPH TYPES\n export type RequiredPropsSingle = CommonRequiredProps & {\n value: number;\n };\n export type DefaultPropsSingle = CommonDefaultProps & {\n multiple: false; // this must be ACTUALLY false, it's used as the distinguisher from typescript\n onValueChange: (newValue: number) => void;\n };\n export type OptionalPropsSingle = CommonOptionalProps & {\n // for the \"single\" version, the minimum range is not applicable\n // keeping this minRange here helps typescript to discriminate if the component is being used in \"single\" or \"multiple\" mode\n // by setting it to \"never\", we ensure that if someone tries to use \"minRange\" with the single version, TypeScript will throw an error\n minRange?: never;\n };\n /* **************************************************************************************************************\n * each polimorphism needs it's own \"Props\" and \"InternalProps\" defined!!! *\n ************************************************************************************************************** */\n export type PropsSingle = Partial<DefaultPropsSingle> &\n OptionalPropsSingle &\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultPropsSingle | keyof OptionalPropsSingle | keyof XstyledProps | keyof RequiredPropsSingle\n > &\n XstyledProps &\n RequiredPropsSingle;\n export type InternalPropsSingle = DefaultPropsSingle &\n OptionalPropsSingle &\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultPropsSingle | keyof OptionalPropsSingle | keyof XstyledProps | keyof RequiredPropsSingle\n > &\n XstyledProps &\n RequiredPropsSingle;\n\n /* **************************************************************************************************************\n * WRAP UP THE POLYMORPHIC CONTRACT *\n ************************************************************************************************************** */\n export type DefaultProps = DefaultPropsMultiple | DefaultPropsSingle;\n export type RequiredProps = RequiredPropsMultiple | RequiredPropsSingle;\n export type OptionalProps = OptionalPropsMultiple | OptionalPropsSingle;\n export type Props = PropsMultiple | PropsSingle;\n export type InternalProps = InternalPropsMultiple | InternalPropsSingle;\n}\n\nexport const defaultProps: DSSliderV2T.DefaultProps = {\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n multiple: false,\n applyAriaDisabled: false,\n readOnly: false,\n};\n\nexport const DSSliderV2PropTypes: DSPropTypesSchema<DSSliderV2T.Props> = {\n ...getPropsPerSlotPropTypes(DSSliderV2Name, SLIDER_V2_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]).description(\n 'The current value of the slider. Can be a single number or an array of two numbers for multiple sliders.',\n ).isRequired,\n onValueChange: PropTypes.func\n .description('change handler, if multiple is true it will receive an array of two numbers')\n .signature('(value: number) => void | (value: [number, number]) => void')\n .defaultValue(() => {}),\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 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 applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n readOnly: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n minRange: PropTypes.number\n .description(\n 'In a multiple selection scenario, this defines the minimum range that must be maintained between the two values.',\n )\n .defaultValue(0),\n};\n\nexport const DSSliderV2PropTypesSchema = DSSliderV2PropTypes as unknown as ValidationMap<DSSliderV2T.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,uBAAuB;AAmHzC,MAAM,eAAyC;AAAA,EACpD,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,UAAU;AACZ;AAEO,MAAM,sBAA4D;AAAA,EACvE,GAAG,yBAAyB,gBAAgB,eAAe;AAAA,EAC3D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,EAAE;AAAA,IAClF;AAAA,EACF,EAAE;AAAA,EACF,eAAe,UAAU,KACtB,YAAY,6EAA6E,EACzF,UAAU,6DAA6D,EACvE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,UAAU,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,KAAK;AAAA,EACzE,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,CAAC;AAAA,EAC7E,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,GAAG;AAAA,EAC/E,MAAM,UAAU,OAAO,YAAY,iCAAiC,EAAE,aAAa,CAAC;AAAA,EACpF,eAAe,UAAU,KAAK,YAAY,8BAA8B,EAAE,aAAa,KAAK;AAAA,EAC5F,qBAAqB,UAAU,KAAK,YAAY,4BAA4B,EAAE,aAAa,KAAK;AAAA,EAChG,uBAAuB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,EAC/F,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AAAA,EAClB,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,OACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC;AACnB;AAEO,MAAM,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,73 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSSliderV2 } from "../index.js";
4
+ const testRequiredProps = {
5
+ value: [10, 50],
6
+ minValue: 0,
7
+ maxValue: 100
8
+ };
9
+ const testOptionalProps = {};
10
+ const testPartialDefaults = {
11
+ multiple: true,
12
+ applyAriaDisabled: false
13
+ };
14
+ const testProps = {
15
+ ...testRequiredProps,
16
+ ...testOptionalProps,
17
+ ...testPartialDefaults
18
+ };
19
+ const testPropsAsSyntax = {
20
+ ...testRequiredProps,
21
+ ...testOptionalProps,
22
+ ...testPartialDefaults
23
+ };
24
+ const testCompleteDefaults = {
25
+ multiple: true,
26
+ disabled: false,
27
+ step: 5,
28
+ onValueChange: () => {
29
+ },
30
+ withTickMarks: false,
31
+ withTickMarksValues: false,
32
+ customTickMarksValues: [],
33
+ applyAriaDisabled: false,
34
+ readOnly: false,
35
+ minRange: 10
36
+ };
37
+ const testInternalProps = {
38
+ ...testRequiredProps,
39
+ ...testOptionalProps,
40
+ ...testCompleteDefaults
41
+ };
42
+ const testInternalPropsAsSyntax = {
43
+ ...testRequiredProps,
44
+ ...testOptionalProps,
45
+ ...testCompleteDefaults
46
+ };
47
+ const testExplicitDefinition = {
48
+ value: [10, 50],
49
+ minValue: 0,
50
+ maxValue: 100,
51
+ multiple: true
52
+ };
53
+ const testInferedTypeCompatibility = {
54
+ value: [10, 50],
55
+ minValue: 0,
56
+ maxValue: 100,
57
+ multiple: true
58
+ };
59
+ const testDefinitionAsConst = {
60
+ value: [10, 50],
61
+ minValue: 0,
62
+ maxValue: 100,
63
+ multiple: true
64
+ };
65
+ const onValueChange = (value) => {
66
+ };
67
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
68
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testExplicitDefinition }),
69
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testInferedTypeCompatibility }),
70
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testDefinitionAsConst }),
71
+ /* @__PURE__ */ jsx(DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange })
72
+ ] });
73
+ //# sourceMappingURL=typescript-slider-v2-valid-auto-polymorph-multiple.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-auto-polymorph-multiple.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;\ntype ComponentPropsInternals = DSSliderV2T.InternalProps;\ntype ComponentPropsDefaultProps = DSSliderV2T.DefaultProps;\ntype ComponentPropsOptionalProps = DSSliderV2T.OptionalProps;\ntype ComponentPropsRequiredProps = DSSliderV2T.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n value: [10, 50],\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: true,\n applyAriaDisabled: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n multiple: true,\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n applyAriaDisabled: false,\n readOnly: false,\n minRange: 10,\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: [10, 50],\n minValue: 0,\n maxValue: 100,\n multiple: true,\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: [10, 50],\n minValue: 0,\n maxValue: 100,\n multiple: true,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n value: [10, 50] as [number, number],\n minValue: 0,\n maxValue: 100,\n multiple: true,\n} as const;\n\nconst onValueChange = (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 multiple value={[0, 100]} minValue={0} maxValue={100} onValueChange={onValueChange} />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;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BAAC,cAAY,GAAG,8BAA8B;AAAA,EAC9C,oBAAC,cAAY,GAAG,uBAAuB;AAAA,EAEvC,oBAAC,cAAW,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAA8B;AAAA,GAClG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,74 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSSliderV2 } from "../index.js";
4
+ const testRequiredProps = {
5
+ value: 0,
6
+ minValue: 0,
7
+ maxValue: 100
8
+ };
9
+ const testOptionalProps = {
10
+ minRange: void 0
11
+ };
12
+ const testPartialDefaults = {
13
+ multiple: false,
14
+ applyAriaDisabled: false
15
+ };
16
+ const testProps = {
17
+ ...testRequiredProps,
18
+ ...testOptionalProps,
19
+ ...testPartialDefaults
20
+ };
21
+ const testPropsAsSyntax = {
22
+ ...testRequiredProps,
23
+ ...testOptionalProps,
24
+ ...testPartialDefaults
25
+ };
26
+ const testCompleteDefaults = {
27
+ multiple: false,
28
+ disabled: false,
29
+ step: 5,
30
+ onValueChange: () => {
31
+ },
32
+ withTickMarks: false,
33
+ withTickMarksValues: false,
34
+ customTickMarksValues: [],
35
+ applyAriaDisabled: false,
36
+ readOnly: false
37
+ };
38
+ const testInternalProps = {
39
+ ...testRequiredProps,
40
+ ...testOptionalProps,
41
+ ...testCompleteDefaults
42
+ };
43
+ const testInternalPropsAsSyntax = {
44
+ ...testRequiredProps,
45
+ ...testOptionalProps,
46
+ ...testCompleteDefaults
47
+ };
48
+ const testExplicitDefinition = {
49
+ value: 0,
50
+ minValue: 0,
51
+ maxValue: 100,
52
+ multiple: false
53
+ };
54
+ const testInferedTypeCompatibility = {
55
+ value: 0,
56
+ minValue: 0,
57
+ maxValue: 100,
58
+ multiple: false
59
+ };
60
+ const testDefinitionAsConst = {
61
+ value: 0,
62
+ minValue: 0,
63
+ maxValue: 100,
64
+ multiple: false
65
+ };
66
+ const onValueChange = (value) => {
67
+ };
68
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testExplicitDefinition }),
70
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testInferedTypeCompatibility }),
71
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testDefinitionAsConst }),
72
+ /* @__PURE__ */ jsx(DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange })
73
+ ] });
74
+ //# sourceMappingURL=typescript-slider-v2-valid-auto-polymorph-single.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-auto-polymorph-single.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;\ntype ComponentPropsInternals = DSSliderV2T.InternalProps;\ntype ComponentPropsDefaultProps = DSSliderV2T.DefaultProps;\ntype ComponentPropsOptionalProps = DSSliderV2T.OptionalProps;\ntype ComponentPropsRequiredProps = DSSliderV2T.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n value: 0,\n minValue: 0,\n maxValue: 100,\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n minRange: undefined,\n};\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 applyAriaDisabled: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\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 applyAriaDisabled: false,\n readOnly: false,\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 onValueChange = (value: 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={onValueChange} />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwFrB,mBAEE,KAFF;AAvFF,SAAS,kBAAkB;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD;AAAA,EACrD,UAAU;AACZ;AAIA,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AAAA,EACV,mBAAmB;AACrB;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,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;AAAA,EACxB,mBAAmB;AAAA,EACnB,UAAU;AACZ;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,gBAAgB,CAAC,UAAkB;AAAC;AAE1C,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,cAAY,GAAG,wBAAwB;AAAA,EACxC,oBAAC,cAAY,GAAG,8BAA8B;AAAA,EAC9C,oBAAC,cAAY,GAAG,uBAAuB;AAAA,EAEvC,oBAAC,cAAW,OAAO,GAAG,UAAU,GAAG,UAAU,KAAK,eAA8B;AAAA,GAClF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSSliderV2 } from "../index.js";
4
+ const testRequiredProps = {
5
+ value: [10, 50],
6
+ minValue: 0,
7
+ maxValue: 100
8
+ };
9
+ const testOptionalProps = {};
10
+ const testPartialDefaults = {
11
+ multiple: true,
12
+ applyAriaDisabled: false
13
+ };
14
+ const testProps = {
15
+ ...testRequiredProps,
16
+ ...testOptionalProps,
17
+ ...testPartialDefaults
18
+ };
19
+ const testPropsAsSyntax = {
20
+ ...testRequiredProps,
21
+ ...testOptionalProps,
22
+ ...testPartialDefaults
23
+ };
24
+ const testCompleteDefaults = {
25
+ multiple: true,
26
+ onValueChange: (newVal) => {
27
+ },
28
+ disabled: false,
29
+ step: 5,
30
+ withTickMarks: false,
31
+ withTickMarksValues: false,
32
+ customTickMarksValues: [],
33
+ applyAriaDisabled: false,
34
+ readOnly: false,
35
+ minRange: 0
36
+ };
37
+ const testInternalProps = {
38
+ ...testRequiredProps,
39
+ ...testOptionalProps,
40
+ ...testCompleteDefaults
41
+ };
42
+ const testInternalPropsAsSyntax = {
43
+ ...testRequiredProps,
44
+ ...testOptionalProps,
45
+ ...testCompleteDefaults
46
+ };
47
+ const testExplicitDefinition = {
48
+ value: [10, 50],
49
+ multiple: true,
50
+ minValue: 0,
51
+ maxValue: 100,
52
+ minRange: 1
53
+ };
54
+ const testInferedTypeCompatibility = {
55
+ value: [10, 50],
56
+ multiple: true,
57
+ minValue: 0,
58
+ maxValue: 100
59
+ };
60
+ const testDefinitionAsConst = {
61
+ value: [10, 50],
62
+ multiple: true,
63
+ minValue: 0,
64
+ maxValue: 100,
65
+ minRange: 1
66
+ };
67
+ const onMultipleValueChange = (value) => {
68
+ };
69
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testExplicitDefinition }),
71
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testInferedTypeCompatibility }),
72
+ /* @__PURE__ */ jsx(DSSliderV2, { ...testDefinitionAsConst }),
73
+ /* @__PURE__ */ jsx(DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange: onMultipleValueChange })
74
+ ] });
75
+ //# sourceMappingURL=typescript-slider-v2-valid-multiple.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-multiple.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.PropsMultiple;\ntype ComponentPropsInternals = DSSliderV2T.InternalPropsMultiple;\ntype ComponentPropsDefaultProps = DSSliderV2T.DefaultPropsMultiple;\ntype ComponentPropsOptionalProps = DSSliderV2T.OptionalPropsMultiple;\ntype ComponentPropsRequiredProps = DSSliderV2T.RequiredPropsMultiple;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n value: [10, 50],\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: true,\n applyAriaDisabled: 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: true,\n onValueChange: (newVal: [number, number]) => {},\n disabled: false,\n step: 5,\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n applyAriaDisabled: false,\n readOnly: false,\n minRange: 0,\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: [10, 50],\n multiple: true,\n minValue: 0,\n maxValue: 100,\n minRange: 1,\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: [10, 50],\n multiple: true,\n minValue: 0,\n maxValue: 100,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n value: [10, 50] as [number, number],\n multiple: true,\n minValue: 0,\n maxValue: 100,\n minRange: 1,\n} as const;\n\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 {/* multiple auto inference works */}\n <DSSliderV2 multiple value={[0, 100]} minValue={0} maxValue={100} onValueChange={onMultipleValueChange} />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACsFrB,mBAEE,KAFF;AArFF,SAAS,kBAAkB;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO,CAAC,IAAI,EAAE;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AAAA,EACV,mBAAmB;AACrB;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,eAAe,CAAC,WAA6B;AAAA,EAAC;AAAA,EAC9C,UAAU;AAAA,EACV,MAAM;AAAA,EACN,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AACZ;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,CAAC,IAAI,EAAE;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO,CAAC,IAAI,EAAE;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO,CAAC,IAAI,EAAE;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,wBAAwB,CAAC,UAA4B;AAAC;AAE5D,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,cAAY,GAAG,wBAAwB;AAAA,EACxC,oBAAC,cAAY,GAAG,8BAA8B;AAAA,EAC9C,oBAAC,cAAY,GAAG,uBAAuB;AAAA,EAEvC,oBAAC,cAAW,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,uBAAuB;AAAA,GAC1G;",
6
+ "names": []
7
+ }
@@ -63,13 +63,10 @@ const testDefinitionAsConst = {
63
63
  };
64
64
  const onSingleValueChange = (value) => {
65
65
  };
66
- const onMultipleValueChange = (value) => {
67
- };
68
66
  const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
69
67
  /* @__PURE__ */ jsx(DSSliderV2, { ...testExplicitDefinition }),
70
68
  /* @__PURE__ */ jsx(DSSliderV2, { ...testInferedTypeCompatibility }),
71
69
  /* @__PURE__ */ jsx(DSSliderV2, { ...testDefinitionAsConst }),
72
- /* @__PURE__ */ jsx(DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange: onSingleValueChange }),
73
- /* @__PURE__ */ jsx(DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange: onMultipleValueChange })
70
+ /* @__PURE__ */ jsx(DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange: onSingleValueChange })
74
71
  ] });
75
- //# sourceMappingURL=typescript-slider-v2-valid.js.map
72
+ //# sourceMappingURL=typescript-slider-v2-valid-single.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
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 applyAriaDisabled: 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 applyAriaDisabled: false,\n readOnly: false,\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,YAAY,WAAW;ACoFrB,mBAEE,KAFF;AAnFF,SAAS,kBAAkB;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;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Q,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,uBAAuB;AAAA,GAC1G;",
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-slider-v2-valid-single.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.PropsSingle;\ntype ComponentPropsInternals = DSSliderV2T.InternalPropsSingle;\ntype ComponentPropsDefaultProps = DSSliderV2T.DefaultPropsSingle;\ntype ComponentPropsOptionalProps = DSSliderV2T.OptionalPropsSingle;\ntype ComponentPropsRequiredProps = DSSliderV2T.RequiredPropsSingle;\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 applyAriaDisabled: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\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 applyAriaDisabled: false,\n readOnly: false,\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) => {};\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 </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACsFrB,mBAEE,KAFF;AArFF,SAAS,kBAAkB;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AAAA,EACV,mBAAmB;AACrB;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,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;AAAA,EACxB,mBAAmB;AAAA,EACnB,U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