Skip to content

Commit 84923c8

Browse files
committed
Big refactor, all things working
1 parent 997f0e7 commit 84923c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3043
-8457
lines changed

.storybook-react/main.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["./stories/**/*.stories.ts"],
5+
staticDirs: ["./static"],
6+
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
7+
framework: {
8+
name: "@storybook/react-vite",
9+
options: {},
10+
},
11+
core: {
12+
disableTelemetry: true,
13+
}
14+
};
15+
export default config;
16+

.storybook-react/preview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
actions: { argTypesRegex: "^on[A-Z].*" },
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { Button } from '../../components/react';
4+
5+
const meta = {
6+
title: 'Button',
7+
component: Button,
8+
} satisfies Meta<typeof Button>;
9+
10+
export default meta;
11+
12+
13+
export const Template: StoryObj = {
14+
args: {
15+
innerHTML: "Click me",
16+
variant: "primary",
17+
disabled: false,
18+
onClick: () => console.log("Click!")
19+
},
20+
argTypes: {
21+
variant: {
22+
options: ["default", "primary", "success", "neutral", "warning", "danger"],
23+
control: {
24+
type: "select",
25+
},
26+
},
27+
disabled: {
28+
options: [true, false],
29+
control: {
30+
type: "radio",
31+
},
32+
},
33+
},
34+
};
35+
36+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
import { hrefTo } from '@storybook/addon-links';
3+
import { Header } from '../../components/react/index';
4+
5+
const defaultLogo = "";
6+
7+
const twoTab = [
8+
{
9+
label: 'GO TO HEADER PAGE',
10+
clickEvent: async () => {
11+
const url = await hrefTo('Button', 'Template');
12+
window.location.href = url;
13+
}
14+
},
15+
{
16+
label: 'GO TO TRACKING PAGE',
17+
clickEvent: async () => {
18+
const url = await hrefTo('Tracking', 'Template');
19+
window.location.href = url;
20+
}
21+
}
22+
];
23+
24+
const meta = {
25+
title: 'Header',
26+
component: Header,
27+
args: {
28+
size: "large",
29+
title: "",
30+
logo: defaultLogo,
31+
drawer: true,
32+
tabs: twoTab,
33+
},
34+
argTypes: {
35+
size: {
36+
options: ["large", "small"],
37+
control: {
38+
type: "select",
39+
},
40+
},
41+
title: {
42+
options: ["", "Tasking Manager", "FMTM", "Drone Tasking Manager"],
43+
control: {
44+
type: "select",
45+
},
46+
},
47+
logo: {
48+
options: [defaultLogo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG8AAAAgCAYAAAAcyybZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAWPSURBVHgB7VpLcttGEO0BmCK1inMDcJOUlFRZ2mlhk9AJTJ7A1AkinUDkCUSegNQJrJxAIL3xjnbFkZxshNxAqcqCchmYvAYBCqDwGYASYpfwqljEZzANTHdPv+4ZQSm4Ns1nt1JeSKJdKgtS9rdnswFVyISWdrNpWTdSiC4ObSoLQvSvWq0TqpAJodLoyjQNIeUcHviMSoImZe+n2eyMKiRCSXmMv0xz111OoaUp0BFi7xfLek8VYqGpNvwRg4gp9JhKBLzvgr2eKsRC2fMCYDD7IBVKMUlKOXWJ3uuatvIe13UNCDWFEG1Sg404eLBtWTZViOCe8jyyIISR8VAnafrEPSY5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JBvPGHIG5Fgn2f024u7Dm++ccFa9TTli1wLJVZOtkmcHFMJ8IhkBmpxF1mBKFB3FQrUJjM9bu8r3cvx+MaCPdgfSD+eHsX2IERzEVKGv2r/Ki498dODMSoQe1QheTFWefE1VGVYTwVUVhf4mXA7riakGQyTE5/NPnlklcdUCtTmQxWLuSyExFml7FUVqElhG4RSEv8AO77w/GuuWSo/UO0yU98GgQR2klRjW3Um5VBq2ihPuYqTay45MVOkAnjKu8xyUTPEGmagZkYzG0sjA14aSVMiK63uOD14G9cwjbg2zC6zKj8wmJuiy0PfOnIpj5PnhZRzUi99WagYfIB32G7AKIXYRT71nImH0laLagd1InIpj7G+MFgKKgXGIrfyGNUO6q8DhZTH4F1mznIKLQVBdaXaQX0H5R3T6+Ak/jHre+sILb4aVMFDYeUx/B1fpcWi/2Px9WvGf7fz5sUqb8mmAAAAAElFTkSuQmCC"],
49+
control: {
50+
type: "select",
51+
},
52+
},
53+
drawer: {
54+
options: [true, false],
55+
control: {
56+
type: "radio",
57+
},
58+
},
59+
tabs: {
60+
options: {
61+
'2 Tabs': twoTab,
62+
},
63+
control: {
64+
type: "select",
65+
},
66+
},
67+
},
68+
} satisfies Meta<typeof Header>;
69+
70+
export default meta;
71+
type Story = StoryObj<typeof meta>;
72+
73+
export const Template: Story = {
74+
args: {},
75+
};
76+

.storybook-react/stories/logo.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import type { Meta, StoryObj } from '@storybook/react';
3+
4+
import { Logo } from '../../components/react/index';
5+
6+
const meta = {
7+
title: 'Logo',
8+
component: Logo,
9+
} satisfies Meta<typeof Logo>;
10+
11+
export default meta;
12+
13+
export const Template: StoryObj = {
14+
args: {},
15+
argTypes: {},
16+
};
17+
18+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { Toolbar } from '../../components/react/index';
4+
5+
const meta = {
6+
title: 'Toolbar',
7+
component: Toolbar,
8+
argTypes: {},
9+
} satisfies Meta<typeof Toolbar>;
10+
11+
export default meta;
12+
type Story = StoryObj<typeof meta>;
13+
14+
export const Template: Story = {
15+
args: {},
16+
};
17+

.storybook/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const config: StorybookConfig = {
88
name: "@storybook/web-components-vite",
99
options: {},
1010
},
11-
docs: {},
11+
core: {
12+
disableTelemetry: true,
13+
}
1214
};
1315
export default config;

