@salutejs/plasma-new-hope 0.77.1-canary.1201.8930079977.0 → 0.77.1-canary.1202.8938243709.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/Combobox.css +7 -17
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +10 -81
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +9 -21
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
- package/cjs/components/Dropdown/Dropdown.css +2 -25
- package/cjs/components/Dropdown/Dropdown.js +54 -138
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +7 -40
- package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
- package/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -79
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -90
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
- package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
- package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
- package/cjs/components/Dropdown/utils/index.js +0 -16
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +7 -14
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Select/Select.css +7 -14
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.css +7 -16
- package/cjs/components/Select/ui/SelectItem/SelectItem.js +3 -3
- package/cjs/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
- package/cjs/components/Select/ui/SelectItem/{SelectItem.styles_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/cjs/index.css +8 -18
- package/cjs/index.js +2 -8
- package/cjs/index.js.map +1 -1
- package/es/components/Combobox/Combobox.css +7 -17
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +11 -82
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +10 -19
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
- package/es/components/Dropdown/Dropdown.css +2 -25
- package/es/components/Dropdown/Dropdown.js +60 -144
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +7 -39
- package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
- package/es/components/Dropdown/Dropdown.tokens.js +23 -26
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -80
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -89
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
- package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
- package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
- package/es/components/Dropdown/utils/index.js +2 -16
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Pagination/Pagination.css +7 -14
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Select/Select.css +7 -14
- package/es/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
- package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/es/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
- package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/es/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
- package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/es/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
- package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.css +7 -16
- package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
- package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
- package/es/components/Select/ui/SelectItem/{SelectItem.styles_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/es/index.css +8 -18
- package/es/index.js +1 -4
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +2 -91
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +7 -27
- package/styled-components/cjs/components/Dropdown/Dropdown.js +54 -140
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +7 -22
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +80 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
- package/styled-components/cjs/components/Dropdown/index.js +1 -9
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +105 -77
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +18 -83
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
- package/styled-components/cjs/components/Dropdown/ui/index.js +5 -19
- package/styled-components/cjs/components/Dropdown/utils/index.js +1 -15
- package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +9 -1
- package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
- package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +27 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +27 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +27 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +13 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +27 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +13 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +22 -0
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +21 -0
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +3 -90
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +6 -23
- package/styled-components/es/components/Dropdown/Dropdown.js +55 -142
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +5 -18
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +80 -0
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +23 -26
- package/styled-components/es/components/Dropdown/index.js +0 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +107 -78
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +14 -80
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
- package/styled-components/es/components/Dropdown/ui/index.js +1 -3
- package/styled-components/es/components/Dropdown/utils/index.js +1 -15
- package/styled-components/es/components/Dropdown/variations/_size/tokens.json +9 -1
- package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
- package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
- package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +21 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +7 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +21 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +7 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +21 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +7 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +21 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +7 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +16 -0
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +15 -0
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +13 -15
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +1 -5
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +2 -59
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +4 -4
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +1 -8
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +22 -24
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +40 -64
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +1 -3
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +56 -2
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +2 -5
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +38 -44
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/index.d.ts +1 -3
- package/types/components/Dropdown/ui/index.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +2 -5
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
- package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
- package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
- package/types/components/Select/utils/index.d.ts +1 -1
- package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +30 -0
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +30 -0
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +18 -0
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +30 -0
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +30 -0
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +15 -0
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +1 -0
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +51 -0
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
- package/cjs/components/Combobox/utils/index.js +0 -23
- package/cjs/components/Combobox/utils/index.js.map +0 -1
- package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
- package/cjs/components/Dropdown/hooks/useHashMaps.js +0 -31
- package/cjs/components/Dropdown/hooks/useHashMaps.js.map +0 -1
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -200
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -37
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
- package/cjs/components/Dropdown/reducers/pathReducer.js +0 -41
- package/cjs/components/Dropdown/reducers/pathReducer.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -119
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -30
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -112
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
- package/es/components/Combobox/utils/index.js +0 -19
- package/es/components/Combobox/utils/index.js.map +0 -1
- package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
- package/es/components/Dropdown/hooks/useHashMaps.js +0 -27
- package/es/components/Dropdown/hooks/useHashMaps.js.map +0 -1
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -196
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
- package/es/components/Dropdown/reducers/focusedPathReducer.js +0 -33
- package/es/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
- package/es/components/Dropdown/reducers/pathReducer.js +0 -37
- package/es/components/Dropdown/reducers/pathReducer.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -115
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -23
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -107
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
- package/styled-components/cjs/components/Combobox/utils/index.js +0 -23
- package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +0 -29
- package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -199
- package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -40
- package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +0 -44
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -114
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +0 -5
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -33
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -5
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -119
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -25
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -292
- package/styled-components/es/components/Combobox/utils/index.js +0 -15
- package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +0 -23
- package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -193
- package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +0 -34
- package/styled-components/es/components/Dropdown/reducers/pathReducer.js +0 -38
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -108
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +0 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -25
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -1
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -111
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -19
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -292
- package/types/components/Combobox/utils/index.d.ts +0 -4
- package/types/components/Combobox/utils/index.d.ts.map +0 -1
- package/types/components/Dropdown/hooks/useHashMaps.d.ts +0 -6
- package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +0 -1
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +0 -23
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +0 -1
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +0 -16
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +0 -1
- package/types/components/Dropdown/reducers/pathReducer.d.ts +0 -20
- package/types/components/Dropdown/reducers/pathReducer.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +0 -5
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +0 -26
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +0 -7
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +0 -60
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +0 -58
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +0 -13
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +0 -1
- /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base_x642ct.css +0 -0
- /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base_x642ct.css +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
- /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.d.ts +0 -0
- /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.d.ts +0 -0
- /package/types/examples/plasma_b2c/components/Dropdown/{Dropdown.config.d.ts → Normal/Dropdown.config.d.ts} +0 -0
@@ -1,88 +1,17 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
1
|
+
import 'react';
|
2
|
+
import '@salutejs/plasma-core';
|
3
|
+
import '@linaria/react';
|
4
|
+
import '@linaria/core';
|
5
|
+
import 'focus-visible';
|
6
|
+
import 'react-dom';
|
7
|
+
import 'react-popper';
|
8
|
+
import '../../../../utils/react.js';
|
9
|
+
import { dropdownItemRoot } from '../../../Dropdown/ui/DropdownItem/DropdownItem.js';
|
7
10
|
import { base as base$1 } from './variations/_view/base.js';
|
8
11
|
import { base as base$2 } from './variations/_size/base.js';
|
9
|
-
import {
|
12
|
+
import { base } from './ComboboxItem.styles.js';
|
10
13
|
|
11
|
-
var
|
12
|
-
var comboboxItemRoot = function comboboxItemRoot(Root) {
|
13
|
-
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
14
|
-
var id = _ref.id,
|
15
|
-
className = _ref.className,
|
16
|
-
children = _ref.children,
|
17
|
-
text = _ref.text,
|
18
|
-
isSelected = _ref.isSelected,
|
19
|
-
name = _ref.name,
|
20
|
-
checked = _ref.checked,
|
21
|
-
value = _ref.value,
|
22
|
-
view = _ref.view,
|
23
|
-
size = _ref.size,
|
24
|
-
disabled = _ref.disabled,
|
25
|
-
_ref$role = _ref.role,
|
26
|
-
role = _ref$role === void 0 ? 'option' : _ref$role,
|
27
|
-
ContentLeftComponent = _ref.contentLeft,
|
28
|
-
ContentRightComponent = _ref.contentRight,
|
29
|
-
onSelect = _ref.onSelect,
|
30
|
-
onClick = _ref.onClick,
|
31
|
-
onChange = _ref.onChange,
|
32
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
33
|
-
var uniqId = safeUseId();
|
34
|
-
var innerId = id || uniqId;
|
35
|
-
var withComboboxItemIsSelected = checked || isSelected ? classes.comboboxItemIsDisabled : undefined;
|
36
|
-
var withComboboxItemIsDisabled = disabled ? classes.comboboxItemIsDisabled : undefined;
|
37
|
-
var handleOnClick = useCallback(function (event) {
|
38
|
-
if (disabled) {
|
39
|
-
return;
|
40
|
-
}
|
41
|
-
onClick === null || onClick === void 0 || onClick(event);
|
42
|
-
if (onSelect && !ContentLeftComponent) {
|
43
|
-
onSelect(value, text);
|
44
|
-
}
|
45
|
-
}, [onSelect, disabled]);
|
46
|
-
var handleOnChange = useCallback(function (event) {
|
47
|
-
if (disabled) {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
onChange === null || onChange === void 0 || onChange(event);
|
51
|
-
if (onSelect && ContentLeftComponent) {
|
52
|
-
onSelect(value, text);
|
53
|
-
}
|
54
|
-
}, [onSelect, disabled]);
|
55
|
-
var contentProps = _objectSpread2({
|
56
|
-
name: name,
|
57
|
-
value: value,
|
58
|
-
checked: checked || isSelected,
|
59
|
-
disabled: disabled,
|
60
|
-
tabIndex: -1
|
61
|
-
}, !disabled && {
|
62
|
-
onChange: handleOnChange
|
63
|
-
});
|
64
|
-
var ContentLeft = useMemo(function () {
|
65
|
-
return getValidComponent(ContentLeftComponent, contentProps);
|
66
|
-
}, [ContentRightComponent, contentProps]);
|
67
|
-
var ContentRight = useMemo(function () {
|
68
|
-
return getValidComponent(ContentRightComponent, contentProps);
|
69
|
-
}, [ContentRightComponent, contentProps]);
|
70
|
-
return /*#__PURE__*/React.createElement(Root, _extends({
|
71
|
-
className: cx(withComboboxItemIsSelected, withComboboxItemIsDisabled, className),
|
72
|
-
view: view,
|
73
|
-
size: size,
|
74
|
-
id: innerId,
|
75
|
-
isSelected: isSelected,
|
76
|
-
role: role,
|
77
|
-
ref: outerRootRef,
|
78
|
-
tabIndex: 0,
|
79
|
-
"aria-disabled": disabled,
|
80
|
-
"aria-selected": isSelected,
|
81
|
-
onClick: handleOnClick,
|
82
|
-
"data-value": value
|
83
|
-
}, rest), text ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledContentLeft, null, ContentLeftComponent && ContentLeft), /*#__PURE__*/React.createElement(StyledText, null, text), /*#__PURE__*/React.createElement(StyledContentRight, null, ContentRightComponent && ContentRight)) : children);
|
84
|
-
});
|
85
|
-
};
|
14
|
+
var comboboxItemRoot = dropdownItemRoot;
|
86
15
|
var comboboxItemConfig = {
|
87
16
|
name: 'ComboboxItem',
|
88
17
|
tag: 'div',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComboboxItem.js","sources":["../../../../../src/components/Combobox/ui/ComboboxItem/ComboboxItem.tsx"],"sourcesContent":["import
|
1
|
+
{"version":3,"file":"ComboboxItem.js","sources":["../../../../../src/components/Combobox/ui/ComboboxItem/ComboboxItem.tsx"],"sourcesContent":["import { dropdownItemRoot } from '../../../Dropdown';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base } from './ComboboxItem.styles';\n\nexport const comboboxItemRoot = dropdownItemRoot;\n\nexport const comboboxItemConfig = {\n name: 'ComboboxItem',\n tag: 'div',\n layout: comboboxItemRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["comboboxItemRoot","dropdownItemRoot","comboboxItemConfig","name","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;AAMO,IAAMA,gBAAgB,GAAGC,iBAAgB;AAEzC,IAAMC,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEL,gBAAgB;AACxBM,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,GAAG,EAAEG,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNL,IAAAA,IAAI,EAAE,SAAS;AACfG,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1,23 +1,14 @@
|
|
1
|
-
import './ComboboxItem.
|
2
|
-
import
|
1
|
+
import './ComboboxItem.styles_936wgl.css';
|
2
|
+
import 'react';
|
3
|
+
import '@salutejs/plasma-core';
|
4
|
+
import '@linaria/react';
|
5
|
+
import '@linaria/core';
|
3
6
|
import 'focus-visible';
|
7
|
+
import 'react-dom';
|
8
|
+
import 'react-popper';
|
9
|
+
import '../../../../utils/react.js';
|
4
10
|
|
5
|
-
var
|
6
|
-
name: "StyledContentLeft",
|
7
|
-
"class": "s1thh7ji",
|
8
|
-
propsAsIs: false
|
9
|
-
});
|
10
|
-
var StyledContentRight = /*#__PURE__*/styled('div')({
|
11
|
-
name: "StyledContentRight",
|
12
|
-
"class": "s1exy6xj",
|
13
|
-
propsAsIs: false
|
14
|
-
});
|
15
|
-
var StyledText = /*#__PURE__*/styled('div')({
|
16
|
-
name: "StyledText",
|
17
|
-
"class": "s18437sq",
|
18
|
-
propsAsIs: false
|
19
|
-
});
|
20
|
-
var base = "bvoi56l";
|
11
|
+
var base = "b1thh7ji";
|
21
12
|
|
22
|
-
export {
|
13
|
+
export { base };
|
23
14
|
//# sourceMappingURL=ComboboxItem.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComboboxItem.styles.js","sources":["../../../../../src/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport {
|
1
|
+
{"version":3,"file":"ComboboxItem.styles.js","sources":["../../../../../src/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../Combobox.tokens';\nimport { dropdownTokens } from '../../../Dropdown';\nimport { baseContent as dropdownItemBase } from '../../../Dropdown/ui/DropdownItem/DropdownItem.styles';\n\n// NOTE: Необходимое переопределение токенов из компонента DropdownItem т.к. используются его части\nexport const mappingOverride = `\n ${dropdownTokens.itemBackground}: var(${tokens.itemBackground});\n ${dropdownTokens.itemColor}: var(${tokens.itemColor});\n ${dropdownTokens.itemBackgroundHover}: var(${tokens.itemBackgroundHover});\n ${dropdownTokens.itemBackgroundSelected}: var(${tokens.itemBackgroundSelected});\n ${dropdownTokens.itemColorSelected}: var(${tokens.itemColorSelected});\n ${dropdownTokens.itemBackgroundSelectedHover}: var(${tokens.itemBackgroundSelectedHover});\n ${dropdownTokens.itemColorSelectedHover}: var(${tokens.itemColorSelectedHover});\n ${dropdownTokens.itemContentLeftColor}: var(${tokens.itemContentLeftColor});\n ${dropdownTokens.itemContentRightColor}: var(${tokens.itemContentRightColor});\n ${dropdownTokens.disabledOpacity}: var(${tokens.disabledOpacity});\n ${dropdownTokens.focusColor}: var(${tokens.focusColor});\n ${dropdownTokens.itemWidth}: var(${tokens.itemWidth});\n ${dropdownTokens.itemHeight}: var(${tokens.itemHeight});\n ${dropdownTokens.itemBorderRadius}: var(${tokens.itemBorderRadius});\n ${dropdownTokens.itemPaddingTop}: var(${tokens.itemPaddingTop});\n ${dropdownTokens.itemPaddingRight}: var(${tokens.itemPaddingRight});\n ${dropdownTokens.itemPaddingBottom}: var(${tokens.itemPaddingBottom});\n ${dropdownTokens.itemPaddingLeft}: var(${tokens.itemPaddingLeft});\n ${dropdownTokens.itemMarginTop}: var(${tokens.itemMarginTop});\n ${dropdownTokens.itemMarginRight}: var(${tokens.itemMarginRight});\n ${dropdownTokens.itemMarginBottom}: var(${tokens.itemMarginBottom});\n ${dropdownTokens.itemMarginLeft}: var(${tokens.itemMarginLeft});\n ${dropdownTokens.itemFontFamily}: var(${tokens.itemFontFamily});\n ${dropdownTokens.itemFontSize}: var(${tokens.itemFontSize});\n ${dropdownTokens.itemFontStyle}: var(${tokens.itemFontStyle});\n ${dropdownTokens.itemFontWeightBold}: var(${tokens.itemFontWeightBold});\n ${dropdownTokens.itemFontLetterSpacing}: var(${tokens.itemFontLetterSpacing});\n ${dropdownTokens.itemFontLineHeight}: var(${tokens.itemFontLineHeight});\n ${dropdownTokens.itemContentLeftWidth}: var(${tokens.itemContentLeftWidth});\n ${dropdownTokens.itemContentRightWidth}: var(${tokens.itemContentRightWidth});\n`;\n\nexport const base = css`\n ${dropdownItemBase};\n ${mappingOverride};\n`;\n"],"names":["base"],"mappings":";;;;;;;;;AAwCO,IAAMA,IAAI,GAGhB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b1thh7ji{box-sizing:content-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:100%;font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);width:var(--plasma-dropdown-item-width);height:var(--plasma-dropdown-item-height);padding:var(--plasma-dropdown-item-padding-top) var(--plasma-dropdown-item-padding-right) var(--plasma-dropdown-item-padding-bottom) var(--plasma-dropdown-item-padding-left);margin:var(--plasma-dropdown-item-margin-top) var(--plasma-dropdown-item-margin-right) var(--plasma-dropdown-item-margin-bottom) var(--plasma-dropdown-item-margin-left);--plasma-dropdown-item-background:var(--plasma-combobox-item-background);--plasma-dropdown-item-color:var(--plasma-combobox-item-color);--plasma-dropdown-item-background-hover:var(--plasma-combobox-item-background-hover);--plasma-dropdown-item-background-selected:var(--plasma-combobox-item-background-selected);--plasma-dropdown-item-color-selected:var(--plasma-combobox-item-color-selected);--plasma-dropdown-item-background-selected-hover:var(--plasma-combobox-item-background-selected-hover);--plasma-dropdown-item-color-selected-hover:var(--plasma-combobox-item-color-selected-hover);--plasma-dropdown-item-content-left-color:var(--plasma-combobox-item-content-left-color);--plasma-dropdown-item-content-right-color:var(--plasma-combobox-item-content-right-color);--plasma-dropdown-disabled-opacity:var(--plasma-combobox-disabled-opacity);--plasma-dropdown-focus-color:var(--plasma-combobox-focus-color);--plasma-dropdown-item-width:var(--plasma-combobox-item-width);--plasma-dropdown-item-height:var(--plasma-combobox-item-height);--plasma-dropdown-item-border-radius:var(--plasma-combobox-item-border-radius);--plasma-dropdown-item-padding-top:var(--plasma-combobox-item-padding-top);--plasma-dropdown-item-padding-right:var(--plasma-combobox-item-padding-right);--plasma-dropdown-item-padding-bottom:var(--plasma-combobox-item-padding-bottom);--plasma-dropdown-item-padding-left:var(--plasma-combobox-item-padding-left);--plasma-dropdown-item-margin-top:var(--plasma-combobox-item-margin-top);--plasma-dropdown-item-margin-right:var(--plasma-combobox-item-margin-right);--plasma-dropdown-item-margin-bottom:var(--plasma-combobox-item-margin-bottom);--plasma-dropdown-item-margin-left:var(--plasma-combobox-item-margin-left);--plasma-dropdown-item-font-family:var(--plasma-combobox-item-font-family);--plasma-dropdown-item-font-size:var(--plasma-combobox-item-font-size);--plasma-dropdown-item-font-style:var(--plasma-combobox-item-font-style);--plasma-dropdown-item-letter-spacing:var(--plasma-combobox-item-letter-spacing);--plasma-dropdown-item-line-height:var(--plasma-combobox-item-line-height);--plasma-dropdown-item-font-weight:var(--plasma-combobox-item-font-weight);--plasma-dropdown-item-content-left-width:var(--plasma-combobox-item-content-left-width);--plasma-dropdown-item-content-right-width:var(--plasma-combobox-item-content-right-width);}.b1thh7ji:focus{outline:none;}.b1thh7ji::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.b1thh7ji.focus-visible:focus::before,.b1thh7ji[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}.b1thh7ji:hover:not(.dropdown-item-is-disabled){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.b1thh7ji.dropdown-item-is-selected{color:var(--plasma-dropdown-item-color-selected);background:var(--plasma-dropdown-item-background-selected);}.b1thh7ji.dropdown-item-is-selected:hover:not(.dropdown-item-is-disabled){background:var(--plasma-dropdown-item-background-selected-hover);}.b1thh7ji.dropdown-item-is-disabled{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}
|
@@ -1,30 +1,7 @@
|
|
1
|
-
.DropdownDivider_styles_v3xor1_s1brpi5d__3a791565{background:var(--plasma-dropdown-divider-color);width:var(--plasma-dropdown-divider-width);height:var(--plasma-dropdown-divider-height);margin:var(--plasma-dropdown-divider-margin-top) var(--plasma-dropdown-divider-margin-right) var(--plasma-dropdown-divider-margin-bottom) var(--plasma-dropdown-divider-margin-left);}
|
2
|
-
|
3
|
-
.DropdownFooter_styles_1j4sg1p_stiw0r3__41ff7287{background:var(--plasma-dropdown-footer-background);font-family:var(--plasma-dropdown-footer-font-family);font-size:var(--plasma-dropdown-footer-font-size);font-style:var(--plasma-dropdown-footer-font-style);font-weight:var(--plasma-dropdown-footer-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-footer-line-height);-moz-letter-spacing:var(--plasma-dropdown-footer-line-height);-ms-letter-spacing:var(--plasma-dropdown-footer-line-height);letter-spacing:var(--plasma-dropdown-footer-line-height);line-height:var(--plasma-dropdown-footer-font-weight);width:var(--plasma-dropdown-footer-width);height:var(--plasma-dropdown-footer-height);padding:var(--plasma-dropdown-footer-padding-top) var(--plasma-dropdown-footer-padding-right) var(--plasma-dropdown-footer-padding-bottom) var(--plasma-dropdown-footer-padding-left);margin:var(--plasma-dropdown-footer-margin-top) var(--plasma-dropdown-footer-margin-right) var(--plasma-dropdown-footer-margin-bottom) var(--plasma-dropdown-footer-margin-left);}
|
4
|
-
|
5
|
-
.DropdownGroup_styles_1o990eo_scop7qk__fca8c58e{background:var(--plasma-dropdown-group-background);width:var(--plasma-dropdown-group-width);height:var(--plasma-dropdown-group-height);padding:var(--plasma-dropdown-group-padding-top) var(--plasma-dropdown-group-padding-right) var(--plasma-dropdown-group-padding-bottom) var(--plasma-dropdown-group-padding-left);margin:var(--plasma-dropdown-group-margin-top) var(--plasma-dropdown-group-margin-right) var(--plasma-dropdown-group-margin-bottom) var(--plasma-dropdown-group-margin-left);}
|
6
|
-
.DropdownGroup_styles_1o990eo_s1oaw95y__fca8c58e{font-family:var(--plasma-dropdown-group-label-font-family);font-size:var(--plasma-dropdown-group-label-font-size);font-style:var(--plasma-dropdown-group-label-font-style);font-weight:var(--plasma-dropdown-group-label-font-weight);-webkit-letter-spacing:var(--plasma-dropdown-group-label-letter-spacing);-moz-letter-spacing:var(--plasma-dropdown-group-label-letter-spacing);-ms-letter-spacing:var(--plasma-dropdown-group-label-letter-spacing);letter-spacing:var(--plasma-dropdown-group-label-letter-spacing);line-height:var(--plasma-dropdown-group-label-line-height);color:var(--plasma-dropdown-group-label-color);padding:var(--plasma-dropdown-group-label-padding-top) var(--plasma-dropdown-group-label-padding-right) var(--plasma-dropdown-group-label-padding-bottom) var(--plasma-dropdown-group-label-padding-left);margin:var(--plasma-dropdown-group-label-margin-top) var(--plasma-dropdown-group-label-margin-right) var(--plasma-dropdown-group-label-margin-bottom) var(--plasma-dropdown-group-label-margin-left);}
|
7
|
-
|
8
|
-
.DropdownHeader_styles_196gwgm_s133b1g2__3510806e{background:var(--plasma-dropdown-header-background);font-family:var(--plasma-dropdown-header-font-family);font-size:var(--plasma-dropdown-header-font-size);font-style:var(--plasma-dropdown-header-font-style);font-weight:var(--plasma-dropdown-header-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-header-line-height);-moz-letter-spacing:var(--plasma-dropdown-header-line-height);-ms-letter-spacing:var(--plasma-dropdown-header-line-height);letter-spacing:var(--plasma-dropdown-header-line-height);line-height:var(--plasma-dropdown-header-font-weight);width:var(--plasma-dropdown-header-width);height:var(--plasma-dropdown-header-height);padding:var(--plasma-dropdown-header-padding-top) var(--plasma-dropdown-header-padding-right) var(--plasma-dropdown-header-padding-bottom) var(--plasma-dropdown-header-padding-left);margin:var(--plasma-dropdown-header-margin-top) var(--plasma-dropdown-header-margin-right) var(--plasma-dropdown-header-margin-bottom) var(--plasma-dropdown-header-margin-left);}
|
9
|
-
|
10
|
-
.IconRoot_7pl7ig_svvlqhf__32c458a1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:var(--svvlqhf-0);height:var(--svvlqhf-0);-webkit-flex:0 0 var(--svvlqhf-0);-ms-flex:0 0 var(--svvlqhf-0);flex:0 0 var(--svvlqhf-0);}
|
11
|
-
|
12
|
-
.DropdownItem_styles_1o4szyu_s1gkzlls__6703745b{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
13
|
-
.DropdownItem_styles_1o4szyu_sz6s14y__6703745b{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
14
|
-
.DropdownItem_styles_1o4szyu_d1m97l2m__6703745b{line-height:0;color:var(--plasma-dropdown-disclosure-icon-color);}
|
15
|
-
.DropdownItem_styles_1o4szyu_soib72h__6703745b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
|
16
|
-
.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;box-sizing:content-box;padding-top:var(--w6l2f0g-0);padding-right:var(--plasma-dropdown-item-padding-right);padding-bottom:var(--w6l2f0g-1);padding-left:var(--plasma-dropdown-item-padding-left);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b:hover:not(.DropdownItem_styles_1o4szyu_dropdownItemIsDisabled__6703745b){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsActive__6703745b{background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsDisabled__6703745b{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b:focus{outline:none;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsFocused__6703745b:before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}
|
17
|
-
|
18
|
-
.DropdownItem_styles_12e50g5_s1iqs5in__94ac8eef{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-left-width);color:var(--plasma-dropdown-item-content-left-color);}
|
19
|
-
.DropdownItem_styles_12e50g5_sfg3dyd__94ac8eef{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-right-width);color:var(--plasma-dropdown-item-content-right-color);}
|
20
|
-
.DropdownItem_styles_12e50g5_s1dea6tl__94ac8eef{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
21
|
-
.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef{box-sizing:content-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:auto;font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);width:var(--plasma-dropdown-item-width);height:var(--plasma-dropdown-item-height);padding:var(--plasma-dropdown-item-padding-top) var(--plasma-dropdown-item-padding-right) var(--plasma-dropdown-item-padding-bottom) var(--plasma-dropdown-item-padding-left);margin:var(--plasma-dropdown-item-margin-top) var(--plasma-dropdown-item-margin-right) var(--plasma-dropdown-item-margin-bottom) var(--plasma-dropdown-item-margin-left);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef:focus{outline:none;}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_focusVisible__94ac8eef:focus::before,.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef:hover:not(.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsSelected__94ac8eef{color:var(--plasma-dropdown-item-color-selected);background:var(--plasma-dropdown-item-background-selected);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsSelected__94ac8eef:hover:not(.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef){background:var(--plasma-dropdown-item-background-selected-hover);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}
|
22
|
-
|
23
1
|
.Popover_styles_rmr9za_s1g1xbt5__0bafa6fb{display:inline-block;}
|
24
2
|
.Popover_styles_rmr9za_s12xwbyh__0bafa6fb{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;position:relative;}
|
25
3
|
.Popover_styles_rmr9za_s1pd4d8a__0bafa6fb{width:var(--plasma-popover-arrow-mask-width);height:var(--plasma-popover-arrow-mask-height);}.Popover_styles_rmr9za_s1pd4d8a__0bafa6fb::before{position:absolute;width:var(--plasma-popover-arrow-mask-width);height:var(--plasma-popover-arrow-mask-height);-webkit-mask-image:var(--plasma-popover-arrow-mask-image);mask-image:var(--plasma-popover-arrow-mask-image);background:var(--plasma-popover-arrow-background);content:'';-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}
|
26
4
|
.Popover_styles_rmr9za_s16xlixz__0bafa6fb{position:absolute;z-index:var(--s16xlixz-0);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='top'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{bottom:calc(0px - var(--plasma-popover-arrow-height));}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{top:calc(0px - var(--plasma-popover-arrow-height));}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb::before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='left'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{right:calc(0px - var(--plasma-popover-arrow-height));}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='left'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb::before{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='right'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{left:calc(0px - var(--plasma-popover-arrow-height));}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='right'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb::before{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='top-start'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{bottom:calc(0px - var(--plasma-popover-arrow-height));left:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='top-end'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{bottom:calc(0px - var(--plasma-popover-arrow-height));left:unset !important;right:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom-start'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{top:calc(0px - var(--plasma-popover-arrow-height));left:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom-start'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb::before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom-end'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{top:calc(0px - var(--plasma-popover-arrow-height));left:unset !important;right:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='bottom-end'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb::before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='left-start'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb,.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='right-start'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{top:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='left-end'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb,.Popover_styles_rmr9za_s16xlixz__0bafa6fb[data-popper-placement^='right-end'] > .Popover_styles_rmr9za_popoverArrow__0bafa6fb{top:unset !important;bottom:var(--plasma-popover-arrow-edge-margin) !important;-webkit-transform:unset !important;-ms-transform:unset !important;transform:unset !important;}
|
27
5
|
|
28
|
-
.
|
29
|
-
.
|
30
|
-
.Dropdown_styles_1tihqkp_byfocd2__39673f55{display:inline-block;}
|
6
|
+
.Dropdown_styles_1daxhqh_sn7uamp__488e0a19 .Dropdown_styles_1daxhqh_popoverTarget__488e0a19{display:block;}
|
7
|
+
.Dropdown_styles_1daxhqh_sjr7fmv__488e0a19{box-sizing:border-box;background:var(--plasma-dropdown-background);box-shadow:var(--plasma-dropdown-box-shadow);border-radius:var(--plasma-dropdown-border-radius);width:var(--plasma-dropdown-width);height:var(--plasma-dropdown-height);padding:var(--plasma-dropdown-padding-top) var(--plasma-dropdown-padding-right) var(--plasma-dropdown-padding-bottom) var(--plasma-dropdown-padding-left);}
|
@@ -1,171 +1,87 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties,
|
2
|
-
import React, { forwardRef,
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import '
|
7
|
-
import '
|
8
|
-
import { classes } from './Dropdown.tokens.js';
|
9
|
-
import { DropdownInner } from './ui/DropdownInner/DropdownInner.js';
|
10
|
-
import { getPlacements, childrenWithProps } from './utils/index.js';
|
11
|
-
import 'focus-visible';
|
12
|
-
import { base as base$1 } from './variations/_view/base.js';
|
13
|
-
import { base as base$2 } from './variations/_size/base.js';
|
14
|
-
import { StyledPopover, Ul, base } from './Dropdown.styles.js';
|
15
|
-
import { useKeyNavigation } from './hooks/useKeyboardNavigation.js';
|
16
|
-
import { useHashMaps } from './hooks/useHashMaps.js';
|
17
|
-
|
18
|
-
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow"];
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { forwardRef, useRef } from 'react';
|
3
|
+
import { useUniqId, useForkRef, useFocusTrap } from '@salutejs/plasma-core';
|
4
|
+
import { base } from './variations/_view/base.js';
|
5
|
+
import { base as base$1 } from './variations/_size/base.js';
|
6
|
+
import { StyledPopover, StyledDropdown } from './Dropdown.styles.js';
|
7
|
+
import { getPlacements } from './utils/index.js';
|
19
8
|
|
9
|
+
var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
|
20
10
|
/**
|
21
|
-
* Выпадающий
|
11
|
+
* Выпадающий список без внешнего контроля видимости.
|
22
12
|
*/
|
23
13
|
var dropdownRoot = function dropdownRoot(Root) {
|
24
|
-
return /*#__PURE__*/forwardRef(function (_ref,
|
25
|
-
var
|
14
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
15
|
+
var id = _ref.id,
|
16
|
+
target = _ref.target,
|
26
17
|
children = _ref.children,
|
27
|
-
|
28
|
-
|
29
|
-
_ref$offset = _ref.offset,
|
30
|
-
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
31
|
-
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
32
|
-
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
33
|
-
onToggle = _ref.onToggle,
|
34
|
-
size = _ref.size,
|
18
|
+
hasArrow = _ref.hasArrow,
|
19
|
+
role = _ref.role,
|
35
20
|
view = _ref.view,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
_ref$
|
43
|
-
|
44
|
-
|
45
|
-
onItemSelect = _ref.onItemSelect,
|
46
|
-
onItemClick = _ref.onItemClick,
|
21
|
+
size = _ref.size,
|
22
|
+
frame = _ref.frame,
|
23
|
+
_onToggle = _ref.onToggle,
|
24
|
+
_ref$isFocusTrapped = _ref.isFocusTrapped,
|
25
|
+
isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
|
26
|
+
_ref$isOpen = _ref.isOpen,
|
27
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
28
|
+
_ref$placement = _ref.placement,
|
29
|
+
placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
|
47
30
|
_ref$trigger = _ref.trigger,
|
48
31
|
trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
|
49
|
-
_ref$
|
50
|
-
|
51
|
-
_ref$
|
52
|
-
|
32
|
+
_ref$offset = _ref.offset,
|
33
|
+
offset = _ref$offset === void 0 ? [0, 6] : _ref$offset,
|
34
|
+
_ref$preventOverflow = _ref.preventOverflow,
|
35
|
+
preventOverflow = _ref$preventOverflow === void 0 ? false : _ref$preventOverflow,
|
36
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
37
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? false : _ref$closeOnOverlayCl,
|
38
|
+
_ref$closeOnEsc = _ref.closeOnEsc,
|
39
|
+
closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
|
53
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
54
|
-
var
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
var
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
pathMap = _useHashMaps2[0],
|
65
|
-
focusedToValueMap = _useHashMaps2[1];
|
66
|
-
var handleGlobalToggle = function handleGlobalToggle(opened, event) {
|
67
|
-
if (opened) {
|
68
|
-
dispatchPath({
|
69
|
-
type: 'opened_first_level'
|
70
|
-
});
|
71
|
-
} else {
|
72
|
-
dispatchFocusedPath({
|
73
|
-
type: 'reset'
|
74
|
-
});
|
75
|
-
dispatchPath({
|
76
|
-
type: 'reset'
|
77
|
-
});
|
78
|
-
}
|
79
|
-
if (onToggle) {
|
80
|
-
onToggle(opened, event);
|
81
|
-
}
|
82
|
-
};
|
83
|
-
var _useKeyNavigation = useKeyNavigation({
|
84
|
-
focusedPath: focusedPath,
|
85
|
-
dispatchFocusedPath: dispatchFocusedPath,
|
86
|
-
path: path,
|
87
|
-
dispatchPath: dispatchPath,
|
88
|
-
pathMap: pathMap,
|
89
|
-
focusedToValueMap: focusedToValueMap,
|
90
|
-
handleGlobalToggle: handleGlobalToggle,
|
91
|
-
closeOnSelect: closeOnSelect,
|
92
|
-
onItemSelect: onItemSelect,
|
93
|
-
onItemClick: onItemClick
|
94
|
-
}),
|
95
|
-
onKeyDown = _useKeyNavigation.onKeyDown;
|
96
|
-
var isCurrentListOpen = Boolean(path[0]);
|
97
|
-
var getActiveDescendant = function getActiveDescendant() {
|
98
|
-
var _focusedToValueMap$ge;
|
99
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
100
|
-
return "".concat(acc, "/").concat(n);
|
101
|
-
}, '').replace(/^(\/)/, '');
|
102
|
-
return focusedToValueMap === null || focusedToValueMap === void 0 || (_focusedToValueMap$ge = focusedToValueMap.get(focusedPathAsString)) === null || _focusedToValueMap$ge === void 0 ? void 0 : _focusedToValueMap$ge.value.toString();
|
103
|
-
};
|
104
|
-
return /*#__PURE__*/React.createElement(Root, _extends({
|
105
|
-
className: cx(className, classes.dropdownRoot),
|
106
|
-
ref: ref,
|
107
|
-
view: view,
|
108
|
-
size: size,
|
109
|
-
items: items
|
110
|
-
}, rest), /*#__PURE__*/React.createElement(StyledPopover, {
|
111
|
-
isOpen: isCurrentListOpen,
|
41
|
+
var uniqId = useUniqId();
|
42
|
+
var innerId = id || uniqId;
|
43
|
+
var rootRef = useRef(null);
|
44
|
+
var dropdownRef = useRef(null);
|
45
|
+
var handleRef = useForkRef(rootRef, outerRootRef);
|
46
|
+
var trapRef = useFocusTrap(isOpen && isFocusTrapped);
|
47
|
+
var dropdownForkRef = useForkRef(dropdownRef, trapRef);
|
48
|
+
return /*#__PURE__*/React.createElement(StyledPopover, {
|
49
|
+
role: role,
|
50
|
+
isOpen: isOpen,
|
112
51
|
usePortal: false,
|
113
|
-
onToggle:
|
52
|
+
onToggle: function onToggle(is, event) {
|
53
|
+
return _onToggle === null || _onToggle === void 0 ? void 0 : _onToggle(is, event);
|
54
|
+
},
|
55
|
+
id: innerId,
|
56
|
+
ref: dropdownForkRef,
|
57
|
+
target: target,
|
114
58
|
offset: offset,
|
59
|
+
preventOverflow: preventOverflow,
|
60
|
+
hasArrow: hasArrow,
|
115
61
|
placement: getPlacements(placement),
|
116
62
|
trigger: trigger,
|
117
63
|
closeOnOverlayClick: closeOnOverlayClick,
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
})
|
127
|
-
}, /*#__PURE__*/React.createElement(Ul, {
|
128
|
-
listHeight: listHeight,
|
129
|
-
listOverflow: listOverflow,
|
130
|
-
role: "listbox",
|
131
|
-
id: "listbox1",
|
132
|
-
listWidth: listWidth
|
133
|
-
}, items.map(function (item, index) {
|
134
|
-
return /*#__PURE__*/React.createElement(DropdownInner, {
|
135
|
-
key: "".concat(index, "/0"),
|
136
|
-
item: item,
|
137
|
-
currentLevel: 0,
|
138
|
-
focusedPath: focusedPath,
|
139
|
-
trigger: trigger,
|
140
|
-
path: path,
|
141
|
-
dispatchPath: dispatchPath,
|
142
|
-
index: index,
|
143
|
-
itemRole: itemRole,
|
144
|
-
listHeight: listHeight,
|
145
|
-
listOverflow: listOverflow,
|
146
|
-
handleGlobalToggle: handleGlobalToggle,
|
147
|
-
closeOnSelect: closeOnSelect,
|
148
|
-
onHover: onHover,
|
149
|
-
onItemSelect: onItemSelect,
|
150
|
-
onItemClick: onItemClick,
|
151
|
-
listWidth: listWidth,
|
152
|
-
variant: variant,
|
153
|
-
hasArrow: hasArrow
|
154
|
-
});
|
155
|
-
}))));
|
64
|
+
closeOnEsc: closeOnEsc,
|
65
|
+
isFocusTrapped: isFocusTrapped,
|
66
|
+
frame: frame
|
67
|
+
}, /*#__PURE__*/React.createElement(Root, _extends({
|
68
|
+
ref: handleRef,
|
69
|
+
view: view,
|
70
|
+
size: size
|
71
|
+
}, rest), /*#__PURE__*/React.createElement(StyledDropdown, null, children)));
|
156
72
|
});
|
157
73
|
};
|
158
74
|
var dropdownConfig = {
|
159
75
|
name: 'Dropdown',
|
160
76
|
tag: 'div',
|
161
77
|
layout: dropdownRoot,
|
162
|
-
base:
|
78
|
+
base: '',
|
163
79
|
variations: {
|
164
80
|
view: {
|
165
|
-
css: base
|
81
|
+
css: base
|
166
82
|
},
|
167
83
|
size: {
|
168
|
-
css: base$
|
84
|
+
css: base$1
|
169
85
|
}
|
170
86
|
},
|
171
87
|
defaults: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { forwardRef, useReducer } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport { pathReducer } from './reducers/pathReducer';\nimport { focusedPathReducer } from './reducers/focusedPathReducer';\nimport { DropdownInner } from './ui';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { Ul, StyledPopover, base } from './Dropdown.styles';\nimport { getPlacements, childrenWithProps } from './utils';\nimport type { DropdownProps, HandleGlobalToggleType } from './Dropdown.types';\nimport { classes } from './Dropdown.tokens';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { useHashMaps } from './hooks/useHashMaps';\n\n/**\n * Выпадающий список.\n */\nexport const dropdownRoot = (Root: RootProps<HTMLDivElement, DropdownProps>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n items,\n children,\n placement = 'bottom',\n offset = [0, 0],\n closeOnOverlayClick = true,\n onToggle,\n size,\n view,\n itemRole = 'option',\n className,\n listWidth,\n listHeight,\n listOverflow,\n closeOnSelect = true,\n onHover,\n onItemSelect,\n onItemClick,\n trigger = 'click',\n variant = 'normal',\n hasArrow = true,\n ...rest\n },\n ref,\n ) => {\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n\n const [pathMap, focusedToValueMap] = useHashMaps(items);\n\n const handleGlobalToggle: HandleGlobalToggleType = (opened, event) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n }\n\n if (onToggle) {\n onToggle(opened, event);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleGlobalToggle,\n closeOnSelect,\n onItemSelect,\n onItemClick,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <Root\n className={cx(className, classes.dropdownRoot)}\n ref={ref}\n view={view}\n size={size}\n items={items}\n {...rest}\n >\n <StyledPopover\n isOpen={isCurrentListOpen}\n usePortal={false}\n onToggle={handleGlobalToggle}\n offset={offset}\n placement={getPlacements(placement)}\n trigger={trigger}\n closeOnOverlayClick={closeOnOverlayClick}\n isFocusTrapped={false}\n target={childrenWithProps(children, {\n role: 'combobox',\n 'aria-controls': 'listbox1',\n 'aria-expanded': isCurrentListOpen,\n 'aria-haspopup': 'listbox',\n 'aria-activedescendant': getActiveDescendant(),\n onKeyDown,\n })}\n >\n <Ul\n listHeight={listHeight}\n listOverflow={listOverflow}\n role=\"listbox\"\n id=\"listbox1\"\n listWidth={listWidth}\n >\n {items.map((item, index) => (\n <DropdownInner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n focusedPath={focusedPath}\n trigger={trigger}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n itemRole={itemRole}\n listHeight={listHeight}\n listOverflow={listOverflow}\n handleGlobalToggle={handleGlobalToggle}\n closeOnSelect={closeOnSelect}\n onHover={onHover}\n onItemSelect={onItemSelect}\n onItemClick={onItemClick}\n listWidth={listWidth}\n variant={variant}\n hasArrow={hasArrow}\n />\n ))}\n </Ul>\n </StyledPopover>\n </Root>\n );\n },\n );\n\nexport const dropdownConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["dropdownRoot","Root","forwardRef","_ref","ref","items","children","_ref$placement","placement","_ref$offset","offset","_ref$closeOnOverlayCl","closeOnOverlayClick","onToggle","size","view","_ref$itemRole","itemRole","className","listWidth","listHeight","listOverflow","_ref$closeOnSelect","closeOnSelect","onHover","onItemSelect","onItemClick","_ref$trigger","trigger","_ref$variant","variant","_ref$hasArrow","hasArrow","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","pathReducer","_useReducer2","_slicedToArray","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useHashMaps","useHashMaps","_useHashMaps2","pathMap","focusedToValueMap","handleGlobalToggle","opened","event","type","_useKeyNavigation","useKeyNavigation","onKeyDown","isCurrentListOpen","Boolean","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","concat","replace","get","value","toString","React","createElement","_extends","cx","classes","StyledPopover","isOpen","usePortal","getPlacements","isFocusTrapped","target","childrenWithProps","role","Ul","id","map","item","index","DropdownInner","key","currentLevel","dropdownConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA;AACA;AACA;IACaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA8C,EAAA;AAAA,EAAA,oBACvEC,UAAU,CACN,UAAAC,IAAA,EAwBIC,GAAG,EACF;AAAA,IAAA,IAvBGC,KAAK,GAAAF,IAAA,CAALE,KAAK;MACLC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;MAAAC,cAAA,GAAAJ,IAAA,CACRK,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,cAAA;MAAAE,WAAA,GAAAN,IAAA,CACpBO,MAAM;MAANA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,CAAC,CAAC,EAAE,CAAC,CAAC,GAAAA,WAAA;MAAAE,qBAAA,GAAAR,IAAA,CACfS,mBAAmB;AAAnBA,MAAAA,mBAAmB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,qBAAA;MAC1BE,QAAQ,GAAAV,IAAA,CAARU,QAAQ;MACRC,IAAI,GAAAX,IAAA,CAAJW,IAAI;MACJC,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MAAAC,aAAA,GAAAb,IAAA,CACJc,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,aAA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AAAA,YAAY,EAAEA,YAAa;AAC3BgC,QAAAA,kBAAkB,EAAEA,kBAAmB;AACvC9B,QAAAA,aAAa,EAAEA,aAAc;AAC7BC,QAAAA,OAAO,EAAEA,OAAQ;AACjBC,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,WAAW,EAAEA,WAAY;AACzBP,QAAAA,SAAS,EAAEA,SAAU;AACrBW,QAAAA,OAAO,EAAEA,OAAQ;AACjBE,QAAAA,QAAQ,EAAEA,QAAAA;AAAS,OACtB,CAAC,CAAA;KACL,CACD,CACO,CACb,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM8D,cAAc,GAAG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEjG,YAAY;AACpBkG,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRpF,IAAAA,IAAI,EAAE;AACFqF,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDvF,IAAAA,IAAI,EAAE;AACFsF,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNxF,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdown, StyledPopover } from './Dropdown.styles';\nimport { getPlacements } from './utils';\nimport type { DropdownProps } from './Dropdown.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const dropdownRoot = (Root: RootProps<HTMLDivElement, DropdownProps>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n id,\n target,\n children,\n hasArrow,\n role,\n view,\n size,\n frame,\n onToggle,\n isFocusTrapped = true,\n isOpen = false,\n placement = 'auto',\n trigger = 'click',\n offset = [0, 6],\n preventOverflow = false,\n closeOnOverlayClick = false,\n closeOnEsc = false,\n ...rest\n },\n outerRootRef,\n ) => {\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(rootRef, outerRootRef);\n\n const trapRef = useFocusTrap(isOpen && isFocusTrapped);\n\n const dropdownForkRef = useForkRef<HTMLDivElement>(dropdownRef, trapRef);\n\n return (\n <StyledPopover\n role={role}\n isOpen={isOpen}\n usePortal={false}\n onToggle={(is, event) => onToggle?.(is, event)}\n id={innerId}\n ref={dropdownForkRef}\n target={target}\n offset={offset}\n preventOverflow={preventOverflow}\n hasArrow={hasArrow}\n placement={getPlacements(placement)}\n trigger={trigger}\n closeOnOverlayClick={closeOnOverlayClick}\n closeOnEsc={closeOnEsc}\n isFocusTrapped={isFocusTrapped}\n frame={frame}\n >\n <Root ref={handleRef} view={view} size={size} {...rest}>\n <StyledDropdown>{children}</StyledDropdown>\n </Root>\n </StyledPopover>\n );\n },\n );\n\nexport const dropdownConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["dropdownRoot","Root","forwardRef","_ref","outerRootRef","id","target","children","hasArrow","role","view","size","frame","onToggle","_ref$isFocusTrapped","isFocusTrapped","_ref$isOpen","isOpen","_ref$placement","placement","_ref$trigger","trigger","_ref$offset","offset","_ref$preventOverflow","preventOverflow","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","rest","_objectWithoutProperties","_excluded","uniqId","useUniqId","innerId","rootRef","useRef","dropdownRef","handleRef","useForkRef","trapRef","useFocusTrap","dropdownForkRef","React","createElement","StyledPopover","usePortal","is","event","ref","getPlacements","_extends","StyledDropdown","dropdownConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;AAWA;AACA;AACA;IACaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA8C,EAAA;AAAA,EAAA,oBACvEC,UAAU,CACN,UAAAC,IAAA,EAqBIC,YAAY,EACX;AAAA,IAAA,IApBGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,IAAI,GAAAN,IAAA,CAAJM,IAAI;MACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,SAAQ,GAAAV,IAAA,CAARU,QAAQ;MAAAC,mBAAA,GAAAX,IAAA,CACRY,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;MAAAE,WAAA,GAAAb,IAAA,CACrBc,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;MAAAE,cAAA,GAAAf,IAAA,CACdgB,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,cAAA;MAAAE,YAAA,GAAAjB,IAAA,CAClBkB,OAAO;AAAPA,MAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,YAAA;MAAAE,WAAA,GAAAnB,IAAA,CACjBoB,MAAM;MAANA,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,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNrD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import './Dropdown.
|
1
|
+
import './Dropdown.styles_1daxhqh.css';
|
2
2
|
import { styled } from '@linaria/react';
|
3
3
|
import '@linaria/core';
|
4
4
|
import { component } from '../../engines/common.js';
|
5
5
|
import { popoverConfig } from '../Popover/Popover.js';
|
6
|
-
import { getCorrectHeight } from './utils/index.js';
|
7
|
-
import { tokens } from './Dropdown.tokens.js';
|
8
6
|
|
7
|
+
// issue #823
|
9
8
|
var Popover = /*#__PURE__*/component(popoverConfig);
|
10
9
|
var _exp = function _exp() {
|
11
10
|
return Popover;
|
@@ -15,42 +14,11 @@ var StyledPopover = /*#__PURE__*/styled(_exp())({
|
|
15
14
|
"class": "sn7uamp",
|
16
15
|
propsAsIs: true
|
17
16
|
});
|
18
|
-
var
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
};
|
23
|
-
};
|
24
|
-
var _exp8 = function _exp8() {
|
25
|
-
return function (_ref2) {
|
26
|
-
var listHeight = _ref2.listHeight;
|
27
|
-
return listHeight ? getCorrectHeight(listHeight) : 'auto';
|
28
|
-
};
|
29
|
-
};
|
30
|
-
var _exp9 = function _exp9() {
|
31
|
-
return function (_ref3) {
|
32
|
-
var listOverflow = _ref3.listOverflow;
|
33
|
-
return listOverflow || 'initial';
|
34
|
-
};
|
35
|
-
};
|
36
|
-
var _exp10 = function _exp10() {
|
37
|
-
return function (_ref4) {
|
38
|
-
var isInnerUl = _ref4.isInnerUl;
|
39
|
-
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 var(").concat(tokens.padding, ")") : 0;
|
40
|
-
};
|
41
|
-
};
|
42
|
-
var Ul = /*#__PURE__*/styled('ul')({
|
43
|
-
name: "Ul",
|
44
|
-
"class": "ujr7fmv",
|
45
|
-
propsAsIs: false,
|
46
|
-
vars: {
|
47
|
-
"ujr7fmv-0": [/*#__PURE__*/_exp7()],
|
48
|
-
"ujr7fmv-1": [/*#__PURE__*/_exp8()],
|
49
|
-
"ujr7fmv-2": [/*#__PURE__*/_exp9()],
|
50
|
-
"ujr7fmv-3": [/*#__PURE__*/_exp10()]
|
51
|
-
}
|
17
|
+
var StyledDropdown = /*#__PURE__*/styled('div')({
|
18
|
+
name: "StyledDropdown",
|
19
|
+
"class": "sjr7fmv",
|
20
|
+
propsAsIs: false
|
52
21
|
});
|
53
|
-
var base = "byfocd2";
|
54
22
|
|
55
|
-
export {
|
23
|
+
export { StyledDropdown, StyledPopover };
|
56
24
|
//# sourceMappingURL=Dropdown.styles.js.map
|