@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
@@ -34,30 +34,36 @@ module.exports = __toCommonJS(Track_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
+ var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
37
38
  var import_TickMarks = require("./TickMarks.js");
38
39
  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 }) => {
40
+ var import_styles = require("./styles.js");
41
+ const Track = ({ children, props: reactRangeOpinionatedProps, disabled }) => {
42
42
  const {
43
- propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, withTickMarksValues, withTickMarks },
43
+ propsWithDefault: { minValue, maxValue, applyAriaDisabled, readOnly, withTickMarksValues, withTickMarks, multiple },
44
44
  rangeValues,
45
45
  getOwnerProps,
46
46
  getOwnerPropsArguments
47
47
  } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
48
- const { ref, ...rest } = props;
48
+ const { ref, style: trackStyle, ...propsFromReactRangeTookAsIsForTheTrack } = reactRangeOpinionatedProps;
49
+ const sanitizedStyle = (0, import_react.useMemo)(() => {
50
+ if (disabled || applyAriaDisabled || readOnly) return { ...trackStyle, cursor: "not-allowed" };
51
+ return trackStyle;
52
+ }, [applyAriaDisabled, disabled, readOnly, trackStyle]);
49
53
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
50
54
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
51
55
  import_styles.StyledTrack,
52
56
  {
53
- ...rest,
57
+ style: sanitizedStyle,
58
+ ...propsFromReactRangeTookAsIsForTheTrack,
54
59
  innerRef: ref,
55
60
  disabled,
56
- applyAriaDisabled: applyAriaDisabled || readOnly,
61
+ $readOnly: readOnly,
62
+ $applyAriaDisabled: applyAriaDisabled,
57
63
  minValue,
58
64
  maxValue,
59
65
  rangeValues,
60
- multiple: rangeValues.length === 2,
66
+ multiple,
61
67
  getOwnerProps,
62
68
  getOwnerPropsArguments,
63
69
  children: [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/Track.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBnB;AAlBJ,mBAAkC;AAElC,uBAA0B;AAC1B,6BAAgC;AAChC,oBAA4B;AAC5B,2BAA8B;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,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,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,4CAAC,8BAAU;AAAA;AAAA;AAAA,IACpE;AAAA,IACC,uBAAuB,4CAAC,0CAAgB;AAAA,KAC3C;AAEJ;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwBnB;AAxBJ,mBAAoC;AAEpC,2BAA8B;AAC9B,uBAA0B;AAC1B,6BAAgC;AAChC,oBAA4B;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,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,EAAE,KAAK,OAAO,YAAY,GAAG,uCAAuC,IAAI;AAE9E,QAAM,qBAAiB,sBAAQ,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,4EACE;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,4CAAC,8BAAU;AAAA;AAAA;AAAA,IACpE;AAAA,IACC,uBAAuB,4CAAC,0CAAgB;AAAA,KAC3C;AAEJ;",
6
6
  "names": ["DSSliderV2Context"]
7
7
  }
@@ -39,29 +39,40 @@ __export(styles_exports, {
39
39
  });
40
40
  module.exports = __toCommonJS(styles_exports);
41
41
  var React = __toESM(require("react"));
42
- var import_react_range = require("react-range");
43
42
  var import_ds_grid = require("@elliemae/ds-grid");
44
43
  var import_ds_system = require("@elliemae/ds-system");
45
- var import_constants = require("./constants/index.js");
44
+ var import_react_range = require("react-range");
45
+ var import_constants = require("../constants/index.js");
46
46
  const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.ROOT })``;
