@salutejs/plasma-new-hope 0.78.0-canary.1185.8915022482.0 → 0.78.0-canary.1195.8913931601.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/IconButton/IconButton.css +25 -0
- package/cjs/components/IconButton/IconButton.js +84 -0
- package/cjs/components/IconButton/IconButton.js.map +1 -0
- package/cjs/components/IconButton/IconButton.styles.js +25 -0
- package/cjs/components/IconButton/IconButton.styles.js.map +1 -0
- package/cjs/components/IconButton/IconButton.styles_12iyaye.css +2 -0
- package/cjs/components/IconButton/IconButton.tokens.js +36 -0
- package/cjs/components/IconButton/IconButton.tokens.js.map +1 -0
- package/cjs/components/IconButton/variations/_disabled/base.js +9 -0
- package/cjs/components/IconButton/variations/_disabled/base.js.map +1 -0
- package/cjs/components/IconButton/variations/_focused/base.js +9 -0
- package/cjs/components/IconButton/variations/_focused/base.js.map +1 -0
- package/cjs/components/IconButton/variations/_size/base.js +9 -0
- package/cjs/components/IconButton/variations/_size/base.js.map +1 -0
- package/cjs/components/IconButton/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/IconButton/variations/_view/base.js +9 -0
- package/cjs/components/IconButton/variations/_view/base.js.map +1 -0
- package/cjs/components/IconButton/variations/_view/base_x642ct.css +1 -0
- 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 +11 -18
- package/cjs/index.js +8 -8
- 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/DropdownItem/variations/_size/base_x642ct.css +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/ui/DropdownItem/variations/_view/base_x642ct.css +1 -0
- package/es/components/Dropdown/utils/index.js +2 -16
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/IconButton/IconButton.css +25 -0
- package/es/components/IconButton/IconButton.js +79 -0
- package/es/components/IconButton/IconButton.js.map +1 -0
- package/es/components/IconButton/IconButton.styles.js +20 -0
- package/es/components/IconButton/IconButton.styles.js.map +1 -0
- package/es/components/IconButton/IconButton.styles_12iyaye.css +2 -0
- package/es/components/IconButton/IconButton.tokens.js +31 -0
- package/es/components/IconButton/IconButton.tokens.js.map +1 -0
- package/es/components/IconButton/variations/_disabled/base.js +5 -0
- package/es/components/IconButton/variations/_disabled/base.js.map +1 -0
- package/es/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
- package/es/components/IconButton/variations/_focused/base.js +5 -0
- package/es/components/IconButton/variations/_focused/base.js.map +1 -0
- package/es/components/IconButton/variations/_focused/base_x642ct.css +1 -0
- package/es/components/IconButton/variations/_size/base.js +5 -0
- package/es/components/IconButton/variations/_size/base.js.map +1 -0
- package/es/components/IconButton/variations/_size/base_x642ct.css +1 -0
- package/es/components/IconButton/variations/_view/base.js +5 -0
- package/es/components/IconButton/variations/_view/base.js.map +1 -0
- package/es/components/IconButton/variations/_view/base_x642ct.css +1 -0
- 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 +11 -18
- package/es/index.js +3 -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/IconButton/IconButton.js +86 -0
- package/styled-components/cjs/components/IconButton/IconButton.styles.js +19 -0
- package/styled-components/cjs/components/IconButton/IconButton.tokens.js +34 -0
- package/styled-components/cjs/components/IconButton/index.js +31 -0
- package/styled-components/cjs/components/IconButton/variations/_disabled/base.js +8 -0
- package/styled-components/cjs/components/IconButton/variations/_disabled/tokens.json +1 -0
- package/styled-components/cjs/components/IconButton/variations/_focused/base.js +8 -0
- package/styled-components/cjs/components/IconButton/variations/_focused/tokens.json +1 -0
- package/styled-components/cjs/components/IconButton/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/IconButton/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/IconButton/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/IconButton/variations/_view/tokens.json +1 -0
- 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_b2c/components/IconButton/IconButton.config.js +46 -0
- package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -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/plasma_web/components/IconButton/IconButton.config.js +46 -0
- package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -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/cjs/index.js +11 -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/IconButton/IconButton.js +77 -0
- package/styled-components/es/components/IconButton/IconButton.styles.js +11 -0
- package/styled-components/es/components/IconButton/IconButton.tokens.js +28 -0
- package/styled-components/es/components/IconButton/index.js +2 -0
- package/styled-components/es/components/IconButton/variations/_disabled/base.js +2 -0
- package/styled-components/es/components/IconButton/variations/_disabled/tokens.json +1 -0
- package/styled-components/es/components/IconButton/variations/_focused/base.js +2 -0
- package/styled-components/es/components/IconButton/variations/_focused/tokens.json +1 -0
- package/styled-components/es/components/IconButton/variations/_size/base.js +2 -0
- package/styled-components/es/components/IconButton/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/IconButton/variations/_view/base.js +2 -0
- package/styled-components/es/components/IconButton/variations/_view/tokens.json +1 -0
- 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_b2c/components/IconButton/IconButton.config.js +40 -0
- package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -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/plasma_web/components/IconButton/IconButton.config.js +40 -0
- package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.js +5 -0
- package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -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/styled-components/es/index.js +1 -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/IconButton/IconButton.d.ts +30 -0
- package/types/components/IconButton/IconButton.d.ts.map +1 -0
- package/types/components/IconButton/IconButton.styles.d.ts +4 -0
- package/types/components/IconButton/IconButton.styles.d.ts.map +1 -0
- package/types/components/IconButton/IconButton.tokens.d.ts +29 -0
- package/types/components/IconButton/IconButton.tokens.d.ts.map +1 -0
- package/types/components/IconButton/IconButton.types.d.ts +13 -0
- package/types/components/IconButton/IconButton.types.d.ts.map +1 -0
- package/types/components/IconButton/index.d.ts +4 -0
- package/types/components/IconButton/index.d.ts.map +1 -0
- package/types/components/IconButton/variations/_disabled/base.d.ts +2 -0
- package/types/components/IconButton/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/IconButton/variations/_focused/base.d.ts +2 -0
- package/types/components/IconButton/variations/_focused/base.d.ts.map +1 -0
- package/types/components/IconButton/variations/_size/base.d.ts +2 -0
- package/types/components/IconButton/variations/_size/base.d.ts.map +1 -0
- package/types/components/IconButton/variations/_view/base.d.ts +2 -0
- package/types/components/IconButton/variations/_view/base.d.ts.map +1 -0
- 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_b2c/components/IconButton/IconButton.config.d.ts +39 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +33 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.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/plasma_web/components/IconButton/IconButton.config.d.ts +39 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +33 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.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/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- 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/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 -294
- 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/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 -294
- 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/variations/_size → cjs/components/IconButton/variations/_disabled}/base_x642ct.css +0 -0
- /package/{es/components/Dropdown/ui/DropdownItemOld/variations/_view → cjs/components/IconButton/variations/_focused}/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/cjs/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.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/styled-components/es/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.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,294 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import type { ComponentProps } from 'react';
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
4
|
-
import { action } from '@storybook/addon-actions';
|
5
|
-
|
6
|
-
import { WithTheme } from '../../../_helpers';
|
7
|
-
import { Button } from '../Button/Button';
|
8
|
-
import type { DropdownPlacement, DropdownTrigger } from '../../../../components/Dropdown/Dropdown.types';
|
9
|
-
|
10
|
-
import { Dropdown } from './Dropdown';
|
11
|
-
|
12
|
-
type StoryDropdownProps = ComponentProps<typeof Dropdown>;
|
13
|
-
|
14
|
-
const placements: Array<DropdownPlacement> = ['top', 'bottom', 'right', 'left', 'auto'];
|
15
|
-
const triggers: Array<DropdownTrigger> = ['click', 'hover'];
|
16
|
-
const size = ['xs', 's', 'm', 'l'];
|
17
|
-
const variant = ['normal', 'tight'];
|
18
|
-
|
19
|
-
const meta: Meta<StoryDropdownProps> = {
|
20
|
-
title: 'plasma_b2c/Dropdown',
|
21
|
-
decorators: [WithTheme],
|
22
|
-
component: Dropdown,
|
23
|
-
argTypes: {
|
24
|
-
placement: {
|
25
|
-
options: placements,
|
26
|
-
control: {
|
27
|
-
type: 'select',
|
28
|
-
},
|
29
|
-
},
|
30
|
-
trigger: {
|
31
|
-
options: triggers,
|
32
|
-
control: {
|
33
|
-
type: 'select',
|
34
|
-
},
|
35
|
-
},
|
36
|
-
size: {
|
37
|
-
options: size,
|
38
|
-
control: {
|
39
|
-
type: 'select',
|
40
|
-
},
|
41
|
-
},
|
42
|
-
variant: {
|
43
|
-
options: variant,
|
44
|
-
control: {
|
45
|
-
type: 'select',
|
46
|
-
},
|
47
|
-
},
|
48
|
-
},
|
49
|
-
args: {
|
50
|
-
trigger: 'click',
|
51
|
-
offset: [0, 0],
|
52
|
-
listWidth: 'auto',
|
53
|
-
hasArrow: true,
|
54
|
-
closeOnOverlayClick: true,
|
55
|
-
closeOnSelect: true,
|
56
|
-
size: 'm',
|
57
|
-
variant: 'normal',
|
58
|
-
},
|
59
|
-
};
|
60
|
-
|
61
|
-
export default meta;
|
62
|
-
|
63
|
-
const items = [
|
64
|
-
{
|
65
|
-
value: 'north_america',
|
66
|
-
label: 'Северная Америка',
|
67
|
-
},
|
68
|
-
{
|
69
|
-
value: 'south_america',
|
70
|
-
label: 'Южная Америка',
|
71
|
-
items: [
|
72
|
-
{
|
73
|
-
value: 'brazil',
|
74
|
-
label: 'Бразилия',
|
75
|
-
items: [
|
76
|
-
{
|
77
|
-
value: 'rio_de_janeiro',
|
78
|
-
label: 'Рио-де-Жанейро',
|
79
|
-
},
|
80
|
-
{
|
81
|
-
value: 'sao_paulo',
|
82
|
-
label: 'Сан-Паулу',
|
83
|
-
},
|
84
|
-
],
|
85
|
-
},
|
86
|
-
{
|
87
|
-
value: 'argentina',
|
88
|
-
label: 'Аргентина',
|
89
|
-
items: [
|
90
|
-
{
|
91
|
-
value: 'buenos_aires',
|
92
|
-
label: 'Буэнос-Айрес',
|
93
|
-
},
|
94
|
-
{
|
95
|
-
value: 'cordoba',
|
96
|
-
label: 'Кордова',
|
97
|
-
},
|
98
|
-
],
|
99
|
-
},
|
100
|
-
{
|
101
|
-
value: 'colombia',
|
102
|
-
label: 'Колумбия',
|
103
|
-
items: [
|
104
|
-
{
|
105
|
-
value: 'bogota',
|
106
|
-
label: 'Богота',
|
107
|
-
},
|
108
|
-
{
|
109
|
-
value: 'medellin',
|
110
|
-
label: 'Медельин',
|
111
|
-
},
|
112
|
-
],
|
113
|
-
},
|
114
|
-
],
|
115
|
-
},
|
116
|
-
{
|
117
|
-
value: 'europe',
|
118
|
-
label: 'Европа',
|
119
|
-
items: [
|
120
|
-
{
|
121
|
-
value: 'france',
|
122
|
-
label: 'Франция',
|
123
|
-
items: [
|
124
|
-
{
|
125
|
-
value: 'paris',
|
126
|
-
label: 'Париж',
|
127
|
-
},
|
128
|
-
{
|
129
|
-
value: 'lyon',
|
130
|
-
label: 'Лион',
|
131
|
-
},
|
132
|
-
],
|
133
|
-
},
|
134
|
-
{
|
135
|
-
value: 'germany',
|
136
|
-
label: 'Германия',
|
137
|
-
items: [
|
138
|
-
{
|
139
|
-
value: 'berlin',
|
140
|
-
label: 'Берлин',
|
141
|
-
},
|
142
|
-
{
|
143
|
-
value: 'munich',
|
144
|
-
label: 'Мюнхен',
|
145
|
-
},
|
146
|
-
],
|
147
|
-
},
|
148
|
-
{
|
149
|
-
value: 'italy',
|
150
|
-
label: 'Италия',
|
151
|
-
items: [
|
152
|
-
{
|
153
|
-
value: 'rome',
|
154
|
-
label: 'Рим',
|
155
|
-
},
|
156
|
-
{
|
157
|
-
value: 'milan',
|
158
|
-
label: 'Милан',
|
159
|
-
},
|
160
|
-
],
|
161
|
-
},
|
162
|
-
{
|
163
|
-
value: 'spain',
|
164
|
-
label: 'Испания',
|
165
|
-
items: [
|
166
|
-
{
|
167
|
-
value: 'madrid',
|
168
|
-
label: 'Мадрид',
|
169
|
-
},
|
170
|
-
{
|
171
|
-
value: 'barcelona',
|
172
|
-
label: 'Барселона',
|
173
|
-
},
|
174
|
-
],
|
175
|
-
},
|
176
|
-
{
|
177
|
-
value: 'united_kingdom',
|
178
|
-
label: 'Великобритания',
|
179
|
-
items: [
|
180
|
-
{
|
181
|
-
value: 'london',
|
182
|
-
label: 'Лондон',
|
183
|
-
},
|
184
|
-
{
|
185
|
-
value: 'manchester',
|
186
|
-
label: 'Манчестер',
|
187
|
-
},
|
188
|
-
],
|
189
|
-
},
|
190
|
-
],
|
191
|
-
},
|
192
|
-
{
|
193
|
-
value: 'asia',
|
194
|
-
label: 'Азия',
|
195
|
-
items: [
|
196
|
-
{
|
197
|
-
value: 'china',
|
198
|
-
label: 'Китай',
|
199
|
-
items: [
|
200
|
-
{
|
201
|
-
value: 'beijing',
|
202
|
-
label: 'Пекин',
|
203
|
-
},
|
204
|
-
{
|
205
|
-
value: 'shanghai',
|
206
|
-
label: 'Шанхай',
|
207
|
-
},
|
208
|
-
],
|
209
|
-
},
|
210
|
-
{
|
211
|
-
value: 'japan',
|
212
|
-
label: 'Япония',
|
213
|
-
items: [
|
214
|
-
{
|
215
|
-
value: 'tokyo',
|
216
|
-
label: 'Токио',
|
217
|
-
},
|
218
|
-
{
|
219
|
-
value: 'osaka',
|
220
|
-
label: 'Осака',
|
221
|
-
},
|
222
|
-
],
|
223
|
-
},
|
224
|
-
{
|
225
|
-
value: 'india',
|
226
|
-
label: 'Индия',
|
227
|
-
items: [
|
228
|
-
{
|
229
|
-
value: 'delhi',
|
230
|
-
label: 'Дели',
|
231
|
-
},
|
232
|
-
{
|
233
|
-
value: 'mumbai',
|
234
|
-
label: 'Мумбаи',
|
235
|
-
},
|
236
|
-
],
|
237
|
-
},
|
238
|
-
{
|
239
|
-
value: 'south_korea',
|
240
|
-
label: 'Южная Корея',
|
241
|
-
items: [
|
242
|
-
{
|
243
|
-
value: 'seoul',
|
244
|
-
label: 'Сеул',
|
245
|
-
},
|
246
|
-
{
|
247
|
-
value: 'busan',
|
248
|
-
label: 'Пусан',
|
249
|
-
},
|
250
|
-
],
|
251
|
-
},
|
252
|
-
{
|
253
|
-
value: 'thailand',
|
254
|
-
label: 'Таиланд',
|
255
|
-
items: [
|
256
|
-
{
|
257
|
-
value: 'bangkok',
|
258
|
-
label: 'Бангкок',
|
259
|
-
},
|
260
|
-
{
|
261
|
-
value: 'phuket',
|
262
|
-
label: 'Пхукет',
|
263
|
-
},
|
264
|
-
],
|
265
|
-
},
|
266
|
-
],
|
267
|
-
},
|
268
|
-
{
|
269
|
-
value: 'africa',
|
270
|
-
label: 'Африка',
|
271
|
-
disabled: true,
|
272
|
-
},
|
273
|
-
];
|
274
|
-
|
275
|
-
const StoryNormal = (args: StoryDropdownProps) => {
|
276
|
-
return (
|
277
|
-
<>
|
278
|
-
<Dropdown
|
279
|
-
{...args}
|
280
|
-
items={items}
|
281
|
-
onToggle={action('onToggle')}
|
282
|
-
onHover={action('onHover')}
|
283
|
-
onItemSelect={action('onItemSelect')}
|
284
|
-
onItemClick={action('onItemClick')}
|
285
|
-
>
|
286
|
-
<Button text="Список стран" />
|
287
|
-
</Dropdown>
|
288
|
-
</>
|
289
|
-
);
|
290
|
-
};
|
291
|
-
|
292
|
-
export const Default: StoryObj<StoryDropdownProps> = {
|
293
|
-
render: (args) => <StoryNormal {...args} />,
|
294
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
import React, { cloneElement, isValidElement } from 'react';
|
3
|
-
var isReactObject = function isReactObject(element) {
|
4
|
-
return _typeof(element) === 'object' || typeof element === 'function';
|
5
|
-
};
|
6
|
-
export var getValidComponent = function getValidComponent(element, props) {
|
7
|
-
if ( /*#__PURE__*/isValidElement(element)) {
|
8
|
-
return /*#__PURE__*/cloneElement(element, props);
|
9
|
-
}
|
10
|
-
if (isReactObject(element)) {
|
11
|
-
var Component = element;
|
12
|
-
return /*#__PURE__*/React.createElement(Component, props);
|
13
|
-
}
|
14
|
-
return element;
|
15
|
-
};
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { useMemo } from 'react';
|
2
|
-
export var useHashMaps = function useHashMaps(items) {
|
3
|
-
return useMemo(function () {
|
4
|
-
var pathMap = new Map();
|
5
|
-
var focusedToValueMap = new Map();
|
6
|
-
pathMap.set('root', items.length);
|
7
|
-
var rec = function rec(items) {
|
8
|
-
var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
9
|
-
items.forEach(function (item, index) {
|
10
|
-
var value = item.value,
|
11
|
-
innerItems = item.items;
|
12
|
-
var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
|
13
|
-
focusedToValueMap.set(currIndex, item);
|
14
|
-
if (innerItems) {
|
15
|
-
pathMap.set(value, innerItems.length);
|
16
|
-
rec(innerItems, currIndex);
|
17
|
-
}
|
18
|
-
});
|
19
|
-
};
|
20
|
-
rec(items);
|
21
|
-
return [pathMap, focusedToValueMap];
|
22
|
-
}, [items]);
|
23
|
-
};
|
@@ -1,193 +0,0 @@
|
|
1
|
-
var getFurtherPath = function getFurtherPath(focusedPath, focusedToValueMap) {
|
2
|
-
var focusedPathAsString = focusedPath.reduce(function (acc, n) {
|
3
|
-
return "".concat(acc, "/").concat(n);
|
4
|
-
}, '').replace(/^(\/)/, '');
|
5
|
-
return focusedToValueMap.get(focusedPathAsString);
|
6
|
-
};
|
7
|
-
export var useKeyNavigation = function useKeyNavigation(_ref) {
|
8
|
-
var focusedPath = _ref.focusedPath,
|
9
|
-
dispatchFocusedPath = _ref.dispatchFocusedPath,
|
10
|
-
path = _ref.path,
|
11
|
-
dispatchPath = _ref.dispatchPath,
|
12
|
-
pathMap = _ref.pathMap,
|
13
|
-
focusedToValueMap = _ref.focusedToValueMap,
|
14
|
-
handleGlobalToggle = _ref.handleGlobalToggle,
|
15
|
-
closeOnSelect = _ref.closeOnSelect,
|
16
|
-
onItemSelect = _ref.onItemSelect,
|
17
|
-
onItemClick = _ref.onItemClick;
|
18
|
-
var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[path.length - 1]) || 0;
|
19
|
-
var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
|
20
|
-
var onKeyDown = function onKeyDown(event) {
|
21
|
-
var code = event.code;
|
22
|
-
if (code === 'ArrowUp') {
|
23
|
-
if (focusedPath.length) {
|
24
|
-
var newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;
|
25
|
-
dispatchFocusedPath({
|
26
|
-
type: 'change_last_focus',
|
27
|
-
value: newIndex
|
28
|
-
});
|
29
|
-
} else {
|
30
|
-
dispatchPath({
|
31
|
-
type: 'opened_first_level'
|
32
|
-
});
|
33
|
-
dispatchFocusedPath({
|
34
|
-
type: 'set_initial_focus'
|
35
|
-
});
|
36
|
-
handleGlobalToggle(true, event);
|
37
|
-
}
|
38
|
-
}
|
39
|
-
if (code === 'ArrowDown') {
|
40
|
-
if (focusedPath.length) {
|
41
|
-
var _newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;
|
42
|
-
dispatchFocusedPath({
|
43
|
-
type: 'change_last_focus',
|
44
|
-
value: _newIndex
|
45
|
-
});
|
46
|
-
} else {
|
47
|
-
dispatchPath({
|
48
|
-
type: 'opened_first_level'
|
49
|
-
});
|
50
|
-
dispatchFocusedPath({
|
51
|
-
type: 'set_initial_focus'
|
52
|
-
});
|
53
|
-
handleGlobalToggle(true, event);
|
54
|
-
}
|
55
|
-
}
|
56
|
-
if (code === 'ArrowLeft') {
|
57
|
-
if (focusedPath.length) {
|
58
|
-
dispatchPath({
|
59
|
-
type: 'removed_last_level'
|
60
|
-
});
|
61
|
-
dispatchFocusedPath({
|
62
|
-
type: 'return_prev_focus'
|
63
|
-
});
|
64
|
-
}
|
65
|
-
if (focusedPath.length === 1) {
|
66
|
-
handleGlobalToggle(false, event);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
if (code === 'ArrowRight') {
|
70
|
-
if (focusedPath.length) {
|
71
|
-
var currentItem = getFurtherPath(focusedPath, focusedToValueMap);
|
72
|
-
if (currentItem !== null && currentItem !== void 0 && currentItem.items) {
|
73
|
-
dispatchPath({
|
74
|
-
type: 'added_next_level',
|
75
|
-
value: currentItem.value.toString()
|
76
|
-
});
|
77
|
-
dispatchFocusedPath({
|
78
|
-
type: 'add_focus',
|
79
|
-
value: 0
|
80
|
-
});
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
if (code === 'Enter' || code === 'Space') {
|
85
|
-
event.preventDefault();
|
86
|
-
if (path[0]) {
|
87
|
-
var _currentItem = getFurtherPath(focusedPath, focusedToValueMap);
|
88
|
-
if (_currentItem !== null && _currentItem !== void 0 && _currentItem.disabled || _currentItem !== null && _currentItem !== void 0 && _currentItem.isDisabled) return;
|
89
|
-
if (_currentItem !== null && _currentItem !== void 0 && _currentItem.items) {
|
90
|
-
dispatchPath({
|
91
|
-
type: 'added_next_level',
|
92
|
-
value: _currentItem.value.toString()
|
93
|
-
});
|
94
|
-
dispatchFocusedPath({
|
95
|
-
type: 'add_focus',
|
96
|
-
value: 0
|
97
|
-
});
|
98
|
-
} else {
|
99
|
-
if (closeOnSelect) {
|
100
|
-
handleGlobalToggle(false, event);
|
101
|
-
}
|
102
|
-
if (onItemSelect && _currentItem) {
|
103
|
-
onItemSelect(_currentItem, event);
|
104
|
-
}
|
105
|
-
if (onItemClick && _currentItem) {
|
106
|
-
onItemClick(_currentItem, event);
|
107
|
-
}
|
108
|
-
}
|
109
|
-
} else {
|
110
|
-
dispatchPath({
|
111
|
-
type: 'opened_first_level'
|
112
|
-
});
|
113
|
-
dispatchFocusedPath({
|
114
|
-
type: 'set_initial_focus'
|
115
|
-
});
|
116
|
-
}
|
117
|
-
}
|
118
|
-
if (code === 'Tab') {
|
119
|
-
dispatchFocusedPath({
|
120
|
-
type: 'reset'
|
121
|
-
});
|
122
|
-
dispatchPath({
|
123
|
-
type: 'reset'
|
124
|
-
});
|
125
|
-
handleGlobalToggle(false, event);
|
126
|
-
}
|
127
|
-
if (code === 'Home') {
|
128
|
-
if (path[0]) {
|
129
|
-
dispatchFocusedPath({
|
130
|
-
type: 'change_last_focus',
|
131
|
-
value: 0
|
132
|
-
});
|
133
|
-
} else {
|
134
|
-
dispatchPath({
|
135
|
-
type: 'opened_first_level'
|
136
|
-
});
|
137
|
-
dispatchFocusedPath({
|
138
|
-
type: 'set_initial_focus'
|
139
|
-
});
|
140
|
-
handleGlobalToggle(true, event);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
if (code === 'End') {
|
144
|
-
if (path[0]) {
|
145
|
-
dispatchFocusedPath({
|
146
|
-
type: 'change_last_focus',
|
147
|
-
value: currentLength - 1
|
148
|
-
});
|
149
|
-
} else {
|
150
|
-
dispatchPath({
|
151
|
-
type: 'opened_first_level'
|
152
|
-
});
|
153
|
-
dispatchFocusedPath({
|
154
|
-
type: 'change_last_focus',
|
155
|
-
value: (pathMap.get('root') || 0) - 1
|
156
|
-
});
|
157
|
-
handleGlobalToggle(true, event);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
if (code === 'PageUp') {
|
161
|
-
if (path[0]) {
|
162
|
-
if (currentIndex <= 10) {
|
163
|
-
dispatchFocusedPath({
|
164
|
-
type: 'set_initial_focus'
|
165
|
-
});
|
166
|
-
} else {
|
167
|
-
dispatchFocusedPath({
|
168
|
-
type: 'change_last_focus',
|
169
|
-
value: currentIndex - 10
|
170
|
-
});
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
if (code === 'PageDown') {
|
175
|
-
if (path[0]) {
|
176
|
-
if (currentLength - currentIndex <= 10) {
|
177
|
-
dispatchFocusedPath({
|
178
|
-
type: 'change_last_focus',
|
179
|
-
value: currentLength - 1
|
180
|
-
});
|
181
|
-
} else {
|
182
|
-
dispatchFocusedPath({
|
183
|
-
type: 'change_last_focus',
|
184
|
-
value: currentIndex + 10
|
185
|
-
});
|
186
|
-
}
|
187
|
-
}
|
188
|
-
}
|
189
|
-
};
|
190
|
-
return {
|
191
|
-
onKeyDown: onKeyDown
|
192
|
-
};
|
193
|
-
};
|
@@ -1,34 +0,0 @@
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
4
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
5
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
-
export function focusedPathReducer(state, action) {
|
8
|
-
switch (action.type) {
|
9
|
-
case 'reset':
|
10
|
-
{
|
11
|
-
return [];
|
12
|
-
}
|
13
|
-
case 'set_initial_focus':
|
14
|
-
{
|
15
|
-
return [0];
|
16
|
-
}
|
17
|
-
case 'change_last_focus':
|
18
|
-
{
|
19
|
-
return [].concat(_toConsumableArray(state.slice(0, -1)), [action.value]);
|
20
|
-
}
|
21
|
-
case 'add_focus':
|
22
|
-
{
|
23
|
-
return [].concat(_toConsumableArray(state), [action.value]);
|
24
|
-
}
|
25
|
-
case 'return_prev_focus':
|
26
|
-
{
|
27
|
-
return _toConsumableArray(state.slice(0, -1));
|
28
|
-
}
|
29
|
-
default:
|
30
|
-
{
|
31
|
-
return state;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
4
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
5
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
-
export function pathReducer(state, action) {
|
8
|
-
switch (action.type) {
|
9
|
-
case 'reset':
|
10
|
-
{
|
11
|
-
return [];
|
12
|
-
}
|
13
|
-
case 'opened_first_level':
|
14
|
-
{
|
15
|
-
return ['root'];
|
16
|
-
}
|
17
|
-
case 'added_next_level':
|
18
|
-
{
|
19
|
-
return [].concat(_toConsumableArray(state), [action.value]);
|
20
|
-
}
|
21
|
-
case 'removed_last_level':
|
22
|
-
{
|
23
|
-
return _toConsumableArray(state.slice(0, -1));
|
24
|
-
}
|
25
|
-
case 'changed_on_level':
|
26
|
-
{
|
27
|
-
return [].concat(_toConsumableArray(state.slice(0, action.level)), [action.value]);
|
28
|
-
}
|
29
|
-
case 'cut_by_level':
|
30
|
-
{
|
31
|
-
return state.slice(0, action.level);
|
32
|
-
}
|
33
|
-
default:
|
34
|
-
{
|
35
|
-
return state;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|