Skip to content

Commit

Permalink
component : GhostNavbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Abusayid693 committed Mar 27, 2022
1 parent 19d0cd9 commit 49e23bf
Show file tree
Hide file tree
Showing 12 changed files with 2,737 additions and 119 deletions.
2,153 changes: 2,076 additions & 77 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-terser": "^7.0.2",
"size-limit": "^7.0.8",
"tsdx": "^0.14.1",
"tslib": "^2.3.1",
Expand Down
47 changes: 47 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import postcss from "rollup-plugin-postcss";
//NEW
import { terser } from "rollup-plugin-terser";


const packageJson = require("./package.json");

export default [
{
input: "src/index.ts",
output: [
{
file: packageJson.main,
format: "cjs",
sourcemap: true,
},
{
file: packageJson.module,
format: "esm",
sourcemap: true,
},
],
plugins: [
// NEW
peerDepsExternal(),

resolve(),
commonjs(),
typescript({ tsconfig: "./tsconfig.json" }),
postcss(),

// NEW
terser(),
],
},
{
input: "dist/esm/types/index.d.ts",
output: [{ file: "dist/index.d.ts", format: "esm" }],
plugins: [dts()],
external: [/\.css$/],
},
];
2 changes: 1 addition & 1 deletion src/Button/Button.tsx → src/GhostNavbar/GhostNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface Props extends HTMLAttributes<HTMLDivElement> {
styles?: Styles;
}

export const Button = (props: Props) => {
export const GhostNavbar = (props: Props) => {
const { styles, children } = props;

var cssVariables = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font-size: 12.5px;
&__checkbox {
display: none;
}
}

&__button {
background-color: $color-white;
Expand Down Expand Up @@ -102,6 +102,8 @@
& ul {
@include centerItem;
list-style: none;
display: flex;
flex-direction: column;
& a {
text-decoration: none;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Button/style.css → src/GhostNavbar/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
list-style: none; }
list-style: none;
display: flex;
flex-direction: column; }
.navigation ul a {
text-decoration: none; }
.navigation li {
Expand Down
16 changes: 1 addition & 15 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
import React, { FC, HTMLAttributes, ReactChild } from 'react';

export interface Props extends HTMLAttributes<HTMLDivElement> {
/** custom content, defaults to 'the snozzberries taste like snozzberries' */
children?: ReactChild;
}

// Please do not use types off of a default export module or else Storybook Docs will suffer.
// see: https://github.com/storybookjs/storybook/issues/9556
/**
* A custom Thing component. Neat!
*/
export const Thing: FC<Props> = ({ children }) => {
return <div>{children || `the snozzberries taste like snozzberries`}</div>;
};
export * from "./GhostNavbar/GhostNavbar";
12 changes: 0 additions & 12 deletions stories/Button.stories.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions stories/GhostNavbar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Meta } from '@storybook/react';
import React from "react";
import { GhostNavbar } from '../src/GhostNavbar/GhostNavbar';

const meta: Meta = {
title: 'Ghost Navbar',
component: GhostNavbar,
};

export default meta

export const Default = ()=> <GhostNavbar styles={{navigationBackground:{backgroundColor: 'red'}}}/>
13 changes: 13 additions & 0 deletions tsdx.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const postcss = require('rollup-plugin-postcss');

module.exports = {
rollup(config, options) {
config.plugins.push(
postcss({
inject: false,
extract: !!options.writeMeta,
}),
);
return config;
},
};
Loading

0 comments on commit 49e23bf

Please sign in to comment.