@elliemae/ds-slider-v2 3.52.0-rc.9 → 3.52.0

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 (34) hide show
  1. package/dist/cjs/config/useSliderV2.js +12 -1
  2. package/dist/cjs/config/useSliderV2.js.map +2 -2
  3. package/dist/cjs/parts/MainContent.js +6 -1
  4. package/dist/cjs/parts/MainContent.js.map +2 -2
  5. package/dist/cjs/parts/Thumb.js +30 -15
  6. package/dist/cjs/parts/Thumb.js.map +2 -2
  7. package/dist/cjs/parts/TickMarksValues.js +16 -2
  8. package/dist/cjs/parts/TickMarksValues.js.map +2 -2
  9. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  10. package/dist/cjs/styles.js +8 -2
  11. package/dist/cjs/styles.js.map +2 -2
  12. package/dist/esm/config/useSliderV2.js +12 -1
  13. package/dist/esm/config/useSliderV2.js.map +2 -2
  14. package/dist/esm/parts/MainContent.js +6 -1
  15. package/dist/esm/parts/MainContent.js.map +2 -2
  16. package/dist/esm/parts/Thumb.js +31 -16
  17. package/dist/esm/parts/Thumb.js.map +2 -2
  18. package/dist/esm/parts/TickMarksValues.js +16 -2
  19. package/dist/esm/parts/TickMarksValues.js.map +2 -2
  20. package/dist/esm/react-desc-prop-types.js.map +2 -2
  21. package/dist/esm/styles.js +8 -2
  22. package/dist/esm/styles.js.map +2 -2
  23. package/dist/types/config/useSliderV2.d.ts +5 -0
  24. package/dist/types/react-desc-prop-types.d.ts +3 -3
  25. package/dist/types/styles.d.ts +4 -1
  26. package/dist/types/tests/DSSliderV2.data-testid.test.d.ts +1 -0
  27. package/dist/types/tests/DSSliderV2.events.test.d.ts +1 -0
  28. package/dist/types/tests/DSSliderV2.exports.test.d.ts +1 -0
  29. package/dist/types/tests/DSSliderV2.keyboard.test.d.ts +1 -0
  30. package/dist/types/tests/DSSliderv2.api.test.d.ts +1 -0
  31. package/package.json +11 -11
  32. /package/dist/types/tests/{a11y.test.d.ts → DSSliderV2.PUI-15228.test.d.ts} +0 -0
  33. /package/dist/types/tests/{events.test.d.ts → DSSliderV2.PUI-15992.test.d.ts} +0 -0
  34. /package/dist/types/tests/{render.test.d.ts → DSSliderV2.a11y.test.d.ts} +0 -0
@@ -53,6 +53,7 @@ const useSliderV2 = (propsFromUser) => {
53
53
  const tickMarkPositions = (0, import_useTickMarksValues.useTickMarksValues)(propsWithDefault);
54
54
  (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSSliderV2PropTypes, { tickMarkPositions });
55
55
  const ownerPropConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
56
+ const [hasUserInteractedAfterFocus, setHasUserInteractedAfterFocus] = import_react.default.useState(false);
56
57
  return import_react.default.useMemo(
57
58
  () => ({
58
59
  propsWithDefault,
@@ -60,9 +61,19 @@ const useSliderV2 = (propsFromUser) => {
60
61
  instanceUid,
61
62
  rangeValues,
62
63
  tickMarkPositions,
64
+ hasUserInteractedAfterFocus,
65
+ setHasUserInteractedAfterFocus,
63
66
  ...ownerPropConfig
64
67
  }),
65
- [propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig]
68
+ [
69
+ propsWithDefault,
70
+ xstyledProps,
71
+ instanceUid,
72
+ rangeValues,
73
+ tickMarkPositions,
74
+ hasUserInteractedAfterFocus,
75
+ ownerPropConfig
76
+ ]
66
77
  );
67
78
  };
68
79
  //# sourceMappingURL=useSliderV2.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useSliderV2.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["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}\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\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n ...ownerPropConfig,\n }),\n [propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,8BAAgF;AAChF,iBAAoB;AACpB,mCAAoE;AACpE,8BAAiC;AACjC,gCAAmC;AAY5B,MAAM,cAAc,CAA4B,kBAAgD;AAIrG,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,UAAU,MAAM,IAAI;AAK5B,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,iBAAa,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAEjE,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM;AACtC,QAAI,aAAa,KAAM,QAAO;AAC9B,WAAO,CAAC,KAAK;AAAA,EACf,GAAG,CAAC,UAAU,KAAK,CAAC;AAKpB,QAAM,wBAAoB,8CAAmB,gBAAgB;AAK7D,gDAAiB,kBAAkB,kDAAqB,EAAE,kBAAkB,CAAC;AAE7E,QAAM,sBAAkB,uCAAc,gBAAgB;AAEtD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA,CAAC,kBAAkB,cAAc,aAAa,aAAa,mBAAmB,eAAe;AAAA,EAC/F;AACF;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,8BAAgF;AAChF,iBAAoB;AACpB,mCAAoE;AACpE,8BAAiC;AACjC,gCAAmC;AAc5B,MAAM,cAAc,CAA4B,kBAAgD;AAIrG,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,UAAU,MAAM,IAAI;AAK5B,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,iBAAa,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAEjE,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM;AACtC,QAAI,aAAa,KAAM,QAAO;AAC9B,WAAO,CAAC,KAAK;AAAA,EACf,GAAG,CAAC,UAAU,KAAK,CAAC;AAKpB,QAAM,wBAAoB,8CAAmB,gBAAgB;AAK7D,gDAAiB,kBAAkB,kDAAqB,EAAE,kBAAkB,CAAC;AAE7E,QAAM,sBAAkB,uCAAc,gBAAgB;AACtD,QAAM,CAAC,6BAA6B,8BAA8B,IAAI,aAAAA,QAAM,SAAS,KAAK;AAE1F,SAAO,aAAAA,QAAM;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
  }
@@ -45,7 +45,9 @@ const MainContent = () => {
45
45
  xstyledProps,
46
46
  rangeValues,
47
47
  getOwnerProps,
48
- getOwnerPropsArguments
48
+ getOwnerPropsArguments,
49
+ setHasUserInteractedAfterFocus,
50
+ hasUserInteractedAfterFocus
49
51
  } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
50
52
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
53
  import_styles.StyledWrapper,
@@ -81,6 +83,9 @@ const MainContent = () => {
81
83
  } else {
82
84
  onValueChange(values);
83
85
  }
