@decidables/decidables-elements 0.5.5 → 0.5.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decidables/decidables-elements",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "decidables-elements: Basic UI Web Components for the decidables project",
5
5
  "keywords": [
6
6
  "web component",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "d3": "^7.9.0",
49
- "lit": "^3.3.1"
49
+ "lit": "^3.3.2"
50
50
  },
51
- "gitHead": "045955a4696ea4b38440d84d467cad3ddaad812d"
51
+ "gitHead": "6fcd31a19c082ec41bde7d351bcb52161c5b654b"
52
52
  }
package/src/button.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import {html, css} from 'lit';
2
+ import {css, html} from 'lit';
3
3
 
4
4
  import DecidablesElement from './decidables-element';
5
5
 
@@ -124,65 +124,12 @@ export default class DecidablesElement extends LitElement {
124
124
  return `${umbraS} ${umbraC}, ${penumbraS} ${penumbraC}, ${ambientS} ${ambientC}`;
125
125
  }
126
126
 
127
- static get svgDefs() {
128
- const shadows = DecidablesElement.shadows; /* eslint-disable-line prefer-destructuring */
129
-
130
- const filters = shadows.elevations.map((z) => {
131
- return `
132
- <filter id=${`shadow-${z}`} filterUnits="userSpaceOnUse" x="-100%" y="-100%" width="200%" height="200%">
133
- <feComponentTransfer in="SourceAlpha" result="solid">
134
- <feFuncA type="table" tableValues="0 1 1"/>
135
- </feComponentTransfer>
136
- <feOffset in="solid" result="offU" dx=${shadows.mapUmbra[z].y / 2} dy=${shadows.mapUmbra[z].y} />
137
- <feOffset in="solid" result="offP" dx=${shadows.mapPenumbra[z].y / 2} dy=${shadows.mapPenumbra[z].y} />
138
- <feOffset in="solid" result="offA" dx=${shadows.mapAmbient[z].y / 2} dy=${shadows.mapAmbient[z].y} />
139
- ${(shadows.mapUmbra[z].s === 0)
140
- ? ''
141
- : `<feMorphology in="offU" result="spreadU" operator=${(shadows.mapUmbra[z].s > 0) ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapUmbra[z].s)} />`
142
- }
143
- ${(shadows.mapPenumbra[z].s === 0)
144
- ? ''
145
- : `<feMorphology in="offP" result="spreadP" operator=${(shadows.mapPenumbra[z].s > 0) ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapPenumbra[z].s)} />`
146
- }
147
- ${(shadows.mapAmbient[z].s === 0)
148
- ? ''
149
- : `<feMorphology in="offA" result="spreadA" operator=${(shadows.mapAmbient[z].s > 0) ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapAmbient[z].s)} />`
150
- }
151
- <feGaussianBlur in=${(shadows.mapUmbra[z].s === 0) ? 'offU' : 'spreadU'} result="blurU" stdDeviation=${shadows.mapUmbra[z].b / 2} />
152
- <feGaussianBlur in=${(shadows.mapPenumbra[z].s === 0) ? 'offP' : 'spreadP'} result="blurP" stdDeviation=${shadows.mapPenumbra[z].b / 2} />
153
- <feGaussianBlur in=${(shadows.mapAmbient[z].s === 0) ? 'offA' : 'spreadA'} result="blurA" stdDeviation=${shadows.mapAmbient[z].b / 2} />
154
- <feFlood in="SourceGraphic" result="opU" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityUmbra + shadows.opacityBoost} />
155
- <feFlood in="SourceGraphic" result="opP" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityPenumbra + shadows.opacityBoost} />
156
- <feFlood in="SourceGraphic" result="opA" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityAmbient + shadows.opacityBoost} />
157
- <feComposite in="opU" in2="blurU" result="shU" operator="in" />
158
- <feComposite in="opP" in2="blurP" result="shP" operator="in" />
159
- <feComposite in="opA" in2="blurA" result="shA" operator="in" />
160
- <feMorphology in="solid" result="smaller" operator="erode" radius="1" />
161
- <feComposite in="shU" in2="smaller" result="finalU" operator="out" />
162
- <feComposite in="shP" in2="smaller" result="finalP" operator="out" />
163
- <feComposite in="shA" in2="smaller" result="finalA" operator="out" />
164
- <feMerge>
165
- <feMergeNode in="finalU" />
166
- <feMergeNode in="finalP" />
167
- <feMergeNode in="finalA" />
168
- <feMergeNode in="SourceGraphic" />
169
- </feMerge>
170
- </filter>`;
171
- });
172
-
173
- return `
174
- <defs>
175
- ${filters}
176
- </defs>
177
- `;
178
- }
179
-
180
127
  static get svgFilters() {
181
128
  const shadows = DecidablesElement.shadows; /* eslint-disable-line prefer-destructuring */
182
129
 
183
130
  const filters = shadows.elevations.map((z) => {
184
131
  return svg`
185
- <filter id=${`shadow-${z}`} x="-250%" y="-250%" width="600%" height="600%">
132
+ <filter id=${`shadow-${z}`} filterUnits="userSpaceOnUse" x="-100%" y="-100%" width="200%" height="200%">
186
133
  <feComponentTransfer in="SourceAlpha" result="solid">
187
134
  <feFuncA type="table" tableValues="0 1 1"/>
188
135
  </feComponentTransfer>
@@ -224,11 +171,9 @@ export default class DecidablesElement extends LitElement {
224
171
  });
225
172
 
226
173
  return svg`
227
- <svg class="defs">
228
- <defs>
229
- ${filters}
230
- </defs>
231
- </svg>
174
+ <defs class="filtersUser">
175
+ ${filters}
176
+ </defs>
232
177
  `;
233
178
  }
234
179
 
package/src/spinner.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  import {ifDefined} from 'lit/directives/if-defined.js'; /* eslint-disable-line import/extensions */
3
- import {html, css} from 'lit';
3
+ import {css, html} from 'lit';
4
4
 
5
5
  import DecidablesElement from './decidables-element';
6
6
 
package/src/switch.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import {html, css} from 'lit';
2
+ import {css, html} from 'lit';
3
3
 
4
4
  import DecidablesElement from './decidables-element';
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- import {html, css} from 'lit';
2
+ import {css, html} from 'lit';
3
3
 
4
4
  import DecidablesElement from './decidables-element';
5
5
 
package/src/toggle.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import {html, css} from 'lit';
2
+ import {css, html} from 'lit';
3
3
 
4
4
  import DecidablesElement from './decidables-element';
5
5