playbook-ui 18.2.0-rc.1 → 18.2.0-rc.2

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.
@@ -2412,7 +2412,7 @@
2412
2412
  ],
2413
2413
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
2414
2414
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
2415
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
2415
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
2416
2416
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
2417
2417
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
2418
2418
  "sources": [
@@ -3015,7 +3015,7 @@
3015
3015
  ],
3016
3016
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
3017
3017
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
3018
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
3018
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
3019
3019
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
3020
3020
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
3021
3021
  "sources": [
@@ -3049,13 +3049,14 @@
3049
3049
  "type": "boolean",
3050
3050
  "example": "@user.errors[:terms].any?",
3051
3051
  "description": "Checkbox does not auto-map record.errors. Pass a boolean styling flag; render any error message separately."
3052
- }
3052
+ },
3053
+ "client": "props.validation_message becomes data-message on the checkbox input."
3053
3054
  },
3054
3055
  "block": {
3055
3056
  "supported": false,
3056
3057
  "description": "The builder supplies the Rails checkbox as kit content; caller blocks are not forwarded."
3057
3058
  },
3058
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.check_box :terms, checked_value: \"1\", unchecked_value: \"0\", props: { label: true, required: true, error: @user.errors[:terms].any? } %>\n<% end %>",
3059
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.check_box :terms, checked_value: \"1\", unchecked_value: \"0\", props: { label: true, required: true, validation_message: \"Please accept the terms\", error: @user.errors[:terms].any? } %>\n<% end %>",
3059
3060
  "kit": "checkbox",
3060
3061
  "signature": "check_box(name, props: {}, **options)",
