playbook_ui 15.6.0.pre.alpha.play261013050 → 15.6.0.pre.alpha.play263913015
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -95
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +5 -11
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -57
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +0 -3
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_timeline/item.rb +0 -2
- data/app/pb_kits/playbook/pb_timeline/label.html.erb +1 -2
- data/app/pb_kits/playbook/pb_timeline/label.rb +0 -2
- data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -3
- data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -51
- data/dist/chunks/vendor.js +2 -2
- data/dist/menu.yml +1 -1
- data/lib/playbook/pb_kit_helper.rb +0 -35
- data/lib/playbook/version.rb +1 -1
- metadata +2 -12
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +0 -54
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +0 -3
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
- data/app/pb_kits/playbook/utilities/deprecated.ts +0 -73
data/dist/menu.yml
CHANGED
|
@@ -81,7 +81,7 @@ kits:
|
|
|
81
81
|
enhanced_element_used: true
|
|
82
82
|
- name: styling
|
|
83
83
|
parent: advanced_table
|
|
84
|
-
kit_section: ["Collapsible Trail","Row Styling", "Padding Control using Row Styling", "Column Styling", "Column Styling with Multiple Headers", "
|
|
84
|
+
kit_section: ["Collapsible Trail","Row Styling", "Padding Control using Row Styling", "Column Styling", "Column Styling with Multiple Headers", "Padding Control using Column Styling", "Column Group Border Color"]
|
|
85
85
|
platforms: *1
|
|
86
86
|
status: stable
|
|
87
87
|
icons_used: true
|
|
@@ -13,40 +13,5 @@ module Playbook
|
|
|
13
13
|
render kit.new(props, &block), &block
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
|
-
|
|
17
|
-
def deprecated_kit_warning(kit_name, message = nil)
|
|
18
|
-
# Skip in test and production environments
|
|
19
|
-
return "".html_safe if Rails.env.test? || Rails.env.production?
|
|
20
|
-
|
|
21
|
-
# Build the warning message
|
|
22
|
-
base_message = "PLAYBOOK DEPRECATION WARNING\\n ----------------------------\\n The \\\"#{kit_name}\\\" kit is deprecated and will be removed in a future version."
|
|
23
|
-
|
|
24
|
-
full_message = if message
|
|
25
|
-
"#{base_message} #{message}"
|
|
26
|
-
else
|
|
27
|
-
"#{base_message} Please migrate to the recommended alternative"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Escape the message for JavaScript
|
|
31
|
-
escaped_message = full_message.gsub("'", "\\\\'").gsub("\n", "\\n")
|
|
32
|
-
|
|
33
|
-
# Return a self-executing script that checks if we're already warned
|
|
34
|
-
# Uses client-side tracking to ensure one warning per page load
|
|
35
|
-
# Only shows warnings on localhost (matching React behavior)
|
|
36
|
-
script = "<script type=\"text/javascript\">\n"
|
|
37
|
-
script += "(function() {\n"
|
|
38
|
-
script += " var hostname = window.location.hostname;\n"
|
|
39
|
-
script += " var isLocalDev = hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local') || hostname.includes('local.') || !hostname;\n"
|
|
40
|
-
script += " if (!isLocalDev) return;\n"
|
|
41
|
-
script += " if (!window.__PB_WARNED_KITS__) window.__PB_WARNED_KITS__ = new Set();\n"
|
|
42
|
-
script += " if (!window.__PB_WARNED_KITS__.has('#{kit_name}')) {\n"
|
|
43
|
-
script += " window.__PB_WARNED_KITS__.add('#{kit_name}');\n"
|
|
44
|
-
script += " console.warn('#{escaped_message}');\n"
|
|
45
|
-
script += " }\n"
|
|
46
|
-
script += "})();\n"
|
|
47
|
-
script += "</script>"
|
|
48
|
-
|
|
49
|
-
script.html_safe
|
|
50
|
-
end
|
|
51
16
|
end
|
|
52
17
|
end
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playbook_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 15.6.0.pre.alpha.
|
|
4
|
+
version: 15.6.0.pre.alpha.play263913015
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-12-
|
|
12
|
+
date: 2025-12-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: actionpack
|
|
@@ -273,8 +273,6 @@ files:
|
|
|
273
273
|
- app/pb_kits/playbook/pb_advanced_table/advanced_table.rb
|
|
274
274
|
- app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx
|
|
275
275
|
- app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js
|
|
276
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb
|
|
277
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md
|
|
278
276
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb
|
|
279
277
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md
|
|
280
278
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.html.erb
|
|
@@ -302,10 +300,6 @@ files:
|
|
|
302
300
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx
|
|
303
301
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx
|
|
304
302
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md
|
|
305
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx
|
|
306
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md
|
|
307
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx
|
|
308
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md
|
|
309
303
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx
|
|
310
304
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.md
|
|
311
305
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb
|
|
@@ -3443,9 +3437,6 @@ files:
|
|
|
3443
3437
|
- app/pb_kits/playbook/pb_timeline/docs/_description.md
|
|
3444
3438
|
- app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb
|
|
3445
3439
|
- app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx
|
|
3446
|
-
- app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb
|
|
3447
|
-
- app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx
|
|
3448
|
-
- app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md
|
|
3449
3440
|
- app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb
|
|
3450
3441
|
- app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx
|
|
3451
3442
|
- app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb
|
|
@@ -3842,7 +3833,6 @@ files:
|
|
|
3842
3833
|
- app/pb_kits/playbook/utilities/_truncate.scss
|
|
3843
3834
|
- app/pb_kits/playbook/utilities/_vertical_align.scss
|
|
3844
3835
|
- app/pb_kits/playbook/utilities/_width.scss
|
|
3845
|
-
- app/pb_kits/playbook/utilities/deprecated.ts
|
|
3846
3836
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
|
|
3847
3837
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
|
|
3848
3838
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
column_styling: {
|
|
11
|
-
cell_background_color: ->(row) { row[:newEnrollments].to_i > 20 ? "success_secondary" : "warning_secondary" }
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
accessor: "scheduledMeetings",
|
|
16
|
-
label: "Scheduled Meetings",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
accessor: "attendanceRate",
|
|
20
|
-
label: "Attendance Rate",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
accessor: "completedClasses",
|
|
24
|
-
label: "Completed Classes",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
accessor: "classCompletionRate",
|
|
28
|
-
label: "Class Completion Rate",
|
|
29
|
-
column_styling: {
|
|
30
|
-
cell_background_color: "category_1",
|
|
31
|
-
font_color: "white"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
accessor: "graduatedStudents",
|
|
36
|
-
label: "Graduated Students",
|
|
37
|
-
}
|
|
38
|
-
] %>
|
|
39
|
-
|
|
40
|
-
<%= pb_rails("advanced_table", props: { id: "background-control", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
41
|
-
<%= pb_rails("advanced_table/table_header", props: { table_id: "background-control", column_definitions: column_definitions }) %>
|
|
42
|
-
<%= pb_rails("advanced_table/table_body", props: { table_id: "background-control", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
43
|
-
<% end %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
`column_styling` can also be used to control the background color on individual cells in a given column as shown here.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import AdvancedTable from '../_advanced_table'
|
|
3
|
-
import colors from '../../tokens/exports/_colors.module.scss'
|
|
4
|
-
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const AdvancedTableColumnStylingBackground = (props) => {
|
|
8
|
-
const columnDefinitions = [
|
|
9
|
-
{
|
|
10
|
-
accessor: "year",
|
|
11
|
-
label: "Year",
|
|
12
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
accessor: "newEnrollments",
|
|
16
|
-
label: "New Enrollments",
|
|
17
|
-
columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
accessor: "scheduledMeetings",
|
|
21
|
-
label: "Scheduled Meetings",
|
|
22
|
-
columnStyling:{cellBackgroundColor: colors.info_subtle},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
accessor: "attendanceRate",
|
|
26
|
-
label: "Attendance Rate",
|
|
27
|
-
columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
accessor: "completedClasses",
|
|
31
|
-
label: "Completed Classes",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
accessor: "classCompletionRate",
|
|
35
|
-
label: "Class Completion Rate",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
accessor: "graduatedStudents",
|
|
39
|
-
label: "Graduated Students",
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div>
|
|
45
|
-
<AdvancedTable
|
|
46
|
-
columnDefinitions={columnDefinitions}
|
|
47
|
-
tableData={MOCK_DATA}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
</div>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default AdvancedTableColumnStylingBackground
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
The `columnStyling` prop can also be used to set background color for entire columns.As stated above, `columnStyling` is an object that has several optional key/value pairs, here are the options highlighted in this doc:
|
|
2
|
-
|
|
3
|
-
1) `cellBackgroundColor`: use this to control the background color of all cells in the given column
|
|
4
|
-
2) `headerBackgroundColor`: use this to control the background color of the column header
|
|
5
|
-
3) `fontColor`: use this to control font color for all cells in the given column if needed, for example if using a darker background color.
|
|
6
|
-
4) `headerFontColor`: use this to control font color for the header in the given column if needed, for example if using a darker background color.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import AdvancedTable from '../_advanced_table'
|
|
3
|
-
import colors from '../../tokens/exports/_colors.module.scss'
|
|
4
|
-
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const AdvancedTableColumnStylingBackgroundMulti = (props) => {
|
|
8
|
-
const columnDefinitions = [
|
|
9
|
-
{
|
|
10
|
-
accessor: "year",
|
|
11
|
-
label: "Year",
|
|
12
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
label: "Enrollment Data",
|
|
16
|
-
columns: [
|
|
17
|
-
{
|
|
18
|
-
label: "Enrollment Stats",
|
|
19
|
-
columns: [
|
|
20
|
-
{
|
|
21
|
-
accessor: "newEnrollments",
|
|
22
|
-
label: "New Enrollments",
|
|
23
|
-
columnStyling:{cellBackgroundColor: colors.error_subtle, headerBackgroundColor: colors.error_subtle},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
accessor: "scheduledMeetings",
|
|
27
|
-
label: "Scheduled Meetings",
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: "Performance Data",
|
|
35
|
-
columns: [
|
|
36
|
-
{
|
|
37
|
-
label: "Completion Metrics",
|
|
38
|
-
columns: [
|
|
39
|
-
{
|
|
40
|
-
accessor: "completedClasses",
|
|
41
|
-
label: "Completed Classes",
|
|
42
|
-
columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
accessor: "classCompletionRate",
|
|
46
|
-
label: "Class Completion Rate",
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: "Attendance",
|
|
52
|
-
columns: [
|
|
53
|
-
{
|
|
54
|
-
accessor: "attendanceRate",
|
|
55
|
-
label: "Attendance Rate",
|
|
56
|
-
columnStyling:{cellBackgroundColor: colors.info_subtle},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
accessor: "scheduledMeetings",
|
|
60
|
-
label: "Scheduled Meetings",
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<div>
|
|
71
|
-
<AdvancedTable
|
|
72
|
-
columnDefinitions={columnDefinitions}
|
|
73
|
-
tableData={MOCK_DATA}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default AdvancedTableColumnStylingBackgroundMulti
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The `columnStyling` prop can also be used to set background color for entire columns for the multi header variant as well.
|
|
2
|
-
|
|
3
|
-
It should be noted that `headerFontColor` and `headerBackgroundColor` in the multi header variant will only apply to the immediate header for the given column as shown here.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("timeline", props: {orientation: "horizontal", show_date: true}) do %>
|
|
2
|
-
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today, show_current_year: true }) do %>
|
|
3
|
-
<%= pb_rails("title_detail", props: {
|
|
4
|
-
title: "Jackson Heights",
|
|
5
|
-
detail: "37-27 74th Street"
|
|
6
|
-
}) %>
|
|
7
|
-
<% end %>
|
|
8
|
-
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %>
|
|
9
|
-
<%= pb_rails("title_detail", props: {
|
|
10
|
-
title: "Greenpoint",
|
|
11
|
-
detail: "81 Gate St Brooklyn"
|
|
12
|
-
}) %>
|
|
13
|
-
<% end %>
|
|
14
|
-
<%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %>
|
|
15
|
-
<% item.label do %>
|
|
16
|
-
<%= pb_rails("timeline/label", props: { date: Date.today, show_current_year: true }) %>
|
|
17
|
-
<% end %>
|
|
18
|
-
<% item.step do %>
|
|
19
|
-
<%= pb_rails("timeline/step", props: { icon: 'map-marker-alt', icon_color: 'purple' }) %>
|
|
20
|
-
<% end %>
|
|
21
|
-
<% item.detail do %>
|
|
22
|
-
<%= pb_rails("title_detail", props: {
|
|
23
|
-
title: "Society Hill",
|
|
24
|
-
detail: "72 E St Astoria"
|
|
25
|
-
}) %>
|
|
26
|
-
<% end %>
|
|
27
|
-
<% end %>
|
|
28
|
-
<% end %>
|
|
29
|
-
|
|
30
|
-
<br /><br /><br />
|
|
31
|
-
|
|
32
|
-
<%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %>
|
|
33
|
-
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today, show_current_year: true }) do %>
|
|
34
|
-
<%= pb_rails("title_detail", props: {
|
|
35
|
-
title: "Jackson Heights",
|
|
36
|
-
detail: "37-27 74th Street"
|
|
37
|
-
}) %>
|
|
38
|
-
<% end %>
|
|
39
|
-
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %>
|
|
40
|
-
<%= pb_rails("title_detail", props: {
|
|
41
|
-
title: "Greenpoint",
|
|
42
|
-
detail: "81 Gate St Brooklyn"
|
|
43
|
-
}) %>
|
|
44
|
-
<% end %>
|
|
45
|
-
<%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %>
|
|
46
|
-
<% item.label do %>
|
|
47
|
-
<%= pb_rails("timeline/label", props: { date: Date.today, show_current_year: true }) %>
|
|
48
|
-
<% end %>
|
|
49
|
-
<% item.step do %>
|
|
50
|
-
<%= pb_rails("timeline/step", props: { icon: 'map-marker-alt', icon_color: 'purple' }) %>
|
|
51
|
-
<% end %>
|
|
52
|
-
<% item.detail do %>
|
|
53
|
-
<%= pb_rails("title_detail", props: {
|
|
54
|
-
title: "Society Hill",
|
|
55
|
-
detail: "72 E St Astoria"
|
|
56
|
-
}) %>
|
|
57
|
-
<% end %>
|
|
58
|
-
<% end %>
|
|
59
|
-
<% end %>
|
|
60
|
-
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import Timeline from '../_timeline'
|
|
4
|
-
import TitleDetail from '../../pb_title_detail/_title_detail'
|
|
5
|
-
|
|
6
|
-
const TimelineShowCurrentYear = (props) => (
|
|
7
|
-
<div>
|
|
8
|
-
<Timeline
|
|
9
|
-
orientation="horizontal"
|
|
10
|
-
showDate
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
<Timeline.Item
|
|
14
|
-
date={new Date()}
|
|
15
|
-
icon="user"
|
|
16
|
-
iconColor="royal"
|
|
17
|
-
showCurrentYear
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<TitleDetail
|
|
21
|
-
detail="37-27 74th Street"
|
|
22
|
-
title="Jackson Heights"
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
</Timeline.Item>
|
|
26
|
-
<Timeline.Item
|
|
27
|
-
icon="check"
|
|
28
|
-
iconColor="teal"
|
|
29
|
-
lineStyle="dotted"
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
<TitleDetail
|
|
33
|
-
detail="81 Gate St Brooklyn"
|
|
34
|
-
title="Greenpoint"
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
</Timeline.Item>
|
|
38
|
-
<Timeline.Item
|
|
39
|
-
lineStyle="solid"
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
<Timeline.Label
|
|
43
|
-
date={new Date()}
|
|
44
|
-
showCurrentYear
|
|
45
|
-
/>
|
|
46
|
-
<Timeline.Step
|
|
47
|
-
icon="map-marker-alt"
|
|
48
|
-
iconColor="purple"
|
|
49
|
-
/>
|
|
50
|
-
<Timeline.Detail>
|
|
51
|
-
<TitleDetail
|
|
52
|
-
detail="72 E St Astoria"
|
|
53
|
-
title="Society Hill"
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
</Timeline.Detail>
|
|
57
|
-
</Timeline.Item>
|
|
58
|
-
</Timeline>
|
|
59
|
-
|
|
60
|
-
<br />
|
|
61
|
-
<br />
|
|
62
|
-
<br />
|
|
63
|
-
|
|
64
|
-
<Timeline
|
|
65
|
-
orientation="vertical"
|
|
66
|
-
showDate
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
<Timeline.Item
|
|
70
|
-
date={new Date()}
|
|
71
|
-
icon="user"
|
|
72
|
-
iconColor="royal"
|
|
73
|
-
showCurrentYear
|
|
74
|
-
{...props}
|
|
75
|
-
>
|
|
76
|
-
<TitleDetail
|
|
77
|
-
detail="37-27 74th Street"
|
|
78
|
-
title="Jackson Heights"
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
</Timeline.Item>
|
|
82
|
-
<Timeline.Item
|
|
83
|
-
icon="check"
|
|
84
|
-
iconColor="teal"
|
|
85
|
-
lineStyle="dotted"
|
|
86
|
-
{...props}
|
|
87
|
-
>
|
|
88
|
-
<TitleDetail
|
|
89
|
-
detail="81 Gate St Brooklyn"
|
|
90
|
-
title="Greenpoint"
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
</Timeline.Item>
|
|
94
|
-
<Timeline.Item
|
|
95
|
-
lineStyle="solid"
|
|
96
|
-
{...props}
|
|
97
|
-
>
|
|
98
|
-
<Timeline.Label
|
|
99
|
-
date={new Date()}
|
|
100
|
-
showCurrentYear
|
|
101
|
-
/>
|
|
102
|
-
<Timeline.Step
|
|
103
|
-
icon="map-marker-alt"
|
|
104
|
-
iconColor="purple"
|
|
105
|
-
/>
|
|
106
|
-
<Timeline.Detail>
|
|
107
|
-
<TitleDetail
|
|
108
|
-
detail="72 E St Astoria"
|
|
109
|
-
title="Society Hill"
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
</Timeline.Detail>
|
|
113
|
-
</Timeline.Item>
|
|
114
|
-
</Timeline>
|
|
115
|
-
</div>
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
export default TimelineShowCurrentYear
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
By default, the Timeline kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true. Pass it to `Timeline.Item`/`timeline/item` when using its `date` prop, or to `Timeline.Label`/`timeline/label` if following the "With Children" pattern.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks which deprecated kits have already logged warnings in this session
|
|
3
|
-
* to ensure we only log once per page load per kit
|
|
4
|
-
*/
|
|
5
|
-
const warnedKits = new Set<string>();
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Logs a deprecation warning for a Playbook kit
|
|
9
|
-
* - Only logs once per kit per page load (prevents spam on re-renders)
|
|
10
|
-
* - Only logs in development mode (not in production or test environments)
|
|
11
|
-
*
|
|
12
|
-
* @param kitName - The name of the deprecated kit (e.g., 'BarGraph', 'RichTextEditor')
|
|
13
|
-
* @param message - Optional custom deprecation message. If not provided, uses a default message.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // In your kit component:
|
|
17
|
-
* useEffect(() => {
|
|
18
|
-
* deprecatedKitWarning('BarGraph');
|
|
19
|
-
* }, []);
|
|
20
|
-
*/
|
|
21
|
-
export const deprecatedKitWarning = (
|
|
22
|
-
kitName: string,
|
|
23
|
-
message?: string
|
|
24
|
-
): void => {
|
|
25
|
-
// Skip in test environments (Jest sets NODE_ENV to 'test')
|
|
26
|
-
if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'test') {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// In browser environments, check if we're on localhost/dev
|
|
31
|
-
if (typeof window !== 'undefined') {
|
|
32
|
-
const hostname = window.location?.hostname;
|
|
33
|
-
const isLocalDev = hostname === 'localhost' ||
|
|
34
|
-
hostname === '127.0.0.1' ||
|
|
35
|
-
hostname?.endsWith('.local') ||
|
|
36
|
-
hostname?.includes('local.') ||
|
|
37
|
-
!hostname; // file:// protocol
|
|
38
|
-
|
|
39
|
-
// Only show warnings in local development
|
|
40
|
-
if (!isLocalDev) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Only warn once per kit per page load
|
|
46
|
-
if (warnedKits.has(kitName)) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Mark this kit as warned
|
|
51
|
-
warnedKits.add(kitName);
|
|
52
|
-
|
|
53
|
-
// Build the warning message
|
|
54
|
-
const baseMessage = `PLAYBOOK DEPRECATION WARNING
|
|
55
|
-
----------------------------
|
|
56
|
-
The "${kitName}" kit is deprecated and will be removed in a future version.`;
|
|
57
|
-
|
|
58
|
-
const fullMessage = message
|
|
59
|
-
? `${baseMessage} ${message}`
|
|
60
|
-
: `${baseMessage} Please migrate to the recommended alternative
|
|
61
|
-
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
console.warn(fullMessage);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Resets the warned kits tracker (useful for testing)
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
export const resetDeprecationWarnings = (): void => {
|
|
72
|
-
warnedKits.clear();
|
|
73
|
-
};
|