@salutejs/plasma-new-hope 0.82.1-canary.1209.9162541836.0 → 0.83.0-canary.1194.9157747369.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 +1 -0
- package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Slider/Slider.css +69 -0
- package/cjs/components/Slider/Slider.js +48 -0
- package/cjs/components/Slider/Slider.js.map +1 -0
- package/cjs/components/Slider/Slider.tokens.js +79 -0
- package/cjs/components/Slider/Slider.tokens.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.css +62 -0
- package/cjs/components/Slider/components/Double/Double.js +288 -0
- package/cjs/components/Slider/components/Double/Double.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.styles.js +61 -0
- package/cjs/components/Slider/components/Double/Double.styles.js.map +1 -0
- package/cjs/components/Slider/components/Double/Double.styles_1jhda4u.css +7 -0
- package/cjs/components/Slider/components/Single/Single.css +16 -0
- package/cjs/components/Slider/components/Single/Single.js +164 -0
- package/cjs/components/Slider/components/Single/Single.js.map +1 -0
- package/cjs/components/Slider/components/Single/Single.styles.js +45 -0
- package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -0
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +4 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +82 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +33 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +4 -0
- package/cjs/components/Slider/ui/Handler/Handler.css +4 -0
- package/cjs/components/Slider/ui/Handler/Handler.js +174 -0
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles.js +21 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.js +31 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +15 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/cjs/components/Slider/utils/index.js +56 -0
- package/cjs/components/Slider/utils/index.js.map +1 -0
- package/cjs/components/Slider/variations/_disabled/base.js +9 -0
- package/cjs/components/Slider/variations/_disabled/base.js.map +1 -0
- package/cjs/components/Slider/variations/_disabled/base_x642ct.css +1 -0
- package/cjs/components/Slider/variations/_size/base.js +9 -0
- package/cjs/components/Slider/variations/_size/base.js.map +1 -0
- package/cjs/components/Slider/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Slider/variations/_view/base.js +9 -0
- package/cjs/components/Slider/variations/_view/base.js.map +1 -0
- package/cjs/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/cjs/components/TextArea/TextArea.js +5 -7
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +0 -4
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/TextArea_qicm5y.css +1 -0
- package/cjs/components/TextField/TextField.js +12 -3
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/engines/common.js +4 -0
- package/cjs/engines/common.js.map +1 -1
- package/cjs/engines/index.js.map +1 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +15 -0
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +1 -0
- package/cjs/index.css +26 -1
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/cjs/utils/canUseDOM.js +12 -0
- package/cjs/utils/canUseDOM.js.map +1 -0
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Combobox/hooks/useFocusController.js +1 -0
- package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/es/components/Slider/Slider.css +69 -0
- package/es/components/Slider/Slider.js +43 -0
- package/es/components/Slider/Slider.js.map +1 -0
- package/es/components/Slider/Slider.tokens.js +74 -0
- package/es/components/Slider/Slider.tokens.js.map +1 -0
- package/es/components/Slider/components/Double/Double.css +62 -0
- package/es/components/Slider/components/Double/Double.js +284 -0
- package/es/components/Slider/components/Double/Double.js.map +1 -0
- package/es/components/Slider/components/Double/Double.styles.js +51 -0
- package/es/components/Slider/components/Double/Double.styles.js.map +1 -0
- package/es/components/Slider/components/Double/Double.styles_1jhda4u.css +7 -0
- package/es/components/Slider/components/Single/Single.css +16 -0
- package/es/components/Slider/components/Single/Single.js +160 -0
- package/es/components/Slider/components/Single/Single.js.map +1 -0
- package/es/components/Slider/components/Single/Single.styles.js +36 -0
- package/es/components/Slider/components/Single/Single.styles.js.map +1 -0
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/es/components/Slider/components/SliderBase/SliderBase.css +4 -0
- package/es/components/Slider/components/SliderBase/SliderBase.js +78 -0
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +26 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -0
- package/es/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +4 -0
- package/es/components/Slider/ui/Handler/Handler.css +4 -0
- package/es/components/Slider/ui/Handler/Handler.js +170 -0
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.styles.js +16 -0
- package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/es/components/Slider/ui/Thumb/Thumb.css +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.js +27 -0
- package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +11 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/es/components/Slider/utils/index.js +50 -0
- package/es/components/Slider/utils/index.js.map +1 -0
- package/es/components/Slider/variations/_disabled/base.js +5 -0
- package/es/components/Slider/variations/_disabled/base.js.map +1 -0
- package/es/components/Slider/variations/_disabled/base_x642ct.css +1 -0
- package/es/components/Slider/variations/_size/base.js +5 -0
- package/es/components/Slider/variations/_size/base.js.map +1 -0
- package/es/components/Slider/variations/_size/base_x642ct.css +1 -0
- package/es/components/Slider/variations/_view/base.js +5 -0
- package/es/components/Slider/variations/_view/base.js.map +1 -0
- package/es/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/es/components/TextArea/TextArea.js +5 -7
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +0 -4
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/TextArea_qicm5y.css +1 -0
- package/es/components/TextField/TextField.js +12 -3
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/engines/common.js +4 -0
- package/es/engines/common.js.map +1 -1
- package/es/engines/index.js.map +1 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/es/hooks/useIsomorphicLayoutEffect.js.map +1 -0
- package/es/index.css +26 -1
- package/es/index.js +8 -0
- package/es/index.js.map +1 -1
- package/es/utils/canUseDOM.js +8 -0
- package/es/utils/canUseDOM.js.map +1 -0
- package/es/utils/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Slider/Slider.js +47 -0
- package/styled-components/cjs/components/Slider/Slider.tokens.js +77 -0
- package/styled-components/cjs/components/Slider/Slider.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.js +300 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.styles.js +36 -0
- package/styled-components/cjs/components/Slider/components/Double/Double.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.js +176 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +27 -0
- package/styled-components/cjs/components/Slider/components/Single/Single.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +83 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +21 -0
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.types.js +5 -0
- package/styled-components/cjs/components/Slider/components/index.js +27 -0
- package/styled-components/cjs/components/Slider/index.js +32 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +183 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +15 -0
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.types.js +5 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +32 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +18 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.types.js +5 -0
- package/styled-components/cjs/components/Slider/ui/index.js +63 -0
- package/styled-components/cjs/components/Slider/utils/index.js +55 -0
- package/styled-components/cjs/components/Slider/variations/_disabled/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_disabled/tokens.json +4 -0
- package/styled-components/cjs/components/Slider/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/Slider/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/components/TextArea/TextArea.js +4 -6
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +0 -4
- package/styled-components/cjs/components/TextArea/mixins/applyDynamicLabel.js +1 -1
- package/styled-components/cjs/components/TextField/TextField.js +12 -3
- package/styled-components/cjs/engines/common.js +4 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +29 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.js +16 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +164 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +29 -0
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.js +16 -0
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +163 -0
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/cjs/hooks/index.js +8 -1
- package/styled-components/cjs/hooks/useIsomorphicLayoutEffect.js +12 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/cjs/utils/canUseDOM.js +11 -0
- package/styled-components/cjs/utils/index.js +7 -0
- package/styled-components/es/components/Slider/Slider.js +38 -0
- package/styled-components/es/components/Slider/Slider.tokens.js +71 -0
- package/styled-components/es/components/Slider/Slider.types.js +1 -0
- package/styled-components/es/components/Slider/components/Double/Double.js +292 -0
- package/styled-components/es/components/Slider/components/Double/Double.styles.js +29 -0
- package/styled-components/es/components/Slider/components/Double/Double.types.js +1 -0
- package/styled-components/es/components/Slider/components/Single/Single.js +168 -0
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +20 -0
- package/styled-components/es/components/Slider/components/Single/Single.types.js +1 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +74 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +14 -0
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.types.js +1 -0
- package/styled-components/es/components/Slider/components/index.js +3 -0
- package/styled-components/es/components/Slider/index.js +3 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +174 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -0
- package/styled-components/es/components/Slider/ui/Handler/Handler.types.js +1 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +25 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +11 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.types.js +1 -0
- package/styled-components/es/components/Slider/ui/index.js +5 -0
- package/styled-components/es/components/Slider/utils/index.js +47 -0
- package/styled-components/es/components/Slider/variations/_disabled/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_disabled/tokens.json +4 -0
- package/styled-components/es/components/Slider/variations/_size/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/Slider/variations/_view/base.js +2 -0
- package/styled-components/es/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/es/components/TextArea/TextArea.js +4 -6
- package/styled-components/es/components/TextArea/TextArea.tokens.js +0 -4
- package/styled-components/es/components/TextArea/mixins/applyDynamicLabel.js +1 -1
- package/styled-components/es/components/TextField/TextField.js +12 -3
- package/styled-components/es/engines/common.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +23 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.js +10 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +164 -0
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +23 -0
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.js +10 -0
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +163 -0
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +4 -4
- package/styled-components/es/hooks/index.js +2 -1
- package/styled-components/es/hooks/useIsomorphicLayoutEffect.js +7 -0
- package/styled-components/es/index.js +2 -1
- package/styled-components/es/utils/canUseDOM.js +5 -0
- package/styled-components/es/utils/index.js +1 -0
- package/types/components/Slider/Slider.d.ts +27 -0
- package/types/components/Slider/Slider.d.ts.map +1 -0
- package/types/components/Slider/Slider.tokens.d.ts +72 -0
- package/types/components/Slider/Slider.tokens.d.ts.map +1 -0
- package/types/components/Slider/Slider.types.d.ts +3 -0
- package/types/components/Slider/Slider.types.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.d.ts +4 -0
- package/types/components/Slider/components/Double/Double.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.styles.d.ts +43 -0
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +1 -0
- package/types/components/Slider/components/Double/Double.types.d.ts +65 -0
- package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.d.ts +4 -0
- package/types/components/Slider/components/Single/Single.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.styles.d.ts +8 -0
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -0
- package/types/components/Slider/components/Single/Single.types.d.ts +55 -0
- package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts +4 -0
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +6 -0
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -0
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +45 -0
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -0
- package/types/components/Slider/components/index.d.ts +6 -0
- package/types/components/Slider/components/index.d.ts.map +1 -0
- package/types/components/Slider/index.d.ts +6 -0
- package/types/components/Slider/index.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.d.ts +9 -0
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts +4 -0
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -0
- package/types/components/Slider/ui/Handler/Handler.types.d.ts +24 -0
- package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +4 -0
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts +5 -0
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +12 -0
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -0
- package/types/components/Slider/ui/index.d.ts +6 -0
- package/types/components/Slider/ui/index.d.ts.map +1 -0
- package/types/components/Slider/utils/index.d.ts +33 -0
- package/types/components/Slider/utils/index.d.ts.map +1 -0
- package/types/components/Slider/variations/_disabled/base.d.ts +2 -0
- package/types/components/Slider/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/Slider/variations/_size/base.d.ts +2 -0
- package/types/components/Slider/variations/_size/base.d.ts.map +1 -0
- package/types/components/Slider/variations/_view/base.d.ts +2 -0
- package/types/components/Slider/variations/_view/base.d.ts.map +1 -0
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +0 -4
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/mixins/applyDynamicLabel.d.ts.map +1 -1
- package/types/components/TextField/TextField.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 +4 -0
- package/types/engines/types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts +22 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +21 -0
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts +22 -0
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +21 -0
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -0
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/index.d.ts.map +1 -1
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +6 -0
- package/types/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/utils/canUseDOM.d.ts +6 -0
- package/types/utils/canUseDOM.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/TextArea/TextArea_ob9y3r.css +0 -1
- package/es/components/TextArea/TextArea_ob9y3r.css +0 -1
package/es/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { CSSProperties } from '@linaria/core';\n\nexport { extractTextFrom } from './extractTextFrom';\nexport { getSizeValueFromProp } from './getSizeValueFromProp';\nexport { IS_REACT_18, safeUseId } from './react';\nexport { isNumber } from './isNumber';\n\nexport const cx = (...classes: (string | undefined)[]) => classes.filter((classItem) => classItem).join(' ');\n\nexport const composableStyle = (s: TemplateStringsArray, ...expr: Array<string | number | CSSProperties>): string => {\n let res = '';\n for (let i = 0; i < Math.max(s.length, expr.length); ++i) {\n res += s[i] ?? '';\n res += expr[i] ?? '';\n }\n\n return res;\n};\n"],"names":["cx","_len","arguments","length","classes","Array","_key","filter","classItem","join","composableStyle","s","res","i","Math","max","_s$i","_ref","undefined"],"mappings":";;;
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { CSSProperties } from '@linaria/core';\n\nexport { canUseDOM } from './canUseDOM';\nexport { extractTextFrom } from './extractTextFrom';\nexport { getSizeValueFromProp } from './getSizeValueFromProp';\nexport { IS_REACT_18, safeUseId } from './react';\nexport { isNumber } from './isNumber';\n\nexport const cx = (...classes: (string | undefined)[]) => classes.filter((classItem) => classItem).join(' ');\n\nexport const composableStyle = (s: TemplateStringsArray, ...expr: Array<string | number | CSSProperties>): string => {\n let res = '';\n for (let i = 0; i < Math.max(s.length, expr.length); ++i) {\n res += s[i] ?? '';\n res += expr[i] ?? '';\n }\n\n return res;\n};\n"],"names":["cx","_len","arguments","length","classes","Array","_key","filter","classItem","join","composableStyle","s","res","i","Math","max","_s$i","_ref","undefined"],"mappings":";;;AAQaA,IAAAA,EAAE,GAAG,SAALA,EAAEA,GAAA;AAAA,EAAA,KAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAOC,OAAO,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,EAAA,EAAA;AAAPF,IAAAA,OAAO,CAAAE,IAAA,CAAAJ,GAAAA,SAAA,CAAAI,IAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAAA,OAA6BF,OAAO,CAACG,MAAM,CAAC,UAACC,SAAS,EAAA;AAAA,IAAA,OAAKA,SAAS,CAAA;AAAA,GAAA,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;AAAA,EAAA;IAE/FC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,CAAuB,EAA8D;EACjH,IAAIC,GAAG,GAAG,EAAE,CAAA;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,IAAI,CAACC,GAAG,CAACJ,CAAC,CAACR,MAAM,EAAAD,SAAA,CAAAC,MAAA,IAAA,CAAA,GAAA,CAAA,GAAAD,SAAA,CAAAC,MAAA,GAAA,CAAa,CAAC,EAAE,EAAEU,CAAC,EAAE;IAAA,IAAAG,IAAA,EAAAC,IAAA,CAAA;AACtDL,IAAAA,GAAG,IAAAI,CAAAA,IAAA,GAAIL,CAAC,CAACE,CAAC,CAAC,MAAA,IAAA,IAAAG,IAAA,KAAA,KAAA,CAAA,GAAAA,IAAA,GAAI,EAAE,CAAA;IACjBJ,GAAG,IAAA,CAAAK,IAAA,GAASJ,CAAC,YAAAX,SAAA,CAAAC,MAAA,IAADU,CAAC,OAAAK,SAAA,GAAAhB,SAAA,CAADW,CAAC,mBAAAI,IAAA,KAAA,KAAA,CAAA,GAAAA,IAAA,GAAK,EAAE,CAAA;AACxB,GAAA;AAEA,EAAA,OAAOL,GAAG,CAAA;AACd;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.83.0-canary.1194.9157747369.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -99,8 +99,9 @@
|
|
99
99
|
"@popperjs/core": "2.11.8",
|
100
100
|
"@salutejs/plasma-core": "1.160.0-dev.0",
|
101
101
|
"focus-visible": "5.2.0",
|
102
|
+
"react-draggable": "4.4.3",
|
102
103
|
"react-popper": "2.3.0",
|
103
104
|
"storeon": "3.1.5"
|
104
105
|
},
|
105
|
-
"gitHead": "
|
106
|
+
"gitHead": "a36504c538212c8dd5acb9ae74594807d55abad1"
|
106
107
|
}
|
@@ -0,0 +1,47 @@
|
|
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
|
+
};
|
@@ -0,0 +1,77 @@
|
|
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
|
+
};
|
@@ -0,0 +1,300 @@
|
|
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
|
+
setFirstValue(handleValue);
|
139
|
+
if (onChangeCommitted) {
|
140
|
+
onChangeCommitted([handleValue, value[1]]);
|
141
|
+
}
|
142
|
+
setState(function (prevState) {
|
143
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
144
|
+
firstValue: handleValue,
|
145
|
+
xFirstHandle: data.lastX
|
146
|
+
});
|
147
|
+
});
|
148
|
+
};
|
149
|
+
var onFirstTextfieldChange = function onFirstTextfieldChange(event) {
|
150
|
+
if (!(0, _utils2.isNumber)(event.target.value)) {
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
var handleValue = Number(event.target.value);
|
154
|
+
setFirstValue(handleValue);
|
155
|
+
if (onChangeTextField) {
|
156
|
+
onChangeTextField([handleValue, secondValue], event);
|
157
|
+
}
|
158
|
+
};
|
159
|
+
var onFirstTextfieldBlur = function onFirstTextfieldBlur(event) {
|
160
|
+
if (!(0, _utils2.isNumber)(event.target.value)) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
var handleValue = Number(event.target.value);
|
164
|
+
setFirstValue(handleValue);
|
165
|
+
if (onBlurTextField) {
|
166
|
+
onBlurTextField && onBlurTextField([handleValue, secondValue], event);
|
167
|
+
}
|
168
|
+
};
|
169
|
+
var onSecondHandleChange = function onSecondHandleChange(handleValue, data) {
|
170
|
+
if (!(firstHandleRef !== null && firstHandleRef !== void 0 && firstHandleRef.current)) {
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
var firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);
|
174
|
+
var newHandleXPosition = data.x;
|
175
|
+
var fillWidth = newHandleXPosition - firstXHandleXPosition;
|
176
|
+
secondHandleValue.current = handleValue;
|
177
|
+
setSecondValue(handleValue);
|
178
|
+
setState(function (prevState) {
|
179
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
180
|
+
firstHandleZIndex: 100,
|
181
|
+
secondHandleZIndex: 101,
|
182
|
+
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
183
|
+
railFillXPosition: firstXHandleXPosition
|
184
|
+
});
|
185
|
+
});
|
186
|
+
if (onChange) {
|
187
|
+
onChange([value[0], handleValue]);
|
188
|
+
}
|
189
|
+
};
|
190
|
+
var onSecondHandleChangeCommitted = function onSecondHandleChangeCommitted(handleValue, data) {
|
191
|
+
if (onChangeCommitted) {
|
192
|
+
onChangeCommitted([value[0], handleValue]);
|
193
|
+
}
|
194
|
+
setSecondValue(handleValue);
|
195
|
+
setState(function (prevState) {
|
196
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
197
|
+
secondValue: handleValue,
|
198
|
+
xSecondHandle: data.lastX
|
199
|
+
});
|
200
|
+
});
|
201
|
+
};
|
202
|
+
var onSecondTextfieldChange = function onSecondTextfieldChange(event) {
|
203
|
+
if (!(0, _utils2.isNumber)(event.target.value)) {
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
var handleValue = Number(event.target.value);
|
207
|
+
setSecondValue(handleValue);
|
208
|
+
if (onChangeTextField) {
|
209
|
+
onChangeTextField([firstValue, handleValue], event);
|
210
|
+
}
|
211
|
+
};
|
212
|
+
var onSecondTextfieldBlur = function onSecondTextfieldBlur(event) {
|
213
|
+
if (!(0, _utils2.isNumber)(event.target.value)) {
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
var handleValue = Number(event.target.value);
|
217
|
+
setSecondValue(handleValue);
|
218
|
+
if (onBlurTextField) {
|
219
|
+
onBlurTextField([firstValue, handleValue], event);
|
220
|
+
}
|
221
|
+
};
|
222
|
+
var onTextfieldKeyDown = function onTextfieldKeyDown(event) {
|
223
|
+
if (onKeyDownTextField) {
|
224
|
+
onKeyDownTextField([firstValue, secondValue], event);
|
225
|
+
}
|
226
|
+
};
|
227
|
+
var _ref2 = ariaLabel || [],
|
228
|
+
_ref3 = _slicedToArray(_ref2, 2),
|
229
|
+
ariaLabelLeft = _ref3[0],
|
230
|
+
ariaLabelRight = _ref3[1];
|
231
|
+
var currentFirstSliderValue = Math.max(state.firstValue, min);
|
232
|
+
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({
|
233
|
+
min: min,
|
234
|
+
max: max,
|
235
|
+
disabled: disabled,
|
236
|
+
setStepSize: setStepSize,
|
237
|
+
railFillWidth: state.railFillWidth,
|
238
|
+
settings: _utils.sizeData[size],
|
239
|
+
railFillXPosition: state.railFillXPosition
|
240
|
+
}, rest), /*#__PURE__*/_react["default"].createElement(_ui.Handler, {
|
241
|
+
ref: firstHandleRef,
|
242
|
+
stepSize: state.stepSize,
|
243
|
+
multipleStepSize: multipleStepSize,
|
244
|
+
onChangeCommitted: onFirstHandleChangeCommitted,
|
245
|
+
onChange: onFirstHandleChange,
|
246
|
+
min: min,
|
247
|
+
max: state.secondValue,
|
248
|
+
disabled: disabled,
|
249
|
+
bounds: [min, state.secondValue],
|
250
|
+
side: "left",
|
251
|
+
xPosition: state.xFirstHandle,
|
252
|
+
zIndex: state.firstHandleZIndex,
|
253
|
+
value: currentFirstSliderValue,
|
254
|
+
ariaLabel: ariaLabelLeft,
|
255
|
+
onMouseEnter: function onMouseEnter() {
|
256
|
+
return setFirstInputActive(true);
|
257
|
+
},
|
258
|
+
onMouseLeave: function onMouseLeave() {
|
259
|
+
return setFirstInputActive(false);
|
260
|
+
}
|
261
|
+
}), /*#__PURE__*/_react["default"].createElement(_ui.Handler, {
|
262
|
+
ref: secondHandleRef,
|
263
|
+
stepSize: state.stepSize,
|
264
|
+
multipleStepSize: multipleStepSize,
|
265
|
+
onChangeCommitted: onSecondHandleChangeCommitted,
|
266
|
+
onChange: onSecondHandleChange,
|
267
|
+
min: min,
|
268
|
+
ariaValueMin: currentFirstSliderValue,
|
269
|
+
max: max,
|
270
|
+
disabled: disabled,
|
271
|
+
bounds: [state.firstValue, max],
|
272
|
+
side: "right",
|
273
|
+
xPosition: state.xSecondHandle,
|
274
|
+
zIndex: state.secondHandleZIndex,
|
275
|
+
value: Math.max(state.secondValue, min),
|
276
|
+
ariaLabel: ariaLabelRight,
|
277
|
+
onMouseEnter: function onMouseEnter() {
|
278
|
+
return setSecondInputActive(true);
|
279
|
+
},
|
280
|
+
onMouseLeave: function onMouseLeave() {
|
281
|
+
return setSecondInputActive(false);
|
282
|
+
}
|
283
|
+
})), /*#__PURE__*/_react["default"].createElement(_Double.InputsWrapper, null, /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
284
|
+
className: (0, _utils2.cx)(_Slider.classes.firstTextField, firstInputActiveClass),
|
285
|
+
enumerationType: "plain",
|
286
|
+
disabled: disabled,
|
287
|
+
value: firstValue,
|
288
|
+
onChange: onFirstTextfieldChange,
|
289
|
+
onBlur: onFirstTextfieldBlur,
|
290
|
+
onKeyDown: onTextfieldKeyDown
|
291
|
+
}), /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
292
|
+
className: (0, _utils2.cx)(_Slider.classes.secondTextField, secondInputActiveClass),
|
293
|
+
enumerationType: "plain",
|
294
|
+
disabled: disabled,
|
295
|
+
value: secondValue,
|
296
|
+
onChange: onSecondTextfieldChange,
|
297
|
+
onBlur: onSecondTextfieldBlur,
|
298
|
+
onKeyDown: onTextfieldKeyDown
|
299
|
+
}))));
|
300
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.StyledInput = exports.SliderWrapper = exports.LabelWrapper = exports.LabelContentLeft = exports.Label = exports.InputsWrapper = exports.DoubleWrapper = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
|
+
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
9
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
10
|
+
var _TextField = /*#__PURE__*/require("../../../TextField");
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
12
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_TextField.textFieldConfig);
|
13
|
+
var TextField = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
14
|
+
var LabelWrapper = exports.LabelWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
15
|
+
componentId: "plasma-new-hope__sc-97pdfk-0"
|
16
|
+
})(["color:var(", ");display:flex;gap:var(", ");margin-bottom:var(", ");"], _Slider.tokens.labelColor, _Slider.tokens.labelWrapperGap, _Slider.tokens.labelWrapperMarginBottom);
|
17
|
+
var LabelContentLeft = exports.LabelContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
18
|
+
componentId: "plasma-new-hope__sc-97pdfk-1"
|
19
|
+
})([""]);
|
20
|
+
var Label = exports.Label = /*#__PURE__*/_styledComponents["default"].label.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-97pdfk-2"
|
22
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], _Slider.tokens.labelFontFamily, _Slider.tokens.labelFontSize, _Slider.tokens.labelFontStyle, _Slider.tokens.labelFontWeight, _Slider.tokens.labelLetterSpacing, _Slider.tokens.labelLineHeight);
|
23
|
+
var InputsWrapper = exports.InputsWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
24
|
+
componentId: "plasma-new-hope__sc-97pdfk-3"
|
25
|
+
})(["display:flex;gap:var(", ");margin-top:var(", ");"], _Slider.tokens.textFieldWrapperGap, _Slider.tokens.doubleWrapperGap);
|
26
|
+
|
27
|
+
// NOTE: переопределение токенов TextField
|
28
|
+
var StyledInput = exports.StyledInput = /*#__PURE__*/(0, _styledComponents["default"])(TextField).withConfig({
|
29
|
+
componentId: "plasma-new-hope__sc-97pdfk-4"
|
30
|
+
})(["flex:1;", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");&.", " > div{border-top-right-radius:0;border-bottom-right-radius:0;}&.", " > div{border-top-left-radius:0;border-bottom-left-radius:0;}input:focus,&.", "{", ":var(", ");}"], _TextField.textFieldTokens.color, _Slider.tokens.textFieldColor, _TextField.textFieldTokens.backgroundColor, _Slider.tokens.textFieldBackgroundColor, _TextField.textFieldTokens.caretColor, _Slider.tokens.textFieldCaretColor, _TextField.textFieldTokens.placeholderColor, _Slider.tokens.textFieldPlaceholderColor, _TextField.textFieldTokens.disabledOpacity, _Slider.tokens.disabledOpacity, _TextField.textFieldTokens.height, _Slider.tokens.textFieldHeight, _TextField.textFieldTokens.padding, _Slider.tokens.textFieldPadding, _TextField.textFieldTokens.borderRadius, _Slider.tokens.textFieldBorderRadius, _TextField.textFieldTokens.fontFamily, _Slider.tokens.textFieldFontFamily, _TextField.textFieldTokens.fontSize, _Slider.tokens.textFieldFontSize, _TextField.textFieldTokens.fontStyle, _Slider.tokens.textFieldFontStyle, _TextField.textFieldTokens.fontWeight, _Slider.tokens.textFieldFontWeight, _TextField.textFieldTokens.letterSpacing, _Slider.tokens.textFieldLetterSpacing, _TextField.textFieldTokens.lineHeight, _Slider.tokens.textFieldLineHeight, _Slider.classes.firstTextField, _Slider.classes.secondTextField, _Slider.classes.textFieldActive, _TextField.textFieldTokens.color, _Slider.tokens.textFiledFocusColor);
|
31
|
+
var DoubleWrapper = exports.DoubleWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
32
|
+
componentId: "plasma-new-hope__sc-97pdfk-5"
|
33
|
+
})(["opacity:var(", ");"], _Slider.tokens.disabledOpacity);
|
34
|
+
var SliderWrapper = exports.SliderWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
35
|
+
componentId: "plasma-new-hope__sc-97pdfk-6"
|
36
|
+
})([""]);
|