@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
@@ -29,6 +29,7 @@ type CustomStoryTabsProps = {
|
|
29
29
|
|
30
30
|
const contentLeftOptions = ['none', 'icon'];
|
31
31
|
const contentRightOptions = ['none', 'counter', 'icon'];
|
32
|
+
const labels = ['Label', 'Middle label', 'Very long label'];
|
32
33
|
|
33
34
|
const getContentLeft = (contentLeftOption: string, size: Size) => {
|
34
35
|
const iconSize = size === 'xs' ? 'xs' : 's';
|
@@ -57,6 +58,9 @@ const meta: Meta<StoryTabsProps> = {
|
|
57
58
|
title: 'plasma_b2c/Tabs',
|
58
59
|
component: Tabs,
|
59
60
|
decorators: [WithTheme],
|
61
|
+
args: {
|
62
|
+
maxWidth: '',
|
63
|
+
},
|
60
64
|
argTypes: {
|
61
65
|
...disableProps([
|
62
66
|
'orientation',
|
@@ -76,6 +80,12 @@ const meta: Meta<StoryTabsProps> = {
|
|
76
80
|
},
|
77
81
|
if: { arg: 'helperText', eq: '' },
|
78
82
|
},
|
83
|
+
maxWidth: {
|
84
|
+
control: {
|
85
|
+
type: 'text',
|
86
|
+
},
|
87
|
+
if: { arg: 'stretch', truthy: false },
|
88
|
+
},
|
79
89
|
},
|
80
90
|
};
|
81
91
|
|
@@ -90,13 +100,14 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
90
100
|
contentRight: contentRightOption,
|
91
101
|
hasDivider,
|
92
102
|
stretch,
|
103
|
+
maxWidth,
|
93
104
|
helperText,
|
94
105
|
} = props;
|
95
106
|
const items = Array(itemQuantity).fill(0);
|
96
107
|
const [index, setIndex] = useState(0);
|
97
108
|
|
98
109
|
return (
|
99
|
-
<Tabs view={hasDivider ? 'divider' : 'clear'} stretch={stretch} disabled={disabled} size={size}>
|
110
|
+
<Tabs clip="none" view={hasDivider ? 'divider' : 'clear'} stretch={stretch} disabled={disabled} size={size}>
|
100
111
|
{items.map((_, i) => {
|
101
112
|
if (helperText !== '') {
|
102
113
|
return (
|
@@ -110,8 +121,9 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
110
121
|
value={helperText}
|
111
122
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
112
123
|
size={size as Size}
|
124
|
+
maxWidth={maxWidth}
|
113
125
|
>
|
114
|
-
{
|
126
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
115
127
|
</TabItem>
|
116
128
|
);
|
117
129
|
}
|
@@ -127,8 +139,9 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
127
139
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
128
140
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
129
141
|
size={size as Size}
|
142
|
+
maxWidth={maxWidth}
|
130
143
|
>
|
131
|
-
{
|
144
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
132
145
|
</TabItem>
|
133
146
|
);
|
134
147
|
})}
|
@@ -147,6 +160,7 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
147
160
|
hasDivider,
|
148
161
|
helperText,
|
149
162
|
width,
|
163
|
+
maxWidth,
|
150
164
|
} = props;
|
151
165
|
const items = Array(itemQuantity).fill(0);
|
152
166
|
const [index, setIndex] = useState(0);
|
@@ -166,8 +180,9 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
166
180
|
value={helperText}
|
167
181
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
168
182
|
size={size as Size}
|
183
|
+
maxWidth={maxWidth}
|
169
184
|
>
|
170
|
-
{
|
185
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
171
186
|
</TabItem>
|
172
187
|
);
|
173
188
|
}
|
@@ -183,8 +198,9 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
183
198
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
184
199
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
185
200
|
size={size as Size}
|
201
|
+
maxWidth={maxWidth}
|
186
202
|
>
|
187
|
-
{
|
203
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
188
204
|
</TabItem>
|
189
205
|
);
|
190
206
|
})}
|
@@ -202,6 +218,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
202
218
|
contentRight: contentRightOption,
|
203
219
|
hasDivider,
|
204
220
|
helperText,
|
221
|
+
maxWidth,
|
205
222
|
} = props;
|
206
223
|
const maxItemQuantity = 3;
|
207
224
|
const items = Array(itemQuantity).fill(0);
|
@@ -234,8 +251,9 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
234
251
|
value={helperText}
|
235
252
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
236
253
|
size={size as Size}
|
254
|
+
maxWidth={maxWidth}
|
237
255
|
>
|
238
|
-
{
|
256
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
239
257
|
</TabItem>
|
240
258
|
);
|
241
259
|
}
|
@@ -251,8 +269,9 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
251
269
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
252
270
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
253
271
|
size={size as Size}
|
272
|
+
maxWidth={maxWidth}
|
254
273
|
>
|
255
|
-
{
|
274
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
256
275
|
</TabItem>
|
257
276
|
);
|
258
277
|
})}
|
@@ -269,6 +288,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
269
288
|
tabIndex={!disabled ? 0 : -1}
|
270
289
|
disabled={disabled}
|
271
290
|
size={size as Size}
|
291
|
+
maxWidth="auto"
|
272
292
|
>
|
273
293
|
ShowAll
|
274
294
|
</TabItem>
|
@@ -285,7 +305,7 @@ export const HorizontalTabs: StoryObj<HorizontalStoryTabsProps> = {
|
|
285
305
|
disabled: false,
|
286
306
|
hasDivider: true,
|
287
307
|
helperText: '',
|
288
|
-
itemQuantity:
|
308
|
+
itemQuantity: 6,
|
289
309
|
stretch: false,
|
290
310
|
width: '15rem',
|
291
311
|
},
|
@@ -343,6 +363,7 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
343
363
|
contentRight: contentRightOption,
|
344
364
|
hasDivider,
|
345
365
|
helperText,
|
366
|
+
maxWidth,
|
346
367
|
} = props;
|
347
368
|
const items = Array(itemQuantity).fill(0);
|
348
369
|
const [index, setIndex] = useState(0);
|
@@ -363,8 +384,9 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
363
384
|
value={helperText}
|
364
385
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
365
386
|
size={size as Size}
|
387
|
+
maxWidth={maxWidth}
|
366
388
|
>
|
367
|
-
{
|
389
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
368
390
|
</TabItem>
|
369
391
|
);
|
370
392
|
}
|
@@ -381,8 +403,9 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
381
403
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
382
404
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
383
405
|
size={size as Size}
|
406
|
+
maxWidth={maxWidth}
|
384
407
|
>
|
385
|
-
{
|
408
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
386
409
|
</TabItem>
|
387
410
|
);
|
388
411
|
})}
|
@@ -401,6 +424,7 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
401
424
|
hasDivider,
|
402
425
|
helperText,
|
403
426
|
height,
|
427
|
+
maxWidth,
|
404
428
|
} = props;
|
405
429
|
const items = Array(itemQuantity).fill(0);
|
406
430
|
const [index, setIndex] = useState(0);
|
@@ -428,8 +452,9 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
428
452
|
value={helperText}
|
429
453
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
430
454
|
size={size as Size}
|
455
|
+
maxWidth={maxWidth}
|
431
456
|
>
|
432
|
-
{
|
457
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
433
458
|
</TabItem>
|
434
459
|
);
|
435
460
|
}
|
@@ -446,8 +471,9 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
446
471
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
447
472
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
448
473
|
size={size as Size}
|
474
|
+
maxWidth={maxWidth}
|
449
475
|
>
|
450
|
-
{
|
476
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
451
477
|
</TabItem>
|
452
478
|
);
|
453
479
|
})}
|
@@ -465,6 +491,7 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
465
491
|
contentRight: contentRightOption,
|
466
492
|
hasDivider,
|
467
493
|
helperText,
|
494
|
+
maxWidth,
|
468
495
|
} = props;
|
469
496
|
const maxItemQuantity = 3;
|
470
497
|
const items = Array(itemQuantity).fill(0);
|
@@ -498,8 +525,9 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
498
525
|
value={helperText}
|
499
526
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
500
527
|
size={size as Size}
|
528
|
+
maxWidth={maxWidth}
|
501
529
|
>
|
502
|
-
{
|
530
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
503
531
|
</TabItem>
|
504
532
|
);
|
505
533
|
}
|
@@ -516,8 +544,9 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
516
544
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
517
545
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
518
546
|
size={size as Size}
|
547
|
+
maxWidth={maxWidth}
|
519
548
|
>
|
520
|
-
{
|
549
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
521
550
|
</TabItem>
|
522
551
|
);
|
523
552
|
})}
|
@@ -534,6 +563,7 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
534
563
|
tabIndex={!disabled ? 0 : -1}
|
535
564
|
disabled={disabled}
|
536
565
|
size={size as Size}
|
566
|
+
maxWidth="auto"
|
537
567
|
>
|
538
568
|
ShowAll
|
539
569
|
</TabItem>
|
@@ -548,10 +578,11 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
|
|
548
578
|
size: 'xs',
|
549
579
|
disabled: false,
|
550
580
|
hasDivider: true,
|
551
|
-
itemQuantity:
|
581
|
+
itemQuantity: 6,
|
552
582
|
orientation: 'vertical',
|
553
583
|
helperText: '',
|
554
584
|
height: '10rem',
|
585
|
+
maxWidth: '',
|
555
586
|
},
|
556
587
|
argTypes: {
|
557
588
|
contentLeft: {
|
@@ -612,6 +643,7 @@ const StoryHeaderTabs = (props: StoryTabsProps) => {
|
|
612
643
|
contentRight: contentRightOption,
|
613
644
|
hasDivider,
|
614
645
|
stretch,
|
646
|
+
maxWidth,
|
615
647
|
} = props;
|
616
648
|
const items = Array(itemQuantity).fill(0);
|
617
649
|
const [index, setIndex] = useState(0);
|
@@ -629,8 +661,9 @@ const StoryHeaderTabs = (props: StoryTabsProps) => {
|
|
629
661
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
630
662
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
631
663
|
size={size as HeaderSize}
|
664
|
+
maxWidth={maxWidth}
|
632
665
|
>
|
633
|
-
{
|
666
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
634
667
|
</TabItem>
|
635
668
|
))}
|
636
669
|
</Tabs>
|
@@ -18,9 +18,9 @@ var config = exports.config = {
|
|
18
18
|
gradient: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-solid-tertiary);", ":var(--on-light-surface-solid-card);", ":var(--surface-accent-gradient);", ":var(--surface-solid-tertiary);", ":var(--surface-accent-gradient);", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-primary);"], _Slider.sliderTokens.labelColor, _Slider.sliderTokens.rangeValueColor, _Slider.sliderTokens.thumbBorderColor, _Slider.sliderTokens.thumbBackgroundColor, _Slider.sliderTokens.thumbFocusBorderColor, _Slider.sliderTokens.railBackgroundColor, _Slider.sliderTokens.fillColor, _Slider.sliderTokens.textFieldColor, _Slider.sliderTokens.textFieldBackgroundColor, _Slider.sliderTokens.textFieldCaretColor, _Slider.sliderTokens.textFieldPlaceholderColor, _Slider.sliderTokens.textFiledFocusColor, _Slider.sliderTokens.textFieldActiveColor)
|
19
19
|
},
|
20
20
|
size: {
|
21
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":
|
22
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":
|
23
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":
|
21
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":0.75rem;", ":-1.25rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.5rem;", ":0.125rem solid;", ":1.625rem;", ":var(--plasma-typo-text-s-font-family);", ":var(--plasma-typo-text-s-font-size);", ":var(--plasma-typo-text-s-font-style);", ":var(--plasma-typo-text-s-font-weight);", ":var(--plasma-typo-text-s-letter-spacing);", ":var(--plasma-typo-text-s-line-height);", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3.5rem;", ":1.25rem 1rem 1.25rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], _Slider.sliderTokens.height, _Slider.sliderTokens.doubleWrapperGap, _Slider.sliderTokens.labelWrapperGap, _Slider.sliderTokens.labelWrapperMarginBottom, _Slider.sliderTokens.labelWrapperMarginRight, _Slider.sliderTokens.labelFontFamily, _Slider.sliderTokens.labelFontSize, _Slider.sliderTokens.labelFontStyle, _Slider.sliderTokens.labelFontWeight, _Slider.sliderTokens.labelLetterSpacing, _Slider.sliderTokens.labelLineHeight, _Slider.sliderTokens.rangeMinValueMargin, _Slider.sliderTokens.rangeMaxValueMargin, _Slider.sliderTokens.rangeValueBottomOffset, _Slider.sliderTokens.rangeValueFontFamily, _Slider.sliderTokens.rangeValueFontSize, _Slider.sliderTokens.rangeValueFontStyle, _Slider.sliderTokens.rangeValueFontWeight, _Slider.sliderTokens.rangeValueLetterSpacing, _Slider.sliderTokens.rangeValueLineHeight, _Slider.sliderTokens.thumbSize, _Slider.sliderTokens.thumbBorder, _Slider.sliderTokens.currentValueTopOffset, _Slider.sliderTokens.currentValueFontFamily, _Slider.sliderTokens.currentValueFontSize, _Slider.sliderTokens.currentValueFontStyle, _Slider.sliderTokens.currentValueFontWeight, _Slider.sliderTokens.currentValueLetterSpacing, _Slider.sliderTokens.currentValueLineHeight, _Slider.sliderTokens.railHeight, _Slider.sliderTokens.railBorderRadius, _Slider.sliderTokens.railIndent, _Slider.sliderTokens.textFieldWrapperGap, _Slider.sliderTokens.textFieldHeight, _Slider.sliderTokens.textFieldPadding, _Slider.sliderTokens.textFieldBorderRadius, _Slider.sliderTokens.textFieldFontFamily, _Slider.sliderTokens.textFieldFontSize, _Slider.sliderTokens.textFieldFontStyle, _Slider.sliderTokens.textFieldFontWeight, _Slider.sliderTokens.textFieldLetterSpacing, _Slider.sliderTokens.textFieldLineHeight),
|
22
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.75rem;", ":0.75rem;", ":-1.25rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.5rem;", ":0.125rem solid;", ":1.75rem;", ":var(--plasma-typo-text-xs-font-family);", ":var(--plasma-typo-text-xs-font-size);", ":var(--plasma-typo-text-xs-font-style);", ":var(--plasma-typo-text-xs-font-weight);", ":var(--plasma-typo-text-xs-letter-spacing);", ":var(--plasma-typo-text-xs-line-height);", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _Slider.sliderTokens.height, _Slider.sliderTokens.doubleWrapperGap, _Slider.sliderTokens.labelWrapperGap, _Slider.sliderTokens.labelWrapperMarginBottom, _Slider.sliderTokens.labelWrapperMarginRight, _Slider.sliderTokens.labelFontFamily, _Slider.sliderTokens.labelFontSize, _Slider.sliderTokens.labelFontStyle, _Slider.sliderTokens.labelFontWeight, _Slider.sliderTokens.labelLetterSpacing, _Slider.sliderTokens.labelLineHeight, _Slider.sliderTokens.rangeMinValueMargin, _Slider.sliderTokens.rangeMaxValueMargin, _Slider.sliderTokens.rangeValueBottomOffset, _Slider.sliderTokens.rangeValueFontFamily, _Slider.sliderTokens.rangeValueFontSize, _Slider.sliderTokens.rangeValueFontStyle, _Slider.sliderTokens.rangeValueFontWeight, _Slider.sliderTokens.rangeValueLetterSpacing, _Slider.sliderTokens.rangeValueLineHeight, _Slider.sliderTokens.thumbSize, _Slider.sliderTokens.thumbBorder, _Slider.sliderTokens.currentValueTopOffset, _Slider.sliderTokens.currentValueFontFamily, _Slider.sliderTokens.currentValueFontSize, _Slider.sliderTokens.currentValueFontStyle, _Slider.sliderTokens.currentValueFontWeight, _Slider.sliderTokens.currentValueLetterSpacing, _Slider.sliderTokens.currentValueLineHeight, _Slider.sliderTokens.railHeight, _Slider.sliderTokens.railBorderRadius, _Slider.sliderTokens.railIndent, _Slider.sliderTokens.textFieldWrapperGap, _Slider.sliderTokens.textFieldHeight, _Slider.sliderTokens.textFieldPadding, _Slider.sliderTokens.textFieldBorderRadius, _Slider.sliderTokens.textFieldFontFamily, _Slider.sliderTokens.textFieldFontSize, _Slider.sliderTokens.textFieldFontStyle, _Slider.sliderTokens.textFieldFontWeight, _Slider.sliderTokens.textFieldLetterSpacing, _Slider.sliderTokens.textFieldLineHeight),
|
23
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":0.5rem;", ":-1.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":0.125rem solid;", ":1.25rem;", ":var(--plasma-typo-text-xs-font-family);", ":var(--plasma-typo-text-xs-font-size);", ":var(--plasma-typo-text-xs-font-style);", ":var(--plasma-typo-text-xs-font-weight);", ":var(--plasma-typo-text-xs-letter-spacing);", ":var(--plasma-typo-text-xs-line-height);", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":2.5rem;", ":0.5rem 1rem 0.5rem 1rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Slider.sliderTokens.height, _Slider.sliderTokens.doubleWrapperGap, _Slider.sliderTokens.labelWrapperGap, _Slider.sliderTokens.labelWrapperMarginBottom, _Slider.sliderTokens.labelWrapperMarginRight, _Slider.sliderTokens.labelFontFamily, _Slider.sliderTokens.labelFontSize, _Slider.sliderTokens.labelFontStyle, _Slider.sliderTokens.labelFontWeight, _Slider.sliderTokens.labelLetterSpacing, _Slider.sliderTokens.labelLineHeight, _Slider.sliderTokens.rangeMinValueMargin, _Slider.sliderTokens.rangeMaxValueMargin, _Slider.sliderTokens.rangeValueBottomOffset, _Slider.sliderTokens.rangeValueFontFamily, _Slider.sliderTokens.rangeValueFontSize, _Slider.sliderTokens.rangeValueFontStyle, _Slider.sliderTokens.rangeValueFontWeight, _Slider.sliderTokens.rangeValueLetterSpacing, _Slider.sliderTokens.rangeValueLineHeight, _Slider.sliderTokens.thumbSize, _Slider.sliderTokens.thumbBorder, _Slider.sliderTokens.currentValueTopOffset, _Slider.sliderTokens.currentValueFontFamily, _Slider.sliderTokens.currentValueFontSize, _Slider.sliderTokens.currentValueFontStyle, _Slider.sliderTokens.currentValueFontWeight, _Slider.sliderTokens.currentValueLetterSpacing, _Slider.sliderTokens.currentValueLineHeight, _Slider.sliderTokens.railHeight, _Slider.sliderTokens.railBorderRadius, _Slider.sliderTokens.railIndent, _Slider.sliderTokens.textFieldWrapperGap, _Slider.sliderTokens.textFieldHeight, _Slider.sliderTokens.textFieldPadding, _Slider.sliderTokens.textFieldBorderRadius, _Slider.sliderTokens.textFieldFontFamily, _Slider.sliderTokens.textFieldFontSize, _Slider.sliderTokens.textFieldFontStyle, _Slider.sliderTokens.textFieldFontWeight, _Slider.sliderTokens.textFieldLetterSpacing, _Slider.sliderTokens.textFieldLineHeight)
|
24
24
|
},
|
25
25
|
disabled: {
|
26
26
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Slider.sliderTokens.disabledOpacity)
|
@@ -4,18 +4,14 @@ import styled from 'styled-components';
|
|
4
4
|
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
5
|
import type { StoryObj, Meta } from '@storybook/react';
|
6
6
|
|
7
|
-
import { IconMic } from '../../../../components/_Icon';
|
8
7
|
import { WithTheme } from '../../../_helpers';
|
9
8
|
|
10
9
|
import { Slider } from './Slider';
|
11
10
|
|
12
11
|
const sizes = ['l', 'm', 's'];
|
13
|
-
const pointerSizes = ['small', 'large', 'none'];
|
14
12
|
const views = ['default', 'accent', 'gradient'];
|
15
|
-
const
|
16
|
-
const
|
17
|
-
const scaleAligns = ['side', 'bottom'];
|
18
|
-
const orientations: Array<string> = ['vertical', 'horizontal'];
|
13
|
+
const labelPlacements = ['outer', 'inner'];
|
14
|
+
const rangeValuesPlacement = ['outer', 'inner'];
|
19
15
|
|
20
16
|
const meta: Meta<typeof Slider> = {
|
21
17
|
title: 'plasma_web/Slider',
|
@@ -34,24 +30,9 @@ const meta: Meta<typeof Slider> = {
|
|
34
30
|
type: 'inline-radio',
|
35
31
|
},
|
36
32
|
},
|
37
|
-
pointerSize: {
|
38
|
-
options: pointerSizes,
|
39
|
-
control: {
|
40
|
-
type: 'inline-radio',
|
41
|
-
},
|
42
|
-
},
|
43
|
-
orientation: {
|
44
|
-
options: orientations,
|
45
|
-
control: {
|
46
|
-
type: 'select',
|
47
|
-
},
|
48
|
-
},
|
49
33
|
...disableProps([
|
50
34
|
'value',
|
51
35
|
'onChangeCommitted',
|
52
|
-
'onChangeTextField',
|
53
|
-
'onBlurTextField',
|
54
|
-
'onKeyDownTextField',
|
55
36
|
'ariaLabel',
|
56
37
|
'onChange',
|
57
38
|
'fontSizeMultiplier',
|
@@ -59,14 +40,6 @@ const meta: Meta<typeof Slider> = {
|
|
59
40
|
'settings',
|
60
41
|
'hasHoverAnimation',
|
61
42
|
'type',
|
62
|
-
'labelContentLeft',
|
63
|
-
'rangeValuesPlacement',
|
64
|
-
'name',
|
65
|
-
'defaultValue',
|
66
|
-
'labelContent',
|
67
|
-
'showRangeValues',
|
68
|
-
'hideMinValueDiff',
|
69
|
-
'hideMaxValueDiff',
|
70
43
|
]),
|
71
44
|
},
|
72
45
|
};
|
@@ -79,9 +52,8 @@ type StorySingleProps = StoryProps;
|
|
79
52
|
type StorySingle = StoryObj<StorySingleProps>;
|
80
53
|
type StoryDouble = StoryObj<StoryProps>;
|
81
54
|
|
82
|
-
const SliderWrapper = styled.div
|
83
|
-
width:
|
84
|
-
height: ${({ isVertical }) => (isVertical ? '25rem' : 'auto')};
|
55
|
+
const SliderWrapper = styled.div`
|
56
|
+
width: 25rem;
|
85
57
|
`;
|
86
58
|
|
87
59
|
const StoryDefault = (args: StorySingleProps) => {
|
@@ -95,86 +67,41 @@ const StoryDefault = (args: StorySingleProps) => {
|
|
95
67
|
setValue(values);
|
96
68
|
};
|
97
69
|
|
98
|
-
const { hasIcon, showIcon, orientation, labelPlacement, labelVerticalPlacement, ...rest } = args;
|
99
|
-
const isVertical = orientation === 'vertical';
|
100
|
-
|
101
70
|
return (
|
102
|
-
<SliderWrapper
|
103
|
-
<Slider
|
104
|
-
value={value}
|
105
|
-
orientation={orientation}
|
106
|
-
labelPlacement={labelPlacement}
|
107
|
-
labelContent={showIcon ? <IconMic size={rest.size === 's' ? 'xs' : 's'} /> : null}
|
108
|
-
onChangeCommitted={onChangeCommittedHandle}
|
109
|
-
onChange={onChangeHandle}
|
110
|
-
{...rest}
|
111
|
-
/>
|
71
|
+
<SliderWrapper>
|
72
|
+
<Slider value={value} onChangeCommitted={onChangeCommittedHandle} onChange={onChangeHandle} {...args} />
|
112
73
|
</SliderWrapper>
|
113
74
|
);
|
114
75
|
};
|
115
76
|
|
116
77
|
export const Default: StorySingle = {
|
117
78
|
argTypes: {
|
118
|
-
sliderAlign: {
|
119
|
-
options: sliderAligns,
|
120
|
-
control: {
|
121
|
-
type: 'inline-radio',
|
122
|
-
},
|
123
|
-
if: { arg: 'orientation', eq: 'vertical' },
|
124
|
-
},
|
125
79
|
labelPlacement: {
|
126
80
|
options: labelPlacements,
|
127
81
|
control: {
|
128
82
|
type: 'inline-radio',
|
129
83
|
},
|
130
|
-
if: { arg: 'orientation', eq: 'horizontal' },
|
131
|
-
},
|
132
|
-
labelReversed: {
|
133
|
-
control: {
|
134
|
-
type: 'boolean',
|
135
|
-
expanded: true,
|
136
|
-
},
|
137
|
-
if: { arg: 'orientation', eq: 'vertical' },
|
138
|
-
},
|
139
|
-
scaleAlign: {
|
140
|
-
options: scaleAligns,
|
141
|
-
control: {
|
142
|
-
type: 'inline-radio',
|
143
|
-
},
|
144
|
-
if: { arg: 'orientation', eq: 'horizontal' },
|
145
84
|
},
|
146
|
-
|
147
|
-
options:
|
85
|
+
rangeValuesPlacement: {
|
86
|
+
options: rangeValuesPlacement,
|
148
87
|
control: {
|
149
88
|
type: 'inline-radio',
|
150
89
|
},
|
151
90
|
},
|
152
|
-
reversed: {
|
153
|
-
control: {
|
154
|
-
type: 'boolean',
|
155
|
-
},
|
156
|
-
if: { arg: 'orientation', eq: 'vertical' },
|
157
|
-
},
|
158
91
|
},
|
159
92
|
args: {
|
160
93
|
view: 'default',
|
161
94
|
size: 'm',
|
162
|
-
pointerSize: 'small',
|
163
95
|
min: 0,
|
164
96
|
max: 100,
|
165
|
-
|
166
|
-
ariaLabel: 'Цена
|
97
|
+
disabled: false,
|
98
|
+
ariaLabel: 'Цена товара',
|
167
99
|
multipleStepSize: 10,
|
168
|
-
label: 'Цена
|
169
|
-
labelPlacement: '
|
170
|
-
|
171
|
-
|
172
|
-
showScale: true,
|
100
|
+
label: 'Цена товара',
|
101
|
+
labelPlacement: 'outer',
|
102
|
+
rangeValuesPlacement: 'outer',
|
103
|
+
showRangeValues: true,
|
173
104
|
showCurrentValue: false,
|
174
|
-
showIcon: true,
|
175
|
-
reversed: false,
|
176
|
-
labelReversed: false,
|
177
|
-
disabled: false,
|
178
105
|
},
|
179
106
|
render: (args) => <StoryDefault {...args} />,
|
180
107
|
};
|
@@ -214,7 +141,7 @@ const StoryMultipleValues = (args: StoryProps) => {
|
|
214
141
|
};
|
215
142
|
|
216
143
|
return (
|
217
|
-
<SliderWrapper
|
144
|
+
<SliderWrapper>
|
218
145
|
<Slider
|
219
146
|
value={value}
|
220
147
|
onKeyDownTextField={onKeyDownTextField}
|
@@ -231,7 +158,6 @@ export const MultipleValues: StoryDouble = {
|
|
231
158
|
args: {
|
232
159
|
view: 'default',
|
233
160
|
size: 'm',
|
234
|
-
pointerSize: 'small',
|
235
161
|
min: 0,
|
236
162
|
max: 100,
|
237
163
|
disabled: false,
|
@@ -239,14 +165,5 @@ export const MultipleValues: StoryDouble = {
|
|
239
165
|
ariaLabel: ['Минимальная цена товара', 'Максимальная цена товара'],
|
240
166
|
multipleStepSize: 10,
|
241
167
|
},
|
242
|
-
argTypes: {
|
243
|
-
pointerSize: {
|
244
|
-
options: ['small', 'large'],
|
245
|
-
control: {
|
246
|
-
type: 'inline-radio',
|
247
|
-
},
|
248
|
-
},
|
249
|
-
...disableProps(['orientation']),
|
250
|
-
},
|
251
168
|
render: (args) => <StoryMultipleValues {...args} />,
|
252
169
|
};
|
@@ -1,5 +1,11 @@
|
|
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 = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear", "maxWidth"];
|
2
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
|
+
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
|
+
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; }
|
6
|
+
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; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
8
|
+
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); }
|
3
9
|
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; }
|
4
10
|
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
11
|
import React, { forwardRef } from 'react';
|
@@ -9,6 +15,7 @@ import { base as sizeCSS } from './variations/_size/base';
|
|
9
15
|
import { base as pilledCSS } from './variations/_pilled/base';
|
10
16
|
import { base as transparentCSS } from './variations/_transparent/base';
|
11
17
|
import { base as clearCSS } from './variations/_clear/base';
|
18
|
+
import { base as truncateCSS } from './variations/_truncate/base';
|
12
19
|
import { StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Badge.styles';
|
13
20
|
import { classes } from './Badge.tokens';
|
14
21
|
export var badgeRoot = function badgeRoot(Root) {
|
@@ -26,20 +33,28 @@ export var badgeRoot = function badgeRoot(Root) {
|
|
26
33
|
transparent = _props$transparent === void 0 ? false : _props$transparent,
|
27
34
|
_props$clear = props.clear,
|
28
35
|
clear = _props$clear === void 0 ? false : _props$clear,
|
36
|
+
_props$maxWidth = props.maxWidth,
|
37
|
+
maxWidth = _props$maxWidth === void 0 ? 'auto' : _props$maxWidth,
|
29
38
|
rest = _objectWithoutProperties(props, _excluded);
|
30
39
|
var pilledClass = pilled ? classes.badgePilled : undefined;
|
31
40
|
var transparentClass = transparent ? classes.badgeTransparent : undefined;
|
32
41
|
var clearClass = clear ? classes.badgeClear : undefined;
|
33
42
|
var txt = !text && typeof children === 'string' ? children : text;
|
43
|
+
var truncate = maxWidth !== 'auto';
|
34
44
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
35
45
|
ref: ref,
|
36
|
-
className: cx(pilledClass, transparentClass, clearClass, className),
|
46
|
+
className: cx(pilledClass, transparentClass, clearClass, truncate && classes.badgeTruncate, className),
|
37
47
|
view: view,
|
38
48
|
size: size,
|
39
49
|
pilled: pilled,
|
40
50
|
transparent: transparent,
|
41
|
-
clear: clear
|
42
|
-
|
51
|
+
clear: clear,
|
52
|
+
truncate: truncate
|
53
|
+
}, rest, {
|
54
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
55
|
+
maxWidth: maxWidth
|
56
|
+
})
|
57
|
+
}), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight));
|
43
58
|
});
|
44
59
|
};
|
45
60
|
export var badgeConfig = {
|
@@ -65,6 +80,10 @@ export var badgeConfig = {
|
|
65
80
|
clear: {
|
66
81
|
css: clearCSS,
|
67
82
|
attrs: true
|
83
|
+
},
|
84
|
+
truncate: {
|
85
|
+
css: truncateCSS,
|
86
|
+
attrs: true
|
68
87
|
}
|
69
88
|
},
|
70
89
|
defaults: {
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { classes } from '../../Badge.tokens';
|
3
|
+
import { StyledContentMain } from '../../Badge.styles';
|
4
|
+
export var base = /*#__PURE__*/css(["&.", "{max-width:100%;", "{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}}"], classes.badgeTruncate, StyledContentMain);
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|