@oiij/naive-ui 0.0.2 → 0.0.3

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.
Files changed (39) hide show
  1. package/README.md +2 -15
  2. package/dist/_virtual/rolldown_runtime.cjs +30 -0
  3. package/dist/components/_utils/cssr-bem.d.ts +1 -0
  4. package/dist/components/_utils/index.d.ts +3 -0
  5. package/dist/components/_utils/prismjs.d.ts +1 -0
  6. package/dist/components/_utils/transition.cssr.d.ts +10 -0
  7. package/dist/components/bubble/Bubble.vue.d.ts +26 -0
  8. package/dist/components/bubble/bubble.cssr.d.ts +2 -0
  9. package/dist/components/bubble/index.d.ts +16 -0
  10. package/dist/components/config-providers/ConfigProviders.vue.d.ts +2 -20
  11. package/dist/components/config-providers/index.d.ts +19 -0
  12. package/dist/components/copy-button/CopyButton.vue.d.ts +3 -10
  13. package/dist/components/copy-button/index.d.ts +8 -0
  14. package/dist/components/icons/MageCopyFill.vue.d.ts +2 -0
  15. package/dist/components/icons/RiSearch2Line.vue.d.ts +2 -0
  16. package/dist/components/index.d.ts +2 -0
  17. package/dist/components/search-input/SearchInput.vue.d.ts +3 -10
  18. package/dist/components/search-input/index.d.ts +9 -0
  19. package/dist/components/tooltip-button/TooltipButton.vue.d.ts +3 -8
  20. package/dist/components/tooltip-button/index.d.ts +6 -0
  21. package/dist/components/type-writer/TypeWriter.vue.d.ts +17 -0
  22. package/dist/components/type-writer/index.d.ts +9 -0
  23. package/dist/components/type-writer/type-writer.cssr.d.ts +2 -0
  24. package/dist/components.cjs +38 -1
  25. package/dist/components.js +5578 -129
  26. package/dist/components.umd.cjs +38 -1
  27. package/dist/composables/useNaiveForm.cjs +61 -0
  28. package/dist/composables/useNaiveForm.d.cts +36 -0
  29. package/dist/composables/useNaiveForm.d.ts +36 -0
  30. package/dist/composables/useNaiveForm.js +60 -0
  31. package/dist/composables/useNaiveTheme.cjs +120 -0
  32. package/dist/composables/useNaiveTheme.d.cts +165 -0
  33. package/dist/composables/useNaiveTheme.d.ts +165 -0
  34. package/dist/composables/useNaiveTheme.js +119 -0
  35. package/dist/index.cjs +4 -181
  36. package/dist/index.d.cts +2 -50
  37. package/dist/index.d.ts +2 -50
  38. package/dist/index.js +2 -155
  39. package/package.json +26 -65
