@spectrum-web-components/theme 0.10.2 → 0.11.0
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/README.md +54 -38
- package/core.d.ts +1 -0
- package/core.js +15 -0
- package/core.js.map +1 -0
- package/custom-elements.json +184 -6
- package/express/scale-large.d.ts +1 -0
- package/express/scale-large.js +16 -0
- package/express/scale-large.js.map +1 -0
- package/express/scale-medium.d.ts +1 -0
- package/express/scale-medium.js +16 -0
- package/express/scale-medium.js.map +1 -0
- package/express/theme-dark.d.ts +1 -0
- package/express/theme-dark.js +16 -0
- package/express/theme-dark.js.map +1 -0
- package/express/theme-darkest.d.ts +1 -0
- package/express/theme-darkest.js +16 -0
- package/express/theme-darkest.js.map +1 -0
- package/express/theme-light.d.ts +1 -0
- package/express/theme-light.js +16 -0
- package/express/theme-light.js.map +1 -0
- package/express/theme-lightest.d.ts +1 -0
- package/express/theme-lightest.js +16 -0
- package/express/theme-lightest.js.map +1 -0
- package/package.json +14 -5
- package/scale-large.d.ts +1 -1
- package/scale-large.js +1 -0
- package/scale-large.js.map +1 -1
- package/scale-medium.d.ts +1 -1
- package/scale-medium.js +1 -0
- package/scale-medium.js.map +1 -1
- package/src/Theme.d.ts +12 -7
- package/src/Theme.js +58 -14
- package/src/Theme.js.map +1 -1
- package/src/express/core.d.ts +1 -0
- package/src/express/core.js +15 -0
- package/src/express/core.js.map +1 -0
- package/src/express/scale-large.css.d.ts +2 -0
- package/src/express/scale-large.css.js +4079 -0
- package/src/express/scale-large.css.js.map +1 -0
- package/src/express/scale-medium.css.d.ts +2 -0
- package/src/express/scale-medium.css.js +4135 -0
- package/src/express/scale-medium.css.js.map +1 -0
- package/src/express/theme-dark.css.d.ts +2 -0
- package/src/express/theme-dark.css.js +35 -0
- package/src/express/theme-dark.css.js.map +1 -0
- package/src/express/theme-light.css.d.ts +2 -0
- package/src/express/theme-light.css.js +35 -0
- package/src/express/theme-light.css.js.map +1 -0
- package/src/express/theme.css.d.ts +2 -0
- package/src/express/theme.css.js +1705 -0
- package/src/express/theme.css.js.map +1 -0
- package/src/express/themes.d.ts +6 -0
- package/src/express/themes.js +18 -0
- package/src/express/themes.js.map +1 -0
- package/src/scale-large.css.js +1 -1
- package/src/scale-large.css.js.map +1 -1
- package/src/scale-medium.css.js +1 -1
- package/src/scale-medium.css.js.map +1 -1
- package/src/theme-dark.css.js +2 -2
- package/src/theme-dark.css.js.map +1 -1
- package/src/theme-darkest.css.js +2 -2
- package/src/theme-darkest.css.js.map +1 -1
- package/src/theme-light.css.js +2 -2
- package/src/theme-light.css.js.map +1 -1
- package/src/theme-lightest.css.js +2 -2
- package/src/theme-lightest.css.js.map +1 -1
- package/src/theme.css.js +3 -3
- package/src/theme.css.js.map +1 -1
- package/src/typography.css.js +1 -1
- package/src/typography.css.js.map +1 -1
- package/stories/theme.stories.js +27 -6
- package/stories/theme.stories.js.map +1 -1
- package/test/theme-lazy.test.js +1 -1
- package/test/theme-lazy.test.js.map +1 -1
- package/test/themes.test.js +2 -2
- package/test/themes.test.js.map +1 -1
- package/theme-dark.d.ts +1 -1
- package/theme-dark.js +1 -0
- package/theme-dark.js.map +1 -1
- package/theme-darkest.d.ts +1 -1
- package/theme-darkest.js +1 -0
- package/theme-darkest.js.map +1 -1
- package/theme-light.d.ts +1 -1
- package/theme-light.js +1 -0
- package/theme-light.js.map +1 -1
- package/theme-lightest.d.ts +1 -1
- package/theme-lightest.js +1 -0
- package/theme-lightest.js.map +1 -1
package/README.md
CHANGED
|
@@ -25,12 +25,18 @@ When looking to leverage the `Theme` base class as a type and/or for extension p
|
|
|
25
25
|
import { Theme } from '@spectrum-web-components/theme';
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
The various themes can be imported en masse:
|
|
28
|
+
The various Classic themes can be imported en masse:
|
|
29
29
|
|
|
30
30
|
```
|
|
31
31
|
import '@spectrum-web-components/theme/src/themes.js';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
The various Express themes can be imported en masse:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
import '@spectrum-web-components/theme/src/express/themes.js';
|
|
38
|
+
```
|
|
39
|
+
|
|
34
40
|
Or, individually:
|
|
35
41
|
|
|
36
42
|
```
|
|
@@ -40,6 +46,12 @@ import '@spectrum-web-components/theme/theme-light.js';
|
|
|
40
46
|
import '@spectrum-web-components/theme/theme-lightest.js';
|
|
41
47
|
import '@spectrum-web-components/theme/scale-medium.js';
|
|
42
48
|
import '@spectrum-web-components/theme/scale-large.js';
|
|
49
|
+
import '@spectrum-web-components/theme/express/theme-darkest.js';
|
|
50
|
+
import '@spectrum-web-components/theme/express/theme-dark.js';
|
|
51
|
+
import '@spectrum-web-components/theme/express/theme-light.js';
|
|
52
|
+
import '@spectrum-web-components/theme/express/theme-lightest.js';
|
|
53
|
+
import '@spectrum-web-components/theme/express/scale-medium.js';
|
|
54
|
+
import '@spectrum-web-components/theme/express/scale-large.js';
|
|
43
55
|
```
|
|
44
56
|
|
|
45
57
|
## Quick start
|
|
@@ -55,14 +67,42 @@ The above import will get you started using the `<sp-theme>` wrapper element, an
|
|
|
55
67
|
|
|
56
68
|
Once you've moved beyond the prototype phases of an application, it is likely that you will only use one combinatin of `color` and `scale` in your application, and even when you don't you will likely benefit from lazily loading variants that you don't leverage by default. For single combination applications or to power a _default_ theme, the following imports can be used to ensure only the code your application requires is loaded:
|
|
57
69
|
|
|
70
|
+
### Classic
|
|
71
|
+
|
|
58
72
|
```js
|
|
59
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Power a site using
|
|
75
|
+
*
|
|
76
|
+
* <sp-theme
|
|
77
|
+
* theme="classic"
|
|
78
|
+
* color="darkest"
|
|
79
|
+
* scale="large"
|
|
80
|
+
* >
|
|
81
|
+
**/
|
|
60
82
|
import '@spectrum-web-components/theme/theme-darkest.js';
|
|
61
83
|
import '@spectrum-web-components/theme/scale-large.js';
|
|
62
84
|
|
|
63
85
|
import '@spectrum-web-components/theme/sp-theme.js';
|
|
64
86
|
```
|
|
65
87
|
|
|
88
|
+
### Express
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
/**
|
|
92
|
+
* Power a site using
|
|
93
|
+
*
|
|
94
|
+
* <sp-theme
|
|
95
|
+
* theme="express"
|
|
96
|
+
* color="light"
|
|
97
|
+
* scale="medium"
|
|
98
|
+
* >
|
|
99
|
+
**/
|
|
100
|
+
import '@spectrum-web-components/theme/express/theme-light.js';
|
|
101
|
+
import '@spectrum-web-components/theme/express/scale-medium.js';
|
|
102
|
+
|
|
103
|
+
import '@spectrum-web-components/theme/sp-theme.js';
|
|
104
|
+
```
|
|
105
|
+
|
|
66
106
|
When subsequent theme variants are needed you can ensure those are lazily loaded by leveraging dynamic imports via something like the following:
|
|
67
107
|
|
|
68
108
|
```js
|
|
@@ -102,25 +142,13 @@ The `<sp-theme>` element provides a language context for its descendents in the
|
|
|
102
142
|
margin-top: 2em;
|
|
103
143
|
}
|
|
104
144
|
</style>
|
|
105
|
-
<sp-theme color="light">
|
|
106
|
-
<
|
|
107
|
-
<div>
|
|
108
|
-
<sp-slider
|
|
109
|
-
value="5"
|
|
110
|
-
step="1"
|
|
111
|
-
min="1"
|
|
112
|
-
max="11"
|
|
113
|
-
label="Volume"
|
|
114
|
-
id="volume-slider"
|
|
115
|
-
></sp-slider>
|
|
116
|
-
</div>
|
|
117
|
-
<div><sp-switch>Overdrive</sp-switch></div>
|
|
118
|
-
<sp-button-group id="buttons">
|
|
119
|
-
<sp-button variant="primary">Cancel</sp-button>
|
|
120
|
-
<sp-button variant="cta">Continue</sp-button>
|
|
121
|
-
</sp-button-group>
|
|
122
|
-
</div>
|
|
145
|
+
<sp-theme theme="express" color="light" scale="medium">
|
|
146
|
+
<hzn-app-stuff></hzn-app-stuff>
|
|
123
147
|
</sp-theme>
|
|
148
|
+
|
|
149
|
+
<express-app>
|
|
150
|
+
<hzn-app-stuff></hzn-app-stuff>
|
|
151
|
+
</express-app>
|
|
124
152
|
```
|
|
125
153
|
|
|
126
154
|
## Dark theme
|
|
@@ -138,25 +166,13 @@ The `<sp-theme>` element provides a language context for its descendents in the
|
|
|
138
166
|
margin-top: 2em;
|
|
139
167
|
}
|
|
140
168
|
</style>
|
|
141
|
-
<sp-theme color="dark">
|
|
142
|
-
<
|
|
143
|
-
<div>
|
|
144
|
-
<sp-slider
|
|
145
|
-
value="5"
|
|
146
|
-
step="1"
|
|
147
|
-
min="1"
|
|
148
|
-
max="11"
|
|
149
|
-
label="Volume"
|
|
150
|
-
id="volume-slider"
|
|
151
|
-
></sp-slider>
|
|
152
|
-
</div>
|
|
153
|
-
<div><sp-switch>Overdrive</sp-switch></div>
|
|
154
|
-
<sp-button-group id="buttons">
|
|
155
|
-
<sp-button variant="primary">Cancel</sp-button>
|
|
156
|
-
<sp-button variant="cta">Continue</sp-button>
|
|
157
|
-
</sp-button-group>
|
|
158
|
-
</div>
|
|
169
|
+
<sp-theme theme="express" color="dark" scale="large">
|
|
170
|
+
<hzn-app-stuff></hzn-app-stuff>
|
|
159
171
|
</sp-theme>
|
|
172
|
+
|
|
173
|
+
<express-app>
|
|
174
|
+
<hzn-app-stuff></hzn-app-stuff>
|
|
175
|
+
</express-app>
|
|
160
176
|
```
|
|
161
177
|
|
|
162
178
|
## Large scale
|
package/core.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/core.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { Theme } from './src/Theme.js';
|
|
13
|
+
import coreStyles from './src/theme.css.js';
|
|
14
|
+
Theme.registerThemeFragment('spectrum', 'theme', coreStyles);
|
|
15
|
+
//# sourceMappingURL=core.js.map
|
package/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAE5C,KAAK,CAAC,qBAAqB,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Theme } from './src/Theme.js';\n\nimport coreStyles from './src/theme.css.js';\n\nTheme.registerThemeFragment('spectrum', 'theme', coreStyles);\n"]}
|