3061
3062
  "sources": [
@@ -3091,9 +3092,10 @@
3091
3092
  "questions": [
3092
3093
  "How do I show ActiveRecord errors?",
3093
3094
  "Does required_indicator validate?",
3094
- "How do I enable client validation?"
3095
+ "How do I enable client validation?",
3096
+ "How do I set a custom required-field message?"
3095
3097
  ],
3096
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
3098
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
3097
3099
  "contractPaths": [
3098
3100
  "form.rails.builder.validation",
3099
3101
  "form.rails.builder.methods"
@@ -4384,7 +4386,7 @@
4384
4386
  ],
4385
4387
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
4386
4388
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
4387
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
4389
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
4388
4390
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
4389
4391
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
4390
4392
  "sources": [
@@ -4460,9 +4462,10 @@
4460
4462
  "questions": [
4461
4463
  "How do I show ActiveRecord errors?",
4462
4464
  "Does required_indicator validate?",
4463
- "How do I enable client validation?"
4465
+ "How do I enable client validation?",
4466
+ "How do I set a custom required-field message?"
4464
4467
  ],
4465
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
4468
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
4466
4469
  "contractPaths": [
4467
4470
  "form.rails.builder.validation",
4468
4471
  "form.rails.builder.methods"
@@ -5677,6 +5680,13 @@
5677
5680
  "type": "boolean",
5678
5681
  "default": false
5679
5682
  },
5683
+ "validationMessage": {
5684
+ "platforms": [
5685
+ "rails"
5686
+ ],
5687
+ "type": "string",
5688
+ "default": ""
5689
+ },
5680
5690
  "searchTermMinimumLength": {
5681
5691
  "platforms": [
5682
5692
  "rails"
@@ -5784,7 +5794,7 @@
5784
5794
  ],
5785
5795
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
5786
5796
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
5787
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
5797
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
5788
5798
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
5789
5799
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
5790
5800
  "sources": [
@@ -5825,9 +5835,9 @@
5825
5835
  "example": "Omit props.error, or pass an explicit message / nil to override",
5826
5836
  "description": "Unless props.error is set (including explicit nil), the builder sets it from record.errors.full_messages_for(attribute).first when present."
5827
5837
  },
5828
- "client": "No validation or input_options prop is exposed by this Rails kit."
5838
+ "client": "props.validation_message becomes data-message on the CSS-hidden input (single and multi-select)."
5829
5839
  },
5830
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.dropdown_field :country, props: { label: \"Country\", options: [{ id: \"ca\", value: \"canada\", label: \"Canada\" }], required: true } %>\n<% end %>",
5840
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.dropdown_field :country, props: { label: \"Country\", options: [{ id: \"ca\", value: \"canada\", label: \"Canada\" }], required: true, validation_message: \"Please select a country\" } %>\n<% end %>",
5831
5841
  "kit": "dropdown",
5832
5842
  "signature": "dropdown_field(name, props: {})",
5833
5843
  "sources": [
@@ -5863,9 +5873,10 @@
5863
5873
  "questions": [
5864
5874
  "How do I show ActiveRecord errors?",
5865
5875
  "Does required_indicator validate?",
5866
- "How do I enable client validation?"
5876
+ "How do I enable client validation?",
5877
+ "How do I set a custom required-field message?"
5867
5878
  ],
5868
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
5879
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
5869
5880
  "contractPaths": [
5870
5881
  "form.rails.builder.validation",
5871
5882
  "form.rails.builder.methods"
@@ -8968,6 +8979,13 @@
8968
8979
  "accessories"
8969
8980
  ],
8970
8981
  "default": "primary"
8982
+ },
8983
+ "validationMessage": {
8984
+ "platforms": [
8985
+ "rails"
8986
+ ],
8987
+ "type": "string",
8988
+ "default": ""
8971
8989
  }
8972
8990
  },
8973
8991
  "globalProps": true,
@@ -8995,7 +9013,7 @@
8995
9013
  ],
8996
9014
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
8997
9015
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
8998
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
9016
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
8999
9017
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
9000
9018
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
9001
9019
  "sources": [
@@ -9026,7 +9044,7 @@
9026
9044
  "multi": "Pass user[regions], without [], to submit user[regions][] entries."
9027
9045
  },
9028
9046
  "validation": {
9029
- "required": "props.required is used by the kit; hidden selected-value inputs also receive required. Do not infer native validation from hidden inputs.",
9047
+ "required": "props.required is used by the kit. The search input is required when empty; kit JS removes required from the search input once currentSelected() is non-empty. Hidden selected-value inputs also receive required, but type=hidden is not constraint-validated.",
9030
9048
  "indicator": "props.required_indicator is visual only.",
9031
9049
  "error": {
9032
9050
  "automatic": true,
@@ -9034,9 +9052,10 @@
9034
9052
  "type": "string",
9035
9053
  "example": "Omit props.error, or pass an explicit message / nil to override",
9036
9054
  "description": "Unless props.error is set (including explicit nil), the builder sets it from record.errors.full_messages_for(attribute).first when present."
9037
- }
9055
+ },
9056
+ "client": "props.validation_message becomes data-message on the search input. Kit JS clears custom validity when the selection changes."
9038
9057
  },
9039
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.multi_level_select :regions, props: { label: \"Regions\", tree_data: @regions, required: true } %>\n<% end %>",
9058
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.multi_level_select :regions, props: { label: \"Regions\", tree_data: @regions, required: true, validation_message: \"Please select a region\" } %>\n<% end %>",
9040
9059
  "kit": "multi_level_select",
9041
9060
  "signature": "multi_level_select(name, props: {})",
9042
9061
  "sources": [
@@ -9072,9 +9091,10 @@
9072
9091
  "questions": [
9073
9092
  "How do I show ActiveRecord errors?",
9074
9093
  "Does required_indicator validate?",
9075
- "How do I enable client validation?"
9094
+ "How do I enable client validation?",
9095
+ "How do I set a custom required-field message?"
9076
9096
  ],
9077
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
9097
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
9078
9098
  "contractPaths": [
9079
9099
  "form.rails.builder.validation",
9080
9100
  "form.rails.builder.methods"
@@ -10143,6 +10163,14 @@
10143
10163
  ],
10144
10164
  "default": false
10145
10165
  },
10166
+ "validationMessage": {
10167
+ "type": "string",
10168
+ "platforms": [
10169
+ "react",
10170
+ "rails"
10171
+ ],
10172
+ "default": ""
10173
+ },
10146
10174
  "value": {
10147
10175
  "type": "string",
10148
10176
  "platforms": [
@@ -10209,7 +10237,7 @@
10209
10237
  ],
10210
10238
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
10211
10239
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
10212
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
10240
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
10213
10241
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
10214
10242
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
10215
10243
  "sources": [
@@ -10248,9 +10276,10 @@
10248
10276
  "type": "string",
10249
10277
  "example": "Omit props.error, or pass an explicit message / nil to override",
10250
10278
  "description": "Unless props.error is set (including explicit nil), the builder sets it from record.errors.full_messages_for(attribute).first when present."
10251
- }
10279
+ },
10280
+ "client": "props.validation_message replaces the kit-owned required empty-field copy (default \"Missing phone number\"). Format errors remain kit-owned. PbFormValidation skips phone fields."
10252
10281
  },
10253
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.intl_telephone :phone, props: { label: \"Phone\", required: true } %>\n<% end %>",
10282
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.intl_telephone :phone, props: { label: \"Phone\", required: true, validation_message: \"Phone number is required\" } %>\n<% end %>",
10254
10283
  "kit": "phone_number_input",
10255
10284
  "signature": "intl_telephone(name, props: {})",
10256
10285
  "sources": [
@@ -10288,9 +10317,10 @@
10288
10317
  "type": "string",
10289
10318
  "example": "Omit props.error, or pass an explicit message / nil to override",
10290
10319
  "description": "Unless props.error is set (including explicit nil), the builder sets it from record.errors.full_messages_for(attribute).first when present."
10291
- }
10320
+ },
10321
+ "client": "props.validation_message replaces the kit-owned required empty-field copy (default \"Missing phone number\"). Format errors remain kit-owned. PbFormValidation skips phone fields."
10292
10322
  },
10293
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.phone_number_field :phone, props: { label: \"Phone\", required: true } %>\n<% end %>",
10323
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.phone_number_field :phone, props: { label: \"Phone\", required: true, validation_message: \"Phone number is required\" } %>\n<% end %>",
10294
10324
  "kit": "phone_number_input",
10295
10325
  "signature": "phone_number_field(name, props: {})",
10296
10326
  "sources": [
@@ -10326,9 +10356,10 @@
10326
10356
  "questions": [
10327
10357
  "How do I show ActiveRecord errors?",
10328
10358
  "Does required_indicator validate?",
10329
- "How do I enable client validation?"
10359
+ "How do I enable client validation?",
10360
+ "How do I set a custom required-field message?"
10330
10361
  ],
10331
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
10362
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
10332
10363
  "contractPaths": [
10333
10364
  "form.rails.builder.validation",
10334
10365
  "form.rails.builder.methods"
@@ -11467,7 +11498,7 @@
11467
11498
  ],
11468
11499
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
11469
11500
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
11470
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
11501
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
11471
11502
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
11472
11503
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
11473
11504
  "sources": [
@@ -11490,7 +11521,7 @@
11490
11521
  },
11491
11522
  "htmlOptions": {
11492
11523
  "argument": "html_options",
11493
- "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. props.blank_selection sets options.prompt (default empty)."
11524
+ "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. An explicitly supplied props.blank_selection sets options.prompt (nil becomes empty), overriding any explicit prompt. Otherwise options.prompt is preserved, including false or nil to omit the prompt; when neither is supplied, the prompt defaults to empty."
11494
11525
  },
11495
11526
  "validation": {
11496
11527
  "required": "props.required sets html_options.required.",
@@ -11530,7 +11561,7 @@
11530
11561
  },
11531
11562
  "htmlOptions": {
11532
11563
  "argument": "html_options",
11533
- "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. props.blank_selection sets options.prompt (default empty)."
11564
+ "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. An explicitly supplied props.blank_selection sets options.prompt (nil becomes empty), overriding any explicit prompt. Otherwise options.prompt is preserved, including false or nil to omit the prompt; when neither is supplied, the prompt defaults to empty."
11534
11565
  },
11535
11566
  "validation": {
11536
11567
  "required": "props.required sets html_options.required.",
@@ -11570,7 +11601,7 @@
11570
11601
  },
11571
11602
  "htmlOptions": {
11572
11603
  "argument": "html_options",
11573
- "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. props.blank_selection sets options.prompt (default empty)."
11604
+ "description": "Pass input attributes in the positional html_options hash. props.input_options forwards only id, class and data. props.blank_selection sets options.prompt (default empty), overriding any explicit prompt."
11574
11605
  },
11575
11606
  "validation": {
11576
11607
  "required": "props.required sets html_options.required.",
@@ -11624,9 +11655,10 @@
11624
11655
  "questions": [
11625
11656
  "How do I show ActiveRecord errors?",
11626
11657
  "Does required_indicator validate?",
11627
- "How do I enable client validation?"
11658
+ "How do I enable client validation?",
11659
+ "How do I set a custom required-field message?"
11628
11660
  ],
11629
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
11661
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
11630
11662
  "contractPaths": [
11631
11663
  "form.rails.builder.validation",
11632
11664
  "form.rails.builder.methods"
@@ -11705,6 +11737,24 @@
11705
11737
  "contractPaths": [
11706
11738
  "form.rails.builder.simpleForm"
11707
11739
  ]
11740
+ },
11741
+ {
11742
+ "id": "select.builder-prompt",
11743
+ "platforms": [
11744
+ "rails"
11745
+ ],
11746
+ "questions": [
11747
+ "How do I omit the prompt in a select builder field?",
11748
+ "Does blank_selection override options.prompt?"
11749
+ ],
11750
+ "answer": "For f.select and f.collection_select, pass prompt: false in the positional options hash and omit props.blank_selection to omit the prompt. An explicitly supplied props.blank_selection overrides options.prompt, including false or nil; a nil blank_selection becomes an empty prompt. Otherwise an explicit prompt is preserved, and when neither is supplied the prompt defaults to empty. time_zone_select_field still sets the prompt from props.blank_selection (default empty), overriding an explicit prompt.",
11751
+ "example": "<%= f.select :country, [[\"Canada\", \"ca\"]], { prompt: false }, {}, props: { label: true } %>",
11752
+ "contractPaths": [
11753
+ "form.rails.builder.methods"
11754
+ ],
11755
+ "props": [
11756
+ "blankSelection"
11757
+ ]
11708
11758
  }
11709
11759
  ]
11710
11760
  },
@@ -12450,6 +12500,13 @@
12450
12500
  "type": "boolean",
12451
12501
  "default": false
12452
12502
  },
12503
+ "validationMessage": {
12504
+ "platforms": [
12505
+ "rails"
12506
+ ],
12507
+ "type": "string",
12508
+ "default": ""
12509
+ },
12453
12510
  "inputOptions": {
12454
12511
  "platforms": [
12455
12512
  "rails"
@@ -12487,7 +12544,7 @@
12487
12544
  ],
12488
12545
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
12489
12546
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
12490
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
12547
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
12491
12548
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
12492
12549
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
12493
12550
  "sources": [
@@ -12523,9 +12580,10 @@
12523
12580
  "supported": false,
12524
12581
  "automatic": false,
12525
12582
  "description": "This kit has no error prop. Render model errors separately."
12526
- }
12583
+ },
12584
+ "client": "props.validation_message becomes data-message on the CSS-hidden rating input."
12527
12585
  },
12528
- "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.star_rating_field :rating, props: { label: \"Rating\", variant: \"interactive\", required: true } %>\n<% end %>",
12586
+ "example": "<%= pb_form_with model: @user do |f| %>\n <%= f.star_rating_field :rating, props: { label: \"Rating\", variant: \"interactive\", required: true, validation_message: \"Please provide a rating\" } %>\n<% end %>",
12529
12587
  "kit": "star_rating",
12530
12588
  "signature": "star_rating_field(name, props: {})",
12531
12589
  "sources": [
@@ -12561,9 +12619,10 @@
12561
12619
  "questions": [
12562
12620
  "How do I show ActiveRecord errors?",
12563
12621
  "Does required_indicator validate?",
12564
- "How do I enable client validation?"
12622
+ "How do I enable client validation?",
12623
+ "How do I set a custom required-field message?"
12565
12624
  ],
12566
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
12625
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
12567
12626
  "contractPaths": [
12568
12627
  "form.rails.builder.validation",
12569
12628
  "form.rails.builder.methods"
@@ -13188,7 +13247,7 @@
13188
13247
  ],
13189
13248
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
13190
13249
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
13191
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
13250
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
13192
13251
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
13193
13252
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
13194
13253
  "sources": [
@@ -13575,9 +13634,10 @@
13575
13634
  "questions": [
13576
13635
  "How do I show ActiveRecord errors?",
13577
13636
  "Does required_indicator validate?",
13578
- "How do I enable client validation?"
13637
+ "How do I enable client validation?",
13638
+ "How do I set a custom required-field message?"
13579
13639
  ],
13580
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
13640
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
13581
13641
  "contractPaths": [
13582
13642
  "form.rails.builder.validation",
13583
13643
  "form.rails.builder.methods"
@@ -13853,7 +13913,7 @@
13853
13913
  ],
13854
13914
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
13855
13915
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
13856
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
13916
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
13857
13917
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
13858
13918
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
13859
13919
  "sources": [
@@ -13940,9 +14000,10 @@
13940
14000
  "questions": [
13941
14001
  "How do I show ActiveRecord errors?",
13942
14002
  "Does required_indicator validate?",
13943
- "How do I enable client validation?"
14003
+ "How do I enable client validation?",
14004
+ "How do I set a custom required-field message?"
13944
14005
  ],
13945
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
14006
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
13946
14007
  "contractPaths": [
13947
14008
  "form.rails.builder.validation",
13948
14009
  "form.rails.builder.methods"
@@ -14309,7 +14370,7 @@
14309
14370
  ],
14310
14371
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
14311
14372
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
14312
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
14373
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
14313
14374
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
14314
14375
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
14315
14376
  "sources": [
@@ -14386,9 +14447,10 @@
14386
14447
  "questions": [
14387
14448
  "How do I show ActiveRecord errors?",
14388
14449
  "Does required_indicator validate?",
14389
- "How do I enable client validation?"
14450
+ "How do I enable client validation?",
14451
+ "How do I set a custom required-field message?"
14390
14452
  ],
14391
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
14453
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
14392
14454
  "contractPaths": [
14393
14455
  "form.rails.builder.validation",
14394
14456
  "form.rails.builder.methods"
@@ -15668,7 +15730,7 @@
15668
15730
  ],
15669
15731
  "setup": "<%= pb_form_with model: @user do |f| %>\n <%= f.text_field :email, props: { label: \"Email\", required: true } %>\n<% end %>",
15670
15732
  "formWith": "<%= form_with model: @user, builder: Playbook::Forms::Builder do |f| %>\n <%= f.text_field :email, props: { label: \"Email\" } %>\n<% end %>",
15671
- "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
15733
+ "validation": "pb_form_with defaults validate to false. validate: true sets data-pb-form-validation for Playbook client validation. PbFormValidation finds the field kit via a *_kit classname, or via data-pb-dropdown / data-pb-multi-level-select for those kits. It binds invalid in capture on the form (not a one-time [required] snapshot) so controls that toggle required after mount still get data-message. Server/model validation remains the host application responsibility. Most builder fields also map record.errors into props.error unless the caller sets error explicitly (including nil).",
15672
15734
  "lifecycle": "pb_form_with invokes formHelper when available. PbFormValidation is registered with PbKitRegistry; its MutationObserver handles dynamically added forms, including Turbo navigation. Load the Playbook Rails bundle in the host.",
15673
15735
  "simpleForm": "No Simple Form adapter is declared by this contract. These methods belong to Playbook::Forms::Builder.",
15674
15736
  "sources": [
@@ -15749,9 +15811,10 @@
15749
15811
  "questions": [
15750
15812
  "How do I show ActiveRecord errors?",
15751
15813
  "Does required_indicator validate?",
15752
- "How do I enable client validation?"
15814
+ "How do I enable client validation?",
15815
+ "How do I set a custom required-field message?"
15753
15816
  ],
15754
- "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations.",
15817
+ "answer": "Most builder fields auto-map record.errors.full_messages_for(attribute) into props.error unless error is set explicitly (including nil to opt out). Checkbox still needs an explicit boolean error flag, and StarRating has no error prop. A required indicator is visual only. pb_form_with validate: true enables Playbook client validation; it does not run model validations. Custom required messages use props.validation.message on text-style fields (including text_area and telephone_field) and props.validation_message on selection-style fields (select, dropdown_field, check_box, phone_number_field, star_rating_field, multi_level_select, and similar). Phone kits own their UI and use validation_message for the empty required copy only.",
15755
15818
  "contractPaths": [
15756
15819
  "form.rails.builder.validation",
15757
15820
  "form.rails.builder.methods"