muzhiyu-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 (96) hide show
  1. package/README.md +202 -0
  2. package/components/muzhiyu/mu-action-sheet/mu-action-sheet.vue +335 -0
  3. package/components/muzhiyu/mu-alert/mu-alert.vue +220 -0
  4. package/components/muzhiyu/mu-back-top/mu-back-top.vue +161 -0
  5. package/components/muzhiyu/mu-badge/mu-badge.vue +150 -0
  6. package/components/muzhiyu/mu-barcode/mu-barcode.vue +100 -0
  7. package/components/muzhiyu/mu-blank/mu-blank.vue +30 -0
  8. package/components/muzhiyu/mu-bottom-nav/mu-bottom-nav.vue +331 -0
  9. package/components/muzhiyu/mu-bubble/mu-bubble.vue +316 -0
  10. package/components/muzhiyu/mu-button/mu-button.vue +431 -0
  11. package/components/muzhiyu/mu-calendar/mu-calendar.vue +429 -0
  12. package/components/muzhiyu/mu-car-input/mu-car-input.vue +209 -0
  13. package/components/muzhiyu/mu-card/mu-card.vue +317 -0
  14. package/components/muzhiyu/mu-cascader/mu-cascader.vue +336 -0
  15. package/components/muzhiyu/mu-cell/mu-cell.vue +368 -0
  16. package/components/muzhiyu/mu-checkbox/mu-checkbox.vue +116 -0
  17. package/components/muzhiyu/mu-checkbox-group/mu-checkbox-group.vue +40 -0
  18. package/components/muzhiyu/mu-code-input/mu-code-input.vue +264 -0
  19. package/components/muzhiyu/mu-collapse/mu-collapse.vue +316 -0
  20. package/components/muzhiyu/mu-color-picker/mu-color-picker.vue +466 -0
  21. package/components/muzhiyu/mu-config/index.js +34 -0
  22. package/components/muzhiyu/mu-config/mu-config.vue +54 -0
  23. package/components/muzhiyu/mu-countdown/mu-countdown.vue +338 -0
  24. package/components/muzhiyu/mu-cropper/mu-cropper.vue +415 -0
  25. package/components/muzhiyu/mu-date-picker/mu-date-picker.vue +290 -0
  26. package/components/muzhiyu/mu-datetime/mu-datetime.vue +262 -0
  27. package/components/muzhiyu/mu-divider/mu-divider.vue +229 -0
  28. package/components/muzhiyu/mu-drawer/mu-drawer.vue +172 -0
  29. package/components/muzhiyu/mu-dropdown/mu-dropdown.vue +215 -0
  30. package/components/muzhiyu/mu-dropdown-top/mu-dropdown-top.vue +243 -0
  31. package/components/muzhiyu/mu-empty/mu-empty.vue +217 -0
  32. package/components/muzhiyu/mu-fab/mu-fab.vue +324 -0
  33. package/components/muzhiyu/mu-footer/mu-footer.vue +21 -0
  34. package/components/muzhiyu/mu-form/mu-form.vue +170 -0
  35. package/components/muzhiyu/mu-grid/mu-grid.vue +95 -0
  36. package/components/muzhiyu/mu-grid-item/mu-grid-item.vue +247 -0
  37. package/components/muzhiyu/mu-html/mu-html.vue +145 -0
  38. package/components/muzhiyu/mu-icon/mu-icon.vue +822 -0
  39. package/components/muzhiyu/mu-image-grid/mu-image-grid.vue +225 -0
  40. package/components/muzhiyu/mu-image-preview/mu-image-preview.vue +286 -0
  41. package/components/muzhiyu/mu-index-list/mu-index-list.vue +381 -0
  42. package/components/muzhiyu/mu-input/mu-input.vue +570 -0
  43. package/components/muzhiyu/mu-input-number/mu-input-number.vue +193 -0
  44. package/components/muzhiyu/mu-keyboard/mu-keyboard.vue +415 -0
  45. package/components/muzhiyu/mu-list/mu-list.vue +89 -0
  46. package/components/muzhiyu/mu-loading/mu-loading.vue +124 -0
  47. package/components/muzhiyu/mu-loading-page/mu-loading-page.vue +529 -0
  48. package/components/muzhiyu/mu-loadmore/mu-loadmore.vue +26 -0
  49. package/components/muzhiyu/mu-modal/mu-modal.vue +298 -0
  50. package/components/muzhiyu/mu-navbar/mu-navbar.vue +223 -0
  51. package/components/muzhiyu/mu-nomore/mu-nomore.vue +107 -0
  52. package/components/muzhiyu/mu-notice-bar/mu-notice-bar.vue +284 -0
  53. package/components/muzhiyu/mu-notify/mu-notify.vue +202 -0
  54. package/components/muzhiyu/mu-overlay/mu-overlay.vue +94 -0
  55. package/components/muzhiyu/mu-pagination/mu-pagination.vue +330 -0
  56. package/components/muzhiyu/mu-password-input/mu-password-input.vue +119 -0
  57. package/components/muzhiyu/mu-picker/mu-picker.vue +297 -0
  58. package/components/muzhiyu/mu-popup/mu-popup.vue +297 -0
  59. package/components/muzhiyu/mu-progress/mu-progress.vue +156 -0
  60. package/components/muzhiyu/mu-pull-refresh/mu-pull-refresh.vue +54 -0
  61. package/components/muzhiyu/mu-qrcode/mu-qrcode.vue +340 -0
  62. package/components/muzhiyu/mu-qrcode/qrcode.js +2237 -0
  63. package/components/muzhiyu/mu-radio/mu-radio.vue +125 -0
  64. package/components/muzhiyu/mu-radio-group/mu-radio-group.vue +37 -0
  65. package/components/muzhiyu/mu-rate/mu-rate.vue +103 -0
  66. package/components/muzhiyu/mu-search/mu-search.vue +320 -0
  67. package/components/muzhiyu/mu-section/mu-section.vue +206 -0
  68. package/components/muzhiyu/mu-select/mu-select.vue +440 -0
  69. package/components/muzhiyu/mu-share-sheet/mu-share-sheet.vue +269 -0
  70. package/components/muzhiyu/mu-sidebar/mu-sidebar.vue +304 -0
  71. package/components/muzhiyu/mu-signature/mu-signature.vue +449 -0
  72. package/components/muzhiyu/mu-skeleton/mu-skeleton.vue +225 -0
  73. package/components/muzhiyu/mu-slider/mu-slider.vue +228 -0
  74. package/components/muzhiyu/mu-space/mu-space.vue +84 -0
  75. package/components/muzhiyu/mu-steps/mu-steps.vue +311 -0
  76. package/components/muzhiyu/mu-sticky/mu-sticky.vue +57 -0
  77. package/components/muzhiyu/mu-swipe-cell/mu-swipe-cell.vue +281 -0
  78. package/components/muzhiyu/mu-swiper/mu-swiper.vue +107 -0
  79. package/components/muzhiyu/mu-switch/mu-switch.vue +99 -0
  80. package/components/muzhiyu/mu-tabbar/mu-tabbar.vue +382 -0
  81. package/components/muzhiyu/mu-table/mu-table.vue +420 -0
  82. package/components/muzhiyu/mu-tabs/mu-tabs.vue +339 -0
  83. package/components/muzhiyu/mu-tag/mu-tag.vue +65 -0
  84. package/components/muzhiyu/mu-text-ellipsis/mu-text-ellipsis.vue +54 -0
  85. package/components/muzhiyu/mu-timeline/mu-timeline.vue +166 -0
  86. package/components/muzhiyu/mu-tips/mu-tips.vue +36 -0
  87. package/components/muzhiyu/mu-toast/mu-toast.vue +151 -0
  88. package/components/muzhiyu/mu-transfer/mu-transfer.vue +114 -0
  89. package/components/muzhiyu/mu-tree/mu-tree.vue +263 -0
  90. package/components/muzhiyu/mu-upload/mu-upload.vue +415 -0
  91. package/components/muzhiyu/mu-waterfall/mu-waterfall.vue +321 -0
  92. package/components/muzhiyu/mu-watermark/mu-watermark.vue +60 -0
  93. package/index.js +83 -0
  94. package/package.json +38 -0
  95. package/utils/index.js +600 -0
  96. package/utils/request.js +265 -0
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <view class="mu-radio" :class="{ 'mu-radio--disabled': disabled }" @tap="handleClick">
3
+ <view class="mu-radio__icon" :class="{ 'mu-radio__icon--checked': isChecked, 'mu-radio__icon--disabled': disabled }">
4
+ <view v-if="isChecked" class="mu-radio__icon-inner"></view>
5
+ </view>
6
+ <view v-if="label || $slots.default" class="mu-radio__label" :class="{ 'mu-radio__label--disabled': disabled }">
7
+ <slot><text class="mu-radio__label-text">{{ label }}</text></slot>
8
+ </view>
9
+ </view>
10
+ </template>
11
+
12
+ <script setup>
13
+ import { computed, inject } from 'vue'
14
+
15
+ const props = defineProps({
16
+ name: { type: [String, Number, Boolean], default: '' },
17
+ label: { type: String, default: '' },
18
+ disabled: { type: Boolean, default: false },
19
+ modelValue: { type: [String, Number, Boolean], default: '' }
20
+ })
21
+
22
+ const emit = defineEmits(['update:modelValue', 'change'])
23
+
24
+ const radioGroup = inject('mu-radio-group', inject('radioGroup', null))
25
+
26
+ const isChecked = computed(() => {
27
+ if (radioGroup) {
28
+ const groupVal = radioGroup.modelValue ? radioGroup.modelValue.value : null
29
+ return groupVal === props.name
30
+ }
31
+ return props.modelValue === props.name
32
+ })
33
+
34
+ function handleClick() {
35
+ if (props.disabled) return
36
+ if (radioGroup) {
37
+ radioGroup.changeValue(props.name)
38
+ } else {
39
+ emit('update:modelValue', props.name)
40
+ }
41
+ emit('change', props.name)
42
+ }
43
+ </script>
44
+
45
+ <style lang="scss" scoped>
46
+ @import "@/uni.scss";
47
+
48
+ .mu-radio {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ cursor: pointer;
52
+ padding: 10rpx 0;
53
+ transition: opacity $mu-duration $mu-ease;
54
+
55
+ &--disabled { opacity: $mu-opacity-disabled; cursor: not-allowed; }
56
+
57
+ &__icon {
58
+ width: 34rpx;
59
+ height: 34rpx;
60
+ border-radius: 50%;
61
+ border: 2rpx solid $mu-border;
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ transition: all $mu-duration $mu-ease;
66
+ flex-shrink: 0;
67
+ background: $mu-bg-base;
68
+
69
+ &--checked {
70
+ border-color: transparent;
71
+ background: $mu-primary-gradient;
72
+ box-shadow: none;
73
+ }
74
+ &--disabled { border-color: $mu-text-disabled; }
75
+
76
+ &-inner {
77
+ width: 14rpx;
78
+ height: 14rpx;
79
+ border-radius: 50%;
80
+ background: #ffffff;
81
+ box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
82
+ animation: mu-radio-pop 0.2s $mu-ease-spring;
83
+ }
84
+ }
85
+ &__label {
86
+ margin-left: 14rpx;
87
+ display: inline-flex;
88
+ align-items: center;
89
+ &--disabled { color: $mu-text-disabled; }
90
+ &-text {
91
+ font-size: 28rpx;
92
+ font-weight: 600;
93
+ color: $mu-text-primary;
94
+ line-height: 1;
95
+ }
96
+ }
97
+ }
98
+
99
+ @keyframes mu-radio-pop {
100
+ from { transform: scale(0); opacity: 0; }
101
+ to { transform: scale(1); opacity: 1; }
102
+ }
103
+
104
+ .mu-dark, page.mu-dark {
105
+
106
+ .mu-radio {
107
+ &__icon {
108
+ background: $mu-dark-bg-base;
109
+ border-color: $mu-dark-border;
110
+ }
111
+ &__label-text { color: $mu-dark-text-primary; }
112
+ }
113
+ }
114
+
115
+ @media (prefers-color-scheme: dark) {
116
+
117
+ .mu-radio {
118
+ &__icon {
119
+ background: $mu-dark-bg-base;
120
+ border-color: $mu-dark-border;
121
+ }
122
+ &__label-text { color: $mu-dark-text-primary; }
123
+ }
124
+ }
125
+ </style>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <view class="mu-radio-group" :class="{ 'mu-radio-group--horizontal': direction === 'horizontal' }">
3
+ <slot></slot>
4
+ </view>
5
+ </template>
6
+
7
+ <script setup>
8
+ /**
9
+ * mu-radio-group 单选框组
10
+ * @description 包裹多个 mu-radio,管理选中状态
11
+ * @property {string|number} modelValue - 当前选中值
12
+ * @property {string} direction - 排列方向 horizontal|vertical
13
+ */
14
+ import { provide, toRefs } from 'vue'
15
+
16
+ const props = defineProps({
17
+ modelValue: { type: [String, Number], default: '' },
18
+ direction: { type: String, default: 'vertical' }
19
+ })
20
+
21
+ const emit = defineEmits(['update:modelValue', 'change'])
22
+
23
+ provide('mu-radio-group', {
24
+ modelValue: toRefs(props).modelValue,
25
+ changeValue(val) {
26
+ emit('update:modelValue', val)
27
+ emit('change', val)
28
+ }
29
+ })
30
+ </script>
31
+
32
+ <style lang="scss" scoped>
33
+ .mu-radio-group {
34
+ display: flex; flex-direction: column; gap: 8rpx;
35
+ &--horizontal { flex-direction: row; flex-wrap: wrap; gap: 24rpx; }
36
+ }
37
+ </style>
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <view class="mu-rate" :class="{ 'mu-rate--disabled': disabled || readonly }">
3
+ <view v-for="i in count" :key="i" class="mu-rate__star" @tap="handleClick(i)">
4
+ <view class="mu-rate__star-bg">
5
+ <mu-icon name="star" :size="size" :color="voidColor" />
6
+ </view>
7
+ <view class="mu-rate__star-active" :style="{ width: getStarWidth(i) }">
8
+ <mu-icon name="star" :size="size" :color="activeColor" />
9
+ </view>
10
+ </view>
11
+ <view v-if="showText" class="mu-rate__text">
12
+ <slot><text class="mu-rate__text-label">{{ currentText }}</text></slot>
13
+ </view>
14
+ </view>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { computed } from 'vue'
19
+
20
+ const props = defineProps({
21
+ value: { type: Number, default: 0 },
22
+ count: { type: Number, default: 5 },
23
+ size: { type: [Number, String], default: 32 }, // 优化移动端默认 32rpx 尺寸
24
+ activeColor: { type: String, default: '#F59E0B' }, // 琥珀高彩金
25
+ voidColor: { type: String, default: '#E2E8F0' },
26
+ disabled: { type: Boolean, default: false },
27
+ readonly: { type: Boolean, default: false },
28
+ allowHalf: { type: Boolean, default: false },
29
+ showText: { type: Boolean, default: false },
30
+ texts: { type: Array, default: () => ['很差', '较差', '一般', '满意', '非常满意'] }
31
+ })
32
+
33
+ const emit = defineEmits(['change', 'update:value'])
34
+
35
+ function getStarWidth(i) {
36
+ const v = props.value
37
+ if (i <= v) return '100%'
38
+ if (props.allowHalf && i - 0.5 <= v) return '50%'
39
+ return '0%'
40
+ }
41
+
42
+ const currentText = computed(() => {
43
+ const idx = Math.ceil(props.value) - 1
44
+ return props.texts[idx] || ''
45
+ })
46
+
47
+ function handleClick(i) {
48
+ if (props.disabled || props.readonly) return
49
+ let val = i
50
+ if (props.allowHalf && val === props.value) val = i - 0.5
51
+ emit('change', val)
52
+ emit('update:value', val)
53
+ }
54
+ </script>
55
+
56
+ <style lang="scss" scoped>
57
+ @import "@/uni.scss";
58
+
59
+ .mu-rate {
60
+ display: inline-flex;
61
+ align-items: center;
62
+ &--disabled { opacity: 0.6; }
63
+ &__star {
64
+ position: relative;
65
+ margin-right: 12rpx;
66
+ cursor: pointer;
67
+ transition: transform $mu-duration $mu-ease-spring;
68
+ display: inline-flex;
69
+ &:active { transform: scale(1.2); }
70
+ }
71
+ &__star-bg { display: flex; }
72
+ &__star-active {
73
+ position: absolute;
74
+ top: 0;
75
+ left: 0;
76
+ overflow: hidden;
77
+ display: flex;
78
+ transition: width $mu-duration $mu-ease;
79
+ }
80
+ &__text {
81
+ margin-left: 16rpx;
82
+ &-label {
83
+ font-size: 26rpx;
84
+ font-weight: 700;
85
+ color: #F59E0B;
86
+ }
87
+ }
88
+ }
89
+
90
+ .mu-dark, page.mu-dark {
91
+
92
+ .mu-rate {
93
+ &__text-label { color: #F59E0B; }
94
+ }
95
+ }
96
+
97
+ @media (prefers-color-scheme: dark) {
98
+
99
+ .mu-rate {
100
+ &__text-label { color: #F59E0B; }
101
+ }
102
+ }
103
+ </style>
@@ -0,0 +1,320 @@
1
+ <template>
2
+ <view class="mu-search" :class="[disabled && 'mu-search--disabled']">
3
+ <view
4
+ class="mu-search__bar"
5
+ :class="[
6
+ isFocus && 'mu-search__bar--focus',
7
+ `mu-search__bar--${shape}`
8
+ ]"
9
+ :style="barStyle"
10
+ >
11
+ <!-- 搜索图标 -->
12
+ <view class="mu-search__icon">
13
+ <slot name="icon">
14
+ <mu-icon name="search" :size="16" :color="isFocus ? '#171717' : '#94A3B8'" />
15
+ </slot>
16
+ </view>
17
+
18
+ <!-- 输入框 -->
19
+ <input
20
+ class="mu-search__input"
21
+ :value="modelValue"
22
+ :placeholder="placeholder"
23
+ :placeholder-style="placeholderStyle"
24
+ :disabled="disabled"
25
+ :focus="autofocus"
26
+ confirm-type="search"
27
+ @input="onInput"
28
+ @focus="onFocus"
29
+ @blur="onBlur"
30
+ @confirm="onSearch"
31
+ />
32
+
33
+ <!-- 清除按钮 -->
34
+ <view
35
+ v-if="modelValue && clearable && !disabled"
36
+ class="mu-search__clear mu-touchable-flat"
37
+ @tap="handleClear"
38
+ >
39
+ <mu-icon name="close" :size="12" color="#94A3B8" />
40
+ </view>
41
+ </view>
42
+
43
+ <!-- 右侧动作按钮 (搜索/取消) -->
44
+ <view
45
+ v-if="showAction && (isFocus || alwaysShowAction || modelValue)"
46
+ class="mu-search__action mu-touchable-flat"
47
+ @tap="onActionClick"
48
+ >
49
+ <slot name="action">
50
+ <text class="mu-search__action-text">{{ actionText }}</text>
51
+ </slot>
52
+ </view>
53
+
54
+ <!-- 搜索联想建议下拉框 -->
55
+ <view v-if="showSuggest && suggestions.length && isFocus" class="mu-search__suggest">
56
+ <view
57
+ v-for="(item, i) in suggestions"
58
+ :key="i"
59
+ class="mu-search__suggest-item"
60
+ @tap="handleSuggest(item)"
61
+ >
62
+ <mu-icon name="search" :size="14" color="#94A3B8" style="margin-right: 12rpx;" />
63
+ <text class="mu-search__suggest-text">{{ item }}</text>
64
+ </view>
65
+ </view>
66
+ </view>
67
+ </template>
68
+
69
+ <script setup>
70
+ import { ref, computed } from 'vue'
71
+
72
+ const props = defineProps({
73
+ modelValue: { type: String, default: '' },
74
+ value: { type: String, default: '' }, // 兼容旧属性 value
75
+ placeholder: { type: String, default: '搜索' },
76
+ disabled: { type: Boolean, default: false },
77
+ clearable: { type: Boolean, default: true },
78
+ showAction: { type: Boolean, default: false },
79
+ alwaysShowAction: { type: Boolean, default: false },
80
+ actionText: { type: String, default: '搜索' },
81
+ autofocus: { type: Boolean, default: false },
82
+ suggestions: { type: Array, default: () => [] },
83
+ shape: { type: String, default: 'round' }, // round | radius
84
+ background: { type: String, default: '' }
85
+ })
86
+
87
+ const emit = defineEmits(['input', 'change', 'search', 'focus', 'blur', 'clear', 'action-click', 'update:modelValue', 'update:value'])
88
+
89
+ const isFocus = ref(false)
90
+
91
+ const modelValue = computed({
92
+ get: () => props.modelValue || props.value,
93
+ set: (val) => {
94
+ emit('update:modelValue', val)
95
+ emit('update:value', val)
96
+ }
97
+ })
98
+
99
+ const showSuggest = computed(() => props.suggestions.length > 0)
100
+
101
+ const placeholderStyle = computed(() => 'color: #94A3B8; font-size: 26rpx;')
102
+
103
+ const barStyle = computed(() => {
104
+ const s = {}
105
+ if (props.background) s.background = props.background
106
+ return s
107
+ })
108
+
109
+ function onInput(e) {
110
+ const val = e.detail.value
111
+ modelValue.value = val
112
+ emit('input', val)
113
+ emit('change', val)
114
+ }
115
+
116
+ function onFocus() {
117
+ if (props.disabled) return
118
+ isFocus.value = true
119
+ emit('focus')
120
+ }
121
+
122
+ function onBlur() {
123
+ setTimeout(() => {
124
+ isFocus.value = false
125
+ }, 150)
126
+ emit('blur')
127
+ }
128
+
129
+ function onSearch() {
130
+ emit('search', modelValue.value)
131
+ }
132
+
133
+ function onActionClick() {
134
+ emit('action-click', modelValue.value)
135
+ onSearch()
136
+ }
137
+
138
+ function handleClear() {
139
+ modelValue.value = ''
140
+ emit('input', '')
141
+ emit('change', '')
142
+ emit('clear')
143
+ }
144
+
145
+ function handleSuggest(item) {
146
+ modelValue.value = item
147
+ emit('input', item)
148
+ emit('change', item)
149
+ emit('search', item)
150
+ }
151
+ </script>
152
+
153
+ <style lang="scss" scoped>
154
+ @import "@/uni.scss";
155
+
156
+ .mu-search {
157
+ display: flex;
158
+ align-items: center;
159
+ position: relative;
160
+ width: 100%;
161
+ box-sizing: border-box;
162
+
163
+ &--disabled {
164
+ opacity: 0.6;
165
+ pointer-events: none;
166
+ }
167
+
168
+ &__bar {
169
+ flex: 1;
170
+ display: flex;
171
+ align-items: center;
172
+ height: 68rpx;
173
+ background: #F8FAFC;
174
+ border-radius: 999rpx;
175
+ padding: 0 20rpx;
176
+ border: 1rpx solid rgba(226, 232, 240, 0.9);
177
+ transition: all 0.25s ease;
178
+ box-sizing: border-box;
179
+
180
+ &--radius {
181
+ border-radius: 12rpx;
182
+ }
183
+
184
+ &--focus {
185
+ border-color: #171717;
186
+ background: #ffffff;
187
+ box-shadow: 0 0 0 4rpx rgba(99, 102, 241, 0.12);
188
+ }
189
+ }
190
+
191
+ &__icon {
192
+ margin-right: 12rpx;
193
+ display: flex;
194
+ align-items: center;
195
+ justify-content: center;
196
+ flex-shrink: 0;
197
+ }
198
+
199
+ &__input {
200
+ flex: 1;
201
+ height: 100%;
202
+ font-size: 26rpx;
203
+ color: $mu-text-primary;
204
+ background: transparent;
205
+ border: none;
206
+ font-weight: 500;
207
+ }
208
+
209
+ &__clear {
210
+ width: 32rpx;
211
+ height: 32rpx;
212
+ border-radius: 50%;
213
+ background: #E2E8F0;
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: center;
217
+ margin-left: 10rpx;
218
+ flex-shrink: 0;
219
+
220
+ &:active {
221
+ opacity: 0.7;
222
+ }
223
+ }
224
+
225
+ &__action {
226
+ margin-left: 16rpx;
227
+ display: flex;
228
+ align-items: center;
229
+ height: 68rpx;
230
+ flex-shrink: 0;
231
+
232
+ &-text {
233
+ font-size: 26rpx;
234
+ color: #171717;
235
+ font-weight: 700;
236
+ }
237
+ }
238
+
239
+ &__suggest {
240
+ position: absolute;
241
+ top: calc(100% + 12rpx);
242
+ left: 0;
243
+ right: 0;
244
+ z-index: 99;
245
+ background: #ffffff;
246
+ border: 1rpx solid rgba(226, 232, 240, 0.9);
247
+ border-radius: 20rpx;
248
+ box-shadow: 0 12rpx 36rpx rgba(15, 23, 42, 0.08);
249
+ overflow: hidden;
250
+
251
+ &-item {
252
+ padding: 20rpx 24rpx;
253
+ display: flex;
254
+ align-items: center;
255
+ border-bottom: 1rpx solid rgba(226, 232, 240, 0.6);
256
+
257
+ &:last-child { border-bottom: none; }
258
+ &:active { background: #F8FAFC; }
259
+ }
260
+
261
+ &-text {
262
+ font-size: 26rpx;
263
+ color: $mu-text-primary;
264
+ font-weight: 500;
265
+ }
266
+ }
267
+ }
268
+
269
+ .mu-dark, page.mu-dark {
270
+
271
+ .mu-search {
272
+ &__bar {
273
+ background: $mu-dark-bg-base;
274
+ border-color: rgba(255, 255, 255, 0.08);
275
+ &--focus {
276
+ border-color: #171717;
277
+ background: $mu-dark-bg-base;
278
+ box-shadow: 0 0 0 4rpx rgba(99, 102, 241, 0.2);
279
+ }
280
+ }
281
+ &__input { color: $mu-dark-text-primary; }
282
+ &__clear { background: rgba(255, 255, 255, 0.15); }
283
+ &__suggest {
284
+ background: $mu-dark-bg-base;
285
+ border-color: rgba(255, 255, 255, 0.1);
286
+ &-item {
287
+ border-color: rgba(255, 255, 255, 0.06);
288
+ &:active { background: rgba(255, 255, 255, 0.05); }
289
+ }
290
+ &-text { color: $mu-dark-text-primary; }
291
+ }
292
+ }
293
+ }
294
+
295
+ @media (prefers-color-scheme: dark) {
296
+
297
+ .mu-search {
298
+ &__bar {
299
+ background: $mu-dark-bg-base;
300
+ border-color: rgba(255, 255, 255, 0.08);
301
+ &--focus {
302
+ border-color: #171717;
303
+ background: $mu-dark-bg-base;
304
+ box-shadow: 0 0 0 4rpx rgba(99, 102, 241, 0.2);
305
+ }
306
+ }
307
+ &__input { color: $mu-dark-text-primary; }
308
+ &__clear { background: rgba(255, 255, 255, 0.15); }
309
+ &__suggest {
310
+ background: $mu-dark-bg-base;
311
+ border-color: rgba(255, 255, 255, 0.1);
312
+ &-item {
313
+ border-color: rgba(255, 255, 255, 0.06);
314
+ &:active { background: rgba(255, 255, 255, 0.05); }
315
+ }
316
+ &-text { color: $mu-dark-text-primary; }
317
+ }
318
+ }
319
+ }
320
+ </style>