playbook_ui_docs 13.25.0.pre.alpha.barchartfix2766 → 13.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_disabled.html.erb +23 -0
  3. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_disabled.jsx +29 -0
  4. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -0
  5. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  6. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +3 -1
  7. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_close.md +3 -1
  8. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  9. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +2 -20
  10. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -0
  11. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +42 -0
  12. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +7 -0
  13. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +1 -4
  14. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +0 -1
  15. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +1 -1
  16. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -1
  17. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +1 -4
  18. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -1
  19. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +1 -4
  20. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +59 -0
  21. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +72 -0
  22. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +39 -0
  23. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -0
  24. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -2
  25. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +5 -1
  26. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.html.erb +3 -0
  27. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.jsx +16 -0
  28. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_flex.md +1 -0
  29. data/app/pb_kits/playbook/pb_progress_simple/docs/example.yml +2 -0
  30. data/app/pb_kits/playbook/pb_progress_simple/docs/index.js +1 -0
  31. data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment.jsx +4 -1
  32. data/app/pb_kits/playbook/pb_radio/docs/_radio_default.jsx +4 -1
  33. data/app/pb_kits/playbook/pb_radio/docs/_radio_disabled.html.erb +26 -0
  34. data/app/pb_kits/playbook/pb_radio/docs/_radio_disabled.jsx +31 -0
  35. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.jsx +2 -1
  36. data/app/pb_kits/playbook/pb_radio/docs/example.yml +2 -0
  37. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  38. data/dist/playbook-doc.js +9 -9
  39. metadata +18 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acebf673f660e55db726c6147d21e39e88381a4e7c653bfacaae24972a3933e4
4
- data.tar.gz: 41b8ba5ab847991a6bcd680a6e838a9fb33a0c35aeb3debf917112772e42d753
3
+ metadata.gz: 506f0f2408c89875b290043f9fb12e8cb0bfa8937bb37ba9a2f955b2367a4054
4
+ data.tar.gz: ae596ee753bd1153ea66228e5ed56ad2e2f8552c162a287881b2fba11b3587e4
5
5
  SHA512:
6
- metadata.gz: 44f613480497f461bfb4cfb9228ae3ca2c7c8517aed143bede3906b36f921121faccc8c84393211d4777e39921563d36b77fecc3006e8f38940bccf9573c9bc9
7
- data.tar.gz: 9abbb0729769e596a857aa30141ea6dcdc83f36fb1c7413e02954b88680ebb1b4d0eeb1d4b9f1a5f39e910bc7c5d73b75a163fb0ca73d56dfd56c34ae640db50
6
+ metadata.gz: ee88bbfb7b88283f206212ec714d0aecf139d9b7adff62899f9eb71327084de9748718e5b9b3867f114085c084559dbb3146e726fd9ae32cc831e92ce2130047
7
+ data.tar.gz: 7b4dd023282b0a4e5ada4325582f6d8acf824d02832c857b9c24b12e5d155e452c28b1e3d2b1a7f8456b672be2a8cadc0e166ab87a95358073206507b2ded18d
@@ -0,0 +1,23 @@
1
+ <%= pb_rails("flex", props: {orientation: "column"}) do %>
2
+ <%= pb_rails("flex/flex_item") do %>
3
+ <%= pb_rails("checkbox" , props: {
4
+ input_options: { tabindex: 0 },
5
+ margin_bottom: "xs",
6
+ text: "Disabled unchecked",
7
+ value: "checkbox-value",
8
+ disabled: true,
9
+ name: "checkbox-name"
10
+ }) %>
11
+ <% end %>
12
+ <%= pb_rails("flex/flex_item") do %>
13
+ <%= pb_rails("checkbox" , props: {
14
+ input_options: { tabindex: 0 },
15
+ text: "Disabled checked",
16
+ value: "checkbox-value",
17
+ disabled: true,
18
+ checked: true,
19
+ name: "checkbox-name"
20
+ }) %>
21
+ <% end %>
22
+ <% end %>
23
+
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+
3
+ import Checkbox from '../_checkbox'
4
+
5
+ const CheckboxDisabled = (props) => {
6
+ return (
7
+ <div style={{ display: "flex", flexDirection: "column" }}>
8
+ <Checkbox
9
+ disabled
10
+ marginBottom="xs"
11
+ name="default name"
12
+ tabIndex={0}
13
+ text="Disabled unchecked"
14
+ value="default value"
15
+ {...props}
16
+ />
17
+ <Checkbox
18
+ checked
19
+ disabled
20
+ name="checkbox-name"
21
+ text="Disabled checked"
22
+ value="check-box value"
23
+ {...props}
24
+ />
25
+ </div>
26
+ )
27
+ }
28
+
29
+ export default CheckboxDisabled
@@ -6,6 +6,7 @@ examples:
6
6
  - checkbox_error: Default w/ Error
