playbook_ui 15.0.0.pre.alpha.PLAY2511playbookiconsupgrade10732 → 15.0.0.pre.alpha.PLAY198710641
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 +11 -12
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +2 -7
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +0 -5
- data/app/pb_kits/playbook/pb_contact/contact.rb +0 -4
- data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -21
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -16
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +0 -15
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +0 -6
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +0 -6
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +5 -13
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +0 -23
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +7 -45
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -4
- data/dist/chunks/{_line_graph-DeH7NK-i.js → _line_graph-CUfJ7E4h.js} +1 -1
- data/dist/chunks/{_typeahead-CCGp0OQe.js → _typeahead-DCp1lVJx.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CZAWLGyu.js → _weekday_stacked-B-e7xOfU.js} +2 -2
- data/dist/chunks/{lib-QZuu1ltS.js → lib-BTs5acfO.js} +1 -1
- data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-CKkaQFX3.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/engine.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -23
- data/lib/playbook/version.rb +1 -1
- metadata +26 -15
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +0 -5
- data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +0 -165
- data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
data/lib/playbook/engine.rb
CHANGED
data/lib/playbook/kit_base.rb
CHANGED
@@ -122,7 +122,7 @@ module Playbook
|
|
122
122
|
html_options.each do |key, value|
|
123
123
|
if key == :style && value.is_a?(Hash)
|
124
124
|
# Convert style hash to CSS string
|
125
|
-
merged[:style] = value.map { |k, v| "#{k.to_s.
|
125
|
+
merged[:style] = value.map { |k, v| "#{k.to_s.gsub('_', '-')}: #{v}" }.join("; ")
|
126
126
|
else
|
127
127
|
merged[key] = value
|
128
128
|
end
|
@@ -136,27 +136,6 @@ module Playbook
|
|
136
136
|
merged.deep_merge(data_attributes)
|
137
137
|
end
|
138
138
|
|
139
|
-
# Custom react_component helper to replace Webpacker React
|
140
|
-
# This will render a div with data attributes for the component name and props
|
141
|
-
# The mounting script will look for these divs and mount the appropriate React components
|
142
|
-
# Sister def in app/helpers/react_helper in playbook-website. Any changes here should be reflected there.
|
143
|
-
def react_component(component_name, props = {}, html_options = {})
|
144
|
-
# Convert props to JSON for the data attribute
|
145
|
-
props_json = props.to_json
|
146
|
-
|
147
|
-
# Build the HTML attributes
|
148
|
-
html_attrs = {
|
149
|
-
"data-pb-react-component" => component_name,
|
150
|
-
"data-pb-react-props" => props_json,
|
151
|
-
}
|
152
|
-
|
153
|
-
# Merge with any additional HTML options
|
154
|
-
html_attrs.merge!(html_options)
|
155
|
-
|
156
|
-
# Return the div element
|
157
|
-
content_tag(:div, "", html_attrs)
|
158
|
-
end
|
159
|
-
|
160
139
|
def global_inline_props
|
161
140
|
{
|
162
141
|
height: height,
|
@@ -193,7 +172,7 @@ module Playbook
|
|
193
172
|
end
|
194
173
|
|
195
174
|
def dynamic_inline_props
|
196
|
-
styles = global_inline_props.map { |key, value| "#{key.to_s.
|
175
|
+
styles = global_inline_props.map { |key, value| "#{key.to_s.gsub('_', '-')}: #{value}" if inline_validator(key, value) }.compact
|
197
176
|
styles.join("; ").presence
|
198
177
|
end
|
199
178
|
|
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.0.0.pre.alpha.
|
4
|
+
version: 15.0.0.pre.alpha.PLAY198710641
|
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-09-
|
12
|
+
date: 2025-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 5.2.4.5
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: react-rails
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 2.6.1
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.6.1
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: view_component
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,19 +82,19 @@ dependencies:
|
|
68
82
|
- !ruby/object:Gem::Version
|
69
83
|
version: 2.83.0
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
85
|
+
name: webpacker-react
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
|
-
- - "
|
88
|
+
- - "~>"
|
75
89
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
90
|
+
version: 0.3.2
|
77
91
|
type: :runtime
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
|
-
- - "
|
95
|
+
- - "~>"
|
82
96
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
97
|
+
version: 0.3.2
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: brakeman
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -875,7 +889,6 @@ files:
|
|
875
889
|
- app/pb_kits/playbook/pb_contact/contact.test.js
|
876
890
|
- app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb
|
877
891
|
- app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx
|
878
|
-
- app/pb_kits/playbook/pb_contact/docs/_contact_default.md
|
879
892
|
- app/pb_kits/playbook/pb_contact/docs/_contact_default_swift.md
|
880
893
|
- app/pb_kits/playbook/pb_contact/docs/_contact_props_swift.md
|
881
894
|
- app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb
|
@@ -2757,7 +2770,6 @@ files:
|
|
2757
2770
|
- app/pb_kits/playbook/pb_section_separator/docs/index.js
|
2758
2771
|
- app/pb_kits/playbook/pb_section_separator/section_separator.html.erb
|
2759
2772
|
- app/pb_kits/playbook/pb_section_separator/section_separator.rb
|
2760
|
-
- app/pb_kits/playbook/pb_section_separator/section_separator.test.js
|
2761
2773
|
- app/pb_kits/playbook/pb_select/_select.scss
|
2762
2774
|
- app/pb_kits/playbook/pb_select/_select.tsx
|
2763
2775
|
- app/pb_kits/playbook/pb_select/docs/_description.md
|
@@ -3699,13 +3711,12 @@ files:
|
|
3699
3711
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3700
3712
|
- app/pb_kits/playbook/utilities/text.ts
|
3701
3713
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3702
|
-
- dist/chunks/_line_graph-
|
3703
|
-
- dist/chunks/_typeahead-
|
3704
|
-
- dist/chunks/_weekday_stacked-
|
3705
|
-
- dist/chunks/componentRegistry-DzmmLR2x.js
|
3714
|
+
- dist/chunks/_line_graph-CUfJ7E4h.js
|
3715
|
+
- dist/chunks/_typeahead-DCp1lVJx.js
|
3716
|
+
- dist/chunks/_weekday_stacked-B-e7xOfU.js
|
3706
3717
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3707
|
-
- dist/chunks/lib-
|
3708
|
-
- dist/chunks/pb_form_validation-
|
3718
|
+
- dist/chunks/lib-BTs5acfO.js
|
3719
|
+
- dist/chunks/pb_form_validation-CKkaQFX3.js
|
3709
3720
|
- dist/chunks/vendor.js
|
3710
3721
|
- dist/menu.yml
|
3711
3722
|
- dist/playbook-doc.js
|
@@ -1,5 +0,0 @@
|
|
1
|
-
The Contact kit automatically formats US phone numbers when the `contactType` / `contact_type` is one of: `home` (default), `work`, `cell`, `work-cell`, `wrong-phone`.
|
2
|
-
|
3
|
-
- Use `email` to display emails.
|
4
|
-
- Use `international` to display International phone numbers exactly as provided (no formatting applied).
|
5
|
-
- Use `extension` to display four digit phone extensions.
|
@@ -1,165 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { render, screen } from '../utilities/test-utils'
|
3
|
-
|
4
|
-
import SectionSeparator from './_section_separator'
|
5
|
-
|
6
|
-
const testId = "section-separator-kit"
|
7
|
-
|
8
|
-
describe("Section Separator Kit", () => {
|
9
|
-
test("renders basic section separator with default props", () => {
|
10
|
-
render(
|
11
|
-
<SectionSeparator
|
12
|
-
data={{ testid: testId }}
|
13
|
-
/>
|
14
|
-
)
|
15
|
-
|
16
|
-
const kit = screen.getByTestId(testId)
|
17
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
18
|
-
})
|
19
|
-
|
20
|
-
test("renders with text prop", () => {
|
21
|
-
const text = "Section Title"
|
22
|
-
render(
|
23
|
-
<SectionSeparator
|
24
|
-
data={{ testid: testId }}
|
25
|
-
text={text}
|
26
|
-
/>
|
27
|
-
)
|
28
|
-
|
29
|
-
const kit = screen.getByTestId(testId)
|
30
|
-
const textElement = screen.getByText(text)
|
31
|
-
|
32
|
-
expect(kit).toHaveClass("pb_section_separator_kit")
|
33
|
-
expect(textElement).toBeInTheDocument()
|
34
|
-
})
|
35
|
-
|
36
|
-
test("renders with children", () => {
|
37
|
-
const childText = "Custom Content"
|
38
|
-
render(
|
39
|
-
<SectionSeparator
|
40
|
-
data={{ testid: testId }}
|
41
|
-
>
|
42
|
-
<span>{childText}</span>
|
43
|
-
</SectionSeparator>
|
44
|
-
)
|
45
|
-
|
46
|
-
const kit = screen.getByTestId(testId)
|
47
|
-
const childElement = screen.getByText(childText)
|
48
|
-
|
49
|
-
expect(kit).toHaveClass("pb_section_separator_kit")
|
50
|
-
expect(childElement).toBeInTheDocument()
|
51
|
-
})
|
52
|
-
|
53
|
-
test("renders vertical orientation", () => {
|
54
|
-
render(
|
55
|
-
<SectionSeparator
|
56
|
-
data={{ testid: testId }}
|
57
|
-
orientation="vertical"
|
58
|
-
/>
|
59
|
-
)
|
60
|
-
|
61
|
-
const kit = screen.getByTestId(testId)
|
62
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_vertical pb_section_separator_solid pb_section_separator_color_default")
|
63
|
-
})
|
64
|
-
|
65
|
-
test("renders background variant", () => {
|
66
|
-
render(
|
67
|
-
<SectionSeparator
|
68
|
-
data={{ testid: testId }}
|
69
|
-
variant="background"
|
70
|
-
/>
|
71
|
-
)
|
72
|
-
|
73
|
-
const kit = screen.getByTestId(testId)
|
74
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_background pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
75
|
-
})
|
76
|
-
|
77
|
-
test("renders dashed line style", () => {
|
78
|
-
render(
|
79
|
-
<SectionSeparator
|
80
|
-
data={{ testid: testId }}
|
81
|
-
lineStyle="dashed"
|
82
|
-
/>
|
83
|
-
)
|
84
|
-
|
85
|
-
const kit = screen.getByTestId(testId)
|
86
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_dashed pb_section_separator_color_default")
|
87
|
-
})
|
88
|
-
|
89
|
-
test("renders primary color", () => {
|
90
|
-
render(
|
91
|
-
<SectionSeparator
|
92
|
-
color="primary"
|
93
|
-
data={{ testid: testId }}
|
94
|
-
/>
|
95
|
-
)
|
96
|
-
|
97
|
-
const kit = screen.getByTestId(testId)
|
98
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_primary")
|
99
|
-
})
|
100
|
-
|
101
|
-
test("renders dark mode", () => {
|
102
|
-
render(
|
103
|
-
<SectionSeparator
|
104
|
-
dark
|
105
|
-
data={{ testid: testId }}
|
106
|
-
/>
|
107
|
-
)
|
108
|
-
|
109
|
-
const kit = screen.getByTestId(testId)
|
110
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
111
|
-
})
|
112
|
-
|
113
|
-
test("renders with custom className", () => {
|
114
|
-
const customClass = "custom-class"
|
115
|
-
render(
|
116
|
-
<SectionSeparator
|
117
|
-
className={customClass}
|
118
|
-
data={{ testid: testId }}
|
119
|
-
/>
|
120
|
-
)
|
121
|
-
|
122
|
-
const kit = screen.getByTestId(testId)
|
123
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default custom-class")
|
124
|
-
})
|
125
|
-
|
126
|
-
test("renders vertical with children", () => {
|
127
|
-
const childText = "Vertical Content"
|
128
|
-
render(
|
129
|
-
<SectionSeparator
|
130
|
-
data={{ testid: testId }}
|
131
|
-
orientation="vertical"
|
132
|
-
>
|
133
|
-
<span>{childText}</span>
|
134
|
-
</SectionSeparator>
|
135
|
-
)
|
136
|
-
|
137
|
-
const kit = screen.getByTestId(testId)
|
138
|
-
const childElement = screen.getByText(childText)
|
139
|
-
|
140
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_vertical pb_section_separator_solid pb_section_separator_color_default")
|
141
|
-
expect(childElement).toBeInTheDocument()
|
142
|
-
})
|
143
|
-
|
144
|
-
test("renders all props combined", () => {
|
145
|
-
const text = "Combined Props"
|
146
|
-
render(
|
147
|
-
<SectionSeparator
|
148
|
-
color="primary"
|
149
|
-
dark
|
150
|
-
data={{ testid: testId }}
|
151
|
-
lineStyle="dashed"
|
152
|
-
orientation="vertical"
|
153
|
-
variant="background"
|
154
|
-
>
|
155
|
-
<span>{text}</span>
|
156
|
-
</SectionSeparator>
|
157
|
-
)
|
158
|
-
|
159
|
-
const kit = screen.getByTestId(testId)
|
160
|
-
const childElement = screen.getByText(text)
|
161
|
-
|
162
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_background pb_section_separator_vertical pb_section_separator_dashed pb_section_separator_color_primary")
|
163
|
-
expect(childElement).toBeInTheDocument()
|
164
|
-
})
|
165
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
import React__default from"react";import ReactDOM__default from"react-dom";class ComponentRegistry{constructor(){this.components=new Map;this.mountedComponents=new Set;this._mountQueue=new WeakMap}register(name,component){this.components.set(name,component);const kebab=this.toKebabCase(name);if(kebab!==name)this.components.set(kebab,component)}registerComponents(components){Object.entries(components).forEach((([name,comp])=>this.register(name,comp)))}get(name){return this.components.get(name)}mountComponents(root=document){const nodes=root.querySelectorAll("[data-pb-react-component]");nodes.forEach((el=>{if(this.mountedComponents.has(el))return;const name=el.getAttribute("data-pb-react-component");if(!name)return;const Comp=this.get(name);if(!Comp)return;this._scheduleMount(el,Comp)}))}_scheduleMount(el,Comp,immediate=false){let entry=this._mountQueue.get(el);if(!entry){entry={scheduled:false,retries:0};this._mountQueue.set(el,entry)}if(entry.scheduled&&!immediate)return;const run=()=>{entry.scheduled=false;this._tryRender(el,Comp,entry)};entry.scheduled=true;if(immediate){run()}else{requestAnimationFrame(run)}}_tryRender(el,Comp,entry){if(!el.isConnected)return;try{const props=this.extractProps(el);ReactDOM__default.render(React__default.createElement(Comp,props),el);this.mountedComponents.add(el);entry.retries=0}catch(err){entry.retries=(entry.retries||0)+1;if(entry.retries<=3){this._scheduleMount(el,Comp,false)}else{console.warn("[PB] Mount failed after retries:",err)}}}unmountComponents(){this.mountedComponents.forEach((el=>{this._safeUnmount(el)}));this.mountedComponents.clear()}unmountWithin(rootEl){if(!rootEl)return;const toUnmount=[];this.mountedComponents.forEach((el=>{if(rootEl.contains(el))toUnmount.push(el)}));toUnmount.forEach((el=>this._safeUnmount(el)))}_safeUnmount(el){if(!el||!el.isConnected){this.mountedComponents.delete(el);return}try{ReactDOM__default.unmountComponentAtNode(el)}catch(err){console.warn("[PB] Unmount warning:",err)}this.mountedComponents.delete(el)}extractProps(el){const props={};const blob=el.getAttribute("data-pb-react-props");if(blob){try{Object.assign(props,JSON.parse(blob))}catch(e){console.warn("[PB] Failed to parse data-pb-react-props JSON:",e)}}Array.from(el.attributes).forEach((attr=>{const name=attr.name;if(!name.startsWith("data-pb-"))return;if(name==="data-pb-react-component"||name==="data-pb-react-props")return;const key=name.replace("data-pb-","");if(props[key]===void 0)props[key]=attr.value}));return props}toKebabCase(str){return str.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").toLowerCase()}}window.ComponentRegistry=window.ComponentRegistry||new ComponentRegistry;const ComponentRegistry$1=window.ComponentRegistry;export{ComponentRegistry$1 as C};
|