playbook_ui 14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 → 14.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  5. data/app/pb_kits/playbook/pb_button/button.html.erb +3 -2
  6. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +6 -1
  7. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +6 -2
  8. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -7
  9. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +14 -9
  10. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +11 -6
  11. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +14 -8
  12. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -3
  13. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -12
  14. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +1 -5
  15. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +3 -8
  16. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +1 -6
  17. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -21
  18. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -13
  19. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -7
  20. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +0 -2
  21. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -4
  22. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
  23. data/dist/chunks/{_typeahead-BNULwihE.js → _typeahead-C2iCBqxQ.js} +1 -1
  24. data/dist/chunks/{_weekday_stacked-BKWemDAe.js → _weekday_stacked-E-5KcEkc.js} +1 -1
  25. data/dist/chunks/lazysizes-DHz07jlL.js +1 -0
  26. data/dist/chunks/vendor.js +1 -1
  27. data/dist/playbook-doc.js +1 -1
  28. data/dist/playbook-rails-react-bindings.js +1 -1
  29. data/dist/playbook-rails.js +1 -1
  30. data/lib/playbook/version.rb +2 -2
  31. metadata +9 -11
  32. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +0 -33
  33. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +0 -1
  34. data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
  35. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props_react.md → _advanced_table_table_props.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4151d717eddca9843cbee0cfc1bb9749f739689a6b2e59dc4008a54f93abeba
4
- data.tar.gz: 96d539dc7f12d61d3a1ef76e6018731f7f244ef9972e21d81c404e85a292405d
3
+ metadata.gz: 684dfcc3e0b2d271c0ef3992c66895d5bf59f7814908e97b4ba0a6a2fd3a35c6
4
+ data.tar.gz: 8cff029a4d16a46c0d11292767c7faed0fed272b1102316c5c6988289b145f9b
5
5
  SHA512:
6
- metadata.gz: c4ca0515955bc7b8f7b2e1b235e3361e6e9cfe8ef38e7e2969aa99196439399ba473b0e7d75cab6ad617813bff735c00d9782762d57090cbf45d2b13efa2dd18
7
- data.tar.gz: 26428d2ec5528dcdf8b5d7efb8935e4efe7726c848502bc54847f1bc251ac06d30df8de8a1b32567b7f851a73789c57a51f4141dbc7f2179f00a2b6f67084c9c
6
+ metadata.gz: cf605e9ea95eca375c9efc8a112416d373958b9c5b0cd2bb4ea63495a6e6a97e22776d372d96894d2060c0c2c02ee671943390b06dbf0b35dded14de3b531a09
7
+ data.tar.gz: 8c2b6329d1a8ed96313eb9cacae23f86c2801ebdf4fe24de3070b969b79758753ca5f7e2507956482e4560fac781f6dc443f55cf0844ea749f2e7dcd26b1c92e
@@ -1,5 +1,5 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }.merge(object.table_props)) do %>
2
+ <%= pb_rails("table", props: { size: "sm", data_table: true, number_spacing:"tabular", responsive:"none", dark: dark }) do %>
3
3
  <% if content.present? %>
4
4
  <% content.presence %>
5
5
  <% else %>
@@ -13,8 +13,6 @@ module Playbook
13
13
  prop :responsive, type: Playbook::Props::Enum,
14
14
  values: %w[none scroll],
15
15
  default: "none"
16
- prop :table_props, type: Playbook::Props::HashProp,
17
- default: {}
18
16
 
19
17
  def classname
20
18
  generate_classname("pb_advanced_table", responsive_classname, separator: " ")
@@ -3,7 +3,6 @@ examples:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
5
  - advanced_table_collapsible_trail_rails: Collapsible Trail
6
- - advanced_table_table_props: Table Props
7
6
  - advanced_table_beta_sort: Enable Sorting
8
7
  - advanced_table_custom_cell_rails: Custom Components for Cells
9
8
  - advanced_table_column_headers: Multi-Header Columns