7
7
  - checkbox_options: Checkbox w/ Options
8
8
  - checkbox_indeterminate: Indeterminate Checkbox
9
+ - checkbox_disabled: Disabled Checkbox
9
10
 
10
11
  react:
11
12
  - checkbox_default: Default
@@ -13,6 +14,7 @@ examples:
13
14
  - checkbox_custom: Custom Checkbox
14
15
  - checkbox_error: Default w/ Error
15
16
  - checkbox_indeterminate: Indeterminate Checkbox
17
+ - checkbox_disabled: Disabled Checkbox
16
18
 
17
19
  swift:
18
20
  - checkbox_default_swift: Default
@@ -3,3 +3,4 @@ export { default as CheckboxCustom } from './_checkbox_custom.jsx'
3
3
  export { default as CheckboxError } from './_checkbox_error.jsx'
4
4
  export { default as CheckboxChecked } from './_checkbox_checked.jsx'
5
5
  export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
6
+ export { default as CheckboxDisabled } from './_checkbox_disabled.jsx'
@@ -1,3 +1,5 @@
1
1
  Your change handler function has access to two arguments: `dateStr` and `selectedDates`.
2
2
 
3
- The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
3
+ The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
4
+
5
+ NOTE: On Change does not account for manual input by users, so if your date picker sets `allowInput`, you should use the `onClose` method instead.
@@ -1,3 +1,5 @@
1
1
  The `onClose` handler function has access to two arguments: `dateStr` and `selectedDates`.
2
2
 
3
- The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
3
+ The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
4
+
5
+ NOTE: `onClose` is the ideal handler function to use when `allowInput` is enabled.
@@ -1 +1 @@
1
- Applying `this_ranges_end_today` (Rails) or `thisRangesEndToday` (React) causes all “This” preset ranges (i.e., this week, this month, this quarter, this year) to use an endDate of today, instead of their natural end date in the future.
1
+ Because the Quick Pick variant has `allowInput` set to `true` by default, use the `onClose` handler function to access the startDate and endDate values. See the `onClose` example for details.
@@ -1,31 +1,20 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
  import { Dropdown } from '../../'
3
3
 
4
4
  const DropdownDefault = (props) => {
5
- // eslint-disable-next-line no-unused-vars
6
- const [selectedOption, setSelectedOption] = useState();
7
5
 
8
6
  const options = [
9
7
  {
10
8
  label: "United States",
11
9
  value: "United States",
12
- areaCode: "+1",
13
- icon: "🇺🇸",
14
- id: "United-states"
15
10
  },
16
11
  {
17
12
  label: "Canada",
18
13
  value: "Canada",
19
- areaCode: "+1",
20
- icon: "🇨🇦",
21
- id: "canada"
22
14
  },
23
15
  {
24
16
  label: "Pakistan",
25
17
  value: "Pakistan",
26
- areaCode: "+92",
27
- icon: "🇵🇰",
28
- id: "pakistan"
29
18
  }
30
19
  ];
31
20
 
@@ -33,16 +22,9 @@ const [selectedOption, setSelectedOption] = useState();
33
22
  return (
34
23
  <div>
35
24
  <Dropdown
36
- onSelect={(selectedItem) => setSelectedOption(selectedItem)}
37
25
  options={options}
38
26
  {...props}
39
- >
40
- {options.map((option) => (
41
- <Dropdown.Option key={option.id}
42
- option={option}
43
- />
44
- ))}
45
- </Dropdown>
27
+ />
46
28
  </div>
47
29
  )
48
30
  }