86
+ if (!hasUserInteractedAfterFocus) {
87
+ setHasUserInteractedAfterFocus(true);
88
+ }
84
89
  },
85
90
  renderTrack: (args) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Track.Track, { ...args }),
86
91
  renderThumb: (args) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Thumb.Thumb, { ...args }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/MainContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["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 } = 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 }}\n renderTrack={(args) => <Track {...args} />}\n renderThumb={(args) => <Thumb {...args} />}\n allowOverlap\n draggableTrack\n />\n </StyledRangeWrapper>\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiDU;AAjDjC,mBAA2B;AAC3B,yBAAsB;AACtB,2BAA8B;AAC9B,oBAAkD;AAClD,mBAAsB;AACtB,mBAAsB;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,EACF,QAAI,yBAAW,qBAAAA,OAAiB;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;AAAA,cACF;AAAA,cACA,aAAa,CAAC,SAAS,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,aAAa,CAAC,SAAS,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,cAAY;AAAA,cACZ,gBAAc;AAAA;AAAA,UAChB;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsDU;AAtDjC,mBAA2B;AAC3B,yBAAsB;AACtB,2BAA8B;AAC9B,oBAAkD;AAClD,mBAAsB;AACtB,mBAAsB;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,QAAI,yBAAW,qBAAAA,OAAiB;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,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,aAAa,CAAC,SAAS,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,cAAY;AAAA,cACZ,gBAAc;AAAA;AAAA,UAChB;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": ["DSSliderV2Context"]
7
7
  }
@@ -43,10 +43,12 @@ const Thumb = ({ index, props, isDragged }) => {
43
43
  propsWithDefault: { disabled, applyAriaDisabled, readOnly, customTickMarksValues, step, minValue },
44
44
  rangeValues,
45
45
  getOwnerProps,
46
- getOwnerPropsArguments
46
+ hasUserInteractedAfterFocus,
47
+ setHasUserInteractedAfterFocus
47
48
  } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
48
49
  const [isHovered, setIsHovered] = (0, import_react.useState)(false);
49
50
  const [isFocused, setIsFocused] = (0, import_react.useState)(false);
51
+ const [isTooltipDismissed, setIsTooltipDismissed] = (0, import_react.useState)(false);
50
52
  const { ref, ...rest } = props;
51
53
  const label = (0, import_thumbLabels.conformedThumbLabel)({ rangeValues, customTickMarksValues, index, step, minValue });
52
54
  const thumbStyle = (0, import_react.useMemo)(
@@ -58,6 +60,14 @@ const Thumb = ({ index, props, isDragged }) => {
58
60
  }),
59
61
  [rest.style, disabled, applyAriaDisabled, readOnly]
60
62
  );
63
+ const getOwnerPropsArguments = (0, import_react.useCallback)(
64
+ () => ({
65
+ index,
66
+ shouldUseExtendedAriaValueText: !hasUserInteractedAfterFocus
67
+ }),
68
+ [index, hasUserInteractedAfterFocus]
69
+ );
70
+ const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;
61
71
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
62
72
  import_styles.StyledThumb,
63
73
  {
@@ -71,24 +81,29 @@ const Thumb = ({ index, props, isDragged }) => {
71
81
  onMouseEnter: () => {
72
82
  setIsHovered(true);
73
83
  setIsFocused(false);
84
+ setIsTooltipDismissed(false);
74
85
  },
75
86
  onMouseLeave: () => setIsHovered(false),
76
- onKeyDownCapture: () => setIsFocused(true),
77
- onFocus: () => setIsFocused(true),
78
- onBlur: () => setIsFocused(false),
87
+ onKeyDownCapture: (e) => {
88
+ if (e.key === "Escape" && showPopover) {
89
+ e.stopPropagation();
90
+ setIsTooltipDismissed(true);
91
+ } else {
92
+ setIsFocused(true);
93
+ setIsTooltipDismissed(false);
94
+ }
95
+ },
96
+ onFocus: () => {
97
+ setIsFocused(true);
98
+ setIsTooltipDismissed(false);
99
+ },
100
+ onBlur: () => {
101
+ setIsFocused(false);
102
+ setHasUserInteractedAfterFocus(false);
103
+ },
79
104
  getOwnerProps,
80
105
  getOwnerPropsArguments,
81
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
- import_ds_tooltip_v3.DSTooltipV3,
83
- {
84
- text: label,
85
- showPopover: isDragged || isHovered || isFocused,
86
- customOffset: [0, 20],
87
- withoutAnimation: true,
88
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {})
89
- },
90
- label
91
- )
106
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_tooltip_v3.DSTooltipV3, { text: label, showPopover, customOffset: [0, 20], withoutAnimation: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}) }, label)
92
107
  }
93
108
  );
94
109
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/Thumb.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { 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 getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\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 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 }}\n onMouseLeave={() => setIsHovered(false)}\n onKeyDownCapture={() => setIsFocused(true)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTooltipV3\n key={label}\n text={label}\n showPopover={isDragged || isHovered || isFocused}\n customOffset={[0, 20]}\n withoutAnimation\n >\n <span></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Df;AA3DR,mBAAqD;AAErD,2BAA4B;AAC5B,yBAAoC;AACpC,oBAA4B;AAC5B,2BAA8B;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,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAEhD,QAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AAEzB,QAAM,YAAQ,wCAAoB,EAAE,aAAa,uBAAuB,OAAO,MAAM,SAAS,CAAC;AAE/F,QAAM,iBAAa;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,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;AAAA,MACpB;AAAA,MACA,cAAc,MAAM,aAAa,KAAK;AAAA,MACtC,kBAAkB,MAAM,aAAa,IAAI;AAAA,MACzC,SAAS,MAAM,aAAa,IAAI;AAAA,MAChC,QAAQ,MAAM,aAAa,KAAK;AAAA,MAChC;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,UACN,aAAa,aAAa,aAAa;AAAA,UACvC,cAAc,CAAC,GAAG,EAAE;AAAA,UACpB,kBAAgB;AAAA,UAEhB,sDAAC,UAAK;AAAA;AAAA,QAND;AAAA,MAOP;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["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} customOffset={[0, 20]} withoutAnimation>\n <span></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgFf;AAhFR,mBAAkE;AAElE,2B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a,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,sDAAC,oCAAwB,MAAM,OAAO,aAA0B,cAAc,CAAC,GAAG,EAAE,GAAG,kBAAgB,MACrG,sDAAC,UAAK,KADU,KAElB;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": ["DSSliderV2Context"]
7
7
  }
@@ -39,13 +39,18 @@ var import_inRange = require("../utils/inRange.js");
39
39
  var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
40
40
  const TickMarksValues = () => {
41
41
  const {
42
- propsWithDefault: { customTickMarksValues },
42
+ propsWithDefault: { customTickMarksValues, maxValue, minValue },
43
43
  rangeValues,
44
44
  tickMarkPositions,
45
45
  instanceUid,
46
46
  getOwnerProps,
47
47
  getOwnerPropsArguments
48
48
  } = (0, import_react.useContext)(import_DSSliderV2CTX.default);
49
+ const { columnWidth } = (0, import_react.useMemo)(() => {
50
+ const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);
51
+ const calculatedColumnWidthPercentage = `${distanceBetweenDots / (maxValue - minValue) * 100}%`;
52
+ return { columnWidth: calculatedColumnWidthPercentage };
53
+ }, [maxValue, minValue, tickMarkPositions.length]);
49
54
  const markValues = (0, import_react.useMemo)(
50
55
  () => tickMarkPositions.map((value, index) => {
51
56
  const isSelected = (0, import_inRange.inRange)(value, rangeValues);
@@ -62,6 +67,15 @@ const TickMarksValues = () => {
62
67
  }),
63
68
  [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues]
64
69
  );
65
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledTickMarksContainer, { getOwnerProps, getOwnerPropsArguments, children: markValues });
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
+ import_styles.StyledTickMarksContainer,
72
+ {
73
+ getOwnerProps,
74
+ getOwnerPropsArguments,
75
+ columnCount: tickMarkPositions.length,
76
+ columnWidth,
77
+ children: markValues
78
+ }
79
+ );
66
80
  };
