Skip to content

Commit

Permalink
WIP (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
freost authored Sep 20, 2023
1 parent dfe7a21 commit 1166037
Show file tree
Hide file tree
Showing 13 changed files with 263 additions and 312 deletions.
14 changes: 12 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
version: 2
updates:
# github-actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
target-branch: "1.x"
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
target-branch: "1.x"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
target-branch: "master"
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
target-branch: "master"
51 changes: 51 additions & 0 deletions gallery/src/components/ButtonExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Autocomplete, Button, Fab, Paper, Popper, Stack, styled, TextField, Typography } from "@mui/material"
import { useRef, useState } from "react"
import { ArrowDropDown } from "@mui/icons-material"

const InnerPaper = styled(Paper)({
maxWidth: "600px",
boxShadow:
"0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);",
})

export const ButtonExample = () => {
return (
<Paper variant="padded">
<Typography variant="h2">Eksempel på knapper</Typography>

<Typography variant="h3">Primary</Typography>

<InnerPaper variant="padded">
<Button variant="contained">Enabled</Button>
&nbsp;
<Button variant="contained" disabled>
Disabled
</Button>
</InnerPaper>

<Typography variant="h3">Secondary</Typography>

<InnerPaper variant="padded">
<Button variant="contained" color="secondary">
Enabled
</Button>
&nbsp;
<Button variant="contained" color="secondary" disabled>
Disabled
</Button>
</InnerPaper>

<Typography variant="h3">Secondary Result</Typography>

<InnerPaper variant="padded">
<Button variant="contained" color="secondaryResult">
Enabled
</Button>
&nbsp;
<Button variant="contained" color="secondaryResult" disabled>
Disabled
</Button>
</InnerPaper>
</Paper>
)
}
28 changes: 3 additions & 25 deletions gallery/src/components/Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ const PaletteDisplay = ({ name, path }: { name: string; path: string }) => {
<Box display="grid" gridTemplateAreas={{ xs: '"a a" "b c" "d e"', md: '"a a b c" "a a d e"' }}>
<ColorDrop path={path} name="Main" big gridArea="a" />
<ColorDrop path={path} name="Dark" gridArea="b" />
<ColorDrop path={path} name="50p" gridArea="c" />
<ColorDrop path={path} name="Light" gridArea="d" />
<ColorDrop path={path} name="25p" gridArea="e" />
</Box>
</Stack>
)
Expand All @@ -68,9 +66,7 @@ const TextPaletteDisplay = ({}) => {
<Box display="grid" gridTemplateAreas={'"a a b c" "a a d e" "a a f g"'}>
<ColorDrop path={"text"} name="Primary" big gridArea="a" />
<ColorDrop path={"text"} name="Secondary" gridArea="b" />
<ColorDrop path={"text"} name="50p" gridArea="c" />
<ColorDrop path={"text"} name="Disabled" gridArea="d" />
<ColorDrop path={"text"} name="25p" gridArea="e" />
<ColorDrop path={"text"} name="White" gridArea="f" />
</Box>
</Stack>
Expand All @@ -86,13 +82,9 @@ const BackgroundPaletteDisplay = ({}) => {
<Stack sx={{ maxWidth: { xs: "100%", md: "80%", xl: "60%" } }}>
<Typography variant="h4">Backgrounds</Typography>
<Stack>
<ColorDrop path={"background"} name="Black" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="White" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Disabled" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Border" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Hover" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Selected" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Primary" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Default" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Content" direction={"row"} sx={{ ...dropSx }} />
<ColorDrop path={"background"} name="Assets" direction={"row"} sx={{ ...dropSx }} />
</Stack>
</Stack>
)
Expand All @@ -107,26 +99,12 @@ export const Colors = () => {
<Grid item xs={6}>
<PaletteDisplay name="Primary colors" path="primary" />
</Grid>
<Grid item xs={6}>
<PaletteDisplay name="Info" path="info" />
</Grid>
<Grid item xs={6}>
<PaletteDisplay name="Secondary colors" path="secondary" />
</Grid>
<Grid item xs={6}>
<PaletteDisplay name="Error" path="error" />
</Grid>

<Grid item xs={6}>
<TextPaletteDisplay />
</Grid>

<Grid item xs={6}>
<PaletteDisplay name="Warning" path="warning" />
</Grid>
<Grid item xs={6}>
<PaletteDisplay name="Success" path="success" />
</Grid>
<Grid item xs={6}>
<BackgroundPaletteDisplay />
</Grid>
Expand Down
12 changes: 8 additions & 4 deletions gallery/src/components/Gallery.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { Container, Stack, Typography } from "@mui/material"
import { Container, Stack, Switch, Typography } from "@mui/material"
import { Colors } from "./Colors"
import { SpacingExample } from "./SpacingExample"
import { ButtonExample } from "./ButtonExample"
import { SwitchExample } from "./SwitchExample"
import { RadioExample } from "./RadioExample"

export const Gallery = () => (
<Container maxWidth="xl">
<Typography variant="h1">Arkivverket MUI theme</Typography>
<Typography variant="h1">Digitalarkivet MUI theme</Typography>
<Stack>
<Colors />
<SpacingExample />
<ButtonExample />
<SwitchExample />
<RadioExample />
</Stack>
</Container>
)
47 changes: 47 additions & 0 deletions gallery/src/components/RadioExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {
Autocomplete,
Button,
Fab,
FormControl,
FormControlLabel,
FormLabel,
Paper,
Popper,
Radio,
RadioGroup,
Stack,
styled,
Switch,
TextField,
Typography,
} from "@mui/material"
import { useRef, useState } from "react"
import { ArrowDropDown } from "@mui/icons-material"

const InnerPaper = styled(Paper)({
maxWidth: "600px",
boxShadow:
"0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);",
})

export const RadioExample = () => {
return (
<Paper variant="padded">
<Typography variant="h2">Eksempel på Radiobuttons</Typography>

<InnerPaper variant="padded">
<FormControl>
<RadioGroup
aria-labelledby="demo-radio-buttons-group-label"
defaultValue="superawesome"
name="radio-buttons-group"
>
<FormControlLabel value="superawesome" control={<Radio />} label="Superawesome" />
<FormControlLabel value="awesome" control={<Radio />} label="Awesome" />
<FormControlLabel value="other" control={<Radio />} label="Other" disabled />
</RadioGroup>
</FormControl>
</InnerPaper>
</Paper>
)
}
82 changes: 0 additions & 82 deletions gallery/src/components/SpacingExample.tsx

This file was deleted.

23 changes: 23 additions & 0 deletions gallery/src/components/SwitchExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Autocomplete, Button, Fab, Paper, Popper, Stack, styled, Switch, TextField, Typography } from "@mui/material"
import { useRef, useState } from "react"
import { ArrowDropDown } from "@mui/icons-material"

const InnerPaper = styled(Paper)({
maxWidth: "600px",
boxShadow:
"0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);",
})

export const SwitchExample = () => {
return (
<Paper variant="padded">
<Typography variant="h2">Eksempel på Switches</Typography>

<InnerPaper variant="padded">
<Switch />
&nbsp;
<Switch disabled />
</InnerPaper>
</Paper>
)
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"ts-loader": "^9.4.2",
"typescript": "^5.0.2",
"webpack": "^5.76.0",
"webpack-cli": "^5.0.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.11.1"
},
"files": [
Expand Down
7 changes: 0 additions & 7 deletions src/DaToggleButton.ts

This file was deleted.

51 changes: 0 additions & 51 deletions src/DaToggleButtonGroup.ts

This file was deleted.

Loading

0 comments on commit 1166037

Please sign in to comment.