@appscode/design-system 2.0.11 → 2.0.13

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.
@@ -1,4 +1,4 @@
1
- .has-hover-style {
1
+ .has-hover-style:not(.is-disabled) {
2
2
  cursor: pointer;
3
3
 
4
4
  &::before {
@@ -30,10 +30,9 @@
30
30
  }
31
31
 
32
32
  &:hover {
33
-
34
33
  &::before,
35
34
  &::after {
36
35
  transform: scale(1);
37
36
  }
38
37
  }
39
- }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
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,144 @@
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(document.documentElement).getPropertyValue(
103
+ "--hsl-lightness"
104
+ );
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(document.documentElement).getPropertyValue(
130
+ "--font-hsl-lightness"
131
+ );
132
+
133
+ return {
134
+ hue,
135
+ saturation,
136
+ lightness,
137
+ };
138
+ }
139
+ export const loaderLightThemePrimaryColor = "#f5f7f9";
140
+ export const loaderDarkThemePrimaryColor = "#2e323c";
141
+ export const loaderLightThemeSecondaryColor = "#ecebeb";
142
+ export const loaderDarkThemeSecondaryColor = "#21272e";
143
+ export const sidebarLoaderLightThemePrimaryColor = "#0F4371";
144
+ export const sidebarLoaderLightThemeSecondaryColor = "#0C365A";
@@ -71,21 +71,22 @@ const OptionDots = defineAsyncComponent(
71
71
  <style lang="scss" scoped>
72
72
  .card-details {
73
73
  border: 1px solid $primary-90;
74
- padding: 30px 20px;
74
+ padding: 24px 20px;
75
75
  transition: 0.3s ease-in-out;
76
76
  position: relative;
77
77
  z-index: 1;
78
78
  width: 100%;
79
+ border-radius: 2px;
79
80
 
80
81
  .ac-options {
81
82
  position: absolute;
82
83
  right: 20px;
83
- top: 30px;
84
+ top: 24px;
84
85
  z-index: 999;
85
86
  }
86
87
  .c-header {
87
88
  display: flex;
88
- margin-bottom: 20px;
89
+ margin-bottom: 24px;
89
90
 
90
91
  .c-logo {
91
92
  width: 54px;
@@ -23,7 +23,7 @@
23
23
  width: calc(25% - 8px);
24
24
  max-width: 390px;
25
25
  min-width: 290px;
26
-
26
+ border-radius: 2px;
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  justify-content: space-between;
@@ -47,6 +47,7 @@ withDefaults(
47
47
  max-width: 390px;
48
48
  min-width: 290px;
49
49
  position: relative;
50
+ border-radius: 2px;
50
51
 
51
52
  .required {
52
53
  position: absolute;
@@ -70,6 +70,7 @@ withDefaults(defineProps<Props>(), {
70
70
  max-width: 390px;
71
71
  min-width: 290px;
72
72
  position: relative;
73
+ border-radius: 2px;
73
74
 
74
75
  .required {
75
76
  position: absolute;
@@ -32,7 +32,7 @@ withDefaults(defineProps<Props>(), {
32
32
  </script>
33
33
  <template>
34
34
  <div
35
- class="card-details"
35
+ class="card-details has-hover-style"
36
36
  :class="[
37
37
  modifierClasses,
38
38
  { 'no-data-available is-justify-content-center': noDataAvailable },
@@ -42,7 +42,7 @@ withDefaults(defineProps<Props>(), {
42
42
  class="left-content"
43
43
  :class="{ 'is-align-items-center': noDataAvailable }"
44
44
  >
45
- <figure class="image" :class="{ 'is-64x64': !noDataAvailable }">
45
+ <figure class="image" :class="{ 'is-48x48': !noDataAvailable }">
46
46
  <img :class="{ 'is-rounded': !noDataAvailable }" :src="thumbnail" />
47
47
  </figure>
48
48
  <h5>{{ title }}</h5>
@@ -61,7 +61,7 @@ withDefaults(defineProps<Props>(), {
61
61
  </AcButton>
62
62
  </div>
63
63
  <div class="right-content" v-if="!noDataAvailable">
64
- <figure class="image is-64x64">
64
+ <figure class="image is-48x48">
65
65
  <img
66
66
  v-if="type === 'organization'"
67
67
  src="../../images/icons/org-icon.svg"
@@ -77,20 +77,27 @@ withDefaults(defineProps<Props>(), {
77
77
  align-items: flex-end;
78
78
  justify-content: space-between;
79
79
  border: 1px solid $primary-90;
80
- padding: 32px 20px;
81
- border-radius: 4px;
80
+ padding: 24px 20px;
81
+ border-radius: 2px;
82
82
  transition: 0.3s ease-in-out;
83
+ position: relative;
84
+
85
+ figure {
86
+ margin-bottom: 8px;
87
+ }
83
88
 
84
89
  button.ac-button.is-text {
85
90
  color: $primary;
86
91
  transition: 0.3s ease-in-out;
92
+ padding: 2px 0;
93
+ height: auto;
87
94
  &:hover {
88
95
  background-color: transparent;
89
96
  }
90
97
  }
91
98
 
92
99
  &:hover:not(.no-data-available) {
93
- border: 1px solid $primary;
100
+ // border: 1px solid $primary;
94
101
  button.ac-button.is-text {
95
102
  gap: 16px;
96
103
  }
@@ -106,7 +113,7 @@ withDefaults(defineProps<Props>(), {
106
113
  display: flex;
107
114
  flex-direction: column;
108
115
  align-items: flex-start;
109
- gap: 16px;
116
+ gap: 8px;
110
117
  justify-content: space-between;
111
118
 
112
119
  .image {
@@ -32,7 +32,7 @@ withDefaults(defineProps<Props>(), {
32
32
  .ac-single-card {
33
33
  border: 1px solid $primary-90;
34
34
  transition: 0.3s ease-in-out;
35
-
35
+ border-radius: 2px;
36
36
  display: flex;
37
37
  flex-direction: column;
38
38
  justify-content: space-between;