{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/eui/pulls/comments/185655129","pull_request_review_id":117088948,"id":185655129,"diff_hunk":"@@ -0,0 +1,190 @@\n+import React, {\n+  Component,\n+} from 'react';\n+\n+import {\n+  EuiButton,\n+  EuiCheckboxGroup,\n+  EuiCode,\n+  EuiFieldText,\n+  EuiForm,\n+  EuiFormRow,\n+  EuiDescriptiveFormRow,\n+  EuiFilePicker,\n+  EuiRange,\n+  EuiSelect,\n+  EuiSwitch,\n+} from '../../../../src/components';\n+\n+import makeId from '../../../../src/components/form/form_row/make_id';\n+\n+export default class extends Component {\n+  constructor(props) {\n+    super(props);\n+\n+    const idPrefix = makeId();\n+\n+    this.state = {\n+      isSwitchChecked: false,\n+      checkboxes: [{\n+        id: `${idPrefix}0`,\n+        label: 'Option one',\n+      }, {\n+        id: `${idPrefix}1`,\n+        label: 'Option two is checked by default',\n+      }, {\n+        id: `${idPrefix}2`,\n+        label: 'Option three',\n+      }],\n+      checkboxIdToSelectedMap: {\n+        [`${idPrefix}1`]: true,\n+      },\n+      radios: [{\n+        id: `${idPrefix}4`,\n+        label: 'Option one',\n+      }, {\n+        id: `${idPrefix}5`,\n+        label: 'Option two is selected by default',\n+      }, {\n+        id: `${idPrefix}6`,\n+        label: 'Option three',\n+      }],\n+      radioIdSelected: `${idPrefix}5`,\n+    };\n+  }\n+\n+  onSwitchChange = () => {\n+    this.setState({\n+      isSwitchChecked: !this.state.isSwitchChecked,\n+    });\n+  }\n+\n+  onCheckboxChange = optionId => {\n+    const newCheckboxIdToSelectedMap = ({ ...this.state.checkboxIdToSelectedMap, ...{\n+        [optionId]: !this.state.checkboxIdToSelectedMap[optionId],\n+      } });\n+\n+    this.setState({\n+      checkboxIdToSelectedMap: newCheckboxIdToSelectedMap,\n+    });\n+  }\n+\n+  onRadioChange = optionId => {\n+    this.setState({\n+      radioIdSelected: optionId,\n+    });\n+  }\n+\n+  render() {\n+    return (\n+      <EuiForm>\n+        <EuiDescriptiveFormRow\n+          id=\"single-example\"\n+          title={<h3>Single text field</h3>}\n+          paddingSize=\"m\"\n+          description={\n+            <span>\n+              When using this with a single field where the text here serves as the help text for the input,\n+              it is a good idea to give it <EuiCode>someID</EuiCode> and pass <EuiCode>someID-description</EuiCode> to\n+              the form row&apos;s <EuiCode>describedByIds</EuiCode> prop.\n+            </span>\n+          }\n+        >\n+          <EuiFormRow\n+            label=\"Text field\"\n+            describedByIds={['single-example-description']}","path":"src-docs/src/views/form_layouts/form_rows_descriptive.js","position":null,"original_position":95,"commit_id":"b2a34ece090630442a841cf758aef91c5f5b9bfa","original_commit_id":"4692afbd1d5a981d6f31b4e23e46cc5ffa766fc1","user":{"login":"jen-huang","id":1965714,"avatar_url":"https://avatars0.githubusercontent.com/u/1965714?v=4","gravatar_id":"","url":"https://api.github.com/users/jen-huang","html_url":"https://github.com/jen-huang","followers_url":"https://api.github.com/users/jen-huang/followers","following_url":"https://api.github.com/users/jen-huang/following{/other_user}","gists_url":"https://api.github.com/users/jen-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/jen-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jen-huang/subscriptions","organizations_url":"https://api.github.com/users/jen-huang/orgs","repos_url":"https://api.github.com/users/jen-huang/repos","events_url":"https://api.github.com/users/jen-huang/events{/privacy}","received_events_url":"https://api.github.com/users/jen-huang/received_events","type":"User","site_admin":false},"body":"I changed it so that the user will pass in `idAria` (React didn't like \"ariaId\") prop, which gets put on the `EuiText` description. They can pass the same ID to `describedByIds` so there won't be a case where they have to know how the description ID is generated.\r\n\r\nIf they pass `id` it'll just unfold to the top level `div` container for `EuiDescribedFormRow` 🙂 ","created_at":"2018-05-02T22:16:21Z","updated_at":"2018-05-02T22:16:21Z","html_url":"https://github.com/elastic/eui/pull/707#discussion_r185655129","pull_request_url":"https://api.github.com/repos/elastic/eui/pulls/707","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/eui/pulls/comments/185655129"},"html":{"href":"https://github.com/elastic/eui/pull/707#discussion_r185655129"},"pull_request":{"href":"https://api.github.com/repos/elastic/eui/pulls/707"}},"in_reply_to_id":185365087},"pull_request":{"url":"https://api.github.com/repos/elastic/eui/pulls/707","id":184497287,"html_url":"https://github.com/elastic/eui/pull/707","diff_url":"https://github.com/elastic/eui/pull/707.diff","patch_url":"https://github.com/elastic/eui/pull/707.patch","issue_url":"https://api.github.com/repos/elastic/eui/issues/707","number":707,"state":"open","locked":false,"title":"EuiDescriptiveFormRow component","user":{"login":"jen-huang","id":1965714,"avatar_url":"https://avatars0.githubusercontent.com/u/1965714?v=4","gravatar_id":"","url":"https://api.github.com/users/jen-huang","html_url":"https://github.com/jen-huang","followers_url":"https://api.github.com/users/jen-huang/followers","following_url":"https://api.github.com/users/jen-huang/following{/other_user}","gists_url":"https://api.github.com/users/jen-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/jen-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jen-huang/subscriptions","organizations_url":"https://api.github.com/users/jen-huang/orgs","repos_url":"https://api.github.com/users/jen-huang/repos","events_url":"https://api.github.com/users/jen-huang/events{/privacy}","received_events_url":"https://api.github.com/users/jen-huang/received_events","type":"User","site_admin":false},"body":"`EuiDescriptiveFormRow` is a wrapper around `EuiFormRow` that uses `EuiFlexGroup` to display help text horizontally next to the field instead of below (falls back to stacking on mobile). Includes support for validation errors and full width. If full width is not enabled, it maxes out at 800px (`$euiFormMaxWidth*2`).\r\n\r\nMost of its props are passed to `EuiFormRow` with the following exceptions:\r\n- `gutterSize` passed to `EuiFlexGroup`, defaults to `l`\r\n- `helpTitle` used by itself, title that displays above the help text - it is treated as a second label for the field (or only label if `label` is ommited)\r\n- `helpText` used by itself, not passed to form row\r\n\r\n**Desktop view with focusing fields:**\r\n\r\n![apr-26-2018 17-21-56](https://user-images.githubusercontent.com/1965714/39338223-6d5d7e1c-4976-11e8-9947-b2468bfe028d.gif)\r\n\r\n**Mobile view:**\r\n\r\n<img width=\"468\" alt=\"screen shot 2018-04-26 at 5 24 11 pm\" src=\"https://user-images.githubusercontent.com/1965714/39338272-b5ef583a-4976-11e8-8d17-1bb664a91b83.png\">\r\n","created_at":"2018-04-27T00:31:48Z","updated_at":"2018-05-02T22:16:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cb9764835a906bdd5c64626d92d49f6b9538e14","assignee":null,"assignees":[],"requested_reviewers":[{"login":"chandlerprall","id":313125,"avatar_url":"https://avatars3.githubusercontent.com/u/313125?v=4","gravatar_id":"","url":"https://api.github.com/users/chandlerprall","html_url":"https://github.com/chandlerprall","followers_url":"https://api.github.com/users/chandlerprall/followers","following_url":"https://api.github.com/users/chandlerprall/following{/other_user}","gists_url":"https://api.github.com/users/chandlerprall/gists{/gist_id}","starred_url":"https://api.github.com/users/chandlerprall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandlerprall/subscriptions","organizations_url":"https://api.github.com/users/chandlerprall/orgs","repos_url":"https://api.github.com/users/chandlerprall/repos","events_url":"https://api.github.com/users/chandlerprall/events{/privacy}","received_events_url":"https://api.github.com/users/chandlerprall/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/eui/pulls/707/commits","review_comments_url":"https://api.github.com/repos/elastic/eui/pulls/707/comments","review_comment_url":"https://api.github.com/repos/elastic/eui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/eui/issues/707/comments","statuses_url":"https://api.github.com/repos/elastic/eui/statuses/b2a34ece090630442a841cf758aef91c5f5b9bfa","head":{"label":"jen-huang:descriptive-form-row","ref":"descriptive-form-row","sha":"b2a34ece090630442a841cf758aef91c5f5b9bfa","user":{"login":"jen-huang","id":1965714,"avatar_url":"https://avatars0.githubusercontent.com/u/1965714?v=4","gravatar_id":"","url":"https://api.github.com/users/jen-huang","html_url":"https://github.com/jen-huang","followers_url":"https://api.github.com/users/jen-huang/followers","following_url":"https://api.github.com/users/jen-huang/following{/other_user}","gists_url":"https://api.github.com/users/jen-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/jen-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jen-huang/subscriptions","organizations_url":"https://api.github.com/users/jen-huang/orgs","repos_url":"https://api.github.com/users/jen-huang/repos","events_url":"https://api.github.com/users/jen-huang/events{/privacy}","received_events_url":"https://api.github.com/users/jen-huang/received_events","type":"User","site_admin":false},"repo":{"id":121548885,"name":"eui","full_name":"jen-huang/eui","owner":{"login":"jen-huang","id":1965714,"avatar_url":"https://avatars0.githubusercontent.com/u/1965714?v=4","gravatar_id":"","url":"https://api.github.com/users/jen-huang","html_url":"https://github.com/jen-huang","followers_url":"https://api.github.com/users/jen-huang/followers","following_url":"https://api.github.com/users/jen-huang/following{/other_user}","gists_url":"https://api.github.com/users/jen-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/jen-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jen-huang/subscriptions","organizations_url":"https://api.github.com/users/jen-huang/orgs","repos_url":"https://api.github.com/users/jen-huang/repos","events_url":"https://api.github.com/users/jen-huang/events{/privacy}","received_events_url":"https://api.github.com/users/jen-huang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jen-huang/eui","description":"Elastic UI Framework 🙌","fork":true,"url":"https://api.github.com/repos/jen-huang/eui","forks_url":"https://api.github.com/repos/jen-huang/eui/forks","keys_url":"https://api.github.com/repos/jen-huang/eui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jen-huang/eui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jen-huang/eui/teams","hooks_url":"https://api.github.com/repos/jen-huang/eui/hooks","issue_events_url":"https://api.github.com/repos/jen-huang/eui/issues/events{/number}","events_url":"https://api.github.com/repos/jen-huang/eui/events","assignees_url":"https://api.github.com/repos/jen-huang/eui/assignees{/user}","branches_url":"https://api.github.com/repos/jen-huang/eui/branches{/branch}","tags_url":"https://api.github.com/repos/jen-huang/eui/tags","blobs_url":"https://api.github.com/repos/jen-huang/eui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jen-huang/eui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jen-huang/eui/git/refs{/sha}","trees_url":"https://api.github.com/repos/jen-huang/eui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jen-huang/eui/statuses/{sha}","languages_url":"https://api.github.com/repos/jen-huang/eui/languages","stargazers_url":"https://api.github.com/repos/jen-huang/eui/stargazers","contributors_url":"https://api.github.com/repos/jen-huang/eui/contributors","subscribers_url":"https://api.github.com/repos/jen-huang/eui/subscribers","subscription_url":"https://api.github.com/repos/jen-huang/eui/subscription","commits_url":"https://api.github.com/repos/jen-huang/eui/commits{/sha}","git_commits_url":"https://api.github.com/repos/jen-huang/eui/git/commits{/sha}","comments_url":"https://api.github.com/repos/jen-huang/eui/comments{/number}","issue_comment_url":"https://api.github.com/repos/jen-huang/eui/issues/comments{/number}","contents_url":"https://api.github.com/repos/jen-huang/eui/contents/{+path}","compare_url":"https://api.github.com/repos/jen-huang/eui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jen-huang/eui/merges","archive_url":"https://api.github.com/repos/jen-huang/eui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jen-huang/eui/downloads","issues_url":"https://api.github.com/repos/jen-huang/eui/issues{/number}","pulls_url":"https://api.github.com/repos/jen-huang/eui/pulls{/number}","milestones_url":"https://api.github.com/repos/jen-huang/eui/milestones{/number}","notifications_url":"https://api.github.com/repos/jen-huang/eui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jen-huang/eui/labels{/name}","releases_url":"https://api.github.com/repos/jen-huang/eui/releases{/id}","deployments_url":"https://api.github.com/repos/jen-huang/eui/deployments","created_at":"2018-02-14T18:58:03Z","updated_at":"2018-04-26T18:07:27Z","pushed_at":"2018-05-02T22:10:30Z","git_url":"git://github.com/jen-huang/eui.git","ssh_url":"git@github.com:jen-huang/eui.git","clone_url":"https://github.com/jen-huang/eui.git","svn_url":"https://github.com/jen-huang/eui","homepage":"https://elastic.github.io/eui/","size":61858,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"fdd97143e9d2e5fec7d197e136cb0692b5c9e572","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":107422373,"name":"eui","full_name":"elastic/eui","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/eui","description":"Elastic UI Framework 🙌","fork":false,"url":"https://api.github.com/repos/elastic/eui","forks_url":"https://api.github.com/repos/elastic/eui/forks","keys_url":"https://api.github.com/repos/elastic/eui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/eui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/eui/teams","hooks_url":"https://api.github.com/repos/elastic/eui/hooks","issue_events_url":"https://api.github.com/repos/elastic/eui/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/eui/events","assignees_url":"https://api.github.com/repos/elastic/eui/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/eui/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/eui/tags","blobs_url":"https://api.github.com/repos/elastic/eui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/eui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/eui/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/eui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/eui/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/eui/languages","stargazers_url":"https://api.github.com/repos/elastic/eui/stargazers","contributors_url":"https://api.github.com/repos/elastic/eui/contributors","subscribers_url":"https://api.github.com/repos/elastic/eui/subscribers","subscription_url":"https://api.github.com/repos/elastic/eui/subscription","commits_url":"https://api.github.com/repos/elastic/eui/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/eui/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/eui/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/eui/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/eui/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/eui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/eui/merges","archive_url":"https://api.github.com/repos/elastic/eui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/eui/downloads","issues_url":"https://api.github.com/repos/elastic/eui/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/eui/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/eui/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/eui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/eui/labels{/name}","releases_url":"https://api.github.com/repos/elastic/eui/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/eui/deployments","created_at":"2017-10-18T14:49:20Z","updated_at":"2018-05-02T16:48:28Z","pushed_at":"2018-05-02T22:10:31Z","git_url":"git://github.com/elastic/eui.git","ssh_url":"git@github.com:elastic/eui.git","clone_url":"https://github.com/elastic/eui.git","svn_url":"https://github.com/elastic/eui","homepage":"https://elastic.github.io/eui/","size":61789,"stargazers_count":186,"watchers_count":186,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":161,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":51,"open_issues":161,"watchers":186,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/eui/pulls/707"},"html":{"href":"https://github.com/elastic/eui/pull/707"},"issue":{"href":"https://api.github.com/repos/elastic/eui/issues/707"},"comments":{"href":"https://api.github.com/repos/elastic/eui/issues/707/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/eui/pulls/707/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/eui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/eui/pulls/707/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/eui/statuses/b2a34ece090630442a841cf758aef91c5f5b9bfa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jen-huang"}}