Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aerian-studios/aerian-component-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: aerian-studios/aerian-component-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: checkbox
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Nov 18, 2022

  1. feat:

    S-unya committed Nov 18, 2022
    Copy the full SHA
    3f3acab View commit details
  2. Copy the full SHA
    4e259a9 View commit details
  3. feat: use vite with sotrybook

    S-unya committed Nov 18, 2022
    Copy the full SHA
    7ef6349 View commit details
  4. feat:

    S-unya committed Nov 18, 2022
    Copy the full SHA
    2c24cf3 View commit details
  5. feat: Add AlertDialog & Button

    S-unya committed Nov 18, 2022
    Copy the full SHA
    991ee40 View commit details
  6. docs: readme

    S-unya committed Nov 18, 2022
    Copy the full SHA
    8338ff7 View commit details
  7. Copy the full SHA
    87646d2 View commit details

Commits on Nov 21, 2022

  1. Copy the full SHA
    0fdafb0 View commit details
  2. Copy the full SHA
    90a4c2f View commit details
  3. fix: add visuallyHidden style

    S-unya committed Nov 21, 2022
    Copy the full SHA
    da3e8be View commit details
  4. Copy the full SHA
    ed92b50 View commit details
  5. Copy the full SHA
    d32f1a8 View commit details
  6. Copy the full SHA
    dcab2b8 View commit details
  7. chore: comment out favicon

    S-unya committed Nov 21, 2022
    Copy the full SHA
    93866f9 View commit details
  8. test: fix AerButton tests

    S-unya committed Nov 21, 2022
    Copy the full SHA
    18b53be View commit details
  9. test: update tests

    S-unya committed Nov 21, 2022
    Copy the full SHA
    75a40c9 View commit details
  10. Copy the full SHA
    000e9af View commit details
  11. chore: more templating

    S-unya committed Nov 21, 2022
    Copy the full SHA
    93125ff View commit details
  12. Copy the full SHA
    67c4d32 View commit details

Commits on Nov 24, 2022

  1. fix: updated repo refs

    S-unya committed Nov 24, 2022
    Copy the full SHA
    054d3cf View commit details
  2. fix: updated repo refs

    S-unya committed Nov 24, 2022
    Copy the full SHA
    b41ee6c View commit details

Commits on Nov 25, 2022

  1. Copy the full SHA
    5f6a560 View commit details
  2. Copy the full SHA
    ea1b4ba View commit details
  3. docs: alert update readme

    S-unya committed Nov 25, 2022
    Copy the full SHA
    98543ba View commit details
  4. Merge branch 'update-packaging' of github.com:aerian-studios/aerian-c…

    …omponent-library into update-packaging
    S-unya committed Nov 25, 2022
    Copy the full SHA
    71c526f View commit details
  5. Copy the full SHA
    492b8c3 View commit details
  6. Copy the full SHA
    f934ec3 View commit details

Commits on Nov 26, 2022

  1. Copy the full SHA
    abb6c17 View commit details
  2. Copy the full SHA
    d3c2dbb View commit details
  3. Copy the full SHA
    402486c View commit details

Commits on Nov 27, 2022

  1. Copy the full SHA
    082b34c View commit details
  2. feat: checkbox new component

    S-unya committed Nov 27, 2022
    Copy the full SHA
    e90b9a3 View commit details
  3. Copy the full SHA
    5c787dd View commit details
  4. Copy the full SHA
    41a6383 View commit details
  5. Copy the full SHA
    a9250d8 View commit details
  6. Copy the full SHA
    b009951 View commit details
  7. docs: checkbox Add local theme

    S-unya committed Nov 27, 2022
    Copy the full SHA
    7e29744 View commit details
  8. test: checkbox tests

    S-unya committed Nov 27, 2022
    Copy the full SHA
    2d94da4 View commit details
  9. Copy the full SHA
    f47d69e View commit details

Commits on Nov 28, 2022

  1. Copy the full SHA
    b385a15 View commit details
  2. Copy the full SHA
    0ecef64 View commit details
  3. chore: checkbox clean up

    S-unya committed Nov 28, 2022
    Copy the full SHA
    af01545 View commit details
  4. Copy the full SHA
    2bf9f8f View commit details
  5. Update src/components/AerButton/AerButton.tsx

    Co-authored-by: Oli Booty <oliboots@gmail.com>
    S-unya and olibooty authored Nov 28, 2022
    Copy the full SHA
    e574732 View commit details
  6. Copy the full SHA
    3f12873 View commit details
  7. Copy the full SHA
    1385501 View commit details

Commits on Dec 5, 2022

  1. Copy the full SHA
    da6a2d1 View commit details
