smoothly 0.1.83 → 0.1.87

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.
Files changed (75) hide show
  1. package/dist/cjs/{generate-a6821b82.js → generate-f9a36f25.js} +1 -1
  2. package/dist/cjs/index-328edd81.js +1599 -0
  3. package/dist/cjs/{index-fc82954f.js → index-ac32385c.js} +230 -184
  4. package/dist/cjs/index.cjs.js +214 -116
  5. package/dist/cjs/smoothly-accordion_47.cjs.entry.js +1031 -19112
  6. package/dist/cjs/smoothly-calendar.cjs.entry.js +7 -15
  7. package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
  8. package/dist/cjs/smoothly-display.cjs.entry.js +2 -1
  9. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +2 -2
  10. package/dist/cjs/smoothly-input-date.cjs.entry.js +2 -2
  11. package/dist/cjs/smoothly-input-month.cjs.entry.js +2 -2
  12. package/dist/cjs/smoothly-input.cjs.entry.js +17 -10
  13. package/dist/cjs/smoothly-select-demo.cjs.entry.js +2 -2
  14. package/dist/collection/components/calendar/index.js +9 -17
  15. package/dist/collection/components/display/index.js +1 -1
  16. package/dist/collection/components/input/index.js +17 -10
  17. package/dist/collection/components/input-date/style.css +4 -0
  18. package/dist/collection/components/input-date-range/style.css +4 -0
  19. package/dist/collection/components/select-demo/index.js +2 -2
  20. package/dist/collection/index.js +1 -1
  21. package/dist/collection/utilities/Cosmetic/Color/CommaRgb.js +90 -0
  22. package/dist/collection/utilities/Cosmetic/Color/Hex.js +11 -0
  23. package/dist/collection/utilities/Cosmetic/Color/Hsl.js +32 -0
  24. package/dist/collection/utilities/{colorNames.js → Cosmetic/Color/Name.js} +9 -1
  25. package/dist/collection/utilities/Cosmetic/Color/Rgb.js +19 -0
  26. package/dist/collection/utilities/Cosmetic/Color/index.js +23 -0
  27. package/dist/collection/utilities/Cosmetic/index.js +40 -0
  28. package/dist/collection/utilities/index.js +1 -1
  29. package/dist/custom-elements/index.js +1387 -19577
  30. package/dist/esm/{generate-776b3b0f.js → generate-50b98474.js} +1 -1
  31. package/dist/esm/index-1be6d668.js +1597 -0
  32. package/dist/{smoothly/index-a28d88cf.js → esm/index-a5a08f46.js} +230 -184
  33. package/dist/esm/index.js +215 -116
  34. package/dist/esm/smoothly-accordion_47.entry.js +1031 -19112
  35. package/dist/esm/smoothly-calendar.entry.js +7 -15
  36. package/dist/esm/smoothly-display-amount.entry.js +1 -1
  37. package/dist/esm/smoothly-display.entry.js +2 -1
  38. package/dist/esm/smoothly-input-date-range.entry.js +2 -2
  39. package/dist/esm/smoothly-input-date.entry.js +2 -2
  40. package/dist/esm/smoothly-input-month.entry.js +2 -2
  41. package/dist/esm/smoothly-input.entry.js +17 -10
  42. package/dist/esm/smoothly-select-demo.entry.js +2 -2
  43. package/dist/smoothly/{generate-776b3b0f.js → generate-50b98474.js} +1 -1
  44. package/dist/smoothly/index-1be6d668.js +1597 -0
  45. package/dist/{esm/index-a28d88cf.js → smoothly/index-a5a08f46.js} +230 -184
  46. package/dist/smoothly/index.esm.js +215 -116
  47. package/dist/smoothly/p-7b43df84.entry.js +1 -0
  48. package/dist/smoothly/smoothly-calendar.entry.js +7 -15
  49. package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
  50. package/dist/smoothly/smoothly-display.entry.js +2 -1
  51. package/dist/smoothly/smoothly-input-date-range.entry.js +2 -2
  52. package/dist/smoothly/smoothly-input-date.entry.js +2 -2
  53. package/dist/smoothly/smoothly-input-month.entry.js +2 -2
  54. package/dist/smoothly/smoothly-input.entry.js +17 -10
  55. package/dist/smoothly/smoothly-select-demo.entry.js +2 -2
  56. package/dist/types/components/calendar/index.d.ts +2 -2
  57. package/dist/types/components/input/index.d.ts +1 -0
  58. package/dist/types/components.d.ts +2 -2
  59. package/dist/types/index.d.ts +1 -1
  60. package/dist/types/utilities/Cosmetic/Color/CommaRgb.d.ts +11 -0
  61. package/dist/types/utilities/Cosmetic/Color/Hex.d.ts +4 -0
  62. package/dist/types/utilities/Cosmetic/Color/Hsl.d.ts +4 -0
  63. package/dist/types/utilities/Cosmetic/Color/Name.d.ts +155 -0
  64. package/dist/types/utilities/Cosmetic/Color/Rgb.d.ts +4 -0
  65. package/dist/types/utilities/Cosmetic/Color/index.d.ts +170 -0
  66. package/dist/types/utilities/Cosmetic/index.d.ts +23 -0
  67. package/dist/types/utilities/index.d.ts +1 -1
  68. package/package.json +3 -3
  69. package/dist/cjs/index-42db74b3.js +0 -19931
  70. package/dist/collection/utilities/colorTransform.js +0 -120
  71. package/dist/esm/index-36a04e8c.js +0 -19929
  72. package/dist/smoothly/index-36a04e8c.js +0 -19929
  73. package/dist/smoothly/p-c4dd9866.entry.js +0 -1
  74. package/dist/types/utilities/colorNames.d.ts +0 -3
  75. package/dist/types/utilities/colorTransform.d.ts +0 -8