67
81
  //# sourceMappingURL=TickMarksValues.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/TickMarksValues.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n return (\n <StyledTickMarkValue\n key={`${instanceUid}-${value}`}\n isSelected={isSelected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customTickMarksValues[index] ?? value}\n </StyledTickMarkValue>\n );\n }),\n [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues],\n );\n\n return (\n <StyledTickMarksContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBb;AApBV,mBAA2C;AAC3C,oBAA8D;AAC9D,qBAAwB;AACxB,2BAA8B;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,sBAAsB;AAAA,IAC1C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,iBAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,iBAAa,wBAAQ,OAAO,WAAW;AAC7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,MAM9B;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE,4CAAC,0CAAyB,eAA8B,wBACrD,sBACH;AAEJ;",
4
+ "sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues, maxValue, minValue },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { columnWidth } = useMemo(() => {\n const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);\n const calculatedColumnWidthPercentage = `${(distanceBetweenDots / (maxValue - minValue)) * 100}%`;\n return { columnWidth: calculatedColumnWidthPercentage };\n }, [maxValue, minValue, tickMarkPositions.length]);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n\n return (\n <StyledTickMarkValue\n key={`${instanceUid}-${value}`}\n isSelected={isSelected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customTickMarksValues[index] ?? value}\n </StyledTickMarkValue>\n );\n }),\n [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues],\n );\n\n return (\n <StyledTickMarksContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n columnCount={tickMarkPositions.length}\n columnWidth={columnWidth}\n >\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Bb;AA3BV,mBAA2C;AAC3C,oBAA8D;AAC9D,qBAAwB;AACxB,2BAA8B;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,uBAAuB,UAAU,SAAS;AAAA,IAC9D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,EAAE,YAAY,QAAI,sBAAQ,MAAM;AACpC,UAAM,uBAAuB,WAAW,aAAa,kBAAkB,SAAS;AAChF,UAAM,kCAAkC,GAAI,uBAAuB,WAAW,YAAa,GAAG;AAC9F,WAAO,EAAE,aAAa,gCAAgC;AAAA,EACxD,GAAG,CAAC,UAAU,UAAU,kBAAkB,MAAM,CAAC;AAEjD,QAAM,iBAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,iBAAa,wBAAQ,OAAO,WAAW;AAE7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,MAM9B;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,aAAa,kBAAkB;AAAA,MAC/B;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;",
6
6
  "names": ["DSSliderV2Context"]
7
7
  }
@@ -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, 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 XstyledProps,\n RequiredProps<TMultiple> {}\n\n export interface InternalProps<TMultiple extends boolean = false>\n extends DefaultProps<TMultiple>,\n OptionalProps,\n XstyledProps,\n RequiredProps<TMultiple> {}\n}\n\nexport const defaultProps: DSSliderV2T.DefaultProps<boolean> = {\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n multiple: false as boolean,\n 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": ";;;;;;;;;;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escript-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;",
6
6
  "names": []
7
7
  }
