@ruixinkeji/prism-ui 1.0.0 → 1.0.2
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 +1 -1
- package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
- package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
- package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
- package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
- package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
- package/components/PrismCode/PrismCode.vue +749 -749
- package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
- package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
- package/components/PrismDropdown/PrismDropdown.vue +77 -77
- package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
- package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
- package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
- package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
- package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
- package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
- package/components/PrismNavBar/PrismNavBar.vue +199 -199
- package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
- package/components/PrismSticky/PrismSticky.vue +173 -173
- package/components/PrismSwiper/PrismSwiper.vue +338 -338
- package/components/PrismSwitch/PrismSwitch.vue +202 -202
- package/components/PrismTabBar/PrismTabBar.vue +147 -147
- package/components/PrismTabs/PrismTabs.vue +49 -49
- package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
- package/fonts/fa-brands-400.woff2 +0 -0
- package/fonts/fa-regular-400.woff2 +0 -0
- package/fonts/fa-solid-900.woff2 +0 -0
- package/fonts/fa-v4compatibility.woff2 +0 -0
- package/fonts/font-awesome.css +913 -0
- package/fonts/iconfont.woff2 +0 -0
- package/package.json +7 -1
- package/store/app.d.ts +21 -0
- package/store/app.js +68 -0
- package/styles/base.scss +2 -2
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruixinkeji/prism-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Prism UI - 现代化玻璃态设计 uni-app 组件库",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"styles",
|
|
10
10
|
"theme",
|
|
11
11
|
"components",
|
|
12
|
+
"fonts",
|
|
13
|
+
"store",
|
|
12
14
|
"index.js",
|
|
13
15
|
"index.esm.js",
|
|
14
16
|
"index.d.ts",
|
|
@@ -46,10 +48,14 @@
|
|
|
46
48
|
"url": "https://github.com/ruixin/prism-ui/issues"
|
|
47
49
|
},
|
|
48
50
|
"peerDependencies": {
|
|
51
|
+
"pinia": "^2.0.0",
|
|
49
52
|
"sass": "^1.0.0",
|
|
50
53
|
"vue": "^3.0.0"
|
|
51
54
|
},
|
|
52
55
|
"peerDependenciesMeta": {
|
|
56
|
+
"pinia": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
53
59
|
"sass": {
|
|
54
60
|
"optional": false
|
|
55
61
|
}
|
package/store/app.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoreDefinition } from 'pinia';
|
|
2
|
+
|
|
3
|
+
export interface AppState {
|
|
4
|
+
themeMode: 'light' | 'dark' | 'system';
|
|
5
|
+
systemTheme: 'light' | 'dark';
|
|
6
|
+
statusBarHeight: number;
|
|
7
|
+
menuButtonBounds: UniApp.GetMenuButtonBoundingClientRectRes | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AppGetters {
|
|
11
|
+
isDarkMode: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AppActions {
|
|
15
|
+
updateThemeStyle(): void;
|
|
16
|
+
setThemeMode(mode: 'light' | 'dark' | 'system'): void;
|
|
17
|
+
toggleTheme(): void;
|
|
18
|
+
initTheme(): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const useAppStore: StoreDefinition<'app', AppState, AppGetters, AppActions>;
|
package/store/app.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
export const useAppStore = defineStore('app', {
|
|
4
|
+
state: () => ({
|
|
5
|
+
themeMode: 'system',
|
|
6
|
+
systemTheme: 'light',
|
|
7
|
+
statusBarHeight: 0,
|
|
8
|
+
menuButtonBounds: null
|
|
9
|
+
}),
|
|
10
|
+
|
|
11
|
+
getters: {
|
|
12
|
+
isDarkMode: (state) => {
|
|
13
|
+
if (state.themeMode === 'system') {
|
|
14
|
+
return state.systemTheme === 'dark';
|
|
15
|
+
}
|
|
16
|
+
return state.themeMode === 'dark';
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
actions: {
|
|
21
|
+
updateThemeStyle() {
|
|
22
|
+
const isDark = this.isDarkMode;
|
|
23
|
+
const htmlElement = document.documentElement;
|
|
24
|
+
const bodyElement = document.body;
|
|
25
|
+
const bgColor = isDark ? '#121212' : '#F5F7FA';
|
|
26
|
+
|
|
27
|
+
if (isDark) {
|
|
28
|
+
htmlElement.classList.add('dark-mode');
|
|
29
|
+
} else {
|
|
30
|
+
htmlElement.classList.remove('dark-mode');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
htmlElement.style.backgroundColor = bgColor;
|
|
34
|
+
bodyElement.style.backgroundColor = bgColor;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
setThemeMode(mode) {
|
|
38
|
+
this.themeMode = mode;
|
|
39
|
+
uni.setStorageSync('prism_theme_mode', mode);
|
|
40
|
+
this.updateThemeStyle();
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
toggleTheme() {
|
|
44
|
+
const modes = ['light', 'dark', 'system'];
|
|
45
|
+
const currentIndex = modes.indexOf(this.themeMode);
|
|
46
|
+
const nextIndex = (currentIndex + 1) % modes.length;
|
|
47
|
+
this.setThemeMode(modes[nextIndex]);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
initTheme() {
|
|
51
|
+
const savedMode = uni.getStorageSync('prism_theme_mode');
|
|
52
|
+
if (savedMode) {
|
|
53
|
+
this.themeMode = savedMode;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const systemInfo = uni.getSystemInfoSync();
|
|
57
|
+
this.statusBarHeight = systemInfo.statusBarHeight || 0;
|
|
58
|
+
this.systemTheme = systemInfo.theme || 'light';
|
|
59
|
+
|
|
60
|
+
uni.onThemeChange((res) => {
|
|
61
|
+
this.systemTheme = res.theme;
|
|
62
|
+
this.updateThemeStyle();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
this.updateThemeStyle();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
package/styles/base.scss
CHANGED
|
@@ -131,7 +131,7 @@ uni-page-wrapper, uni-page-body {
|
|
|
131
131
|
/* #endif */
|
|
132
132
|
|
|
133
133
|
/* -------------------- 页面容器 -------------------- */
|
|
134
|
-
.page
|
|
134
|
+
.prism-page {
|
|
135
135
|
width: 100%;
|
|
136
136
|
min-height: 100vh;
|
|
137
137
|
background: var(--prism-bg-color-page);
|
|
@@ -139,7 +139,7 @@ uni-page-wrapper, uni-page-body {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/* -------------------- 主内容区(scroll-view) -------------------- */
|
|
142
|
-
.main
|
|
142
|
+
.prism-main {
|
|
143
143
|
height: 100vh;
|
|
144
144
|
box-sizing: border-box;
|
|
145
145
|
background: var(--prism-bg-color-page);
|