Skip to content

Commit

Permalink
feat(shared): Generated the React components lib
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Nov 13, 2022
1 parent 33aeaa1 commit f6f882b
Show file tree
Hide file tree
Showing 46 changed files with 734 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ tools/**/out-test/**
.docusaurus/
.cache-loader/
libs/shared-ui-design-components-react/**/generated

.next
20 changes: 0 additions & 20 deletions apps/web/landing/ClientApp/app/error.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/web/landing/ClientApp/app/head.tsx

This file was deleted.

29 changes: 3 additions & 26 deletions apps/web/landing/ClientApp/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
import Link from "next/link";

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<head />
<body className="bg-gray-1100">
<nav>
<div className="flex flex-row gap-2">
<Link href="/" className="rounded-lg bg-gray-900 hover:bg-gray-800">
Home
</Link>
<Link
href="/contact"
className="rounded-lg bg-gray-900 hover:bg-gray-800">
Contact
</Link>
<Link
href="/about"
className="rounded-lg bg-gray-900 hover:bg-gray-800">
About
</Link>
</div>
</nav>

<div className="lg:pl-72">{children}</div>
</body>
</html>
<div className="flex flex-row gap-2">
<div className="lg:pl-72">{children}</div>
</div>
);
}
4 changes: 0 additions & 4 deletions apps/web/landing/ClientApp/app/loading.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/web/landing/ClientApp/app/not-found.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions apps/web/landing/ClientApp/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const { API_URL } = process.env;
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
basePath: "/home",
distDir: "../../../../dist/web/landing/ClientApp",
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: true,
},
swcMinify: true,
Expand Down
48 changes: 30 additions & 18 deletions apps/web/shell/ClientApp/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { UserProvider } from "@auth0/nextjs-auth0";
import Link from "next/link";
import React from "react";
import "./globals.css";

export default function RootLayout({
Expand All @@ -10,25 +12,35 @@ export default function RootLayout({
<html lang="en">
<head />
<body className="bg-gray-1100">
<nav>
<div className="flex flex-row gap-2">
<Link href="/" className="rounded-lg bg-gray-900 hover:bg-gray-800">
Home
</Link>
<Link
href="/contact"
className="rounded-lg bg-gray-900 hover:bg-gray-800">
Contact
</Link>
<Link
href="/about"
className="rounded-lg bg-gray-900 hover:bg-gray-800">
About
</Link>
</div>
</nav>
<UserProvider>
<nav>
<div className="flex flex-row gap-2">
<Link
href="/"
className="rounded-lg bg-gray-900 text-primary hover:bg-gray-800">
Home
</Link>
<Link
href="/contact"
className="rounded-lg bg-gray-900 text-primary hover:bg-gray-800">
Contact
</Link>
<Link
href="/about"
className="rounded-lg bg-gray-900 text-primary hover:bg-gray-800">
About
</Link>

<div className="lg:pl-72">{children}</div>
<Link
href="/api/auth/login"
className="rounded-lg bg-gray-900 text-primary hover:bg-gray-800">
Login
</Link>
</div>
</nav>

<div className="lg:pl-72">{children}</div>
</UserProvider>
</body>
</html>
);
Expand Down
8 changes: 4 additions & 4 deletions apps/web/shell/ClientApp/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const { DOCS_URL, API_URL } = process.env;
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
basePath: "/",
distDir: "../../../../dist/web/shell/ClientApp",
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: true,
},
swcMinify: true,
Expand All @@ -31,8 +31,8 @@ const nextConfig = {
destination: `${DOCS_URL}/:path*`,
},
{
source: "/api/:path*",
destination: `${API_URL}/api/:path*`,
source: "/api/os/:path*",
destination: `${API_URL}/api/os/:path*`,
},
];
},
Expand Down
3 changes: 3 additions & 0 deletions apps/web/shell/ClientApp/pages/api/auth/[...auth0].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { handleAuth } from "@auth0/nextjs-auth0";

export default handleAuth();
17 changes: 2 additions & 15 deletions design-system/components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
"dev": true,
"prod": false,
"clean": false,
"verbose": false
"verbose": true
},
"production": {
"dev": false,
"prod": true,
"clean": false
"clean": true
}
}
},
Expand Down Expand Up @@ -80,24 +80,11 @@
"serve": {
"executor": "@nxext/stencil:serve",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"projectType": "library",
"tsConfig": "design-system/components/tsconfig.lib.json",
"configPath": "design-system/components/stencil.config.ts",
"outputPath": "dist/design-system/components"
},
"configurations": {
"development": {
"dev": true,
"debug": true,
"verbose": true
},
"production": {
"dev": false,
"debug": false,
"verbose": false
}
}
},
"e2e": {
Expand Down
2 changes: 0 additions & 2 deletions design-system/components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { ButtonTransitionDirections, ButtonTypes, ButtonVariants } from "./components/os-button/os-button.types";
import { SelectOption } from "./components/os-select/os-select.types";
export namespace Components {
interface OsButton {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import {
Prop,
} from "@stencil/core";
import clsx from "clsx";
import {
ButtonTransitionDirections,
ButtonTypes,
ButtonVariants,
} from "./os-button.types";

@Component({
tag: "os-button",
Expand Down Expand Up @@ -131,7 +126,7 @@ export class OsButton {
<div
class={clsx(
this.getTextColor(),
"font-btn-label-1 text-btn-label-1 rounded-full bg-bg-1 px-8 py-3"
"rounded-full bg-bg-1 px-8 py-3 font-btn-label-1 text-btn-label-1"
)}>
{this.inverse ? (
<slot name="hover-text">{this.getDefaultText()}</slot>
Expand Down Expand Up @@ -274,7 +269,7 @@ export class OsButton {
this.variant !== ButtonVariants.GRADIENT ||
this.disabled,
},
"font-btn-label-1 text-btn-label-1 flex h-full w-full items-center justify-center text-center"
"flex h-full w-full items-center justify-center text-center font-btn-label-1 text-btn-label-1"
)}>
{this.inverse ? (
<slot>{this.getDefaultText()}</slot>
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions design-system/components/src/components/os-input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<!-- Auto Generated Below -->


## Overview

An input field used in forms to collect data from users

## Properties

| Property | Attribute | Description | Type | Default |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Watch,
} from "@stencil/core";
import clsx from "clsx";
import { SelectOption } from "./os-select.types";

@Component({
tag: "os-select",
Expand Down

This file was deleted.

52 changes: 52 additions & 0 deletions design-system/components/src/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
declare interface SelectOption {
/**
* The string value to display in the field
*/
name: string;

/**
* The value stored behind the scenes when selected
*/
value: string;

/**
* Is the option value valid for selection in the dropdown
*/
disabled: boolean;

/**
* Sets or retrieves whether the option in the list box is the default item.
*/
selected: boolean;
}

declare enum ButtonVariants {
GRADIENT = "gradient",
PRIMARY = "primary",
SECONDARY = "secondary",
TERTIARY = "tertiary",
}

declare enum ButtonTransitionDirections {
LEFT = "left",
RIGHT = "right",
TOP = "top",
BOTTOM = "bottom",
}

declare enum ButtonTypes {
/**
* The button is a submit button (submits form-data)
*/
SUBMIT = "submit",

/**
* The button is a reset button (resets the form-data to its initial values)
*/
RESET = "reset",

/**
* The button is a clickable button
*/
BUTTON = "button",
}
Loading

0 comments on commit f6f882b

Please sign in to comment.