@bbl-digital/snorre 3.1.36 → 4.0.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +5228 -5293
- package/esm/app-shell/index.js +19 -9
- package/esm/app-shell/theme.js +2 -60
- package/esm/core/Alert/index.js +0 -2
- package/esm/core/Box/styles.js +7 -7
- package/esm/core/Card/index.js +2 -6
- package/esm/core/Card/styles.js +11 -19
- package/esm/core/Datepicker/styles.js +9 -9
- package/esm/core/SearchFilter/index.js +6 -15
- package/esm/core/SearchFilter/styles.js +24 -34
- package/esm/core/Timepicker/index.js +5 -4
- package/esm/index.d.js +2 -0
- package/esm/index.js +11 -12
- package/esm/layout/Menu/MenuBottom/index.js +37 -0
- package/esm/layout/Menu/MenuBottom/styles.js +15 -0
- package/esm/layout/Menu/MenuItem/index.js +1 -1
- package/esm/layout/Menu/MenuItem/styles.js +2 -2
- package/esm/layout/Menu/SecondaryMenuItem/index.js +1 -1
- package/esm/layout/Menu/styles.js +1 -1
- package/esm/layout/Submenu/styles.js +14 -14
- package/esm/utils/format.js +2 -10
- package/esm/utils/useSnorreTheme.js +33 -0
- package/lib/app-shell/index.d.ts +1 -1
- package/lib/app-shell/index.d.ts.map +1 -1
- package/lib/app-shell/index.js +19 -9
- package/lib/app-shell/theme.d.ts +33 -64
- package/lib/app-shell/theme.d.ts.map +1 -1
- package/lib/app-shell/theme.js +2 -60
- package/lib/core/Alert/index.d.ts +0 -2
- package/lib/core/Alert/index.d.ts.map +1 -1
- package/lib/core/Alert/index.js +0 -2
- package/lib/core/Box/styles.js +7 -7
- package/lib/core/Card/index.d.ts +0 -2
- package/lib/core/Card/index.d.ts.map +1 -1
- package/lib/core/Card/index.js +2 -6
- package/lib/core/Card/styles.d.ts +1 -1
- package/lib/core/Card/styles.d.ts.map +1 -1
- package/lib/core/Card/styles.js +11 -19
- package/lib/core/Datepicker/styles.d.ts.map +1 -1
- package/lib/core/Datepicker/styles.js +9 -9
- package/lib/core/Datepicker/yearMonthForm.d.ts.map +1 -1
- package/lib/core/Input/index.d.ts +4 -4
- package/lib/core/Input/index.d.ts.map +1 -1
- package/lib/core/SearchFilter/index.d.ts +0 -7
- package/lib/core/SearchFilter/index.d.ts.map +1 -1
- package/lib/core/SearchFilter/index.js +6 -15
- package/lib/core/SearchFilter/styles.d.ts +1 -4
- package/lib/core/SearchFilter/styles.d.ts.map +1 -1
- package/lib/core/SearchFilter/styles.js +24 -34
- package/lib/core/Timepicker/index.d.ts +1 -1
- package/lib/core/Timepicker/index.d.ts.map +1 -1
- package/lib/core/Timepicker/index.js +5 -4
- package/lib/index.d.js +2 -0
- package/lib/index.d.ts +11 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -12
- package/lib/layout/Menu/MenuBottom/index.d.ts +14 -0
- package/lib/layout/Menu/MenuBottom/index.d.ts.map +1 -0
- package/lib/layout/Menu/MenuBottom/index.js +37 -0
- package/lib/layout/Menu/MenuBottom/styles.d.ts +4 -0
- package/lib/layout/Menu/MenuBottom/styles.d.ts.map +1 -0
- package/lib/layout/Menu/MenuBottom/styles.js +15 -0
- package/lib/layout/Menu/MenuItem/index.d.ts.map +1 -1
- package/lib/layout/Menu/MenuItem/index.js +1 -1
- package/lib/layout/Menu/MenuItem/styles.d.ts.map +1 -1
- package/lib/layout/Menu/MenuItem/styles.js +2 -2
- package/lib/layout/Menu/SecondaryMenuItem/index.d.ts.map +1 -1
- package/lib/layout/Menu/SecondaryMenuItem/index.js +1 -1
- package/lib/layout/Menu/styles.d.ts.map +1 -1
- package/lib/layout/Menu/styles.js +1 -1
- package/lib/layout/Submenu/styles.d.ts.map +1 -1
- package/lib/layout/Submenu/styles.js +14 -14
- package/lib/utils/format.d.ts +1 -2
- package/lib/utils/format.d.ts.map +1 -1
- package/lib/utils/format.js +2 -10
- package/lib/utils/useSnorreTheme.d.ts +11 -0
- package/lib/utils/useSnorreTheme.d.ts.map +1 -0
- package/lib/utils/useSnorreTheme.js +33 -0
- package/package.json +1 -1
- package/theme-bbls.js +412 -0
- package/theme-generator.js +299 -489
- package/theme-helpers.js +62 -0
- package/esm/enums/ModifierKey.js +0 -13
- package/lib/enums/ModifierKey.d.ts +0 -12
- package/lib/enums/ModifierKey.d.ts.map +0 -1
- package/lib/enums/ModifierKey.js +0 -13
package/theme-helpers.js
ADDED
@@ -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
|
+
}
|
package/esm/enums/ModifierKey.js
DELETED
@@ -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"}
|
package/lib/enums/ModifierKey.js
DELETED
@@ -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 = {}));
|