@salutejs/plasma-new-hope 0.174.0-canary.1497.11501781410.0 → 0.174.0-canary.1503.11500823810.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +14 -28
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
- package/cjs/components/Dropdown/Dropdown.css +16 -30
- package/cjs/components/Dropdown/Dropdown.js +37 -60
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +26 -14
- package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
- package/cjs/components/Dropdown/Dropdown.tokens.js +1 -24
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +31 -25
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
- package/cjs/components/Dropdown/utils/index.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 +1 -1
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
- 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 +5 -3
- 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/Select/Select.js +1 -1
- package/cjs/components/Select/utils/getCorrectHeight.js.map +1 -1
- package/cjs/hooks/useOutsideClick.js +1 -1
- package/cjs/hooks/useOutsideClick.js.map +1 -1
- package/cjs/index.css +33 -31
- package/cjs/index.js +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
- package/emotion/cjs/components/Dropdown/Dropdown.js +37 -58
- package/emotion/cjs/components/Dropdown/Dropdown.styles.js +25 -9
- package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
- package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +41 -21
- package/emotion/cjs/components/Dropdown/utils/index.js +1 -23
- package/emotion/cjs/components/Notification/Notification.js +2 -2
- package/emotion/cjs/components/Notification/Notification.styles.js +11 -11
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +15 -7
- package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
- package/emotion/cjs/components/Notification/NotificationsPortal.js +6 -4
- package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/cjs/components/Notification/index.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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/hooks/useOutsideClick.js +1 -1
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
- package/emotion/es/components/Dropdown/Dropdown.js +40 -60
- package/emotion/es/components/Dropdown/Dropdown.styles.js +25 -9
- package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -35
- package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +42 -22
- package/emotion/es/components/Dropdown/utils/index.js +1 -4
- package/emotion/es/components/Notification/Notification.js +1 -1
- package/emotion/es/components/Notification/Notification.styles.js +11 -11
- package/emotion/es/components/Notification/Notification.template-doc.mdx +15 -7
- package/emotion/es/components/Notification/Notification.tokens.js +2 -1
- package/emotion/es/components/Notification/NotificationsPortal.js +6 -4
- package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/es/components/Notification/index.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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_web/components/Combobox/Combobox.config.js +12 -12
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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/hooks/useOutsideClick.js +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +14 -28
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
- package/es/components/Dropdown/Dropdown.css +16 -30
- package/es/components/Dropdown/Dropdown.js +40 -62
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +26 -15
- package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
- package/es/components/Dropdown/Dropdown.tokens.js +1 -24
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +29 -24
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
- package/es/components/Dropdown/utils/index.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 +1 -1
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
- 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 +5 -3
- 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/Select/Select.js +1 -1
- package/es/components/Select/utils/getCorrectHeight.js.map +1 -1
- package/es/hooks/useOutsideClick.js +1 -1
- package/es/hooks/useOutsideClick.js.map +1 -1
- package/es/index.css +33 -31
- package/es/index.js +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
- package/styled-components/cjs/components/Dropdown/Dropdown.js +37 -58
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +15 -9
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +19 -17
- package/styled-components/cjs/components/Dropdown/utils/index.js +1 -23
- package/styled-components/cjs/components/Notification/Notification.js +2 -2
- package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +15 -7
- package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/cjs/components/Notification/NotificationsPortal.js +5 -3
- package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/cjs/components/Notification/index.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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/hooks/useOutsideClick.js +1 -1
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
- package/styled-components/es/components/Dropdown/Dropdown.js +40 -60
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +15 -9
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -35
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +20 -18
- package/styled-components/es/components/Dropdown/utils/index.js +1 -4
- package/styled-components/es/components/Notification/Notification.js +1 -1
- package/styled-components/es/components/Notification/Notification.styles.js +1 -1
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +15 -7
- package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/es/components/Notification/NotificationsPortal.js +5 -3
- package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/es/components/Notification/index.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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_web/components/Combobox/Combobox.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
- 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/hooks/useOutsideClick.js +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts +1 -2
- package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +1 -2
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +6 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +0 -25
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +4 -30
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +1 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +12 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +3 -32
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +14 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +0 -3
- package/types/components/Dropdown/utils/index.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.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/Select/utils/getCorrectHeight.d.ts +2 -2
- package/types/components/Select/utils/getCorrectHeight.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts +3 -3
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.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_web/components/Dropdown/Dropdown.config.d.ts +3 -3
- package/types/examples/plasma_web/components/Dropdown/Dropdown.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/examples/plasma_web/components/Dropdown/Dropdown.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/hooks/useOutsideClick.d.ts +1 -1
- package/types/hooks/useOutsideClick.d.ts.map +1 -1
- package/types/utils/index.d.ts +1 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
- package/cjs/components/Dropdown/FloatingPopover.js +0 -104
- package/cjs/components/Dropdown/FloatingPopover.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
- package/cjs/components/Dropdown/utils/getItemByFocused.js +0 -13
- package/cjs/components/Dropdown/utils/getItemByFocused.js.map +0 -1
- package/cjs/components/Dropdown/utils/getItemId.js +0 -10
- package/cjs/components/Dropdown/utils/getItemId.js.map +0 -1
- package/cjs/components/Dropdown/utils/getPlacement.js +0 -16
- package/cjs/components/Dropdown/utils/getPlacement.js.map +0 -1
- package/emotion/cjs/components/Dropdown/FloatingPopover.js +0 -109
- package/emotion/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
- package/emotion/cjs/components/Dropdown/utils/getItemId.js +0 -9
- package/emotion/cjs/components/Dropdown/utils/getPlacement.js +0 -15
- package/emotion/es/components/Dropdown/FloatingPopover.js +0 -102
- package/emotion/es/components/Dropdown/utils/getItemByFocused.js +0 -6
- package/emotion/es/components/Dropdown/utils/getItemId.js +0 -3
- package/emotion/es/components/Dropdown/utils/getPlacement.js +0 -9
- package/es/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
- package/es/components/Dropdown/FloatingPopover.js +0 -100
- package/es/components/Dropdown/FloatingPopover.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
- package/es/components/Dropdown/utils/getItemByFocused.js +0 -9
- package/es/components/Dropdown/utils/getItemByFocused.js.map +0 -1
- package/es/components/Dropdown/utils/getItemId.js +0 -6
- package/es/components/Dropdown/utils/getItemId.js.map +0 -1
- package/es/components/Dropdown/utils/getPlacement.js +0 -12
- package/es/components/Dropdown/utils/getPlacement.js.map +0 -1
- package/styled-components/cjs/components/Dropdown/FloatingPopover.js +0 -109
- package/styled-components/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
- package/styled-components/cjs/components/Dropdown/utils/getItemId.js +0 -9
- package/styled-components/cjs/components/Dropdown/utils/getPlacement.js +0 -15
- package/styled-components/es/components/Dropdown/FloatingPopover.js +0 -102
- package/styled-components/es/components/Dropdown/utils/getItemByFocused.js +0 -6
- package/styled-components/es/components/Dropdown/utils/getItemId.js +0 -3
- package/styled-components/es/components/Dropdown/utils/getPlacement.js +0 -9
- package/types/components/Dropdown/FloatingPopover.d.ts +0 -5
- package/types/components/Dropdown/FloatingPopover.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getItemByFocused.d.ts +0 -4
- package/types/components/Dropdown/utils/getItemByFocused.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getItemId.d.ts +0 -2
- package/types/components/Dropdown/utils/getItemId.d.ts.map +0 -1
- package/types/components/Dropdown/utils/getPlacement.d.ts +0 -3
- package/types/components/Dropdown/utils/getPlacement.d.ts.map +0 -1
@@ -1,20 +1,26 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import { css } from 'styled-components';
|
3
|
+
import { component } from '../../engines';
|
4
|
+
import { popoverConfig, popoverClasses } from '../Popover';
|
3
5
|
import { getCorrectHeight } from './utils';
|
4
|
-
import { tokens
|
5
|
-
|
6
|
+
import { tokens } from './Dropdown.tokens';
|
7
|
+
var Popover = /*#__PURE__*/component(popoverConfig);
|
8
|
+
export var StyledPopover = /*#__PURE__*/styled(Popover).withConfig({
|
6
9
|
componentId: "plasma-new-hope__sc-13ezpo5-0"
|
7
|
-
})(["
|
10
|
+
})([".", ",.", "{display:block;}"], /*#__PURE__*/String(popoverClasses.wrapper), /*#__PURE__*/String(popoverClasses.target));
|
11
|
+
export var Ul = /*#__PURE__*/styled.ul.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-13ezpo5-1"
|
13
|
+
})(["box-sizing:border-box;background:var(", ");box-shadow:var(", ");border-radius:var(", ");width:", ";height:", ";overflow:", ";margin:", ";padding:var(", ");"], tokens.background, tokens.boxShadow, tokens.borderRadius, function (_ref) {
|
8
14
|
var listWidth = _ref.listWidth;
|
9
15
|
return listWidth || "var(".concat(tokens.width, ")");
|
10
16
|
}, function (_ref2) {
|
11
17
|
var listHeight = _ref2.listHeight;
|
12
18
|
return listHeight ? getCorrectHeight(listHeight) : 'auto';
|
13
19
|
}, function (_ref3) {
|
14
|
-
var
|
15
|
-
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0.125rem 0") : 0;
|
16
|
-
}, tokens.padding, function (_ref4) {
|
17
|
-
var listOverflow = _ref4.listOverflow;
|
20
|
+
var listOverflow = _ref3.listOverflow;
|
18
21
|
return listOverflow || 'initial';
|
19
|
-
},
|
20
|
-
|
22
|
+
}, function (_ref4) {
|
23
|
+
var isInnerUl = _ref4.isInnerUl;
|
24
|
+
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 var(").concat(tokens.padding, ")") : 0;
|
25
|
+
}, tokens.padding);
|
26
|
+
export var base = /*#__PURE__*/css(["display:inline-block;"]);
|
@@ -3,7 +3,7 @@ export var classes = {
|
|
3
3
|
dropdownItemIsFocused: 'dropdown-item-is-focused',
|
4
4
|
dropdownItemIsDisabled: 'dropdown-item-is-disabled',
|
5
5
|
dropdownItemIsActive: 'dropdown-item-is-active',
|
6
|
-
dropdownItemIsSelected: '
|
6
|
+
dropdownItemIsSelected: 'dropdownItemIsSelected'
|
7
7
|
};
|
8
8
|
export var tokens = {
|
9
9
|
background: '--plasma-dropdown-background',
|
@@ -14,8 +14,6 @@ export var tokens = {
|
|
14
14
|
disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',
|
15
15
|
disabledOpacity: '--plasma-dropdown-disabled-opacity',
|
16
16
|
focusColor: '--plasma-dropdown-focus-color',
|
17
|
-
// Old
|
18
|
-
|
19
17
|
dividerColor: '--plasma-dropdown-divider-color',
|
20
18
|
dividerMarginTop: '--plasma-dropdown-divider-margin-top',
|
21
19
|
dividerMarginTopTight: '--plasma-dropdown-divider-margin-top-tight',
|
@@ -30,7 +28,6 @@ export var tokens = {
|
|
30
28
|
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
31
29
|
// Old
|
32
30
|
itemColor: '--plasma-dropdown-item-color',
|
33
|
-
// Old
|
34
31
|
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
35
32
|
// Old
|
36
33
|
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
@@ -49,17 +46,11 @@ export var tokens = {
|
|
49
46
|
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
50
47
|
// Old
|
51
48
|
itemPaddingTop: '--plasma-dropdown-item-padding-top',
|
52
|
-
// Old
|
53
49
|
itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',
|
54
|
-
// Old
|
55
50
|
itemPaddingRight: '--plasma-dropdown-item-padding-right',
|
56
|
-
// Old
|
57
51
|
itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
|
58
|
-
// Old
|
59
52
|
itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',
|
60
|
-
// Old
|
61
53
|
itemPaddingLeft: '--plasma-dropdown-item-padding-left',
|
62
|
-
// Old
|
63
54
|
itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
|
64
55
|
// Old
|
65
56
|
itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
|
@@ -74,20 +65,6 @@ export var tokens = {
|
|
74
65
|
itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
|
75
66
|
itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
|
76
67
|
itemFontLineHeight: '--plasma-dropdown-item-font-weight',
|
77
|
-
itemPadding: '--plasma-dropdown-item-padding',
|
78
|
-
itemPaddingTight: '--plasma-dropdown-item-padding-tight',
|
79
|
-
cellPadding: '--plasma-dropdown-cell-padding',
|
80
|
-
cellPaddingLeftContent: '--plasma-dropdown-cell-padding-left-content',
|
81
|
-
cellPaddingContent: '--plasma-dropdown-cell-padding-content',
|
82
|
-
cellPaddingRightContent: '--plasma-dropdown-cell-padding-right-content',
|
83
|
-
cellTextboxGap: '--plasma-dropdown-cell-textbox-gap',
|
84
|
-
cellGap: '--plasma-dropdown-cell-gap',
|
85
|
-
cellTitleFontFamily: '--plasma-dropdown-cell-title-font-family',
|
86
|
-
cellTitleFontSize: '--plasma-dropdown-cell-title-font-size',
|
87
|
-
cellTitleFontStyle: '--plasma-dropdown-cell-title-font-style',
|
88
|
-
cellTitleFontWeight: '--plasma-dropdown-cell-title-font-weight',
|
89
|
-
cellTitleLetterSpacing: '--plasma-dropdown-cell-title-letter-spacing',
|
90
|
-
cellTitleLineHeight: '--plasma-dropdown-cell-title-line-height',
|
91
68
|
// TODO: Remove below tokens as soon as they are no longer needed
|
92
69
|
footerBackground: '--plasma-dropdown-footer-background',
|
93
70
|
footerWidth: '--plasma-dropdown-footer-width',
|
@@ -151,15 +128,4 @@ export var tokens = {
|
|
151
128
|
groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
|
152
129
|
groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
|
153
130
|
groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left'
|
154
|
-
};
|
155
|
-
export var constants = {
|
156
|
-
focusColor: '--surface-accent',
|
157
|
-
background: '--surface-solid-card-brightness',
|
158
|
-
boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',
|
159
|
-
disclosureIconColor: '--text-secondary',
|
160
|
-
itemBackground: '--plasma-colors-transparent',
|
161
|
-
itemBackgroundHover: '--surface-transparent-secondary',
|
162
|
-
opacity: '0.4',
|
163
|
-
cellTitleColor: '--text-primary',
|
164
|
-
cellBackgroundColor: '--plasma-colors-transparent'
|
165
131
|
};
|
@@ -1,18 +1,26 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { safeUseId } from '@salutejs/plasma-core';
|
3
2
|
import { DropdownItem } from '..';
|
4
|
-
import { Ul } from '../../Dropdown.styles';
|
5
|
-
import { FloatingPopover } from '../../FloatingPopover';
|
3
|
+
import { Ul, StyledPopover } from '../../Dropdown.styles';
|
6
4
|
var DropdownInner = function DropdownInner(_ref) {
|
7
5
|
var item = _ref.item,
|
8
6
|
currentLevel = _ref.currentLevel,
|
7
|
+
focusedPath = _ref.focusedPath,
|
9
8
|
path = _ref.path,
|
10
9
|
dispatchPath = _ref.dispatchPath,
|
11
10
|
index = _ref.index,
|
12
11
|
trigger = _ref.trigger,
|
12
|
+
itemRole = _ref.itemRole,
|
13
13
|
listHeight = _ref.listHeight,
|
14
14
|
listOverflow = _ref.listOverflow,
|
15
|
-
|
15
|
+
handleGlobalToggle = _ref.handleGlobalToggle,
|
16
|
+
closeOnSelect = _ref.closeOnSelect,
|
17
|
+
onHover = _ref.onHover,
|
18
|
+
onItemSelect = _ref.onItemSelect,
|
19
|
+
onItemClick = _ref.onItemClick,
|
20
|
+
listWidth = _ref.listWidth,
|
21
|
+
variant = _ref.variant,
|
22
|
+
hasArrow = _ref.hasArrow,
|
23
|
+
size = _ref.size;
|
16
24
|
var handleToggle = function handleToggle(opened) {
|
17
25
|
if (opened) {
|
18
26
|
dispatchPath({
|
@@ -28,54 +36,80 @@ var DropdownInner = function DropdownInner(_ref) {
|
|
28
36
|
}
|
29
37
|
};
|
30
38
|
var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
|
31
|
-
var
|
32
|
-
var listId = "".concat(treeId, "_tree_level_").concat(currentLevel + 2);
|
39
|
+
var listId = "tree_level_".concat(currentLevel + 2);
|
33
40
|
var nextLevel = currentLevel + 1;
|
34
41
|
if (item !== null && item !== void 0 && item.items) {
|
35
|
-
return /*#__PURE__*/React.createElement(
|
36
|
-
placement: "right-start",
|
42
|
+
return /*#__PURE__*/React.createElement(StyledPopover, {
|
37
43
|
opened: isCurrentListOpen,
|
38
|
-
|
44
|
+
usePortal: false,
|
45
|
+
placement: "right-start",
|
39
46
|
trigger: trigger,
|
40
47
|
target: /*#__PURE__*/React.createElement(DropdownItem, {
|
41
48
|
item: item,
|
42
49
|
index: index,
|
43
50
|
path: path,
|
51
|
+
focusedPath: focusedPath,
|
44
52
|
currentLevel: currentLevel,
|
53
|
+
itemRole: itemRole,
|
54
|
+
onHover: onHover,
|
55
|
+
onItemSelect: onItemSelect,
|
56
|
+
onItemClick: onItemClick,
|
57
|
+
variant: variant,
|
58
|
+
hasArrow: hasArrow,
|
45
59
|
ariaControls: listId,
|
46
60
|
ariaExpanded: isCurrentListOpen,
|
47
61
|
ariaLevel: nextLevel,
|
48
|
-
ariaLabel: item.label
|
62
|
+
ariaLabel: item.label,
|
63
|
+
size: size
|
49
64
|
}),
|
50
|
-
|
65
|
+
onToggle: handleToggle,
|
66
|
+
isFocusTrapped: false,
|
67
|
+
preventOverflow: false
|
51
68
|
}, /*#__PURE__*/React.createElement(Ul, {
|
52
|
-
id: listId,
|
53
|
-
role: "group",
|
54
|
-
isInnerUl: true,
|
55
69
|
listHeight: listHeight,
|
56
70
|
listOverflow: listOverflow,
|
57
|
-
|
71
|
+
role: "group",
|
72
|
+
id: listId,
|
73
|
+
listWidth: listWidth,
|
74
|
+
isInnerUl: true
|
58
75
|
}, item.items.map(function (innerItem, innerIndex) {
|
59
76
|
return /*#__PURE__*/React.createElement(DropdownInner, {
|
60
77
|
key: "".concat(innerIndex, "/").concat(currentLevel),
|
61
78
|
item: innerItem,
|
62
79
|
currentLevel: nextLevel,
|
80
|
+
focusedPath: focusedPath,
|
63
81
|
path: path,
|
64
82
|
dispatchPath: dispatchPath,
|
65
83
|
index: innerIndex,
|
66
84
|
trigger: trigger,
|
85
|
+
itemRole: itemRole,
|
67
86
|
listHeight: listHeight,
|
68
87
|
listOverflow: listOverflow,
|
69
|
-
|
88
|
+
handleGlobalToggle: handleGlobalToggle,
|
89
|
+
closeOnSelect: closeOnSelect,
|
90
|
+
onHover: onHover,
|
91
|
+
onItemSelect: onItemSelect,
|
92
|
+
onItemClick: onItemClick,
|
93
|
+
listWidth: listWidth,
|
94
|
+
variant: variant,
|
95
|
+
hasArrow: hasArrow,
|
96
|
+
size: size
|
70
97
|
});
|
71
98
|
})));
|
72
99
|
}
|
73
100
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
74
101
|
item: item,
|
75
|
-
path: path,
|
76
102
|
index: index,
|
103
|
+
focusedPath: focusedPath,
|
77
104
|
currentLevel: currentLevel,
|
78
|
-
|
105
|
+
itemRole: itemRole,
|
106
|
+
handleGlobalToggle: handleGlobalToggle,
|
107
|
+
closeOnSelect: closeOnSelect,
|
108
|
+
onHover: onHover,
|
109
|
+
onItemSelect: onItemSelect,
|
110
|
+
onItemClick: onItemClick,
|
111
|
+
variant: variant,
|
112
|
+
size: size
|
79
113
|
});
|
80
114
|
};
|
81
115
|
export { DropdownInner };
|
@@ -1,19 +1,28 @@
|
|
1
|
-
import React, { useEffect, useRef
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
2
2
|
import { classes } from '../../Dropdown.tokens';
|
3
3
|
import { cx } from '../../../../utils';
|
4
4
|
import { IconDisclosureRight } from '../../../_Icon';
|
5
|
-
import {
|
6
|
-
import { getItemId } from '../../utils';
|
7
|
-
import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';
|
5
|
+
import { StyledContentLeft, StyledContentRight, StyledText, Wrapper, DisclosureIconWrapper, Divider } from './DropdownItem.styles';
|
8
6
|
export var DropdownItem = function DropdownItem(_ref) {
|
9
7
|
var item = _ref.item,
|
10
8
|
path = _ref.path,
|
9
|
+
focusedPath = _ref.focusedPath,
|
11
10
|
currentLevel = _ref.currentLevel,
|
12
11
|
index = _ref.index,
|
12
|
+
itemRole = _ref.itemRole,
|
13
|
+
closeOnSelect = _ref.closeOnSelect,
|
14
|
+
handleGlobalToggle = _ref.handleGlobalToggle,
|
15
|
+
onHover = _ref.onHover,
|
16
|
+
onItemSelect = _ref.onItemSelect,
|
17
|
+
onItemClick = _ref.onItemClick,
|
13
18
|
ariaControls = _ref.ariaControls,
|
14
19
|
ariaExpanded = _ref.ariaExpanded,
|
20
|
+
ariaHasPopup = _ref.ariaHasPopup,
|
15
21
|
ariaLevel = _ref.ariaLevel,
|
16
|
-
ariaLabel = _ref.ariaLabel
|
22
|
+
ariaLabel = _ref.ariaLabel,
|
23
|
+
variant = _ref.variant,
|
24
|
+
hasArrow = _ref.hasArrow,
|
25
|
+
size = _ref.size;
|
17
26
|
var value = item.value,
|
18
27
|
label = item.label,
|
19
28
|
disabled = item.disabled,
|
@@ -23,19 +32,6 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
23
32
|
dividerBefore = item.dividerBefore,
|
24
33
|
dividerAfter = item.dividerAfter;
|
25
34
|
var ref = useRef(null);
|
26
|
-
var _useContext = useContext(Context),
|
27
|
-
focusedPath = _useContext.focusedPath,
|
28
|
-
size = _useContext.size,
|
29
|
-
variant = _useContext.variant,
|
30
|
-
itemRole = _useContext.itemRole,
|
31
|
-
handleGlobalToggle = _useContext.handleGlobalToggle,
|
32
|
-
closeOnSelect = _useContext.closeOnSelect,
|
33
|
-
onHover = _useContext.onHover,
|
34
|
-
onItemSelect = _useContext.onItemSelect,
|
35
|
-
onItemClick = _useContext.onItemClick,
|
36
|
-
hasArrow = _useContext.hasArrow,
|
37
|
-
treeId = _useContext.treeId;
|
38
|
-
var hasDescendants = Boolean(item.items);
|
39
35
|
var disclosureIconSize = size === 'xs' ? 'xs' : 's';
|
40
36
|
var isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;
|
41
37
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
|
@@ -59,9 +55,7 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
59
55
|
if (onItemClick) {
|
60
56
|
onItemClick(item, event);
|
61
57
|
}
|
62
|
-
|
63
|
-
// Закрываем весь дропдаун целиком при клике на айтем без потомков. Только при closeOnSelect === true.
|
64
|
-
if (closeOnSelect && !hasDescendants) {
|
58
|
+
if (handleGlobalToggle && closeOnSelect) {
|
65
59
|
handleGlobalToggle(false, event);
|
66
60
|
}
|
67
61
|
};
|
@@ -73,25 +67,20 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
73
67
|
return /*#__PURE__*/React.createElement(React.Fragment, null, dividerBefore && /*#__PURE__*/React.createElement(Divider, {
|
74
68
|
variant: variant
|
75
69
|
}), /*#__PURE__*/React.createElement(Wrapper, {
|
76
|
-
ref: ref,
|
77
70
|
className: cx(isDisabledClassName, focusedClass, activeClass),
|
78
|
-
id:
|
71
|
+
id: value.toString(),
|
79
72
|
role: itemRole,
|
73
|
+
ref: ref,
|
74
|
+
"aria-disabled": disabled || isDisabled,
|
80
75
|
onClick: handleClick,
|
81
76
|
onMouseEnter: handleHover,
|
82
77
|
variant: variant,
|
83
|
-
"aria-disabled": disabled || isDisabled,
|
84
78
|
"aria-controls": ariaControls,
|
85
79
|
"aria-expanded": ariaExpanded,
|
80
|
+
"aria-haspopup": ariaHasPopup,
|
86
81
|
"aria-level": ariaLevel,
|
87
82
|
"aria-label": ariaLabel
|
88
|
-
}, /*#__PURE__*/React.createElement(
|
89
|
-
contentLeft: contentLeft,
|
90
|
-
contentRight: contentRight,
|
91
|
-
alignContentLeft: "center",
|
92
|
-
alignContentRight: "center",
|
93
|
-
title: label
|
94
|
-
})), item.items && hasArrow && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRight, {
|
83
|
+
}, contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(StyledText, null, label), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), item.items && hasArrow && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRight, {
|
95
84
|
size: disclosureIconSize,
|
96
85
|
color: "inherit"
|
97
86
|
}))), dividerAfter && /*#__PURE__*/React.createElement(Divider, {
|
@@ -1,21 +1,20 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
import { classes, tokens
|
3
|
-
import { addFocus } from '../../../../mixins';
|
4
|
-
|
5
|
-
import { component, mergeConfig } from '../../../../engines';
|
6
|
-
var mergedCellConfig = /*#__PURE__*/mergeConfig(cellConfig);
|
7
|
-
var Cell = /*#__PURE__*/component(mergedCellConfig);
|
8
|
-
export var CellWrapper = /*#__PURE__*/styled.div.withConfig({
|
2
|
+
import { classes, tokens } from '../../Dropdown.tokens';
|
3
|
+
import { addFocus, applyEllipsis } from '../../../../mixins';
|
4
|
+
export var StyledContentLeft = /*#__PURE__*/styled.div.withConfig({
|
9
5
|
componentId: "plasma-new-hope__sc-hs0ek1-0"
|
10
|
-
})(["
|
11
|
-
export var
|
6
|
+
})(["display:inline-flex;"]);
|
7
|
+
export var StyledContentRight = /*#__PURE__*/styled.div.withConfig({
|
12
8
|
componentId: "plasma-new-hope__sc-hs0ek1-1"
|
13
|
-
})([""]);
|
9
|
+
})(["margin-left:auto;display:inline-flex;"]);
|
14
10
|
export var DisclosureIconWrapper = /*#__PURE__*/styled.div.withConfig({
|
15
11
|
componentId: "plasma-new-hope__sc-hs0ek1-2"
|
16
|
-
})(["line-height:0;color:var(", ");"],
|
17
|
-
export var
|
12
|
+
})(["line-height:0;color:var(", ");"], tokens.disclosureIconColor);
|
13
|
+
export var StyledText = /*#__PURE__*/styled.div.withConfig({
|
18
14
|
componentId: "plasma-new-hope__sc-hs0ek1-3"
|
15
|
+
})(["", ";flex:1;"], /*#__PURE__*/applyEllipsis());
|
16
|
+
export var Divider = /*#__PURE__*/styled.div.withConfig({
|
17
|
+
componentId: "plasma-new-hope__sc-hs0ek1-4"
|
19
18
|
})(["height:1px;margin-top:", ";margin-right:var(", ");margin-bottom:", ";margin-left:var(", ");background:var(", ");"], function (_ref) {
|
20
19
|
var variant = _ref.variant;
|
21
20
|
return "var(".concat(variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop, ")");
|
@@ -24,15 +23,18 @@ export var Divider = /*#__PURE__*/styled.div.withConfig({
|
|
24
23
|
return "var(".concat(variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom, ")");
|
25
24
|
}, tokens.dividerMarginLeft, tokens.dividerColor);
|
26
25
|
export var Wrapper = /*#__PURE__*/styled.li.withConfig({
|
27
|
-
componentId: "plasma-new-hope__sc-hs0ek1-
|
28
|
-
})(["display:flex;align-items:center;
|
26
|
+
componentId: "plasma-new-hope__sc-hs0ek1-5"
|
27
|
+
})(["display:flex;align-items:center;margin:0;box-sizing:content-box;padding-top:", ";padding-right:var(", ");padding-bottom:", ";padding-left:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");background:var(", ");color:var(", ");border-radius:var(", ");user-select:none;&:hover:not(.", "){cursor:pointer;background:var(", ");}&.", "{background:var(", ");}&.", "{opacity:var(", ");cursor:not-allowed;}:focus{outline:none;}", ";"], function (_ref3) {
|
29
28
|
var variant = _ref3.variant;
|
30
|
-
return "var(".concat(variant === 'tight' ? tokens.
|
31
|
-
}, tokens.
|
29
|
+
return "var(".concat(variant === 'tight' ? tokens.itemPaddingTopTight : tokens.itemPaddingTop, ")");
|
30
|
+
}, tokens.itemPaddingRight, function (_ref4) {
|
31
|
+
var variant = _ref4.variant;
|
32
|
+
return "var(".concat(variant === 'tight' ? tokens.itemPaddingBottomTight : tokens.itemPaddingBottom, ")");
|
33
|
+
}, tokens.itemPaddingLeft, tokens.itemFontFamily, tokens.itemFontSize, tokens.itemFontStyle, tokens.itemFontWeightBold, tokens.itemFontLetterSpacing, tokens.itemFontLineHeight, tokens.itemBackground, tokens.itemColor, tokens.itemBorderRadius, classes.dropdownItemIsDisabled, tokens.itemBackgroundHover, classes.dropdownItemIsActive, tokens.itemBackgroundHover, classes.dropdownItemIsDisabled, tokens.disabledOpacity, /*#__PURE__*/addFocus({
|
32
34
|
outlineSize: '0.0625rem',
|
33
35
|
outlineOffset: '0',
|
34
|
-
outlineColor: /*#__PURE__*/"var(".concat(
|
36
|
+
outlineColor: /*#__PURE__*/"var(".concat(tokens.focusColor, ")"),
|
35
37
|
outlineRadius: /*#__PURE__*/"var(".concat(tokens.itemBorderRadius, ")"),
|
36
38
|
hasTransition: false,
|
37
|
-
customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(
|
39
|
+
customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(tokens.focusColor, ");\n }\n ")
|
38
40
|
}));
|
@@ -26,7 +26,4 @@ export var getValidComponent = function getValidComponent(element, props) {
|
|
26
26
|
return /*#__PURE__*/React.createElement(Component, props);
|
27
27
|
}
|
28
28
|
return element;
|
29
|
-
};
|
30
|
-
export { getItemId } from './getItemId';
|
31
|
-
export { getItemByFocused } from './getItemByFocused';
|
32
|
-
export { getPlacement } from './getPlacement';
|
29
|
+
};
|
@@ -58,7 +58,7 @@ 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
64
|
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:flex-end;"]);
|
@@ -10,9 +10,9 @@ 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
|
|
@@ -34,24 +34,32 @@ ReactDOM.render(
|
|
34
34
|
```
|
35
35
|
|
36
36
|
### Вызов уведомления
|
37
|
-
После подключения `NotificationsProvider` станет возможен вызов функции `addNotification
|
38
|
-
Функция принимает значения свойств компонента `Notification
|
37
|
+
После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`, который приведет к отображению оповещения.
|
38
|
+
Функция принимает значения свойств компонента `Notification`, включая необязательное поле `id`. И возвращает сгенерированный или переданный `id`, по которому можно закрыть оповещение через вызов `closeNotification`.
|
39
39
|
|
40
40
|
```tsx live
|
41
41
|
import React from 'react';
|
42
|
-
import { Button, addNotification, NotificationsProvider } from '@salutejs/{{ package }}';
|
42
|
+
import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
|
43
43
|
|
44
44
|
export function App() {
|
45
|
-
const
|
45
|
+
const handleShow = React.useCallback(() => {
|
46
46
|
addNotification({
|
47
|
+
id: 'incoming-call',
|
47
48
|
title: 'Входящий вызов',
|
48
49
|
children: 'Принять?',
|
49
50
|
}, 1000);
|
50
51
|
}, []);
|
51
52
|
|
53
|
+
const handleHide = React.useCallback(() => {
|
54
|
+
closeNotification('incoming-call');
|
55
|
+
}, []);
|
56
|
+
|
52
57
|
return (
|
53
58
|
<NotificationsProvider>
|
54
|
-
<
|
59
|
+
<ButtonGroup>
|
60
|
+
<Button text="Показать оповещение" onClick={handleShow} />
|
61
|
+
<Button text="Скрыть оповещение" onClick={handleHide} />
|
62
|
+
</ButtonGroup>
|
55
63
|
</NotificationsProvider>
|
56
64
|
);
|
57
65
|
}
|
@@ -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,7 +35,7 @@ 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
40
|
}, /*#__PURE__*/React.createElement(StyledRoot, null, notifications.map(function (_ref2) {
|
39
41
|
var id = _ref2.id,
|
@@ -41,7 +43,7 @@ export var NotificationsPortal = function NotificationsPortal(_ref) {
|
|
41
43
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
42
44
|
return /*#__PURE__*/React.createElement(StyledItemWrapper, {
|
43
45
|
key: id,
|
44
|
-
className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened),
|
46
|
+
className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened, placement === 'bottom-left' && classes.notificationLeftToRightAnimation),
|
45
47
|
isHidden: isHidden || false
|
46
48
|
}, /*#__PURE__*/React.createElement(Notification, _extends({
|
47
49
|
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';
|