@@ -0,0 +1 @@
1
+ The Dropdown kit accepts an `options` array and renders each object from that array as a selectable option within a dropdown container. `options` is a required prop and must be an array of objects. Each object can contain as many key/value pairs as needed but MUST contain 'label' and 'value' as the only required items within each object.
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+ import { Dropdown } from '../..'
3
+
4
+ const DropdownSubcomponentStructure = (props) => {
5
+
6
+
7
+ const options = [
8
+ {
9
+ label: "United States",
10
+ value: "United States",
11
+ },
12
+ {
13
+ label: "Canada",
14
+ value: "Canada",
15
+ },
16
+ {
17
+ label: "Pakistan",
18
+ value: "Pakistan",
19
+ }
20
+ ];
21
+
22
+
23
+ return (
24
+ <div>
25
+ <Dropdown
26
+ options={options}
27
+ {...props}
28
+ >
29
+ <Dropdown.Trigger/>
30
+ <Dropdown.Container>
31
+ {options.map((option) => (
32
+ <Dropdown.Option key={option.id}
33
+ option={option}
34
+ />
35
+ ))}
36
+ </Dropdown.Container>
37
+ </Dropdown>
38
+ </div>
39
+ )
40
+ }
41
+
42
+ export default DropdownSubcomponentStructure
@@ -0,0 +1,7 @@
1
+ The dropdown comes with the following subcomponents that can be used to achieve various levels of customization:
2
+
3
+ `Dropdown. Trigger`
4
+ `Dropdown.Container`
5
+ `Dropdown.Option`
6
+
7
+ See the code snippet below for a visual on how to use the kit with subcomponents. Each subcomponent allows for GlobalProps in addition to any subcomponent specfic props.
@@ -1,9 +1,7 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
  import { Dropdown, User, Badge, FlexItem } from '../..'
3
3
 