@@ -88,14 +88,20 @@ const StyledTickMarkValue = (0, import_ds_system.styled)("div", { name: import_c
88
88
  text-align: center;
89
89
  min-height: ${(props) => props.theme.space.xs};
90
90
  overflow: visible;
91
- width: ${(props) => props.theme.space.xxxs};
92
91
  color: ${(props) => props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500]};
92
+ place-self: baseline;
93
+ transform: translateX(-50%);
94
+ white-space: normal;
95
+ overflow-wrap: break-word;
96
+ word-break: break-word;
93
97
  `;
94
98
  const StyledTickMarksContainer = (0, import_ds_system.styled)("div", {
95
99
  name: import_constants.DSSliderV2Name,
96
100
  slot: import_constants.SLIDER_V2_SLOTS.TICK_MARK_CONTAINER
97
101
  })`
98
- display: flex;
102
+ display: grid;
103
+ grid-template-columns: repeat(${(props) => props.columnCount}, calc(${(props) => props.columnWidth} - 4px));
104
+ gap: 4px;
99
105
  justify-content: space-between;
100
106
  // this next property-value reverts the sanitize.css value
101
107
  overflow-wrap: normal;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { getTrackBackground } from 'react-range';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;\n\nexport const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}>`\n position: relative;\n height: ${(props) => props.theme.space.xxxs};\n width: 100%;\n min-width: ${(props) => props.theme.space.xl};\n border-radius: ${(props) => props.theme.space.xxxs};\n background: ${(props) =>\n props.disabled || props.applyAriaDisabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.multiple\n ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })<{ isActive: boolean }>`\n &:after {\n content: '';\n background: ${(props) => (props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400])};\n border-radius: ${(props) => props.theme.space.xxxs};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nexport const StyledDotsContainer = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT_CONTAINER })`\n padding: 0 2px;\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip - 1};\n`;\n\nexport const StyledTickMarkValue = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TICK_MARK_VALUE })<{\n isSelected: boolean;\n}>`\n display: flex;\n justify-content: center;\n text-align: center;\n min-height: ${(props) => props.theme.space.xs};\n overflow: visible;\n width: ${(props) => props.theme.space.xxxs};\n color: ${(props) => (props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500])};\n`;\n\nexport const StyledTickMarksContainer = styled('div', {\n name: DSSliderV2Name,\n slot: SLIDER_V2_SLOTS.TICK_MARK_CONTAINER,\n})`\n display: flex;\n justify-content: space-between;\n // this next property-value reverts the sanitize.css value\n overflow-wrap: normal;\n`;\n\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n}>`\n height: 20px;\n width: 20px;\n top: 0;\n background-color: ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid\n ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};\n\n :focus {\n border: 2px solid brand-700;\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : undefined)};\n\n z-index: ${(props) => props.theme.zIndex.tooltip};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmC;AACnC,qBAAqB;AACrB,uBAAuB;AACvB,uBAAgD;AAEzC,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,KAAK,CAAC;AAEvF,MAAM,yBAAqB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,cAAc,CAAC;AAErG,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA,YASlF,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA,eAE9B,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,mBAC3B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,gBACpC,CAAC,UACb,MAAM,YAAY,MAAM,oBACpB,MAAM,MAAM,OAAO,QAAQ,GAAG,QAC9B,uCAAmB;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM,WACV,CAAC,MAAM,MAAM,OAAO,QAAQ,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC,IAChG,CAAC,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACnE,KAAK,MAAM;AAAA,EACX,KAAK,MAAM;AACb,CAAC,CAAC;AAAA;AAGH,MAAM,gBAAY,yBAAO,OAAO,EAAE,MA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AM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQ3F,CAAC,EAAE,UAAU,mBAAmB,MAAM,MACxD,YAAY,oBAAoB,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA,YAG7E,CAAC,EAAE,UAAU,kBAAkB,MAAO,YAAY,oBAAoB,gBAAgB,MAAU;AAAA;AAAA,aAE/F,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;",
4
+ "sourcesContent": ["import { getTrackBackground } from 'react-range';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;\n\nexport const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}>`\n position: relative;\n height: ${(props) => props.theme.space.xxxs};\n width: 100%;\n min-width: ${(props) => props.theme.space.xl};\n border-radius: ${(props) => props.theme.space.xxxs};\n background: ${(props) =>\n props.disabled || props.applyAriaDisabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.multiple\n ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })<{ isActive: boolean }>`\n &:after {\n content: '';\n background: ${(props) => (props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400])};\n border-radius: ${(props) => props.theme.space.xxxs};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nexport const StyledDotsContainer = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT_CONTAINER })`\n padding: 0 2px;\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip - 1};\n`;\n\nexport const StyledTickMarkValue = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TICK_MARK_VALUE })<{\n isSelected: boolean;\n}>`\n display: flex;\n justify-content: center;\n text-align: center;\n min-height: ${(props) => props.theme.space.xs};\n overflow: visible;\n 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\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n}>`\n height: 20px;\n width: 20px;\n top: 0;\n background-color: ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid\n ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};\n\n :focus {\n border: 2px solid brand-700;\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : undefined)};\n\n z-index: ${(props) => props.theme.zIndex.tooltip};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAmC;AACnC,qBAAqB;AACrB,uBAAuB;AACvB,uBAAgD;AAEzC,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,KAAK,CAAC;AAEvF,MAAM,yBAAqB,yBAAO,qBAAM,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,cAAc,CAAC;AAErG,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,iCAAgB,MAAM,iCAAgB,MAAM,CAAC;AAAA;AAAA,YASlF,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA,eAE9B,CAAC,UAAU,MAAM,MAAM,MAAM,EAAE;AAAA,mBAC3B,CAAC,UAAU,MAAM,MAAM,MAAM,IAAI;AAAA,gBACpC,CAAC,UACb,MAAM,YAAY,MAAM,oBACpB,MAAM,MAAM,OAAO,QAAQ,GAAG,QAC9B,uCAAmB;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM,WACV,CAAC,MAAM,MAAM,OAAO,QAAQ,GAAG,GAAG,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC,IAChG,CAAC,MAAM,MAAM,OAAO,MAAM,GAAG,GAAG,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,EACnE,KAAK,MAAM;AAAA,EACX,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OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,MAG7G,CAAC,UACD,MAAM,YAAY,MAAM,oBAAoB,MAAM,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQ3F,CAAC,EAAE,UAAU,mBAAmB,MAAM,MACxD,YAAY,oBAAoB,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA,YAG7E,CAAC,EAAE,UAAU,kBAAkB,MAAO,YAAY,oBAAoB,gBAAgB,MAAU;AAAA;AAAA,aAE/F,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;",
6
6
  "names": []
7
7
  }
@@ -20,6 +20,7 @@ const useSliderV2 = (propsFromUser) => {
20
20
  const tickMarkPositions = useTickMarksValues(propsWithDefault);
21
21
  useValidateProps(propsWithDefault, DSSliderV2PropTypes, { tickMarkPositions });
22
22
  const ownerPropConfig = useOwnerProps(propsWithDefault);
23
+ const [hasUserInteractedAfterFocus, setHasUserInteractedAfterFocus] = React2.useState(false);
23
24
  return React2.useMemo(
24
25
  () => ({
25
26
  propsWithDefault,
@@ -27,9 +28,19 @@ const useSliderV2 = (propsFromUser) => {
27
28
  instanceUid,
28
29
  rangeValues,
29
30
  tickMarkPositions,
31
+ hasUserInteractedAfterFocus,
32
+ setHasUserInteractedAfterFocus,
30
33
  ...ownerPropConfig
31
34
  }),
32
- [propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig]
35
+ [
36
+ propsWithDefault,
37
+ xstyledProps,
38
+ instanceUid,
39
+ rangeValues,
40
+ tickMarkPositions,
41
+ hasUserInteractedAfterFocus,
42
+ ownerPropConfig
43
+ ]
33
44
  );
34
45
  };
35
46
  export {
@@ -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}\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\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n ...ownerPropConfig,\n }),\n [propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig],\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;AAY5B,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;AAEtD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA,CAAC,kBAAkB,cAAc,aAAa,aAAa,mBAAmB,eAAe;AAAA,EAC/F;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<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;",
6
6
  "names": ["React"]
7
7
  }
@@ -12,7 +12,9 @@ const MainContent = () => {
12
12
  xstyledProps,
13
13
  rangeValues,
14
14
  getOwnerProps,
15
- getOwnerPropsArguments
15
+ getOwnerPropsArguments,
16
+ setHasUserInteractedAfterFocus,
17
+ hasUserInteractedAfterFocus
16
18
  } = useContext(DSSliderV2Context);
17
19
  return /* @__PURE__ */ jsx(
18
20
  StyledWrapper,
@@ -48,6 +50,9 @@ const MainContent = () => {
48
50
  } else {
49
51
  onValueChange(values);
50
52
  }
53
+ if (!hasUserInteractedAfterFocus) {
54
+ setHasUserInteractedAfterFocus(true);
55
+ }
51
56
  },
52
57
  renderTrack: (args) => /* @__PURE__ */ jsx(Track, { ...args }),
53
58
  renderThumb: (args) => /* @__PURE__ */ jsx(Thumb, { ...args }),
@@ -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 } = 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 }}\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;ACiDU;AAjDjC,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,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;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 } 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,SAA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
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext, useMemo, useState } from "react";
3
+ import { useCallback, useContext, useMemo, useState } from "react";
4
4
  import { DSTooltipV3 } from "@elliemae/ds-tooltip-v3";
5
5
  import { conformedThumbLabel } from "../utils/thumbLabels.js";
6
6
  import { StyledThumb } from "../styles.js";
@@ -10,10 +10,12 @@ const Thumb = ({ index, props, isDragged }) => {
10
10
  propsWithDefault: { disabled, applyAriaDisabled, readOnly, customTickMarksValues, step, minValue },
11
11
  rangeValues,
12
12
  getOwnerProps,
13
- getOwnerPropsArguments
13
+ hasUserInteractedAfterFocus,
14
+ setHasUserInteractedAfterFocus
14
15
  } = useContext(DSSliderV2Context);
15
16
  const [isHovered, setIsHovered] = useState(false);
16
17
  const [isFocused, setIsFocused] = useState(false);
18
+ const [isTooltipDismissed, setIsTooltipDismissed] = useState(false);
17
19
  const { ref, ...rest } = props;
18
20
  const label = conformedThumbLabel({ rangeValues, customTickMarksValues, index, step, minValue });
19
21
  const thumbStyle = useMemo(
@@ -25,6 +27,14 @@ const Thumb = ({ index, props, isDragged }) => {
25
27
  }),
26
28
  [rest.style, disabled, applyAriaDisabled, readOnly]
27
29
  );
30
+ const getOwnerPropsArguments = useCallback(
31
+ () => ({
32
+ index,
33
+ shouldUseExtendedAriaValueText: !hasUserInteractedAfterFocus
34
+ }),
35
+ [index, hasUserInteractedAfterFocus]
36
+ );
37
+ const showPopover = (isDragged || isHovered || isFocused) && !isTooltipDismissed;
28
38
  return /* @__PURE__ */ jsx(
29
39
  StyledThumb,
30
40
  {
@@ -38,24 +48,29 @@ const Thumb = ({ index, props, isDragged }) => {
38
48
  onMouseEnter: () => {
39
49
  setIsHovered(true);
40
50
  setIsFocused(false);
51
+ setIsTooltipDismissed(false);
41
52
  },
42
53
  onMouseLeave: () => setIsHovered(false),
43
- onKeyDownCapture: () => setIsFocused(true),
44
- onFocus: () => setIsFocused(true),
45
- onBlur: () => setIsFocused(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
+ },
46
71
  getOwnerProps,
47
72
  getOwnerPropsArguments,
48
- children: /* @__PURE__ */ jsx(
49
- DSTooltipV3,
50
- {
51
- text: label,
52
- showPopover: isDragged || isHovered || isFocused,
53
- customOffset: [0, 20],
54
- withoutAnimation: true,
55
- children: /* @__PURE__ */ jsx("span", {})
56
- },
57
- label
58
- )
73
+ children: /* @__PURE__ */ jsx(DSTooltipV3, { text: label, showPopover, customOffset: [0, 20], withoutAnimation: true, children: /* @__PURE__ */ jsx("span", {}) }, label)
59
74
  }
60
75
  );
61
76
  };
@@ -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, { 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 getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\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 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 }}\n onMouseLeave={() => setIsHovered(false)}\n onKeyDownCapture={() => setIsFocused(true)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTooltipV3\n key={label}\n text={label}\n showPopover={isDragged || isHovered || isFocused}\n customOffset={[0, 20]}\n withoutAnimation\n >\n <span></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2Df;AA3DR,SAAgB,YAAY,SAAS,gBAAgB;AAErD,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,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,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,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;AAAA,MACpB;AAAA,MACA,cAAc,MAAM,aAAa,KAAK;AAAA,MACtC,kBAAkB,MAAM,aAAa,IAAI;AAAA,MACzC,SAAS,MAAM,aAAa,IAAI;AAAA,MAChC,QAAQ,MAAM,aAAa,KAAK;AAAA,MAChC;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,UACN,aAAa,aAAa,aAAa;AAAA,UACvC,cAAc,CAAC,GAAG,EAAE;AAAA,UACpB,kBAAgB;AAAA,UAEhB,8BAAC,UAAK;AAAA;AAAA,QAND;AAAA,MAOP;AAAA;AAAA,EACF;AAEJ;",
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} customOffset={[0, 20]} withoutAnimation>\n <span></span>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgFf;AAhFR,SAAgB,aAAa,YAAY,SAAS,gBAAgB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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,cAAc,CAAC,GAAG,EAAE,GAAG,kBAAgB,MACrG,8BAAC,UAAK,KADU,KAElB;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -6,13 +6,18 @@ import { inRange } from "../utils/inRange.js";
6
6
  import DSSliderV2Context from "../DSSliderV2CTX.js";
7
7
  const TickMarksValues = () => {
8
8
  const {
9
- propsWithDefault: { customTickMarksValues },
9
+ propsWithDefault: { customTickMarksValues, maxValue, minValue },
10
10
  rangeValues,
11
11
  tickMarkPositions,
12
12
  instanceUid,
13
13
  getOwnerProps,
14
14
  getOwnerPropsArguments
15
15
  } = useContext(DSSliderV2Context);
16
+ const { columnWidth } = useMemo(() => {
17
+ const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);
18
+ const calculatedColumnWidthPercentage = `${distanceBetweenDots / (maxValue - minValue) * 100}%`;
19
+ return { columnWidth: calculatedColumnWidthPercentage };
20
+ }, [maxValue, minValue, tickMarkPositions.length]);
16
21
  const markValues = useMemo(
17
22
  () => tickMarkPositions.map((value, index) => {
18
23
  const isSelected = inRange(value, rangeValues);
@@ -29,7 +34,16 @@ const TickMarksValues = () => {
29
34
  }),
30
35
  [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues]
31
36
  );
32
- return /* @__PURE__ */ jsx(StyledTickMarksContainer, { getOwnerProps, getOwnerPropsArguments, children: markValues });
37
+ return /* @__PURE__ */ jsx(
38
+ StyledTickMarksContainer,
39
+ {
40
+ getOwnerProps,
41
+ getOwnerPropsArguments,
42
+ columnCount: tickMarkPositions.length,
43
+ columnWidth,
44
+ children: markValues
45
+ }
46
+ );
33
47
  };
34
48
  export {
35
49
  TickMarksValues
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TickMarksValues.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n return (\n <StyledTickMarkValue\n key={`${instanceUid}-${value}`}\n isSelected={isSelected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customTickMarksValues[index] ?? value}\n </StyledTickMarkValue>\n );\n }),\n [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues],\n );\n\n return (\n <StyledTickMarksContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoBb;AApBV,SAAgB,YAAY,eAAe;AAC3C,SAAS,qBAAqB,gCAAgC;AAC9D,SAAS,eAAe;AACxB,OAAO,uBAAuB;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,sBAAsB;AAAA,IAC1C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,aAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,aAAa,QAAQ,OAAO,WAAW;AAC7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,MAM9B;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE,oBAAC,4BAAyB,eAA8B,wBACrD,sBACH;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo } from 'react';\nimport { StyledTickMarkValue, StyledTickMarksContainer } from '../styles.js';\nimport { inRange } from '../utils/inRange.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const TickMarksValues = () => {\n const {\n propsWithDefault: { customTickMarksValues, maxValue, minValue },\n rangeValues,\n tickMarkPositions,\n instanceUid,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const { columnWidth } = useMemo(() => {\n const distanceBetweenDots = (maxValue - minValue) / (tickMarkPositions.length - 1);\n const calculatedColumnWidthPercentage = `${(distanceBetweenDots / (maxValue - minValue)) * 100}%`;\n return { columnWidth: calculatedColumnWidthPercentage };\n }, [maxValue, minValue, tickMarkPositions.length]);\n\n const markValues = useMemo(\n () =>\n tickMarkPositions.map((value, index) => {\n const isSelected = inRange(value, rangeValues);\n\n return (\n <StyledTickMarkValue\n key={`${instanceUid}-${value}`}\n isSelected={isSelected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customTickMarksValues[index] ?? value}\n </StyledTickMarkValue>\n );\n }),\n [tickMarkPositions, rangeValues, instanceUid, getOwnerProps, getOwnerPropsArguments, customTickMarksValues],\n );\n\n return (\n <StyledTickMarksContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n columnCount={tickMarkPositions.length}\n columnWidth={columnWidth}\n >\n {markValues}\n </StyledTickMarksContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC2Bb;AA3BV,SAAgB,YAAY,eAAe;AAC3C,SAAS,qBAAqB,gCAAgC;AAC9D,SAAS,eAAe;AACxB,OAAO,uBAAuB;AAEvB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ,kBAAkB,EAAE,uBAAuB,UAAU,SAAS;AAAA,IAC9D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,iBAAiB;AAEhC,QAAM,EAAE,YAAY,IAAI,QAAQ,MAAM;AACpC,UAAM,uBAAuB,WAAW,aAAa,kBAAkB,SAAS;AAChF,UAAM,kCAAkC,GAAI,uBAAuB,WAAW,YAAa,GAAG;AAC9F,WAAO,EAAE,aAAa,gCAAgC;AAAA,EACxD,GAAG,CAAC,UAAU,UAAU,kBAAkB,MAAM,CAAC;AAEjD,QAAM,aAAa;AAAA,IACjB,MACE,kBAAkB,IAAI,CAAC,OAAO,UAAU;AACtC,YAAM,aAAa,QAAQ,OAAO,WAAW;AAE7C,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UAEC,gCAAsB,KAAK,KAAK;AAAA;AAAA,QAL5B,GAAG,WAAW,IAAI,KAAK;AAAA,MAM9B;AAAA,IAEJ,CAAC;AAAA,IACH,CAAC,mBAAmB,aAAa,aAAa,eAAe,wBAAwB,qBAAqB;AAAA,EAC5G;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,aAAa,kBAAkB;AAAA,MAC/B;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;",
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/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, 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 XstyledProps,\n RequiredProps<TMultiple> {}\n\n export interface InternalProps<TMultiple extends boolean = false>\n extends DefaultProps<TMultiple>,\n OptionalProps,\n XstyledProps,\n RequiredProps<TMultiple> {}\n}\n\nexport const defaultProps: DSSliderV2T.DefaultProps<boolean> = {\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n multiple: false as boolean,\n 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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,uBAAuB;AA6CzC,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,GAAG,yBAAyB,gBAAgB,eAAe;AAAA,EAC3D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,KAAK;AAAA,EACzE,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,CAAC;AAAA,EAC7E,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,GAAG;AAAA,EAC/E,MAAM,UAAU,OAAO,YAAY,iCAAiC,EAAE,aAAa,CAAC;AAAA,EACpF,eAAe,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACjF,eAAe,UAAU,KAAK,YAAY,8BAA8B,EAAE,aAAa,KAAK;AAAA,EAC5F,qBAAqB,UAAU,KAAK,YAAY,4BAA4B,EAAE,aAAa,KAAK;AAAA,EAChG,uBAAuB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,EAC/F,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AAAA,EAClB,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,4BAA4B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport declare namespace DSSliderV2T {\n export type ValueType<TMultiple extends boolean> = TMultiple extends true\n ? [number, number]\n : TMultiple extends false\n ? number\n : number | [number, number];\n\n export interface RequiredProps<TMultiple extends boolean> {\n value: ValueType<TMultiple>;\n minValue: number;\n maxValue: number;\n }\n\n export interface DefaultProps<TMultiple extends boolean> {\n multiple: TMultiple;\n disabled: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n step: number;\n onValueChange: (newValue: ValueType<TMultiple>) => void;\n withTickMarks: boolean;\n withTickMarksValues: boolean;\n customTickMarksValues: string[];\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSSliderV2Name, typeof SLIDER_V2_SLOTS> {\n className?: string;\n }\n\n export interface Props<TMultiple extends boolean = false>\n extends Partial<DefaultProps<TMultiple>>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>,\n XstyledProps,\n RequiredProps<TMultiple> {}\n\n export interface InternalProps<TMultiple extends boolean = false>\n extends DefaultProps<TMultiple>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>,\n XstyledProps,\n RequiredProps<TMultiple> {}\n}\n\nexport const defaultProps: DSSliderV2T.DefaultProps<boolean> = {\n disabled: false,\n step: 5,\n onValueChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n customTickMarksValues: [],\n multiple: false as boolean,\n applyAriaDisabled: false,\n readOnly: false,\n};\n\nexport const DSSliderV2PropTypes: DSPropTypesSchema<DSSliderV2T.Props<boolean>> = {\n ...getPropsPerSlotPropTypes(DSSliderV2Name, SLIDER_V2_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n disabled: PropTypes.bool.description('disable slider').defaultValue(false),\n minValue: PropTypes.number.description('min value for slider').defaultValue(0),\n maxValue: PropTypes.number.description('max value for slider').defaultValue(100),\n step: PropTypes.number.description('steps of values from min to max').defaultValue(5),\n onValueChange: PropTypes.func.description('change handler').defaultValue(() => {}),\n withTickMarks: PropTypes.bool.description('add tick marks between steps').defaultValue(false),\n withTickMarksValues: PropTypes.bool.description('add step value to tickmark').defaultValue(false),\n customTickMarksValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n .description('Explicitly set tickmark values for custom tickmarks')\n .defaultValue([]),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n readOnly: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const DSSliderV2PropTypesSchema = DSSliderV2PropTypes as unknown as ValidationMap<DSSliderV2T.Props<boolean>>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,uBAAuB;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,GAAG,yBAAyB,gBAAgB,eAAe;AAAA,EAC3D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,KAAK;AAAA,EACzE,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,CAAC;AAAA,EAC7E,UAAU,UAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,GAAG;AAAA,EAC/E,MAAM,UAAU,OAAO,YAAY,iCAAiC,EAAE,aAAa,CAAC;AAAA,EACpF,eAAe,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACjF,eAAe,UAAU,KAAK,YAAY,8BAA8B,EAAE,aAAa,KAAK;AAAA,EAC5F,qBAAqB,UAAU,KAAK,YAAY,4BAA4B,EAAE,aAAa,KAAK;AAAA,EAChG,uBAAuB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,EAC/F,YAAY,qDAAqD,EACjE,aAAa,CAAC,CAAC;AAAA,EAClB,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,4BAA4B;",
6
6
  "names": []
7
7
  }
@@ -48,14 +48,20 @@ const StyledTickMarkValue = styled("div", { name: DSSliderV2Name, slot: SLIDER_V
48
48
  text-align: center;
49
49
  min-height: ${(props) => props.theme.space.xs};
50
50
  overflow: visible;
51
- width: ${(props) => props.theme.space.xxxs};
52
51
  color: ${(props) => props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500]};
52
+ place-self: baseline;
53
+ transform: translateX(-50%);
54
+ white-space: normal;
55
+ overflow-wrap: break-word;
56
+ word-break: break-word;
53
57
  `;
