@symbo.ls/uikit 2.11.91 → 2.11.92

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/dist/index.cjs.js CHANGED
@@ -383,10 +383,10 @@ var require_cjs = __commonJS({
383
383
  isFunction: () => isFunction22,
384
384
  isNot: () => isNot4,
385
385
  isNull: () => isNull,
386
- isNumber: () => isNumber,
386
+ isNumber: () => isNumber2,
387
387
  isObject: () => isObject7,
388
388
  isObjectLike: () => isObjectLike32,
389
- isString: () => isString8,
389
+ isString: () => isString9,
390
390
  isUndefined: () => isUndefined,
391
391
  isValidHtmlTag: () => isValidHtmlTag
392
392
  });
@@ -399,8 +399,8 @@ var require_cjs = __commonJS({
399
399
  return false;
400
400
  return typeof arg === "object" && arg.constructor === Object;
401
401
  };
402
- var isString8 = (arg) => typeof arg === "string";
403
- var isNumber = (arg) => typeof arg === "number";
402
+ var isString9 = (arg) => typeof arg === "string";
403
+ var isNumber2 = (arg) => typeof arg === "number";
404
404
  var isFunction22 = (arg) => typeof arg === "function";
405
405
  var isBoolean = (arg) => arg === true || arg === false;
406
406
  var isNull = (arg) => arg === null;
@@ -411,7 +411,7 @@ var require_cjs = __commonJS({
411
411
  return typeof arg === "object";
412
412
  };
413
413
  var isDefined2 = (arg) => {
414
- return isObject7(arg) || isObjectLike32(arg) || isString8(arg) || isNumber(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
414
+ return isObject7(arg) || isObjectLike32(arg) || isString9(arg) || isNumber2(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
415
415
  };
416
416
  var isUndefined = (arg) => {
417
417
  return arg === void 0;
@@ -420,8 +420,8 @@ var require_cjs = __commonJS({
420
420
  boolean: isBoolean,
421
421
  array: isArray62,
422
422
  object: isObject7,
423
- string: isString8,
424
- number: isNumber,
423
+ string: isString9,
424
+ number: isNumber2,
425
425
  null: isNull,
426
426
  function: isFunction22,
427
427
  objectLike: isObjectLike32,
@@ -1157,6 +1157,7 @@ var require_cjs = __commonJS({
1157
1157
  getFontSizeByKey: () => getFontSizeByKey4,
1158
1158
  getMediaColor: () => getMediaColor7,
1159
1159
  getMediaTheme: () => getMediaTheme4,
1160
+ getRgbTone: () => getRgbTone,
1160
1161
  getSequenceValue: () => getSequenceValue,
1161
1162
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
1162
1163
  getSpacingBasedOnRatio: () => getSpacingBasedOnRatio10,
@@ -1224,6 +1225,7 @@ var require_cjs = __commonJS({
1224
1225
  getFontFaceEachString: () => getFontFaceEachString,
1225
1226
  getFontFaceString: () => getFontFaceString,
1226
1227
  getFontFormat: () => getFontFormat,
1228
+ getRgbTone: () => getRgbTone,
1227
1229
  getSequenceValue: () => getSequenceValue,
1228
1230
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
1229
1231
  hexToRgb: () => hexToRgb,
@@ -1245,6 +1247,7 @@ var require_cjs = __commonJS({
1245
1247
  setVariables: () => setVariables
1246
1248
  });
1247
1249
  var import_globals = __toESM2(require_cjs11(), 1);
1250
+ var import_utils16 = __toESM2(require_cjs42(), 1);
1248
1251
  var ENV = "development";
1249
1252
  var colorStringToRgbaArray = (color) => {
1250
1253
  if (color === "")
@@ -1297,7 +1300,7 @@ var require_cjs = __commonJS({
1297
1300
  return [r, g, b];
1298
1301
  };
1299
1302
  var rgbToHex = (r, g, b) => {
1300
- return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
1303
+ return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
1301
1304
  };
1302
1305
  var rgbArrayToHex = ([r, g, b]) => {
1303
1306
  return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
@@ -1349,7 +1352,7 @@ var require_cjs = __commonJS({
1349
1352
  g = 255;
1350
1353
  else if (g < 0)
1351
1354
  g = 0;
1352
- return (g | b << 8 | r << 16).toString(16);
1355
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
1353
1356
  };
1354
1357
  var mixTwoRgba = (colorA, colorB, range = 0.5) => {
1355
1358
  const arr = [];
@@ -1371,6 +1374,24 @@ var require_cjs = __commonJS({
1371
1374
  arr[3] = opacity;
1372
1375
  return `rgba(${arr})`;
1373
1376
  };
1377
+ var getRgbTone = (rgb, tone) => {
1378
+ if ((0, import_utils16.isString)(rgb))
1379
+ rgb = rgb.split(", ").map((v) => parseFloat(v));
1380
+ if ((0, import_utils16.isNumber)(tone))
1381
+ tone += "";
1382
+ const toHex = rgbArrayToHex(rgb);
1383
+ const abs2 = tone.slice(0, 1);
1384
+ if (abs2 === "-" || abs2 === "+") {
1385
+ const colorShade = getColorShade(toHex, parseFloat(tone));
1386
+ return hexToRgbArray(colorShade).join(", ");
1387
+ } else {
1388
+ const [r, g, b] = rgb;
1389
+ const hsl = rgbToHSL(r, g, b);
1390
+ const [h, s, l] = hsl;
1391
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1392
+ return newRgb;
1393
+ }
1394
+ };
1374
1395
  var returnSubThemeOrDefault = (orig, theme) => {
1375
1396
  if (!orig)
1376
1397
  return;
@@ -1419,9 +1440,9 @@ var require_cjs = __commonJS({
1419
1440
  const keys = Object.keys(LIBRARY);
1420
1441
  return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
1421
1442
  };
1422
- var import_utils42 = __toESM2(require_cjs42(), 1);
1443
+ var import_utils52 = __toESM2(require_cjs42(), 1);
1444
+ var import_utils32 = __toESM2(require_cjs42());
1423
1445
  var import_utils22 = __toESM2(require_cjs42());
1424
- var import_utils16 = __toESM2(require_cjs42());
1425
1446
  var toCamelCase = (str) => {
1426
1447
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
1427
1448
  return index === 0 ? word.toLowerCase() : word.toUpperCase();
@@ -1429,14 +1450,14 @@ var require_cjs = __commonJS({
1429
1450
  };
1430
1451
  var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
1431
1452
  var arrayzeValue = (val) => {
1432
- if ((0, import_utils22.isString)(val))
1453
+ if ((0, import_utils32.isString)(val))
1433
1454
  return val.split(" ");
1434
- if ((0, import_utils22.isObject)(val))
1455
+ if ((0, import_utils32.isObject)(val))
1435
1456
  return Object.keys(val).map((v) => val[v]);
1436
- if ((0, import_utils22.isArray)(val))
1457
+ if ((0, import_utils32.isArray)(val))
1437
1458
  return val;
1438
1459
  };
1439
- var import_utils32 = __toESM2(require_cjs42(), 1);
1460
+ var import_utils42 = __toESM2(require_cjs42(), 1);
1440
1461
  var defaultConfig_exports = {};
1441
1462
  __export2(defaultConfig_exports, {
1442
1463
  ANIMATION: () => ANIMATION,
@@ -1607,13 +1628,13 @@ var require_cjs = __commonJS({
1607
1628
  CSS_VARS,
1608
1629
  ...defaultConfig_exports
1609
1630
  };
1610
- var cachedConfig = (0, import_utils32.deepClone)(CONFIG4);
1631
+ var cachedConfig = (0, import_utils42.deepClone)(CONFIG4);
1611
1632
  var FACTORY = {
1612
1633
  active: "0",
1613
1634
  0: CONFIG4
1614
1635
  };
1615
1636
  var activateConfig = (def) => {
1616
- if ((0, import_utils32.isDefined)(def)) {
1637
+ if ((0, import_utils42.isDefined)(def)) {
1617
1638
  FACTORY.active = def;
1618
1639
  }
1619
1640
  return FACTORY[def || FACTORY.active];
@@ -1622,10 +1643,10 @@ var require_cjs = __commonJS({
1622
1643
  return FACTORY[def || FACTORY.active];
1623
1644
  };
1624
1645
  var setActiveConfig = (newConfig) => {
1625
- if (!(0, import_utils32.isObject)(newConfig))
1646
+ if (!(0, import_utils42.isObject)(newConfig))
1626
1647
  return;
1627
1648
  FACTORY.active = "1";
1628
- FACTORY["1"] = (0, import_utils32.deepMerge)(newConfig, (0, import_utils32.deepClone)(cachedConfig));
1649
+ FACTORY["1"] = (0, import_utils42.deepMerge)(newConfig, (0, import_utils42.deepClone)(cachedConfig));
1629
1650
  return newConfig;
1630
1651
  };
1631
1652
  var numToLetterMap = {
@@ -1734,7 +1755,7 @@ var require_cjs = __commonJS({
1734
1755
  unit = UNIT2.default,
1735
1756
  useVariable
1736
1757
  } = sequenceProps;
1737
- if ((0, import_utils42.isString)(value) && value.slice(0, 2) === "--")
1758
+ if ((0, import_utils52.isString)(value) && value.slice(0, 2) === "--")
1738
1759
  return `var(${value})`;
1739
1760
  const prefix2 = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
1740
1761
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
@@ -1795,11 +1816,11 @@ var require_cjs = __commonJS({
1795
1816
  return sequence[findLetter];
1796
1817
  });
1797
1818
  };
1798
- var import_utils62 = __toESM2(require_cjs42(), 1);
1819
+ var import_utils72 = __toESM2(require_cjs42(), 1);
1799
1820
  var setVariables = (result, key) => {
1800
1821
  const CONFIG22 = getActiveConfig4();
1801
1822
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
1802
- if ((0, import_utils62.isObjectLike)(result.value)) {
1823
+ if ((0, import_utils72.isObjectLike)(result.value)) {
1803
1824
  } else {
1804
1825
  CSS_VARS2[result.var] = result.value;
1805
1826
  }
@@ -1833,7 +1854,7 @@ var require_cjs = __commonJS({
1833
1854
  }
1834
1855
  }
1835
1856
  };
1836
- var import_utils72 = __toESM2(require_cjs42(), 1);
1857
+ var import_utils82 = __toESM2(require_cjs42(), 1);
1837
1858
  var generateSprite = (icons) => {
1838
1859
  const CONFIG22 = getActiveConfig4();
1839
1860
  let sprite = "";
@@ -1847,7 +1868,7 @@ var require_cjs = __commonJS({
1847
1868
  return sprite;
1848
1869
  };
1849
1870
  var parseRootAttributes = (htmlString) => {
1850
- if (!(0, import_utils72.isString)(htmlString)) {
1871
+ if (!(0, import_utils82.isString)(htmlString)) {
1851
1872
  return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
1852
1873
  }
1853
1874
  const match2 = htmlString.match(/<svg\s+(.*?)>/);
@@ -1867,7 +1888,7 @@ var require_cjs = __commonJS({
1867
1888
  const urlRegex = /url\(#([^)]*)\)/g;
1868
1889
  const matches = code.match(/id="([^"]*)"/g);
1869
1890
  let replacedCode = code;
1870
- if ((0, import_utils72.isArray)(matches)) {
1891
+ if ((0, import_utils82.isArray)(matches)) {
1871
1892
  matches.forEach(() => {
1872
1893
  const randomKey = Math.floor(Math.random() * 1e5);
1873
1894
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -1920,10 +1941,10 @@ var require_cjs = __commonJS({
1920
1941
  setSVG: () => setSVG,
1921
1942
  setTheme: () => setTheme
1922
1943
  });
1923
- var import_utils82 = __toESM2(require_cjs42(), 1);
1944
+ var import_utils92 = __toESM2(require_cjs42(), 1);
1924
1945
  var getColor4 = (value, key, config) => {
1925
1946
  const CONFIG22 = config || getActiveConfig4();
1926
- if (!(0, import_utils82.isString)(value)) {
1947
+ if (!(0, import_utils92.isString)(value)) {
1927
1948
  if (CONFIG22.verbose)
1928
1949
  console.warn(value, "- type for color is not valid");
1929
1950
  return;
@@ -1932,7 +1953,7 @@ var require_cjs = __commonJS({
1932
1953
  return `var(${value})`;
1933
1954
  if (key && value[key])
1934
1955
  value = value[key];
1935
- const [name, alpha, tone] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
1956
+ const [name, alpha, tone] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
1936
1957
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
1937
1958
  let val = COLOR2[name] || GRADIENT2[name];
1938
1959
  if (!val) {
@@ -1947,22 +1968,11 @@ var require_cjs = __commonJS({
1947
1968
  console.warn(value, " - does not have ", key);
1948
1969
  }
1949
1970
  let rgb = val.rgb;
1950
- if (!rgb)
1971
+ if (!rgb) {
1951
1972
  return CONFIG22.useVariable ? `var(${val.var})` : val.value;
1973
+ }
1952
1974
  if (tone && !val[tone]) {
1953
- const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
1954
- const abs2 = tone.slice(0, 1);
1955
- if (abs2 === "-" || abs2 === "+") {
1956
- rgb = hexToRgbArray(
1957
- getColorShade(toHex, parseFloat(tone))
1958
- ).join(", ");
1959
- } else {
1960
- const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
1961
- const hsl = rgbToHSL(r, g, b);
1962
- const [h, s, l] = hsl;
1963
- const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1964
- rgb = newRgb;
1965
- }
1975
+ rgb = getRgbTone(rgb, tone);
1966
1976
  val[tone] = { rgb, var: `${val.var}-${tone}` };
1967
1977
  }
1968
1978
  if (val[tone])
@@ -1975,17 +1985,17 @@ var require_cjs = __commonJS({
1975
1985
  const CONFIG22 = config || getActiveConfig4();
1976
1986
  if (!globalTheme)
1977
1987
  globalTheme = CONFIG22.globalTheme;
1978
- if (!(0, import_utils82.isString)(value)) {
1988
+ if (!(0, import_utils92.isString)(value)) {
1979
1989
  if (CONFIG22.verbose)
1980
1990
  console.warn(value, "- type for color is not valid");
1981
1991
  return;
1982
1992
  }
1983
1993
  if (value.slice(0, 2) === "--")
1984
1994
  return `var(${value})`;
1985
- const [name] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
1995
+ const [name] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
1986
1996
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
1987
1997
  const val = COLOR2[name] || GRADIENT2[name];
1988
- const isObj = (0, import_utils82.isObject)(val);
1998
+ const isObj = (0, import_utils92.isObject)(val);
1989
1999
  if (isObj && val.value)
1990
2000
  return getColor4(value, `@${globalTheme}`, config);
1991
2001
  else if (isObj) {
@@ -2008,15 +2018,15 @@ var require_cjs = __commonJS({
2008
2018
  };
2009
2019
  var setColor = (val, key, suffix) => {
2010
2020
  const CONFIG22 = getActiveConfig4();
2011
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
2021
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
2012
2022
  val = getColor4(val.slice(2));
2013
- if ((0, import_utils82.isArray)(val)) {
2023
+ if ((0, import_utils92.isArray)(val)) {
2014
2024
  return {
2015
2025
  "@light": setColor(val[0], key, "light"),
2016
2026
  "@dark": setColor(val[1], key, "dark")
2017
2027
  };
2018
2028
  }
2019
- if ((0, import_utils82.isObject)(val)) {
2029
+ if ((0, import_utils92.isObject)(val)) {
2020
2030
  const obj = {};
2021
2031
  for (const variant in val)
2022
2032
  obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -2039,15 +2049,15 @@ var require_cjs = __commonJS({
2039
2049
  };
2040
2050
  var setGradient = (val, key, suffix) => {
2041
2051
  const CONFIG22 = getActiveConfig4();
2042
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
2052
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
2043
2053
  val = getColor4(val.slice(2));
2044
- if ((0, import_utils82.isArray)(val)) {
2054
+ if ((0, import_utils92.isArray)(val)) {
2045
2055
  return {
2046
2056
  "@light": setGradient(val[0], key, "light"),
2047
2057
  "@dark": setGradient(val[0], key, "dark")
2048
2058
  };
2049
2059
  }
2050
- if ((0, import_utils82.isObject)(val)) {
2060
+ if ((0, import_utils92.isObject)(val)) {
2051
2061
  const obj = {};
2052
2062
  for (const variant in val)
2053
2063
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -2062,7 +2072,7 @@ var require_cjs = __commonJS({
2062
2072
  value: val.value || val
2063
2073
  };
2064
2074
  };
2065
- var import_utils102 = __toESM2(require_cjs42(), 1);
2075
+ var import_utils112 = __toESM2(require_cjs42(), 1);
2066
2076
  var setThemeValue = (theme) => {
2067
2077
  const value = {};
2068
2078
  const { state, media, helpers, ...rest } = theme;
@@ -2085,7 +2095,7 @@ var require_cjs = __commonJS({
2085
2095
  if (CONFIG22.useVariable)
2086
2096
  return getMediaTheme4(value, modifier);
2087
2097
  const { THEME: THEME2 } = CONFIG22;
2088
- if ((0, import_utils102.isString)(value)) {
2098
+ if ((0, import_utils112.isString)(value)) {
2089
2099
  const [theme, subtheme] = value.split(" ");
2090
2100
  const isOurTheme = THEME2[theme];
2091
2101
  if (isOurTheme) {
@@ -2094,7 +2104,7 @@ var require_cjs = __commonJS({
2094
2104
  value = [theme, subtheme || modifier];
2095
2105
  }
2096
2106
  }
2097
- if ((0, import_utils102.isObjectLike)(value) && value[1]) {
2107
+ if ((0, import_utils112.isObjectLike)(value) && value[1]) {
2098
2108
  const themeName = value[0];
2099
2109
  const subThemeName = value[1];
2100
2110
  const { helpers, media, state } = THEME2[themeName];
@@ -2104,11 +2114,11 @@ var require_cjs = __commonJS({
2104
2114
  return getThemeValue(helpers[subThemeName]);
2105
2115
  if (state && state[subThemeName])
2106
2116
  return getThemeValue(state[subThemeName]);
2107
- } else if ((0, import_utils102.isObject)(value))
2117
+ } else if ((0, import_utils112.isObject)(value))
2108
2118
  return setThemeValue(value);
2109
2119
  };
2110
2120
  var setInverseTheme = (theme, variant, value) => {
2111
- if ((0, import_utils102.isObject)(variant)) {
2121
+ if ((0, import_utils112.isObject)(variant)) {
2112
2122
  theme.variants.inverse.value = setThemeValue(variant);
2113
2123
  } else if (variant === true) {
2114
2124
  const { color, background } = value;
@@ -2123,7 +2133,7 @@ var require_cjs = __commonJS({
2123
2133
  var setPseudo = (theme, key, variant, themeValue) => {
2124
2134
  const result = getTheme4(variant);
2125
2135
  themeValue[`&:${key}`] = result;
2126
- if ((0, import_utils102.isObject)(variant) && !variant.value)
2136
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
2127
2137
  variant.value = result;
2128
2138
  };
2129
2139
  var setSelectors = (theme, value) => {
@@ -2141,7 +2151,7 @@ var require_cjs = __commonJS({
2141
2151
  var setPrefersScheme = (theme, key, variant, themeValue) => {
2142
2152
  const result = getTheme4(variant);
2143
2153
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
2144
- if ((0, import_utils102.isObject)(variant) && !variant.value)
2154
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
2145
2155
  variant.value = result;
2146
2156
  };
2147
2157
  var setMedia = (theme, value) => {
@@ -2167,7 +2177,7 @@ var require_cjs = __commonJS({
2167
2177
  const keys = Object.keys(helpers);
2168
2178
  keys.map((key) => {
2169
2179
  const helper = helpers[key];
2170
- if ((0, import_utils102.isString)(helper))
2180
+ if ((0, import_utils112.isString)(helper))
2171
2181
  helpers[key] = CONFIG22.THEME[helper];
2172
2182
  else
2173
2183
  getThemeValue(helpers[key]);
@@ -2191,7 +2201,7 @@ var require_cjs = __commonJS({
2191
2201
  const CONFIG22 = getActiveConfig4();
2192
2202
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
2193
2203
  const theme = { value: val };
2194
- if ((0, import_utils102.isObjectLike)(val)) {
2204
+ if ((0, import_utils112.isObjectLike)(val)) {
2195
2205
  for (const param in val) {
2196
2206
  const symb = param.slice(0, 1);
2197
2207
  const value = val[param];
@@ -2219,7 +2229,7 @@ var require_cjs = __commonJS({
2219
2229
  };
2220
2230
  }
2221
2231
  }
2222
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--") {
2232
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--") {
2223
2233
  const { THEME: THEME2 } = CONFIG22;
2224
2234
  const value = THEME2[val.slice(2)];
2225
2235
  const getReferenced = getMediaTheme4(value, prefers);
@@ -2232,7 +2242,7 @@ var require_cjs = __commonJS({
2232
2242
  const obj = {};
2233
2243
  for (const param in val) {
2234
2244
  const symb = param.slice(0, 1);
2235
- if ((0, import_utils102.isObjectLike)(val[param])) {
2245
+ if ((0, import_utils112.isObjectLike)(val[param])) {
2236
2246
  if (symb === "@") {
2237
2247
  const query = CONFIG22.MEDIA[param.slice(1)];
2238
2248
  const media = `@media screen and ${query}`;
@@ -2252,23 +2262,23 @@ var require_cjs = __commonJS({
2252
2262
  return val;
2253
2263
  };
2254
2264
  var findModifier = (val, modifier) => {
2255
- if ((0, import_utils102.isArray)(modifier))
2265
+ if ((0, import_utils112.isArray)(modifier))
2256
2266
  return findModifierFromArray(val, modifier);
2257
- else if ((0, import_utils102.isString)(modifier) && val[modifier])
2267
+ else if ((0, import_utils112.isString)(modifier) && val[modifier])
2258
2268
  return val[modifier];
2259
2269
  else
2260
2270
  return val;
2261
2271
  };
2262
2272
  var getMediaTheme4 = (val, mod) => {
2263
2273
  const CONFIG22 = getActiveConfig4();
2264
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--")
2274
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--")
2265
2275
  val = getMediaTheme4(val.slice(2));
2266
- if (!val || !(0, import_utils102.isString)(val)) {
2276
+ if (!val || !(0, import_utils112.isString)(val)) {
2267
2277
  if (CONFIG22.verbose)
2268
2278
  console.warn(val, "- theme is not string");
2269
2279
  return;
2270
2280
  }
2271
- const [name, ...modifier] = (0, import_utils102.isArray)(val) ? val : val.split(" ");
2281
+ const [name, ...modifier] = (0, import_utils112.isArray)(val) ? val : val.split(" ");
2272
2282
  let value = CONFIG22.THEME[name];
2273
2283
  if (value && (modifier || mod)) {
2274
2284
  value = findModifier(value, modifier.length ? modifier : mod);
@@ -2276,7 +2286,7 @@ var require_cjs = __commonJS({
2276
2286
  const r = recursiveTheme(value);
2277
2287
  return r;
2278
2288
  };
2279
- var import_utils112 = __toESM2(require_cjs42(), 1);
2289
+ var import_utils122 = __toESM2(require_cjs42(), 1);
2280
2290
  var setFont = (val, key) => {
2281
2291
  const CSSvar = `--font-${key}`;
2282
2292
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
@@ -2293,13 +2303,13 @@ var require_cjs = __commonJS({
2293
2303
  let { value, type } = val;
2294
2304
  if (val.isDefault)
2295
2305
  FONT_FAMILY2.default = key;
2296
- if ((0, import_utils112.isObject)(value))
2306
+ if ((0, import_utils122.isObject)(value))
2297
2307
  value = arrayzeValue(value);
2298
2308
  const CSSvar = `--font-family-${key}`;
2299
2309
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
2300
2310
  return { var: CSSvar, value: str, arr: value, type };
2301
2311
  };
2302
- var import_utils142 = __toESM2(require_cjs42(), 1);
2312
+ var import_utils152 = __toESM2(require_cjs42(), 1);
2303
2313
  var runThroughMedia = (props7) => {
2304
2314
  const CONFIG22 = getActiveConfig4();
2305
2315
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG22;
@@ -2307,7 +2317,7 @@ var require_cjs = __commonJS({
2307
2317
  const mediaProps = props7[prop];
2308
2318
  if (prop.slice(0, 1) === "@") {
2309
2319
  const { type, base, ratio, range, subSequence, h1Matches, unit } = props7;
2310
- (0, import_utils142.merge)(mediaProps, {
2320
+ (0, import_utils152.merge)(mediaProps, {
2311
2321
  type,
2312
2322
  base,
2313
2323
  ratio,
@@ -2366,13 +2376,13 @@ var require_cjs = __commonJS({
2366
2376
  TYPOGRAPHY2
2367
2377
  );
2368
2378
  };
2369
- var import_utils17 = __toESM2(require_cjs42(), 1);
2379
+ var import_utils18 = __toESM2(require_cjs42(), 1);
2370
2380
  var runThroughMedia2 = (sequenceProps) => {
2371
2381
  for (const prop in sequenceProps) {
2372
2382
  const mediaProps = sequenceProps[prop];
2373
2383
  if (prop.slice(0, 1) === "@") {
2374
2384
  const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
2375
- (0, import_utils17.merge)(mediaProps, {
2385
+ (0, import_utils18.merge)(mediaProps, {
2376
2386
  type,
2377
2387
  base,
2378
2388
  ratio,
@@ -2411,7 +2421,7 @@ var require_cjs = __commonJS({
2411
2421
  const stack = arrayzeValue(value);
2412
2422
  if (!stack)
2413
2423
  return;
2414
- if ((0, import_utils17.isString)(value) && value.includes("calc")) {
2424
+ if ((0, import_utils18.isString)(value) && value.includes("calc")) {
2415
2425
  return { [propertyName]: value };
2416
2426
  }
2417
2427
  if (stack.length > 1) {
@@ -2447,7 +2457,7 @@ var require_cjs = __commonJS({
2447
2457
  let sequenceProps = SPACING2[spacingRatio];
2448
2458
  if (!sequenceProps) {
2449
2459
  const { type, base, range, subSequence } = SPACING2;
2450
- sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
2460
+ sequenceProps = SPACING2[spacingRatio] = (0, import_utils18.merge)({
2451
2461
  ratio: spacingRatio,
2452
2462
  type: type + "-" + spacingRatio,
2453
2463
  unit,
@@ -2488,11 +2498,11 @@ var require_cjs = __commonJS({
2488
2498
  TIMING2
2489
2499
  );
2490
2500
  };
2491
- var import_utils21 = __toESM2(require_cjs42(), 1);
2501
+ var import_utils222 = __toESM2(require_cjs42(), 1);
2492
2502
  var applyDocument = () => {
2493
2503
  const CONFIG22 = getActiveConfig4();
2494
2504
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG22;
2495
- return (0, import_utils21.merge)(DOCUMENT2, {
2505
+ return (0, import_utils222.merge)(DOCUMENT2, {
2496
2506
  theme: THEME2.document,
2497
2507
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
2498
2508
  fontSize: TYPOGRAPHY2.base,
@@ -2572,7 +2582,7 @@ var require_cjs = __commonJS({
2572
2582
  }
2573
2583
  }
2574
2584
  };
2575
- var import_utils24 = __toESM2(require_cjs42(), 1);
2585
+ var import_utils25 = __toESM2(require_cjs42(), 1);
2576
2586
  var applyReset = (reset = {}) => {
2577
2587
  const CONFIG22 = getActiveConfig4();
2578
2588
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG22;
@@ -2594,8 +2604,8 @@ var require_cjs = __commonJS({
2594
2604
  const { body, ...templates } = TYPOGRAPHY2.templates;
2595
2605
  const globalTheme = CONFIG22.useDocumentTheme ? getMediaTheme4("document", `@${CONFIG22.globalTheme}`) : {};
2596
2606
  if (RESET2.html)
2597
- (0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
2598
- return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
2607
+ (0, import_utils25.overwriteDeep)(RESET2.html, globalTheme);
2608
+ return (0, import_utils25.deepMerge)((0, import_utils25.merge)(RESET2, reset), {
2599
2609
  html: {
2600
2610
  position: "absolute",
2601
2611
  // overflow: 'hidden',
@@ -2632,7 +2642,7 @@ var require_cjs = __commonJS({
2632
2642
  });
2633
2643
  }
2634
2644
  };
2635
- var import_utils25 = __toESM2(require_cjs42(), 1);
2645
+ var import_utils26 = __toESM2(require_cjs42(), 1);
2636
2646
  var isBorderStyle = (str) => [
2637
2647
  "none",
2638
2648
  "hidden",
@@ -2703,7 +2713,7 @@ var require_cjs = __commonJS({
2703
2713
  return v;
2704
2714
  }).join(" ");
2705
2715
  };
2706
- var transfromGap4 = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
2716
+ var transfromGap4 = (gap) => (0, import_utils26.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
2707
2717
  var transformTransition = (transition) => {
2708
2718
  const arr = transition.split(" ");
2709
2719
  if (!arr.length)
@@ -2721,7 +2731,7 @@ var require_cjs = __commonJS({
2721
2731
  }).join(" ");
2722
2732
  };
2723
2733
  var transformDuration4 = (duration, props7, propertyName) => {
2724
- if (!(0, import_utils25.isString)(duration))
2734
+ if (!(0, import_utils26.isString)(duration))
2725
2735
  return;
2726
2736
  return duration.split(",").map((v) => getTimingByKey4(v).timing || v).join(",");
2727
2737
  };
@@ -2731,9 +2741,9 @@ var require_cjs = __commonJS({
2731
2741
  return;
2732
2742
  return arr.map(transformTransition).join(",");
2733
2743
  };
2734
- var import_utils26 = __toESM2(require_cjs42(), 1);
2744
+ var import_utils27 = __toESM2(require_cjs42(), 1);
2735
2745
  var setCases = (val, key) => {
2736
- if ((0, import_utils26.isFunction)(val))
2746
+ if ((0, import_utils27.isFunction)(val))
2737
2747
  return val();
2738
2748
  return val;
2739
2749
  };
@@ -11755,6 +11765,7 @@ __export(domql_exports, {
11755
11765
  UploadResult: () => UploadResult,
11756
11766
  Video: () => Video,
11757
11767
  XYZ: () => XYZ,
11768
+ calendar: () => calendar,
11758
11769
  getSystemTheme: () => getSystemTheme,
11759
11770
  keySetters: () => keySetters
11760
11771
  });
@@ -14537,12 +14548,17 @@ var DatePickerDay = {
14537
14548
  extend: Button,
14538
14549
  state: true,
14539
14550
  props: ({ state, key }) => {
14540
- const isSelected = state.parent.parent.activeDay === parseInt(key) + 1;
14551
+ const rootState = state.parent.parent.parent;
14552
+ const date = new Date(state._d);
14553
+ const isSelected = rootState.activeDay === date.toString();
14541
14554
  const gridColumnStart = 7 - state.parent.weekItems.weeks[0].dates.length;
14542
- const isWeekend = state.moment.isoWeekday();
14555
+ const { moment } = state;
14556
+ moment._d = date;
14557
+ const isWeekend = moment.day() === 0 || moment.day() === 6;
14543
14558
  return {
14544
14559
  isSelected,
14545
14560
  isWeekend,
14561
+ date: date.toString(),
14546
14562
  textAlign: "center",
14547
14563
  fontSize: "Z1",
14548
14564
  round: "100%",
@@ -14564,10 +14580,9 @@ var DatePickerDay = {
14564
14580
  },
14565
14581
  on: {
14566
14582
  click: (event, element, state) => {
14567
- state.parent.parent.update({
14568
- active: state.parse()
14583
+ state.parent.parent.parent.update({
14584
+ activeDay: element.props.date
14569
14585
  });
14570
- console.log(state);
14571
14586
  }
14572
14587
  }
14573
14588
  };
@@ -14582,6 +14597,17 @@ var DatePickerGrid = {
14582
14597
  childExtend: DatePickerDay,
14583
14598
  $setStateCollection: (el, s) => {
14584
14599
  return s.days;
14600
+ },
14601
+ on: {
14602
+ render: (el, state) => {
14603
+ const { key } = el;
14604
+ const isSelected = state.parent.parent.activeMonth === parseInt(key);
14605
+ if (isSelected) {
14606
+ window.requestAnimationFrame(() => {
14607
+ el.node.scrollIntoView();
14608
+ });
14609
+ }
14610
+ }
14585
14611
  }
14586
14612
  };
14587
14613
 
@@ -14715,12 +14741,26 @@ var DatePickerMonthsSlider = {
14715
14741
  }
14716
14742
  },
14717
14743
  Button_left: {
14718
- icon: "arrowLeft",
14719
- "@dark": {
14720
- theme: "primary @dark .color-only"
14744
+ props: {
14745
+ icon: "arrowLeft",
14746
+ "@dark": {
14747
+ theme: "primary @dark .color-only"
14748
+ },
14749
+ "@light": {
14750
+ theme: "primary @light .color-only"
14751
+ }
14721
14752
  },
14722
- "@light": {
14723
- theme: "primary @light .color-only"
14753
+ on: {
14754
+ click: (ev, el, s) => {
14755
+ const { activeMonth, activeYear } = s;
14756
+ if (activeMonth > 0)
14757
+ s.update({ activeMonth: activeMonth - 1 });
14758
+ else
14759
+ s.update({
14760
+ activeYear: activeYear - 1,
14761
+ activeMonth: 11
14762
+ });
14763
+ }
14724
14764
  }
14725
14765
  },
14726
14766
  Flex: {
@@ -14739,13 +14779,15 @@ var DatePickerMonthsSlider = {
14739
14779
  isSelected: state.activeMonth === parseInt(key),
14740
14780
  ".isSelected": { opacity: "1" }
14741
14781
  }),
14742
- render: (el, state) => {
14743
- const { props: props7 } = el;
14744
- const { isSelected } = props7;
14745
- if (isSelected) {
14746
- window.requestAnimationFrame(() => {
14747
- el.parent.parent.node.scrollLeft = el.node.offsetLeft;
14748
- });
14782
+ on: {
14783
+ update: (el, state) => {
14784
+ const { props: props7 } = el;
14785
+ const { isSelected } = props7;
14786
+ if (isSelected) {
14787
+ window.requestAnimationFrame(() => {
14788
+ el.parent.parent.node.scrollLeft = el.node.offsetLeft;
14789
+ });
14790
+ }
14749
14791
  }
14750
14792
  }
14751
14793
  },
@@ -14767,12 +14809,26 @@ var DatePickerMonthsSlider = {
14767
14809
  }
14768
14810
  },
14769
14811
  Button_right: {
14770
- icon: "arrowRight",
14771
- "@dark": {
14772
- theme: "primary @dark .color-only"
14812
+ props: {
14813
+ icon: "arrowRight",
14814
+ "@dark": {
14815
+ theme: "primary @dark .color-only"
14816
+ },
14817
+ "@light": {
14818
+ theme: "primary @light .color-only"
14819
+ }
14773
14820
  },
14774
- "@light": {
14775
- theme: "primary @light .color-only"
14821
+ on: {
14822
+ click: (ev, el, s) => {
14823
+ const { activeMonth, activeYear } = s;
14824
+ if (activeMonth < 11)
14825
+ s.update({ activeMonth: activeMonth + 1 });
14826
+ else
14827
+ s.update({
14828
+ activeYear: activeYear + 1,
14829
+ activeMonth: 0
14830
+ });
14831
+ }
14776
14832
  }
14777
14833
  }
14778
14834
  };
@@ -14816,7 +14872,7 @@ var extractMonthDays = (data) => {
14816
14872
  const result = [];
14817
14873
  data.weeks.forEach((week) => {
14818
14874
  week.dates.forEach((date) => {
14819
- result.push(date);
14875
+ result.push({ ...date, _d: date.moment._d.toString() });
14820
14876
  });
14821
14877
  });
14822
14878
  return result;