@exakt/ui 0.0.50 → 0.0.51

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.
package/dist/module.d.ts CHANGED
@@ -1,14 +1,19 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
+ interface Colors {
4
+ primary?: string;
5
+ text?: string;
6
+ bg?: string;
7
+ green?: string;
8
+ red?: string;
9
+ blue?: string;
10
+ yellow?: string;
11
+ }
3
12
  interface ModuleOptions {
4
13
  hue: number;
5
14
  colors: {
6
- primary?: string;
7
- dark?: string;
8
- light?: string;
9
- red?: string;
10
- blue?: string;
11
- yellow?: string;
15
+ light: Colors;
16
+ dark: Colors;
12
17
  };
13
18
  breakpoints: {
14
19
  sm?: string;
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "exakt-ui",
3
3
  "configKey": "exakt",
4
- "version": "0.0.50"
4
+ "version": "0.0.51"
5
5
  }
package/dist/module.mjs CHANGED
@@ -4,12 +4,24 @@ import fs from 'fs';
4
4
  const defaults = {
5
5
  hue: 9,
6
6
  colors: {
7
- primary: "#008dff",
8
- dark: "#212121",
9
- light: "#ffffff",
10
- red: "#f44336",
11
- blue: "#2196f3",
12
- yellow: "#FFA000"
7
+ light: {
8
+ primary: "#008dff",
9
+ text: "#212121",
10
+ red: "#f44336",
11
+ blue: "#2196f3",
12
+ green: "#00b850",
13
+ yellow: "#ebbc00",
14
+ bg: "#ffffff"
15
+ },
16
+ dark: {
17
+ primary: "#008dff",
18
+ text: "#ffffff",
19
+ red: "#ff8980",
20
+ blue: "#008dff",
21
+ green: "#00ff6e",
22
+ yellow: "#FFA000",
23
+ bg: "#212121"
24
+ }
13
25
  },
14
26
  breakpoints: {
15
27
  sm: "16em",
@@ -39,8 +51,13 @@ const module = defineNuxtModule({
39
51
  );
40
52
  let SCSSvariables = "";
41
53
  let CSSvariables = ":root{";
42
- for (const [key, value] of [["hue", options.hue + "deg"], ...Object.entries(options.colors)]) {
43
- SCSSvariables += `$root-${key}: ${value}; `;
54
+ SCSSvariables += `$root-hue: ${options.hue}; `;
55
+ for (const mode of ["light", "dark"]) {
56
+ SCSSvariables += `$root-colors-${mode}: (`;
57
+ for (const [key, value] of Object.entries(options.colors[mode])) {
58
+ SCSSvariables += `"${key}": ${value}, `;
59
+ }
60
+ SCSSvariables += ");";
44
61
  }
45
62
  for (const [key, value] of Object.entries(options.breakpoints)) {
46
63
  SCSSvariables += `$e-${key}-screen-breakpoint: ${value}; `;
@@ -62,7 +79,7 @@ const module = defineNuxtModule({
62
79
  css: {
63
80
  preprocessorOptions: {
64
81
  scss: {
65
- additionalData: `@use "sass:color"; @import "${resolver.resolve(
82
+ additionalData: `@use "sass:color"; @use "sass:map"; @import "${resolver.resolve(
66
83
  "../node_modules/.cache/exakt-ui/variables.scss"
67
84
  )}"; `
68
85
  }
@@ -16,7 +16,7 @@
16
16
  class="bar-e-container"
17
17
  :force-full-width="true"
18
18
  >
19
- <div class="rounded bar">
19
+ <div class="rounded bar bg-elev-2">
20
20
  <e-progress-linear
21
21
  :model-value="props.loading"
22
22
  class="md-and-up-only"
@@ -62,7 +62,6 @@ const props = withDefaults(
62
62
  display: flex;
63
63
  justify-content: flex-start;
64
64
  justify-items: flex-start;
65
- background-color: var(--e-color-elev-2);
66
65
  width: 100%;
67
66
  overflow: clip;
68
67
  position: relative;
@@ -3,7 +3,7 @@
3
3
  <slot />
4
4
  <e-image-lazy-view
5
5
  v-if="src"
6
- class="avatar"
6
+ class="avatar bg-elev"
7
7
  :width="props.size"
8
8
  :height="props.size"
9
9
  :contain="true"
@@ -32,7 +32,6 @@ const props = withDefaults(defineProps<{
32
32
  border-radius: 100%;
33
33
  width: fit-content;
34
34
  height: fit-content;
35
- background-color: var(--e-color-elev);
36
35
  }
37
36
 
38
37
  .a-container {
@@ -115,7 +115,7 @@ const textColor = computed(() => {
115
115
  return props.color;
116
116
  }
117
117
  if (props.background == "transparent") {
118
- return "var(--e-color-dark)";
118
+ return "var(--e-color-text)";
119
119
  }
120
120
  const rgb = backgroundColorRgb.value;
121
121
 
@@ -168,7 +168,7 @@ const textColor = computed(() => {
168
168
  border: transparent solid 0.1rem;
169
169
 
170
170
  &.transparent {
171
- color: var(--e-color-dark);
171
+ color: var(--e-color-text);
172
172
  background: rgba(0, 0, 0, 0);
173
173
  &:hover {
174
174
  background: rgba(98, 98, 98, 0.15);
@@ -178,7 +178,7 @@ const textColor = computed(() => {
178
178
 
179
179
  &:focus-visible {
180
180
  transition: border-width 0.2s;
181
- border: var(--e-color-dark) solid 0.1rem;
181
+ border: var(--e-color-text) solid 0.1rem;
182
182
  }
183
183
 
184
184
  &.loading {
@@ -234,7 +234,7 @@ const textColor = computed(() => {
234
234
  }
235
235
 
236
236
  &.inactive {
237
- color: var(--e-color-dark);
237
+ color: var(--e-color-text);
238
238
  opacity: 80%;
239
239
  }
240
240
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="e-chip py-3 px-4 ma-1 d-flex flex-center"
4
- :class="{ active }"
4
+ :class="{ active, 'bg-i-active':active, 'bg-i-inactive':!active }"
5
5
  @click="active = !active"
6
6
  >
7
7
  <e-icon
@@ -41,7 +41,6 @@ const active = computed({
41
41
  .e-chip {
42
42
  outline: var(--e-color-i-outline) solid 0.1rem;
43
43
  width: fit-content;
44
- background-color: var(--e-color-i-inactive);
45
44
  transition: background-color 0.15s;
46
45
  border-radius: 15rem;
47
46
  user-select: none;
@@ -53,7 +52,6 @@ const active = computed({
53
52
  }
54
53
 
55
54
  &.active {
56
- background-color: var(--e-color-i-active);
57
55
  outline: var(--e-color-primary) solid 0.1rem;
58
56
 
59
57
  &>.icon {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="rounded clickable-card py-4 my-2">
2
+ <div class="rounded clickable-card bg-elev py-4 my-2">
3
3
  <div class=" px-6">
4
4
  <slot />
5
5
  </div>
@@ -9,7 +9,6 @@
9
9
 
10
10
  <style lang="scss" scoped>
11
11
  .clickable-card {
12
- background-color: var(--e-color-elev);
13
12
  cursor: pointer;
14
13
  transition: background 0.15s;
15
14
  & > * {
@@ -11,7 +11,7 @@
11
11
  v-if="modelValue"
12
12
  class="dialog-wrap flex-center"
13
13
  >
14
- <div class="dialog rounded px-6 pe-6 pb-2">
14
+ <div class="dialog bg-elev rounded px-6 pe-6 pb-2">
15
15
  <div class="mb-4">
16
16
  <h2 class="ma-0 pa-0">
17
17
  <slot name="title" />
@@ -47,8 +47,6 @@ const emit = defineEmits(["update:modelValue"]);
47
47
  .dialog {
48
48
  min-width: 25rem;
49
49
  pointer-events: all;
50
- background-color: var(--e-color-elev);
51
- color: var(--e-color-dark);
52
50
  position: relative;
53
51
  overflow: clip;
54
52
  }
@@ -12,7 +12,7 @@
12
12
  <div
13
13
  v-if="visibleComputed"
14
14
  ref="list"
15
- class="list rounded"
15
+ class="list bg-elev-2 rounded"
16
16
  :style="{position:(fixed?'fixed':undefined)}"
17
17
  >
18
18
  <component
@@ -196,8 +196,6 @@ const onActivatorClick = () => {
196
196
  width: v-bind('state.width + `px`');
197
197
  display: flex;
198
198
 
199
- background-color: var(--e-color-elev-2);
200
- color: var(--e-color-dark);
201
199
  z-index: 6;
202
200
 
203
201
  flex-shrink: 1;
@@ -207,14 +205,14 @@ const onActivatorClick = () => {
207
205
  margin-top: v-bind("props.paddingY");
208
206
 
209
207
  .item {
210
- // color: var(--e-color-dark);
208
+ // color: var(--e-color-text);
211
209
  font-size: 1rem;
212
210
  padding: 0.7rem;
213
211
  text-transform: capitalize;
214
212
  position: relative;
215
213
 
216
214
  &:hover {
217
- background-color: rgba(var(--e-color-dark-rgb), 0.2);
215
+ background-color: rgba(var(--e-color-fg-rgb), 0.5);
218
216
  }
219
217
 
220
218
  &:focus {}
@@ -116,7 +116,7 @@ const selected = computed({
116
116
  width: var(--size);
117
117
  height: var(--size);
118
118
  border-radius: 50%;
119
- background: var(--e-color-dark);
119
+ background: var(--e-color-text);
120
120
  transform: scale(0);
121
121
  transition: transform 0.25s;
122
122
  box-sizing: border-box;
@@ -165,7 +165,7 @@ const transitionEnd = () => {
165
165
  resize: none;
166
166
  margin: var(--e-core-padding-x) / 2;
167
167
  font-size: 1rem;
168
- color: var(--e-color-dark);
168
+ color: var(--e-color-text);
169
169
  font-family: var(--e-font-family);
170
170
  height: v-bind(height);
171
171
  transition: outline ease-in-out 0.15s, background-color ease-in-out 0.15s;
@@ -203,7 +203,7 @@ const transitionEnd = () => {
203
203
  position: relative;
204
204
 
205
205
  background-color: transparent;
206
- color: var(--e-color-dark);
206
+ color: var(--e-color-text);
207
207
  padding: 10px;
208
208
  outline: var(--e-color-i-outline) solid 0.1rem;
209
209
  //box-shadow: 0 0 0 0.1rem var(--e-color-i-outline);
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <nav
3
- class="nav e-blur"
3
+ class="nav bg-elev e-blur"
4
4
  :class="{ fixed }"
5
5
  >
6
6
  <e-container
@@ -32,7 +32,6 @@ defineProps<{
32
32
  height: 3.5rem;
33
33
  box-shadow: 0 0 0 0.06rem rgba(0, 0, 0, 0.12) !important;
34
34
 
35
- background-color: var(--e-color-elev);
36
35
  position: sticky;
37
36
  top: 0;
38
37
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
  <template>
4
- <div class="titlebar d-flex flex-align-center">
4
+ <div class="titlebar d-flex flex-align-center bg-elev-2">
5
5
  <h4>Title</h4>
6
6
  </div>
7
7
  </template>
@@ -12,6 +12,5 @@
12
12
  left:0;
13
13
  height:3.5rem;
14
14
  padding-left: 3.5rem;
15
- background-color: var(--e-color-elev-2);
16
15
  }
17
16
  </style>
@@ -2,7 +2,7 @@
2
2
  <Transition name="fade">
3
3
  <div
4
4
  v-if="modelValue"
5
- class="e-progress-linear"
5
+ class="e-progress-linear bg-elev"
6
6
  :class="posClass"
7
7
  />
8
8
  </Transition>
@@ -51,7 +51,6 @@ const posClass = computed(() => {
51
51
  height: 0.2rem;
52
52
  overflow: clip;
53
53
 
54
- background-color: var(--e-color-elev);
55
54
  }
56
55
 
57
56
  .e-progress-linear:before {
@@ -1,13 +1,5 @@
1
1
  /* This is very much a hack, but it will have to do for now */
2
2
 
3
- /* Color Definitions */
4
- $root-dark-rgb: red($root-dark), green($root-dark), blue($root-dark);
5
- $root-light-rgb: red($root-light), green($root-light), blue($root-light);
6
- $root-primary-rgb: red($root-primary), green($root-primary), blue($root-primary);
7
- $root-red-rgb: red($root-red), green($root-red), blue($root-red);
8
- $root-blue-rgb: red($root-blue), green($root-blue), blue($root-blue);
9
- $root-yellow-rgb: red($root-yellow), green($root-yellow), blue($root-yellow);
10
-
11
3
  .rounded {
12
4
  border-radius: var(--e-rounded-border-radius);
13
5
  }
@@ -26,33 +18,6 @@ body {
26
18
  margin: 0px;
27
19
  }
28
20
 
29
- $color-map: (
30
- "red": $root-red,
31
- "blue": $root-blue,
32
- "primary": $root-primary,
33
- "dark": $root-dark,
34
- "light": $root-light,
35
- "yellow": $root-yellow,
36
- );
37
-
38
- @each $name, $color in $color-map {
39
- :root {
40
- #{'--e-color-'+$name}: $color;
41
- }
42
-
43
- .bg-#{$name} {
44
- background: $color;
45
- @if (color.lightness($color) > 49%){
46
- color: $root-dark
47
- }@else{
48
- color: $root-light
49
- }
50
- }
51
-
52
- .color-#{$name} {
53
- color: $color;
54
- }
55
- }
56
21
 
57
22
  a {
58
23
  color: var(--e-color-primary);
@@ -65,88 +30,101 @@ a {
65
30
  color: var(--e-color-primary);
66
31
  }
67
32
 
68
- &:active{
33
+ &:active {
69
34
  color: var(--e-color-i);
70
35
  }
71
36
 
72
37
  &:hover {
73
- text-underline-offset: 0.15rem;
38
+ text-underline-offset: 0.15rem;
74
39
  text-decoration-thickness: 0.1rem;
75
40
 
76
41
  }
77
42
  }
78
43
 
79
- @mixin elev($lightness, $light) {
80
-
81
- $source: hsl($root-hue,15%, $lightness);
82
- $source-i: color.change($source, $saturation: 20%);
44
+ @mixin color-definitions($color-map) {
45
+
46
+ :root {
47
+ @each $name, $color in $color-map {
48
+ #{'--e-color-'+$name}: $color;
49
+ #{'--e-color-'+$name+'-rgb'}: red($color), green($color), blue($color);
50
+
51
+ }
52
+ }
53
+
54
+ @each $name, $color in $color-map {
55
+ .bg-#{$name} {
56
+ background: $color;
57
+
58
+ @if (color.lightness($color) > 49%) {
59
+ color: map.get($root-colors-light, "text");
60
+ }
61
+
62
+ @else {
63
+ color: map.get($root-colors-dark, "text");
64
+ }
65
+ }
66
+
67
+ .color-#{$name} {
68
+ color: $color;
69
+ }
70
+ }
71
+ }
72
+
73
+ @mixin elev($lightness, $light, $color-map) {
83
74
 
84
- $full: 0;
85
- $factor: 1;
86
- @if $light == 1 {
75
+ $source: hsl($root-hue, 15%, $lightness);
76
+ $source-i: color.change($source, $saturation: 20%);
77
+
78
+ $full: 0;
79
+ $factor: 1;
80
+
81
+ @if $light ==1 {
87
82
  $full: 100;
88
83
  $factor: -1;
89
84
  }
90
- $root-i-depressed: color.adjust($source-i, $lightness: -2.5%);
91
- $root-i-depressed-2: color.adjust($source-i, $lightness: -7.5%);
92
- $root-i-depressed-active: color.adjust($source-i, $lightness: -5%, $saturation: 2%);
93
- //$root-depressed: color.change($source, $lightness: $full + $factor*20%, $saturation:22%);
94
- --e-color-i-inactive: #{color.adjust($source-i, $lightness: 10%)};
95
- --e-color-i: #{color.adjust($source-i, $lightness: 20%)};
96
- --e-color-i-active: #{color.change($root-primary, $lightness: 30%)};
97
85
 
86
+ $color-map: map.set($color-map, "i-depressed", color.adjust($source-i, $lightness: -2.5%));
87
+ $color-map: map.set($color-map, "i-depressed-2", color.adjust($source-i, $lightness: -7.5%));
88
+ $color-map: map.set($color-map, "i-depressed-active", color.adjust($source-i, $lightness: -5%, $saturation: 2%));
89
+
90
+
91
+ $color-map: map.set($color-map, "i-inactive", color.adjust($source-i, $lightness: 10%));
92
+ $color-map: map.set($color-map, "i", color.adjust($source-i, $lightness: 20%));
93
+ $color-map: map.set($color-map, "i-active", color.change(map.get($color-map, "primary"), $lightness: 30%));
94
+
95
+ $color-map: map.set($color-map, "i-outline", color.change($source-i, $lightness: $full + $factor*30%, $saturation: 20%));
98
96
 
99
- --e-color-i-depressed: #{$root-i-depressed};
100
- --e-color-i-depressed-active: #{$root-i-depressed-active};
101
- //--e-color-depressed: #{$root-depressed};
102
- --e-color-i-depressed-2: #{$root-i-depressed-2};
97
+ $color-map: map.set($color-map, "bg", color.adjust($source, $lightness: -2%));
98
+ $color-map: map.set($color-map, "fg", color.adjust($source, $lightness: 2%));
103
99
 
104
100
 
105
- $root-i-outline: color.change($source-i, $lightness: $full + $factor*30%, $saturation: 20%);
106
- --e-color-i-outline: #{$root-i-outline};
101
+ $color-map: map.set($color-map, "elev", color.scale($source, $lightness: $lightness));
102
+ $color-map: map.set($color-map, "elev-2", color.scale($source, $lightness: $lightness));
103
+ $color-map: map.set($color-map, "elev-3", color.scale($source, $lightness: $lightness));
104
+
107
105
 
108
- $root-bg: color.adjust($source, $lightness: -2%);
109
- $root-fg: color.adjust($source, $lightness: 2%);
110
- --e-color-fg: #{$root-fg};
111
- --e-color-bg: #{$root-bg};
112
-
113
106
 
114
107
  $root-elev: color.scale($source, $lightness: $lightness);
115
108
  $root-elev-2: color.scale($source, $lightness: $lightness);
116
109
  $root-elev-3: color.scale($source, $lightness: $lightness);
117
-
118
- --e-color-elev: #{$root-elev};
119
- --e-color-elev-rgb: #{red($root-elev), green($root-elev), blue($root-elev)};
120
110
 
121
- --e-color-elev-2: #{$root-elev-2};
122
- --e-color-elev-2-rgb: #{red($root-elev-2), green($root-elev-2),
123
- blue($root-elev-2)};
111
+ @include color-definitions($color-map);
124
112
 
125
- --e-color-elev-3: #{$root-elev-3};
126
- --e-color-elev-3-rgb: #{red($root-elev-3), green($root-elev-3),
127
- blue($root-elev-3)};
128
113
  }
129
114
 
130
115
  :root {
131
- --e-color-primary-rgb: #{$root-primary-rgb};
116
+ color-scheme: light;
117
+ }
132
118
 
133
- --e-color-bg: #{$root-light};
134
- --e-color-bg-rgb: #{$root-light-rgb};
119
+ @include elev(83%, 1, $root-colors-light);
135
120
 
136
- --e-color-dark: #{$root-dark};
137
- --e-color-dark-rgb: #{$root-dark-rgb};
138
-
139
- @include elev(83%, 1);
140
- }
141
121
 
142
122
  @media (prefers-color-scheme: dark) {
143
123
  :root {
144
- --e-color-bg: #{$root-dark};
145
- --e-color-bg-rgb: #{$root-dark-rgb};
146
-
147
- --e-color-dark: #{$root-light};
148
- --e-color-dark-rgb: #{$root-light-rgb};
149
124
  color-scheme: dark;
150
- @include elev(15%, 0);
151
125
  }
152
- }
126
+
127
+ @include elev(15%, 0, $root-colors-dark);
128
+
129
+
130
+ }
@@ -144,7 +144,7 @@ $directions: (
144
144
 
145
145
  body {
146
146
  background-color: var(--e-color-bg);
147
- color: var(--e-color-dark);
147
+ color: var(--e-color-text);
148
148
  font-family: var(--e-font-family);
149
149
  font-weight: var(--e-font-weight);
150
150
 
@@ -34,7 +34,7 @@ export default defineNuxtPlugin(() => {
34
34
  }
35
35
  return p;
36
36
  },
37
- rootColors: ["primary", "red", "dark", "light", "yellow", "elev"],
37
+ rootColors: ["primary", "red", "text", "yellow", "elev"],
38
38
  /**
39
39
  * Generates an alphanumeric ID of a given length.
40
40
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exakt/ui",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "A UI library for Nuxt.js",
5
5
  "license": "MIT",
6
6
  "type": "module",