.storybook/stories/button.stories.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,13 @@ export const Template: StoryObj = {
3030
},
3131
},
3232
},
33-
parameters: {
34-
showToast: () => {
35-
const alert = document.getElementById("click-toast");
36-
if (alert) {
37-
alert.show();
38-
}
39-
},
40-
},
4133
render: (args, { parameters }) => {
4234
return html`
43-
<h1>Button</h1>
4435
<hot-button
4536
variant="${args.variant}"
46-
@click=${() => {parameters.showToast()}}
37+
@click=${() => {console.log("click!")}}
4738
?disabled=${args.disabled}
4839
>${args.text}</hot-button>
49-
50-
<br>
51-
<br>
52-
<sl-alert id="click-toast" variant="success" duration="3000" closable>
53-
<sl-icon slot="icon" name="check2-circle"></sl-icon>
54-
You clicked the button.
55-
</sl-alert>
5640
`;
5741
},
5842
};

.storybook/stories/header.stories.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@ export const Template: StoryObj = {
9898
?drawer=${args.drawer}
9999
.tabs=${args.tabs}
100100
></hot-header>
101-
102-
<h1 class="hot-font-sans hot-font-size-x-large">
103-
Page Content
104-
</h1>
105-
<p class="hot-font-sans hot-font-size-medium">
106-
Lorem ipsum dolor sit amet, consectetur adipiscing
107-
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
108-
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
109-
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
110-
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
111-
laborum.
112-
</p>
113101
`;
114102
},
115103
};

.storybook/stories/toolbar.stories.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ export const Template: StoryObj = {
2222
},
2323
render: (args) => {
2424
return html`
25-
<h1>Toolbar</h1>
26-
<br>
27-
<br>
2825
<hot-toolbar
2926
tooltip-position="${args.tooltipPosition}"
3027
@redo=${() => {alert("Redo Clicked")}}

.storybook/stories/tracking.stories.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ export const Template: StoryObj = {
5050
},
5151
render: (args, { parameters }) => {
5252
return html`
53-
<h1>Matomo Tracking Banner</h1>
54-
The banner is disabled if a local storage key is set.
55-
<br>
56-
Click the buttons below to enable/disable and refresh the page.
57-
<br>
58-
<br>
59-
6053
<sl-button @click=${() => {
6154
parameters.removeKeyLocalStorage(args.siteId)
6255
}}>Re-Enable Banner</sl-button>

components/header/header.styles.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { css } from 'lit';
2+
3+
export default css`
4+
.header {
5+
display: flex;
6+
}
7+
8+
.header--link {
9+
text-decoration: none;
10+
}
11+
12+
.header--title {
13+
}
14+
15+
.header--tab-group {
16+
flex-direction: column;
17+
}
18+
19+
.header--nav {
20+
justify-content: space-between;
21+
justify-items: center;
22+
gap: 1rem;
23+
font-weight: 600;
24+
}
25+
26+
.header--nav-mobile {
27+
}
28+
29+
.header--person-circle {
30+
font-size: var(--sl-font-size-x-large);
31+
}
32+
33+
.header--drawer {
34+
font-size: var(--sl-font-size-x-large)
35+
}
36+
37+
.header--right-section {
38+
}
39+
40+
.header--logo-img {
41+
}
42+
}
43+
`

0 commit comments

Comments
 (0)