@@ -0,0 +1,119 @@
1
+ import { computed, ref, toValue, watchEffect } from "vue";
2
+ import { colord } from "colord";
3
+ import { darkTheme, dateEnUS, dateZhCN, enUS, zhCN } from "naive-ui";
4
+
5
+ //#region src/composables/useNaiveTheme.ts
6
+ function getStatusColor(color = "#ff461f") {
7
+ return {
8
+ color,
9
+ hover: colord(color).lighten(.1).toHex(),
10
+ pressed: colord(color).darken(.1).toHex(),
11
+ suppl: colord(color).lighten(.1).toHex()
12
+ };
13
+ }
14
+ const naiveLocaleMap = {
15
+ "zh-CN": {
16
+ name: "简体中文",
17
+ dateLocale: dateZhCN,
18
+ locale: zhCN
19
+ },
20
+ "en-US": {
21
+ name: "English",
22
+ dateLocale: dateEnUS,
23
+ locale: enUS
24
+ }
25
+ };
26
+ function getColors(color) {
27
+ const { primary, info, success, warning, error } = color;
28
+ return {
29
+ primary: getStatusColor(primary),
30
+ info: getStatusColor(info),
31
+ success: getStatusColor(success),
32
+ warning: getStatusColor(warning),
33
+ error: getStatusColor(error)
34
+ };
35
+ }
36
+ function useNaiveTheme(options) {
37
+ const { language, darkMode, color, globalThemeOverrides } = options ?? {};
38
+ const languageRef = ref(toValue(language));
39
+ watchEffect(() => {
40
+ languageRef.value = toValue(language);
41
+ });
42
+ const darkModeRef = ref(toValue(darkMode));
43
+ watchEffect(() => {
44
+ darkModeRef.value = toValue(darkMode);
45
+ });
46
+ const { common, Dialog,...extra } = globalThemeOverrides ?? {};
47
+ const colorRef = ref({
48
+ primary: "#64748B",
49
+ info: "#06b6d4",
50
+ success: "#10b981",
51
+ warning: "#fbbf24",
52
+ error: "#f43f5e",
53
+ ...color
54
+ });
55
+ function setColor(v) {
56
+ colorRef.value = v;
57
+ }
58
+ const theme = computed(() => {
59
+ return darkModeRef?.value ? darkTheme : void 0;
60
+ });
61
+ const themeOverrides = computed(() => {
62
+ const { primary, info, success, warning, error } = getColors(colorRef.value);
63
+ return {
64
+ common: {
65
+ bodyColor: darkModeRef?.value ? "#1f1f1f" : "#f5f5f5",
66
+ primaryColor: primary.color,
67
+ primaryColorHover: primary.hover,
68
+ primaryColorPressed: primary.pressed,
69
+ primaryColorSuppl: primary.suppl,
70
+ infoColor: info.color,
71
+ infoColorHover: info.hover,
72
+ infoColorPressed: info.pressed,
73
+ infoColorSuppl: info.suppl,
74
+ successColor: success.color,
75
+ successColorHover: success.hover,
76
+ successColorPressed: success.pressed,
77
+ successColorSuppl: success.suppl,
78
+ warningColor: warning.color,
79
+ warningColorHover: warning.hover,
80
+ warningColorPressed: warning.pressed,
81
+ warningColorSuppl: warning.suppl,
82
+ errorColor: error.color,
83
+ errorColorHover: error.hover,
84
+ errorColorPressed: error.pressed,
85
+ errorColorSuppl: error.suppl,
86
+ borderRadius: "6px",
87
+ ...common
88
+ },
89
+ Dialog: {
90
+ borderRadius: "12px",
91
+ padding: "20px",
92
+ closeMargin: "20px 20px 0 0",
93
+ ...Dialog
94
+ },
95
+ ...extra
96
+ };
97
+ });
98
+ const locale = computed(() => {
99
+ if (!languageRef?.value || !naiveLocaleMap[languageRef.value]) return naiveLocaleMap["zh-CN"].locale;
100
+ return naiveLocaleMap[languageRef.value].locale;
101
+ });
102
+ const dateLocale = computed(() => {
103
+ if (!languageRef?.value || !naiveLocaleMap[languageRef.value]) return naiveLocaleMap["zh-CN"].dateLocale;
104
+ return naiveLocaleMap[languageRef.value].dateLocale;
105
+ });
106
+ return {
107
+ language: languageRef,
108
+ darkMode: darkModeRef,
109
+ theme,
110
+ themeOverrides,
111
+ locale,
112
+ dateLocale,
113
+ color: colorRef,
114
+ setColor
115
+ };
116
+ }
117
+
118
+ //#endregion
119
+ export { useNaiveTheme };
package/dist/index.cjs CHANGED
@@ -1,182 +1,5 @@
1
- "use strict";
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
1
+ const require_useNaiveForm = require('./composables/useNaiveForm.cjs');
2
+ const require_useNaiveTheme = require('./composables/useNaiveTheme.cjs');
23
3
 
