@decisiv/ui-components 2.0.1-alpha.99 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/atoms/Calendar/index.d.ts.map +1 -1
- package/lib/atoms/Calendar/index.js +38 -5
- package/lib/atoms/Calendar/index.test.js +5 -5
- package/lib/atoms/Calendar/types.d.ts +1 -1
- package/lib/atoms/Calendar/types.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.d.ts +2 -1
- package/lib/atoms/InputField/Containers.d.ts.map +1 -1
- package/lib/atoms/InputField/Containers.js +3 -1
- package/lib/atoms/InputField/HelpMessage.d.ts +1 -1
- package/lib/atoms/InputField/HelpMessage.d.ts.map +1 -1
- package/lib/atoms/InputField/HelpMessage.js +23 -7
- package/lib/atoms/InputField/index.d.ts +6 -1
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +21 -4
- package/lib/atoms/InputField/index.test.js +53 -0
- package/lib/atoms/InputField/schema.js +2 -2
- package/lib/atoms/InputField/styles.d.ts +7 -0
- package/lib/atoms/InputField/styles.d.ts.map +1 -0
- package/lib/atoms/InputField/styles.js +31 -0
- package/lib/atoms/OptionsList/Category/index.d.ts +4 -0
- package/lib/atoms/OptionsList/Category/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/index.js +85 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts +5 -0
- package/lib/atoms/OptionsList/Category/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Category/styles.js +35 -0
- package/lib/atoms/OptionsList/{Option.d.ts → Option/index.d.ts} +2 -2
- package/lib/atoms/OptionsList/Option/index.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/index.js +182 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts +17 -0
- package/lib/atoms/OptionsList/Option/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Option/styles.js +86 -0
- package/lib/atoms/OptionsList/context.d.ts +1 -0
- package/lib/atoms/OptionsList/context.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.d.ts +1 -44
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +259 -40
- package/lib/atoms/OptionsList/index.test.js +329 -186
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +7 -1
- package/lib/atoms/OptionsList/styles.d.ts +45 -0
- package/lib/atoms/OptionsList/styles.d.ts.map +1 -0
- package/lib/atoms/OptionsList/styles.js +29 -0
- package/lib/atoms/OptionsList/types.d.ts +50 -1
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/atoms/OptionsList/utils.d.ts +2 -1
- package/lib/atoms/OptionsList/utils.d.ts.map +1 -1
- package/lib/atoms/OptionsList/utils.js +49 -2
- package/lib/components/Alert/Container.d.ts +201 -0
- package/lib/components/Alert/Container.d.ts.map +1 -0
- package/lib/components/Alert/Container.js +26 -0
- package/lib/components/Alert/StyledButton.d.ts +5 -0
- package/lib/components/Alert/StyledButton.d.ts.map +1 -0
- package/lib/components/Alert/StyledButton.js +23 -0
- package/lib/components/Alert/index.d.ts +27 -0
- package/lib/components/Alert/index.d.ts.map +1 -0
- package/lib/components/Alert/index.js +112 -0
- package/lib/components/Alert/index.test.js +79 -0
- package/lib/components/Alert/intents.d.ts +13 -0
- package/lib/components/Alert/intents.d.ts.map +1 -0
- package/lib/components/Alert/intents.js +72 -0
- package/lib/components/{Tabs/schema.tab.d.ts → Alert/schema.d.ts} +1 -1
- package/lib/components/Alert/schema.d.ts.map +1 -0
- package/lib/components/Alert/schema.js +25 -0
- package/lib/components/Alert/types.d.ts +36 -0
- package/lib/components/Alert/types.d.ts.map +1 -0
- package/lib/components/Alert/types.js +32 -0
- package/lib/components/Avatar/AvatarContainer.d.ts +1 -13
- package/lib/components/Avatar/AvatarContainer.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContainer.js +12 -13
- package/lib/components/Avatar/AvatarContent.d.ts +2 -2
- package/lib/components/Avatar/AvatarContent.d.ts.map +1 -1
- package/lib/components/Avatar/AvatarContent.js +24 -20
- package/lib/components/Avatar/index.d.ts.map +1 -1
- package/lib/components/Avatar/index.js +42 -5
- package/lib/components/Avatar/index.test.js +4 -0
- package/lib/components/Avatar/schema.d.ts.map +1 -1
- package/lib/components/Avatar/schema.js +3 -1
- package/lib/components/Avatar/types.d.ts +15 -2
- package/lib/components/Avatar/types.d.ts.map +1 -1
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +2 -58
- package/lib/components/Badge/index.test.js +15 -4
- package/lib/components/Badge/schema.d.ts.map +1 -1
- package/lib/components/Badge/schema.js +1 -0
- package/lib/components/Badge/styles.d.ts +3 -0
- package/lib/components/Badge/styles.d.ts.map +1 -0
- package/lib/components/Badge/styles.js +97 -0
- package/lib/components/Badge/types.d.ts +3 -1
- package/lib/components/Badge/types.d.ts.map +1 -1
- package/lib/components/Badge/types.js +2 -1
- package/lib/components/Button/StyledButton.d.ts +3 -6
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +39 -11
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +51 -12
- package/lib/components/Button/index.test.js +43 -8
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +4 -1
- package/lib/components/Button/types.d.ts +4 -1
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/Combobox/Target.d.ts.map +1 -1
- package/lib/components/Combobox/Target.js +10 -0
- package/lib/components/Combobox/index.d.ts.map +1 -1
- package/lib/components/Combobox/index.js +111 -59
- package/lib/components/Combobox/index.test.js +110 -25
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +7 -1
- package/lib/components/Combobox/types.d.ts +7 -2
- package/lib/components/Combobox/types.d.ts.map +1 -1
- package/lib/components/Drawer/index.d.ts +22 -0
- package/lib/components/Drawer/index.d.ts.map +1 -0
- package/lib/components/Drawer/index.js +122 -0
- package/lib/components/Drawer/index.test.js +164 -0
- package/lib/components/Drawer/schema.d.ts +3 -0
- package/lib/components/Drawer/schema.d.ts.map +1 -0
- package/lib/components/Drawer/schema.js +32 -0
- package/lib/components/Drawer/styles.d.ts +11 -0
- package/lib/components/Drawer/styles.d.ts.map +1 -0
- package/lib/components/Drawer/styles.js +79 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +10 -3
- package/lib/components/DropdownList/index.test.js +38 -25
- package/lib/components/DropdownList/schema.js +1 -1
- package/lib/components/Filter/ActionFilter/index.d.ts +5 -0
- package/lib/components/Filter/ActionFilter/index.d.ts.map +1 -0
- package/lib/components/Filter/ActionFilter/index.js +43 -0
- package/lib/components/Filter/IconWrapper/index.d.ts +2 -2
- package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.d.ts +2 -28
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -1
- package/lib/components/Filter/SimplePrimary/index.js +9 -21
- package/lib/components/Filter/StyledFilter.d.ts +2 -2
- package/lib/components/Filter/StyledFilter.d.ts.map +1 -1
- package/lib/components/Filter/StyledFilter.js +28 -1
- package/lib/components/Filter/StyledLabel/index.d.ts +3 -3
- package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -1
- package/lib/components/Filter/StyledLabel/index.js +14 -6
- package/lib/components/Filter/index.d.ts +4 -25
- package/lib/components/Filter/index.d.ts.map +1 -1
- package/lib/components/Filter/index.js +41 -29
- package/lib/components/Filter/index.test.js +33 -4
- package/lib/components/Filter/kind.d.ts +4 -3
- package/lib/components/Filter/kind.d.ts.map +1 -1
- package/lib/components/Filter/kind.js +20 -22
- package/lib/components/Filter/schema.d.ts.map +1 -1
- package/lib/components/Filter/schema.js +8 -3
- package/lib/components/Filter/types.d.ts +21 -7
- package/lib/components/Filter/types.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
- package/lib/components/JumpTo/JumpToMenu.js +50 -9
- package/lib/components/JumpTo/index.test.js +84 -0
- package/lib/components/JumpTo/schema.d.ts.map +1 -1
- package/lib/components/JumpTo/schema.js +2 -1
- package/lib/components/JumpTo/types.d.ts +1 -0
- package/lib/components/JumpTo/types.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.d.ts.map +1 -1
- package/lib/components/JumpTo/utils.js +3 -7
- package/lib/components/LeftNav/Item/NavExpandedItem/index.js +7 -2
- package/lib/components/LeftNav/index.test.js +35 -19
- package/lib/components/LeftNav/schema.d.ts.map +1 -1
- package/lib/components/LeftNav/schema.js +3 -1
- package/lib/components/LeftNav/types.d.ts +1 -0
- package/lib/components/LeftNav/types.d.ts.map +1 -1
- package/lib/components/Link/DisabledLink.d.ts +7 -0
- package/lib/components/Link/DisabledLink.d.ts.map +1 -0
- package/lib/components/Link/DisabledLink.js +46 -0
- package/lib/components/Link/Link.d.ts +4 -0
- package/lib/components/Link/Link.d.ts.map +1 -0
- package/lib/components/Link/Link.js +67 -0
- package/lib/components/Link/index.d.ts +4 -23
- package/lib/components/Link/index.d.ts.map +1 -1
- package/lib/components/Link/index.js +19 -157
- package/lib/components/Link/index.test.js +62 -49
- package/lib/components/Link/schema.d.ts.map +1 -1
- package/lib/components/Link/schema.js +1 -0
- package/lib/components/Link/styles.d.ts +20 -0
- package/lib/components/Link/styles.d.ts.map +1 -0
- package/lib/components/Link/styles.js +131 -0
- package/lib/components/Link/types.d.ts +28 -0
- package/lib/components/Link/types.d.ts.map +1 -0
- package/lib/components/List/BaseCell/index.d.ts +6 -0
- package/lib/components/List/BaseCell/index.d.ts.map +1 -0
- package/lib/components/List/BaseCell/index.js +17 -0
- package/lib/components/List/BaseCell/index.test.js +33 -0
- package/lib/components/List/BaseCell/styles.d.ts +198 -0
- package/lib/components/List/BaseCell/styles.d.ts.map +1 -0
- package/lib/components/List/BaseCell/styles.js +26 -0
- package/lib/components/List/ContentContainer/index.d.ts +21 -0
- package/lib/components/List/ContentContainer/index.d.ts.map +1 -0
- package/lib/components/List/ContentContainer/index.js +82 -0
- package/lib/components/List/ContentContainer/index.test.js +102 -0
- package/lib/components/List/DefaultCell/index.d.ts +6 -0
- package/lib/components/List/DefaultCell/index.d.ts.map +1 -0
- package/lib/components/List/DefaultCell/index.js +26 -0
- package/lib/components/List/EditableCell/index.d.ts +13 -0
- package/lib/components/List/EditableCell/index.d.ts.map +1 -0
- package/lib/components/List/EditableCell/index.js +47 -0
- package/lib/components/List/EditableCell/styles.d.ts +204 -0
- package/lib/components/List/EditableCell/styles.d.ts.map +1 -0
- package/lib/components/List/EditableCell/styles.js +47 -0
- package/lib/components/List/LabelContainer/index.d.ts +9 -0
- package/lib/components/List/LabelContainer/index.d.ts.map +1 -0
- package/lib/components/List/LabelContainer/index.js +38 -0
- package/lib/components/List/LabelContainer/index.test.js +105 -0
- package/lib/components/List/LabelContainer/styles.d.ts +4 -0
- package/lib/components/List/LabelContainer/styles.d.ts.map +1 -0
- package/lib/components/List/LabelContainer/styles.js +28 -0
- package/lib/components/List/ListItem/index.d.ts +8 -0
- package/lib/components/List/ListItem/index.d.ts.map +1 -0
- package/lib/components/List/ListItem/index.js +43 -0
- package/lib/components/List/ListItem/index.test.js +76 -0
- package/lib/components/List/ListItem/schema.d.ts +4 -0
- package/lib/components/List/ListItem/schema.d.ts.map +1 -0
- package/lib/components/List/ListItem/schema.js +30 -0
- package/lib/components/List/ListItem/styles.d.ts +2 -0
- package/lib/components/List/ListItem/styles.d.ts.map +1 -0
- package/lib/components/List/ListItem/styles.js +23 -0
- package/lib/components/List/constants.d.ts +19 -0
- package/lib/components/List/constants.d.ts.map +1 -0
- package/lib/components/List/constants.js +28 -0
- package/lib/components/List/index.d.ts +15 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +67 -0
- package/lib/components/List/index.test.js +64 -0
- package/lib/components/List/schema.d.ts +4 -0
- package/lib/components/List/schema.d.ts.map +1 -0
- package/lib/components/List/schema.js +26 -0
- package/lib/components/List/styles.d.ts +198 -0
- package/lib/components/List/styles.d.ts.map +1 -0
- package/lib/components/List/styles.js +34 -0
- package/lib/components/List/types.d.ts +15 -0
- package/lib/components/List/types.d.ts.map +1 -0
- package/lib/components/List/types.js +5 -0
- package/lib/components/Loading/Loading.d.ts +12 -0
- package/lib/components/Loading/Loading.d.ts.map +1 -0
- package/lib/components/Loading/Loading.js +70 -0
- package/lib/components/Loading/index.d.ts +4 -0
- package/lib/components/Loading/index.d.ts.map +1 -0
- package/lib/components/Loading/index.js +33 -0
- package/lib/components/Loading/index.test.js +55 -0
- package/lib/components/Loading/schema.d.ts +4 -0
- package/lib/components/Loading/schema.d.ts.map +1 -0
- package/lib/components/Loading/schema.js +31 -0
- package/lib/components/Loading/styles.d.ts +211 -0
- package/lib/components/Loading/styles.d.ts.map +1 -0
- package/lib/components/Loading/styles.js +77 -0
- package/lib/components/Loading/types.d.ts +10 -0
- package/lib/components/Loading/types.d.ts.map +1 -0
- package/lib/components/Loading/types.js +5 -0
- package/lib/components/Modal/Manager.d.ts +6 -0
- package/lib/components/Modal/Manager.d.ts.map +1 -0
- package/lib/components/Modal/Manager.js +53 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts +11 -0
- package/lib/components/Modal/ResponsiveModalWrapper.d.ts.map +1 -0
- package/lib/components/Modal/ResponsiveModalWrapper.js +82 -0
- package/lib/components/Modal/components.d.ts +199 -1
- package/lib/components/Modal/components.d.ts.map +1 -1
- package/lib/components/Modal/components.js +16 -24
- package/lib/components/Modal/index.d.ts +8 -4
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +63 -95
- package/lib/components/Modal/index.test.js +99 -0
- package/lib/components/Modal/schema.d.ts.map +1 -1
- package/lib/components/Modal/schema.js +2 -1
- package/lib/components/Modal/types.d.ts +2 -1
- package/lib/components/Modal/types.d.ts.map +1 -1
- package/lib/components/Modal/utils.d.ts +1 -1
- package/lib/components/Modal/utils.d.ts.map +1 -1
- package/lib/components/Modal/utils.js +7 -5
- package/lib/components/Pagination/Pages.d.ts +1 -7
- package/lib/components/Pagination/Pages.d.ts.map +1 -1
- package/lib/components/Pagination/Pages.js +17 -0
- package/lib/components/Pagination/Pagination.d.ts +13 -14
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +20 -5
- package/lib/components/Pagination/Pagination.test.js +14 -0
- package/lib/components/Pagination/paginate.d.ts +1 -1
- package/lib/components/Pagination/paginate.d.ts.map +1 -1
- package/lib/components/Pagination/paginate.js +4 -0
- package/lib/components/Pagination/paginate.test.js +38 -17
- package/lib/components/Pagination/schema.d.ts.map +1 -1
- package/lib/components/Pagination/schema.js +3 -1
- package/lib/components/Pagination/types.d.ts +24 -1
- package/lib/components/Pagination/types.d.ts.map +1 -1
- package/lib/components/PasswordField/IconWrapper.d.ts +198 -0
- package/lib/components/PasswordField/IconWrapper.d.ts.map +1 -0
- package/lib/components/PasswordField/IconWrapper.js +32 -0
- package/lib/components/PasswordField/Input.d.ts +6 -0
- package/lib/components/PasswordField/Input.d.ts.map +1 -0
- package/lib/components/PasswordField/Input.js +28 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts +8 -0
- package/lib/components/PasswordField/ShowPasswordButton.d.ts.map +1 -0
- package/lib/components/PasswordField/ShowPasswordButton.js +48 -0
- package/lib/components/PasswordField/index.d.ts +14 -0
- package/lib/components/PasswordField/index.d.ts.map +1 -0
- package/lib/components/PasswordField/index.js +113 -0
- package/lib/components/PasswordField/index.test.js +217 -0
- package/lib/components/PasswordField/schema.d.ts +3 -0
- package/lib/components/PasswordField/schema.d.ts.map +1 -0
- package/lib/components/PasswordField/schema.js +27 -0
- package/lib/components/Popover/Arrow.d.ts +2 -2
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +25 -10
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +28 -20
- package/lib/components/Popover/types.d.ts +6 -2
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/SearchInput/index.d.ts +11 -0
- package/lib/components/SearchInput/index.d.ts.map +1 -0
- package/lib/components/SearchInput/index.js +179 -0
- package/lib/components/SearchInput/index.test.js +660 -0
- package/lib/components/SearchInput/schema.d.ts +3 -0
- package/lib/components/SearchInput/schema.d.ts.map +1 -0
- package/lib/components/SearchInput/schema.js +38 -0
- package/lib/components/SearchInput/styles.d.ts +1176 -0
- package/lib/components/SearchInput/styles.d.ts.map +1 -0
- package/lib/components/SearchInput/styles.js +97 -0
- package/lib/components/SearchInput/types.d.ts +39 -0
- package/lib/components/SearchInput/types.d.ts.map +1 -0
- package/lib/components/SearchInput/types.js +5 -0
- package/lib/components/Select/Target.d.ts.map +1 -1
- package/lib/components/Select/Target.js +5 -1
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js +7 -3
- package/lib/components/Select/index.test.js +43 -19
- package/lib/components/Select/schema.d.ts.map +1 -1
- package/lib/components/Select/schema.js +2 -0
- package/lib/components/Select/types.d.ts +2 -0
- package/lib/components/Select/types.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.d.ts.map +1 -1
- package/lib/components/SelectDate/Target.js +5 -1
- package/lib/components/SelectDate/index.d.ts.map +1 -1
- package/lib/components/SelectDate/index.js +7 -3
- package/lib/components/SelectDate/schema.d.ts.map +1 -1
- package/lib/components/SelectDate/schema.js +1 -0
- package/lib/components/SelectDate/types.d.ts +1 -0
- package/lib/components/SelectDate/types.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.d.ts.map +1 -1
- package/lib/components/SelectDateRange/index.js +6 -2
- package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
- package/lib/components/SelectDateRange/schema.js +1 -0
- package/lib/components/StepTracker/index.d.ts +11 -0
- package/lib/components/StepTracker/index.d.ts.map +1 -0
- package/lib/components/StepTracker/index.js +56 -0
- package/lib/components/StepTracker/index.test.js +89 -0
- package/lib/components/StepTracker/schema.d.ts +3 -0
- package/lib/components/StepTracker/schema.d.ts.map +1 -0
- package/lib/components/StepTracker/schema.js +19 -0
- package/lib/components/StepTracker/styles.d.ts +605 -0
- package/lib/components/StepTracker/styles.d.ts.map +1 -0
- package/lib/components/StepTracker/styles.js +114 -0
- package/lib/components/Table/Body.d.ts.map +1 -1
- package/lib/components/Table/Body.js +2 -5
- package/lib/components/Table/Container.d.ts.map +1 -1
- package/lib/components/Table/Container.js +6 -1
- package/lib/components/Table/Grip.d.ts +6 -2
- package/lib/components/Table/Grip.d.ts.map +1 -1
- package/lib/components/Table/Grip.js +9 -3
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Tabs/Tab/index.d.ts +13 -0
- package/lib/components/Tabs/Tab/index.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/index.js +94 -0
- package/lib/components/Tabs/Tab/schema.d.ts +3 -0
- package/lib/components/Tabs/Tab/schema.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.d.ts +7 -0
- package/lib/components/Tabs/Tab/styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tab/styles.js +37 -0
- package/lib/components/Tabs/context.d.ts +2 -2
- package/lib/components/Tabs/context.d.ts.map +1 -1
- package/lib/components/Tabs/context.js +1 -1
- package/lib/components/Tabs/index.d.ts +17 -6
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +104 -163
- package/lib/components/Tabs/index.test.js +54 -2
- package/lib/components/Tabs/styles.d.ts +4 -0
- package/lib/components/Tabs/styles.d.ts.map +1 -0
- package/lib/components/Tabs/styles.js +35 -0
- package/lib/components/Tag/Action.d.ts +4 -0
- package/lib/components/Tag/Action.d.ts.map +1 -0
- package/lib/components/Tag/Action.js +39 -0
- package/lib/components/Tag/constants.d.ts +2 -2
- package/lib/components/Tag/constants.d.ts.map +1 -1
- package/lib/components/Tag/constants.js +4 -4
- package/lib/components/Tag/index.d.ts +1 -3
- package/lib/components/Tag/index.d.ts.map +1 -1
- package/lib/components/Tag/index.js +40 -97
- package/lib/components/Tag/index.test.js +239 -2
- package/lib/components/Tag/propTypes.d.ts +4 -1
- package/lib/components/Tag/propTypes.d.ts.map +1 -1
- package/lib/components/Tag/propTypes.js +5 -2
- package/lib/components/Tag/schema.d.ts.map +1 -1
- package/lib/components/Tag/schema.js +3 -1
- package/lib/components/Tag/styles.d.ts +13 -0
- package/lib/components/Tag/styles.d.ts.map +1 -0
- package/lib/components/Tag/styles.js +133 -0
- package/lib/components/Tag/types.d.ts +11 -12
- package/lib/components/Tag/types.d.ts.map +1 -1
- package/lib/components/TagInput/index.d.ts +5 -0
- package/lib/components/TagInput/index.d.ts.map +1 -0
- package/lib/components/TagInput/index.js +363 -0
- package/lib/components/TagInput/index.test.js +1143 -0
- package/lib/components/TagInput/schema.d.ts +3 -0
- package/lib/components/TagInput/schema.d.ts.map +1 -0
- package/lib/components/TagInput/schema.js +36 -0
- package/lib/components/TagInput/styles.d.ts +10 -0
- package/lib/components/TagInput/styles.d.ts.map +1 -0
- package/lib/components/TagInput/styles.js +52 -0
- package/lib/components/TagInput/types.d.ts +21 -0
- package/lib/components/TagInput/types.d.ts.map +1 -0
- package/lib/components/TagInput/types.js +5 -0
- package/lib/components/Toggle/Fieldset.d.ts.map +1 -1
- package/lib/components/Toggle/Fieldset.js +20 -11
- package/lib/components/Toggle/Option.d.ts.map +1 -1
- package/lib/components/Toggle/Option.js +1 -1
- package/lib/components/Toggle/Slider.d.ts +1 -3
- package/lib/components/Toggle/Slider.d.ts.map +1 -1
- package/lib/components/Toggle/Slider.js +29 -24
- package/lib/components/Toggle/index.d.ts.map +1 -1
- package/lib/components/Toggle/index.js +2 -1
- package/lib/components/Toggle/propTypes.js +1 -1
- package/lib/components/Toggle/schema.js +1 -1
- package/lib/components/Toggle/types.d.ts +3 -2
- package/lib/components/Toggle/types.d.ts.map +1 -1
- package/lib/components/ToggleView/ToggleView.d.ts +5 -0
- package/lib/components/ToggleView/ToggleView.d.ts.map +1 -0
- package/lib/components/ToggleView/ToggleView.js +80 -0
- package/lib/components/ToggleView/index.d.ts +4 -0
- package/lib/components/ToggleView/index.d.ts.map +1 -0
- package/lib/components/ToggleView/index.js +33 -0
- package/lib/components/ToggleView/index.test.js +61 -0
- package/lib/components/ToggleView/schema.d.ts +3 -0
- package/lib/components/ToggleView/schema.d.ts.map +1 -0
- package/lib/components/ToggleView/schema.js +24 -0
- package/lib/components/ToggleView/styles.d.ts +6 -0
- package/lib/components/ToggleView/styles.d.ts.map +1 -0
- package/lib/components/ToggleView/styles.js +23 -0
- package/lib/components/ToggleView/types.d.ts +23 -0
- package/lib/components/ToggleView/types.d.ts.map +1 -0
- package/lib/components/ToggleView/types.js +12 -0
- package/lib/components/Tooltip/index.d.ts.map +1 -1
- package/lib/components/Tooltip/index.js +3 -13
- package/lib/components/Tooltip/schema.d.ts +3 -0
- package/lib/components/Tooltip/schema.d.ts.map +1 -0
- package/lib/components/Tooltip/schema.js +29 -0
- package/lib/components/TopNav/Menu/index.d.ts +1 -1
- package/lib/components/TopNav/index.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts +1 -1
- package/lib/components/Typography/withColors.d.ts.map +1 -1
- package/lib/components/Typography/withColors.js +1 -1
- package/lib/components/Wizard/index.d.ts +33 -0
- package/lib/components/Wizard/index.d.ts.map +1 -0
- package/lib/components/Wizard/index.js +161 -0
- package/lib/components/Wizard/index.test.js +940 -0
- package/lib/components/Wizard/schema.d.ts +3 -0
- package/lib/components/Wizard/schema.d.ts.map +1 -0
- package/lib/components/Wizard/schema.js +42 -0
- package/lib/components/Wizard/styles.d.ts +990 -0
- package/lib/components/Wizard/styles.d.ts.map +1 -0
- package/lib/components/Wizard/styles.js +79 -0
- package/lib/components/index.d.ts +11 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +196 -1
- package/lib/modifiers/palette.d.ts +36 -0
- package/lib/modifiers/palette.d.ts.map +1 -0
- package/lib/modifiers/palette.js +88 -0
- package/lib/modifiers/spacingSchema.d.ts.map +1 -1
- package/lib/modifiers/spacingSchema.js +29 -16
- package/lib/providers/ConfigProvider/utils/linkRenderer.d.ts +2 -1
- package/lib/providers/ConfigProvider/utils/linkRenderer.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts +45 -1
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +46 -2
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +5 -0
- package/lib/utils/commonUIColors.d.ts +351 -3
- package/lib/utils/commonUIColors.d.ts.map +1 -1
- package/lib/utils/commonUIColors.js +6 -2
- package/lib/utils/useDebounce.d.ts +2 -0
- package/lib/utils/useDebounce.d.ts.map +1 -0
- package/lib/utils/useDebounce.js +37 -0
- package/lib/utils/useStackingContext.d.ts +12 -0
- package/lib/utils/useStackingContext.d.ts.map +1 -0
- package/lib/utils/useStackingContext.js +46 -0
- package/package.json +26 -13
- package/CHANGELOG.md +0 -796
- package/lib/atoms/OptionsList/Category.d.ts +0 -4
- package/lib/atoms/OptionsList/Category.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Category.js +0 -53
- package/lib/atoms/OptionsList/Option.d.ts.map +0 -1
- package/lib/atoms/OptionsList/Option.js +0 -197
- package/lib/components/Tabs/Tab.d.ts +0 -5
- package/lib/components/Tabs/Tab.d.ts.map +0 -1
- package/lib/components/Tabs/Tab.js +0 -109
- package/lib/components/Tabs/schema.tab.d.ts.map +0 -1
- package/lib/components/Tabs/types.d.ts +0 -27
- package/lib/components/Tabs/types.d.ts.map +0 -1
- package/lib/components/Tag/ActionButton.d.ts +0 -5
- package/lib/components/Tag/ActionButton.d.ts.map +0 -1
- package/lib/components/Tag/ActionButton.js +0 -56
- /package/lib/components/{Tabs → Link}/types.js +0 -0
- /package/lib/components/Tabs/{schema.tab.js → Tab/schema.js} +0 -0
|
@@ -18,39 +18,31 @@ Object.defineProperty(exports, "TagRef", {
|
|
|
18
18
|
Object.defineProperty(exports, "TagActionButtonRef", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return _types.
|
|
21
|
+
return _types.TagActionRef;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "IconComponent", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _types.IconComponent;
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
30
|
exports.default = void 0;
|
|
25
31
|
|
|
26
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
27
|
-
|
|
28
|
-
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
29
|
-
|
|
30
32
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
33
|
|
|
32
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
33
|
-
|
|
34
|
-
var _designTokens = require("@decisiv/design-tokens");
|
|
35
|
-
|
|
36
|
-
var _color = _interopRequireDefault(require("../../modifiers/color"));
|
|
37
|
-
|
|
38
|
-
var _commonUIColors = require("../../utils/commonUIColors");
|
|
39
|
-
|
|
40
34
|
var _Typography = require("../Typography");
|
|
41
35
|
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var _constants = require("./constants");
|
|
36
|
+
var _Action = _interopRequireWildcard(require("./Action"));
|
|
45
37
|
|
|
46
38
|
var _propTypes = require("./propTypes");
|
|
47
39
|
|
|
40
|
+
var _styles = require("./styles");
|
|
41
|
+
|
|
48
42
|
var _types = require("./types");
|
|
49
43
|
|
|
50
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; } }
|
|
51
45
|
|
|
52
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
53
|
-
|
|
54
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); }
|
|
55
47
|
|
|
56
48
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
@@ -65,61 +57,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
65
57
|
|
|
66
58
|
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; }
|
|
67
59
|
|
|
68
|
-
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; }
|
|
69
|
-
|
|
70
|
-
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; }
|
|
71
|
-
|
|
72
|
-
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; }
|
|
73
|
-
|
|
74
|
-
var borderColor = (0, _toColorString.default)(_designTokens.color.opacity.charcoal15);
|
|
75
|
-
|
|
76
|
-
var getContentMaxWidth = function getContentMaxWidth(props) {
|
|
77
|
-
var isSingleChild = props.isSingleChild,
|
|
78
|
-
hasIcon = props.hasIcon;
|
|
79
|
-
var iconWidth = 12;
|
|
80
|
-
var actionBorder = 1;
|
|
81
|
-
var containerBorder = 2;
|
|
82
|
-
var baseWidth = _constants.MAX_CONTAINER_WIDTH - _constants.CONTAINER_X_PADDING - containerBorder;
|
|
83
|
-
var valuesToSubtract = [];
|
|
84
|
-
!isSingleChild && valuesToSubtract.push(_constants.ACTION_BUTTON_WIDTH, actionBorder);
|
|
85
|
-
hasIcon && valuesToSubtract.push(iconWidth, _constants.ICON_CONTENT_MARGIN);
|
|
86
|
-
return (0, _rem.default)(valuesToSubtract.reduce(function (r, v) {
|
|
87
|
-
return r - v;
|
|
88
|
-
}, baseWidth));
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var colorModifiers = function colorModifiers(_ref) {
|
|
92
|
-
var variant = _ref.variant,
|
|
93
|
-
colorProp = _ref.color;
|
|
94
|
-
return variant === 'outline' ? (0, _color.default)(_objectSpread({}, _designTokens.color.base.snowWhite, {
|
|
95
|
-
fg: _designTokens.color.base.alaskanHusky
|
|
96
|
-
})) : (0, _color.default)(colorProp && colorProp in _commonUIColors.commonUIColors ? _commonUIColors.commonUIColors[colorProp] : _commonUIColors.commonUIColors.licoriceMousse);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var Content = _styledComponents.default.div.withConfig({
|
|
100
|
-
displayName: "Tag__Content",
|
|
101
|
-
componentId: "nifm8a-0"
|
|
102
|
-
})(["align-items:center;border:0;display:flex;padding:0 ", ";", ";> svg{flex:1 0 auto;}* + *{margin-left:", ";}span{max-width:", ";}"], (0, _rem.default)(_constants.CONTAINER_X_PADDING / 2), function (_ref2) {
|
|
103
|
-
var isSingleChild = _ref2.isSingleChild;
|
|
104
|
-
return (0, _styledComponents.css)(["max-width:", ";"], isSingleChild ? '100%' : "calc(100% - ".concat(_constants.ACTION_BUTTON_WIDTH, "px)"));
|
|
105
|
-
}, (0, _rem.default)(_constants.ICON_CONTENT_MARGIN), getContentMaxWidth);
|
|
106
|
-
|
|
107
|
-
var contentSVGColor = function contentSVGColor(_ref3) {
|
|
108
|
-
var variant = _ref3.variant,
|
|
109
|
-
colorProp = _ref3.color;
|
|
110
|
-
|
|
111
|
-
if (variant === 'outline' && colorProp && colorProp in _commonUIColors.commonUIColors) {
|
|
112
|
-
return (0, _styledComponents.css)(["", " svg{color:", ";}"], Content, (0, _toColorString.default)(_commonUIColors.commonUIColors[colorProp]));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
var Container = _styledComponents.default.div.withConfig({
|
|
119
|
-
displayName: "Tag__Container",
|
|
120
|
-
componentId: "nifm8a-1"
|
|
121
|
-
})(["font-family:", ";font-size:", ";font-weight:", ";align-items:center;border-radius:", ";border:1px solid ", ";display:inline-flex;height:", ";max-width:100%;min-width:", ";padding:0;", ";", ";", "{", ";}"], _designTokens.typography.typeface.default, (0, _rem.default)(_designTokens.typography.size.alias.default), _designTokens.typography.weight.alias.default, (0, _rem.default)(10), borderColor, (0, _rem.default)(20), (0, _rem.default)(26), colorModifiers, contentSVGColor, _ActionButton.ActionButtonContainer, colorModifiers);
|
|
122
|
-
|
|
123
60
|
function Tag(props, containerRef) {
|
|
124
61
|
var action = props.action,
|
|
125
62
|
actionAttributes = props.actionAttributes,
|
|
@@ -128,50 +65,46 @@ function Tag(props, containerRef) {
|
|
|
128
65
|
actionRef = props.actionRef,
|
|
129
66
|
Icon = props.icon,
|
|
130
67
|
text = props.text,
|
|
131
|
-
|
|
68
|
+
palette = props.palette,
|
|
69
|
+
_props$size = props.size,
|
|
70
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
71
|
+
rest = _objectWithoutProperties(props, ["action", "actionAttributes", "actionIcon", "actionIntent", "actionRef", "icon", "text", "palette", "size"]);
|
|
132
72
|
|
|
133
73
|
var _useState = (0, _react.useState)(false),
|
|
134
74
|
_useState2 = _slicedToArray(_useState, 2),
|
|
135
75
|
isFocused = _useState2[0],
|
|
136
76
|
setIsFocused = _useState2[1];
|
|
137
77
|
|
|
138
|
-
var
|
|
139
|
-
var
|
|
78
|
+
var onTagFocus = (0, _react.useCallback)(function (e) {
|
|
79
|
+
var _ref = actionAttributes || {
|
|
140
80
|
onFocus: undefined
|
|
141
81
|
},
|
|
142
|
-
onFocus =
|
|
82
|
+
onFocus = _ref.onFocus;
|
|
143
83
|
|
|
144
84
|
setIsFocused(true);
|
|
145
85
|
onFocus && onFocus(e);
|
|
146
86
|
}, [actionAttributes]);
|
|
147
|
-
var
|
|
148
|
-
var
|
|
87
|
+
var onTagBlur = (0, _react.useCallback)(function (e) {
|
|
88
|
+
var _ref2 = actionAttributes || {
|
|
149
89
|
onBlur: undefined
|
|
150
90
|
},
|
|
151
|
-
onBlur =
|
|
91
|
+
onBlur = _ref2.onBlur;
|
|
152
92
|
|
|
153
93
|
setIsFocused(false);
|
|
154
94
|
onBlur && onBlur(e);
|
|
155
95
|
}, [actionAttributes]);
|
|
156
|
-
var
|
|
96
|
+
var ActionElement = (0, _react.useMemo)(function () {
|
|
157
97
|
if (!text || !action || !actionIcon) {
|
|
158
98
|
return null;
|
|
159
99
|
}
|
|
160
100
|
|
|
161
101
|
var ActionIcon = actionIcon;
|
|
162
|
-
return _react.default.createElement(
|
|
163
|
-
|
|
164
|
-
}, _react.default.createElement(
|
|
165
|
-
ref: actionRef,
|
|
166
|
-
type: "button",
|
|
167
|
-
onBlur: onActionBlur,
|
|
168
|
-
onClick: action,
|
|
169
|
-
onFocus: onActionFocus,
|
|
170
|
-
actionIntent: actionIntent
|
|
171
|
-
}), _react.default.createElement(ActionIcon, {
|
|
102
|
+
return _react.default.createElement(_Action.ActionContainer, null, _react.default.createElement(_Action.default, {
|
|
103
|
+
ref: actionRef
|
|
104
|
+
}, _react.default.createElement(ActionIcon, {
|
|
172
105
|
size: "small"
|
|
173
106
|
})));
|
|
174
|
-
}, [text, action, actionRef,
|
|
107
|
+
}, [text, action, actionRef, actionIcon]);
|
|
175
108
|
var contentIsSingleChild = !action || !!action && !text;
|
|
176
109
|
/**
|
|
177
110
|
* We render the "content" twice below. The first one is visible to the user
|
|
@@ -182,9 +115,19 @@ function Tag(props, containerRef) {
|
|
|
182
115
|
* seconds content component, and calculate the max width of the container.
|
|
183
116
|
*/
|
|
184
117
|
|
|
185
|
-
return _react.default.createElement(Container, _extends({}, rest, {
|
|
186
|
-
|
|
187
|
-
|
|
118
|
+
return _react.default.createElement(_styles.Container, _extends({}, rest, actionAttributes, {
|
|
119
|
+
tabIndex: 0,
|
|
120
|
+
size: size,
|
|
121
|
+
isSingleChild: contentIsSingleChild,
|
|
122
|
+
palette: palette,
|
|
123
|
+
ref: containerRef,
|
|
124
|
+
onBlur: onTagBlur,
|
|
125
|
+
onClick: action,
|
|
126
|
+
onFocus: onTagFocus,
|
|
127
|
+
isFocused: isFocused,
|
|
128
|
+
actionIntent: actionIntent
|
|
129
|
+
}), _react.default.createElement(_styles.Content, {
|
|
130
|
+
palette: palette,
|
|
188
131
|
hasIcon: !!Icon,
|
|
189
132
|
isSingleChild: contentIsSingleChild
|
|
190
133
|
}, Icon && _react.default.createElement(Icon, {
|
|
@@ -192,9 +135,9 @@ function Tag(props, containerRef) {
|
|
|
192
135
|
}), text && _react.default.createElement(_Typography.P, {
|
|
193
136
|
as: "span",
|
|
194
137
|
color: "inherit",
|
|
195
|
-
size:
|
|
138
|
+
size: size === 'small' ? 'small' : undefined,
|
|
196
139
|
truncate: true
|
|
197
|
-
}, text)),
|
|
140
|
+
}, text)), ActionElement);
|
|
198
141
|
}
|
|
199
142
|
|
|
200
143
|
var TagWithRef = (0, _react.forwardRef)(Tag); // @ts-ignore
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
4
|
|
|
5
|
+
require("jest-styled-components");
|
|
6
|
+
|
|
5
7
|
var _react2 = require("@testing-library/react");
|
|
6
8
|
|
|
7
9
|
var _Home = _interopRequireDefault(require("@decisiv/iconix/lib/components/Home"));
|
|
@@ -17,6 +19,7 @@ describe('Tag', function () {
|
|
|
17
19
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
20
|
var variant = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
21
|
return (0, _react2.render)(_react.default.createElement(_.default, _extends({
|
|
22
|
+
"data-testid": "tag",
|
|
20
23
|
text: "text"
|
|
21
24
|
}, props, {
|
|
22
25
|
variant: variant
|
|
@@ -83,12 +86,246 @@ describe('Tag', function () {
|
|
|
83
86
|
describe('Outline variant', function () {
|
|
84
87
|
TestVariant('outline');
|
|
85
88
|
});
|
|
89
|
+
describe('Size Props', function () {
|
|
90
|
+
describe('when the size is "small"', function () {
|
|
91
|
+
it('renders with a height of 1.25rem', function () {
|
|
92
|
+
var _render = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
93
|
+
"data-testid": "small-tag",
|
|
94
|
+
text: "text",
|
|
95
|
+
size: "small"
|
|
96
|
+
})),
|
|
97
|
+
getByTestId = _render.getByTestId;
|
|
98
|
+
|
|
99
|
+
expect(getByTestId('small-tag')).toHaveStyleRule('height', '1.25rem');
|
|
100
|
+
});
|
|
101
|
+
it('renders with a font-size of 0.75rem', function () {
|
|
102
|
+
var _render2 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
103
|
+
"data-testid": "small-tag",
|
|
104
|
+
text: "text",
|
|
105
|
+
size: "small"
|
|
106
|
+
})),
|
|
107
|
+
getByText = _render2.getByText;
|
|
108
|
+
|
|
109
|
+
expect(getByText(/text/i, {
|
|
110
|
+
selector: 'span'
|
|
111
|
+
})).toHaveStyleRule('font-size', '0.75rem');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
describe('when the size is "medium"', function () {
|
|
115
|
+
it('renders with a height of 1.5625rem', function () {
|
|
116
|
+
var _render3 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
117
|
+
"data-testid": "medium-tag",
|
|
118
|
+
text: "text",
|
|
119
|
+
size: "medium"
|
|
120
|
+
})),
|
|
121
|
+
getByTestId = _render3.getByTestId;
|
|
122
|
+
|
|
123
|
+
expect(getByTestId('medium-tag')).toHaveStyleRule('height', '1.5625rem');
|
|
124
|
+
});
|
|
125
|
+
it('renders with a font-size of 0.875rem', function () {
|
|
126
|
+
var _render4 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
127
|
+
"data-testid": "small-tag",
|
|
128
|
+
text: "text",
|
|
129
|
+
size: "medium"
|
|
130
|
+
})),
|
|
131
|
+
getByText = _render4.getByText;
|
|
132
|
+
|
|
133
|
+
expect(getByText(/text/i, {
|
|
134
|
+
selector: 'span'
|
|
135
|
+
})).toHaveStyleRule('font-size', '0.875rem');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
describe('Palette variants', function () {
|
|
140
|
+
describe('bright', function () {
|
|
141
|
+
it('renders correctly', function () {
|
|
142
|
+
var _render5 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
143
|
+
text: "text",
|
|
144
|
+
palette: "bright"
|
|
145
|
+
})),
|
|
146
|
+
container = _render5.container;
|
|
147
|
+
|
|
148
|
+
expect(container).toMatchSnapshot();
|
|
149
|
+
});
|
|
150
|
+
it('renders correctly with an Icon', function () {
|
|
151
|
+
var _render6 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
152
|
+
text: "text",
|
|
153
|
+
palette: "bright",
|
|
154
|
+
icon: _Home.default
|
|
155
|
+
})),
|
|
156
|
+
container = _render6.container;
|
|
157
|
+
|
|
158
|
+
expect(container).toMatchSnapshot();
|
|
159
|
+
});
|
|
160
|
+
it('renders correctly with different colors', function () {
|
|
161
|
+
var _render7 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
162
|
+
text: "text",
|
|
163
|
+
palette: "bright",
|
|
164
|
+
color: "information"
|
|
165
|
+
})),
|
|
166
|
+
container = _render7.container;
|
|
167
|
+
|
|
168
|
+
expect(container).toMatchSnapshot();
|
|
169
|
+
});
|
|
170
|
+
it('renders correctly with an action', function () {
|
|
171
|
+
var _render8 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
172
|
+
"data-testid": "action-tag",
|
|
173
|
+
text: "text",
|
|
174
|
+
palette: "bright",
|
|
175
|
+
action: jest.fn(),
|
|
176
|
+
actionAttributes: {
|
|
177
|
+
'aria-label': 'test'
|
|
178
|
+
},
|
|
179
|
+
actionIcon: _Home.default
|
|
180
|
+
})),
|
|
181
|
+
container = _render8.container,
|
|
182
|
+
getByTestId = _render8.getByTestId;
|
|
183
|
+
|
|
184
|
+
expect(getByTestId('action-tag')).toHaveStyleRule('cursor', 'pointer');
|
|
185
|
+
expect(container).toMatchSnapshot();
|
|
186
|
+
});
|
|
187
|
+
it('renders the action correctly with the danger intent', function () {
|
|
188
|
+
var _render9 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
189
|
+
text: "text",
|
|
190
|
+
palette: "bright",
|
|
191
|
+
action: jest.fn(),
|
|
192
|
+
actionAttributes: {
|
|
193
|
+
'aria-label': 'test'
|
|
194
|
+
},
|
|
195
|
+
actionIcon: _Home.default,
|
|
196
|
+
actionIntent: "danger"
|
|
197
|
+
})),
|
|
198
|
+
container = _render9.container;
|
|
199
|
+
|
|
200
|
+
expect(container).toMatchSnapshot();
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
describe('pastel', function () {
|
|
204
|
+
it('renders correctly', function () {
|
|
205
|
+
var _render10 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
206
|
+
text: "text",
|
|
207
|
+
palette: "pastel"
|
|
208
|
+
})),
|
|
209
|
+
container = _render10.container;
|
|
210
|
+
|
|
211
|
+
expect(container).toMatchSnapshot();
|
|
212
|
+
});
|
|
213
|
+
it('renders correctly with an Icon', function () {
|
|
214
|
+
var _render11 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
215
|
+
text: "text",
|
|
216
|
+
palette: "pastel",
|
|
217
|
+
icon: _Home.default
|
|
218
|
+
})),
|
|
219
|
+
container = _render11.container;
|
|
220
|
+
|
|
221
|
+
expect(container).toMatchSnapshot();
|
|
222
|
+
});
|
|
223
|
+
it('renders correctly with different colors', function () {
|
|
224
|
+
var _render12 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
225
|
+
text: "text",
|
|
226
|
+
palette: "pastel",
|
|
227
|
+
color: "information"
|
|
228
|
+
})),
|
|
229
|
+
container = _render12.container;
|
|
230
|
+
|
|
231
|
+
expect(container).toMatchSnapshot();
|
|
232
|
+
});
|
|
233
|
+
it('renders correctly with an action', function () {
|
|
234
|
+
var _render13 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
235
|
+
text: "text",
|
|
236
|
+
palette: "pastel",
|
|
237
|
+
action: jest.fn(),
|
|
238
|
+
actionAttributes: {
|
|
239
|
+
'aria-label': 'test'
|
|
240
|
+
},
|
|
241
|
+
actionIcon: _Home.default
|
|
242
|
+
})),
|
|
243
|
+
container = _render13.container;
|
|
244
|
+
|
|
245
|
+
expect(container).toMatchSnapshot();
|
|
246
|
+
});
|
|
247
|
+
it('renders the action correctly with the danger intent', function () {
|
|
248
|
+
var _render14 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
249
|
+
text: "text",
|
|
250
|
+
palette: "pastel",
|
|
251
|
+
action: jest.fn(),
|
|
252
|
+
actionAttributes: {
|
|
253
|
+
'aria-label': 'test'
|
|
254
|
+
},
|
|
255
|
+
actionIcon: _Home.default,
|
|
256
|
+
actionIntent: "danger"
|
|
257
|
+
})),
|
|
258
|
+
container = _render14.container;
|
|
259
|
+
|
|
260
|
+
expect(container).toMatchSnapshot();
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
describe('dark', function () {
|
|
264
|
+
it('renders correctly', function () {
|
|
265
|
+
var _render15 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
266
|
+
text: "text",
|
|
267
|
+
palette: "dark"
|
|
268
|
+
})),
|
|
269
|
+
container = _render15.container;
|
|
270
|
+
|
|
271
|
+
expect(container).toMatchSnapshot();
|
|
272
|
+
});
|
|
273
|
+
it('renders correctly with an Icon', function () {
|
|
274
|
+
var _render16 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
275
|
+
text: "text",
|
|
276
|
+
palette: "dark",
|
|
277
|
+
icon: _Home.default
|
|
278
|
+
})),
|
|
279
|
+
container = _render16.container;
|
|
280
|
+
|
|
281
|
+
expect(container).toMatchSnapshot();
|
|
282
|
+
});
|
|
283
|
+
it('renders correctly with different colors', function () {
|
|
284
|
+
var _render17 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
285
|
+
text: "text",
|
|
286
|
+
palette: "dark",
|
|
287
|
+
color: "information"
|
|
288
|
+
})),
|
|
289
|
+
container = _render17.container;
|
|
290
|
+
|
|
291
|
+
expect(container).toMatchSnapshot();
|
|
292
|
+
});
|
|
293
|
+
it('renders correctly with an action', function () {
|
|
294
|
+
var _render18 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
295
|
+
text: "text",
|
|
296
|
+
palette: "dark",
|
|
297
|
+
action: jest.fn(),
|
|
298
|
+
actionAttributes: {
|
|
299
|
+
'aria-label': 'test'
|
|
300
|
+
},
|
|
301
|
+
actionIcon: _Home.default
|
|
302
|
+
})),
|
|
303
|
+
container = _render18.container;
|
|
304
|
+
|
|
305
|
+
expect(container).toMatchSnapshot();
|
|
306
|
+
});
|
|
307
|
+
it('renders the action correctly with the danger intent', function () {
|
|
308
|
+
var _render19 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
309
|
+
text: "text",
|
|
310
|
+
palette: "dark",
|
|
311
|
+
action: jest.fn(),
|
|
312
|
+
actionAttributes: {
|
|
313
|
+
'aria-label': 'test'
|
|
314
|
+
},
|
|
315
|
+
actionIcon: _Home.default,
|
|
316
|
+
actionIntent: "danger"
|
|
317
|
+
})),
|
|
318
|
+
container = _render19.container;
|
|
319
|
+
|
|
320
|
+
expect(container).toMatchSnapshot();
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
});
|
|
86
324
|
describe('Common', function () {
|
|
87
325
|
it('does not render a provided action if there is not text', function () {
|
|
88
326
|
jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
89
327
|
|
|
90
328
|
var _renderTag6 = renderTag({
|
|
91
|
-
icon: _Home.default,
|
|
92
329
|
text: undefined,
|
|
93
330
|
action: function action() {
|
|
94
331
|
return null;
|
|
@@ -100,7 +337,7 @@ describe('Tag', function () {
|
|
|
100
337
|
}, 'normal'),
|
|
101
338
|
container = _renderTag6.container;
|
|
102
339
|
|
|
103
|
-
expect(container.querySelectorAll('
|
|
340
|
+
expect(container.querySelectorAll('svg').length).toBe(0);
|
|
104
341
|
expect(console.error).toHaveBeenCalled(); // @ts-ignore
|
|
105
342
|
|
|
106
343
|
console.error.mockRestore();
|
|
@@ -7,8 +7,10 @@ export declare const propTypes: {
|
|
|
7
7
|
actionAttributes: any;
|
|
8
8
|
actionIntent: PropTypes.Requireable<string>;
|
|
9
9
|
actionRef: PropTypes.Requireable<any>;
|
|
10
|
-
color: PropTypes.Requireable<
|
|
10
|
+
color: PropTypes.Requireable<"danger" | "success" | "information" | "warning" | "berryCrisp" | "koolaidCake" | "cookieMonster" | "cottonCandy" | "fizzyLime" | "mamboMango" | "carrotCake" | "roseGummy" | "licoriceMousse">;
|
|
11
11
|
variant: PropTypes.Requireable<string>;
|
|
12
|
+
palette: PropTypes.Requireable<string>;
|
|
13
|
+
size: PropTypes.Requireable<string>;
|
|
12
14
|
};
|
|
13
15
|
export declare const defaultProps: {
|
|
14
16
|
action: undefined;
|
|
@@ -20,5 +22,6 @@ export declare const defaultProps: {
|
|
|
20
22
|
icon: undefined;
|
|
21
23
|
text: undefined;
|
|
22
24
|
variant: string;
|
|
25
|
+
palette: string;
|
|
23
26
|
};
|
|
24
27
|
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/propTypes.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAYnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/propTypes.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAYnC,eAAO,MAAM,SAAS;;;;;;;;;;;;CA4BrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;CAWxB,CAAC"}
|
|
@@ -40,7 +40,9 @@ var propTypes = {
|
|
|
40
40
|
actionIntent: _propTypes.default.oneOf(['normal', 'danger']),
|
|
41
41
|
actionRef: _propTypes.default.any,
|
|
42
42
|
color: _propTypes.default.oneOf(_commonUIColors.commonUIColorKeys),
|
|
43
|
-
variant: _propTypes.default.oneOf(['normal', 'outline'])
|
|
43
|
+
variant: _propTypes.default.oneOf(['normal', 'outline']),
|
|
44
|
+
palette: _propTypes.default.oneOf(['pastel', 'bright', 'dark']),
|
|
45
|
+
size: _propTypes.default.oneOf(['small', 'medium'])
|
|
44
46
|
};
|
|
45
47
|
exports.propTypes = propTypes;
|
|
46
48
|
var defaultProps = {
|
|
@@ -52,6 +54,7 @@ var defaultProps = {
|
|
|
52
54
|
color: undefined,
|
|
53
55
|
icon: undefined,
|
|
54
56
|
text: undefined,
|
|
55
|
-
variant: 'normal'
|
|
57
|
+
variant: 'normal',
|
|
58
|
+
palette: 'bright'
|
|
56
59
|
};
|
|
57
60
|
exports.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAAmC,CAAC;AAoDhD,eAAe,MAAM,CAAC"}
|
|
@@ -14,9 +14,11 @@ var schema = (0, _reactDesc.describe)({
|
|
|
14
14
|
displayName: 'Tag'
|
|
15
15
|
});
|
|
16
16
|
schema.propTypes = {
|
|
17
|
-
text: _reactDesc.PropTypes.
|
|
17
|
+
text: _reactDesc.PropTypes.node.description('Content to render inside the tag (string or any React node)'),
|
|
18
18
|
icon: _reactDesc.PropTypes.element.description('Which `iconix` icon to render as the main icon'),
|
|
19
|
+
size: _reactDesc.PropTypes.oneOf(['small', 'medium']).description('The size to use for the Tag').defaultValue('small'),
|
|
19
20
|
color: _reactDesc.PropTypes.oneOf(_commonUIColors.commonUIColorKeys).description('The color to use as the tag background or SVG color when outlined').format('string (see notes below)').defaultValue('licoriceMousse'),
|
|
21
|
+
palette: _reactDesc.PropTypes.oneOf(['bright', 'pastel', 'dark']).description('What color variant to render').defaultValue('bright'),
|
|
20
22
|
variant: _reactDesc.PropTypes.oneOf(['normal', 'outline']).description('What tag variant to render').defaultValue('normal'),
|
|
21
23
|
action: _reactDesc.PropTypes.func.description('A function to callback when the action button is clicked'),
|
|
22
24
|
actionRef: _reactDesc.PropTypes.any.description('Provide a "React Ref" to get a reference to the action\'s DOM node'),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TagProps } from './types';
|
|
2
|
+
interface ContentProps extends Pick<TagProps, 'palette'> {
|
|
3
|
+
hasIcon: boolean;
|
|
4
|
+
isSingleChild: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare type ContainerProps = TagProps & {
|
|
7
|
+
isFocused: boolean;
|
|
8
|
+
isSingleChild: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const Content: import("styled-components").StyledComponent<"div", any, ContentProps, never>;
|
|
11
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, ContainerProps, never>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/styles.ts"],"names":[],"mappings":"AAeA,OAAO,EAAa,QAAQ,EAAoB,MAAM,SAAS,CAAC;AAahE,UAAU,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IACtD,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,aAAK,cAAc,GAAG,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC;AAkBhF,eAAO,MAAM,OAAO,8EAkCnB,CAAC;AAqHF,eAAO,MAAM,SAAS,gFAqDrB,CAAC"}
|