Showing with 11,141 additions and 7,410 deletions.
  1. +24 −3 .gitignore
  2. +25 −0 .storybook/main.cjs
  3. +0 −65 .storybook/main.js
  4. +10 −0 .storybook/preview.cjs
  5. +0 −6 .storybook/preview.js
  6. +21 −160 README.md
  7. +0 −18 _templates/component/new/component.ejs.t
  8. +0 −4 _templates/component/new/index.ejs.t
  9. +0 −11 _templates/component/new/story.ejs.t
  10. +0 −6 _templates/component/new/style.ejs.t
  11. +6 −0 generator-templates/Component/Component.modules.scss.hbs
  12. +16 −0 generator-templates/Component/Component.spec.tsx.hbs
  13. +42 −0 generator-templates/Component/Component.stories.tsx.hbs
  14. +16 −0 generator-templates/Component/Component.tsx.hbs
  15. +3 −0 generator-templates/Component/index.ts.hbs
  16. +27 −0 generator-templates/context.ts.hbs
  17. +5 −0 generator-templates/hook.ts.hbs
  18. +5 −0 generator-templates/injectable-index.ts.hbs
  19. +15 −0 index.html
  20. +0 −4 modules.d.ts
  21. +51 −37 package.json
  22. +196 −0 plopfile.cjs
  23. +0 −19 src/Theme/index.tsx
  24. +158 −0 src/components/AerAccordion/AerAccordion.module.scss
  25. +71 −0 src/components/AerAccordion/AerAccordion.spec.tsx
  26. +147 −0 src/components/AerAccordion/AerAccordion.stories.tsx
  27. +107 −0 src/components/AerAccordion/AerAccordion.tsx
  28. +145 −0 src/components/AerAccordion/__snapshots__/AerAccordion.spec.tsx.snap
  29. +3 −0 src/components/AerAccordion/index.ts
  30. +102 −0 src/components/AerAlertDialog/AerAlertDialog.module.scss
  31. +111 −0 src/components/AerAlertDialog/AerAlertDialog.spec.tsx
  32. +73 −0 src/components/AerAlertDialog/AerAlertDialog.stories.tsx
  33. +90 −0 src/components/AerAlertDialog/AerAlertDialog.tsx
  34. +163 −0 src/components/AerAlertDialog/__snapshots__/AerAlertDialog.spec.tsx.snap
  35. +3 −0 src/components/AerAlertDialog/index.ts
  36. +137 −0 src/components/AerButton/AerButton.module.scss
  37. +56 −0 src/components/AerButton/AerButton.spec.tsx
  38. +111 −0 src/components/AerButton/AerButton.stories.tsx
  39. +45 −0 src/components/AerButton/AerButton.tsx
  40. +3 −0 src/components/AerButton/index.ts
  41. +109 −0 src/components/AerCheckbox/AerCheckbox.module.scss
  42. +205 −0 src/components/AerCheckbox/AerCheckbox.spec.tsx
  43. +119 −0 src/components/AerCheckbox/AerCheckbox.stories.tsx
  44. +154 −0 src/components/AerCheckbox/AerCheckbox.tsx
  45. +32 −0 src/components/AerCheckbox/__snapshots__/AerCheckbox.spec.tsx.snap
  46. +3 −0 src/components/AerCheckbox/index.ts
  47. +4 −5 src/components/Form/Form.tsx
  48. +12 −0 src/components/index.ts
  49. +10 −0 src/main.module.scss
  50. +32 −0 src/main.tsx
  51. +71 −0 src/styles/README.md
  52. +8 −0 src/styles/_animation.scss
  53. +24 −0 src/styles/_breakpoints.scss
  54. +116 −0 src/styles/_colors.scss
  55. +70 −0 src/styles/_elements.scss
  56. +43 −0 src/styles/_layout.scss
  57. +7 −0 src/styles/_surfaces.scss
  58. +37 −0 src/styles/_typography.scss
  59. +77 −0 src/styles/formElements.module.scss
  60. +7 −0 src/styles/index.scss
  61. +102 −0 src/styles/layout.module.scss
  62. +341 −0 src/styles/normalize.scss
  63. +18 −0 src/styles/utils.module.scss
  64. +15 −0 src/types/modules.d.ts
  65. +10 −0 src/types/types.ts
  66. +17 −12 tsconfig.json
  67. +9 −0 tsconfig.node.json
  68. +7 −0 vite.config.ts
  69. +7 −0 vitest.config.ts
  70. +7,488 −7,060 yarn.lock
27 changes: 24 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/node_modules/
/build
.npmrc
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
25 changes: 25 additions & 0 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
core: {
builder: "@storybook/builder-vite", // 👈 The builder enabled here.
},
framework: "@storybook/react",
async viteFinal(config) {
return {
...config,
define: {
...config.define,
global: "window",
},
// esbuild: {
// ...config.esbuild,
// jsxInject: `import React from 'react'`,
// },
};
},
};
65 changes: 0 additions & 65 deletions .storybook/main.js

This file was deleted.

10 changes: 10 additions & 0 deletions .storybook/preview.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import "../src/styles/index.scss";
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
6 changes: 0 additions & 6 deletions .storybook/preview.js

This file was deleted.

181 changes: 21 additions & 160 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,181 +1,42 @@
# Aerian Component Library
# Aerated - Component Library

# Installation
## Installation

TODO This is coming while we decide how best to manage versioning. See below for local development.

