@pure-ds/core 0.5.16 → 0.5.17
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
|
@@ -156,9 +156,47 @@ async function ensurePdsConfig(consumerRoot, force = false) {
|
|
|
156
156
|
// File doesn't exist, create it
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
const defaultConfig = `
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const defaultConfig = `import { PDS } from '@pure-ds/core';
|
|
160
|
+
|
|
161
|
+
const defaultEnhancers = Array.isArray(PDS.defaultEnhancers)
|
|
162
|
+
? PDS.defaultEnhancers
|
|
163
|
+
: [];
|
|
164
|
+
|
|
165
|
+
export const config = {
|
|
166
|
+
mode: "static",
|
|
167
|
+
preset: "social-feed",
|
|
168
|
+
|
|
169
|
+
autoDefine: {
|
|
170
|
+
predefine: ["pds-icon", "pds-drawer", "pds-toaster"],
|
|
171
|
+
|
|
172
|
+
// Custom component paths
|
|
173
|
+
mapper: (tag) => {
|
|
174
|
+
if (tag.startsWith("my-")) return "/assets/my/\${tag}.js";
|
|
175
|
+
|
|
176
|
+
// Return nothing to use PDS default mapping
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
enhancers: [
|
|
180
|
+
...defaultEnhancers,
|
|
181
|
+
{
|
|
182
|
+
selector: ".hero",
|
|
183
|
+
description: "Adds tooltip on hover",
|
|
184
|
+
run: (element) => {
|
|
185
|
+
// make the border-gradient in PDS rotate slowly
|
|
186
|
+
let angle = 135;
|
|
187
|
+
const speed = 0.5; // degrees per frame (~30 degrees/second at 60fps)
|
|
188
|
+
|
|
189
|
+
function animate() {
|
|
190
|
+
angle = (angle + speed) % 360;
|
|
191
|
+
element.style.setProperty("--gradient-angle", \`\${angle}deg\`);
|
|
192
|
+
requestAnimationFrame(animate);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
animate();
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
162
200
|
|
|
163
201
|
// Uncomment to override preset design tokens:
|
|
164
202
|
// design: {
|
|
@@ -177,35 +215,8 @@ async function ensurePdsConfig(consumerRoot, force = false) {
|
|
|
177
215
|
// baseUnit: 8,
|
|
178
216
|
// scaleRatio: 1.5
|
|
179
217
|
// }
|
|
180
|
-
// },
|
|
181
|
-
|
|
182
|
-
// Uncomment to add custom progressive enhancers:
|
|
183
|
-
// enhancers: [
|
|
184
|
-
// {
|
|
185
|
-
// selector: '[data-tooltip]',
|
|
186
|
-
// description: 'Adds tooltip on hover',
|
|
187
|
-
// run: (element) => {
|
|
188
|
-
// const text = element.dataset.tooltip;
|
|
189
|
-
// element.addEventListener('mouseenter', () => {
|
|
190
|
-
// // Show tooltip implementation
|
|
191
|
-
// });
|
|
192
|
-
// }
|
|
193
|
-
// }
|
|
194
|
-
// ],
|
|
195
|
-
|
|
196
|
-
// Uncomment to customize lazy-loaded web components:
|
|
197
|
-
// autoDefine: {
|
|
198
|
-
// baseURL: '/pds/components/',
|
|
199
|
-
// predefine: ['pds-icon', 'pds-drawer', 'pds-toaster'],
|
|
200
|
-
//
|
|
201
|
-
// // Custom component paths
|
|
202
|
-
// mapper: (tag) => {
|
|
203
|
-
// if (tag.startsWith('my-')) {
|
|
204
|
-
// return \`/components/\${tag}.js\`;
|
|
205
|
-
// }
|
|
206
|
-
// // Return nothing to use PDS default mapping
|
|
207
|
-
// }
|
|
208
218
|
// }
|
|
219
|
+
|
|
209
220
|
};
|
|
210
221
|
`;
|
|
211
222
|
|