@elliemae/ds-slider-v2 3.61.11 → 3.70.0-alpha.9

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
- "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,YAAuB;ACoFrB;AAnFF,eAA2B;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;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,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,sBAAsB,CAAC,UAAkB;AAAC;AAChD,MAAM,wBAAwB,CAAC,UAA4B;AAAC;AAE5D,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC,4CAAC,uBAAW,OAAO,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,qBAAqB;AAAA,EAEtF,4CAAC,uBAAW,UAAQ,MAAC,OAAO,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,uBAAuB;AAAA,GAC1G;",
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,YAAuB;ACsFrB;AArFF,eAA2B;AAU3B,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AACA,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,UAAU;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,sBAAsB,CAAC,UAAkB;AAAC;AAEhD,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC,4CAAC,uBAAW,OAAO,GAAG,UAAU,GAAG,UAAU,KAAK,eAAe,qBAAqB;AAAA,GACxF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSSliderV2.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSliderV2T, DSSliderV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useSliderV2 } from './config/useSliderV2.js';\nimport { DSSliderV2Name } from './constants/index.js';\n\nimport DSSliderV2Context from './DSSliderV2CTX.js';\nimport { MainContent } from './parts/MainContent.js';\n\nconst DSSliderV2 = <TMultiple extends boolean = false>(props: DSSliderV2T.Props<TMultiple>) => {\n const ctx = useSliderV2(props);\n\n return (\n <DSSliderV2Context.Provider value={ctx}>\n <MainContent />\n </DSSliderV2Context.Provider>\n );\n};\n\nDSSliderV2.displayName = DSSliderV2Name;\nconst DSSliderV2WithSchema = describe(DSSliderV2);\nDSSliderV2WithSchema.propTypes = DSSliderV2PropTypesSchema;\n\nexport { DSSliderV2, DSSliderV2WithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACcjB;AAbN,SAAS,gBAAgB;AACzB,SAA2B,iCAAiC;AAC5D,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,OAAO,uBAAuB;AAC9B,SAAS,mBAAmB;AAE5B,MAAM,aAAa,CAAoC,UAAwC;AAC7F,QAAM,MAAM,YAAY,KAAK;AAE7B,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,KACjC,8BAAC,eAAY,GACf;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSliderV2T, DSSliderV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useSliderV2 } from './config/useSliderV2.js';\nimport { DSSliderV2Name } from './constants/index.js';\n\nimport DSSliderV2Context from './DSSliderV2CTX.js';\nimport { MainContent } from './parts/MainContent.js';\n\nconst DSSliderV2 = (props: DSSliderV2T.Props) => {\n const ctx = useSliderV2(props);\n\n return (\n <DSSliderV2Context.Provider value={ctx}>\n <MainContent />\n </DSSliderV2Context.Provider>\n );\n};\n\nDSSliderV2.displayName = DSSliderV2Name;\nconst DSSliderV2WithSchema = describe(DSSliderV2);\nDSSliderV2WithSchema.propTypes = DSSliderV2PropTypesSchema;\n\nexport { DSSliderV2, DSSliderV2WithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACcjB;AAbN,SAAS,gBAAgB;AACzB,SAA2B,iCAAiC;AAC5D,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,OAAO,uBAAuB;AAC9B,SAAS,mBAAmB;AAE5B,MAAM,aAAa,CAAC,UAA6B;AAC/C,QAAM,MAAM,YAAY,KAAK;AAE7B,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,KACjC,8BAAC,eAAY,GACf;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSSliderV2CTX.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DSSliderV2CTX } from './config/useSliderV2.js';\n\nconst defaultContext = {} as DSSliderV2CTX<boolean>;\n\n/** Context for cross component communication */\nexport const DSSliderV2Context = createContext<DSSliderV2CTX<boolean>>(defaultContext);\n\nexport default DSSliderV2Context;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAG9B,MAAM,iBAAiB,CAAC;AAGjB,MAAM,oBAAoB,cAAsC,cAAc;AAErF,IAAO,wBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DSSliderV2CTX } from './config/useSliderV2.js';\n\nconst defaultContext = {} as DSSliderV2CTX;\n\n/** Context for cross component communication */\nexport const DSSliderV2Context = createContext<DSSliderV2CTX>(defaultContext);\n\nexport default DSSliderV2Context;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAG9B,MAAM,iBAAiB,CAAC;AAGjB,MAAM,oBAAoB,cAA6B,cAAc;AAE5E,IAAO,wBAAQ;",
6
6
  "names": []
7
7
  }
@@ -6,10 +6,7 @@ import { DSSliderV2PropTypes, defaultProps } from "../react-desc-prop-types.js";
6
6
  import { useValidateProps } from "./useValidateProps.js";
7
7
  import { useTickMarksValues } from "./useTickMarksValues.js";
