playbook_ui 15.1.0.pre.rc.3 → 15.1.0.pre.rc.4
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/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +12 -4
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +10 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +3 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +8 -0
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +1 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +2 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +19 -5
- data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +3 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +62 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +31 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +81 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +25 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +40 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +5 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +27 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +39 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +5 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +93 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +131 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +14 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +42 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +58 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +24 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +38 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +22 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +33 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +118 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +144 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +60 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +24 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +42 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +38 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +52 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +29 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +88 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +28 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +51 -0
- data/dist/chunks/{_line_graph-BBny-YYZ.js → _line_graph-CUfJ7E4h.js} +1 -1
- data/dist/chunks/{_typeahead-CeyJ6-GF.js → _typeahead-DCp1lVJx.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CUUNTwVc.js → _weekday_stacked-YwRTPuBs.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -0
- 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/forms/builder/form_field_builder.rb +28 -1
- data/lib/playbook/version.rb +1 -1
- metadata +37 -5
@@ -4,6 +4,15 @@ module Playbook
|
|
4
4
|
module Forms
|
5
5
|
class Builder
|
6
6
|
class FormFieldBuilder < Module
|
7
|
+
MASK_PATTERNS = {
|
8
|
+
"currency" => '^\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?$',
|
9
|
+
"zip_code" => '\d{5}',
|
10
|
+
"postal_code" => '\d{5}-\d{4}',
|
11
|
+
"ssn" => '\d{3}-\d{2}-\d{4}',
|
12
|
+
"credit_card" => '\d{4} \d{4} \d{4} \d{4}',
|
13
|
+
"cvv" => '\d{3,4}',
|
14
|
+
}.freeze
|
15
|
+
|
7
16
|
def initialize(method_name, kit_name:)
|
8
17
|
define_method method_name do |name, props: {}, **options, &block|
|
9
18
|
props = props.dup
|
@@ -12,11 +21,29 @@ module Playbook
|
|
12
21
|
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
13
22
|
options[:required] = true if props[:required]
|
14
23
|
options[:placeholder] = props[:placeholder] || ""
|
24
|
+
options[:type] = props[:type] if props.key?(:type)
|
25
|
+
options[:value] = props[:value] if props.key?(:value)
|
26
|
+
options[:disabled] = true if props.key?(:disabled) && props[:disabled]
|
27
|
+
if props.key?(:disabled)
|
28
|
+
cursor_style = props[:disabled] ? "not-allowed" : "pointer"
|
29
|
+
existing_style = options[:style] || ""
|
30
|
+
|
31
|
+
options[:style] =
|
32
|
+
existing_style.empty? ? "cursor: #{cursor_style}" : "#{existing_style}; cursor: #{cursor_style}"
|
33
|
+
end
|
34
|
+
if props.key?(:autocomplete)
|
35
|
+
options[:autocomplete] = props[:autocomplete] == true ? nil : (props[:autocomplete].presence || "off")
|
36
|
+
end
|
37
|
+
if props.key?(:mask) && props[:mask].present?
|
38
|
+
options[:mask] = props[:mask]
|
39
|
+
options[:data] = (options[:data] || {}).merge(pb_input_mask: true)
|
40
|
+
options[:pattern] = MASK_PATTERNS[props[:mask]]
|
41
|
+
end
|
15
42
|
|
16
43
|
if props.key?(:validation)
|
17
44
|
validation = props[:validation]
|
18
45
|
options[:pattern] = validation[:pattern] if validation[:pattern].present?
|
19
|
-
options[:data] = {
|
46
|
+
options[:data] = (options[:data] || {}).merge(message: validation[:message]) if validation[:message].present?
|
20
47
|
end
|
21
48
|
|
22
49
|
input = super(name, **options, &block)
|
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.1.0.pre.rc.
|
4
|
+
version: 15.1.0.pre.rc.4
|
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-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -2448,6 +2448,38 @@ files:
|
|
2448
2448
|
- app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb
|
2449
2449
|
- app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb
|
2450
2450
|
- app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx
|
2451
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss
|
2452
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx
|
2453
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb
|
2454
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx
|
2455
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb
|
2456
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx
|
2457
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md
|
2458
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb
|
2459
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx
|
2460
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md
|
2461
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb
|
2462
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx
|
2463
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md
|
2464
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb
|
2465
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx
|
2466
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb
|
2467
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx
|
2468
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb
|
2469
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx
|
2470
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb
|
2471
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx
|
2472
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx
|
2473
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb
|
2474
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx
|
2475
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb
|
2476
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx
|
2477
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml
|
2478
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js
|
2479
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts
|
2480
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb
|
2481
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb
|
2482
|
+
- app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx
|
2451
2483
|
- app/pb_kits/playbook/pb_person/_person.scss
|
2452
2484
|
- app/pb_kits/playbook/pb_person/_person.tsx
|
2453
2485
|
- app/pb_kits/playbook/pb_person/docs/_description.md
|
@@ -3657,9 +3689,9 @@ files:
|
|
3657
3689
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3658
3690
|
- app/pb_kits/playbook/utilities/text.ts
|
3659
3691
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3660
|
-
- dist/chunks/_line_graph-
|
3661
|
-
- dist/chunks/_typeahead-
|
3662
|
-
- dist/chunks/_weekday_stacked-
|
3692
|
+
- dist/chunks/_line_graph-CUfJ7E4h.js
|
3693
|
+
- dist/chunks/_typeahead-DCp1lVJx.js
|
3694
|
+
- dist/chunks/_weekday_stacked-YwRTPuBs.js
|
3663
3695
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3664
3696
|
- dist/chunks/lib-BTs5acfO.js
|
3665
3697
|
- dist/chunks/pb_form_validation-CKkaQFX3.js
|