playbook_ui_docs 14.25.0 → 15.0.0.pre.alpha.PLAY1981sectionseparatorverticalchildren10469

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +16 -2
  4. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md +3 -2
  5. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.html.erb +12 -1
  6. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.jsx +26 -1
  7. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_rails.md +11 -0
  8. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_react.md +11 -0
  9. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.html.erb +5 -0
  10. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +24 -0
  11. data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
  12. data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
  13. data/app/pb_kits/playbook/pb_map/docs/_map_default.jsx +1 -1
  14. data/app/pb_kits/playbook/pb_map/docs/_map_with_custom_button.jsx +1 -1
  15. data/app/pb_kits/playbook/pb_map/docs/_map_with_plugin.jsx +1 -1
  16. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +0 -3
  17. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +23 -0
  18. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +45 -7
  19. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +3 -1
  20. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.html.erb +41 -0
  21. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.jsx +80 -0
  22. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.md +1 -0
  23. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +3 -0
  24. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  25. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.html.erb +1 -1
  26. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +1 -1
  27. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +1 -22
  28. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_without_pills.html.erb +2 -2
  30. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +14 -7
  31. data/dist/playbook-doc.js +2 -2
  32. metadata +9 -21
  33. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  34. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -41
  35. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  36. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +0 -78
  37. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -3
  38. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -26
  39. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +0 -20
  40. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +0 -59
  41. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  42. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +0 -61
  43. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +0 -24
  44. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  45. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +0 -54
  46. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  47. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  48. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +0 -99
  49. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -20
  50. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -7
  51. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.md +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17377883adedb4af5d2a6890fcec2cc8536538ff54885c300738fdd8a843689b
4
- data.tar.gz: a5a0317ddb43a680c0441ee41bba11d215c00f551ee1872b9bd717c7438083a0
3
+ metadata.gz: 2da117bbd2b5be0efda4c24ceceaf279f9b1fa98e1018fa0f8419d5568bbfba0
4
+ data.tar.gz: 19ad4cdc5bc9ba1ddcb2cff6e423de1f5e0f7b7256d386272febeab7fb31c3ad
5
5
  SHA512:
6
- metadata.gz: '08cbfc7cd58df427620018e446d6d0409ee034f039175088c9928a900a9eb94eaf43ce7f0042a2407e8cf8b84d70403ad316b917cf43143577579e62a2d21665'
7
- data.tar.gz: dd09288525d787eaee6e16a0afd3e97557d72b1cdafd67616d2b70389c81ce5843ce09f7858dab2b25beaefcc17530e94a90b7aa8a2820edc509343b95125f0b
6
+ metadata.gz: 832d673ea67b381c6a348ee91d56f42585276be8931320e4a9704dd6f0ffbb27d83d6002a4aef92a4fd661a913a3883cb04a23ef213848a97da9199001b205da
7
+ data.tar.gz: 8d042762776e477ee84416895ec88704c3323e942895b298c131e4528e8974cfd60f25f31f0ca9790e23f7bfefbdf75c2516864cf21f8482161db5c3c27f30c1
@@ -50,7 +50,7 @@
50
50
  <% end %>
51
51
 
52
52
  <%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
53
- <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "bg_dark" }) do %>
53
+ <%= pb_rails("card/card_header", props: { padding: "sm", header_color: "dark" }) do %>
54
54
  <%= pb_rails("body", props: { text: "Dark", dark: true }) %>
55
55
  <% end %>
56
56
  <%= pb_rails("card/card_body", props: { padding: "md" }) do %>
@@ -21,13 +21,27 @@
21
21
  let currentClass = okayLoadingButton.className;
22
22
  let cancelClass = cancelButton ? cancelButton.className : "";
23
23
 