@@ -1,120 +0,0 @@
1
- import { colorNames } from "./colorNames";
2
- export function toCommaRgb(color) {
3
- let result;
4
- const colorWithoutSpace = color.replace(/ /g, "").toLowerCase();
5
- if (isCommaRgb(colorWithoutSpace))
6
- result = colorWithoutSpace;
7
- else if (isHex(colorWithoutSpace))
8
- result = hexToCommaRgb(colorWithoutSpace);
9
- else if (isRgb(colorWithoutSpace))
10
- result = rgbToCommaRgb(colorWithoutSpace);
11
- else if (colorWithoutSpace in colorNames)
12
- result = hexToCommaRgb(colorNames[colorWithoutSpace]);
13
- else if (isHsl(colorWithoutSpace))
14
- result = hslToCommaRgb(colorWithoutSpace);
15
- return result;
16
- }
17
- export function isCommaRgb(commaRgb) {
18
- const values = commaRgb.split(",");
19
- return (values.length == 3 &&
20
- values.every(value => {
21
- var _a;
22
- return !Number.isNaN(value) &&
23
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
24
- Number(value) >= 0 &&
25
- Number(value) <= 255;
26
- }));
27
- }
28
- export function isHex(hex) {
29
- const matchArray = hex.match(/[0-9a-fA-F]/g);
30
- return hex[0] == "#" && ((matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 3 || (matchArray === null || matchArray === void 0 ? void 0 : matchArray.length) == 6);
31
- }
32
- export function hexToCommaRgb(hex) {
33
- let result = "0,0,0";
34
- if (hex.length == 7)
35
- result = `${parseInt(hex.substr(1, 2), 16)},${parseInt(hex.substr(3, 2), 16)},${parseInt(hex.substr(5, 2), 16)}`;
36
- else if (hex.length == 4)
37
- result = hexToCommaRgb(`#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`);
38
- return result;
39
- }
40
- export function isRgb(rgb) {
41
- const values = rgb.substring(4, rgb.length - 1).split(",");
42
- return (rgb.substr(0, 4) == "rgb(" &&
43
- rgb.substr(rgb.length - 1, 1) == ")" &&
44
- values.length == 3 &&
45
- values.every(value => {
46
- var _a;
47
- return !Number.isNaN(value) &&
48
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
49
- Number(value) >= 0 &&
50
- Number(value) <= 255;
51
- }));
52
- }
53
- export function rgbToCommaRgb(rgb) {
54
- return rgb.substring(4, rgb.length - 1);
55
- }
56
- export function isHsl(hsl) {
57
- const values = hsl.substring(4, hsl.length - 1).split(",");
58
- return (hsl.substr(0, 4) == "hsl(" &&
59
- hsl.substr(hsl.length - 1, 1) == ")" &&
60
- values.length == 3 &&
61
- values.every((value, index) => {
62
- var _a, _b;
63
- let result = false;
64
- if (index == 0)
65
- result =
66
- !Number.isNaN(value) &&
67
- ((_a = value.match(/[0-9]/g)) === null || _a === void 0 ? void 0 : _a.length) == value.length &&
68
- Number(value) >= 0 &&
69
- Number(value) <= 360;
70
- else {
71
- const number = value.substr(0, value.length - 1);
72
- result =
73
- value[value.length - 1] == "%" &&
74
- !Number.isNaN(number) &&
75
- ((_b = number.match(/[0-9]/g)) === null || _b === void 0 ? void 0 : _b.length) == number.length &&
76
- Number(number) >= 0 &&
77
- Number(number) <= 100;
78
- }
79
- return result;
80
- }));
81
- }
82
- function hue2rgb(p, q, t) {
83
- let result = p;
84
- if (t < 0)
85
- t += 1;
86
- if (t > 1)
87
- t -= 1;
88
- if (t < 1 / 6)
89
- result = p + (q - p) * 6 * t;
90
- else if (t < 1 / 2)
91
- result = q;
92
- else if (t < 2 / 3)
93
- result = p + (q - p) * (2 / 3 - t) * 6;
94
- return result;
95
- }
96
- export function hslToCommaRgb(hsl) {
97
- let result;
98
- let h, s, l;
99
- let r, g, b;
100
- const HSL = hsl
101
- .substring(4, hsl.length - 1)
102
- .split(",")
103
- .map((value, index) => Number(index == 0 ? value : value.substr(0, value.length - 1)));
104
- if (HSL.length == 3) {
105
- h = HSL[0] / 360;
106
- s = HSL[1] / 100;
107
- l = HSL[2] / 100;
108
- if (s == 0)
109
- r = g = b = l;
110
- else {
111
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
112
- const p = 2 * l - q;
113
- r = hue2rgb(p, q, h + 1 / 3);
114
- g = hue2rgb(p, q, h);
115
- b = hue2rgb(p, q, h - 1 / 3);
116
- }
117
- result = `${Math.round(255 * r)},${Math.round(255 * g)},${Math.round(255 * b)}`;
118
- }
119
- return result;
120
- }