Skip to content

Commit

Permalink
refactor(docs): merge design system and ui (#994)
Browse files Browse the repository at this point in the history
Incorporate design system guidance inline with the `dhis2/ui` documentation and live examples
  • Loading branch information
varl authored Apr 21, 2022
1 parent d2b645e commit e206df1
Show file tree
Hide file tree
Showing 592 changed files with 29,219 additions and 1,900 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/dhis2-deploy-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,12 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: c-hive/gha-yarn-cache@v1
- run: |
yarn install --frozen-lockfile
yarn setup
- run: yarn install --frozen-lockfile

- name: Docsite
run: yarn docs

- name: Demo
run: yarn demo
- run: yarn build

- uses: nwtgck/[email protected]
with:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/dhis2-preview-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile

- name: Setup
run: yarn setup

- name: Storybook
run: yarn demo
- run: yarn build

- name: Deploy
id: netlify-deploy
Expand All @@ -49,7 +45,7 @@ jobs:
enable-commit-status: true
alias: pr-${{ github.event.number }}
# customize according to project needs
publish-dir: 'dist/demo'
publish-dir: 'dist'
env:
# org secret
NETLIFY_AUTH_TOKEN: ${{ secrets.DHIS2_BOT_NETLIFY_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: c-hive/gha-yarn-cache@v1
- run: |
Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/download-artifact@v2
with:
Expand All @@ -67,7 +67,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/download-artifact@v2
with:
Expand Down
59 changes: 59 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Components

- [@dhis2-ui/alert](components/alert/API.md)
- [@dhis2-ui/box](components/box/API.md)
- [@dhis2-ui/button](components/button/API.md)
- [@dhis2-ui/card](components/card/API.md)
- [@dhis2-ui/center](components/center/API.md)
- [@dhis2-ui/checkbox](components/checkbox/API.md)
- [@dhis2-ui/chip](components/chip/API.md)
- [@dhis2-ui/cover](components/cover/API.md)
- [@dhis2-ui/css](components/css/API.md)
- [@dhis2-ui/divider](components/divider/API.md)
- [@dhis2-ui/field](components/field/API.md)
- [@dhis2-ui/file-input](components/file-input/API.md)
- [@dhis2-ui/header-bar](components/header-bar/API.md)
- [@dhis2-ui/help](components/help/API.md)
- [@dhis2-ui/input](components/input/API.md)
- [@dhis2-ui/intersection-detector](components/intersection-detector/API.md)
- [@dhis2-ui/label](components/label/API.md)
- [@dhis2-ui/layer](components/layer/API.md)
- [@dhis2-ui/legend](components/legend/API.md)
- [@dhis2-ui/loader](components/loader/API.md)
- [@dhis2-ui/logo](components/logo/API.md)
- [@dhis2-ui/menu](components/menu/API.md)
- [@dhis2-ui/modal](components/modal/API.md)
- [@dhis2-ui/node](components/node/API.md)
- [@dhis2-ui/notice-box](components/notice-box/API.md)
- [@dhis2-ui/organisation-unit-tree](components/organisation-unit-tree/API.md)
- [@dhis2-ui/pagination](components/pagination/API.md)
- [@dhis2-ui/popover](components/popover/API.md)
- [@dhis2-ui/popper](components/popper/API.md)
- [@dhis2-ui/portal](components/portal/API.md)
- [@dhis2-ui/radio](components/radio/API.md)
- [@dhis2-ui/required](components/required/API.md)
- [@dhis2-ui/segmented-control](components/segmented-control/API.md)
- [@dhis2-ui/select](components/select/API.md)
- [@dhis2-ui/selector-bar](components/selector-bar/API.md)
- [@dhis2-ui/sharing-dialog](components/sharing-dialog/API.md)
- [@dhis2-ui/switch](components/switch/API.md)
- [@dhis2-ui/tab](components/tab/API.md)
- [@dhis2-ui/table](components/table/API.md)
- [@dhis2-ui/tag](components/tag/API.md)
- [@dhis2-ui/text-area](components/text-area/API.md)
- [@dhis2-ui/tooltip](components/tooltip/API.md)
- [@dhis2-ui/transfer](components/transfer/API.md)
- [@dhis2-ui/user-avatar](components/user-avatar/API.md)

# Icons

- [@dhis2/ui-icons](icons/API.md)

# Collections

- [@dhis2/ui-forms](collections/forms/API.md)
- [@dhis2/ui](collections/ui/API.md)

# Constants

- [@dhis2/ui-constants](constants/API.md)
214 changes: 214 additions & 0 deletions collections/forms/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
### CheckboxFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { CheckboxFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| --------------- | -------- | ------- | -------- | ------------------------------ |
| input | custom | | | Provided by Final Form `Field` |
| meta | custom | | | Provided by Final Form `Field` |
| error | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### FieldGroupFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { FieldGroupFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| -------- | ------- | ------- | -------- | ----------- |
| children | node | | | |
| label | string | | | |
| name | string | | | |
| required | boolean | | | |

### FileInputFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { FileInputFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| --------------- | ------------------------------ | ------- | -------- | -------------------------------------------- |
| input | custom | | | `input` props provided by Final Form `Field` |
| meta | custom | | | `meta` props provided by Final Form `Field` |
| buttonLabel | string | | | |
| disabled | boolean | | | |
| error | boolean | | | |
| multifile | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| value | arrayOf(instanceOf(File)) │ '' | | | |

### InputFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { InputFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| ----------------- | -------- | ------- | -------- | ---------------------------------------------- |
| input | custom | | | `input` props received from Final Form `Field` |
| meta | custom | | | `meta` props received from Final Form `Field` |
| error | boolean | | | |
| loading | boolean | | | |
| showLoadingStatus | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### MultiSelectFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { MultiSelectFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| ----------------- | --------------------------------------------------------------- | ------- | -------- | -------------------------------------------- |
| input | custom | | | `input` props provided by Final Form `Field` |
| meta | custom | | | `meta` props provided by Final Form `Field` |
| error | boolean | | | |
| loading | boolean | | | |
| options | arrayOf({<br/> "label": "string",<br/> "value": "string"<br/>}) | `[]` | | |
| showLoadingStatus | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### RadioFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { RadioFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| --------------- | -------- | ------- | -------- | ---------------------------------------------- |
| input | custom | | | `input` props received from Final Form `Field` |
| meta | custom | | | `meta` props received from Final Form `Field` |
| error | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### SingleSelectFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { SingleSelectFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| ----------------- | --------------------------------------------------------------- | ------- | -------- | ---------------------------------------------- |
| input | custom | | | `input` props received from Final Form `Field` |
| meta | custom | | | `meta` props received from Final Form `Field` |
| options | arrayOf({<br/> "label": "string",<br/> "value": "string"<br/>}) | | \* | |
| error | boolean | | | |
| loading | boolean | | | |
| showLoadingStatus | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### SwitchFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { SwitchFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| --------------- | -------- | ------- | -------- | ---------------------------------------------- |
| input | custom | | | `input` props received from Final Form `Field` |
| meta | custom | | | `meta` props received from Final Form `Field` |
| error | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |

### TextAreaFieldFF

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.

```js
import { TextAreaFieldFF } from '@dhis2/ui-forms'
```

#### Props

| Name | Type | Default | Required | Description |
| ----------------- | -------- | ------- | -------- | ---------------------------------------------- |
| input | custom | | | `input` props received from Final Form `Field` |
| meta | custom | | | `meta` props received from Final Form `Field` |
| error | boolean | | | |
| loading | boolean | | | |
| showLoadingStatus | boolean | | | |
| showValidStatus | boolean | | | |
| valid | boolean | | | |
| validationText | string | | | |
| onBlur | function | | | |
| onFocus | function | | | |
7 changes: 2 additions & 5 deletions collections/forms/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2022-01-10T18:10:56.819Z\n"
"PO-Revision-Date: 2022-01-10T18:10:56.819Z\n"
"POT-Creation-Date: 2022-02-11T13:37:19.312Z\n"
"PO-Revision-Date: 2022-02-11T13:37:19.312Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand All @@ -17,9 +17,6 @@ msgstr "Upload files"
msgid "Remove"
msgstr "Remove"

msgid "No file(s) selected yet"
msgstr "No file(s) selected yet"

msgid "Please provide an alpha-numeric value"
msgstr "Please provide an alpha-numeric value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Press **Submit** to see the form values logged to the console.
`

export default {
title: 'Forms/Checkbox/Checkbox Field (Final Form)',
title: 'Checkbox Field (Final Form)',
component: CheckboxFieldFF,
decorators: [formDecorator],
parameters: { docs: { description: { component: description } } },
Expand Down
Loading

0 comments on commit e206df1

Please sign in to comment.