@spectrum-web-components/theme
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -6,2 +6,6 @@ # Change Log | ||
## [0.3.2](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/theme@0.3.1...@spectrum-web-components/theme@0.3.2) (2020-04-07) | ||
**Note:** Version bump only for package @spectrum-web-components/theme | ||
## [0.3.1](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/theme@0.3.0...@spectrum-web-components/theme@0.3.1) (2020-03-16) | ||
@@ -8,0 +12,0 @@ |
@@ -6,2 +6,3 @@ { | ||
"name": "sp-theme", | ||
"path": "./src/theme.ts", | ||
"attributes": [ | ||
@@ -8,0 +9,0 @@ { |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
@@ -33,9 +33,11 @@ import { CSSResult } from 'lit-element'; | ||
private static templateElement?; | ||
static readonly observedAttributes: string[]; | ||
readonly core: 'core'; | ||
color: Color; | ||
scale: Scale; | ||
static get observedAttributes(): string[]; | ||
get core(): 'core'; | ||
get color(): Color; | ||
set color(newValue: Color); | ||
get scale(): Scale; | ||
set scale(newValue: Scale); | ||
private getFragmentNameByKind; | ||
private readonly styles; | ||
private static readonly template; | ||
private get styles(); | ||
private static get template(); | ||
constructor(); | ||
@@ -42,0 +44,0 @@ private onQueryTheme; |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -25,4 +25,3 @@ you may not use this file except in compliance with the License. You may obtain a copy | ||
this.adoptStyles(); | ||
this.addEventListener('sp-query-theme', this | ||
.onQueryTheme); | ||
this.addEventListener('sp-query-theme', this.onQueryTheme); | ||
} | ||
@@ -29,0 +28,0 @@ static get observedAttributes() { |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "", | ||
@@ -42,6 +42,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@spectrum-web-components/styles": "^0.5.0", | ||
"@spectrum-web-components/styles": "^0.5.1", | ||
"tslib": "^1.10.0" | ||
}, | ||
"gitHead": "05f9a0b1e25b0419276845d0c5a3c9395fea78ea" | ||
"gitHead": "c2eb86ecfa01469b723cbf64163ae7f8e4203119" | ||
} |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -4,0 +4,0 @@ you may not use this file except in compliance with the License. You may obtain a copy |
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
@@ -120,19 +120,16 @@ you may not use this file except in compliance with the License. You may obtain a copy | ||
]; | ||
const styles = themeKinds.reduce( | ||
(acc, kind) => { | ||
const kindFragments = Theme.themeFragmentsByKind.get( | ||
kind | ||
) as FragmentMap; | ||
const defaultStyles = kindFragments.get('default'); | ||
const { [kind]: name } = this; | ||
const currentStyles = kindFragments.get(name); | ||
if (currentStyles) { | ||
acc.push(currentStyles.styles); | ||
} else if (defaultStyles) { | ||
acc.push(defaultStyles.styles); | ||
} | ||
return acc; | ||
}, | ||
[] as CSSResult[] | ||
); | ||
const styles = themeKinds.reduce((acc, kind) => { | ||
const kindFragments = Theme.themeFragmentsByKind.get( | ||
kind | ||
) as FragmentMap; | ||
const defaultStyles = kindFragments.get('default'); | ||
const { [kind]: name } = this; | ||
const currentStyles = kindFragments.get(name); | ||
if (currentStyles) { | ||
acc.push(currentStyles.styles); | ||
} else if (defaultStyles) { | ||
acc.push(defaultStyles.styles); | ||
} | ||
return acc; | ||
}, [] as CSSResult[]); | ||
return [coreStyles, ...styles]; | ||
@@ -158,4 +155,6 @@ } | ||
this.adoptStyles(); | ||
this.addEventListener('sp-query-theme', this | ||
.onQueryTheme as EventListener); | ||
this.addEventListener( | ||
'sp-query-theme', | ||
this.onQueryTheme as EventListener | ||
); | ||
} | ||
@@ -162,0 +161,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
426441
1888