Skip to content

Commit

Permalink
Merge pull request #1220 from dnbexperience/main
Browse files Browse the repository at this point in the history
release of v9.19.0
  • Loading branch information
tujoworker authored Jan 26, 2022
2 parents 2d40ce1 + 5c15dbc commit 040e69f
Show file tree
Hide file tree
Showing 203 changed files with 6,629 additions and 618 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"test:update": "yarn workspace @dnb/eufemia test:update",
"test:screenshots": "yarn workspace @dnb/eufemia test:screenshots",
"test:screenshots:update": "yarn workspace @dnb/eufemia test:screenshots:update",
"prepare": "husky install"
"prepare": "husky install",
"lint": "yarn workspace @dnb/eufemia lint && yarn workspace dnb-design-system-portal lint",
"lint:ci": "yarn workspace @dnb/eufemia lint:ci && yarn workspace dnb-design-system-portal lint:ci"
},
"devDependencies": {
"husky": "7.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 2
icon: 'naming'
---

import { Button, Blockquote, cite } from '@dnb/eufemia/src'
import { Button, Blockquote } from '@dnb/eufemia/src'

# New contributor

Expand Down Expand Up @@ -60,4 +60,4 @@ The best way to understand a project is to just jump on a real task. It is scary
<cite>Dina, new contributor</cite>
</Blockquote>

<Button href="/contribute/getting-started" size="large" text="Next up: Getting started" icon="chevron_right" variant="tertiary" bottom="2rem"/>
<Button href="/contribute/getting-started" size="large" text="Next up: Getting started" icon="chevron_right" variant="tertiary" bottom="2rem"/>
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,50 @@ describe('Breadcrumb aria', () => {
})
```

### Adding tests
### Running tests locally

1. Run the integration tests: `yarn test` – you may need to update changed snapshots: `yarn test:update`. You can test only your component with `yarn test <component>`.
1. Start the portal: `yarn workspace dnb-design-system-portal start`
1. Run the visual test against it: `yarn test:screenshots`
1. Check the result / reports, located in: `open ./packages/dnb-eufemia/jest-screenshot-report/index.html`
1. Update eventually new or valid PNG snapshots by running: `yarn test:screenshots:update`
Run the commands from the repository's root folder. Replace `breadcrumb` with your component's name in the commands.

1. Run the integration tests:

```bash
# Run all tests including the word 'breadcrumb'
yarn test breadcrumb
```

```bash
# or be more specific
yarn test /breadcrumb.test.tsx
```

```bash
# Execute the tests periodically
yarn test:watch breadcrumb
```

2. Update the changed snapshots:

```bash
yarn test:update breadcrumb
```

3. Run the visual test against the portal:

```bash
# First start the portal
yarn start
# Then run all screenshot tests including 'breadcrumb'
yarn test:screenshots breadcrumb
```

You can also create a screenshot report for all components running `yarn test:screenshots`. Check the result / reports, located in: `open ./packages/dnb-eufemia/jest-screenshot-report/index.html`

4. Update eventually new or valid PNG snapshots:

```bash
# Update all screenshot tests including 'breadcrumb'
yarn test:screenshots:update breadcrumb
```

## 5. (Optional) Update change logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Remember - test for accessibility early in the design process.

## Useful Resources

- What is Universal Design? (DNB Sharepoint) https://dnbasa.sharepoint.com/sites/n1317
- (Norwegian) Gjeldende regelverk og krav https://www.uutilsynet.no/regelverk/gjeldende-regelverk-og-krav/746
- [What is Universal Design? (DNB Sharepoint)](https://dnbasa.sharepoint.com/sites/n1317)
- [Gjeldende regelverk og krav (Uutilsynet)](https://www.uutilsynet.no/regelverk/gjeldende-regelverk-og-krav/746) (in norwegian)

## WCAG (Web Content and Accessibility Guide)

Expand Down Expand Up @@ -96,19 +96,6 @@ Semantic markup makes robust content that's accessible. Pay attention to the fol
Responsive Design ensures that content can be viewed on a wide spectrum of display sizes.
Responsive components and layout design should be planned from the beginning and not applied as an afterthought. Build prototypes early in code or design and begin testing their breakpoints sooner rather than later.

### Accessibility checklist for designers

**NB:** Move this section to its own menu item pages

Building an accessible interface starts at the UX stage of design. Ideally, a designer should be able to convey to a developer how they would like a keyboard user to use and navigate through an interface. Much of the DNB Design System's styling and development have considered accessibility to a certain extent, see [Accessibility](/uilib/usage/accessibility). However, each interface design comes with its own challenges and requirement

- make sure the content is perceivable - ensure good contrast between background and foreground
- plan how you would like a keyboard navigator to access interface laments/areas. What will the order of tabbing be?
- should you provide a ’skip to content’ feature to allow users to get to the main content quickly
- plan how the interface will respond to different screen sizes. The layout may have to change - how will this affect accessibility?
- zoom the interface - some users zoom their browser to increase the size. How will elements behave in these scenarios? Will they overlap? What happens to wide horizontal components such as navigation or tab sets?
- fluid design as opposed to using fixed breakpoints, allows the content to reflow in the same order as screen readers render content to users who are blind or visually impaired.

## Focus management

### Where should the focus start on the first page init?
Expand Down Expand Up @@ -137,3 +124,7 @@ Or, it can be based on user needs. For example, it may be more beneficial for a

Again, this is dependent on both content, context, and user needs which ultimately affect the user experience. If there are blocks of repeating content on multiple pages then it may improve user experience to add a Skip-Link.
It is not a requirement to have a Skip-Link but an asset.

## Accessibility checklist for designers

Check out the [Accessibility checklist for designers](/quickguide-designer/accessibility/checklist) for the most important features in accessibility.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 'Checklist for designers'
---

## Accessibility checklist for designers

Building an accessible interface starts at the UX stage of design. Much of the DNB Design System's styling and development have taken accessibility into consideration to a certain extent (see [UI Library Accessibility](/uilib/usage/accessibility)). However, each interface design comes with its own challenges and requirement.

- [ ] **Content is perceivable**: Ensure good contrast between background and foreground.
- [ ] **Accessible for keyboard users**: Plan how you would like a keyboard navigator to access interface laments/areas. What will the order of tabbing be?
- [ ] **Skip to content**: Should you provide a ’skip to content’ feature to allow users to get to the main content quickly?
- [ ] **Responsive page**: Plan how the interface will respond to different screen sizes. The layout may have to change - how will this affect accessibility?
- [ ] **Zoom the interface**: Some users zoom their browser to increase the size. How will elements behave in these scenarios? Will they overlap? What happens to wide horizontal components such as navigation or tab sets?
- [ ] **Fluid design**: As opposed to using fixed breakpoints, fluid design allows the content to reflow in the same order as screen readers render content to users who are blind or visually impaired.
36 changes: 32 additions & 4 deletions packages/dnb-design-system-portal/src/docs/uilib/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ order: 7

DNB Eufemia components are ready to use, styled and custom build HTML elements.

## [Accordion](/uilib/components/accordion)

The Accordion component, also know as a ComboBox, completes / suggests values during typing.

## [Autocomplete](/uilib/components/autocomplete)

The Autocomplete component is a combination of an [Input](/uilib/components/input) and a [Dropdown](/uilib/components/dropdown), also called **ComboBox**. During typing, matching data items gets suggested in an option menu (listbox).

## [Avatar](/uilib/components/avatar)

The Avatar component are identifiers that makes people and companies more scannable.

## [Breadcrumb](/uilib/components/breadcrumb)

The Breadcrumb component is a bar for navigation showing current web path.

## [Button](/uilib/components/button)

The Button component should be used as the primary call-to-action in a form, or as a user interaction mechanism.
Expand All @@ -25,6 +37,10 @@ Checkboxes are used to let a user select one or more options of a limited number

The DatePicker component should be used whenever there is to enter a single date or a date range/period with a start and end date.

## [Drawer](/uilib/components/drawer)

The Drawer component is a part of (mode) the Modal component because they have many similarities.

## [Dropdown](/uilib/components/dropdown)

The Dropdown component is a fully custom-made component. This allows us to change it's form based on context (small screens, touch devices etc.)
Expand Down Expand Up @@ -69,6 +85,10 @@ The main Icon component is basically a wrapper for whatever icon you place withi

The IconPrimary component loads by default all Primary Icons so they can easily be included and used without additionally importing every icon.

## [InfoCard](/uilib/components/info-card)

The InfoCard is used to give the user more information than we can give in a messagebox. It can also be used as to give useful tips.

## [Input](/uilib/components/input)

The input component is an umbrella component for all inputs which share the same style as the classic text input field. Radio buttons and other form elements are not included here.
Expand Down Expand Up @@ -97,10 +117,6 @@ The Pagination component supports both classical **page pagination** and **infin

Use a ProgressIndicator whenever the user has to wait for more than _150ms_.

## [StepIndicator](/uilib/components/step-indicator)

The step indicator (progress) is a visual representation of a users progress through a set of steps or series of actions. Their purpose is to both guide the user through the process and to help them create a mental model of the amount of time and effort that is required of them.

## [Radio](/uilib/components/radio)

Radio buttons lets a user select one option / value of a limited number of choices. It is recommended to use it in a group. You can use either the React component `<Radio.Group>` or use the property `group="NAME"` to define the group.
Expand All @@ -113,6 +129,10 @@ Sliders provide a visual indication of adjustable content. A value can be adjust

The Space component provides `margins` within the [provided spacing extensions](/uilib/usage/layout/spacing#spacing-helpers).

## [StepIndicator](/uilib/components/step-indicator)

The step indicator (progress) is a visual representation of a users progress through a set of steps or series of actions. Their purpose is to both guide the user through the process and to help them create a mental model of the amount of time and effort that is required of them.

## [Switch](/uilib/components/switch)

The Switch component (toggle) is a digital on/off switch. Toggle switches are best used for changing the state of system functionalities and preferences.
Expand All @@ -121,10 +141,18 @@ The Switch component (toggle) is a digital on/off switch. Toggle switches are be

Tabs are a set of buttons which allow navigation between content that is related and on the same level of hierarchy.

## [Tag](/uilib/components/tag)

The Tag component is a compact component for displaying discrete information.

## [Textarea](/uilib/components/textarea)

The Textarea component has to be used as a multi-line text input control with an unlimited number of characters possible.

## [ToggleButton](/uilib/components/toggle-button)

The ToggleButton component should be used to toggle on or off a limited number of choices.

## [Tooltip](/uilib/components/tooltip)

The Tooltip component is primarily meant to enhance the UX for various and additional information.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
title: 'Accordion'
description: 'The Accordion component, also know as a ComboBox, completes / suggests values during typing.'
description: 'The Accordion component, also known as a ComboBox, completes / suggests values during typing.'
order: 1
showTabs: true
status: 'new'
---

import AccordionInfo from 'Docs/uilib/components/accordion/info'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Avatar'
description: 'The avatar component are identifiers that makes people and companies more scannable.'
status: 'new'
order: 1
showTabs: true
---

import AvatarInfo from 'Docs/uilib/components/avatar/info'
import AvatarDemos from 'Docs/uilib/components/avatar/demos'

<AvatarInfo />
<AvatarDemos />
Loading

0 comments on commit 040e69f

Please sign in to comment.