24
- //#endregion
25
- const vue = __toESM(require("vue"));
26
- const colord = __toESM(require("colord"));
27
- const naive_ui = __toESM(require("naive-ui"));
28
-
29
- //#region src/composables/useNaiveForm.ts
30
- function clearObjectValues(obj) {
31
- if (Array.isArray(obj)) {
32
- obj.length = 0;
33
- return obj;
34
- }
35
- if (typeof obj === "object" && obj !== null) {
36
- for (const key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) obj[key] = clearObjectValues(obj[key]);
37
- return obj;
38
- }
39
- if (typeof obj === "string") return "";
40
- if (typeof obj === "number") return 0;
41
- if (typeof obj === "boolean") return false;
42
- return obj;
43
- }
44
- function useNaiveForm(options) {
45
- const { value, rules } = options ?? {};
46
- const formValue = (0, vue.ref)(structuredClone(value));
47
- const formRules = rules;
48
- const formRef = (0, vue.ref)();
49
- const formProps = {
50
- ref: formRef,
51
- model: (0, vue.reactive)((0, vue.toValue)(formValue)),
52
- rules: formRules
53
- };
54
- function validate() {
55
- return formRef.value?.validate();
56
- }
57
- function resetValidation() {
58
- formRef.value?.restoreValidation();
59
- }
60
- function clear() {
61
- clearObjectValues(formValue.value);
62
- }
63
- function resetForm() {
64
- clear();
65
- Object.assign(formValue.value, structuredClone(value));
66
- }
67
- function reset() {
68
- resetValidation();
69
- resetForm();
70
- }
71
- return {
72
- formRef,
73
- formValue,
74
- rules: formRules,
75
- formProps,
76
- validate,
77
- resetValidation,
78
- resetForm,
79
- reset,
80
- clear
81
- };
82
- }
83
-
84
- //#endregion
85
- //#region src/composables/useNaiveTheme.ts
86
- function getStatusColor(color = "#ff461f") {
87
- return {
88
- color,
89
- hover: (0, colord.colord)(color).lighten(.1).toHex(),
90
- pressed: (0, colord.colord)(color).darken(.1).toHex(),
91
- suppl: (0, colord.colord)(color).lighten(.1).toHex()
92
- };
93
- }
94
- const naiveLocaleMap = {
95
- "zh-CN": {
96
- name: "简体中文",
97
- dateLocale: naive_ui.dateZhCN,
98
- locale: naive_ui.zhCN
99
- },
100
- "en-US": {
101
- name: "English",
102
- dateLocale: naive_ui.dateEnUS,
103
- locale: naive_ui.enUS
104
- }
105
- };
106
- function useNaiveTheme(darkMode, language, globalThemeOverrides) {
107
- const { common, Dialog,...extra } = globalThemeOverrides || {};
108
- const color = (0, vue.ref)({
109
- primary: "#64748B",
110
- info: "#06b6d4",
111
- success: "#10b981",
112
- warning: "#fbbf24",
113
- error: "#f43f5e"
114
- });
115
- function setColor(v) {
116
- color.value = v;
117
- }
118
- const theme = (0, vue.computed)(() => {
119
- return darkMode?.value ? naive_ui.darkTheme : void 0;
120
- });
121
- const themeOverrides = (0, vue.computed)(() => {
122
- const primary = getStatusColor(color.value.primary);
123
- const info = getStatusColor(color.value.info);
124
- const success = getStatusColor(color.value.success);
125
- const warning = getStatusColor(color.value.warning);
126
- const error = getStatusColor(color.value.error);
127
- return {
128
- common: {
129
- bodyColor: darkMode?.value ? "#1f1f1f" : "#f5f5f5",
130
- primaryColor: primary.color,
131
- primaryColorHover: primary.hover,
132
- primaryColorPressed: primary.pressed,
133
- primaryColorSuppl: primary.suppl,
134
- infoColor: info.color,
135
- infoColorHover: info.hover,
136
- infoColorPressed: info.pressed,
137
- infoColorSuppl: info.suppl,
138
- successColor: success.color,
139
- successColorHover: success.hover,
140
- successColorPressed: success.pressed,
141
- successColorSuppl: success.suppl,
142
- warningColor: warning.color,
143
- warningColorHover: warning.hover,
144
- warningColorPressed: warning.pressed,
145
- warningColorSuppl: warning.suppl,
146
- errorColor: error.color,
147
- errorColorHover: error.hover,
148
- errorColorPressed: error.pressed,
149
- errorColorSuppl: error.suppl,
150
- borderRadius: "6px",
151
- ...common
152
- },
153
- Dialog: {
154
- borderRadius: "12px",
155
- padding: "20px",
156
- closeMargin: "20px 20px 0 0",
157
- ...Dialog
158
- },
159
- ...extra
160
- };
161
- });
162
- const locale = (0, vue.computed)(() => {
163
- if (!language?.value || !naiveLocaleMap[language.value]) return naiveLocaleMap["zh-CN"].locale;
164
- return naiveLocaleMap[language.value].locale;
165
- });
166
- const dateLocale = (0, vue.computed)(() => {
167
- if (!language?.value || !naiveLocaleMap[language.value]) return naiveLocaleMap["zh-CN"].dateLocale;
168
- return naiveLocaleMap[language.value].dateLocale;
169
- });
170
- return {
171
- theme,
172
- themeOverrides,
173
- locale,
174
- dateLocale,
175
- color,
176
- setColor
177
- };
178
- }
179
-
180
- //#endregion
181
- exports.useNaiveForm = useNaiveForm
182
- exports.useNaiveTheme = useNaiveTheme
4
+ exports.useNaiveForm = require_useNaiveForm.useNaiveForm;
5
+ exports.useNaiveTheme = require_useNaiveTheme.useNaiveTheme;
package/dist/index.d.cts CHANGED
@@ -1,51 +1,3 @@
1
- import { ValidateError } from "async-validator";
2
- import { FormInst, FormItemRule, FormRules, GlobalThemeOverrides, NDateLocale, darkTheme, enUS, zhCN } from "naive-ui";
3
- import { ComputedRef, Reactive, Ref } from "vue";
4
-
5
- //#region src/composables/useNaiveForm.d.ts
6
- type ExtendsType = Record<string, unknown>;
7
- type NaiveFormRules<T extends ExtendsType> = Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
8
- interface NaiveFormOptions<T extends ExtendsType> {
9
- value?: T;
10
- rules?: NaiveFormRules<T>;
11
- }
12
- interface NaiveFormReturns<T extends ExtendsType> {
13
- formRef: Ref<FormInst | undefined>;
14
- formValue: Ref<T>;
15
- rules: NaiveFormRules<T>;
16
- formProps: {
17
- ref: Ref<FormInst | undefined>;
18
- model: Reactive<T>;
19
- rules: NaiveFormRules<T>;
20
- };
21
- validate: () => Promise<{
22
- warnings: ValidateError[][] | undefined;
23
- }> | undefined;
24
- resetValidation: () => void;
25
- resetForm: () => void;
26
- clear: () => void;
27
- reset: () => void;
28
- }
29
- declare function useNaiveForm<T extends ExtendsType>(options?: NaiveFormOptions<T>): NaiveFormReturns<T>;
30
-
31
- //#endregion
32
- //#region src/composables/useNaiveTheme.d.ts
33
- interface Color {
34
- primary: string;
35
- info: string;
36
- success: string;
37
- warning: string;
38
- error: string;
39
- }
40
- interface NaiveThemeReturns {
41
- theme: ComputedRef<typeof darkTheme | undefined>;
42
- themeOverrides: ComputedRef<GlobalThemeOverrides>;
43
- locale: ComputedRef<typeof zhCN | typeof enUS>;
44
- dateLocale: ComputedRef<NDateLocale>;
45
- color: Ref<Color>;
46
- setColor: (v: Color) => void;
47
- }
48
- declare function useNaiveTheme<T extends 'zh-CN' | 'en-US'>(darkMode?: ComputedRef<boolean> | Ref<boolean>, language?: ComputedRef<T> | Ref<T>, globalThemeOverrides?: GlobalThemeOverrides): NaiveThemeReturns;
49
-
50
- //#endregion
1
+ import { NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./composables/useNaiveForm.cjs";
2
+ import { NaiveThemeReturns, useNaiveTheme } from "./composables/useNaiveTheme.cjs";
51
3
  export { NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeReturns, useNaiveForm, useNaiveTheme };
package/dist/index.d.ts CHANGED
@@ -1,51 +1,3 @@
1
- import { ComputedRef, Reactive, Ref } from "vue";
2
- import { FormInst, FormItemRule, FormRules, GlobalThemeOverrides, NDateLocale, darkTheme, enUS, zhCN } from "naive-ui";
3
- import { ValidateError } from "async-validator";
4
-
5
- //#region src/composables/useNaiveForm.d.ts
6
- type ExtendsType = Record<string, unknown>;
7
- type NaiveFormRules<T extends ExtendsType> = Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>> | undefined;
8
- interface NaiveFormOptions<T extends ExtendsType> {
9
- value?: T;
10
- rules?: NaiveFormRules<T>;
11
- }
12
- interface NaiveFormReturns<T extends ExtendsType> {
13
- formRef: Ref<FormInst | undefined>;
14
- formValue: Ref<T>;
15
- rules: NaiveFormRules<T>;
16
- formProps: {
17
- ref: Ref<FormInst | undefined>;
18
- model: Reactive<T>;
19
- rules: NaiveFormRules<T>;
20
- };
21
- validate: () => Promise<{
22
- warnings: ValidateError[][] | undefined;
23
- }> | undefined;
24
- resetValidation: () => void;
25
- resetForm: () => void;
26
- clear: () => void;
27
- reset: () => void;
28
- }
29
- declare function useNaiveForm<T extends ExtendsType>(options?: NaiveFormOptions<T>): NaiveFormReturns<T>;
30
-
31
- //#endregion
32
- //#region src/composables/useNaiveTheme.d.ts
33
- interface Color {
34
- primary: string;
35
- info: string;
36
- success: string;
37
- warning: string;
38
- error: string;
39
- }
40
- interface NaiveThemeReturns {
41
- theme: ComputedRef<typeof darkTheme | undefined>;
42
- themeOverrides: ComputedRef<GlobalThemeOverrides>;
43
- locale: ComputedRef<typeof zhCN | typeof enUS>;
44
- dateLocale: ComputedRef<NDateLocale>;
45
- color: Ref<Color>;
46
- setColor: (v: Color) => void;
47
- }
48
- declare function useNaiveTheme<T extends 'zh-CN' | 'en-US'>(darkMode?: ComputedRef<boolean> | Ref<boolean>, language?: ComputedRef<T> | Ref<T>, globalThemeOverrides?: GlobalThemeOverrides): NaiveThemeReturns;
49
-
50
- //#endregion
1
+ import { NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./composables/useNaiveForm.js";
2
+ import { NaiveThemeReturns, useNaiveTheme } from "./composables/useNaiveTheme.js";
51
3
  export { NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeReturns, useNaiveForm, useNaiveTheme };
package/dist/index.js CHANGED
@@ -1,157 +1,4 @@
1
- import { computed, reactive, ref, toValue } from "vue";
2
- import { colord } from "colord";
3
- import { darkTheme, dateEnUS, dateZhCN, enUS, zhCN } from "naive-ui";
1
+ import { useNaiveForm } from "./composables/useNaiveForm.js";
2
+ import { useNaiveTheme } from "./composables/useNaiveTheme.js";
4
3
 
5
- //#region src/composables/useNaiveForm.ts
6
- function clearObjectValues(obj) {
7
- if (Array.isArray(obj)) {
8
- obj.length = 0;
9
- return obj;
10
- }
11
- if (typeof obj === "object" && obj !== null) {
12
- for (const key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) obj[key] = clearObjectValues(obj[key]);
13
- return obj;
14
- }
15
- if (typeof obj === "string") return "";
16
- if (typeof obj === "number") return 0;
17
- if (typeof obj === "boolean") return false;
18
- return obj;
19
- }
20
- function useNaiveForm(options) {
21
- const { value, rules } = options ?? {};
22
- const formValue = ref(structuredClone(value));
23
- const formRules = rules;
24
- const formRef = ref();
25
- const formProps = {
26
- ref: formRef,
27
- model: reactive(toValue(formValue)),
28
- rules: formRules
29
- };
30
- function validate() {
31
- return formRef.value?.validate();
32
- }
33
- function resetValidation() {
34
- formRef.value?.restoreValidation();
35
- }
36
- function clear() {
37
- clearObjectValues(formValue.value);
38
- }
39
- function resetForm() {
40
- clear();
41
- Object.assign(formValue.value, structuredClone(value));
42
- }
43
- function reset() {
44
- resetValidation();
45
- resetForm();
46
- }
47
- return {
48
- formRef,
49
- formValue,
50
- rules: formRules,
51
- formProps,
52
- validate,
53
- resetValidation,
54
- resetForm,
55
- reset,
56
- clear
57
- };
58
- }
59
-
60
- //#endregion
61
- //#region src/composables/useNaiveTheme.ts
62
- function getStatusColor(color = "#ff461f") {
63
- return {
64
- color,
65
- hover: colord(color).lighten(.1).toHex(),
66
- pressed: colord(color).darken(.1).toHex(),
67
- suppl: colord(color).lighten(.1).toHex()
68
- };
69
- }
70
- const naiveLocaleMap = {
71
- "zh-CN": {
72
- name: "简体中文",
73
- dateLocale: dateZhCN,
74
- locale: zhCN
75
- },
76
- "en-US": {
77
- name: "English",
78
- dateLocale: dateEnUS,
79
- locale: enUS
80
- }
81
- };
82
- function useNaiveTheme(darkMode, language, globalThemeOverrides) {
83
- const { common, Dialog,...extra } = globalThemeOverrides || {};
84
- const color = ref({
85
- primary: "#64748B",
86
- info: "#06b6d4",
87
- success: "#10b981",
88
- warning: "#fbbf24",
89
- error: "#f43f5e"
90
- });
91
- function setColor(v) {
92
- color.value = v;
93
- }
94
- const theme = computed(() => {
95
- return darkMode?.value ? darkTheme : void 0;
96
- });
97
- const themeOverrides = computed(() => {
98
- const primary = getStatusColor(color.value.primary);
99
- const info = getStatusColor(color.value.info);
100
- const success = getStatusColor(color.value.success);
101
- const warning = getStatusColor(color.value.warning);
102
- const error = getStatusColor(color.value.error);
103
- return {
104
- common: {
105
- bodyColor: darkMode?.value ? "#1f1f1f" : "#f5f5f5",
106
- primaryColor: primary.color,
107
- primaryColorHover: primary.hover,
108
- primaryColorPressed: primary.pressed,
109
- primaryColorSuppl: primary.suppl,
110
- infoColor: info.color,
111
- infoColorHover: info.hover,
112
- infoColorPressed: info.pressed,
113
- infoColorSuppl: info.suppl,
114
- successColor: success.color,
115
- successColorHover: success.hover,
116
- successColorPressed: success.pressed,
117
- successColorSuppl: success.suppl,
118
- warningColor: warning.color,
119
- warningColorHover: warning.hover,
120
- warningColorPressed: warning.pressed,
121
- warningColorSuppl: warning.suppl,
122
- errorColor: error.color,
123
- errorColorHover: error.hover,
124
- errorColorPressed: error.pressed,
125
- errorColorSuppl: error.suppl,
126
- borderRadius: "6px",
127
- ...common
128
- },
129
- Dialog: {
130
- borderRadius: "12px",
131
- padding: "20px",
132
- closeMargin: "20px 20px 0 0",
133
- ...Dialog
134
- },
135
- ...extra
136
- };
137
- });
138
- const locale = computed(() => {
139
- if (!language?.value || !naiveLocaleMap[language.value]) return naiveLocaleMap["zh-CN"].locale;
140
- return naiveLocaleMap[language.value].locale;
141
- });
142
- const dateLocale = computed(() => {
143
- if (!language?.value || !naiveLocaleMap[language.value]) return naiveLocaleMap["zh-CN"].dateLocale;
144
- return naiveLocaleMap[language.value].dateLocale;
145
- });
146
- return {
147
- theme,
148
- themeOverrides,
149
- locale,
150
- dateLocale,
151
- color,
152
- setColor
153
- };
154
- }
155
-
156
- //#endregion
157
4
  export { useNaiveForm, useNaiveTheme };
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@oiij/naive-ui",
3
3
  "type": "module",
4
- "version": "0.0.2",
5
- "description": "",
4
+ "version": "0.0.3",
5
+ "description": "Som Composable Functions And Components for Vue 3",
6
6
  "author": "oiij",
7
7
  "license": "MIT",
8
- "homepage": "https://github.com/oiij/naive-ui",
8
+ "homepage": "https://github.com/oiij/use",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git@github.com:oiij/naive-ui.git"
11
+ "url": "git@github.com:oiij/use.git"
12
12
  },
13
- "bugs": "https://github.com/oiij/naive-ui/issues",
13
+ "bugs": "https://github.com/oiij/use/issues",
14
14
  "keywords": [
15
+ "@oiij/use",
15
16
  "naive-ui"
16
17
  ],
17
18
  "sideEffects": false,
@@ -36,76 +37,36 @@
36
37
  "dist",
37
38
  "package.json"
38
39
  ],
