playbook_ui 14.9.0.pre.alpha.play1703errorstatealignment4889 → 14.9.0.pre.alpha.play1703errorstatealignment5060

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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +1 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +8 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +36 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +1 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
  8. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +8 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +2 -0
  12. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +53 -49
  13. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +29 -36
  14. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +9 -4
  15. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
  16. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
  17. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
  18. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
  19. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +9 -12
  20. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +17 -1
  21. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +17 -1
  22. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +15 -0
  23. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +2 -1
  24. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +15 -1
  25. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +32 -0
  26. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +29 -0
  27. data/app/pb_kits/playbook/pb_layout/_layout.tsx +30 -11
  28. data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
  29. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +166 -0
  30. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -0
  31. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +89 -0
  32. data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +2 -1
  33. data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +2 -0
  34. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +75 -0
  35. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +1 -0
  36. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +108 -0
  37. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +2 -0
  38. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +94 -0
  39. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
  40. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +83 -0
  41. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -0
  42. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +120 -0
  43. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -0
  44. data/app/pb_kits/playbook/pb_table/docs/example.yml +5 -0
  45. data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
  46. data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -1
  47. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +35 -0
  48. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
  49. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +35 -3
  50. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +88 -0
  51. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
  52. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  53. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +64 -0
  54. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +139 -2
  55. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +115 -46
  56. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +9 -2
  57. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
  58. data/dist/chunks/_typeahead-l1kq1p9m.js +22 -0
  59. data/dist/chunks/{_weekday_stacked-CblTZ9cd.js → _weekday_stacked-DkCMUF58.js} +2 -2
  60. data/dist/chunks/{lib-CVPInSs5.js → lib-CuCy3_xO.js} +3 -3
  61. data/dist/chunks/{pb_form_validation-CDLJ5eAG.js → pb_form_validation-D37k10a0.js} +1 -1
  62. data/dist/chunks/vendor.js +1 -1
  63. data/dist/menu.yml +1 -1
  64. data/dist/playbook-doc.js +1 -1
  65. data/dist/playbook-rails-react-bindings.js +1 -1
  66. data/dist/playbook-rails.js +1 -1
  67. data/dist/playbook.css +1 -1
  68. data/lib/playbook/version.rb +1 -1
  69. metadata +26 -6
  70. data/dist/chunks/_typeahead-4sdDeM4X.js +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c76303a7544e38deef03a9ac8c3e287b6013cf828a750766ec788f66e706bbc4
4
- data.tar.gz: 98da736fc4c77104393be8ab4f11379e52113aecdc16fcb2ccdb954e4aecc97b
3
+ metadata.gz: 0cafdaf728f6e7924b815a4a2525dd59cb72dcb4986d8062dbc8df9a56ca3897
4
+ data.tar.gz: 45233fb274a14a0522f2c8bb7f1d8ce4222e6d7d69298bbf839be73ea1d3de7b
5
5
  SHA512:
6
- metadata.gz: bbf0e95a2e97295650df84cdd1c87dfdd713eaaf68a6fb21c540dac59fa8084239c288becf3aa0eecb84f0dd6855e6e5440c37e748d0524560a4699f497c20f1
7
- data.tar.gz: 49a7797ec7401bd8e09a81b696cc652c1557dda1a514116cd7263842629fc845ff2f8eb19c30c95566eb8838ca1b64be94182491c8e487cb76034e38459554c7
6
+ metadata.gz: 20668527d152f490902220ba60775ab6479f1cb7dc0a18e33341759c064751eb12d55ee5e17953c0fec90d2e24b2916880110fe89c92df8e1cbb5f98af9f8eba
7
+ data.tar.gz: 5aeebf46b23221b0cb447ca22b3a197ea38fc7181fd157aa4504490dfef84f4024536d9d10a58f91ed3704754f735b46b0b295ab17d058a2ad7b15b870fb3503
@@ -3,18 +3,13 @@ import React from "react"
3
3
  //CollapsibleTrail component