8
8
  const useSliderV2 = (propsFromUser) => {
9
- const propsWithDefault = useMemoMergePropsWithDefault(
10
- propsFromUser,
11
- defaultProps
12
- );
9
+ const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
13
10
  const { multiple, value } = propsWithDefault;
14
11
  const xstyledProps = useGetXstyledProps(propsWithDefault);
15
12
  const instanceUid = React2.useMemo(() => `slider-v2-${uid(5)}`, []);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useSliderV2.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSSliderV2T, DSSliderV2PropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useTickMarksValues } from './useTickMarksValues.js';\n\nexport interface DSSliderV2CTX<TMultiple extends boolean> {\n propsWithDefault: DSSliderV2T.InternalProps<TMultiple>;\n xstyledProps: XstyledProps;\n instanceUid: string;\n rangeValues: [number, number] | [number];\n tickMarkPositions: number[];\n getOwnerProps: () => DSSliderV2T.InternalProps<TMultiple>;\n getOwnerPropsArguments: () => Record<string, unknown>;\n hasUserInteractedAfterFocus: boolean;\n setHasUserInteractedAfterFocus: (value: boolean) => void;\n}\n\nexport const useSliderV2 = <TMultiple extends boolean>(propsFromUser: DSSliderV2T.Props<TMultiple>) => {\n // =============================================================================\n // MERGE WITH DEFAULT\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSliderV2T.InternalProps<TMultiple>>(\n propsFromUser,\n defaultProps as DSSliderV2T.DefaultProps<TMultiple>,\n );\n\n const { multiple, value } = propsWithDefault;\n\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const instanceUid = React.useMemo(() => `slider-v2-${uid(5)}`, []);\n\n const rangeValues = React.useMemo(() => {\n if (multiple === true) return value as [number, number];\n return [value] as [number];\n }, [multiple, value]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const tickMarkPositions = useTickMarksValues(propsWithDefault);\n\n // ===========================================================================\n // VALIDATE PROPS\n // ===========================================================================\n useValidateProps(propsWithDefault, DSSliderV2PropTypes, { tickMarkPositions });\n\n const ownerPropConfig = useOwnerProps(propsWithDefault);\n const [hasUserInteractedAfterFocus, setHasUserInteractedAfterFocus] = React.useState(false);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n hasUserInteractedAfterFocus,\n setHasUserInteractedAfterFocus,\n ...ownerPropConfig,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n hasUserInteractedAfterFocus,\n ownerPropConfig,\n ],\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAElB,SAAS,oBAAoB,8BAA8B,qBAAqB;AAChF,SAAS,WAAW;AACpB,SAA2B,qBAAqB,oBAAoB;AACpE,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAc5B,MAAM,cAAc,CAA4B,kBAAgD;AAIrG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,UAAU,MAAM,IAAI;AAK5B,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,aAAa,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAEjE,QAAM,cAAcA,OAAM,QAAQ,MAAM;AACtC,QAAI,aAAa,KAAM,QAAO;AAC9B,WAAO,CAAC,KAAK;AAAA,EACf,GAAG,CAAC,UAAU,KAAK,CAAC;AAKpB,QAAM,oBAAoB,mBAAmB,gBAAgB;AAK7D,mBAAiB,kBAAkB,qBAAqB,EAAE,kBAAkB,CAAC;AAE7E,QAAM,kBAAkB,cAAc,gBAAgB;AACtD,QAAM,CAAC,6BAA6B,8BAA8B,IAAIA,OAAM,SAAS,KAAK;AAE1F,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSSliderV2T, DSSliderV2PropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useTickMarksValues } from './useTickMarksValues.js';\n\nexport interface DSSliderV2CTX {\n propsWithDefault: DSSliderV2T.InternalProps;\n xstyledProps: XstyledProps;\n instanceUid: string;\n rangeValues: [number, number] | [number];\n tickMarkPositions: number[];\n getOwnerProps: () => DSSliderV2T.InternalProps;\n getOwnerPropsArguments: () => Record<string, unknown>;\n hasUserInteractedAfterFocus: boolean;\n setHasUserInteractedAfterFocus: (value: boolean) => void;\n}\n\nexport const useSliderV2 = (propsFromUser: DSSliderV2T.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSliderV2T.InternalProps>(propsFromUser, defaultProps);\n\n const { multiple, value } = propsWithDefault;\n\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const instanceUid = React.useMemo(() => `slider-v2-${uid(5)}`, []);\n\n const rangeValues = React.useMemo(() => {\n if (multiple === true) return value;\n return [value] as [number];\n }, [multiple, value]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const tickMarkPositions = useTickMarksValues(propsWithDefault);\n\n // ===========================================================================\n // VALIDATE PROPS\n // ===========================================================================\n useValidateProps(propsWithDefault, DSSliderV2PropTypes, { tickMarkPositions });\n\n const ownerPropConfig = useOwnerProps(propsWithDefault);\n const [hasUserInteractedAfterFocus, setHasUserInteractedAfterFocus] = React.useState(false);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n hasUserInteractedAfterFocus,\n setHasUserInteractedAfterFocus,\n ...ownerPropConfig,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n hasUserInteractedAfterFocus,\n ownerPropConfig,\n ],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAElB,SAAS,oBAAoB,8BAA8B,qBAAqB;AAChF,SAAS,WAAW;AACpB,SAA2B,qBAAqB,oBAAoB;AACpE,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AAc5B,MAAM,cAAc,CAAC,kBAAqC;AAI/D,QAAM,mBAAmB,6BAAwD,eAAe,YAAY;AAE5G,QAAM,EAAE,UAAU,MAAM,IAAI;AAK5B,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,cAAcA,OAAM,QAAQ,MAAM,aAAa,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAEjE,QAAM,cAAcA,OAAM,QAAQ,MAAM;AACtC,QAAI,aAAa,KAAM,QAAO;AAC9B,WAAO,CAAC,KAAK;AAAA,EACf,GAAG,CAAC,UAAU,KAAK,CAAC;AAKpB,QAAM,oBAAoB,mBAAmB,gBAAgB;AAK7D,mBAAiB,kBAAkB,qBAAqB,EAAE,kBAAkB,CAAC;AAE7E,QAAM,kBAAkB,cAAc,gBAAgB;AACtD,QAAM,CAAC,6BAA6B,8BAA8B,IAAIA,OAAM,SAAS,KAAK;AAE1F,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTickMarksValues.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\n\n// Tick mark values will be generated from the minValue, maxValue and step props\nconst getDefaultTickMarksValues = ({\n minValue,\n maxValue,\n step,\n}: {\n minValue: number;\n maxValue: number;\n step: number;\n}) => {\n const parsedValuesArray: number[] = [];\n for (let value = minValue; value <= maxValue; value += step) {\n parsedValuesArray.push(value);\n }\n return parsedValuesArray;\n};\n\nexport const useTickMarksValues = <TMultiple extends boolean>(props: DSSliderV2T.InternalProps<TMultiple>) => {\n const { minValue, maxValue, step } = props;\n return React.useMemo(() => getDefaultTickMarksValues({ minValue, maxValue, step }), [maxValue, minValue, step]);\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAIlB,MAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,oBAA8B,CAAC;AACrC,WAAS,QAAQ,UAAU,SAAS,UAAU,SAAS,MAAM;AAC3D,sBAAkB,KAAK,KAAK;AAAA,EAC9B;AACA,SAAO;AACT;AAEO,MAAM,qBAAqB,CAA4B,UAAgD;AAC5G,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,SAAOA,OAAM,QAAQ,MAAM,0BAA0B,EAAE,UAAU,UAAU,KAAK,CAAC,GAAG,CAAC,UAAU,UAAU,IAAI,CAAC;AAChH;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\n\n// Tick mark values will be generated from the minValue, maxValue and step props\nconst getDefaultTickMarksValues = ({\n minValue,\n maxValue,\n step,\n}: {\n minValue: number;\n maxValue: number;\n step: number;\n}) => {\n const parsedValuesArray: number[] = [];\n for (let value = minValue; value <= maxValue; value += step) {\n parsedValuesArray.push(value);\n }\n return parsedValuesArray;\n};\n\nexport const useTickMarksValues = (props: DSSliderV2T.InternalProps) => {\n const { minValue, maxValue, step } = props;\n return React.useMemo(() => getDefaultTickMarksValues({ minValue, maxValue, step }), [maxValue, minValue, step]);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAIlB,MAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,oBAA8B,CAAC;AACrC,WAAS,QAAQ,UAAU,SAAS,UAAU,SAAS,MAAM;AAC3D,sBAAkB,KAAK,KAAK;AAAA,EAC9B;AACA,SAAO;AACT;AAEO,MAAM,qBAAqB,CAAC,UAAqC;AACtE,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,SAAOA,OAAM,QAAQ,MAAM,0BAA0B,EAAE,UAAU,UAAU,KAAK,CAAC,GAAG,CAAC,UAAU,UAAU,IAAI,CAAC;AAChH;",
6
6
  "names": ["React"]
7
7
  }
@@ -8,6 +8,19 @@ const useValidateProps = (props, propTypes, { tickMarkPositions }) => {
8
8
  `The length of the customTickMarksValues prop must be equal to the length of the tickMarkPositions array (${tickMarkPositions.length}).`
9
9
  );
10
10
  }
11
+ if (props.multiple === false && Array.isArray(props.value) || props.multiple === true && !Array.isArray(props.value)) {
12
+ throw new Error(
13
+ `The "multiple" prop must match the value contract exactly. Received "multiple": ${props.multiple}, value: ${JSON.stringify(props.value)}. Either the value must not be an array, or the flag should be true.`
14
+ );
15
+ }
16
+ if (props.minRange && props.step && props.minRange % props.step !== 0) {
17
+ console.warn(`The minRange prop (${props.minRange}) must be perfectly divisible by the step prop (${props.step}).`);
18
+ }
19
+ if (props.minRange && props.minRange > props.maxValue - props.minValue) {
20
+ throw new Error(
21
+ `The minRange prop (${props.minRange}) must be within the feasable range selection, maxValue(${props.maxValue}) - minValue(${props.minValue}) = ${props.maxValue - props.minValue}).`
22
+ );
23
+ }
11
24
  };