47
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 TrackStates = import_ds_system.css`
49
+ ${({ theme, disabled, $applyAriaDisabled, $readOnly, rangeValues, multiple, minValue, maxValue }) => {
50
+ if (disabled) return `background: ${theme.colors.neutral[400]};`;
51
+ let trackColorSelected = theme.colors.brand[600];
52
+ const trackColorUnselected = theme.colors.neutral[400];
53
+ if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];
54
+ const reactRangeColors = multiple ? [trackColorUnselected, trackColorSelected, trackColorUnselected] : [trackColorSelected, trackColorUnselected];
55
+ if ($applyAriaDisabled || $readOnly) trackColorSelected = theme.colors.neutral[700];
56
+ return `background: ${(0, import_react_range.getTrackBackground)({
57
+ values: rangeValues,
58
+ colors: reactRangeColors,
59
+ min: minValue,
60
+ max: maxValue
61
+ })};`;
62
+ }}
63
+ `;
48
64
  const StyledTrack = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.TRACK })`
49
65
  position: relative;
50
66
  height: ${(props) => props.theme.space.xxxs};
51
67
  width: 100%;
52
68
  min-width: ${(props) => props.theme.space.xl};
53
69
  border-radius: ${(props) => props.theme.space.xxxs};
54
- background: ${(props) => props.disabled || props.applyAriaDisabled ? 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
- })};
70
+ ${TrackStates}
60
71
  `;
61
72
  const StyledDot = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.DOT })`
62
73
  &:after {
63
74
  content: '';
64
- background: ${(props) => props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400]};
75
+ background: ${(props) => props.theme.colors.neutral["000"]};
65
76
  border-radius: ${(props) => props.theme.space.xxxs};
66
77
  display: block;
67
78
  position: relative;
@@ -106,26 +117,44 @@ const StyledTickMarksContainer = (0, import_ds_system.styled)("div", {
106
117
  // this next property-value reverts the sanitize.css value
107
118
  overflow-wrap: normal;
108
119
  `;
120
+ const ThumbStates = import_ds_system.css`
121
+ ${({ theme, disabled, $applyAriaDisabled, $readOnly }) => {
122
+ if (disabled)
123
+ return `
124
+ background-color: ${theme.colors.neutral[400]};
125
+ `;
126
+ const standardBgColorAndBorder = `
127
+ background-color: ${theme.colors.neutral["000"]};
128
+ border: 1px solid ${theme.colors.neutral[400]};
129
+ `;
130
+ const standardFocusRing = `:focus {
131
+ border: 2px solid ${theme.colors.brand[700]};
132
+ outline: unset;
133
+ }`;
134
+ if ($applyAriaDisabled || $readOnly)
135
+ return `
136
+ ${standardBgColorAndBorder}
137
+ :hover{
138
+ background-color: ${theme.colors.neutral["050"]};
139
+ }
140
+ ${standardFocusRing}`;
141
+ return `
142
+ ${standardBgColorAndBorder}
143
+ :hover{
144
+ background-color: ${theme.colors.brand[200]};
145
+ }
146
+ :hover:not(:focus){
147
+ border: 1px solid ${theme.colors.brand[600]};
148
+ }
149
+ ${standardFocusRing}`;
150
+ }}
151
+ `;
109
152
  const StyledThumb = (0, import_ds_system.styled)("div", { name: import_constants.DSSliderV2Name, slot: import_constants.SLIDER_V2_SLOTS.THUMB })`
110
153
  height: 20px;
111
154
  width: 20px;
155
+ border-radius: 50%;
112
156
  top: 0;
113
- background-color: ${(props) => props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral["000"]};
114
- border-radius: 10px;
115
- border: 1px solid
116
- ${(props) => props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};
117
-
118
- :focus {
119
- border: 2px solid brand-700;
120
- outline: unset;
121
- }
122
-
123
- :hover {
124
- background-color: ${({ disabled, applyAriaDisabled, theme }) => disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};
125
- }
126
-
127
- cursor: ${({ disabled, applyAriaDisabled }) => disabled || applyAriaDisabled ? "not-allowed" : void 0};
128
-
129
157
  z-index: ${(props) => props.theme.zIndex.tooltip};
158
+ ${ThumbStates}
130
159
  `;
