@decisiv/ui-components 2.0.1-alpha.99 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +38 -5
- package/lib/atoms/Calendar/index.test.js +5 -5
- package/lib/atoms/Calendar/types.d.ts +1 -1
- package/lib/atoms/Calendar/types.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.d.ts +2 -1
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +3 -1
- package/lib/atoms/InputField/HelpMessage.d.ts +1 -1
- package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
- package/lib/atoms/InputField/HelpMessage.js +23 -7
- package/lib/atoms/InputField/index.d.ts +6 -1
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +21 -4
- package/lib/atoms/InputField/index.test.js +53 -0
- package/lib/atoms/InputField/schema.js +2 -2
- package/lib/atoms/InputField/styles.d.ts +7 -0
- package/lib/atoms/InputField/styles.d.ts.map +1 -0
- package/lib/atoms/InputField/styles.js +31 -0
- package/lib/atoms/OptionsList/Category/index.d.ts +4 -0
- package/lib/atoms/OptionsList/Category/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/index.js +85 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts +5 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/styles.js +35 -0
- package/lib/atoms/OptionsList/{Option.d.ts → Option/index.d.ts} +2 -2
- package/lib/atoms/OptionsList/Option/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/index.js +182 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts +17 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/styles.js +86 -0
- package/lib/atoms/OptionsList/context.d.ts +1 -0
- package/lib/atoms/OptionsList/context.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.d.ts +1 -44
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +259 -40
- package/lib/atoms/OptionsList/index.test.js +329 -186
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +7 -1
- package/lib/atoms/OptionsList/styles.d.ts +45 -0
- package/lib/atoms/OptionsList/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/styles.js +29 -0
- package/lib/atoms/OptionsList/types.d.ts +50 -1
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/OptionsList/utils.d.ts +2 -1
- package/lib/atoms/OptionsList/utils.d.ts.map +1 -1
- package/lib/atoms/OptionsList/utils.js +49 -2
- package/lib/components/Alert/Container.d.ts +201 -0
- package/lib/components/Alert/Container.d.ts.map +1 -0
- package/lib/components/Alert/Container.js +26 -0
- package/lib/components/Alert/StyledButton.d.ts +5 -0
- package/lib/components/Alert/StyledButton.d.ts.map +1 -0
- package/lib/components/Alert/StyledButton.js +23 -0
- package/lib/components/Alert/index.d.ts +27 -0
- package/lib/components/Alert/index.d.ts.map +1 -0
- package/lib/components/Alert/index.js +112 -0
- package/lib/components/Alert/index.test.js +79 -0
- package/lib/components/Alert/intents.d.ts +13 -0
- package/lib/components/Alert/intents.d.ts.map +1 -0
- package/lib/components/Alert/intents.js +72 -0
- package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
- package/lib/components/Alert/schema.d.ts.map +1 -0
- package/lib/components/Alert/schema.js +25 -0
- package/lib/components/Alert/types.d.ts +36 -0
- package/lib/components/Alert/types.d.ts.map +1 -0
- package/lib/components/Alert/types.js +32 -0
- package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
- package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContainer.js +12 -13
- package/lib/components/Avatar/AvatarContent.d.ts +2 -2
- package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContent.js +24 -20
- package/lib/components/Avatar/index.d.ts.map +1 -1
- package/lib/components/Avatar/index.js +42 -5
- package/lib/components/Avatar/index.test.js +4 -0
- package/lib/components/Avatar/schema.d.ts.map +1 -1
- package/lib/components/Avatar/schema.js +3 -1
- package/lib/components/Avatar/types.d.ts +15 -2
- package/lib/components/Avatar/types.d.ts.map +1 -1
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +2 -58
- package/lib/components/Badge/index.test.js +15 -4
- package/lib/components/Badge/schema.d.ts.map +1 -1
- package/lib/components/Badge/schema.js +1 -0
- package/lib/components/Badge/styles.d.ts +3 -0
- package/lib/components/Badge/styles.d.ts.map +1 -0
- package/lib/components/Badge/styles.js +97 -0
- package/lib/components/Badge/types.d.ts +3 -1
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +2 -1
- package/lib/components/Button/StyledButton.d.ts +3 -6
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +39 -11
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +51 -12
- package/lib/components/Button/index.test.js +43 -8
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +4 -1
- package/lib/components/Button/types.d.ts +4 -1
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +10 -0
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +111 -59
- package/lib/components/Combobox/index.test.js +110 -25
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +7 -1
- package/lib/components/Combobox/types.d.ts +7 -2
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/Drawer/index.d.ts +22 -0
- package/lib/components/Drawer/index.d.ts.map +1 -0
- package/lib/components/Drawer/index.js +122 -0
- package/lib/components/Drawer/index.test.js +164 -0
- package/lib/components/Drawer/schema.d.ts +3 -0
- package/lib/components/Drawer/schema.d.ts.map +1 -0
- package/lib/components/Drawer/schema.js +32 -0
- package/lib/components/Drawer/styles.d.ts +11 -0
- package/lib/components/Drawer/styles.d.ts.map +1 -0
- package/lib/components/Drawer/styles.js +79 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +10 -3
- package/lib/components/DropdownList/index.test.js +38 -25
- package/lib/components/DropdownList/schema.js +1 -1
- package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
- package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
- package/lib/components/Filter/ActionFilter/index.js +43 -0
- package/lib/components/Filter/IconWrapper/index.d.ts +2 -2
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.d.ts +2 -28
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.js +9 -21
- package/lib/components/Filter/StyledFilter.d.ts +2 -2
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -1
- package/lib/components/Filter/StyledFilter.js +28 -1
- package/lib/components/Filter/StyledLabel/index.d.ts +3 -3
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -1
- package/lib/components/Filter/StyledLabel/index.js +14 -6
- package/lib/components/Filter/index.d.ts +4 -25
- package/lib/components/Filter/index.d.ts.map +1 -1
- package/lib/components/Filter/index.js +41 -29
- package/lib/components/Filter/index.test.js +33 -4
- package/lib/components/Filter/kind.d.ts +4 -3
- package/lib/components/Filter/kind.d.ts.map +1 -1
- package/lib/components/Filter/kind.js +20 -22
- package/lib/components/Filter/schema.d.ts.map +1 -1
- package/lib/components/Filter/schema.js +8 -3
- package/lib/components/Filter/types.d.ts +21 -7
- package/lib/components/Filter/types.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +50 -9
- package/lib/components/JumpTo/index.test.js +84 -0
- package/lib/components/JumpTo/schema.d.ts.map +1 -1
- package/lib/components/JumpTo/schema.js +2 -1
- package/lib/components/JumpTo/types.d.ts +1 -0
- package/lib/components/JumpTo/types.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.js +3 -7
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +7 -2
- package/lib/components/LeftNav/index.test.js +35 -19
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +3 -1
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/Link/DisabledLink.d.ts +7 -0
- package/lib/components/Link/DisabledLink.d.ts.map +1 -0
- package/lib/components/Link/DisabledLink.js +46 -0
- package/lib/components/Link/Link.d.ts +4 -0
- package/lib/components/Link/Link.d.ts.map +1 -0
- package/lib/components/Link/Link.js +67 -0
- package/lib/components/Link/index.d.ts +4 -23
- package/lib/components/Link/index.d.ts.map +1 -1
- package/lib/components/Link/index.js +19 -157
- package/lib/components/Link/index.test.js +62 -49
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +1 -0
- package/lib/components/Link/styles.d.ts +20 -0
- package/lib/components/Link/styles.d.ts.map +1 -0
- package/lib/components/Link/styles.js +131 -0
- package/lib/components/Link/types.d.ts +28 -0
- package/lib/components/Link/types.d.ts.map +1 -0
- package/lib/components/List/BaseCell/index.d.ts +6 -0
- package/lib/components/List/BaseCell/index.d.ts.map +1 -0
- package/lib/components/List/BaseCell/index.js +17 -0
- package/lib/components/List/BaseCell/index.test.js +33 -0
- package/lib/components/List/BaseCell/styles.d.ts +198 -0
- package/lib/components/List/BaseCell/styles.d.ts.map +1 -0
- package/lib/components/List/BaseCell/styles.js +26 -0
- package/lib/components/List/ContentContainer/index.d.ts +21 -0
- package/lib/components/List/ContentContainer/index.d.ts.map +1 -0
- package/lib/components/List/ContentContainer/index.js +82 -0
- package/lib/components/List/ContentContainer/index.test.js +102 -0
- package/lib/components/List/DefaultCell/index.d.ts +6 -0
- package/lib/components/List/DefaultCell/index.d.ts.map +1 -0
- package/lib/components/List/DefaultCell/index.js +26 -0
- package/lib/components/List/EditableCell/index.d.ts +13 -0
- package/lib/components/List/EditableCell/index.d.ts.map +1 -0
- package/lib/components/List/EditableCell/index.js +47 -0
- package/lib/components/List/EditableCell/styles.d.ts +204 -0
- package/lib/components/List/EditableCell/styles.d.ts.map +1 -0
- package/lib/components/List/EditableCell/styles.js +47 -0
- package/lib/components/List/LabelContainer/index.d.ts +9 -0
- package/lib/components/List/LabelContainer/index.d.ts.map +1 -0
- package/lib/components/List/LabelContainer/index.js +38 -0
- package/lib/components/List/LabelContainer/index.test.js +105 -0
- package/lib/components/List/LabelContainer/styles.d.ts +4 -0
- package/lib/components/List/LabelContainer/styles.d.ts.map +1 -0
- package/lib/components/List/LabelContainer/styles.js +28 -0
- package/lib/components/List/ListItem/index.d.ts +8 -0
- package/lib/components/List/ListItem/index.d.ts.map +1 -0
- package/lib/components/List/ListItem/index.js +43 -0
- package/lib/components/List/ListItem/index.test.js +76 -0
- package/lib/components/List/ListItem/schema.d.ts +4 -0
- package/lib/components/List/ListItem/schema.d.ts.map +1 -0
- package/lib/components/List/ListItem/schema.js +30 -0
- package/lib/components/List/ListItem/styles.d.ts +2 -0
- package/lib/components/List/ListItem/styles.d.ts.map +1 -0
- package/lib/components/List/ListItem/styles.js +23 -0
- package/lib/components/List/constants.d.ts +19 -0
- package/lib/components/List/constants.d.ts.map +1 -0
- package/lib/components/List/constants.js +28 -0
- package/lib/components/List/index.d.ts +15 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +67 -0
- package/lib/components/List/index.test.js +64 -0
- package/lib/components/List/schema.d.ts +4 -0
- package/lib/components/List/schema.d.ts.map +1 -0
- package/lib/components/List/schema.js +26 -0
- package/lib/components/List/styles.d.ts +198 -0
- package/lib/components/List/styles.d.ts.map +1 -0
- package/lib/components/List/styles.js +34 -0
- package/lib/components/List/types.d.ts +15 -0
- package/lib/components/List/types.d.ts.map +1 -0
- package/lib/components/List/types.js +5 -0
- package/lib/components/Loading/Loading.d.ts +12 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +70 -0
- package/lib/components/Loading/index.d.ts +4 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +33 -0
- package/lib/components/Loading/index.test.js +55 -0
- package/lib/components/Loading/schema.d.ts +4 -0
- package/lib/components/Loading/schema.d.ts.map +1 -0
- package/lib/components/Loading/schema.js +31 -0
- package/lib/components/Loading/styles.d.ts +211 -0
- package/lib/components/Loading/styles.d.ts.map +1 -0
- package/lib/components/Loading/styles.js +77 -0
- package/lib/components/Loading/types.d.ts +10 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Loading/types.js +5 -0
- package/lib/components/Modal/Manager.d.ts +6 -0
- package/lib/components/Modal/Manager.d.ts.map +1 -0
- package/lib/components/Modal/Manager.js +53 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
- package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
- package/lib/components/Modal/components.d.ts +199 -1
- package/lib/components/Modal/components.d.ts.map +1 -1
- package/lib/components/Modal/components.js +16 -24
- package/lib/components/Modal/index.d.ts +8 -4
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +63 -95
- package/lib/components/Modal/index.test.js +99 -0
- package/lib/components/Modal/schema.d.ts.map +1 -1
- package/lib/components/Modal/schema.js +2 -1
- package/lib/components/Modal/types.d.ts +2 -1
- package/lib/components/Modal/types.d.ts.map +1 -1
- package/lib/components/Modal/utils.d.ts +1 -1
- package/lib/components/Modal/utils.d.ts.map +1 -1
- package/lib/components/Modal/utils.js +7 -5
- package/lib/components/Pagination/Pages.d.ts +1 -7
- package/lib/components/Pagination/Pages.d.ts.map +1 -1
- package/lib/components/Pagination/Pages.js +17 -0
- package/lib/components/Pagination/Pagination.d.ts +13 -14
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +20 -5
- package/lib/components/Pagination/Pagination.test.js +14 -0
- package/lib/components/Pagination/paginate.d.ts +1 -1
- package/lib/components/Pagination/paginate.d.ts.map +1 -1
- package/lib/components/Pagination/paginate.js +4 -0
- package/lib/components/Pagination/paginate.test.js +38 -17
- package/lib/components/Pagination/schema.d.ts.map +1 -1
- package/lib/components/Pagination/schema.js +3 -1
- package/lib/components/Pagination/types.d.ts +24 -1
- package/lib/components/Pagination/types.d.ts.map +1 -1
- package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
- package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
- package/lib/components/PasswordField/IconWrapper.js +32 -0
- package/lib/components/PasswordField/Input.d.ts +6 -0
- package/lib/components/PasswordField/Input.d.ts.map +1 -0
- package/lib/components/PasswordField/Input.js +28 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
- package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
- package/lib/components/PasswordField/index.d.ts +14 -0
- package/lib/components/PasswordField/index.d.ts.map +1 -0
- package/lib/components/PasswordField/index.js +113 -0
- package/lib/components/PasswordField/index.test.js +217 -0
- package/lib/components/PasswordField/schema.d.ts +3 -0
- package/lib/components/PasswordField/schema.d.ts.map +1 -0
- package/lib/components/PasswordField/schema.js +27 -0
- package/lib/components/Popover/Arrow.d.ts +2 -2
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +25 -10
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +28 -20
- package/lib/components/Popover/types.d.ts +6 -2
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/SearchInput/index.d.ts +11 -0
- package/lib/components/SearchInput/index.d.ts.map +1 -0
- package/lib/components/SearchInput/index.js +179 -0
- package/lib/components/SearchInput/index.test.js +660 -0
- package/lib/components/SearchInput/schema.d.ts +3 -0
- package/lib/components/SearchInput/schema.d.ts.map +1 -0
- package/lib/components/SearchInput/schema.js +38 -0
- package/lib/components/SearchInput/styles.d.ts +1176 -0
- package/lib/components/SearchInput/styles.d.ts.map +1 -0
- package/lib/components/SearchInput/styles.js +97 -0
- package/lib/components/SearchInput/types.d.ts +39 -0
- package/lib/components/SearchInput/types.d.ts.map +1 -0
- package/lib/components/SearchInput/types.js +5 -0
- package/lib/components/Select/Target.d.ts.map +1 -1
- package/lib/components/Select/Target.js +5 -1
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +7 -3
- package/lib/components/Select/index.test.js +43 -19
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +2 -0
- package/lib/components/Select/types.d.ts +2 -0
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +5 -1
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +7 -3
- package/lib/components/SelectDate/schema.d.ts.map +1 -1
- package/lib/components/SelectDate/schema.js +1 -0
- package/lib/components/SelectDate/types.d.ts +1 -0
- package/lib/components/SelectDate/types.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +6 -2
- package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
- package/lib/components/SelectDateRange/schema.js +1 -0
- package/lib/components/StepTracker/index.d.ts +11 -0
- package/lib/components/StepTracker/index.d.ts.map +1 -0
- package/lib/components/StepTracker/index.js +56 -0
- package/lib/components/StepTracker/index.test.js +89 -0
- package/lib/components/StepTracker/schema.d.ts +3 -0
- package/lib/components/StepTracker/schema.d.ts.map +1 -0
- package/lib/components/StepTracker/schema.js +19 -0
- package/lib/components/StepTracker/styles.d.ts +605 -0
- package/lib/components/StepTracker/styles.d.ts.map +1 -0
- package/lib/components/StepTracker/styles.js +114 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +2 -5
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +6 -1
- package/lib/components/Table/Grip.d.ts +6 -2
- package/lib/components/Table/Grip.d.ts.map +1 -1
- package/lib/components/Table/Grip.js +9 -3
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Tabs/Tab/index.d.ts +13 -0
- package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/index.js +94 -0
- package/lib/components/Tabs/Tab/schema.d.ts +3 -0
- package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.d.ts +7 -0
- package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.js +37 -0
- package/lib/components/Tabs/context.d.ts +2 -2
- package/lib/components/Tabs/context.d.ts.map +1 -1
- package/lib/components/Tabs/context.js +1 -1
- package/lib/components/Tabs/index.d.ts +17 -6
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +104 -163
- package/lib/components/Tabs/index.test.js +54 -2
- package/lib/components/Tabs/styles.d.ts +4 -0
- package/lib/components/Tabs/styles.d.ts.map +1 -0
- package/lib/components/Tabs/styles.js +35 -0
- package/lib/components/Tag/Action.d.ts +4 -0
- package/lib/components/Tag/Action.d.ts.map +1 -0
- package/lib/components/Tag/Action.js +39 -0
- package/lib/components/Tag/constants.d.ts +2 -2
- package/lib/components/Tag/constants.d.ts.map +1 -1
- package/lib/components/Tag/constants.js +4 -4
- package/lib/components/Tag/index.d.ts +1 -3
- package/lib/components/Tag/index.d.ts.map +1 -1
- package/lib/components/Tag/index.js +40 -97
- package/lib/components/Tag/index.test.js +239 -2
- package/lib/components/Tag/propTypes.d.ts +4 -1
- package/lib/components/Tag/propTypes.d.ts.map +1 -1
- package/lib/components/Tag/propTypes.js +5 -2
- package/lib/components/Tag/schema.d.ts.map +1 -1
- package/lib/components/Tag/schema.js +3 -1
- package/lib/components/Tag/styles.d.ts +13 -0
- package/lib/components/Tag/styles.d.ts.map +1 -0
- package/lib/components/Tag/styles.js +133 -0
- package/lib/components/Tag/types.d.ts +11 -12
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/TagInput/index.d.ts +5 -0
- package/lib/components/TagInput/index.d.ts.map +1 -0
- package/lib/components/TagInput/index.js +363 -0
- package/lib/components/TagInput/index.test.js +1143 -0
- package/lib/components/TagInput/schema.d.ts +3 -0
- package/lib/components/TagInput/schema.d.ts.map +1 -0
- package/lib/components/TagInput/schema.js +36 -0
- package/lib/components/TagInput/styles.d.ts +10 -0
- package/lib/components/TagInput/styles.d.ts.map +1 -0
- package/lib/components/TagInput/styles.js +52 -0
- package/lib/components/TagInput/types.d.ts +21 -0
- package/lib/components/TagInput/types.d.ts.map +1 -0
- package/lib/components/TagInput/types.js +5 -0
- package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
- package/lib/components/Toggle/Fieldset.js +20 -11
- package/lib/components/Toggle/Option.d.ts.map +1 -1
- package/lib/components/Toggle/Option.js +1 -1
- package/lib/components/Toggle/Slider.d.ts +1 -3
- package/lib/components/Toggle/Slider.d.ts.map +1 -1
- package/lib/components/Toggle/Slider.js +29 -24
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +2 -1
- package/lib/components/Toggle/propTypes.js +1 -1
- package/lib/components/Toggle/schema.js +1 -1
- package/lib/components/Toggle/types.d.ts +3 -2
- package/lib/components/Toggle/types.d.ts.map +1 -1
- package/lib/components/ToggleView/ToggleView.d.ts +5 -0
- package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
- package/lib/components/ToggleView/ToggleView.js +80 -0
- package/lib/components/ToggleView/index.d.ts +4 -0
- package/lib/components/ToggleView/index.d.ts.map +1 -0
- package/lib/components/ToggleView/index.js +33 -0
- package/lib/components/ToggleView/index.test.js +61 -0
- package/lib/components/ToggleView/schema.d.ts +3 -0
- package/lib/components/ToggleView/schema.d.ts.map +1 -0
- package/lib/components/ToggleView/schema.js +24 -0
- package/lib/components/ToggleView/styles.d.ts +6 -0
- package/lib/components/ToggleView/styles.d.ts.map +1 -0
- package/lib/components/ToggleView/styles.js +23 -0
- package/lib/components/ToggleView/types.d.ts +23 -0
- package/lib/components/ToggleView/types.d.ts.map +1 -0
- package/lib/components/ToggleView/types.js +12 -0
- package/lib/components/Tooltip/index.d.ts.map +1 -1
- package/lib/components/Tooltip/index.js +3 -13
- package/lib/components/Tooltip/schema.d.ts +3 -0
- package/lib/components/Tooltip/schema.d.ts.map +1 -0
- package/lib/components/Tooltip/schema.js +29 -0
- package/lib/components/TopNav/Menu/index.d.ts +1 -1
- package/lib/components/TopNav/index.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts.map +1 -1
- package/lib/components/Typography/withColors.js +1 -1
- package/lib/components/Wizard/index.d.ts +33 -0
- package/lib/components/Wizard/index.d.ts.map +1 -0
- package/lib/components/Wizard/index.js +161 -0
- package/lib/components/Wizard/index.test.js +940 -0
- package/lib/components/Wizard/schema.d.ts +3 -0
- package/lib/components/Wizard/schema.d.ts.map +1 -0
- package/lib/components/Wizard/schema.js +42 -0
- package/lib/components/Wizard/styles.d.ts +990 -0
- package/lib/components/Wizard/styles.d.ts.map +1 -0
- package/lib/components/Wizard/styles.js +79 -0
- package/lib/components/index.d.ts +11 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +196 -1
- package/lib/modifiers/palette.d.ts +36 -0
- package/lib/modifiers/palette.d.ts.map +1 -0
- package/lib/modifiers/palette.js +88 -0
- package/lib/modifiers/spacingSchema.d.ts.map +1 -1
- package/lib/modifiers/spacingSchema.js +29 -16
- package/lib/providers/ConfigProvider/utils/linkRenderer.d.ts +2 -1
- package/lib/providers/ConfigProvider/utils/linkRenderer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +45 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +46 -2
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +5 -0
- package/lib/utils/commonUIColors.d.ts +351 -3
- package/lib/utils/commonUIColors.d.ts.map +1 -1
- package/lib/utils/commonUIColors.js +6 -2
- package/lib/utils/useDebounce.d.ts +2 -0
- package/lib/utils/useDebounce.d.ts.map +1 -0
- package/lib/utils/useDebounce.js +37 -0
- package/lib/utils/useStackingContext.d.ts +12 -0
- package/lib/utils/useStackingContext.d.ts.map +1 -0
- package/lib/utils/useStackingContext.js +46 -0
- package/package.json +26 -13
- package/CHANGELOG.md +0 -796
- package/lib/atoms/OptionsList/Category.d.ts +0 -4
- package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Category.js +0 -53
- package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.js +0 -197
- package/lib/components/Tabs/Tab.d.ts +0 -5
- package/lib/components/Tabs/Tab.d.ts.map +0 -1
- package/lib/components/Tabs/Tab.js +0 -109
- package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
- package/lib/components/Tabs/types.d.ts +0 -27
- package/lib/components/Tabs/types.d.ts.map +0 -1
- package/lib/components/Tag/ActionButton.d.ts +0 -5
- package/lib/components/Tag/ActionButton.d.ts.map +0 -1
- package/lib/components/Tag/ActionButton.js +0 -56
- /package/lib/components/{Tabs → Link}/types.js +0 -0
- /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
|
@@ -86,6 +86,14 @@ var items = [{
|
|
|
86
86
|
label: 'Option 5',
|
|
87
87
|
value: '5'
|
|
88
88
|
}]
|
|
89
|
+
}, {
|
|
90
|
+
label: 'WithDetailLabel',
|
|
91
|
+
items: [{
|
|
92
|
+
id: '6',
|
|
93
|
+
label: 'custom label here',
|
|
94
|
+
labelDetails: 'test detail label',
|
|
95
|
+
value: '6'
|
|
96
|
+
}]
|
|
89
97
|
}];
|
|
90
98
|
var defaultProps = {
|
|
91
99
|
items: items,
|
|
@@ -93,126 +101,157 @@ var defaultProps = {
|
|
|
93
101
|
onChange: jest.fn()
|
|
94
102
|
};
|
|
95
103
|
describe('OptionsList', function () {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
it('renders custom option label', function () {
|
|
113
|
-
var renderOptionLabel = function renderOptionLabel(_ref3) {
|
|
114
|
-
var label = _ref3.label;
|
|
115
|
-
return _react.default.createElement("span", null, "".concat(label, " foo"));
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
var _render2 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
119
|
-
renderOptionLabel: renderOptionLabel
|
|
120
|
-
}))),
|
|
121
|
-
queryByText = _render2.queryByText;
|
|
122
|
-
|
|
123
|
-
items.forEach(function (item) {
|
|
124
|
-
var label = item.label;
|
|
125
|
-
|
|
126
|
-
if ((0, _utils.isCategory)(item)) {
|
|
127
|
-
item.items.forEach(function (_ref4) {
|
|
128
|
-
var subItemLabel = _ref4.label;
|
|
129
|
-
expect(queryByText("".concat(subItemLabel, " foo"))).toBeInTheDocument();
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
expect(queryByText("".concat(label, " foo"))).toBeInTheDocument();
|
|
133
|
-
}
|
|
104
|
+
describe('virtualization', function () {
|
|
105
|
+
it('renders with virtualization enabled', function () {
|
|
106
|
+
var _render = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
107
|
+
enableVirtualization: true,
|
|
108
|
+
getItemHeight: function getItemHeight(item) {
|
|
109
|
+
return item.type === 'category-header' ? 40 : 48;
|
|
110
|
+
}
|
|
111
|
+
})), {
|
|
112
|
+
wrapper: wrapper
|
|
113
|
+
}),
|
|
114
|
+
container = _render.container; // Verify that react-window's List container is rendered
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
var listContainer = container.querySelector('[style*="overflow"]');
|
|
118
|
+
expect(listContainer).toBeTruthy();
|
|
119
|
+
expect(container).toMatchSnapshot();
|
|
134
120
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
121
|
+
it('renders without virtualization by default', function () {
|
|
122
|
+
var _render2 = render(_react.default.createElement(_.default, defaultProps), {
|
|
123
|
+
wrapper: wrapper
|
|
124
|
+
}),
|
|
125
|
+
queryByText = _render2.queryByText; // Verify all items are rendered directly (not virtualized)
|
|
140
126
|
|
|
141
|
-
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
142
127
|
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
expect(queryByText(item0Label)).toBeTruthy();
|
|
129
|
+
expect(queryByText('Option 1')).toBeTruthy();
|
|
130
|
+
expect(queryByText(item2Label)).toBeTruthy();
|
|
145
131
|
});
|
|
132
|
+
it('warns when enableVirtualization is used with drag-drop', function () {
|
|
133
|
+
var consoleSpy = jest.spyOn(console, 'warn').mockImplementation();
|
|
134
|
+
var onDragEnd = jest.fn();
|
|
135
|
+
render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
136
|
+
enableVirtualization: true,
|
|
137
|
+
onDragEnd: onDragEnd
|
|
138
|
+
})), {
|
|
139
|
+
wrapper: wrapper
|
|
140
|
+
});
|
|
141
|
+
expect(consoleSpy).toHaveBeenCalledWith('OptionsList: enableVirtualization is ignored when onDragEnd is provided. Virtualization and drag-and-drop are incompatible.');
|
|
142
|
+
consoleSpy.mockRestore();
|
|
143
|
+
});
|
|
144
|
+
it('disables virtualization when drag-drop is enabled', function () {
|
|
145
|
+
var onDragEnd = jest.fn();
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
var _render3 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
148
|
+
enableVirtualization: true,
|
|
149
|
+
onDragEnd: onDragEnd
|
|
150
|
+
})), {
|
|
151
|
+
wrapper: wrapper
|
|
152
|
+
}),
|
|
153
|
+
queryByText = _render3.queryByText; // All items should be rendered directly (not virtualized) when drag-drop is enabled
|
|
150
154
|
|
|
151
|
-
expect(getByText(defaultProps.items[0].label).closest('.label')).toHaveStyle("\n border-color: ".concat((0, _toColorString.default)(_designTokens.color.interaction.pacificOcean), ";\n "));
|
|
152
155
|
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
expect(queryByText(item0Label)).toBeTruthy();
|
|
157
|
+
expect(queryByText('Option 1')).toBeTruthy();
|
|
158
|
+
expect(queryByText(item2Label)).toBeTruthy();
|
|
155
159
|
});
|
|
160
|
+
});
|
|
161
|
+
['small', 'medium'].forEach(function (size) {
|
|
162
|
+
it('renders items and categories sub items', function () {
|
|
163
|
+
var _render4 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
164
|
+
size: size
|
|
165
|
+
}))),
|
|
166
|
+
queryByText = _render4.queryByText;
|
|
167
|
+
|
|
168
|
+
items.forEach(function (item) {
|
|
169
|
+
var label = item.label;
|
|
170
|
+
expect(queryByText(label)).toBeInTheDocument();
|
|
171
|
+
|
|
172
|
+
if ((0, _utils.isCategory)(item)) {
|
|
173
|
+
item.items.forEach(function (_ref2) {
|
|
174
|
+
var subItemLabel = _ref2.label;
|
|
175
|
+
expect(queryByText(subItemLabel)).toBeInTheDocument();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
it('renders custom option label', function () {
|
|
181
|
+
var renderOptionLabel = function renderOptionLabel(_ref3) {
|
|
182
|
+
var label = _ref3.label;
|
|
183
|
+
return _react.default.createElement("span", null, "".concat(label, " foo"));
|
|
184
|
+
};
|
|
156
185
|
|
|
157
|
-
|
|
186
|
+
var _render5 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
187
|
+
renderOptionLabel: renderOptionLabel,
|
|
188
|
+
size: size
|
|
189
|
+
}))),
|
|
190
|
+
queryByText = _render5.queryByText;
|
|
191
|
+
|
|
192
|
+
items.forEach(function (item) {
|
|
193
|
+
var label = item.label;
|
|
194
|
+
|
|
195
|
+
if ((0, _utils.isCategory)(item)) {
|
|
196
|
+
item.items.forEach(function (_ref4) {
|
|
197
|
+
var subItemLabel = _ref4.label;
|
|
198
|
+
expect(queryByText("".concat(subItemLabel, " foo"))).toBeInTheDocument();
|
|
199
|
+
});
|
|
200
|
+
} else {
|
|
201
|
+
expect(queryByText("".concat(label, " foo"))).toBeInTheDocument();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
it('checks that labelDetails when provided ', function () {
|
|
206
|
+
var _render6 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
207
|
+
size: size
|
|
208
|
+
}))),
|
|
209
|
+
getByText = _render6.getByText;
|
|
158
210
|
|
|
159
|
-
|
|
160
|
-
key: 'ArrowUp'
|
|
211
|
+
expect(getByText('test detail label')).toBeInTheDocument();
|
|
161
212
|
});
|
|
213
|
+
it('navigates through the options with arrow keys', function () {
|
|
214
|
+
var _render7 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
215
|
+
size: size
|
|
216
|
+
}))),
|
|
217
|
+
getByText = _render7.getByText,
|
|
218
|
+
container = _render7.container;
|
|
162
219
|
|
|
163
|
-
|
|
164
|
-
});
|
|
165
|
-
it('selects an item with Enter or Space key', function () {
|
|
166
|
-
var onChange = jest.fn();
|
|
220
|
+
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
167
221
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
getByLabelText = _render4.getByLabelText,
|
|
172
|
-
container = _render4.container;
|
|
222
|
+
_react2.fireEvent.keyDown(container, {
|
|
223
|
+
key: 'Tab'
|
|
224
|
+
});
|
|
173
225
|
|
|
174
|
-
|
|
175
|
-
|
|
226
|
+
_react2.fireEvent.focus(optionsList); // default first element active
|
|
227
|
+
// check the active item with border style
|
|
176
228
|
|
|
177
|
-
_react2.fireEvent.keyDown(container, {
|
|
178
|
-
key: 'Tab'
|
|
179
|
-
});
|
|
180
229
|
|
|
181
|
-
|
|
230
|
+
expect(getByText(defaultProps.items[0].label).closest('.label')).toHaveStyle("\n border-color: ".concat((0, _toColorString.default)(_designTokens.color.interaction.pacificOcean), ";\n "));
|
|
182
231
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
232
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
233
|
+
key: 'ArrowDown'
|
|
234
|
+
});
|
|
186
235
|
|
|
187
|
-
|
|
188
|
-
key: 'Enter'
|
|
189
|
-
});
|
|
236
|
+
expect(getByText(defaultProps.items[1].label).closest('.label')).toHaveStyle("\n border-color: ".concat((0, _toColorString.default)(_designTokens.color.interaction.pacificOcean), ";\n "));
|
|
190
237
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
238
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
239
|
+
key: 'ArrowUp'
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
expect(getByText(defaultProps.items[0].label).closest('.label')).toHaveStyle("\n border-color: ".concat((0, _toColorString.default)(_designTokens.color.interaction.pacificOcean), ";\n "));
|
|
243
|
+
});
|
|
195
244
|
it('selects an item with Enter or Space key', function () {
|
|
196
245
|
var onChange = jest.fn();
|
|
197
|
-
var onlyDisabledItems = [{
|
|
198
|
-
id: '2',
|
|
199
|
-
label: 'Option 2',
|
|
200
|
-
value: '2',
|
|
201
|
-
disabled: true
|
|
202
|
-
}, {
|
|
203
|
-
id: disabledItemId,
|
|
204
|
-
label: disabledItemLabel,
|
|
205
|
-
value: '4',
|
|
206
|
-
disabled: true
|
|
207
|
-
}];
|
|
208
246
|
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
|
|
247
|
+
var _render8 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
248
|
+
onChange: onChange,
|
|
249
|
+
size: size
|
|
212
250
|
}))),
|
|
213
|
-
getByLabelText =
|
|
214
|
-
container =
|
|
251
|
+
getByLabelText = _render8.getByLabelText,
|
|
252
|
+
container = _render8.container;
|
|
215
253
|
|
|
254
|
+
var selectedItem = defaultProps.items[1];
|
|
216
255
|
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
217
256
|
|
|
218
257
|
_react2.fireEvent.keyDown(container, {
|
|
@@ -229,131 +268,235 @@ describe('OptionsList', function () {
|
|
|
229
268
|
key: 'Enter'
|
|
230
269
|
});
|
|
231
270
|
|
|
232
|
-
expect(onChange).
|
|
233
|
-
expect(
|
|
234
|
-
expect(getByLabelText(disabledItemLabel)).not.toBeChecked();
|
|
271
|
+
expect(onChange).toHaveBeenCalledWith(selectedItem.id);
|
|
272
|
+
expect(getByLabelText(selectedItem.label)).toBeChecked();
|
|
235
273
|
});
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
274
|
+
describe('selecting disabled element with keyboard', function () {
|
|
275
|
+
it('selects an item with Enter or Space key', function () {
|
|
276
|
+
var onChange = jest.fn();
|
|
277
|
+
var onlyDisabledItems = [{
|
|
278
|
+
id: '2',
|
|
279
|
+
label: 'Option 2',
|
|
280
|
+
value: '2',
|
|
281
|
+
disabled: true
|
|
282
|
+
}, {
|
|
283
|
+
id: disabledItemId,
|
|
284
|
+
label: disabledItemLabel,
|
|
285
|
+
value: '4',
|
|
286
|
+
disabled: true
|
|
287
|
+
}];
|
|
288
|
+
|
|
289
|
+
var _render9 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
290
|
+
items: onlyDisabledItems,
|
|
291
|
+
onChange: onChange,
|
|
292
|
+
size: size
|
|
293
|
+
}))),
|
|
294
|
+
getByLabelText = _render9.getByLabelText,
|
|
295
|
+
container = _render9.container;
|
|
246
296
|
|
|
247
|
-
|
|
297
|
+
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
248
298
|
|
|
249
|
-
|
|
299
|
+
_react2.fireEvent.keyDown(container, {
|
|
300
|
+
key: 'Tab'
|
|
301
|
+
});
|
|
250
302
|
|
|
251
|
-
|
|
252
|
-
var subItem = items[2].items[0];
|
|
303
|
+
_react2.fireEvent.focus(optionsList);
|
|
253
304
|
|
|
254
|
-
|
|
305
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
306
|
+
key: 'ArrowDown'
|
|
307
|
+
});
|
|
255
308
|
|
|
256
|
-
|
|
309
|
+
_react2.fireEvent.keyDown(optionsList, {
|
|
310
|
+
key: 'Enter'
|
|
311
|
+
});
|
|
257
312
|
|
|
258
|
-
|
|
313
|
+
expect(onChange).not.toHaveBeenCalledWith(disabledItemId);
|
|
314
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
315
|
+
expect(getByLabelText(disabledItemLabel)).not.toBeChecked();
|
|
316
|
+
});
|
|
259
317
|
});
|
|
260
|
-
describe('
|
|
261
|
-
it('
|
|
318
|
+
describe('single selection', function () {
|
|
319
|
+
it('calls onChange with id when item is clicked', function () {
|
|
262
320
|
var onChange = jest.fn();
|
|
263
321
|
|
|
264
|
-
var
|
|
265
|
-
onChange: onChange
|
|
322
|
+
var _render10 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
323
|
+
onChange: onChange,
|
|
324
|
+
size: size
|
|
266
325
|
}))),
|
|
267
|
-
getByText =
|
|
268
|
-
getByLabelText =
|
|
326
|
+
getByText = _render10.getByText,
|
|
327
|
+
getByLabelText = _render10.getByLabelText;
|
|
269
328
|
|
|
270
|
-
|
|
329
|
+
var item = items[0];
|
|
271
330
|
|
|
272
|
-
|
|
273
|
-
expect(onChange).not.toHaveBeenCalled(); // the item shouldn't be marked as selected
|
|
331
|
+
_react2.fireEvent.click(getByText(item.label));
|
|
274
332
|
|
|
275
|
-
expect(
|
|
333
|
+
expect(onChange).toHaveBeenLastCalledWith(item.id);
|
|
334
|
+
var subItem = items[2].items[0];
|
|
335
|
+
|
|
336
|
+
_react2.fireEvent.click(getByText(subItem.label));
|
|
337
|
+
|
|
338
|
+
expect(onChange).toHaveBeenLastCalledWith(subItem.id); // there should be an item marked as selected
|
|
339
|
+
|
|
340
|
+
expect(getByLabelText(subItem.label)).toBeChecked();
|
|
341
|
+
});
|
|
342
|
+
describe('disabled element', function () {
|
|
343
|
+
it('does not calls onChange when item is clicked', function () {
|
|
344
|
+
var onChange = jest.fn();
|
|
345
|
+
|
|
346
|
+
var _render11 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
347
|
+
onChange: onChange,
|
|
348
|
+
size: size
|
|
349
|
+
}))),
|
|
350
|
+
getByText = _render11.getByText,
|
|
351
|
+
getByLabelText = _render11.getByLabelText;
|
|
352
|
+
|
|
353
|
+
_react2.fireEvent.click(getByText(disabledItemLabel));
|
|
354
|
+
|
|
355
|
+
expect(onChange).not.toHaveBeenLastCalledWith(disabledItemId);
|
|
356
|
+
expect(onChange).not.toHaveBeenCalled(); // the item shouldn't be marked as selected
|
|
357
|
+
|
|
358
|
+
expect(getByLabelText(disabledItemLabel)).not.toBeChecked();
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
describe('controlled', function () {
|
|
362
|
+
it('prefers value over internal', function () {
|
|
363
|
+
var selected = items[1];
|
|
364
|
+
|
|
365
|
+
var _render12 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
366
|
+
selected: selected.id,
|
|
367
|
+
size: size
|
|
368
|
+
}))),
|
|
369
|
+
getByText = _render12.getByText,
|
|
370
|
+
getByLabelText = _render12.getByLabelText;
|
|
371
|
+
|
|
372
|
+
var item = items[0];
|
|
373
|
+
|
|
374
|
+
_react2.fireEvent.click(getByText(item.label));
|
|
375
|
+
|
|
376
|
+
expect(getByLabelText(item.label)).not.toBeChecked();
|
|
377
|
+
expect(getByLabelText(selected.label)).toBeChecked();
|
|
378
|
+
});
|
|
276
379
|
});
|
|
277
380
|
});
|
|
278
|
-
describe('
|
|
279
|
-
it('
|
|
280
|
-
var
|
|
381
|
+
describe('multi selection', function () {
|
|
382
|
+
it('calls onChange with array of selected ids when item is clicked', function () {
|
|
383
|
+
var onChange = jest.fn();
|
|
281
384
|
|
|
282
|
-
var
|
|
283
|
-
|
|
385
|
+
var _render13 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
386
|
+
onChange: onChange,
|
|
387
|
+
multiple: true,
|
|
388
|
+
size: size
|
|
284
389
|
}))),
|
|
285
|
-
getByText =
|
|
286
|
-
getByLabelText =
|
|
390
|
+
getByText = _render13.getByText,
|
|
391
|
+
getByLabelText = _render13.getByLabelText;
|
|
287
392
|
|
|
288
393
|
var item = items[0];
|
|
289
394
|
|
|
290
395
|
_react2.fireEvent.click(getByText(item.label));
|
|
291
396
|
|
|
292
|
-
expect(
|
|
293
|
-
|
|
397
|
+
expect(onChange).toHaveBeenLastCalledWith([item.id]);
|
|
398
|
+
var subItem = items[2].items[0];
|
|
399
|
+
|
|
400
|
+
_react2.fireEvent.click(getByText(subItem.label));
|
|
401
|
+
|
|
402
|
+
expect(onChange).toHaveBeenLastCalledWith([item.id, subItem.id]);
|
|
403
|
+
expect(getByLabelText(subItem.label)).toBeChecked();
|
|
404
|
+
expect(getByLabelText(item.label)).toBeChecked(); // second click unselects
|
|
405
|
+
|
|
406
|
+
_react2.fireEvent.click(getByText(item.label));
|
|
407
|
+
|
|
408
|
+
expect(onChange).toHaveBeenLastCalledWith([subItem.id]);
|
|
409
|
+
});
|
|
410
|
+
it('adds a footer with buttons when actions are provided', function () {
|
|
411
|
+
var onClick = jest.fn();
|
|
412
|
+
var actions = [{
|
|
413
|
+
id: '1',
|
|
414
|
+
text: 'apply',
|
|
415
|
+
onClick: onClick
|
|
416
|
+
}, {
|
|
417
|
+
id: '2',
|
|
418
|
+
text: 'cancel',
|
|
419
|
+
kind: 'secondary',
|
|
420
|
+
onClick: onClick
|
|
421
|
+
}, {
|
|
422
|
+
id: '3',
|
|
423
|
+
text: 'clear',
|
|
424
|
+
kind: 'secondary',
|
|
425
|
+
variant: 'ghost',
|
|
426
|
+
paddingLeft: 4,
|
|
427
|
+
onClick: onClick
|
|
428
|
+
}];
|
|
429
|
+
|
|
430
|
+
var _render14 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
431
|
+
actions: actions,
|
|
432
|
+
multiple: true,
|
|
433
|
+
size: size
|
|
434
|
+
}))),
|
|
435
|
+
baseElement = _render14.baseElement,
|
|
436
|
+
getByText = _render14.getByText;
|
|
437
|
+
|
|
438
|
+
actions.forEach(function (_ref5) {
|
|
439
|
+
var label = _ref5.text;
|
|
440
|
+
return expect(getByText(label)).toBeTruthy();
|
|
441
|
+
});
|
|
442
|
+
expect(baseElement).toMatchSnapshot();
|
|
294
443
|
});
|
|
295
444
|
});
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var onChange = jest.fn();
|
|
445
|
+
describe('drag and drop', function () {
|
|
446
|
+
it('has draggable attributes', function () {
|
|
447
|
+
var mockedFn = jest.fn();
|
|
300
448
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
getByLabelText = _render9.getByLabelText;
|
|
449
|
+
var _render15 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
450
|
+
size: size,
|
|
451
|
+
onDragEnd: mockedFn
|
|
452
|
+
}))),
|
|
453
|
+
getByText = _render15.getByText;
|
|
307
454
|
|
|
308
|
-
|
|
455
|
+
var item = items[0];
|
|
456
|
+
expect(getByText(item.label).closest('li')).toHaveAttribute('draggable');
|
|
457
|
+
var category = items[2];
|
|
458
|
+
category.items.forEach(function (subItem) {
|
|
459
|
+
expect(getByText(subItem.label).closest('li')).toHaveAttribute('draggable');
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
it('does not have draggable attributes when onDragEnd is not provided', function () {
|
|
463
|
+
var _render16 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
464
|
+
size: size
|
|
465
|
+
}))),
|
|
466
|
+
getByText = _render16.getByText;
|
|
467
|
+
|
|
468
|
+
var item = items[0];
|
|
469
|
+
expect(getByText(item.label).closest('li')).not.toHaveAttribute('draggable');
|
|
470
|
+
var category = items[2];
|
|
471
|
+
category.items.forEach(function (subItem) {
|
|
472
|
+
expect(getByText(subItem.label).closest('li')).not.toHaveAttribute('draggable');
|
|
473
|
+
});
|
|
474
|
+
}); // TODO: re-enable once migrated to pragmatic-drag-and-drop
|
|
309
475
|
|
|
310
|
-
|
|
476
|
+
it.skip('calls onDragEnd when drag ends', function () {
|
|
477
|
+
var mockedFn = jest.fn();
|
|
311
478
|
|
|
312
|
-
|
|
313
|
-
|
|
479
|
+
var _render17 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
480
|
+
size: size,
|
|
481
|
+
onDragEnd: mockedFn
|
|
482
|
+
}))),
|
|
483
|
+
getByText = _render17.getByText;
|
|
314
484
|
|
|
315
|
-
|
|
485
|
+
var draggableElement = getByText(items[0].label).closest('li');
|
|
486
|
+
var dropTarget = getByText('Option 2').closest('li');
|
|
316
487
|
|
|
317
|
-
|
|
318
|
-
expect(getByLabelText(subItem.label)).toBeChecked();
|
|
319
|
-
expect(getByLabelText(item.label)).toBeChecked(); // second click unselects
|
|
488
|
+
_react2.fireEvent.dragStart(draggableElement);
|
|
320
489
|
|
|
321
|
-
|
|
490
|
+
_react2.fireEvent.dragEnter(dropTarget);
|
|
322
491
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
id: '1',
|
|
329
|
-
text: 'apply',
|
|
330
|
-
onClick: onClick
|
|
331
|
-
}, {
|
|
332
|
-
id: '2',
|
|
333
|
-
text: 'cancel',
|
|
334
|
-
kind: 'secondary',
|
|
335
|
-
onClick: onClick
|
|
336
|
-
}, {
|
|
337
|
-
id: '3',
|
|
338
|
-
text: 'clear',
|
|
339
|
-
kind: 'secondary',
|
|
340
|
-
variant: 'ghost',
|
|
341
|
-
paddingLeft: 4,
|
|
342
|
-
onClick: onClick
|
|
343
|
-
}];
|
|
344
|
-
|
|
345
|
-
var _render10 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
346
|
-
actions: actions,
|
|
347
|
-
multiple: true
|
|
348
|
-
}))),
|
|
349
|
-
baseElement = _render10.baseElement,
|
|
350
|
-
getByText = _render10.getByText;
|
|
492
|
+
_react2.fireEvent.dragOver(dropTarget);
|
|
493
|
+
|
|
494
|
+
_react2.fireEvent.drop(dropTarget);
|
|
495
|
+
|
|
496
|
+
_react2.fireEvent.dragEnd(draggableElement);
|
|
351
497
|
|
|
352
|
-
|
|
353
|
-
var label = _ref5.text;
|
|
354
|
-
return expect(getByText(label)).toBeTruthy();
|
|
498
|
+
expect(mockedFn).toHaveBeenCalled();
|
|
355
499
|
});
|
|
356
|
-
expect(baseElement).toMatchSnapshot();
|
|
357
500
|
});
|
|
358
501
|
});
|
|
359
502
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;AAsFxD,eAAe,MAAM,CAAC"}
|
|
@@ -26,6 +26,7 @@ schema.makePropTypes = function () {
|
|
|
26
26
|
disabled: _reactDesc.PropTypes.bool,
|
|
27
27
|
id: _reactDesc.PropTypes.string,
|
|
28
28
|
label: _reactDesc.PropTypes.string.description('The label text for an option in the dropdown list.'),
|
|
29
|
+
labelDetails: _reactDesc.PropTypes.string.description('The secondary sub-text for an option in the dropdown list.'),
|
|
29
30
|
value: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.number, _reactDesc.PropTypes.string]).description('The value for an option in the dropdown list.')
|
|
30
31
|
})).description('The array of item data that will be rendered').isRequired,
|
|
31
32
|
minWidth: _reactDesc.PropTypes.string.description('A CSS min-width value to apply'),
|
|
@@ -36,9 +37,14 @@ schema.makePropTypes = function () {
|
|
|
36
37
|
onChange: _reactDesc.PropTypes.func.description('Change event handler, called with the selected id or array of the selected item IDs.'),
|
|
37
38
|
selected: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.string, _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.string)]).description('Used when component is controlled. Defines the item(s) selected in the options list.'),
|
|
38
39
|
renderOptionLabel: _reactDesc.PropTypes.func.description('Function to customize render of option labels, called with the item value.'),
|
|
40
|
+
pointerEvents: _reactDesc.PropTypes.string.description('Defines the value of pointer-events of the options.').defaultValue('none'),
|
|
39
41
|
selectable: _reactDesc.PropTypes.bool.description('Enables selection in the options list.').defaultValue(true),
|
|
40
42
|
role: _reactDesc.PropTypes.string.description('The role assigned to the list.').defaultValue('listbox'),
|
|
41
|
-
itemRole: _reactDesc.PropTypes.string.description('The role assigned to each item in the list.').defaultValue('option')
|
|
43
|
+
itemRole: _reactDesc.PropTypes.string.description('The role assigned to each item in the list.').defaultValue('option'),
|
|
44
|
+
size: _reactDesc.PropTypes.oneOf(['small', 'medium']).description('Defines the size of the OptionList').defaultValue('small'),
|
|
45
|
+
onDragEnd: _reactDesc.PropTypes.func.description("If present, enables Drag-and-Drop sorting. This function will be called after the order of rows changes when a row is dragged and dropped. It is called with 2 arguments: the index from where it's dragged, and the index to where it's dropped. If there are grouped rows then each argument is an array where the first element is the group index and the second the row index inside the group. See below for function signature."),
|
|
46
|
+
enableVirtualization: _reactDesc.PropTypes.bool.description('Enables virtualization of the options list for better performance with large datasets. When enabled, only visible items are rendered. For accurate virtualization, you should also provide the getItemHeight prop.'),
|
|
47
|
+
getItemHeight: _reactDesc.PropTypes.func.description('Function that returns the height in pixels for each item. When enableVirtualization is true, this should be provided to avoid relying on the internal default. Called with (item, size) and should return the height as a number.')
|
|
42
48
|
};
|
|
43
49
|
};
|
|
44
50
|
|