54
58
  const StyledTickMarksContainer = styled("div", {
55
59
  name: DSSliderV2Name,
56
60
  slot: SLIDER_V2_SLOTS.TICK_MARK_CONTAINER
57
61
  })`
58
- display: flex;
62
+ display: grid;
63
+ grid-template-columns: repeat(${(props) => props.columnCount}, calc(${(props) => props.columnWidth} - 4px));
64
+ gap: 4px;
59
65
  justify-content: space-between;
60
66
  // this next property-value reverts the sanitize.css value
61
67
  overflow-wrap: normal;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getTrackBackground } from 'react-range';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;\n\nexport const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}>`\n position: relative;\n height: ${(props) => props.theme.space.xxxs};\n width: 100%;\n min-width: ${(props) => props.theme.space.xl};\n border-radius: ${(props) => props.theme.space.xxxs};\n background: ${(props) =>\n props.disabled || props.applyAriaDisabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.multiple\n ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })<{ isActive: boolean }>`\n &:after {\n content: '';\n background: ${(props) => (props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400])};\n border-radius: ${(props) => props.theme.space.xxxs};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nexport const StyledDotsContainer = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT_CONTAINER })`\n padding: 0 2px;\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip - 1};\n`;\n\nexport const StyledTickMarkValue = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TICK_MARK_VALUE })<{\n isSelected: boolean;\n}>`\n display: flex;\n justify-content: center;\n text-align: center;\n min-height: ${(props) => props.theme.space.xs};\n overflow: visible;\n width: ${(props) => props.theme.space.xxxs};\n color: ${(props) => (props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500])};\n`;\n\nexport const StyledTickMarksContainer = styled('div', {\n name: DSSliderV2Name,\n slot: SLIDER_V2_SLOTS.TICK_MARK_CONTAINER,\n})`\n display: flex;\n justify-content: space-between;\n // this next property-value reverts the sanitize.css value\n overflow-wrap: normal;\n`;\n\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n}>`\n height: 20px;\n width: 20px;\n top: 0;\n background-color: ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid\n ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};\n\n :focus {\n border: 2px solid brand-700;\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : undefined)};\n\n z-index: ${(props) => props.theme.zIndex.tooltip};\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,S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sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getTrackBackground } from 'react-range';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';\n\nexport const StyledWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.ROOT })``;\n\nexport const StyledRangeWrapper = styled(Grid, { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.RANGE_WRAPPER })``;\n\nexport const StyledTrack = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TRACK })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n multiple: boolean;\n minValue: number;\n maxValue: number;\n rangeValues: [number] | [number, number];\n}>`\n position: relative;\n height: ${(props) => props.theme.space.xxxs};\n width: 100%;\n min-width: ${(props) => props.theme.space.xl};\n border-radius: ${(props) => props.theme.space.xxxs};\n background: ${(props) =>\n props.disabled || props.applyAriaDisabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.multiple\n ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport const StyledDot = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT })<{ isActive: boolean }>`\n &:after {\n content: '';\n background: ${(props) => (props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400])};\n border-radius: ${(props) => props.theme.space.xxxs};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nexport const StyledDotsContainer = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.DOT_CONTAINER })`\n padding: 0 2px;\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.theme.zIndex.tooltip - 1};\n`;\n\nexport const StyledTickMarkValue = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.TICK_MARK_VALUE })<{\n isSelected: boolean;\n}>`\n display: flex;\n justify-content: center;\n text-align: center;\n min-height: ${(props) => props.theme.space.xs};\n overflow: visible;\n 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\nexport const StyledThumb = styled('div', { name: DSSliderV2Name, slot: SLIDER_V2_SLOTS.THUMB })<{\n disabled: boolean;\n applyAriaDisabled: boolean;\n}>`\n height: 20px;\n width: 20px;\n top: 0;\n background-color: ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid\n ${(props) =>\n props.disabled || props.applyAriaDisabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};\n\n :focus {\n border: 2px solid brand-700;\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, applyAriaDisabled, theme }) =>\n disabled || applyAriaDisabled ? theme.colors.neutral[100] : theme.colors.brand[200]};\n }\n\n cursor: ${({ disabled, applyAriaDisabled }) => (disabled || applyAriaDisabled ? 'not-allowed' : undefined)};\n\n z-index: ${(props) => props.theme.zIndex.tooltip};\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,gBAAgB,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UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { XstyledProps } from '@elliemae/ds-props-helpers';