24
+ okayLoadingButton.disabled = true;
25
+ okayLoadingButton.classList.add("pb_button_loading");
26
+ okayLoadingButton.classList.remove("pb_button_enabled");
27
+ okayLoadingButton.classList.add("pb_button_disabled");
28
+
29
+ if (cancelButton) {
30
+ cancelButton.disabled = true;
31
+ cancelButton.classList.remove("pb_button_enabled");
32
+ cancelButton.classList.add("pb_button_disabled");
33
+ }
34
+
24
35
  setTimeout(function() {
25
36
  okayLoadingButton.disabled = false;
26
- okayLoadingButton.className = currentClass.replace("_disabled_loading", "_enabled");
37
+ okayLoadingButton.classList.remove("pb_button_loading");
38
+ okayLoadingButton.classList.remove("pb_button_disabled");
39
+ okayLoadingButton.classList.add("pb_button_enabled");
27
40
 
28
41
  if (cancelButton) {
29
42
  cancelButton.disabled = false;
30
- cancelButton.className = cancelClass.replace("_disabled", "_enabled");
43
+ cancelButton.classList.remove("pb_button_disabled");
44
+ cancelButton.classList.add("pb_button_enabled");
31
45
  }
32
46
  }, 5000);
33
47
 
@@ -2,7 +2,8 @@
2
2
  | Name | Type | Description | Default | Values |
3
3
  | --- | ----------- | --------- | --------- | --------- |
4
4
  | **text** | `String` |`Value for the toast message` | `nil` | |
5
- | **variant** | `Variant` | `Determines the type pf toast message being displayed` | `.custom()` | `error`, `success`,
6
- `neutral`, `custom()` |
5
+ | **font** | `PBFont` |`Value for the toast message font style` | `.title4` | |
6
+ | **animatedIcon** | `AnyView` |`Value for the option to use an animated icon` | `nil` | |
7
+ | **variant** | `Variant` | `Determines the type pf toast message being displayed` | `.custom()` | `error` `success` `neutral` `custom()` |
7
8
  | **actionView** | `dismissAction` | Dismisses the toast message | `.default` | `default` `custom()` `withTimer()` |
8
9
  | **dismissAction** | `(() -> Void)` | `Triggers the dismiss action` | | |
@@ -1,4 +1,4 @@
1
- <%= pb_rails("title", props: {size: 4, text: "Row"}) %>
1
+ <%= pb_rails("title", props: {size: 4, text: "Gap"}) %>
2
2
  <br/>
3
3
  <div class="flex-doc-example">
4
4
  <%= pb_rails("flex", props:{ gap: "xxs", wrap:true}) do %>
@@ -31,3 +31,14 @@
31
31
  <%= pb_rails("flex/flex_item") do %>4<% end %>
32
32
  <% end %>
33
33
  </div>
34
+
35
+ <br/><br/>
36
+ <%= pb_rails("title", props: {size: 4, text: "Responsive"}) %>
37
+ <br/>
38
+ <div class="flex-doc-example">
39
+ <%= pb_rails("flex", props: { gap: { xs: "none", sm: "sm", md: "md", lg: "lg", xl: "xl" }, wrap: true }) do %>
40
+ <% 40.times do |i| %>
41
+ <%= pb_rails("flex/flex_item") do %> <%=i%> <% end %>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import Flex from '../../pb_flex/_flex'
3
3
  import FlexItem from '../../pb_flex/_flex_item'
4
+ import Title from '../../pb_title/_title'
4
5
 