39
- "scripts": {
40
- "dev": "tsdown --watch",
41
- "dev:vite": "vite build --watch",
42
- "build": "vue-tsc --noEmit && tsdown && vite build",
43
- "docs:dev": "vitepress dev docs",
44
- "docs:build": "vitepress build docs",
45
- "docs:preview": "vitepress preview docs",
46
- "lint": "eslint .",
47
- "lint:fix": "eslint . --fix",
48
- "prepublishOnly": "pnpm build",
49
- "release": "bumpp && npm publish",
50
- "awe": "pnpx are-we-esm",
51
- "nmi": "pnpx node-modules-inspector",
52
- "start": "esno src/index.ts",
53
- "test": "vitest",
54
- "update:deps": "taze -w && pnpm i",
55
- "type:check": "vue-tsc --noEmit",
56
- "cz": "czg",
57
- "commit": "git pull && git add -A && pnpm cz && git push",
58
- "link": "pnpm link --global",
59
- "preinstall": "npx only-allow pnpm"
60
- },
61
40
  "peerDependencies": {
62
41
  "@vueuse/core": "^13.1.0",
63
42
  "async-validator": "^4.2.5",
64
43
  "colord": "^2.9.3",
65
44
  "naive-ui": "^2.41.0",
66
- "radash": "^12.1.0",
67
- "vue": "^3.5.13"
45
+ "prismjs": "^1.30.0",
46
+ "vue": "^3.5.13",
47
+ "@oiij/markdown-it": "0.0.2",
48
+ "@oiij/css-render": "0.0.1",
49
+ "@oiij/use": "0.0.15"
68
50
  },
