@salutejs/plasma-new-hope 0.83.0-canary.1194.9174145281.0 → 0.83.0-canary.1208.9173239801.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/hooks/useFocusController.js +0 -1
- package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Range/Range.css +63 -0
- package/cjs/components/Range/Range.js +146 -0
- package/cjs/components/Range/Range.js.map +1 -0
- package/cjs/components/Range/Range.styles.js +63 -0
- package/cjs/components/Range/Range.styles.js.map +1 -0
- package/cjs/components/Range/Range.styles_mc4w65.css +8 -0
- package/cjs/components/Range/Range.tokens.js +105 -0
- package/cjs/components/Range/Range.tokens.js.map +1 -0
- package/cjs/components/Range/utils/index.js +24 -0
- package/cjs/components/Range/utils/index.js.map +1 -0
- package/cjs/components/{Slider → Range}/variations/_disabled/base.js +2 -2
- package/cjs/components/Range/variations/_disabled/base.js.map +1 -0
- package/cjs/components/Range/variations/_disabled/base_1ufizo4.css +1 -0
- package/cjs/components/{Slider/variations/_view → Range/variations/_readonly}/base.js +2 -2
- package/cjs/components/Range/variations/_readonly/base.js.map +1 -0
- package/cjs/components/Range/variations/_readonly/base_hzmd8h.css +1 -0
- package/cjs/components/Range/variations/_size/base.js +9 -0
- package/cjs/components/Range/variations/_size/base.js.map +1 -0
- package/cjs/components/Range/variations/_size/base_16xiubi.css +1 -0
- package/cjs/components/{Slider/variations/_size → Range/variations/_view}/base.js +2 -2
- package/cjs/components/Range/variations/_view/base.js.map +1 -0
- package/cjs/components/Range/variations/_view/base_5iz3nr.css +1 -0
- package/cjs/components/TextField/TextField.js +6 -9
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.styles.js +13 -1
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/{TextField.styles_1b1mddp.css → TextField.styles_aqmut.css} +2 -0
- package/cjs/components/TextField/TextField.tokens.js +5 -0
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_label-placement/inner.js +1 -1
- package/cjs/components/TextField/variations/_label-placement/inner.js.map +1 -1
- package/cjs/components/TextField/variations/_label-placement/inner_7c08qb.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base.js.map +1 -1
- package/cjs/components/TextField/variations/_size/{base_1khzr9t.css → base_ntoddv.css} +1 -1
- package/cjs/components/TextField/variations/_view/base.js +1 -1
- package/cjs/components/TextField/variations/_view/base.js.map +1 -1
- package/cjs/components/TextField/variations/_view/{base_1qd77x6.css → base_19gxyva.css} +1 -1
- package/cjs/engines/common.js +0 -4
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/index.js.map +1 -1
- package/cjs/index.css +20 -26
- package/cjs/index.js +5 -14
- package/cjs/index.js.map +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Combobox/hooks/useFocusController.js +0 -1
- package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/es/components/Range/Range.css +63 -0
- package/es/components/Range/Range.js +141 -0
- package/es/components/Range/Range.js.map +1 -0
- package/es/components/Range/Range.styles.js +52 -0
- package/es/components/Range/Range.styles.js.map +1 -0
- package/es/components/Range/Range.styles_mc4w65.css +8 -0
- package/es/components/Range/Range.tokens.js +100 -0
- package/es/components/Range/Range.tokens.js.map +1 -0
- package/es/components/Range/utils/index.js +19 -0
- package/es/components/Range/utils/index.js.map +1 -0
- package/es/components/{Slider/variations/_size → Range/variations/_disabled}/base.js +2 -2
- package/es/components/Range/variations/_disabled/base.js.map +1 -0
- package/es/components/Range/variations/_disabled/base_1ufizo4.css +1 -0
- package/es/components/{Slider/variations/_view → Range/variations/_readonly}/base.js +2 -2
- package/es/components/Range/variations/_readonly/base.js.map +1 -0
- package/es/components/Range/variations/_readonly/base_hzmd8h.css +1 -0
- package/es/components/Range/variations/_size/base.js +5 -0
- package/es/components/Range/variations/_size/base.js.map +1 -0
- package/es/components/Range/variations/_size/base_16xiubi.css +1 -0
- package/es/components/{Slider/variations/_disabled → Range/variations/_view}/base.js +2 -2
- package/es/components/Range/variations/_view/base.js.map +1 -0
- package/es/components/Range/variations/_view/base_5iz3nr.css +1 -0
- package/es/components/TextField/TextField.js +7 -10
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.styles.js +12 -2
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/{TextField.styles_1b1mddp.css → TextField.styles_aqmut.css} +2 -0
- package/es/components/TextField/TextField.tokens.js +5 -0
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_label-placement/inner.js +1 -1
- package/es/components/TextField/variations/_label-placement/inner.js.map +1 -1
- package/es/components/TextField/variations/_label-placement/inner_7c08qb.css +1 -0
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base.js.map +1 -1
- package/es/components/TextField/variations/_size/{base_1khzr9t.css → base_ntoddv.css} +1 -1
- package/es/components/TextField/variations/_view/base.js +1 -1
- package/es/components/TextField/variations/_view/base.js.map +1 -1
- package/es/components/TextField/variations/_view/{base_1qd77x6.css → base_19gxyva.css} +1 -1
- package/es/engines/common.js +0 -4
- package/es/engines/common.js.map +1 -1
- package/es/engines/index.js.map +1 -1
- package/es/index.css +20 -26
- package/es/index.js +2 -8
- package/es/index.js.map +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -3
- package/styled-components/cjs/components/Range/Range.js +148 -0
- package/styled-components/cjs/components/Range/Range.styles.js +39 -0
- package/styled-components/cjs/components/Range/Range.template-doc.mdx +323 -0
- package/styled-components/cjs/components/Range/Range.tokens.js +103 -0
- package/styled-components/cjs/components/Range/index.js +25 -0
- package/styled-components/cjs/components/Range/utils/index.js +22 -0
- package/styled-components/cjs/components/{Slider → Range}/variations/_disabled/base.js +2 -1
- package/styled-components/cjs/components/Range/variations/_disabled/tokens.json +4 -0
- package/styled-components/cjs/components/Range/variations/_readonly/base.js +10 -0
- package/styled-components/cjs/components/Range/variations/_readonly/tokens.json +4 -0
- package/styled-components/cjs/components/Range/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/Range/variations/_size/tokens.json +26 -0
- package/styled-components/cjs/components/Range/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/Range/variations/_view/tokens.json +6 -0
- package/styled-components/cjs/components/TextField/TextField.js +6 -9
- package/styled-components/cjs/components/TextField/TextField.styles.js +7 -1
- package/styled-components/cjs/components/TextField/TextField.tokens.js +5 -0
- package/styled-components/cjs/components/TextField/variations/_label-placement/inner.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_view/base.js +1 -1
- package/styled-components/cjs/engines/common.js +0 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +312 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +8 -8
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +2 -0
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.stories.tsx +312 -0
- package/styled-components/cjs/hooks/index.js +1 -8
- package/styled-components/cjs/index.js +4 -4
- package/styled-components/cjs/utils/index.js +0 -7
- package/styled-components/es/components/Range/Range.js +139 -0
- package/styled-components/es/components/Range/Range.styles.js +31 -0
- package/styled-components/es/components/Range/Range.template-doc.mdx +323 -0
- package/styled-components/es/components/Range/Range.tokens.js +97 -0
- package/styled-components/es/components/Range/index.js +2 -0
- package/styled-components/es/components/Range/utils/index.js +16 -0
- package/styled-components/es/components/Range/variations/_disabled/base.js +3 -0
- package/styled-components/es/components/Range/variations/_disabled/tokens.json +4 -0
- package/styled-components/es/components/Range/variations/_readonly/base.js +4 -0
- package/styled-components/es/components/Range/variations/_readonly/tokens.json +4 -0
- package/styled-components/es/components/Range/variations/_size/base.js +4 -0
- package/styled-components/es/components/Range/variations/_size/tokens.json +26 -0
- package/styled-components/es/components/Range/variations/_view/base.js +4 -0
- package/styled-components/es/components/Range/variations/_view/tokens.json +6 -0
- package/styled-components/es/components/TextField/TextField.js +7 -10
- package/styled-components/es/components/TextField/TextField.styles.js +6 -0
- package/styled-components/es/components/TextField/TextField.tokens.js +5 -0
- package/styled-components/es/components/TextField/variations/_label-placement/inner.js +2 -2
- package/styled-components/es/components/TextField/variations/_size/base.js +2 -2
- package/styled-components/es/components/TextField/variations/_view/base.js +2 -2
- package/styled-components/es/engines/common.js +0 -4
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.stories.tsx +312 -0
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +8 -8
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +2 -0
- package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/Range/Range.js +5 -0
- package/styled-components/es/examples/plasma_web/components/Range/Range.stories.tsx +312 -0
- package/styled-components/es/hooks/index.js +1 -2
- package/styled-components/es/index.js +1 -1
- package/styled-components/es/utils/index.js +0 -1
- package/types/components/Range/Range.d.ts +31 -0
- package/types/components/Range/Range.d.ts.map +1 -0
- package/types/components/{Slider/components/Double/Double.styles.d.ts → Range/Range.styles.d.ts} +15 -10
- package/types/components/Range/Range.styles.d.ts.map +1 -0
- package/types/components/Range/Range.tokens.d.ts +98 -0
- package/types/components/Range/Range.tokens.d.ts.map +1 -0
- package/types/components/Range/Range.types.d.ts +143 -0
- package/types/components/Range/Range.types.d.ts.map +1 -0
- package/types/components/Range/index.d.ts +4 -0
- package/types/components/Range/index.d.ts.map +1 -0
- package/types/components/Range/utils/index.d.ts +5 -0
- package/types/components/Range/utils/index.d.ts.map +1 -0
- package/types/components/Range/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/Range/variations/_readonly/base.d.ts.map +1 -0
- package/types/components/Range/variations/_size/base.d.ts.map +1 -0
- package/types/components/Range/variations/_view/base.d.ts +2 -0
- package/types/components/Range/variations/_view/base.d.ts.map +1 -0
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +2 -0
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +5 -0
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +8 -0
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/variations/_label-placement/inner.d.ts.map +1 -1
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -1
- package/types/components/TextField/variations/_view/base.d.ts.map +1 -1
- package/types/engines/common.d.ts +3 -3
- package/types/engines/common.d.ts.map +1 -1
- package/types/engines/index.d.ts +1 -1
- package/types/engines/index.d.ts.map +1 -1
- package/types/engines/types.d.ts +0 -4
- package/types/engines/types.d.ts.map +1 -1
- package/types/examples/{plasma_web/components/Slider/Slider.config.d.ts → plasma_b2c/components/Range/Range.config.d.ts} +5 -3
- package/types/examples/plasma_b2c/components/Range/Range.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Range/Range.d.ts +127 -0
- package/types/examples/plasma_b2c/components/Range/Range.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +4 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/{plasma_b2c/components/Slider/Slider.config.d.ts → plasma_web/components/Range/Range.config.d.ts} +5 -3
- package/types/examples/plasma_web/components/Range/Range.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Range/Range.d.ts +127 -0
- package/types/examples/plasma_web/components/Range/Range.d.ts.map +1 -0
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +4 -0
- package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/TextField/TextField.d.ts +4 -0
- package/types/examples/sds_engineer/components/TextField/TextField.d.ts.map +1 -1
- package/types/hooks/index.d.ts +0 -1
- package/types/hooks/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Slider/Slider.css +0 -69
- package/cjs/components/Slider/Slider.js +0 -48
- package/cjs/components/Slider/Slider.js.map +0 -1
- package/cjs/components/Slider/Slider.tokens.js +0 -79
- package/cjs/components/Slider/Slider.tokens.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.css +0 -62
- package/cjs/components/Slider/components/Double/Double.js +0 -306
- package/cjs/components/Slider/components/Double/Double.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.styles.js +0 -61
- package/cjs/components/Slider/components/Double/Double.styles.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.styles_1jhda4u.css +0 -7
- package/cjs/components/Slider/components/Single/Single.css +0 -16
- package/cjs/components/Slider/components/Single/Single.js +0 -164
- package/cjs/components/Slider/components/Single/Single.js.map +0 -1
- package/cjs/components/Slider/components/Single/Single.styles.js +0 -45
- package/cjs/components/Slider/components/Single/Single.styles.js.map +0 -1
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +0 -4
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +0 -82
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +0 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +0 -33
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +0 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +0 -4
- package/cjs/components/Slider/ui/Handler/Handler.css +0 -4
- package/cjs/components/Slider/ui/Handler/Handler.js +0 -167
- package/cjs/components/Slider/ui/Handler/Handler.js.map +0 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles.js +0 -21
- package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +0 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
- package/cjs/components/Slider/ui/Thumb/Thumb.css +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.js +0 -31
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +0 -15
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
- package/cjs/components/Slider/utils/index.js +0 -56
- package/cjs/components/Slider/utils/index.js.map +0 -1
- package/cjs/components/Slider/variations/_disabled/base.js.map +0 -1
- package/cjs/components/Slider/variations/_disabled/base_x642ct.css +0 -1
- package/cjs/components/Slider/variations/_size/base.js.map +0 -1
- package/cjs/components/Slider/variations/_size/base_x642ct.css +0 -1
- package/cjs/components/Slider/variations/_view/base.js.map +0 -1
- package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
- package/cjs/components/TextField/variations/_label-placement/inner_gqlcj2.css +0 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -15
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/cjs/utils/canUseDOM.js +0 -12
- package/cjs/utils/canUseDOM.js.map +0 -1
- package/es/components/Slider/Slider.css +0 -69
- package/es/components/Slider/Slider.js +0 -43
- package/es/components/Slider/Slider.js.map +0 -1
- package/es/components/Slider/Slider.tokens.js +0 -74
- package/es/components/Slider/Slider.tokens.js.map +0 -1
- package/es/components/Slider/components/Double/Double.css +0 -62
- package/es/components/Slider/components/Double/Double.js +0 -302
- package/es/components/Slider/components/Double/Double.js.map +0 -1
- package/es/components/Slider/components/Double/Double.styles.js +0 -51
- package/es/components/Slider/components/Double/Double.styles.js.map +0 -1
- package/es/components/Slider/components/Double/Double.styles_1jhda4u.css +0 -7
- package/es/components/Slider/components/Single/Single.css +0 -16
- package/es/components/Slider/components/Single/Single.js +0 -160
- package/es/components/Slider/components/Single/Single.js.map +0 -1
- package/es/components/Slider/components/Single/Single.styles.js +0 -36
- package/es/components/Slider/components/Single/Single.styles.js.map +0 -1
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/es/components/Slider/components/SliderBase/SliderBase.css +0 -4
- package/es/components/Slider/components/SliderBase/SliderBase.js +0 -78
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +0 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +0 -26
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +0 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +0 -4
- package/es/components/Slider/ui/Handler/Handler.css +0 -4
- package/es/components/Slider/ui/Handler/Handler.js +0 -163
- package/es/components/Slider/ui/Handler/Handler.js.map +0 -1
- package/es/components/Slider/ui/Handler/Handler.styles.js +0 -16
- package/es/components/Slider/ui/Handler/Handler.styles.js.map +0 -1
- package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
- package/es/components/Slider/ui/Thumb/Thumb.css +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.js +0 -27
- package/es/components/Slider/ui/Thumb/Thumb.js.map +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +0 -11
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
- package/es/components/Slider/utils/index.js +0 -50
- package/es/components/Slider/utils/index.js.map +0 -1
- package/es/components/Slider/variations/_disabled/base.js.map +0 -1
- package/es/components/Slider/variations/_disabled/base_x642ct.css +0 -1
- package/es/components/Slider/variations/_size/base.js.map +0 -1
- package/es/components/Slider/variations/_size/base_x642ct.css +0 -1
- package/es/components/Slider/variations/_view/base.js.map +0 -1
- package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
- package/es/components/TextField/variations/_label-placement/inner_gqlcj2.css +0 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +0 -11
- package/es/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/es/utils/canUseDOM.js +0 -8
- package/es/utils/canUseDOM.js.map +0 -1
- package/styled-components/cjs/components/Slider/Slider.js +0 -47
- package/styled-components/cjs/components/Slider/Slider.tokens.js +0 -77
- package/styled-components/cjs/components/Slider/components/Double/Double.js +0 -318
- package/styled-components/cjs/components/Slider/components/Double/Double.styles.js +0 -36
- package/styled-components/cjs/components/Slider/components/Double/Double.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/Single/Single.js +0 -176
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +0 -27
- package/styled-components/cjs/components/Slider/components/Single/Single.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +0 -83
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +0 -21
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/index.js +0 -27
- package/styled-components/cjs/components/Slider/index.js +0 -32
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +0 -176
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +0 -15
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.types.js +0 -5
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +0 -32
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +0 -18
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.types.js +0 -5
- package/styled-components/cjs/components/Slider/ui/index.js +0 -63
- package/styled-components/cjs/components/Slider/utils/index.js +0 -55
- package/styled-components/cjs/components/Slider/variations/_disabled/tokens.json +0 -4
- package/styled-components/cjs/components/Slider/variations/_size/base.js +0 -8
- package/styled-components/cjs/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/Slider/variations/_view/base.js +0 -8
- package/styled-components/cjs/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +0 -29
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.js +0 -16
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +0 -169
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +0 -29
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.js +0 -16
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +0 -168
- package/styled-components/cjs/hooks/useIsomorphicLayoutEffect.js +0 -12
- package/styled-components/cjs/utils/canUseDOM.js +0 -11
- package/styled-components/es/components/Slider/Slider.js +0 -38
- package/styled-components/es/components/Slider/Slider.tokens.js +0 -71
- package/styled-components/es/components/Slider/components/Double/Double.js +0 -310
- package/styled-components/es/components/Slider/components/Double/Double.styles.js +0 -29
- package/styled-components/es/components/Slider/components/Double/Double.types.js +0 -1
- package/styled-components/es/components/Slider/components/Single/Single.js +0 -168
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +0 -20
- package/styled-components/es/components/Slider/components/Single/Single.types.js +0 -1
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +0 -74
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +0 -14
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.types.js +0 -1
- package/styled-components/es/components/Slider/components/index.js +0 -3
- package/styled-components/es/components/Slider/index.js +0 -3
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +0 -167
- package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +0 -8
- package/styled-components/es/components/Slider/ui/Handler/Handler.types.js +0 -1
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +0 -25
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +0 -11
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.types.js +0 -1
- package/styled-components/es/components/Slider/ui/index.js +0 -5
- package/styled-components/es/components/Slider/utils/index.js +0 -47
- package/styled-components/es/components/Slider/variations/_disabled/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_disabled/tokens.json +0 -4
- package/styled-components/es/components/Slider/variations/_size/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/Slider/variations/_view/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +0 -23
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.js +0 -10
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +0 -169
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +0 -23
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.js +0 -10
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +0 -168
- package/styled-components/es/hooks/useIsomorphicLayoutEffect.js +0 -7
- package/styled-components/es/utils/canUseDOM.js +0 -5
- package/types/components/Slider/Slider.d.ts +0 -27
- package/types/components/Slider/Slider.d.ts.map +0 -1
- package/types/components/Slider/Slider.tokens.d.ts +0 -72
- package/types/components/Slider/Slider.tokens.d.ts.map +0 -1
- package/types/components/Slider/Slider.types.d.ts +0 -3
- package/types/components/Slider/Slider.types.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.d.ts +0 -4
- package/types/components/Slider/components/Double/Double.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.types.d.ts +0 -65
- package/types/components/Slider/components/Double/Double.types.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.d.ts +0 -4
- package/types/components/Slider/components/Single/Single.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts +0 -8
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.types.d.ts +0 -55
- package/types/components/Slider/components/Single/Single.types.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts +0 -4
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +0 -6
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +0 -45
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +0 -1
- package/types/components/Slider/components/index.d.ts +0 -6
- package/types/components/Slider/components/index.d.ts.map +0 -1
- package/types/components/Slider/index.d.ts +0 -6
- package/types/components/Slider/index.d.ts.map +0 -1
- package/types/components/Slider/ui/Handler/Handler.d.ts +0 -9
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +0 -1
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts +0 -4
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +0 -1
- package/types/components/Slider/ui/Handler/Handler.types.d.ts +0 -24
- package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +0 -4
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts +0 -5
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +0 -12
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +0 -1
- package/types/components/Slider/ui/index.d.ts +0 -6
- package/types/components/Slider/ui/index.d.ts.map +0 -1
- package/types/components/Slider/utils/index.d.ts +0 -33
- package/types/components/Slider/utils/index.d.ts.map +0 -1
- package/types/components/Slider/variations/_disabled/base.d.ts.map +0 -1
- package/types/components/Slider/variations/_size/base.d.ts.map +0 -1
- package/types/components/Slider/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +0 -21
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +0 -21
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +0 -1
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +0 -6
- package/types/hooks/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/types/utils/canUseDOM.d.ts +0 -6
- package/types/utils/canUseDOM.d.ts.map +0 -1
- /package/styled-components/cjs/components/{Slider/Slider.types.js → Range/Range.types.js} +0 -0
- /package/styled-components/es/components/{Slider/Slider.types.js → Range/Range.types.js} +0 -0
- /package/types/components/{Slider → Range}/variations/_disabled/base.d.ts +0 -0
- /package/types/components/{Slider/variations/_size → Range/variations/_readonly}/base.d.ts +0 -0
- /package/types/components/{Slider/variations/_view → Range/variations/_size}/base.d.ts +0 -0
@@ -1,27 +0,0 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import React from 'react';
|
3
|
-
import { ThumbBase } from './Thumb.styles.js';
|
4
|
-
|
5
|
-
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"];
|
6
|
-
var Thumb = function Thumb(_ref) {
|
7
|
-
var min = _ref.min,
|
8
|
-
max = _ref.max,
|
9
|
-
value = _ref.value,
|
10
|
-
_ref$ariaValueMin = _ref.ariaValueMin,
|
11
|
-
ariaValueMin = _ref$ariaValueMin === void 0 ? min : _ref$ariaValueMin,
|
12
|
-
ariaLabel = _ref.ariaLabel,
|
13
|
-
disabled = _ref.disabled,
|
14
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
15
|
-
return /*#__PURE__*/React.createElement(ThumbBase, _extends({
|
16
|
-
role: "slider",
|
17
|
-
"aria-label": ariaLabel,
|
18
|
-
"aria-valuemin": ariaValueMin,
|
19
|
-
"aria-valuemax": max,
|
20
|
-
"aria-valuenow": value,
|
21
|
-
disabled: disabled,
|
22
|
-
"aria-orientation": "horizontal"
|
23
|
-
}, rest));
|
24
|
-
};
|
25
|
-
|
26
|
-
export { Thumb };
|
27
|
-
//# sourceMappingURL=Thumb.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Thumb.js","sources":["../../../../../src/components/Slider/ui/Thumb/Thumb.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { ThumbProps } from './Thumb.types';\nimport { ThumbBase } from './Thumb.styles';\n\nexport const Thumb = ({ min, max, value, ariaValueMin = min, ariaLabel, disabled, ...rest }: ThumbProps) => {\n return (\n <ThumbBase\n role=\"slider\"\n aria-label={ariaLabel}\n aria-valuemin={ariaValueMin}\n aria-valuemax={max}\n aria-valuenow={value}\n disabled={disabled}\n aria-orientation=\"horizontal\"\n {...rest}\n />\n );\n};\n"],"names":["Thumb","_ref","min","max","value","_ref$ariaValueMin","ariaValueMin","ariaLabel","disabled","rest","_objectWithoutProperties","_excluded","React","createElement","ThumbBase","_extends","role"],"mappings":";;;;;IAKaA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAA0F;AAAA,EAAA,IAApFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAAC,iBAAA,GAAAJ,IAAA,CAAEK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGH,KAAAA,CAAAA,GAAAA,GAAG,GAAAG,iBAAA;IAAEE,SAAS,GAAAN,IAAA,CAATM,SAAS;IAAEC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA,CAAA;AACrF,EAAA,oBACIC,KAAA,CAAAC,aAAA,CAACC,SAAS,EAAAC,QAAA,CAAA;AACNC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYT,SAAU;AACtB,IAAA,eAAA,EAAeD,YAAa;AAC5B,IAAA,eAAA,EAAeH,GAAI;AACnB,IAAA,eAAA,EAAeC,KAAM;AACrBI,IAAAA,QAAQ,EAAEA,QAAS;IACnB,kBAAiB,EAAA,YAAA;GACbC,EAAAA,IAAI,CACX,CAAC,CAAA;AAEV;;;;"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import './Thumb.styles_4w4gzn.css';
|
2
|
-
import { styled } from '@linaria/react';
|
3
|
-
|
4
|
-
var ThumbBase = /*#__PURE__*/styled('div')({
|
5
|
-
name: "ThumbBase",
|
6
|
-
"class": "tqbdf8b",
|
7
|
-
propsAsIs: false
|
8
|
-
});
|
9
|
-
|
10
|
-
export { ThumbBase };
|
11
|
-
//# sourceMappingURL=Thumb.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Thumb.styles.js","sources":["../../../../../src/components/Slider/ui/Thumb/Thumb.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { addFocus } from '../../../../mixins';\nimport { tokens } from '../../Slider.tokens';\n\nexport const ThumbBase = styled.div<{ disabled?: boolean }>`\n width: var(${tokens.thumbSize});\n height: var(${tokens.thumbSize});\n position: relative;\n left: -0.125rem;\n top: -0.125rem;\n border-radius: 50%;\n box-sizing: border-box;\n background: var(${tokens.thumbBackgroundColor});\n margin: 0.125rem;\n transition: border-color 0.1s ease-in-out;\n\n &:after {\n background: var(${tokens.thumbBorderColor});\n margin: -0.125rem;\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n }\n\n &:not([disabled]):hover:after,\n &:not([disabled]):active:after {\n background: var(${tokens.thumbFocusBorderColor});\n }\n\n &[disabled] {\n cursor: not-allowed;\n }\n\n &:focus {\n outline: none;\n }\n\n ${addFocus({\n outlineOffset: '0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '50%',\n outlineColor: `var(${tokens.thumbFocusBorderColor})`,\n })}\n`;\n"],"names":["ThumbBase","styled","name","class","propsAsIs"],"mappings":";;AAKO,IAAMA,SAAS,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAyC9B;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.tqbdf8b{width:var(--plasma-slider-thumb-size);height:var(--plasma-slider-thumb-size);position:relative;left:-0.125rem;top:-0.125rem;border-radius:50%;box-sizing:border-box;background:var(--plasma-slider-thumb-background-color);margin:0.125rem;-webkit-transition:border-color 0.1s ease-in-out;transition:border-color 0.1s ease-in-out;position:relative;}.tqbdf8b:after{background:var(--plasma-slider-thumb-border-color);margin:-0.125rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}.tqbdf8b:not([disabled]):hover:after,.tqbdf8b:not([disabled]):active:after{background:var(--plasma-slider-thumb-focus-border-color);}.tqbdf8b[disabled]{cursor:not-allowed;}.tqbdf8b:focus{outline:none;}.tqbdf8b::before{content:'';position:absolute;top:0.125rem;left:0.125rem;right:0.125rem;bottom:0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.125rem solid transparent;border-radius:50%;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.tqbdf8b.focus-visible:focus::before,.tqbdf8b[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.125rem var(--plasma-slider-thumb-focus-border-color);}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Расчитать значение слайдера с учетом его координат и шага изменений.
|
3
|
-
* @param {number} handleCenterXRelative
|
4
|
-
* @param {number} stepSize
|
5
|
-
* @param {number} min
|
6
|
-
* @param {number} max
|
7
|
-
* @return {number}
|
8
|
-
*/
|
9
|
-
function getSliderThumbValue(handleCenterXRelative, stepSize, min, max) {
|
10
|
-
var newValue = Math.round(handleCenterXRelative / stepSize) + min;
|
11
|
-
return Math.min(Math.max(newValue, min), max);
|
12
|
-
}
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.
|
16
|
-
* Значение используется для правильного расчета ограничения движения слайдера.
|
17
|
-
* @param ref
|
18
|
-
* @param {'left' | 'right'} side
|
19
|
-
* @return Array<number>
|
20
|
-
*/
|
21
|
-
function getOffsets(ref, side) {
|
22
|
-
if (!ref || !('current' in ref) || !ref.current || !side) {
|
23
|
-
return [0, 0];
|
24
|
-
}
|
25
|
-
var size = ref.current.clientWidth;
|
26
|
-
if (side === 'left') {
|
27
|
-
return [0, size];
|
28
|
-
}
|
29
|
-
if (side === 'right') {
|
30
|
-
return [size, 0];
|
31
|
-
}
|
32
|
-
return [0, 0];
|
33
|
-
}
|
34
|
-
var sizeData = {
|
35
|
-
s: {
|
36
|
-
indent: 0.5,
|
37
|
-
fontSizeMultiplier: 16
|
38
|
-
},
|
39
|
-
m: {
|
40
|
-
indent: 0.75,
|
41
|
-
fontSizeMultiplier: 16
|
42
|
-
},
|
43
|
-
l: {
|
44
|
-
indent: 0.75,
|
45
|
-
fontSizeMultiplier: 16
|
46
|
-
}
|
47
|
-
};
|
48
|
-
|
49
|
-
export { getOffsets, getSliderThumbValue, sizeData };
|
50
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Slider/utils/index.ts"],"sourcesContent":["import { MutableRefObject } from 'react';\n\n/**\n * Расчитать значение слайдера с учетом его координат и шага изменений.\n * @param {number} handleCenterXRelative\n * @param {number} stepSize\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport function getSliderThumbValue(handleCenterXRelative: number, stepSize: number, min: number, max: number) {\n const newValue = Math.round(handleCenterXRelative / stepSize) + min;\n\n return Math.min(Math.max(newValue, min), max);\n}\n\n/**\n * Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.\n * Значение используется для правильного расчета ограничения движения слайдера.\n * @param ref\n * @param {'left' | 'right'} side\n * @return Array<number>\n */\nexport function getOffsets(\n ref: ((instance: HTMLDivElement | null) => void) | MutableRefObject<HTMLDivElement | null> | null,\n side?: 'left' | 'right',\n): number[] {\n if (!ref || !('current' in ref) || !ref.current || !side) {\n return [0, 0];\n }\n\n const size = ref.current.clientWidth;\n\n if (side === 'left') {\n return [0, size];\n }\n\n if (side === 'right') {\n return [size, 0];\n }\n\n return [0, 0];\n}\n\nexport const sizeData = {\n s: {\n indent: 0.5,\n fontSizeMultiplier: 16,\n },\n m: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n l: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n};\n"],"names":["getSliderThumbValue","handleCenterXRelative","stepSize","min","max","newValue","Math","round","getOffsets","ref","side","current","size","clientWidth","sizeData","s","indent","fontSizeMultiplier","m","l"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAACC,qBAA6B,EAAEC,QAAgB,EAAEC,GAAW,EAAEC,GAAW,EAAE;EAC3G,IAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACN,qBAAqB,GAAGC,QAAQ,CAAC,GAAGC,GAAG,CAAA;AAEnE,EAAA,OAAOG,IAAI,CAACH,GAAG,CAACG,IAAI,CAACF,GAAG,CAACC,QAAQ,EAAEF,GAAG,CAAC,EAAEC,GAAG,CAAC,CAAA;AACjD,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CACtBC,GAAiG,EACjGC,IAAuB,EACf;AACR,EAAA,IAAI,CAACD,GAAG,IAAI,EAAE,SAAS,IAAIA,GAAG,CAAC,IAAI,CAACA,GAAG,CAACE,OAAO,IAAI,CAACD,IAAI,EAAE;AACtD,IAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,GAAA;AAEA,EAAA,IAAME,IAAI,GAAGH,GAAG,CAACE,OAAO,CAACE,WAAW,CAAA;EAEpC,IAAIH,IAAI,KAAK,MAAM,EAAE;AACjB,IAAA,OAAO,CAAC,CAAC,EAAEE,IAAI,CAAC,CAAA;AACpB,GAAA;EAEA,IAAIF,IAAI,KAAK,OAAO,EAAE;AAClB,IAAA,OAAO,CAACE,IAAI,EAAE,CAAC,CAAC,CAAA;AACpB,GAAA;AAEA,EAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,CAAA;AAEO,IAAME,QAAQ,GAAG;AACpBC,EAAAA,CAAC,EAAE;AACCC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDC,EAAAA,CAAC,EAAE;AACCF,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDE,EAAAA,CAAC,EAAE;AACCH,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;AACxB,GAAA;AACJ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_disabled/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_size/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_view/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
.l8oinlg .io4bpie{padding:var(--plasma-textfield-placement_inner__content-padding);}.l8oinlg .io4bpie:focus ~ .l13qvwoy,.l8oinlg .io4bpie:not(:placeholder-shown) ~ .l13qvwoy{height:auto;padding:var(--plasma-textfield-placement_inner__label-padding);font-family:var(--plasma-textfield-placement_inner__label-font-family);font-size:var(--plasma-textfield-placement_inner__label-font-size);font-style:var(--plasma-textfield-placement_inner__label-font-style);font-weight:var(--plasma-textfield-placement_inner__label-font-weight);-webkit-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);line-height:var(--plasma-textfield-placement_inner__label-line-height);}.l8oinlg .io4bpie:not(:focus)::-webkit-input-placeholder{color:transparent;}.l8oinlg .io4bpie:not(:focus)::-moz-placeholder{color:transparent;}.l8oinlg .io4bpie:not(:focus):-ms-input-placeholder{color:transparent;}.l8oinlg .io4bpie:not(:focus)::placeholder{color:transparent;}.l8oinlg .io4bpie:focus::-webkit-input-placeholder{color:transparent;}.l8oinlg .io4bpie:focus::-moz-placeholder{color:transparent;}.l8oinlg .io4bpie:focus:-ms-input-placeholder{color:transparent;}.l8oinlg .io4bpie:focus::placeholder{color:transparent;}.l8oinlg .l13qvwoy{color:var(--plasma-textfield__placeholder-color);pointer-events:none;position:absolute;top:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-transition:padding 0.1s ease-in-out,height 0s;transition:padding 0.1s ease-in-out,height 0s;height:var(--plasma-textfield-height);padding-top:calc(var(--plasma-textfield-height) / 4);padding-bottom:calc(var(--plasma-textfield-height) / 4);}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { useLayoutEffect, useEffect } from 'react';
|
2
|
-
import { canUseDOM } from '../utils/canUseDOM.js';
|
3
|
-
import '../utils/react.js';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Runs effect safely on server.
|
7
|
-
*/
|
8
|
-
var useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
9
|
-
|
10
|
-
export { useIsomorphicLayoutEffect };
|
11
|
-
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nimport { canUseDOM } from '../utils';\n\n/**\n * Runs effect safely on server.\n */\nexport const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n"],"names":["useIsomorphicLayoutEffect","canUseDOM","useLayoutEffect","useEffect"],"mappings":";;;;AAIA;AACA;AACA;IACaA,yBAAyB,GAAGC,SAAS,GAAGC,eAAe,GAAGC;;;;"}
|
package/es/utils/canUseDOM.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This constant tells you whether can DOM be used.
|
3
|
-
* https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
|
4
|
-
*/
|
5
|
-
var canUseDOM = /*#__PURE__*/Boolean(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
6
|
-
|
7
|
-
export { canUseDOM };
|
8
|
-
//# sourceMappingURL=canUseDOM.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"canUseDOM.js","sources":["../../src/utils/canUseDOM.ts"],"sourcesContent":["/**\n * This constant tells you whether can DOM be used.\n * https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\n */\nexport const canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined',\n);\n"],"names":["canUseDOM","Boolean","window","document","createElement"],"mappings":"AAAA;AACA;AACA;AACA;AACO,IAAMA,SAAS,gBAAGC,OAAO,CAC5B,OAAOC,MAAM,KAAK,WAAW,IACzB,OAAOA,MAAM,CAACC,QAAQ,KAAK,WAAW,IACtC,OAAOD,MAAM,CAACC,QAAQ,CAACC,aAAa,KAAK,WACjD;;;;"}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.sliderRoot = exports.sliderConfig = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _base = /*#__PURE__*/require("./variations/_view/base");
|
10
|
-
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
11
|
-
var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
|
12
|
-
var _components = /*#__PURE__*/require("./components");
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
16
|
-
var isSingleValueProps = function isSingleValueProps(props) {
|
17
|
-
return typeof props.value === 'number';
|
18
|
-
};
|
19
|
-
var sliderRoot = exports.sliderRoot = function sliderRoot(Root) {
|
20
|
-
return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
21
|
-
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
22
|
-
ref: ref
|
23
|
-
}, props), isSingleValueProps(props) && /*#__PURE__*/_react["default"].createElement(_components.SingleSlider, props), !isSingleValueProps(props) && /*#__PURE__*/_react["default"].createElement(_components.DoubleSlider, props));
|
24
|
-
});
|
25
|
-
};
|
26
|
-
var sliderConfig = exports.sliderConfig = {
|
27
|
-
name: 'Slider',
|
28
|
-
tag: 'div',
|
29
|
-
layout: sliderRoot,
|
30
|
-
base: '',
|
31
|
-
variations: {
|
32
|
-
view: {
|
33
|
-
css: _base.base
|
34
|
-
},
|
35
|
-
size: {
|
36
|
-
css: _base2.base
|
37
|
-
},
|
38
|
-
disabled: {
|
39
|
-
css: _base3.base,
|
40
|
-
attrs: true
|
41
|
-
}
|
42
|
-
},
|
43
|
-
defaults: {
|
44
|
-
view: 'default',
|
45
|
-
size: 'm'
|
46
|
-
}
|
47
|
-
};
|
@@ -1,77 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.tokens = exports.classes = void 0;
|
7
|
-
var classes = exports.classes = {
|
8
|
-
labelPlacementOuter: 'slider-label-placement-outer',
|
9
|
-
labelPlacementInner: 'slider-label-placement-inner',
|
10
|
-
rangeValuesPlacementOuter: 'slider-range-values-placement-outer',
|
11
|
-
rangeValuesPlacementInner: 'slider-range-values-placement-inner',
|
12
|
-
maxRangeValue: 'slider-max-range-value',
|
13
|
-
hideMinValue: 'slider-hide-min-value',
|
14
|
-
hideMaxValue: 'slider-hide-max-value',
|
15
|
-
textFieldActive: 'slider-text-field-active',
|
16
|
-
firstTextField: 'slider-first-text-field',
|
17
|
-
secondTextField: 'slider-second-text-field',
|
18
|
-
activeRangeValue: 'slider-active-range-value'
|
19
|
-
};
|
20
|
-
var tokens = exports.tokens = {
|
21
|
-
height: '--plasma-slider-height',
|
22
|
-
labelWrapperGap: '--plasma-slider-label-wrapper-gap',
|
23
|
-
labelWrapperMarginBottom: '--plasma-slider-label-wrapper-margin-bottom',
|
24
|
-
labelWrapperMarginRight: '--plasma-slider-label-wrapper-margin-right',
|
25
|
-
labelColor: '--plasma-slider-label-color',
|
26
|
-
labelFontFamily: '--plasma-slider-label-font-family',
|
27
|
-
labelFontSize: '--plasma-slider-label-font-size',
|
28
|
-
labelFontStyle: '--plasma-slider-label-font-style',
|
29
|
-
labelFontWeight: '--plasma-slider-label-font-weight',
|
30
|
-
labelLetterSpacing: '--plasma-slider-label-letter-spacing',
|
31
|
-
labelLineHeight: '--plasma-slider-label-line-height',
|
32
|
-
rangeMinValueMargin: '--plasma-slider-range-min-value-margin',
|
33
|
-
rangeMaxValueMargin: '--plasma-slider-range-max-value-margin',
|
34
|
-
rangeValueBottomOffset: '--plasma-slider-range-value-bottom-offset',
|
35
|
-
rangeValueColor: '--plasma-slider-range-value-color',
|
36
|
-
rangeValueFontFamily: '--plasma-slider-range-value-font-family',
|
37
|
-
rangeValueFontSize: '--plasma-slider-range-value-font-size',
|
38
|
-
rangeValueFontStyle: '--plasma-slider-range-value-font-style',
|
39
|
-
rangeValueFontWeight: '--plasma-slider-range-value-font-weight',
|
40
|
-
rangeValueLetterSpacing: '--plasma-slider-range-value-letter-spacing',
|
41
|
-
rangeValueLineHeight: '--plasma-slider-range-value-line-height',
|
42
|
-
doubleWrapperGap: '--plasma-slider-double-wrapper-gap',
|
43
|
-
thumbSize: '--plasma-slider-thumb-size',
|
44
|
-
thumbBorder: '--plasma-slider-thumb-border',
|
45
|
-
thumbBorderColor: '--plasma-slider-thumb-border-color',
|
46
|
-
thumbBackgroundColor: '--plasma-slider-thumb-background-color',
|
47
|
-
thumbFocusBorderColor: '--plasma-slider-thumb-focus-border-color',
|
48
|
-
currentValueTopOffset: '--plasma-slider-current-value-top-offset',
|
49
|
-
currentValueFontFamily: '--plasma-slider-current-value-font-family',
|
50
|
-
currentValueFontSize: '--plasma-slider-current-value-font-size',
|
51
|
-
currentValueFontStyle: '--plasma-slider-current-value-font-style',
|
52
|
-
currentValueFontWeight: '--plasma-slider-current-value-font-weight',
|
53
|
-
currentValueLetterSpacing: '--plasma-slider-current-value-letter-spacing',
|
54
|
-
currentValueLineHeight: '--plasma-slider-current-value-line-height',
|
55
|
-
railBackgroundColor: '--plasma-slider-rail-background-color',
|
56
|
-
railHeight: '--plasma-slider-rail-height',
|
57
|
-
railBorderRadius: '--plasma-slider-rail-border-radius',
|
58
|
-
railIndent: '--plasma-slider-rail-indent',
|
59
|
-
fillColor: '--plasma-slider-fill-color',
|
60
|
-
textFieldWrapperGap: '--plasma-slider-text-field-wrapper-gap',
|
61
|
-
textFieldFontFamily: '--plasma-slider-text-field-font-family',
|
62
|
-
textFieldFontSize: '--plasma-slider-text-field-font-size',
|
63
|
-
textFieldFontStyle: '--plasma-slider-text-field-font-style',
|
64
|
-
textFieldFontWeight: '--plasma-slider-text-field-font-weight',
|
65
|
-
textFieldLetterSpacing: '--plasma-slider-text-field-letter-spacing',
|
66
|
-
textFieldLineHeight: '--plasma-slider-text-field-line-height',
|
67
|
-
textFieldHeight: '--plasma-slider-text-field-height',
|
68
|
-
textFieldPadding: '--plasma-slider-text-field-padding',
|
69
|
-
textFieldBorderRadius: '--plasma-slider-text-field-border-radius',
|
70
|
-
textFieldColor: '--plasma-slider-text-field-color',
|
71
|
-
textFieldActiveColor: '--plasma-slider-text-field-active-color',
|
72
|
-
textFieldBackgroundColor: '--plasma-slider-text-field-background-color',
|
73
|
-
textFieldCaretColor: '--plasma-slider-text-field-caret-color',
|
74
|
-
textFieldPlaceholderColor: '--plasma-slider-text-field-placeholder-color',
|
75
|
-
textFiledFocusColor: '--plasma-slider-text-field-focus-color',
|
76
|
-
disabledOpacity: '--plasma-slider-disabled-opacity'
|
77
|
-
};
|
@@ -1,318 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.DoubleSlider = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _SliderBase = /*#__PURE__*/require("../SliderBase/SliderBase");
|
10
|
-
var _ui = /*#__PURE__*/require("../../ui");
|
11
|
-
var _utils = /*#__PURE__*/require("../../utils");
|
12
|
-
var _utils2 = /*#__PURE__*/require("../../../../utils");
|
13
|
-
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
14
|
-
var _Double = /*#__PURE__*/require("./Double.styles");
|
15
|
-
var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeTextField", "onBlurTextField", "onKeyDownTextField", "onChange", "ariaLabel", "multipleStepSize"];
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
18
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
20
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
21
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
23
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
25
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
27
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
28
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
29
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
30
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
31
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
32
|
-
function getXCenterHandle(handle) {
|
33
|
-
var _handle$parentElement;
|
34
|
-
var containerX = ((_handle$parentElement = handle.parentElement) === null || _handle$parentElement === void 0 || (_handle$parentElement = _handle$parentElement.getBoundingClientRect()) === null || _handle$parentElement === void 0 ? void 0 : _handle$parentElement.x) || 0;
|
35
|
-
var handleRect = handle.getBoundingClientRect();
|
36
|
-
var handlePosition = handleRect.x;
|
37
|
-
return handlePosition - containerX;
|
38
|
-
}
|
39
|
-
var DoubleSlider = exports.DoubleSlider = function DoubleSlider(_ref) {
|
40
|
-
var min = _ref.min,
|
41
|
-
max = _ref.max,
|
42
|
-
value = _ref.value,
|
43
|
-
disabled = _ref.disabled,
|
44
|
-
label = _ref.label,
|
45
|
-
labelContentLeft = _ref.labelContentLeft,
|
46
|
-
_ref$size = _ref.size,
|
47
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
48
|
-
onChangeCommitted = _ref.onChangeCommitted,
|
49
|
-
onChangeTextField = _ref.onChangeTextField,
|
50
|
-
onBlurTextField = _ref.onBlurTextField,
|
51
|
-
onKeyDownTextField = _ref.onKeyDownTextField,
|
52
|
-
onChange = _ref.onChange,
|
53
|
-
ariaLabel = _ref.ariaLabel,
|
54
|
-
_ref$multipleStepSize = _ref.multipleStepSize,
|
55
|
-
multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
|
56
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
57
|
-
var _useState = (0, _react.useState)({
|
58
|
-
stepSize: 0,
|
59
|
-
railFillWidth: 0,
|
60
|
-
railFillXPosition: 0,
|
61
|
-
xFirstHandle: 0,
|
62
|
-
xSecondHandle: 0,
|
63
|
-
firstHandleZIndex: 100,
|
64
|
-
secondHandleZIndex: 101,
|
65
|
-
firstValue: value[0],
|
66
|
-
secondValue: value[1]
|
67
|
-
}),
|
68
|
-
_useState2 = _slicedToArray(_useState, 2),
|
69
|
-
state = _useState2[0],
|
70
|
-
setState = _useState2[1];
|
71
|
-
var _useState3 = (0, _react.useState)(false),
|
72
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
73
|
-
firstInputActive = _useState4[0],
|
74
|
-
setFirstInputActive = _useState4[1];
|
75
|
-
var _useState5 = (0, _react.useState)(false),
|
76
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
77
|
-
secondInputActive = _useState6[0],
|
78
|
-
setSecondInputActive = _useState6[1];
|
79
|
-
var _useState7 = (0, _react.useState)(value[0]),
|
80
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
81
|
-
firstValue = _useState8[0],
|
82
|
-
setFirstValue = _useState8[1];
|
83
|
-
var _useState9 = (0, _react.useState)(value[1]),
|
84
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
85
|
-
secondValue = _useState10[0],
|
86
|
-
setSecondValue = _useState10[1];
|
87
|
-
var firstHandleRef = (0, _react.useRef)(null);
|
88
|
-
var secondHandleRef = (0, _react.useRef)(null);
|
89
|
-
var firstHandleValue = (0, _react.useRef)(value[0]);
|
90
|
-
var secondHandleValue = (0, _react.useRef)(value[1]);
|
91
|
-
var stepSize = state.stepSize;
|
92
|
-
var hasLabelContent = label || labelContentLeft;
|
93
|
-
var firstInputActiveClass = firstInputActive && !disabled ? _Slider.classes.textFieldActive : undefined;
|
94
|
-
var secondInputActiveClass = secondInputActive && !disabled ? _Slider.classes.textFieldActive : undefined;
|
95
|
-
(0, _react.useEffect)(function () {
|
96
|
-
var firstLocalValue = Math.min(Math.max(value[0], min), max) - min;
|
97
|
-
var secondLocalValue = Math.min(Math.max(value[1], min), max) - min;
|
98
|
-
setFirstValue(value[0]);
|
99
|
-
setSecondValue(value[1]);
|
100
|
-
setState(function (prevState) {
|
101
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
102
|
-
railFillXPosition: stepSize * firstLocalValue,
|
103
|
-
railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,
|
104
|
-
xFirstHandle: stepSize * firstLocalValue,
|
105
|
-
xSecondHandle: stepSize * secondLocalValue
|
106
|
-
});
|
107
|
-
});
|
108
|
-
}, [value, stepSize, min, max, setFirstValue, setSecondValue]);
|
109
|
-
var setStepSize = (0, _react.useCallback)(function (newStepSize) {
|
110
|
-
setState(function (prevState) {
|
111
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
112
|
-
stepSize: newStepSize
|
113
|
-
});
|
114
|
-
});
|
115
|
-
}, [setState]);
|
116
|
-
var onFirstHandleChange = function onFirstHandleChange(handleValue, data) {
|
117
|
-
if (!(secondHandleRef !== null && secondHandleRef !== void 0 && secondHandleRef.current)) {
|
118
|
-
return;
|
119
|
-
}
|
120
|
-
var newHandleXPosition = data.x;
|
121
|
-
var secondHandleXPosition = getXCenterHandle(secondHandleRef.current);
|
122
|
-
var fillWidth = secondHandleXPosition - newHandleXPosition;
|
123
|
-
firstHandleValue.current = handleValue;
|
124
|
-
setFirstValue(handleValue);
|
125
|
-
setState(function (prevState) {
|
126
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
127
|
-
firstHandleZIndex: 101,
|
128
|
-
secondHandleZIndex: 100,
|
129
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
130
|
-
railFillXPosition: newHandleXPosition
|
131
|
-
});
|
132
|
-
});
|
133
|
-
if (onChange) {
|
134
|
-
onChange([handleValue, value[1]]);
|
135
|
-
}
|
136
|
-
};
|
137
|
-
var onFirstHandleChangeCommitted = function onFirstHandleChangeCommitted(handleValue, data) {
|
138
|
-
if (!(secondHandleRef !== null && secondHandleRef !== void 0 && secondHandleRef.current)) {
|
139
|
-
return;
|
140
|
-
}
|
141
|
-
var newHandleXPosition = data.x;
|
142
|
-
var secondHandleXPosition = getXCenterHandle(secondHandleRef.current);
|
143
|
-
var fillWidth = secondHandleXPosition - newHandleXPosition;
|
144
|
-
firstHandleValue.current = handleValue;
|
145
|
-
setFirstValue(handleValue);
|
146
|
-
if (onChangeCommitted) {
|
147
|
-
onChangeCommitted([handleValue, value[1]]);
|
148
|
-
}
|
149
|
-
setState(function (prevState) {
|
150
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
151
|
-
firstValue: handleValue,
|
152
|
-
xFirstHandle: data.x,
|
153
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
154
|
-
railFillXPosition: newHandleXPosition
|
155
|
-
});
|
156
|
-
});
|
157
|
-
};
|
158
|
-
var onFirstTextfieldChange = function onFirstTextfieldChange(event) {
|
159
|
-
if (!(0, _utils2.isNumber)(event.target.value)) {
|
160
|
-
return;
|
161
|
-
}
|
162
|
-
var handleValue = Number(event.target.value);
|
163
|
-
setFirstValue(handleValue);
|
164
|
-
if (onChangeTextField) {
|
165
|
-
onChangeTextField([handleValue, secondValue], event);
|
166
|
-
}
|
167
|
-
};
|
168
|
-
var onFirstTextfieldBlur = function onFirstTextfieldBlur(event) {
|
169
|
-
if (!(0, _utils2.isNumber)(event.target.value)) {
|
170
|
-
return;
|
171
|
-
}
|
172
|
-
var handleValue = Number(event.target.value);
|
173
|
-
setFirstValue(handleValue);
|
174
|
-
if (onBlurTextField) {
|
175
|
-
onBlurTextField && onBlurTextField([handleValue, secondValue], event);
|
176
|
-
}
|
177
|
-
};
|
178
|
-
var onSecondHandleChange = function onSecondHandleChange(handleValue, data) {
|
179
|
-
if (!(firstHandleRef !== null && firstHandleRef !== void 0 && firstHandleRef.current)) {
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
var firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);
|
183
|
-
var newHandleXPosition = data.x;
|
184
|
-
var fillWidth = newHandleXPosition - firstXHandleXPosition;
|
185
|
-
secondHandleValue.current = handleValue;
|
186
|
-
setSecondValue(handleValue);
|
187
|
-
setState(function (prevState) {
|
188
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
189
|
-
firstHandleZIndex: 100,
|
190
|
-
secondHandleZIndex: 101,
|
191
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
192
|
-
railFillXPosition: firstXHandleXPosition
|
193
|
-
});
|
194
|
-
});
|
195
|
-
if (onChange) {
|
196
|
-
onChange([value[0], handleValue]);
|
197
|
-
}
|
198
|
-
};
|
199
|
-
var onSecondHandleChangeCommitted = function onSecondHandleChangeCommitted(handleValue, data) {
|
200
|
-
if (!(firstHandleRef !== null && firstHandleRef !== void 0 && firstHandleRef.current)) {
|
201
|
-
return;
|
202
|
-
}
|
203
|
-
var firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);
|
204
|
-
var newHandleXPosition = data.x;
|
205
|
-
var fillWidth = newHandleXPosition - firstXHandleXPosition;
|
206
|
-
secondHandleValue.current = handleValue;
|
207
|
-
if (onChangeCommitted) {
|
208
|
-
onChangeCommitted([value[0], handleValue]);
|
209
|
-
}
|
210
|
-
setSecondValue(handleValue);
|
211
|
-
setState(function (prevState) {
|
212
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
213
|
-
secondValue: handleValue,
|
214
|
-
xSecondHandle: data.x,
|
215
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
216
|
-
railFillXPosition: firstXHandleXPosition
|
217
|
-
});
|
218
|
-
});
|
219
|
-
};
|
220
|
-
var onSecondTextfieldChange = function onSecondTextfieldChange(event) {
|
221
|
-
if (!(0, _utils2.isNumber)(event.target.value)) {
|
222
|
-
return;
|
223
|
-
}
|
224
|
-
var handleValue = Number(event.target.value);
|
225
|
-
setSecondValue(handleValue);
|
226
|
-
if (onChangeTextField) {
|
227
|
-
onChangeTextField([firstValue, handleValue], event);
|
228
|
-
}
|
229
|
-
};
|
230
|
-
var onSecondTextfieldBlur = function onSecondTextfieldBlur(event) {
|
231
|
-
if (!(0, _utils2.isNumber)(event.target.value)) {
|
232
|
-
return;
|
233
|
-
}
|
234
|
-
var handleValue = Number(event.target.value);
|
235
|
-
setSecondValue(handleValue);
|
236
|
-
if (onBlurTextField) {
|
237
|
-
onBlurTextField([firstValue, handleValue], event);
|
238
|
-
}
|
239
|
-
};
|
240
|
-
var onTextfieldKeyDown = function onTextfieldKeyDown(event) {
|
241
|
-
if (onKeyDownTextField) {
|
242
|
-
onKeyDownTextField([firstValue, secondValue], event);
|
243
|
-
}
|
244
|
-
};
|
245
|
-
var _ref2 = ariaLabel || [],
|
246
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
247
|
-
ariaLabelLeft = _ref3[0],
|
248
|
-
ariaLabelRight = _ref3[1];
|
249
|
-
var currentFirstSliderValue = Math.max(state.firstValue, min);
|
250
|
-
return /*#__PURE__*/_react["default"].createElement(_Double.DoubleWrapper, null, hasLabelContent && /*#__PURE__*/_react["default"].createElement(_Double.LabelWrapper, null, labelContentLeft && /*#__PURE__*/_react["default"].createElement(_Double.LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/_react["default"].createElement(_Double.Label, null, label)), /*#__PURE__*/_react["default"].createElement(_Double.SliderWrapper, null, /*#__PURE__*/_react["default"].createElement(_SliderBase.SliderBase, _extends({
|
251
|
-
min: min,
|
252
|
-
max: max,
|
253
|
-
disabled: disabled,
|
254
|
-
setStepSize: setStepSize,
|
255
|
-
railFillWidth: state.railFillWidth,
|
256
|
-
settings: _utils.sizeData[size],
|
257
|
-
railFillXPosition: state.railFillXPosition
|
258
|
-
}, rest), /*#__PURE__*/_react["default"].createElement(_ui.Handler, {
|
259
|
-
ref: firstHandleRef,
|
260
|
-
stepSize: state.stepSize,
|
261
|
-
multipleStepSize: multipleStepSize,
|
262
|
-
onChangeCommitted: onFirstHandleChangeCommitted,
|
263
|
-
onChange: onFirstHandleChange,
|
264
|
-
min: min,
|
265
|
-
max: state.secondValue,
|
266
|
-
disabled: disabled,
|
267
|
-
bounds: [min, state.secondValue],
|
268
|
-
side: "left",
|
269
|
-
xPosition: state.xFirstHandle,
|
270
|
-
zIndex: state.firstHandleZIndex,
|
271
|
-
value: currentFirstSliderValue,
|
272
|
-
ariaLabel: ariaLabelLeft,
|
273
|
-
onMouseEnter: function onMouseEnter() {
|
274
|
-
return setFirstInputActive(true);
|
275
|
-
},
|
276
|
-
onMouseLeave: function onMouseLeave() {
|
277
|
-
return setFirstInputActive(false);
|
278
|
-
}
|
279
|
-
}), /*#__PURE__*/_react["default"].createElement(_ui.Handler, {
|
280
|
-
ref: secondHandleRef,
|
281
|
-
stepSize: state.stepSize,
|
282
|
-
multipleStepSize: multipleStepSize,
|
283
|
-
onChangeCommitted: onSecondHandleChangeCommitted,
|
284
|
-
onChange: onSecondHandleChange,
|
285
|
-
min: min,
|
286
|
-
ariaValueMin: currentFirstSliderValue,
|
287
|
-
max: max,
|
288
|
-
disabled: disabled,
|
289
|
-
bounds: [state.firstValue, max],
|
290
|
-
side: "right",
|
291
|
-
xPosition: state.xSecondHandle,
|
292
|
-
zIndex: state.secondHandleZIndex,
|
293
|
-
value: Math.max(state.secondValue, min),
|
294
|
-
ariaLabel: ariaLabelRight,
|
295
|
-
onMouseEnter: function onMouseEnter() {
|
296
|
-
return setSecondInputActive(true);
|
297
|
-
},
|
298
|
-
onMouseLeave: function onMouseLeave() {
|
299
|
-
return setSecondInputActive(false);
|
300
|
-
}
|
301
|
-
})), /*#__PURE__*/_react["default"].createElement(_Double.InputsWrapper, null, /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
302
|
-
className: (0, _utils2.cx)(_Slider.classes.firstTextField, firstInputActiveClass),
|
303
|
-
enumerationType: "plain",
|
304
|
-
disabled: disabled,
|
305
|
-
value: firstValue,
|
306
|
-
onChange: onFirstTextfieldChange,
|
307
|
-
onBlur: onFirstTextfieldBlur,
|
308
|
-
onKeyDown: onTextfieldKeyDown
|
309
|
-
}), /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
310
|
-
className: (0, _utils2.cx)(_Slider.classes.secondTextField, secondInputActiveClass),
|
311
|
-
enumerationType: "plain",
|
312
|
-
disabled: disabled,
|
313
|
-
value: secondValue,
|
314
|
-
onChange: onSecondTextfieldChange,
|
315
|
-
onBlur: onSecondTextfieldBlur,
|
316
|
-
onKeyDown: onTextfieldKeyDown
|
317
|
-
}))));
|
318
|
-
};
|