@@ -1,5 +1,6 @@
1
- <%= pb_content_tag(object.tag,
2
- object.tag == "button" ? object.options : object.link_options) do %>
1
+ <%= content_tag(object.tag,
2
+ object.tag == "button" ? object.options : object.link_options,
3
+ **combined_html_options) do %>
3
4
  <% if object.variant === "reaction" %>
4
5
  <% if icon && object.valid_emoji(object.icon) %>
5
6
  <%= pb_rails("flex", props:{ align: "center" }) do %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag(:label) do %>
1
+ <%= content_tag(:label, aria: object.aria,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options
6
+ ) do %>
2
7
  <%= content.presence || object.input %>
3
8
  <% if object.indeterminate %>
4
9
  <span data-pb-checkbox-icon-span="true" class="pb_checkbox_indeterminate">
@@ -1,5 +1,9 @@
1
- <%= pb_content_tag(:div,
2
- class: object.classname + object.error_class) do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname + object.error_class,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
3
7
  <div class="input_wrapper">
4
8
  <% if content.present? %>
5
9
  <%= content %>
@@ -1,14 +1,19 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% if object.label.present? %>
3
8
  <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
4
9
  <% end %>
5
10
  <div class="dropdown_wrapper<%= error_class %>" style="position: relative">
6
- <input
7
- data-default-value="<%= input_default_value %>"
8
- id="dropdown-selected-option"
9
- name="<%= object.name %>"
10
- style="display: none"
11
- <%= object.required ? "required" : ""%>
11
+ <input
12
+ data-default-value="<%= input_default_value %>"
13
+ id="dropdown-selected-option"
14
+ name="<%= object.name %>"
15
+ style="display: none"
16
+ <%= object.required ? "required" : ""%>
12
17
  />
13
18
  <% if content.present? %>
14
19
  <%= content.presence %>
@@ -1,15 +1,20 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("list", props: {ordered: false, borderless: false}) do %>
3
- <% if content.present? %>
8
+ <% if content.present? %>
4
9
  <%= content.presence %>
5
- <% else %>
10
+ <% else %>
6
11
  <%= pb_rails("list/item", props: {
7
- display: "flex",
8
- justify_content: "center",
9
- padding:"xs",
10
- }) do %>
12
+ display: "flex",
13
+ justify_content: "center",
14
+ padding:"xs",
15
+ }) do %>
11
16
  <%= pb_rails("body", props: {text: "No option"}) %>
12
17
  <% end %>
13
18
  <% end %>
14
- <% end %>
15
- <% end %>
19
+ <% end %>
20
+ <% end %>
@@ -1,10 +1,15 @@
1
- <%= pb_content_tag(:div, id: object.option[:id]) do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.option[:id],
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("list/item", props: {
3
- display: "flex",
4
- justify_content: "center",
5
- padding:"none",
8
+ display: "flex",
9
+ justify_content: "center",
10
+ padding:"none",
6
11
  cursor: "pointer"
7
- }) do %>
12
+ }) do %>
8
13
  <div class="dropdown_option_wrapper">
9
14
  <% if content.present? %>
10
15
  <%= content.presence %>
@@ -13,4 +18,4 @@
13
18
  <% end %>
14
19
  </div>
15
20
  <% end %>
16
- <% end %>
21
+ <% end %>
@@ -1,16 +1,21 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% if content.present? %>
3
8
  <div style="display: inline-block" tabindex="0" data-dropdown-custom-trigger>
4
9
  <%= content.presence %>
5
10
  </div>
6
11
  <% else %>
7
12
  <%= pb_rails("flex", props: {
8
- align: "center",
9
- border_radius:"lg",
10
- classname: object.trigger_wrapper_classes,
11
- cursor: "pointer",
12
- justify: "between",
13
- padding_x:"sm",
13
+ align: "center",
14
+ border_radius:"lg",
15
+ classname: object.trigger_wrapper_classes,
16
+ cursor: "pointer",
17
+ justify: "between",
18
+ padding_x:"sm",
14
19
  padding_y:"xs",
15
20
  html_options: {tabindex:"0"}
16
21
  }) do %>
