Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Header): new component #158

Open
wants to merge 2 commits into
base: release/3.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configs/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const TSComponentsList = [
'Image',
'Rating',
'InteractiveWidget',
'GeneUIProvider'
'GeneUIProvider',
'Header'
];

const getInputs = (name, dir) => {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export { default as TransferList } from './lib/organisms/TransferList';
export { default as RichEditor } from './lib/organisms/RichEditor';
export { default as Drawer } from './lib/organisms/Drawer';
export { default as ActionableList } from './lib/organisms/ActionableList';
export { default as Header } from './lib/organisms/Header';

// Providers
export { default as GeneUIProvider, GeneUIDesignSystemContext } from './lib/providers/GeneUIProvider';
Expand Down
5 changes: 5 additions & 0 deletions src/lib/organisms/Header/Header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.header {
// Your styles here
color: var(--guit-ref-color-magenta-500base);
font-size: var(--guit-sem-font-caption-large-medium-font-size);
}
27 changes: 27 additions & 0 deletions src/lib/organisms/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, { FC } from 'react';
import { Meta } from '@storybook/react';

// Helpers
import { args, propCategory } from '../../../../stories/assets/storybook.globals';

// Components
import Header, { IHeaderProps } from './index';

const meta: Meta<typeof Header> = {
title: 'Organisms/Header',
component: Header,
argTypes: {
type: args({ control: false, ...propCategory.others })
},
args: {
type: 'fill the type prop value'
} as IHeaderProps
};

export default meta;

const Template: FC<IHeaderProps> = (args) => <Header {...args} />;

export const Default = Template.bind({});

Default.args = {} as IHeaderProps;
16 changes: 16 additions & 0 deletions src/lib/organisms/Header/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { ReactWrapper, mount } from 'enzyme';

// Components
import Header, { IHeaderProps } from './index';

describe('Header ', () => {
let setup: ReactWrapper<IHeaderProps>;
beforeEach(() => (setup = mount(<Header />)));

it('renders without crashing', () => {
expect(setup.exists()).toBeTruthy();
});

// Your tests here
});
20 changes: 20 additions & 0 deletions src/lib/organisms/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { FC } from 'react';

// Styles
import './Header.scss';

interface IHeaderProps {
/**
* type description
*/
type?: unknown;
}

/**
* Global Header component is a persistent navigation element that appears at the top of an application or website. It serves as a central hub for accessing key features and tools, ensuring consistent and intuitive navigation across all pages.
*/
const Header: FC<IHeaderProps> = ({ type }) => {
return <header className="header">Header component</header>;
};

export { IHeaderProps, Header as default };
1 change: 1 addition & 0 deletions src/lib/organisms/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { IHeaderProps, default as default } from './Header';
Loading