ember-freestyle 0.12.9 → 0.13.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.
- package/.husky/pre-commit +5 -0
- package/CHANGELOG.md +54 -0
- package/README.md +69 -49
- package/addon/components/freestyle/usage/argument/index.hbs +1 -1
- package/addon/components/freestyle/usage/argument/index.js +5 -0
- package/addon/components/freestyle/usage/array/index.hbs +1 -0
- package/addon/components/freestyle/usage/bool/{control.hbs → control/index.hbs} +1 -1
- package/addon/components/freestyle/usage/bool/control/index.js +9 -0
- package/addon/components/freestyle/usage/bool/index.hbs +1 -0
- package/addon/components/freestyle/usage/number/{control.hbs → control/index.hbs} +2 -1
- package/addon/components/freestyle/usage/number/{control.js → control/index.js} +5 -0
- package/addon/components/freestyle/usage/number/index.hbs +1 -0
- package/addon/components/freestyle/usage/object/control/index.hbs +5 -0
- package/addon/components/freestyle/usage/object/control/index.js +18 -0
- package/addon/components/freestyle/usage/object/index.hbs +1 -0
- package/addon/components/freestyle/usage/string/{control.hbs → control/index.hbs} +4 -2
- package/addon/components/freestyle/usage/string/{control.js → control/index.js} +6 -0
- package/addon/components/freestyle/usage/string/index.hbs +1 -0
- package/addon/components/freestyle-collection/index.js +1 -2
- package/addon/components/freestyle-dynamic/index.js +1 -2
- package/addon/components/freestyle-dynamic-input/index.hbs +34 -6
- package/addon/components/freestyle-dynamic-input/index.js +6 -6
- package/addon/components/freestyle-palette/index.hbs +3 -3
- package/addon/components/freestyle-palette/index.js +1 -0
- package/addon/components/freestyle-palette-item/index.js +1 -1
- package/addon/components/freestyle-section/index.js +0 -2
- package/addon/components/freestyle-showdown-content/index.js +14 -0
- package/addon/components/freestyle-source/index.js +1 -2
- package/addon/components/freestyle-subsection/index.js +0 -1
- package/addon/components/freestyle-typeface/index.js +1 -1
- package/addon/components/freestyle-usage/index.js +3 -4
- package/addon/components/freestyle-usage-controls/index.hbs +2 -2
- package/addon/components/freestyle-variant-list/index.hbs +1 -1
- package/addon/services/ember-freestyle.js +2 -2
- package/app/components/freestyle/usage/{bool/index.js → bool.js} +0 -0
- package/app/components/freestyle/usage/{number/index.js → number.js} +0 -0
- package/app/components/freestyle/usage/{object/index.js → object.js} +0 -0
- package/app/components/freestyle/usage/{string/index.js → string.js} +0 -0
- package/{addon → app}/styles/components/freestyle/usage.scss +14 -14
- package/{addon → app}/styles/components/freestyle-annotation.scss +1 -1
- package/{addon → app}/styles/components/freestyle-collection.scss +5 -4
- package/{addon → app}/styles/components/freestyle-dynamic.scss +2 -1
- package/{addon → app}/styles/components/freestyle-guide.scss +7 -6
- package/{addon → app}/styles/components/freestyle-menu.scss +1 -1
- package/{addon → app}/styles/components/freestyle-palette-item.scss +0 -1
- package/{addon → app}/styles/components/freestyle-palette.scss +1 -1
- package/{addon → app}/styles/components/freestyle-section.scss +1 -1
- package/{addon → app}/styles/components/freestyle-source.scss +2 -2
- package/{addon → app}/styles/components/freestyle-subsection.scss +2 -2
- package/{addon → app}/styles/components/freestyle-typeface.scss +0 -0
- package/{addon → app}/styles/components/freestyle-usage-controls.scss +12 -11
- package/{addon → app}/styles/components/freestyle-usage.scss +2 -6
- package/{addon → app}/styles/components/freestyle-variant.scss +0 -0
- package/{addon/styles/addon.scss → app/styles/ember-freestyle.scss} +3 -3
- package/blueprints/ember-freestyle/files/__root__/app/controllers/freestyle.js +16 -47
- package/blueprints/ember-freestyle/files/__root__/app/templates/freestyle.hbs +14 -20
- package/blueprints/ember-freestyle/index.js +0 -1
- package/index.js +15 -1
- package/lib/ast-transform.js +26 -33
- package/package.json +50 -44
- package/vendor/ember-freestyle.css +523 -0
- package/addon/components/freestyle/usage/object/control.hbs +0 -7
- package/addon/components/freestyle-note/index.hbs +0 -3
- package/addon/components/freestyle-note/index.js +0 -11
- package/addon/helpers/equal.js +0 -3
- package/addon/helpers/is-present.js +0 -10
- package/addon/helpers/pick.js +0 -14
- package/app/components/freestyle-note.js +0 -9
- package/app/helpers/is-present.js +0 -1
- package/app/helpers/pick.js +0 -1
- package/app/helpers/variant-eq.js +0 -4
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* eslint-disable ember/no-component-lifecycle-hooks */
|
|
2
2
|
import { inject as service } from '@ember/service';
|
|
3
|
-
import { and, readOnly } from '@ember/object/computed';
|
|
3
|
+
import { and, or, readOnly } from '@ember/object/computed';
|
|
4
4
|
import Component from '@ember/component';
|
|
5
|
-
import { computed } from '@ember/object';
|
|
6
|
-
import { action } from '@ember/object';
|
|
5
|
+
import { action, computed } from '@ember/object';
|
|
7
6
|
|
|
8
7
|
let FreestyleUsage = Component.extend({
|
|
9
8
|
tagName: '',
|
|
@@ -22,7 +21,7 @@ let FreestyleUsage = Component.extend({
|
|
|
22
21
|
}),
|
|
23
22
|
defaultTheme: readOnly('emberFreestyle.defaultTheme'),
|
|
24
23
|
// highlightJsTheme - passed in
|
|
25
|
-
computedTheme:
|
|
24
|
+
computedTheme: or('defaultTheme', 'highlightJsTheme'),
|
|
26
25
|
|
|
27
26
|
hasLabels: and('showLabels', 'title'),
|
|
28
27
|
hasCode: computed('showCode', 'slug', 'source', function () {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
{{#if this.showFocus}}
|
|
40
40
|
<div class="FreestyleUsageControls-item FreestyleUsageControls-item--focus">
|
|
41
41
|
<div class="FreestyleUsageControls-itemControl">
|
|
42
|
-
<label
|
|
43
|
-
<Input class="FreestyleUsageControls-input--focus" @value={{this.focus}} @
|
|
42
|
+
<label class="FreestyleUsageControls-label--focus">Focus a section
|
|
43
|
+
<Input class="FreestyleUsageControls-input--focus" @value={{this.focus}} @enter={{this.setFocus}} />
|
|
44
44
|
</label>
|
|
45
45
|
<button class="FreestyleUsageControls-button" onclick={{this.setFocus}} type="button">Focus</button>
|
|
46
46
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<ul class='FreestyleCollection-variantList'>
|
|
2
2
|
{{#each @variants as |variantKey|}}
|
|
3
3
|
<li
|
|
4
|
-
class='FreestyleCollection-variantListItem {{if (
|
|
4
|
+
class='FreestyleCollection-variantListItem {{if (eq @activeKey variantKey) 'FreestyleCollection-variantListItem--active'}}'
|
|
5
5
|
role="button"
|
|
6
6
|
onclick={{fn this.onClickItem variantKey}}
|
|
7
7
|
>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* global hljs */
|
|
2
2
|
import Service from '@ember/service';
|
|
3
|
-
import { isPresent } from '@ember/utils';
|
|
3
|
+
import { isBlank, isPresent } from '@ember/utils';
|
|
4
4
|
import { A } from '@ember/array';
|
|
5
5
|
import { Promise } from 'rsvp';
|
|
6
6
|
import { tracked } from '@glimmer/tracking';
|
|
7
|
-
import { isBlank } from '@ember/utils';
|
|
8
7
|
import { action } from '@ember/object';
|
|
8
|
+
|
|
9
9
|
export default class EmberFreestyleService extends Service {
|
|
10
10
|
@tracked showLabels = true;
|
|
11
11
|
@tracked showNotes = true;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
margin-top: 1.5rem;
|
|
16
16
|
}
|
|
17
17
|
&-description {
|
|
18
|
-
margin: .5rem 0;
|
|
18
|
+
margin: 0.5rem 0;
|
|
19
19
|
font-size: 1.1rem;
|
|
20
20
|
color: #666;
|
|
21
21
|
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
&:after {
|
|
42
42
|
content: 'Preview';
|
|
43
|
-
font-size: .7rem;
|
|
43
|
+
font-size: 0.7rem;
|
|
44
44
|
position: absolute;
|
|
45
45
|
right: 0;
|
|
46
46
|
top: 0;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
th,
|
|
80
80
|
td {
|
|
81
|
-
padding: .5rem 1rem;
|
|
81
|
+
padding: 0.5rem 1rem;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -87,12 +87,11 @@
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
91
90
|
/*
|
|
92
91
|
FreestyleUsageArgument
|
|
93
92
|
*/
|
|
94
93
|
.FreestyleUsageArgument {
|
|
95
|
-
font-size: .8rem;
|
|
94
|
+
font-size: 0.8rem;
|
|
96
95
|
|
|
97
96
|
&-name {
|
|
98
97
|
font-weight: bold;
|
|
@@ -103,7 +102,7 @@
|
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
&-required {
|
|
106
|
-
color: #
|
|
105
|
+
color: #d81c38;
|
|
107
106
|
font-style: oblique;
|
|
108
107
|
}
|
|
109
108
|
&-default {
|
|
@@ -111,8 +110,9 @@
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
&-jsonViewer {
|
|
114
|
-
|
|
113
|
+
background-color: #222;
|
|
115
114
|
min-width: 300px;
|
|
115
|
+
padding: 1rem;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
display: flex;
|
|
122
122
|
|
|
123
123
|
&:after {
|
|
124
|
-
content:
|
|
124
|
+
content: 'False';
|
|
125
125
|
display: block;
|
|
126
126
|
position: absolute;
|
|
127
127
|
top: 2px;
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
color: #999;
|
|
131
131
|
}
|
|
132
132
|
&.is-checked:after {
|
|
133
|
-
content:
|
|
133
|
+
content: 'True';
|
|
134
134
|
color: #333;
|
|
135
135
|
font-weight: 700;
|
|
136
136
|
}
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
|
|
139
139
|
.FreestyleUsageArray {
|
|
140
140
|
&-item {
|
|
141
|
-
margin: 0 0 .5em 0;
|
|
141
|
+
margin: 0 0 0.5em 0;
|
|
142
142
|
display: flex;
|
|
143
143
|
flex-direction: row;
|
|
144
144
|
justify-content: space-between;
|
|
@@ -151,14 +151,14 @@
|
|
|
151
151
|
cursor: pointer;
|
|
152
152
|
padding: 2px 4px;
|
|
153
153
|
text-transform: uppercase;
|
|
154
|
-
letter-spacing: .5px;
|
|
155
|
-
font-size: .8em;
|
|
154
|
+
letter-spacing: 0.5px;
|
|
155
|
+
font-size: 0.8em;
|
|
156
156
|
border-radius: 4px;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
&-removeItem {
|
|
160
160
|
color: #999;
|
|
161
|
-
opacity: .5;
|
|
161
|
+
opacity: 0.5;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
&-addItem {
|
|
@@ -179,6 +179,6 @@
|
|
|
179
179
|
color: #777;
|
|
180
180
|
display: inline-block;
|
|
181
181
|
font-family: monospace;
|
|
182
|
-
margin-right: .2em;
|
|
182
|
+
margin-right: 0.2em;
|
|
183
183
|
padding: 1px 7px;
|
|
184
184
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
$FreestyleCollection-maxWidth: $FreestyleGuide-maxWidth !default;
|
|
2
|
-
$FreestyleCollection-shadow1: rgba(0, 0, 0, .16);
|
|
3
|
-
$FreestyleCollection-shadow2: rgba(0, 0, 0, .12);
|
|
4
|
-
$FreestyleCollection-boxShadow: 0 2px 5px 0 $FreestyleCollection-shadow1,
|
|
2
|
+
$FreestyleCollection-shadow1: rgba(0, 0, 0, 0.16);
|
|
3
|
+
$FreestyleCollection-shadow2: rgba(0, 0, 0, 0.12);
|
|
4
|
+
$FreestyleCollection-boxShadow: 0 2px 5px 0 $FreestyleCollection-shadow1,
|
|
5
|
+
0 2px 10px 0 $FreestyleCollection-shadow2;
|
|
5
6
|
|
|
6
7
|
.FreestyleCollection {
|
|
7
8
|
max-width: $FreestyleCollection-maxWidth;
|
|
@@ -34,7 +35,7 @@ $FreestyleCollection-boxShadow: 0 2px 5px 0 $FreestyleCollection-shadow1, 0 2px
|
|
|
34
35
|
float: left;
|
|
35
36
|
font-size: 14px;
|
|
36
37
|
height: 48px;
|
|
37
|
-
letter-spacing: .8px;
|
|
38
|
+
letter-spacing: 0.8px;
|
|
38
39
|
line-height: 48px;
|
|
39
40
|
margin: 0;
|
|
40
41
|
min-width: 120px;
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
$FreestyleGuide-maxWidth: 1200px !default;
|
|
8
8
|
$FreestyleGuide-asideBackgroundColor: #fff !default;
|
|
9
|
-
$FreestyleGuide-shadow1: rgba(0, 0, 0, .16);
|
|
10
|
-
$FreestyleGuide-shadow2: rgba(0, 0, 0, .12);
|
|
11
|
-
$FreestyleGuide-boxShadow: 0 2px 5px 0 $FreestyleGuide-shadow1,
|
|
9
|
+
$FreestyleGuide-shadow1: rgba(0, 0, 0, 0.16);
|
|
10
|
+
$FreestyleGuide-shadow2: rgba(0, 0, 0, 0.12);
|
|
11
|
+
$FreestyleGuide-boxShadow: 0 2px 5px 0 $FreestyleGuide-shadow1,
|
|
12
|
+
0 2px 10px 0 $FreestyleGuide-shadow2;
|
|
12
13
|
|
|
13
14
|
.FreestyleGuide {
|
|
14
15
|
display: flex;
|
|
@@ -27,7 +28,7 @@ $FreestyleGuide-boxShadow: 0 2px 5px 0 $FreestyleGuide-shadow1, 0 2px 10px 0 $Fr
|
|
|
27
28
|
align-items: center;
|
|
28
29
|
justify-content: space-between;
|
|
29
30
|
border-bottom: solid 1px $FreestyleGuide-color--secondary;
|
|
30
|
-
padding: .5rem 1rem;
|
|
31
|
+
padding: 0.5rem 1rem;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&-cta {
|
|
@@ -97,10 +98,10 @@ $FreestyleGuide-boxShadow: 0 2px 5px 0 $FreestyleGuide-shadow1, 0 2px 10px 0 $Fr
|
|
|
97
98
|
&-aside {
|
|
98
99
|
background: $FreestyleGuide-asideBackgroundColor;
|
|
99
100
|
box-shadow: $FreestyleGuide-boxShadow;
|
|
100
|
-
margin-right: .5rem;
|
|
101
|
+
margin-right: 0.5rem;
|
|
101
102
|
order: -2;
|
|
102
103
|
position: fixed;
|
|
103
|
-
right: .5rem;
|
|
104
|
+
right: 0.5rem;
|
|
104
105
|
|
|
105
106
|
@include freestyle-breakpoint(large) {
|
|
106
107
|
border-left: solid 1px $FreestyleGuide-color--secondary;
|
|
File without changes
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
$FreestyleUsageControls-backgroundColor: #fff !default;
|
|
2
|
-
$FreestyleUsageControls-shadow1: rgba(0, 0, 0, .16);
|
|
3
|
-
$FreestyleUsageControls-shadow2: rgba(0, 0, 0, .12);
|
|
4
|
-
$FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
|
|
2
|
+
$FreestyleUsageControls-shadow1: rgba(0, 0, 0, 0.16);
|
|
3
|
+
$FreestyleUsageControls-shadow2: rgba(0, 0, 0, 0.12);
|
|
4
|
+
$FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
|
|
5
|
+
0 2px 10px 0 $FreestyleUsageControls-shadow2;
|
|
5
6
|
|
|
6
7
|
.FreestyleUsageControls {
|
|
7
8
|
background: $FreestyleUsageControls-backgroundColor;
|
|
8
|
-
font-size: .9rem;
|
|
9
|
+
font-size: 0.9rem;
|
|
9
10
|
padding: 1rem;
|
|
10
11
|
text-align: left;
|
|
11
12
|
width: 200px;
|
|
@@ -13,7 +14,7 @@ $FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
|
|
|
13
14
|
&-header {
|
|
14
15
|
color: $FreestyleGuide-color--primary;
|
|
15
16
|
font-weight: bold;
|
|
16
|
-
margin-bottom: .3rem;
|
|
17
|
+
margin-bottom: 0.3rem;
|
|
17
18
|
text-transform: uppercase;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -22,22 +23,22 @@ $FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
|
|
|
22
23
|
display: flex;
|
|
23
24
|
|
|
24
25
|
&--focus {
|
|
25
|
-
padding-top: .6rem;
|
|
26
|
+
padding-top: 0.6rem;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&-itemControl {
|
|
30
31
|
cursor: pointer;
|
|
31
|
-
padding-right: .1rem;
|
|
32
|
+
padding-right: 0.1rem;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
&-itemLabel {
|
|
35
|
-
font-size: .8rem;
|
|
36
|
+
font-size: 0.8rem;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
&-input {
|
|
39
40
|
&--focus {
|
|
40
|
-
margin-bottom: .2rem;
|
|
41
|
+
margin-bottom: 0.2rem;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -47,8 +48,8 @@ $FreestyleUsageControls-boxShadow: 0 2px 5px 0 $FreestyleUsageControls-shadow1,
|
|
|
47
48
|
box-shadow: $FreestyleUsageControls-boxShadow;
|
|
48
49
|
color: $FreestyleGuide-color--background;
|
|
49
50
|
cursor: pointer;
|
|
50
|
-
font-size: .6rem;
|
|
51
|
-
padding: .4rem 1rem;
|
|
51
|
+
font-size: 0.6rem;
|
|
52
|
+
padding: 0.4rem 1rem;
|
|
52
53
|
text-transform: uppercase;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -10,10 +10,6 @@ $FreestyleUsage-maxWidth: $FreestyleGuide-maxWidth !default;
|
|
|
10
10
|
text-transform: uppercase;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
&-notes {
|
|
14
|
-
font-size: .9rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
&-rendered {
|
|
18
14
|
padding: 1rem;
|
|
19
15
|
}
|
|
@@ -24,11 +20,11 @@ $FreestyleUsage-maxWidth: $FreestyleGuide-maxWidth !default;
|
|
|
24
20
|
|
|
25
21
|
&-sourceContainer {
|
|
26
22
|
pre {
|
|
27
|
-
font-size: .8rem;
|
|
23
|
+
font-size: 0.8rem;
|
|
28
24
|
margin-top: 0;
|
|
29
25
|
|
|
30
26
|
&.hljs {
|
|
31
|
-
padding: .5rem 1rem;
|
|
27
|
+
padding: 0.5rem 1rem;
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
}
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// TODO: Replace with actual breakpoint system
|
|
2
2
|
$FreestyleBreakpoints: (
|
|
3
|
-
large: 600px
|
|
3
|
+
large: 600px,
|
|
4
4
|
);
|
|
5
5
|
|
|
6
6
|
@mixin freestyle-breakpoint($name: 'large') {
|
|
7
7
|
@media (min-width: map-get($FreestyleBreakpoints, $name)) {
|
|
8
|
-
@content
|
|
8
|
+
@content;
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
|
|
12
12
|
// Default Ember Freestyle Palette
|
|
13
13
|
$FreestyleGuide-color--primary: #00bcd4 !default;
|
|
@@ -1,60 +1,29 @@
|
|
|
1
|
-
import Ember from 'ember';
|
|
2
1
|
import BaseFreestyleController from 'ember-freestyle/controllers/freestyle';
|
|
3
2
|
import { inject as service } from '@ember/service';
|
|
4
3
|
|
|
5
4
|
export default class FreestyleController extends BaseFreestyleController {
|
|
6
5
|
@service emberFreestyle;
|
|
7
6
|
|
|
8
|
-
/* BEGIN-FREESTYLE-USAGE fp--notes
|
|
9
|
-
### A few notes regarding freestyle-palette
|
|
10
|
-
|
|
11
|
-
- Accepts a colorPalette POJO like the one found in the freestyle.js blueprint controller
|
|
12
|
-
- Looks very nice
|
|
13
|
-
|
|
14
|
-
And another thing...
|
|
15
|
-
|
|
16
|
-
###### Markdown note demonstrating prettified code
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
import Ember from 'ember';
|
|
20
|
-
|
|
21
|
-
export default Ember.Component.extend({
|
|
22
|
-
// ...
|
|
23
|
-
colorPalette: {
|
|
24
|
-
'primary': {
|
|
25
|
-
'name': 'cyan',
|
|
26
|
-
'base': '#00bcd4'
|
|
27
|
-
},
|
|
28
|
-
'accent': {
|
|
29
|
-
'name': 'amber',
|
|
30
|
-
'base': '#ffc107'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// ...
|
|
34
|
-
});
|
|
35
|
-
```
|
|
36
|
-
END-FREESTYLE-USAGE */
|
|
37
|
-
|
|
38
7
|
colorPalette = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
8
|
+
primary: {
|
|
9
|
+
name: 'cyan',
|
|
10
|
+
base: '#00bcd4',
|
|
11
|
+
},
|
|
12
|
+
accent: {
|
|
13
|
+
name: 'amber',
|
|
14
|
+
base: '#ffc107',
|
|
42
15
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
16
|
+
secondary: {
|
|
17
|
+
name: 'greyish',
|
|
18
|
+
base: '#b6b6b6',
|
|
46
19
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
20
|
+
foreground: {
|
|
21
|
+
name: 'blackish',
|
|
22
|
+
base: '#212121',
|
|
50
23
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
24
|
+
background: {
|
|
25
|
+
name: 'white',
|
|
26
|
+
base: '#ffffff',
|
|
54
27
|
},
|
|
55
|
-
'background': {
|
|
56
|
-
'name': 'white',
|
|
57
|
-
'base': '#ffffff'
|
|
58
|
-
}
|
|
59
28
|
};
|
|
60
29
|
}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
<FreestyleGuide
|
|
2
|
-
@title=
|
|
3
|
-
@subtitle=
|
|
2
|
+
@title="Ember Freestyle"
|
|
3
|
+
@subtitle="Living Style Guide"
|
|
4
4
|
>
|
|
5
|
-
<FreestyleSection @name=
|
|
6
|
-
<Section.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<FreestyleTypeface @fontFamily='Times New Roman' />
|
|
5
|
+
<FreestyleSection @name="Visual Style" as |Section|>
|
|
6
|
+
<Section.subsection @name="Typography">
|
|
7
|
+
<FreestyleUsage @slug="typography-times" @title="Times New Roman">
|
|
8
|
+
<FreestyleTypeface @fontFamily="Times New Roman" />
|
|
10
9
|
</FreestyleUsage>
|
|
11
10
|
|
|
12
|
-
<FreestyleUsage @slug=
|
|
13
|
-
<FreestyleTypeface @fontFamily=
|
|
11
|
+
<FreestyleUsage @slug="typography-helvetica" @title="Helvetica">
|
|
12
|
+
<FreestyleTypeface @fontFamily="Helvetica" />
|
|
14
13
|
</FreestyleUsage>
|
|
14
|
+
</Section.subsection>
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<Section.Subsection @name='Color'>
|
|
19
|
-
|
|
20
|
-
<FreestyleUsage @slug='fp' @title='Freestyle Palette' @usageTitle='Usage'>
|
|
21
|
-
|
|
16
|
+
<Section.subsection @name="Color">
|
|
17
|
+
<FreestyleUsage @slug="fp" @title="Freestyle Palette" @usageTitle="Usage">
|
|
22
18
|
<FreestylePalette
|
|
23
19
|
@colorPalette={{this.colorPalette}}
|
|
24
|
-
@title=
|
|
25
|
-
@description=
|
|
20
|
+
@title="Dummy App Color Palette"
|
|
21
|
+
@description="This component displays the color palette specified in app/controllers/freestyle.js"
|
|
26
22
|
/>
|
|
27
23
|
</FreestyleUsage>
|
|
28
|
-
|
|
29
|
-
</Section.Subsection>
|
|
30
|
-
|
|
24
|
+
</Section.subsection>
|
|
31
25
|
</FreestyleSection>
|
|
32
26
|
</FreestyleGuide>
|
package/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const DEFAULT_OPTIONS = {
|
|
4
|
+
includeStyles: true,
|
|
5
|
+
};
|
|
6
|
+
|
|
3
7
|
module.exports = {
|
|
4
8
|
name: require('./package').name,
|
|
5
9
|
|
|
@@ -11,10 +15,20 @@ module.exports = {
|
|
|
11
15
|
this._super.included.apply(this, arguments);
|
|
12
16
|
// support for nested addon
|
|
13
17
|
// see: https://github.com/ember-cli/ember-cli/issues/3718
|
|
14
|
-
|
|
18
|
+
const target = parentAddon || app;
|
|
19
|
+
|
|
15
20
|
if (!this.app && target.app) {
|
|
16
21
|
this.app = target.app;
|
|
17
22
|
}
|
|
23
|
+
|
|
24
|
+
const options = {
|
|
25
|
+
...DEFAULT_OPTIONS,
|
|
26
|
+
...this.app.options[this.name],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (options.includeStyles === true) {
|
|
30
|
+
this.app.import('vendor/ember-freestyle.css');
|
|
31
|
+
}
|
|
18
32
|
},
|
|
19
33
|
|
|
20
34
|
setupPreprocessorRegistry(type, registry) {
|