nuxt-glorious 1.1.9 → 1.2.0

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.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "glorious",
3
3
  "configKey": "glorious",
4
- "version": "1.1.9"
4
+ "version": "1.2.0"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  button:focus-visible {
2
- outline: none;
2
+ @apply outline-none;
3
3
  }
4
4
 
5
5
  .xl.glorious-button-orange, .xl.glorious-button-blue, .xl.glorious-button-gray, .xl.glorious-button-red, .xl.glorious-button-primary {
@@ -48,7 +48,7 @@ button:focus-visible {
48
48
  @apply text-gray-500 hover:bg-green-100;
49
49
  }
50
50
  .glorious-button-primary:disabled {
51
- @apply cursor-not-allowed opacity-50;
51
+ @apply cursor-not-allowed;
52
52
  }
53
53
  .glorious-button-primary:disabled:not(:disabled) {
54
54
  @apply bg-green-300;
@@ -61,7 +61,7 @@ button:focus-visible {
61
61
  @apply text-gray-500 hover:bg-red-100;
62
62
  }
63
63
  .glorious-button-red:disabled {
64
- @apply cursor-not-allowed opacity-50;
64
+ @apply cursor-not-allowed;
65
65
  }
66
66
  .glorious-button-red:disabled:not(:disabled) {
67
67
  @apply bg-red-300;
@@ -74,7 +74,7 @@ button:focus-visible {
74
74
  @apply text-gray-500 hover:bg-gray-100;
75
75
  }
76
76
  .glorious-button-gray:disabled {
77
- @apply cursor-not-allowed opacity-50;
77
+ @apply cursor-not-allowed;
78
78
  }
79
79
  .glorious-button-gray:disabled:not(:disabled) {
80
80
  @apply bg-gray-300;
@@ -87,7 +87,7 @@ button:focus-visible {
87
87
  @apply text-gray-500 hover:bg-blue-100;
88
88
  }
89
89
  .glorious-button-blue:disabled {
90
- @apply cursor-not-allowed opacity-50;
90
+ @apply cursor-not-allowed;
91
91
  }
92
92
  .glorious-button-blue:disabled:not(:disabled) {
93
93
  @apply bg-blue-300;
@@ -100,7 +100,7 @@ button:focus-visible {
100
100
  @apply text-gray-500 hover:bg-orange-100;
101
101
  }
102
102
  .glorious-button-orange:disabled {
103
- @apply cursor-not-allowed opacity-50;
103
+ @apply cursor-not-allowed;
104
104
  }
105
105
  .glorious-button-orange:disabled:not(:disabled) {
106
106
  @apply bg-orange-300;
@@ -31,15 +31,15 @@
31
31
  .g-scafold-modal.close {
32
32
  @apply hidden;
33
33
  }
34
- .g-scafold-modal.open {
35
- animation: animation-mobile 0.3s normal forwards;
36
- }
37
34
  @screen md {
38
35
  .g-scafold-modal.open {
39
- animation: animation-opacity 0.2s normal forwards;
36
+ animation: animationOpacity 0.2s normal forwards;
40
37
  }
41
38
  }
42
- @keyframes animation-opacity {
39
+ .g-scafold-modal.open {
40
+ animation: animationMobile 0.3s normal forwards;
41
+ }
42
+ @keyframes animationOpacity {
43
43
  from {
44
44
  opacity: 0;
45
45
  }
@@ -47,7 +47,7 @@
47
47
  opacity: 1;
48
48
  }
49
49
  }
50
- @keyframes animation-mobile {
50
+ @keyframes animationMobile {
51
51
  from {
52
52
  transform: translateY(100%);
53
53
  }
@@ -36,13 +36,6 @@ const props = defineProps({
36
36
  type: String,
37
37
  },
38
38
  });
39
-
40
- const emits = defineEmits(["click"]);
41
- const click = () => {
42
- if (props.loading) return;
43
-
44
- emits("click");
45
- };
46
39
  </script>
47
40
 
48
41
  <template>
@@ -55,7 +48,6 @@ const click = () => {
55
48
  props.outline ? 'outline' : '',
56
49
  ]"
57
50
  :disabled="props.disabled"
58
- @click="click"
59
51
  >
60
52
  <div v-if="props.loading" class="loading">
61
53
  <GLoading />
@@ -72,13 +64,16 @@ const click = () => {
72
64
  ]"
73
65
  :disabled="props.disabled"
74
66
  >
75
- <slot />
67
+ <div v-if="props.loading" class="loading">
68
+ <GLoading />
69
+ </div>
70
+ <slot v-else />
76
71
  </NuxtLink>
77
72
  </template>
78
73
 
79
74
  <style>
80
75
  button:focus-visible {
81
- outline: none;
76
+ @apply outline-none;
82
77
  }
83
78
 
84
79
  .xl.glorious-button-orange, .xl.glorious-button-blue, .xl.glorious-button-gray, .xl.glorious-button-red, .xl.glorious-button-primary {
@@ -127,7 +122,7 @@ button:focus-visible {
127
122
  @apply text-gray-500 hover:bg-green-100;
128
123
  }
129
124
  .glorious-button-primary:disabled {
130
- @apply cursor-not-allowed opacity-50;
125
+ @apply cursor-not-allowed;
131
126
  }
132
127
  .glorious-button-primary:disabled:not(:disabled) {
133
128
  @apply bg-green-300;
@@ -140,7 +135,7 @@ button:focus-visible {
140
135
  @apply text-gray-500 hover:bg-red-100;
141
136
  }
142
137
  .glorious-button-red:disabled {
143
- @apply cursor-not-allowed opacity-50;
138
+ @apply cursor-not-allowed;
144
139
  }
145
140
  .glorious-button-red:disabled:not(:disabled) {
146
141
  @apply bg-red-300;
@@ -153,7 +148,7 @@ button:focus-visible {
153
148
  @apply text-gray-500 hover:bg-gray-100;
154
149
  }
155
150
  .glorious-button-gray:disabled {
156
- @apply cursor-not-allowed opacity-50;
151
+ @apply cursor-not-allowed;
157
152
  }
158
153
  .glorious-button-gray:disabled:not(:disabled) {
159
154
  @apply bg-gray-300;
@@ -166,7 +161,7 @@ button:focus-visible {
166
161
  @apply text-gray-500 hover:bg-blue-100;
167
162
  }
168
163
  .glorious-button-blue:disabled {
169
- @apply cursor-not-allowed opacity-50;
164
+ @apply cursor-not-allowed;
170
165
  }
171
166
  .glorious-button-blue:disabled:not(:disabled) {
172
167
  @apply bg-blue-300;
@@ -179,7 +174,7 @@ button:focus-visible {
179
174
  @apply text-gray-500 hover:bg-orange-100;
180
175
  }
181
176
  .glorious-button-orange:disabled {
182
- @apply cursor-not-allowed opacity-50;
177
+ @apply cursor-not-allowed;
183
178
  }
184
179
  .glorious-button-orange:disabled:not(:disabled) {
185
180
  @apply bg-orange-300;
@@ -2,7 +2,7 @@
2
2
  const props = defineProps({
3
3
  modelValue: {
4
4
  required: true,
5
- type: [String, Object, null],
5
+ type: null,
6
6
  },
7
7
  color: {
8
8
  required: false,
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, watch } from "#imports";
3
3
  import { useGloriousCore } from "../../composables/useGloriousCore";
4
- import tailwindColor from "../../utils/tailwindColor";
4
+ import gTailwindColor from "../../utils/gTailwindColor";
5
5
  const props = defineProps({
6
6
  modelValue: {
7
7
  required: false,
@@ -208,7 +208,7 @@ const typeInput = ref(props.type);
208
208
  class="absolute left-0 top-0 bottom-0 my-auto ml-1 cursor-pointer"
209
209
  :size="23"
210
210
  name="glorious-eye-fill"
211
- :color="tailwindColor('gray', 500)"
211
+ :color="gTailwindColor('gray', 500)"
212
212
  @click="typeInput = 'text'"
213
213
  ></GIcon>
214
214
  <GIcon
@@ -216,7 +216,7 @@ const typeInput = ref(props.type);
216
216
  class="absolute left-0 top-0 bottom-0 my-auto ml-1 cursor-pointer"
217
217
  :size="23"
218
218
  name="glorious-eye-off-fill"
219
- :color="tailwindColor('gray', 500)"
219
+ :color="gTailwindColor('gray', 500)"
220
220
  @click="typeInput = 'password'"
221
221
  ></GIcon>
222
222
  </div>
@@ -236,7 +236,7 @@ const typeInput = ref(props.type);
236
236
  class="glorious-input-icon"
237
237
  :name="props.icon"
238
238
  :size="computeIconSize"
239
- :color="$tailwindColor('gray', '500')"
239
+ :color="gTailwindColor('gray', '500')"
240
240
  />
241
241
  </div>
242
242
  <GErrorText :error="props.error" />
@@ -109,7 +109,7 @@ watch(
109
109
  v-show="props.closeBtn !== ''"
110
110
  @click="emits('update:modelValue', false)"
111
111
  >
112
- {{ props.closeBtn }}Z
112
+ {{ props.closeBtn }}
113
113
  </GButton>
114
114
  </div>
115
115
  <!-- end footer -->
@@ -150,15 +150,15 @@ watch(
150
150
  .g-scafold-modal.close {
151
151
  @apply hidden;
152
152
  }
153
- .g-scafold-modal.open {
154
- animation: animation-mobile 0.3s normal forwards;
155
- }
156
153
  @screen md {
157
154
  .g-scafold-modal.open {
158
- animation: animation-opacity 0.2s normal forwards;
155
+ animation: animationOpacity 0.2s normal forwards;
159
156
  }
160
157
  }
161
- @keyframes animation-opacity {
158
+ .g-scafold-modal.open {
159
+ animation: animationMobile 0.3s normal forwards;
160
+ }
161
+ @keyframes animationOpacity {
162
162
  from {
163
163
  opacity: 0;
164
164
  }
@@ -166,7 +166,7 @@ watch(
166
166
  opacity: 1;
167
167
  }
168
168
  }
169
- @keyframes animation-mobile {
169
+ @keyframes animationMobile {
170
170
  from {
171
171
  transform: translateY(100%);
172
172
  }
@@ -41,11 +41,6 @@ const props = defineProps({
41
41
  default: "off",
42
42
  type: String,
43
43
  },
44
- rows: {
45
- require: false,
46
- default: 3,
47
- type: Number,
48
- },
49
44
  });
50
45
 
51
46
  const inputValue: any = ref(null);
@@ -71,7 +66,6 @@ watch(
71
66
  :class="[props.size, `glorious-textarea-${props.color}`]"
72
67
  :placeholder="props.placeholder"
73
68
  :disabled="props.disabled"
74
- :rows="props.rows"
75
69
  />
76
70
  </div>
77
71
  <GErrorText :error="props.error" />
@@ -11,7 +11,6 @@ const defaultOptions = {
11
11
  Accept: "application/json"
12
12
  },
13
13
  bodyType: "normal",
14
- body: {},
15
14
  credentials: "same-origin"
16
15
  };
17
16
  export default function(url, options = defaultOptions) {
@@ -8,8 +8,7 @@ export const GloriousStore = defineStore("GloriousStore", {
8
8
  },
9
9
  loading: {},
10
10
  keepData: {},
11
- forms: {},
12
- modals: {}
11
+ forms: {}
13
12
  }),
14
13
  getters: {
15
14
  authIsLogin() {
@@ -40,8 +39,7 @@ export const GloriousStore = defineStore("GloriousStore", {
40
39
  show: false,
41
40
  keepData: {}
42
41
  };
43
- if (typeof key === "string")
44
- this.modals[key] = defaultValue;
42
+ if (typeof key === "string") this.modals[key] = defaultValue;
45
43
  else
46
44
  key.map((item) => {
47
45
  this.modals[item] = defaultValue;
@@ -0,0 +1 @@
1
+ export default function gTailwindColor(name: string, range: number): any;
@@ -0,0 +1,5 @@
1
+ import colors from "tailwindcss/colors.js";
2
+ export default function gTailwindColor(name, range) {
3
+ const gTailwindColor2 = colors;
4
+ return gTailwindColor2[name][range];
5
+ }
package/package.json CHANGED
@@ -1,53 +1,54 @@
1
- {
2
- "version": "1.1.9",
3
- "name": "nuxt-glorious",
4
- "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
- "repository": "sajadhzj/nuxt-glorious",
6
- "author": "sajad hossein zadeh (https://github.com/sajadhzj)",
7
- "license": "MIT",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/types.d.ts",
11
- "import": "./dist/module.mjs",
12
- "require": "./dist/module.cjs"
13
- }
14
- },
15
- "main": "./dist/module.cjs",
16
- "types": "./dist/types.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "scripts": {
21
- "prepack": "nuxt-module-build build",
22
- "dev": "nuxi dev playground",
23
- "dev:build": "nuxi build playground",
24
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
25
- "release": "npm run prepack && npm publish",
26
- "lint": "eslint .",
27
- "test": "vitest run",
28
- "test:watch": "vitest watch"
29
- },
30
- "dependencies": {
31
- "@nuxt/kit": "^3.11.1",
32
- "@nuxtjs/tailwindcss": "^6.12.0",
33
- "@pinia/nuxt": "^0.5.1",
34
- "defu": "^6.1.4",
35
- "pinia": "^2.1.7",
36
- "sass": "^1.77.5"
37
- },
38
- "devDependencies": {
39
- "@nuxt/devtools": "latest",
40
- "@nuxt/eslint-config": "^0.2.0",
41
- "@nuxt/module-builder": "^0.5.5",
42
- "@nuxt/schema": "^3.11.1",
43
- "@nuxt/test-utils": "^3.12.0",
44
- "@types/node": "^20.11.29",
45
- "changelogen": "^0.5.5",
46
- "eslint": "^8.57.0",
47
- "nuxt": "^3.13.2",
48
- "vitest": "^1.4.0"
49
- },
50
- "overrides": {
51
- "vue": "latest"
52
- }
53
- }
1
+ {
2
+ "version": "1.2.0",
3
+ "name": "nuxt-glorious",
4
+ "description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
5
+ "repository": "sajadhzj/nuxt-glorious",
6
+ "author": "sajad hossein zadeh (https://github.com/sajadhzj)",
7
+ "license": "MIT",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types.d.ts",
12
+ "import": "./dist/module.mjs",
13
+ "require": "./dist/module.cjs"
14
+ }
15
+ },
16
+ "main": "./dist/module.cjs",
17
+ "types": "./dist/types.d.ts",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "prepack": "nuxt-module-build build",
23
+ "dev": "nuxi dev playground",
24
+ "dev:build": "nuxi build playground",
25
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
26
+ "release": "npm run prepack && npm publish",
27
+ "lint": "eslint .",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest watch"
30
+ },
31
+ "dependencies": {
32
+ "@nuxt/kit": "^3.11.1",
33
+ "@nuxtjs/tailwindcss": "^6.12.0",
34
+ "@pinia/nuxt": "^0.5.1",
35
+ "defu": "^6.1.4",
36
+ "pinia": "^2.1.7",
37
+ "sass": "^1.77.5"
38
+ },
39
+ "devDependencies": {
40
+ "@nuxt/devtools": "latest",
41
+ "@nuxt/eslint-config": "^0.2.0",
42
+ "@nuxt/module-builder": "^0.5.5",
43
+ "@nuxt/schema": "^3.11.1",
44
+ "@nuxt/test-utils": "^3.12.0",
45
+ "@types/node": "^20.11.29",
46
+ "changelogen": "^0.5.5",
47
+ "eslint": "^8.57.0",
48
+ "nuxt": "^3.11.1",
49
+ "vitest": "^1.4.0"
50
+ },
51
+ "overrides": {
52
+ "vue": "latest"
53
+ }
54
+ }
@@ -1 +0,0 @@
1
- export default function tailwindColor(name: string, range: number): any;
@@ -1,5 +0,0 @@
1
- import colors from "tailwindcss/colors.js";
2
- export default function tailwindColor(name, range) {
3
- const tailwindColor2 = colors;
4
- return tailwindColor2[name][range];
5
- }