12
25
  export {
13
26
  useValidateProps
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSSliderV2T } from '../react-desc-prop-types.js';\nimport { DSSliderV2Name } from '../constants/index.js';\n\nexport const useValidateProps = <TMultiple extends boolean>(\n props: DSSliderV2T.InternalProps<TMultiple>,\n propTypes: ValidationMap<unknown>,\n { tickMarkPositions }: { tickMarkPositions: number[] },\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSSliderV2Name);\n\n if (props.customTickMarksValues.length && props.customTickMarksValues.length !== tickMarkPositions.length) {\n throw new Error(\n `The length of the customTickMarksValues prop must be equal to the length of the tickMarkPositions array (${tickMarkPositions.length}).`,\n );\n }\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAA0D;AAEnE,SAAS,sBAAsB;AAExB,MAAM,mBAAmB,CAC9B,OACA,WACA,EAAE,kBAAkB,MACX;AAET,iCAA+B,OAAO,WAAW,cAAc;AAE/D,MAAI,MAAM,sBAAsB,UAAU,MAAM,sBAAsB,WAAW,kBAAkB,QAAQ;AACzG,UAAM,IAAI;AAAA,MACR,4GAA4G,kBAAkB,MAAM;AAAA,IACtI;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable no-console */\nimport { useValidateTypescriptPropTypes, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSSliderV2T } from '../react-desc-prop-types.js';\nimport { DSSliderV2Name } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSSliderV2T.InternalProps,\n propTypes: ValidationMap<unknown>,\n { tickMarkPositions }: { tickMarkPositions: number[] },\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSSliderV2Name);\n\n if (props.customTickMarksValues.length && props.customTickMarksValues.length !== tickMarkPositions.length) {\n throw new Error(\n `The length of the customTickMarksValues prop must be equal to the length of the tickMarkPositions array (${tickMarkPositions.length}).`,\n );\n }\n\n // Our polymorphism requires the flag to match the value, if props.multiple is false, value can not be [number,number], it will break the internals assumptions and the contract.\n if (\n (props.multiple === false && Array.isArray(props.value)) ||\n (props.multiple === true && !Array.isArray(props.value))\n ) {\n throw new Error(\n `The \"multiple\" prop must match the value contract exactly. Received \"multiple\": ${props.multiple}, value: ${JSON.stringify(props.value)}. Either the value must not be an array, or the flag should be true.`,\n );\n }\n\n // Introducing the `minRange` props, we want to have a warning for final users if they happen to provide a min range that is not perfectly divisible by the step value\n // this is not an hard error because\n // - minRange 9, step 10 can still be coherently mathematically and logically described, is consistent and predictable even if strange and maybe confusing\n // - minRange 11, step 10 can still be coherently mathematically and logically described, is consistent and predictable even if strange and maybe confusing\n // a warning instead of an hard stop here makes sense.\n if (props.minRange && props.step && props.minRange % props.step !== 0) {\n console.warn(`The minRange prop (${props.minRange}) must be perfectly divisible by the step prop (${props.step}).`);\n }\n // We want to make sure the minRange is withing the min and max values, as defining a minRange above the maximum available space is a logic fallacy that needs adressing\n // this is an hard error because there is no hard truth that can be objectively enforced\n // some may say \"I think maxValue should win\" and other may say \"minRange is the metric to enforce\"\n // opinions are the killers of predictability and maintainability and scaling. The only opinion here is, if you want to enforce either, you configure the value accordingly.\n if (props.minRange && props.minRange > props.maxValue - props.minValue) {\n throw new Error(\n `The minRange prop (${props.minRange}) must be within the feasable range selection, maxValue(${props.maxValue}) - minValue(${props.minValue}) = ${props.maxValue - props.minValue}).`,\n );\n }\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,sCAA0D;AAEnE,SAAS,sBAAsB;AAExB,MAAM,mBAAmB,CAC9B,OACA,WACA,EAAE,kBAAkB,MACX;AAET,iCAA+B,OAAO,WAAW,cAAc;AAE/D,MAAI,MAAM,sBAAsB,UAAU,MAAM,sBAAsB,WAAW,kBAAkB,QAAQ;AACzG,UAAM,IAAI;AAAA,MACR,4GAA4G,kBAAkB,MAAM;AAAA,IACtI;AAAA,EACF;AAGA,MACG,MAAM,aAAa,SAAS,MAAM,QAAQ,MAAM,KAAK,KACrD,MAAM,aAAa,QAAQ,CAAC,MAAM,QAAQ,MAAM,KAAK,GACtD;AACA,UAAM,IAAI;AAAA,MACR,mFAAmF,MAAM,QAAQ,YAAY,KAAK,UAAU,MAAM,KAAK,CAAC;AAAA,IAC1I;AAAA,EACF;AAOA,MAAI,MAAM,YAAY,MAAM,QAAQ,MAAM,WAAW,MAAM,SAAS,GAAG;AACrE,YAAQ,KAAK,sBAAsB,MAAM,QAAQ,mDAAmD,MAAM,IAAI,IAAI;AAAA,EACpH;AAKA,MAAI,MAAM,YAAY,MAAM,WAAW,MAAM,WAAW,MAAM,UAAU;AACtE,UAAM,IAAI;AAAA,MACR,sBAAsB,MAAM,QAAQ,2DAA2D,MAAM,QAAQ,gBAAgB,MAAM,QAAQ,OAAO,MAAM,WAAW,MAAM,QAAQ;AAAA,IACnL;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,14 +1,29 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import { useContext, useCallback } from "react";
4
4
  import { Range } from "react-range";
5
5
  import DSSliderV2Context from "../DSSliderV2CTX.js";
6
- import { StyledRangeWrapper, StyledWrapper } from "../styles.js";
7
- import { Track } from "./Track.js";
6
+ import { StyledRangeWrapper, StyledWrapper } from "./styles.js";
8
7
  import { Thumb } from "./Thumb.js";
