@appscode/design-system 1.0.43-alpha.10 → 1.0.43-alpha.15

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.
@@ -686,7 +686,7 @@ $border_color_4: transparent transparent #585d6e transparent;
686
686
  height: 10px;
687
687
  width: 10px;
688
688
  border-radius: 50%;
689
- background: $ac-grey-lightest;
689
+ background: $ac-gray-lightest;
690
690
  border: 2px solid $ac-white;
691
691
  display: inline-flex;
692
692
 
@@ -95,7 +95,7 @@ $ac-gray-dark: #5f5f5f;
95
95
  $ac-gray: #767676;
96
96
  $ac-gray-light: #8d8d8d;
97
97
  $ac-gray-lighter: #a4a4a4;
98
- $ac-grey-lightest: #d1d1d1;
98
+ $ac-gray-lightest: #d1d1d1;
99
99
  $ac-white-light: #e7e7e7;
100
100
  $ac-white-lighter: #f1f1f1;
101
101
  $ac-white: #ffffff;
@@ -2,7 +2,7 @@
2
2
  // margin-top: 3px;
3
3
  &.cluster-select {
4
4
  .multiselect__tags {
5
- border: 1px solid $ac-grey-lightest;
5
+ border: 1px solid $ac-gray-lightest;
6
6
  background-color: $table-header;
7
7
 
8
8
  .multiselect__input {
@@ -49,13 +49,16 @@
49
49
  td {
50
50
  border: none;
51
51
  font-size: $font-size-small;
52
- color: $ac-gray-dark;
52
+ color: hsl(
53
+ var(--font-hsl-hue),
54
+ var(--font-hsl-saturation),
55
+ calc(var(--font-hsl-lightness) + 25%)
56
+ );
53
57
  font-weight: 400;
54
58
  padding: 3px 0px;
55
59
  min-width: 230px;
56
60
 
57
61
  &:first-child {
58
- color: $ac-black;
59
62
  font-weight: 400;
60
63
  padding-right: 10px;
61
64
  color: $ac-color-heading;
@@ -3,7 +3,7 @@
3
3
  align-items: center;
4
4
 
5
5
  li {
6
- background: $ac-grey-lightest;
6
+ background: $ac-gray-lightest;
7
7
  list-style: none;
8
8
  padding: 2px 10px;
9
9
  border-radius: 4px;
@@ -143,7 +143,7 @@
143
143
  }
144
144
 
145
145
  &:hover {
146
- background-color: $ac-grey-lightest;
146
+ background-color: $ac-gray-lightest;
147
147
  }
148
148
  }
149
149
 
@@ -282,7 +282,7 @@
282
282
  position: absolute;
283
283
  right: -5px;
284
284
  top: -5px;
285
- border: 1px solid $ac-grey-lightest;
285
+ border: 1px solid $ac-gray-lightest;
286
286
  font-size: 10px;
287
287
  height: 25px;
288
288
  width: 25px;
@@ -72,7 +72,7 @@
72
72
  height: 160px;
73
73
  background-size: cover;
74
74
  background-position: center;
75
- background-color: $ac-grey-lightest;
75
+ background-color: $ac-gray-lightest;
76
76
  position: relative;
77
77
  z-index: 1;
78
78
 
@@ -126,7 +126,7 @@
126
126
  transition: 0.3s;
127
127
 
128
128
  &:hover {
129
- color: $ac-grey-lightest;
129
+ color: $ac-gray-lightest;
130
130
  }
131
131
  }
132
132
  }
@@ -12,7 +12,7 @@
12
12
  height: 240px;
13
13
  background-size: cover;
14
14
  background-position: center;
15
- background-color: $ac-grey-lightest;
15
+ background-color: $ac-gray-lightest;
16
16
  background-repeat: no-repeat;
17
17
  border-radius: 10px;
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.10",
3
+ "version": "1.0.43-alpha.15",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -0,0 +1,138 @@
1
+ export function HSLToHex(h, s, l) {
2
+ s /= 100;
3
+ l /= 100;
4
+
5
+ const c = (1 - Math.abs(2 * l - 1)) * s,
6
+ x = c * (1 - Math.abs(((h / 60) % 2) - 1)),
7
+ m = l - c / 2;
8
+
9
+ let r = 0,
10
+ g = 0,
11
+ b = 0;
12
+
13
+ if (0 <= h && h < 60) {
14
+ r = c;
15
+ g = x;
16
+ b = 0;
17
+ } else if (60 <= h && h < 120) {
18
+ r = x;
19
+ g = c;
20
+ b = 0;
21
+ } else if (120 <= h && h < 180) {
22
+ r = 0;
23
+ g = c;
24
+ b = x;
25
+ } else if (180 <= h && h < 240) {
26
+ r = 0;
27
+ g = x;
28
+ b = c;
29
+ } else if (240 <= h && h < 300) {
30
+ r = x;
31
+ g = 0;
32
+ b = c;
33
+ } else if (300 <= h && h < 360) {
34
+ r = c;
35
+ g = 0;
36
+ b = x;
37
+ }
38
+ // Having obtained RGB, convert channels to hex
39
+ r = Math.round((r + m) * 255).toString(16);
40
+ g = Math.round((g + m) * 255).toString(16);
41
+ b = Math.round((b + m) * 255).toString(16);
42
+
43
+ // Prepend 0s, if necessary
44
+ if (r.length == 1) r = "0" + r;
45
+ if (g.length == 1) g = "0" + g;
46
+ if (b.length == 1) b = "0" + b;
47
+
48
+ return "#" + r + g + b;
49
+ }
50
+ export function HexToHSL(H) {
51
+ // Convert hex to RGB first
52
+ let r = 0,
53
+ g = 0,
54
+ b = 0;
55
+ if (H.length == 4) {
56
+ r = parseInt("0x" + H[1] + H[1]);
57
+ g = parseInt("0x" + H[2] + H[2]);
58
+ b = parseInt("0x" + H[3] + H[3]);
59
+ } else if (H.length == 7) {
60
+ r = parseInt("0x" + H[1] + H[2]);
61
+ g = parseInt("0x" + H[3] + H[4]);
62
+ b = parseInt("0x" + H[5] + H[6]);
63
+ }
64
+ // Then to HSL
65
+ r /= 255;
66
+ g /= 255;
67
+ b /= 255;
68
+ const cmin = Math.min(r, g, b),
69
+ cmax = Math.max(r, g, b),
70
+ delta = cmax - cmin;
71
+ let h = 0,
72
+ s = 0,
73
+ l = 0;
74
+
75
+ if (delta == 0) h = 0;
76
+ else if (cmax == r) h = ((g - b) / delta) % 6;
77
+ else if (cmax == g) h = (b - r) / delta + 2;
78
+ else h = (r - g) / delta + 4;
79
+
80
+ h = Math.round(h * 60);
81
+
82
+ if (h < 0) h += 360;
83
+
84
+ l = (cmax + cmin) / 2;
85
+ s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
86
+ s = +(s * 100).toFixed(1);
87
+ l = +(l * 100).toFixed(1);
88
+
89
+ return {
90
+ hue: `${h}`,
91
+ saturation: `${s}%`,
92
+ lightness: `${l}%`,
93
+ };
94
+ }
95
+ export function getThemeHSL() {
96
+ const hue = getComputedStyle(document.documentElement).getPropertyValue(
97
+ "--hsl-hue"
98
+ );
99
+ const saturation = getComputedStyle(
100
+ document.documentElement
101
+ ).getPropertyValue("--hsl-saturation");
102
+ const lightness = getComputedStyle(
103
+ document.documentElement
104
+ ).getPropertyValue("--hsl-lightness");
105
+
106
+ return {
107
+ hue,
108
+ saturation,
109
+ lightness,
110
+ };
111
+ }
112
+ export function setThemeHSL(h, s, l) {
113
+ document.documentElement.style.setProperty("--hsl-hue", h);
114
+ document.documentElement.style.setProperty("--hsl-saturation", s);
115
+ document.documentElement.style.setProperty("--hsl-lightness", l);
116
+ }
117
+ export function setFontHSL(h, s, l) {
118
+ document.documentElement.style.setProperty("--font-hsl-hue", h);
119
+ document.documentElement.style.setProperty("--font-hsl-saturation", s);
120
+ document.documentElement.style.setProperty("--font-hsl-lightness", l);
121
+ }
122
+ export function getFontHSL() {
123
+ const hue = getComputedStyle(document.documentElement).getPropertyValue(
124
+ "--font-hsl-hue"
125
+ );
126
+ const saturation = getComputedStyle(
127
+ document.documentElement
128
+ ).getPropertyValue("--font-hsl-saturation");
129
+ const lightness = getComputedStyle(
130
+ document.documentElement
131
+ ).getPropertyValue("--font-hsl-lightness");
132
+
133
+ return {
134
+ hue,
135
+ saturation,
136
+ lightness,
137
+ };
138
+ }
@@ -57,9 +57,9 @@ export default defineComponent({
57
57
 
58
58
  // attach click event listener on window, and close the dropdown
59
59
  function deactivateDropdown(e: Event) {
60
- e.preventDefault();
61
60
  const { target } = e;
62
61
  if (
62
+ isDropdownActive.value &&
63
63
  dropdown.value &&
64
64
  dropdown.value !== target &&
65
65
  !dropdown.value.contains(target as Node)