diff --git a/packages/web-react/src/components/Header/demo/HeaderExperimentalRTL.tsx b/packages/web-react/src/components/Header/demo/HeaderExperimentalRTL.tsx new file mode 100644 index 0000000000..f0e584fbb9 --- /dev/null +++ b/packages/web-react/src/components/Header/demo/HeaderExperimentalRTL.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { Checkbox } from '../../Checkbox'; + +const HeaderExperimentalRTL = () => { + const toggleRtl = () => { + const htmlElement = document.querySelector('html'); + + if (htmlElement?.hasAttribute('dir')) { + htmlElement?.removeAttribute('dir'); + } else { + htmlElement?.setAttribute('dir', 'rtl'); + } + }; + + return ; +}; + +export default HeaderExperimentalRTL; diff --git a/packages/web-react/src/components/Header/demo/HeaderActions.tsx b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActions.tsx similarity index 77% rename from packages/web-react/src/components/Header/demo/HeaderActions.tsx rename to packages/web-react/src/components/Header/demo/HeaderInvertedWithActions.tsx index 6a55b70c8d..5ec4aa8773 100644 --- a/packages/web-react/src/components/Header/demo/HeaderActions.tsx +++ b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActions.tsx @@ -1,22 +1,23 @@ import React, { useState } from 'react'; -import { ComponentStory } from '@storybook/react'; -import { Link } from '../../Link'; import { Button } from '../../Button'; +import { Link } from '../../Link'; +import { + Header, + HeaderDesktopActions, + HeaderDialog, + HeaderDialogActions, + HeaderDialogCloseButton, + HeaderDialogLink, + HeaderDialogNav, + HeaderDialogNavItem, + HeaderLink, + HeaderMobileActions, + HeaderNav, + HeaderNavItem, +} from '..'; import SpiritLogo from './SpiritLogo'; -import Header from '../Header'; -import HeaderMobileActions from '../HeaderMobileActions'; -import HeaderDesktopActions from '../HeaderDesktopActions'; -import HeaderNav from '../HeaderNav'; -import HeaderNavItem from '../HeaderNavItem'; -import HeaderLink from '../HeaderLink'; -import HeaderDialog from '../HeaderDialog'; -import HeaderDialogCloseButton from '../HeaderDialogCloseButton'; -import HeaderDialogActions from '../HeaderDialogActions'; -import HeaderDialogNav from '../HeaderDialogNav'; -import HeaderDialogNavItem from '../HeaderDialogNavItem'; -import HeaderDialogLink from '../HeaderDialogLink'; -const Story: ComponentStory = () => { +const HeaderInvertedWithActions = () => { const [isOpen, setOpen] = useState(false); const handleOpen = () => setOpen(true); @@ -83,4 +84,4 @@ const Story: ComponentStory = () => { ); }; -export default Story; +export default HeaderInvertedWithActions; diff --git a/packages/web-react/src/components/Header/demo/HeaderActionsAndHeaderDialog.tsx b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx similarity index 84% rename from packages/web-react/src/components/Header/demo/HeaderActionsAndHeaderDialog.tsx rename to packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx index 1bdff46445..9bd822c6c9 100644 --- a/packages/web-react/src/components/Header/demo/HeaderActionsAndHeaderDialog.tsx +++ b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx @@ -1,23 +1,25 @@ import React, { useState } from 'react'; -import { ComponentStory } from '@storybook/react'; import { Link } from '../../Link'; +import { + Header, + HeaderButton, + HeaderDesktopActions, + HeaderDialog, + HeaderDialogActions, + HeaderDialogButton, + HeaderDialogCloseButton, + HeaderDialogLink, + HeaderDialogNav, + HeaderDialogNavItem, + HeaderDialogText, + HeaderLink, + HeaderMobileActions, + HeaderNav, + HeaderNavItem, +} from '..'; import SpiritLogo from './SpiritLogo'; -import Header from '../Header'; -import HeaderMobileActions from '../HeaderMobileActions'; -import HeaderDesktopActions from '../HeaderDesktopActions'; -import HeaderNav from '../HeaderNav'; -import HeaderNavItem from '../HeaderNavItem'; -import HeaderLink from '../HeaderLink'; -import HeaderDialog from '../HeaderDialog'; -import HeaderDialogCloseButton from '../HeaderDialogCloseButton'; -import HeaderDialogActions from '../HeaderDialogActions'; -import HeaderDialogNav from '../HeaderDialogNav'; -import HeaderDialogNavItem from '../HeaderDialogNavItem'; -import HeaderDialogLink from '../HeaderDialogLink'; -import HeaderDialogText from '../HeaderDialogText'; -import HeaderDialogButton from '../HeaderDialogButton'; -const Story: ComponentStory = () => { +const HeaderInvertedWithActionsAndDialog = () => { const [isMenuOpen, setMenuOpen] = useState(false); const [isUserMenuOpen, setUserMenuOpen] = useState(false); @@ -57,13 +59,13 @@ const Story: ComponentStory = () => { - Marian - + @@ -143,4 +145,4 @@ const Story: ComponentStory = () => { ); }; -export default Story; +export default HeaderInvertedWithActionsAndDialog; diff --git a/packages/web-react/src/components/Header/demo/HeaderMinimalInverted.tsx b/packages/web-react/src/components/Header/demo/HeaderMinimalInverted.tsx new file mode 100644 index 0000000000..345fa9650f --- /dev/null +++ b/packages/web-react/src/components/Header/demo/HeaderMinimalInverted.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Link } from '../../Link'; +import { Header } from '..'; +import SpiritLogo from './SpiritLogo'; + +const HeaderMinimalInverted = () => { + return ( +
+ + + +
+ ); +}; + +export default HeaderMinimalInverted; diff --git a/packages/web-react/src/components/Header/demo/HeaderSimpleInverted.tsx b/packages/web-react/src/components/Header/demo/HeaderSimpleInverted.tsx new file mode 100644 index 0000000000..13a81db453 --- /dev/null +++ b/packages/web-react/src/components/Header/demo/HeaderSimpleInverted.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Link } from '../../Link'; +import { Header } from '..'; +import SpiritLogo from './SpiritLogo'; + +const HeaderSimpleInverted = () => { + return ( +
+ + + +
+ ); +}; + +export default HeaderSimpleInverted; diff --git a/packages/web-react/src/components/Header/demo/HeaderSimpleTransparent.tsx b/packages/web-react/src/components/Header/demo/HeaderSimpleTransparent.tsx new file mode 100644 index 0000000000..7f42c5b3c5 --- /dev/null +++ b/packages/web-react/src/components/Header/demo/HeaderSimpleTransparent.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import { Heading } from '../../Heading'; +import { Link } from '../../Link'; +import { Header } from '..'; +import SpiritLogo from './SpiritLogo'; + +const HeaderSimpleTransparent = () => { + return ( +
+
+ + + +
+ + + Example Cover + +
+ ); +}; + +export default HeaderSimpleTransparent; diff --git a/packages/web-react/src/components/Header/demo/index.tsx b/packages/web-react/src/components/Header/demo/index.tsx index 87621015c1..d56eb12eb2 100644 --- a/packages/web-react/src/components/Header/demo/index.tsx +++ b/packages/web-react/src/components/Header/demo/index.tsx @@ -1,20 +1,40 @@ +// Because there is no `dist` directory during the CI run +/* eslint-disable import/no-extraneous-dependencies, import/extensions, import/no-unresolved */ import React from 'react'; import ReactDOM from 'react-dom/client'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment, import/extensions, import/no-unresolved +// @ts-ignore: No declaration file +import icons from '@lmc-eu/spirit-icons/dist/icons'; import DocsSection from '../../../../docs/DocsSections'; -import Header from './Header'; -import HeaderActions from './HeaderActions'; -import HeaderActionsAndHeaderDialog from './HeaderActionsAndHeaderDialog'; +import { IconsProvider } from '../../../context'; +import HeaderMinimalInverted from './HeaderMinimalInverted'; +import HeaderInvertedWithActions from './HeaderInvertedWithActions'; +import HeaderInvertedWithActionsAndDialog from './HeaderInvertedWithActionsAndDialog'; +import HeaderSimpleInverted from './HeaderSimpleInverted'; +import HeaderSimpleTransparent from './HeaderSimpleTransparent'; +import HeaderExperimentalRTL from './HeaderExperimentalRTL'; ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - -
- - - - - - - + + + + + + + + + + + + + + + + + + + + , );