You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: previews/primer/alpha/text_area_preview.rb
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -50,69 +50,69 @@ def playground(
50
50
# @label Default
51
51
# @snapshot
52
52
defdefault
53
-
render(Primer::Alpha::TextArea.new(name: "my-text-area",label: "Tell me about yourself"))
53
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-default",name: "my-text-area-default",label: "Tell me about yourself"))
54
54
end
55
55
56
56
# @!group Options
57
57
#
58
58
# @label With caption
59
59
# @snapshot
60
60
defwith_caption
61
-
render(Primer::Alpha::TextArea.new(caption: "With a caption",name: "my-text-area",label: "Tell me about yourself"))
61
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-with-caption",name: "my-text-area-with-caption",caption: "With a caption",label: "Tell me about yourself"))
62
62
end
63
63
64
64
# @label Visually hidden label
65
65
# @snapshot
66
66
defvisually_hide_label
67
-
render(Primer::Alpha::TextArea.new(visually_hide_label: true,name: "my-text-area",label: "Tell me about yourself"))
67
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-visually-hide-label",name: "my-text-area-visually-hide-label",visually_hide_label: true,label: "Tell me about yourself"))
68
68
end
69
69
70
70
# @label Full width
71
71
# @snapshot
72
72
deffull_width
73
-
render(Primer::Alpha::TextArea.new(full_width: true,name: "my-text-area",label: "Tell me about yourself"))
73
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-full-width",name: "my-text-area-full-width",full_width: true,label: "Tell me about yourself"))
74
74
end
75
75
76
76
# @label Not full width
77
77
# @snapshot
78
78
defnot_full_width
79
-
render(Primer::Alpha::TextArea.new(full_width: false,name: "my-text-area",label: "Tell me about yourself"))
79
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-not-full-width",name: "my-text-area-not-full-width",full_width: false,label: "Tell me about yourself"))
80
80
end
81
81
82
82
# @label Disabled
83
83
# @snapshot
84
84
defdisabled
85
-
render(Primer::Alpha::TextArea.new(disabled: true,name: "my-text-area",label: "Tell me about yourself"))
85
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-disabled",name: "my-text-area-disabled",disabled: true,label: "Tell me about yourself"))
86
86
end
87
87
88
88
# @label Invalid
89
89
# @snapshot
90
90
definvalid
91
-
render(Primer::Alpha::TextArea.new(invalid: true,name: "my-text-area",label: "Tell me about yourself"))
91
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-invalid",name: "my-text-area-invalid",invalid: true,label: "Tell me about yourself"))
92
92
end
93
93
94
94
# @label With validation message
95
95
# @snapshot
96
96
defwith_validation_message
97
-
render(Primer::Alpha::TextArea.new(validation_message: "An error occurred!",name: "my-text-area",label: "Tell me about yourself"))
97
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-with-validation-message",name: "my-text-area-with-validation-message",validation_message: "An error occurred!",label: "Tell me about yourself"))
98
98
end
99
99
100
100
# @label With character limit
101
101
# @snapshot interactive
102
102
defwith_character_limit
103
-
render(Primer::Alpha::TextArea.new(character_limit: 10,name: "my-text-area",label: "Tell me about yourself"))
103
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-with-character-limit",name: "my-text-area-with-character-limit",character_limit: 10,label: "Tell me about yourself"))
104
104
end
105
105
106
106
# @label With character limit, over limit
107
107
# @snapshot interactive
108
108
defwith_character_limit_over_limit
109
-
render(Primer::Alpha::TextArea.new(character_limit: 10,name: "my-text-area",label: "Tell me about yourself",value: "This text is definitely over the limit."))
109
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-with-character-limit-over-limit",name: "my-text-area-with-character-limit-over-limit",character_limit: 10,label: "Tell me about yourself",value: "This text is definitely over the limit."))
110
110
end
111
111
112
112
# @label With character limit and caption
113
113
# @snapshot
114
114
defwith_character_limit_and_caption
115
-
render(Primer::Alpha::TextArea.new(character_limit: 100,caption: "With a caption.",name: "my-text-area",label: "Tell me about yourself"))
115
+
render(Primer::Alpha::TextArea.new(id: "my-text-area-with-character-limit-and-caption",name: "my-text-area-with-character-limit-and-caption",character_limit: 100,caption: "With a caption.",label: "Tell me about yourself"))
0 commit comments