playbook_ui_docs 15.5.0.pre.alpha.play265012854 → 15.5.0.pre.alpha.revert5553typeaheadfix12763

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 052c6710f6a8cc40ce1f4fd6b78c60bdb1240c219f628a5845a5f0803b800c6d
4
- data.tar.gz: 4a7ba66407b858d9c1b7f6d7bda584d7f7ea7b2bc4ae92ff96b32888afd548d7
3
+ metadata.gz: 2accdc5d1717afbf469975a20877c07369cf5edf7532dd2596d31a102eedd322
4
+ data.tar.gz: 59334871af39998f1a402ddd2d37ca0dfe9960a0012077a215000473a092227a
5
5
  SHA512:
6
- metadata.gz: f11973a9b4e903c89b5b3a9eb1dd6a19a0feae60ecf9850cc551abbee35c528415b02228096163ac97814115ffc1522e33dc512801df5ebadba14becdfa7ae4c
7
- data.tar.gz: e247b82c567b82f1b64106c987b30507ee14918edf81b6ee2df6681e1419c004ff7e9308c8cb825d08df052b0a4842528c46862b0b5d816587879f611ab568b9
6
+ metadata.gz: 600dd8aaa3a5c2be79065a80a4d321b6c04a38e2755836d0b3b8b7c14501f03147ac57a77b9453a58e8dbeef1949bfb51250991be4607902c78180abd257ad7f
7
+ data.tar.gz: d79137791dac164368dd0b1b9717d05cbde2f77ff11a778097771b2131361e2f74f5227be59667ebb217a61d4a584960170c20b3755ee74728aa531d3f2f7740
@@ -1,3 +1,3 @@
1
- <%= pb_rails("background", props: { padding: "xl" }) do %>
1
+ <%= pb_rails("background", props: { background_color: "light", padding: "xl" }) do %>
2
2
 
3
3
  <% end %>
@@ -3,6 +3,7 @@ import Background from '../../pb_background/_background'
3
3
 
4
4
  const BackgroundLight = (props) => (
5
5
  <Background
6
+ backgroundColor="light"
6
7
  padding="xl"
7
8
  {...props}
8
9
  />
@@ -1,7 +1,7 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
- - background_light: Default
4
+ - background_light: Light
5
5
  - background_white: White
6
6
  - background_gradient: Gradient
7
7
  - background_image: Image
@@ -11,7 +11,7 @@ examples:
11
11
  - background_size: Size
12
12
 
13
13
  react:
14
- - background_light: Default
14
+ - background_light: Light
15
15
  - background_white: White
16
16
  - background_gradient: Gradient
17
17
  - background_image: Image
@@ -1,24 +1,3 @@
1
- <%
2
- options = [
3
- {
4
- label: "United States",
5
- value: "unitedStates",
6
- id: "us"
7
- },
8
- {
9
- label: "United Kingdom",
10
- value: "unitedKingdom",
11
- id: "gb"
12
- },
13
- {
14
- label: "Pakistan",
15
- value: "pakistan",
16
- id: "pk"
17
- }
18
- ]
19
- %>
20
-
21
-
22
1
  <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
23
2
 
24
3
  <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
@@ -31,16 +10,6 @@
31
10
  <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
32
11
  <%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
33
12
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
34
- <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
35
- <%= pb_rails("typeahead", props: {
36
- id: "typeahead-default",
37
- placeholder: "Select one...",
38
- options: options,
39
- name: :foo,
40
- margin_top: "sm",
41
- is_multi: false
42
- })
43
- %>
44
13
 
45
14
  <% end %>
46
15
  <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
@@ -1,42 +1,12 @@
1
1
  <form id="example-form-validation" action="" method="get">
2
- <%= pb_rails("phone_number_input", props: {
3
- id: "validation",
4
- initial_country: "af",
5
- value: "",
6
- required: true
7
- }) %>
2
+ <%= pb_rails("phone_number_input", props: { error: "Missing phone number", id: "validation", initial_country: "af", value: "", required: true }) %>
8
3
  <%= pb_rails("button", props: {html_type: "submit", text: "Save Phone Number"}) %>
9
4
  </form>
10
5
 
11
6
  <%= javascript_tag do %>
12
7
  document.addEventListener('DOMContentLoaded', function () {
13
- const form = document.querySelector('#example-form-validation');
14
-
15
- // Wait for React component to mount
16
- function waitForComponent() {
17
- const phoneInput = form.querySelector('#validation');
18
-
19
- if (!phoneInput) {
20
- setTimeout(waitForComponent, 100);
21
- return;
22
- }
23
-
24
- // Wait for intl-tel-input to initialize, then focus and blur to trigger validation
25
- setTimeout(function() {
26
- phoneInput.focus({ preventScroll: true });
27
- setTimeout(function() {
28
- phoneInput.blur();
29
- }, 100);
30
- }, 500);
31
- }
32
-
33
- waitForComponent();
34
-
35
- // Prevent form submission if there are validation errors
36
- form.addEventListener('submit', function (e) {
37
- if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) {
38
- e.preventDefault();
39
- }
40
- });
8
+ document.querySelector('#example-form-validation').addEventListener('submit', function (e) {
9
+ if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) e.preventDefault();
10
+ })
41
11
  })
