@finema/core 1.3.39 → 1.3.40

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.39",
3
+ "version": "1.3.40",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
2
2
  import { merge } from 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.3.39";
5
+ const version = "1.3.40";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -43,7 +43,7 @@ const colors = {
43
43
  },
44
44
  danger: {
45
45
  DEFAULT: "#F25555",
46
- 50: "#FEF2F2",
46
+ 50: "#FF808E",
47
47
  100: "#FF808E",
48
48
  400: "#FF808E",
49
49
  500: "#F25555",
@@ -51,7 +51,7 @@ const colors = {
51
51
  },
52
52
  success: {
53
53
  DEFAULT: "#3FB061",
54
- 50: "#F0FDF4",
54
+ 50: "#E7F8D7",
55
55
  100: "#C6F2D3",
56
56
  400: "#C6F2D3",
57
57
  500: "#3FB061",
@@ -59,7 +59,7 @@ const colors = {
59
59
  },
60
60
  warning: {
61
61
  DEFAULT: "#FF9A35",
62
- 50: "#FFF3D2",
62
+ 50: "#FFC061",
63
63
  100: "#FFC061",
64
64
  400: "#FFC061",
65
65
  500: "#FF9A35",
@@ -164,6 +164,13 @@ const table = {
164
164
  }
165
165
  };
166
166
 
167
+ const alert = {
168
+ default: {
169
+ variant: "soft",
170
+ color: "primary"
171
+ }
172
+ };
173
+
167
174
  const module = defineNuxtModule({
168
175
  meta: {
169
176
  name,
@@ -195,10 +202,13 @@ const module = defineNuxtModule({
195
202
  ...colors
196
203
  };
197
204
  });
198
- await installModule("@nuxt/ui");
205
+ await installModule("@nuxt/ui", {
206
+ safelistColors: ["success", "secondary", "info", "danger", "warning"]
207
+ });
199
208
  nuxt.options.appConfig.ui = _merge(nuxt.options.appConfig.ui || {}, {
200
209
  table,
201
- pagination
210
+ pagination,
211
+ alert
202
212
  });
203
213
  nuxt.options.appConfig.ui.strategy = "override";
204
214
  nuxt.options.runtimeConfig = _deepMerge(
@@ -265,6 +275,14 @@ const module = defineNuxtModule({
265
275
  },
266
276
  nuxt.options.app
267
277
  );
278
+ nuxt.options.colorMode = _deepMerge(
279
+ {},
280
+ {
281
+ preference: "light"
282
+ },
283
+ nuxt.options.colorMode
284
+ );
285
+ nuxt.options.devtools = _deepMerge({}, { enabled: true }, nuxt.options.devtools);
268
286
  await installModule("@pinia/nuxt");
269
287
  await installModule("@vee-validate/nuxt", {
270
288
  // disable or enable auto imports
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <UAlert v-bind="$props">
3
+ <template #title><slot name="title" /></template>
4
+ <template #description><slot name="description" /></template>
5
+ </UAlert>
6
+ </template>
7
+ <script lang="ts" setup>
8
+ import { type PropType } from 'vue'
9
+ import { type AlertColor, type AlertVariant, type Avatar, type Button } from '#ui/types'
10
+ import type { Strategy } from '#core/types/utils'
11
+ import { alert } from '#ui/ui.config'
12
+ // @ts-expect-error
13
+ import appConfig from '#build/app.config'
14
+
15
+ defineProps({
16
+ title: {
17
+ type: String,
18
+ required: true,
19
+ },
20
+ description: {
21
+ type: String,
22
+ default: null,
23
+ },
24
+ icon: {
25
+ type: String,
26
+ },
27
+ avatar: {
28
+ type: Object as PropType<Avatar>,
29
+ default: null,
30
+ },
31
+ closeButton: {
32
+ type: Object as PropType<Button>,
33
+ },
34
+ actions: {
35
+ // eslint-disable-next-line @typescript-eslint/ban-types
36
+ type: Array as PropType<Array<Button & { click?: Function }>>,
37
+ },
38
+ color: {
39
+ type: String as PropType<AlertColor>,
40
+ validator(value: string) {
41
+ return [...appConfig.ui.colors, ...Object.keys(alert.color)].includes(value)
42
+ },
43
+ },
44
+ variant: {
45
+ type: String as PropType<AlertVariant>,
46
+ validator(value: string) {
47
+ return [
48
+ ...Object.keys(alert.variant),
49
+ ...Object.values(alert.color).flatMap((value) => Object.keys(value)),
50
+ ].includes(value)
51
+ },
52
+ },
53
+ class: {
54
+ type: [String, Object, Array] as PropType<any>,
55
+ },
56
+ ui: {
57
+ type: Object as PropType<Partial<typeof alert> & { strategy?: Strategy }>,
58
+ default: () => ({}),
59
+ },
60
+ })
61
+ </script>
@@ -0,0 +1,3 @@
1
+ import type * as config from '#ui/ui.config';
2
+ import type { DeepPartial } from '#ui/types';
3
+ export declare const alert: DeepPartial<(typeof config)['alert']>;
@@ -0,0 +1,6 @@
1
+ export const alert = {
2
+ default: {
3
+ variant: "soft",
4
+ color: "primary"
5
+ }
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.39",
3
+ "version": "1.3.40",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",