69
51
  "devDependencies": {
70
- "@antfu/eslint-config": "^4.13.0",
71
- "@oiij/tsconfig": "^0.0.1",
72
- "@types/node": "^22.15.16",
73
- "@vitejs/plugin-vue": "^5.2.3",
74
- "@vitest/ui": "^3.1.3",
75
- "@vueuse/core": "^13.1.0",
52
+ "@types/prismjs": "^1.26.5",
53
+ "@vueuse/core": "^13.3.0",
76
54
  "async-validator": "^4.2.5",
77
- "bumpp": "^10.1.0",
78
55
  "colord": "^2.9.3",
79
- "commitlint": "^19.8.1",
80
- "cz-git": "^1.11.1",
81
- "czg": "^1.11.1",
82
- "eslint": "^9.26.0",
83
- "eslint-plugin-format": "^1.0.1",
84
- "esno": "^4.8.0",
85
- "lint-staged": "^15.5.2",
86
- "naive-ui": "^2.41.0",
87
- "radash": "^12.1.0",
88
- "simple-git-hooks": "^2.13.0",
89
- "taze": "^19.1.0",
90
- "tsdown": "^0.11.1",
91
- "typescript": "^5.8.3",
92
- "vite": "^6.3.5",
93
- "vite-plugin-dts": "^4.5.3",
94
- "vitepress": "^1.6.3",
95
- "vitepress-demo-plugin": "^1.4.1",
96
- "vitest": "^3.1.3",
97
- "vue": "^3.5.13",
98
- "vue-tsc": "^2.2.10"
99
- },
100
- "simple-git-hooks": {
101
- "pre-commit": "pnpm lint-staged && pnpm type:check"
102
- },
103
- "lint-staged": {
104
- "*.{js,jsx,ts,tsx}": [
105
- "pnpm lint:fix"
106
- ]
56
+ "naive-ui": "^2.41.1",
57
+ "prismjs": "^1.30.0",
58
+ "vue": "^3.5.16",
59
+ "@oiij/css-render": "0.0.1",
60
+ "@oiij/use": "0.0.15",
61
+ "@oiij/markdown-it": "0.0.2"
107
62
  },
108
63
  "publishConfig": {
109
64
  "access": "public"
65
+ },
66
+ "scripts": {
67
+ "dev": "tsdown --watch",
68
+ "dev:vite": "vite build --watch",
69
+ "build": "vue-tsc --noEmit && tsdown && vite build",
70
+ "bumpp": "bumpp --no-push"
110
71
  }
111
- }
72
+ }