@salutejs/plasma-new-hope 0.175.0-canary.1452.11541985977.0 → 0.175.0-canary.1500.11549138907.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +2 -0
- package/cjs/components/Badge/Badge.js +17 -4
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +2 -1
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Badge/variations/_truncate/base.js +9 -0
- package/cjs/components/Badge/variations/_truncate/base.js.map +1 -0
- package/cjs/components/Badge/variations/_truncate/base_nf9u2h.css +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/cjs/components/Tabs/tokens.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +7 -5
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +14 -3
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/{HorizontalTabItem.styles_hfqv5b.css → HorizontalTabItem.styles_1vj7dbl.css} +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +9 -0
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js.map +1 -0
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base_1b34xv3.css +1 -0
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +7 -5
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +14 -3
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_6ssvos.css +5 -0
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +9 -0
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js.map +1 -0
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base_1nwonlh.css +1 -0
- package/cjs/index.css +29 -25
- package/emotion/cjs/components/Badge/Badge.js +22 -4
- package/emotion/cjs/components/Badge/Badge.tokens.js +2 -1
- package/emotion/cjs/components/Badge/variations/_truncate/base.js +10 -0
- package/emotion/cjs/components/Badge/variations/_truncate/tokens.json +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +19 -3
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +10 -0
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +1 -0
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +19 -3
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +10 -0
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +1 -0
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +17 -14
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- 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_b2c/components/Tabs/Tabs.stories.tsx +49 -16
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- 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/Badge/Badge.js +23 -4
- package/emotion/es/components/Badge/Badge.tokens.js +2 -1
- package/emotion/es/components/Badge/variations/_truncate/base.js +4 -0
- package/emotion/es/components/Badge/variations/_truncate/tokens.json +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +20 -3
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +4 -0
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +1 -0
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +20 -3
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +4 -0
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +1 -0
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +17 -14
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- 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_b2c/components/Tabs/Tabs.stories.tsx +49 -16
- package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- 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/Badge/Badge.css +2 -0
- package/es/components/Badge/Badge.js +18 -5
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +2 -1
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Badge/variations/_truncate/base.js +5 -0
- package/es/components/Badge/variations/_truncate/base.js.map +1 -0
- package/es/components/Badge/variations/_truncate/base_nf9u2h.css +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/es/components/Tabs/tokens.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +7 -5
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +15 -4
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/{HorizontalTabItem.styles_hfqv5b.css → HorizontalTabItem.styles_1vj7dbl.css} +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +5 -0
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js.map +1 -0
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base_1b34xv3.css +1 -0
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +7 -5
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +15 -4
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_6ssvos.css +5 -0
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +5 -0
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js.map +1 -0
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base_1nwonlh.css +1 -0
- package/es/index.css +29 -25
- package/package.json +2 -2
- package/styled-components/cjs/components/Badge/Badge.js +22 -4
- package/styled-components/cjs/components/Badge/Badge.tokens.js +2 -1
- package/styled-components/cjs/components/Badge/variations/_truncate/base.js +10 -0
- package/styled-components/cjs/components/Badge/variations/_truncate/tokens.json +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +19 -3
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +10 -0
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +1 -0
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +19 -3
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +2 -2
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +10 -0
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- 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_b2c/components/Tabs/Tabs.stories.tsx +49 -16
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- 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/Badge/Badge.js +23 -4
- package/styled-components/es/components/Badge/Badge.tokens.js +2 -1
- package/styled-components/es/components/Badge/variations/_truncate/base.js +4 -0
- package/styled-components/es/components/Badge/variations/_truncate/tokens.json +1 -0
- 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/components/Tabs/tokens.js +2 -1
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +20 -3
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +4 -0
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +1 -0
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +20 -3
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +2 -2
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +4 -0
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- 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_b2c/components/Tabs/Tabs.stories.tsx +49 -16
- package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- 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/Badge/Badge.d.ts +10 -2
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +1 -0
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +5 -0
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Badge/variations/_truncate/base.d.ts +2 -0
- package/types/components/Badge/variations/_truncate/base.d.ts.map +1 -0
- 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/components/Tabs/TabItem.types.d.ts +5 -0
- package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
- package/types/components/Tabs/tokens.d.ts +1 -0
- package/types/components/Tabs/tokens.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts +9 -2
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.d.ts +2 -0
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.d.ts.map +1 -0
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.d.ts +9 -2
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.d.ts.map +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.d.ts.map +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.d.ts +2 -0
- package/types/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.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_b2c/components/Tabs/TabItem.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +3 -0
- package/types/examples/plasma_web/components/Badge/Badge.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/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/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_16d3lah.css +0 -5
- 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/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/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_16d3lah.css +0 -5
- 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
@@ -3,25 +3,25 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.StyledRangeValue = exports.SliderBaseWrapper = exports.SingleWrapper = exports.LabelWrapper = exports.
|
6
|
+
exports.StyledRangeValue = exports.SliderBaseWrapper = exports.SingleWrapper = exports.LabelWrapper = exports.LabelContentLeft = exports.Label = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
10
|
var LabelWrapper = exports.LabelWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
11
|
componentId: "plasma-new-hope__sc-1qm4elt-0"
|
12
12
|
})(["color:var(", ");display:flex;gap:var(", ");"], _Slider.tokens.labelColor, _Slider.tokens.labelWrapperGap);
|
13
|
-
var
|
13
|
+
var LabelContentLeft = exports.LabelContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
14
14
|
componentId: "plasma-new-hope__sc-1qm4elt-1"
|
15
|
-
})(["
|
15
|
+
})([""]);
|
16
16
|
var Label = exports.Label = /*#__PURE__*/_styledComponents["default"].label.withConfig({
|
17
17
|
componentId: "plasma-new-hope__sc-1qm4elt-2"
|
18
18
|
})(["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);
|
19
19
|
var StyledRangeValue = exports.StyledRangeValue = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
20
20
|
componentId: "plasma-new-hope__sc-1qm4elt-3"
|
21
|
-
})(["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(", ");}"], _Slider.tokens.rangeValueColor, _Slider.tokens.
|
21
|
+
})(["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(", ");}"], _Slider.tokens.rangeValueColor, _Slider.tokens.rangeValueFontFamily, _Slider.tokens.rangeValueFontSize, _Slider.tokens.rangeValueFontStyle, _Slider.tokens.rangeValueFontWeight, _Slider.tokens.rangeValueLetterSpacing, _Slider.tokens.rangeValueLineHeight, _Slider.classes.hideMinValue, _Slider.classes.hideMaxValue, _Slider.classes.activeRangeValue, _Slider.tokens.labelColor);
|
22
22
|
var SliderBaseWrapper = exports.SliderBaseWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
23
23
|
componentId: "plasma-new-hope__sc-1qm4elt-4"
|
24
|
-
})(["position:relative;display:flex;flex:1;&.", "{", "{position:absolute;bottom:
|
24
|
+
})(["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(", ");}}}"], _Slider.classes.rangeValuesPlacementOuter, StyledRangeValue, _Slider.tokens.rangeValueBottomOffset, _Slider.classes.maxRangeValue, _Slider.classes.rangeValuesPlacementInner, StyledRangeValue, _Slider.tokens.rangeMinValueMargin, _Slider.classes.maxRangeValue, _Slider.tokens.rangeMaxValueMargin);
|
25
25
|
var SingleWrapper = exports.SingleWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
26
26
|
componentId: "plasma-new-hope__sc-1qm4elt-5"
|
27
|
-
})(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}
|
27
|
+
})(["display:flex;opacity:var(", ");&.", "{flex-direction:column;", "{margin-bottom:var(", ");}}&.", "{", "{margin-right:var(", ");}}"], _Slider.tokens.disabledOpacity, _Slider.classes.labelPlacementOuter, LabelWrapper, _Slider.tokens.labelWrapperMarginBottom, _Slider.classes.labelPlacementInner, LabelWrapper, _Slider.tokens.labelWrapperMarginRight);
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.SliderBase = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _hooks = /*#__PURE__*/require("../../../../hooks");
|
10
|
-
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
11
|
-
var _utils = /*#__PURE__*/require("../../../../utils");
|
12
10
|
var _SliderBase = /*#__PURE__*/require("./SliderBase.styles");
|
13
11
|
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
12
|
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; }
|
@@ -24,9 +22,6 @@ var SliderBase = exports.SliderBase = function SliderBase(_ref) {
|
|
24
22
|
labelPlacement = _ref.labelPlacement,
|
25
23
|
rangeValuesPlacement = _ref.rangeValuesPlacement,
|
26
24
|
onChange = _ref.onChange,
|
27
|
-
orientation = _ref.orientation,
|
28
|
-
size = _ref.size,
|
29
|
-
sliderAlign = _ref.sliderAlign,
|
30
25
|
_ref$settings = _ref.settings,
|
31
26
|
settings = _ref$settings === void 0 ? {} : _ref$settings;
|
32
27
|
var _settings$indent = settings.indent,
|
@@ -35,43 +30,34 @@ var SliderBase = exports.SliderBase = function SliderBase(_ref) {
|
|
35
30
|
fontSizeMultiplier = _settings$fontSizeMul === void 0 ? 16 : _settings$fontSizeMul;
|
36
31
|
var ref = (0, _react.useRef)(null);
|
37
32
|
var gap = indent * fontSizeMultiplier * 2;
|
38
|
-
var isVertical = orientation === 'vertical';
|
39
33
|
(0, _react.useEffect)(function () {
|
40
34
|
var resizeHandler = function resizeHandler() {
|
41
35
|
if (ref.current) {
|
42
|
-
var railSize =
|
36
|
+
var railSize = ref.current.offsetWidth - gap;
|
43
37
|
var totalSteps = max - min;
|
44
38
|
setStepSize(railSize / totalSteps);
|
45
39
|
}
|
46
40
|
};
|
47
41
|
resizeHandler();
|
48
|
-
}, [labelPlacement, rangeValuesPlacement
|
49
|
-
// для перерасчета размеров
|
50
|
-
size, sliderAlign]);
|
42
|
+
}, [labelPlacement, rangeValuesPlacement]);
|
51
43
|
var onHandleChange = function onHandleChange(e) {
|
52
44
|
if (!onChange || disabled) {
|
53
45
|
return;
|
54
46
|
}
|
55
47
|
var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
|
56
48
|
x = _e$currentTarget$getB.x,
|
57
|
-
width = _e$currentTarget$getB.width
|
58
|
-
|
59
|
-
|
60
|
-
var lastPos = isVertical ? e.clientY - y : e.clientX - x;
|
61
|
-
var sliderWidth = isVertical ? height : width;
|
62
|
-
var position = min + lastPos / (sliderWidth - gap) * (max - min);
|
49
|
+
width = _e$currentTarget$getB.width;
|
50
|
+
var lastX = e.clientX - x;
|
51
|
+
var position = min + lastX / (width - gap) * (max - min);
|
63
52
|
var result = Math.max(min, Math.min(max, position));
|
64
|
-
|
65
|
-
|
66
|
-
}
|
67
|
-
lastX: lastPos
|
68
|
-
};
|
69
|
-
onChange(result, data);
|
53
|
+
onChange(result, {
|
54
|
+
lastX: lastX
|
55
|
+
});
|
70
56
|
};
|
71
57
|
(0, _hooks.useIsomorphicLayoutEffect)(function () {
|
72
58
|
var resizeHandler = function resizeHandler() {
|
73
59
|
if (ref.current) {
|
74
|
-
var railSize =
|
60
|
+
var railSize = ref.current.offsetWidth - gap;
|
75
61
|
var totalSteps = max - min;
|
76
62
|
setStepSize(railSize / totalSteps);
|
77
63
|
}
|
@@ -81,18 +67,13 @@ var SliderBase = exports.SliderBase = function SliderBase(_ref) {
|
|
81
67
|
return function () {
|
82
68
|
return window.removeEventListener('resize', resizeHandler);
|
83
69
|
};
|
84
|
-
}, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement
|
85
|
-
var fillStyle =
|
86
|
-
top: "".concat(railFillXPosition, "px"),
|
87
|
-
height: "".concat(railFillWidth, "px"),
|
88
|
-
width: '100%'
|
89
|
-
} : {
|
70
|
+
}, [min, max, setStepSize, gap, labelPlacement, rangeValuesPlacement]);
|
71
|
+
var fillStyle = {
|
90
72
|
left: "".concat(railFillXPosition, "px"),
|
91
73
|
width: "".concat(railFillWidth, "px")
|
92
74
|
};
|
93
75
|
return /*#__PURE__*/_react["default"].createElement(_SliderBase.Slider, {
|
94
|
-
ref: ref
|
95
|
-
className: (0, _utils.cx)(orientation === 'vertical' && _Slider.classes.verticalOrientation)
|
76
|
+
ref: ref
|
96
77
|
}, /*#__PURE__*/_react["default"].createElement(_SliderBase.RailWrap, {
|
97
78
|
"aria-hidden": "true",
|
98
79
|
onMouseDown: onHandleChange
|
@@ -8,15 +8,15 @@ var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/requir
|
|
8
8
|
var _mixins = /*#__PURE__*/require("../../../../mixins");
|
9
9
|
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
-
var Rail = exports.Rail = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
|
-
componentId: "plasma-new-hope__sc-ik0bjb-0"
|
13
|
-
})(["position:relative;top:50%;height:var(", ");border-radius:var(", ");background-color:var(", ");overflow:hidden;transform:translateY(-50%);"], _Slider.tokens.railThickness, _Slider.tokens.railBorderRadius, _Slider.tokens.railBackgroundColor);
|
14
11
|
var Slider = exports.Slider = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
15
|
-
componentId: "plasma-new-hope__sc-ik0bjb-
|
16
|
-
})(["flex:1;position:relative;user-select:none;height:var(", ")
|
12
|
+
componentId: "plasma-new-hope__sc-ik0bjb-0"
|
13
|
+
})(["flex:1;position:relative;user-select:none;height:var(", ");"], _Slider.tokens.height);
|
17
14
|
var RailWrap = exports.RailWrap = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
18
|
-
componentId: "plasma-new-hope__sc-ik0bjb-
|
15
|
+
componentId: "plasma-new-hope__sc-ik0bjb-1"
|
19
16
|
})(["height:100%;"]);
|
17
|
+
var Rail = exports.Rail = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
18
|
+
componentId: "plasma-new-hope__sc-ik0bjb-2"
|
19
|
+
})(["position:relative;top:50%;height:var(", ");border-radius:var(", ");background-color:var(", ");overflow:hidden;transform:translateY(-50%);"], _Slider.tokens.railHeight, _Slider.tokens.railBorderRadius, _Slider.tokens.railBackgroundColor);
|
20
20
|
var Fill = exports.Fill = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
21
21
|
componentId: "plasma-new-hope__sc-ik0bjb-3"
|
22
22
|
})(["position:absolute;height:100%;top:0;left:0;background:var(", ");width:0;"], _Slider.tokens.fillColor);
|
@@ -7,20 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.Handler = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _reactDraggable = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react-draggable"));
|
10
|
-
var _utils = /*#__PURE__*/require("
|
11
|
-
var _utils2 = /*#__PURE__*/require("../../utils");
|
10
|
+
var _utils = /*#__PURE__*/require("../../utils");
|
12
11
|
var _Thumb = /*#__PURE__*/require("../Thumb/Thumb");
|
13
|
-
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
14
12
|
var _Handler = /*#__PURE__*/require("./Handler.styles");
|
15
|
-
var
|
16
|
-
var _excluded = ["size", "orientation", "stepSize", "onChangeCommitted", "onChange", "position", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value", "valuePlacement"];
|
13
|
+
var _excluded = ["stepSize", "onChangeCommitted", "onChange", "xPosition", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value"];
|
17
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18
15
|
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); }
|
19
16
|
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; }
|
20
17
|
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); }
|
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
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
25
19
|
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
20
|
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); }
|
@@ -31,14 +25,22 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
31
25
|
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
26
|
// TODO: PLASMA-1707
|
33
27
|
|
28
|
+
var KeyboardSupport = {
|
29
|
+
PageUp: 33,
|
30
|
+
PageDown: 34,
|
31
|
+
End: 35,
|
32
|
+
Home: 36,
|
33
|
+
ArrowLeft: 37,
|
34
|
+
ArrowUp: 38,
|
35
|
+
ArrowRight: 39,
|
36
|
+
ArrowDown: 40
|
37
|
+
};
|
34
38
|
var Handler = exports.Handler = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
35
|
-
var
|
36
|
-
orientation = _ref.orientation,
|
37
|
-
stepSize = _ref.stepSize,
|
39
|
+
var stepSize = _ref.stepSize,
|
38
40
|
onChangeCommitted = _ref.onChangeCommitted,
|
39
41
|
onChange = _ref.onChange,
|
40
|
-
_ref$
|
41
|
-
|
42
|
+
_ref$xPosition = _ref.xPosition,
|
43
|
+
xPosition = _ref$xPosition === void 0 ? 0 : _ref$xPosition,
|
42
44
|
min = _ref.min,
|
43
45
|
max = _ref.max,
|
44
46
|
_ref$bounds = _ref.bounds,
|
@@ -53,88 +55,122 @@ var Handler = exports.Handler = /*#__PURE__*/(0, _react.forwardRef)(function (_r
|
|
53
55
|
_ref$endOffset = _ref.endOffset,
|
54
56
|
endOffset = _ref$endOffset === void 0 ? 0 : _ref$endOffset,
|
55
57
|
value = _ref.value,
|
56
|
-
valuePlacement = _ref.valuePlacement,
|
57
58
|
rest = _objectWithoutProperties(_ref, _excluded);
|
58
|
-
var isVertical = orientation === 'vertical';
|
59
59
|
var lastOnChangeValue = (0, _react.useRef)();
|
60
|
-
var _getOffsets = (0,
|
60
|
+
var _getOffsets = (0, _utils.getOffsets)(ref, side),
|
61
61
|
_getOffsets2 = _slicedToArray(_getOffsets, 2),
|
62
|
-
|
63
|
-
|
62
|
+
offsetLeft = _getOffsets2[0],
|
63
|
+
offsetRight = _getOffsets2[1];
|
64
64
|
var _bounds = _slicedToArray(bounds, 2),
|
65
|
-
|
66
|
-
|
67
|
-
var
|
68
|
-
var
|
69
|
-
var
|
70
|
-
x:
|
71
|
-
y:
|
65
|
+
leftValueBound = _bounds[0],
|
66
|
+
rightValueBound = _bounds[1];
|
67
|
+
var leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;
|
68
|
+
var rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;
|
69
|
+
var position = typeof xPosition === 'number' ? {
|
70
|
+
x: xPosition,
|
71
|
+
y: 0
|
72
72
|
} : undefined;
|
73
73
|
var tabIndex = disabled ? -1 : 0;
|
74
|
-
var computedBounds =
|
75
|
-
|
74
|
+
var computedBounds = {
|
75
|
+
left: (leftPositionBound !== null && leftPositionBound !== void 0 ? leftPositionBound : 0) - (offsetLeft ? stepSize : 0),
|
76
|
+
right: (rightPositionBound !== null && rightPositionBound !== void 0 ? rightPositionBound : stepSize * (max - min)) - (offsetRight ? stepSize : 0)
|
77
|
+
};
|
78
|
+
var showCurrentValueCondition = showCurrentValue && (xPosition >= startOffset && xPosition <= max * stepSize - endOffset || xPosition === 0 && value !== 0);
|
76
79
|
var onDrag = function onDrag(_, data) {
|
77
|
-
var newValue = (0,
|
80
|
+
var newValue = (0, _utils.getSliderThumbValue)(data.x, stepSize, min, max);
|
78
81
|
if (lastOnChangeValue.current !== newValue) {
|
79
82
|
onChange === null || onChange === void 0 || onChange(newValue, data);
|
80
83
|
lastOnChangeValue.current = newValue;
|
81
84
|
}
|
82
85
|
};
|
83
86
|
var onStop = function onStop(_, data) {
|
84
|
-
var newValue = (0,
|
87
|
+
var newValue = (0, _utils.getSliderThumbValue)(data.x, stepSize, min, max);
|
85
88
|
onChangeCommitted && onChangeCommitted(newValue, data);
|
86
89
|
};
|
87
90
|
var onKeyPress = function onKeyPress(event) {
|
88
91
|
event.persist();
|
89
|
-
var
|
90
|
-
|
91
|
-
|
92
|
-
stepSize: stepSize,
|
93
|
-
position: position,
|
94
|
-
max: max,
|
95
|
-
computedMultipleSteps: computedMultipleSteps
|
96
|
-
});
|
97
|
-
if (!data) {
|
92
|
+
var keyCode = event.keyCode,
|
93
|
+
target = event.target;
|
94
|
+
if (!Object.values(KeyboardSupport).includes(keyCode)) {
|
98
95
|
return;
|
99
96
|
}
|
97
|
+
var ArrowUp = KeyboardSupport.ArrowUp,
|
98
|
+
ArrowRight = KeyboardSupport.ArrowRight,
|
99
|
+
ArrowDown = KeyboardSupport.ArrowDown,
|
100
|
+
ArrowLeft = KeyboardSupport.ArrowLeft,
|
101
|
+
Home = KeyboardSupport.Home,
|
102
|
+
End = KeyboardSupport.End,
|
103
|
+
PageDown = KeyboardSupport.PageDown,
|
104
|
+
PageUp = KeyboardSupport.PageUp;
|
105
|
+
var computedMultipleSteps = stepSize * (rest.multipleStepSize / 100 * max);
|
106
|
+
var data = {
|
107
|
+
x: 0,
|
108
|
+
deltaX: stepSize,
|
109
|
+
lastX: xPosition,
|
110
|
+
y: 0,
|
111
|
+
deltaY: 0,
|
112
|
+
lastY: 0,
|
113
|
+
node: target
|
114
|
+
};
|
115
|
+
switch (keyCode) {
|
116
|
+
case ArrowUp:
|
117
|
+
case ArrowRight:
|
118
|
+
data.x = xPosition + stepSize;
|
119
|
+
break;
|
120
|
+
case ArrowDown:
|
121
|
+
case ArrowLeft:
|
122
|
+
data.x = xPosition - stepSize;
|
123
|
+
data.deltaX = -stepSize;
|
124
|
+
break;
|
125
|
+
case PageUp:
|
126
|
+
data.x = xPosition + computedMultipleSteps;
|
127
|
+
data.deltaX = computedMultipleSteps;
|
128
|
+
break;
|
129
|
+
case PageDown:
|
130
|
+
data.x = xPosition - computedMultipleSteps;
|
131
|
+
data.deltaX = -computedMultipleSteps;
|
132
|
+
break;
|
133
|
+
case End:
|
134
|
+
data.x = max * stepSize;
|
135
|
+
break;
|
136
|
+
case Home:
|
137
|
+
data.x = 0;
|
138
|
+
break;
|
139
|
+
default:
|
140
|
+
data.x = 0;
|
141
|
+
}
|
100
142
|
var left = computedBounds.left,
|
101
|
-
right = computedBounds.right
|
102
|
-
top = computedBounds.top,
|
103
|
-
bottom = computedBounds.bottom;
|
143
|
+
right = computedBounds.right;
|
104
144
|
|
105
145
|
/*
|
106
146
|
* INFO: Находим значение в диапазоне между указанными левой и правой границами.
|
107
|
-
* Или между верхней и нижней
|
108
147
|
* Необходимо для правильного расчета положения SliderThumb.
|
109
148
|
* см. функция clamp
|
110
149
|
*/
|
111
|
-
var boundedValue =
|
112
|
-
var computedValue = (0,
|
150
|
+
var boundedValue = Math.max(Math.min(right, data.x), left);
|
151
|
+
var computedValue = (0, _utils.getSliderThumbValue)(boundedValue, stepSize, min, max);
|
113
152
|
lastOnChangeValue.current = computedValue;
|
114
153
|
onChangeCommitted && onChangeCommitted(computedValue, data);
|
115
154
|
};
|
116
155
|
return /*#__PURE__*/_react["default"].createElement(_reactDraggable["default"], {
|
117
|
-
axis:
|
156
|
+
axis: "x",
|
118
157
|
bounds: computedBounds,
|
119
|
-
grid:
|
158
|
+
grid: [stepSize, 1],
|
120
159
|
onStop: onStop,
|
121
160
|
onDrag: onDrag,
|
122
|
-
position:
|
161
|
+
position: position,
|
123
162
|
disabled: disabled
|
124
163
|
}, /*#__PURE__*/_react["default"].createElement(_Handler.HandlerStyled, {
|
125
164
|
ref: ref,
|
126
165
|
style: {
|
127
166
|
zIndex: zIndex
|
128
167
|
},
|
129
|
-
className: (0, _utils.cx)(isVertical && _Slider.classes.verticalOrientation, valuePlacement === 'left' && _Slider.classes.valuePlacementLeft),
|
130
|
-
isLarge: size === 'large',
|
131
168
|
onKeyDown: onKeyPress
|
132
|
-
},
|
169
|
+
}, /*#__PURE__*/_react["default"].createElement(_Thumb.Thumb, _extends({
|
133
170
|
tabIndex: tabIndex,
|
134
171
|
min: min,
|
135
172
|
max: max,
|
136
173
|
value: value,
|
137
|
-
disabled: disabled
|
138
|
-
orientation: orientation
|
174
|
+
disabled: disabled
|
139
175
|
}, rest)), showCurrentValueCondition && /*#__PURE__*/_react["default"].createElement(_Handler.StyledValue, null, value)));
|
140
176
|
});
|
@@ -7,12 +7,9 @@ exports.StyledValue = exports.HandlerStyled = void 0;
|
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var StyledValue = exports.StyledValue = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
11
|
-
componentId: "plasma-new-hope__sc-a1py3c-0"
|
12
|
-
})(["position:absolute;z-index:1;top:var(", ");text-align:center;width:100%;margin-left:-0.125rem;display:flex;justify-content:center;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], _Slider.tokens.currentValueTopOffset, _Slider.tokens.valueFontFamily, _Slider.tokens.valueFontSize, _Slider.tokens.valueFontStyle, _Slider.tokens.valueFontWeight, _Slider.tokens.valueLetterSpacing, _Slider.tokens.valueLineHeight);
|
13
10
|
var HandlerStyled = exports.HandlerStyled = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-a1py3c-0"
|
12
|
+
})(["cursor:pointer;position:absolute;z-index:1;top:0;left:0;"]);
|
13
|
+
var StyledValue = exports.StyledValue = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
14
14
|
componentId: "plasma-new-hope__sc-a1py3c-1"
|
15
|
-
})(["
|
16
|
-
var isLarge = _ref.isLarge;
|
17
|
-
return isLarge ? "var(".concat(_Slider.tokens.thumbSizeLarge, ")") : "var(".concat(_Slider.tokens.thumbSize, ")");
|
18
|
-
}, _Slider.classes.verticalOrientation, StyledValue, _Slider.tokens.size, _Slider.tokens.size, _Slider.classes.valuePlacementLeft, StyledValue, _Slider.tokens.size, _Slider.tokens.size);
|
15
|
+
})(["position:absolute;z-index:1;top:var(", ");text-align:center;width:100%;margin-left:-0.125rem;display:flex;justify-content:center;font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");"], _Slider.tokens.currentValueTopOffset, _Slider.tokens.currentValueFontFamily, _Slider.tokens.currentValueFontSize, _Slider.tokens.currentValueFontStyle, _Slider.tokens.currentValueFontWeight, _Slider.tokens.currentValueLetterSpacing, _Slider.tokens.currentValueLineHeight);
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.Thumb = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
8
|
var _Thumb = /*#__PURE__*/require("./Thumb.styles");
|
9
|
-
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"
|
9
|
+
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"];
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
11
|
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); }
|
12
12
|
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; }
|
@@ -19,7 +19,6 @@ var Thumb = exports.Thumb = function Thumb(_ref) {
|
|
19
19
|
ariaValueMin = _ref$ariaValueMin === void 0 ? min : _ref$ariaValueMin,
|
20
20
|
ariaLabel = _ref.ariaLabel,
|
21
21
|
disabled = _ref.disabled,
|
22
|
-
orientation = _ref.orientation,
|
23
22
|
rest = _objectWithoutProperties(_ref, _excluded);
|
24
23
|
return /*#__PURE__*/_react["default"].createElement(_Thumb.ThumbBase, _extends({
|
25
24
|
role: "slider",
|
@@ -28,6 +27,6 @@ var Thumb = exports.Thumb = function Thumb(_ref) {
|
|
28
27
|
"aria-valuemax": max,
|
29
28
|
"aria-valuenow": value,
|
30
29
|
disabled: disabled,
|
31
|
-
"aria-orientation":
|
30
|
+
"aria-orientation": "horizontal"
|
32
31
|
}, rest));
|
33
32
|
};
|
@@ -10,8 +10,8 @@ var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
11
|
var ThumbBase = exports.ThumbBase = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
12
|
componentId: "plasma-new-hope__sc-13botku-0"
|
13
|
-
})(["width:var(
|
14
|
-
outlineOffset: '0.
|
13
|
+
})(["width:var(", ");height:var(", ");position:relative;left:-0.125rem;top:-0.125rem;border-radius:50%;box-sizing:border-box;background:var(", ");margin:0.125rem;transition:border-color 0.1s ease-in-out;&:after{background:var(", ");margin:-0.125rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}&:not([disabled]):hover:after,&:not([disabled]):active:after{background:var(", ");}&[disabled]{cursor:not-allowed;}&:focus{outline:none;}", ""], _Slider.tokens.thumbSize, _Slider.tokens.thumbSize, _Slider.tokens.thumbBackgroundColor, _Slider.tokens.thumbBorderColor, _Slider.tokens.thumbFocusBorderColor, /*#__PURE__*/(0, _mixins.addFocus)({
|
14
|
+
outlineOffset: '0.125rem',
|
15
15
|
outlineSize: '0.125rem',
|
16
16
|
outlineRadius: '50%',
|
17
17
|
outlineColor: /*#__PURE__*/"var(".concat(_Slider.tokens.thumbFocusBorderColor, ")")
|
@@ -14,8 +14,8 @@ exports.sizeData = void 0;
|
|
14
14
|
* @param {number} max
|
15
15
|
* @return {number}
|
16
16
|
*/
|
17
|
-
function getSliderThumbValue(
|
18
|
-
var newValue = Math.round(
|
17
|
+
function getSliderThumbValue(handleCenterXRelative, stepSize, min, max) {
|
18
|
+
var newValue = Math.round(handleCenterXRelative / stepSize) + min;
|
19
19
|
return Math.min(Math.max(newValue, min), max);
|
20
20
|
}
|
21
21
|
|
@@ -26,11 +26,11 @@ function getSliderThumbValue(handleCenterPosRelative, stepSize, min, max) {
|
|
26
26
|
* @param {'left' | 'right'} side
|
27
27
|
* @return Array<number>
|
28
28
|
*/
|
29
|
-
function getOffsets(ref, side
|
29
|
+
function getOffsets(ref, side) {
|
30
30
|
if (!ref || !('current' in ref) || !ref.current || !side) {
|
31
31
|
return [0, 0];
|
32
32
|
}
|
33
|
-
var size =
|
33
|
+
var size = ref.current.clientWidth;
|
34
34
|
if (side === 'left') {
|
35
35
|
return [0, size];
|
36
36
|
}
|
@@ -41,33 +41,15 @@ function getOffsets(ref, side, isVertical) {
|
|
41
41
|
}
|
42
42
|
var sizeData = exports.sizeData = {
|
43
43
|
s: {
|
44
|
-
|
45
|
-
|
46
|
-
fontSizeMultiplier: 16
|
47
|
-
},
|
48
|
-
large: {
|
49
|
-
indent: 0.625,
|
50
|
-
fontSizeMultiplier: 16
|
51
|
-
}
|
44
|
+
indent: 0.5,
|
45
|
+
fontSizeMultiplier: 16
|
52
46
|
},
|
53
47
|
m: {
|
54
|
-
|
55
|
-
|
56
|
-
fontSizeMultiplier: 16
|
57
|
-
},
|
58
|
-
large: {
|
59
|
-
indent: 0.625,
|
60
|
-
fontSizeMultiplier: 16
|
61
|
-
}
|
48
|
+
indent: 0.75,
|
49
|
+
fontSizeMultiplier: 16
|
62
50
|
},
|
63
51
|
l: {
|
64
|
-
|
65
|
-
|
66
|
-
fontSizeMultiplier: 16
|
67
|
-
},
|
68
|
-
large: {
|
69
|
-
indent: 0.625,
|
70
|
-
fontSizeMultiplier: 16
|
71
|
-
}
|
52
|
+
indent: 0.75,
|
53
|
+
fontSizeMultiplier: 16
|
72
54
|
}
|
73
55
|
};
|
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.base = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
|
-
var
|
9
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{height:100%;display:inline-flex;}"], _Slider.classes.verticalOrientation);
|
8
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([""]);
|
@@ -20,7 +20,8 @@ var classes = exports.classes = {
|
|
20
20
|
tabsHasTopArrow: 'tabs-has-top-arrow',
|
21
21
|
tabsHasBottomArrow: 'tabs-has-bottom-arrow',
|
22
22
|
tabsClipScroll: 'tabs-clip-scroll',
|
23
|
-
tabsClipShowAll: 'tabs-clip-show-all'
|
23
|
+
tabsClipShowAll: 'tabs-clip-show-all',
|
24
|
+
tabsTruncate: 'tabs-truncate'
|
24
25
|
};
|
25
26
|
var tokens = exports.tokens = {
|
26
27
|
disabledOpacity: '--plasma-tabs-disabled-opacity',
|
package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js
CHANGED
@@ -14,11 +14,17 @@ var _base = /*#__PURE__*/require("./variations/_view/base");
|
|
14
14
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
15
15
|
var _base3 = /*#__PURE__*/require("./variations/_pilled/base");
|
16
16
|
var _base4 = /*#__PURE__*/require("./variations/_disabled/base");
|
17
|
+
var _base5 = /*#__PURE__*/require("./variations/_truncate/base");
|
17
18
|
var _HorizontalTabItem = /*#__PURE__*/require("./HorizontalTabItem.styles");
|
18
|
-
var _excluded = ["size", "view", "isActive", "selected", "disabled", "pilled", "children", "value", "contentLeft", "contentRight", "animated", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick"];
|
19
|
+
var _excluded = ["size", "view", "isActive", "selected", "disabled", "pilled", "children", "value", "contentLeft", "contentRight", "animated", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick", "maxWidth"];
|
19
20
|
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); }
|
20
21
|
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; }
|
21
22
|
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); }
|
23
|
+
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; }
|
24
|
+
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; }
|
25
|
+
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; }
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
27
|
+
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); }
|
22
28
|
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; }
|
23
29
|
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; }
|
24
30
|
var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalTabItemRoot(Root) {
|
@@ -42,11 +48,13 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
42
48
|
tabIndex = props.tabIndex,
|
43
49
|
className = props.className,
|
44
50
|
onClick = props.onClick,
|
51
|
+
maxWidth = props.maxWidth,
|
45
52
|
rest = _objectWithoutProperties(props, _excluded);
|
46
53
|
var innerRef = (0, _react.useRef)(null);
|
47
54
|
var ref = (0, _plasmaCore.useForkRef)(outerRef, innerRef);
|
48
55
|
var refs = (0, _react.useContext)(_TabsContext.TabsContext);
|
49
56
|
var role = 'tab';
|
57
|
+
var truncate = maxWidth !== 'auto';
|
50
58
|
var pilledAttr = view !== 'clear' && pilled;
|
51
59
|
var animatedClass = animated ? _tokens.classes.tabItemAnimated : undefined;
|
52
60
|
var pilledClass = pilledAttr ? _tokens.classes.tabsPilled : undefined;
|
@@ -103,11 +111,16 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
103
111
|
role: role,
|
104
112
|
view: view,
|
105
113
|
size: size,
|
114
|
+
truncate: truncate,
|
106
115
|
onFocus: onItemFocus,
|
107
116
|
tabIndex: hasKeyNavigation ? navigationTabIndex : tabIndex,
|
108
|
-
className: (0, _utils.cx)(pilledClass, selectedClass, animatedClass, className),
|
117
|
+
className: (0, _utils.cx)(pilledClass, selectedClass, animatedClass, truncate && _tokens.classes.tabsTruncate, className),
|
109
118
|
onClick: handleClick
|
110
|
-
}, rest
|
119
|
+
}, rest, {
|
120
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
121
|
+
maxWidth: maxWidth
|
122
|
+
})
|
123
|
+
}), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, contentLeft && /*#__PURE__*/_react["default"].createElement(_HorizontalTabItem.LeftContent, {
|
111
124
|
className: _tokens.classes.tabLeftContent
|
112
125
|
}, contentLeft), /*#__PURE__*/_react["default"].createElement(_HorizontalTabItem.StyledContent, {
|
113
126
|
className: _tokens.classes.tabContent
|
@@ -134,6 +147,9 @@ var horizontalTabItemConfig = exports.horizontalTabItemConfig = {
|
|
134
147
|
},
|
135
148
|
pilled: {
|
136
149
|
css: _base3.base
|
150
|
+
},
|
151
|
+
truncate: {
|
152
|
+
css: _base5.base
|
137
153
|
}
|
138
154
|
},
|
139
155
|
defaults: {
|
@@ -10,7 +10,7 @@ var _mixins = /*#__PURE__*/require("../../../../../mixins");
|
|
10
10
|
var _tokens = /*#__PURE__*/require("../../../tokens");
|
11
11
|
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); }
|
12
12
|
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; }
|
13
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;align-items:center;gap:var(", ");padding:var(", ",var(", "));appearance:none;border:none;outline:none;cursor:pointer;-webkit-tap-highlight-color:transparent;&:first-child{margin-left:0;}", ";"], _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingClear, _tokens.tokens.itemPadding, /*#__PURE__*/(0, _mixins.addFocus)({
|
13
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;align-items:center;white-space:nowrap;gap:var(", ");padding:var(", ",var(", "));appearance:none;border:none;outline:none;cursor:pointer;-webkit-tap-highlight-color:transparent;&:first-child{margin-left:0;}", ";"], _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingClear, _tokens.tokens.itemPadding, /*#__PURE__*/(0, _mixins.addFocus)({
|
14
14
|
outlineSize: '0.063rem',
|
15
15
|
outlineOffset: '-0.125rem',
|
16
16
|
outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.base = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
|
+
var _tokens = /*#__PURE__*/require("../../../../../tokens");
|
9
|
+
var _HorizontalTabItem = /*#__PURE__*/require("../../HorizontalTabItem.styles");
|
10
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{", "{overflow:hidden;text-overflow:ellipsis;}", "{overflow:hidden;text-overflow:ellipsis;}}"], _tokens.classes.tabsTruncate, _HorizontalTabItem.StyledContent, _HorizontalTabItem.TabItemValue);
|