@decisiv/ui-components 2.0.1-alpha.21 → 2.0.1-alpha.210
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 +19 -0
- package/lib/components/List/ContentContainer/index.d.ts.map +1 -0
- package/lib/components/List/ContentContainer/index.js +78 -0
- package/lib/components/List/ContentContainer/index.test.js +102 -0
- package/lib/components/List/DefaultCell/index.d.ts +7 -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/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 +41 -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 +14 -0
- package/lib/components/List/constants.d.ts.map +1 -0
- package/lib/components/List/constants.js +22 -0
- package/lib/components/List/index.d.ts +14 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +64 -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 +14 -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/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 +350 -2
- 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,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultProps = exports.propTypes = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var propTypes = {
|
|
13
|
+
'aria-label': _propTypes.default.string,
|
|
14
|
+
description: _propTypes.default.string,
|
|
15
|
+
dismissable: _propTypes.default.bool,
|
|
16
|
+
icon: _propTypes.default.element,
|
|
17
|
+
intent: _propTypes.default.oneOf(['information', 'success', 'warning', 'danger']),
|
|
18
|
+
title: _propTypes.default.string.isRequired,
|
|
19
|
+
onDismissClick: _propTypes.default.func,
|
|
20
|
+
tooltipText: _propTypes.default.string
|
|
21
|
+
};
|
|
22
|
+
exports.propTypes = propTypes;
|
|
23
|
+
var defaultProps = {
|
|
24
|
+
'aria-label': undefined,
|
|
25
|
+
description: undefined,
|
|
26
|
+
dismissable: false,
|
|
27
|
+
icon: undefined,
|
|
28
|
+
intent: 'information',
|
|
29
|
+
onDismissClick: undefined,
|
|
30
|
+
tooltipText: undefined
|
|
31
|
+
};
|
|
32
|
+
exports.defaultProps = defaultProps;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const kindModifiers: {
|
|
3
|
-
readonly primary: () => CSS;
|
|
4
|
-
readonly secondary: () => CSS;
|
|
5
|
-
};
|
|
6
|
-
declare const sizeModifiers: {
|
|
7
|
-
readonly medium: () => CSS;
|
|
8
|
-
readonly large: () => CSS;
|
|
9
|
-
};
|
|
10
|
-
interface AvatarContainerProps {
|
|
11
|
-
kind?: keyof typeof kindModifiers;
|
|
12
|
-
size?: keyof typeof sizeModifiers;
|
|
13
|
-
}
|
|
1
|
+
import { AvatarContainerProps } from './types';
|
|
14
2
|
declare const AvatarContainer: import("styled-components").StyledComponent<"div", any, AvatarContainerProps, never>;
|
|
15
3
|
export default AvatarContainer;
|
|
16
4
|
//# sourceMappingURL=AvatarContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/AvatarContainer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/AvatarContainer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAoC/C,QAAA,MAAM,eAAe,sFAkBpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -17,25 +17,18 @@ var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"))
|
|
|
17
17
|
|
|
18
18
|
var _typography = _interopRequireDefault(require("@decisiv/design-tokens/lib/typography"));
|
|
19
19
|
|
|
20
|
+
var _palette = require("../../modifiers/palette");
|
|
21
|
+
|
|
20
22
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
|
-
var status = _color.default.status
|
|
25
|
-
visualInterest = _color.default.visualInterest;
|
|
26
|
-
var kindModifiers = {
|
|
27
|
-
primary: function primary() {
|
|
28
|
-
return (0, _styledComponents.css)(["background-color:", ";"], (0, _toColorString.default)(status.information.medium));
|
|
29
|
-
},
|
|
30
|
-
secondary: function secondary() {
|
|
31
|
-
return (0, _styledComponents.css)(["background-color:", ";"], (0, _toColorString.default)(visualInterest.licoriceMousse.medium));
|
|
32
|
-
}
|
|
33
|
-
};
|
|
26
|
+
var status = _color.default.status;
|
|
34
27
|
|
|
35
28
|
var makeSizeModifiers = function makeSizeModifiers(_ref) {
|
|
36
29
|
var size = _ref.size,
|
|
37
30
|
typeScale = _ref.typeScale;
|
|
38
|
-
return (0, _styledComponents.css)(["font-size:", ";height:", ";min-height:", ";width:", ";min-width:", ";"], (0, _rem.default)(_typography.default.size.scale[typeScale]), (0, _rem.default)(size), (0, _rem.default)(size), (0, _rem.default)(size), (0, _rem.default)(size));
|
|
31
|
+
return (0, _styledComponents.css)(["font-weight:", ";font-size:", ";height:", ";min-height:", ";width:", ";min-width:", ";"], _typography.default.weight.alias.regular, (0, _rem.default)(_typography.default.size.scale[typeScale]), (0, _rem.default)(size), (0, _rem.default)(size), (0, _rem.default)(size), (0, _rem.default)(size));
|
|
39
32
|
};
|
|
40
33
|
|
|
41
34
|
var sizeModifiers = {
|
|
@@ -48,15 +41,21 @@ var sizeModifiers = {
|
|
|
48
41
|
large: function large() {
|
|
49
42
|
return makeSizeModifiers({
|
|
50
43
|
size: 60,
|
|
51
|
-
typeScale:
|
|
44
|
+
typeScale: 3
|
|
52
45
|
});
|
|
53
46
|
}
|
|
54
47
|
};
|
|
55
48
|
|
|
49
|
+
var withGravatarModifiers = function withGravatarModifiers(props) {
|
|
50
|
+
var shouldUseGravatar = props.shouldUseGravatar;
|
|
51
|
+
if (!shouldUseGravatar) return null;
|
|
52
|
+
return (0, _styledComponents.css)(["color:transparent;background-color:transparent;border:none;"]);
|
|
53
|
+
};
|
|
54
|
+
|
|
56
55
|
var AvatarContainer = _styledComponents.default.div.withConfig({
|
|
57
56
|
displayName: "AvatarContainer",
|
|
58
57
|
componentId: "sc-16avffw-0"
|
|
59
|
-
})(["position:relative;align-items:center;background-color:", ";border-radius:50%;display:inline-flex;height:", ";justify-content:center;width:", ";> span[role='img']{line-height:0;}", ";", ";"], (0, _toColorString.default)(status.information.medium), (0, _rem.default)(36), (0, _rem.default)(36), (0, _styledComponentsModifiers.applyStyleModifiers)(
|
|
58
|
+
})(["position:relative;align-items:center;background-color:", ";border-radius:50%;display:inline-flex;height:", ";justify-content:center;width:", ";> span[role='img']{line-height:0;}", ";", ";", ""], (0, _toColorString.default)(status.information.medium), (0, _rem.default)(36), (0, _rem.default)(36), (0, _styledComponentsModifiers.applyStyleModifiers)(sizeModifiers, 'size'), _palette.withBorderedPalette, withGravatarModifiers);
|
|
60
59
|
|
|
61
60
|
var _default = AvatarContainer;
|
|
62
61
|
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare function AvatarContent(props:
|
|
2
|
+
import { AvatarContentProps } from './types';
|
|
3
|
+
declare function AvatarContent(props: AvatarContentProps): JSX.Element;
|
|
4
4
|
export default AvatarContent;
|
|
5
5
|
//# sourceMappingURL=AvatarContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarContent.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/AvatarContent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AvatarContent.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/AvatarContent.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA8B7C,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAkB7D;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -5,61 +5,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
11
|
|
|
14
|
-
var
|
|
12
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
13
|
+
|
|
14
|
+
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
15
15
|
|
|
16
16
|
var _Typography = require("../Typography");
|
|
17
17
|
|
|
18
18
|
var _useAvatarIcon = _interopRequireDefault(require("./hooks/useAvatarIcon"));
|
|
19
19
|
|
|
20
|
-
var _useGravatar3 = _interopRequireDefault(require("./hooks/useGravatar"));
|
|
21
|
-
|
|
22
20
|
var _useInitials = _interopRequireDefault(require("./hooks/useInitials"));
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
var _palette = require("../../modifiers/palette");
|
|
25
23
|
|
|
26
|
-
function
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
25
|
|
|
28
|
-
function
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
29
27
|
|
|
30
|
-
function
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
29
|
|
|
32
|
-
function
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
31
|
|
|
34
32
|
var GravatarImg = _styledComponents.default.img.withConfig({
|
|
35
33
|
displayName: "AvatarContent__GravatarImg",
|
|
36
34
|
componentId: "sc-1jejgqy-0"
|
|
37
35
|
})(["border-radius:50%;width:100%;"]);
|
|
38
36
|
|
|
37
|
+
var borderColor = _objectSpread({}, _color.default.base.charcoal, {
|
|
38
|
+
alpha: _palette.BORDER_OPACITY.pastel
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var GravatarShadow = _styledComponents.default.div.withConfig({
|
|
42
|
+
displayName: "AvatarContent__GravatarShadow",
|
|
43
|
+
componentId: "sc-1jejgqy-1"
|
|
44
|
+
})(["position:absolute;width:100%;height:100%;box-shadow:inset 0 0 0 1px ", ";border-radius:50%;top:0;left:0;"], (0, _toColorString.default)(borderColor));
|
|
45
|
+
|
|
39
46
|
var Initials = (0, _styledComponents.default)(_Typography.P).attrs({
|
|
40
47
|
as: 'span'
|
|
41
48
|
}).withConfig({
|
|
42
49
|
displayName: "AvatarContent__Initials",
|
|
43
|
-
componentId: "sc-1jejgqy-
|
|
44
|
-
})(["
|
|
50
|
+
componentId: "sc-1jejgqy-2"
|
|
51
|
+
})(["font-size:inherit;text-transform:uppercase;font-weight:inherit;"]);
|
|
45
52
|
|
|
46
53
|
var AvatarIcon = _styledComponents.default.div.withConfig({
|
|
47
54
|
displayName: "AvatarContent__AvatarIcon",
|
|
48
|
-
componentId: "sc-1jejgqy-
|
|
49
|
-
})(["
|
|
55
|
+
componentId: "sc-1jejgqy-3"
|
|
56
|
+
})([""]);
|
|
50
57
|
|
|
51
58
|
function AvatarContent(props) {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
gravatarProps = _useGravatar2[0],
|
|
55
|
-
shouldUseGravatar = _useGravatar2[1];
|
|
56
|
-
|
|
59
|
+
var gravatarProps = props.gravatarProps,
|
|
60
|
+
shouldUseGravatar = props.shouldUseGravatar;
|
|
57
61
|
var initials = (0, _useInitials.default)(props);
|
|
58
62
|
var avatarIconProps = (0, _useAvatarIcon.default)(props);
|
|
59
63
|
|
|
60
64
|
switch (true) {
|
|
61
65
|
case shouldUseGravatar:
|
|
62
|
-
return _react.default.createElement(GravatarImg, gravatarProps);
|
|
66
|
+
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(GravatarImg, gravatarProps), _react.default.createElement(GravatarShadow, null));
|
|
63
67
|
|
|
64
68
|
case !!initials.length:
|
|
65
69
|
return _react.default.createElement(Initials, null, initials);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEZ,sBAAsB,EAGvB,MAAM,OAAO,CAAC;AAUf,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKjD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AA6DlC,QAAA,MAAM,aAAa,EAAE,sBAAsB,CACzC,SAAS,EACT,WAAW,CACS,CAAC;AAcvB,eAAe,aAAa,CAAC"}
|
|
@@ -19,6 +19,8 @@ exports.default = void 0;
|
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
23
|
+
|
|
22
24
|
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
23
25
|
|
|
24
26
|
var _AvatarContainer = _interopRequireDefault(require("./AvatarContainer"));
|
|
@@ -35,29 +37,60 @@ var _types = require("./types");
|
|
|
35
37
|
|
|
36
38
|
var _schema = _interopRequireDefault(require("./schema"));
|
|
37
39
|
|
|
40
|
+
var _useGravatar3 = _interopRequireDefault(require("./hooks/useGravatar"));
|
|
41
|
+
|
|
38
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
43
|
|
|
40
44
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
41
45
|
|
|
46
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
47
|
+
|
|
48
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
49
|
+
|
|
50
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
51
|
+
|
|
52
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
53
|
+
|
|
54
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
+
|
|
42
56
|
function Avatar(props, ref) {
|
|
43
57
|
var ariaLabel = props['aria-label'],
|
|
44
58
|
email = props.email,
|
|
45
59
|
entityType = props.entityType,
|
|
60
|
+
color = props.color,
|
|
46
61
|
kind = props.kind,
|
|
47
62
|
name = props.name,
|
|
63
|
+
palette = props.palette,
|
|
48
64
|
size = props.size,
|
|
49
65
|
indicatorColor = props.indicatorColor;
|
|
50
66
|
var translate = (0, _useTranslations.default)();
|
|
67
|
+
|
|
68
|
+
var _useGravatar = (0, _useGravatar3.default)(props),
|
|
69
|
+
_useGravatar2 = _slicedToArray(_useGravatar, 2),
|
|
70
|
+
gravatarProps = _useGravatar2[0],
|
|
71
|
+
shouldUseGravatar = _useGravatar2[1];
|
|
72
|
+
|
|
73
|
+
(0, _react.useEffect)(function () {
|
|
74
|
+
if (!(0, _isEmpty.default)(kind)) window.console && // eslint-disable-next-line no-console
|
|
75
|
+
console.warn('[KeyDesignSystems] The `kind` prop for the `Avatar` component has been deprecated. Use `color` + `palette` instead.'); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
|
+
}, []); // This is done to not break the now deprecated `secondary` kind variant. Should be removed in the future.
|
|
77
|
+
|
|
78
|
+
var componentColor = kind === 'secondary' ? 'licoriceMousse' : color;
|
|
51
79
|
return _react.default.createElement(_AvatarContainer.default, {
|
|
52
80
|
ref: ref,
|
|
53
|
-
|
|
54
|
-
|
|
81
|
+
size: size,
|
|
82
|
+
palette: palette,
|
|
83
|
+
color: componentColor,
|
|
84
|
+
shouldUseGravatar: shouldUseGravatar
|
|
55
85
|
}, _react.default.createElement("span", {
|
|
56
86
|
"aria-label": translate(ariaLabel, 'avatar.aria.label', {
|
|
57
87
|
descriptor: name || email || entityType
|
|
58
88
|
}),
|
|
59
89
|
role: "img"
|
|
60
|
-
}, _react.default.createElement(_AvatarContent.default,
|
|
90
|
+
}, _react.default.createElement(_AvatarContent.default, _extends({
|
|
91
|
+
gravatarProps: gravatarProps,
|
|
92
|
+
shouldUseGravatar: shouldUseGravatar
|
|
93
|
+
}, props))), indicatorColor && indicatorColor in _commonUIColors.commonUIColors && _react.default.createElement(_AvatarIndicator.default, {
|
|
61
94
|
size: size,
|
|
62
95
|
color: indicatorColor
|
|
63
96
|
}));
|
|
@@ -68,10 +101,11 @@ AvatarWithRef.propTypes = _schema.default.propTypes;
|
|
|
68
101
|
AvatarWithRef.defaultProps = {
|
|
69
102
|
email: undefined,
|
|
70
103
|
entityType: _constants.entityTypes.person,
|
|
71
|
-
kind: _constants.kinds.primary,
|
|
72
104
|
name: undefined,
|
|
73
105
|
size: _constants.sizes.medium,
|
|
74
|
-
indicatorColor: undefined
|
|
106
|
+
indicatorColor: undefined,
|
|
107
|
+
color: 'information',
|
|
108
|
+
palette: 'bright'
|
|
75
109
|
};
|
|
76
110
|
var _default = AvatarWithRef;
|
|
77
111
|
exports.default = _default;
|
|
@@ -10,6 +10,8 @@ var _constants = require("./constants");
|
|
|
10
10
|
|
|
11
11
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
12
12
|
|
|
13
|
+
var _palette = require("../../modifiers/palette");
|
|
14
|
+
|
|
13
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
16
|
|
|
15
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -25,6 +27,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
25
27
|
var modifierMap = {
|
|
26
28
|
kind: Object.values(_constants.kinds),
|
|
27
29
|
size: Object.values(_constants.sizes),
|
|
30
|
+
palette: Object.keys(_palette.PALETTE_MAPPER),
|
|
31
|
+
color: Object.keys(_commonUIColors.commonUIColors),
|
|
28
32
|
indicatorColor: Object.keys(_commonUIColors.commonUIColors)
|
|
29
33
|
};
|
|
30
34
|
describe('Avatar', function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAsC,CAAC;AAwCnD,eAAe,MAAM,CAAC"}
|
|
@@ -15,8 +15,10 @@ var schema = (0, _reactDesc.describe)({
|
|
|
15
15
|
});
|
|
16
16
|
schema.propTypes = {
|
|
17
17
|
email: _reactDesc.PropTypes.string.description("The entity's email address. Used in Gravatar image lookup."),
|
|
18
|
+
color: _reactDesc.PropTypes.string.description('(See note) Sets the color for the background and the icon').defaultValue('information'),
|
|
18
19
|
entityType: _reactDesc.PropTypes.oneOf(Object.values(_constants.entityTypes)).description('Selects the entity type represented.').defaultValue('person'),
|
|
19
|
-
|
|
20
|
+
palette: _reactDesc.PropTypes.oneOf(['bright', 'pastel', 'dark']).description('What color variant to render').defaultValue('bright'),
|
|
21
|
+
kind: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.oneOf(Object.values(_constants.kinds))]).description('***DEPRECATED*** Use color + palette instead. Selects the kind of Avatar.').defaultValue('primary').format('***DEPRECATED*** string').deprecated('Use color + palette instead'),
|
|
20
22
|
name: _reactDesc.PropTypes.string.description("The entity's name. First letter of first and last words used to generate initials."),
|
|
21
23
|
size: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.oneOf(Object.values(_constants.sizes))]).description('Selects the size desired.'),
|
|
22
24
|
indicatorColor: _reactDesc.PropTypes.string.description('(See note) Sets the indicator color')
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { entityTypes, kinds, sizes } from './constants';
|
|
3
3
|
import { CommonUIColorKeys } from '../../utils/commonUIColors';
|
|
4
|
+
import { GravatarProps, ShouldUseGravatar } from './hooks/useGravatar';
|
|
4
5
|
export declare type AvatarRef = HTMLDivElement;
|
|
5
|
-
export interface AvatarProps extends
|
|
6
|
+
export interface AvatarProps extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
color?: CommonUIColorKeys;
|
|
6
8
|
email?: string;
|
|
7
9
|
entityType?: keyof typeof entityTypes;
|
|
8
10
|
indicatorColor?: CommonUIColorKeys;
|
|
9
11
|
kind?: keyof typeof kinds;
|
|
10
12
|
name?: string;
|
|
13
|
+
palette?: 'pastel' | 'bright' | 'dark';
|
|
11
14
|
ref?: Ref<AvatarRef>;
|
|
12
15
|
size?: keyof typeof sizes;
|
|
13
16
|
}
|
|
17
|
+
export interface AvatarContentProps extends AvatarProps {
|
|
18
|
+
gravatarProps: GravatarProps;
|
|
19
|
+
shouldUseGravatar: ShouldUseGravatar;
|
|
20
|
+
}
|
|
21
|
+
export interface AvatarContainerProps {
|
|
22
|
+
color?: CommonUIColorKeys;
|
|
23
|
+
palette?: 'pastel' | 'bright' | 'dark';
|
|
24
|
+
size?: keyof typeof sizes;
|
|
25
|
+
shouldUseGravatar: ShouldUseGravatar;
|
|
26
|
+
}
|
|
14
27
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEvE,oBAAY,SAAS,GAAG,cAAc,CAAC;AAEvC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IACtC,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,iBAAiB,EAAE,iBAAiB,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/constants.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAKzC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sizeStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
/* eslint-disable import/prefer-default-export */
|
|
13
|
+
var makeSizeStyles = function makeSizeStyles(size) {
|
|
14
|
+
var value = (0, _rem.default)(size);
|
|
15
|
+
return {
|
|
16
|
+
width: value,
|
|
17
|
+
minWidth: value,
|
|
18
|
+
height: value,
|
|
19
|
+
minHeight: value
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var sizeStyles = {
|
|
24
|
+
'small.square': makeSizeStyles(20),
|
|
25
|
+
'medium.round': makeSizeStyles(36),
|
|
26
|
+
'medium.square': makeSizeStyles(30),
|
|
27
|
+
'large.round': makeSizeStyles(60)
|
|
28
|
+
};
|
|
29
|
+
exports.sizeStyles = sizeStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAmB,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAIxE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAWhC,QAAA,MAAM,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,UAAU,CAE9D,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -17,25 +17,13 @@ Object.defineProperty(exports, "BadgeProps", {
|
|
|
17
17
|
});
|
|
18
18
|
exports.default = void 0;
|
|
19
19
|
|
|
20
|
-
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
21
|
-
|
|
22
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
21
|
|
|
24
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _styledComponentsModifiers = require("styled-components-modifiers");
|
|
27
|
-
|
|
28
|
-
var _color = _interopRequireDefault(require("../../modifiers/color"));
|
|
29
|
-
|
|
30
|
-
var _commonUIColors = require("../../utils/commonUIColors");
|
|
31
|
-
|
|
32
|
-
var _utils = require("../../utils");
|
|
33
|
-
|
|
34
22
|
var _types = require("./types");
|
|
35
23
|
|
|
36
|
-
|
|
24
|
+
var _styles = require("./styles");
|
|
37
25
|
|
|
38
|
-
function
|
|
26
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
39
27
|
|
|
40
28
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
29
|
|
|
@@ -43,68 +31,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
43
31
|
|
|
44
32
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
33
|
|
|
46
|
-
var colorModifiers = (0, _utils.applyDynamicModifiers)('color', function (_ref) {
|
|
47
|
-
var color = _ref.color;
|
|
48
|
-
return (0, _styledComponents.css)(["", ""], color && color in _commonUIColors.commonUIColors && (0, _color.default)(_commonUIColors.commonUIColors[color]));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var makeSizeStyles = function makeSizeStyles(size) {
|
|
52
|
-
return {
|
|
53
|
-
width: (0, _rem.default)(size),
|
|
54
|
-
minWidth: (0, _rem.default)(size),
|
|
55
|
-
height: (0, _rem.default)(size),
|
|
56
|
-
minHeight: (0, _rem.default)(size)
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var sizeStyles = {
|
|
61
|
-
'medium.round': makeSizeStyles(36),
|
|
62
|
-
'medium.square': makeSizeStyles(30),
|
|
63
|
-
'large.round': makeSizeStyles(60)
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
var getSizeStyles = function getSizeStyles(key) {
|
|
67
|
-
return (0, _styledComponents.css)(sizeStyles[key] || '');
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var sizeModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
|
|
71
|
-
medium: function medium(_ref2) {
|
|
72
|
-
var v = _ref2.variant;
|
|
73
|
-
return getSizeStyles("medium.".concat(v));
|
|
74
|
-
},
|
|
75
|
-
large: function large(_ref3) {
|
|
76
|
-
var v = _ref3.variant;
|
|
77
|
-
return getSizeStyles("large.".concat(v));
|
|
78
|
-
}
|
|
79
|
-
}, 'size');
|
|
80
|
-
var variantModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
|
|
81
|
-
round: function round() {
|
|
82
|
-
return (0, _styledComponents.css)({
|
|
83
|
-
borderRadius: '50%'
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
square: function square() {
|
|
87
|
-
return (0, _styledComponents.css)({
|
|
88
|
-
borderRadius: '2px'
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}, 'variant'); // The default coloring is explicitly set instead of relying on the
|
|
92
|
-
// `visualInterest.licoriceMousse.medium` colors. The "default" badge is
|
|
93
|
-
// intended to be used in “empty” and/or “no results” messages, the snowWhite
|
|
94
|
-
// fg color and lower contrast help convey “emptiness”.
|
|
95
|
-
|
|
96
|
-
var BadgeContainer = _styledComponents.default.div.withConfig({
|
|
97
|
-
displayName: "Badge__BadgeContainer",
|
|
98
|
-
componentId: "sc-1y6oxgp-0"
|
|
99
|
-
})(["align-items:center;display:inline-flex;justify-content:center;", ";", ";", ";", ";"], (0, _color.default)(_commonUIColors.commonUIColors.information), colorModifiers, sizeModifiers, variantModifiers);
|
|
100
|
-
|
|
101
34
|
function Badge(props, containerRef) {
|
|
102
35
|
var ariaLabel = props['aria-label'],
|
|
103
36
|
Icon = props.icon,
|
|
104
37
|
size = props.size,
|
|
105
38
|
rest = _objectWithoutProperties(props, ["aria-label", "icon", "size"]);
|
|
106
39
|
|
|
107
|
-
return _react.default.createElement(BadgeContainer, _extends({
|
|
40
|
+
return _react.default.createElement(_styles.BadgeContainer, _extends({
|
|
108
41
|
ref: containerRef,
|
|
109
42
|
size: size
|
|
110
43
|
}, rest), _react.default.createElement(Icon, {
|
|
@@ -10,6 +10,8 @@ var _Home = _interopRequireDefault(require("@decisiv/iconix/lib/components/Home"
|
|
|
10
10
|
|
|
11
11
|
var _ = _interopRequireDefault(require("."));
|
|
12
12
|
|
|
13
|
+
var _constants = require("./constants");
|
|
14
|
+
|
|
13
15
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
14
16
|
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -53,16 +55,36 @@ describe('Badge', function () {
|
|
|
53
55
|
expect(container).toMatchSnapshot();
|
|
54
56
|
});
|
|
55
57
|
});
|
|
58
|
+
['bright', 'pastel'].forEach(function (palette) {
|
|
59
|
+
it("renders correctly with palette=\"".concat(palette, "\""), function () {
|
|
60
|
+
var _renderBadge3 = renderBadge({
|
|
61
|
+
palette: palette,
|
|
62
|
+
color: 'carrotCake'
|
|
63
|
+
}),
|
|
64
|
+
container = _renderBadge3.container;
|
|
65
|
+
|
|
66
|
+
expect(container).toMatchSnapshot();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
it("renders correctly with size=\"small\" and variant=\"square\"", function () {
|
|
70
|
+
var _renderBadge4 = renderBadge({
|
|
71
|
+
size: 'small',
|
|
72
|
+
variant: 'square'
|
|
73
|
+
}),
|
|
74
|
+
container = _renderBadge4.container;
|
|
75
|
+
|
|
76
|
+
expect(container).toMatchSnapshot();
|
|
77
|
+
});
|
|
56
78
|
it('renders correctly in any of the common UI colors', function () {
|
|
57
79
|
Object.entries(_commonUIColors.commonUIColors).forEach(function (_ref) {
|
|
58
80
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
59
81
|
key = _ref2[0],
|
|
60
82
|
value = _ref2[1];
|
|
61
83
|
|
|
62
|
-
var
|
|
84
|
+
var _renderBadge5 = renderBadge({
|
|
63
85
|
color: key
|
|
64
86
|
}),
|
|
65
|
-
container =
|
|
87
|
+
container = _renderBadge5.container;
|
|
66
88
|
|
|
67
89
|
expect(container.firstChild).toHaveStyleRule('background-color', (0, _toColorString.default)(value));
|
|
68
90
|
});
|
|
@@ -75,12 +97,44 @@ describe('Badge', function () {
|
|
|
75
97
|
// @ts-ignore
|
|
76
98
|
console.error.mockRestore();
|
|
77
99
|
});
|
|
78
|
-
it('warns
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
100
|
+
it('warns for invalid size/variant combinations', function () {
|
|
101
|
+
var sizes = ['small', 'medium', 'large'];
|
|
102
|
+
var variants = ['round', 'square'];
|
|
103
|
+
var validCombinations = Object.keys(_constants.sizeStyles);
|
|
104
|
+
|
|
105
|
+
for (var _i2 = 0, _sizes = sizes; _i2 < _sizes.length; _i2++) {
|
|
106
|
+
var size = _sizes[_i2];
|
|
107
|
+
var _iteratorNormalCompletion = true;
|
|
108
|
+
var _didIteratorError = false;
|
|
109
|
+
var _iteratorError = undefined;
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
for (var _iterator = variants[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
113
|
+
var variant = _step.value;
|
|
114
|
+
|
|
115
|
+
if (!validCombinations.includes("".concat(size, ".").concat(variant))) {
|
|
116
|
+
renderBadge({
|
|
117
|
+
size: size,
|
|
118
|
+
variant: variant
|
|
119
|
+
});
|
|
120
|
+
expect(console.error).toHaveBeenCalledWith("Warning: Failed prop type: The Badge component does not support the '".concat(size, "' size and '").concat(variant, "' variant props combination.\n in Badge"));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
_didIteratorError = true;
|
|
125
|
+
_iteratorError = err;
|
|
126
|
+
} finally {
|
|
127
|
+
try {
|
|
128
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
129
|
+
_iterator.return();
|
|
130
|
+
}
|
|
131
|
+
} finally {
|
|
132
|
+
if (_didIteratorError) {
|
|
133
|
+
throw _iteratorError;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
84
138
|
});
|
|
85
139
|
});
|
|
86
140
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA4BlD,eAAe,MAAM,CAAC"}
|