@decidables/decidables-elements 0.5.5 → 0.5.6
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/CHANGELOG.md +8 -0
- package/lib/decidablesElements.esm.js +4 -48
- package/lib/decidablesElements.esm.js.map +1 -1
- package/lib/decidablesElements.esm.min.js +16 -18
- package/lib/decidablesElements.esm.min.js.map +1 -1
- package/lib/decidablesElements.umd.js +4 -48
- package/lib/decidablesElements.umd.js.map +1 -1
- package/lib/decidablesElements.umd.min.js +24 -26
- package/lib/decidablesElements.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/button.js +1 -1
- package/src/decidables-element.js +4 -59
- package/src/spinner.js +1 -1
- package/src/switch.js +1 -1
- package/src/toggle-option.js +1 -1
- package/src/toggle.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decidables/decidables-elements",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "decidables-elements: Basic UI Web Components for the decidables project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web component",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"d3": "^7.9.0",
|
|
49
49
|
"lit": "^3.3.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8c39b095d6cc3cf6a5f49457048bebf53e7158c1"
|
|
52
52
|
}
|
package/src/button.js
CHANGED
|
@@ -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="-
|
|
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
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</defs>
|
|
231
|
-
</svg>
|
|
174
|
+
<defs class="filtersUser">
|
|
175
|
+
${filters}
|
|
176
|
+
</defs>
|
|
232
177
|
`;
|
|
233
178
|
}
|
|
234
179
|
|
package/src/spinner.js
CHANGED
package/src/switch.js
CHANGED
package/src/toggle-option.js
CHANGED
package/src/toggle.js
CHANGED