@exakt/ui 0.0.21 → 0.0.23

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/README.md CHANGED
@@ -9,7 +9,9 @@ a simple nuxt ui library focused on doing as much as possible with css
9
9
 
10
10
  - [✨  Release Notes](/CHANGELOG.md)
11
11
  <!-- - [📖 &nbsp;Documentation](https://example.com) -->
12
-
12
+ ### DO NOT USE THIS LIBRARY IN YOUR PROJECT.
13
+ ### THIS LIBRARY IS VERY UNSTABLE AND EXPERIMENTAL
14
+ ### first rule of exakt is to be yourself and have fun :)
13
15
  ## Features
14
16
 
15
17
  <!-- Highlight some of the features your module provide here -->
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "exakt-ui",
3
3
  "configKey": "exakt",
4
- "version": "0.0.21"
4
+ "version": "0.0.23"
5
5
  }
@@ -190,9 +190,9 @@ const onActivatorClick = () => {
190
190
 
191
191
  .list {
192
192
  position: absolute;
193
- left: v-bind('(state.x) + "px"');
194
- top: v-bind('(state.y) + "px"');
195
- width: v-bind('state.width + "px"');
193
+ left: v-bind('(state.x) + `px`');
194
+ top: v-bind('(state.y) + `px`');
195
+ width: v-bind('state.width + `px`');
196
196
  display: flex;
197
197
 
198
198
  background-color: var(--e-color-elev-2);
@@ -93,8 +93,8 @@ const props = withDefaults(
93
93
  }>(),
94
94
  {
95
95
  icon: undefined,
96
- label: "Search",
97
- solid: false,
96
+ label: "",
97
+ solid: true,
98
98
  type: "text",
99
99
  modelValue: "",
100
100
  autocomplete: "off",
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <e-btn
3
+ :solid="false"
4
+ justify="stretch"
5
+ block
6
+ background="transparent"
7
+ class="pa-0 ma-0 btn"
8
+ >
9
+ <div class="icon">
10
+ <e-icon
11
+ v-if="icon"
12
+ :icon="icon"
13
+ size="22"
14
+ /><slot
15
+ v-else
16
+ name="icon"
17
+ />
18
+ </div>
19
+ <div class="ml-4 d-flex flex-column onhover">
20
+ <slot />
21
+ </div>
22
+ </e-btn>
23
+ </template>
24
+ <script setup lang="ts">
25
+ const props = withDefaults(
26
+ defineProps<{
27
+ icon?: string;
28
+ iconWidth?: string;
29
+ }>(),
30
+ { icon: "" }
31
+ );
32
+ </script>
33
+ <style lang="scss" scoped>
34
+ .icon {
35
+ width: calc(
36
+ v-bind(iconWidth) - 0.1rem * 2
37
+ ); // Compensate the btn's accessibility border
38
+ }
39
+
40
+
41
+
42
+ .btn {
43
+ transition: all 0.25s ease-in-out;
44
+ height: v-bind(iconWidth);
45
+ width: v-bind(iconWidth);
46
+ }
47
+
48
+ .onhover{
49
+ display: none;
50
+ }
51
+ </style>
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <div
3
+ class="sidebar"
4
+ @mouseenter="state.hover = true"
5
+ @mouseleave="state.hover = false"
6
+ >
7
+ <e-btn
8
+ :solid="false"
9
+ justify="stretch"
10
+ block
11
+ background="transparent"
12
+ class="pa-0 ma-0 btn"
13
+ >
14
+ <div class="icon">
15
+ <e-icon
16
+ :icon="mdiHome"
17
+ size="22"
18
+ />
19
+ </div>
20
+ <div class="ml-4 d-flex flex-column btn-text">
21
+ <div class="mb-1">
22
+ John Pork
23
+ </div>
24
+ <div class="text-secondary">
25
+ Hey I was wondering if you've got your bogos
26
+ binted
27
+ </div>
28
+ </div>
29
+ </e-btn>
30
+ </div>
31
+ <div class="app-content">
32
+ <slot name="app" />
33
+ </div>
34
+ </template>
35
+ <script setup lang="ts">
36
+ import { reactive } from "#imports";
37
+ import { mdiHome } from "@mdi/js";
38
+ const props = withDefaults(
39
+ defineProps<{
40
+ collapsedWidth?: number | string;
41
+ width?: number | string;
42
+ }>(),
43
+ { width: "3.5rem" }
44
+ );
45
+ const state = reactive({
46
+ hover: false,
47
+ });
48
+ </script>
49
+ <style lang="scss" scoped>
50
+ .sidebar,
51
+ .app-content {
52
+ --collapsed-sidebar-width: v-bind(collapsedWidth);
53
+ --expanded-sidebar-width: 20rem; //v-bind(width);
54
+ --expansion-amount: calc(
55
+ var(--expanded-sidebar-width) - var(--collapsed-sidebar-width)
56
+ );
57
+ }
58
+ .sidebar {
59
+ height: 100vh;
60
+ width: var(--collapsed-sidebar-width);
61
+ z-index: 5;
62
+ position: fixed;
63
+ left: 0;
64
+ top: 0;
65
+ background-color: var(--e-color-elev-2);
66
+ overflow-x: hidden;
67
+ transition: width 0.25s ease-in-out;
68
+ .btn-text {
69
+ text-align: left;
70
+ max-width: calc(var(--expansion-amount) - 0.1rem*2);
71
+ }
72
+
73
+ &:hover ~ .app-content {
74
+
75
+ // transform: translateX(var(--expansion-amount));
76
+ }
77
+ &:hover {
78
+ width: var(--expanded-sidebar-width);
79
+
80
+ }
81
+ &:hover .btn-text {
82
+ display: block;
83
+ flex-grow: 0;
84
+ flex-shrink: 0;
85
+ position: relative;
86
+ }
87
+ .btn {
88
+ width: 100%;
89
+ flex-grow: 0;
90
+ flex-shrink: 0;
91
+ }
92
+ }
93
+
94
+ .app-content {
95
+ transition: transform 0.25s ease-in-out;
96
+ background-color: var(--e-color-light);
97
+ width: 100%;
98
+ height: 100%;
99
+ left: 3.5rem;
100
+ top: 0rem;
101
+ position: absolute;
102
+ }
103
+
104
+ .icon {
105
+ min-width: calc(
106
+ var(--collapsed-sidebar-width) - 0.1rem * 2
107
+ ); // Compensate the btn's accessibility border
108
+
109
+ display: block;
110
+ }
111
+
112
+
113
+ </style>
@@ -88,7 +88,7 @@ a,
88
88
 
89
89
  --e-color-dark: #{$root-light};
90
90
  --e-color-dark-rgb: #{$root-light-rgb};
91
-
91
+ color-scheme: dark;
92
92
  @include elev($root-dark, 5%);
93
93
  }
94
94
  }
@@ -3,6 +3,24 @@ export default defineNuxtPlugin(() => {
3
3
  return {
4
4
  provide: {
5
5
  exakt: {
6
+ /**
7
+ * Converts a color to an RGB object by creating a temporary element and reading the color.
8
+ *
9
+ * @param x Input color string
10
+ * @returns The RGB object
11
+ */
12
+ computeColor: (input) => {
13
+ const div = document.createElement("div");
14
+ document.body.appendChild(div);
15
+ div.style.color = input;
16
+ const c = getComputedStyle(div).color;
17
+ const res = c.match(/[.\d]+/g).map(Number);
18
+ div.remove();
19
+ return { r: res[0], g: res[1], b: res[2] };
20
+ },
21
+ /**
22
+ * Parses exakt-specific color strings to CSS variable names.
23
+ */
6
24
  parseColor: (p, suffix = "") => {
7
25
  let result = null;
8
26
  if (p === "primary") {
@@ -15,13 +33,18 @@ export default defineNuxtPlugin(() => {
15
33
  }
16
34
  return p;
17
35
  },
36
+ /**
37
+ * Generates an alphanumeric ID of a given length.
38
+ */
18
39
  makeid: (length) => {
19
40
  let result = "";
20
41
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
21
42
  const charactersLength = characters.length;
22
43
  let counter = 0;
23
44
  while (counter < length) {
24
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
45
+ result += characters.charAt(
46
+ Math.floor(Math.random() * charactersLength)
47
+ );
25
48
  counter += 1;
26
49
  }
27
50
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exakt/ui",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "A UI library for Nuxt.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -67,7 +67,7 @@
67
67
  "url": "https://github.com/wd-4000/exakt/issues"
68
68
  },
69
69
  "resolutions": {
70
- "mkdist": "npm:@wd4000/mkdist-no-scss@1.2.0"
70
+ "mkdist": "npm:@wd4000/mkdist-no-scss@1.4.1"
71
71
  },
72
72
  "homepage": "https://github.com/wd-4000/exakt#readme",
73
73
  "packageManager": "yarn@3.5.1"