@karmo-co/drift-kit-public 25.0.0 → 25.1.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/components.js +91 -1
- package/drift-kit.min.css +2 -2
- package/package.json +1 -1
package/components.js
CHANGED
|
@@ -340,7 +340,11 @@
|
|
|
340
340
|
var A = 'data-dk-cascade';
|
|
341
341
|
var last = 0;
|
|
342
342
|
function prop(root, name) { return getComputedStyle(root).getPropertyValue(name); }
|
|
343
|
-
function
|
|
343
|
+
function own(root) {
|
|
344
|
+
var v = (root.getAttribute(A + '-max-beats') || '').trim();
|
|
345
|
+
return /^[0-9]+$/.test(v) && +v >= 1 ? +v : 0;
|
|
346
|
+
}
|
|
347
|
+
function cap(root) { return own(root) || parseFloat(prop(root, '--dk-motion-cascade-max-beats')) || 8; }
|
|
344
348
|
function reduced() { return !!(dk.motion.reduced && dk.motion.reduced()); }
|
|
345
349
|
function set(el, i, max) {
|
|
346
350
|
el.setAttribute(A + '-unit', '');
|
|
@@ -1349,6 +1353,76 @@
|
|
|
1349
1353
|
init(document);
|
|
1350
1354
|
})();
|
|
1351
1355
|
})(typeof window !== 'undefined' ? window : undefined);
|
|
1356
|
+
(function (w) {
|
|
1357
|
+
if (!w)
|
|
1358
|
+
return;
|
|
1359
|
+
var d = (w.dk = w.dk || {});
|
|
1360
|
+
d.__loaded = d.__loaded || {};
|
|
1361
|
+
if (d.__loaded['kit/theme.js'])
|
|
1362
|
+
return;
|
|
1363
|
+
d.__loaded['kit/theme.js'] = true;
|
|
1364
|
+
(function () {
|
|
1365
|
+
'use strict';
|
|
1366
|
+
var dk = (window.dk = window.dk || {});
|
|
1367
|
+
if (dk.theme)
|
|
1368
|
+
return;
|
|
1369
|
+
var FROM = 'data-theme-from';
|
|
1370
|
+
var THEMES = { light: true, dark: true };
|
|
1371
|
+
function set(el, theme) {
|
|
1372
|
+
if (!el || !el.setAttribute || !THEMES.hasOwnProperty(theme))
|
|
1373
|
+
return false;
|
|
1374
|
+
el.setAttribute('data-theme', theme);
|
|
1375
|
+
if (el === document.documentElement && document.body)
|
|
1376
|
+
document.body.setAttribute('data-theme', theme);
|
|
1377
|
+
return true;
|
|
1378
|
+
}
|
|
1379
|
+
function current(el) {
|
|
1380
|
+
var host = el && el.closest ? el.closest('[data-theme]') : null;
|
|
1381
|
+
return host && host.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
|
|
1382
|
+
}
|
|
1383
|
+
function toggle(el) {
|
|
1384
|
+
var shown = el === document.documentElement && document.body ? document.body : el;
|
|
1385
|
+
return set(el, current(shown) === 'dark' ? 'light' : 'dark');
|
|
1386
|
+
}
|
|
1387
|
+
function opted() {
|
|
1388
|
+
var out = [];
|
|
1389
|
+
var html = document.documentElement, body = document.body;
|
|
1390
|
+
if (html && html.getAttribute(FROM) === 'url')
|
|
1391
|
+
out.push(html);
|
|
1392
|
+
if (body && body.getAttribute(FROM) === 'url')
|
|
1393
|
+
out.push(body);
|
|
1394
|
+
return out;
|
|
1395
|
+
}
|
|
1396
|
+
function fromUrl() {
|
|
1397
|
+
var els = opted();
|
|
1398
|
+
if (!els.length)
|
|
1399
|
+
return;
|
|
1400
|
+
var q = null;
|
|
1401
|
+
try {
|
|
1402
|
+
q = new URLSearchParams(window.location.search).get('theme');
|
|
1403
|
+
}
|
|
1404
|
+
catch (e) {
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
if (!q || !THEMES.hasOwnProperty(q))
|
|
1408
|
+
return;
|
|
1409
|
+
els.forEach(function (el) { set(el, q); });
|
|
1410
|
+
}
|
|
1411
|
+
function onClick(e) {
|
|
1412
|
+
var t = e.target && e.target.closest ? e.target.closest('[data-theme-toggle]') : null;
|
|
1413
|
+
if (!t)
|
|
1414
|
+
return;
|
|
1415
|
+
var host = t.closest('[' + FROM + ']') || document.querySelector('[' + FROM + ']');
|
|
1416
|
+
if (host)
|
|
1417
|
+
toggle(host);
|
|
1418
|
+
}
|
|
1419
|
+
dk.theme = { set: set, toggle: toggle, fromUrl: fromUrl };
|
|
1420
|
+
document.addEventListener('click', onClick);
|
|
1421
|
+
fromUrl();
|
|
1422
|
+
if (document.readyState === 'loading')
|
|
1423
|
+
document.addEventListener('DOMContentLoaded', fromUrl);
|
|
1424
|
+
})();
|
|
1425
|
+
})(typeof window !== 'undefined' ? window : undefined);
|
|
1352
1426
|
(function (w) {
|
|
1353
1427
|
if (!w)
|
|
1354
1428
|
return;
|
|
@@ -6870,6 +6944,12 @@
|
|
|
6870
6944
|
(function () {
|
|
6871
6945
|
'use strict';
|
|
6872
6946
|
var NS = 'http://www.w3.org/2000/svg';
|
|
6947
|
+
var PRIOR = (window.dk && window.dk.component && window.dk.component.icon) || null;
|
|
6948
|
+
var HERE = (function () {
|
|
6949
|
+
var s = document.currentScript;
|
|
6950
|
+
var src = s && s.src;
|
|
6951
|
+
return src ? src.replace(/[?#].*$/, '').replace(/[^/]*$/, '') : '';
|
|
6952
|
+
})();
|
|
6873
6953
|
var KARMO = {
|
|
6874
6954
|
'car': { viewBox: '0 0 24 24', body: "<path d=\"M1 10.6H2.27781M2.27781 10.6H21.7222M2.27781 10.6C2.29141 10.5348 2.3075 10.4702 2.32606 10.4063C2.37038 10.254 2.43296 10.1075 2.55881 9.814L4.44868 5.40716C4.82234 4.53587 5.00947 4.09998 5.30479 3.78053C5.56583 3.49817 5.886 3.28247 6.24099 3.14994C6.6426 3 7.10299 3 8.023 3H15.9766C16.8966 3 17.3574 3 17.759 3.14994C18.114 3.28247 18.4337 3.49817 18.6948 3.78053C18.9899 4.09976 19.1767 4.5353 19.5498 5.40541L21.4473 9.83003C21.5686 10.1128 21.6303 10.2568 21.6738 10.4063C21.6924 10.4702 21.7085 10.5348 21.7222 10.6M2.27781 10.6C2.26258 10.673 2.25045 10.7467 2.24144 10.8208C2.22222 10.9787 2.22222 11.1392 2.22222 11.4603V18.2M21.7222 10.6H23M21.7222 10.6C21.7375 10.673 21.7497 10.7467 21.7587 10.8208C21.7778 10.9777 21.7778 11.1373 21.7778 11.4545V18.2001M21.7778 18.2001L16.8889 18.2001M21.7778 18.2001V19.4665C21.7778 20.8656 20.6834 22 19.3333 22C17.9833 22 16.8889 20.8658 16.8889 19.4667V18.2001M16.8889 18.2001L7.11111 18.2M7.11111 18.2H2.22222M7.11111 18.2V19.4667C7.11111 20.8658 6.0167 22 4.66667 22C3.31664 22 2.22222 20.8658 2.22222 19.4667V18.2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>" },
|
|
6875
6955
|
'car-calendar-x': { viewBox: '0 0 24 24', body: "<path d=\"M3.19458 10.1982H2.09998M3.19458 10.1982C3.20628 10.1426 3.2201 10.0875 3.23601 10.0331C3.27327 9.90554 3.32615 9.78282 3.43005 9.54169L5.0555 5.76911C5.37514 5.02723 5.53514 4.65587 5.78794 4.38369C6.01156 4.14294 6.28542 3.95903 6.58952 3.84603C6.93355 3.71819 7.3283 3.71819 8.11641 3.71819H14.9297C15.7178 3.71819 16.1121 3.71819 16.4562 3.84603C16.7603 3.95903 17.0345 4.14294 17.2581 4.38369C17.5111 4.65606 17.6714 5.02772 17.9915 5.77061L18.3 6.48654M3.19458 10.1982C3.18148 10.2604 3.17105 10.3233 3.16332 10.3864C3.14696 10.5202 3.14696 10.6563 3.14696 10.9268V16.6783M3.19458 10.1982H9.23295M3.14696 16.6783L7.33491 16.6783M3.14696 16.6783V17.7581C3.14696 18.951 4.08447 19.9182 5.24094 19.9182C6.3974 19.9182 7.33491 18.9511 7.33491 17.7582V16.6783M7.33491 16.6783L9.31067 16.6783M14.475 10.3182H13.9801C13.287 10.3182 12.9402 10.3182 12.6755 10.449C12.4427 10.564 12.2535 10.7475 12.1349 10.9733C12 11.23 12 11.5663 12 12.2383V17.9983C12 18.6704 12 19.0062 12.1349 19.2629C12.2535 19.4887 12.4427 19.6725 12.6755 19.7875C12.94 19.9182 13.2864 19.9182 13.9781 19.9182H19.9222C20.6139 19.9182 20.9598 19.9182 21.2242 19.7875C21.4571 19.6725 21.6466 19.4887 21.7652 19.2629C21.9 19.0065 21.9 18.6711 21.9 18.0003V12.2363C21.9 11.5656 21.9 11.2297 21.7652 10.9733C21.6466 10.7475 21.4571 10.564 21.2242 10.449C20.9595 10.3182 20.6132 10.3182 19.9201 10.3182H19.425M14.475 10.3182H19.425M14.475 10.3182V9.1182M19.425 10.3182V9.1182M18.3 16.3182L16.95 14.9682M16.95 14.9682L15.6 13.6182M16.95 14.9682L18.3 13.6182M16.95 14.9682L15.6 16.3182\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>" },
|
|
@@ -6894,7 +6974,13 @@
|
|
|
6894
6974
|
'shop': { viewBox: '0 0 24 23', body: "<path d=\"M10.0214 16.1667H9.02135H10.0214ZM11.1521 15V14V14V15ZM13.4135 15V16V16V15ZM14.5443 16.1667H13.5443V16.1667H14.5443ZM20.5104 1.64492L21.4103 1.20883L21.4103 1.20882L20.5104 1.64492ZM22.786 6.34066L23.6859 5.90457L23.6859 5.90457L22.786 6.34066ZM22.9864 7.38243L21.9962 7.2432V7.24321L22.9864 7.38243ZM16.675 6.83333C16.675 6.28105 16.2273 5.83333 15.675 5.83333C15.1227 5.83333 14.675 6.28105 14.675 6.83333H15.675H16.675ZM3.48983 1.64492L4.38973 2.08101V2.08101L3.48983 1.64492ZM1.21429 6.34066L0.314386 5.90457H0.314386L1.21429 6.34066ZM1.01379 7.38243L2.00405 7.24321V7.24321L1.01379 7.38243ZM9.32526 6.83333C9.32526 6.28105 8.87755 5.83333 8.32526 5.83333C7.77298 5.83333 7.32526 6.28105 7.32526 6.83333H8.32526H9.32526ZM21.3286 10.0289H20.3286V20.8333H21.3286H22.3286V10.0289H21.3286ZM20.1979 22V21H4.36772V22V23H20.1979V22ZM3.23699 20.8333H4.23699V10.3333H3.23699H2.23699V20.8333H3.23699ZM4.36772 22V21C4.32479 21 4.23699 20.9551 4.23699 20.8333H3.23699H2.23699C2.23699 22.0002 3.16169 23 4.36772 23V22ZM21.3286 20.8333H20.3286C20.3286 20.9551 20.2408 21 20.1979 21V22V23C21.4039 23 22.3286 22.0002 22.3286 20.8333H21.3286ZM10.0214 22H11.0214V16.1667H10.0214H9.02135V22H10.0214ZM11.1521 15V16H13.4135V15V14H11.1521V15ZM14.5443 16.1667H13.5443L13.5443 22H14.5443H15.5443L15.5443 16.1667H14.5443ZM13.4135 15V16C13.4565 16 13.5443 16.0449 13.5443 16.1667H14.5443H15.5443C15.5443 14.9998 14.6196 14 13.4135 14V15ZM10.0214 16.1667H11.0214C11.0214 16.0449 11.1091 16 11.1521 16V15V14C9.94604 14 9.02135 14.9998 9.02135 16.1667H10.0214ZM20.5104 1.64492L19.6105 2.08101L21.8861 6.77675L22.786 6.34066L23.6859 5.90457L21.4103 1.20883L20.5104 1.64492ZM22.9864 7.38243L21.9962 7.24321C21.8034 8.61418 20.6697 9.625 19.3498 9.625V10.625V11.625C21.7276 11.625 23.6538 9.81841 23.9767 7.52166L22.9864 7.38243ZM19.3498 10.625V9.625C17.9018 9.625 16.675 8.40485 16.675 6.83333H15.675H14.675C14.675 9.44997 16.7387 11.625 19.3498 11.625V10.625ZM15.675 6.83333H14.675C14.675 8.40485 13.4481 9.625 12.0001 9.625V10.625V11.625C14.6112 11.625 16.675 9.44997 16.675 6.83333H15.675ZM3.48983 1.64492L2.58993 1.20883L0.314386 5.90457L1.21429 6.34066L2.11419 6.77675L4.38973 2.08101L3.48983 1.64492ZM1.01379 7.38243L0.0235329 7.52166C0.346442 9.81841 2.27264 11.625 4.6504 11.625V10.625V9.625C3.3305 9.625 2.19681 8.61418 2.00405 7.24321L1.01379 7.38243ZM4.6504 10.625V11.625C7.26152 11.625 9.32526 9.44997 9.32526 6.83333H8.32526H7.32526C7.32526 8.40485 6.09842 9.625 4.6504 9.625V10.625ZM8.32526 6.83333H7.32526C7.32526 9.44997 9.389 11.625 12.0001 11.625V10.625V9.625C10.5521 9.625 9.32526 8.40485 9.32526 6.83333H8.32526ZM1.21429 6.34066L0.314386 5.90457C0.104654 6.33737 -0.0636069 6.90186 0.0235329 7.52166L1.01379 7.38243L2.00405 7.24321C1.99039 7.14603 2.00991 6.99194 2.11419 6.77675L1.21429 6.34066ZM4.50118 1V0C3.67732 0 2.94314 0.479942 2.58993 1.20883L3.48983 1.64492L4.38973 2.08101C4.41959 2.0194 4.46848 2 4.50118 2V1ZM22.786 6.34066L21.886 6.77675C21.9903 6.99195 22.0098 7.14603 21.9962 7.2432L22.9864 7.38243L23.9767 7.52166C24.0639 6.90186 23.8956 6.33737 23.6859 5.90457L22.786 6.34066ZM19.4991 1V2C19.5318 2 19.5807 2.0194 19.6105 2.08101L20.5104 1.64492L21.4103 1.20882C21.0571 0.479943 20.3229 0 19.4991 0V1ZM4.50118 1V2H19.4991V1V0H4.50118V1Z\" fill=\"currentColor\" stroke=\"none\"/>" },
|
|
6895
6975
|
};
|
|
6896
6976
|
var sets = { karmo: KARMO };
|
|
6977
|
+
if (PRIOR && PRIOR.sets)
|
|
6978
|
+
Object.keys(PRIOR.sets).forEach(function (n) { if (n !== 'karmo')
|
|
6979
|
+
sets[n] = PRIOR.sets[n]; });
|
|
6897
6980
|
var setKind = { karmo: 'glyph' };
|
|
6981
|
+
if (PRIOR && PRIOR.setKind)
|
|
6982
|
+
Object.keys(PRIOR.setKind).forEach(function (n) { if (n !== 'karmo')
|
|
6983
|
+
setKind[n] = PRIOR.setKind[n]; });
|
|
6898
6984
|
var available = ['karmo', 'card', 'coolicon', 'feather', 'flag', 'flag-circle', 'lucide', 'social'];
|
|
6899
6985
|
function lookup(name, set) {
|
|
6900
6986
|
var s = sets[set];
|
|
@@ -7024,7 +7110,11 @@
|
|
|
7024
7110
|
sets: sets, setKind: setKind, available: available,
|
|
7025
7111
|
loadSet: loadSet, onSetLoaded: onSetLoaded, choices: choices
|
|
7026
7112
|
};
|
|
7113
|
+
if (!dk.component.icon.setPath && ((PRIOR && PRIOR.setPath) || HERE))
|
|
7114
|
+
dk.component.icon.setPath = (PRIOR && PRIOR.setPath) || HERE;
|
|
7027
7115
|
document.addEventListener('DOMContentLoaded', function () { init(document); });
|
|
7116
|
+
if (document.readyState && document.readyState !== 'loading')
|
|
7117
|
+
init(document);
|
|
7028
7118
|
})();
|
|
7029
7119
|
})(typeof window !== 'undefined' ? window : undefined);
|
|
7030
7120
|
(function (w) {
|