5
6
  const FlexGap = (props) => {
6
7
  const count = () => {
@@ -13,6 +14,8 @@ const FlexGap = (props) => {
13
14
 
14
15
  return (
15
16
  <>
17
+ <Title size={4}>Gap</Title>
18
+ <br />
16
19
  <div className="flex-doc-example">
17
20
  <Flex
18
21
  gap="xxs"
@@ -27,8 +30,10 @@ const FlexGap = (props) => {
27
30
  </Flex>
28
31
  </div>
29
32
 
30
- <br />
33
+ <br /><br />
31
34
 
35
+ <Title size={4}>Column Gap</Title>
36
+ <br />
32
37
  <div className="flex-doc-example">
33
38
  <Flex
34
39
  columnGap="lg"
@@ -48,6 +53,9 @@ const FlexGap = (props) => {
48
53
  </FlexItem>
49
54
  </Flex>
50
55
  </div>
56
+ <br /><br />
57
+
58
+ <Title size={4}>Row Gap</Title>
51
59
  <br />
52
60
  <div className="flex-doc-example">
53
61
  <Flex
@@ -69,6 +77,23 @@ const FlexGap = (props) => {
69
77
  </FlexItem>
70
78
  </Flex>
71
79
  </div>
80
+
81
+ <br /><br />
82
+ <Title size={4}>Responsive</Title>
83
+ <br />
84
+ <div className="flex-doc-example">
85
+ <Flex
86
+ gap={{ xs: "none", sm: "sm", md: "md", lg: "lg", xl: "xl" }}
87
+ wrap
88
+ {...props}
89
+ >
90
+ {count().map((v, key) => (
91
+ <FlexItem key={key}>
92
+ {v}
93
+ </FlexItem>
94
+ ))}
95
+ </Flex>
96
+ </div>
72
97
  </>
73
98
  )
74
99
  }
@@ -0,0 +1,11 @@
1
+ ##### Prop
2
+
3
+ `gap` | `row_gap` | `column_gap` | **Type**: String | Hash | **Values**: xxs | xs | sm | md | lg | xl | none
4
+
5
+ Setting the gap prop sets the `row_gap` and the `column_gap` props to the same size and creates equal space within a flex container.
6
+
7
+ Setting the `row_gap` prop creates space between rows in a flex container.
8
+
9
+ Setting the `column_gap` prop creates space between columns in a flex container.
10
+
11
+ You can also set responsive values by passing a hash with device sizes and values.
@@ -0,0 +1,11 @@
1
+ ##### Prop
2
+
3
+ `gap` | `rowGap` | `columnGap` | **Type**: String | Object | **Values**: xxs | xs | sm | md | lg | xl | none
4
+
5
+ Setting the gap prop sets the `rowGap` and the `columnGap` props to the same size and creates equal space within a flex container.
6
+
7
+ Setting the `rowGap` prop creates space between rows in a flex container.
8
+
9
+ Setting the `columnGap` prop creates space between columns in a flex container.
10
+
11
+ You can also set responsive values by passing an object with device sizes and values.
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("loading_inline", props: {text: "Dotted Spinner", variant: "dotted"}) %>
2
+
3
+ <br/>
4
+
5
+ <%= pb_rails("loading_inline", props: {text: "Solid Spinner", variant: "solid"}) %>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import { LoadingInline } from 'playbook-ui'
3
+
4
+ const LoadingInlineVariant = (props) => {
5
+ return (
6
+ <div>
7
+ <LoadingInline
8
+ text=" Dotted Spinner"
9
+ variant="dotted"
10
+ {...props}
11
+ />
12
+
13
+ <br />
14
+
15
+ <LoadingInline
16
+ text=" Solid Spinner"
17
+ variant="solid"
18
+ {...props}
19
+ />
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default LoadingInlineVariant
@@ -3,9 +3,11 @@ examples:
3
3
  rails:
4
4
  - loading_inline_default: Default
5
5
  - loading_inline_custom: Custom Text
6
+ - loading_inline_variant: Variant
6
7
 
7
8
 
8
9
 
9
10
  react:
10
11
  - loading_inline_default: Default
11
12
  - loading_inline_custom: Custom Text
13
+ - loading_inline_variant: Variant
@@ -1,2 +1,3 @@
1
1
  export { default as LoadingInlineDefault } from './_loading_inline_default.jsx'
2
2
  export { default as LoadingInlineCustom } from './_loading_inline_custom.jsx'
3
+ export { default as LoadingInlineVariant } from './_loading_inline_variant.jsx'
@@ -26,7 +26,7 @@ const MapDefault = (props) => {
26
26
  new maplibregl.Marker({
27
27
  color: mapTheme.marker,
28
28
  }).setLngLat(defaultPosition)
29
- .setPopup(new maplibregl.Popup({closeButton: false}).setHTML(`<h4 class="pb_title_kit_size_4">Hello World!</h4>`)) // add popup
29
+ .setPopup(new maplibregl.Popup({closeButton: false}).setHTML(`<h4 class="pb_title_kit pb_title_4">Hello World!</h4>`)) // add popup
30
30
  .addTo(map);
31
31
 
32
32
  // disable map zoom when using scroll
@@ -29,7 +29,7 @@ const MapWithCustomButton = (props) => {
29
29
  new maplibregl.Marker({
30
30
  color: mapTheme.marker,
31
31
  }).setLngLat(defaultPosition)
32
- .setPopup(new maplibregl.Popup({closeButton: false}).setHTML(`<h4 class="pb_title_kit_size_4">Hello World!</h4>`)) // add popup
32
+ .setPopup(new maplibregl.Popup({closeButton: false}).setHTML(`<h4 class="pb_title_kit pb_title_4">Hello World!</h4>`)) // add popup
33
33
  .addTo(map);
34
34
 
35
35
  // disable map zoom when using scroll
@@ -26,7 +26,7 @@ const MapWithPlugin = (props) => {
26
26
  new maplibregl.Marker({
27
27
  color: mapTheme.marker,
28
28
  }).setLngLat(defaultPosition)
29
- .setPopup(new maplibregl.Popup({className: 'map_popup', closeButton: false}).setHTML(`<h4 class="pb_title_kit_size_4">Hello World!</h4>`)) // add popup
29
+ .setPopup(new maplibregl.Popup({closeButton: false}).setHTML(`<h4 class="pb_title_kit pb_title_4">Hello World!</h4>`)) // add popup
30
30
  .addTo(map);
31
31
 
32
32
  //add maplibre default zoom controls
@@ -19,7 +19,6 @@ const RadioReactHook = () => {
19
19
  paddingRight="lg"
20
20
  >
21
21
  <Radio
22
- alignment="left"
23
22
  label="Small"
24
23
  marginBottom='sm'
25
24
  name="size"
@@ -28,7 +27,6 @@ const RadioReactHook = () => {
28
27
  />
29
28
  <br />
30
29
  <Radio
31
- alignment="left"
32
30
  label="Medium"
33
31
  marginBottom='sm'
34
32
  name="size"
@@ -37,7 +35,6 @@ const RadioReactHook = () => {
37
35
  />
38
36
  <br />
39
37
  <Radio
40
- alignment="left"
41
38
  label="Large"
42
39
  marginBottom='sm'
43
40
  name="size"
@@ -11,4 +11,27 @@
11
11
  padding_right: "xs"
12
12
  }) %>
13
13
  <% end %>
14
+ <% end %>
15
+
16
+ <%= pb_rails("flex", props: { classname: "flex-container", margin_top: "lg", vertical: "stretch" }) do %>
17
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
19
+ <% end %>
20
+ <%= pb_rails("section_separator", props: { orientation: "vertical" }) do %>
21
+ <%= pb_rails("card", props: {
22
+ border_radius: "rounded",
23
+ justify_content: "center",
24
+ padding: "none"
25
+ }) do %>
26
+ <%= pb_rails("caption", props: {
27
+ text: "TODAY",
28
+ size: "xs",
29
+ padding_left: "xs",
30
+ padding_right: "xs"
31
+ }) %>
32
+ <% end %>
33
+ <% end %>
34
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
35
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
36
+ <% end %>
14
37
  <% end %>
@@ -2,8 +2,25 @@ import React from 'react'
2
2
  import Card from '../../pb_card/_card'
3
3
  import Caption from '../../pb_caption/_caption'
4
4
  import SectionSeparator from '../../pb_section_separator/_section_separator'
5
+ import Flex from '../../pb_flex/_flex'
6
+ import FlexItem from '../../pb_flex/_flex_item'
5
7
 
6
- const children = (
8
+ const childrenHorizontal = (
9
+ <Card
10
+ borderRadius="rounded"
11
+ justifyContent="center"
12
+ padding="none"
13
+ >
14
+ <Caption
15
+ paddingLeft="xs"
16
+ paddingRight="xs"
17
+ size="xs"
18
+ text="TODAY"
19
+ />
20
+ </Card>
21
+ )
22
+
23
+ const childrenVertical = (
7
24
  <Card
8
25
  borderRadius="rounded"
9
26
  justifyContent="center"
@@ -20,12 +37,33 @@ const children = (
20
37
 
21
38
  const SectionSeparatorChildren = (props) => {
22
39
  return (
23
- <SectionSeparator
24
- {...props}
25
- lineStyle='dashed'
26
- >
27
- {children}
28
- </SectionSeparator>
40
+ <>
41
+ <SectionSeparator
42
+ {...props}
43
+ lineStyle='dashed'
44
+ >
45
+ {childrenHorizontal}
46
+ </SectionSeparator>
47
+ <Flex
48
+ inline="flex-container"
49
+ marginTop="lg"
50
+ vertical="stretch"
51
+ >
52
+ <FlexItem>
53
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
54
+ </FlexItem>
55
+ <SectionSeparator
56
+ orientation="vertical"
57
+ {...props}
58
+ >
59
+ {childrenVertical}
60
+ </SectionSeparator>
61
+ <FlexItem>
62
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
63
+ </FlexItem>
64
+ </Flex>
65
+ </>
66
+
29
67
  )
30
68
  }
31
69
 
@@ -5,7 +5,9 @@ import Detail from '../../pb_detail/_detail'
5
5
  import Icon from '../../pb_icon/_icon'
6
6
 
7
7
  const children = (
8
- <Flex padding="xs">
8
+ <Flex alignItems="center"
9
+ padding="xs"
10
+ >
9
11
  <Icon color="primary"
10
12
  icon="arrow-down"
11
13
  />
@@ -0,0 +1,41 @@
1
+ <%= pb_rails("text_input", props: {
2
+ autocomplete: false,
3
+ label: "autocomplete='off'",
4
+ name: "firstName",
5
+ placeholder: "Enter first name",
6
+ }) %>
7
+
8
+ <%= pb_rails("text_input", props: {
9
+ label: "no autocomplete attribute (let browser decide- basically 'on')",
10
+ name: "lastName",
11
+ placeholder: "Enter last name"
12
+ }) %>
13
+
14
+ <%= pb_rails("text_input", props: {
15
+ autocomplete: true,
16
+ label: "autocomplete='on'",
17
+ name: "phone",
18
+ type: "phone",
19
+ placeholder: "Enter phone number"
20
+ }) %>
21
+
22
+ <%= pb_rails("body", props: { margin_bottom: "sm" }) do %>
23
+ The following have the same autocomplete attributes (email), but have
24
+ different name attributes (email and emailAlt). Many browsers will
25
+ open autocomplete based on name attributes instead of autocomplete:
26
+ <% end %>
27
+
28
+ <%= pb_rails("text_input", props: {
29
+ autocomplete: "email",
30
+ label: "autocomplete='email' name='email'",
31
+ name: "email",
32
+ placeholder: "Enter email address"
33
+ }) %>
34
+
35
+ <%= pb_rails("text_input", props: {
36
+ autocomplete: "email",
37
+ label: "autocomplete='email' name='emailAlt'",
38
+ name: "emailAlt",
39
+ type: "email",
40
+ placeholder: "Enter email address"
41
+ }) %>
@@ -0,0 +1,80 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import TextInput from '../../pb_text_input/_text_input'
4
+ import Body from '../../pb_body/_body'
5
+
6
+
7
+ const TextInputAutocomplete = (props) => {
8
+ const [formFields, setFormFields] = useState({
9
+ firstName: "",
10
+ lastName: "",
11
+ phone: "",
12
+ emailTest: "",
13
+ email: "",
14
+ });
15
+
16
+ const handleOnChangeFormField = ({ target }) => {
17
+ const { name, value } = target;
18
+ setFormFields({ ...formFields, [name]: value });
19
+ };
20
+
21
+ return (
22
+ <div>
23
+ <TextInput
24
+ autoComplete={false}
25
+ label="autocomplete='off'"
26
+ name="firstName"
27
+ onChange={handleOnChangeFormField}
28
+ placeholder="Enter first name"
29
+ value={formFields.firstName}
30
+ {...props}
31
+ />
32
+ <TextInput
33
+ label="no autocomplete attribute (let browser decide- basically 'on')"
34
+ name="lastName"
35
+ onChange={handleOnChangeFormField}
36
+ placeholder="Enter last name"
37
+ value={formFields.lastName}
38
+ {...props}
39
+ />
40
+ <TextInput
41
+ autoComplete
42
+ label="autocomplete='on'"
43
+ name="phone"
44
+ onChange={handleOnChangeFormField}
45
+ placeholder="Enter phone number"
46
+ type="phone"
47
+ value={formFields.phone}
48
+ {...props}
49
+ />
50
+ <Body marginBottom="sm">
51
+ The following have the same autocomplete attributes (email), but have
52
+ different name attributes (email and emailAlt). Many browsers will
53
+ open autocomplete based on name attributes instead of autocomplete:
54
+ </Body>
55
+ <TextInput
56
+ autoComplete="email"
57
+ label="autocomplete='email' name='email'"
58
+ name="email"
59
+ onChange={handleOnChangeFormField}
60
+ placeholder="Enter email address"
61
+ type="email"
62
+ value={formFields.email}
63
+ {...props}
64
+ />
65
+ <TextInput
66
+ autoComplete="email"
67
+ label="autocomplete='email' name='emailAlt'"
68
+ marginTop="sm"
69
+ name="emailTest"
70
+ onChange={handleOnChangeFormField}
71
+ placeholder="Enter email address"
72
+ type="email"
73
+ value={formFields.emailTest}
74
+ {...props}
75
+ />
76
+ </div>
77
+ );
78
+ };
79
+
80
+ export default TextInputAutocomplete;
@@ -0,0 +1 @@
1
+ Set this prop to `false` or `"off"` to remove autocomplete from text inputs. You can also set it to a string, but browsers will often defer to other attributes like `name`.
@@ -9,6 +9,8 @@ examples:
9
9
  - text_input_no_label: No Label
10
10
  - text_input_options: Input Options
11
11
  - text_input_mask: Mask
12
+ - text_input_autocomplete: Autocomplete
13
+
12
14
  react:
13
15
  - text_input_default: Default
14
16
  - text_input_error: With Error
@@ -19,6 +21,7 @@ examples:
19
21
  - text_input_no_label: No Label
20
22
  - text_input_mask: Mask
21
23
  - text_input_sanitize: Sanitized Masked Input
24
+ - text_input_autocomplete: Autocomplete
22
25
 
23
26
 
24
27
  swift:
@@ -7,3 +7,4 @@ export { default as TextInputInline } from './_text_input_inline.jsx'
7
7
  export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
8
8
  export { default as TextInputMask } from './_text_input_mask.jsx'
9
9
  export { default as TextInputSanitize } from './_text_input_sanitize.jsx'
10
+ export { default as TextInputAutocomplete } from './_text_input_autocomplete.jsx'
@@ -7,7 +7,7 @@
7
7
  ]
8
8
  %>
9
9
 
10
- <%= pb_rails("typeahead", props: { id: "typeahead-pills-example1", default_options: [options.first], options: options, label: "Colors", name: :foo, pills: true }) %>
10
+ <%= pb_rails("typeahead", props: { id: "typeahead-pills-example1", default_options: [options.first], options: options, label: "Products", name: :foo, pills: true }) %>
11
11
 
12
12
  <%= pb_rails("button", props: {id: "clear-pills", text: "Clear All Options", variant: "secondary"}) %>
13
13
 
@@ -13,7 +13,7 @@ const TypeaheadWithPills = (props) => {
13
13
  <>
14
14
  <Typeahead
15
15
  isMulti
16
- label="Colors"
16
+ label="Products"
17
17
  options={options}
18
18
  placeholder=""
19
19
  {...props}
@@ -7,25 +7,4 @@
7
7
  ]
8
8
  %>
9
9
 
10
- <%= pb_rails("typeahead", props: { id: "typeahead-pills-example1", pill_color: "neutral", default_options: [options.first], options: options, label: "Colors", name: :foo, pills: true }) %>
11
-
12
- <%= pb_rails("button", props: {id: "clear-pills", text: "Clear All Options", variant: "secondary"}) %>
13
-
14
- <!-- This section is an example of the available JavaScript event hooks -->
15
- <%= javascript_tag defer: "defer" do %>
16
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-select", function(event) {
17
- console.log('Option selected')
18
- console.dir(event.detail)
19
- })
20
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-remove", function(event) {
21
- console.log('Option removed')
22
- console.dir(event.detail)
23
- })
24
- document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-clear", function() {
25
- console.log('All options cleared')
26
- })
27
-
28
- document.querySelector('#clear-pills').addEventListener('click', function() {
29
- document.dispatchEvent(new CustomEvent('pb-typeahead-kit-typeahead-pills-example1:clear'))
30
- })
31
- <% end %>
10
+ <%= pb_rails("typeahead", props: { id: "typeahead-pills-example2", pill_color: "neutral", options: options, label: "Products", name: :foo, pills: true }) %>
@@ -13,7 +13,7 @@ const TypeaheadWithPills = (props) => {
13
13
  <>
14
14
  <Typeahead
15
15
  isMulti
16
- label="Colors"
16
+ label="Products"
17
17
  options={options}
18
18
  pillColor="neutral"
19
19
  placeholder=""
@@ -9,9 +9,9 @@
9
9
 
10
10
  <%= pb_rails("typeahead", props: {
11
11
  id: "typeahead-without-pills-example1",
12
- placeholder: "All Colors",
12
+ placeholder: "All Products",
13
13
  options: options,
14
- label: "Colors",
14
+ label: "Products",
15
15
  name: :foo,
16
16
  is_multi: false
17
17
  })
@@ -1,11 +1,18 @@
1
1
  ### Props
2
2
  | Name | Type | Description | Default | Values |
3
3
  | --- | ----------- | --------- | --------- | --------- |
4
- | **name** | `String` | Sets the User's name | | |
4
+ | **name** | `String` | Sets the User's name | `""` | |
5
+ | **nameFont** | `Typography` | Font styling for the user's name | `.init(font: .title4, variant: .bold)` | |
6
+ | **image** | `Image?` | Sets image for the avatar | `nil` | |
7
+ | **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.vertical` |
8
+ | **size** | `Size` | Changes the size of the User | `.medium` | `.xxSmall` `.xSmall` `.small` `.medium` `.large` `.xLarge` |
9
+ | **territory** | `String?` | Adds the User's territory | `nil` | |
10
+ | **title** | `String?` | Adds a title | `nil` | |
11
+ | **subtitle** | `AnyView?` | Adds a subtitle view | `nil` | |
12
+ | **status** | `PBOnlineStatus.Status?` | An indicator for the current status of the user | `nil` | `.online` `.away` `.offline` |
5
13
  | **displayAvatar** | `Bool` | Displays the User's avatar | `true` | `true` `false` |
6
- | **image** | `Image` | Sets image for the avatar | | |
7
- | **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.verticle` |
8
- | **size** | `UserAvatarSize` | Changes the size of the User | `.medium` | `.small` `.medium` `.large` |
9
- | **territory** | `String` | Adds the User's territory | | |
10
- | **title** | `String` | Adds a title | | |
11
- | **status** | `PBAvatar.PresenceStatus?` | An idicator for the current status of the user | `.none` | `.online` `.away` `.offline` |
14
+ | **territoryTitleFont** | `PBFont` | Font for territory and title text | `.subcaption` | `.title1` `.body` `.caption` `.subcaption` `.badgeText` `.title4` |
15
+ | **isActive** | `Bool` | Sets whether the user is active | `true` | `true` `false` |
16
+ | **hasInactiveBadge** | `Bool` | Shows inactive badge when user is not active | `false` | `true` `false` |
17
+ | **spacing** | `CGFloat` | Controls spacing between elements | `Spacing.small` | `.none` `.xxSmall` `.xSmall` `.small` `.medium` `.large` `.xLarge` |
18
+