@laerdal/life-react-components 2.3.1-dev.7 → 3.0.0
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/dist/AuthPage/AuthPage.cjs +1 -1
- package/dist/AuthPage/AuthPage.cjs.map +1 -1
- package/dist/AuthPage/AuthPage.d.ts +1 -0
- package/dist/AuthPage/AuthPage.js +1 -1
- package/dist/AuthPage/AuthPage.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +34 -32
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/Breadcrumb/Breadcrumb.js +34 -32
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +1 -1
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/HorizontalCard/types.cjs.map +1 -1
- package/dist/Card/HorizontalCard/types.d.ts +1 -1
- package/dist/Card/HorizontalCard/types.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +19 -5
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +2 -0
- package/dist/Dropdown/BasicDropdown.js +19 -5
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +6 -3
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +3 -1
- package/dist/Dropdown/CommonStyling.js +6 -3
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButtonTypes.d.ts +1 -0
- package/dist/Dropdown/DropdownFilter.cjs +14 -2
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +1 -0
- package/dist/Dropdown/DropdownFilter.js +14 -2
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Footer/Components/FooterBottomLinks.d.ts +1 -0
- package/dist/Footer/Components/FooterDropdownLinks.d.ts +1 -0
- package/dist/Footer/Components/FooterNavSection.d.ts +1 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.d.ts +1 -0
- package/dist/Footer/Components/FooterTop.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +1 -0
- package/dist/Footer/SiteFooter.cjs +30 -19
- package/dist/Footer/SiteFooter.cjs.map +1 -1
- package/dist/Footer/SiteFooter.d.ts +3 -1
- package/dist/Footer/SiteFooter.js +31 -19
- package/dist/Footer/SiteFooter.js.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +3 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +3 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +2 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +7 -2
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.d.ts +5 -0
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +6 -5
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +205 -56
- package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +2 -2
- package/dist/GlobalNavigationBar/desktop/MainMenu.js +205 -56
- package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs +259 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs.map +1 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.d.ts +21 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.js +249 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.js.map +1 -0
- package/dist/GlobalNavigationBar/desktop/UserMenu.d.ts +1 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -0
- package/dist/GlobalNavigationBar/types.cjs.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +12 -2
- package/dist/GlobalNavigationBar/types.js.map +1 -1
- package/dist/GlobalNavigationBar/utils.cjs +17 -0
- package/dist/GlobalNavigationBar/utils.cjs.map +1 -0
- package/dist/GlobalNavigationBar/utils.d.ts +2 -0
- package/dist/GlobalNavigationBar/utils.js +10 -0
- package/dist/GlobalNavigationBar/utils.js.map +1 -0
- package/dist/InputFields/DatepickerField.cjs +23 -8
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +20 -1
- package/dist/InputFields/DatepickerField.js +23 -8
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs +2 -4
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.d.ts +1 -0
- package/dist/InputFields/DatepickerFieldHeader.js +2 -4
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.d.ts +1 -1
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +18 -6
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.d.ts +17 -0
- package/dist/InputFields/NumberField.js +18 -6
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.d.ts +15 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.d.ts +1 -1
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +16 -3
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/SearchBar.cjs.map +1 -1
- package/dist/InputFields/SearchBar.d.ts +2 -2
- package/dist/InputFields/SearchBar.js.map +1 -1
- package/dist/InputFields/TextField.cjs +14 -2
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +22 -1
- package/dist/InputFields/TextField.js +14 -2
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/index.cjs.map +1 -1
- package/dist/InputFields/index.d.ts +10 -8
- package/dist/InputFields/index.js.map +1 -1
- package/dist/InputFields/styling.cjs +7 -3
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -0
- package/dist/InputFields/styling.js +7 -3
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/InputFields/types.cjs.map +1 -1
- package/dist/InputFields/types.d.ts +0 -19
- package/dist/InputFields/types.js.map +1 -1
- package/dist/Layouts/index.cjs +4 -6
- package/dist/Layouts/index.cjs.map +1 -1
- package/dist/Layouts/index.d.ts +0 -1
- package/dist/Layouts/index.js +3 -4
- package/dist/Layouts/index.js.map +1 -1
- package/dist/LoadingIndicator/LoadingIndicator.d.ts +1 -0
- package/dist/MiniProductCard/MiniProductCard.d.ts +1 -0
- package/dist/Modals/ModalContent.cjs +1 -1
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +1 -1
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +1 -1
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +1 -1
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/NavItem/NavItem.cjs +2 -1
- package/dist/NavItem/NavItem.cjs.map +1 -1
- package/dist/NavItem/NavItem.d.ts +1 -0
- package/dist/NavItem/NavItem.js +1 -1
- package/dist/NavItem/NavItem.js.map +1 -1
- package/dist/NavItem/NestedNavItem.cjs +38 -0
- package/dist/NavItem/NestedNavItem.cjs.map +1 -0
- package/dist/NavItem/NestedNavItem.d.ts +13 -0
- package/dist/NavItem/NestedNavItem.js +28 -0
- package/dist/NavItem/NestedNavItem.js.map +1 -0
- package/dist/Paginator/Paginator.d.ts +1 -0
- package/dist/Panel/Panel.cjs +4 -4
- package/dist/Panel/Panel.cjs.map +1 -1
- package/dist/Panel/Panel.js +5 -5
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/SideMenu/SideMenuBody.d.ts +1 -0
- package/dist/SideMenu/SideMenuFooter.d.ts +1 -0
- package/dist/SideMenu/SideMenuHeader.d.ts +1 -0
- package/dist/SideMenu/types.d.ts +1 -0
- package/dist/Switcher/MobileCustomMenuContent.cjs +3 -0
- package/dist/Switcher/MobileCustomMenuContent.cjs.map +1 -1
- package/dist/Switcher/MobileCustomMenuContent.d.ts +1 -0
- package/dist/Switcher/MobileCustomMenuContent.js +3 -0
- package/dist/Switcher/MobileCustomMenuContent.js.map +1 -1
- package/dist/Switcher/SwitcherMenuItem.d.ts +1 -0
- package/dist/Table/TableTypes.d.ts +1 -0
- package/dist/Tabs/TabLink.cjs +74 -48
- package/dist/Tabs/TabLink.cjs.map +1 -1
- package/dist/Tabs/TabLink.d.ts +14 -10
- package/dist/Tabs/TabLink.js +74 -48
- package/dist/Tabs/TabLink.js.map +1 -1
- package/dist/Tabs/VerticalTabs.cjs +2 -0
- package/dist/Tabs/VerticalTabs.cjs.map +1 -1
- package/dist/Tabs/VerticalTabs.d.ts +1 -0
- package/dist/Tabs/VerticalTabs.js +2 -0
- package/dist/Tabs/VerticalTabs.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +3 -3
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.d.ts +1 -0
- package/dist/Tile/TileCommonItems.js +3 -3
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Toggles/TogglerTypes.d.ts +1 -0
- package/dist/Tooltips/TooltipOverflow.cjs +112 -0
- package/dist/Tooltips/TooltipOverflow.cjs.map +1 -0
- package/dist/Tooltips/TooltipOverflow.d.ts +10 -0
- package/dist/Tooltips/TooltipOverflow.js +102 -0
- package/dist/Tooltips/TooltipOverflow.js.map +1 -0
- package/dist/Tooltips/TooltipStyles.cjs +8 -5
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.d.ts +3 -1
- package/dist/Tooltips/TooltipStyles.js +8 -5
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/TooltipTypes.d.ts +1 -0
- package/dist/Tooltips/TooltipWrapper.cjs +2 -1
- package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
- package/dist/Tooltips/TooltipWrapper.d.ts +1 -0
- package/dist/Tooltips/TooltipWrapper.js +2 -1
- package/dist/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/icons/contenticons/Stock.cjs +41 -0
- package/dist/icons/contenticons/Stock.cjs.map +1 -0
- package/dist/icons/contenticons/Stock.d.ts +3 -0
- package/dist/icons/contenticons/Stock.js +30 -0
- package/dist/icons/contenticons/Stock.js.map +1 -0
- package/dist/icons/contenticons/index.cjs +88 -0
- package/dist/icons/contenticons/index.cjs.map +1 -1
- package/dist/icons/contenticons/index.d.ts +8 -0
- package/dist/icons/contenticons/index.js +8 -0
- package/dist/icons/contenticons/index.js.map +1 -1
- package/dist/icons/index.cjs +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/systemicons/LegendStrokeDashed.cjs +41 -0
- package/dist/icons/systemicons/LegendStrokeDashed.cjs.map +1 -0
- package/dist/icons/systemicons/LegendStrokeDashed.d.ts +3 -0
- package/dist/icons/systemicons/LegendStrokeDashed.js +30 -0
- package/dist/icons/systemicons/LegendStrokeDashed.js.map +1 -0
- package/dist/icons/systemicons/LegendStrokeSolid.cjs +41 -0
- package/dist/icons/systemicons/LegendStrokeSolid.cjs.map +1 -0
- package/dist/icons/systemicons/LegendStrokeSolid.d.ts +3 -0
- package/dist/icons/systemicons/LegendStrokeSolid.js +30 -0
- package/dist/icons/systemicons/LegendStrokeSolid.js.map +1 -0
- package/dist/icons/systemicons/Pin.cjs +41 -0
- package/dist/icons/systemicons/Pin.cjs.map +1 -0
- package/dist/icons/systemicons/Pin.d.ts +3 -0
- package/dist/icons/systemicons/Pin.js +30 -0
- package/dist/icons/systemicons/Pin.js.map +1 -0
- package/dist/icons/systemicons/ZoomOut.cjs +41 -0
- package/dist/icons/systemicons/ZoomOut.cjs.map +1 -0
- package/dist/icons/systemicons/ZoomOut.d.ts +3 -0
- package/dist/icons/systemicons/ZoomOut.js +30 -0
- package/dist/icons/systemicons/ZoomOut.js.map +1 -0
- package/dist/icons/systemicons/index.cjs +250 -8
- package/dist/icons/systemicons/index.cjs.map +1 -1
- package/dist/icons/systemicons/index.d.ts +23 -1
- package/dist/icons/systemicons/index.js +23 -1
- package/dist/icons/systemicons/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -20,7 +20,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ", " {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n"])), _styles.BREAKPOINTS.MEDIUM);
|
|
23
|
+
var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n height: 100%;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ", " {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n"])), _styles.BREAKPOINTS.MEDIUM);
|
|
24
24
|
var AuthPage = function AuthPage(_ref) {
|
|
25
25
|
var screenSetsContainerId = _ref.screenSetsContainerId,
|
|
26
26
|
panel = _ref.panel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthPage.cjs","names":["Wrapper","styled","div","BREAKPOINTS","MEDIUM","AuthPage","screenSetsContainerId","panel","order","className"],"sources":["../../src/AuthPage/AuthPage.tsx"],"sourcesContent":["import * as React from 'react';\nimport ScreenSetsContainer from './ScreenSetsContainer';\nimport styled from \"styled-components\";\nimport {Panel, PanelProps} from \"../Panel\";\nimport {BREAKPOINTS} from \"../styles\";\n\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ${BREAKPOINTS.MEDIUM} {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n`;\n\ntype AuthPageProps = {\n panel?: PanelProps;\n order?: 'default' | 'reverse';\n screenSetsContainerId: string;\n};\n\nconst AuthPage = ({\n screenSetsContainerId,\n panel,\n order = 'default'\n }: AuthPageProps) => {\n return (\n <Wrapper className={order}>\n {\n panel && <Panel {...panel} order={order} className={`panel ${panel.className || ''}`}/>\n }\n <ScreenSetsContainer id={screenSetsContainerId} centerContents={!panel}/>\n </Wrapper>\n );\n};\n\nexport default AuthPage;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAGtC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,
|
|
1
|
+
{"version":3,"file":"AuthPage.cjs","names":["Wrapper","styled","div","BREAKPOINTS","MEDIUM","AuthPage","screenSetsContainerId","panel","order","className"],"sources":["../../src/AuthPage/AuthPage.tsx"],"sourcesContent":["import * as React from 'react';\nimport ScreenSetsContainer from './ScreenSetsContainer';\nimport styled from \"styled-components\";\nimport {Panel, PanelProps} from \"../Panel\";\nimport {BREAKPOINTS} from \"../styles\";\n\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n height: 100%;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ${BREAKPOINTS.MEDIUM} {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n`;\n\ntype AuthPageProps = {\n panel?: PanelProps;\n order?: 'default' | 'reverse';\n screenSetsContainerId: string;\n};\n\nconst AuthPage = ({\n screenSetsContainerId,\n panel,\n order = 'default'\n }: AuthPageProps) => {\n return (\n <Wrapper className={order}>\n {\n panel && <Panel {...panel} order={order} className={`panel ${panel.className || ''}`}/>\n }\n <ScreenSetsContainer id={screenSetsContainerId} centerContents={!panel}/>\n </Wrapper>\n );\n};\n\nexport default AuthPage;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAGtC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,0TAUtBC,mBAAW,CAACC,MAAM,CASrB;AAQD,IAAMC,QAAQ,GAAG,SAAXA,QAAQ,OAIyB;EAAA,IAHnBC,qBAAqB,QAArBA,qBAAqB;IACrBC,KAAK,QAALA,KAAK;IAAA,kBACLC,KAAK;IAALA,KAAK,2BAAG,SAAS;EAEnC,oBACE,sBAAC,OAAO;IAAC,SAAS,EAAEA,KAAM;IAAA,WAEtBD,KAAK,iBAAI,qBAAC,YAAK,kCAAKA,KAAK;MAAE,KAAK,EAAEC,KAAM;MAAC,SAAS,kBAAWD,KAAK,CAACE,SAAS,IAAI,EAAE;IAAG,GAAE,eAEzF,qBAAC,4BAAmB;MAAC,EAAE,EAAEH,qBAAsB;MAAC,cAAc,EAAE,CAACC;IAAM,EAAE;EAAA,EACjE;AAEd,CAAC;AAAC;EAjBAC,KAAK,4BAAG,SAAS,EAAG,SAAS;EAC7BF,qBAAqB;AAAA;AAAA,eAkBRD,QAAQ;AAAA"}
|
|
@@ -11,7 +11,7 @@ import { Panel } from "../Panel";
|
|
|
11
11
|
import { BREAKPOINTS } from "../styles";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ", " {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n"])), BREAKPOINTS.MEDIUM);
|
|
14
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: 100%;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ", " {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n"])), BREAKPOINTS.MEDIUM);
|
|
15
15
|
var AuthPage = function AuthPage(_ref) {
|
|
16
16
|
var screenSetsContainerId = _ref.screenSetsContainerId,
|
|
17
17
|
panel = _ref.panel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthPage.js","names":["React","ScreenSetsContainer","styled","Panel","BREAKPOINTS","Wrapper","div","MEDIUM","AuthPage","screenSetsContainerId","panel","order","className"],"sources":["../../src/AuthPage/AuthPage.tsx"],"sourcesContent":["import * as React from 'react';\nimport ScreenSetsContainer from './ScreenSetsContainer';\nimport styled from \"styled-components\";\nimport {Panel, PanelProps} from \"../Panel\";\nimport {BREAKPOINTS} from \"../styles\";\n\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ${BREAKPOINTS.MEDIUM} {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n`;\n\ntype AuthPageProps = {\n panel?: PanelProps;\n order?: 'default' | 'reverse';\n screenSetsContainerId: string;\n};\n\nconst AuthPage = ({\n screenSetsContainerId,\n panel,\n order = 'default'\n }: AuthPageProps) => {\n return (\n <Wrapper className={order}>\n {\n panel && <Panel {...panel} order={order} className={`panel ${panel.className || ''}`}/>\n }\n <ScreenSetsContainer id={screenSetsContainerId} centerContents={!panel}/>\n </Wrapper>\n );\n};\n\nexport default AuthPage;\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,KAAK,QAAmB,UAAU;AAC1C,SAAQC,WAAW,QAAO,WAAW;AAAC;AAAA;AAGtC,IAAMC,OAAO,GAAGH,MAAM,CAACI,GAAG,
|
|
1
|
+
{"version":3,"file":"AuthPage.js","names":["React","ScreenSetsContainer","styled","Panel","BREAKPOINTS","Wrapper","div","MEDIUM","AuthPage","screenSetsContainerId","panel","order","className"],"sources":["../../src/AuthPage/AuthPage.tsx"],"sourcesContent":["import * as React from 'react';\nimport ScreenSetsContainer from './ScreenSetsContainer';\nimport styled from \"styled-components\";\nimport {Panel, PanelProps} from \"../Panel\";\nimport {BREAKPOINTS} from \"../styles\";\n\n\nconst Wrapper = styled.div`\n display: flex;\n align-items: center;\n height: 100%;\n\n .panel {\n flex: 1;\n display: none;\n }\n\n ${BREAKPOINTS.MEDIUM} {\n .panel {\n display: flex;\n }\n }\n\n &.reverse {\n flex-direction: row-reverse;\n }\n`;\n\ntype AuthPageProps = {\n panel?: PanelProps;\n order?: 'default' | 'reverse';\n screenSetsContainerId: string;\n};\n\nconst AuthPage = ({\n screenSetsContainerId,\n panel,\n order = 'default'\n }: AuthPageProps) => {\n return (\n <Wrapper className={order}>\n {\n panel && <Panel {...panel} order={order} className={`panel ${panel.className || ''}`}/>\n }\n <ScreenSetsContainer id={screenSetsContainerId} centerContents={!panel}/>\n </Wrapper>\n );\n};\n\nexport default AuthPage;\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,KAAK,QAAmB,UAAU;AAC1C,SAAQC,WAAW,QAAO,WAAW;AAAC;AAAA;AAGtC,IAAMC,OAAO,GAAGH,MAAM,CAACI,GAAG,4SAUtBF,WAAW,CAACG,MAAM,CASrB;AAQD,IAAMC,QAAQ,GAAG,SAAXA,QAAQ,OAIyB;EAAA,IAHnBC,qBAAqB,QAArBA,qBAAqB;IACrBC,KAAK,QAALA,KAAK;IAAA,kBACLC,KAAK;IAALA,KAAK,2BAAG,SAAS;EAEnC,oBACE,MAAC,OAAO;IAAC,SAAS,EAAEA,KAAM;IAAA,WAEtBD,KAAK,iBAAI,KAAC,KAAK,kCAAKA,KAAK;MAAE,KAAK,EAAEC,KAAM;MAAC,SAAS,kBAAWD,KAAK,CAACE,SAAS,IAAI,EAAE;IAAG,GAAE,eAEzF,KAAC,mBAAmB;MAAC,EAAE,EAAEH,qBAAsB;MAAC,cAAc,EAAE,CAACC;IAAM,EAAE;EAAA,EACjE;AAEd,CAAC;AAAC;EAjBAC,KAAK,aAAG,SAAS,EAAG,SAAS;EAC7BF,qBAAqB;AAAA;AAkBvB,eAAeD,QAAQ"}
|
|
@@ -16,7 +16,7 @@ var _reactRouter = require("react-router");
|
|
|
16
16
|
var _DropdownButton = _interopRequireDefault(require("../Dropdown/DropdownButton"));
|
|
17
17
|
var _styles2 = require("./styles");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
var _excluded = ["items", "size", "homeIcon", "homeLabel", "homeUrl"];
|
|
19
|
+
var _excluded = ["items", "size", "homeIcon", "homeLabel", "lastItemAsLabel", "homeUrl"];
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -29,6 +29,8 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
29
29
|
homeIcon = _ref$homeIcon === void 0 ? true : _ref$homeIcon,
|
|
30
30
|
_ref$homeLabel = _ref.homeLabel,
|
|
31
31
|
homeLabel = _ref$homeLabel === void 0 ? 'Home' : _ref$homeLabel,
|
|
32
|
+
_ref$lastItemAsLabel = _ref.lastItemAsLabel,
|
|
33
|
+
lastItemAsLabel = _ref$lastItemAsLabel === void 0 ? false : _ref$lastItemAsLabel,
|
|
32
34
|
_ref$homeUrl = _ref.homeUrl,
|
|
33
35
|
homeUrl = _ref$homeUrl === void 0 ? '/' : _ref$homeUrl,
|
|
34
36
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -46,13 +48,28 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
46
48
|
var renderChevron = function renderChevron() {
|
|
47
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
48
50
|
"aria-hidden": "true",
|
|
49
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SystemIcons.
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SystemIcons.ForwardSlash, {
|
|
50
52
|
className: "chevronicon",
|
|
51
53
|
color: _styles.COLORS.neutral_500,
|
|
52
54
|
size: chevronSize
|
|
53
55
|
})
|
|
54
56
|
});
|
|
55
57
|
};
|
|
58
|
+
var renderBreadcrumbLinkItem = function renderBreadcrumbLinkItem(index, item) {
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
60
|
+
children: [renderChevron(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HyperLink, {
|
|
61
|
+
id: 'link-item-' + index,
|
|
62
|
+
onClick: function onClick(e) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
navigateHook(item.url);
|
|
65
|
+
},
|
|
66
|
+
target: "_self",
|
|
67
|
+
variant: "default",
|
|
68
|
+
href: item.url,
|
|
69
|
+
children: item.label
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
56
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.BreadcrumbContainer, _objectSpread(_objectSpread({
|
|
57
74
|
size: size,
|
|
58
75
|
"data-testid": 'breacrumbContainer'
|
|
@@ -88,35 +105,19 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
88
105
|
}),
|
|
89
106
|
onClick: navigate
|
|
90
107
|
})]
|
|
91
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: [renderChevron(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HyperLink, {
|
|
105
|
-
id: 'link-item-' + (items.length - 2),
|
|
106
|
-
onClick: function onClick(e) {
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
navigateHook(items[items.length - 2].url);
|
|
109
|
-
},
|
|
110
|
-
target: "_self",
|
|
111
|
-
variant: "default",
|
|
112
|
-
href: items[items.length - 2].url,
|
|
113
|
-
children: items[items.length - 2].label
|
|
114
|
-
})]
|
|
115
|
-
}), !!items && items.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
116
|
-
children: [renderChevron(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles2.LastBreadcrumbItem, {
|
|
117
|
-
size: size,
|
|
118
|
-
children: items[items.length - 1].label
|
|
119
|
-
})]
|
|
108
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
109
|
+
children: renderBreadcrumbLinkItem(items.length - 3, items[items.length - 3])
|
|
110
|
+
})), !!items && items.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
111
|
+
children: renderBreadcrumbLinkItem(items.length - 2, items[items.length - 2])
|
|
112
|
+
}), !!items && items.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
113
|
+
children: lastItemAsLabel ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
114
|
+
children: [renderChevron(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles2.LastBreadcrumbItem, {
|
|
115
|
+
size: size,
|
|
116
|
+
children: items[items.length - 1].label
|
|
117
|
+
})]
|
|
118
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
119
|
+
children: [renderBreadcrumbLinkItem(items.length - 1, items[items.length - 1]), renderChevron()]
|
|
120
|
+
})
|
|
120
121
|
})]
|
|
121
122
|
}));
|
|
122
123
|
};
|
|
@@ -124,7 +125,8 @@ Breadcrumb.propTypes = {
|
|
|
124
125
|
homeIcon: _propTypes.default.bool,
|
|
125
126
|
homeLabel: _propTypes.default.string,
|
|
126
127
|
homeUrl: _propTypes.default.string,
|
|
127
|
-
items: _propTypes.default.array
|
|
128
|
+
items: _propTypes.default.array,
|
|
129
|
+
lastItemAsLabel: _propTypes.default.bool
|
|
128
130
|
};
|
|
129
131
|
var _default = Breadcrumb;
|
|
130
132
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.cjs","names":["Breadcrumb","items","size","Size","Small","homeIcon","homeLabel","homeUrl","rest","navigateHook","useNavigate","dropdownItems","slice","length","map","x","value","url","displayLabel","label","navigate","links","chevronSize","Medium","renderChevron","COLORS","neutral_500","e","preventDefault","neutral_600"],"sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { COLORS } from '../styles';\nimport { Size, SystemIcons } from '..';\nimport { useNavigate } from 'react-router';\nimport { HyperLink, IconButton } from '..';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport DropdownButton from '../Dropdown/DropdownButton';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { BreadcrumbContainer, LastBreadcrumbItem } from './styles';\n\ntype BreadcrumbProps = React.HTMLAttributes<HTMLDivElement> & {\n homeIcon?: boolean;\n homeLabel?: string;\n homeUrl?: string;\n items?: BreadcrumbItem[];\n size?: Size;\n};\n\nconst Breadcrumb: React.FunctionComponent<BreadcrumbProps> = ({
|
|
1
|
+
{"version":3,"file":"Breadcrumb.cjs","names":["Breadcrumb","items","size","Size","Small","homeIcon","homeLabel","lastItemAsLabel","homeUrl","rest","navigateHook","useNavigate","dropdownItems","slice","length","map","x","value","url","displayLabel","label","navigate","links","chevronSize","Medium","renderChevron","COLORS","neutral_500","renderBreadcrumbLinkItem","index","item","e","preventDefault","neutral_600"],"sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { COLORS } from '../styles';\nimport { Size, SystemIcons } from '..';\nimport { useNavigate } from 'react-router';\nimport { HyperLink, IconButton } from '..';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport DropdownButton from '../Dropdown/DropdownButton';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { BreadcrumbContainer, LastBreadcrumbItem } from './styles';\nimport internal from 'stream';\n\ntype BreadcrumbProps = React.HTMLAttributes<HTMLDivElement> & {\n homeIcon?: boolean;\n homeLabel?: string;\n homeUrl?: string;\n items?: BreadcrumbItem[];\n size?: Size;\n lastItemAsLabel?: boolean;\n};\n\nconst Breadcrumb: React.FunctionComponent<BreadcrumbProps> = ({\n items,\n size = Size.Small,\n homeIcon = true,\n homeLabel = 'Home',\n lastItemAsLabel = false,\n homeUrl = '/',\n ...rest\n}) => {\n const navigateHook = useNavigate();\n const dropdownItems: DropdownItem[] = items ? items.slice(0, items.length - 2).map((x) => ({ value: x.url, displayLabel: x.label })) : [];\n const navigate = (links: string[]) => {\n navigateHook(links[0]);\n };\n\n const chevronSize = size == Size.Medium ? '24px' : size == Size.Small ? '20px' : '16px';\n const renderChevron = () => (\n <div aria-hidden=\"true\">\n <SystemIcons.ForwardSlash className=\"chevronicon\" color={COLORS.neutral_500} size={chevronSize} />\n </div>\n );\n const renderBreadcrumbLinkItem = (index: number, item: BreadcrumbItem) => {\n return (\n <>\n {renderChevron()}\n <HyperLink\n id={'link-item-' + index}\n onClick={(e) => {\n e.preventDefault();\n navigateHook(item.url);\n }}\n target=\"_self\"\n variant=\"default\"\n href={item.url}>\n {item.label}\n </HyperLink>\n </>\n );\n };\n\n return (\n <BreadcrumbContainer size={size} data-testid={'breacrumbContainer'} {...rest}>\n {homeIcon ? (\n <IconButton id=\"homeIcon\" variant=\"secondary\" shape=\"circular\" action={() => navigateHook(homeUrl)}>\n <SystemIcons.Home size={chevronSize} />\n </IconButton>\n ) : (\n <HyperLink\n id={'homelink'}\n variant=\"default\"\n href={homeUrl}\n onClick={(e) => {\n e.preventDefault();\n navigateHook(homeUrl);\n }}>\n {homeLabel}\n </HyperLink>\n )}\n\n {!!items &&\n items.length > 2 &&\n (items.length > 3 ? (\n <>\n {renderChevron()}\n <DropdownButton\n type={'icon'}\n alignLeft={true}\n items={dropdownItems}\n size={size}\n icon={<SystemIcons.MoreHorizontal color={COLORS.neutral_600} size=\"20px\" />}\n onClick={navigate}\n />\n </>\n ) : (\n <>{renderBreadcrumbLinkItem(items.length - 3, items[items.length - 3])}</>\n ))}\n\n {!!items && items.length > 1 && <>{renderBreadcrumbLinkItem(items.length - 2, items[items.length - 2])}</>}\n\n {!!items && items.length > 0 && (\n <>\n {lastItemAsLabel ? (\n <>\n {renderChevron()}\n <LastBreadcrumbItem size={size}>{items[items.length - 1].label}</LastBreadcrumbItem>\n </>\n ) : (\n <>\n {renderBreadcrumbLinkItem(items.length - 1, items[items.length - 1])}\n {renderChevron()}\n </>\n )}\n </>\n )}\n </BreadcrumbContainer>\n );\n};\n\nexport default Breadcrumb;\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AACA;AACA;AAGA;AAEA;AAAmE;AAAA;AAAA;AAAA;AAAA;AAAA;AAYnE,IAAMA,UAAoD,GAAG,SAAvDA,UAAoD,OAQpD;EAAA,IAPJC,KAAK,QAALA,KAAK;IAAA,iBACLC,IAAI;IAAJA,IAAI,0BAAGC,MAAI,CAACC,KAAK;IAAA,qBACjBC,QAAQ;IAARA,QAAQ,8BAAG,IAAI;IAAA,sBACfC,SAAS;IAATA,SAAS,+BAAG,MAAM;IAAA,4BAClBC,eAAe;IAAfA,eAAe,qCAAG,KAAK;IAAA,oBACvBC,OAAO;IAAPA,OAAO,6BAAG,GAAG;IACVC,IAAI;EAEP,IAAMC,YAAY,GAAG,IAAAC,wBAAW,GAAE;EAClC,IAAMC,aAA6B,GAAGX,KAAK,GAAGA,KAAK,CAACY,KAAK,CAAC,CAAC,EAAEZ,KAAK,CAACa,MAAM,GAAG,CAAC,CAAC,CAACC,GAAG,CAAC,UAACC,CAAC;IAAA,OAAM;MAAEC,KAAK,EAAED,CAAC,CAACE,GAAG;MAAEC,YAAY,EAAEH,CAAC,CAACI;IAAM,CAAC;EAAA,CAAC,CAAC,GAAG,EAAE;EACzI,IAAMC,QAAQ,GAAG,SAAXA,QAAQ,CAAIC,KAAe,EAAK;IACpCZ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,MAAM,GAAG,CAAC,EAAEb,KAAK,CAACA,KAAK,CAACa,MAAM,GAAG,CAAC,CAAC,CAAC,EACnEW,aAAa,EAAE;MAAA;IAEnB,EAEJ;EAAA,GACmB;AAE1B,CAAC;AAAC;EAxGApB,QAAQ;EACRC,SAAS;EACTE,OAAO;EACPP,KAAK;EAELM,eAAe;AAAA;AAAA,eAqGFP,UAAU;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _pt from "prop-types";
|
|
4
|
-
var _excluded = ["items", "size", "homeIcon", "homeLabel", "homeUrl"];
|
|
4
|
+
var _excluded = ["items", "size", "homeIcon", "homeLabel", "lastItemAsLabel", "homeUrl"];
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import * as React from 'react';
|
|
@@ -22,6 +22,8 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
22
22
|
homeIcon = _ref$homeIcon === void 0 ? true : _ref$homeIcon,
|
|
23
23
|
_ref$homeLabel = _ref.homeLabel,
|
|
24
24
|
homeLabel = _ref$homeLabel === void 0 ? 'Home' : _ref$homeLabel,
|
|
25
|
+
_ref$lastItemAsLabel = _ref.lastItemAsLabel,
|
|
26
|
+
lastItemAsLabel = _ref$lastItemAsLabel === void 0 ? false : _ref$lastItemAsLabel,
|
|
25
27
|
_ref$homeUrl = _ref.homeUrl,
|
|
26
28
|
homeUrl = _ref$homeUrl === void 0 ? '/' : _ref$homeUrl,
|
|
27
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -39,13 +41,28 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
39
41
|
var renderChevron = function renderChevron() {
|
|
40
42
|
return /*#__PURE__*/_jsx("div", {
|
|
41
43
|
"aria-hidden": "true",
|
|
42
|
-
children: /*#__PURE__*/_jsx(SystemIcons.
|
|
44
|
+
children: /*#__PURE__*/_jsx(SystemIcons.ForwardSlash, {
|
|
43
45
|
className: "chevronicon",
|
|
44
46
|
color: COLORS.neutral_500,
|
|
45
47
|
size: chevronSize
|
|
46
48
|
})
|
|
47
49
|
});
|
|
48
50
|
};
|
|
51
|
+
var renderBreadcrumbLinkItem = function renderBreadcrumbLinkItem(index, item) {
|
|
52
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
+
children: [renderChevron(), /*#__PURE__*/_jsx(HyperLink, {
|
|
54
|
+
id: 'link-item-' + index,
|
|
55
|
+
onClick: function onClick(e) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
navigateHook(item.url);
|
|
58
|
+
},
|
|
59
|
+
target: "_self",
|
|
60
|
+
variant: "default",
|
|
61
|
+
href: item.url,
|
|
62
|
+
children: item.label
|
|
63
|
+
})]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
49
66
|
return /*#__PURE__*/_jsxs(BreadcrumbContainer, _objectSpread(_objectSpread({
|
|
50
67
|
size: size,
|
|
51
68
|
"data-testid": 'breacrumbContainer'
|
|
@@ -81,35 +98,19 @@ var Breadcrumb = function Breadcrumb(_ref) {
|
|
|
81
98
|
}),
|
|
82
99
|
onClick: navigate
|
|
83
100
|
})]
|
|
84
|
-
}) : /*#__PURE__*/
|
|
85
|
-
children:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
children: [renderChevron(), /*#__PURE__*/_jsx(HyperLink, {
|
|
98
|
-
id: 'link-item-' + (items.length - 2),
|
|
99
|
-
onClick: function onClick(e) {
|
|
100
|
-
e.preventDefault();
|
|
101
|
-
navigateHook(items[items.length - 2].url);
|
|
102
|
-
},
|
|
103
|
-
target: "_self",
|
|
104
|
-
variant: "default",
|
|
105
|
-
href: items[items.length - 2].url,
|
|
106
|
-
children: items[items.length - 2].label
|
|
107
|
-
})]
|
|
108
|
-
}), !!items && items.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
|
|
109
|
-
children: [renderChevron(), /*#__PURE__*/_jsx(LastBreadcrumbItem, {
|
|
110
|
-
size: size,
|
|
111
|
-
children: items[items.length - 1].label
|
|
112
|
-
})]
|
|
101
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
|
102
|
+
children: renderBreadcrumbLinkItem(items.length - 3, items[items.length - 3])
|
|
103
|
+
})), !!items && items.length > 1 && /*#__PURE__*/_jsx(_Fragment, {
|
|
104
|
+
children: renderBreadcrumbLinkItem(items.length - 2, items[items.length - 2])
|
|
105
|
+
}), !!items && items.length > 0 && /*#__PURE__*/_jsx(_Fragment, {
|
|
106
|
+
children: lastItemAsLabel ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
107
|
+
children: [renderChevron(), /*#__PURE__*/_jsx(LastBreadcrumbItem, {
|
|
108
|
+
size: size,
|
|
109
|
+
children: items[items.length - 1].label
|
|
110
|
+
})]
|
|
111
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
112
|
+
children: [renderBreadcrumbLinkItem(items.length - 1, items[items.length - 1]), renderChevron()]
|
|
113
|
+
})
|
|
113
114
|
})]
|
|
114
115
|
}));
|
|
115
116
|
};
|
|
@@ -117,7 +118,8 @@ Breadcrumb.propTypes = {
|
|
|
117
118
|
homeIcon: _pt.bool,
|
|
118
119
|
homeLabel: _pt.string,
|
|
119
120
|
homeUrl: _pt.string,
|
|
120
|
-
items: _pt.array
|
|
121
|
+
items: _pt.array,
|
|
122
|
+
lastItemAsLabel: _pt.bool
|
|
121
123
|
};
|
|
122
124
|
export default Breadcrumb;
|
|
123
125
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","names":["React","COLORS","Size","SystemIcons","useNavigate","HyperLink","IconButton","DropdownButton","BreadcrumbContainer","LastBreadcrumbItem","Breadcrumb","items","size","Small","homeIcon","homeLabel","homeUrl","rest","navigateHook","dropdownItems","slice","length","map","x","value","url","displayLabel","label","navigate","links","chevronSize","Medium","renderChevron","neutral_500","e","preventDefault","neutral_600"],"sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { COLORS } from '../styles';\nimport { Size, SystemIcons } from '..';\nimport { useNavigate } from 'react-router';\nimport { HyperLink, IconButton } from '..';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport DropdownButton from '../Dropdown/DropdownButton';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { BreadcrumbContainer, LastBreadcrumbItem } from './styles';\n\ntype BreadcrumbProps = React.HTMLAttributes<HTMLDivElement> & {\n homeIcon?: boolean;\n homeLabel?: string;\n homeUrl?: string;\n items?: BreadcrumbItem[];\n size?: Size;\n};\n\nconst Breadcrumb: React.FunctionComponent<BreadcrumbProps> = ({
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","names":["React","COLORS","Size","SystemIcons","useNavigate","HyperLink","IconButton","DropdownButton","BreadcrumbContainer","LastBreadcrumbItem","Breadcrumb","items","size","Small","homeIcon","homeLabel","lastItemAsLabel","homeUrl","rest","navigateHook","dropdownItems","slice","length","map","x","value","url","displayLabel","label","navigate","links","chevronSize","Medium","renderChevron","neutral_500","renderBreadcrumbLinkItem","index","item","e","preventDefault","neutral_600"],"sources":["../../src/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { COLORS } from '../styles';\nimport { Size, SystemIcons } from '..';\nimport { useNavigate } from 'react-router';\nimport { HyperLink, IconButton } from '..';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport DropdownButton from '../Dropdown/DropdownButton';\nimport { DropdownItem } from '../Dropdown/DropdownContent';\nimport { BreadcrumbContainer, LastBreadcrumbItem } from './styles';\nimport internal from 'stream';\n\ntype BreadcrumbProps = React.HTMLAttributes<HTMLDivElement> & {\n homeIcon?: boolean;\n homeLabel?: string;\n homeUrl?: string;\n items?: BreadcrumbItem[];\n size?: Size;\n lastItemAsLabel?: boolean;\n};\n\nconst Breadcrumb: React.FunctionComponent<BreadcrumbProps> = ({\n items,\n size = Size.Small,\n homeIcon = true,\n homeLabel = 'Home',\n lastItemAsLabel = false,\n homeUrl = '/',\n ...rest\n}) => {\n const navigateHook = useNavigate();\n const dropdownItems: DropdownItem[] = items ? items.slice(0, items.length - 2).map((x) => ({ value: x.url, displayLabel: x.label })) : [];\n const navigate = (links: string[]) => {\n navigateHook(links[0]);\n };\n\n const chevronSize = size == Size.Medium ? '24px' : size == Size.Small ? '20px' : '16px';\n const renderChevron = () => (\n <div aria-hidden=\"true\">\n <SystemIcons.ForwardSlash className=\"chevronicon\" color={COLORS.neutral_500} size={chevronSize} />\n </div>\n );\n const renderBreadcrumbLinkItem = (index: number, item: BreadcrumbItem) => {\n return (\n <>\n {renderChevron()}\n <HyperLink\n id={'link-item-' + index}\n onClick={(e) => {\n e.preventDefault();\n navigateHook(item.url);\n }}\n target=\"_self\"\n variant=\"default\"\n href={item.url}>\n {item.label}\n </HyperLink>\n </>\n );\n };\n\n return (\n <BreadcrumbContainer size={size} data-testid={'breacrumbContainer'} {...rest}>\n {homeIcon ? (\n <IconButton id=\"homeIcon\" variant=\"secondary\" shape=\"circular\" action={() => navigateHook(homeUrl)}>\n <SystemIcons.Home size={chevronSize} />\n </IconButton>\n ) : (\n <HyperLink\n id={'homelink'}\n variant=\"default\"\n href={homeUrl}\n onClick={(e) => {\n e.preventDefault();\n navigateHook(homeUrl);\n }}>\n {homeLabel}\n </HyperLink>\n )}\n\n {!!items &&\n items.length > 2 &&\n (items.length > 3 ? (\n <>\n {renderChevron()}\n <DropdownButton\n type={'icon'}\n alignLeft={true}\n items={dropdownItems}\n size={size}\n icon={<SystemIcons.MoreHorizontal color={COLORS.neutral_600} size=\"20px\" />}\n onClick={navigate}\n />\n </>\n ) : (\n <>{renderBreadcrumbLinkItem(items.length - 3, items[items.length - 3])}</>\n ))}\n\n {!!items && items.length > 1 && <>{renderBreadcrumbLinkItem(items.length - 2, items[items.length - 2])}</>}\n\n {!!items && items.length > 0 && (\n <>\n {lastItemAsLabel ? (\n <>\n {renderChevron()}\n <LastBreadcrumbItem size={size}>{items[items.length - 1].label}</LastBreadcrumbItem>\n </>\n ) : (\n <>\n {renderBreadcrumbLinkItem(items.length - 1, items[items.length - 1])}\n {renderChevron()}\n </>\n )}\n </>\n )}\n </BreadcrumbContainer>\n );\n};\n\nexport default Breadcrumb;\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,IAAI,EAAEC,WAAW,QAAQ,IAAI;AACtC,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,SAAS,EAAEC,UAAU,QAAQ,IAAI;AAE1C,OAAOC,cAAc,MAAM,4BAA4B;AAEvD,SAASC,mBAAmB,EAAEC,kBAAkB,QAAQ,UAAU;AAAC;AAAA;AAAA;AAYnE,IAAMC,UAAoD,GAAG,SAAvDA,UAAoD,OAQpD;EAAA,IAPJC,KAAK,QAALA,KAAK;IAAA,iBACLC,IAAI;IAAJA,IAAI,0BAAGV,IAAI,CAACW,KAAK;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A,KAAK,CAACW,MAAM,GAAG,CAAC,CAAC;IAAC,EACvE,CAAC,EAEH,CAAC,CAACX,KAAK,IAAIA,KAAK,CAACW,MAAM,GAAG,CAAC,iBAAI;MAAA,UAAGa,wBAAwB,CAACxB,KAAK,CAACW,MAAM,GAAG,CAAC,EAAEX,KAAK,CAACA,KAAK,CAACW,MAAM,GAAG,CAAC,CAAC;IAAC,EAAI,EAEzG,CAAC,CAACX,KAAK,IAAIA,KAAK,CAACW,MAAM,GAAG,CAAC,iBAC1B;MAAA,UACGN,eAAe,gBACd;QAAA,WACGiB,aAAa,EAAE,eAChB,KAAC,kBAAkB;UAAC,IAAI,EAAErB,IAAK;UAAA,UAAED,KAAK,CAACA,KAAK,CAACW,MAAM,GAAG,CAAC,CAAC,CAACM;QAAK,EAAsB;MAAA,EACnF,gBAEH;QAAA,WACGO,wBAAwB,CAACxB,KAAK,CAACW,MAAM,GAAG,CAAC,EAAEX,KAAK,CAACA,KAAK,CAACW,MAAM,GAAG,CAAC,CAAC,CAAC,EACnEW,aAAa,EAAE;MAAA;IAEnB,EAEJ;EAAA,GACmB;AAE1B,CAAC;AAAC;EAxGAnB,QAAQ;EACRC,SAAS;EACTE,OAAO;EACPN,KAAK;EAELK,eAAe;AAAA;AAqGjB,eAAeN,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Iconbutton.cjs","names":["getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","IconButtonContent","styled","div","StyledIconButton","button","hideOnLowWidth","BREAKPOINTS","MEDIUM","unsetIconSize","invertFocus","invertedFocusStyles","focusStyles","StyledPrimaryIconButton","useTransparentBackground","COLORS","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","shouldNotInteract","primary_20","primary_100","neutral_300","IconButton","React","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","focusBackgroundColor","type","hidden","dataTestId","focusOnClick","tooltip","rest","render","event","stopPropagation","defaultOnMouseDownHandler","undefined"],"sources":["../../src/Button/Iconbutton.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles } from '../styles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { Testable } from 'src/types';\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\nimport TooltipWrapper from \"../Tooltips/TooltipWrapper\";\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n shouldNotInteract?: boolean;\n}\n\nconst getBorderRadius = (props: HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props: HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch (props.flatEdge) {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nexport const IconButtonContent = styled.div``;\n\nexport const StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n ${IconButtonContent} {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${(props) => (props.invertFocus ? invertedFocusStyles : focusStyles)}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled),\n &.hover-state {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_700};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_800};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n pointer-events: ${(props) => (props.shouldNotInteract ? 'none' : 'auto')};\n\n &:hover:not(:disabled) {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_20};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_100};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n`;\n\nexport interface IconButtonProps extends Testable, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onMouseDown'> {\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n shouldNotInteract?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n focusBackgroundColor?: string;\n children?: React.ReactNode;\n invertFocus?: boolean;\n focusOnClick?: boolean;\n\n tooltip?: Omit<TooltipProps, 'tabIndex'>;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n shouldNotInteract,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n focusBackgroundColor,\n type,\n hidden,\n invertFocus,\n dataTestId,\n focusOnClick,\n tooltip,\n ...rest\n }: IconButtonProps,\n ref,\n ) => {\n\n const render = () => {\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n shouldNotInteract={shouldNotInteract}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledPrimaryIconButton>\n );\n }\n }\n\n return !tooltip\n ? render()\n : (\n <TooltipWrapper {...tooltip}>\n {render()}\n </TooltipWrapper>\n );\n },\n);\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAGA;AAAwD;AAAA;AAAA;AAAA;AAAA;AAgBxD,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAsB;EAAA,OAAMA,KAAK,CAACC,YAAY,aAAMD,KAAK,CAACC,YAAY,UAAO,KAAK;AAAA,CAAC;AAE5G,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIF,KAAsB,EAAK;EACvD,IAAMG,MAAM,GAAGJ,eAAe,CAACC,KAAK,CAAC;EACrC,QAAQA,KAAK,CAACI,QAAQ;IACpB,KAAK,MAAM;MACT,qBAAcD,MAAM,cAAIA,MAAM;IAEhC,KAAK,OAAO;MACV,iBAAUA,MAAM,sBAAYA,MAAM;IAEpC,KAAK,MAAM;IACX;MACE,iBAAUA,MAAM;EAAG;AAEzB,CAAC;AAEM,IAAME,iBAAiB,GAAGC,yBAAM,CAACC,GAAG,mFAAE;AAAC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getBorderRadiusStyle","radius","flatEdge","IconButtonContent","styled","div","StyledIconButton","button","hideOnLowWidth","BREAKPOINTS","MEDIUM","unsetIconSize","invertFocus","invertedFocusStyles","focusStyles","StyledPrimaryIconButton","useTransparentBackground","COLORS","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","shouldNotInteract","primary_20","primary_100","neutral_300","IconButton","React","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","focusBackgroundColor","type","hidden","dataTestId","focusOnClick","tooltip","rest","render","event","stopPropagation","defaultOnMouseDownHandler","undefined"],"sources":["../../src/Button/Iconbutton.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles } from '../styles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { Testable } from '../types';\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\nimport TooltipWrapper from \"../Tooltips/TooltipWrapper\";\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n shouldNotInteract?: boolean;\n}\n\nconst getBorderRadius = (props: HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props: HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch (props.flatEdge) {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nexport const IconButtonContent = styled.div``;\n\nexport const StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n ${IconButtonContent} {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${(props) => (props.invertFocus ? invertedFocusStyles : focusStyles)}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled),\n &.hover-state {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_700};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_800};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n pointer-events: ${(props) => (props.shouldNotInteract ? 'none' : 'auto')};\n\n &:hover:not(:disabled) {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_20};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_100};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n`;\n\nexport interface IconButtonProps extends Testable, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onMouseDown'> {\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n shouldNotInteract?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n focusBackgroundColor?: string;\n children?: React.ReactNode;\n invertFocus?: boolean;\n focusOnClick?: boolean;\n\n tooltip?: Omit<TooltipProps, 'tabIndex'>;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n shouldNotInteract,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n focusBackgroundColor,\n type,\n hidden,\n invertFocus,\n dataTestId,\n focusOnClick,\n tooltip,\n ...rest\n }: IconButtonProps,\n ref,\n ) => {\n\n const render = () => {\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n shouldNotInteract={shouldNotInteract}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledPrimaryIconButton>\n );\n }\n }\n\n return !tooltip\n ? render()\n : (\n <TooltipWrapper {...tooltip}>\n {render()}\n </TooltipWrapper>\n );\n },\n);\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAGA;AAAwD;AAAA;AAAA;AAAA;AAAA;AAgBxD,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAsB;EAAA,OAAMA,KAAK,CAACC,YAAY,aAAMD,KAAK,CAACC,YAAY,UAAO,KAAK;AAAA,CAAC;AAE5G,IAAMC,oBAAoB,GAAG,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C;EAzHAd,OAAO,4BAAG,SAAS,EAAG,WAAW;EACjCC,KAAK,4BAAG,QAAQ,EAAG,UAAU;EAC7BC,MAAM;EACN7B,cAAc;EAEd8B,cAAc;EACdtB,wBAAwB;EACxBU,iBAAiB;EACjBP,SAAS;EACTR,aAAa;EACbZ,YAAY;EACZ2C,oBAAoB;EACpBH,QAAQ;EACR3B,WAAW;EACXkC,YAAY;AAAA;AAAA,eA6GChB,UAAU;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Iconbutton.js","names":["React","styled","BREAKPOINTS","COLORS","focusStyles","invertedFocusStyles","defaultOnMouseDownHandler","TooltipWrapper","getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","IconButtonContent","div","StyledIconButton","button","hideOnLowWidth","MEDIUM","unsetIconSize","invertFocus","StyledPrimaryIconButton","useTransparentBackground","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","shouldNotInteract","primary_20","primary_100","neutral_300","IconButton","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","focusBackgroundColor","type","hidden","dataTestId","focusOnClick","tooltip","rest","render","event","stopPropagation","undefined"],"sources":["../../src/Button/Iconbutton.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles } from '../styles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { Testable } from 'src/types';\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\nimport TooltipWrapper from \"../Tooltips/TooltipWrapper\";\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n shouldNotInteract?: boolean;\n}\n\nconst getBorderRadius = (props: HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props: HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch (props.flatEdge) {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nexport const IconButtonContent = styled.div``;\n\nexport const StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n ${IconButtonContent} {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${(props) => (props.invertFocus ? invertedFocusStyles : focusStyles)}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled),\n &.hover-state {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_700};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_800};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n pointer-events: ${(props) => (props.shouldNotInteract ? 'none' : 'auto')};\n\n &:hover:not(:disabled) {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_20};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_100};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n`;\n\nexport interface IconButtonProps extends Testable, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onMouseDown'> {\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n shouldNotInteract?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n focusBackgroundColor?: string;\n children?: React.ReactNode;\n invertFocus?: boolean;\n focusOnClick?: boolean;\n\n tooltip?: Omit<TooltipProps, 'tabIndex'>;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n shouldNotInteract,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n focusBackgroundColor,\n type,\n hidden,\n invertFocus,\n dataTestId,\n focusOnClick,\n tooltip,\n ...rest\n }: IconButtonProps,\n ref,\n ) => {\n\n const render = () => {\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n shouldNotInteract={shouldNotInteract}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledPrimaryIconButton>\n );\n }\n }\n\n return !tooltip\n ? render()\n : (\n <TooltipWrapper {...tooltip}>\n {render()}\n </TooltipWrapper>\n );\n },\n);\n\nexport default IconButton;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,WAAW,EAAEC,MAAM,EAAEC,WAAW,EAAEC,mBAAmB,QAAQ,WAAW;AACjF,SAASC,yBAAyB,QAAQ,WAAW;AAGrD,OAAOC,cAAc,MAAM,4BAA4B;AAAC;AAgBxD,IAAMC,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAsB;EAAA,OAAMA,KAAK,CAACC,YAAY,aAAMD,KAAK,CAACC,YAAY,UAAO,KAAK;AAAA,CAAC;AAE5G,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIF,KAAsB,EAAK;EACvD,IAAMG,MAAM,GAAGJ,eAAe,CAACC,KAAK,CAAC;EACrC,QAAQA,KAAK,CAACI,QAAQ;IACpB,KAAK,MAAM;MACT,qBAAcD,MAAM,cAAIA,MAAM;IAEhC,KAAK,OAAO;MACV,iBAAUA,MAAM,sBAAYA,MAAM;IAEpC,KAAK,MAAM;IACX;MACE,iBAAUA,MAAM;EAAG;AAEzB,CAAC;AAED,OAAO,IAAME,iBAAiB,GAAGb,MAAM,CAACc,GAAG,qEAAE;AAE7C,OAAO,IAAMC,gBAAgB,GAAGf,MAAM,CAACgB,MAAM,onBAQhC,UAACR,KAAK;EAAA,OAAMA,KAAK,CAACS,cAAc,GAAG,MAAM,GAAG,OAAO;AAAA,CAAC,EAC7DhB,WAAW,CAACiB,MAAM,EAIH,UAACV,KAAK;EAAA,OAAMA,KAAK,CAACC,YAAY,aAAMD,KAAK,CAACC,YAAY,UAAO,KAAK;AAAA,CAAC,EAClFI,iBAAiB,EAGAH,oBAAoB,EAKzB,UAACF,KAAK;EAAA,OAAMA,KAAK,CAACW,aAAa,GAA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AAwB,EAAEpB,wBAAyB;UACnD,SAAS,EAAEE,SAAU;UACrB,aAAa,EAAEL,aAAc;UAC7B,QAAQ,EAAE0B,QAAS;UACnB,YAAY,EAAEpC,YAAY,IAAI+B,KAAK,KAAK,UAAU,GAAG,EAAE,GAAG,CAAE;UAC5D,WAAW,EAAE,CAACU,YAAY,GAAG7C,yBAAyB,GAAGmD,SAAU;UACnE,MAAM,EAAER,MAAO;UACf,WAAW,EAAE5B,WAAY;UACzB,oBAAoB,EAAE0B;QAAqB,GACvCM,IAAI;UAAA,uBACR,KAAC,iBAAiB;YAAA,UAAET;UAAQ;QAAqB,GACzB;IAC1B;EAER,CAAC;EAED,OAAO,CAACQ,OAAO,GACXE,MAAM,EAAE,gBAER,KAAC,cAAc,kCAAKF,OAAO;IAAA,UACxBE,MAAM;EAAE,GAEZ;AACL,CAAC,CACF;AAAC;EAzHAd,OAAO,aAAG,SAAS,EAAG,WAAW;EACjCC,KAAK,aAAG,QAAQ,EAAG,UAAU;EAC7BC,MAAM;EACNxB,cAAc;EAEdyB,cAAc;EACdpB,wBAAwB;EACxBS,iBAAiB;EACjBP,SAAS;EACTL,aAAa;EACbV,YAAY;EACZqC,oBAAoB;EACpBH,QAAQ;EACRvB,WAAW;EACX8B,YAAY;AAAA;AA6Gd,eAAef,UAAU"}
|
|
1
|
+
{"version":3,"file":"Iconbutton.js","names":["React","styled","BREAKPOINTS","COLORS","focusStyles","invertedFocusStyles","defaultOnMouseDownHandler","TooltipWrapper","getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","IconButtonContent","div","StyledIconButton","button","hideOnLowWidth","MEDIUM","unsetIconSize","invertFocus","StyledPrimaryIconButton","useTransparentBackground","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","shouldNotInteract","primary_20","primary_100","neutral_300","IconButton","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","focusBackgroundColor","type","hidden","dataTestId","focusOnClick","tooltip","rest","render","event","stopPropagation","undefined"],"sources":["../../src/Button/Iconbutton.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\n\nimport { BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles } from '../styles';\nimport { defaultOnMouseDownHandler } from '../common';\nimport { Testable } from '../types';\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\nimport TooltipWrapper from \"../Tooltips/TooltipWrapper\";\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n shouldNotInteract?: boolean;\n}\n\nconst getBorderRadius = (props: HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props: HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch (props.flatEdge) {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nexport const IconButtonContent = styled.div``;\n\nexport const StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n ${IconButtonContent} {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${(props) => (props.invertFocus ? invertedFocusStyles : focusStyles)}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled),\n &.hover-state {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_700};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_800};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n ${IconButtonContent} {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n pointer-events: ${(props) => (props.shouldNotInteract ? 'none' : 'auto')};\n\n &:hover:not(:disabled) {\n ${IconButtonContent} {\n background-color: ${COLORS.primary_20};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled),\n &.active-state {\n ${IconButtonContent} {\n background: ${COLORS.primary_100};\n }\n ${IconButtonContent} svg path,\n ${IconButtonContent} svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n ${IconButtonContent} {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n`;\n\nexport interface IconButtonProps extends Testable, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onMouseDown'> {\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n shouldNotInteract?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n focusBackgroundColor?: string;\n children?: React.ReactNode;\n invertFocus?: boolean;\n focusOnClick?: boolean;\n\n tooltip?: Omit<TooltipProps, 'tabIndex'>;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n shouldNotInteract,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n focusBackgroundColor,\n type,\n hidden,\n invertFocus,\n dataTestId,\n focusOnClick,\n tooltip,\n ...rest\n }: IconButtonProps,\n ref,\n ) => {\n\n const render = () => {\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n shouldNotInteract={shouldNotInteract}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={dataTestId}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n action(event);\n }}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={!focusOnClick ? defaultOnMouseDownHandler : undefined}\n hidden={hidden}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}\n {...rest}>\n <IconButtonContent>{children}</IconButtonContent>\n </StyledPrimaryIconButton>\n );\n }\n }\n\n return !tooltip\n ? render()\n : (\n <TooltipWrapper {...tooltip}>\n {render()}\n </TooltipWrapper>\n );\n },\n);\n\nexport default IconButton;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,WAAW,EAAEC,MAAM,EAAEC,WAAW,EAAEC,mBAAmB,QAAQ,WAAW;AACjF,SAASC,yBAAyB,QAAQ,WAAW;AAGrD,OAAOC,cAAc,MAAM,4BAA4B;AAAC;AAgBxD,IAAMC,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAsB;EAAA,OAAMA,KAAK,CAACC,YAAY,aAAMD,KAAK,CAACC,YAAY,UAAO,KAAK;AAAA,CAAC;AAE5G,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIF,KAAsB,EAAK;EACvD,IAAMG,MAAM,GAAGJ,eAAe,CAACC,KAAK,CAAC;EACrC,QAAQA,KAAK,CAACI,QAAQ;IACpB,KAAK,MAAM;MACT,qBAAcD,MAAM,cAAIA,MAAM;IAEhC,KAAK,OAAO;MACV,iB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ACZqC,oBAAoB;EACpBH,QAAQ;EACRvB,WAAW;EACX8B,YAAY;AAAA;AA6Gd,eAAef,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","names":[],"sources":["../../../src/Card/HorizontalCard/types.ts"],"sourcesContent":["import {IconButtonProps} from '../../Button/Iconbutton';\nimport React from 'react';\nimport {ToggleButtonProps} from '../../Toggles/ToggleButton';\nimport {DropdownButtonProps} from '../../Dropdown/DropdownButtonTypes';\nimport {TagVariants} from '../../Tag';\nimport {LinearProgressProps} from '../../LinearProgress/LinearProgress';\nimport { Testable } from '
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../../src/Card/HorizontalCard/types.ts"],"sourcesContent":["import {IconButtonProps} from '../../Button/Iconbutton';\nimport React from 'react';\nimport {ToggleButtonProps} from '../../Toggles/ToggleButton';\nimport {DropdownButtonProps} from '../../Dropdown/DropdownButtonTypes';\nimport {TagVariants} from '../../Tag';\nimport {LinearProgressProps} from '../../LinearProgress/LinearProgress';\nimport { Testable } from '../../types';\n\nexport type HorizontalCardIconButton = Pick<IconButtonProps, 'action' | 'disabled' | 'tooltip'> & {\n componentType: 'icon';\n icon: React.ReactNode;\n}\n\nexport type HorizontalCardToggleButton =\n Pick<ToggleButtonProps, 'active' | 'onChange' | 'disabled' | 'defaultState' | 'activeState'>\n & { componentType: 'toggle'; }\n\nexport type HorizontalCardDropdownButton =\n Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'itemsType' | 'action' | 'actionIcon' | 'actionLabel' | 'actionLoading' | 'actionVariant' | 'multiSelect' | 'scrollable' | 'pinTopItem' | 'maxHeight'>\n & {\n componentType: 'dropdown';\n icon: React.ReactNode;\n}\n\nexport interface HorizontalCardTag {\n label: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nexport type HorizontalCardLinearProgression = Pick<LinearProgressProps, 'max' | 'value'>\n\nexport interface HorizontalCardProps extends Testable, Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onClick' | 'onKeyDown' | 'onMouseDown'> {\n variant?: 'outline' | 'elevated';\n action?: () => void;\n disabled?: boolean;\n title: string;\n description?: string;\n icon?: React.ReactElement;\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\n tags?: HorizontalCardTag[];\n progress?: HorizontalCardLinearProgression;\n actions?: (HorizontalCardIconButton | HorizontalCardToggleButton | HorizontalCardDropdownButton)[];\n}\n"],"mappings":""}
|
|
@@ -4,7 +4,7 @@ import { ToggleButtonProps } from '../../Toggles/ToggleButton';
|
|
|
4
4
|
import { DropdownButtonProps } from '../../Dropdown/DropdownButtonTypes';
|
|
5
5
|
import { TagVariants } from '../../Tag';
|
|
6
6
|
import { LinearProgressProps } from '../../LinearProgress/LinearProgress';
|
|
7
|
-
import { Testable } from '
|
|
7
|
+
import { Testable } from '../../types';
|
|
8
8
|
export type HorizontalCardIconButton = Pick<IconButtonProps, 'action' | 'disabled' | 'tooltip'> & {
|
|
9
9
|
componentType: 'icon';
|
|
10
10
|
icon: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/Card/HorizontalCard/types.ts"],"sourcesContent":["import {IconButtonProps} from '../../Button/Iconbutton';\nimport React from 'react';\nimport {ToggleButtonProps} from '../../Toggles/ToggleButton';\nimport {DropdownButtonProps} from '../../Dropdown/DropdownButtonTypes';\nimport {TagVariants} from '../../Tag';\nimport {LinearProgressProps} from '../../LinearProgress/LinearProgress';\nimport { Testable } from '
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/Card/HorizontalCard/types.ts"],"sourcesContent":["import {IconButtonProps} from '../../Button/Iconbutton';\nimport React from 'react';\nimport {ToggleButtonProps} from '../../Toggles/ToggleButton';\nimport {DropdownButtonProps} from '../../Dropdown/DropdownButtonTypes';\nimport {TagVariants} from '../../Tag';\nimport {LinearProgressProps} from '../../LinearProgress/LinearProgress';\nimport { Testable } from '../../types';\n\nexport type HorizontalCardIconButton = Pick<IconButtonProps, 'action' | 'disabled' | 'tooltip'> & {\n componentType: 'icon';\n icon: React.ReactNode;\n}\n\nexport type HorizontalCardToggleButton =\n Pick<ToggleButtonProps, 'active' | 'onChange' | 'disabled' | 'defaultState' | 'activeState'>\n & { componentType: 'toggle'; }\n\nexport type HorizontalCardDropdownButton =\n Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'itemsType' | 'action' | 'actionIcon' | 'actionLabel' | 'actionLoading' | 'actionVariant' | 'multiSelect' | 'scrollable' | 'pinTopItem' | 'maxHeight'>\n & {\n componentType: 'dropdown';\n icon: React.ReactNode;\n}\n\nexport interface HorizontalCardTag {\n label: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nexport type HorizontalCardLinearProgression = Pick<LinearProgressProps, 'max' | 'value'>\n\nexport interface HorizontalCardProps extends Testable, Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onClick' | 'onKeyDown' | 'onMouseDown'> {\n variant?: 'outline' | 'elevated';\n action?: () => void;\n disabled?: boolean;\n title: string;\n description?: string;\n icon?: React.ReactElement;\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\n tags?: HorizontalCardTag[];\n progress?: HorizontalCardLinearProgression;\n actions?: (HorizontalCardIconButton | HorizontalCardToggleButton | HorizontalCardDropdownButton)[];\n}\n"],"mappings":""}
|