-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from hotosm/dev
Big refactor: all things working
- Loading branch information
Showing
55 changed files
with
3,425 additions
and
8,682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["./stories/**/*.stories.ts"], | ||
staticDirs: ["./static"], | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"], | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {}, | ||
}, | ||
core: { | ||
disableTelemetry: true, | ||
} | ||
}; | ||
export default config; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Button } from '../../components/react'; | ||
|
||
const meta = { | ||
title: 'Button', | ||
component: Button, | ||
} satisfies Meta<typeof Button>; | ||
|
||
export default meta; | ||
|
||
|
||
export const Template: StoryObj = { | ||
args: { | ||
innerHTML: "Click me", | ||
variant: "primary", | ||
disabled: false, | ||
onClick: () => console.log("Click!") | ||
}, | ||
argTypes: { | ||
variant: { | ||
options: ["default", "primary", "success", "neutral", "warning", "danger", "text"], | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
size: { | ||
options: ["small", "medium", "large"], | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
outline: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
pill: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
disabled: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
caret: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
loading: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { hrefTo } from '@storybook/addon-links'; | ||
import { Header } from '../../components/react/index'; | ||
|
||
const defaultLogo = ""; | ||
|
||
const twoTab = [ | ||
{ | ||
label: 'GO TO HEADER PAGE', | ||
clickEvent: async () => { | ||
const url = await hrefTo('Button', 'Template'); | ||
window.location.href = url; | ||
} | ||
}, | ||
{ | ||
label: 'GO TO TRACKING PAGE', | ||
clickEvent: async () => { | ||
const url = await hrefTo('Tracking', 'Template'); | ||
window.location.href = url; | ||
} | ||
} | ||
]; | ||
|
||
const meta = { | ||
title: 'Header', | ||
component: Header, | ||
args: { | ||
size: "small", | ||
title: "", | ||
logo: defaultLogo, | ||
drawer: true, | ||
tabs: twoTab, | ||
}, | ||
argTypes: { | ||
size: { | ||
options: ["large", "medium", "small"], | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
title: { | ||
options: ["", "Tasking Manager", "FMTM", "Drone Tasking Manager"], | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
logo: { | ||
options: [defaultLogo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG8AAAAgCAYAAAAcyybZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAWPSURBVHgB7VpLcttGEO0BmCK1inMDcJOUlFRZ2mlhk9AJTJ7A1AkinUDkCUSegNQJrJxAIL3xjnbFkZxshNxAqcqCchmYvAYBCqDwGYASYpfwqljEZzANTHdPv+4ZQSm4Ns1nt1JeSKJdKgtS9rdnswFVyISWdrNpWTdSiC4ObSoLQvSvWq0TqpAJodLoyjQNIeUcHviMSoImZe+n2eyMKiRCSXmMv0xz111OoaUp0BFi7xfLek8VYqGpNvwRg4gp9JhKBLzvgr2eKsRC2fMCYDD7IBVKMUlKOXWJ3uuatvIe13UNCDWFEG1Sg404eLBtWTZViOCe8jyyIISR8VAnafrEPSY5owXRcA+EJ6mPOZhsA/34hmBQOuwFptC0/p4i7ilvk9gGTxvdalo/7yArerO1PZ0eUIUVYqdNDGYPgzmmXD2JAaa2PhWEoswJFHhIFTzEEhYoYZKLnGyouEAm+slSTK/KAe+QSlgUp7MH9YbLVmsIMvNrWhvpusc7b98OqQCu2m2p0MzGNzU/tdvzoLqE//Od6bQb6YuZsJTXwbnjuoe6rlvha2lAePrt59msE5ZDMeHBl3NBPjfAcwM8109NFdib4IHpiTK8Ljic7+8b4WMmJatzHEfO+f7aj69vIWYy6UkVqWmnf7Zar+mRAab8w0omyBUG0Yw0yBta1iB8XhGWA5iXL18eRcS4bp9iSF0tPOBxuF0s+lv1+vO4+qZnOdOpzceBFV7t7ze3372zG/X6GGnBFLf6sPY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Ak/jHre+sILb4aVMFDYeUx/B1fpcWi/2Px9WvGf7fz5sUqb8mmAAAAAElFTkSuQmCC"], | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
drawer: { | ||
options: [true, false], | ||
control: { | ||
type: "radio", | ||
}, | ||
}, | ||
tabs: { | ||
options: { | ||
'2 Tabs': twoTab, | ||
}, | ||
control: { | ||
type: "select", | ||
}, | ||
}, | ||
}, | ||
} satisfies Meta<typeof Header>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Template: Story = { | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
args: {}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Logo } from '../../components/react/index'; | ||
|
||
const meta = { | ||
title: 'Logo', | ||
component: Logo, | ||
} satisfies Meta<typeof Logo>; | ||
|
||
export default meta; | ||
|
||
export const Template: StoryObj = { | ||
args: {}, | ||
argTypes: {}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Toolbar } from '../../components/react/index'; | ||
|
||
const meta = { | ||
title: 'Toolbar', | ||
component: Toolbar, | ||
argTypes: {}, | ||
} satisfies Meta<typeof Toolbar>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Template: Story = { | ||
args: {}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.