@bbl-digital/snorre 3.1.38 → 4.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/dist/bundle.js +5228 -5312
  2. package/esm/app-shell/index.js +19 -9
  3. package/esm/app-shell/theme.js +2 -60
  4. package/esm/core/Alert/index.js +0 -2
  5. package/esm/core/Box/styles.js +7 -7
  6. package/esm/core/Card/index.js +2 -6
  7. package/esm/core/Card/styles.js +11 -19
  8. package/esm/core/Datepicker/styles.js +9 -9
  9. package/esm/core/SearchFilter/index.js +6 -15
  10. package/esm/core/SearchFilter/styles.js +24 -34
  11. package/esm/core/Timepicker/index.js +5 -4
  12. package/esm/index.d.js +2 -0
  13. package/esm/index.js +11 -12
  14. package/esm/layout/Menu/MenuBottom/index.js +37 -0
  15. package/esm/layout/Menu/MenuBottom/styles.js +15 -0
  16. package/esm/layout/Menu/MenuItem/index.js +1 -1
  17. package/esm/layout/Menu/MenuItem/styles.js +2 -2
  18. package/esm/layout/Menu/SecondaryMenuItem/index.js +1 -1
  19. package/esm/layout/Menu/styles.js +1 -1
  20. package/esm/layout/Submenu/styles.js +14 -14
  21. package/esm/utils/format.js +2 -10
  22. package/esm/utils/time.js +0 -17
  23. package/esm/utils/useSnorreTheme.js +33 -0
  24. package/lib/app-shell/index.d.ts +1 -1
  25. package/lib/app-shell/index.d.ts.map +1 -1
  26. package/lib/app-shell/index.js +19 -9
  27. package/lib/app-shell/theme.d.ts +33 -64
  28. package/lib/app-shell/theme.d.ts.map +1 -1
  29. package/lib/app-shell/theme.js +2 -60
  30. package/lib/core/Alert/index.d.ts +0 -2
  31. package/lib/core/Alert/index.d.ts.map +1 -1
  32. package/lib/core/Alert/index.js +0 -2
  33. package/lib/core/Box/styles.js +7 -7
  34. package/lib/core/Card/index.d.ts +0 -2
  35. package/lib/core/Card/index.d.ts.map +1 -1
  36. package/lib/core/Card/index.js +2 -6
  37. package/lib/core/Card/styles.d.ts +1 -1
  38. package/lib/core/Card/styles.d.ts.map +1 -1
  39. package/lib/core/Card/styles.js +11 -19
  40. package/lib/core/Datepicker/styles.d.ts.map +1 -1
  41. package/lib/core/Datepicker/styles.js +9 -9
  42. package/lib/core/Datepicker/yearMonthForm.d.ts.map +1 -1
  43. package/lib/core/Input/index.d.ts +4 -4
  44. package/lib/core/Input/index.d.ts.map +1 -1
  45. package/lib/core/SearchFilter/index.d.ts +0 -7
  46. package/lib/core/SearchFilter/index.d.ts.map +1 -1
  47. package/lib/core/SearchFilter/index.js +6 -15
  48. package/lib/core/SearchFilter/styles.d.ts +1 -4
  49. package/lib/core/SearchFilter/styles.d.ts.map +1 -1
  50. package/lib/core/SearchFilter/styles.js +24 -34
  51. package/lib/core/Timepicker/index.d.ts +1 -1
  52. package/lib/core/Timepicker/index.d.ts.map +1 -1
  53. package/lib/core/Timepicker/index.js +5 -4
  54. package/lib/index.d.js +2 -0
  55. package/lib/index.d.ts +11 -12
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +11 -12
  58. package/lib/layout/Menu/MenuBottom/index.d.ts +14 -0
  59. package/lib/layout/Menu/MenuBottom/index.d.ts.map +1 -0
  60. package/lib/layout/Menu/MenuBottom/index.js +37 -0
  61. package/lib/layout/Menu/MenuBottom/styles.d.ts +4 -0
  62. package/lib/layout/Menu/MenuBottom/styles.d.ts.map +1 -0
  63. package/lib/layout/Menu/MenuBottom/styles.js +15 -0
  64. package/lib/layout/Menu/MenuItem/index.d.ts.map +1 -1
  65. package/lib/layout/Menu/MenuItem/index.js +1 -1
  66. package/lib/layout/Menu/MenuItem/styles.d.ts.map +1 -1
  67. package/lib/layout/Menu/MenuItem/styles.js +2 -2
  68. package/lib/layout/Menu/SecondaryMenuItem/index.d.ts.map +1 -1
  69. package/lib/layout/Menu/SecondaryMenuItem/index.js +1 -1
  70. package/lib/layout/Menu/styles.d.ts.map +1 -1
  71. package/lib/layout/Menu/styles.js +1 -1
  72. package/lib/layout/Submenu/styles.d.ts.map +1 -1
  73. package/lib/layout/Submenu/styles.js +14 -14
  74. package/lib/utils/format.d.ts +1 -2
  75. package/lib/utils/format.d.ts.map +1 -1
  76. package/lib/utils/format.js +2 -10
  77. package/lib/utils/time.d.ts +0 -5
  78. package/lib/utils/time.d.ts.map +1 -1
  79. package/lib/utils/time.js +0 -17
  80. package/lib/utils/useSnorreTheme.d.ts +11 -0
  81. package/lib/utils/useSnorreTheme.d.ts.map +1 -0
  82. package/lib/utils/useSnorreTheme.js +33 -0
  83. package/package.json +1 -1
  84. package/theme-bbls.js +412 -0
  85. package/theme-generator.js +299 -489
  86. package/theme-helpers.js +62 -0
  87. package/esm/enums/ModifierKey.js +0 -13
  88. package/lib/enums/ModifierKey.d.ts +0 -12
  89. package/lib/enums/ModifierKey.d.ts.map +0 -1
  90. package/lib/enums/ModifierKey.js +0 -13
