@ruixinkeji/prism-ui 1.0.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.
Files changed (48) hide show
  1. package/README.md +141 -0
  2. package/components/PrismAIAssist/PrismAIAssist.vue +98 -0
  3. package/components/PrismAddressInput/PrismAddressInput.vue +597 -0
  4. package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -0
  5. package/components/PrismCityPicker/PrismCityPicker.vue +1008 -0
  6. package/components/PrismCitySelect/PrismCitySelect.vue +435 -0
  7. package/components/PrismCode/PrismCode.vue +749 -0
  8. package/components/PrismCodeInput/PrismCodeInput.vue +156 -0
  9. package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -0
  10. package/components/PrismDropdown/PrismDropdown.vue +77 -0
  11. package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -0
  12. package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -0
  13. package/components/PrismImagePicker/PrismImagePicker.vue +457 -0
  14. package/components/PrismIndexBar/PrismIndexBar.vue +243 -0
  15. package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -0
  16. package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -0
  17. package/components/PrismNavBar/PrismNavBar.vue +199 -0
  18. package/components/PrismSecureInput/PrismSecureInput.vue +360 -0
  19. package/components/PrismSticky/PrismSticky.vue +173 -0
  20. package/components/PrismSwiper/PrismSwiper.vue +339 -0
  21. package/components/PrismSwitch/PrismSwitch.vue +202 -0
  22. package/components/PrismTabBar/PrismTabBar.vue +147 -0
  23. package/components/PrismTabs/PrismTabs.vue +49 -0
  24. package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -0
  25. package/index.d.ts +24 -0
  26. package/index.esm.js +25 -0
  27. package/index.js +25 -0
  28. package/package.json +89 -0
  29. package/styles/base.scss +227 -0
  30. package/styles/button.scss +120 -0
  31. package/styles/card.scss +306 -0
  32. package/styles/colors.scss +877 -0
  33. package/styles/data.scss +1229 -0
  34. package/styles/effects.scss +407 -0
  35. package/styles/feedback.scss +698 -0
  36. package/styles/form.scss +1574 -0
  37. package/styles/index.scss +46 -0
  38. package/styles/list.scss +184 -0
  39. package/styles/navigation.scss +554 -0
  40. package/styles/overlay.scss +182 -0
  41. package/styles/utilities.scss +134 -0
  42. package/styles/variables.scss +138 -0
  43. package/theme/blue.scss +36 -0
  44. package/theme/cyan.scss +32 -0
  45. package/theme/green.scss +32 -0
  46. package/theme/orange.scss +32 -0
  47. package/theme/purple.scss +32 -0
  48. package/theme/red.scss +32 -0
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # Prism UI
2
+
3
+ 现代化玻璃态设计 uni-app 组件库
4
+
5
+ ## 特性
6
+
7
+ - 玻璃态设计风格
8
+ - 深色/浅色主题自动切换
9
+ - 14 种颜色 + 5 种形态
10
+ - 原子化 CSS 类
11
+ - H5/小程序/App 多端支持
12
+
13
+ ## 安装
14
+
15
+ ```bash
16
+ npm install @ruixin/prism-ui
17
+ ```
18
+
19
+ ## 使用
20
+
21
+ ```scss
22
+ // main.js 或 App.vue
23
+ @import "@/styles/index.scss";
24
+ ```
25
+
26
+ ## 深色模式
27
+
28
+ ```vue
29
+ <view :class="{ 'dark-mode': isDark }">
30
+ <!-- 内容自动适配深色模式 -->
31
+ </view>
32
+ ```
33
+
34
+ ## 组件
35
+
36
+ ### 按钮
37
+
38
+ ```html
39
+ <!-- 颜色:primary / success / warning / danger / blue / green / purple 等 -->
40
+ <button class="prism-btn primary">主题色</button>
41
+ <button class="prism-btn success">成功</button>
42
+ <button class="prism-btn danger">危险</button>
43
+
44
+ <!-- 形态:solid / gradient / glass / outline -->
45
+ <button class="prism-btn primary solid">实心</button>
46
+ <button class="prism-btn primary gradient">渐变</button>
47
+ <button class="prism-btn primary glass">玻璃</button>
48
+ <button class="prism-btn primary outline">轮廓</button>
49
+
50
+ <!-- 尺寸:xs / sm / md / lg / xl -->
51
+ <button class="prism-btn primary md">中等</button>
52
+ <button class="prism-btn primary lg">大号</button>
53
+ ```
54
+
55
+ ### 卡片
56
+
57
+ ```html
58
+ <view class="prism-card">普通卡片</view>
59
+ <view class="prism-card glass">玻璃卡片</view>
60
+ <view class="prism-card primary gradient">渐变卡片</view>
61
+ ```
62
+
63
+ ### 图标
64
+
65
+ ```html
66
+ <!-- 图标容器 -->
67
+ <view class="prism-icon blue">
68
+ <text class="fa fa-home"></text>
69
+ </view>
70
+
71
+ <!-- 图标按钮 -->
72
+ <view class="prism-icon-btn primary">
73
+ <text class="fa fa-plus"></text>
74
+ </view>
75
+ ```
76
+
77
+ ### 表单
78
+
79
+ ```html
80
+ <view class="prism-input-box">
81
+ <input placeholder="请输入" />
82
+ </view>
83
+ <view class="prism-checkbox checked"></view>
84
+ <view class="prism-switch active"></view>
85
+ ```
86
+
87
+ ### 数据展示
88
+
89
+ ```html
90
+ <view class="prism-avatar md"></view>
91
+ <view class="prism-badge">99</view>
92
+ <view class="prism-progress">
93
+ <view class="progress-bar" style="width:60%"></view>
94
+ </view>
95
+ ```
96
+
97
+ ## 颜色系统
98
+
99
+ ### 14 种颜色
100
+
101
+ purple / blue / green / red / orange / cyan / yellow / pink / magenta / indigo / teal / violet / rose / ai
102
+
103
+ ### 语义化别名
104
+
105
+ - `primary` → 主题色(跟随 theme 设置)
106
+ - `success` → 绿色
107
+ - `warning` → 橙色
108
+ - `danger` → 红色
109
+ - `info` → 青色
110
+
111
+ ### 5 种形态
112
+
113
+ - 默认 - 自适应深浅模式
114
+ - `solid` - 实心
115
+ - `gradient` - 渐变
116
+ - `glass` - 玻璃态
117
+ - `outline` - 轮廓
118
+
119
+ ## 主题切换
120
+
121
+ 修改 `src/styles/variables.scss` 中的引入:
122
+
123
+ ```scss
124
+ // 可选:blue / green / purple / orange / red / cyan
125
+ @import '../theme/blue.scss';
126
+ ```
127
+
128
+ ## CSS 变量
129
+
130
+ ```scss
131
+ --prism-primary-color // 主题色
132
+ --prism-bg-color-card // 卡片背景
133
+ --prism-bg-color-page // 页面背景
134
+ --prism-text-primary // 主要文字
135
+ --prism-text-secondary // 次要文字
136
+ --prism-border-color-light // 边框颜色
137
+ ```
138
+
139
+ ## License
140
+
141
+ MIT
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <view class="prism-ai-assist" :class="{ 'dark-mode': appStore.isDarkMode }">
3
+ <view class="ai-btn" :class="{ 'loading': isLoading }" @click="handleClick">
4
+ <text class="fa" :class="isLoading ? 'fa-spinner fa-spin' : 'fa-wand-magic-sparkles'"></text>
5
+ <text class="ai-text">{{ isLoading ? loadingText : text }}</text>
6
+ </view>
7
+ </view>
8
+ </template>
9
+
10
+ <script setup>
11
+ import { ref } from 'vue';
12
+ import { useAppStore } from '@/store/app';
13
+
14
+ const props = defineProps({
15
+ text: {
16
+ type: String,
17
+ default: 'AI帮我完善'
18
+ },
19
+ loadingText: {
20
+ type: String,
21
+ default: 'AI优化中...'
22
+ }
23
+ });
24
+
25
+ const emit = defineEmits(['click']);
26
+
27
+ const appStore = useAppStore();
28
+ const isLoading = ref(false);
29
+
30
+ function handleClick() {
31
+ if (isLoading.value) return;
32
+ emit('click', {
33
+ setLoading: (val) => {
34
+ isLoading.value = val;
35
+ }
36
+ });
37
+ }
38
+
39
+ // 暴露方法给父组件
40
+ defineExpose({
41
+ setLoading: (val) => {
42
+ isLoading.value = val;
43
+ }
44
+ });
45
+ </script>
46
+
47
+ <style lang="scss">
48
+ .prism-ai-assist {
49
+ display: inline-flex;
50
+
51
+ .ai-btn {
52
+ height: 64rpx;
53
+ padding: 0 4rpx;
54
+ background: transparent;
55
+ display: inline-flex;
56
+ align-items: center;
57
+ gap: 12rpx;
58
+ font-size: 30rpx;
59
+ font-weight: 700;
60
+ cursor: pointer;
61
+ transition: all 0.2s ease;
62
+
63
+ &:active {
64
+ opacity: 0.7;
65
+ transform: scale(0.98);
66
+ }
67
+
68
+ &.loading {
69
+ pointer-events: none;
70
+ }
71
+
72
+ .fa {
73
+ font-size: 36rpx;
74
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 25%, #c44569 50%, #764ba2 75%, #667eea 100%);
75
+ -webkit-background-clip: text;
76
+ -webkit-text-fill-color: transparent;
77
+ background-clip: text;
78
+ }
79
+
80
+ .ai-text {
81
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 25%, #c44569 50%, #764ba2 75%, #667eea 100%);
82
+ -webkit-background-clip: text;
83
+ -webkit-text-fill-color: transparent;
84
+ background-clip: text;
85
+ }
86
+ }
87
+ }
88
+
89
+ // 旋转动画
90
+ @keyframes fa-spin {
91
+ 0% { transform: rotate(0deg); }
92
+ 100% { transform: rotate(360deg); }
93
+ }
94
+
95
+ .fa-spin {
96
+ animation: fa-spin 1s infinite linear;
97
+ }
98
+ </style>