2
3
  import { type DSSliderV2T } from '../react-desc-prop-types.js';
3
4
  export interface DSSliderV2CTX<TMultiple extends boolean> {
@@ -8,6 +9,8 @@ export interface DSSliderV2CTX<TMultiple extends boolean> {
8
9
  tickMarkPositions: number[];
9
10
  getOwnerProps: () => DSSliderV2T.InternalProps<TMultiple>;
10
11
  getOwnerPropsArguments: () => Record<string, unknown>;
12
+ hasUserInteractedAfterFocus: boolean;
13
+ setHasUserInteractedAfterFocus: (value: boolean) => void;
11
14
  }
12
15
  export declare const useSliderV2: <TMultiple extends boolean>(propsFromUser: DSSliderV2T.Props<TMultiple>) => {
13
16
  getOwnerProps: () => DSSliderV2T.InternalProps<TMultiple>;
@@ -17,4 +20,6 @@ export declare const useSliderV2: <TMultiple extends boolean>(propsFromUser: DSS
17
20
  instanceUid: string;
18
21
  rangeValues: [number, number] | [number];
19
22
  tickMarkPositions: number[];
23
+ hasUserInteractedAfterFocus: boolean;
24
+ setHasUserInteractedAfterFocus: React.Dispatch<React.SetStateAction<boolean>>;
20
25
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="prop-types" />
2
- import type { DSPropTypesSchema, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';
2
+ import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';
3
3
  import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
4
4
  import { DSSliderV2Name, SLIDER_V2_SLOTS } from './constants/index.js';
5
5
  export declare namespace DSSliderV2T {
@@ -23,9 +23,9 @@ export declare namespace DSSliderV2T {
23
23
  interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSSliderV2Name, typeof SLIDER_V2_SLOTS> {
24
24
  className?: string;
25
25
  }
26
- interface Props<TMultiple extends boolean = false> extends Partial<DefaultProps<TMultiple>>, OptionalProps, XstyledProps, RequiredProps<TMultiple> {
26
+ interface Props<TMultiple extends boolean = false> extends Partial<DefaultProps<TMultiple>>, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>, XstyledProps, RequiredProps<TMultiple> {
27
27
  }
28
- interface InternalProps<TMultiple extends boolean = false> extends DefaultProps<TMultiple>, OptionalProps, XstyledProps, RequiredProps<TMultiple> {
28
+ interface InternalProps<TMultiple extends boolean = false> extends DefaultProps<TMultiple>, OptionalProps, Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps<TMultiple> | keyof XstyledProps | 'value'>, XstyledProps, RequiredProps<TMultiple> {
29
29
  }
30
30
  }
31
31
  export declare const defaultProps: DSSliderV2T.DefaultProps<boolean>;
@@ -16,7 +16,10 @@ export declare const StyledDotsContainer: import("styled-components").StyledComp
16
16
  export declare const StyledTickMarkValue: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
17
17
  isSelected: boolean;
18
18
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
19
- export declare const StyledTickMarksContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
19
+ export declare const StyledTickMarksContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
20
+ columnCount: number;
21
+ columnWidth: string;
22
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
20
23
  export declare const StyledThumb: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
21
24
  disabled: boolean;
22
25
  applyAriaDisabled: boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-slider-v2",
3
- "version": "3.52.0-rc.9",
3
+ "version": "3.52.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Slider V 2",
6
6
  "files": [
@@ -38,25 +38,25 @@
38
38
  "dependencies": {
39
39
  "react-range": "~1.8.14",
40
40
  "uid": "^2.0.2",
41
- "@elliemae/ds-grid": "3.52.0-rc.9",
42
- "@elliemae/ds-typescript-helpers": "3.52.0-rc.9",
43
- "@elliemae/ds-tooltip-v3": "3.52.0-rc.9",
44
- "@elliemae/ds-system": "3.52.0-rc.9",
45
- "@elliemae/ds-props-helpers": "3.52.0-rc.9",
46
- "@elliemae/ds-truncated-tooltip-text": "3.52.0-rc.9"
41
+ "@elliemae/ds-grid": "3.52.0",
42
+ "@elliemae/ds-props-helpers": "3.52.0",
43
+ "@elliemae/ds-system": "3.52.0",
44
+ "@elliemae/ds-tooltip-v3": "3.52.0",
45
+ "@elliemae/ds-truncated-tooltip-text": "3.52.0",
46
+ "@elliemae/ds-typescript-helpers": "3.52.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@elliemae/pui-cli": "9.0.0-next.55",
49
+ "@elliemae/pui-cli": "9.0.0-next.63",
50
50
  "jest": "~29.7.0",
51
- "lodash": "^4.17.21",
51
+ "lodash-es": "^4.17.21",
52
52
  "styled-components": "~5.3.9",
53
- "@elliemae/ds-monorepo-devops": "3.52.0-rc.9"
53
+ "@elliemae/ds-monorepo-devops": "3.52.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@testing-library/jest-dom": "^6.6.3",
57
57
  "@testing-library/react": "^16.0.1",
58
58
  "@testing-library/user-event": "~14.5.2",
59
- "lodash": "^4.17.21",
59
+ "lodash-es": "^4.17.21",
60
60
  "react": "^18.3.1",
61
61
  "react-dom": "^18.3.1",
62
62
  "styled-components": "~5.3.9"