diff --git a/static/arguments.json b/static/arguments.json index a48361ac11..4081ed9953 100644 --- a/static/arguments.json +++ b/static/arguments.json @@ -772,6 +772,18 @@ "default": "N/A", "description": "A string describing the field and what sorts of input it expects. Displayed below the group." }, + { + "name": "invalid", + "type": "Boolean", + "default": "N/A", + "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect." + }, + { + "name": "validation_message", + "type": "String", + "default": "N/A", + "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object." + }, { "name": "label_arguments", "type": "Hash", @@ -1966,6 +1978,18 @@ "default": "N/A", "description": "A string describing the field and what sorts of input it expects. Displayed below the group." }, + { + "name": "invalid", + "type": "Boolean", + "default": "N/A", + "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect." + }, + { + "name": "validation_message", + "type": "String", + "default": "N/A", + "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object." + }, { "name": "label_arguments", "type": "Hash", diff --git a/static/info_arch.json b/static/info_arch.json index 74687e283e..cbfe21e467 100644 --- a/static/info_arch.json +++ b/static/info_arch.json @@ -2686,6 +2686,18 @@ "default": "N/A", "description": "A string describing the field and what sorts of input it expects. Displayed below the group." }, + { + "name": "invalid", + "type": "Boolean", + "default": "N/A", + "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect." + }, + { + "name": "validation_message", + "type": "String", + "default": "N/A", + "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object." + }, { "name": "label_arguments", "type": "Hash", @@ -2743,6 +2755,19 @@ ] } }, + { + "preview_path": "primer/alpha/check_box_group/invalid", + "name": "invalid", + "snapshot": "false", + "skip_rules": { + "wont_fix": [ + "region" + ], + "will_fix": [ + "color-contrast" + ] + } + }, { "preview_path": "primer/alpha/check_box_group/with_caption", "name": "with_caption", @@ -6341,6 +6366,18 @@ "default": "N/A", "description": "A string describing the field and what sorts of input it expects. Displayed below the group." }, + { + "name": "invalid", + "type": "Boolean", + "default": "N/A", + "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect." + }, + { + "name": "validation_message", + "type": "String", + "default": "N/A", + "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object." + }, { "name": "label_arguments", "type": "Hash", @@ -6398,6 +6435,19 @@ ] } }, + { + "preview_path": "primer/alpha/radio_button_group/invalid", + "name": "invalid", + "snapshot": "true", + "skip_rules": { + "wont_fix": [ + "region" + ], + "will_fix": [ + "color-contrast" + ] + } + }, { "preview_path": "primer/alpha/radio_button_group/with_caption", "name": "with_caption", diff --git a/static/previews.json b/static/previews.json index c7b453b0e8..daa0c10fd7 100644 --- a/static/previews.json +++ b/static/previews.json @@ -2403,6 +2403,19 @@ ] } }, + { + "preview_path": "primer/alpha/check_box_group/invalid", + "name": "invalid", + "snapshot": "false", + "skip_rules": { + "wont_fix": [ + "region" + ], + "will_fix": [ + "color-contrast" + ] + } + }, { "preview_path": "primer/alpha/check_box_group/with_caption", "name": "with_caption", @@ -4735,6 +4748,19 @@ ] } }, + { + "preview_path": "primer/alpha/radio_button_group/invalid", + "name": "invalid", + "snapshot": "true", + "skip_rules": { + "wont_fix": [ + "region" + ], + "will_fix": [ + "color-contrast" + ] + } + }, { "preview_path": "primer/alpha/radio_button_group/with_caption", "name": "with_caption",