131
160
  //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["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", "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,qBAAqB;AACrB,uBAA4B;AAC5B,yBAAmC;AACnC,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;AAY5G,MAAM,cAAc;AAAA,IAChB,CAAC,EAAE,OAAO,UAAU,oBAAoB,WAAW,aAAa,UAAU,UAAU,SAAS,MAAM;AACnG,MAAI,SAAU,QAAO,eAAe,MAAM,OAAO,QAAQ,GAAG,CAAC;AAE7D,MAAI,qBAAqB,MAAM,OAAO,MAAM,GAAG;AAC/C,QAAM,uBAAuB,MAAM,OAAO,QAAQ,GAAG;AAErD,MAAI,sBAAsB,UAAW,sBAAqB,MAAM,OAAO,QAAQ,GAAG;AAElF,QAAM,mBAAmB,WACrB,CAAC,sBAAsB,oBAAoB,oBAAoB,IAC/D,CAAC,oBAAoB,oBAAoB;AAE7C,MAAI,sBAAsB,UAAW,sBAAqB,MAAM,OAAO,QAAQ,GAAG;AAElF,SAAO,mBAAe,uCAAmB;AAAA,IACvC,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,KAAK;AAAA,EACP,CAAC,CAAC;AACJ,CAAC;AAAA;AAGI,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA,YAElF,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA,eAE9B,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,mBAC3B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,IAChD,WAAW;AAAA;AAGR,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,IAAI,CAAC;AAAA;AAAA;AAAA,kBAGxE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,qBACzC,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ/C,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,CAAC;AAAA;AAG/C,MAAM,0BAAsB,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA,gBAMhG,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA,WAEpC,CAAC,UAAW,MAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQrG,MAAM,+BAA2B,yBAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,iCAAgB;AACxB,CAAC;AAAA;AAAA,kCAEiC,CAAC,UAAU,MAAM,WAAW,UAAU,CAAC,UAAU,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpG,MAAM,cAAc;AAAA,IAChB,CAAC,EAAE,OAAO,UAAU,oBAAoB,UAAU,MAAM;AAIxD,MAAI;AACF,WAAO;AAAA,0BACa,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAG/C,QAAM,2BAA2B;AAAA,0BACX,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,0BAC3B,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAE/C,QAAM,oBAAoB;AAAA,4BACF,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAI/C,MAAI,sBAAsB;AACxB,WAAO;AAAA,QACL,wBAAwB;AAAA;AAAA,4BAEJ,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,QAE/C,iBAAiB;AAErB,SAAO;AAAA,QACH,wBAAwB;AAAA;AAAA,4BAEJ,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA,4BAGvB,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,QAE3C,iBAAiB;AACvB,CAAC;AAAA;AAGI,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAKjF,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA,IAC9C,WAAW;AAAA;",
6
+ "names": []
7
+ }
@@ -52,12 +52,15 @@ const DSSliderV2PropTypes = {
52
52
  ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSSliderV2Name, import_constants.SLIDER_V2_SLOTS),
53
53
  ...import_ds_props_helpers.globalAttributesPropTypes,
54
54
  ...import_ds_props_helpers.xstyledPropTypes,
55
+ value: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.number)]).description(
56
+ "The current value of the slider. Can be a single number or an array of two numbers for multiple sliders."
57
+ ).isRequired,
58
+ onValueChange: import_ds_props_helpers.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(() => {
59
+ }),
55
60
  disabled: import_ds_props_helpers.PropTypes.bool.description("disable slider").defaultValue(false),
56
61
  minValue: import_ds_props_helpers.PropTypes.number.description("min value for slider").defaultValue(0),
57
62
  maxValue: import_ds_props_helpers.PropTypes.number.description("max value for slider").defaultValue(100),
58
63
  step: import_ds_props_helpers.PropTypes.number.description("steps of values from min to max").defaultValue(5),
59
- onValueChange: import_ds_props_helpers.PropTypes.func.description("change handler").defaultValue(() => {
60
- }),
61
64
  withTickMarks: import_ds_props_helpers.PropTypes.bool.description("add tick marks between steps").defaultValue(false),
62
65
  withTickMarksValues: import_ds_props_helpers.PropTypes.bool.description("add step value to tickmark").defaultValue(false),
63
66
  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([]),
@@ -66,7 +69,10 @@ const DSSliderV2PropTypes = {
66
69
  ).defaultValue(false),
67
70
  readOnly: import_ds_props_helpers.PropTypes.bool.description(
68
71
  "Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
69
- ).defaultValue(false)
72
+ ).defaultValue(false),
73
+ minRange: import_ds_props_helpers.PropTypes.number.description(
74
+ "In a multiple selection scenario, this defines the minimum range that must be maintained between the two values."
75
+ ).defaultValue(0)
70
76
  };
71
77
  const DSSliderV2PropTypesSchema = DSSliderV2PropTypes;
