@decisiv/ui-components 2.0.1-alpha.17 → 2.0.1-alpha.173
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/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 +6 -0
- package/lib/atoms/InputField/index.d.ts.map +1 -1
- package/lib/atoms/InputField/index.js +25 -8
- package/lib/atoms/InputField/index.test.js +91 -0
- package/lib/atoms/InputField/schema.d.ts.map +1 -1
- package/lib/atoms/InputField/schema.js +3 -2
- package/lib/atoms/OptionsList/Category.d.ts +1 -1
- package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Category.js +4 -2
- package/lib/atoms/OptionsList/Footer.d.ts +8 -0
- package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
- package/lib/atoms/OptionsList/Footer.js +72 -0
- package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Option.js +24 -9
- package/lib/atoms/OptionsList/index.d.ts.map +1 -1
- package/lib/atoms/OptionsList/index.js +44 -17
- package/lib/atoms/OptionsList/index.test.js +127 -17
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +5 -0
- package/lib/atoms/OptionsList/types.d.ts +15 -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/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 +12 -23
- package/lib/components/Badge/index.test.js +51 -8
- package/lib/components/Badge/schema.js +1 -1
- package/lib/components/Badge/types.d.ts +1 -1
- 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 -2
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +21 -7
- package/lib/components/Button/index.d.ts.map +1 -1
- package/lib/components/Button/index.js +19 -9
- package/lib/components/Button/index.test.js +24 -8
- package/lib/components/Button/schema.d.ts +6 -1
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +11 -5
- package/lib/components/Button/types.d.ts +2 -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/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 +196 -66
- package/lib/components/Combobox/index.test.js +369 -146
- package/lib/components/Combobox/schema.d.ts.map +1 -1
- package/lib/components/Combobox/schema.js +10 -2
- package/lib/components/Combobox/types.d.ts +12 -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 +105 -0
- package/lib/components/Drawer/index.test.js +122 -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 +4 -0
- package/lib/components/DropdownList/index.d.ts.map +1 -1
- package/lib/components/DropdownList/index.js +76 -11
- 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 +6 -1
- package/lib/components/DropdownList/types.d.ts +4 -1
- package/lib/components/DropdownList/types.d.ts.map +1 -1
- 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 +31 -0
- package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
- package/lib/components/Filter/SimplePrimary/index.js +58 -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 +41 -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 +30 -0
- package/lib/components/Filter/index.d.ts +5 -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 +60 -0
- package/lib/components/Filter/kind.d.ts +6 -0
- package/lib/components/Filter/kind.d.ts.map +1 -0
- package/lib/components/Filter/kind.js +45 -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 +33 -0
- package/lib/components/Filter/types.d.ts +18 -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 +3 -3
- 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 -3
- 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/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/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +3 -1
- package/lib/components/Menu/types.d.ts +2 -0
- package/lib/components/Menu/types.d.ts.map +1 -1
- package/lib/components/Menu/types.js +5 -1
- package/lib/components/Modal/components.d.ts +2 -2
- package/lib/components/Modal/types.js +5 -1
- 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/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/Pagination/Pagination.test.js +9 -0
- 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 +6 -3
- 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 +1 -0
- 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 +190 -0
- package/lib/components/SearchInput/index.test.js +417 -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 +24 -0
- package/lib/components/SearchInput/types.d.ts +28 -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 +44 -4
- 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 +9 -0
- package/lib/components/Select/types.d.ts +6 -1
- 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 +32 -3
- 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 +31 -2
- 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/SelectMenu/index.d.ts +5 -0
- package/lib/components/SelectMenu/index.d.ts.map +1 -1
- package/lib/components/SelectMenu/index.js +27 -3
- package/lib/components/SelectMenu/schema.d.ts.map +1 -1
- package/lib/components/SelectMenu/schema.js +4 -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 +3 -0
- 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 +167 -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/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/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/index.d.ts +8 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +126 -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 +24 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +24 -0
- 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/utils/commonUIColors.d.ts +349 -1
- 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/useFirstMount.d.ts +2 -0
- package/lib/utils/useFirstMount.d.ts.map +1 -0
- package/lib/utils/useFirstMount.js +19 -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/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,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertProps } from './types';
|
|
3
|
+
export { AlertProps };
|
|
4
|
+
declare function Alert({ 'aria-label': ariaLabel, children, description, dismissable, icon, intent, onDismissClick, title, tooltipText, }: AlertProps): JSX.Element;
|
|
5
|
+
declare namespace Alert {
|
|
6
|
+
var propTypes: {
|
|
7
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
8
|
+
description: import("prop-types").Requireable<string>;
|
|
9
|
+
dismissable: import("prop-types").Requireable<boolean>;
|
|
10
|
+
icon: import("prop-types").Requireable<import("prop-types").ReactElementLike>;
|
|
11
|
+
intent: import("prop-types").Requireable<string>;
|
|
12
|
+
title: import("prop-types").Validator<string>;
|
|
13
|
+
onDismissClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
tooltipText: import("prop-types").Requireable<string>;
|
|
15
|
+
};
|
|
16
|
+
var defaultProps: {
|
|
17
|
+
'aria-label': undefined;
|
|
18
|
+
description: undefined;
|
|
19
|
+
dismissable: boolean;
|
|
20
|
+
icon: undefined;
|
|
21
|
+
intent: string;
|
|
22
|
+
onDismissClick: undefined;
|
|
23
|
+
tooltipText: undefined;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default Alert;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/index.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,iBAAwB,KAAK,CAAC,EAC5B,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,WAAW,EACX,WAAW,EACX,IAAI,EACJ,MAAsB,EACtB,cAAc,EACd,KAAK,EACL,WAAW,GACZ,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAwD1B;kBAlEuB,KAAK;;;;;;;;;;;;;;;;;;;;;eAAL,KAAK"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Alert;
|
|
7
|
+
Object.defineProperty(exports, "AlertProps", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _types.AlertProps;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
17
|
+
|
|
18
|
+
var _Times = _interopRequireDefault(require("@decisiv/iconix/lib/components/Times"));
|
|
19
|
+
|
|
20
|
+
var _useTranslations = _interopRequireDefault(require("../../utils/useTranslations"));
|
|
21
|
+
|
|
22
|
+
var _StyledButton = _interopRequireDefault(require("./StyledButton"));
|
|
23
|
+
|
|
24
|
+
var _Container = _interopRequireDefault(require("./Container"));
|
|
25
|
+
|
|
26
|
+
var _Flex = _interopRequireDefault(require("../Flex"));
|
|
27
|
+
|
|
28
|
+
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
29
|
+
|
|
30
|
+
var _Typography = require("../Typography");
|
|
31
|
+
|
|
32
|
+
var _intents = _interopRequireDefault(require("./intents"));
|
|
33
|
+
|
|
34
|
+
var _types = require("./types");
|
|
35
|
+
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
|
|
38
|
+
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
|
+
|
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
41
|
+
|
|
42
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
48
|
+
function Alert(_ref) {
|
|
49
|
+
var ariaLabel = _ref['aria-label'],
|
|
50
|
+
children = _ref.children,
|
|
51
|
+
description = _ref.description,
|
|
52
|
+
dismissable = _ref.dismissable,
|
|
53
|
+
icon = _ref.icon,
|
|
54
|
+
_ref$intent = _ref.intent,
|
|
55
|
+
intent = _ref$intent === void 0 ? 'information' : _ref$intent,
|
|
56
|
+
onDismissClick = _ref.onDismissClick,
|
|
57
|
+
title = _ref.title,
|
|
58
|
+
tooltipText = _ref.tooltipText;
|
|
59
|
+
|
|
60
|
+
var _useState = (0, _react.useState)(true),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
open = _useState2[0],
|
|
63
|
+
setOpen = _useState2[1];
|
|
64
|
+
|
|
65
|
+
var translate = (0, _useTranslations.default)();
|
|
66
|
+
var borderColor = (0, _toColorString.default)(_intents.default[intent].borderColor);
|
|
67
|
+
var Icon = icon || _intents.default[intent].icon;
|
|
68
|
+
|
|
69
|
+
var handleClick = function handleClick() {
|
|
70
|
+
setOpen(false);
|
|
71
|
+
if (onDismissClick) onDismissClick();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (!open) {
|
|
75
|
+
return _react.default.createElement(_react.default.Fragment, null);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return _react.default.createElement(_Container.default, {
|
|
79
|
+
flex: 1,
|
|
80
|
+
paddingLeft: 1.5,
|
|
81
|
+
paddingRight: 1.6,
|
|
82
|
+
paddingTop: 1.3,
|
|
83
|
+
paddingBottom: 1.1,
|
|
84
|
+
intent: intent
|
|
85
|
+
}, _react.default.createElement(Icon, {
|
|
86
|
+
color: borderColor
|
|
87
|
+
}), _react.default.createElement(_Flex.default, {
|
|
88
|
+
flexDirection: "column",
|
|
89
|
+
marginLeft: 1,
|
|
90
|
+
flex: 1
|
|
91
|
+
}, _react.default.createElement(_Flex.default, {
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
flex: 1
|
|
94
|
+
}, _react.default.createElement(_Typography.P, {
|
|
95
|
+
weight: "semibold",
|
|
96
|
+
marginRight: 1
|
|
97
|
+
}, title), dismissable && _react.default.createElement(_Tooltip.default, {
|
|
98
|
+
placement: "auto",
|
|
99
|
+
target: // eslint-disable-next-line react/jsx-wrap-multilines
|
|
100
|
+
_react.default.createElement(_StyledButton.default, {
|
|
101
|
+
variant: "ghost",
|
|
102
|
+
icon: _Times.default,
|
|
103
|
+
onClick: handleClick,
|
|
104
|
+
"aria-label": translate(ariaLabel, 'alert.closeAlert')
|
|
105
|
+
})
|
|
106
|
+
}, translate(tooltipText, 'alert.close'))), _react.default.createElement(_Typography.P, {
|
|
107
|
+
size: "small"
|
|
108
|
+
}, children || description)));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Alert.propTypes = _types.propTypes;
|
|
112
|
+
Alert.defaultProps = _types.defaultProps;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
describe('Alert', function () {
|
|
12
|
+
it('renders Title', function () {
|
|
13
|
+
var _render = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
14
|
+
title: "Alert Title"
|
|
15
|
+
})),
|
|
16
|
+
getByText = _render.getByText;
|
|
17
|
+
|
|
18
|
+
expect(getByText(/alert title/i)).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
describe('when has description', function () {
|
|
21
|
+
it('renders description', function () {
|
|
22
|
+
var _render2 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
23
|
+
title: "Alert Title",
|
|
24
|
+
description: "Alert Description"
|
|
25
|
+
})),
|
|
26
|
+
getByText = _render2.getByText;
|
|
27
|
+
|
|
28
|
+
expect(getByText(/alert description/i)).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
it('renders children as description', function () {
|
|
31
|
+
var _render3 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
32
|
+
title: "Alert Title"
|
|
33
|
+
}, "Alert Description")),
|
|
34
|
+
getByText = _render3.getByText;
|
|
35
|
+
|
|
36
|
+
expect(getByText(/alert description/i)).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('when it is dismissable', function () {
|
|
40
|
+
it('renders close button', function () {
|
|
41
|
+
var _render4 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
42
|
+
title: "Alert Title",
|
|
43
|
+
dismissable: true,
|
|
44
|
+
"aria-label": "Close Alert"
|
|
45
|
+
})),
|
|
46
|
+
getByLabelText = _render4.getByLabelText;
|
|
47
|
+
|
|
48
|
+
expect(getByLabelText(/close alert/i)).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
it('closes alert when clicking on dismiss button', function () {
|
|
51
|
+
var _render5 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
52
|
+
title: "Alert Title",
|
|
53
|
+
dismissable: true,
|
|
54
|
+
"aria-label": "Close Alert"
|
|
55
|
+
})),
|
|
56
|
+
getByLabelText = _render5.getByLabelText,
|
|
57
|
+
queryByText = _render5.queryByText;
|
|
58
|
+
|
|
59
|
+
_react2.fireEvent.click(getByLabelText(/close alert/i));
|
|
60
|
+
|
|
61
|
+
expect(queryByText(/alert title/i)).not.toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
it('triggers onDismissClick when clicking on dismiss button', function () {
|
|
64
|
+
var onDismissClick = jest.fn();
|
|
65
|
+
|
|
66
|
+
var _render6 = (0, _react2.render)(_react.default.createElement(_.default, {
|
|
67
|
+
title: "Alert Title",
|
|
68
|
+
dismissable: true,
|
|
69
|
+
"aria-label": "Close Alert",
|
|
70
|
+
onDismissClick: onDismissClick
|
|
71
|
+
})),
|
|
72
|
+
getByLabelText = _render6.getByLabelText;
|
|
73
|
+
|
|
74
|
+
_react2.fireEvent.click(getByLabelText(/close alert/i));
|
|
75
|
+
|
|
76
|
+
expect(onDismissClick).toHaveBeenCalled();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import theme from 'styled-theming';
|
|
2
|
+
import { Color } from '@decisiv/design-tokens/lib/color';
|
|
3
|
+
import InfoCircle from '@decisiv/iconix/lib/components/InfoCircle';
|
|
4
|
+
interface IntentRecord {
|
|
5
|
+
color: Color;
|
|
6
|
+
borderColor: Color;
|
|
7
|
+
icon: typeof InfoCircle;
|
|
8
|
+
}
|
|
9
|
+
declare type IntentType = Record<string, IntentRecord>;
|
|
10
|
+
declare const intents: IntentType;
|
|
11
|
+
export declare const intentStyle: theme.VariantSet;
|
|
12
|
+
export default intents;
|
|
13
|
+
//# sourceMappingURL=intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAGnC,OAAc,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAKhE,OAAO,UAAU,MAAM,2CAA2C,CAAC;AAKnE,UAAU,YAAY;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,KAAK,CAAC;IACnB,IAAI,EAAE,OAAO,UAAU,CAAC;CACzB;AAED,aAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAE/C,QAAA,MAAM,OAAO,EAAE,UAqBd,CAAC;AAEF,eAAO,MAAM,WAAW,kBAyCtB,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.intentStyle = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledTheming = _interopRequireDefault(require("styled-theming"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = require("styled-components");
|
|
11
|
+
|
|
12
|
+
var _color = _interopRequireDefault(require("@decisiv/design-tokens/lib/color"));
|
|
13
|
+
|
|
14
|
+
var _CheckCircle = _interopRequireDefault(require("@decisiv/iconix/lib/components/CheckCircle"));
|
|
15
|
+
|
|
16
|
+
var _ExclamationCircle = _interopRequireDefault(require("@decisiv/iconix/lib/components/ExclamationCircle"));
|
|
17
|
+
|
|
18
|
+
var _ExclamationTriangle = _interopRequireDefault(require("@decisiv/iconix/lib/components/ExclamationTriangle"));
|
|
19
|
+
|
|
20
|
+
var _InfoCircle = _interopRequireDefault(require("@decisiv/iconix/lib/components/InfoCircle"));
|
|
21
|
+
|
|
22
|
+
var _polished = require("polished");
|
|
23
|
+
|
|
24
|
+
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
var intents = {
|
|
29
|
+
information: {
|
|
30
|
+
color: _color.default.status.information.light,
|
|
31
|
+
borderColor: _color.default.status.information.medium,
|
|
32
|
+
icon: _InfoCircle.default
|
|
33
|
+
},
|
|
34
|
+
success: {
|
|
35
|
+
color: _color.default.status.success.light,
|
|
36
|
+
borderColor: _color.default.status.success.medium,
|
|
37
|
+
icon: _CheckCircle.default
|
|
38
|
+
},
|
|
39
|
+
warning: {
|
|
40
|
+
color: _color.default.status.warning.light,
|
|
41
|
+
borderColor: _color.default.status.warning.medium,
|
|
42
|
+
icon: _ExclamationCircle.default
|
|
43
|
+
},
|
|
44
|
+
danger: {
|
|
45
|
+
color: _color.default.status.danger.light,
|
|
46
|
+
borderColor: _color.default.status.danger.medium,
|
|
47
|
+
icon: _ExclamationTriangle.default
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var intentStyle = _styledTheming.default.variants(_ConfigProvider.themeKeys.mode, 'intent', {
|
|
52
|
+
information: {
|
|
53
|
+
light: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.information.color), (0, _polished.toColorString)(intents.information.borderColor)),
|
|
54
|
+
dark: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.information.color), (0, _polished.toColorString)(intents.information.borderColor))
|
|
55
|
+
},
|
|
56
|
+
success: {
|
|
57
|
+
light: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.success.color), (0, _polished.toColorString)(intents.success.borderColor)),
|
|
58
|
+
dark: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.success.color), (0, _polished.toColorString)(intents.success.borderColor))
|
|
59
|
+
},
|
|
60
|
+
warning: {
|
|
61
|
+
light: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.warning.color), (0, _polished.toColorString)(intents.warning.borderColor)),
|
|
62
|
+
dark: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.warning.color), (0, _polished.toColorString)(intents.warning.borderColor))
|
|
63
|
+
},
|
|
64
|
+
danger: {
|
|
65
|
+
light: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.danger.color), (0, _polished.toColorString)(intents.danger.borderColor)),
|
|
66
|
+
dark: (0, _styledComponents.css)(["background-color:", ";border-left-color:", ";"], (0, _polished.toColorString)(intents.danger.color), (0, _polished.toColorString)(intents.danger.borderColor))
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
exports.intentStyle = intentStyle;
|
|
71
|
+
var _default = intents;
|
|
72
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAyBlD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactDesc = require("react-desc");
|
|
9
|
+
|
|
10
|
+
// @ts-ignore no module typings
|
|
11
|
+
var schema = (0, _reactDesc.describe)({
|
|
12
|
+
displayName: 'Alert'
|
|
13
|
+
});
|
|
14
|
+
schema.propTypes = {
|
|
15
|
+
'aria-label': _reactDesc.PropTypes.string.description('Descriptive text for accessibility purposes'),
|
|
16
|
+
description: _reactDesc.PropTypes.string.description('Text to show as description'),
|
|
17
|
+
dismissable: _reactDesc.PropTypes.bool.description('Sets if the alert is dismissable').defaultValue('false'),
|
|
18
|
+
icon: _reactDesc.PropTypes.element.description('Must be an icon component from `@decisiv/iconix`'),
|
|
19
|
+
intent: _reactDesc.PropTypes.oneOf(['information', 'success', 'warning', 'danger']).description('Shortcuts to the most common combinations of icon and color.').defaultValue('information'),
|
|
20
|
+
title: _reactDesc.PropTypes.string.description('Text to show as title').isRequired,
|
|
21
|
+
onDismissClick: _reactDesc.PropTypes.func.description('A callback when dismissing the alert').defaultValue('undefined'),
|
|
22
|
+
tooltipText: _reactDesc.PropTypes.string.description('The text for dismiss tooltip').defaultValue('Close')
|
|
23
|
+
};
|
|
24
|
+
var _default = schema;
|
|
25
|
+
exports.default = _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { IconProps } from '@decisiv/iconix';
|
|
4
|
+
import intents from './intents';
|
|
5
|
+
export declare type IconComponent = (props: IconProps) => JSX.Element;
|
|
6
|
+
export interface AlertProps {
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
description?: string;
|
|
10
|
+
dismissable?: boolean;
|
|
11
|
+
icon?: IconComponent;
|
|
12
|
+
intent?: keyof typeof intents;
|
|
13
|
+
onDismissClick?: () => void;
|
|
14
|
+
title: string;
|
|
15
|
+
tooltipText?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const propTypes: {
|
|
18
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
19
|
+
description: PropTypes.Requireable<string>;
|
|
20
|
+
dismissable: PropTypes.Requireable<boolean>;
|
|
21
|
+
icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
22
|
+
intent: PropTypes.Requireable<string>;
|
|
23
|
+
title: PropTypes.Validator<string>;
|
|
24
|
+
onDismissClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
+
tooltipText: PropTypes.Requireable<string>;
|
|
26
|
+
};
|
|
27
|
+
export declare const defaultProps: {
|
|
28
|
+
'aria-label': undefined;
|
|
29
|
+
description: undefined;
|
|
30
|
+
dismissable: boolean;
|
|
31
|
+
icon: undefined;
|
|
32
|
+
intent: string;
|
|
33
|
+
onDismissClick: undefined;
|
|
34
|
+
tooltipText: undefined;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;CAQxB,CAAC"}
|
|
@@ -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;
|
|
@@ -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;AAQvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAsDhC,QAAA,MAAM,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,UAAU,CAE9D,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -17,8 +17,6 @@ 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
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
@@ -27,16 +25,18 @@ var _styledComponentsModifiers = require("styled-components-modifiers");
|
|
|
27
25
|
|
|
28
26
|
var _color = _interopRequireDefault(require("../../modifiers/color"));
|
|
29
27
|
|
|
28
|
+
var _constants = require("./constants");
|
|
29
|
+
|
|
30
30
|
var _commonUIColors = require("../../utils/commonUIColors");
|
|
31
31
|
|
|
32
32
|
var _utils = require("../../utils");
|
|
33
33
|
|
|
34
34
|
var _types = require("./types");
|
|
35
35
|
|
|
36
|
-
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; } }
|
|
37
|
-
|
|
38
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
37
|
|
|
38
|
+
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
|
+
|
|
40
40
|
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
41
|
|
|
42
42
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -48,32 +48,21 @@ var colorModifiers = (0, _utils.applyDynamicModifiers)('color', function (_ref)
|
|
|
48
48
|
return (0, _styledComponents.css)(["", ""], color && color in _commonUIColors.commonUIColors && (0, _color.default)(_commonUIColors.commonUIColors[color]));
|
|
49
49
|
});
|
|
50
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
51
|
var getSizeStyles = function getSizeStyles(key) {
|
|
67
|
-
return (0, _styledComponents.css)(sizeStyles[key] || '');
|
|
52
|
+
return (0, _styledComponents.css)(_constants.sizeStyles[key] || '');
|
|
68
53
|
};
|
|
69
54
|
|
|
70
55
|
var sizeModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
|
|
71
|
-
|
|
56
|
+
small: function small(_ref2) {
|
|
72
57
|
var v = _ref2.variant;
|
|
73
|
-
return getSizeStyles("
|
|
58
|
+
return getSizeStyles("small.".concat(v));
|
|
74
59
|
},
|
|
75
|
-
|
|
60
|
+
medium: function medium(_ref3) {
|
|
76
61
|
var v = _ref3.variant;
|
|
62
|
+
return getSizeStyles("medium.".concat(v));
|
|
63
|
+
},
|
|
64
|
+
large: function large(_ref4) {
|
|
65
|
+
var v = _ref4.variant;
|
|
77
66
|
return getSizeStyles("large.".concat(v));
|
|
78
67
|
}
|
|
79
68
|
}, 'size');
|
|
@@ -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,25 @@ describe('Badge', function () {
|
|
|
53
55
|
expect(container).toMatchSnapshot();
|
|
54
56
|
});
|
|
55
57
|
});
|
|
58
|
+
it("renders correctly with size=\"small\" and variant=\"square\"", function () {
|
|
59
|
+
var _renderBadge3 = renderBadge({
|
|
60
|
+
size: 'small',
|
|
61
|
+
variant: 'square'
|
|
62
|
+
}),
|
|
63
|
+
container = _renderBadge3.container;
|
|
64
|
+
|
|
65
|
+
expect(container).toMatchSnapshot();
|
|
66
|
+
});
|
|
56
67
|
it('renders correctly in any of the common UI colors', function () {
|
|
57
68
|
Object.entries(_commonUIColors.commonUIColors).forEach(function (_ref) {
|
|
58
69
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
59
70
|
key = _ref2[0],
|
|
60
71
|
value = _ref2[1];
|
|
61
72
|
|
|
62
|
-
var
|
|
73
|
+
var _renderBadge4 = renderBadge({
|
|
63
74
|
color: key
|
|
64
75
|
}),
|
|
65
|
-
container =
|
|
76
|
+
container = _renderBadge4.container;
|
|
66
77
|
|
|
67
78
|
expect(container.firstChild).toHaveStyleRule('background-color', (0, _toColorString.default)(value));
|
|
68
79
|
});
|
|
@@ -75,12 +86,44 @@ describe('Badge', function () {
|
|
|
75
86
|
// @ts-ignore
|
|
76
87
|
console.error.mockRestore();
|
|
77
88
|
});
|
|
78
|
-
it('warns
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
it('warns for invalid size/variant combinations', function () {
|
|
90
|
+
var sizes = ['small', 'medium', 'large'];
|
|
91
|
+
var variants = ['round', 'square'];
|
|
92
|
+
var validCombinations = Object.keys(_constants.sizeStyles);
|
|
93
|
+
|
|
94
|
+
for (var _i2 = 0, _sizes = sizes; _i2 < _sizes.length; _i2++) {
|
|
95
|
+
var size = _sizes[_i2];
|
|
96
|
+
var _iteratorNormalCompletion = true;
|
|
97
|
+
var _didIteratorError = false;
|
|
98
|
+
var _iteratorError = undefined;
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
for (var _iterator = variants[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
102
|
+
var variant = _step.value;
|
|
103
|
+
|
|
104
|
+
if (!validCombinations.includes("".concat(size, ".").concat(variant))) {
|
|
105
|
+
renderBadge({
|
|
106
|
+
size: size,
|
|
107
|
+
variant: variant
|
|
108
|
+
});
|
|
109
|
+
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"));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} catch (err) {
|
|
113
|
+
_didIteratorError = true;
|
|
114
|
+
_iteratorError = err;
|
|
115
|
+
} finally {
|
|
116
|
+
try {
|
|
117
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
118
|
+
_iterator.return();
|
|
119
|
+
}
|
|
120
|
+
} finally {
|
|
121
|
+
if (_didIteratorError) {
|
|
122
|
+
throw _iteratorError;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
84
127
|
});
|
|
85
128
|
});
|
|
86
129
|
});
|
|
@@ -15,7 +15,7 @@ schema.propTypes = {
|
|
|
15
15
|
'aria-label': _reactDesc.PropTypes.string.description('Descriptive text for accessibility purposes').isRequired,
|
|
16
16
|
color: _reactDesc.PropTypes.string.description('(See note) Sets the color for the background and the icon').defaultValue('information'),
|
|
17
17
|
icon: _reactDesc.PropTypes.element.description('Must be an icon component from `@decisiv/iconix`').isRequired,
|
|
18
|
-
size: _reactDesc.PropTypes.oneOf(['medium', 'large']).description('(See note) Sets the size of the badge').defaultValue('medium'),
|
|
18
|
+
size: _reactDesc.PropTypes.oneOf(['small', 'medium', 'large']).description('(See note) Sets the size of the badge').defaultValue('medium'),
|
|
19
19
|
variant: _reactDesc.PropTypes.oneOf(['round', 'square']).description('(See note) Controls primary style variations of the badge').defaultValue('round')
|
|
20
20
|
};
|
|
21
21
|
var _default = schema;
|
|
@@ -8,7 +8,7 @@ export interface BadgeProps {
|
|
|
8
8
|
'aria-label': string;
|
|
9
9
|
color?: CommonUIColorKeys;
|
|
10
10
|
icon: IconComponent;
|
|
11
|
-
size?: 'medium' | 'large';
|
|
11
|
+
size?: 'small' | 'medium' | 'large';
|
|
12
12
|
variant?: 'round' | 'square';
|
|
13
13
|
}
|
|
14
14
|
declare function variantValidator(props: BadgeProps, propName: 'variant', componentName: 'Badge'): Error | null;
|