<!--
```bash
npm install --save @aerian-studios/aerian-component-library@0.0.1
npm install --save @aerian-studios/aerated@0.0.1
# or
yarn add @aerian-studios/aerian-component-library@0.0.1
```

# Usage

# Form

The `Form` component is an implimentation of `react-hook-form`.
The component has 2 required props `onSubmitFn` and `validationSchema`.

- onSubmitFn:
- Is called when the form is submitted and passed data from the form. Data is passed to the function as an object where each key is the `name` of the form elements that are passed as children to `Form` (see adding children)
- validationSchema:
- Uses the `yup` schema builder library to validate inputs to the form. `yup` needs to be installed and imported separately. The schema can be passed to `Form` as a plain object, as it is wrapped internally with `yup.object().shape()`

## Full example

```tsx
import {
Form,
FormContents,
FormControls,
FormInput,
FormInputGroup,
FormSelect
} from 'aerian-component-library';
import * as yup from 'yup';

const validationSchema = {
email: yup.string().email().required()
}

const FormComponent = () => {
const submitHandler = (data) => {
// do something with the data returned from the form
// data is passed to onSubmitFn with the names of
// each input as the key e.g.:

/*
{
email: "someemail@email.com,
types_of_fish: "pike",
peoples_name: ["jon", "amy"],
types_of_cheese: "cheddar
}
*/
}

return (
<Form onSubmitFn={submitHandler} validationSchema={validationSchema}>
<FormContents>
<FormInput label="Name" name="email" type="email" />

<FormInputGroup
name="types_of_fish"
label="Types of fish"
inputs={[
{
label: "Salmon",
value: "salmon",
defaultChecked: true,
},
{
label: "Pike",
value: "pike",
},
]}
/>

<FormInputGroup
name="peoples_names"
label="People's Names"
type="checkbox"
inputs={[
{
label: "Jon",
value: "jon",
defaultChecked: true,
},
{
label: "Amy",
value: "amy",
},
{
label: "Carol",
value: "carol",
},
]}
/>

<FormSelect
name="types_of_cheese"
label="Types of cheese"
options={[
{ label: "Cheddar", value: "cheddar" },
{ label: "Gouda", value: "gouda" },
{ label: "Brie", value: "brie" },
]}
/>
</FormContents>

<FormControls />
</Form>
);
}

export default FormComponent;
```

## Form Element
yarn add @aerian-studios/aerated@0.0.1
``` -->

```tsx
import { Form } from 'aerian-component-library';
## Usage

const FormComponent = () => {
return (
<Form onSubmitFn={() => {}} validationSchema={{}}>
</Form>
);
}
TODO

export default FormComponent;
```

### Props
| Name | Type | Default |
| :--------------- | :------------------------------------------------------- | :-------- |
| onSubmitFn | `(data: Record<string, string &#124; string[]>) => void` | undefined |
| validationSchema | `Record<string, YupTypes>` | undefined |
| onResetFn? | `() => void` | undefined |
## Form

## Developing locally
<hr />
TODO

The repository contains storybooks for building and testing new components. To add components to the library use the following steps:
## Developing the component library

Clone this repository:
There are generators to quickly output the files and boilerplate that you need to output a component:

```bash
https://github.com/matt-hardman/aerian-component-library.git
```
yarn generate

Install dependencies:
# or npm

```bash
yarn
npm run generate
```

Run:
All components should have tests, a story, some local theming. Largely speaking the development and documentation of a component occurs in storybooks. This encourages thinking about the the component in isolation.

```bash
yarn storybook
```

Then create a component and relevant story within the `src` folder.
### Developing locally

## Linking a local version of aerian-component-library to another project
<hr />

Based on: [this article](https://medium.com/@mtfranchetto/the-solution-for-a-working-npm-yarn-link-ddcb4f3c785e)

Sometimes it is useul to link a local version of a library to another react project, to ensure everything is working correctly, before publishing an update to the npm dirctory.

Using `npm link` or `yarn link` can cause problems as the whole project is linked and multiple versions of react are detected.

To solve this problem `yalc` can be used.

```bash
yarn global add yalc
```

Once yalc is installed running `yarn npm-publish:local` will build the library as if it was being published to npm, but store it locally.
The repository contains storybooks for building and testing new components. There is also a simple `main.tsx` to allow you to test adding classes.

Next go to the react project you want to install the local version of `aerian-component-library` and run `yalc add aerian-component-library`.
## [Using themes and local styles](./src/styles/README.md)
18 changes: 0 additions & 18 deletions _templates/component/new/component.ejs.t

This file was deleted.

4 changes: 0 additions & 4 deletions _templates/component/new/index.ejs.t

This file was deleted.

11 changes: 0 additions & 11 deletions _templates/component/new/story.ejs.t

This file was deleted.

6 changes: 0 additions & 6 deletions _templates/component/new/style.ejs.t

This file was deleted.

6 changes: 6 additions & 0 deletions generator-templates/Component/Component.modules.scss.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** Local theme
*
*/
.component {

}
Loading