disco_app 0.10.5 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/components/disco_app/buttons/model-destroy-button.es6.jsx +31 -0
- data/app/assets/components/disco_app/forms/model-form.es6.jsx +64 -0
- data/app/assets/components/embedded_app/bar.es6.jsx +31 -0
- data/app/assets/components/shopify/buttons/_buttons.scss +546 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit/forms → components/shopify/buttons}/button.es6.jsx +0 -0
- data/app/assets/components/shopify/card/_card.scss +342 -0
- data/app/assets/components/shopify/card/card-header.es6.jsx +34 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit/cards → components/shopify/card}/card-section.es6.jsx +9 -13
- data/app/assets/{javascripts/disco_app/components/ui-kit/cards → components/shopify/card}/card.es6.jsx +0 -0
- data/app/assets/components/shopify/typography/_typography.scss +23 -0
- data/app/assets/components/shopify/typography/ui-heading.es6.jsx +16 -0
- data/app/assets/{stylesheets/disco_app/ui-kit/_ui-empty-state.scss → components/shopify/ui-layout/_ui-layout.scss} +41 -5
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-annotated-section.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-empty-state.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-footer-help.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-layout-item.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-layout-section.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-layout-sections.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-layout.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-page-actions.es6.jsx +0 -0
- data/app/assets/{javascripts/disco_app/components/ui-kit → components/shopify}/ui-layout/ui-page-actions__buttons.es6.jsx +0 -0
- data/app/assets/{stylesheets/disco_app/ui-kit → components/shopify/ui-stack}/_ui-stack.scss +0 -0
- data/app/assets/components/shopify/ui-stack/ui-stack-item.es6.jsx +21 -0
- data/app/assets/components/shopify/ui-stack/ui-stack.es6.jsx +24 -0
- data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-select.es6.jsx +1 -1
- data/app/assets/javascripts/disco_app/components/ui-kit/tables/table.es6.jsx +6 -1
- data/app/assets/javascripts/disco_app/components.js +1 -0
- data/app/assets/stylesheets/disco_app/disco_app.scss +7 -4
- data/app/helpers/disco_app/application_helper.rb +20 -2
- data/app/views/layouts/embedded_app.html.erb +10 -4
- data/lib/disco_app/version.rb +1 -1
- data/lib/generators/disco_app/disco_app_generator.rb +1 -1
- metadata +27 -22
- data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-footer.es6.jsx +0 -11
- data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-header.es6.jsx +0 -11
- data/app/assets/javascripts/disco_app/components/ui-kit/cards/cart-section-title.es6.jsx +0 -17
- data/app/assets/stylesheets/disco_app/ui-kit/_ui-footer-help.scss +0 -28
- data/app/assets/stylesheets/disco_app/ui-kit/_ui-page-actions.scss +0 -23
@@ -0,0 +1,342 @@
|
|
1
|
+
.next-card {
|
2
|
+
background-color: #ffffff;
|
3
|
+
border-radius: 3px;
|
4
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
5
|
+
color: #31373d;
|
6
|
+
}
|
7
|
+
|
8
|
+
.next-card ~ .next-card {
|
9
|
+
margin-top: 20px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.next-card--aside {
|
13
|
+
background-color: #f5f6f7;
|
14
|
+
}
|
15
|
+
|
16
|
+
.next-card--aside-lighter {
|
17
|
+
background-color: #fafbfc;
|
18
|
+
}
|
19
|
+
|
20
|
+
.next-card--plain {
|
21
|
+
box-shadow: none;
|
22
|
+
}
|
23
|
+
|
24
|
+
.next-card--hide-overflow {
|
25
|
+
overflow: hidden;
|
26
|
+
}
|
27
|
+
|
28
|
+
.next-card--stacked {
|
29
|
+
margin: 0;
|
30
|
+
box-shadow: none;
|
31
|
+
border-radius: 0;
|
32
|
+
}
|
33
|
+
|
34
|
+
.next-card--stacked ~ .next-card--stacked {
|
35
|
+
margin-top: 0;
|
36
|
+
}
|
37
|
+
|
38
|
+
.next-card--preserve-first-and-last-section-spacing .next-card__section--half-spacing:first-of-type {
|
39
|
+
padding-top: 20px;
|
40
|
+
}
|
41
|
+
|
42
|
+
.next-card--preserve-first-and-last-section-spacing .next-card__section--half-spacing:last-of-type {
|
43
|
+
padding-bottom: 20px;
|
44
|
+
}
|
45
|
+
|
46
|
+
.next-card--sticky {
|
47
|
+
position: -webkit-sticky;
|
48
|
+
position: sticky;
|
49
|
+
top: 76px;
|
50
|
+
}
|
51
|
+
|
52
|
+
.next-card--js-sticky {
|
53
|
+
position: fixed;
|
54
|
+
top: 56px;
|
55
|
+
margin-top: 20px;
|
56
|
+
}
|
57
|
+
|
58
|
+
.next-card__header {
|
59
|
+
padding: 20px 20px 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
.next-card__header .next-heading {
|
63
|
+
margin-bottom: 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
.next-card__footer {
|
67
|
+
padding: 0 20px 20px;
|
68
|
+
}
|
69
|
+
|
70
|
+
.next-card__section {
|
71
|
+
padding: 20px;
|
72
|
+
}
|
73
|
+
|
74
|
+
.next-card__section ~ .next-card__section {
|
75
|
+
border-top: 1px solid #ebeef0;
|
76
|
+
}
|
77
|
+
|
78
|
+
.next-card__section ~ .next-card__section.next-card__section--no-border {
|
79
|
+
border-top: 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
.next-card__section:first-child {
|
83
|
+
border-radius: 3px 3px 0 0;
|
84
|
+
}
|
85
|
+
|
86
|
+
.next-card__section:last-child {
|
87
|
+
border-radius: 0 0 3px 3px;
|
88
|
+
}
|
89
|
+
|
90
|
+
.next-card__section--no-vertical-spacing {
|
91
|
+
padding-top: 0;
|
92
|
+
padding-bottom: 0;
|
93
|
+
}
|
94
|
+
|
95
|
+
.next-card__section--no-vertical-spacing + .next-card__section {
|
96
|
+
border-top: none;
|
97
|
+
}
|
98
|
+
|
99
|
+
.next-card__section--no-horizontal-spacing {
|
100
|
+
padding-left: 0;
|
101
|
+
padding-right: 0;
|
102
|
+
}
|
103
|
+
|
104
|
+
.next-card__section--half-spacing {
|
105
|
+
padding-top: 10px;
|
106
|
+
padding-bottom: 10px;
|
107
|
+
}
|
108
|
+
|
109
|
+
.next-card__section--half-spacing.next-card__header {
|
110
|
+
padding-bottom: 0;
|
111
|
+
}
|
112
|
+
|
113
|
+
.next-card__section--half-spacing.next-card__footer {
|
114
|
+
padding-top: 0;
|
115
|
+
}
|
116
|
+
|
117
|
+
.next-card__section--three-quarter-spacing {
|
118
|
+
padding-top: 15px;
|
119
|
+
padding-bottom: 15px;
|
120
|
+
}
|
121
|
+
|
122
|
+
.next-card__section--double-spacing {
|
123
|
+
padding-top: 40px;
|
124
|
+
padding-bottom: 40px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.next-card__section--no-padding {
|
128
|
+
padding: 0;
|
129
|
+
}
|
130
|
+
|
131
|
+
.next-card__section--subdued {
|
132
|
+
background-color: #f5f6f7;
|
133
|
+
}
|
134
|
+
|
135
|
+
.next-card__section--more-subdued {
|
136
|
+
background-color: #ebeef0;
|
137
|
+
}
|
138
|
+
|
139
|
+
.next-card__section--less-subdued {
|
140
|
+
background-color: #fafbfc;
|
141
|
+
}
|
142
|
+
|
143
|
+
.next-card__section--accentuated {
|
144
|
+
background-color: #0078bd;
|
145
|
+
}
|
146
|
+
|
147
|
+
.next-card__section--accentuated .next-heading {
|
148
|
+
color: #ffffff;
|
149
|
+
}
|
150
|
+
|
151
|
+
.next-card__section--bordered {
|
152
|
+
border-top: 1px solid #ebeef0;
|
153
|
+
}
|
154
|
+
|
155
|
+
.next-card__section--no-bottom-spacing {
|
156
|
+
padding-bottom: 0;
|
157
|
+
}
|
158
|
+
|
159
|
+
.next-card__section--no-bottom-spacing + .next-card__section {
|
160
|
+
border-top: 0;
|
161
|
+
}
|
162
|
+
|
163
|
+
.next-card__section--no-top-spacing {
|
164
|
+
padding-top: 0;
|
165
|
+
}
|
166
|
+
|
167
|
+
.next-card__section ~ .next-card__section--no-top-spacing {
|
168
|
+
border-top: 0;
|
169
|
+
}
|
170
|
+
|
171
|
+
.next-card__section--border-left {
|
172
|
+
border-left: 1px solid #ebeef0;
|
173
|
+
}
|
174
|
+
|
175
|
+
.next-card__section--border-bottom {
|
176
|
+
border-bottom: 1px solid #ebeef0;
|
177
|
+
}
|
178
|
+
|
179
|
+
.next-card__section--centered {
|
180
|
+
text-align: center;
|
181
|
+
}
|
182
|
+
|
183
|
+
.next-card__section--sello-only {
|
184
|
+
position: relative;
|
185
|
+
}
|
186
|
+
|
187
|
+
.next-card__section--sello-only::after {
|
188
|
+
content: "";
|
189
|
+
position: absolute;
|
190
|
+
top: 0;
|
191
|
+
right: 0;
|
192
|
+
height: 100%;
|
193
|
+
width: 10px;
|
194
|
+
background-color: #2cc699;
|
195
|
+
}
|
196
|
+
|
197
|
+
.next-card__section--sello-only:last-child::after {
|
198
|
+
border-radius: 0 0 3px 0;
|
199
|
+
}
|
200
|
+
|
201
|
+
.next-card__section--sello-only:first-child::after {
|
202
|
+
border-radius: 0 3px 0 0;
|
203
|
+
}
|
204
|
+
|
205
|
+
.next-card--with-full-height-image {
|
206
|
+
position: relative;
|
207
|
+
padding-left: 250px;
|
208
|
+
max-width: calc(100% - 250px);
|
209
|
+
}
|
210
|
+
|
211
|
+
.next-card--with-full-height-image .next-card__image {
|
212
|
+
position: absolute;
|
213
|
+
top: 0;
|
214
|
+
bottom: 0;
|
215
|
+
left: 0;
|
216
|
+
width: 250px;
|
217
|
+
background-size: cover;
|
218
|
+
background-position: center;
|
219
|
+
border-top-left-radius: 3px;
|
220
|
+
border-bottom-left-radius: 3px;
|
221
|
+
}
|
222
|
+
|
223
|
+
.page--condense-spacing .next-card--with-full-height-image {
|
224
|
+
padding-left: 0;
|
225
|
+
max-width: 100%;
|
226
|
+
}
|
227
|
+
|
228
|
+
.page--condense-spacing .next-card--with-full-height-image .next-card__image {
|
229
|
+
position: static;
|
230
|
+
display: block;
|
231
|
+
width: 100%;
|
232
|
+
height: 120px;
|
233
|
+
border-radius: 0;
|
234
|
+
}
|
235
|
+
|
236
|
+
.next-card__section__separator {
|
237
|
+
margin: 20px auto;
|
238
|
+
background-color: #ebeef0;
|
239
|
+
}
|
240
|
+
|
241
|
+
.next-card__section__separator--no-margin {
|
242
|
+
margin: 0;
|
243
|
+
}
|
244
|
+
|
245
|
+
.next-card__separator {
|
246
|
+
margin: 0;
|
247
|
+
height: 1px;
|
248
|
+
background: #ebeef0;
|
249
|
+
}
|
250
|
+
|
251
|
+
.next-card__separator--thick {
|
252
|
+
height: 5px;
|
253
|
+
}
|
254
|
+
|
255
|
+
.next-card__separator--inline {
|
256
|
+
margin: 10px 20px;
|
257
|
+
}
|
258
|
+
|
259
|
+
.next-card--top-rounded-corners {
|
260
|
+
border-radius: 3px 3px 0 0 !important;
|
261
|
+
}
|
262
|
+
|
263
|
+
.next-card--bottom-rounded-corners {
|
264
|
+
border-radius: 0 0 3px 3px !important;
|
265
|
+
}
|
266
|
+
|
267
|
+
.next-card--all-rounded-corners {
|
268
|
+
border-radius: 3px !important;
|
269
|
+
}
|
270
|
+
|
271
|
+
.next-card--left-rounded-corners {
|
272
|
+
border-radius: 3px 0 0 3px;
|
273
|
+
}
|
274
|
+
|
275
|
+
.next-card--right-rounded-corners {
|
276
|
+
border-radius: 0 3px 3px 0;
|
277
|
+
}
|
278
|
+
|
279
|
+
.next-card--top-right-rounded-corner {
|
280
|
+
border-top-right-radius: 3px;
|
281
|
+
}
|
282
|
+
|
283
|
+
.next-card--bottom-right-rounded-corner {
|
284
|
+
border-bottom-right-radius: 3px;
|
285
|
+
}
|
286
|
+
|
287
|
+
.next-card--top-left-rounded-corner {
|
288
|
+
border-top-left-radius: 3px;
|
289
|
+
}
|
290
|
+
|
291
|
+
.next-card--bottom-left-rounded-corner {
|
292
|
+
border-bottom-left-radius: 3px;
|
293
|
+
}
|
294
|
+
|
295
|
+
.next-card__ribbon {
|
296
|
+
background: #fafbfc;
|
297
|
+
border-right: solid 1px #ebeef0;
|
298
|
+
border-radius: 3px 0 0 3px;
|
299
|
+
padding: 20px;
|
300
|
+
display: block;
|
301
|
+
}
|
302
|
+
|
303
|
+
.next-card__ribbon--warning {
|
304
|
+
background: #ffd117;
|
305
|
+
border-right: solid 1px rgba(212, 160, 2, 0.25);
|
306
|
+
}
|
307
|
+
|
308
|
+
.next-card__ribbon--vertically-centered {
|
309
|
+
display: -webkit-box;
|
310
|
+
display: -webkit-flex;
|
311
|
+
display: -ms-flexbox;
|
312
|
+
display: flex;
|
313
|
+
-webkit-box-orient: vertical;
|
314
|
+
-webkit-box-direction: normal;
|
315
|
+
-webkit-flex-direction: column;
|
316
|
+
-ms-flex-direction: column;
|
317
|
+
flex-direction: column;
|
318
|
+
-webkit-box-pack: center;
|
319
|
+
-webkit-justify-content: center;
|
320
|
+
-ms-flex-pack: center;
|
321
|
+
justify-content: center;
|
322
|
+
}
|
323
|
+
|
324
|
+
.next-ui .next-text-slate {
|
325
|
+
color: #31373d;
|
326
|
+
}
|
327
|
+
|
328
|
+
.next-card__header--fully-padded {
|
329
|
+
padding-bottom: 20px;
|
330
|
+
}
|
331
|
+
|
332
|
+
.next-card--semi-transparent {
|
333
|
+
background-color: rgba(255, 255, 255, 0.9);
|
334
|
+
}
|
335
|
+
|
336
|
+
.next-card__channel-image {
|
337
|
+
margin-right: 20px;
|
338
|
+
}
|
339
|
+
|
340
|
+
.next-grid--single-column .next-card__channel-image {
|
341
|
+
display: none;
|
342
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
const CardHeader = ({ title, subheading, children }) => {
|
2
|
+
|
3
|
+
// If children were provided, insert them as the "action" item on the right
|
4
|
+
// hand side of the header.
|
5
|
+
let actionStackItem = null;
|
6
|
+
if(children) {
|
7
|
+
actionStackItem = (
|
8
|
+
<UIStackItem>
|
9
|
+
{children}
|
10
|
+
</UIStackItem>
|
11
|
+
)
|
12
|
+
}
|
13
|
+
|
14
|
+
return (
|
15
|
+
<header className="next-card__header">
|
16
|
+
<UIStack>
|
17
|
+
<UIStackItem fill={true}>
|
18
|
+
<UIHeading subheading={subheading}>{title}</UIHeading>
|
19
|
+
</UIStackItem>
|
20
|
+
{actionStackItem}
|
21
|
+
</UIStack>
|
22
|
+
</header>
|
23
|
+
);
|
24
|
+
};
|
25
|
+
|
26
|
+
CardHeader.propTypes = {
|
27
|
+
title: React.PropTypes.string.isRequired,
|
28
|
+
subheading: React.PropTypes.bool,
|
29
|
+
children: React.PropTypes.node
|
30
|
+
};
|
31
|
+
|
32
|
+
CardHeader.defaultProps = {
|
33
|
+
subheading: false
|
34
|
+
};
|
@@ -1,5 +1,4 @@
|
|
1
|
-
const CardSection = ({
|
2
|
-
|
1
|
+
const CardSection = ({ children, wrappable, borderless }) => {
|
3
2
|
const className = classNames({
|
4
3
|
'next-card__section': true,
|
5
4
|
'wrappable': wrappable,
|
@@ -8,23 +7,20 @@ const CardSection = ({ title, title_small, children, wrappable, borderless }) =>
|
|
8
7
|
'next-card__section--no-top-spacing': borderless
|
9
8
|
});
|
10
9
|
|
11
|
-
const showTitle = () => {
|
12
|
-
if (title) {
|
13
|
-
return <CardSectionTitle title={title} small={title_small} />;
|
14
|
-
} else {
|
15
|
-
return null;
|
16
|
-
}
|
17
|
-
};
|
18
|
-
|
19
10
|
return (
|
20
11
|
<div className={className}>
|
21
|
-
{showTitle()}
|
22
12
|
{children}
|
23
13
|
</div>
|
24
14
|
);
|
25
15
|
};
|
26
16
|
|
27
17
|
CardSection.propTypes = {
|
28
|
-
|
29
|
-
|
18
|
+
children: React.PropTypes.node.isRequired,
|
19
|
+
wrappable: React.PropTypes.bool,
|
20
|
+
borderless: React.PropTypes.bool
|
21
|
+
};
|
22
|
+
|
23
|
+
CardSection.defaultProps = {
|
24
|
+
wrappable: false,
|
25
|
+
borderless: false
|
30
26
|
};
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.ui-heading {
|
2
|
+
font-size: 1.21429rem;
|
3
|
+
line-height: 1.71429rem;
|
4
|
+
font-weight: 600;
|
5
|
+
}
|
6
|
+
|
7
|
+
.ui-subheading {
|
8
|
+
font-size: 0.92857rem;
|
9
|
+
line-height: 1.42857rem;
|
10
|
+
font-weight: 600;
|
11
|
+
text-transform: uppercase;
|
12
|
+
letter-spacing: 0.04em;
|
13
|
+
}
|
14
|
+
|
15
|
+
@media screen and (min-width: 640px) {
|
16
|
+
.ui-heading {
|
17
|
+
font-size: 1.14286rem;
|
18
|
+
}
|
19
|
+
|
20
|
+
.ui-subheading {
|
21
|
+
font-size: 0.85714rem;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
const UIHeading = ({ children, subheading }) => {
|
2
|
+
if(subheading) {
|
3
|
+
return <h3 className="ui-subheading">{children}</h3>;
|
4
|
+
}
|
5
|
+
|
6
|
+
return <h2 className="ui-heading">{children}</h2>;
|
7
|
+
};
|
8
|
+
|
9
|
+
UIHeading.propTypes = {
|
10
|
+
children: React.PropTypes.node.isRequired,
|
11
|
+
subheading: React.PropTypes.bool
|
12
|
+
};
|
13
|
+
|
14
|
+
UIHeading.defaultProps = {
|
15
|
+
subheading: false
|
16
|
+
};
|
@@ -1,8 +1,43 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
.ui-page-actions {
|
2
|
+
@include flexbox();
|
3
|
+
margin: 0 auto;
|
4
|
+
max-width: 1036px;
|
5
|
+
padding: 20px 0;
|
6
|
+
border-top: 1px solid #d3dbe2;
|
7
|
+
}
|
8
|
+
|
9
|
+
.ui-page-actions__primary {
|
10
|
+
@include flex(1 1 auto);
|
11
|
+
padding-right: 20px;
|
12
|
+
}
|
13
|
+
|
14
|
+
.ui-page-actions__secondary {
|
15
|
+
@include flex(1 1 auto);
|
16
|
+
padding: 0 20px;
|
17
|
+
}
|
18
|
+
|
19
|
+
.ui-footer-help {
|
20
|
+
margin: 1.71429rem 0;
|
21
|
+
text-align: center;
|
22
|
+
width: 100%;
|
23
|
+
}
|
24
|
+
|
25
|
+
.ui-footer-help__content {
|
26
|
+
color: rgba(0,0,0,0.56);
|
27
|
+
display: -webkit-inline-box;
|
28
|
+
display: -webkit-inline-flex;
|
29
|
+
display: -ms-inline-flexbox;
|
30
|
+
display: inline-flex;
|
31
|
+
-webkit-box-align: center;
|
32
|
+
-webkit-align-items: center;
|
33
|
+
-ms-flex-align: center;
|
34
|
+
align-items: center;
|
35
|
+
text-align: left;
|
36
|
+
margin: 0 auto;
|
37
|
+
padding: 1.14286rem;
|
38
|
+
border: 1px solid #d3dbe2;
|
39
|
+
border-radius: 3px;
|
40
|
+
}
|
6
41
|
|
7
42
|
.ui-empty-state {
|
8
43
|
text-align: center;
|
@@ -119,3 +154,4 @@
|
|
119
154
|
left: 50%;
|
120
155
|
}
|
121
156
|
}
|
157
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
const UIStackItem = ({ children, fill }) => {
|
2
|
+
const className = classNames({
|
3
|
+
'ui-stack-item': true,
|
4
|
+
'ui-stack-item--fill': fill
|
5
|
+
});
|
6
|
+
|
7
|
+
return (
|
8
|
+
<div className={className}>
|
9
|
+
{children}
|
10
|
+
</div>
|
11
|
+
);
|
12
|
+
};
|
13
|
+
|
14
|
+
UIStackItem.propTypes = {
|
15
|
+
children: React.PropTypes.node,
|
16
|
+
fill: React.PropTypes.bool
|
17
|
+
};
|
18
|
+
|
19
|
+
UIStackItem.defaultProps = {
|
20
|
+
fill: false
|
21
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
const UIStack = ({ children, wrap, center }) => {
|
2
|
+
const className = classNames({
|
3
|
+
'ui-stack': true,
|
4
|
+
'ui-stack--wrap': wrap,
|
5
|
+
'ui-stack--alignment-center': center
|
6
|
+
});
|
7
|
+
|
8
|
+
return (
|
9
|
+
<div className={className}>
|
10
|
+
{children}
|
11
|
+
</div>
|
12
|
+
);
|
13
|
+
};
|
14
|
+
|
15
|
+
UIStack.propTypes = {
|
16
|
+
children: React.PropTypes.node,
|
17
|
+
wrap: React.PropTypes.bool,
|
18
|
+
center: React.PropTypes.bool
|
19
|
+
};
|
20
|
+
|
21
|
+
UIStack.defaultProps = {
|
22
|
+
wrap: true,
|
23
|
+
center: true
|
24
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
const InputSelect = ({ id, label, labelHidden, name, options, value, defaultValue, helpMessage, onChange }) => {
|
2
2
|
|
3
3
|
const optionElements = options.map((option) => {
|
4
|
-
return <option key={option.value} value={option.value}>{option.label}</option>;
|
4
|
+
return <option key={option.value} value={option.value} disabled={option.disabled}>{option.label}</option>;
|
5
5
|
});
|
6
6
|
|
7
7
|
const labelClassName = classNames({
|
@@ -15,8 +15,13 @@ const Table = ({ children, scrollable, sticky }) => {
|
|
15
15
|
);
|
16
16
|
};
|
17
17
|
|
18
|
-
|
18
|
+
Table.PropTypes = {
|
19
19
|
children: React.PropTypes.node.isRequired,
|
20
20
|
scrollable: React.PropTypes.bool,
|
21
21
|
sticky: React.PropTypes.bool
|
22
22
|
};
|
23
|
+
|
24
|
+
Table.defaultProps = {
|
25
|
+
scrollable: false,
|
26
|
+
sticky: false
|
27
|
+
};
|
@@ -14,8 +14,11 @@ $font-family: -apple-system, "BlinkMacSystemFont", "San Francisco", "Roboto", "S
|
|
14
14
|
@import 'ui-kit/ui-icons';
|
15
15
|
@import 'ui-kit/ui-layout';
|
16
16
|
@import 'ui-kit/ui-forms';
|
17
|
-
@import 'ui-kit/ui-stack';
|
18
|
-
@import 'ui-kit/ui-empty-state';
|
19
|
-
@import 'ui-kit/ui-footer-help';
|
20
|
-
@import 'ui-kit/ui-page-actions';
|
21
17
|
@import 'ui-kit/ui-tabs';
|
18
|
+
|
19
|
+
// Components
|
20
|
+
@import '../../components/shopify/ui-layout/ui-layout';
|
21
|
+
@import '../../components/shopify/ui-stack/ui-stack';
|
22
|
+
@import '../../components/shopify/typography/typography';
|
23
|
+
@import '../../components/shopify/buttons/buttons';
|
24
|
+
@import '../../components/shopify/card/card';
|
@@ -42,9 +42,27 @@ module DiscoApp::ApplicationHelper
|
|
42
42
|
link_to(name, '#', class: "add_fields", data: {id: id, fields: fields.gsub("\n", "")})
|
43
43
|
end
|
44
44
|
|
45
|
+
# Return the props required to instantiate a React ModelForm component for the
|
46
|
+
# given model instance.
|
47
|
+
def model_form_props(model)
|
48
|
+
{
|
49
|
+
model: model,
|
50
|
+
modelTitle: model.persisted? ? model.to_s : "New #{model.model_name.human.downcase}",
|
51
|
+
modelName: model.model_name.singular,
|
52
|
+
modelUrl: model.persisted? ? send("#{model.model_name.singular}_path", model) : nil,
|
53
|
+
modelsUrl: send("#{model.model_name.plural}_path"),
|
54
|
+
authenticityToken: form_authenticity_token,
|
55
|
+
errors: errors_to_react(model)
|
56
|
+
}.as_json
|
57
|
+
end
|
58
|
+
|
45
59
|
# Helper method that provides detailed error information from an active record as JSON
|
46
|
-
def errors_to_react(
|
47
|
-
{
|
60
|
+
def errors_to_react(model)
|
61
|
+
{
|
62
|
+
type: model.model_name.human.downcase,
|
63
|
+
errors: model.errors.keys,
|
64
|
+
messages: model.errors.full_messages
|
65
|
+
}.as_json
|
48
66
|
end
|
49
67
|
|
50
68
|
end
|
@@ -21,11 +21,17 @@
|
|
21
21
|
</head>
|
22
22
|
<body>
|
23
23
|
<script type="text/javascript">
|
24
|
+
window.DiscoApp = {
|
25
|
+
INITIAL_TITLE: "<%= yield(:title) %>",
|
26
|
+
INITIAL_ICON: "<%= image_url("disco_app/icon.svg") %>",
|
27
|
+
INITIAL_BUTTONS: <%= content_for?(:buttons) ? content_for(:buttons) : '{}' %>,
|
28
|
+
INITIAL_BREADCRUMB: <%= content_for?(:breadcrumb) ? content_for(:breadcrumb) : 'undefined' %>
|
29
|
+
};
|
24
30
|
ShopifyApp.Bar.initialize({
|
25
|
-
title:
|
26
|
-
icon:
|
27
|
-
buttons:
|
28
|
-
breadcrumb:
|
31
|
+
title: DiscoApp.INITIAL_TITLE,
|
32
|
+
icon: DiscoApp.INITIAL_ICON,
|
33
|
+
buttons: DiscoApp.INITIAL_BUTTONS,
|
34
|
+
breadcrumb: DiscoApp.INITIAL_BREADCRUMB
|
29
35
|
});
|
30
36
|
</script>
|
31
37
|
|
data/lib/disco_app/version.rb
CHANGED