@salutejs/plasma-new-hope 0.175.0-canary.1452.11549482324.0 → 0.175.0-canary.1504.11549657359.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Pagination/Pagination.css +13 -13
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +13 -13
- package/cjs/components/Select/Select.css +13 -13
- package/cjs/components/Select/Select.styles.js +1 -1
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/Select.styles_768h42.css +5 -0
- package/cjs/components/Select/Select.tokens.js +16 -4
- package/cjs/components/Select/Select.tokens.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +13 -13
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +13 -13
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/{Item.styles_baxa65.css → Item.styles_8oe5oy.css} +2 -2
- package/cjs/components/Slider/Slider.css +13 -15
- package/cjs/components/Slider/Slider.js +2 -11
- package/cjs/components/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/Slider.tokens.js +17 -23
- package/cjs/components/Slider/Slider.tokens.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +8 -8
- package/cjs/components/Slider/components/Double/Double.js +23 -58
- package/cjs/components/Slider/components/Double/Double.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.css +14 -14
- package/cjs/components/Slider/components/Single/Single.js +33 -64
- package/cjs/components/Slider/components/Single/Single.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
- package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +5 -0
- package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
- package/cjs/components/Slider/ui/Handler/Handler.js +88 -49
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -17
- package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/cjs/components/Slider/utils/index.js +10 -28
- package/cjs/components/Slider/utils/index.js.map +1 -1
- package/cjs/components/Slider/variations/_view/base.js +1 -1
- package/cjs/components/Slider/variations/_view/base.js.map +1 -1
- package/cjs/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/cjs/index.css +26 -28
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Select/Select.styles.js +5 -5
- package/emotion/cjs/components/Select/Select.tokens.js +16 -4
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +10 -10
- package/emotion/cjs/components/Slider/Slider.js +2 -10
- package/emotion/cjs/components/Slider/Slider.template-doc.mdx +0 -26
- package/emotion/cjs/components/Slider/Slider.tokens.js +17 -23
- package/emotion/cjs/components/Slider/components/Double/Double.js +19 -54
- package/emotion/cjs/components/Slider/components/Single/Single.js +33 -64
- package/emotion/cjs/components/Slider/components/Single/Single.styles.js +9 -18
- package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
- package/emotion/cjs/components/Slider/ui/Handler/Handler.js +88 -52
- package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +15 -9
- package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
- package/emotion/cjs/components/Slider/utils/index.js +10 -28
- package/emotion/cjs/components/Slider/variations/_view/base.js +1 -2
- package/emotion/cjs/examples/plasma_b2c/components/Select/Select.config.js +17 -17
- package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
- package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
- package/emotion/cjs/examples/plasma_web/components/Select/Select.config.js +17 -17
- package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
- package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
- package/emotion/es/components/Select/Select.styles.js +5 -5
- package/emotion/es/components/Select/Select.tokens.js +16 -4
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.styles.js +10 -10
- package/emotion/es/components/Slider/Slider.js +2 -11
- package/emotion/es/components/Slider/Slider.template-doc.mdx +0 -26
- package/emotion/es/components/Slider/Slider.tokens.js +17 -23
- package/emotion/es/components/Slider/components/Double/Double.js +19 -54
- package/emotion/es/components/Slider/components/Single/Single.js +34 -65
- package/emotion/es/components/Slider/components/Single/Single.styles.js +8 -17
- package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
- package/emotion/es/components/Slider/ui/Handler/Handler.js +86 -51
- package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +16 -10
- package/emotion/es/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
- package/emotion/es/components/Slider/utils/index.js +10 -28
- package/emotion/es/components/Slider/variations/_view/base.js +1 -2
- package/emotion/es/examples/plasma_b2c/components/Select/Select.config.js +17 -17
- package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
- package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
- package/emotion/es/examples/plasma_web/components/Select/Select.config.js +17 -17
- package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
- package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
- package/es/components/Pagination/Pagination.css +13 -13
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +13 -13
- package/es/components/Select/Select.css +13 -13
- package/es/components/Select/Select.styles.js +1 -1
- package/es/components/Select/Select.styles.js.map +1 -1
- package/es/components/Select/Select.styles_768h42.css +5 -0
- package/es/components/Select/Select.tokens.js +16 -4
- package/es/components/Select/Select.tokens.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +13 -13
- package/es/components/Select/ui/Inner/ui/Item/Item.css +13 -13
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/{Item.styles_baxa65.css → Item.styles_8oe5oy.css} +2 -2
- package/es/components/Slider/Slider.css +13 -15
- package/es/components/Slider/Slider.js +2 -11
- package/es/components/Slider/Slider.js.map +1 -1
- package/es/components/Slider/Slider.tokens.js +17 -23
- package/es/components/Slider/Slider.tokens.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +8 -8
- package/es/components/Slider/components/Double/Double.js +19 -54
- package/es/components/Slider/components/Double/Double.js.map +1 -1
- package/es/components/Slider/components/Single/Single.css +14 -14
- package/es/components/Slider/components/Single/Single.js +34 -65
- package/es/components/Slider/components/Single/Single.js.map +1 -1
- package/es/components/Slider/components/Single/Single.styles.js +4 -4
- package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +6 -0
- package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
- package/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +5 -0
- package/es/components/Slider/ui/Handler/Handler.css +3 -3
- package/es/components/Slider/ui/Handler/Handler.js +87 -48
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/es/components/Slider/ui/Handler/Handler.styles.js +7 -17
- package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
- package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +2 -0
- package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +1 -0
- package/es/components/Slider/utils/index.js +10 -28
- package/es/components/Slider/utils/index.js.map +1 -1
- package/es/components/Slider/variations/_view/base.js +1 -1
- package/es/components/Slider/variations/_view/base.js.map +1 -1
- package/es/components/Slider/variations/_view/base_x642ct.css +1 -0
- package/es/index.css +26 -28
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Select/Select.styles.js +2 -2
- package/styled-components/cjs/components/Select/Select.tokens.js +16 -4
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +2 -2
- package/styled-components/cjs/components/Slider/Slider.js +2 -10
- package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +0 -26
- package/styled-components/cjs/components/Slider/Slider.tokens.js +17 -23
- package/styled-components/cjs/components/Slider/components/Double/Double.js +19 -54
- package/styled-components/cjs/components/Slider/components/Single/Single.js +33 -64
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +88 -52
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +4 -7
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
- package/styled-components/cjs/components/Slider/utils/index.js +10 -28
- package/styled-components/cjs/components/Slider/variations/_view/base.js +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.config.js +14 -14
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.config.js +14 -14
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
- package/styled-components/es/components/Select/Select.styles.js +2 -2
- package/styled-components/es/components/Select/Select.tokens.js +16 -4
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.styles.js +2 -2
- package/styled-components/es/components/Slider/Slider.js +2 -11
- package/styled-components/es/components/Slider/Slider.template-doc.mdx +0 -26
- package/styled-components/es/components/Slider/Slider.tokens.js +17 -23
- package/styled-components/es/components/Slider/components/Double/Double.js +19 -54
- package/styled-components/es/components/Slider/components/Single/Single.js +34 -65
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +12 -31
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +86 -51
- package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +5 -8
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +2 -3
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
- package/styled-components/es/components/Slider/utils/index.js +10 -28
- package/styled-components/es/components/Slider/variations/_view/base.js +1 -2
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.config.js +14 -14
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +16 -98
- package/styled-components/es/examples/plasma_web/components/Select/Select.config.js +14 -14
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +15 -98
- package/types/components/Select/Select.tokens.d.ts +15 -3
- package/types/components/Select/Select.tokens.d.ts.map +1 -1
- package/types/components/Slider/Slider.d.ts.map +1 -1
- package/types/components/Slider/Slider.tokens.d.ts +16 -22
- package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.types.d.ts +0 -1
- package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.types.d.ts +7 -79
- package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +0 -6
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts +2 -6
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.types.d.ts +1 -5
- package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
- package/types/components/Slider/utils/index.d.ts +8 -26
- package/types/components/Slider/utils/index.d.ts.map +1 -1
- package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Select/Select.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +2 -80
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Select/Select.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +2 -80
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
- package/types/utils/index.d.ts +1 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Select/Select.styles_1nzals0.css +0 -5
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -98
- package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +0 -6
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +0 -5
- package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +0 -2
- package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -122
- package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +0 -1
- package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +0 -1
- package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -121
- package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -115
- package/es/components/Select/Select.styles_1nzals0.css +0 -5
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +0 -98
- package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +0 -6
- package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +0 -5
- package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +0 -2
- package/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -118
- package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +0 -1
- package/es/components/Slider/variations/_view/base_1s3f6q8.css +0 -1
- package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +0 -121
- package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +0 -115
- package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +0 -12
- package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +0 -1
@@ -20,6 +20,18 @@ export var tokens = {
|
|
20
20
|
fontWeight: '--plasma-select-font-weight',
|
21
21
|
fontLetterSpacing: '--plasma-select-font-letter-spacing',
|
22
22
|
fontLineHeight: '--plasma-select-font-line-height',
|
23
|
+
labelFontFamily: '--plasma-select-label-font-family',
|
24
|
+
labelFontSize: '--plasma-select-label-font-size',
|
25
|
+
labelFontStyle: '--plasma-select-label-font-style',
|
26
|
+
labelFontWeight: '--plasma-select-label-font-weight',
|
27
|
+
labelFontLetterSpacing: '--plasma-select-label-font-letter-spacing',
|
28
|
+
labelFontLineHeight: '--plasma-select-label-font-line-height',
|
29
|
+
helperTextFontFamily: '--plasma-select-helper-text-font-family',
|
30
|
+
helperTextFontSize: '--plasma-select-helper-text-font-size',
|
31
|
+
helperTextFontStyle: '--plasma-select-helper-text-font-style',
|
32
|
+
helperTextFontWeight: '--plasma-select-helper-text-font-weight',
|
33
|
+
helperTextFontLetterSpacing: '--plasma-select-helper-text-font-letter-spacing',
|
34
|
+
helperTextFontLineHeight: '--plasma-select-helper-text-font-line-height',
|
23
35
|
itemHeight: '--plasma-select-item-height',
|
24
36
|
itemBorderRadius: '--plasma-select-item-border-radius',
|
25
37
|
itemPadding: '--plasma-select-item-padding',
|
@@ -27,6 +39,7 @@ export var tokens = {
|
|
27
39
|
itemIconSize: '--plasma-select-item-icon-size',
|
28
40
|
itemIconSizeTight: '--plasma-select-item-icon-size-tight',
|
29
41
|
itemIconMargin: '--plasma-select-item-icon-margin',
|
42
|
+
itemBackgroundHover: '--plasma-select-item-background-hover',
|
30
43
|
checkboxTriggerSize: '--plasma-select-checkbox-trigger-size',
|
31
44
|
checkboxTriggerSizeTight: '--plasma-select-checkbox-trigger-size-tight',
|
32
45
|
checkboxTriggerBorderRadius: '--plasma-select-checkbox-trigger-border-radius',
|
@@ -78,17 +91,16 @@ export var tokens = {
|
|
78
91
|
helperTextColor: '--plasma-select-helper-text-color',
|
79
92
|
helperTextOffset: '--plasma-select-helper-text-offset',
|
80
93
|
spinnerSize: '--plasma-select-spinner-size',
|
81
|
-
spinnerSizeTight: '--plasma-select-spinner-size-tight'
|
94
|
+
spinnerSizeTight: '--plasma-select-spinner-size-tight',
|
95
|
+
disclosureIconColor: '--plasma-select-disclosure-icon-color',
|
96
|
+
disclosureIconColorHover: '--plasma-select-disclosure-icon-color-hover'
|
82
97
|
};
|
83
98
|
export var constants = {
|
84
99
|
focusColor: '--surface-accent',
|
85
100
|
focusSize: '0.0625rem',
|
86
101
|
background: '--surface-solid-card',
|
87
102
|
boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',
|
88
|
-
disclosureIconColor: '--text-secondary',
|
89
|
-
disclosureIconColorHover: '--text-secondary-hover',
|
90
103
|
itemBackground: '--plasma-colors-transparent',
|
91
|
-
itemBackgroundHover: '--surface-transparent-secondary',
|
92
104
|
textfieldTargetColor: '--text-primary',
|
93
105
|
textfieldOuterLabelColor: '--text-primary',
|
94
106
|
textfieldInnerLabelColor: '--text-secondary',
|
@@ -22,7 +22,7 @@ export var StyledContentRight = /*#__PURE__*/styled.div.withConfig({
|
|
22
22
|
})(["margin-left:auto;display:inline-flex;"]);
|
23
23
|
export var DisclosureIconWrapper = /*#__PURE__*/styled.div.withConfig({
|
24
24
|
componentId: "plasma-new-hope__sc-fr2h0y-4"
|
25
|
-
})(["line-height:0;color:var(", ");&:hover{color:var(", ");}"],
|
25
|
+
})(["line-height:0;color:var(", ");&:hover{color:var(", ");}"], tokens.disclosureIconColor, tokens.disclosureIconColorHover);
|
26
26
|
export var IconWrapper = /*#__PURE__*/styled.div.withConfig({
|
27
27
|
componentId: "plasma-new-hope__sc-fr2h0y-5"
|
28
28
|
})(["display:flex;align-items:center;justify-content:center;width:", ";height:", ";margin:var(", ");line-height:0;color:var(", ");& .", "{--plasma-checkbox-trigger-size:", ";--plasma-checkbox-trigger-border-radius:", ";}"], function (_ref) {
|
@@ -49,7 +49,7 @@ export var Wrapper = /*#__PURE__*/styled.li.withConfig({
|
|
49
49
|
})(["display:flex;align-items:center;min-height:var(", ");margin:0;box-sizing:content-box;padding:", ";font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");background:var(", ");color:var(--text-primary);border-radius:var(", ");user-select:none;&:hover:not(.", "){cursor:pointer;background:var(", ");}&.", "{background:var(", ");}&.", "{opacity:", ";cursor:not-allowed;}:focus{outline:none;}", ";"], tokens.itemHeight, function (_ref6) {
|
50
50
|
var variant = _ref6.variant;
|
51
51
|
return "var(".concat(variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding, ")");
|
52
|
-
}, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.fontLetterSpacing, tokens.fontLineHeight, constants.itemBackground, tokens.itemBorderRadius, classes.dropdownItemIsDisabled,
|
52
|
+
}, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.fontLetterSpacing, tokens.fontLineHeight, constants.itemBackground, tokens.itemBorderRadius, classes.dropdownItemIsDisabled, tokens.itemBackgroundHover, classes.dropdownItemIsActive, tokens.itemBackgroundHover, classes.dropdownItemIsDisabled, constants.opacity, /*#__PURE__*/addFocus({
|
53
53
|
outlineSize: '0.0625rem',
|
54
54
|
outlineOffset: '0',
|
55
55
|
outlineColor: /*#__PURE__*/"var(".concat(constants.focusColor, ")"),
|
@@ -4,13 +4,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
4
4
|
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; }
|
5
5
|
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); }
|
6
6
|
import React, { forwardRef } from 'react';
|
7
|
-
import { cx } from '../../utils';
|
8
7
|
import { base as viewCSS } from './variations/_view/base';
|
9
8
|
import { base as sizeCSS } from './variations/_size/base';
|
10
9
|
import { base as disabledCSS } from './variations/_disabled/base';
|
11
10
|
import { SingleSlider, DoubleUncontrolled } from './components';
|
12
|
-
import { classes } from './Slider.tokens';
|
13
|
-
|
14
11
|
// TODO: проверить, можно ли обойтись без каста типов
|
15
12
|
|
16
13
|
var isSingleValueProps = function isSingleValueProps(props, type) {
|
@@ -24,15 +21,9 @@ export var sliderRoot = function sliderRoot(Root) {
|
|
24
21
|
var _ref$type = _ref.type,
|
25
22
|
type = _ref$type === void 0 ? 'single' : _ref$type,
|
26
23
|
props = _objectWithoutProperties(_ref, _excluded);
|
27
|
-
|
28
|
-
return /*#__PURE__*/React.createElement(Root, _extends({}, props, {
|
29
|
-
className: cx(props.orientation === 'vertical' && classes.verticalOrientation, props.className),
|
30
|
-
ref: ref
|
31
|
-
}), /*#__PURE__*/React.createElement(SingleSlider, props));
|
32
|
-
}
|
33
|
-
return /*#__PURE__*/React.createElement(Root, _extends({
|
24
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, props, {
|
34
25
|
ref: ref
|
35
|
-
}, props), isDoubleValueProps(props, type) && /*#__PURE__*/React.createElement(DoubleUncontrolled, props));
|
26
|
+
}), isSingleValueProps(props, type) && /*#__PURE__*/React.createElement(SingleSlider, props), isDoubleValueProps(props, type) && /*#__PURE__*/React.createElement(DoubleUncontrolled, props));
|
36
27
|
});
|
37
28
|
};
|
38
29
|
export var sliderConfig = {
|
@@ -76,29 +76,3 @@ export function App() {
|
|
76
76
|
);
|
77
77
|
}
|
78
78
|
```
|
79
|
-
|
80
|
-
# Вертикальное отображение
|
81
|
-
|
82
|
-
```tsx live
|
83
|
-
import React from 'react';
|
84
|
-
import { Slider } from '@salutejs/{{ package }}';
|
85
|
-
import { IconMic } from '@salutejs/plasma-icons';
|
86
|
-
|
87
|
-
export function App() {
|
88
|
-
return (
|
89
|
-
<section style={{ height: '300px' }}>
|
90
|
-
<Slider
|
91
|
-
onChangeCommitted={() => {}}
|
92
|
-
min={0}
|
93
|
-
max={100}
|
94
|
-
value={30}
|
95
|
-
label="Громкость"
|
96
|
-
labelContent={<IconMic size="s" />}
|
97
|
-
orientation="vertical"
|
98
|
-
sliderAlign="center"
|
99
|
-
size="m"
|
100
|
-
/>
|
101
|
-
</section>
|
102
|
-
);
|
103
|
-
}
|
104
|
-
```
|
@@ -1,12 +1,6 @@
|
|
1
1
|
export var classes = {
|
2
2
|
labelPlacementOuter: 'slider-label-placement-outer',
|
3
3
|
labelPlacementInner: 'slider-label-placement-inner',
|
4
|
-
labelPlacementBottom: 'slider-label-placement-bottom',
|
5
|
-
labelAlignLeft: 'slider-label-align-left',
|
6
|
-
labelAlignCenter: 'slider-label-align-center',
|
7
|
-
labelAlignRight: 'slider-label-align-right',
|
8
|
-
labelAlignNone: 'slider-label-align-none',
|
9
|
-
labelContentReversed: 'slider-label-content-reversed',
|
10
4
|
rangeValuesPlacementOuter: 'slider-range-values-placement-outer',
|
11
5
|
rangeValuesPlacementInner: 'slider-range-values-placement-inner',
|
12
6
|
maxRangeValue: 'slider-max-range-value',
|
@@ -15,17 +9,13 @@ export var classes = {
|
|
15
9
|
textFieldActive: 'slider-text-field-active',
|
16
10
|
firstTextField: 'slider-first-text-field',
|
17
11
|
secondTextField: 'slider-second-text-field',
|
18
|
-
activeRangeValue: 'slider-active-range-value'
|
19
|
-
verticalOrientation: 'slider-vertical-orientation',
|
20
|
-
valuePlacementLeft: 'slider-value-placement-left',
|
21
|
-
reversed: 'slider-reversed'
|
12
|
+
activeRangeValue: 'slider-active-range-value'
|
22
13
|
};
|
23
14
|
export var tokens = {
|
24
|
-
|
15
|
+
height: '--plasma-slider-height',
|
25
16
|
labelWrapperGap: '--plasma-slider-label-wrapper-gap',
|
26
17
|
labelWrapperMarginBottom: '--plasma-slider-label-wrapper-margin-bottom',
|
27
18
|
labelWrapperMarginRight: '--plasma-slider-label-wrapper-margin-right',
|
28
|
-
labelWrapperVerticalMargin: '--plasma-slider-label-wrapper-vertical-margin',
|
29
19
|
labelColor: '--plasma-slider-label-color',
|
30
20
|
labelFontFamily: '--plasma-slider-label-font-family',
|
31
21
|
labelFontSize: '--plasma-slider-label-font-size',
|
@@ -33,27 +23,31 @@ export var tokens = {
|
|
33
23
|
labelFontWeight: '--plasma-slider-label-font-weight',
|
34
24
|
labelLetterSpacing: '--plasma-slider-label-letter-spacing',
|
35
25
|
labelLineHeight: '--plasma-slider-label-line-height',
|
26
|
+
rangeMinValueMargin: '--plasma-slider-range-min-value-margin',
|
27
|
+
rangeMaxValueMargin: '--plasma-slider-range-max-value-margin',
|
36
28
|
rangeValueBottomOffset: '--plasma-slider-range-value-bottom-offset',
|
37
|
-
rangeValueHorizontalMargin: '--plasma-slider-range-value-horizontal-margin',
|
38
|
-
rangeValueHorizontalOffset: '--plasma-slider-range-value-horizontal-offset',
|
39
|
-
rangeValueVerticalMargin: '--plasma-slider-range-value-vertical-margin',
|
40
29
|
rangeValueColor: '--plasma-slider-range-value-color',
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
30
|
+
rangeValueFontFamily: '--plasma-slider-range-value-font-family',
|
31
|
+
rangeValueFontSize: '--plasma-slider-range-value-font-size',
|
32
|
+
rangeValueFontStyle: '--plasma-slider-range-value-font-style',
|
33
|
+
rangeValueFontWeight: '--plasma-slider-range-value-font-weight',
|
34
|
+
rangeValueLetterSpacing: '--plasma-slider-range-value-letter-spacing',
|
35
|
+
rangeValueLineHeight: '--plasma-slider-range-value-line-height',
|
47
36
|
doubleWrapperGap: '--plasma-slider-double-wrapper-gap',
|
48
37
|
thumbSize: '--plasma-slider-thumb-size',
|
49
|
-
thumbSizeLarge: '--plasma-slider-thumb-size-large',
|
50
38
|
thumbBorder: '--plasma-slider-thumb-border',
|
51
39
|
thumbBorderColor: '--plasma-slider-thumb-border-color',
|
52
40
|
thumbBackgroundColor: '--plasma-slider-thumb-background-color',
|
53
41
|
thumbFocusBorderColor: '--plasma-slider-thumb-focus-border-color',
|
54
42
|
currentValueTopOffset: '--plasma-slider-current-value-top-offset',
|
43
|
+
currentValueFontFamily: '--plasma-slider-current-value-font-family',
|
44
|
+
currentValueFontSize: '--plasma-slider-current-value-font-size',
|
45
|
+
currentValueFontStyle: '--plasma-slider-current-value-font-style',
|
46
|
+
currentValueFontWeight: '--plasma-slider-current-value-font-weight',
|
47
|
+
currentValueLetterSpacing: '--plasma-slider-current-value-letter-spacing',
|
48
|
+
currentValueLineHeight: '--plasma-slider-current-value-line-height',
|
55
49
|
railBackgroundColor: '--plasma-slider-rail-background-color',
|
56
|
-
|
50
|
+
railHeight: '--plasma-slider-rail-height',
|
57
51
|
railBorderRadius: '--plasma-slider-rail-border-radius',
|
58
52
|
railIndent: '--plasma-slider-rail-indent',
|
59
53
|
fillColor: '--plasma-slider-fill-color',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
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); }
|
2
|
-
var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "
|
2
|
+
var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeTextField", "onBlurTextField", "onKeyDownTextField", "onChange", "ariaLabel", "multipleStepSize", "name"];
|
3
3
|
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); }
|
4
4
|
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; }
|
5
5
|
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; }
|
@@ -38,8 +38,6 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
38
38
|
labelContentLeft = _ref.labelContentLeft,
|
39
39
|
_ref$size = _ref.size,
|
40
40
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
41
|
-
_ref$pointerSize = _ref.pointerSize,
|
42
|
-
pointerSize = _ref$pointerSize === void 0 ? 'small' : _ref$pointerSize,
|
43
41
|
onChangeCommitted = _ref.onChangeCommitted,
|
44
42
|
onChangeTextField = _ref.onChangeTextField,
|
45
43
|
onBlurTextField = _ref.onBlurTextField,
|
@@ -66,30 +64,20 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
66
64
|
setState = _useState2[1];
|
67
65
|
var _useState3 = useState(false),
|
68
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
69
|
-
|
70
|
-
|
67
|
+
firstInputActive = _useState4[0],
|
68
|
+
setFirstInputActive = _useState4[1];
|
71
69
|
var _useState5 = useState(false),
|
72
70
|
_useState6 = _slicedToArray(_useState5, 2),
|
73
|
-
|
74
|
-
|
75
|
-
var _useState7 = useState(
|
71
|
+
secondInputActive = _useState6[0],
|
72
|
+
setSecondInputActive = _useState6[1];
|
73
|
+
var _useState7 = useState(value[0]),
|
76
74
|
_useState8 = _slicedToArray(_useState7, 2),
|
77
|
-
|
78
|
-
|
79
|
-
var _useState9 = useState(
|
75
|
+
firstValue = _useState8[0],
|
76
|
+
setFirstValue = _useState8[1];
|
77
|
+
var _useState9 = useState(value[1]),
|
80
78
|
_useState10 = _slicedToArray(_useState9, 2),
|
81
|
-
|
82
|
-
|
83
|
-
var firstInputActive = firstInputHovered || firstInputFocused;
|
84
|
-
var secondInputActive = secondInputHovered || secondInputFocused;
|
85
|
-
var _useState11 = useState(value[0]),
|
86
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
87
|
-
firstValue = _useState12[0],
|
88
|
-
setFirstValue = _useState12[1];
|
89
|
-
var _useState13 = useState(value[1]),
|
90
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
91
|
-
secondValue = _useState14[0],
|
92
|
-
setSecondValue = _useState14[1];
|
79
|
+
secondValue = _useState10[0],
|
80
|
+
setSecondValue = _useState10[1];
|
93
81
|
var firstHandleRef = useRef(null);
|
94
82
|
var secondHandleRef = useRef(null);
|
95
83
|
var firstHandleValue = useRef(value[0]);
|
@@ -114,16 +102,6 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
114
102
|
});
|
115
103
|
});
|
116
104
|
}, [value, stepSize, min, max, setFirstValue, setSecondValue]);
|
117
|
-
useEffect(function () {
|
118
|
-
var onMouseUp = function onMouseUp() {
|
119
|
-
setFirstInputFocused(false);
|
120
|
-
setSecondInputFocused(false);
|
121
|
-
};
|
122
|
-
window.addEventListener('mouseup', onMouseUp);
|
123
|
-
return function () {
|
124
|
-
window.removeEventListener('mouseup', onMouseUp);
|
125
|
-
};
|
126
|
-
}, []);
|
127
105
|
var setStepSize = useCallback(function (newStepSize) {
|
128
106
|
setState(function (prevState) {
|
129
107
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
@@ -265,20 +243,16 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
265
243
|
ariaLabelLeft = _ref3[0],
|
266
244
|
ariaLabelRight = _ref3[1];
|
267
245
|
var currentFirstSliderValue = Math.max(state.firstValue, min);
|
268
|
-
var settings = sizeData[size][pointerSize === 'large' ? 'large' : 'small'];
|
269
246
|
return /*#__PURE__*/React.createElement(DoubleWrapper, null, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null, labelContentLeft && /*#__PURE__*/React.createElement(LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(SliderWrapper, null, /*#__PURE__*/React.createElement(SliderBase, _extends({
|
270
247
|
min: min,
|
271
248
|
max: max,
|
272
|
-
size: size,
|
273
249
|
disabled: disabled,
|
274
250
|
setStepSize: setStepSize,
|
275
251
|
railFillWidth: state.railFillWidth,
|
276
|
-
settings:
|
277
|
-
railFillXPosition: state.railFillXPosition
|
278
|
-
orientation: "horizontal"
|
252
|
+
settings: sizeData[size],
|
253
|
+
railFillXPosition: state.railFillXPosition
|
279
254
|
}, rest), /*#__PURE__*/React.createElement(Handler, {
|
280
255
|
ref: firstHandleRef,
|
281
|
-
size: pointerSize,
|
282
256
|
stepSize: state.stepSize,
|
283
257
|
multipleStepSize: multipleStepSize,
|
284
258
|
onChangeCommitted: onFirstHandleChangeCommitted,
|
@@ -288,23 +262,18 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
288
262
|
disabled: disabled,
|
289
263
|
bounds: [min, state.secondValue],
|
290
264
|
side: "left",
|
291
|
-
|
292
|
-
position: state.xFirstHandle,
|
265
|
+
xPosition: state.xFirstHandle,
|
293
266
|
zIndex: state.firstHandleZIndex,
|
294
267
|
value: currentFirstSliderValue,
|
295
268
|
ariaLabel: ariaLabelLeft,
|
296
|
-
onMouseDown: function onMouseDown() {
|
297
|
-
return setFirstInputFocused(true);
|
298
|
-
},
|
299
269
|
onMouseEnter: function onMouseEnter() {
|
300
|
-
return
|
270
|
+
return setFirstInputActive(true);
|
301
271
|
},
|
302
272
|
onMouseLeave: function onMouseLeave() {
|
303
|
-
return
|
273
|
+
return setFirstInputActive(false);
|
304
274
|
}
|
305
275
|
}), /*#__PURE__*/React.createElement(Handler, {
|
306
276
|
ref: secondHandleRef,
|
307
|
-
size: pointerSize,
|
308
277
|
stepSize: state.stepSize,
|
309
278
|
multipleStepSize: multipleStepSize,
|
310
279
|
onChangeCommitted: onSecondHandleChangeCommitted,
|
@@ -315,19 +284,15 @@ export var DoubleSlider = function DoubleSlider(_ref) {
|
|
315
284
|
disabled: disabled,
|
316
285
|
bounds: [state.firstValue, max],
|
317
286
|
side: "right",
|
318
|
-
|
319
|
-
position: state.xSecondHandle,
|
287
|
+
xPosition: state.xSecondHandle,
|
320
288
|
zIndex: state.secondHandleZIndex,
|
321
289
|
value: Math.max(state.secondValue, min),
|
322
290
|
ariaLabel: ariaLabelRight,
|
323
|
-
onMouseDown: function onMouseDown() {
|
324
|
-
return setSecondInputFocused(true);
|
325
|
-
},
|
326
291
|
onMouseEnter: function onMouseEnter() {
|
327
|
-
return
|
292
|
+
return setSecondInputActive(true);
|
328
293
|
},
|
329
294
|
onMouseLeave: function onMouseLeave() {
|
330
|
-
return
|
295
|
+
return setSecondInputActive(false);
|
331
296
|
}
|
332
297
|
})), /*#__PURE__*/React.createElement(InputsWrapper, null, /*#__PURE__*/React.createElement(StyledInput, {
|
333
298
|
className: cx(classes.firstTextField, firstInputActiveClass),
|
@@ -1,5 +1,5 @@
|
|
1
1
|
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); }
|
2
|
-
var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "
|
2
|
+
var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "defaultValue", "size", "name"];
|
3
3
|
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); }
|
4
4
|
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; }
|
5
5
|
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,7 +21,7 @@ import { sizeData } from '../../utils';
|
|
21
21
|
import { cx, isNumber, noop } from '../../../../utils';
|
22
22
|
import { classes } from '../../Slider.tokens';
|
23
23
|
import { InputHidden } from '../SliderBase/SliderBase.styles';
|
24
|
-
import { Label,
|
24
|
+
import { Label, LabelContentLeft, LabelWrapper, SingleWrapper, SliderBaseWrapper, StyledRangeValue } from './Single.styles';
|
25
25
|
export var SingleSlider = function SingleSlider(_ref) {
|
26
26
|
var _ref2;
|
27
27
|
var min = _ref.min,
|
@@ -33,35 +33,23 @@ export var SingleSlider = function SingleSlider(_ref) {
|
|
33
33
|
ariaLabel = _ref.ariaLabel,
|
34
34
|
label = _ref.label,
|
35
35
|
labelContentLeft = _ref.labelContentLeft,
|
36
|
-
labelContent = _ref.labelContent,
|
37
|
-
_ref$sliderAlign = _ref.sliderAlign,
|
38
|
-
sliderAlign = _ref$sliderAlign === void 0 ? 'left' : _ref$sliderAlign,
|
39
|
-
showScale = _ref.showScale,
|
40
36
|
showRangeValues = _ref.showRangeValues,
|
41
37
|
showCurrentValue = _ref.showCurrentValue,
|
42
38
|
hideMinValueDiff = _ref.hideMinValueDiff,
|
43
39
|
hideMaxValueDiff = _ref.hideMaxValueDiff,
|
44
40
|
_ref$labelPlacement = _ref.labelPlacement,
|
45
|
-
labelPlacement = _ref$labelPlacement === void 0 ? '
|
46
|
-
|
47
|
-
_ref$
|
48
|
-
scaleAlign = _ref$scaleAlign === void 0 ? 'bottom' : _ref$scaleAlign,
|
41
|
+
labelPlacement = _ref$labelPlacement === void 0 ? 'outer' : _ref$labelPlacement,
|
42
|
+
_ref$rangeValuesPlace = _ref.rangeValuesPlacement,
|
43
|
+
rangeValuesPlacement = _ref$rangeValuesPlace === void 0 ? 'outer' : _ref$rangeValuesPlace,
|
49
44
|
_ref$multipleStepSize = _ref.multipleStepSize,
|
50
45
|
multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
|
51
46
|
defaultValue = _ref.defaultValue,
|
52
47
|
_ref$size = _ref.size,
|
53
48
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
54
49
|
name = _ref.name,
|
55
|
-
_ref$pointerSize = _ref.pointerSize,
|
56
|
-
pointerSize = _ref$pointerSize === void 0 ? 'small' : _ref$pointerSize,
|
57
|
-
_ref$orientation = _ref.orientation,
|
58
|
-
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
|
59
|
-
reversed = _ref.reversed,
|
60
|
-
labelReversed = _ref.labelReversed,
|
61
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
62
|
-
var isVertical = orientation === 'vertical';
|
63
51
|
var _useState = useState({
|
64
|
-
|
52
|
+
xHandle: 0,
|
65
53
|
stepSize: 0,
|
66
54
|
railFillWidth: 0
|
67
55
|
}),
|
@@ -77,28 +65,23 @@ export var SingleSlider = function SingleSlider(_ref) {
|
|
77
65
|
_useState6 = _slicedToArray(_useState5, 2),
|
78
66
|
endOffset = _useState6[0],
|
79
67
|
setEndOffset = _useState6[1];
|
80
|
-
var
|
81
|
-
var _useState7 = useState(innerValue),
|
68
|
+
var _useState7 = useState((_ref2 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : min),
|
82
69
|
_useState8 = _slicedToArray(_useState7, 2),
|
83
70
|
dragValue = _useState8[0],
|
84
71
|
setDragValue = _useState8[1];
|
85
72
|
var stepSize = state.stepSize;
|
86
|
-
var
|
87
|
-
var
|
88
|
-
var
|
89
|
-
var rangeValuesPlacement = rangeValuesPlacementOld === 'outer' || scaleAlign === 'bottom' ? 'outer' : 'inner';
|
90
|
-
var scaleAlignClass = rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;
|
73
|
+
var hasLabelContent = label || labelContentLeft;
|
74
|
+
var labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;
|
75
|
+
var rangeValuesPlacementClass = rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;
|
91
76
|
var hideMinValueDiffClass = hideMinValueDiff && dragValue - min <= hideMinValueDiff ? classes.hideMinValue : '';
|
92
77
|
var hideMaxValueDiffClass = hideMaxValueDiff && max - dragValue <= hideMaxValueDiff ? classes.hideMaxValue : '';
|
93
|
-
var verticalOrientationClass = orientation === 'vertical' ? classes.verticalOrientation : '';
|
94
78
|
var startLabelRef = useRef(null);
|
95
79
|
var endLabelRef = useRef(null);
|
96
80
|
var activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;
|
97
81
|
var activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;
|
98
82
|
useEffect(function () {
|
99
|
-
var
|
100
|
-
|
101
|
-
if (!isVertical && rangeValuesPlacement === 'outer') {
|
83
|
+
var localValue = Math.min(Math.max(dragValue, min), max) - min;
|
84
|
+
if (rangeValuesPlacement === 'outer') {
|
102
85
|
var _startLabelRef$curren, _endLabelRef$current;
|
103
86
|
var startWidth = (_startLabelRef$curren = startLabelRef.current) === null || _startLabelRef$curren === void 0 ? void 0 : _startLabelRef$curren.offsetWidth;
|
104
87
|
if (isNumber(startWidth)) {
|
@@ -108,35 +91,30 @@ export var SingleSlider = function SingleSlider(_ref) {
|
|
108
91
|
if (isNumber(endWidth)) {
|
109
92
|
setEndOffset(Number(endWidth));
|
110
93
|
}
|
111
|
-
} else if (isVertical && innerShowScale && sliderAlign !== 'center') {
|
112
|
-
setStartOffset(12);
|
113
|
-
setEndOffset(12);
|
114
94
|
} else {
|
115
95
|
setStartOffset(1);
|
116
96
|
setEndOffset(1);
|
117
97
|
}
|
118
98
|
setState(function (prevState) {
|
119
99
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
120
|
-
|
100
|
+
xHandle: stepSize * localValue,
|
121
101
|
railFillWidth: stepSize * localValue
|
122
102
|
});
|
123
103
|
});
|
124
|
-
}, [dragValue,
|
125
|
-
// для перерасчета размеров
|
126
|
-
sliderAlign, size]);
|
104
|
+
}, [dragValue, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);
|
127
105
|
var setStepSize = useCallback(function (newStepSize) {
|
128
106
|
setState(function (prevState) {
|
129
107
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
130
108
|
stepSize: newStepSize
|
131
109
|
});
|
132
110
|
});
|
133
|
-
}, []);
|
111
|
+
}, [setState]);
|
134
112
|
var onHandleChange = function onHandleChange(handleValue, data) {
|
135
|
-
var
|
136
|
-
var
|
113
|
+
var newHandleXPosition = data.x;
|
114
|
+
var newValue = Math.round(handleValue);
|
137
115
|
setState(function (prevState) {
|
138
116
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
139
|
-
railFillWidth:
|
117
|
+
railFillWidth: newHandleXPosition
|
140
118
|
});
|
141
119
|
});
|
142
120
|
if (onChange) {
|
@@ -154,49 +132,41 @@ export var SingleSlider = function SingleSlider(_ref) {
|
|
154
132
|
}
|
155
133
|
setDragValue(newValue);
|
156
134
|
};
|
157
|
-
var onHandleChangeCommitted =
|
158
|
-
var newValue = Math.round(
|
135
|
+
var onHandleChangeCommitted = function onHandleChangeCommitted(handleValue, data) {
|
136
|
+
var newValue = Math.round(handleValue);
|
159
137
|
if (onChangeCommitted) {
|
160
138
|
onChangeCommitted(newValue);
|
161
139
|
}
|
162
140
|
setState(function (prevState) {
|
163
141
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
164
|
-
|
165
|
-
railFillWidth:
|
142
|
+
xHandle: data.lastX,
|
143
|
+
railFillWidth: data.lastX
|
166
144
|
});
|
167
145
|
});
|
168
146
|
setDragValue(newValue);
|
169
|
-
}
|
170
|
-
var labelVerticalPlacement = reversed ? 'bottom' : 'top';
|
171
|
-
var valuePlacement = sliderAlign === 'right' ? 'left' : 'right';
|
172
|
-
var settings = sizeData[size][pointerSize === 'large' ? 'large' : 'small'];
|
147
|
+
};
|
173
148
|
return /*#__PURE__*/React.createElement(SingleWrapper, {
|
174
|
-
className:
|
175
|
-
}, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null,
|
176
|
-
className:
|
177
|
-
},
|
149
|
+
className: labelPlacementClass
|
150
|
+
}, hasLabelContent && /*#__PURE__*/React.createElement(LabelWrapper, null, labelContentLeft && /*#__PURE__*/React.createElement(LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement(SliderBaseWrapper, {
|
151
|
+
className: rangeValuesPlacementClass
|
152
|
+
}, showRangeValues && /*#__PURE__*/React.createElement(StyledRangeValue, {
|
178
153
|
ref: startLabelRef,
|
179
154
|
className: cx(hideMinValueDiffClass, activeFirstValue)
|
180
|
-
},
|
155
|
+
}, min), /*#__PURE__*/React.createElement(SliderBase, _extends({
|
181
156
|
min: min,
|
182
157
|
max: max,
|
183
158
|
disabled: disabled,
|
184
|
-
size: size,
|
185
|
-
sliderAlign: sliderAlign,
|
186
159
|
setStepSize: setStepSize,
|
187
160
|
onChange: onHandleChangeCommitted,
|
188
161
|
railFillWidth: state.railFillWidth,
|
189
|
-
settings:
|
162
|
+
settings: sizeData[size],
|
190
163
|
labelPlacement: labelPlacement,
|
191
|
-
rangeValuesPlacement: rangeValuesPlacement
|
192
|
-
orientation: orientation
|
164
|
+
rangeValuesPlacement: rangeValuesPlacement
|
193
165
|
}, rest), /*#__PURE__*/React.createElement(Handler, {
|
194
|
-
size: pointerSize,
|
195
|
-
orientation: orientation,
|
196
166
|
stepSize: state.stepSize,
|
197
167
|
onChangeCommitted: onHandleChangeCommitted,
|
198
168
|
onChange: onHandleChange,
|
199
|
-
|
169
|
+
xPosition: state.xHandle,
|
200
170
|
min: min,
|
201
171
|
max: max,
|
202
172
|
startOffset: startOffset,
|
@@ -205,12 +175,11 @@ export var SingleSlider = function SingleSlider(_ref) {
|
|
205
175
|
disabled: disabled,
|
206
176
|
ariaLabel: ariaLabel,
|
207
177
|
multipleStepSize: multipleStepSize,
|
208
|
-
showCurrentValue: showCurrentValue
|
209
|
-
|
210
|
-
})), innerShowScale && /*#__PURE__*/React.createElement(StyledRangeValue, {
|
178
|
+
showCurrentValue: showCurrentValue
|
179
|
+
})), showRangeValues && /*#__PURE__*/React.createElement(StyledRangeValue, {
|
211
180
|
ref: endLabelRef,
|
212
181
|
className: cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)
|
213
|
-
},
|
182
|
+
}, max)), /*#__PURE__*/React.createElement(InputHidden, _extends({
|
214
183
|
name: name,
|
215
184
|
type: "number",
|
216
185
|
datatype: "slider-single",
|
@@ -3,18 +3,18 @@ import { classes, tokens } from '../../Slider.tokens';
|
|
3
3
|
export var LabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
4
4
|
componentId: "plasma-new-hope__sc-1qm4elt-0"
|
5
5
|
})(["color:var(", ");display:flex;gap:var(", ");"], tokens.labelColor, tokens.labelWrapperGap);
|
6
|
-
export var
|
6
|
+
export var LabelContentLeft = /*#__PURE__*/styled.div.withConfig({
|
7
7
|
componentId: "plasma-new-hope__sc-1qm4elt-1"
|
8
|
-
})(["
|
8
|
+
})([""]);
|
9
9
|
export var Label = /*#__PURE__*/styled.label.withConfig({
|
10
10
|
componentId: "plasma-new-hope__sc-1qm4elt-2"
|
11
11
|
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight);
|
12
12
|
export var StyledRangeValue = /*#__PURE__*/styled.span.withConfig({
|
13
13
|
componentId: "plasma-new-hope__sc-1qm4elt-3"
|
14
|
-
})(["color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");transition:opacity 0.1s ease-in-out;&.", ",&.", "{opacity:0;}&.", "{color:var(", ");}"], tokens.rangeValueColor, tokens.
|
14
|
+
})(["color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");transition:opacity 0.1s ease-in-out;&.", ",&.", "{opacity:0;}&.", "{color:var(", ");}"], tokens.rangeValueColor, tokens.rangeValueFontFamily, tokens.rangeValueFontSize, tokens.rangeValueFontStyle, tokens.rangeValueFontWeight, tokens.rangeValueLetterSpacing, tokens.rangeValueLineHeight, classes.hideMinValue, classes.hideMaxValue, classes.activeRangeValue, tokens.labelColor);
|
15
15
|
export var SliderBaseWrapper = /*#__PURE__*/styled.div.withConfig({
|
16
16
|
componentId: "plasma-new-hope__sc-1qm4elt-4"
|
17
|
-
})(["position:relative;display:flex;flex:1;&.", "{", "{position:absolute;bottom:
|
17
|
+
})(["position:relative;display:flex;flex:1;&.", "{", "{position:absolute;bottom:var(", ");left:0;&.", "{left:unset;right:0;}}}&.", "{align-items:center;", "{margin-right:var(", ");&.", "{margin-right:0;margin-left:var(", ");}}}"], classes.rangeValuesPlacementOuter, StyledRangeValue, tokens.rangeValueBottomOffset, classes.maxRangeValue, classes.rangeValuesPlacementInner, StyledRangeValue, tokens.rangeMinValueMargin, classes.maxRangeValue, tokens.rangeMaxValueMargin);
|
18
18
|
export var SingleWrapper = /*#__PURE__*/styled.div.withConfig({
|
19
19
|
componentId: "plasma-new-hope__sc-1qm4elt-5"
|
20
|
-
})(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}
|
20
|
+
})(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}"], tokens.disabledOpacity, classes.labelPlacementOuter, LabelWrapper, tokens.labelWrapperMarginBottom, classes.labelPlacementInner, LabelWrapper, tokens.labelWrapperMarginRight);
|