From 558973f51a0bf60d0d406072f60b36d7c2d1fb71 Mon Sep 17 00:00:00 2001 From: Joseph John Aas Cooper Date: Mon, 8 Jan 2024 11:22:14 +0100 Subject: [PATCH 1/4] fix(segmented-control): adjust design --- .../src/segmented-control.js | 52 ++++++------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/components/segmented-control/src/segmented-control.js b/components/segmented-control/src/segmented-control.js index dfa132ecd0..44f9410e3e 100644 --- a/components/segmented-control/src/segmented-control.js +++ b/components/segmented-control/src/segmented-control.js @@ -1,4 +1,4 @@ -import { colors, spacers, theme } from '@dhis2/ui-constants' +import { colors, elevations, spacers, theme } from '@dhis2/ui-constants' import cx from 'classnames' import { PropTypes } from 'prop-types' import React from 'react' @@ -46,26 +46,24 @@ export const SegmentedControl = ({ options, selected, onChange }) => { - + ) } From cce94e01ce27f00f0002fa7f617f63546909aa3a Mon Sep 17 00:00:00 2001 From: Joseph John Aas Cooper Date: Mon, 8 Jan 2024 12:18:06 +0100 Subject: [PATCH 3/4] fix(segmented-control): add aria-label prop --- components/segmented-control/src/segmented-control.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/segmented-control/src/segmented-control.js b/components/segmented-control/src/segmented-control.js index f08a35261a..6eee2338a3 100644 --- a/components/segmented-control/src/segmented-control.js +++ b/components/segmented-control/src/segmented-control.js @@ -18,7 +18,12 @@ import { SegmentedControl } from '@dhis2/ui' ``` */ -export const SegmentedControl = ({ options, selected, onChange }) => { +export const SegmentedControl = ({ + options, + selected, + onChange, + ariaLabel, +}) => { if (!options.map(({ value }) => value).includes(selected)) { const message = `There is no option with the value: "${selected}". ` + @@ -28,7 +33,7 @@ export const SegmentedControl = ({ options, selected, onChange }) => { } return ( -