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

A11y workshop pages #3923

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .changeset/twenty-radios-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/a11y-workshop-pages": major
---

A11y workshop pages
41 changes: 41 additions & 0 deletions packages/a11y-workshop-pages/docs/A11yWorkshopPages.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { useEffect, useState } from "react"
import { StoryFn } from "@storybook/react"
import { Admin as AdminPage, Settings as SettingsPage } from "../src/"

export default {
tags: ["autodocs"],
title: "Culture Amp",
decorators: [
(StoryComponent: StoryFn) => (
<div style={{ margin: "-1rem", minHeight: "1200px" }}>
<StoryComponent />
</div>
),
],
}

export const Admin: StoryFn = () => {
useEffect(() => {
window.document.title = "Culture Amp"
}, [])
const [adminPageActive, setAdminPageActive] = useState<boolean>(false)
const onNavPress = (page: string): void => {
if (page === "settings") {
setAdminPageActive(false)
} else if (page === "admin") {
setAdminPageActive(true)
}
}

if (adminPageActive) {
return <AdminPage onNavPress={onNavPress} />
}

return <SettingsPage onNavPress={onNavPress} />
}

Admin.parameters = {
backgrounds: { default: "Gray 100" },
chromatic: { disable: false },
}
Admin.storyName = "Culture Amp"
1 change: 1 addition & 0 deletions packages/a11y-workshop-pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src"
57 changes: 57 additions & 0 deletions packages/a11y-workshop-pages/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "@kaizen/a11y-workshop-pages",
"version": "0.0.0",
"description": "A11y workshop pages",
"scripts": {
"prepublish": "tsc --project tsconfig.dist.json",
"build": "yarn clean && yarn prepublish",
"build:watch": "yarn clean && yarn prepublish --watch",
"clean": "rimraf '**/*.d.ts' '**/*.js' '**/*.map'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cultureamp/kaizen-design-system.git",
"directory": "packages/a11y-workshop-pages"
},
"bugs": {
"url": "https://github.com/cultureamp/kaizen-design-system/issues"
},
"files": [
"**/*",
"!**/*.ts",
"!**/*.tsx",
"**/*.d.ts",
"!**/*.spec.*",
"!**/*.snap",
"!draft-templates",
"!stories",
"!docs",
"!tsconfig.dist.json"
],
"author": "",
"private": false,
"license": "MIT",
"dependencies": {
"@kaizen/component-base": "^1.1.7",
"@kaizen/component-library": "^16.9.3",
"@kaizen/draft-form": "^10.4.8",
"@kaizen/draft-tooltip": "^5.4.47",
"@kaizen/draft-title-block-zen": "^7.10.12",
"@kaizen/draft-slider": "^1.8.12",
"@kaizen/button": "^3.0.4",
"@kaizen/draft-card": "^3.2.11",
"@kaizen/typography": "^2.3.11",
"@kaizen/draft-page-layout": "^2.3.13",
"@kaizen/date-picker": "^6.2.3",
"@kaizen/draft-menu": "^5.0.2",
"classnames": "^2.3.2",
"uuid": "^9.0.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@kaizen/design-tokens": "^2.10.3 || ^3.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
"react": "^16.9.0 || ^17.0.0 || ^18.0.0"
}
}
62 changes: 62 additions & 0 deletions packages/a11y-workshop-pages/src/Admin/Admin.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@import "~@kaizen/design-tokens/sass/color";
@import "~@kaizen/design-tokens/sass/spacing";
@import "~@kaizen/design-tokens/sass/typography";

.flex {
display: flex;
}

.alignItemsCenter {
align-items: center;
}

.justifyContentCenter {
justify-content: center;
}

.sidebar {
flex: 0 0 240px;
}

.content {
flex: 1 0 auto;
}

button.navItem {
// button reset
appearance: none;
background: transparent;
border: none;
font: inherit;
margin: 0;
padding: 0;
display: block;
margin-bottom: $spacing-md;
color: $color-purple-800;
text-decoration: none;
font-family: $typography-heading-4-font-family;
font-weight: $typography-heading-4-font-weight;
font-size: $typography-heading-4-font-size;
line-height: $typography-heading-4-line-height;
letter-spacing: $typography-heading-4-letter-spacing;
}

.navItem.active {
color: $color-blue-500;
}

.headingLabel {
margin-bottom: $spacing-xs;
}

.formHelpText {
height: 1.2rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 1rem;
}

.infoIcon {
color: $color-purple-800;
}
38 changes: 38 additions & 0 deletions packages/a11y-workshop-pages/src/Admin/Admin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react"
import { Box } from "@kaizen/component-library"
import { Container, Content } from "@kaizen/draft-page-layout"
import { TitleBlockZen } from "@kaizen/draft-title-block-zen"
import { Heading } from "@kaizen/typography"
import { Sidebar } from "./Sidebar"
import styles from "./Admin.module.scss"

interface AdminProps {
onNavPress: (page: string) => void
}

export const Admin = (props: AdminProps): JSX.Element => (
<>
<TitleBlockZen
variant="admin"
title="Account admin"
breadcrumb={{
path: "#",
text: "Back to home",
}}
/>
<Container>
<Content>
<div className={styles.flex}>
<Box classNameOverride={styles.sidebar}>
<Sidebar onNavPress={props.onNavPress} />
</Box>
<div className={styles.content}>
<Heading variant="heading-2" tag="h1" style={{ flex: "1 0 auto" }}>
Administrators
</Heading>
</div>
</div>
</Content>
</Container>
</>
)
Loading