42
12
  <% end %>
@@ -10,19 +10,8 @@ const PhoneNumberInputValidation = (props) => {
10
10
  const [showFormErrors, setShowFormErrors] = useState(false);
11
11
  const [phoneNumber, setPhoneNumber] = useState("");
12
12
  const [countryCode, setCountryCode] = useState("af");
13
- const [isValid, setIsValid] = useState(false);
14
- const [hasInteracted, setHasInteracted] = useState(false);
15
-
16
- // Start with initial error - will be cleared on blur if valid
17
- const initialError = (
18
- <>
19
- <Icon icon="warning" /> Missing phone number.
20
- </>
21
- );
22
13
 
23
14
  const handleOnValidate = (valid) => {
24
- setIsValid(valid);
25
- setHasInteracted(true);
26
15
  setFormErrors(
27
16
  valid ? "" : "Please correct the fields below and try again."
28
17
  );
@@ -34,16 +23,18 @@ const PhoneNumberInputValidation = (props) => {
34
23
  };
35
24
 
36
25
  const handleOnSubmit = (e) => {
37
- if (!isValid) e.preventDefault()
26
+ if (showFormErrors) e.preventDefault()
38
27
  }
39
28
 
40
29
  useEffect(() => {
41
30
  setShowFormErrors(formErrors.length > 0);
42
31
  }, [formErrors]);
43
32
 
44
- // Only show error prop initially, or if invalid after interaction
45
- // Clear error prop once valid (component handles validation on blur)
46
- const shouldShowError = !hasInteracted || (hasInteracted && !isValid);
33
+ const error = (
34
+ <>
35
+ <Icon icon="warning" /> Missing phone number.
36
+ </>
37
+ )
47
38
 
48
39
  return (
49
40
  <form
@@ -59,7 +50,7 @@ const PhoneNumberInputValidation = (props) => {
59
50
  />
60
51
  )}
61
52
  <PhoneNumberInput
62
- error={shouldShowError ? initialError : undefined}
53
+ error={error}
63
54
  id="validation"
64
55
  initialCountry={countryCode}
65
56
  onChange={handleOnChange}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.5.0.pre.alpha.play265012854
4
+ version: 15.5.0.pre.alpha.revert5553typeaheadfix12763
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-05 00:00:00.000000000 Z
12
+ date: 2025-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -220,7 +220,6 @@ files:
220
220
  - app/pb_kits/playbook/pb_background/docs/_background_image.md
221
221
  - app/pb_kits/playbook/pb_background/docs/_background_light.html.erb
222
222
  - app/pb_kits/playbook/pb_background/docs/_background_light.jsx
223
- - app/pb_kits/playbook/pb_background/docs/_background_light.md
224
223
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx
225
224
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.md
226
225
  - app/pb_kits/playbook/pb_background/docs/_background_size.html.erb
@@ -1 +0,0 @@
1
- By default, the Background kit sets background color to 'light' as seen here.