4
4
  const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => {
5
5
  const style: { [key: string]: string | number } = {
6
- position: "absolute",
7
6
  left: `${leftOffset}em`,
8
- top: 0,
9
- bottom: 0,
10
- width: "2px",
11
- backgroundColor: "#E4E8F0",
12
7
  }
13
8
 
14
9
  return (
15
10
  <div
16
11
  className="collapsible-trail"
17
- style={style}
12
+ style={style}
18
13
  />
19
14
  )
20
15
  }
@@ -110,6 +110,14 @@
110
110
  height: auto;
111
111
  }
112
112
 
113
+ .collapsible-trail {
114
+ background-color: $border_light;
115
+ position: absolute;
116
+ top: 0;
117
+ bottom: 0;
118
+ width: 2px;
119
+ }
120
+
113
121
  // Responsive Styles
114
122
  @media only screen and (max-width: $screen-xl-min) {
115
123
  &[class*="table-responsive-scroll"] {
@@ -0,0 +1,36 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <%= pb_rails("advanced_table", props: { id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions }) do %>
34
+ <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
35
+ <%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
36
+ <% end %>
@@ -0,0 +1 @@
1
+ `collapsible_trail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of the rows when subRows are toggled open.
@@ -2,6 +2,7 @@ examples:
2
2
  rails:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
+ - advanced_table_collapsible_trail_rails: Collapsible Trail
5
6
  - advanced_table_beta_sort: Enable Sorting
6
7
  - advanced_table_custom_cell_rails: Custom Components for Cells
7
8
 
@@ -14,14 +14,16 @@ module Playbook
14
14
  default: "header"
15
15
  prop :subrow_headers, type: Playbook::Props::Array,
16
16
  default: []
17
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
18
+ default: true
17
19
 
18
20
  def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
19
21
  output = ActiveSupport::SafeBuffer.new
20
22
  is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
21
23
 
22
- output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1] }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
24
+ output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
23
25
 
24
- output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth })
26
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth, collapsible_trail: collapsible_trail })
25
27
 
26
28
  if row[:children].present?
27
29
  output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
@@ -2,6 +2,14 @@
2
2
  <% object.column_definitions.each_with_index do |column, index| %>
3
3
  <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
4
4
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
5
+ <% if collapsible_trail && index.zero? %>
6
+ <% (1..depth).each do |i| %>
7
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
8
+ <% left_offset = i * 1.0 + additional_offset %>
9
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
10
+ <% end %>
11
+ <% end %>
12
+
5
13
  <div style="padding-left: <%= depth * 1.25 %>em">
6
14
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
7
15
  <% if index.zero? && object.row[:children].present? %>
@@ -9,6 +9,8 @@ module Playbook
9
9
  default: []
10
10
  prop :row
11
11
  prop :depth
12
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
13
+ default: true
12
14
 
13
15
  def classname
14
16
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -6,6 +6,14 @@
6
6
  <% object.column_definitions.each_with_index do |column, index| %>
7
7
  <%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
8
8
  <%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
9
+ <% if collapsible_trail && index.zero? %>
10
+ <% (1..depth).each do |i| %>
11
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
12
+ <% left_offset = i * 1.0 + additional_offset %>
13
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
14
+ <% end %>
15
+ <% end %>
16
+
9
17
  <div style="padding-left: <%= depth * 1.25 %>em">
10
18
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
11
19
  <% if index.zero? && object.row[:children].present? %>
@@ -12,6 +12,8 @@ module Playbook
12
12
  default: "header"
13
13
  prop :subrow_header, type: Playbook::Props::String,
14
14
  default: ""
15
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
16
+ default: true
15
17
 
16
18
  def classname
17
19
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -1,66 +1,70 @@
1
1
  import React from 'react'
2
-
2
+ import ReactDOMServer from 'react-dom/server'
3
3
  import BarGraph from '../_bar_graph'
4
+ import Icon from '../../pb_icon/_icon'
5
+
6
+ const chartData = [
7
+ {
8
+ name: 'Role',
9
+ data: [0, 200, 300, 654, 656],
10
+ },
11
+ {
12
+ name: 'Company',
13
+ data: [150, 524, 320, 440, 500],
14
+ },
15
+ ]
4
16
 
5
- const chartData = [{
6
- name: 'Installation',
7
- data: [1475, 200, 3000, 654, 656],
8
- }, {
9
- name: 'Manufacturing',
10
- data: [4434, 524, 2320, 440, 500],
11
- }, {
12
- name: 'Sales & Distribution',
13
- data: [3387, 743, 1344, 434, 440],
14
- }, {
15
- name: 'Project Development',
16
- data: [3227, 878, 999, 780, 1000],
17
- }, {
18
- name: 'Other',
19
- data: [1111, 677, 3245, 500, 200],
20
- }]
17
+ const renderIcon = (iconName, color) => {
18
+ return ReactDOMServer.renderToStaticMarkup(
19
+ <Icon
20
+ color={color}
21
+ icon={iconName}
22
+ />)
23
+ };
21
24
 
22
25
  const barGraphOptions = {
23
- subtitle: {
24
- text: "Overwritten subtitle",
25
- style: {
26
- color: "red"
27
- }
26
+ yAxis: {
27
+ tickInterval: 5,
28
28
  },
29
29
  xAxis: {
30
- labels: {
31
- useHTML: true,
32
- formatter: function() {
33
- switch (this.value) {
34
- case 'Jan':
35
- return `<i class="far fa-apple-whole"></i> ${this.value}`
36
- case 'Feb':
37
- return `<i class="far fa-strawberry"></i> ${this.value}`
38
- case 'Mar':
39
- return `<i class="far fa-lemon"></i> ${this.value}`
40
- case 'Apr':
41
- return `<i class="far fa-pear"></i> ${this.value}`
42
- case 'May':
43
- return `<i class="far fa-peach"></i> ${this.value}`
44
- default:
45
- return ''
46
- }
47
- }
48
- }
49
- }
30
+ categories: ['1', '2', '3', '4', '5'],
31
+ labels: {
32
+ useHTML: true,
33
+ formatter: function () {
34
+ switch (this.value) {
35
+ case '1':
36
+ return `${renderIcon('frown', 'error')}`;
37
+ case '2':
38
+ return `${renderIcon('frown', 'warning')}`;
39
+ case '3':
40
+ return `${renderIcon('frown-open', 'neutral')}`;
41
+ case '4':
42
+ return `${renderIcon('smile', 'category_7')}`;
43
+ case '5':
44
+ return `${renderIcon('smile-beam', 'success')}`;
45
+ default:
46
+ return ''
47
+ }
48
+ },
49
+ style: {
50
+ fontSize: '1.4em',
51
+ },
52
+ y: 42,
53
+ },
54
+ },
55
+ legend: {
56
+ itemMarginTop: 62,
57
+ },
50
58
  }
51
59
 
52
- const BarGraphCustom = (props) => (
60
+ const BarGraphCustom = () => (
53
61
  <div>
54
62
  <BarGraph
55
- axisTitle="Number of Employees"
56
63
  chartData={chartData}
57
64
  customOptions={barGraphOptions}
58
- id="bar-custom"
59
- subTitle="Subtitle to replace"
65
+ id="happiness-dashboard"
66
+ legend
60
67
  title="Bar Graph with Custom Overrides"
61
- xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
62
- yAxisMin={0}
63
- {...props}
64
68
  />
65
69
  </div>
66
70
  )
@@ -1,49 +1,42 @@
1
1
  <% data = [{
2
- name: 'Installation',
3
- data: [1475,200,3000,654,656]
2
+ name: 'Role',
3
+ data: [0, 200, 300, 654, 656],
4
4
  }, {
5
- name: 'Manufacturing',
6
- data: [4434,524,2320,440,500]
7
- }, {
8
- name: 'Sales & Distribution',
9
- data: [3387,743,1344,434,440,]
10
- }, {
11
- name: 'Project Development',
12
- data: [3227,878,999,780,1000]
13
- }, {
14
- name: 'Other',
15
- data: [1111,677,3245,500,200]
5
+ name: 'Company',
6
+ data: [150, 524, 320, 440, 500],
16
7
  }] %>
17
8
 
18
9
  <% bar_graph_options = {
19
- customOptions: {
20
- subtitle: {
21
- text: "Overwritten subtitle",
22
- style: {
23
- color: "red"
24
- }
10
+ customOptions: {
11
+ yAxis: {
12
+ tickInterval: 5,
13
+ },
14
+ xAxis: {
15
+ categories: [
16
+ raw(pb_rails("icon", props: { icon: "frown", color: "error", size: "2x" })),
17
+ raw(pb_rails("icon", props: { icon: "frown", color: "warning", size: "2x" })),
18
+ raw(pb_rails("icon", props: { icon: "frown-open", color: "neutral", size: "2x" })),
19
+ raw(pb_rails("icon", props: { icon: "smile", color: "category_7", size: "2x" })),
20
+ raw(pb_rails("icon", props: { icon: "smile-beam", color: "success", size: "2x" }))
21
+ ],
22
+ labels: {
23
+ useHTML: true,
24
+ sytle: {
25
+ fontSize: '1.4em',
25
26
  },
26
- xAxis: {
27
- categories: [
28
- '<i class="far fa-apple-whole"></i> Jan',
29
- '<i class="far fa-strawberry"></i> Feb',
30
- '<i class="far fa-lemon"></i> Mar',
31
- '<i class="far fa-pear"></i> Apr',
32
- '<i class="far fa-peach"></i> May'
33
- ],
34
- labels: {
35
- useHTML: true,
36
- }
37
- }
38
- }
27
+ y: 42,
28
+ },
29
+ },
30
+ legend: {
31
+ itemMarginTop: 62,
32
+ },
33
+ }
39
34
  } %>
40
35
 
41
36
  <%= pb_rails("bar_graph", props: {
42
- axis_title: 'Number of Employees',
43
37
  chart_data: data,
44
38
  id: "bar-default",
45
- y_axis_min: 0,
46
- subtitle: 'Subtitle to replace',
39
+ legend: true,
47
40
  title: 'Bar Graph with Custom Overrides',
48
41
  custom_options: bar_graph_options
49
- }) %>
42
+ }) %>
@@ -2,7 +2,7 @@ import React, { useEffect, ReactElement } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import useCollapsible from './useCollapsible'
4
4
 
5
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { globalProps, globalInlineProps, GlobalProps } from '../utilities/globalProps'
6
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
7
7
 
8
8
  import CollapsibleContent from './child_kits/CollapsibleContent'
@@ -32,6 +32,7 @@ type CollapsibleProps = {
32
32
  onClick?: ()=> void,
33
33
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
34
34
  id?: string,
35
+ tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col',
35
36
  }
36
37
 
37
38
  const Collapsible = ({
@@ -47,8 +48,9 @@ const Collapsible = ({
47
48
  onIconClick,
48
49
  onClick,
49
50
  id,
51
+ tag = 'div',
50
52
  ...props
51
- }: CollapsibleProps): React.ReactElement => {
53
+ }: CollapsibleProps & GlobalProps): React.ReactElement => {
52
54
  const [isCollapsed, toggle, setIsCollapsed] = useCollapsible(collapsed)
53
55
 
54
56
  useEffect(()=> {
@@ -76,9 +78,12 @@ const Collapsible = ({
76
78
  className
77
79
  )
78
80
  const dynamicInlineProps = globalInlineProps(props)
81
+
82
+ const Tag: React.ReactElement | any = `${tag}`;
83
+
79
84
  return (
80
85
  <CollapsibleContext.Provider value={{ collapsed: isCollapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick }}>
81
- <div
86
+ <Tag
82
87
  {...ariaProps}
83
88
  {...dataProps}
84
89
  {...htmlProps}
@@ -96,7 +101,7 @@ const Collapsible = ({
96
101
  <CollapsibleContent {...contentProps}>
97
102
  {contentChildren}
98
103
  </CollapsibleContent>
99
- </div>
104
+ </Tag>
100
105
  </CollapsibleContext.Provider>
101
106
  )
102
107
  }
@@ -1,7 +1,7 @@
1
1
  import classnames from 'classnames'
2
2
  import React, { useContext, useRef, useEffect } from 'react'
3
3
  import { buildCss } from '../../utilities/props'
4
- import { globalProps } from '../../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../../utilities/globalProps'
5
5
  import { hideElement, showElement } from '../_helper_functions'
6
6
 
7
7
  import CollapsibleContext from '../context'
@@ -15,7 +15,7 @@ const CollapsibleContent = ({
15
15
  children,
16
16
  className,
17
17
  ...props
18
- }: CollapsibleContentProps): React.ReactElement => {
18
+ }: CollapsibleContentProps & GlobalProps): React.ReactElement => {
19
19
  const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
20
20
  const contentCSS = buildCss('pb_collapsible_content_kit')
21
21
  const contentSpacing = globalProps(props)
@@ -3,7 +3,7 @@
3
3
  import classnames from 'classnames'
4
4
  import React, { useContext } from 'react'
5
5
  import { buildCss } from '../../utilities/props'
6
- import { globalProps } from '../../utilities/globalProps'
6
+ import { globalProps, GlobalProps } from '../../utilities/globalProps'
7
7
 
8
8
  import Flex from '../../pb_flex/_flex'
9
9
  import FlexItem from '../../pb_flex/_flex_item'
@@ -25,7 +25,7 @@ const CollapsibleMain = ({
25
25
  className,
26
26
  cursor = 'pointer',
27
27
  ...props
28
- }: CollapsibleMainProps): React.ReactElement=> {
28
+ }: CollapsibleMainProps & GlobalProps): React.ReactElement=> {
29
29
  const {collapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick}: any = useContext(CollapsibleContext)
30
30
  const mainCSS = buildCss('pb_collapsible_main_kit')
31
31
  const mainSpacing = globalProps(props, { cursor })
@@ -287,7 +287,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
287
287
  {...ariaProps}
288
288
  {...dataProps}
289
289
  {...htmlProps}
290
- style={dynamicInlineProps}
291
290
  className={classnames(drawerClassNames.base, {
292
291
  [drawerClassNames.afterOpen]:
293
292
  animationState === "afterOpen",
@@ -296,6 +295,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
296
295
  })}
297
296
  id={id}
298
297
  onClick={(e) => e.stopPropagation()}
298
+ style={dynamicInlineProps}
299
299
  >
300
300
  {children}
301
301
  </div>
@@ -306,7 +306,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
306
306
  {...dataProps}
307
307
  {...htmlProps}
308
308
  className={classes}
309
- style={dynamicInlineProps}
310
309
  >
311
310
  {isModalVisible && (
312
311
  <div
@@ -327,6 +326,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
327
326
  animationState === "beforeClose",
328
327
  })}
329
328
  onClick={(e) => e.stopPropagation()}
329
+ style={dynamicInlineProps}
330
330
  >
331
331
  {children}
332
332
  </div>
@@ -0,0 +1,57 @@
1
+ @mixin error-state-flex-start-selectors {
2
+ &:has(.pb_text_input_kit.error):has(.pb_text_input_kit),
3
+ &:has(.pb_text_input_kit):has(.pb_date_picker_kit.error),
4
+ &:has(.pb_text_input_kit):has(.pb_select_kit_wrapper.error),
5
+ &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error) {
6
+ align-items: flex-start;
7
+ }
8
+ }
9
+
10
+ @mixin error-state-center-selectors {
11
+ &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input),
12
+ &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has([class^=pb_button_kit]) {
13
+ align-items: center;
14
+ }
15
+ }
16
+
17
+ @mixin error-state-flex-end-selectors {
18
+ &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
19
+ align-items: flex-end;
20
+ }
21
+ }
22
+
23
+ @mixin error-state-right-side-select-kit {
24
+ &:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
25
+ &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
26
+ align-items: flex-start;
27
+
28
+ .pb_select_kit_wrapper {
29
+ padding-top: $space_md;
30
+ margin-top: 2px;
31
+
32
+ .pb_select_kit_caret {
33
+ padding-top: $space_md;
34
+ }
35
+ }
36
+
37
+ .pb_select_kit_wrapper.error {
38
+ padding-top: $space_md;
39
+ margin-top: 2px;
40
+
41
+ .pb_select_kit_caret {
42
+ padding-top: $space_xl;
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ @mixin error-state-left-side-select-kit {
49
+ &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
50
+ align-items: flex-start;
51
+
52
+ .pb_text_input_kit.error {
53
+ padding-top: $space_md;
54
+ margin-top: 2px;
55
+ }
56
+ }
57
+ }
@@ -1,7 +1,10 @@
1
+ @import "../tokens/spacing";
2
+ @import "./error_state_mixin";
3
+
1
4
  [class^=pb_form_group_kit] {
2
5
  display: inline-flex;
3
6
  flex-direction: row;
4
- align-items: flex-start;
7
+ align-items: flex-end;
5
8
  justify-content: flex-start;
6
9
 
7
10
  &[class*=_full] {
@@ -12,17 +15,11 @@
12
15
  }
13
16
  }
14
17
 
15
- &:has(.pb_text_input_kit):has(.pb_text_input_kit_label){
16
- align-items: flex-end;
17
- }
18
-
19
- &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label){
20
- align-items: center;
21
- }
22
-
23
- &:has(.pb_phone_number_input):has(.pb_text_input_kit.error):has(.pb_text_input_kit_label){
24
- align-items: center;
25
- }
18
+ @include error-state-flex-start-selectors;
19
+ @include error-state-center-selectors;
20
+ @include error-state-flex-end-selectors;
21
+ @include error-state-left-side-select-kit;
22
+ @include error-state-right-side-select-kit;
26
23
 
27
24
  & [class^=pb_text_input_kit] .text_input_wrapper,
28
25
  & [class^=pb_date_picker_kit] .input_wrapper,
@@ -18,7 +18,7 @@ type HomeAddressStreetProps = {
18
18
  className?: string,
19
19
  data?: { [key: string]: string },
20
20
  dark?: boolean,
21
- emphasis: "street" | "city",
21
+ emphasis: "street" | "city" | "none",
22
22
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
23
23
  homeId: string,
24
24
  houseStyle: string,
@@ -129,6 +129,22 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
129
129
  </div>
130
130
  </div>
131
131
  }
132
+ {emphasis == 'none' &&
133
+ <div>
134
+ <Body dark={dark}>
135
+ {joinPresent([titleize(address), houseStyle], ' · ')}
136
+ </Body>
137
+ <Body dark={dark}>{titleize(addressCont)}</Body>
138
+ <div>
139
+ <Body
140
+ color="light"
141
+ dark={dark}
142
+ >
143
+ {`${titleize(city)}, ${state} ${zipcode}`}
144
+ </Body>
145
+ </div>
146
+ </div>
147
+ }
132
148
  {homeId &&
133
149
  <Hashtag
134
150
  classname="home-hashtag"
@@ -24,4 +24,20 @@
24
24
  state: "PA",
25
25
  zipcode: "19382",
26
26
  territory: "PHL",
27
- }) %>
27
+ }) %>
28
+
29
+ <br>
30
+ <br>
31
+
32
+ <%= pb_rails("home_address_street", props: {
33
+ address: "70 Prospect Ave",
34
+ address_cont: "Apt M18",
35
+ city: "West Chester",
36
+ emphasis: "none",
37
+ home_id: 8250263,
38
+ home_url: "https://powerhrg.com/",
39
+ house_style: "Colonial",
40
+ state: "PA",
41
+ zipcode: "19382",
42
+ territory: "PHL",
43
+ }) %>
@@ -32,6 +32,21 @@ const HomeAddressStreetEmphasis = (props) => {
32
32
  zipcode="19382"
33
33
  {...props}
34
34
  />
35
+ <br />
36
+ <br />
37
+ <HomeAddressStreet
38
+ address="70 Prospect Ave"
39
+ addressCont="Apt M18"
40
+ city="West Chester"
41
+ emphasis="none"
42
+ homeId="8250263"
43
+ homeUrl="https://powerhrg.com/"
44
+ houseStyle="Colonial"
45
+ state="PA"
46
+ territory="PHL"
47
+ zipcode="19382"
48
+ {...props}
49
+ />
35
50
  </div>
36
51
  )
37
52
  }