4
4
  const DropdownWithAutocomplete = (props) => {
5
- // eslint-disable-next-line no-unused-vars
6
- const [selectedOption, setSelectedOption] = useState();
7
5
 
8
6
  const options = [
9
7
  {
@@ -44,7 +42,6 @@ const DropdownWithAutocomplete = (props) => {
44
42
  return (
45
43
  <div>
46
44
  <Dropdown autocomplete
47
- onSelect={(selectedItem) => setSelectedOption(selectedItem)}
48
45
  options={options}
49
46
  {...props}
50
47
  >
@@ -2,7 +2,6 @@ import React, { useState } from 'react'
2
2
  import { Dropdown, User, Badge, FlexItem, Avatar } from '../..'
3
3
 
4
4
  const DropdownWithAutocompleteAndCustomDisplay = (props) => {
5
- // eslint-disable-next-line no-unused-vars
6
5
  const [selectedOption, setSelectedOption] = useState();
7
6
 
8
7
  const options = [
@@ -81,7 +81,7 @@ const DropdownWithCustomDisplay = (props) => {
81
81
  />
82
82
  </FlexItem>
83
83
  <FlexItem>
84
- <Badge
84
+ <Badge dark
85
85
  rounded
86
86
  text={option.status}
87
87
  variant={`${
@@ -1,3 +1,5 @@
1
1
  The `customDisplay` prop can be used to customize the display of the selected item by allowing devs to pass in a component that will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
2
2
 
3
- The `placeholder` prop can also be used to customize the placeholder text for the default Trigger.
3
+ The `placeholder` prop can also be used to customize the placeholder text for the default Trigger.
4
+
5
+ The `onSelect` prop is a function that gives the dev one argument: the selected option. In this example we are using the `onSelect` to set a state with the selected option and using it to customize the `customDisplay`.
@@ -1,9 +1,7 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
  import { Dropdown, Icon, Body, FlexItem, Flex } from '../..'
3
3
 
4
4
  const DropdownWithCustomOptions = (props) => {
5
- // eslint-disable-next-line no-unused-vars
6
- const [selectedOption, setSelectedOption] = useState();
7
5
 
8
6
  const options = [
9
7
  {
@@ -33,7 +31,6 @@ const DropdownWithCustomOptions = (props) => {
33
31
  return (
34
32
  <div>
35
33
  <Dropdown
36
- onSelect={(selectedItem) => setSelectedOption(selectedItem)}
37
34
  options={options}
38
35
  {...props}
39
36
  >
@@ -1 +1 @@
1
- The Dropdown also allows for custom options that can be passed in as children to the `Dropdown.Option` subcomponent. If no children are passed in the `Dropdown.Option`, the kit will render each option as text by default.
1
+ The Dropdown also allows for custom options that can be passed in as children to the `Dropdown.Option` subcomponent. If no children are passed to `Dropdown.Option`, the kit will render each option as text within a Body kit by default.
@@ -1,9 +1,7 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
  import { Dropdown } from '../..'
3
3
 
4
4
  const DropdownWithCustomPadding = (props) => {
5
- // eslint-disable-next-line no-unused-vars
6
- const [selectedOption, setSelectedOption] = useState();
7
5
 
8
6
  const options = [
9
7
  {
@@ -33,7 +31,6 @@ const [selectedOption, setSelectedOption] = useState();
33
31
  return (
34
32
  <div>
35
33
  <Dropdown
36
- onSelect={(selectedItem) => setSelectedOption(selectedItem)}
37
34
  options={options}
38
35
  {...props}
39
36
  >
@@ -0,0 +1,59 @@
1
+ import React from 'react'
2
+ import { Dropdown, useDropdown, Button } from '../../'
3
+
4
+ const DropdownWithExternalControl = (props) => {
5
+ const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
6
+
7
+ const options = [
8
+ {
9
+ label: "United States",
10
+ value: "United States",
11
+ areaCode: "+1",
12
+ icon: "🇺🇸",
13
+ id: "United-states"
14
+ },
15
+ {
16
+ label: "Canada",
17
+ value: "Canada",
18
+ areaCode: "+1",
19
+ icon: "🇨🇦",
20
+ id: "canada"
21
+ },
22
+ {
23
+ label: "Pakistan",
24
+ value: "Pakistan",
25
+ areaCode: "+92",
26
+ icon: "🇵🇰",
27
+ id: "pakistan"
28
+ }
29
+ ];
30
+
31
+ return (
32
+ <div>
33
+ <Button
34
+ data={{dropdown:'pb-dropdown-trigger'}}
35
+ marginBottom='sm'
36
+ onClick={() => setIsDropdownClosed(!isDropDownClosed)}
37
+ padding="none"
38
+ tabIndex={0}
39
+ variant="link"
40
+ >
41
+ {isDropDownClosed ? "Open Dropdown" : "Close Dropdown"}
42
+ </Button>
43
+
44
+ <Dropdown
45
+ isClosed={isDropDownClosed}
46
+ options={options}
47
+ {...props}
48
+ >
49
+ {options.map((option) => (
50
+ <Dropdown.Option key={option.id}
51
+ option={option}
52
+ />
53
+ ))}
54
+ </Dropdown>
55
+ </div>
56
+ )
57
+ }
58
+
59
+ export default DropdownWithExternalControl
@@ -0,0 +1,72 @@
1
+ import React, { useRef } from 'react'
2
+ import { Dropdown, useDropdown, CircleIconButton, Icon, Body, FlexItem, Flex } from '../..'
3
+
4
+ const DropdownWithHook = (props) => {
5
+ const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
6
+ const buttonRef = useRef(null);
7
+
8
+ const options = [
9
+ {
10
+ label: "United States",
11
+ value: "United States",
12
+ areaCode: "+1",
13
+ icon: "🇺🇸",
14
+ id: "United-states"
15
+ },
16
+ {
17
+ label: "Canada",
18
+ value: "Canada",
19
+ areaCode: "+1",
20
+ icon: "🇨🇦",
21
+ id: "canada"
22
+ },
23
+ {
24
+ label: "Pakistan",
25
+ value: "Pakistan",
26
+ areaCode: "+92",
27
+ icon: "🇵🇰",
28
+ id: "pakistan"
29
+ }
30
+ ];
31
+
32
+ return (
33
+ <div>
34
+ <CircleIconButton
35
+ htmlOptions={{ref: buttonRef}}
36
+ icon={"flag"}
37
+ onClick={() => setIsDropdownClosed(!isDropDownClosed)}
38
+ variant="secondary"
39
+ />
40
+ <Dropdown
41
+ isClosed={isDropDownClosed}
42
+ options={options}
43
+ triggerRef={buttonRef}
44
+ {...props}
45
+ >
46
+ {options.map((option) => (
47
+ <Dropdown.Option key={option.id}
48
+ option={option}
49
+ >
50
+ <>
51
+ <FlexItem>
52
+ <Flex paddingRight='md'>
53
+ <Icon icon={option.icon}
54
+ paddingRight="xs"
55
+ />
56
+ <Body text={option.label} />
57
+ </Flex>
58
+ </FlexItem>
59
+ <FlexItem>
60
+ <Body color="light"
61
+ text={option.areaCode}
62
+ />
63
+ </FlexItem>
64
+ </>
65
+ </Dropdown.Option>
66
+ ))}
67
+ </Dropdown>
68
+ </div>
69
+ )
70
+ }
71
+
72
+ export default DropdownWithHook
@@ -0,0 +1,39 @@
1
+ import React from 'react'
2
+ import { Dropdown } from '../..'
3
+
4
+ const DropdownDefault = (props) => {
5
+
6
+ const options = [
7
+ {
8
+ label: "United States",
9
+ value: "United States",
10
+ },
11
+ {
12
+ label: "Canada",
13
+ value: "Canada",
14
+ },
15
+ {
16
+ label: "Pakistan",
17
+ value: "Pakistan",
18
+ }
19
+ ];
20
+
21
+
22
+ return (
23
+ <div>
24
+ <Dropdown
25
+ label="Select a Country"
26
+ options={options}
27
+ {...props}
28
+ >
29
+ {options.map((option) => (
30
+ <Dropdown.Option key={option.id}
31
+ option={option}
32
+ />
33
+ ))}
34
+ </Dropdown>
35
+ </div>
36
+ )
37
+ }
38
+
39
+ export default DropdownDefault
@@ -0,0 +1 @@
1
+ The optional `label` prop takes a string value that if present will render that string as the label for the Dropdown.
@@ -3,10 +3,14 @@ examples:
3
3
 
4
4
  react:
5
5
  - dropdown_default: Default
6
+ - dropdown_subcomponent_structure: Subcomponent Structure
7
+ - dropdown_with_label: With Label
6
8
  - dropdown_with_custom_options: Custom Options
7
9
  - dropdown_with_custom_display: Custom Display
8
10
  - dropdown_with_custom_trigger: Custom Trigger
9
- - dropdown_with_autocomplete: Autocomplete
10
- - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
11
11
  - dropdown_with_custom_padding: Custom Padding for Dropdown Options
12
+ # - dropdown_with_autocomplete: Autocomplete
13
+ # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
14
+ # - dropdown_with_external_control: useDropdown Hook
15
+ # - dropdown_with_hook: useDropdown Hook with Any Trigger
12
16
 
@@ -4,4 +4,8 @@ export { default as DropdownWithCustomOptions } from './_dropdown_with_custom_op
4
4
  export { default as DropdownWithCustomTrigger } from './_dropdown_with_custom_trigger.jsx'
5
5
  export { default as DropdownWithAutocomplete } from './_dropdown_with_autocomplete.jsx'
6
6
  export { default as DropdownWithAutocompleteAndCustomDisplay } from './_dropdown_with_autocomplete_and_custom_display.jsx'
7
- export { default as DropdownWithCustomPadding } from './_dropdown_with_custom_padding.jsx'
7
+ export { default as DropdownWithCustomPadding } from './_dropdown_with_custom_padding.jsx'
8
+ export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
9
+ export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
10
+ export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
11
+ export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("flex") do %>
2
+ <%= pb_rails("progress_simple", props: { flex: "1", percent: 50 }) %>
3
+ <% end %>
@@ -0,0 +1,16 @@
1
+ import React from 'react'
2
+ import { Flex, ProgressSimple } from '../..'
3
+
4
+ const ProgressSimpleFlex = () => {
5
+ return (
6
+ <Flex>
7
+ <ProgressSimple
8
+ align="left"
9
+ flex="1"
10
+ percent={68}
11
+ />
12
+ </Flex>
13
+ )
14
+ }
15
+
16
+ export default ProgressSimpleFlex
@@ -0,0 +1 @@
1
+ When rendering a Progress Simple through within a Flex container, you must pass `flex="1"` to the kit itself so that it fills the available space
@@ -3,6 +3,7 @@ examples:
3
3
  rails:
4
4
  - progress_simple_default: Default
5
5
  - progress_simple_value: Setting Values
6
+ - progress_simple_flex: Within a Flex
6
7
  - progress_simple_width: Progress Bar Width
7
8
  - progress_simple_variants: Variants
8
9
  - progress_simple_muted: Muted
@@ -12,6 +13,7 @@ examples:
12
13
  react:
13
14
  - progress_simple_default: Default
14
15
  - progress_simple_value: Setting Values
16
+ - progress_simple_flex: Within a Flex
15
17
  - progress_simple_width: Progress Bar Width
16
18
  - progress_simple_variants: Variants
17
19
  - progress_simple_muted: Muted
@@ -2,6 +2,7 @@ export { default as ProgressSimpleAlign } from './_progress_simple_align.jsx'
2
2
  export { default as ProgressSimpleDefault } from './_progress_simple_default.jsx'
3
3
  export { default as ProgressSimpleMuted } from './_progress_simple_muted.jsx'
4
4
  export { default as ProgressSimpleValue } from './_progress_simple_value.jsx'
5
+ export { default as ProgressSimpleFlex } from './_progress_simple_flex.jsx'
5
6
  export { default as ProgressSimpleWidth } from './_progress_simple_width.jsx'
6
7
  export { default as ProgressSimpleVariants } from './_progress_simple_variants.jsx'
7
8
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { Flex, Radio } from '../../'
3
3
 
4
- const RadioAlignment = () => {
4
+ const RadioAlignment = (props) => {
5
5
  return (
6
6
  <Flex>
7
7
  <Radio
@@ -11,6 +11,7 @@ const RadioAlignment = () => {
11
11
  name="Group2"
12
12
  tabIndex={0}
13
13
  value="Power"
14
+ {...props}
14
15
  />
15
16
  <br />
16
17
  <Radio
@@ -20,6 +21,7 @@ const RadioAlignment = () => {
20
21
  marginRight="sm"
21
22
  name="Group2"
22
23
  value="Nitro"
24
+ {...props}
23
25
  />
24
26
  <br />
25
27
  <Radio
@@ -28,6 +30,7 @@ const RadioAlignment = () => {
28
30
  label="Google"
29
31
  name="Group2"
30
32
  value="Google"
33
+ {...props}
31
34
  />
32
35
  </Flex>
33
36
  )
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import Radio from '../_radio'
4
4
 
5
- const RadioDefault = () => {
5
+ const RadioDefault = (props) => {
6
6
  const ref = React.createRef()
7
7
 
8
8
  return (
@@ -13,6 +13,7 @@ const RadioDefault = () => {
13
13
  ref={ref}
14
14
  tabIndex={0}
15
15
  value="Power"
16
+ {...props}
16
17
  />
17
18
  <br />
18
19
  <Radio
@@ -20,6 +21,7 @@ const RadioDefault = () => {
20
21
  label="Nitro"
21
22
  name="Group2"
22
23
  value="Nitro"
24
+ {...props}
23
25
  />
24
26
  <br />
25
27
  <Radio
@@ -27,6 +29,7 @@ const RadioDefault = () => {
27
29
  label="Google"
28
30
  name="Group2"
29
31
  value="Google"
32
+ {...props}
30
33
  />
31
34
  </div>
32
35
  )
@@ -0,0 +1,26 @@
1
+ <%= pb_rails("flex", props: {orientation: "column"}) do %>
2
+ <%= pb_rails("flex/flex_item") do %>
3
+ <%= pb_rails("radio", props: {
4
+ text: "Disabled unselected",
5
+ input_options: {
6
+ tabindex: 0,
7
+ disabled: true,
8
+ },
9
+ margin_bottom: "xs",
10
+ name: "DisabledGroup",
11
+ value: "Disabled unselected",
12
+ }) %>
13
+ <% end %>
14
+ <%= pb_rails("flex/flex_item") do %>
15
+ <%= pb_rails("radio", props: {
16
+ text: "Disabled selected",
17
+ input_options: {
18
+ tabindex: 0,
19
+ disabled: true,
20
+ },
21
+ checked: true,
22
+ name: "DisabledGroup",
23
+ value: "Disabled selected"
24
+ }) %>
25
+ <% end %>
26
+ <% end %>