@decisiv/ui-components 2.0.1-alpha.17 → 2.0.1-alpha.174
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 +4 -2
- package/lib/components/Button/StyledButton.d.ts.map +1 -1
- package/lib/components/Button/StyledButton.js +37 -10
- 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 +6 -1
- package/lib/components/Button/schema.d.ts.map +1 -1
- package/lib/components/Button/schema.js +13 -5
- package/lib/components/Button/types.d.ts +4 -1
- package/lib/components/Button/types.d.ts.map +1 -1
- package/lib/components/Button/types.js +5 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/Checkbox/schema.d.ts.map +1 -1
- package/lib/components/Checkbox/schema.js +2 -0
- package/lib/components/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 +27 -0
- package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
- package/lib/providers/ConfigProvider/utils/translations.js +27 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/LeftNav/Item/NavExpandedItem/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,aAAa,EAId,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/LeftNav/Item/NavExpandedItem/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAEL,aAAa,EAId,MAAM,aAAa,CAAC;AAcrB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAqMlE"}
|
|
@@ -29,6 +29,8 @@ var _SubItemsWrapper = _interopRequireDefault(require("../SubItemsWrapper"));
|
|
|
29
29
|
|
|
30
30
|
var _ItemWrapper = _interopRequireDefault(require("../ItemWrapper"));
|
|
31
31
|
|
|
32
|
+
var _MenuItemWrapper = _interopRequireDefault(require("../MenuItemWrapper"));
|
|
33
|
+
|
|
32
34
|
var _useMenuItem2 = _interopRequireDefault(require("../hooks/useMenuItem"));
|
|
33
35
|
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -71,11 +73,12 @@ function MenuItem(props) {
|
|
|
71
73
|
|
|
72
74
|
if (kind === 'MenuItemTopLink') {
|
|
73
75
|
var _ref2 = item,
|
|
74
|
-
Icon = _ref2.icon
|
|
76
|
+
Icon = _ref2.icon,
|
|
77
|
+
selected = _ref2.active;
|
|
75
78
|
|
|
76
79
|
var _to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
77
80
|
|
|
78
|
-
var _active = !disabled && currentPath === _to;
|
|
81
|
+
var _active = !disabled && (currentPath === _to || selected);
|
|
79
82
|
|
|
80
83
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
81
84
|
active: _active,
|
|
@@ -94,29 +97,36 @@ function MenuItem(props) {
|
|
|
94
97
|
if (kind === 'MenuItemTopLinkWithSubItems') {
|
|
95
98
|
var _ref3 = item,
|
|
96
99
|
_Icon = _ref3.icon,
|
|
97
|
-
items = _ref3.items
|
|
100
|
+
items = _ref3.items,
|
|
101
|
+
_selected = _ref3.active;
|
|
98
102
|
|
|
99
103
|
var _to2 = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
100
104
|
|
|
101
|
-
var _active2 = !disabled && currentPath === _to2;
|
|
105
|
+
var _active2 = !disabled && (currentPath === _to2 || _selected);
|
|
102
106
|
|
|
103
107
|
return _react.default.createElement("li", null, _react.default.createElement(_ItemWrapper.default, {
|
|
104
108
|
as: "div",
|
|
105
109
|
active: _active2,
|
|
106
110
|
disabled: disabled,
|
|
107
|
-
navVariant: navVariant
|
|
108
|
-
|
|
111
|
+
navVariant: navVariant,
|
|
112
|
+
flexDirection: "column"
|
|
113
|
+
}, _react.default.createElement(_Flex.default, {
|
|
114
|
+
flexWrap: "wrap"
|
|
115
|
+
}, _react.default.createElement(_MenuItemWrapper.default, {
|
|
116
|
+
flex: "1 0"
|
|
117
|
+
}, _react.default.createElement(_ClickArea.default, {
|
|
109
118
|
"aria-disabled": disabled,
|
|
110
119
|
as: disabled ? 'div' : MenuItemLink,
|
|
111
120
|
disabled: disabled,
|
|
112
121
|
navVariant: navVariant,
|
|
113
122
|
tabIndex: disabled ? undefined : 0,
|
|
114
123
|
to: disabled ? undefined : _to2
|
|
115
|
-
}, _react.default.createElement(_IconWrapper.default, null, _react.default.createElement(_Icon, null)), _react.default.createElement(_TextWrapper.default, null, text)), _react.default.createElement(
|
|
124
|
+
}, _react.default.createElement(_IconWrapper.default, null, _react.default.createElement(_Icon, null)), _react.default.createElement(_TextWrapper.default, null, text))), _react.default.createElement(_MenuItemWrapper.default, {
|
|
125
|
+
flexDirection: "column"
|
|
126
|
+
}, _react.default.createElement(_ClickArea.default, {
|
|
116
127
|
"aria-disabled": disabled,
|
|
117
128
|
as: "button",
|
|
118
129
|
disabled: disabled,
|
|
119
|
-
flex: 0,
|
|
120
130
|
flexDirection: "column",
|
|
121
131
|
navVariant: navVariant,
|
|
122
132
|
onClick: toggleExpanded,
|
|
@@ -128,7 +138,7 @@ function MenuItem(props) {
|
|
|
128
138
|
size: "small"
|
|
129
139
|
}) : _react.default.createElement(_CaretDown.default, {
|
|
130
140
|
size: "small"
|
|
131
|
-
}))))), expanded && _react.default.createElement(_SubItemsWrapper.default, {
|
|
141
|
+
})))))), expanded && _react.default.createElement(_SubItemsWrapper.default, {
|
|
132
142
|
navVariant: navVariant
|
|
133
143
|
}, items.map(function (subItem) {
|
|
134
144
|
var key = subItem.text;
|
|
@@ -148,8 +158,9 @@ function MenuItem(props) {
|
|
|
148
158
|
return _react.default.createElement("li", null, _react.default.createElement(_ItemWrapper.default, {
|
|
149
159
|
as: "div",
|
|
150
160
|
disabled: disabled,
|
|
151
|
-
navVariant: navVariant
|
|
152
|
-
|
|
161
|
+
navVariant: navVariant,
|
|
162
|
+
flexDirection: "column"
|
|
163
|
+
}, _react.default.createElement(_MenuItemWrapper.default, null, _react.default.createElement(_ClickArea.default, {
|
|
153
164
|
"aria-disabled": disabled,
|
|
154
165
|
as: "button",
|
|
155
166
|
disabled: disabled,
|
|
@@ -162,7 +173,7 @@ function MenuItem(props) {
|
|
|
162
173
|
size: "small"
|
|
163
174
|
}) : _react.default.createElement(_CaretDown.default, {
|
|
164
175
|
size: "small"
|
|
165
|
-
}))), _react.default.createElement(_SubItemsWrapper.default, {
|
|
176
|
+
})))), _react.default.createElement(_SubItemsWrapper.default, {
|
|
166
177
|
expanded: expanded,
|
|
167
178
|
navVariant: navVariant
|
|
168
179
|
}, expanded && _items.map(function (subItem) {
|
|
@@ -178,7 +189,7 @@ function MenuItem(props) {
|
|
|
178
189
|
|
|
179
190
|
|
|
180
191
|
var to = (0, _utils.isMenuItemInternalLink)(item) ? item.path : item.url;
|
|
181
|
-
var active = !disabled && currentPath === to;
|
|
192
|
+
var active = !disabled && (currentPath === to || item.active);
|
|
182
193
|
return _react.default.createElement(_ItemWrapper.default, {
|
|
183
194
|
active: active,
|
|
184
195
|
disabled: disabled,
|
|
@@ -6,9 +6,9 @@ import { MenuItemProps } from '../types';
|
|
|
6
6
|
export interface MenuItemDisplayProps extends FlexComponentProps {
|
|
7
7
|
active?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
navVariant?: keyof typeof NAV_EXPANDED_STATES;
|
|
9
10
|
to?: string;
|
|
10
11
|
variant?: 'expander' | 'sub';
|
|
11
|
-
navVariant?: keyof typeof NAV_EXPANDED_STATES;
|
|
12
12
|
}
|
|
13
13
|
export declare type RendererProps = MenuItemProps & {
|
|
14
14
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/LeftNav/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/LeftNav/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CAC9B;AAED,oBAAY,aAAa,GAAG,aAAa,GAAG;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B,CAAC"}
|
|
@@ -65,12 +65,21 @@ var items = [{
|
|
|
65
65
|
}, {
|
|
66
66
|
text: 'sub item external link',
|
|
67
67
|
url: 'https://www.google.com'
|
|
68
|
+
}, {
|
|
69
|
+
text: 'selected sub level item',
|
|
70
|
+
path: '/#sub/#im-active',
|
|
71
|
+
active: true
|
|
68
72
|
}]
|
|
69
73
|
}, {
|
|
70
74
|
icon: _iconix.default.Angry,
|
|
71
75
|
text: 'disabled top level internal link',
|
|
72
76
|
path: '/#angry',
|
|
73
77
|
disabled: true
|
|
78
|
+
}, {
|
|
79
|
+
icon: _iconix.default.Check,
|
|
80
|
+
text: 'selected top level item',
|
|
81
|
+
path: '/#im-active',
|
|
82
|
+
active: true
|
|
74
83
|
}];
|
|
75
84
|
var defaultProps = {
|
|
76
85
|
currentPath: '/',
|
|
@@ -120,14 +129,15 @@ describe('LeftNav', function () {
|
|
|
120
129
|
test('clicking expander button toggles the sub menu', function () {
|
|
121
130
|
var _render4 = render(_react2.default.createElement(_.default, defaultProps)),
|
|
122
131
|
container = _render4.container,
|
|
123
|
-
queryByText = _render4.queryByText
|
|
132
|
+
queryByText = _render4.queryByText,
|
|
133
|
+
getByRole = _render4.getByRole;
|
|
124
134
|
|
|
125
135
|
var linkWithSubItems = items[3];
|
|
126
136
|
var itemLink = queryByText(linkWithSubItems.text);
|
|
127
|
-
var
|
|
137
|
+
var expanderButtonContainer = itemLink.closest('a').parentElement.nextSibling;
|
|
128
138
|
expect(queryByText(linkWithSubItems.items[0].text)).toBe(null);
|
|
129
139
|
|
|
130
|
-
_react.fireEvent.click(
|
|
140
|
+
_react.fireEvent.click((0, _react.within)(expanderButtonContainer).getByRole('button'));
|
|
131
141
|
|
|
132
142
|
expect(queryByText(linkWithSubItems.items[0].text)).toBeTruthy();
|
|
133
143
|
expect(container).toMatchSnapshot();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAuC,CAAC;AA6DpD,eAAe,MAAM,CAAC"}
|
|
@@ -17,12 +17,14 @@ schema.propTypes = {
|
|
|
17
17
|
navExpandedState: _reactDesc.PropTypes.oneOf(['COLLAPSED_XY', 'COLLAPSED_X', 'EXPANDED']).description('A value used to control the expanded state of the nav. If provided, will always override internal values'),
|
|
18
18
|
onChangeNavExpandedState: _reactDesc.PropTypes.func.description('An event handler used to track when a user requests a change to the nav expanded state. Will not be called when the nav expanded state changes based on screen size.'),
|
|
19
19
|
items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
20
|
+
active: _reactDesc.PropTypes.bool.description('Sets the menu item as active.'),
|
|
20
21
|
disabled: _reactDesc.PropTypes.bool.description('Disables the menu item.'),
|
|
21
22
|
icon: _reactDesc.PropTypes.func.description('Which `iconix` icon to render.').isRequired,
|
|
22
23
|
text: _reactDesc.PropTypes.string.description('The label for the menu item.').isRequired,
|
|
23
24
|
path: _reactDesc.PropTypes.string.description('The path for an internal link. Can not be used with a `url` attribute.'),
|
|
24
25
|
url: _reactDesc.PropTypes.string.description('The path for an external link. Can not be used with a `path` attribute.'),
|
|
25
26
|
items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
|
|
27
|
+
active: _reactDesc.PropTypes.bool.description('Sets the menu item as active.'),
|
|
26
28
|
disabled: _reactDesc.PropTypes.bool.description('Disables the menu subitem.'),
|
|
27
29
|
text: _reactDesc.PropTypes.string.description('The label for the menu subitem.').isRequired,
|
|
28
30
|
path: _reactDesc.PropTypes.string.description('The path for an internal link. Can not be used with a `url` attribute.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oBAAY,aAAa,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAExE,oBAAY,eAAe,GAAG,aAAa,GAAG;IAC5C,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,oBAAY,uBAAuB,GAAG,YAAY,GAAG;IACnD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,oBAAY,2BAA2B,GAAG,oBAAoB,GAAG;IAC/D,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,oBAAY,SAAS,GACjB,eAAe,GACf,uBAAuB,GACvB,2BAA2B,CAAC;AAChC,oBAAY,UAAU,GAAG,SAAS,EAAE,CAAC;AAErC,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,EAAE,KAAK,CAAC;CAChB;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC3D,gBAAgB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IACpD,wBAAwB,CAAC,EAAE,CACzB,gBAAgB,EAAE,MAAM,OAAO,mBAAmB,KAC/C,IAAI,CAAC;CACX"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/LeftNav/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oBAAY,aAAa,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAExE,oBAAY,eAAe,GAAG,aAAa,GAAG;IAC5C,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,oBAAY,uBAAuB,GAAG,YAAY,GAAG;IACnD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,oBAAY,2BAA2B,GAAG,oBAAoB,GAAG;IAC/D,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,oBAAY,SAAS,GACjB,eAAe,GACf,uBAAuB,GACvB,2BAA2B,CAAC;AAChC,oBAAY,UAAU,GAAG,SAAS,EAAE,CAAC;AAErC,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC9C,OAAO,EAAE,KAAK,CAAC;CAChB;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IAC3D,gBAAgB,CAAC,EAAE,MAAM,OAAO,mBAAmB,CAAC;IACpD,wBAAwB,CAAC,EAAE,CACzB,gBAAgB,EAAE,MAAM,OAAO,mBAAmB,KAC/C,IAAI,CAAC;CACX"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinkRendererProps } from '../../providers/ConfigProvider';
|
|
3
|
+
declare const _default: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Pick<LinkRendererProps, "children" | "to"> & React.RefAttributes<HTMLAnchorElement>>, any, {
|
|
4
|
+
size?: "small" | "medium" | undefined;
|
|
5
|
+
}, never>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=DisabledLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisabledLink.d.ts","sourceRoot":"","sources":["../../../src/components/Link/DisabledLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAM/C,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;;;;AAwBxC,wBAEE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _designTokens = require("@decisiv/design-tokens");
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
var DisabledLink = function DisabledLink(props, ref) {
|
|
29
|
+
var to = props.to,
|
|
30
|
+
children = props.children,
|
|
31
|
+
rest = _objectWithoutProperties(props, ["to", "children"]);
|
|
32
|
+
|
|
33
|
+
return _react.default.createElement("span", _extends({}, rest, {
|
|
34
|
+
ref: ref
|
|
35
|
+
}), children);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var DisabledLinkWithRef = (0, _react.forwardRef)(DisabledLink);
|
|
39
|
+
var disabledLinkStyles = (0, _styledComponents.css)(["cursor:not-allowed;color:", ";", ";"], (0, _toColorString.default)(_designTokens.color.opacity.charcoal40), _styles.sharedLinkStyles);
|
|
40
|
+
|
|
41
|
+
var _default = (0, _styledComponents.default)(DisabledLinkWithRef).withConfig({
|
|
42
|
+
displayName: "DisabledLink",
|
|
43
|
+
componentId: "sc-129tszc-0"
|
|
44
|
+
})(["", ""], disabledLinkStyles);
|
|
45
|
+
|
|
46
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,GAAG,EAAW,MAAM,OAAO,CAAC;AAO5C,OAAO,EAAiB,SAAS,EAAE,OAAO,EAAsB,MAAM,SAAS,CAAC;AAEhF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CA4C7E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Link;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
13
|
+
|
|
14
|
+
var _DisabledLink = _interopRequireDefault(require("./DisabledLink"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function Link(props, ref) {
|
|
29
|
+
var _useConfig = (0, _ConfigProvider.useConfig)(),
|
|
30
|
+
linkRenderer = _useConfig.linkRenderer;
|
|
31
|
+
/* istanbul ignore next: iconPosition and size default values */
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var disabled = props.disabled,
|
|
35
|
+
text = props.text,
|
|
36
|
+
icon = props.icon,
|
|
37
|
+
_props$iconPosition = props.iconPosition,
|
|
38
|
+
iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
|
|
39
|
+
_props$size = props.size,
|
|
40
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
41
|
+
rest = _objectWithoutProperties(props, ["disabled", "text", "icon", "iconPosition", "size"]);
|
|
42
|
+
|
|
43
|
+
var StyledLink = (0, _react.useMemo)(function () {
|
|
44
|
+
return disabled ? _DisabledLink.default : (0, _styledComponents.default)(linkRenderer).withConfig({
|
|
45
|
+
displayName: "Link",
|
|
46
|
+
componentId: "j02y1q-0"
|
|
47
|
+
})(["", ";"], _styles.linkStyles);
|
|
48
|
+
}, [linkRenderer, disabled]);
|
|
49
|
+
var LinkIcon = (0, _react.useMemo)(function () {
|
|
50
|
+
if (!icon) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var Icon = icon;
|
|
55
|
+
return _react.default.createElement(_styles.IconContainer, {
|
|
56
|
+
"aria-hidden": true,
|
|
57
|
+
position: iconPosition,
|
|
58
|
+
withText: !!text
|
|
59
|
+
}, _react.default.createElement(Icon, {
|
|
60
|
+
size: size
|
|
61
|
+
}));
|
|
62
|
+
}, [icon, iconPosition, size, text]);
|
|
63
|
+
return _react.default.createElement(StyledLink, _extends({}, rest, {
|
|
64
|
+
ref: ref,
|
|
65
|
+
size: size
|
|
66
|
+
}), !!icon && iconPosition === 'left' && LinkIcon, text, !!icon && iconPosition === 'right' && LinkIcon);
|
|
67
|
+
}
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { IconProps } from '@decisiv/iconix';
|
|
5
|
-
import { LinkRendererRef } from '../../providers/ConfigProvider';
|
|
1
|
+
import { RefForwardingComponent } from 'react';
|
|
2
|
+
import { LinkProps, LinkRef } from './types';
|
|
3
|
+
export { linkColorStyles } from './styles';
|
|
6
4
|
export { makeLinkSchemaPropTypes } from './schema';
|
|
7
|
-
export
|
|
8
|
-
export declare type LinkSize = 'medium' | 'small';
|
|
9
|
-
export declare type IconPosition = 'left' | 'right';
|
|
10
|
-
export declare type LinkVariant = 'normal' | 'inverted';
|
|
11
|
-
declare type Color = RgbColor | RgbaColor;
|
|
12
|
-
declare type IconComponent = (props: IconProps) => JSX.Element;
|
|
13
|
-
export interface LinkProps extends ComponentPropsWithRef<'a'> {
|
|
14
|
-
icon?: IconComponent;
|
|
15
|
-
iconPosition?: IconPosition;
|
|
16
|
-
size?: LinkSize;
|
|
17
|
-
text?: string;
|
|
18
|
-
to: string;
|
|
19
|
-
variant?: LinkVariant;
|
|
20
|
-
}
|
|
21
|
-
export declare function linkColorStyles(normalColor: Color, visitedColor: Color, hoverColor: Color, focusColors?: {
|
|
22
|
-
border: Color;
|
|
23
|
-
shadow: Color;
|
|
24
|
-
}): FlattenSimpleInterpolation;
|
|
5
|
+
export { LinkProps };
|
|
25
6
|
declare const LinkWithRef: RefForwardingComponent<LinkRef, LinkProps>;
|
|
26
7
|
export default LinkWithRef;
|
|
27
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,QAAA,MAAM,WAAW,EAAE,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAE3D,CAAC;AAwBF,eAAe,WAAW,CAAC"}
|
|
@@ -3,48 +3,45 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.linkColorStyles = linkColorStyles;
|
|
7
6
|
Object.defineProperty(exports, "makeLinkSchemaPropTypes", {
|
|
8
7
|
enumerable: true,
|
|
9
8
|
get: function get() {
|
|
10
9
|
return _schema.makeLinkSchemaPropTypes;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "LinkProps", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _types.LinkProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "linkColorStyles", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _styles.linkColorStyles;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
13
24
|
exports.default = void 0;
|
|
14
25
|
|
|
15
26
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
16
27
|
|
|
17
|
-
var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
|
|
18
|
-
|
|
19
|
-
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
20
|
-
|
|
21
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
29
|
|
|
23
|
-
var _react =
|
|
24
|
-
|
|
25
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
26
|
-
|
|
27
|
-
var _styledTheming = _interopRequireDefault(require("styled-theming"));
|
|
28
|
-
|
|
29
|
-
var _designTokens = _interopRequireDefault(require("@decisiv/design-tokens"));
|
|
30
|
+
var _react = require("react");
|
|
30
31
|
|
|
31
32
|
var _propTypes2 = require("@decisiv/prop-types");
|
|
32
33
|
|
|
33
|
-
var _ConfigProvider = require("../../providers/ConfigProvider");
|
|
34
|
-
|
|
35
|
-
var _focusRingWithColor = _interopRequireDefault(require("../../utils/focusRingWithColor"));
|
|
36
|
-
|
|
37
34
|
var _schema = _interopRequireWildcard(require("./schema"));
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
var _Link = _interopRequireDefault(require("./Link"));
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
var _types = require("./types");
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
var _styles = require("./styles");
|
|
44
41
|
|
|
45
|
-
function
|
|
42
|
+
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; } }
|
|
46
43
|
|
|
47
|
-
function
|
|
44
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
45
|
|
|
49
46
|
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; }
|
|
50
47
|
|
|
@@ -52,142 +49,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
52
49
|
|
|
53
50
|
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; }
|
|
54
51
|
|
|
55
|
-
var
|
|
56
|
-
base = _designTokens$color.base,
|
|
57
|
-
interaction = _designTokens$color.interaction,
|
|
58
|
-
opacity = _designTokens$color.opacity,
|
|
59
|
-
fontSizes = _designTokens.default.typography.size.alias;
|
|
60
|
-
/*
|
|
61
|
-
Notes about changing SVG fill color inside visited links:
|
|
62
|
-
|
|
63
|
-
1: Changing the color of an node that contains SVG with nodes set to have
|
|
64
|
-
fill="currentColor" does not work on Safari for :visited links (it does
|
|
65
|
-
work on Chrome and Firefox). To work around that, we instead change the
|
|
66
|
-
fill color of those SVG nodes to the be the same color as the visited link.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
function linkColorStyles(normalColor, visitedColor, hoverColor, focusColors) {
|
|
70
|
-
var focusStyles = focusColors ? (0, _styledComponents.css)(["&:focus{border-color:", ";", "}"], (0, _toColorString.default)(focusColors.border), (0, _focusRingWithColor.default)((0, _toColorString.default)(focusColors.shadow))) : (0, _styledComponents.css)(["&:focus{border-color:transparent;box-shadow:none;}"]);
|
|
71
|
-
var normalColorString = (0, _toColorString.default)(normalColor);
|
|
72
|
-
var visitedColorString = (0, _toColorString.default)(visitedColor);
|
|
73
|
-
var hoverColorString = (0, _toColorString.default)(hoverColor);
|
|
74
|
-
return (0, _styledComponents.css)(["&:link{color:", ";}", " &:visited,&:visited svg [fill='currentColor']{color:", ";fill:", ";}&:hover,&:hover svg [fill='currentColor']{color:", ";fill:", ";}"], normalColorString, focusStyles, visitedColorString, visitedColorString, hoverColorString, hoverColorString);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var modeStateColors = {
|
|
78
|
-
light: {
|
|
79
|
-
normal: interaction.pacificOcean,
|
|
80
|
-
visited: interaction.redWine,
|
|
81
|
-
hover: interaction.indianOcean,
|
|
82
|
-
focus: {
|
|
83
|
-
border: interaction.pacificOcean,
|
|
84
|
-
shadow: interaction.pacificOcean40
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
dark: {
|
|
88
|
-
normal: interaction.arcticOcean,
|
|
89
|
-
visited: interaction.roseWine,
|
|
90
|
-
hover: interaction.atlanticOcean,
|
|
91
|
-
focus: {
|
|
92
|
-
border: interaction.arcticOcean,
|
|
93
|
-
shadow: interaction.arcticOcean40
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
var modeColorStyles = function modeColorStyles(mode) {
|
|
99
|
-
var modeColors = modeStateColors[mode];
|
|
100
|
-
return linkColorStyles(modeColors.normal, modeColors.visited, modeColors.hover, modeColors.focus);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var invertedColorStyles = function invertedColorStyles() {
|
|
104
|
-
return linkColorStyles(base.snowWhite, _objectSpread({}, base.charcoal, {
|
|
105
|
-
alpha: 0.6
|
|
106
|
-
}), _objectSpread({}, base.snowWhite, {
|
|
107
|
-
alpha: 0.7
|
|
108
|
-
}), {
|
|
109
|
-
border: base.blackSheep,
|
|
110
|
-
shadow: opacity.charcoal40
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var color = _styledTheming.default.variants(_ConfigProvider.themeKeys.mode, 'variant', {
|
|
115
|
-
normal: {
|
|
116
|
-
light: modeColorStyles('light'),
|
|
117
|
-
dark: modeColorStyles('dark')
|
|
118
|
-
},
|
|
119
|
-
inverted: {
|
|
120
|
-
light: invertedColorStyles(),
|
|
121
|
-
dark: invertedColorStyles()
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
var fontSize = function fontSize(p) {
|
|
126
|
-
var size = (0, _rem.default)(fontSizes[p.size === 'small' ? 'paragraph2' : 'default']);
|
|
127
|
-
return (0, _styledComponents.css)(["font-size:", ";"], size);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
var iconMarginProp = {
|
|
131
|
-
left: 'margin-right',
|
|
132
|
-
right: 'margin-left'
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
var iconMargin = function iconMargin(props) {
|
|
136
|
-
if (props.withText) {
|
|
137
|
-
return "".concat(iconMarginProp[props.position], ": ").concat((0, _rem.default)(5));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return '';
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
var IconContainer = _styledComponents.default.span.withConfig({
|
|
144
|
-
displayName: "Link__IconContainer",
|
|
145
|
-
componentId: "xqzqjb-0"
|
|
146
|
-
})(["line-height:0;", ";"], iconMargin);
|
|
147
|
-
|
|
148
|
-
var linkStyles = (0, _styledComponents.css)(["cursor:pointer;background-color:transparent;align-items:baseline;border:1px solid transparent;border-radius:2px;display:inline-flex;text-decoration:underline;transition:none;", ";", ";&:hover{text-decoration:underline;}", "{align-self:center;}"], fontSize, color, IconContainer);
|
|
149
|
-
|
|
150
|
-
var Link = function Link(props, ref) {
|
|
151
|
-
var _useConfig = (0, _ConfigProvider.useConfig)(),
|
|
152
|
-
linkRenderer = _useConfig.linkRenderer;
|
|
153
|
-
/* istanbul ignore next: iconPosition and size default values */
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var text = props.text,
|
|
157
|
-
icon = props.icon,
|
|
158
|
-
_props$iconPosition = props.iconPosition,
|
|
159
|
-
iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
|
|
160
|
-
_props$size = props.size,
|
|
161
|
-
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
162
|
-
rest = _objectWithoutProperties(props, ["text", "icon", "iconPosition", "size"]);
|
|
163
|
-
|
|
164
|
-
var StyledLink = (0, _react.useMemo)(function () {
|
|
165
|
-
return (0, _styledComponents.default)(linkRenderer).withConfig({
|
|
166
|
-
displayName: "Link",
|
|
167
|
-
componentId: "xqzqjb-1"
|
|
168
|
-
})(["", ";"], linkStyles);
|
|
169
|
-
}, [linkRenderer]);
|
|
170
|
-
var LinkIcon = (0, _react.useMemo)(function () {
|
|
171
|
-
if (!icon) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
var Icon = icon;
|
|
176
|
-
return _react.default.createElement(IconContainer, {
|
|
177
|
-
"aria-hidden": true,
|
|
178
|
-
position: iconPosition,
|
|
179
|
-
withText: !!text
|
|
180
|
-
}, _react.default.createElement(Icon, {
|
|
181
|
-
size: size
|
|
182
|
-
}));
|
|
183
|
-
}, [icon, iconPosition, size, text]);
|
|
184
|
-
return _react.default.createElement(StyledLink, _extends({}, rest, {
|
|
185
|
-
ref: ref,
|
|
186
|
-
size: size
|
|
187
|
-
}), !!icon && iconPosition === 'left' && LinkIcon, text, !!icon && iconPosition === 'right' && LinkIcon);
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
var LinkWithRef = (0, _react.forwardRef)(Link); // @ts-ignore
|
|
52
|
+
var LinkWithRef = (0, _react.forwardRef)(_Link.default); // @ts-ignore
|
|
191
53
|
|
|
192
54
|
LinkWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
193
55
|
'aria-label': (0, _propTypes2.requireIf)(_propTypes.default.string, function (_ref) {
|
|
@@ -195,7 +57,7 @@ LinkWithRef.propTypes = _objectSpread({}, _schema.default.propTypes, {
|
|
|
195
57
|
return (0, _isEmpty.default)(text);
|
|
196
58
|
}),
|
|
197
59
|
icon: _propTypes.default.elementType,
|
|
198
|
-
text: (0, _propTypes2.requireIf)(_propTypes.default.string, function (_ref2) {
|
|
60
|
+
text: (0, _propTypes2.requireIf)(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]), function (_ref2) {
|
|
199
61
|
var icon = _ref2.icon;
|
|
200
62
|
return (0, _isEmpty.default)(icon);
|
|
201
63
|
})
|