@decisiv/ui-components 2.0.1-alpha.21 → 2.0.1-alpha.211
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/BaseButton/index.d.ts.map +1 -1
- package/lib/atoms/BaseButton/index.js +1 -1
- package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/elements.js +8 -3
- package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/index.js +26 -5
- package/lib/atoms/BooleanInput/index.test.js +17 -6
- package/lib/atoms/BooleanInput/types.d.ts +4 -0
- package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
- package/lib/atoms/BooleanInput/types.js +5 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
- package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +46 -6
- package/lib/atoms/Calendar/index.test.js +68 -38
- package/lib/atoms/Calendar/types.d.ts +1 -1
- package/lib/atoms/Calendar/types.d.ts.map +1 -1
- package/lib/atoms/Calendar/types.js +5 -1
- package/lib/atoms/InputField/Containers.d.ts +12 -6
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +8 -6
- 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/InputLabel.d.ts +1 -0
- package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
- package/lib/atoms/InputField/InputLabel.js +2 -1
- package/lib/atoms/InputField/index.d.ts +8 -1
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +33 -9
- package/lib/atoms/InputField/index.test.js +144 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +3 -2
- 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.js → Category/index.js} +13 -21
- package/lib/atoms/OptionsList/Category/styles.d.ts +6 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/styles.js +36 -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 +172 -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.map +1 -1
- package/lib/atoms/OptionsList/index.js +20 -9
- package/lib/atoms/OptionsList/index.test.js +249 -156
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +4 -1
- package/lib/atoms/OptionsList/types.d.ts +25 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/OptionsList/types.js +5 -1
- package/lib/atoms/RequiredIcon.d.ts +9 -0
- package/lib/atoms/RequiredIcon.d.ts.map +1 -0
- package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
- package/lib/components/Accordion/types.js +5 -1
- package/lib/components/Accordion/useAccordion/types.js +5 -1
- 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 +39 -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/Avatar/types.js +5 -1
- package/lib/components/Badge/constants.d.ts +2 -0
- package/lib/components/Badge/constants.d.ts.map +1 -0
- package/lib/components/Badge/constants.js +29 -0
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +3 -70
- package/lib/components/Badge/index.test.js +62 -8
- package/lib/components/Badge/schema.d.ts.map +1 -1
- package/lib/components/Badge/schema.js +2 -1
- 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 +96 -0
- package/lib/components/Badge/types.d.ts +3 -2
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +7 -3
- package/lib/components/Breadcrumbs/types.js +5 -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/Button/types.js +5 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/CheckboxGroup/index.d.ts +1 -1
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +52 -14
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +231 -89
- package/lib/components/Combobox/index.test.js +425 -147
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +13 -3
- package/lib/components/Combobox/types.d.ts +13 -3
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/Combobox/types.js +5 -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 +115 -0
- package/lib/components/Drawer/index.test.js +139 -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 +1 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +70 -22
- package/lib/components/DropdownList/index.test.js +47 -15
- package/lib/components/DropdownList/propTypes.d.ts +4 -0
- package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
- package/lib/components/DropdownList/propTypes.js +42 -0
- package/lib/components/DropdownList/schema.d.ts.map +1 -1
- package/lib/components/DropdownList/schema.js +2 -1
- package/lib/components/DropdownList/types.d.ts +2 -0
- package/lib/components/DropdownList/types.d.ts.map +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 +197 -0
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
- package/lib/components/Filter/IconWrapper/index.js +35 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts +5 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +46 -0
- package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
- package/lib/components/Filter/StyledFilter.d.ts +4 -0
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
- package/lib/components/Filter/StyledFilter.js +66 -0
- package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
- package/lib/components/Filter/StyledLabel/index.js +38 -0
- package/lib/components/Filter/index.d.ts +6 -0
- package/lib/components/Filter/index.d.ts.map +1 -0
- package/lib/components/Filter/index.js +107 -0
- package/lib/components/Filter/index.test.js +70 -0
- package/lib/components/Filter/kind.d.ts +7 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +43 -0
- package/lib/components/Filter/schema.d.ts +9 -0
- package/lib/components/Filter/schema.d.ts.map +1 -0
- package/lib/components/Filter/schema.js +37 -0
- package/lib/components/Filter/types.d.ts +31 -0
- package/lib/components/Filter/types.d.ts.map +1 -0
- package/lib/components/Filter/types.js +5 -0
- package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +53 -12
- 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/types.js +5 -1
- package/lib/components/JumpTo/utils.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.js +3 -7
- package/lib/components/LeftNav/Item/ClickArea.js +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/ItemWrapper.js +3 -1
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
- package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
- package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
- package/lib/components/LeftNav/Item/types.d.ts +1 -1
- package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
- package/lib/components/LeftNav/Item/types.js +5 -1
- package/lib/components/LeftNav/index.test.js +13 -3
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +2 -0
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/LeftNav/types.js +5 -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 +20 -158
- package/lib/components/Link/index.test.js +63 -42
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +2 -1
- 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/Link/types.js +5 -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/Menu/types.js +5 -1
- 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 +201 -3
- 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 +89 -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/types.js +5 -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/Notifications/Notification/components.d.ts +3 -3
- package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/components.js +12 -6
- package/lib/components/Notifications/Notification/index.d.ts +3 -6
- package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
- package/lib/components/Notifications/Notification/index.js +19 -12
- package/lib/components/Notifications/Notification/index.test.js +38 -19
- package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
- package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
- package/lib/components/Notifications/NotificationsPanel/index.js +41 -22
- package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
- package/lib/components/Notifications/Notifier.test.js +79 -10
- package/lib/components/Notifications/constants.d.ts +2 -0
- package/lib/components/Notifications/constants.d.ts.map +1 -0
- package/lib/components/Notifications/constants.js +16 -0
- package/lib/components/Notifications/schema.d.ts.map +1 -1
- package/lib/components/Notifications/schema.js +2 -1
- package/lib/components/Notifications/useNotifications.d.ts +1 -0
- package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
- package/lib/components/Notifications/useNotifications.test.js +7 -4
- 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/Pagination/types.js +5 -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 +19 -8
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +27 -20
- package/lib/components/Popover/types.d.ts +4 -2
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/Popover/utils.d.ts +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 +176 -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 +37 -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 +38 -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 +6 -2
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +26 -3
- package/lib/components/Select/index.test.js +106 -23
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +5 -0
- package/lib/components/Select/types.d.ts +6 -3
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/Select/types.js +5 -1
- package/lib/components/SelectDate/Target.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +6 -2
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +35 -4
- package/lib/components/SelectDate/index.test.js +108 -51
- package/lib/components/SelectDate/schema.d.ts.map +1 -1
- package/lib/components/SelectDate/schema.js +3 -0
- package/lib/components/SelectDate/types.d.ts +3 -0
- package/lib/components/SelectDate/types.d.ts.map +1 -1
- package/lib/components/SelectDate/types.js +5 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +34 -3
- package/lib/components/SelectDateRange/index.test.js +115 -58
- package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
- package/lib/components/SelectDateRange/schema.js +3 -0
- package/lib/components/SelectDateRange/types.js +5 -1
- 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 +28 -17
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +6 -1
- package/lib/components/Table/DataRow.d.ts.map +1 -1
- package/lib/components/Table/DataRow.js +26 -18
- package/lib/components/Table/Head.d.ts +1 -1
- package/lib/components/Table/Head.d.ts.map +1 -1
- package/lib/components/Table/Head.js +10 -5
- package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/index.js +19 -6
- package/lib/components/Table/HeaderCell/types.d.ts +6 -1
- package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
- package/lib/components/Table/HeaderCell/types.js +5 -1
- package/lib/components/Table/Provider.d.ts +5 -5
- package/lib/components/Table/Provider.d.ts.map +1 -1
- package/lib/components/Table/Provider.js +10 -11
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js +110 -20
- package/lib/components/Table/index.test.js +80 -33
- package/lib/components/Table/schema.columns.d.ts.map +1 -1
- package/lib/components/Table/schema.columns.js +6 -4
- package/lib/components/Table/schema.d.ts.map +1 -1
- package/lib/components/Table/schema.js +7 -6
- package/lib/components/Table/types.d.ts +19 -4
- package/lib/components/Table/types.d.ts.map +1 -1
- package/lib/components/Table/utils.d.ts +2 -8
- package/lib/components/Table/utils.d.ts.map +1 -1
- package/lib/components/Table/utils.js +21 -20
- 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 +2 -0
- 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 +9 -10
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/Tag/types.js +5 -1
- package/lib/components/TagInput/index.d.ts +10 -0
- package/lib/components/TagInput/index.d.ts.map +1 -0
- package/lib/components/TagInput/index.js +217 -0
- package/lib/components/TagInput/index.test.js +1001 -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 +30 -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/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/index.js +1 -0
- package/lib/components/TextArea/index.test.js +5 -0
- package/lib/components/TextField/Input.js +1 -1
- package/lib/components/TextField/index.test.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 +6 -1
- package/lib/components/Toggle/index.test.js +39 -10
- 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/Toggle/types.js +5 -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 +24 -0
- package/lib/components/Wizard/index.d.ts.map +1 -0
- package/lib/components/Wizard/index.js +146 -0
- package/lib/components/Wizard/index.test.js +591 -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 +37 -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 +12 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +205 -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/index.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/index.js +5 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
- package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +42 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +43 -1
- package/lib/providers/NotificationsProvider/index.d.ts +6 -5
- package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
- package/lib/providers/NotificationsProvider/index.js +47 -28
- package/lib/providers/NotificationsProvider/types.d.ts +4 -1
- package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
- 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/joinClassnames.d.ts +3 -0
- package/lib/utils/joinClassnames.d.ts.map +1 -0
- package/lib/utils/joinClassnames.js +26 -0
- 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/useFirstMount.d.ts +2 -0
- package/lib/utils/useFirstMount.d.ts.map +1 -0
- package/lib/utils/useFirstMount.js +19 -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/lib/utils/useUpdateEffect.d.ts +4 -0
- package/lib/utils/useUpdateEffect.d.ts.map +1 -0
- package/lib/utils/useUpdateEffect.js +28 -0
- package/package.json +2 -2
- package/CHANGELOG.md +0 -796
- package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
- package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Category.d.ts +0 -4
- package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.js +0 -194
- 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/Tabs/types.js +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/{schema.tab.js → Tab/schema.js} +0 -0
|
@@ -0,0 +1,1001 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
|
|
13
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
|
+
|
|
15
|
+
var onChange = jest.fn();
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
onChange.mockClear();
|
|
18
|
+
});
|
|
19
|
+
describe('TagInput', function () {
|
|
20
|
+
it('renders label', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
21
|
+
var _render, getByText;
|
|
22
|
+
|
|
23
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
24
|
+
while (1) {
|
|
25
|
+
switch (_context.prev = _context.next) {
|
|
26
|
+
case 0:
|
|
27
|
+
_render = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
28
|
+
tags: [],
|
|
29
|
+
hideLabel: false,
|
|
30
|
+
label: "My Tag Input",
|
|
31
|
+
onChange: onChange
|
|
32
|
+
})), getByText = _render.getByText;
|
|
33
|
+
expect(getByText(/my tag input/i)).toBeInTheDocument();
|
|
34
|
+
|
|
35
|
+
case 2:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context.stop();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, _callee);
|
|
41
|
+
})));
|
|
42
|
+
it('renders help message', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
43
|
+
var _render2, getByText;
|
|
44
|
+
|
|
45
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
46
|
+
while (1) {
|
|
47
|
+
switch (_context2.prev = _context2.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_render2 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
50
|
+
tags: [],
|
|
51
|
+
hideLabel: false,
|
|
52
|
+
label: "My Tag Input",
|
|
53
|
+
helpMessage: "My Help Message",
|
|
54
|
+
onChange: onChange
|
|
55
|
+
})), getByText = _render2.getByText;
|
|
56
|
+
expect(getByText(/my help message/i)).toBeInTheDocument();
|
|
57
|
+
|
|
58
|
+
case 2:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context2.stop();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, _callee2);
|
|
64
|
+
})));
|
|
65
|
+
it('renders warning message', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
66
|
+
var _render3, getByText;
|
|
67
|
+
|
|
68
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
69
|
+
while (1) {
|
|
70
|
+
switch (_context3.prev = _context3.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
_render3 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
73
|
+
tags: [],
|
|
74
|
+
hideLabel: false,
|
|
75
|
+
label: "My Tag Input",
|
|
76
|
+
warningMessage: "My Warning Message",
|
|
77
|
+
onChange: onChange
|
|
78
|
+
})), getByText = _render3.getByText;
|
|
79
|
+
expect(getByText(/my warning message/i)).toBeInTheDocument();
|
|
80
|
+
|
|
81
|
+
case 2:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context3.stop();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, _callee3);
|
|
87
|
+
})));
|
|
88
|
+
describe('when input is uncontrolled', function () {
|
|
89
|
+
it('renders default tags', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
90
|
+
var _render4, getByText;
|
|
91
|
+
|
|
92
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
93
|
+
while (1) {
|
|
94
|
+
switch (_context4.prev = _context4.next) {
|
|
95
|
+
case 0:
|
|
96
|
+
_render4 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
97
|
+
defaultTags: ['Foo tag'],
|
|
98
|
+
label: "My Tag Input"
|
|
99
|
+
})), getByText = _render4.getByText;
|
|
100
|
+
expect(getByText(/Foo tag/i)).toBeInTheDocument();
|
|
101
|
+
|
|
102
|
+
case 2:
|
|
103
|
+
case "end":
|
|
104
|
+
return _context4.stop();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, _callee4);
|
|
108
|
+
})));
|
|
109
|
+
it('renders tag action button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
110
|
+
var _render5, getByLabelText;
|
|
111
|
+
|
|
112
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
113
|
+
while (1) {
|
|
114
|
+
switch (_context5.prev = _context5.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
_render5 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
117
|
+
defaultTags: ['My tag'],
|
|
118
|
+
label: "My Tag Input"
|
|
119
|
+
})), getByLabelText = _render5.getByLabelText;
|
|
120
|
+
expect(getByLabelText(/remove my tag/i)).toBeInTheDocument();
|
|
121
|
+
|
|
122
|
+
case 2:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context5.stop();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, _callee5);
|
|
128
|
+
})));
|
|
129
|
+
describe('when typing in input', function () {
|
|
130
|
+
describe('when hitting Enter', function () {
|
|
131
|
+
describe('when input has value', function () {
|
|
132
|
+
describe('when value is unique', function () {
|
|
133
|
+
it('adds tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
134
|
+
var _render6, getByLabelText;
|
|
135
|
+
|
|
136
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
137
|
+
while (1) {
|
|
138
|
+
switch (_context6.prev = _context6.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
_render6 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
141
|
+
defaultTags: ['Foo tag'],
|
|
142
|
+
label: "My Tag Input",
|
|
143
|
+
"aria-label": "My Tag Input"
|
|
144
|
+
})), getByLabelText = _render6.getByLabelText;
|
|
145
|
+
|
|
146
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
147
|
+
target: {
|
|
148
|
+
value: 'Bar tag'
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
153
|
+
key: 'Enter'
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
expect(getByLabelText('Remove Bar tag')).toBeInTheDocument();
|
|
157
|
+
|
|
158
|
+
case 4:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context6.stop();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, _callee6);
|
|
164
|
+
})));
|
|
165
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
|
|
166
|
+
var _render7, getByLabelText;
|
|
167
|
+
|
|
168
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
169
|
+
while (1) {
|
|
170
|
+
switch (_context7.prev = _context7.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
_render7 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
173
|
+
defaultTags: ['Foo tag'],
|
|
174
|
+
label: "My Tag Input",
|
|
175
|
+
"aria-label": "My Tag Input",
|
|
176
|
+
onChange: onChange
|
|
177
|
+
})), getByLabelText = _render7.getByLabelText;
|
|
178
|
+
|
|
179
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
180
|
+
target: {
|
|
181
|
+
value: 'Bar tag'
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
186
|
+
key: 'Enter'
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
|
|
190
|
+
|
|
191
|
+
case 4:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context7.stop();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, _callee7);
|
|
197
|
+
})));
|
|
198
|
+
});
|
|
199
|
+
describe('when value is not unique', function () {
|
|
200
|
+
it('does not add duplicated tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
|
|
201
|
+
var _render8, getAllByLabelText, getByLabelText;
|
|
202
|
+
|
|
203
|
+
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
204
|
+
while (1) {
|
|
205
|
+
switch (_context8.prev = _context8.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_render8 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
208
|
+
defaultTags: ['Foo tag'],
|
|
209
|
+
label: "My Tag Input",
|
|
210
|
+
"aria-label": "My Tag Input",
|
|
211
|
+
onChange: onChange
|
|
212
|
+
})), getAllByLabelText = _render8.getAllByLabelText, getByLabelText = _render8.getByLabelText;
|
|
213
|
+
|
|
214
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
215
|
+
target: {
|
|
216
|
+
value: 'Foo tag'
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
221
|
+
key: 'Enter'
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
expect(getAllByLabelText('Remove Foo tag').length).toBe(1);
|
|
225
|
+
|
|
226
|
+
case 4:
|
|
227
|
+
case "end":
|
|
228
|
+
return _context8.stop();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, _callee8);
|
|
232
|
+
})));
|
|
233
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
|
|
234
|
+
var _render9, getByLabelText;
|
|
235
|
+
|
|
236
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
237
|
+
while (1) {
|
|
238
|
+
switch (_context9.prev = _context9.next) {
|
|
239
|
+
case 0:
|
|
240
|
+
_render9 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
241
|
+
defaultTags: ['Foo tag'],
|
|
242
|
+
label: "My Tag Input",
|
|
243
|
+
"aria-label": "My Tag Input",
|
|
244
|
+
onChange: onChange
|
|
245
|
+
})), getByLabelText = _render9.getByLabelText;
|
|
246
|
+
|
|
247
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
248
|
+
target: {
|
|
249
|
+
value: 'Foo tag'
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
254
|
+
key: 'Enter'
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
258
|
+
|
|
259
|
+
case 4:
|
|
260
|
+
case "end":
|
|
261
|
+
return _context9.stop();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}, _callee9);
|
|
265
|
+
})));
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
describe('when input is blank', function () {
|
|
269
|
+
it('does not add blank tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
|
|
270
|
+
var _render10, queryByLabelText, getByLabelText;
|
|
271
|
+
|
|
272
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
273
|
+
while (1) {
|
|
274
|
+
switch (_context10.prev = _context10.next) {
|
|
275
|
+
case 0:
|
|
276
|
+
_render10 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
277
|
+
defaultTags: ['Foo tag'],
|
|
278
|
+
label: "My Tag Input",
|
|
279
|
+
"aria-label": "My Tag Input"
|
|
280
|
+
})), queryByLabelText = _render10.queryByLabelText, getByLabelText = _render10.getByLabelText;
|
|
281
|
+
|
|
282
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
283
|
+
target: {
|
|
284
|
+
value: ' '
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
289
|
+
key: 'Enter'
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
expect(queryByLabelText('Remove ')).not.toBeInTheDocument();
|
|
293
|
+
|
|
294
|
+
case 4:
|
|
295
|
+
case "end":
|
|
296
|
+
return _context10.stop();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}, _callee10);
|
|
300
|
+
})));
|
|
301
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
|
|
302
|
+
var _render11, getByLabelText;
|
|
303
|
+
|
|
304
|
+
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
305
|
+
while (1) {
|
|
306
|
+
switch (_context11.prev = _context11.next) {
|
|
307
|
+
case 0:
|
|
308
|
+
_render11 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
309
|
+
defaultTags: ['Foo tag'],
|
|
310
|
+
label: "My Tag Input",
|
|
311
|
+
"aria-label": "My Tag Input",
|
|
312
|
+
onChange: onChange
|
|
313
|
+
})), getByLabelText = _render11.getByLabelText;
|
|
314
|
+
|
|
315
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
316
|
+
target: {
|
|
317
|
+
value: ' '
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
322
|
+
key: 'Enter'
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
326
|
+
|
|
327
|
+
case 4:
|
|
328
|
+
case "end":
|
|
329
|
+
return _context11.stop();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}, _callee11);
|
|
333
|
+
})));
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
describe('when loose focus', function () {
|
|
337
|
+
describe('when input has value', function () {
|
|
338
|
+
describe('when value is unique', function () {
|
|
339
|
+
it('adds tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
|
|
340
|
+
var _render12, getByLabelText;
|
|
341
|
+
|
|
342
|
+
return regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
343
|
+
while (1) {
|
|
344
|
+
switch (_context12.prev = _context12.next) {
|
|
345
|
+
case 0:
|
|
346
|
+
_render12 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
347
|
+
defaultTags: ['Foo tag'],
|
|
348
|
+
label: "My Tag Input",
|
|
349
|
+
"aria-label": "My Tag Input",
|
|
350
|
+
onChange: onChange
|
|
351
|
+
})), getByLabelText = _render12.getByLabelText;
|
|
352
|
+
|
|
353
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
354
|
+
target: {
|
|
355
|
+
value: 'Bar tag'
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
360
|
+
|
|
361
|
+
expect(getByLabelText('Remove Bar tag')).toBeInTheDocument();
|
|
362
|
+
|
|
363
|
+
case 4:
|
|
364
|
+
case "end":
|
|
365
|
+
return _context12.stop();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}, _callee12);
|
|
369
|
+
})));
|
|
370
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
|
|
371
|
+
var _render13, getByLabelText;
|
|
372
|
+
|
|
373
|
+
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
374
|
+
while (1) {
|
|
375
|
+
switch (_context13.prev = _context13.next) {
|
|
376
|
+
case 0:
|
|
377
|
+
_render13 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
378
|
+
defaultTags: ['Foo tag'],
|
|
379
|
+
label: "My Tag Input",
|
|
380
|
+
"aria-label": "My Tag Input",
|
|
381
|
+
onChange: onChange
|
|
382
|
+
})), getByLabelText = _render13.getByLabelText;
|
|
383
|
+
|
|
384
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
385
|
+
target: {
|
|
386
|
+
value: 'Bar tag'
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
391
|
+
|
|
392
|
+
expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
|
|
393
|
+
|
|
394
|
+
case 4:
|
|
395
|
+
case "end":
|
|
396
|
+
return _context13.stop();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}, _callee13);
|
|
400
|
+
})));
|
|
401
|
+
});
|
|
402
|
+
describe('when value is not unique', function () {
|
|
403
|
+
it('does not add duplicated tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
|
|
404
|
+
var _render14, getAllByLabelText, getByLabelText;
|
|
405
|
+
|
|
406
|
+
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
407
|
+
while (1) {
|
|
408
|
+
switch (_context14.prev = _context14.next) {
|
|
409
|
+
case 0:
|
|
410
|
+
_render14 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
411
|
+
defaultTags: ['Foo tag'],
|
|
412
|
+
label: "My Tag Input",
|
|
413
|
+
"aria-label": "My Tag Input",
|
|
414
|
+
onChange: onChange
|
|
415
|
+
})), getAllByLabelText = _render14.getAllByLabelText, getByLabelText = _render14.getByLabelText;
|
|
416
|
+
|
|
417
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
418
|
+
target: {
|
|
419
|
+
value: 'Foo tag'
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
424
|
+
|
|
425
|
+
expect(getAllByLabelText('Remove Foo tag').length).toBe(1);
|
|
426
|
+
|
|
427
|
+
case 4:
|
|
428
|
+
case "end":
|
|
429
|
+
return _context14.stop();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}, _callee14);
|
|
433
|
+
})));
|
|
434
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
|
|
435
|
+
var _render15, getByLabelText;
|
|
436
|
+
|
|
437
|
+
return regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
438
|
+
while (1) {
|
|
439
|
+
switch (_context15.prev = _context15.next) {
|
|
440
|
+
case 0:
|
|
441
|
+
_render15 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
442
|
+
defaultTags: ['Foo tag'],
|
|
443
|
+
label: "My Tag Input",
|
|
444
|
+
"aria-label": "My Tag Input",
|
|
445
|
+
onChange: onChange
|
|
446
|
+
})), getByLabelText = _render15.getByLabelText;
|
|
447
|
+
|
|
448
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
449
|
+
target: {
|
|
450
|
+
value: 'Foo tag'
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
455
|
+
|
|
456
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
457
|
+
|
|
458
|
+
case 4:
|
|
459
|
+
case "end":
|
|
460
|
+
return _context15.stop();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}, _callee15);
|
|
464
|
+
})));
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
describe('when input is blank', function () {
|
|
468
|
+
it('does not add blank tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
|
|
469
|
+
var _render16, queryByLabelText, getByLabelText;
|
|
470
|
+
|
|
471
|
+
return regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
472
|
+
while (1) {
|
|
473
|
+
switch (_context16.prev = _context16.next) {
|
|
474
|
+
case 0:
|
|
475
|
+
_render16 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
476
|
+
defaultTags: ['Foo tag'],
|
|
477
|
+
label: "My Tag Input",
|
|
478
|
+
"aria-label": "My Tag Input"
|
|
479
|
+
})), queryByLabelText = _render16.queryByLabelText, getByLabelText = _render16.getByLabelText;
|
|
480
|
+
|
|
481
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
482
|
+
target: {
|
|
483
|
+
value: ' '
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
488
|
+
|
|
489
|
+
expect(queryByLabelText('Remove ')).not.toBeInTheDocument();
|
|
490
|
+
|
|
491
|
+
case 4:
|
|
492
|
+
case "end":
|
|
493
|
+
return _context16.stop();
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}, _callee16);
|
|
497
|
+
})));
|
|
498
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
|
|
499
|
+
var _render17, getByLabelText;
|
|
500
|
+
|
|
501
|
+
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
502
|
+
while (1) {
|
|
503
|
+
switch (_context17.prev = _context17.next) {
|
|
504
|
+
case 0:
|
|
505
|
+
_render17 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
506
|
+
defaultTags: ['Foo tag'],
|
|
507
|
+
label: "My Tag Input",
|
|
508
|
+
"aria-label": "My Tag Input",
|
|
509
|
+
onChange: onChange
|
|
510
|
+
})), getByLabelText = _render17.getByLabelText;
|
|
511
|
+
|
|
512
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
513
|
+
target: {
|
|
514
|
+
value: ' '
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
519
|
+
|
|
520
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
521
|
+
|
|
522
|
+
case 4:
|
|
523
|
+
case "end":
|
|
524
|
+
return _context17.stop();
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}, _callee17);
|
|
528
|
+
})));
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
describe('when hitting Backspace', function () {
|
|
532
|
+
describe('when input has value', function () {
|
|
533
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
|
|
534
|
+
var _render18, getByLabelText;
|
|
535
|
+
|
|
536
|
+
return regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
537
|
+
while (1) {
|
|
538
|
+
switch (_context18.prev = _context18.next) {
|
|
539
|
+
case 0:
|
|
540
|
+
_render18 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
541
|
+
defaultTags: ['Foo tag'],
|
|
542
|
+
label: "My Tag Input",
|
|
543
|
+
"aria-label": "My Tag Input",
|
|
544
|
+
onChange: onChange
|
|
545
|
+
})), getByLabelText = _render18.getByLabelText;
|
|
546
|
+
|
|
547
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
548
|
+
target: {
|
|
549
|
+
value: 'something'
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
554
|
+
key: 'Backspace'
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
558
|
+
|
|
559
|
+
case 4:
|
|
560
|
+
case "end":
|
|
561
|
+
return _context18.stop();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}, _callee18);
|
|
565
|
+
})));
|
|
566
|
+
});
|
|
567
|
+
describe('when input value is blank', function () {
|
|
568
|
+
it('removes tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
|
|
569
|
+
var _render19, getByLabelText, queryByLabelText;
|
|
570
|
+
|
|
571
|
+
return regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
572
|
+
while (1) {
|
|
573
|
+
switch (_context19.prev = _context19.next) {
|
|
574
|
+
case 0:
|
|
575
|
+
_render19 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
576
|
+
defaultTags: ['Foo tag'],
|
|
577
|
+
label: "My Tag Input",
|
|
578
|
+
"aria-label": "My Tag Input",
|
|
579
|
+
onChange: onChange
|
|
580
|
+
})), getByLabelText = _render19.getByLabelText, queryByLabelText = _render19.queryByLabelText;
|
|
581
|
+
|
|
582
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
583
|
+
key: 'Backspace'
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
expect(queryByLabelText('Remove Foo tag')).not.toBeInTheDocument();
|
|
587
|
+
|
|
588
|
+
case 3:
|
|
589
|
+
case "end":
|
|
590
|
+
return _context19.stop();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}, _callee19);
|
|
594
|
+
})));
|
|
595
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() {
|
|
596
|
+
var _render20, getByLabelText;
|
|
597
|
+
|
|
598
|
+
return regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
599
|
+
while (1) {
|
|
600
|
+
switch (_context20.prev = _context20.next) {
|
|
601
|
+
case 0:
|
|
602
|
+
_render20 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
603
|
+
defaultTags: ['Foo tag'],
|
|
604
|
+
label: "My Tag Input",
|
|
605
|
+
"aria-label": "My Tag Input",
|
|
606
|
+
onChange: onChange
|
|
607
|
+
})), getByLabelText = _render20.getByLabelText;
|
|
608
|
+
|
|
609
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
610
|
+
key: 'Backspace'
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
expect(onChange).toHaveBeenCalledWith([]);
|
|
614
|
+
|
|
615
|
+
case 3:
|
|
616
|
+
case "end":
|
|
617
|
+
return _context20.stop();
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}, _callee20);
|
|
621
|
+
})));
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
});
|
|
625
|
+
describe("when clicking on tag's action button", function () {
|
|
626
|
+
it('removes tag', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() {
|
|
627
|
+
var _render21, getByLabelText, queryByLabelText;
|
|
628
|
+
|
|
629
|
+
return regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
630
|
+
while (1) {
|
|
631
|
+
switch (_context21.prev = _context21.next) {
|
|
632
|
+
case 0:
|
|
633
|
+
_render21 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
634
|
+
defaultTags: ['Foo tag'],
|
|
635
|
+
label: "My Tag Input",
|
|
636
|
+
"aria-label": "My Tag Input",
|
|
637
|
+
onChange: onChange
|
|
638
|
+
})), getByLabelText = _render21.getByLabelText, queryByLabelText = _render21.queryByLabelText;
|
|
639
|
+
|
|
640
|
+
_react2.fireEvent.click(getByLabelText('Remove Foo tag'));
|
|
641
|
+
|
|
642
|
+
expect(queryByLabelText('Remove Foo tag')).not.toBeInTheDocument();
|
|
643
|
+
|
|
644
|
+
case 3:
|
|
645
|
+
case "end":
|
|
646
|
+
return _context21.stop();
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}, _callee21);
|
|
650
|
+
})));
|
|
651
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
|
|
652
|
+
var _render22, getByLabelText, queryByLabelText;
|
|
653
|
+
|
|
654
|
+
return regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
655
|
+
while (1) {
|
|
656
|
+
switch (_context22.prev = _context22.next) {
|
|
657
|
+
case 0:
|
|
658
|
+
_render22 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
659
|
+
defaultTags: ['Foo tag'],
|
|
660
|
+
label: "My Tag Input",
|
|
661
|
+
"aria-label": "My Tag Input",
|
|
662
|
+
onChange: onChange
|
|
663
|
+
})), getByLabelText = _render22.getByLabelText, queryByLabelText = _render22.queryByLabelText;
|
|
664
|
+
|
|
665
|
+
_react2.fireEvent.click(getByLabelText('Remove Foo tag'));
|
|
666
|
+
|
|
667
|
+
expect(onChange).toHaveBeenCalledWith([]);
|
|
668
|
+
|
|
669
|
+
case 3:
|
|
670
|
+
case "end":
|
|
671
|
+
return _context22.stop();
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}, _callee22);
|
|
675
|
+
})));
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
describe('when input is controlled', function () {
|
|
679
|
+
describe('when typing in input', function () {
|
|
680
|
+
describe('when hitting Enter', function () {
|
|
681
|
+
describe('when input has value', function () {
|
|
682
|
+
describe('when value is unique', function () {
|
|
683
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23() {
|
|
684
|
+
var _render23, getByLabelText;
|
|
685
|
+
|
|
686
|
+
return regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
687
|
+
while (1) {
|
|
688
|
+
switch (_context23.prev = _context23.next) {
|
|
689
|
+
case 0:
|
|
690
|
+
_render23 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
691
|
+
tags: ['Foo tag'],
|
|
692
|
+
label: "My Tag Input",
|
|
693
|
+
"aria-label": "My Tag Input",
|
|
694
|
+
onChange: onChange
|
|
695
|
+
})), getByLabelText = _render23.getByLabelText;
|
|
696
|
+
|
|
697
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
698
|
+
target: {
|
|
699
|
+
value: 'Bar tag'
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
704
|
+
key: 'Enter'
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
|
|
708
|
+
|
|
709
|
+
case 4:
|
|
710
|
+
case "end":
|
|
711
|
+
return _context23.stop();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}, _callee23);
|
|
715
|
+
})));
|
|
716
|
+
});
|
|
717
|
+
describe('when value is not unique', function () {
|
|
718
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24() {
|
|
719
|
+
var _render24, getByLabelText;
|
|
720
|
+
|
|
721
|
+
return regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
722
|
+
while (1) {
|
|
723
|
+
switch (_context24.prev = _context24.next) {
|
|
724
|
+
case 0:
|
|
725
|
+
_render24 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
726
|
+
tags: ['Foo tag'],
|
|
727
|
+
label: "My Tag Input",
|
|
728
|
+
"aria-label": "My Tag Input",
|
|
729
|
+
onChange: onChange
|
|
730
|
+
})), getByLabelText = _render24.getByLabelText;
|
|
731
|
+
|
|
732
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
733
|
+
target: {
|
|
734
|
+
value: 'Foo tag'
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
739
|
+
key: 'Enter'
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
743
|
+
|
|
744
|
+
case 4:
|
|
745
|
+
case "end":
|
|
746
|
+
return _context24.stop();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}, _callee24);
|
|
750
|
+
})));
|
|
751
|
+
});
|
|
752
|
+
});
|
|
753
|
+
describe('when input is blank', function () {
|
|
754
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25() {
|
|
755
|
+
var _render25, getByLabelText;
|
|
756
|
+
|
|
757
|
+
return regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
758
|
+
while (1) {
|
|
759
|
+
switch (_context25.prev = _context25.next) {
|
|
760
|
+
case 0:
|
|
761
|
+
_render25 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
762
|
+
tags: ['Foo tag'],
|
|
763
|
+
label: "My Tag Input",
|
|
764
|
+
"aria-label": "My Tag Input",
|
|
765
|
+
onChange: onChange
|
|
766
|
+
})), getByLabelText = _render25.getByLabelText;
|
|
767
|
+
|
|
768
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
769
|
+
target: {
|
|
770
|
+
value: ' '
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
775
|
+
key: 'Enter'
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
779
|
+
|
|
780
|
+
case 4:
|
|
781
|
+
case "end":
|
|
782
|
+
return _context25.stop();
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}, _callee25);
|
|
786
|
+
})));
|
|
787
|
+
});
|
|
788
|
+
});
|
|
789
|
+
describe('when loose focus', function () {
|
|
790
|
+
describe('when input has value', function () {
|
|
791
|
+
describe('when value is unique', function () {
|
|
792
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26() {
|
|
793
|
+
var _render26, getByLabelText;
|
|
794
|
+
|
|
795
|
+
return regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
796
|
+
while (1) {
|
|
797
|
+
switch (_context26.prev = _context26.next) {
|
|
798
|
+
case 0:
|
|
799
|
+
_render26 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
800
|
+
tags: ['Foo tag'],
|
|
801
|
+
label: "My Tag Input",
|
|
802
|
+
"aria-label": "My Tag Input",
|
|
803
|
+
onChange: onChange
|
|
804
|
+
})), getByLabelText = _render26.getByLabelText;
|
|
805
|
+
|
|
806
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
807
|
+
target: {
|
|
808
|
+
value: 'Bar tag'
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
813
|
+
|
|
814
|
+
expect(onChange).toHaveBeenCalledWith(['Foo tag', 'Bar tag']);
|
|
815
|
+
|
|
816
|
+
case 4:
|
|
817
|
+
case "end":
|
|
818
|
+
return _context26.stop();
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}, _callee26);
|
|
822
|
+
})));
|
|
823
|
+
});
|
|
824
|
+
describe('when value is not unique', function () {
|
|
825
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee27() {
|
|
826
|
+
var _render27, getByLabelText;
|
|
827
|
+
|
|
828
|
+
return regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
829
|
+
while (1) {
|
|
830
|
+
switch (_context27.prev = _context27.next) {
|
|
831
|
+
case 0:
|
|
832
|
+
_render27 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
833
|
+
tags: ['Foo tag'],
|
|
834
|
+
label: "My Tag Input",
|
|
835
|
+
"aria-label": "My Tag Input",
|
|
836
|
+
onChange: onChange
|
|
837
|
+
})), getByLabelText = _render27.getByLabelText;
|
|
838
|
+
|
|
839
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
840
|
+
target: {
|
|
841
|
+
value: 'Foo tag'
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
846
|
+
|
|
847
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
848
|
+
|
|
849
|
+
case 4:
|
|
850
|
+
case "end":
|
|
851
|
+
return _context27.stop();
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}, _callee27);
|
|
855
|
+
})));
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
describe('when input is blank', function () {
|
|
859
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee28() {
|
|
860
|
+
var _render28, getByLabelText;
|
|
861
|
+
|
|
862
|
+
return regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
863
|
+
while (1) {
|
|
864
|
+
switch (_context28.prev = _context28.next) {
|
|
865
|
+
case 0:
|
|
866
|
+
_render28 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
867
|
+
tags: ['Foo tag'],
|
|
868
|
+
label: "My Tag Input",
|
|
869
|
+
"aria-label": "My Tag Input",
|
|
870
|
+
onChange: onChange
|
|
871
|
+
})), getByLabelText = _render28.getByLabelText;
|
|
872
|
+
|
|
873
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
874
|
+
target: {
|
|
875
|
+
value: ' '
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
_react2.fireEvent.blur(getByLabelText('My Tag Input'));
|
|
880
|
+
|
|
881
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
882
|
+
|
|
883
|
+
case 4:
|
|
884
|
+
case "end":
|
|
885
|
+
return _context28.stop();
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}, _callee28);
|
|
889
|
+
})));
|
|
890
|
+
});
|
|
891
|
+
});
|
|
892
|
+
describe('when hitting Backspace', function () {
|
|
893
|
+
describe('when input has value', function () {
|
|
894
|
+
it('does not call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee29() {
|
|
895
|
+
var _render29, getByLabelText;
|
|
896
|
+
|
|
897
|
+
return regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
898
|
+
while (1) {
|
|
899
|
+
switch (_context29.prev = _context29.next) {
|
|
900
|
+
case 0:
|
|
901
|
+
_render29 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
902
|
+
defaultTags: ['Foo tag'],
|
|
903
|
+
label: "My Tag Input",
|
|
904
|
+
"aria-label": "My Tag Input",
|
|
905
|
+
onChange: onChange
|
|
906
|
+
})), getByLabelText = _render29.getByLabelText;
|
|
907
|
+
|
|
908
|
+
_react2.fireEvent.change(getByLabelText('My Tag Input'), {
|
|
909
|
+
target: {
|
|
910
|
+
value: 'something'
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
915
|
+
key: 'Backspace'
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
919
|
+
|
|
920
|
+
case 4:
|
|
921
|
+
case "end":
|
|
922
|
+
return _context29.stop();
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}, _callee29);
|
|
926
|
+
})));
|
|
927
|
+
});
|
|
928
|
+
describe('when input value is blank', function () {
|
|
929
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee30() {
|
|
930
|
+
return regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
931
|
+
while (1) {
|
|
932
|
+
switch (_context30.prev = _context30.next) {
|
|
933
|
+
case 0:
|
|
934
|
+
case "end":
|
|
935
|
+
return _context30.stop();
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}, _callee30);
|
|
939
|
+
})));
|
|
940
|
+
});
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
describe("when clicking on tag's action button", function () {
|
|
944
|
+
it('call onChange callback', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee31() {
|
|
945
|
+
var _render30, getByLabelText;
|
|
946
|
+
|
|
947
|
+
return regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
948
|
+
while (1) {
|
|
949
|
+
switch (_context31.prev = _context31.next) {
|
|
950
|
+
case 0:
|
|
951
|
+
_render30 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
952
|
+
tags: ['Foo tag'],
|
|
953
|
+
label: "My Tag Input",
|
|
954
|
+
"aria-label": "My Tag Input",
|
|
955
|
+
onChange: onChange
|
|
956
|
+
})), getByLabelText = _render30.getByLabelText;
|
|
957
|
+
|
|
958
|
+
_react2.fireEvent.keyUp(getByLabelText('My Tag Input'), {
|
|
959
|
+
key: 'Backspace'
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
expect(onChange).toHaveBeenCalledWith([]);
|
|
963
|
+
|
|
964
|
+
case 3:
|
|
965
|
+
case "end":
|
|
966
|
+
return _context31.stop();
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}, _callee31);
|
|
970
|
+
})));
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
describe('when input is disabled', function () {
|
|
974
|
+
it('suppress tag click event', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee32() {
|
|
975
|
+
var _render31, getByLabelText;
|
|
976
|
+
|
|
977
|
+
return regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
978
|
+
while (1) {
|
|
979
|
+
switch (_context32.prev = _context32.next) {
|
|
980
|
+
case 0:
|
|
981
|
+
_render31 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
982
|
+
tags: ['Foo tag'],
|
|
983
|
+
label: "My Tag Input",
|
|
984
|
+
"aria-label": "My Tag Input",
|
|
985
|
+
onChange: onChange,
|
|
986
|
+
disabled: true
|
|
987
|
+
})), getByLabelText = _render31.getByLabelText;
|
|
988
|
+
|
|
989
|
+
_react2.fireEvent.click(getByLabelText('Remove Foo tag'));
|
|
990
|
+
|
|
991
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
992
|
+
|
|
993
|
+
case 3:
|
|
994
|
+
case "end":
|
|
995
|
+
return _context32.stop();
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}, _callee32);
|
|
999
|
+
})));
|
|
1000
|
+
});
|
|
1001
|
+
});
|