@salutejs/plasma-new-hope 0.177.0-canary.1500.11571505911.0 → 0.177.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +0 -2
- package/cjs/components/Badge/Badge.js +4 -17
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.tokens.js +1 -2
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Notification/Notification.css +11 -11
- package/cjs/components/Notification/Notification.js +2 -2
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +11 -2
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/{es/components/Notification/Notification.styles_7h8hp0.css → cjs/components/Notification/Notification.styles_e6274r.css} +2 -2
- package/cjs/components/Notification/Notification.tokens.js +2 -1
- package/cjs/components/Notification/Notification.tokens.js.map +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
- package/cjs/components/Tabs/tokens.js +1 -2
- package/cjs/components/Tabs/tokens.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +5 -7
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -14
- 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_1vj7dbl.css → HorizontalTabItem.styles_hfqv5b.css} +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +5 -7
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +3 -14
- 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_16d3lah.css +5 -0
- package/cjs/index.css +21 -27
- package/cjs/index.js +1 -1
- package/emotion/cjs/components/Badge/Badge.js +4 -22
- package/emotion/cjs/components/Badge/Badge.tokens.js +1 -2
- package/emotion/cjs/components/Notification/Notification.js +2 -2
- package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
- package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/cjs/components/Notification/index.js +4 -4
- package/emotion/cjs/components/Tabs/tokens.js +1 -2
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -19
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +3 -19
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +14 -17
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +1 -5
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +16 -48
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -18
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +6 -9
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +16 -48
- package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -18
- package/emotion/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +6 -9
- package/emotion/es/components/Badge/Badge.js +4 -23
- package/emotion/es/components/Badge/Badge.tokens.js +1 -2
- package/emotion/es/components/Notification/Notification.js +1 -1
- package/emotion/es/components/Notification/Notification.styles.js +14 -19
- package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/es/components/Notification/Notification.tokens.js +2 -1
- package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/es/components/Notification/index.js +1 -1
- package/emotion/es/components/Tabs/tokens.js +1 -2
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -20
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +3 -20
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +14 -17
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +1 -5
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +16 -48
- package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -18
- package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +6 -9
- package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +16 -48
- package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -18
- package/emotion/es/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +6 -9
- package/es/components/Badge/Badge.css +0 -2
- package/es/components/Badge/Badge.js +5 -18
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.tokens.js +1 -2
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Notification/Notification.css +11 -11
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +11 -2
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/{cjs/components/Notification/Notification.styles_7h8hp0.css → es/components/Notification/Notification.styles_e6274r.css} +2 -2
- package/es/components/Notification/Notification.tokens.js +2 -1
- package/es/components/Notification/Notification.tokens.js.map +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +8 -4
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/NotificationsProvider.js +3 -1
- package/es/components/Notification/NotificationsProvider.js.map +1 -1
- package/es/components/Tabs/tokens.js +1 -2
- package/es/components/Tabs/tokens.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +5 -7
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +4 -15
- 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_1vj7dbl.css → HorizontalTabItem.styles_hfqv5b.css} +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +5 -7
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +4 -15
- 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_16d3lah.css +5 -0
- package/es/index.css +21 -27
- package/es/index.js +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Badge/Badge.js +4 -22
- package/styled-components/cjs/components/Badge/Badge.tokens.js +1 -2
- package/styled-components/cjs/components/Notification/Notification.js +2 -2
- package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/cjs/components/Notification/index.js +4 -4
- package/styled-components/cjs/components/Tabs/tokens.js +1 -2
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -19
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +3 -19
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +0 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +1 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +16 -48
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +0 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +0 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +16 -48
- package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +0 -3
- package/styled-components/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +0 -3
- package/styled-components/es/components/Badge/Badge.js +4 -23
- package/styled-components/es/components/Badge/Badge.tokens.js +1 -2
- package/styled-components/es/components/Notification/Notification.js +1 -1
- package/styled-components/es/components/Notification/Notification.styles.js +5 -2
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/es/components/Notification/index.js +1 -1
- package/styled-components/es/components/Tabs/tokens.js +1 -2
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +3 -20
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +1 -1
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +3 -20
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +0 -3
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +1 -5
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +16 -48
- package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +0 -3
- package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +0 -3
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +16 -48
- package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +0 -3
- package/styled-components/es/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +0 -3
- package/types/components/Badge/Badge.d.ts +2 -10
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +0 -1
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +0 -5
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Notification/Notification.d.ts +3 -3
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts +4 -2
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.tokens.d.ts +1 -0
- package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +11 -5
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
- package/types/components/Notification/NotificationsProvider.d.ts +4 -3
- package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
- package/types/components/Notification/index.d.ts +2 -2
- package/types/components/Notification/index.d.ts.map +1 -1
- package/types/components/Tabs/TabItem.types.d.ts +0 -5
- package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
- package/types/components/Tabs/tokens.d.ts +0 -1
- package/types/components/Tabs/tokens.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts +2 -9
- 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/vertical/VerticalTabItem/VerticalTabItem.d.ts +2 -9
- 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/examples/plasma_b2c/components/Badge/Badge.config.d.ts +0 -3
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +0 -6
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts +0 -6
- 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 +0 -3
- 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 +0 -3
- 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 +0 -3
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
- package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts +0 -6
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.d.ts +0 -3
- package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.d.ts +0 -3
- package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.d.ts.map +1 -1
- package/cjs/components/Badge/variations/_truncate/base.js +0 -9
- package/cjs/components/Badge/variations/_truncate/base.js.map +0 -1
- package/cjs/components/Badge/variations/_truncate/base_nf9u2h.css +0 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -9
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js.map +0 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base_1b34xv3.css +0 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_6ssvos.css +0 -5
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -9
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js.map +0 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base_1nwonlh.css +0 -1
- package/emotion/cjs/components/Badge/variations/_truncate/base.js +0 -10
- package/emotion/cjs/components/Badge/variations/_truncate/tokens.json +0 -1
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -10
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +0 -1
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -10
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +0 -1
- package/emotion/es/components/Badge/variations/_truncate/base.js +0 -4
- package/emotion/es/components/Badge/variations/_truncate/tokens.json +0 -1
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -4
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +0 -1
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -4
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +0 -1
- package/es/components/Badge/variations/_truncate/base.js +0 -5
- package/es/components/Badge/variations/_truncate/base.js.map +0 -1
- package/es/components/Badge/variations/_truncate/base_nf9u2h.css +0 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -5
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js.map +0 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base_1b34xv3.css +0 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_6ssvos.css +0 -5
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -5
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js.map +0 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base_1nwonlh.css +0 -1
- package/styled-components/cjs/components/Badge/variations/_truncate/base.js +0 -10
- package/styled-components/cjs/components/Badge/variations/_truncate/tokens.json +0 -1
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -10
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +0 -1
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -10
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +0 -1
- package/styled-components/es/components/Badge/variations/_truncate/base.js +0 -4
- package/styled-components/es/components/Badge/variations/_truncate/tokens.json +0 -1
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.js +0 -4
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/tokens.json +0 -1
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.js +0 -4
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/tokens.json +0 -1
- package/types/components/Badge/variations/_truncate/base.d.ts +0 -2
- package/types/components/Badge/variations/_truncate/base.d.ts.map +0 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.d.ts +0 -2
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_truncate/base.d.ts.map +0 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.d.ts +0 -2
- package/types/components/Tabs/ui/vertical/VerticalTabItem/variations/_truncate/base.d.ts.map +0 -1
@@ -16,14 +16,16 @@ var _engines = /*#__PURE__*/require("../../../../engines");
|
|
16
16
|
var _Notification2 = /*#__PURE__*/require("./Notification.config");
|
17
17
|
var _Modal = /*#__PURE__*/require("../../../../components/Modal");
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.
|
19
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.notificationConfig, _Notification2.config);
|
20
20
|
var Notification = exports.Notification = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
21
21
|
var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
|
22
22
|
var children = _ref.children,
|
23
23
|
_ref$frame = _ref.frame,
|
24
|
-
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame
|
24
|
+
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame,
|
25
|
+
placement = _ref.placement;
|
25
26
|
return /*#__PURE__*/_react["default"].createElement(_Notification.NotificationsProvider, {
|
26
27
|
config: mergedConfig,
|
27
|
-
frame: frame
|
28
|
+
frame: frame,
|
29
|
+
placement: placement
|
28
30
|
}, children);
|
29
31
|
};
|
package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx
CHANGED
@@ -5,6 +5,7 @@ import type { StoryObj, Meta } from '@storybook/react';
|
|
5
5
|
import { Button } from '../Button/Button';
|
6
6
|
import { Modal } from '../Modal/Modal';
|
7
7
|
import {
|
8
|
+
NotificationPlacement,
|
8
9
|
NotificationIconPlacement,
|
9
10
|
NotificationLayout,
|
10
11
|
addNotification,
|
@@ -20,6 +21,7 @@ const titles = ['Выполнено', 'Внимание', 'Ошибка'];
|
|
20
21
|
const texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
|
21
22
|
const size = ['xs', 'xxs'];
|
22
23
|
const iconPlacement = ['top', 'left'];
|
24
|
+
const notificationsPlacements = ['bottom-right', 'bottom-left'];
|
23
25
|
|
24
26
|
const longText = `JavaScript frameworks are an essential part of modern front-end web development,
|
25
27
|
providing developers with proven tools for building scalable, interactive web applications.
|
@@ -49,6 +51,7 @@ interface StoryDefaultProps {
|
|
49
51
|
layout: NotificationLayout;
|
50
52
|
size: 'xs' | 'xxs';
|
51
53
|
iconPlacement: NotificationIconPlacement;
|
54
|
+
placement?: NotificationPlacement;
|
52
55
|
}
|
53
56
|
|
54
57
|
const StoryDefault = ({ title, children, iconPlacement, size, layout, showLeftIcon, ...rest }: StoryDefaultProps) => {
|
@@ -111,9 +114,10 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
111
114
|
layout: NotificationLayout;
|
112
115
|
size: 'xs' | 'xxs';
|
113
116
|
iconPlacement: NotificationIconPlacement;
|
117
|
+
placement?: NotificationPlacement;
|
114
118
|
};
|
115
119
|
|
116
|
-
const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
120
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
117
121
|
const count = useRef(0);
|
118
122
|
const handleClick = useCallback(() => {
|
119
123
|
addNotification({ icon: <IconDisclosureRight />, ...rest, ...getNotificationProps(count.current) }, timeout);
|
@@ -121,7 +125,7 @@ const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
|
121
125
|
}, [count, rest]);
|
122
126
|
|
123
127
|
return (
|
124
|
-
<NotificationsProvider>
|
128
|
+
<NotificationsProvider placement={placement}>
|
125
129
|
<Button text="Добавить уведомление" onClick={handleClick} />
|
126
130
|
</NotificationsProvider>
|
127
131
|
);
|
@@ -135,20 +139,28 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
135
139
|
type: 'select',
|
136
140
|
},
|
137
141
|
},
|
142
|
+
placement: {
|
143
|
+
options: notificationsPlacements,
|
144
|
+
control: {
|
145
|
+
type: 'select',
|
146
|
+
},
|
147
|
+
},
|
138
148
|
},
|
139
149
|
args: {
|
140
150
|
timeout: 3000,
|
141
151
|
role: 'alert',
|
142
152
|
layout: 'vertical',
|
153
|
+
placement: 'bottom-right',
|
143
154
|
},
|
144
155
|
render: (args) => <StoryLiveDemo {...args} />,
|
145
156
|
};
|
146
157
|
|
147
158
|
type StoryWithModalProps = ComponentProps<typeof Notification> & {
|
148
159
|
timeout: number;
|
160
|
+
placement?: NotificationPlacement;
|
149
161
|
};
|
150
162
|
|
151
|
-
const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
163
|
+
const StoryWithModal = ({ timeout, placement }: StoryWithModalProps) => {
|
152
164
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
153
165
|
const count = useRef(0);
|
154
166
|
const handleClick = useCallback(() => {
|
@@ -157,7 +169,7 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
157
169
|
}, [count]);
|
158
170
|
|
159
171
|
return (
|
160
|
-
<NotificationsProvider>
|
172
|
+
<NotificationsProvider placement={placement}>
|
161
173
|
<PopupProvider>
|
162
174
|
<Button text="Open modal" onClick={() => setIsModalOpen(true)} />
|
163
175
|
<Modal frame="theme-root" opened={isModalOpen} onClose={() => setIsModalOpen(false)}>
|
@@ -172,6 +184,15 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
172
184
|
export const WithModal: StoryObj<StoryLiveDemoProps> = {
|
173
185
|
args: {
|
174
186
|
timeout: 3500,
|
187
|
+
placement: 'bottom-right',
|
188
|
+
},
|
189
|
+
argTypes: {
|
190
|
+
placement: {
|
191
|
+
options: notificationsPlacements,
|
192
|
+
control: {
|
193
|
+
type: 'select',
|
194
|
+
},
|
195
|
+
},
|
175
196
|
},
|
176
197
|
render: (args) => <StoryWithModal {...args} />,
|
177
198
|
};
|
@@ -29,7 +29,6 @@ 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'];
|
33
32
|
|
34
33
|
const getContentLeft = (contentLeftOption: string, size: Size) => {
|
35
34
|
const iconSize = size === 'xs' ? 'xs' : 's';
|
@@ -77,12 +76,6 @@ const meta: Meta<StoryTabsProps> = {
|
|
77
76
|
},
|
78
77
|
if: { arg: 'helperText', eq: '' },
|
79
78
|
},
|
80
|
-
maxItemWidth: {
|
81
|
-
control: {
|
82
|
-
type: 'text',
|
83
|
-
},
|
84
|
-
if: { arg: 'stretch', truthy: false },
|
85
|
-
},
|
86
79
|
},
|
87
80
|
};
|
88
81
|
|
@@ -97,14 +90,13 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
97
90
|
contentRight: contentRightOption,
|
98
91
|
hasDivider,
|
99
92
|
stretch,
|
100
|
-
maxItemWidth,
|
101
93
|
helperText,
|
102
94
|
} = props;
|
103
95
|
const items = Array(itemQuantity).fill(0);
|
104
96
|
const [index, setIndex] = useState(0);
|
105
97
|
|
106
98
|
return (
|
107
|
-
<Tabs
|
99
|
+
<Tabs view={hasDivider ? 'divider' : 'clear'} stretch={stretch} disabled={disabled} size={size}>
|
108
100
|
{items.map((_, i) => {
|
109
101
|
if (helperText !== '') {
|
110
102
|
return (
|
@@ -118,9 +110,8 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
118
110
|
value={helperText}
|
119
111
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
120
112
|
size={size as Size}
|
121
|
-
maxItemWidth={maxItemWidth}
|
122
113
|
>
|
123
|
-
{
|
114
|
+
{`Label${i + 1}`}
|
124
115
|
</TabItem>
|
125
116
|
);
|
126
117
|
}
|
@@ -136,9 +127,8 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
136
127
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
137
128
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
138
129
|
size={size as Size}
|
139
|
-
maxItemWidth={maxItemWidth}
|
140
130
|
>
|
141
|
-
{
|
131
|
+
{`Label${i + 1}`}
|
142
132
|
</TabItem>
|
143
133
|
);
|
144
134
|
})}
|
@@ -157,7 +147,6 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
157
147
|
hasDivider,
|
158
148
|
helperText,
|
159
149
|
width,
|
160
|
-
maxItemWidth,
|
161
150
|
} = props;
|
162
151
|
const items = Array(itemQuantity).fill(0);
|
163
152
|
const [index, setIndex] = useState(0);
|
@@ -177,9 +166,8 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
177
166
|
value={helperText}
|
178
167
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
179
168
|
size={size as Size}
|
180
|
-
maxItemWidth={maxItemWidth}
|
181
169
|
>
|
182
|
-
{
|
170
|
+
{`Label${i + 1}`}
|
183
171
|
</TabItem>
|
184
172
|
);
|
185
173
|
}
|
@@ -195,9 +183,8 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
195
183
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
196
184
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
197
185
|
size={size as Size}
|
198
|
-
maxItemWidth={maxItemWidth}
|
199
186
|
>
|
200
|
-
{
|
187
|
+
{`Label${i + 1}`}
|
201
188
|
</TabItem>
|
202
189
|
);
|
203
190
|
})}
|
@@ -215,7 +202,6 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
215
202
|
contentRight: contentRightOption,
|
216
203
|
hasDivider,
|
217
204
|
helperText,
|
218
|
-
maxItemWidth,
|
219
205
|
} = props;
|
220
206
|
const maxItemQuantity = 3;
|
221
207
|
const items = Array(itemQuantity).fill(0);
|
@@ -248,9 +234,8 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
248
234
|
value={helperText}
|
249
235
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
250
236
|
size={size as Size}
|
251
|
-
maxItemWidth={maxItemWidth}
|
252
237
|
>
|
253
|
-
{
|
238
|
+
{`Label${i + 1}`}
|
254
239
|
</TabItem>
|
255
240
|
);
|
256
241
|
}
|
@@ -266,9 +251,8 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
266
251
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
267
252
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
268
253
|
size={size as Size}
|
269
|
-
maxItemWidth={maxItemWidth}
|
270
254
|
>
|
271
|
-
{
|
255
|
+
{`Label${i + 1}`}
|
272
256
|
</TabItem>
|
273
257
|
);
|
274
258
|
})}
|
@@ -285,7 +269,6 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
285
269
|
tabIndex={!disabled ? 0 : -1}
|
286
270
|
disabled={disabled}
|
287
271
|
size={size as Size}
|
288
|
-
maxItemWidth="auto"
|
289
272
|
>
|
290
273
|
ShowAll
|
291
274
|
</TabItem>
|
@@ -302,10 +285,9 @@ export const HorizontalTabs: StoryObj<HorizontalStoryTabsProps> = {
|
|
302
285
|
disabled: false,
|
303
286
|
hasDivider: true,
|
304
287
|
helperText: '',
|
305
|
-
itemQuantity:
|
288
|
+
itemQuantity: 8,
|
306
289
|
stretch: false,
|
307
290
|
width: '15rem',
|
308
|
-
maxItemWidth: '',
|
309
291
|
},
|
310
292
|
argTypes: {
|
311
293
|
contentLeft: {
|
@@ -361,7 +343,6 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
361
343
|
contentRight: contentRightOption,
|
362
344
|
hasDivider,
|
363
345
|
helperText,
|
364
|
-
maxItemWidth,
|
365
346
|
} = props;
|
366
347
|
const items = Array(itemQuantity).fill(0);
|
367
348
|
const [index, setIndex] = useState(0);
|
@@ -382,9 +363,8 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
382
363
|
value={helperText}
|
383
364
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
384
365
|
size={size as Size}
|
385
|
-
maxItemWidth={maxItemWidth}
|
386
366
|
>
|
387
|
-
{
|
367
|
+
{`Label${i + 1}`}
|
388
368
|
</TabItem>
|
389
369
|
);
|
390
370
|
}
|
@@ -401,9 +381,8 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
401
381
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
402
382
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
403
383
|
size={size as Size}
|
404
|
-
maxItemWidth={maxItemWidth}
|
405
384
|
>
|
406
|
-
{
|
385
|
+
{`Label${i + 1}`}
|
407
386
|
</TabItem>
|
408
387
|
);
|
409
388
|
})}
|
@@ -422,7 +401,6 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
422
401
|
hasDivider,
|
423
402
|
helperText,
|
424
403
|
height,
|
425
|
-
maxItemWidth,
|
426
404
|
} = props;
|
427
405
|
const items = Array(itemQuantity).fill(0);
|
428
406
|
const [index, setIndex] = useState(0);
|
@@ -450,9 +428,8 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
450
428
|
value={helperText}
|
451
429
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
452
430
|
size={size as Size}
|
453
|
-
maxItemWidth={maxItemWidth}
|
454
431
|
>
|
455
|
-
{
|
432
|
+
{`Label${i + 1}`}
|
456
433
|
</TabItem>
|
457
434
|
);
|
458
435
|
}
|
@@ -469,9 +446,8 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
469
446
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
470
447
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
471
448
|
size={size as Size}
|
472
|
-
maxItemWidth={maxItemWidth}
|
473
449
|
>
|
474
|
-
{
|
450
|
+
{`Label${i + 1}`}
|
475
451
|
</TabItem>
|
476
452
|
);
|
477
453
|
})}
|
@@ -489,7 +465,6 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
489
465
|
contentRight: contentRightOption,
|
490
466
|
hasDivider,
|
491
467
|
helperText,
|
492
|
-
maxItemWidth,
|
493
468
|
} = props;
|
494
469
|
const maxItemQuantity = 3;
|
495
470
|
const items = Array(itemQuantity).fill(0);
|
@@ -523,9 +498,8 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
523
498
|
value={helperText}
|
524
499
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
525
500
|
size={size as Size}
|
526
|
-
maxItemWidth={maxItemWidth}
|
527
501
|
>
|
528
|
-
{
|
502
|
+
{`Label${i + 1}`}
|
529
503
|
</TabItem>
|
530
504
|
);
|
531
505
|
}
|
@@ -542,9 +516,8 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
542
516
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
543
517
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
544
518
|
size={size as Size}
|
545
|
-
maxItemWidth={maxItemWidth}
|
546
519
|
>
|
547
|
-
{
|
520
|
+
{`Label${i + 1}`}
|
548
521
|
</TabItem>
|
549
522
|
);
|
550
523
|
})}
|
@@ -561,7 +534,6 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
561
534
|
tabIndex={!disabled ? 0 : -1}
|
562
535
|
disabled={disabled}
|
563
536
|
size={size as Size}
|
564
|
-
maxItemWidth="auto"
|
565
537
|
>
|
566
538
|
ShowAll
|
567
539
|
</TabItem>
|
@@ -576,11 +548,10 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
|
|
576
548
|
size: 'xs',
|
577
549
|
disabled: false,
|
578
550
|
hasDivider: true,
|
579
|
-
itemQuantity:
|
551
|
+
itemQuantity: 8,
|
580
552
|
orientation: 'vertical',
|
581
553
|
helperText: '',
|
582
554
|
height: '10rem',
|
583
|
-
maxItemWidth: '',
|
584
555
|
},
|
585
556
|
argTypes: {
|
586
557
|
contentLeft: {
|
@@ -641,7 +612,6 @@ const StoryHeaderTabs = (props: StoryTabsProps) => {
|
|
641
612
|
contentRight: contentRightOption,
|
642
613
|
hasDivider,
|
643
614
|
stretch,
|
644
|
-
maxItemWidth,
|
645
615
|
} = props;
|
646
616
|
const items = Array(itemQuantity).fill(0);
|
647
617
|
const [index, setIndex] = useState(0);
|
@@ -659,9 +629,8 @@ const StoryHeaderTabs = (props: StoryTabsProps) => {
|
|
659
629
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
660
630
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
661
631
|
size={size as HeaderSize}
|
662
|
-
maxItemWidth={maxItemWidth}
|
663
632
|
>
|
664
|
-
{
|
633
|
+
{`Label${i + 1}`}
|
665
634
|
</TabItem>
|
666
635
|
))}
|
667
636
|
</Tabs>
|
@@ -674,7 +643,6 @@ export const HeaderTabs: StoryObj<StoryTabsProps> = {
|
|
674
643
|
disabled: false,
|
675
644
|
hasDivider: true,
|
676
645
|
itemQuantity: 4,
|
677
|
-
maxItemWidth: '',
|
678
646
|
},
|
679
647
|
argTypes: {
|
680
648
|
size: {
|
@@ -1,11 +1,5 @@
|
|
1
|
-
|
2
|
-
var _excluded = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear", "maxWidth"];
|
1
|
+
var _excluded = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear"];
|
3
2
|
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); }
|
9
3
|
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; }
|
10
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
5
|
import React, { forwardRef } from 'react';
|
@@ -15,7 +9,6 @@ import { base as sizeCSS } from './variations/_size/base';
|
|
15
9
|
import { base as pilledCSS } from './variations/_pilled/base';
|
16
10
|
import { base as transparentCSS } from './variations/_transparent/base';
|
17
11
|
import { base as clearCSS } from './variations/_clear/base';
|
18
|
-
import { base as truncateCSS } from './variations/_truncate/base';
|
19
12
|
import { StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Badge.styles';
|
20
13
|
import { classes } from './Badge.tokens';
|
21
14
|
export var badgeRoot = function badgeRoot(Root) {
|
@@ -33,28 +26,20 @@ export var badgeRoot = function badgeRoot(Root) {
|
|
33
26
|
transparent = _props$transparent === void 0 ? false : _props$transparent,
|
34
27
|
_props$clear = props.clear,
|
35
28
|
clear = _props$clear === void 0 ? false : _props$clear,
|
36
|
-
_props$maxWidth = props.maxWidth,
|
37
|
-
maxWidth = _props$maxWidth === void 0 ? 'auto' : _props$maxWidth,
|
38
29
|
rest = _objectWithoutProperties(props, _excluded);
|
39
30
|
var pilledClass = pilled ? classes.badgePilled : undefined;
|
40
31
|
var transparentClass = transparent ? classes.badgeTransparent : undefined;
|
41
32
|
var clearClass = clear ? classes.badgeClear : undefined;
|
42
33
|
var txt = !text && typeof children === 'string' ? children : text;
|
43
|
-
var truncate = maxWidth !== 'auto';
|
44
34
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
45
35
|
ref: ref,
|
46
|
-
className: cx(pilledClass, transparentClass, clearClass,
|
36
|
+
className: cx(pilledClass, transparentClass, clearClass, className),
|
47
37
|
view: view,
|
48
38
|
size: size,
|
49
39
|
pilled: pilled,
|
50
40
|
transparent: transparent,
|
51
|
-
clear: clear
|
52
|
-
|
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));
|
41
|
+
clear: clear
|
42
|
+
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight));
|
58
43
|
});
|
59
44
|
};
|
60
45
|
export var badgeConfig = {
|
@@ -80,10 +65,6 @@ export var badgeConfig = {
|
|
80
65
|
clear: {
|
81
66
|
css: clearCSS,
|
82
67
|
attrs: true
|
83
|
-
},
|
84
|
-
truncate: {
|
85
|
-
css: truncateCSS,
|
86
|
-
attrs: true
|
87
68
|
}
|
88
69
|
},
|
89
70
|
defaults: {
|
@@ -58,7 +58,10 @@ export var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
|
58
58
|
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:var(", ");"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), tokens.contentColor);
|
59
59
|
export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
60
60
|
componentId: "plasma-new-hope__sc-1iufy9r-8"
|
61
|
-
})(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;}&&.", "{animation:0.4s hideAnimation ease-out;}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationItemHidden);
|
61
|
+
})(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showLeftToRightAnimation{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideLeftToRightAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(-100%);opacity:0;}}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationLeftToRightAnimation, classes.notificationItemHidden, classes.notificationLeftToRightAnimation);
|
62
62
|
export var StyledRoot = /*#__PURE__*/styled.div.withConfig({
|
63
63
|
componentId: "plasma-new-hope__sc-1iufy9r-9"
|
64
|
-
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:
|
64
|
+
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (_ref8) {
|
65
|
+
var placement = _ref8.placement;
|
66
|
+
return placement === 'bottom-left' ? 'flex-start' : 'flex-end';
|
67
|
+
});
|
@@ -10,14 +10,15 @@ import { PropsTable, Description } from '@site/src/components';
|
|
10
10
|
<PropsTable name="Notification" />
|
11
11
|
|
12
12
|
## Использование
|
13
|
-
Компонент `Notification` может использоваться для создания собственных систем оповещения.
|
13
|
+
Компонент `Notification` может использоваться для создания собственных систем оповещения.
|
14
14
|
Вид компонента контролируется свойствами (props).
|
15
|
-
Текстовая часть оповещения состоит из `title` и `children`.
|
15
|
+
Текстовая часть оповещения состоит из `title` и `children`.
|
16
16
|
Слева или сверху от нее, также можно пробросить иконку через свойство `icon`.
|
17
17
|
Также есть часть `actions`, в которой предполагается отображение кнопок для взаимодействия.
|
18
18
|
|
19
19
|
### Провайдер контекста
|
20
|
-
Поместите `NotificationsProvider` в [корень приложения](../../#корень-приложения) или там, где будете применять модальные
|
20
|
+
Поместите `NotificationsProvider` в [корень приложения](../../#корень-приложения) или там, где будете применять модальные окна.
|
21
|
+
В качестве свойств можно указать контейнер для оповещений через `frame` и расположение в контейнере через свойство `placement`, как `bottom-right` _(по умолчанию)_ или `bottom-left`.
|
21
22
|
|
22
23
|
```tsx title="index.ts"
|
23
24
|
import ReactDOM from 'react-dom';
|
@@ -34,24 +35,32 @@ ReactDOM.render(
|
|
34
35
|
```
|
35
36
|
|
36
37
|
### Вызов уведомления
|
37
|
-
После подключения `NotificationsProvider` станет возможен вызов функции `addNotification
|
38
|
-
Функция принимает значения свойств компонента `Notification
|
38
|
+
После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`, который приведет к отображению оповещения.
|
39
|
+
Функция принимает значения свойств компонента `Notification`, включая необязательное поле `id`. И возвращает сгенерированный или переданный `id`, по которому можно закрыть оповещение через вызов `closeNotification`.
|
39
40
|
|
40
41
|
```tsx live
|
41
42
|
import React from 'react';
|
42
|
-
import { Button, addNotification, NotificationsProvider } from '@salutejs/{{ package }}';
|
43
|
+
import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
|
43
44
|
|
44
45
|
export function App() {
|
45
|
-
const
|
46
|
+
const handleShow = React.useCallback(() => {
|
46
47
|
addNotification({
|
48
|
+
id: 'incoming-call',
|
47
49
|
title: 'Входящий вызов',
|
48
50
|
children: 'Принять?',
|
49
51
|
}, 1000);
|
50
52
|
}, []);
|
51
53
|
|
54
|
+
const handleHide = React.useCallback(() => {
|
55
|
+
closeNotification('incoming-call');
|
56
|
+
}, []);
|
57
|
+
|
52
58
|
return (
|
53
59
|
<NotificationsProvider>
|
54
|
-
<
|
60
|
+
<ButtonGroup>
|
61
|
+
<Button text="Показать оповещение" onClick={handleShow} />
|
62
|
+
<Button text="Скрыть оповещение" onClick={handleHide} />
|
63
|
+
</ButtonGroup>
|
55
64
|
</NotificationsProvider>
|
56
65
|
);
|
57
66
|
}
|
@@ -13,7 +13,8 @@ export var classes = {
|
|
13
13
|
withoutIcon: 'notification-without-icon',
|
14
14
|
withoutCloseIcon: 'notification-without-close-icon',
|
15
15
|
notificationItemOpened: 'notification-item-opened',
|
16
|
-
notificationItemHidden: 'notification-item-hidden'
|
16
|
+
notificationItemHidden: 'notification-item-hidden',
|
17
|
+
notificationLeftToRightAnimation: 'notification-left-to-right-animation'
|
17
18
|
};
|
18
19
|
export var tokens = {
|
19
20
|
background: '--plasma-notification-backgorund',
|
@@ -24,7 +24,9 @@ var StyledPopup = /*#__PURE__*/styled(Popup).withConfig({
|
|
24
24
|
*/
|
25
25
|
export var NotificationsPortal = function NotificationsPortal(_ref) {
|
26
26
|
var config = _ref.config,
|
27
|
-
frame = _ref.frame
|
27
|
+
frame = _ref.frame,
|
28
|
+
_ref$placement = _ref.placement,
|
29
|
+
placement = _ref$placement === void 0 ? 'bottom-right' : _ref$placement;
|
28
30
|
var _useStoreon = useStoreon('notifications'),
|
29
31
|
notifications = _useStoreon.notifications;
|
30
32
|
var Notification = useMemo(function () {
|
@@ -33,15 +35,17 @@ export var NotificationsPortal = function NotificationsPortal(_ref) {
|
|
33
35
|
return /*#__PURE__*/React.createElement(PopupProvider, null, notifications.length > 0 && /*#__PURE__*/React.createElement(StyledPopup, {
|
34
36
|
opened: true,
|
35
37
|
frame: frame,
|
36
|
-
placement:
|
38
|
+
placement: placement,
|
37
39
|
zIndex: "9100"
|
38
|
-
}, /*#__PURE__*/React.createElement(StyledRoot,
|
40
|
+
}, /*#__PURE__*/React.createElement(StyledRoot, {
|
41
|
+
placement: placement
|
42
|
+
}, notifications.map(function (_ref2) {
|
39
43
|
var id = _ref2.id,
|
40
44
|
isHidden = _ref2.isHidden,
|
41
45
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
42
46
|
return /*#__PURE__*/React.createElement(StyledItemWrapper, {
|
43
47
|
key: id,
|
44
|
-
className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened),
|
48
|
+
className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened, placement === 'bottom-left' && classes.notificationLeftToRightAnimation),
|
45
49
|
isHidden: isHidden || false
|
46
50
|
}, /*#__PURE__*/React.createElement(Notification, _extends({
|
47
51
|
key: id,
|
@@ -5,11 +5,13 @@ import { NotificationsPortal } from './NotificationsPortal';
|
|
5
5
|
export var NotificationsProvider = function NotificationsProvider(_ref) {
|
6
6
|
var children = _ref.children,
|
7
7
|
config = _ref.config,
|
8
|
-
frame = _ref.frame
|
8
|
+
frame = _ref.frame,
|
9
|
+
placement = _ref.placement;
|
9
10
|
return /*#__PURE__*/React.createElement(StoreContext.Provider, {
|
10
11
|
value: NotificationsStore
|
11
12
|
}, children, /*#__PURE__*/React.createElement(NotificationsPortal, {
|
12
13
|
frame: frame,
|
14
|
+
placement: placement,
|
13
15
|
config: config
|
14
16
|
}));
|
15
17
|
};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
export { NotificationsProvider } from './NotificationsProvider';
|
2
|
-
export { notificationRoot,
|
2
|
+
export { notificationRoot, notificationConfig } from './Notification';
|
3
3
|
export { addNotification, closeNotification } from './NotificationsStore';
|
4
4
|
export { classes as notificationClasses, tokens as notificationTokens } from './Notification.tokens';
|
@@ -14,8 +14,7 @@ export var classes = {
|
|
14
14
|
tabsHasTopArrow: 'tabs-has-top-arrow',
|
15
15
|
tabsHasBottomArrow: 'tabs-has-bottom-arrow',
|
16
16
|
tabsClipScroll: 'tabs-clip-scroll',
|
17
|
-
tabsClipShowAll: 'tabs-clip-show-all'
|
18
|
-
tabsTruncate: 'tabs-truncate'
|
17
|
+
tabsClipShowAll: 'tabs-clip-show-all'
|
19
18
|
};
|
20
19
|
export var tokens = {
|
21
20
|
disabledOpacity: '--plasma-tabs-disabled-opacity',
|