72
78
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 { 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<DSSliderV2T.Props<boolean>>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AAEP,uBAAgD;AA+CzC,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;AAAA,EACV,mBAAmB;AAAA,EACnB,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;AAAA,EAClB,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,4BAA4B;",
4
+ "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AAEP,uBAAgD;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,OAAG,kDAAyB,iCAAgB,gCAAe;AAAA,EAC3D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC,EAAE;AAAA,IAClF;AAAA,EACF,EAAE;AAAA,EACF,eAAe,kCAAU,KACtB,YAAY,6EAA6E,EACzF,UAAU,6DAA6D,EACvE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,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,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;AAAA,EAClB,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,KACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,OACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,CAAC;AACnB;AAEO,MAAM,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,96 @@
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: [10, 50],
29
+ minValue: 0,
30
+ maxValue: 100
31
+ };
32
+ const testOptionalProps = {};
33
+ const testPartialDefaults = {
34
+ multiple: true,
35
+ applyAriaDisabled: false
36
+ };
37
+ const testProps = {
38
+ ...testRequiredProps,
39
+ ...testOptionalProps,
40
+ ...testPartialDefaults
41
+ };
42
+ const testPropsAsSyntax = {
43
+ ...testRequiredProps,
44
+ ...testOptionalProps,
45
+ ...testPartialDefaults
46
+ };
47
+ const testCompleteDefaults = {
48
+ multiple: true,
49
+ disabled: false,
50
+ step: 5,
51
+ onValueChange: () => {
52
+ },
53
+ withTickMarks: false,
54
+ withTickMarksValues: false,
55
+ customTickMarksValues: [],
56
+ applyAriaDisabled: false,
57
+ readOnly: false,
58
+ minRange: 10
59
+ };
60
+ const testInternalProps = {
61
+ ...testRequiredProps,
62
+ ...testOptionalProps,
63
+ ...testCompleteDefaults
64
+ };
65
+ const testInternalPropsAsSyntax = {
66
+ ...testRequiredProps,
67
+ ...testOptionalProps,
68
+ ...testCompleteDefaults
69
+ };
70
+ const testExplicitDefinition = {
71
+ value: [10, 50],
72
+ minValue: 0,
73
+ maxValue: 100,
74
+ multiple: true
75
+ };
76
+ const testInferedTypeCompatibility = {
77
+ value: [10, 50],
78
+ minValue: 0,
79
+ maxValue: 100,
80
+ multiple: true
81
+ };
82
+ const testDefinitionAsConst = {
83
+ value: [10, 50],
84
+ minValue: 0,
85
+ maxValue: 100,
86
+ multiple: true
87
+ };
88
+ const onValueChange = (value) => {
89
+ };
90
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testExplicitDefinition }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testInferedTypeCompatibility }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testDefinitionAsConst }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange })
95
+ ] });
96
+ //# 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,YAAuB;ACuFrB;AAtFF,eAA2B;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;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;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;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;AACZ;AAEA,MAAM,gBAAgB,CAAC,UAA4B;AAAC;AAEpD,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,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAA8B;AAAA,GAClG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,97 @@
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
+ minRange: void 0
34
+ };
35
+ const testPartialDefaults = {
36
+ multiple: false,
37
+ applyAriaDisabled: false
38
+ };
39
+ const testProps = {
40
+ ...testRequiredProps,
41
+ ...testOptionalProps,
42
+ ...testPartialDefaults
43
+ };
44
+ const testPropsAsSyntax = {
45
+ ...testRequiredProps,
46
+ ...testOptionalProps,
47
+ ...testPartialDefaults
48
+ };
49
+ const testCompleteDefaults = {
50
+ multiple: false,
51
+ disabled: false,
52
+ step: 5,
53
+ onValueChange: () => {
54
+ },
55
+ withTickMarks: false,
56
+ withTickMarksValues: false,
57
+ customTickMarksValues: [],
58
+ applyAriaDisabled: false,
59
+ readOnly: false
60
+ };
61
+ const testInternalProps = {
62
+ ...testRequiredProps,
63
+ ...testOptionalProps,
64
+ ...testCompleteDefaults
65
+ };
66
+ const testInternalPropsAsSyntax = {
67
+ ...testRequiredProps,
68
+ ...testOptionalProps,
69
+ ...testCompleteDefaults
70
+ };
71
+ const testExplicitDefinition = {
72
+ value: 0,
73
+ minValue: 0,
74
+ maxValue: 100,
75
+ multiple: false
76
+ };
77
+ const testInferedTypeCompatibility = {
78
+ value: 0,
79
+ minValue: 0,
80
+ maxValue: 100,
81
+ multiple: false
82
+ };
83
+ const testDefinitionAsConst = {
84
+ value: 0,
85
+ minValue: 0,
86
+ maxValue: 100,
87
+ multiple: false
88
+ };
89
+ const onValueChange = (value) => {
90
+ };
91
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testExplicitDefinition }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testInferedTypeCompatibility }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testDefinitionAsConst }),
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange })
96
+ ] });
97
+ //# 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,YAAuB;ACwFrB;AAvFF,eAA2B;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,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,eAA8B;AAAA,GAClF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,98 @@
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: [10, 50],
29
+ minValue: 0,
30
+ maxValue: 100
31
+ };
32
+ const testOptionalProps = {};
33
+ const testPartialDefaults = {
34
+ multiple: true,
35
+ applyAriaDisabled: false
36
+ };
37
+ const testProps = {
38
+ ...testRequiredProps,
39
+ ...testOptionalProps,
40
+ ...testPartialDefaults
41
+ };
42
+ const testPropsAsSyntax = {
43
+ ...testRequiredProps,
44
+ ...testOptionalProps,
45
+ ...testPartialDefaults
46
+ };
47
+ const testCompleteDefaults = {
48
+ multiple: true,
49
+ onValueChange: (newVal) => {
50
+ },
51
+ disabled: false,
52
+ step: 5,
53
+ withTickMarks: false,
54
+ withTickMarksValues: false,
55
+ customTickMarksValues: [],
56
+ applyAriaDisabled: false,
57
+ readOnly: false,
58
+ minRange: 0
59
+ };
60
+ const testInternalProps = {
61
+ ...testRequiredProps,
62
+ ...testOptionalProps,
63
+ ...testCompleteDefaults
64
+ };
65
+ const testInternalPropsAsSyntax = {
66
+ ...testRequiredProps,
67
+ ...testOptionalProps,
68
+ ...testCompleteDefaults
69
+ };
70
+ const testExplicitDefinition = {
71
+ value: [10, 50],
72
+ multiple: true,
73
+ minValue: 0,
74
+ maxValue: 100,
75
+ minRange: 1
76
+ };
77
+ const testInferedTypeCompatibility = {
78
+ value: [10, 50],
79
+ multiple: true,
80
+ minValue: 0,
81
+ maxValue: 100
82
+ };
83
+ const testDefinitionAsConst = {
84
+ value: [10, 50],
85
+ multiple: true,
86
+ minValue: 0,
87
+ maxValue: 100,
88
+ minRange: 1
89
+ };
90
+ const onMultipleValueChange = (value) => {
91
+ };
92
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testExplicitDefinition }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testInferedTypeCompatibility }),
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testDefinitionAsConst }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange: onMultipleValueChange })
97
+ ] });
98
+ //# 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,YAAuB;ACsFrB;AArFF,eAA2B;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,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC,4CAAC,uBAAW,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,uBAAuB;AAAA,GAC1G;",
6
+ "names": []
7
+ }
@@ -86,13 +86,10 @@ const testDefinitionAsConst = {
86
86
  };
87
87
  const onSingleValueChange = (value) => {
88
88
  };
89
- const onMultipleValueChange = (value) => {
90
- };
91
89
  const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
92
90
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testExplicitDefinition }),
93
91
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testInferedTypeCompatibility }),
94
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { ...testDefinitionAsConst }),
95
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange: onSingleValueChange }),
96
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { multiple: true, value: [0, 100], minValue: 0, maxValue: 100, onValueChange: onMultipleValueChange })
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSliderV2, { value: 0, minValue: 0, maxValue: 100, onValueChange: onSingleValueChange })
97
94
  ] });
98
- //# sourceMappingURL=typescript-slider-v2-valid.js.map
95
+ //# sourceMappingURL=typescript-slider-v2-valid-single.js.map