8
+ import { Track } from "./Track.js";
9
+ const isMultipleOnChangeCallback = (values, onValueChange) => Array.isArray(values) && values.length !== 1;
10
+ const renderTrack = (args) => /* @__PURE__ */ jsx(Track, { ...args });
11
+ const renderThumb = ({ props: { key }, props, ...args }) => /* @__PURE__ */ jsx(Thumb, { props, ...args }, key);
12
+ const wrapperRows = ["auto", "auto"];
13
+ const rangeWrapperRows = ["28px", "auto"];
9
14
  const MainContent = () => {
10
15
  const {
11
- propsWithDefault: { step, minValue, maxValue, disabled, applyAriaDisabled, readOnly, onValueChange, className },
16
+ propsWithDefault: {
17
+ step,
18
+ minValue,
19
+ maxValue,
20
+ disabled,
21
+ applyAriaDisabled,
22
+ readOnly,
23
+ onValueChange,
24
+ className,
25
+ minRange
26
+ },
12
27
  xstyledProps,
13
28
  rangeValues,
14
29
  getOwnerProps,
@@ -16,12 +31,28 @@ const MainContent = () => {
16
31
  setHasUserInteractedAfterFocus,
17
32
  hasUserInteractedAfterFocus
18
33
  } = useContext(DSSliderV2Context);
34
+ const handleOnChange = useCallback(
35
+ (values) => {
36
+ if (applyAriaDisabled || readOnly) return;
37
+ if (isMultipleOnChangeCallback(values, onValueChange)) {
38
+ const [newMin, newMax] = values;
39
+ const newRange = newMax - newMin;
40
+ if (newRange >= (minRange ?? 0)) onValueChange(values);
41
+ } else {
42
+ onValueChange(values[0]);
43
+ }
44
+ if (!hasUserInteractedAfterFocus) {
45
+ setHasUserInteractedAfterFocus(true);
46
+ }
47
+ },
48
+ [applyAriaDisabled, hasUserInteractedAfterFocus, onValueChange, readOnly, setHasUserInteractedAfterFocus, minRange]
49
+ );
19
50
  return /* @__PURE__ */ jsx(
20
51
  StyledWrapper,
21
52
  {
22
53
  width: "100%",
23
54
  alignItems: "center",
24
- rows: ["auto", "auto"],
55
+ rows: wrapperRows,
25
56
  getOwnerProps,
26
57
  getOwnerPropsArguments,
27
58
  className,
@@ -29,7 +60,7 @@ const MainContent = () => {
29
60
  children: /* @__PURE__ */ jsx(
30
61
  StyledRangeWrapper,
31
62
  {
32
- rows: ["28px", "auto"],
63
+ rows: rangeWrapperRows,
33
64
  alignItems: "center",
34
65
  margin: "0 16px",
35
66
  minHeight: "28px",
@@ -43,20 +74,10 @@ const MainContent = () => {
43
74
  max: maxValue,
44
75
  values: rangeValues,
45
76
  disabled,
46
- onChange: (values) => {
47
- if (applyAriaDisabled || readOnly) return;
48
- if (values.length === 1) {
49
- onValueChange(values[0]);
50
- } else {
51
- onValueChange(values);
52
- }
53
- if (!hasUserInteractedAfterFocus) {
54
- setHasUserInteractedAfterFocus(true);
55
- }
56
- },
57
- renderTrack: (args) => /* @__PURE__ */ jsx(Track, { ...args }),
58
- renderThumb: (args) => /* @__PURE__ */ jsx(Thumb, { ...args }),
59
- allowOverlap: true,
77
+ onChange: handleOnChange,
78
+ renderTrack,
79
+ renderThumb,
80
+ allowOverlap: false,
60
81
  draggableTrack: true
61
82
  }
62
83
  )
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/MainContent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext } from 'react';\nimport { Range } from 'react-range';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { StyledRangeWrapper, StyledWrapper } from '../styles.js';\nimport { Track } from './Track.js';\nimport { Thumb } from './Thumb.js';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\n\nexport const MainContent = () => {\n const {\n propsWithDefault: { step, minValue, maxValue, disabled, applyAriaDisabled, readOnly, onValueChange, className },\n xstyledProps,\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n setHasUserInteractedAfterFocus,\n hasUserInteractedAfterFocus,\n } = useContext(DSSliderV2Context);\n\n return (\n <StyledWrapper\n width=\"100%\"\n alignItems=\"center\"\n rows={['auto', 'auto']}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n className={className}\n {...xstyledProps}\n >\n <StyledRangeWrapper\n rows={['28px', 'auto']}\n alignItems=\"center\"\n margin=\"0 16px\"\n minHeight=\"28px\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Range\n step={step}\n min={minValue}\n max={maxValue}\n values={rangeValues}\n disabled={disabled}\n onChange={(values) => {\n if (applyAriaDisabled || readOnly) return;\n if (values.length === 1) {\n onValueChange(values[0]);\n } else {\n onValueChange(values as DSSliderV2T.ValueType<true>);\n }\n if (!hasUserInteractedAfterFocus) {\n setHasUserInteractedAfterFocus(true);\n }\n }}\n renderTrack={(args) => <Track {...args} />}\n renderThumb={(args) => <Thumb {...args} />}\n allowOverlap\n draggableTrack\n />\n </StyledRangeWrapper>\n </StyledWrapper>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACsDU;AAtDjC,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,OAAO,uBAAuB;AAC9B,SAAS,oBAAoB,qBAAqB;AAClD,SAAS,aAAa;AACtB,SAAS,aAAa;AAGf,MAAM,cAAc,MAAM;AAC/B,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,UAAU,UAAU,UAAU,mBAAmB,UAAU,eAAe,UAAU;AAAA,IAC9G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,YAAW;AAAA,MACX,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,CAAC,QAAQ,MAAM;AAAA,UACrB,YAAW;AAAA,UACX,QAAO;AAAA,UACP,WAAU;AAAA,UACV;AAAA,UACA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,KAAK;AAAA,cACL,KAAK;AAAA,cACL,QAAQ;AAAA,cACR;AAAA,cACA,UAAU,CAAC,WAAW;AACpB,oBAAI,qBAAqB,SAAU;AACnC,oBAAI,OAAO,WAAW,GAAG;AACvB,gCAAc,OAAO,CAAC,CAAC;AAAA,gBACzB,OAAO;AACL,gCAAc,MAAqC;AAAA,gBACrD;AACA,oBAAI,CAAC,6BAA6B;AAChC,iDAA+B,IAAI;AAAA,gBACrC;AAAA,cACF;AAAA,cACA,aAAa,CAAC,SAAS,oBAAC,SAAO,GAAG,MAAM;AAAA,cACxC,aAAa,CAAC,SAAS,oBAAC,SAAO,GAAG,MAAM;AAAA,cACxC,cAAY;AAAA,cACZ,gBAAc;AAAA;AAAA,UAChB;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useCallback } from 'react';\nimport { Range } from 'react-range';\nimport type { IRenderThumbParams, IRenderTrackParams } from 'react-range/lib/types.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\nimport { StyledRangeWrapper, StyledWrapper } from './styles.js';\nimport { Thumb } from './Thumb.js';\nimport { Track } from './Track.js';\n\n// typeguard, making the same assumption the previous version was making: if the values are an array, the user must be expecting a multiple slider value onchange\nconst isMultipleOnChangeCallback = (\n values: unknown,\n onValueChange: unknown,\n): onValueChange is DSSliderV2T.PropsMultiple['onValueChange'] => Array.isArray(values) && values.length !== 1;\n\n// DO NOT CAPITALIZE THIS TWO VARIABLES\n// react-range DO NOT WANT COMPONENTS, IT WANTS FUNCTIONS\n// IF THIS GETS CAPITALIZED, THE COMPILER WILL CONVERT IT TO A COMPONENT\n// AND THEN YOU GET \"hooks can only be used inside the body of a component\" ERROR\nconst renderTrack = (args: IRenderTrackParams) => <Track {...args} />;\nconst renderThumb = ({ props: { key }, props, ...args }: IRenderThumbParams) => (\n <Thumb key={key} props={props} {...args} />\n);\n\nconst wrapperRows = ['auto', 'auto'];\nconst rangeWrapperRows = ['28px', 'auto'];\nexport const MainContent = () => {\n const {\n propsWithDefault: {\n step,\n minValue,\n maxValue,\n disabled,\n applyAriaDisabled,\n readOnly,\n onValueChange,\n className,\n minRange,\n },\n xstyledProps,\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n setHasUserInteractedAfterFocus,\n hasUserInteractedAfterFocus,\n } = useContext(DSSliderV2Context);\n\n const handleOnChange = useCallback<Range['props']['onChange']>(\n (values) => {\n if (applyAriaDisabled || readOnly) return;\n if (isMultipleOnChangeCallback(values, onValueChange)) {\n const [newMin, newMax] = values;\n const newRange = newMax - newMin;\n if (newRange >= (minRange ?? 0)) onValueChange(values as [number, number]);\n } else {\n onValueChange(values[0]);\n }\n if (!hasUserInteractedAfterFocus) {\n setHasUserInteractedAfterFocus(true);\n }\n },\n [applyAriaDisabled, hasUserInteractedAfterFocus, onValueChange, readOnly, setHasUserInteractedAfterFocus, minRange],\n );\n\n return (\n <StyledWrapper\n width=\"100%\"\n alignItems=\"center\"\n rows={wrapperRows}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n className={className}\n {...xstyledProps}\n >\n <StyledRangeWrapper\n rows={rangeWrapperRows}\n alignItems=\"center\"\n margin=\"0 16px\"\n minHeight=\"28px\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Range\n step={step}\n min={minValue}\n max={maxValue}\n values={rangeValues}\n disabled={disabled}\n onChange={handleOnChange}\n renderTrack={renderTrack}\n renderThumb={renderThumb}\n allowOverlap={false}\n draggableTrack\n />\n </StyledRangeWrapper>\n </StyledWrapper>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmB2B;AAnBlD,SAAS,YAAY,mBAAmB;AACxC,SAAS,aAAa;AAEtB,OAAO,uBAAuB;AAE9B,SAAS,oBAAoB,qBAAqB;AAClD,SAAS,aAAa;AACtB,SAAS,aAAa;AAGtB,MAAM,6BAA6B,CACjC,QACA,kBACgE,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW;AAM7G,MAAM,cAAc,CAAC,SAA6B,oBAAC,SAAO,GAAG,MAAM;AACnE,MAAM,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK,MACpD,oBAAC,SAAgB,OAAe,GAAG,QAAvB,GAA6B;AAG3C,MAAM,cAAc,CAAC,QAAQ,MAAM;AACnC,MAAM,mBAAmB,CAAC,QAAQ,MAAM;AACjC,MAAM,cAAc,MAAM;AAC/B,QAAM;AAAA,IACJ,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,iBAAiB;AAAA,IACrB,CAAC,WAAW;AACV,UAAI,qBAAqB,SAAU;AACnC,UAAI,2BAA2B,QAAQ,aAAa,GAAG;AACrD,cAAM,CAAC,QAAQ,MAAM,IAAI;AACzB,cAAM,WAAW,SAAS;AAC1B,YAAI,aAAa,YAAY,GAAI,eAAc,MAA0B;AAAA,MAC3E,OAAO;AACL,sBAAc,OAAO,CAAC,CAAC;AAAA,MACzB;AACA,UAAI,CAAC,6BAA6B;AAChC,uCAA+B,IAAI;AAAA,MACrC;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,6BAA6B,eAAe,UAAU,gCAAgC,QAAQ;AAAA,EACpH;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,YAAW;AAAA,MACX,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,YAAW;AAAA,UACX,QAAO;AAAA,UACP,WAAU;AAAA,UACV;AAAA,UACA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,KAAK;AAAA,cACL,KAAK;AAAA,cACL,QAAQ;AAAA,cACR;AAAA,cACA,UAAU;AAAA,cACV;AAAA,cACA;AAAA,cACA,cAAc;AAAA,cACd,gBAAc;AAAA;AAAA,UAChB;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,22 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useCallback, useContext, useMemo, useState } from "react";
4
3
  import { DSTooltipV3 } from "@elliemae/ds-tooltip-v3";
5
- import { conformedThumbLabel } from "../utils/thumbLabels.js";
6
- import { StyledThumb } from "../styles.js";
4
+ import { useCallback, useContext, useMemo, useState } from "react";
7
5
  import DSSliderV2Context from "../DSSliderV2CTX.js";
8
- const Thumb = ({ index, props, isDragged }) => {
6
+ import { StyledThumb } from "./styles.js";
7
+ const conformedThumbLabel = (config) => {
8
+ const { rangeValues, customTickMarksValues, index, step, minValue } = config;
9
+ let msg = `Value: `;
10
+ if (customTickMarksValues.length) {
11
+ const foundValue = customTickMarksValues[Math.floor((rangeValues[index] - minValue) / step)];
12
+ msg += `${foundValue ?? rangeValues[index].toFixed(1)}`;
13
+ } else {
14
+ msg += `${rangeValues[index].toFixed(1)}`;
15
+ }
16
+ return msg;
17
+ };
18
+ const spanStyle = { height: 20, width: 20 };
19
+ const Thumb = ({ index, props: reactRangeOpinionatedProps, isDragged }) => {
9
20
  const {
10
21
  propsWithDefault: { disabled, applyAriaDisabled, readOnly, customTickMarksValues, step, minValue },
11
22
  rangeValues,
@@ -16,17 +27,16 @@ const Thumb = ({ index, props, isDragged }) => {
16
27
  const [isHovered, setIsHovered] = useState(false);
17
28
  const [isFocused, setIsFocused] = useState(false);
18
29
  const [isTooltipDismissed, setIsTooltipDismissed] = useState(false);
19
- const { ref, ...rest } = props;
30
+ const {
31
+ ref,
32
+ style: thumbStyle,
33
+ key: unusedKeyDueToLibTypescriptIssues,
34
+ onKeyDown: reactRangeOnKeyDownHandler,
35
+ onKeyUp: reactRangeOnKeyUpHandler,
36
+ ...propsFromReactRangeTookAsIs
37
+ } = reactRangeOpinionatedProps;
38
+ const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;
20
39
  const label = conformedThumbLabel({ rangeValues, customTickMarksValues, index, step, minValue });
21
- const thumbStyle = useMemo(
22
- () => ({
23
- ...rest.style,
24
- zIndex: void 0,
25
- cursor: disabled || applyAriaDisabled || readOnly ? "not-allowed" : rest.style.cursor
26
- // we override the library cursor's style for disable state
27
- }),
28
- [rest.style, disabled, applyAriaDisabled, readOnly]
29
- );
30
40
  const getOwnerPropsArguments = useCallback(
31
41
  () => ({
32
42
  index,
@@ -34,47 +44,70 @@ const Thumb = ({ index, props, isDragged }) => {
34
44
  }),
35
45
  [index, hasUserInteractedAfterFocus]
36
46
  );
37
- const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;
47
+ const sanitizedStyle = useMemo(() => {
48
+ const { zIndex, ...libInherithedStyles } = thumbStyle;
49
+ if (disabled || applyAriaDisabled || readOnly) return { ...libInherithedStyles, cursor: "not-allowed" };
50
+ return libInherithedStyles;
51
+ }, [applyAriaDisabled, disabled, readOnly, thumbStyle]);
52
+ const handleMouseEnter = useCallback(() => {
53
+ setIsHovered(true);
54
+ setIsFocused(false);
55
+ setIsTooltipDismissed(false);
56
+ }, []);
57
+ const handleMouseLeave = useCallback(() => {
58
+ setIsHovered(false);
59
+ }, []);
60
+ const handleKeyDown = useCallback(
61
+ (e) => {
62
+ reactRangeOnKeyDownHandler?.(e);
63
+ if (e.key === "Escape" && showPopover) {
64
+ e.stopPropagation();
65
+ setIsTooltipDismissed(true);
66
+ setIsFocused(true);
67
+ } else {
68
+ setIsTooltipDismissed(false);
69
+ }
70
+ },
71
+ [showPopover, reactRangeOnKeyDownHandler]
72
+ );
73
+ const handleKeyUp = useCallback(
74
+ (e) => {
75
+ reactRangeOnKeyUpHandler?.(e);
76
+ },
77
+ [reactRangeOnKeyUpHandler]
78
+ );
79
+ const handleFocus = useCallback(() => {
80
+ setIsFocused(true);
81
+ setIsTooltipDismissed(false);
82
+ }, []);
83
+ const handleBlur = useCallback(() => {
84
+ setIsFocused(false);
85
+ setHasUserInteractedAfterFocus(false);
86
+ }, [setHasUserInteractedAfterFocus]);
38
87
  return /* @__PURE__ */ jsx(
39
88
  StyledThumb,
40
89
  {
41
- ...rest,
42
- style: thumbStyle,
90
+ ...propsFromReactRangeTookAsIs,
91
+ style: sanitizedStyle,
43
92
  innerRef: ref,
44
93
  disabled,
45
- applyAriaDisabled: applyAriaDisabled || readOnly,
46
- "aria-disabled": disabled || applyAriaDisabled || readOnly,
47
- "aria-readonly": readOnly,
48
- onMouseEnter: () => {
49
- setIsHovered(true);
50
- setIsFocused(false);
51
- setIsTooltipDismissed(false);
52
- },
53
- onMouseLeave: () => setIsHovered(false),
54
- onKeyDownCapture: (e) => {
55
- if (e.key === "Escape" && showPopover) {
56
- e.stopPropagation();
57
- setIsTooltipDismissed(true);
58
- } else {
59
- setIsFocused(true);
60
- setIsTooltipDismissed(false);
61
- }
62
- },
63
- onFocus: () => {
64
- setIsFocused(true);
65
- setIsTooltipDismissed(false);
66
- },
67
- onBlur: () => {
68
- setIsFocused(false);
69
- setHasUserInteractedAfterFocus(false);
70
- },
94
+ $applyAriaDisabled: applyAriaDisabled,
95
+ $readOnly: readOnly,
96
+ "aria-disabled": applyAriaDisabled || readOnly,
97
+ onMouseEnter: handleMouseEnter,
98
+ onMouseLeave: handleMouseLeave,
99
+ onKeyDown: handleKeyDown,
100
+ onKeyUp: handleKeyUp,
101
+ onFocus: handleFocus,
102
+ onBlur: handleBlur,
71
103
  getOwnerProps,
72
104
  getOwnerPropsArguments,
73
- children: /* @__PURE__ */ jsx(DSTooltipV3, { text: label, showPopover, withoutAnimation: true, children: /* @__PURE__ */ jsx("span", { style: { height: 20, width: 20 } }) }, label)
105
+ children: /* @__PURE__ */ jsx(DSTooltipV3, { text: label, showPopover, withoutAnimation: true, children: /* @__PURE__ */ jsx("span", { style: spanStyle }) }, label)
74
106
  }
75
107
  );
76
108
  };
77
109
  export {
78
- Thumb
110
+ Thumb,
111
+ conformedThumbLabel
79
112
  };
80
113
  //# sourceMappingURL=Thumb.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Thumb.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext, useMemo, useState } from 'react';\nimport type { IRenderThumbParams } from 'react-range/lib/types.js';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip-v3';\nimport { conformedThumbLabel } from '../utils/thumbLabels.js';\nimport { StyledThumb } from '../styles.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const Thumb = ({ index, props, isDragged }: IRenderThumbParams) => {\n const {\n propsWithDefault: { disabled, applyAriaDisabled, readOnly, customTickMarksValues, step, minValue },\n rangeValues,\n getOwnerProps,\n hasUserInteractedAfterFocus,\n setHasUserInteractedAfterFocus,\n } = useContext(DSSliderV2Context);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const [isTooltipDismissed, setIsTooltipDismissed] = useState(false);\n const { ref, ...rest } = props;\n\n const label = conformedThumbLabel({ rangeValues, customTickMarksValues, index, step, minValue });\n\n const thumbStyle = useMemo(\n () => ({\n ...rest.style,\n zIndex: undefined,\n cursor: disabled || applyAriaDisabled || readOnly ? 'not-allowed' : rest.style.cursor,\n // we override the library cursor's style for disable state\n }),\n [rest.style, disabled, applyAriaDisabled, readOnly],\n );\n\n const getOwnerPropsArguments = useCallback(\n () => ({\n index,\n shouldUseExtendedAriaValueText: !hasUserInteractedAfterFocus,\n }),\n [index, hasUserInteractedAfterFocus],\n );\n\n const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;\n\n return (\n <StyledThumb\n {...rest}\n style={thumbStyle}\n innerRef={ref}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n aria-disabled={disabled || applyAriaDisabled || readOnly}\n aria-readonly={readOnly}\n onMouseEnter={() => {\n setIsHovered(true);\n setIsFocused(false);\n setIsTooltipDismissed(false);\n }}\n onMouseLeave={() => setIsHovered(false)}\n onKeyDownCapture={(e) => {\n if (e.key === 'Escape' && showPopover) {\n e.stopPropagation();\n setIsTooltipDismissed(true);\n } else {\n setIsFocused(true);\n setIsTooltipDismissed(false);\n }\n }}\n onFocus={() => {\n setIsFocused(true);\n setIsTooltipDismissed(false);\n }}\n onBlur={() => {\n setIsFocused(false);\n setHasUserInteractedAfterFocus(false);\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTooltipV3 key={label} text={label} showPopover={showPopover} withoutAnimation>\n <span style={{ height: 20, width: 20 }}></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgFf;AAhFR,SAAgB,aAAa,YAAY,SAAS,gBAAgB;AAElE,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,OAAO,uBAAuB;AAEvB,MAAM,QAAQ,CAAC,EAAE,OAAO,OAAO,UAAU,MAA0B;AACxE,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,mBAAmB,UAAU,uBAAuB,MAAM,SAAS;AAAA,IACjG;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,KAAK;AAClE,QAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AAEzB,QAAM,QAAQ,oBAAoB,EAAE,aAAa,uBAAuB,OAAO,MAAM,SAAS,CAAC;AAE/F,QAAM,aAAa;AAAA,IACjB,OAAO;AAAA,MACL,GAAG,KAAK;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ,YAAY,qBAAqB,WAAW,gBAAgB,KAAK,MAAM;AAAA;AAAA,IAEjF;AAAA,IACA,CAAC,KAAK,OAAO,UAAU,mBAAmB,QAAQ;AAAA,EACpD;AAEA,QAAM,yBAAyB;AAAA,IAC7B,OAAO;AAAA,MACL;AAAA,MACA,gCAAgC,CAAC;AAAA,IACnC;AAAA,IACA,CAAC,OAAO,2BAA2B;AAAA,EACrC;AAEA,QAAM,eAAe,aAAa,aAAa,cAAc,CAAC;AAE9D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,MACV;AAAA,MACA,mBAAmB,qBAAqB;AAAA,MACxC,iBAAe,YAAY,qBAAqB;AAAA,MAChD,iBAAe;AAAA,MACf,cAAc,MAAM;AAClB,qBAAa,IAAI;AACjB,qBAAa,KAAK;AAClB,8BAAsB,KAAK;AAAA,MAC7B;AAAA,MACA,cAAc,MAAM,aAAa,KAAK;AAAA,MACtC,kBAAkB,CAAC,MAAM;AACvB,YAAI,EAAE,QAAQ,YAAY,aAAa;AACrC,YAAE,gBAAgB;AAClB,gCAAsB,IAAI;AAAA,QAC5B,OAAO;AACL,uBAAa,IAAI;AACjB,gCAAsB,KAAK;AAAA,QAC7B;AAAA,MACF;AAAA,MACA,SAAS,MAAM;AACb,qBAAa,IAAI;AACjB,8BAAsB,KAAK;AAAA,MAC7B;AAAA,MACA,QAAQ,MAAM;AACZ,qBAAa,KAAK;AAClB,uCAA+B,KAAK;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MAEA,8BAAC,eAAwB,MAAM,OAAO,aAA0B,kBAAgB,MAC9E,8BAAC,UAAK,OAAO,EAAE,QAAQ,IAAI,OAAO,GAAG,GAAG,KADxB,KAElB;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSTooltipV3 } from '@elliemae/ds-tooltip-v3';\nimport { useCallback, useContext, useMemo, useState } from 'react';\nimport type { IRenderThumbParams } from 'react-range/lib/types.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { StyledThumb } from './styles.js';\n\nexport const conformedThumbLabel = (config: {\n rangeValues: [number] | [number, number];\n customTickMarksValues: string[];\n index: number;\n step: number;\n minValue: number;\n}) => {\n const { rangeValues, customTickMarksValues, index, step, minValue } = config;\n let msg = `Value: `;\n if (customTickMarksValues.length) {\n const foundValue = customTickMarksValues[Math.floor((rangeValues[index] - minValue) / step)];\n msg += `${foundValue ?? rangeValues[index].toFixed(1)}`;\n } else {\n msg += `${rangeValues[index].toFixed(1)}`;\n }\n\n return msg;\n};\n\nconst spanStyle = { height: 20, width: 20 };\n\nexport const Thumb = ({ index, props: reactRangeOpinionatedProps, isDragged }: Omit<IRenderThumbParams, 'key'>) => {\n const {\n propsWithDefault: { disabled, applyAriaDisabled, readOnly, customTickMarksValues, step, minValue },\n rangeValues,\n getOwnerProps,\n hasUserInteractedAfterFocus,\n setHasUserInteractedAfterFocus,\n } = useContext(DSSliderV2Context);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [isTooltipDismissed, setIsTooltipDismissed] = useState(false);\n\n const {\n ref,\n style: thumbStyle,\n key: unusedKeyDueToLibTypescriptIssues,\n onKeyDown: reactRangeOnKeyDownHandler,\n onKeyUp: reactRangeOnKeyUpHandler,\n ...propsFromReactRangeTookAsIs\n } = reactRangeOpinionatedProps;\n const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;\n\n const label = conformedThumbLabel({ rangeValues, customTickMarksValues, index, step, minValue });\n\n const getOwnerPropsArguments = useCallback(\n () => ({\n index,\n shouldUseExtendedAriaValueText: !hasUserInteractedAfterFocus,\n }),\n [index, hasUserInteractedAfterFocus],\n );\n\n const sanitizedStyle = useMemo(() => {\n // as per https://jira.elliemae.io/browse/PUI-14390 and https://github.com/intcx/PLATFORM-UI.dimsum/pull/7046\n // we also want z-index: ${(props) => props.theme.zIndex.tooltip}; from the theme\n // I keep the same, just refactoring so the styles concerns are part of the styled component as expected\n // my understanding is that libInherithedStyles main purposes are:\n // - to position the element on the track with a transform: translate\n // - to handle the cursor:grab/grabbing based on interaction state\n const { zIndex, ...libInherithedStyles } = thumbStyle;\n // we want to keep the cursor grab/grabbing thing, but we want our own \"disabled\" cursor...\n if (disabled || applyAriaDisabled || readOnly) return { ...libInherithedStyles, cursor: 'not-allowed' };\n return libInherithedStyles;\n }, [applyAriaDisabled, disabled, readOnly, thumbStyle]);\n\n const handleMouseEnter = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n setIsHovered(true);\n setIsFocused(false);\n setIsTooltipDismissed(false);\n }, []);\n const handleMouseLeave = useCallback<React.MouseEventHandler<HTMLDivElement>>(() => {\n setIsHovered(false);\n }, []);\n\n const handleKeyDown = useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (e) => {\n reactRangeOnKeyDownHandler?.(e);\n if (e.key === 'Escape' && showPopover) {\n // stoping propagation here is load-bearing\n // we are checking \"showPopover\" because if \"the popover exist\" it means the tooltip exist\n // if it exist and we are in a dialog, the first esc needs to close the tooltip, not the dialog.\n e.stopPropagation();\n setIsTooltipDismissed(true);\n setIsFocused(true);\n } else {\n setIsTooltipDismissed(false);\n }\n },\n [showPopover, reactRangeOnKeyDownHandler],\n );\n const handleKeyUp = useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (e) => {\n reactRangeOnKeyUpHandler?.(e);\n // if we need to do anything on keyup too, this is where we will do it.\n },\n [reactRangeOnKeyUpHandler],\n );\n const handleFocus = useCallback<React.FocusEventHandler<HTMLDivElement>>(() => {\n setIsFocused(true);\n setIsTooltipDismissed(false);\n }, []);\n const handleBlur = useCallback<React.FocusEventHandler<HTMLDivElement>>(() => {\n setIsFocused(false);\n setHasUserInteractedAfterFocus(false);\n }, [setHasUserInteractedAfterFocus]);\n\n return (\n <StyledThumb\n {...propsFromReactRangeTookAsIs}\n style={sanitizedStyle}\n innerRef={ref}\n disabled={disabled}\n $applyAriaDisabled={applyAriaDisabled}\n $readOnly={readOnly}\n // dicussed with SME on 13/jul/2026, even if role='slider' technically accepts aria-readonly\n // - SRs support for aria-readonly is loose\n // - having both aria-readonly and aria-disabled is a violation\n // - aria-disabled transmit the same interaction pattern\n // therefore, we will not set aria-readonly and will rely on aria-disabled to convey the interaction pattern\n // aria-readonly={readOnly}\n aria-disabled={applyAriaDisabled || readOnly} // || readOnly as per previous comment\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onFocus={handleFocus}\n onBlur={handleBlur}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTooltipV3 key={label} text={label} showPopover={showPopover} withoutAnimation>\n <span style={spanStyle}></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC2If;AA3IR,SAAS,mBAAmB;AAC5B,SAAS,aAAa,YAAY,SAAS,gBAAgB;AAE3D,OAAO,uBAAuB;AAC9B,SAAS,mBAAmB;AAErB,MAAM,sBAAsB,CAAC,WAM9B;AACJ,QAAM,EAAE,aAAa,uBAAuB,OAAO,MAAM,SAAS,IAAI;AACtE,MAAI,MAAM;AACV,MAAI,sBAAsB,QAAQ;AAChC,UAAM,aAAa,sBAAsB,KAAK,OAAO,YAAY,KAAK,IAAI,YAAY,IAAI,CAAC;AAC3F,WAAO,GAAG,cAAc,YAAY,KAAK,EAAE,QAAQ,CAAC,CAAC;AAAA,EACvD,OAAO;AACL,WAAO,GAAG,YAAY,KAAK,EAAE,QAAQ,CAAC,CAAC;AAAA,EACzC;AAEA,SAAO;AACT;AAEA,MAAM,YAAY,EAAE,QAAQ,IAAI,OAAO,GAAG;AAEnC,MAAM,QAAQ,CAAC,EAAE,OAAO,OAAO,4BAA4B,UAAU,MAAuC;AACjH,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,mBAAmB,UAAU,uBAAuB,MAAM,SAAS;AAAA,IACjG;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,KAAK;AAElE,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,KAAK;AAAA,IACL,WAAW;AAAA,IACX,SAAS;AAAA,IACT,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,eAAe,aAAa,aAAa,cAAc,CAAC;AAE9D,QAAM,QAAQ,oBAAoB,EAAE,aAAa,uBAAuB,OAAO,MAAM,SAAS,CAAC;AAE/F,QAAM,yBAAyB;AAAA,IAC7B,OAAO;AAAA,MACL;AAAA,MACA,gCAAgC,CAAC;AAAA,IACnC;AAAA,IACA,CAAC,OAAO,2BAA2B;AAAA,EACrC;AAEA,QAAM,iBAAiB,QAAQ,MAAM;AAOnC,UAAM,EAAE,QAAQ,GAAG,oBAAoB,IAAI;AAE3C,QAAI,YAAY,qBAAqB,SAAU,QAAO,EAAE,GAAG,qBAAqB,QAAQ,cAAc;AACtG,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,UAAU,UAAU,UAAU,CAAC;AAEtD,QAAM,mBAAmB,YAAqD,MAAM;AAClF,iBAAa,IAAI;AACjB,iBAAa,KAAK;AAClB,0BAAsB,KAAK;AAAA,EAC7B,GAAG,CAAC,CAAC;AACL,QAAM,mBAAmB,YAAqD,MAAM;AAClF,iBAAa,KAAK;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAM;AACL,mCAA6B,CAAC;AAC9B,UAAI,EAAE,QAAQ,YAAY,aAAa;AAIrC,UAAE,gBAAgB;AAClB,8BAAsB,IAAI;AAC1B,qBAAa,IAAI;AAAA,MACnB,OAAO;AACL,8BAAsB,KAAK;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,aAAa,0BAA0B;AAAA,EAC1C;AACA,QAAM,cAAc;AAAA,IAClB,CAAC,MAAM;AACL,iCAA2B,CAAC;AAAA,IAE9B;AAAA,IACA,CAAC,wBAAwB;AAAA,EAC3B;AACA,QAAM,cAAc,YAAqD,MAAM;AAC7E,iBAAa,IAAI;AACjB,0BAAsB,KAAK;AAAA,EAC7B,GAAG,CAAC,CAAC;AACL,QAAM,aAAa,YAAqD,MAAM;AAC5E,iBAAa,KAAK;AAClB,mCAA+B,KAAK;AAAA,EACtC,GAAG,CAAC,8BAA8B,CAAC;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,MACP,UAAU;AAAA,MACV;AAAA,MACA,oBAAoB;AAAA,MACpB,WAAW;AAAA,MAOX,iBAAe,qBAAqB;AAAA,MACpC,cAAc;AAAA,MACd,cAAc;AAAA,MACd,WAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MAEA,8BAAC,eAAwB,MAAM,OAAO,aAA0B,kBAAgB,MAC9E,8BAAC,UAAK,OAAO,WAAW,KADR,KAElB;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,35 +1,18 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext, useMemo } from "react";
4
- import { StyledDot, StyledDotsContainer } from "../styles.js";
5
- import { inRange } from "../utils/inRange.js";
3
+ import { useContext } from "react";
6
4
  import DSSliderV2Context from "../DSSliderV2CTX.js";
5
+ import { StyledDot, StyledDotsContainer } from "./styles.js";
7
6
  const TickMarks = () => {
8
- const {
9
- propsWithDefault: { step, minValue, maxValue },
10
- rangeValues,
11
- getOwnerProps,
12
- getOwnerPropsArguments
13
- } = useContext(DSSliderV2Context);
14
- const dots = useMemo(() => {
15
- const dotsArr = [];
16
- for (let value = minValue; value <= maxValue; value += step) {
17
- const isActive = inRange(value, rangeValues);
18
- dotsArr.push(
19
- /* @__PURE__ */ jsx(
20
- StyledDot,
21
- {
22
- isActive,
23
- getOwnerProps,
24
- getOwnerPropsArguments
25
- },
26
- value
27
- )
28
- );
29
- }
30
- return dotsArr;
31
- }, [getOwnerProps, getOwnerPropsArguments, maxValue, minValue, rangeValues, step]);
32
- return /* @__PURE__ */ jsx(StyledDotsContainer, { getOwnerProps, getOwnerPropsArguments, children: dots });
7
+ const { tickMarkPositions, instanceUid, getOwnerProps, getOwnerPropsArguments } = useContext(DSSliderV2Context);
8
+ return /* @__PURE__ */ jsx(StyledDotsContainer, { getOwnerProps, getOwnerPropsArguments, children: tickMarkPositions.map((val) => /* @__PURE__ */ jsx(
9
+ StyledDot,
10
+ {
11
+ getOwnerProps,
12
+ getOwnerPropsArguments
13
+ },
14
+ `${instanceUid}-track-dot-${val}`
15
+ )) });
33
16
  };
34
17
  export {
35
18
  TickMarks
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TickMarks.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { StyledDot, StyledDotsContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarks = () => {\n const {\n propsWithDefault: { step, minValue, maxValue },\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const dots = useMemo(() => {\n const dotsArr = [];\n\n for (let value = minValue; value <= maxValue; value += step) {\n const isActive = inRange(value, rangeValues);\n dotsArr.push(\n <StyledDot\n isActive={isActive}\n key={value}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />,\n );\n }\n\n return dotsArr;\n }, [getOwnerProps, getOwnerPropsArguments, maxValue, minValue, rangeValues, step]);\n\n return (\n <StyledDotsContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {dots}\n </StyledDotsContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACmBf;AAnBR,SAAgB,YAAY,eAAe;AAC3C,SAAS,WAAW,2BAA2B;AAC/C,SAAS,eAAe;AACxB,OAAO,uBAAuB;AAEvB,MAAM,YAAY,MAAM;AAC7B,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,UAAU,SAAS;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,OAAO,QAAQ,MAAM;AACzB,UAAM,UAAU,CAAC;AAEjB,aAAS,QAAQ,UAAU,SAAS,UAAU,SAAS,MAAM;AAC3D,YAAM,WAAW,QAAQ,OAAO,WAAW;AAC3C,cAAQ;AAAA,QACN;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YAEA;AAAA,YACA;AAAA;AAAA,UAFK;AAAA,QAGP;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,wBAAwB,UAAU,UAAU,aAAa,IAAI,CAAC;AAEjF,SACE,oBAAC,uBAAoB,eAA8B,wBAChD,gBACH;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-array-index-key */\nimport { useContext } from 'react';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { StyledDot, StyledDotsContainer } from './styles.js';\n\nexport const TickMarks = () => {\n const { tickMarkPositions, instanceUid, getOwnerProps, getOwnerPropsArguments } = useContext(DSSliderV2Context);\n\n return (\n <StyledDotsContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {tickMarkPositions.map((val) => (\n <StyledDot\n key={`${instanceUid}-track-dot-${val}`}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ))}\n </StyledDotsContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACWf;AAVR,SAAS,kBAAkB;AAC3B,OAAO,uBAAuB;AAC9B,SAAS,WAAW,2BAA2B;AAExC,MAAM,YAAY,MAAM;AAC7B,QAAM,EAAE,mBAAmB,aAAa,eAAe,uBAAuB,IAAI,WAAW,iBAAiB;AAE9G,SACE,oBAAC,uBAAoB,eAA8B,wBAChD,4BAAkB,IAAI,CAAC,QACtB;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA;AAAA;AAAA,IAFK,GAAG,WAAW,cAAc,GAAG;AAAA,EAGtC,CACD,GACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useContext, useMemo } from "react";
4
- import { StyledTickMarkValue, StyledTickMarksContainer } from "../styles.js";
5
- import { inRange } from "../utils/inRange.js";
6
4
  import DSSliderV2Context from "../DSSliderV2CTX.js";
5
+ import { inRange } from "../utils/inRange.js";
6
+ import { StyledTickMarkValue, StyledTickMarksContainer } from "./styles.js";
7
7
  const TickMarksValues = () => {
8
8
  const {
9
9
  propsWithDefault: { customTickMarksValues, maxValue, minValue },
@@ -18,22 +18,6 @@ const TickMarksValues = () => {
18
18
  const calculatedColumnWidthPercentage = `${distanceBetweenDots / (maxValue - minValue) * 100}%`;
19
19
  return { columnWidth: calculatedColumnWidthPercentage };
20
20
  }, [maxValue, minValue, tickMarkPositions.length]);
21
- const markValues = useMemo(
22
- () => tickMarkPositions.map((value, index) => {
23
- const isSelected = inRange(value, rangeValues);
24
- return /* @__PURE__ */ jsx(
25
- StyledTickMarkValue,
26
- {
27
- isSelected,
28
- getOwnerProps,
29
- getOwnerPropsArguments,
30
- children: customTickMarksValues[index] ?? value
31
- },
32
- `${instanceUid}-${value}`
33
- );
34
- }),
35
- [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues]
36
- );
37
21
  return /* @__PURE__ */ jsx(
38
22
  StyledTickMarksContainer,
39
23
  {
@@ -41,7 +25,19 @@ const TickMarksValues = () => {
41
25
  getOwnerPropsArguments,
42
26
  columnCount: tickMarkPositions.length,
43
27
  columnWidth,
44
- children: markValues
28
+ children: tickMarkPositions.map((value, index) => {
29
+ const isSelected = inRange(value, rangeValues);
30
+ return /* @__PURE__ */ jsx(
31
+ StyledTickMarkValue,
32
+ {
33
+ isSelected,
34
+ getOwnerProps,
35
+ getOwnerPropsArguments,
36
+ children: customTickMarksValues[index] ?? value
37
+ },
38
+ `${instanceUid}-${value}`
39
+ );
40
+ })
45
41
  }
46
42
  );
47
43
  };