@@ -0,0 +1,62 @@
1
+ // Helpers
2
+ const hexToRGBA = (hex, alpha) => {
3
+ var r = parseInt(hex.slice(1, 3), 16),
4
+ g = parseInt(hex.slice(3, 5), 16),
5
+ b = parseInt(hex.slice(5, 7), 16)
6
+
7
+ return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')'
8
+ }
9
+
10
+ const hexifyWithWhiteBackground = (color) => {
11
+ var values = color
12
+ .replace(/rgba?\(/, '')
13
+ .replace(/\)/, '')
14
+ .replace(/[\s+]/g, '')
15
+ .split(',')
16
+ var a = parseFloat(values[3] || 1),
17
+ r = Math.floor(a * parseInt(values[0]) + (1 - a) * 255),
18
+ g = Math.floor(a * parseInt(values[1]) + (1 - a) * 255),
19
+ b = Math.floor(a * parseInt(values[2]) + (1 - a) * 255)
20
+ return (
21
+ '#' +
22
+ ('0' + r.toString(16)).slice(-2) +
23
+ ('0' + g.toString(16)).slice(-2) +
24
+ ('0' + b.toString(16)).slice(-2)
25
+ )
26
+ }
27
+
28
+ const shadeColor = (color, percent) => {
29
+ var R = parseInt(color.substring(1, 3), 16)
30
+ var G = parseInt(color.substring(3, 5), 16)
31
+ var B = parseInt(color.substring(5, 7), 16)
32
+
33
+ R = parseInt('' + (R * (100 + percent)) / 100)
34
+ G = parseInt('' + (G * (100 + percent)) / 100)
35
+ B = parseInt('' + (B * (100 + percent)) / 100)
36
+
37
+ R = R < 255 ? R : 255
38
+ G = G < 255 ? G : 255
39
+ B = B < 255 ? B : 255
40
+
41
+ var RR = R.toString(16).length === 1 ? '0' + R.toString(16) : R.toString(16)
42
+ var GG = G.toString(16).length === 1 ? '0' + G.toString(16) : G.toString(16)
43
+ var BB = B.toString(16).length === 1 ? '0' + B.toString(16) : B.toString(16)
44
+
45
+ return '#' + RR + GG + BB
46
+ }
47
+
48
+ const getContrastYIQ = (hexcolor) => {
49
+ hexcolor = hexcolor.replace('#', '')
50
+ var r = parseInt(hexcolor.substr(0, 2), 16)
51
+ var g = parseInt(hexcolor.substr(2, 2), 16)
52
+ var b = parseInt(hexcolor.substr(4, 2), 16)
53
+ var yiq = (r * 299 + g * 587 + b * 114) / 1000
54
+ return yiq >= 128 ? 'black' : 'white'
55
+ }
56
+
57
+ module.exports = {
58
+ hexToRGBA,
59
+ hexifyWithWhiteBackground,
60
+ shadeColor,
61
+ getContrastYIQ,
62
+ }
@@ -1,13 +0,0 @@
1
- export let ModifierKey;
2
-
3
- (function (ModifierKey) {
4
- ModifierKey["enter"] = "Enter";
5
- ModifierKey["tab"] = "Tab";
6
- ModifierKey["space"] = " ";
7
- ModifierKey["escape"] = "Escape";
8
- ModifierKey["shift"] = "Shift";
9
- ModifierKey["right"] = "ArrowRight";
10
- ModifierKey["left"] = "ArrowLeft";
11
- ModifierKey["up"] = "ArrowUp";
12
- ModifierKey["down"] = "ArrowDown";
13
- })(ModifierKey || (ModifierKey = {}));
@@ -1,12 +0,0 @@
1
- export declare enum ModifierKey {
2
- enter = "Enter",
3
- tab = "Tab",
4
- space = " ",
5
- escape = "Escape",
6
- shift = "Shift",
7
- right = "ArrowRight",
8
- left = "ArrowLeft",
9
- up = "ArrowUp",
10
- down = "ArrowDown"
11
- }
12
- //# sourceMappingURL=ModifierKey.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModifierKey.d.ts","sourceRoot":"","sources":["../../src/packages/enums/ModifierKey.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,KAAK,MAAM;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,eAAe;IACpB,IAAI,cAAc;IAClB,EAAE,YAAY;IACd,IAAI,cAAc;CACnB"}
@@ -1,13 +0,0 @@
1
- export let ModifierKey;
2
-
3
- (function (ModifierKey) {
4
- ModifierKey["enter"] = "Enter";
5
- ModifierKey["tab"] = "Tab";
6
- ModifierKey["space"] = " ";
7
- ModifierKey["escape"] = "Escape";
8
- ModifierKey["shift"] = "Shift";
9
- ModifierKey["right"] = "ArrowRight";
10
- ModifierKey["left"] = "ArrowLeft";
11
- ModifierKey["up"] = "ArrowUp";
12
- ModifierKey["down"] = "ArrowDown";
13
- })(ModifierKey || (ModifierKey = {}));