diff --git a/src-docs/src/views/card/card_checkable.js b/src-docs/src/views/card/card_checkable.js index 9850d2dc4ed..7c3f917cef2 100644 --- a/src-docs/src/views/card/card_checkable.js +++ b/src-docs/src/views/card/card_checkable.js @@ -8,10 +8,10 @@ import { EuiFormFieldset, } from '../../../../src/components'; -import { htmlIdGenerator } from '../../../../src/services'; +import { useGeneratedHtmlId } from '../../../../src/services'; export default () => { - const radioName = htmlIdGenerator()(); + const radioGroupId = useGeneratedHtmlId({ prefix: 'radioGroup' }); const [radio, setRadio] = useState('radio2'); const [nestedRadio, setNestedRadio] = useState('nestedRadio1'); @@ -30,6 +30,19 @@ export default () => { }, ]; + const checkableCardId__1 = useGeneratedHtmlId({ + prefix: 'checkableCard', + suffix: 'first', + }); + const checkableCardId__2 = useGeneratedHtmlId({ + prefix: 'checkableCard', + suffix: 'second', + }); + const checkableCardId__3 = useGeneratedHtmlId({ + prefix: 'checkableCard', + suffix: 'third', + }); + return ( { }} > setRadio('radio1')} @@ -53,9 +66,9 @@ export default () => { setRadio('radio2')} @@ -71,9 +84,9 @@ export default () => { setRadio('radio3')} diff --git a/src-docs/src/views/card/card_checkable_checkbox.js b/src-docs/src/views/card/card_checkable_checkbox.js index 358ffcd68ed..3cdd265f62c 100644 --- a/src-docs/src/views/card/card_checkable_checkbox.js +++ b/src-docs/src/views/card/card_checkable_checkbox.js @@ -2,14 +2,15 @@ import React, { useState } from 'react'; import { EuiCheckableCard } from '../../../../src/components'; -import { htmlIdGenerator } from '../../../../src/services'; +import { useGeneratedHtmlId } from '../../../../src/services'; export default () => { const [checkbox, setCheckbox] = useState(false); + const checkboxCardId = useGeneratedHtmlId({ prefix: 'checkboxCard' }); return ( { const [favorite1, setFavorite1] = useState(undefined); @@ -8,6 +9,27 @@ export default () => { const [favorite3, setFavorite3] = useState(undefined); const [favorite4, setFavorite4] = useState(undefined); + const listGroupLinkId__1 = useGeneratedHtmlId({ + prefix: 'listGroupLink', + suffix: 'first', + }); + const listGroupLinkId__2 = useGeneratedHtmlId({ + prefix: 'listGroupLink', + suffix: 'second', + }); + const listGroupLinkId__3 = useGeneratedHtmlId({ + prefix: 'listGroupLink', + suffix: 'third', + }); + const listGroupLinkId__4 = useGeneratedHtmlId({ + prefix: 'listGroupLink', + suffix: 'fourth', + }); + const listGroupLinkId__5 = useGeneratedHtmlId({ + prefix: 'listGroupLink', + suffix: 'fifth', + }); + const link1Clicked = () => { setFavorite1(favorite1 === 'link1' ? undefined : 'link1'); if (favorite1 === undefined) { @@ -39,7 +61,7 @@ export default () => { return ( {}} @@ -55,7 +77,7 @@ export default () => { /> {}} label="EUI button link" @@ -70,7 +92,7 @@ export default () => { /> {}} @@ -86,7 +108,7 @@ export default () => { /> {}} iconType="broom" label="EUI button link" @@ -102,7 +124,7 @@ export default () => { /> { const [isRead, setIsRead] = useState(false); @@ -10,6 +11,10 @@ export default () => { setIsRead(!isRead); }; + const reportNotificationEventId = useGeneratedHtmlId({ + prefix: 'reportNotificationEvent', + }); + const onOpenContextMenu = (id) => { return [ { return ( { + const explainedCheckboxId = useGeneratedHtmlId({ + prefix: 'explainedCheckbox', + }); -export default () => ( - - - - {}} - /> - + return ( + + + + {}} + /> + - - - - + + + + - + - + - + - -

- Pass a position utility class via iconProps to shift - for better alignment. - - This was passed .eui-alignTop - - } - iconProps={{ - className: 'eui-alignTop', - }} - /> -

-
-
-); + +

+ Pass a position utility class via iconProps to + shift for better alignment. + + This was passed .eui-alignTop + + } + iconProps={{ + className: 'eui-alignTop', + }} + /> +

+
+
+ ); +};