primer_view_components 0.0.110 → 0.0.111
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +2 -2
- data/app/components/primer/alpha/x_banner.d.ts +2 -1
- data/app/components/primer/alpha/x_banner.js +0 -1
- data/app/components/primer/alpha/x_banner.ts +1 -1
- data/app/components/primer/beta/avatar.css +1 -0
- data/app/components/primer/beta/avatar.css.json +1 -0
- data/app/components/primer/beta/avatar.css.map +1 -0
- data/app/components/primer/beta/avatar.pcss +73 -0
- data/app/components/primer/beta/avatar_stack.css +1 -0
- data/app/components/primer/beta/avatar_stack.css.json +1 -0
- data/app/components/primer/beta/avatar_stack.css.map +1 -0
- data/app/components/primer/beta/avatar_stack.pcss +141 -0
- data/app/components/primer/beta/button.rb +1 -1
- data/app/components/primer/beta/flash.css +1 -0
- data/app/components/primer/beta/flash.css.json +1 -0
- data/app/components/primer/beta/flash.css.map +1 -0
- data/app/components/primer/beta/flash.pcss +143 -0
- data/app/components/primer/dropdown.css +1 -0
- data/app/components/primer/dropdown.css.json +1 -0
- data/app/components/primer/dropdown.css.map +1 -0
- data/app/components/primer/dropdown.pcss +260 -0
- data/app/components/primer/popover_component.css +1 -0
- data/app/components/primer/popover_component.css.json +1 -0
- data/app/components/primer/popover_component.css.map +1 -0
- data/app/components/primer/popover_component.pcss +225 -0
- data/app/components/primer/primer.pcss +6 -0
- data/app/components/primer/timeline_item_component.css +1 -0
- data/app/components/primer/timeline_item_component.css.json +1 -0
- data/app/components/primer/timeline_item_component.css.map +1 -0
- data/app/components/primer/timeline_item_component.pcss +93 -0
- data/lib/primer/deprecations.rb +0 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/banner_preview.rb +1 -1
- data/previews/primer/beta/avatar_preview.rb +61 -5
- data/previews/primer/beta/avatar_stack_preview.rb +54 -12
- data/previews/primer/beta/blankslate_preview.rb +29 -5
- data/previews/primer/beta/flash_preview.rb +45 -8
- data/previews/primer/beta/label_preview.rb +86 -8
- data/previews/primer/dropdown_preview.rb +161 -10
- data/static/audited_at.json +0 -1
- data/static/constants.json +0 -2
- data/static/statuses.json +0 -1
- metadata +26 -3
- data/app/components/primer/counter_component.rb +0 -7
@@ -0,0 +1,225 @@
|
|
1
|
+
/* Popover */
|
2
|
+
|
3
|
+
.Popover {
|
4
|
+
position: absolute;
|
5
|
+
z-index: 100;
|
6
|
+
}
|
7
|
+
|
8
|
+
.Popover-message {
|
9
|
+
position: relative;
|
10
|
+
width: 232px;
|
11
|
+
margin-right: auto;
|
12
|
+
margin-left: auto;
|
13
|
+
background-color: var(--color-canvas-overlay);
|
14
|
+
border: var(--primer-borderWidth-thin, 1px) solid var(--color-border-default);
|
15
|
+
border-radius: var(--primer-borderRadius-medium, 6px);
|
16
|
+
|
17
|
+
/* Carets */
|
18
|
+
&::before,
|
19
|
+
&::after {
|
20
|
+
position: absolute;
|
21
|
+
left: 50%;
|
22
|
+
display: inline-block;
|
23
|
+
content: '';
|
24
|
+
}
|
25
|
+
|
26
|
+
&::before {
|
27
|
+
top: -16px;
|
28
|
+
margin-left: -9px;
|
29
|
+
border: 8px solid transparent;
|
30
|
+
border-bottom-color: var(--color-border-default);
|
31
|
+
}
|
32
|
+
|
33
|
+
&::after {
|
34
|
+
top: -14px;
|
35
|
+
margin-left: -8px;
|
36
|
+
border: 7px solid transparent;
|
37
|
+
border-bottom-color: var(--color-canvas-overlay);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
/* No caret */
|
42
|
+
.Popover-message--no-caret {
|
43
|
+
&::before,
|
44
|
+
&::after {
|
45
|
+
display: none;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
/* Bottom-oriented carets */
|
50
|
+
.Popover-message--bottom,
|
51
|
+
.Popover-message--bottom-right,
|
52
|
+
.Popover-message--bottom-left {
|
53
|
+
&::before,
|
54
|
+
&::after {
|
55
|
+
top: auto;
|
56
|
+
border-bottom-color: transparent;
|
57
|
+
}
|
58
|
+
|
59
|
+
&::before {
|
60
|
+
bottom: -16px;
|
61
|
+
border-top-color: var(--color-border-default);
|
62
|
+
}
|
63
|
+
|
64
|
+
&::after {
|
65
|
+
bottom: -14px;
|
66
|
+
border-top-color: var(--color-canvas-overlay);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
/* Top & Bottom: Right-oriented carets */
|
71
|
+
.Popover-message--top-right,
|
72
|
+
.Popover-message--bottom-right {
|
73
|
+
right: -9px;
|
74
|
+
margin-right: 0;
|
75
|
+
|
76
|
+
&::before,
|
77
|
+
&::after {
|
78
|
+
left: auto;
|
79
|
+
margin-left: 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
&::before {
|
83
|
+
right: 20px;
|
84
|
+
}
|
85
|
+
|
86
|
+
&::after {
|
87
|
+
right: 21px;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
/* Top & Bottom: Left-oriented carets */
|
92
|
+
.Popover-message--top-left,
|
93
|
+
.Popover-message--bottom-left {
|
94
|
+
left: -9px;
|
95
|
+
margin-left: 0;
|
96
|
+
|
97
|
+
&::before,
|
98
|
+
&::after {
|
99
|
+
left: 24px;
|
100
|
+
margin-left: 0;
|
101
|
+
}
|
102
|
+
|
103
|
+
&::after {
|
104
|
+
left: 25px;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
/* Right- & Left-oriented carets */
|
109
|
+
.Popover-message--right,
|
110
|
+
.Popover-message--right-top,
|
111
|
+
.Popover-message--right-bottom,
|
112
|
+
.Popover-message--left,
|
113
|
+
.Popover-message--left-top,
|
114
|
+
.Popover-message--left-bottom {
|
115
|
+
&::before,
|
116
|
+
&::after {
|
117
|
+
top: 50%;
|
118
|
+
left: auto;
|
119
|
+
margin-left: 0;
|
120
|
+
border-bottom-color: transparent;
|
121
|
+
}
|
122
|
+
|
123
|
+
&::before {
|
124
|
+
margin-top: -9px;
|
125
|
+
}
|
126
|
+
|
127
|
+
&::after {
|
128
|
+
margin-top: -8px;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
/* Right-oriented carets */
|
133
|
+
.Popover-message--right,
|
134
|
+
.Popover-message--right-top,
|
135
|
+
.Popover-message--right-bottom {
|
136
|
+
&::before {
|
137
|
+
right: -16px;
|
138
|
+
border-left-color: var(--color-border-default);
|
139
|
+
}
|
140
|
+
|
141
|
+
&::after {
|
142
|
+
right: -14px;
|
143
|
+
border-left-color: var(--color-canvas-overlay);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
/* Left-oriented carets */
|
148
|
+
.Popover-message--left,
|
149
|
+
.Popover-message--left-top,
|
150
|
+
.Popover-message--left-bottom {
|
151
|
+
&::before {
|
152
|
+
left: -16px;
|
153
|
+
border-right-color: var(--color-border-default);
|
154
|
+
}
|
155
|
+
|
156
|
+
&::after {
|
157
|
+
left: -14px;
|
158
|
+
border-right-color: var(--color-canvas-overlay);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/* Right & Left: Top-oriented carets */
|
163
|
+
.Popover-message--right-top,
|
164
|
+
.Popover-message--left-top {
|
165
|
+
&::before,
|
166
|
+
&::after {
|
167
|
+
top: 24px;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
171
|
+
/* Right & Left: Bottom-oriented carets */
|
172
|
+
.Popover-message--right-bottom,
|
173
|
+
.Popover-message--left-bottom {
|
174
|
+
&::before,
|
175
|
+
&::after {
|
176
|
+
top: auto;
|
177
|
+
}
|
178
|
+
|
179
|
+
&::before {
|
180
|
+
bottom: 16px;
|
181
|
+
}
|
182
|
+
|
183
|
+
&::after {
|
184
|
+
bottom: 17px;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
@media (min-width: 544px) {
|
189
|
+
.Popover-message--large {
|
190
|
+
min-width: 320px;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
/* Responsive Popover
|
195
|
+
** For < md it will show full-width anchored to the bottom */
|
196
|
+
|
197
|
+
@media (max-width: 767.98px) {
|
198
|
+
.Popover {
|
199
|
+
position: fixed;
|
200
|
+
top: auto !important;
|
201
|
+
right: 0 !important;
|
202
|
+
bottom: 0 !important;
|
203
|
+
left: 0 !important;
|
204
|
+
}
|
205
|
+
|
206
|
+
.Popover-message {
|
207
|
+
top: auto;
|
208
|
+
right: auto;
|
209
|
+
bottom: auto;
|
210
|
+
left: auto;
|
211
|
+
width: auto !important;
|
212
|
+
margin: var(--primer-stack-gap-condensed, 8px);
|
213
|
+
}
|
214
|
+
|
215
|
+
/* Increase tap area for touch input */
|
216
|
+
.Popover-message > .btn-octicon {
|
217
|
+
padding: var(--primer-control-medium-paddingInline-normal, 12px) !important;
|
218
|
+
}
|
219
|
+
|
220
|
+
/* Remove caret */
|
221
|
+
.Popover-message::after,
|
222
|
+
.Popover-message::before {
|
223
|
+
display: none;
|
224
|
+
}
|
225
|
+
}
|
@@ -3,13 +3,19 @@
|
|
3
3
|
@import "./alpha/banner.pcss";
|
4
4
|
@import "./alpha/toggle_switch.pcss";
|
5
5
|
@import "./alpha/segmented_control.pcss";
|
6
|
+
@import "./beta/avatar.pcss";
|
7
|
+
@import "./beta/avatar_stack.pcss";
|
6
8
|
@import "./beta/breadcrumbs.pcss";
|
7
9
|
@import "./beta/button.pcss";
|
8
10
|
@import "./beta/counter.pcss";
|
11
|
+
@import "./beta/flash.pcss";
|
9
12
|
@import "./beta/label.pcss";
|
10
13
|
@import "./beta/blankslate.pcss";
|
11
14
|
@import "./beta/progress_bar.pcss";
|
12
15
|
@import "./beta/truncate.pcss";
|
16
|
+
@import "./dropdown.pcss";
|
17
|
+
@import "./popover_component.pcss";
|
13
18
|
@import "./state_component.pcss";
|
14
19
|
@import "./subhead_component.pcss";
|
20
|
+
@import "./timeline_item_component.pcss";
|
15
21
|
@import "./truncate.pcss";
|
@@ -0,0 +1 @@
|
|
1
|
+
.TimelineItem{display:flex;margin-left:var(--primer-stack-gap-normal,16px);padding:var(--primer-stack-padding-normal,16px) 0;position:relative}.TimelineItem:before{background-color:var(--color-border-muted);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--primer-borderWidth-thick,2px)}.TimelineItem:target .TimelineItem-badge{border-color:var(--color-accent-emphasis);box-shadow:0 0 .2em var(--color-accent-muted)}.TimelineItem-badge{align-items:center;background-color:var(--color-timeline-badge-bg);border:var(--primer-borderWidth-thick,2px) solid var(--color-canvas-default);border-radius:50%;color:var(--color-fg-muted);display:flex;flex-shrink:0;height:var(--primer-control-medium-size,32px);justify-content:center;margin-left:calc(var(--primer-control-medium-size, 32px)/-2 + 1px);margin-right:var(--primer-controlStack-medium-gap-condensed,8px);position:relative;width:var(--primer-control-medium-size,32px);z-index:1}.TimelineItem-badge--success{background-color:var(--color-success-emphasis);border:var(--primer-borderWidth-thin,1px) solid #0000;color:var(--color-fg-on-emphasis)}.TimelineItem-body{color:var(--color-fg-muted);flex:auto;margin-top:var(--base-size-4,4px);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--color-canvas-default);border:0;border-top:var(--primer-borderWidth-thicker,4px) solid var(--color-border-default);height:var(--primer-stack-gap-spacious,24px);margin:0;margin-bottom:calc(var(--primer-stack-gap-normal, 16px)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4,4px)}.TimelineItem--condensed:last-child{padding-bottom:var(--primer-stack-gap-normal,16px)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--color-canvas-default);border:0;color:var(--color-fg-muted);height:var(--base-size-16,16px);margin-bottom:var(--base-size-8,8px);margin-top:var(--base-size-8,8px)}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"timeline_item_component","selectors":[".TimelineItem",".TimelineItem:before",".TimelineItem:target .TimelineItem-badge",".TimelineItem-badge",".TimelineItem-badge--success",".TimelineItem-body",".TimelineItem-avatar",".TimelineItem-break",".TimelineItem--condensed",".TimelineItem--condensed:last-child",".TimelineItem--condensed .TimelineItem-badge"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["timeline_item_component.pcss"],"names":[],"mappings":"AAEA,cAEE,YAAa,CAEb,+CAAiD,CADjD,iDAAmD,CAFnD,iBAqBF,CAfE,qBAQE,0CAA2C,CAL3C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,yCAGF,CAEA,yCACE,yCAA0C,CAC1C,6CACF,CAGF,oBASE,kBAAmB,CACnB,+CAAgD,CAChD,4EAA8E,CAC9E,iBAAkB,CAJlB,2BAA4B,CAL5B,YAAa,CAWb,aAAc,CATd,6CAA+C,CAQ/C,sBAAuB,CANvB,kEAAqE,CADrE,gEAAkE,CALlE,iBAAkB,CAGlB,4CAA8C,CAF9C,SAaF,CAEA,6BAEE,8CAA+C,CAC/C,qDAA6D,CAF7D,iCAGF,CAEA,mBAIE,2BAA4B,CAC5B,SAAU,CAFV,iCAAmC,CADnC,cAAe,CADf,WAKF,CAEA,qBAEE,UAAW,CADX,iBAAkB,CAElB,SACF,CAEA,oBAOE,4CAA6C,CAC7C,QAAS,CACT,kFAAoF,CANpF,4CAA8C,CAC9C,QAAS,CACT,2DAA8D,CAC9D,iBAAkB,CALlB,iBAAkB,CAClB,SAQF,CAEA,yBAEE,gBAAiB,CADjB,kCAgBF,CAZE,oCACE,kDACF,CAEA,6CAKE,4CAA6C,CAC7C,QAAS,CAFT,2BAA4B,CAH5B,+BAAiC,CAEjC,oCAAsC,CADtC,iCAKF","file":"timeline_item_component.css","sourcesContent":["/* TimelineItem */\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--primer-stack-padding-normal, 16px) 0;\n margin-left: var(--primer-stack-gap-normal, 16px);\n\n /* The Timeline */\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: var(--primer-borderWidth-thick, 2px);\n content: '';\n background-color: var(--color-border-muted);\n }\n\n &:target .TimelineItem-badge {\n border-color: var(--color-accent-emphasis);\n box-shadow: 0 0 0.2em var(--color-accent-muted);\n }\n}\n\n.TimelineItem-badge {\n position: relative;\n z-index: 1;\n display: flex;\n width: var(--primer-control-medium-size, 32px);\n height: var(--primer-control-medium-size, 32px);\n margin-right: var(--primer-controlStack-medium-gap-condensed, 8px);\n margin-left: calc(var(--primer-control-medium-size, 32px) / -2 + 1px);\n color: var(--color-fg-muted);\n align-items: center;\n background-color: var(--color-timeline-badge-bg);\n border: var(--primer-borderWidth-thick, 2px) solid var(--color-canvas-default);\n border-radius: 50%;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.TimelineItem-badge--success {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-success-emphasis);\n border: var(--primer-borderWidth-thin, 1px) solid transparent;\n}\n\n.TimelineItem-body {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4, 4px);\n color: var(--color-fg-muted);\n flex: auto;\n}\n\n.TimelineItem-avatar {\n position: absolute;\n left: -72px;\n z-index: 1;\n}\n\n.TimelineItem-break {\n position: relative;\n z-index: 1;\n height: var(--primer-stack-gap-spacious, 24px);\n margin: 0;\n margin-bottom: calc(var(--primer-stack-gap-normal, 16px) * -1);\n margin-left: -56px;\n background-color: var(--color-canvas-default);\n border: 0;\n border-top: var(--primer-borderWidth-thicker, 4px) solid var(--color-border-default);\n}\n\n.TimelineItem--condensed {\n padding-top: var(--base-size-4, 4px);\n padding-bottom: 0;\n\n /* TimelineItem--condensed is often grouped. (commits) */\n &:last-child {\n padding-bottom: var(--primer-stack-gap-normal, 16px);\n }\n\n & .TimelineItem-badge {\n height: var(--base-size-16, 16px);\n margin-top: var(--base-size-8, 8px);\n margin-bottom: var(--base-size-8, 8px);\n color: var(--color-fg-muted);\n background-color: var(--color-canvas-default);\n border: 0;\n }\n}\n"]}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/* TimelineItem */
|
2
|
+
|
3
|
+
.TimelineItem {
|
4
|
+
position: relative;
|
5
|
+
display: flex;
|
6
|
+
padding: var(--primer-stack-padding-normal, 16px) 0;
|
7
|
+
margin-left: var(--primer-stack-gap-normal, 16px);
|
8
|
+
|
9
|
+
/* The Timeline */
|
10
|
+
&::before {
|
11
|
+
position: absolute;
|
12
|
+
top: 0;
|
13
|
+
bottom: 0;
|
14
|
+
left: 0;
|
15
|
+
display: block;
|
16
|
+
width: var(--primer-borderWidth-thick, 2px);
|
17
|
+
content: '';
|
18
|
+
background-color: var(--color-border-muted);
|
19
|
+
}
|
20
|
+
|
21
|
+
&:target .TimelineItem-badge {
|
22
|
+
border-color: var(--color-accent-emphasis);
|
23
|
+
box-shadow: 0 0 0.2em var(--color-accent-muted);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.TimelineItem-badge {
|
28
|
+
position: relative;
|
29
|
+
z-index: 1;
|
30
|
+
display: flex;
|
31
|
+
width: var(--primer-control-medium-size, 32px);
|
32
|
+
height: var(--primer-control-medium-size, 32px);
|
33
|
+
margin-right: var(--primer-controlStack-medium-gap-condensed, 8px);
|
34
|
+
margin-left: calc(var(--primer-control-medium-size, 32px) / -2 + 1px);
|
35
|
+
color: var(--color-fg-muted);
|
36
|
+
align-items: center;
|
37
|
+
background-color: var(--color-timeline-badge-bg);
|
38
|
+
border: var(--primer-borderWidth-thick, 2px) solid var(--color-canvas-default);
|
39
|
+
border-radius: 50%;
|
40
|
+
justify-content: center;
|
41
|
+
flex-shrink: 0;
|
42
|
+
}
|
43
|
+
|
44
|
+
.TimelineItem-badge--success {
|
45
|
+
color: var(--color-fg-on-emphasis);
|
46
|
+
background-color: var(--color-success-emphasis);
|
47
|
+
border: var(--primer-borderWidth-thin, 1px) solid transparent;
|
48
|
+
}
|
49
|
+
|
50
|
+
.TimelineItem-body {
|
51
|
+
min-width: 0;
|
52
|
+
max-width: 100%;
|
53
|
+
margin-top: var(--base-size-4, 4px);
|
54
|
+
color: var(--color-fg-muted);
|
55
|
+
flex: auto;
|
56
|
+
}
|
57
|
+
|
58
|
+
.TimelineItem-avatar {
|
59
|
+
position: absolute;
|
60
|
+
left: -72px;
|
61
|
+
z-index: 1;
|
62
|
+
}
|
63
|
+
|
64
|
+
.TimelineItem-break {
|
65
|
+
position: relative;
|
66
|
+
z-index: 1;
|
67
|
+
height: var(--primer-stack-gap-spacious, 24px);
|
68
|
+
margin: 0;
|
69
|
+
margin-bottom: calc(var(--primer-stack-gap-normal, 16px) * -1);
|
70
|
+
margin-left: -56px;
|
71
|
+
background-color: var(--color-canvas-default);
|
72
|
+
border: 0;
|
73
|
+
border-top: var(--primer-borderWidth-thicker, 4px) solid var(--color-border-default);
|
74
|
+
}
|
75
|
+
|
76
|
+
.TimelineItem--condensed {
|
77
|
+
padding-top: var(--base-size-4, 4px);
|
78
|
+
padding-bottom: 0;
|
79
|
+
|
80
|
+
/* TimelineItem--condensed is often grouped. (commits) */
|
81
|
+
&:last-child {
|
82
|
+
padding-bottom: var(--primer-stack-gap-normal, 16px);
|
83
|
+
}
|
84
|
+
|
85
|
+
& .TimelineItem-badge {
|
86
|
+
height: var(--base-size-16, 16px);
|
87
|
+
margin-top: var(--base-size-8, 8px);
|
88
|
+
margin-bottom: var(--base-size-8, 8px);
|
89
|
+
color: var(--color-fg-muted);
|
90
|
+
background-color: var(--color-canvas-default);
|
91
|
+
border: 0;
|
92
|
+
}
|
93
|
+
}
|
data/lib/primer/deprecations.rb
CHANGED
@@ -12,7 +12,6 @@ module Primer
|
|
12
12
|
"Primer::Alpha::AutoComplete::Item" => "Primer::Beta::AutoComplete::Item",
|
13
13
|
"Primer::BlankslateComponent" => "Primer::Beta::Blankslate",
|
14
14
|
"Primer::BoxComponent" => "Primer::Box",
|
15
|
-
"Primer::CounterComponent" => "Primer::Beta::Counter",
|
16
15
|
"Primer::DropdownMenuComponent" => nil,
|
17
16
|
"Primer::IconButton" => "Primer::Beta::IconButton",
|
18
17
|
"Primer::Tooltip" => "Primer::Alpha::Tooltip",
|
@@ -13,14 +13,70 @@ module Primer
|
|
13
13
|
render(Primer::Beta::Avatar.new(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser", size: size, shape: shape, href: href))
|
14
14
|
end
|
15
15
|
|
16
|
-
# @label Default
|
16
|
+
# @label Default
|
17
|
+
def default
|
18
|
+
render(Primer::Beta::Avatar.new(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
19
|
+
end
|
20
|
+
|
21
|
+
# @label As link
|
17
22
|
#
|
18
|
-
# @param size [Integer] select [16, 20, 24, 32, 40, 48, 80]
|
19
|
-
# @param shape [Symbol] select [circle, square]
|
20
23
|
# @param href [String] text
|
21
|
-
def
|
22
|
-
render(Primer::Beta::Avatar.new(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"
|
24
|
+
def as_link(href: "#")
|
25
|
+
render(Primer::Beta::Avatar.new(href: href, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
26
|
+
end
|
27
|
+
|
28
|
+
# @!group Sizes
|
29
|
+
#
|
30
|
+
# @label 16px
|
31
|
+
def size_16
|
32
|
+
render(Primer::Beta::Avatar.new(size: 16, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
33
|
+
end
|
34
|
+
|
35
|
+
# @label 20px
|
36
|
+
def size_20
|
37
|
+
render(Primer::Beta::Avatar.new(size: 20, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
38
|
+
end
|
39
|
+
|
40
|
+
# @label 24px
|
41
|
+
def size_24
|
42
|
+
render(Primer::Beta::Avatar.new(size: 24, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
43
|
+
end
|
44
|
+
|
45
|
+
# @label 32px
|
46
|
+
def size_32
|
47
|
+
render(Primer::Beta::Avatar.new(size: 32, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
23
48
|
end
|
49
|
+
|
50
|
+
# @label 40px
|
51
|
+
def size_40
|
52
|
+
render(Primer::Beta::Avatar.new(size: 40, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
53
|
+
end
|
54
|
+
|
55
|
+
# @label 48px
|
56
|
+
def size_48
|
57
|
+
render(Primer::Beta::Avatar.new(size: 48, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
58
|
+
end
|
59
|
+
|
60
|
+
# @label 80px
|
61
|
+
def size_80
|
62
|
+
render(Primer::Beta::Avatar.new(size: 80, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
63
|
+
end
|
64
|
+
#
|
65
|
+
# @!endgroup
|
66
|
+
|
67
|
+
# @!group Shape
|
68
|
+
#
|
69
|
+
# @label Circle
|
70
|
+
def shape_circle
|
71
|
+
render(Primer::Beta::Avatar.new(shape: :circle, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
72
|
+
end
|
73
|
+
|
74
|
+
# @label Square
|
75
|
+
def shape_square
|
76
|
+
render(Primer::Beta::Avatar.new(shape: :square, src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser"))
|
77
|
+
end
|
78
|
+
#
|
79
|
+
# @!endgroup
|
24
80
|
end
|
25
81
|
end
|
26
82
|
end
|
@@ -19,23 +19,64 @@ module Primer
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
# @label Default
|
22
|
+
# @label Default
|
23
|
+
def default
|
24
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
25
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# @!group Multiple avatars
|
23
30
|
#
|
24
|
-
# @
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
# @param tooltip_label text
|
29
|
-
def default(number_of_avatars: 1, tag: :div, align: :left, tooltipped: false, tooltip_label: "This is a tooltip!")
|
30
|
-
render(Primer::Beta::AvatarStack.new(tag: tag, align: align, tooltipped: tooltipped, body_arguments: { label: tooltip_label })) do |c|
|
31
|
-
Array.new(number_of_avatars || 1) do
|
32
|
-
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
33
|
-
end
|
31
|
+
# @label 1 avatar
|
32
|
+
def avatar_1
|
33
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
34
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
#
|
38
|
+
# @label 2 avatars
|
39
|
+
def avatar_2
|
40
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
41
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
42
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
43
|
+
end
|
44
|
+
end
|
38
45
|
|
46
|
+
# @label 3 avatars
|
47
|
+
def avatar_3
|
48
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
49
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
50
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
51
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# @label 4 avatars
|
56
|
+
def avatar_4
|
57
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
58
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
59
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
60
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
61
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# @label 5 avatars
|
66
|
+
def avatar_5
|
67
|
+
render(Primer::Beta::AvatarStack.new) do |c|
|
68
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
69
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
70
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
71
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
72
|
+
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
73
|
+
end
|
74
|
+
end
|
75
|
+
#
|
76
|
+
# @!endgroup
|
77
|
+
|
78
|
+
# @!group More options
|
79
|
+
#
|
39
80
|
# @label Align right
|
40
81
|
def align_right
|
41
82
|
render(Primer::Beta::AvatarStack.new(align: :right)) do |c|
|
@@ -53,6 +94,7 @@ module Primer
|
|
53
94
|
c.avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "@kittenuser")
|
54
95
|
end
|
55
96
|
end
|
97
|
+
#
|
56
98
|
# @!endgroup
|
57
99
|
end
|
58
100
|
end
|
@@ -17,16 +17,40 @@ module Primer
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# @label Default options
|
20
|
+
def default
|
21
|
+
render Primer::Beta::Blankslate.new do |c|
|
22
|
+
c.heading(tag: :h2).with_content("Title")
|
23
|
+
c.description { "Description" }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# @!group Options
|
20
28
|
#
|
21
|
-
# @
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
29
|
+
# @label Narrow
|
30
|
+
def option_narrow
|
31
|
+
render Primer::Beta::Blankslate.new(narrow: true) do |c|
|
32
|
+
c.heading(tag: :h2).with_content("Title")
|
33
|
+
c.description { "Description" }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# @label Spacious
|
38
|
+
def option_spacious
|
39
|
+
render Primer::Beta::Blankslate.new(spacious: true) do |c|
|
40
|
+
c.heading(tag: :h2).with_content("Title")
|
41
|
+
c.description { "Description" }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# @label Border
|
46
|
+
def option_border
|
47
|
+
render Primer::Beta::Blankslate.new(border: true) do |c|
|
26
48
|
c.heading(tag: :h2).with_content("Title")
|
27
49
|
c.description { "Description" }
|
28
50
|
end
|
29
51
|
end
|
52
|
+
#
|
53
|
+
# @!endgroup
|
30
54
|
|
31
55
|
# @param narrow [Boolean] toggle
|
32
56
|
# @param spacious [Boolean] toggle
|
@@ -18,15 +18,52 @@ module Primer
|
|
18
18
|
|
19
19
|
# @label Default
|
20
20
|
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
#
|
26
|
-
#
|
27
|
-
|
28
|
-
|
21
|
+
def default
|
22
|
+
render(Primer::Beta::Flash.new) { "This is a flash message!" }
|
23
|
+
end
|
24
|
+
|
25
|
+
# @!group Color Schemes
|
26
|
+
#
|
27
|
+
# @label Default
|
28
|
+
def color_scheme_default
|
29
|
+
render(Primer::Beta::Flash.new) { "This is a flash message!" }
|
30
|
+
end
|
31
|
+
|
32
|
+
# @label Warning
|
33
|
+
def color_scheme_warning
|
34
|
+
render(Primer::Beta::Flash.new(scheme: :warning)) { "This is a warning flash message!" }
|
29
35
|
end
|
36
|
+
|
37
|
+
# @label Danger
|
38
|
+
def color_scheme_danger
|
39
|
+
render(Primer::Beta::Flash.new(scheme: :danger)) { "This is a danger flash message!" }
|
40
|
+
end
|
41
|
+
|
42
|
+
# @label Success
|
43
|
+
def color_scheme_success
|
44
|
+
render(Primer::Beta::Flash.new(scheme: :success)) { "This is a success flash message!" }
|
45
|
+
end
|
46
|
+
#
|
47
|
+
# @!endgroup
|
48
|
+
|
49
|
+
# @!group More options
|
50
|
+
#
|
51
|
+
# @label Full width
|
52
|
+
def options_full
|
53
|
+
render(Primer::Beta::Flash.new(full: true)) { "This is a full width flash message!" }
|
54
|
+
end
|
55
|
+
|
56
|
+
# @label Dismissible
|
57
|
+
def options_dismissible
|
58
|
+
render(Primer::Beta::Flash.new(dismissible: true)) { "This is a dismissible flash message!" }
|
59
|
+
end
|
60
|
+
|
61
|
+
# @label With icon
|
62
|
+
def options_with_icon
|
63
|
+
render(Primer::Beta::Flash.new(icon: :info)) { "This is a flash message with an icon!" }
|
64
|
+
end
|
65
|
+
#
|
66
|
+
# @!endgroup
|
30
67
|
end
|
31
68
|
end
|
32
69
|
end
|