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

docs(feat): prepare documentation for docs merge into developer portal #1606

Merged
merged 1 commit into from
Dec 6, 2024
Merged
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
10 changes: 7 additions & 3 deletions .github/workflows/dhis2-deploy-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
push:
branches:
- master
paths:
- '/_redirects' # only rebuild and deploy when redirects file changes

concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
Expand All @@ -28,10 +30,12 @@ jobs:
with:
node-version: 20.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
# We use Netlify only for deploy previews, production docs are hosted at developers.dhis2.org
# Don't build anything, just copy the _redirects file into the dist directory

- run: yarn build
- run: |
mkdir dist
cp _redirects dist/_redirects

- uses: nwtgck/[email protected]
with:
Expand Down
5 changes: 5 additions & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Redirect legacy ui.dhis2.nu netlify site to the developer portal
/demo https://developers.dhis2.org/demo
/components/* https://developers.dhis2.org/docs/ui/components/:splat
/recipes/* https://developers.dhis2.org/docs/ui/recipes/:splat
/* https://developers.dhis2.org/design-system/:splat
6 changes: 3 additions & 3 deletions collections/forms/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import { FileInputFieldFF } from '@dhis2/ui'
|showValidStatus|boolean||||
|valid|boolean||||
|validationText|string||||
|value|arrayOf(instanceOf(File)) │ ''||||
|value|`arrayOf(instanceOf(File)) │ ''`||||

### InputFieldFF

Expand Down Expand Up @@ -118,7 +118,7 @@ import { MultiSelectFieldFF } from '@dhis2/ui'
|meta|custom|||`meta` props provided by Final Form `Field`|
|error|boolean||||
|loading|boolean||||
|options|arrayOf({<br/> "label": "string",<br/> "value": "string"<br/>})|`[]`|||
|options|`arrayOf({<br/> "label": "string",<br/> "value": "string"<br/>})`|``[]``|||
|showLoadingStatus|boolean||||
|showValidStatus|boolean||||
|valid|boolean||||
Expand Down Expand Up @@ -169,7 +169,7 @@ import { SingleSelectFieldFF } from '@dhis2/ui'
|---|---|---|---|---|
|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/>})||*||
|options|`arrayOf({<br/> "label": "string",<br/> "value": "string"<br/>})`||*||
|error|boolean||||
|loading|boolean||||
|showLoadingStatus|boolean||||
Expand Down
4 changes: 2 additions & 2 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: 2024-09-26T14:15:11.940Z\n"
"PO-Revision-Date: 2024-09-26T14:15:11.941Z\n"
"POT-Creation-Date: 2024-11-29T06:54:11.622Z\n"
"PO-Revision-Date: 2024-11-29T06:54:11.622Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand Down
436 changes: 218 additions & 218 deletions collections/ui/API.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions components/alert/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { AlertBar } from '@dhis2/ui'
|children|string|||The message string for the alert|
|className|string||||
|critical|custom|||Alert bars with `critical` will not autohide|
|dataTest|string|`'dhis2-uicore-alertbar'`|||
|duration|number|`8000`||How long you want the notification to display, in `ms`, when it's not permanent|
|dataTest|string|``'dhis2-uicore-alertbar'``|||
|duration|number|``8000``||How long you want the notification to display, in `ms`, when it's not permanent|
|hidden|boolean|||AlertBar will be hidden on creation when this is set to true|
|icon|custom|`true`||A specific icon to override the default icon in the bar.<br/>If `false` is provided, no icon will be shown.|
|icon|custom|``true``||A specific icon to override the default icon in the bar.<br/>If `false` is provided, no icon will be shown.|
|permanent|boolean|||When set, AlertBar will not autohide|
|success|custom||||
|warning|custom|||Alert bars with `warning` will not autohide|
Expand All @@ -45,4 +45,4 @@ import { AlertStack } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-alertstack'`|||
|dataTest|string|``'dhis2-uicore-alertstack'``|||
2 changes: 1 addition & 1 deletion components/box/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Box } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-box'`|||
|dataTest|string|``'dhis2-uicore-box'``|||
|height|string||||
|marginTop|string||||
|maxHeight|string||||
Expand Down
10 changes: 5 additions & 5 deletions components/button/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Button } from '@dhis2/ui'
|---|---|---|---|---|
|children|node|||Component to render inside the button|
|className|string|||A className that will be passed to the `<button>` element|
|dataTest|string|`'dhis2-uicore-button'`||A string that will be applied as a `data-test` attribute on the button element<br/>for identification during testing|
|dataTest|string|``'dhis2-uicore-button'``||A string that will be applied as a `data-test` attribute on the button element<br/>for identification during testing|
|destructive|boolean|||Applies 'destructive' button appearance, implying a dangerous action.|
|disabled|boolean|||Applies a greyed-out appearance and makes the button non-interactive|
|icon|element|||An icon element to display inside the button|
Expand All @@ -29,7 +29,7 @@ import { Button } from '@dhis2/ui'
|small|custom|||Makes the button small. Mutually exclusive with `large` prop|
|tabIndex|string|||Tab index for focusing the button with a keyboard|
|toggled|boolean|||Changes appearance of button to an on/off state|
|type|'submit' │ 'reset' │ 'button'|`'button'`||Sets `type` attribute on `<button>` element|
|type|'submit' │ 'reset' │ 'button'|``'button'``||Sets `type` attribute on `<button>` element|
|value|string|||Value associated with the button.<br/>Gets passed as part of the first argument to callbacks (see `onClick`).|
|onBlur|function|||Callback to trigger on de-focus (blur).<br/>Called with same args as `onClick`|
|onClick|function|||Callback to trigger on click.<br/>Called with args `({ value, name }, event)`|
Expand All @@ -54,7 +54,7 @@ import { ButtonStrip } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-buttonstrip'`|||
|dataTest|string|``'dhis2-uicore-buttonstrip'``|||
|end|custom|||Horizontal alignment for buttons. Mutually exclusive with `middle` prop|
|middle|custom|||Horizontal alignment. Mutually exclusive with `end` prop|

Expand All @@ -77,7 +77,7 @@ import { DropdownButton } from '@dhis2/ui'
|children|node|||Children to render inside the buton|
|className|string||||
|component|element|||Component to show/hide when button is clicked|
|dataTest|string|`'dhis2-uicore-dropdownbutton'`|||
|dataTest|string|``'dhis2-uicore-dropdownbutton'``|||
|destructive|boolean|||Applies 'destructive' button appearance, implying a dangerous action.|
|disabled|boolean|||Make the button non-interactive|
|icon|element||||
Expand Down Expand Up @@ -112,7 +112,7 @@ import { SplitButton } from '@dhis2/ui'
|children|string||||
|className|string||||
|component|element|||Component to render when the dropdown is opened|
|dataTest|string|`'dhis2-uicore-splitbutton'`|||
|dataTest|string|``'dhis2-uicore-splitbutton'``|||
|destructive|boolean|||Applies 'destructive' button appearance, implying a dangerous action.|
|disabled|boolean|||Disables the button and makes it uninteractive|
|icon|element|||An icon to add inside the button|
Expand Down
6 changes: 3 additions & 3 deletions components/calendar/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { Calendar } from '@dhis2/ui'
|---|---|---|---|---|
|calendar|any||*|the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts|
|onDateSelect|function||*|Called with signature `(null)` \|\| `({ dateCalendarString: string, validation: { error: boolean, warning: boolean, validationText: string} })` with `dateCalendarString` being the stringified date in the specified calendar in the format `yyyy-MM-dd`|
|cellSize|string|`'32px'`||the size of a single cell in the table forming the calendar|
|cellSize|string|``'32px'``||the size of a single cell in the table forming the calendar|
|date|string|||the currently selected date using an iso-like format YYYY-MM-DD, in the calendar system provided (not iso8601)|
|dir|'ltr' │ 'rtl'|||the direction of the library - internally the library will use rtl for rtl-languages but this can be overridden here for more control|
|locale|string|||any valid locale - if none provided, the internal library will fallback to the user locale (more info here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/hooks/internal/useResolvedLocaleOptions.ts#L15)|
|numberingSystem|string|||numbering system to use - full list here https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/numberingSystems.ts|
|timeZone|string|||the timeZone to use|
|weekDayFormat|'narrow' │ 'short' │ 'long'|`'narrow'`||the format to display for the week day, i.e. Monday (long), Mon (short), M (narrow)|
|width|string|`'240px'`||the width of the calendar component|
|weekDayFormat|'narrow' │ 'short' │ 'long'|``'narrow'``||the format to display for the week day, i.e. Monday (long), Mon (short), M (narrow)|
|width|string|``'240px'``||the width of the calendar component|

### CalendarInput

Expand Down
2 changes: 1 addition & 1 deletion components/card/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import { Card } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-card'`|||
|dataTest|string|``'dhis2-uicore-card'``|||
4 changes: 2 additions & 2 deletions components/center/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ import { Center } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-centeredcontent'`|||
|position|'top' │ 'middle' │ 'bottom'|`'middle'`||Vertical alignment|
|dataTest|string|``'dhis2-uicore-centeredcontent'``|||
|position|'top' │ 'middle' │ 'bottom'|``'middle'``||Vertical alignment|
8 changes: 4 additions & 4 deletions components/checkbox/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import { Checkbox } from '@dhis2/ui'

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|checked|custom|`false`|||
|checked|custom|``false``|||
|className|string||||
|dataTest|string|`'dhis2-uicore-checkbox'`|||
|dataTest|string|``'dhis2-uicore-checkbox'``|||
|dense|boolean||||
|disabled|boolean||||
|error|custom||||
|indeterminate|custom|`false`|||
|indeterminate|custom|``false``|||
|initialFocus|boolean||||
|label|node||||
|name|string||||
Expand Down Expand Up @@ -51,7 +51,7 @@ import { CheckboxField } from '@dhis2/ui'
|---|---|---|---|---|
|checked|boolean||||
|className|string||||
|dataTest|string|`'dhis2-uiwidgets-checkboxfield'`|||
|dataTest|string|``'dhis2-uiwidgets-checkboxfield'``|||
|dense|boolean|||Smaller dimensions for information-dense layouts|
|disabled|boolean|||Disables the checkbox|
|error|custom|||Applies 'error' styling to checkbox and validation text for feedback. Mutually exclusive with `warning` and `valid` props|
Expand Down
6 changes: 3 additions & 3 deletions components/chip/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ import { Chip } from '@dhis2/ui'
|---|---|---|---|---|
|children|any||||
|className|string||||
|dataTest|string|`'dhis2-uicore-chip'`|||
|dataTest|string|``'dhis2-uicore-chip'``|||
|dense|boolean||||
|disabled|boolean||||
|dragging|boolean||||
|icon|element||||
|marginBottom|number|`4`||`margin-bottom` value, applied in `px`|
|marginBottom|number|``4``||`margin-bottom` value, applied in `px`|
|marginInlineEnd|number|||`margin-inline-end` value, applied in `px`|
|marginInlineStart|number|||`margin-inline-start` value, applied in `px`|
|marginLeft|number|||`margin-inline-start` value, applied in `px`|
|marginRight|number|||`margin-inline-end` value, applied in `px`|
|marginTop|number|`4`||`margin-top` value, applied in `px`|
|marginTop|number|``4``||`margin-top` value, applied in `px`|
|overflow|boolean||||
|selected|boolean||||
|onClick|function||||
Expand Down
2 changes: 1 addition & 1 deletion components/cover/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ import { Cover } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-componentcover'`|||
|dataTest|string|``'dhis2-uicore-componentcover'``|||
|translucent|boolean|||Adds a semi-transparent background to the cover|
|onClick|function||||
10 changes: 5 additions & 5 deletions components/css/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import { CssVariables } from '@dhis2/ui'

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|colors|boolean|`false`|||
|elevations|boolean|`false`|||
|layers|boolean|`false`|||
|spacers|boolean|`false`|||
|theme|boolean|`false`|||
|colors|boolean|``false``|||
|elevations|boolean|``false``|||
|layers|boolean|``false``|||
|spacers|boolean|``false``|||
|theme|boolean|``false``|||
4 changes: 2 additions & 2 deletions components/divider/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import { Divider } from '@dhis2/ui'
|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|className|string||||
|dataTest|string|`'dhis2-uicore-divider'`|||
|dataTest|string|``'dhis2-uicore-divider'``|||
|dense|boolean||||
|margin|string|``${spacers.dp8} 0``|||
|margin|string|```${spacers.dp8} 0```|||
6 changes: 3 additions & 3 deletions components/field/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Field } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-field'`|||
|dataTest|string|``'dhis2-uicore-field'``|||
|disabled|boolean|||Disabled status, shown when mouse is over label|
|error|custom|||Field status. Mutually exclusive with `valid` and `warning` props|
|helpText|string|||Useful text within the field|
Expand Down Expand Up @@ -45,7 +45,7 @@ import { FieldGroup } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uiwidgets-fieldsetfield'`|||
|dataTest|string|``'dhis2-uiwidgets-fieldsetfield'``|||
|disabled|boolean|||Disables the form controls within|
|error|custom|||Applies 'error' styling to validation text for feedback. Mutually exclusive with `warning` and `valid` props|
|helpText|string|||Useful instructions for the user|
Expand Down Expand Up @@ -74,4 +74,4 @@ import { FieldSet } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-fieldset'`|||
|dataTest|string|``'dhis2-uicore-fieldset'``|||
30 changes: 15 additions & 15 deletions components/file-input/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { FileInput } from '@dhis2/ui'

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|accept|string|`'*'`||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|accept|string|``'*'``||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|buttonLabel|string||||
|className|string||||
|dataTest|string|`'dhis2-uicore-fileinput'`|||
|dataTest|string|``'dhis2-uicore-fileinput'``|||
|disabled|boolean||||
|error|custom|||Input status. Mutually exclusive with `warning` and `valid`|
|initialFocus|boolean||||
Expand Down Expand Up @@ -49,11 +49,11 @@ import { FileInputField } from '@dhis2/ui'

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|accept|string|`'*'`||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|buttonLabel|string │ function|`() => i18n.t('Upload a file')`||Text on the button|
|accept|string|``'*'``||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|buttonLabel|string │ function|``() => i18n.t('Upload a file')``||Text on the button|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uiwidgets-fileinputfield'`|||
|dataTest|string|``'dhis2-uiwidgets-fileinputfield'``|||
|disabled|boolean|||Disables the button|
|error|custom|||Applies 'error' styling to the validation text. Mutually exclusive with `warning` and `valid` props|
|helpText|string|||Useful guiding text for the user|
Expand All @@ -62,7 +62,7 @@ import { FileInputField } from '@dhis2/ui'
|large|custom|||Size of the button. Mutually exclusive with the `small` prop|
|multiple|boolean|||The `multiple` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple)|
|name|string|||Name associated with input. Passed to event handler callbacks|
|placeholder|string │ function|`() => i18n.t('No file uploaded yet')`||Placeholder below the button|
|placeholder|string │ function|``() => i18n.t('No file uploaded yet')``||Placeholder below the button|
|required|boolean|||Adds an asterisk to indicate this field is required|
|small|custom|||Size of the button. Mutually exclusive with the `large` prop|
|tabIndex|string||||
Expand Down Expand Up @@ -91,21 +91,21 @@ import { FileInputFieldWithList } from '@dhis2/ui'
|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|onChange|function||*|Called with signature `({ name: string, files: [File] }, event)`|
|accept|string|`'*'`||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|buttonLabel|string │ function|`() => i18n.t('Upload a file')`||Text on the button|
|accept|string|``'*'``||The `accept` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept)|
|buttonLabel|string │ function|``() => i18n.t('Upload a file')``||Text on the button|
|className|string||||
|dataTest|string|`'dhis2-uiwidgets-fileinputfield'`|||
|dataTest|string|``'dhis2-uiwidgets-fileinputfield'``|||
|disabled|boolean|||Disables the button|
|error|custom|||Applies 'error' styling to the button and validation text. Mutually exclusive with `warning` and `valid` props|
|files|arrayOf(instanceOf(File))||||
|files|`arrayOf(instanceOf(File))`||||
|helpText|string|||Useful guiding text for the user|
|initialFocus|boolean||||
|label|string|||A descriptive label above the button|
|large|custom|||Size of the button. Mutually exclusive with the `small` prop|
|multiple|boolean|||The `multiple` attribute of the [native file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple)|
|name|string|||Name associated with input. Passed to event handler callbacks|
|placeholder|string │ function|`() => i18n.t('No file uploaded yet')`||Placeholder below the button|
|removeText|string │ function|`() => i18n.t('Remove')`||Text used for the button that removes a file from the list|
|placeholder|string │ function|``() => i18n.t('No file uploaded yet')``||Placeholder below the button|
|removeText|string │ function|``() => i18n.t('Remove')``||Text used for the button that removes a file from the list|
|required|boolean|||Adds an asterisk to indicate this field is required|
|small|custom|||Size of the button. Mutually exclusive with the `large` prop|
|tabIndex|string||||
Expand Down Expand Up @@ -135,7 +135,7 @@ import { FileListItem } from '@dhis2/ui'
|onRemove|function||*||
|cancelText|string||||
|className|string||||
|dataTest|string|`'dhis2-uicore-filelistitem'`|||
|dataTest|string|``'dhis2-uicore-filelistitem'``|||
|label|string||||
|loading|boolean||||
|removeText|string||||
Expand All @@ -158,7 +158,7 @@ import { FileListPlaceholder } from '@dhis2/ui'
|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|children|string||||
|dataTest|string|`'dhis2-uicore-filelistplaceholder'`|||
|dataTest|string|``'dhis2-uicore-filelistplaceholder'``|||

### FileList

Expand All @@ -178,4 +178,4 @@ import { FileList } from '@dhis2/ui'
|---|---|---|---|---|
|children|node||||
|className|string||||
|dataTest|string|`'dhis2-uicore-filelist'`|||
|dataTest|string|``'dhis2-uicore-filelist'``|||
2 changes: 1 addition & 1 deletion components/help/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Help } from '@dhis2/ui'
|---|---|---|---|---|
|children|string||||
|className|string||||
|dataTest|string|`'dhis2-uicore-help'`|||
|dataTest|string|``'dhis2-uicore-help'``|||
|error|custom||||
|valid|custom||||
|warning|custom||||
Loading
Loading