Skip to content

Commit

Permalink
Merge branch 'master' into header-bar-for-global-shell
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Feb 15, 2024
2 parents b9667b3 + bb83b95 commit 56ab260
Show file tree
Hide file tree
Showing 60 changed files with 310 additions and 281 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [9.3.0](https://github.com/dhis2/ui/compare/v9.2.0...v9.3.0) (2024-02-13)


### Features

* update accessibility in button component ([0a015c7](https://github.com/dhis2/ui/commit/0a015c7fe9115edcaa5126daca0ef65f092c925e))

# [9.2.0](https://github.com/dhis2/ui/compare/v9.1.2...v9.2.0) (2024-01-11)


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: 2023-05-05T12:46:11.864Z\n"
"PO-Revision-Date: 2023-05-05T12:46:11.864Z\n"
"POT-Creation-Date: 2024-02-12T14:58:56.792Z\n"
"PO-Revision-Date: 2024-02-12T14:58:56.792Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand Down
20 changes: 10 additions & 10 deletions collections/forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/ui-forms",
"version": "9.2.0",
"version": "9.3.0",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"sideEffects": [
Expand Down Expand Up @@ -35,15 +35,15 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2-ui/button": "9.2.0",
"@dhis2-ui/checkbox": "9.2.0",
"@dhis2-ui/field": "9.2.0",
"@dhis2-ui/file-input": "9.2.0",
"@dhis2-ui/input": "9.2.0",
"@dhis2-ui/radio": "9.2.0",
"@dhis2-ui/select": "9.2.0",
"@dhis2-ui/switch": "9.2.0",
"@dhis2-ui/text-area": "9.2.0",
"@dhis2-ui/button": "9.3.0",
"@dhis2-ui/checkbox": "9.3.0",
"@dhis2-ui/field": "9.3.0",
"@dhis2-ui/file-input": "9.3.0",
"@dhis2-ui/input": "9.3.0",
"@dhis2-ui/radio": "9.3.0",
"@dhis2-ui/select": "9.3.0",
"@dhis2-ui/switch": "9.3.0",
"@dhis2-ui/text-area": "9.3.0",
"classnames": "^2.3.1",
"final-form": "^4.20.2",
"prop-types": "^15.7.2",
Expand Down
98 changes: 49 additions & 49 deletions collections/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/ui",
"version": "9.2.0",
"version": "9.3.0",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"exports": {
Expand All @@ -21,54 +21,54 @@
"build": "d2-app-scripts build"
},
"dependencies": {
"@dhis2-ui/alert": "9.2.0",
"@dhis2-ui/box": "9.2.0",
"@dhis2-ui/button": "9.2.0",
"@dhis2-ui/calendar": "9.2.0",
"@dhis2-ui/card": "9.2.0",
"@dhis2-ui/center": "9.2.0",
"@dhis2-ui/checkbox": "9.2.0",
"@dhis2-ui/chip": "9.2.0",
"@dhis2-ui/cover": "9.2.0",
"@dhis2-ui/css": "9.2.0",
"@dhis2-ui/divider": "9.2.0",
"@dhis2-ui/field": "9.2.0",
"@dhis2-ui/file-input": "9.2.0",
"@dhis2-ui/header-bar": "9.2.0",
"@dhis2-ui/help": "9.2.0",
"@dhis2-ui/input": "9.2.0",
"@dhis2-ui/intersection-detector": "9.2.0",
"@dhis2-ui/label": "9.2.0",
"@dhis2-ui/layer": "9.2.0",
"@dhis2-ui/legend": "9.2.0",
"@dhis2-ui/loader": "9.2.0",
"@dhis2-ui/logo": "9.2.0",
"@dhis2-ui/menu": "9.2.0",
"@dhis2-ui/modal": "9.2.0",
"@dhis2-ui/node": "9.2.0",
"@dhis2-ui/notice-box": "9.2.0",
"@dhis2-ui/organisation-unit-tree": "9.2.0",
"@dhis2-ui/pagination": "9.2.0",
"@dhis2-ui/popover": "9.2.0",
"@dhis2-ui/popper": "9.2.0",
"@dhis2-ui/portal": "9.2.0",
"@dhis2-ui/radio": "9.2.0",
"@dhis2-ui/required": "9.2.0",
"@dhis2-ui/segmented-control": "9.2.0",
"@dhis2-ui/select": "9.2.0",
"@dhis2-ui/selector-bar": "9.2.0",
"@dhis2-ui/sharing-dialog": "9.2.0",
"@dhis2-ui/switch": "9.2.0",
"@dhis2-ui/tab": "9.2.0",
"@dhis2-ui/table": "9.2.0",
"@dhis2-ui/tag": "9.2.0",
"@dhis2-ui/text-area": "9.2.0",
"@dhis2-ui/tooltip": "9.2.0",
"@dhis2-ui/transfer": "9.2.0",
"@dhis2-ui/user-avatar": "9.2.0",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-forms": "9.2.0",
"@dhis2/ui-icons": "9.2.0",
"@dhis2-ui/alert": "9.3.0",
"@dhis2-ui/box": "9.3.0",
"@dhis2-ui/button": "9.3.0",
"@dhis2-ui/calendar": "9.3.0",
"@dhis2-ui/card": "9.3.0",
"@dhis2-ui/center": "9.3.0",
"@dhis2-ui/checkbox": "9.3.0",
"@dhis2-ui/chip": "9.3.0",
"@dhis2-ui/cover": "9.3.0",
"@dhis2-ui/css": "9.3.0",
"@dhis2-ui/divider": "9.3.0",
"@dhis2-ui/field": "9.3.0",
"@dhis2-ui/file-input": "9.3.0",
"@dhis2-ui/header-bar": "9.3.0",
"@dhis2-ui/help": "9.3.0",
"@dhis2-ui/input": "9.3.0",
"@dhis2-ui/intersection-detector": "9.3.0",
"@dhis2-ui/label": "9.3.0",
"@dhis2-ui/layer": "9.3.0",
"@dhis2-ui/legend": "9.3.0",
"@dhis2-ui/loader": "9.3.0",
"@dhis2-ui/logo": "9.3.0",
"@dhis2-ui/menu": "9.3.0",
"@dhis2-ui/modal": "9.3.0",
"@dhis2-ui/node": "9.3.0",
"@dhis2-ui/notice-box": "9.3.0",
"@dhis2-ui/organisation-unit-tree": "9.3.0",
"@dhis2-ui/pagination": "9.3.0",
"@dhis2-ui/popover": "9.3.0",
"@dhis2-ui/popper": "9.3.0",
"@dhis2-ui/portal": "9.3.0",
"@dhis2-ui/radio": "9.3.0",
"@dhis2-ui/required": "9.3.0",
"@dhis2-ui/segmented-control": "9.3.0",
"@dhis2-ui/select": "9.3.0",
"@dhis2-ui/selector-bar": "9.3.0",
"@dhis2-ui/sharing-dialog": "9.3.0",
"@dhis2-ui/switch": "9.3.0",
"@dhis2-ui/tab": "9.3.0",
"@dhis2-ui/table": "9.3.0",
"@dhis2-ui/tag": "9.3.0",
"@dhis2-ui/text-area": "9.3.0",
"@dhis2-ui/tooltip": "9.3.0",
"@dhis2-ui/transfer": "9.3.0",
"@dhis2-ui/user-avatar": "9.3.0",
"@dhis2/ui-constants": "9.3.0",
"@dhis2/ui-forms": "9.3.0",
"@dhis2/ui-icons": "9.3.0",
"prop-types": "^15.7.2"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions components/alert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/alert",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Alert",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,9 +33,9 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2-ui/portal": "9.2.0",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-icons": "9.2.0",
"@dhis2-ui/portal": "9.3.0",
"@dhis2/ui-constants": "9.3.0",
"@dhis2/ui-icons": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions components/box/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/box",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Box",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-constants": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
12 changes: 6 additions & 6 deletions components/button/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/button",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Button",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,11 +33,11 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2-ui/layer": "9.2.0",
"@dhis2-ui/loader": "9.2.0",
"@dhis2-ui/popper": "9.2.0",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-icons": "9.2.0",
"@dhis2-ui/layer": "9.3.0",
"@dhis2-ui/loader": "9.3.0",
"@dhis2-ui/popper": "9.3.0",
"@dhis2/ui-constants": "9.3.0",
"@dhis2/ui-icons": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
14 changes: 14 additions & 0 deletions components/button/src/button/__tests__/Button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ describe('<Button>', () => {
expect(actual.length).toBe(1)
})

it('has the accessibility attributes', () => {
const dataTest = 'button-data-test'
const wrapper = mount(
<Button
dataTest={dataTest}
ariaLabel="test aria label"
title="title for button"
/>
)
const buttonElement = wrapper.find('button').getDOMNode()
expect(buttonElement).toHaveAttribute('title', 'title for button')
expect(buttonElement).toHaveAttribute('ariaLabel', 'test aria label')
})

describe('toggle', () => {
it('should have class "toggled" if toggled-prop is true', () => {
const wrapper = mount(<Button toggled />)
Expand Down
3 changes: 3 additions & 0 deletions components/button/src/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Button = ({
onFocus,
onKeyDown,
loading,
...otherProps
}) => {
const ref = useRef()

Expand Down Expand Up @@ -67,6 +68,7 @@ export const Button = ({
onClick={handleClick}
onFocus={handleFocus}
onKeyDown={handleKeyDown}
{...otherProps}
>
{loading && (
<span className="loader">
Expand Down Expand Up @@ -149,6 +151,7 @@ Button.propTypes = {
* Called with args `({ value, name }, event)`
* */
onClick: PropTypes.func,

/** Callback to trigger on focus. Called with same args as `onClick` */
onFocus: PropTypes.func,
/** Callback to trigger on key-down. Called with same args as `onClick` */
Expand Down
4 changes: 4 additions & 0 deletions components/button/src/button/button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export default {
children: 'Label me!',
value: 'default',
onClick: logger,
title: 'Button',
ariaLabel: 'Button',
},
argTypes: {
primary: { ...buttonVariantArgType },
Expand Down Expand Up @@ -219,6 +221,8 @@ IconOnly.args = {
icon: DemoIcon24,
name: 'Icon only button',
children: null,
title: 'Icon Button',
ariaLabel: 'Icon Button',
}

export const IconSmall = Template.bind({})
Expand Down
2 changes: 1 addition & 1 deletion components/button/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ButtonOpenEventHandler<
Event extends React.SyntheticEvent = React.MouseEvent<HTMLButtonElement>
> = (arg0: ButtonEventPayload & { open: boolean }, event: Event) => void

export interface ButtonProps {
export interface ButtonProps extends HTMLButtonElement {
/**
* Component to render inside the button
*/
Expand Down
16 changes: 8 additions & 8 deletions components/calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/calendar",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Calendar",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,15 +33,15 @@
"styled-jsx": "^4"
},
"dependencies": {
"@dhis2-ui/button": "9.2.0",
"@dhis2-ui/card": "9.2.0",
"@dhis2-ui/input": "9.2.0",
"@dhis2-ui/layer": "9.2.0",
"@dhis2-ui/popper": "9.2.0",
"@dhis2-ui/button": "9.3.0",
"@dhis2-ui/card": "9.3.0",
"@dhis2-ui/input": "9.3.0",
"@dhis2-ui/layer": "9.3.0",
"@dhis2-ui/popper": "9.3.0",
"@dhis2/multi-calendar-dates": "1.0.2",
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-icons": "9.2.0",
"@dhis2/ui-constants": "9.3.0",
"@dhis2/ui-icons": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions components/card/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/card",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Card",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-constants": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
4 changes: 2 additions & 2 deletions components/center/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/center",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Center",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,7 +33,7 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui-constants": "9.2.0",
"@dhis2/ui-constants": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
8 changes: 4 additions & 4 deletions components/checkbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2-ui/checkbox",
"version": "9.2.0",
"version": "9.3.0",
"description": "UI Checkbox",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,9 +33,9 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2-ui/field": "9.2.0",
"@dhis2-ui/required": "9.2.0",
"@dhis2/ui-constants": "9.2.0",
"@dhis2-ui/field": "9.3.0",
"@dhis2-ui/required": "9.3.0",
"@dhis2/ui-constants": "9.3.0",
"classnames": "^2.3.1",
"prop-types": "^15.7.2"
},
Expand Down
Loading

0 comments on commit 56ab260

Please sign in to comment.