playbook_ui_docs 13.32.0.pre.alpha.PLAY14143272 → 13.32.0.pre.alpha.PLAY14143288

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b970887cc5fb116e5c6f1b7af6f9b7c2a60c9b248b848411f70c1017b83670fe
4
- data.tar.gz: 37e7a8a584d0b46026ff9f88c2be09fd1058158f147e7c5aaed53720063b001f
3
+ metadata.gz: f14033d25185093809f123b76f10a331721f6c6ae3b564a285b341f1a212d74e
4
+ data.tar.gz: 4a6c994851f19a665da30da7d03969c75045f26c15c361e6342695f1b0911f9d
5
5
  SHA512:
6
- metadata.gz: a082a2c39b3ef10f311e73f4307ffa7fcaa3dad55a2ec2144b9992666f13bcd8afe440c2fddedad5cfd47eb96fe7d8671b3009fbead81a8e8fc462b23cb67050
7
- data.tar.gz: 5084c8ebd1efd3c456e875e6972696e24b5074d526e9fde635903e6f04433a1229db9c4445762504c8e3df74580d143db348dbec4b6fa32c5d1f5cc9a5ac2c29
6
+ metadata.gz: 98f445b0f9eac6dd815510a92cb3e9e403056557a4ad86aef576fb456670227fd61725845cf67cdc221b17375a15fce77d985d16ae4798e8b8790b3594244ba4
7
+ data.tar.gz: 5775b0804049b39e46c9d02f915835966d71b14661f1c7ad0dacb08697b3fd7cce0353b8e83909fb7e4f89ab9ddaa6e65b67e00c92d1f6181b843b9bdb3322f2
@@ -0,0 +1,10 @@
1
+ <%
2
+ options = [
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
+ ]
7
+
8
+ %>
9
+
10
+ <%= pb_rails("dropdown", props: {options: options, default_value: options.last}) %>
@@ -0,0 +1,31 @@
1
+ import React from 'react'
2
+ import { Dropdown } from 'playbook-ui'
3
+
4
+ const DropdownDefaultValue = (props) => {
5
+ const options = [
6
+ {
7
+ label: "United States",
8
+ value: "United States",
9
+ },
10
+ {
11
+ label: "Canada",
12
+ value: "Canada",
13
+ },
14
+ {
15
+ label: "Pakistan",
16
+ value: "Pakistan",
17
+ }
18
+ ];
19
+
20
+ return (
21
+ <>
22
+ <Dropdown
23
+ defaultValue={options[2]}
24
+ options={options}
25
+ {...props}
26
+ />
27
+ </>
28
+ )
29
+ }
30
+
31
+ export default DropdownDefaultValue
@@ -8,6 +8,7 @@ examples:
8
8
  - dropdown_with_custom_trigger_rails: Custom Trigger
9
9
  - dropdown_with_custom_padding: Custom Option Padding
10
10
  - dropdown_error: Dropdown with Error
11
+ - dropdown_default_value: Default Value
11
12
 
12
13
  react:
13
14
  - dropdown_default: Default
@@ -18,6 +19,7 @@ examples:
18
19
  - dropdown_with_custom_trigger: Custom Trigger
19
20
  - dropdown_with_custom_padding: Custom Option Padding
20
21
  - dropdown_error: Dropdown with Error
22
+ - dropdown_default_value: Default Value
21
23
  # - dropdown_with_autocomplete: Autocomplete
22
24
  # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
23
25
  # - dropdown_with_external_control: useDropdown Hook
@@ -9,4 +9,5 @@ export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
9
9
  export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
10
10
  export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
11
11
  export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
12
- export { default as DropdownError } from './_dropdown_error.jsx'
12
+ export { default as DropdownError } from './_dropdown_error.jsx'
13
+ export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'