@@ -18,7 +23,7 @@
18
23
  <%= pb_rails("flex", props: {align: "center"}) do %>
19
24
  <% if object.custom_display.present? %>
20
25
  <%= pb_rails("flex", props: {align: "center"}) do %>
21
- <div id="dropdown_trigger_custom_display" style="display: none;">
26
+ <div id="dropdown_trigger_custom_display" style="display: none;">
22
27
  <%= object.custom_display %>
23
28
  </div>
24
29
  <%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display"}) %>
@@ -35,3 +40,4 @@
35
40
  <% end %>
36
41
  <% end %>
37
42
  <% end %>
43
+
@@ -42,8 +42,8 @@ type TypeaheadProps = {
42
42
  id?: string,
43
43
  label?: string,
44
44
  loadOptions?: string | Noop,
45
- getOptionLabel?: string | (() => string),
46
- getOptionValue?: string | (() => string),
45
+ getOptionLabel?: string | (() => any),
46
+ getOptionValue?: string | (() => any),
47
47
  name?: string,
48
48
  marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
49
49
  pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
@@ -109,7 +109,6 @@ const Typeahead = ({
109
109
  multiKit: '',
110
110
  onCreateOption: null as null,
111
111
  plusIcon: false,
112
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
113
112
  onMultiValueClick: (_option: SelectValueType): any => undefined,
114
113
  pillColor: pillColor,
115
114
  ...props,
@@ -1,24 +1,16 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type ClearContainerProps = {
5
- children: React.ReactNode,
6
- selectProps?: {
7
- id: string,
8
- },
9
- clearValue: () => void,
10
- }
11
-
12
- const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
4
+ const ClearContainer = (props: any) => {
13
5
  const { selectProps, clearValue } = props
14
6
  useEffect(() => {
15
7
  document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
16
- }, [clearValue, selectProps.id])
8
+ }, [true])
17
9
 
18
10
  return (
19
11
  <components.ClearIndicator
20
- className="clear_indicator"
21
- {...props}
12
+ className="clear_indicator"
13
+ {...props}
22
14
  />
23
15
  )
24
16
  }
@@ -5,11 +5,7 @@ import Flex from '../../pb_flex/_flex'
5
5
  import TextInput from '../../pb_text_input/_text_input'
6
6
 
7
7
  type Props = {
8
- selectProps: {
9
- dark?: boolean,
10
- label: string,
11
- error?: string,
12
- },
8
+ selectProps: any,
13
9
  }
14
10
 
15
11
  const TypeaheadControl = (props: Props) => (
@@ -1,15 +1,10 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type IndicatorsContainerProps = {
5
- children: React.ReactNode,
6
- }
7
-
8
-
9
- const IndicatorsContainer = (props: IndicatorsContainerProps): React.ReactElement => (
4
+ const IndicatorsContainer = (props: any) => (
10
5
  <components.IndicatorsContainer
11
- className="text_input_indicators"
12
- {...props}
6
+ className="text_input_indicators"
7
+ {...props}
13
8
  />
14
9
  )
15
10
 
@@ -1,12 +1,7 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type MenuListProps = {
5
- children: React.ReactNode,
6
- footer: React.ReactNode,
7
- }
8
-
9
- const MenuList = (props: MenuListProps): React.ReactElement => {
4
+ const MenuList = (props: any) => {
10
5
  return (
11
6
  <components.MenuList {...props}>
12
7
  {props.children}
@@ -3,22 +3,7 @@ import { components } from 'react-select'
3
3
 
4
4
  import User from '../../pb_user/_user'
5
5
 
6
- type OptionProps = {
7
- children: React.ReactNode,
8
- label?: string,
9
- data: {
10
- imageUrl?: string,
11
- },
12
- selectProps: {
13
- dark?: boolean,
14
- valueComponent?: (data: {
15
- imageUrl?: string,
16
- }) => React.ReactNode,
17
- },
18
- }
19
-
20
-
21
- const Option = (props: OptionProps): React.ReactElement => {
6
+ const Option = (props: any) => {
22
7
  const {
23
8
  imageUrl,
24
9
  } = props.data
@@ -29,11 +14,11 @@ const Option = (props: OptionProps): React.ReactElement => {
29
14
  <>
30
15
  {!valueComponent && imageUrl &&
31
16
  <User
32
- align="left"
33
- avatarUrl={imageUrl}
34
- dark={props.selectProps.dark}
35
- name={props.label}
36
- orientation="horizontal"
17
+ align="left"
18
+ avatarUrl={imageUrl}
19
+ dark={props.selectProps.dark}
20
+ name={props.label}
21
+ orientation="horizontal"
37
22
  />
38
23
  }
39
24
 
@@ -4,26 +4,19 @@ import { components } from 'react-select'
4
4
  import Flex from '../../pb_flex/_flex'
5
5
  import Icon from '../../pb_icon/_icon'
6
6
 
7
- type PlaceholderProps = {
8
- children: React.ReactNode,
9
- selectProps: {
10
- plusIcon?: boolean,
11
- },
12
- }
13
-
14
- const Placeholder = (props: PlaceholderProps): React.ReactElement => (
7
+ const Placeholder = (props: any) => (
15
8
  <>
16
9
  <Flex
17
- align="center"
18
- className="placeholder"
10
+ align="center"
11
+ className="placeholder"
19
12
  >
20
13
  <components.IndicatorsContainer
21
- {...props}
14
+ {...props}
22
15
  />
23
16
  {props.selectProps.plusIcon &&
24
17
  <Icon
25
- className="typeahead-plus-icon"
26
- icon="plus"
18
+ className="typeahead-plus-icon"
19
+ icon="plus"
27
20
  />
28
21
  }
29
22
  </Flex>
@@ -1,14 +1,10 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- type ValueContainerProps = {
5
- children: React.ReactNode,
6
- }
7
-
8
- const ValueContainer = (props: ValueContainerProps): React.ReactElement => (
4
+ const ValueContainer = (props: any) => (
9
5
  <components.ValueContainer
10
- className="text_input_value_container"
11
- {...props}
6
+ className="text_input_value_container"
7
+ {...props}
12
8
  />
13
9
  )
14
10
 
@@ -1,5 +1,3 @@
1
- /* eslint-disable react/no-multi-comp */
2
-
3
1
  import React, { useState } from 'react'
4
2
 
5
3
  import {
@@ -45,7 +45,8 @@ const promiseOptions = (inputValue) =>
45
45
 
46
46
  const TypeaheadWithPillsAsync = (props) => {
47
47
  const [users, setUsers] = useState([])
48
-
48
+ const handleOnChange = (value) => setUsers(formatUsers(value))
49
+ const formatValue = (users) => formatUsers(users)
49
50
  const formatUsers = (users) => {
50
51
  const results = () => (users.map((user) => {
51
52
  if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
@@ -57,9 +58,6 @@ const TypeaheadWithPillsAsync = (props) => {
57
58
  return results()
58
59
  }
59
60
 
60
- const handleOnChange = (value) => setUsers(formatUsers(value))
61
- const formatValue = (users) => formatUsers(users)
62
-
63
61
  return (
64
62
  <>
65
63
  {users && users.length > 0 && (
@@ -83,13 +83,13 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
83
83
  onChange={handleOnChange}
84
84
  onMultiValueClick={handleOnMultiValueClick}
85
85
  placeholder="type the name of a Github user"
86
- valueComponent={({imageUrl, label, territory, type}) => (
86
+ valueComponent={(props) => (
87
87
  <User
88
88
  avatar
89
- avatarUrl={imageUrl}
90
- name={label}
91
- territory={territory}
92
- title={type}
89
+ avatarUrl={props.imageUrl}
90
+ name={props.label}
91
+ territory={props.territory}
92
+ title={props.type}
93
93
  />
94
94
  )}
95
95
  {...props}