@salutejs/plasma-new-hope 0.77.1-canary.1199.8844794649.0 → 0.77.1-canary.1201.8930079977.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/Combobox.css +17 -7
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +81 -10
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +21 -9
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
- package/cjs/components/Combobox/utils/index.js +23 -0
- package/cjs/components/Combobox/utils/index.js.map +1 -0
- package/cjs/components/Dropdown/Dropdown.css +25 -2
- package/cjs/components/Dropdown/Dropdown.js +138 -54
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +40 -7
- 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 +26 -23
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/hooks/useHashMaps.js +31 -0
- package/cjs/components/Dropdown/hooks/useHashMaps.js.map +1 -0
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +200 -0
- package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js +37 -0
- package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
- package/cjs/components/Dropdown/reducers/pathReducer.js +41 -0
- package/cjs/components/Dropdown/reducers/pathReducer.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +119 -0
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +79 -100
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +90 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +30 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +112 -0
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
- package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
- package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
- package/cjs/components/Dropdown/utils/index.js +16 -0
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +14 -7
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Select/Select.css +14 -7
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/cjs/components/Select/ui/SelectItem/SelectItem.css +16 -7
- 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_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/cjs/index.css +18 -8
- package/cjs/index.js +8 -2
- package/cjs/index.js.map +1 -1
- package/es/components/Combobox/Combobox.css +17 -7
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +82 -11
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +19 -10
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
- package/es/components/Combobox/utils/index.js +19 -0
- package/es/components/Combobox/utils/index.js.map +1 -0
- package/es/components/Dropdown/Dropdown.css +25 -2
- package/es/components/Dropdown/Dropdown.js +144 -60
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +39 -7
- 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 +26 -23
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/hooks/useHashMaps.js +27 -0
- package/es/components/Dropdown/hooks/useHashMaps.js.map +1 -0
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js +196 -0
- package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
- package/es/components/Dropdown/reducers/focusedPathReducer.js +33 -0
- package/es/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
- package/es/components/Dropdown/reducers/pathReducer.js +37 -0
- package/es/components/Dropdown/reducers/pathReducer.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +115 -0
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +80 -100
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +89 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +23 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +107 -0
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
- package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
- package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
- package/es/components/Dropdown/utils/index.js +16 -2
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Pagination/Pagination.css +14 -7
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Select/Select.css +14 -7
- package/es/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
- package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
- package/es/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
- package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
- package/es/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
- package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
- package/es/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
- package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
- package/es/components/Select/ui/SelectItem/SelectItem.css +16 -7
- 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_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
- package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/es/index.css +18 -8
- package/es/index.js +4 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +91 -2
- package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +27 -7
- package/styled-components/cjs/components/Combobox/utils/index.js +23 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +140 -54
- package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +22 -7
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
- package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +29 -0
- package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +199 -0
- package/styled-components/cjs/components/Dropdown/index.js +9 -1
- package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +40 -0
- package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +44 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +114 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +5 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +77 -105
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +83 -18
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +33 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +5 -0
- package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +119 -0
- package/styled-components/cjs/components/Dropdown/ui/index.js +19 -5
- package/styled-components/cjs/components/Dropdown/utils/index.js +15 -1
- package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +1 -9
- 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 +1 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +25 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +90 -3
- package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +23 -6
- package/styled-components/es/components/Combobox/utils/index.js +15 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +142 -55
- package/styled-components/es/components/Dropdown/Dropdown.styles.js +18 -5
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +26 -23
- package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +23 -0
- package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +193 -0
- package/styled-components/es/components/Dropdown/index.js +1 -0
- package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +34 -0
- package/styled-components/es/components/Dropdown/reducers/pathReducer.js +38 -0
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +108 -0
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +1 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +78 -107
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +80 -14
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +25 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +1 -0
- package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +111 -0
- package/styled-components/es/components/Dropdown/ui/index.js +3 -1
- package/styled-components/es/components/Dropdown/utils/index.js +15 -1
- package/styled-components/es/components/Dropdown/variations/_size/tokens.json +1 -9
- 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 +1 -2
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +19 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +15 -13
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +5 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +59 -2
- package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
- package/types/components/Combobox/utils/index.d.ts +4 -0
- package/types/components/Combobox/utils/index.d.ts.map +1 -0
- 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 +8 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.tokens.d.ts +24 -22
- package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +64 -40
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/hooks/useHashMaps.d.ts +6 -0
- package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +1 -0
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +23 -0
- package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/types/components/Dropdown/index.d.ts +3 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +16 -0
- package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +1 -0
- package/types/components/Dropdown/reducers/pathReducer.d.ts +20 -0
- package/types/components/Dropdown/reducers/pathReducer.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +5 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +26 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +2 -56
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +5 -2
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +44 -38
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +7 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +60 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +58 -0
- package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +1 -0
- package/types/components/Dropdown/ui/index.d.ts +3 -1
- package/types/components/Dropdown/ui/index.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +5 -2
- 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/Dropdown.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +13 -0
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
- package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
- package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
- package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
- package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
- package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
- package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +0 -80
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -27
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -13
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -22
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -21
- package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +0 -80
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
- package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -21
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -7
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -16
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -15
- package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
- package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +0 -1
- package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +0 -30
- package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +0 -30
- package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +0 -30
- package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +0 -30
- package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +0 -15
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +0 -1
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +0 -51
- package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +0 -1
- /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
- /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
- /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
- /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
- /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
- /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.d.ts +0 -0
- /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.d.ts +0 -0
- /package/types/examples/plasma_b2c/components/Dropdown/{Normal/Dropdown.config.d.ts → Dropdown.config.d.ts} +0 -0
@@ -1,87 +1,171 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import React, { forwardRef,
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import
|
7
|
-
import
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { forwardRef, useReducer } from 'react';
|
3
|
+
import { cx } from '../../utils/index.js';
|
4
|
+
import { pathReducer } from './reducers/pathReducer.js';
|
5
|
+
import { focusedPathReducer } from './reducers/focusedPathReducer.js';
|
6
|
+
import '@salutejs/plasma-core';
|
7
|
+
import '@linaria/react';
|
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"];
|
8
19
|
|
9
|
-
var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
|
10
20
|
/**
|
11
|
-
* Выпадающий
|
21
|
+
* Выпадающий список.
|
12
22
|
*/
|
13
23
|
var dropdownRoot = function dropdownRoot(Root) {
|
14
|
-
return /*#__PURE__*/forwardRef(function (_ref,
|
15
|
-
var
|
16
|
-
target = _ref.target,
|
24
|
+
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
25
|
+
var items = _ref.items,
|
17
26
|
children = _ref.children,
|
18
|
-
hasArrow = _ref.hasArrow,
|
19
|
-
role = _ref.role,
|
20
|
-
view = _ref.view,
|
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
27
|
_ref$placement = _ref.placement,
|
29
|
-
placement = _ref$placement === void 0 ? '
|
30
|
-
_ref$trigger = _ref.trigger,
|
31
|
-
trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
|
28
|
+
placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
|
32
29
|
_ref$offset = _ref.offset,
|
33
|
-
offset = _ref$offset === void 0 ? [0,
|
34
|
-
_ref$preventOverflow = _ref.preventOverflow,
|
35
|
-
preventOverflow = _ref$preventOverflow === void 0 ? false : _ref$preventOverflow,
|
30
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
36
31
|
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
37
|
-
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ?
|
38
|
-
|
39
|
-
|
32
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
33
|
+
onToggle = _ref.onToggle,
|
34
|
+
size = _ref.size,
|
35
|
+
view = _ref.view,
|
36
|
+
_ref$itemRole = _ref.itemRole,
|
37
|
+
itemRole = _ref$itemRole === void 0 ? 'option' : _ref$itemRole,
|
38
|
+
className = _ref.className,
|
39
|
+
listWidth = _ref.listWidth,
|
40
|
+
listHeight = _ref.listHeight,
|
41
|
+
listOverflow = _ref.listOverflow,
|
42
|
+
_ref$closeOnSelect = _ref.closeOnSelect,
|
43
|
+
closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
|
44
|
+
onHover = _ref.onHover,
|
45
|
+
onItemSelect = _ref.onItemSelect,
|
46
|
+
onItemClick = _ref.onItemClick,
|
47
|
+
_ref$trigger = _ref.trigger,
|
48
|
+
trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
|
49
|
+
_ref$variant = _ref.variant,
|
50
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
|
51
|
+
_ref$hasArrow = _ref.hasArrow,
|
52
|
+
hasArrow = _ref$hasArrow === void 0 ? true : _ref$hasArrow,
|
40
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
41
|
-
var
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
var
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
54
|
+
var _useReducer = useReducer(pathReducer, []),
|
55
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
56
|
+
path = _useReducer2[0],
|
57
|
+
dispatchPath = _useReducer2[1];
|
58
|
+
var _useReducer3 = useReducer(focusedPathReducer, []),
|
59
|
+
_useReducer4 = _slicedToArray(_useReducer3, 2),
|
60
|
+
focusedPath = _useReducer4[0],
|
61
|
+
dispatchFocusedPath = _useReducer4[1];
|
62
|
+
var _useHashMaps = useHashMaps(items),
|
63
|
+
_useHashMaps2 = _slicedToArray(_useHashMaps, 2),
|
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,
|
51
112
|
usePortal: false,
|
52
|
-
onToggle:
|
53
|
-
return _onToggle === null || _onToggle === void 0 ? void 0 : _onToggle(is, event);
|
54
|
-
},
|
55
|
-
id: innerId,
|
56
|
-
ref: dropdownForkRef,
|
57
|
-
target: target,
|
113
|
+
onToggle: handleGlobalToggle,
|
58
114
|
offset: offset,
|
59
|
-
preventOverflow: preventOverflow,
|
60
|
-
hasArrow: hasArrow,
|
61
115
|
placement: getPlacements(placement),
|
62
116
|
trigger: trigger,
|
63
117
|
closeOnOverlayClick: closeOnOverlayClick,
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
118
|
+
isFocusTrapped: false,
|
119
|
+
target: childrenWithProps(children, {
|
120
|
+
role: 'combobox',
|
121
|
+
'aria-controls': 'listbox1',
|
122
|
+
'aria-expanded': isCurrentListOpen,
|
123
|
+
'aria-haspopup': 'listbox',
|
124
|
+
'aria-activedescendant': getActiveDescendant(),
|
125
|
+
onKeyDown: onKeyDown
|
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
|
+
}))));
|
72
156
|
});
|
73
157
|
};
|
74
158
|
var dropdownConfig = {
|
75
159
|
name: 'Dropdown',
|
76
160
|
tag: 'div',
|
77
161
|
layout: dropdownRoot,
|
78
|
-
base:
|
162
|
+
base: base,
|
79
163
|
variations: {
|
80
164
|
view: {
|
81
|
-
css: base
|
165
|
+
css: base$1
|
82
166
|
},
|
83
167
|
size: {
|
84
|
-
css: base$
|
168
|
+
css: base$2
|
85
169
|
}
|
86
170
|
},
|
87
171
|
defaults: {
|
@@ -1 +1 @@
|
|
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,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,CAAC,CAAC,EAAE,CAAC,CAAC,GAAAA,WAAA;MAAAE,oBAAA,GAAArB,IAAA,CACfsB,eAAe;AAAfA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+
{"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,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zBlB,QAAAA,OAAO,EAAEA,OAAQ;AACjBa,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,YAAY,EAAEA,YAAa;AAC3BgD,QAAAA,KAAK,EAAEA,KAAM;AACbzE,QAAAA,QAAQ,EAAEA,QAAS;AACnBG,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,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,10 +1,11 @@
|
|
1
|
-
import './Dropdown.
|
1
|
+
import './Dropdown.styles_1tihqkp.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';
|
6
8
|
|
7
|
-
// issue #823
|
8
9
|
var Popover = /*#__PURE__*/component(popoverConfig);
|
9
10
|
var _exp = function _exp() {
|
10
11
|
return Popover;
|
@@ -14,11 +15,42 @@ var StyledPopover = /*#__PURE__*/styled(_exp())({
|
|
14
15
|
"class": "sn7uamp",
|
15
16
|
propsAsIs: true
|
16
17
|
});
|
17
|
-
var
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
var _exp7 = function _exp7() {
|
19
|
+
return function (_ref) {
|
20
|
+
var listWidth = _ref.listWidth;
|
21
|
+
return listWidth || "var(".concat(tokens.width, ")");
|
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
|
+
}
|
21
52
|
});
|
53
|
+
var base = "byfocd2";
|
22
54
|
|
23
|
-
export {
|
55
|
+
export { StyledPopover, Ul, base };
|
24
56
|
//# sourceMappingURL=Dropdown.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { component } from '../../engines';\nimport { popoverConfig, popoverClasses } from '../Popover';\n\nimport { tokens } from './Dropdown.tokens';\n\
|
1
|
+
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { component } from '../../engines';\nimport { popoverConfig, popoverClasses } from '../Popover';\n\nimport { getCorrectHeight } from './utils';\nimport { DropdownProps } from './Dropdown.types';\nimport { tokens } from './Dropdown.tokens';\n\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)`\n .${String(popoverClasses.wrapper)}, .${String(popoverClasses.target)} {\n display: block;\n }\n`;\n\nexport const Ul = styled.ul<{\n listHeight: DropdownProps['listHeight'];\n listOverflow: DropdownProps['listOverflow'];\n isInnerUl?: boolean;\n listWidth?: DropdownProps['listWidth'];\n}>`\n box-sizing: border-box;\n\n background: var(${tokens.background});\n box-shadow: var(${tokens.boxShadow});\n\n border-radius: var(${tokens.borderRadius});\n width: ${({ listWidth }) => listWidth || `var(${tokens.width})`};\n height: ${({ listHeight }) => (listHeight ? getCorrectHeight(listHeight) : 'auto')};\n overflow: ${({ listOverflow }) => listOverflow || 'initial'};\n\n margin: ${({ isInnerUl }) => (isInnerUl ? `calc(var(${tokens.padding}) * -1) 0 0 var(${tokens.padding})` : 0)};\n padding: var(${tokens.padding});\n`;\n\nexport const base = css`\n display: inline-block;\n`;\n"],"names":["Popover","component","popoverConfig","_exp","StyledPopover","styled","name","class","propsAsIs","_exp7","_ref","listWidth","concat","tokens","width","_exp8","_ref2","listHeight","getCorrectHeight","_exp9","_ref3","listOverflow","_exp10","_ref4","isInnerUl","padding","Ul","vars","base"],"mappings":";;;;;;;AAUA,IAAMA,OAAO,gBAAGC,SAAS,CAACC,aAAa,CAAC,CAAA;AAAC,IAAAC,IAAA,GATvBA,SASuBA,IAAAA,GAAA;AAAA,EAAA,OAELH,OAAO,CAAA;AAAA,CAAA,CAAA;AAApC,IAAMI,aAAa,gBAAGC,MAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAIlC,EAAA;AAAC,IAAAC,KAAA,GAfgBA,SAehBA,KAAAA,GAAA;AAAA,EAAA,OAcW,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,SAAAA,GAAAA,IAAAA,CAAAA,SAAAA,CAAAA;AAAAA,IAAAA,OAAgBA,SAAS,IAAAC,MAAAA,CAAAA,MAAA,CAAWC,MAAM,CAACC,KAAM,EAAE,GAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GA7BjDA,SA6BiDA,KAAAA,GAAA;AAAA,EAAA,OACrD,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,UAAAA,GAAAA,KAAAA,CAAAA,UAAAA,CAAAA;AAAAA,IAAAA,OAAkBA,UAAU,GAAGC,gBAAgB,CAACD,UAAU,CAAC,GAAG,MAAO,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAE,KAAA,GA9BpEA,SA8BoEA,KAAAA,GAAA;AAAA,EAAA,OACtE,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,YAAAA,GAAAA,KAAAA,CAAAA,YAAAA,CAAAA;IAAAA,OAAmBA,YAAY,IAAI,SAAS,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,MAAA,GA/B7CA,SA+B6CA,MAAAA,GAAA;AAAA,EAAA,OAEjD,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,SAAAA,GAAAA,KAAAA,CAAAA,SAAAA,CAAAA;AAAAA,IAAAA,OAAiBA,SAAS,GAAA,WAAA,CAAAZ,MAAA,CAAeC,MAAM,CAACY,OAAQ,EAAAb,kBAAAA,CAAAA,CAAAA,MAAA,CAAkBC,MAAM,CAACY,OAAQ,SAAK,CAAE,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAhB1G,IAAMC,EAAE,gBAAGrB,MAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,IAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAmB,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAYXlB,KAAsD,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cACrDM,KAAwE,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cACtEI,KAA+C,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cAEjDG,MAAmG,EAAA,CAAA;AAAA,GAAA;AAAA,CAEhH,EAAA;AAEM,IAAMM,IAAI,GAEhB;;;;"}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
.sn7uamp .popover-wrapper,.sn7uamp .popover-target{display:block;}
|
2
|
+
.ujr7fmv{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(--ujr7fmv-0);height:var(--ujr7fmv-1);overflow:var(--ujr7fmv-2);margin:var(--ujr7fmv-3);padding:var(--plasma-dropdown-padding);}
|
3
|
+
.byfocd2{display:inline-block;}
|
@@ -1,45 +1,36 @@
|
|
1
1
|
var classes = {
|
2
|
-
|
3
|
-
|
2
|
+
dropdownRoot: 'dropdown-root',
|
3
|
+
dropdownItemIsFocused: 'dropdown-item-is-focused',
|
4
|
+
dropdownItemIsDisabled: 'dropdown-item-is-disabled',
|
5
|
+
dropdownItemIsActive: 'dropdown-item-is-active',
|
6
|
+
dropdownItemIsSelected: 'dropdownItemIsSelected'
|
4
7
|
};
|
5
8
|
var tokens = {
|
6
9
|
background: '--plasma-dropdown-background',
|
7
10
|
boxShadow: '--plasma-dropdown-box-shadow',
|
8
11
|
width: '--plasma-dropdown-width',
|
9
|
-
height: '--plasma-dropdown-height',
|
10
12
|
borderRadius: '--plasma-dropdown-border-radius',
|
11
|
-
|
12
|
-
|
13
|
-
paddingBottom: '--plasma-dropdown-padding-bottom',
|
14
|
-
paddingLeft: '--plasma-dropdown-padding-left',
|
13
|
+
padding: '--plasma-dropdown-padding',
|
14
|
+
disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',
|
15
15
|
itemBackground: '--plasma-dropdown-item-background',
|
16
16
|
itemColor: '--plasma-dropdown-item-color',
|
17
17
|
itemBackgroundHover: '--plasma-dropdown-item-background-hover',
|
18
|
-
itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
|
19
|
-
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
20
|
-
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
21
|
-
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
22
|
-
itemWidth: '--plasma-dropdown-item-width',
|
23
|
-
itemHeight: '--plasma-dropdown-item-height',
|
24
18
|
itemBorderRadius: '--plasma-dropdown-item-border-radius',
|
25
19
|
itemPaddingTop: '--plasma-dropdown-item-padding-top',
|
20
|
+
itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',
|
26
21
|
itemPaddingRight: '--plasma-dropdown-item-padding-right',
|
27
22
|
itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
|
23
|
+
itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',
|
28
24
|
itemPaddingLeft: '--plasma-dropdown-item-padding-left',
|
29
|
-
itemMarginTop: '--plasma-dropdown-item-margin-top',
|
30
|
-
itemMarginRight: '--plasma-dropdown-item-margin-right',
|
31
|
-
itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
|
32
|
-
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
33
25
|
itemFontFamily: '--plasma-dropdown-item-font-family',
|
34
26
|
itemFontSize: '--plasma-dropdown-item-font-size',
|
35
27
|
itemFontStyle: '--plasma-dropdown-item-font-style',
|
36
28
|
itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
|
37
29
|
itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
|
38
30
|
itemFontLineHeight: '--plasma-dropdown-item-font-weight',
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
itemContentRightWidth: '--plasma-dropdown-item-content-right-width',
|
31
|
+
disabledOpacity: '--plasma-dropdown-disabled-opacity',
|
32
|
+
focusColor: '--plasma-dropdown-focus-color',
|
33
|
+
// TODO: Remove below tokens as soon as they are no longer needed
|
43
34
|
footerBackground: '--plasma-dropdown-footer-background',
|
44
35
|
footerWidth: '--plasma-dropdown-footer-width',
|
45
36
|
footerHeight: '--plasma-dropdown-footer-height',
|
@@ -107,8 +98,20 @@ var tokens = {
|
|
107
98
|
groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
|
108
99
|
groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
|
109
100
|
groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',
|
110
|
-
|
111
|
-
|
101
|
+
itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
|
102
|
+
itemColorSelected: '--plasma-dropdown-item-color-selected',
|
103
|
+
itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
|
104
|
+
itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
|
105
|
+
itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
|
106
|
+
itemContentRightColor: '--plasma-dropdown-item-content-right-color',
|
107
|
+
itemWidth: '--plasma-dropdown-item-width',
|
108
|
+
itemHeight: '--plasma-dropdown-item-height',
|
109
|
+
itemMarginTop: '--plasma-dropdown-item-margin-top',
|
110
|
+
itemMarginRight: '--plasma-dropdown-item-margin-right',
|
111
|
+
itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
|
112
|
+
itemMarginLeft: '--plasma-dropdown-item-margin-left',
|
113
|
+
itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
|
114
|
+
itemContentRightWidth: '--plasma-dropdown-item-content-right-width'
|
112
115
|
};
|
113
116
|
|
114
117
|
export { classes, tokens };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownItemIsSelected: 'dropdown-item-is-selected',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n height: '--plasma-dropdown-height',\n borderRadius: '--plasma-dropdown-border-radius',\n paddingTop: '--plasma-dropdown-padding-top',\n paddingRight: '--plasma-dropdown-padding-right',\n paddingBottom: '--plasma-dropdown-padding-bottom',\n paddingLeft: '--plasma-dropdown-padding-left',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemColor: '--plasma-dropdown-item-color',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected',\n itemColorSelected: '--plasma-dropdown-item-color-selected',\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',\n itemWidth: '--plasma-dropdown-item-width',\n itemHeight: '--plasma-dropdown-item-height',\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemPaddingTop: '--plasma-dropdown-item-padding-top',\n itemPaddingRight: '--plasma-dropdown-item-padding-right',\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',\n itemPaddingLeft: '--plasma-dropdown-item-padding-left',\n itemMarginTop: '--plasma-dropdown-item-margin-top',\n itemMarginRight: '--plasma-dropdown-item-margin-right',\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom',\n itemMarginLeft: '--plasma-dropdown-item-margin-left',\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color',\n itemContentRightColor: '--plasma-dropdown-item-content-right-color',\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width',\n\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color',\n};\n"],"names":["classes","dropdownItemIsSelected","dropdownItemIsDisabled","tokens","background","boxShadow","width","height","borderRadius","paddingTop","paddingRight","paddingBottom","paddingLeft","itemBackground","itemColor","itemBackgroundHover","itemBackgroundSelected","itemColorSelected","itemBackgroundSelectedHover","itemColorSelectedHover","itemWidth","itemHeight","itemBorderRadius","itemPaddingTop","itemPaddingRight","itemPaddingBottom","itemPaddingLeft","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","itemContentLeftColor","itemContentRightColor","itemContentLeftWidth","itemContentRightWidth","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerColor","dividerWidth","dividerHeight","dividerMarginTop","dividerMarginRight","dividerMarginBottom","dividerMarginLeft","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupLabelMarginTop","groupLabelMarginRight","groupLabelMarginBottom","groupLabelMarginLeft","disabledOpacity","focusColor"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,sBAAsB,EAAE,2BAA2B;AACnDC,EAAAA,sBAAsB,EAAE,2BAAA;AAC5B,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,KAAK,EAAE,yBAAyB;AAChCC,EAAAA,MAAM,EAAE,0BAA0B;AAClCC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,UAAU,EAAE,+BAA+B;AAC3CC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,aAAa,EAAE,kCAAkC;AACjDC,EAAAA,WAAW,EAAE,gCAAgC;AAE7CC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,mBAAmB,EAAE,yCAAyC;AAC9DC,EAAAA,sBAAsB,EAAE,4CAA4C;AACpEC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,2BAA2B,EAAE,kDAAkD;AAC/EC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,SAAS,EAAE,8BAA8B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AAE,wCAAwC;AAC5DC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,cAAc,EAAE,oCAAoC;AACpDC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,iBAAiB,EAAE,uCAAuC;AAC1DC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,kBAAkB,EAAE,yCAAyC;AAC7DC,EAAAA,mBAAmB,EAAE,0CAA0C;AAC/DC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,uBAAuB,EAAE,8CAA8C;AACvEC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,mBAAmB,EAAE,0CAA0C;AAC/DC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,oBAAoB,EAAE,2CAA2C;AAEjEC,EAAAA,eAAe,EAAE,oCAAoC;AACrDC,EAAAA,UAAU,EAAE,+BAAA;AAChB;;;;"}
|
1
|
+
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownRoot: 'dropdown-root',\n dropdownItemIsFocused: 'dropdown-item-is-focused',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n dropdownItemIsActive: 'dropdown-item-is-active',\n dropdownItemIsSelected: 'dropdownItemIsSelected',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n borderRadius: '--plasma-dropdown-border-radius',\n padding: '--plasma-dropdown-padding',\n disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemColor: '--plasma-dropdown-item-color',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemPaddingTop: '--plasma-dropdown-item-padding-top',\n itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',\n itemPaddingRight: '--plasma-dropdown-item-padding-right',\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',\n itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',\n itemPaddingLeft: '--plasma-dropdown-item-padding-left',\n\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color',\n\n // TODO: Remove below tokens as soon as they are no longer needed\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected',\n itemColorSelected: '--plasma-dropdown-item-color-selected',\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color',\n itemContentRightColor: '--plasma-dropdown-item-content-right-color',\n itemWidth: '--plasma-dropdown-item-width',\n itemHeight: '--plasma-dropdown-item-height',\n itemMarginTop: '--plasma-dropdown-item-margin-top',\n itemMarginRight: '--plasma-dropdown-item-margin-right',\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom',\n itemMarginLeft: '--plasma-dropdown-item-margin-left',\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width',\n};\n"],"names":["classes","dropdownRoot","dropdownItemIsFocused","dropdownItemIsDisabled","dropdownItemIsActive","dropdownItemIsSelected","tokens","background","boxShadow","width","borderRadius","padding","disclosureIconColor","itemBackground","itemColor","itemBackgroundHover","itemBorderRadius","itemPaddingTop","itemPaddingTopTight","itemPaddingRight","itemPaddingBottom","itemPaddingBottomTight","itemPaddingLeft","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","disabledOpacity","focusColor","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerColor","dividerWidth","dividerHeight","dividerMarginTop","dividerMarginRight","dividerMarginBottom","dividerMarginLeft","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupLabelMarginTop","groupLabelMarginRight","groupLabelMarginBottom","groupLabelMarginLeft","itemBackgroundSelected","itemColorSelected","itemBackgroundSelectedHover","itemColorSelectedHover","itemContentLeftColor","itemContentRightColor","itemWidth","itemHeight","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemContentLeftWidth","itemContentRightWidth"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,YAAY,EAAE,eAAe;AAC7BC,EAAAA,qBAAqB,EAAE,0BAA0B;AACjDC,EAAAA,sBAAsB,EAAE,2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AAqB,EAAE,4CAA4C;AACnEC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,UAAU,EAAE,+BAA+B;AAC3CC,EAAAA,aAAa,EAAE,mCAAmC;AAClDC,EAAAA,eAAe,EAAE,qCAAqC;AACtDC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,cAAc,EAAE,oCAAoC;AACpDC,EAAAA,oBAAoB,EAAE,2CAA2C;AACjEC,EAAAA,qBAAqB,EAAE,4CAAA;AAC3B;;;;"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { useMemo } from 'react';
|
2
|
+
|
3
|
+
var useHashMaps = function useHashMaps(items) {
|
4
|
+
return useMemo(function () {
|
5
|
+
var pathMap = new Map();
|
6
|
+
var focusedToValueMap = new Map();
|
7
|
+
pathMap.set('root', items.length);
|
8
|
+
var rec = function rec(items) {
|
9
|
+
var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
10
|
+
items.forEach(function (item, index) {
|
11
|
+
var value = item.value,
|
12
|
+
innerItems = item.items;
|
13
|
+
var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
|
14
|
+
focusedToValueMap.set(currIndex, item);
|
15
|
+
if (innerItems) {
|
16
|
+
pathMap.set(value, innerItems.length);
|
17
|
+
rec(innerItems, currIndex);
|
18
|
+
}
|
19
|
+
});
|
20
|
+
};
|
21
|
+
rec(items);
|
22
|
+
return [pathMap, focusedToValueMap];
|
23
|
+
}, [items]);
|
24
|
+
};
|
25
|
+
|
26
|
+
export { useHashMaps };
|
27
|
+
//# sourceMappingURL=useHashMaps.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useHashMaps.js","sources":["../../../../src/components/Dropdown/hooks/useHashMaps.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { DropdownProps } from '../Dropdown.types';\nimport { DropdownItemOption } from '../ui/DropdownItem/DropdownItem.type';\n\nexport type PathMapType = Map<string | number, number>;\nexport type FocusedToValueMapType = Map<string, DropdownItemOption>;\n\nexport const useHashMaps = (items: DropdownProps['items']) => {\n return useMemo(() => {\n const pathMap: PathMapType = new Map();\n const focusedToValueMap: FocusedToValueMapType = new Map();\n\n pathMap.set('root', items.length);\n\n const rec = (items: DropdownProps['items'], prevIndex = '') => {\n items.forEach((item: DropdownItemOption, index: number) => {\n const { value, items: innerItems } = item;\n\n const currIndex = `${prevIndex}/${index}`.replace(/^(\\/)/, '');\n focusedToValueMap.set(currIndex, item);\n\n if (innerItems) {\n pathMap.set(value, innerItems.length);\n rec(innerItems, currIndex);\n }\n });\n };\n rec(items);\n\n return [pathMap, focusedToValueMap] as [PathMapType, FocusedToValueMapType];\n }, [items]);\n};\n"],"names":["useHashMaps","items","useMemo","pathMap","Map","focusedToValueMap","set","length","rec","prevIndex","arguments","undefined","forEach","item","index","value","innerItems","currIndex","concat","replace"],"mappings":";;IAQaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAA6B,EAAK;EAC1D,OAAOC,OAAO,CAAC,YAAM;AACjB,IAAA,IAAMC,OAAoB,GAAG,IAAIC,GAAG,EAAE,CAAA;AACtC,IAAA,IAAMC,iBAAwC,GAAG,IAAID,GAAG,EAAE,CAAA;IAE1DD,OAAO,CAACG,GAAG,CAAC,MAAM,EAAEL,KAAK,CAACM,MAAM,CAAC,CAAA;AAEjC,IAAA,IAAMC,GAAG,GAAG,SAANA,GAAGA,CAAIP,KAA6B,EAAqB;AAAA,MAAA,IAAnBQ,SAAS,GAAAC,SAAA,CAAAH,MAAA,GAAA,CAAA,IAAAG,SAAA,CAAA,CAAA,CAAA,KAAAC,SAAA,GAAAD,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;AACtDT,MAAAA,KAAK,CAACW,OAAO,CAAC,UAACC,IAAwB,EAAEC,KAAa,EAAK;AACvD,QAAA,IAAQC,KAAK,GAAwBF,IAAI,CAAjCE,KAAK;UAASC,UAAU,GAAKH,IAAI,CAA1BZ,KAAK,C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