@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
@@ -8,33 +8,30 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
8
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
|
-
import React, {
|
12
|
-
import {
|
13
|
-
import { cx } from '../../utils';
|
14
|
-
import { useOutsideClick } from '../../hooks';
|
11
|
+
import React, { forwardRef, useReducer } from 'react';
|
12
|
+
import { cx, getPlacements } from '../../utils';
|
15
13
|
import { pathReducer } from './reducers/pathReducer';
|
16
14
|
import { focusedPathReducer } from './reducers/focusedPathReducer';
|
17
15
|
import { DropdownInner } from './ui';
|
18
16
|
import { base as viewCSS } from './variations/_view/base';
|
19
17
|
import { base as sizeCSS } from './variations/_size/base';
|
20
|
-
import { Ul, base } from './Dropdown.styles';
|
21
|
-
import { childrenWithProps
|
18
|
+
import { Ul, StyledPopover, base } from './Dropdown.styles';
|
19
|
+
import { childrenWithProps } from './utils';
|
22
20
|
import { classes } from './Dropdown.tokens';
|
23
21
|
import { useKeyNavigation } from './hooks/useKeyboardNavigation';
|
24
22
|
import { useHashMaps } from './hooks/useHashMaps';
|
25
|
-
import { FloatingPopover } from './FloatingPopover';
|
26
|
-
export var Context = /*#__PURE__*/createContext({});
|
27
23
|
|
28
24
|
/**
|
29
25
|
* Выпадающий список.
|
30
26
|
*/
|
31
27
|
export var dropdownRoot = function dropdownRoot(Root) {
|
32
28
|
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
33
|
-
var _getItemByFocused;
|
34
29
|
var items = _ref.items,
|
35
30
|
children = _ref.children,
|
36
|
-
placement = _ref.placement,
|
37
|
-
|
31
|
+
_ref$placement = _ref.placement,
|
32
|
+
placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
|
33
|
+
_ref$offset = _ref.offset,
|
34
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
38
35
|
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
39
36
|
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
40
37
|
onToggle = _ref.onToggle,
|
@@ -71,25 +68,6 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
71
68
|
_useHashMaps2 = _slicedToArray(_useHashMaps, 2),
|
72
69
|
pathMap = _useHashMaps2[0],
|
73
70
|
focusedToValueMap = _useHashMaps2[1];
|
74
|
-
var activeDescendantItemValue = ((_getItemByFocused = getItemByFocused(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value) || '';
|
75
|
-
var floatingPopoverRef = useRef(null);
|
76
|
-
var treeId = safeUseId();
|
77
|
-
|
78
|
-
// Логика работы при клике за пределами выпадающего списка
|
79
|
-
var targetRef = useOutsideClick(function (event) {
|
80
|
-
if (!isCurrentListOpen || !closeOnOverlayClick) {
|
81
|
-
return;
|
82
|
-
}
|
83
|
-
dispatchPath({
|
84
|
-
type: 'reset'
|
85
|
-
});
|
86
|
-
dispatchFocusedPath({
|
87
|
-
type: 'reset'
|
88
|
-
});
|
89
|
-
if (onToggle) {
|
90
|
-
onToggle(false, event);
|
91
|
-
}
|
92
|
-
}, floatingPopoverRef);
|
93
71
|
var handleGlobalToggle = function handleGlobalToggle(opened, event) {
|
94
72
|
if (opened) {
|
95
73
|
dispatchPath({
|
@@ -121,64 +99,66 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
121
99
|
}),
|
122
100
|
onKeyDown = _useKeyNavigation.onKeyDown;
|
123
101
|
var isCurrentListOpen = Boolean(path[0]);
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
onHover: onHover,
|
133
|
-
onItemClick: onItemClick,
|
134
|
-
onItemSelect: onItemSelect,
|
135
|
-
hasArrow: hasArrow,
|
136
|
-
treeId: treeId
|
137
|
-
}
|
138
|
-
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
139
|
-
ref: floatingPopoverRef,
|
102
|
+
var getActiveDescendant = function getActiveDescendant() {
|
103
|
+
var _focusedToValueMap$ge;
|
104
|
+
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
105
|
+
return "".concat(acc, "/").concat(n);
|
106
|
+
}, '').replace(/^(\/)/, '');
|
107
|
+
return focusedToValueMap === null || focusedToValueMap === void 0 || (_focusedToValueMap$ge = focusedToValueMap.get(focusedPathAsString)) === null || _focusedToValueMap$ge === void 0 ? void 0 : _focusedToValueMap$ge.value.toString();
|
108
|
+
};
|
109
|
+
return /*#__PURE__*/React.createElement(StyledPopover, {
|
140
110
|
opened: isCurrentListOpen,
|
141
111
|
onToggle: handleGlobalToggle,
|
142
|
-
placement: getPlacement(placement),
|
143
112
|
offset: offset,
|
144
|
-
|
113
|
+
placement: getPlacements(placement),
|
145
114
|
trigger: trigger,
|
115
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
116
|
+
isFocusTrapped: false,
|
146
117
|
target: childrenWithProps(children, {
|
147
118
|
role: 'combobox',
|
148
|
-
'aria-controls':
|
119
|
+
'aria-controls': 'tree_level_1',
|
149
120
|
'aria-expanded': isCurrentListOpen,
|
150
|
-
'aria-activedescendant':
|
121
|
+
'aria-activedescendant': getActiveDescendant(),
|
151
122
|
onKeyDown: onKeyDown
|
152
|
-
})
|
123
|
+
}),
|
124
|
+
preventOverflow: false,
|
125
|
+
usePortal: Boolean(portal),
|
126
|
+
frame: portal
|
153
127
|
}, /*#__PURE__*/React.createElement(Root, _extends({
|
154
128
|
className: cx(className, classes.dropdownRoot),
|
155
129
|
ref: ref,
|
156
130
|
view: view,
|
157
|
-
size: size
|
158
|
-
style: {
|
159
|
-
display: 'inline-block'
|
160
|
-
}
|
131
|
+
size: size
|
161
132
|
}, rest), /*#__PURE__*/React.createElement(Ul, {
|
162
|
-
ref: targetRef,
|
163
|
-
id: "".concat(treeId, "_tree_level_1"),
|
164
|
-
role: "tree",
|
165
133
|
listHeight: listHeight,
|
166
134
|
listOverflow: listOverflow,
|
135
|
+
role: "tree",
|
136
|
+
id: "tree_level_1",
|
167
137
|
listWidth: listWidth
|
168
138
|
}, items.map(function (item, index) {
|
169
139
|
return /*#__PURE__*/React.createElement(DropdownInner, {
|
170
140
|
key: "".concat(index, "/0"),
|
171
141
|
item: item,
|
172
142
|
currentLevel: 0,
|
143
|
+
focusedPath: focusedPath,
|
173
144
|
trigger: trigger,
|
174
145
|
path: path,
|
175
146
|
dispatchPath: dispatchPath,
|
176
147
|
index: index,
|
148
|
+
itemRole: itemRole,
|
177
149
|
listHeight: listHeight,
|
178
150
|
listOverflow: listOverflow,
|
179
|
-
|
151
|
+
handleGlobalToggle: handleGlobalToggle,
|
152
|
+
closeOnSelect: closeOnSelect,
|
153
|
+
onHover: onHover,
|
154
|
+
onItemSelect: onItemSelect,
|
155
|
+
onItemClick: onItemClick,
|
156
|
+
listWidth: listWidth,
|
157
|
+
variant: variant,
|
158
|
+
hasArrow: hasArrow,
|
159
|
+
size: size
|
180
160
|
});
|
181
|
-
}))))
|
161
|
+
}))));
|
182
162
|
});
|
183
163
|
};
|
184
164
|
export var dropdownConfig = {
|
@@ -1,21 +1,37 @@
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
2
3
|
import { css } from '@emotion/react';
|
4
|
+
import { component } from '../../engines';
|
5
|
+
import { popoverConfig, popoverClasses } from '../Popover';
|
3
6
|
import { getCorrectHeight } from './utils';
|
4
|
-
import { tokens
|
7
|
+
import { tokens } from './Dropdown.tokens';
|
8
|
+
var Popover = /*#__PURE__*/component(popoverConfig);
|
9
|
+
export var StyledPopover = /*#__PURE__*/_styled(Popover, {
|
10
|
+
target: "euqmbvx1",
|
11
|
+
label: "plasma-new-hope__StyledPopover"
|
12
|
+
})(".", /*#__PURE__*/String(popoverClasses.wrapper), ",.", /*#__PURE__*/String(popoverClasses.target), "{display:block;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVk0QyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY29tcG9uZW50IH0gZnJvbSAnLi4vLi4vZW5naW5lcyc7XG5pbXBvcnQgeyBwb3BvdmVyQ29uZmlnLCBwb3BvdmVyQ2xhc3NlcyB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KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcblxuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
|
5
13
|
export var Ul = /*#__PURE__*/_styled("ul", {
|
6
14
|
target: "euqmbvx0",
|
7
15
|
label: "plasma-new-hope__Ul"
|
8
|
-
})("box-sizing:border-box;width:", function (_ref) {
|
16
|
+
})("box-sizing:border-box;background:var(", tokens.background, ");box-shadow:var(", tokens.boxShadow, ");border-radius:var(", tokens.borderRadius, ");width:", function (_ref) {
|
9
17
|
var listWidth = _ref.listWidth;
|
10
18
|
return listWidth || "var(".concat(tokens.width, ")");
|
11
19
|
}, ";height:", function (_ref2) {
|
12
20
|
var listHeight = _ref2.listHeight;
|
13
21
|
return listHeight ? getCorrectHeight(listHeight) : 'auto';
|
14
|
-
}, ";
|
15
|
-
var
|
16
|
-
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0.125rem 0") : 0;
|
17
|
-
}, ";padding:var(", tokens.padding, ") 0;overflow:", function (_ref4) {
|
18
|
-
var listOverflow = _ref4.listOverflow;
|
22
|
+
}, ";overflow:", function (_ref3) {
|
23
|
+
var listOverflow = _ref3.listOverflow;
|
19
24
|
return listOverflow || 'initial';
|
20
|
-
}, ";
|
21
|
-
|
25
|
+
}, ";margin:", function (_ref4) {
|
26
|
+
var isInnerUl = _ref4.isInnerUl;
|
27
|
+
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 var(").concat(tokens.padding, ")") : 0;
|
28
|
+
}, ";padding:var(", tokens.padding, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY29tcG9uZW50IH0gZnJvbSAnLi4vLi4vZW5naW5lcyc7XG5pbXBvcnQgeyBwb3BvdmVyQ29uZmlnLCBwb3BvdmVyQ2xhc3NlcyB9IGZyb20gJy4uL1BvcG92ZXInO1xuXG5pbXBvcnQgeyBnZXRDb3JyZWN0SGVpZ2h0IH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyBEcm9wZG93blByb3BzIH0gZnJvbSAnLi9Ecm9wZG93bi50eXBlcyc7XG5pbXBvcnQgeyB0b2tlbnMgfSBmcm9tICcuL0Ryb3Bkb3duLnRva2Vucyc7XG5cbmNvbnN0IFBvcG92ZXIgPSBjb21wb25lbnQocG9wb3ZlckNvbmZpZyk7XG5cbmV4cG9ydCBjb25zdCBT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rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
|
29
|
+
export var base = process.env.NODE_ENV === "production" ? {
|
30
|
+
name: "1mufh2u-plasma-new-hope__base",
|
31
|
+
styles: "display:inline-block;label:plasma-new-hope__base;"
|
32
|
+
} : {
|
33
|
+
name: "1mufh2u-plasma-new-hope__base",
|
34
|
+
styles: "display:inline-block;label:plasma-new-hope__base;",
|
35
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNDdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ecm9wZG93bi9Ecm9wZG93bi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IGNvbXBvbmVudCB9IGZyb20gJy4uLy4uL2VuZ2luZXMnO1xuaW1wb3J0IHsgcG9wb3ZlckNvbmZpZywgcG9wb3ZlckNsYXNzZXMgfSBmcm9tICcuLi9Qb3BvdmVyJztcblxuaW1wb3J0IHsgZ2V0Q29ycmVjdEhlaWdodCB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IHsgRHJvcGRvd25Qcm9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iAgICBvdmVyZmxvdzogJHsoeyBsaXN0T3ZlcmZsb3cgfSkgPT4gbGlzdE92ZXJmbG93IHx8ICdpbml0aWFsJ307XG5cbiAgICBtYXJnaW46ICR7KHsgaXNJbm5lclVsIH0pID0+IChpc0lubmVyVWwgPyBgY2FsYyh2YXIoJHt0b2tlbnMucGFkZGluZ30pICogLTEpIDAgMCB2YXIoJHt0b2tlbnMucGFkZGluZ30pYCA6IDApfTtcbiAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pO1xuYDtcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuYDtcbiJdfQ== */",
|
36
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
37
|
+
};
|
@@ -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, {
|