@mc-markets/ui 1.0.86 → 1.0.90

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 (76) hide show
  1. package/README.md +40 -141
  2. package/dist/404.html +22 -22
  3. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +5 -13
  4. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts.map +1 -1
  5. package/dist/components/Breadcrumb/BreadcrumbSeparator.vue.d.ts +3 -0
  6. package/dist/components/Breadcrumb/BreadcrumbSeparator.vue.d.ts.map +1 -0
  7. package/dist/components/DatePicker/DatePicker.vue.d.ts +1 -1
  8. package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
  9. package/dist/components/TabCard/TabCard.vue.d.ts.map +1 -1
  10. package/dist/components/Tag/Tag.vue.d.ts +2 -0
  11. package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
  12. package/dist/index.cjs +1 -5
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.ts +1 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.mjs +605 -661
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/style.css +1 -1
  19. package/package.json +1 -1
  20. package/packages/components/Alert/Alert.vue +139 -139
  21. package/packages/components/Banner/Banner.vue +299 -299
  22. package/packages/components/Breadcrumb/Breadcrumb.vue +113 -77
  23. package/packages/components/Breadcrumb/BreadcrumbSeparator.vue +31 -0
  24. package/packages/components/Button/Button.vue +17 -17
  25. package/packages/components/DatePicker/DatePicker.vue +85 -86
  26. package/packages/components/Dialog/Dialog.vue +61 -61
  27. package/packages/components/Empty/Empty.vue +74 -74
  28. package/packages/components/Form/Form.vue +30 -30
  29. package/packages/components/FormItem/FormItem.vue +19 -19
  30. package/packages/components/Icon/Icon.vue +210 -210
  31. package/packages/components/Input/Input.vue +15 -15
  32. package/packages/components/Message/Message.vue +503 -503
  33. package/packages/components/NotifiMessage/NotifiMessage.vue +293 -293
  34. package/packages/components/Notification/Notification.vue +19 -19
  35. package/packages/components/Option/Option.vue +13 -13
  36. package/packages/components/OptionGroup/OptionGroup.vue +13 -13
  37. package/packages/components/Pagination/Pagination.vue +61 -61
  38. package/packages/components/Radio/Radio.vue +67 -67
  39. package/packages/components/RadioButton/RadioButton.vue +110 -110
  40. package/packages/components/RadioGroup/RadioGroup.vue +155 -155
  41. package/packages/components/Select/Select.vue +22 -22
  42. package/packages/components/Switch/Switch.vue +47 -47
  43. package/packages/components/TabCard/TabCard.vue +107 -177
  44. package/packages/components/TabCard/TabCardItem.vue +105 -102
  45. package/packages/components/Table/Table.vue +17 -17
  46. package/packages/components/Table/TableColumn.vue +20 -20
  47. package/packages/components/Tabs/TabPane.vue +79 -79
  48. package/packages/components/Tabs/Tabs.vue +267 -267
  49. package/packages/components/Tag/Tag.vue +211 -164
  50. package/packages/components/Tooltip/Tooltip.vue +58 -58
  51. package/packages/hooks/useClassName.js +23 -23
  52. package/packages/styles/README.md +129 -129
  53. package/packages/styles/components/button.scss +121 -121
  54. package/packages/styles/components/checkbox.scss +18 -18
  55. package/packages/styles/components/dialog.scss +47 -47
  56. package/packages/styles/components/form.scss +18 -18
  57. package/packages/styles/components/input.scss +14 -14
  58. package/packages/styles/components/select.scss +62 -60
  59. package/packages/styles/components/table.scss +37 -37
  60. package/packages/styles/components/tabs.scss +76 -76
  61. package/packages/styles/components/tag.scss +142 -142
  62. package/packages/styles/font/iconfont.scss +363 -363
  63. package/packages/styles/index.scss +94 -94
  64. package/packages/styles/variables/border-mode.css +6 -6
  65. package/packages/styles/variables/color-modes-dark.css +143 -143
  66. package/packages/styles/variables/index.scss +5 -5
  67. package/packages/styles/variables/primitives-style.css +112 -112
  68. package/packages/styles/variables/radius-mode.css +14 -14
  69. package/packages/styles/variables/spacing-mode.css +20 -20
  70. package/packages/styles/variables/typography-desktop.css +40 -40
  71. package/packages/styles/variables/typography-mobile.css +40 -40
  72. package/packages/utils/classNames.js +23 -23
  73. package/packages/utils/styleUtils.js +105 -105
  74. package/dist/components/Breadcrumb/BreadcrumbItem.vue.d.ts +0 -17
  75. package/dist/components/Breadcrumb/BreadcrumbItem.vue.d.ts.map +0 -1
  76. package/packages/components/Breadcrumb/BreadcrumbItem.vue +0 -142
@@ -1,177 +1,107 @@
1
- <template>
2
- <div class="m-tab-card" :class="{ 'is-disabled': disabled }">
3
- <div class="m-tab-card__container">
4
- <div
5
- v-for="(tab, index) in tabs"
6
- :key="tab.name"
7
- :class="[
8
- 'm-tab-card__item',
9
- {
10
- 'is-active': activeTab === tab.name,
11
- 'is-disabled': tab.disabled
12
- }
13
- ]"
14
- @click="handleTabClick(tab.name, tab.disabled)"
15
- >
16
- <span class="m-tab-card__text">{{ tab.label }}</span>
17
- </div>
18
- </div>
19
- </div>
20
- </template>
21
-
22
- <script setup>
23
- import { ref, computed, watch, provide } from 'vue'
24
- import { useClassName } from "@packages/hooks/useClassName.js"
25
-
26
- defineOptions({
27
- name: "MTabCard",
28
- })
29
-
30
- // 定义 props
31
- const props = defineProps({
32
- modelValue: {
33
- type: [String, Number],
34
- default: ''
35
- },
36
- disabled: {
37
- type: Boolean,
38
- default: false
39
- },
40
- options: {
41
- type: Array,
42
- default: () => []
43
- }
44
- })
45
-
46
- // 定义 emits
47
- const emit = defineEmits(['update:modelValue', 'change', 'tab-click'])
48
-
49
- // 使用类名 Hook
50
- const { mergedAttrs } = useClassName()
51
-
52
- // 内部状态
53
- const activeTab = ref(props.modelValue)
54
-
55
- // 计算 tabs 数据
56
- const tabs = computed(() => {
57
- return props.options.map(option => {
58
- if (typeof option === 'string') {
59
- return { label: option, name: option, disabled: false }
60
- }
61
- return {
62
- label: option.label || option.name || '',
63
- name: option.name || option.label || '',
64
- disabled: option.disabled || false
65
- }
66
- })
67
- })
68
-
69
- // 处理 tab 点击
70
- const handleTabClick = (tabName, isDisabled) => {
71
- if (isDisabled || props.disabled || tabName === activeTab.value) {
72
- return
73
- }
74
-
75
- const oldValue = activeTab.value
76
- activeTab.value = tabName
77
- emit('update:modelValue', tabName)
78
- emit('change', tabName, oldValue)
79
- emit('tab-click', tabName)
80
- }
81
-
82
- // 监听 modelValue 变化
83
- watch(() => props.modelValue, (newValue) => {
84
- if (newValue !== activeTab.value) {
85
- activeTab.value = newValue
86
- }
87
- })
88
-
89
- // 提供给子组件的方法
90
- provide('tabCardContext', {
91
- activeTab,
92
- handleTabClick
93
- })
94
- </script>
95
-
96
- <style lang="scss" scoped>
97
- .m-tab-card {
98
- display: inline-block;
99
-
100
- &.is-disabled {
101
- pointer-events: none;
102
- opacity: 0.6;
103
- }
104
-
105
- &__container {
106
- display: flex;
107
- background-color: var(--bg-tertiary-hover, #2a2a2a);
108
- border-radius: var(--md);
109
- padding: 4px;
110
- gap: 0;
111
- }
112
-
113
- &__item {
114
- position: relative;
115
- display: flex;
116
- align-items: center;
117
- justify-content: center;
118
- min-width: 132px;
119
- height: 40px;
120
- padding: 0 16px;
121
- border-radius: var(--md);
122
- cursor: pointer;
123
- // transition: all 0.3s ease;
124
- user-select: none;
125
- background-color: transparent;
126
- min-width: 80px;
127
- text-align: center;
128
- z-index: 1;
129
-
130
- &:hover:not(.is-disabled):not(.is-active) {
131
- // background-color: rgba(255, 255, 255, 0.05);
132
- }
133
-
134
- &.is-active {
135
- background-color: var(--bg-brand, #ffd700);
136
- color: var(--text-quaternary);
137
- font-weight: 600;
138
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
139
- }
140
-
141
- &.is-disabled {
142
- cursor: not-allowed;
143
- opacity: 0.5;
144
- }
145
-
146
- &:not(.is-active) {
147
- color: var(--text-secondary, #ffffff);
148
- }
149
- }
150
-
151
- &__text {
152
- font-size: 14px;
153
- line-height: 1.4;
154
- white-space: nowrap;
155
- }
156
- }
157
-
158
- // 深色主题适配
159
- @media (prefers-color-scheme: dark) {
160
- .m-tab-card {
161
- &__container {
162
- background-color: var(--bg-tertiary-hover, #2a2a2a);
163
- }
164
-
165
- &__item {
166
- &:not(.is-active) {
167
- color: var(--text-secondary, #cccccc);
168
- }
169
-
170
- &.is-active {
171
- background-color: var(--bg-brand, #ffd700);
172
- color: var(--text-primary, #1a1a1a);
173
- }
174
- }
175
- }
176
- }
177
- </style>
1
+ <template>
2
+ <div class="m-tab-card" :class="{ 'is-disabled': disabled }">
3
+ <div class="m-tab-card__container">
4
+ <m-tab-card-item
5
+ v-for="(tab, index) in tabs"
6
+ :key="tab.name"
7
+ :name="tab.name"
8
+ :label="tab.label"
9
+ :disabled="tab.disabled"
10
+ />
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+ import { ref, computed, watch, provide } from 'vue'
17
+ import { useClassName } from "@packages/hooks/useClassName.js"
18
+ import MTabCardItem from './TabCardItem.vue'
19
+
20
+ defineOptions({
21
+ name: "MTabCard",
22
+ })
23
+
24
+ // 定义 props
25
+ const props = defineProps({
26
+ modelValue: {
27
+ type: [String, Number],
28
+ default: ''
29
+ },
30
+ disabled: {
31
+ type: Boolean,
32
+ default: false
33
+ },
34
+ options: {
35
+ type: Array,
36
+ default: () => []
37
+ }
38
+ })
39
+
40
+ // 定义 emits
41
+ const emit = defineEmits(['update:modelValue', 'change', 'tab-click'])
42
+
43
+ // 使用类名 Hook
44
+ const { mergedAttrs } = useClassName()
45
+
46
+ // 内部状态
47
+ const activeTab = ref(props.modelValue)
48
+
49
+ // 计算 tabs 数据
50
+ const tabs = computed(() => {
51
+ return props.options.map(option => {
52
+ if (typeof option === 'string') {
53
+ return { label: option, name: option, disabled: false }
54
+ }
55
+ return {
56
+ label: option.label || option.name || '',
57
+ name: option.name || option.label || '',
58
+ disabled: option.disabled || false
59
+ }
60
+ })
61
+ })
62
+
63
+ // 处理 tab 点击
64
+ const handleTabClick = (tabName, isDisabled) => {
65
+ if (isDisabled || props.disabled || tabName === activeTab.value) {
66
+ return
67
+ }
68
+
69
+ const oldValue = activeTab.value
70
+ activeTab.value = tabName
71
+ emit('update:modelValue', tabName)
72
+ emit('change', tabName, oldValue)
73
+ emit('tab-click', tabName)
74
+ }
75
+
76
+ // 监听 modelValue 变化
77
+ watch(() => props.modelValue, (newValue) => {
78
+ if (newValue !== activeTab.value) {
79
+ activeTab.value = newValue
80
+ }
81
+ })
82
+
83
+ // 提供给子组件的方法
84
+ provide('tabCardContext', {
85
+ activeTab,
86
+ handleTabClick
87
+ })
88
+ </script>
89
+
90
+ <style lang="scss" scoped>
91
+ .m-tab-card {
92
+ display: inline-block;
93
+
94
+ &.is-disabled {
95
+ pointer-events: none;
96
+ opacity: 0.6;
97
+ }
98
+
99
+ &__container {
100
+ display: flex;
101
+ background-color: var(--bg-tertiary-hover, #2a2a2a);
102
+ border-radius: var(--md);
103
+ padding: 4px;
104
+ gap: 0;
105
+ }
106
+ }
107
+ </style>
@@ -1,102 +1,105 @@
1
- <template>
2
- <div
3
- :class="[
4
- 'm-tab-card-item',
5
- {
6
- 'is-active': isActive,
7
- 'is-disabled': disabled
8
- }
9
- ]"
10
- @click="handleClick"
11
- >
12
- <span class="m-tab-card-item__text">
13
- <slot>{{ label }}</slot>
14
- </span>
15
- </div>
16
- </template>
17
-
18
- <script setup>
19
- import { inject, computed } from 'vue'
20
-
21
- defineOptions({
22
- name: "MTabCardItem",
23
- })
24
-
25
- // 定义 props
26
- const props = defineProps({
27
- label: {
28
- type: String,
29
- default: ''
30
- },
31
- name: {
32
- type: [String, Number],
33
- required: true
34
- },
35
- disabled: {
36
- type: Boolean,
37
- default: false
38
- }
39
- })
40
-
41
- // 定义 emits
42
- const emit = defineEmits(['click'])
43
-
44
- // 注入父组件上下文
45
- const tabCardContext = inject('tabCardContext')
46
-
47
- // 计算是否激活
48
- const isActive = computed(() => {
49
- return tabCardContext.activeTab.value === props.name
50
- })
51
-
52
- // 处理点击
53
- const handleClick = () => {
54
- if (props.disabled) {
55
- return
56
- }
57
-
58
- tabCardContext.handleTabClick(props.name, props.disabled)
59
- emit('click', props.name)
60
- }
61
- </script>
62
-
63
- <style lang="scss" scoped>
64
- .m-tab-card-item {
65
- position: relative;
66
- padding: 8px 16px;
67
- border-radius: 6px;
68
- cursor: pointer;
69
- transition: all 0.3s ease;
70
- user-select: none;
71
- background-color: transparent;
72
- min-width: 80px;
73
- text-align: center;
74
- z-index: 1;
75
-
76
- &:hover:not(.is-disabled):not(.is-active) {
77
- background-color: rgba(255, 255, 255, 0.05);
78
- }
79
-
80
- &.is-active {
81
- background-color: var(--bg-brand, #ffd700);
82
- color: var(--text-primary, #1a1a1a);
83
- font-weight: 600;
84
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
85
- }
86
-
87
- &.is-disabled {
88
- cursor: not-allowed;
89
- opacity: 0.5;
90
- }
91
-
92
- &:not(.is-active) {
93
- color: var(--text-secondary, #ffffff);
94
- }
95
-
96
- &__text {
97
- font-size: 14px;
98
- line-height: 1.4;
99
- white-space: nowrap;
100
- }
101
- }
102
- </style>
1
+ <template>
2
+ <div
3
+ :class="[
4
+ 'm-tab-card-item',
5
+ {
6
+ 'is-active': isActive,
7
+ 'is-disabled': disabled
8
+ }
9
+ ]"
10
+ @click="handleClick"
11
+ >
12
+ <span class="m-tab-card-item__text">
13
+ <slot>{{ label }}</slot>
14
+ </span>
15
+ </div>
16
+ </template>
17
+
18
+ <script setup>
19
+ import { inject, computed } from 'vue'
20
+
21
+ defineOptions({
22
+ name: "MTabCardItem",
23
+ })
24
+
25
+ // 定义 props
26
+ const props = defineProps({
27
+ label: {
28
+ type: String,
29
+ default: ''
30
+ },
31
+ name: {
32
+ type: [String, Number],
33
+ required: true
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false
38
+ }
39
+ })
40
+
41
+ // 定义 emits
42
+ const emit = defineEmits(['click'])
43
+
44
+ // 注入父组件上下文
45
+ const tabCardContext = inject('tabCardContext')
46
+
47
+ // 计算是否激活
48
+ const isActive = computed(() => {
49
+ return tabCardContext.activeTab.value === props.name
50
+ })
51
+
52
+ // 处理点击
53
+ const handleClick = () => {
54
+ if (props.disabled) {
55
+ return
56
+ }
57
+
58
+ tabCardContext.handleTabClick(props.name, props.disabled)
59
+ emit('click', props.name)
60
+ }
61
+ </script>
62
+
63
+ <style lang="scss" scoped>
64
+ .m-tab-card-item {
65
+ position: relative;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ height: 40px;
70
+ border-radius: var(--md);
71
+ cursor: pointer;
72
+ // transition: all 0.3s ease;
73
+ user-select: none;
74
+ background-color: transparent;
75
+ padding: 0 36px;
76
+ text-align: center;
77
+ z-index: 1;
78
+
79
+ // &:hover:not(.is-disabled):not(.is-active) {
80
+ // background-color: rgba(255, 255, 255, 0.05);
81
+ // }
82
+
83
+ &.is-active {
84
+ background-color: var(--bg-brand, #ffd700);
85
+ color: var(--text-quaternary);
86
+ font-weight: 600;
87
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
88
+ }
89
+
90
+ &.is-disabled {
91
+ cursor: not-allowed;
92
+ opacity: 0.5;
93
+ }
94
+
95
+ &:not(.is-active) {
96
+ color: var(--text-secondary, #ffffff);
97
+ }
98
+
99
+ &__text {
100
+ font-size: 14px;
101
+ line-height: 1.4;
102
+ white-space: nowrap;
103
+ }
104
+ }
105
+ </style>
@@ -1,17 +1,17 @@
1
- <template>
2
- <el-table v-bind="$attrs">
3
- <template v-for="(_, name) in $slots" :key="name" #[name]>
4
- <slot :name="name" />
5
- </template>
6
- </el-table>
7
- </template>
8
-
9
- <script setup>
10
- defineOptions({
11
- name: "MTable",
12
- });
13
- </script>
14
- <style lang="scss">
15
- // Table 组件样式 - 无边框设计
16
-
17
- </style>
1
+ <template>
2
+ <el-table v-bind="$attrs">
3
+ <template v-for="(_, name) in $slots" :key="name" #[name]>
4
+ <slot :name="name" />
5
+ </template>
6
+ </el-table>
7
+ </template>
8
+
9
+ <script setup>
10
+ defineOptions({
11
+ name: "MTable",
12
+ });
13
+ </script>
14
+ <style lang="scss">
15
+ // Table 组件样式 - 无边框设计
16
+
17
+ </style>
@@ -1,20 +1,20 @@
1
- <template>
2
- <el-table-column v-bind="$attrs" class="m-table-column">
3
- <template v-for="(_, name) in $slots" :key="name" #[name]>
4
- <slot :name="name" />
5
- </template>
6
- </el-table-column>
7
- </template>
8
-
9
- <script setup>
10
- defineOptions({
11
- name: "MTableColumn",
12
- });
13
- </script>
14
-
15
- <style lang="scss">
16
- // TableColumn 组件样式
17
- .m-table-column.el-table-column {
18
- // 继承父级 Table 组件的样式
19
- }
20
- </style>
1
+ <template>
2
+ <el-table-column v-bind="$attrs" class="m-table-column">
3
+ <template v-for="(_, name) in $slots" :key="name" #[name]>
4
+ <slot :name="name" />
5
+ </template>
6
+ </el-table-column>
7
+ </template>
8
+
9
+ <script setup>
10
+ defineOptions({
11
+ name: "MTableColumn",
12
+ });
13
+ </script>
14
+
15
+ <style lang="scss">
16
+ // TableColumn 组件样式
17
+ .m-table-column.el-table-column {
18
+ // 继承父级 Table 组件的样式
19
+ }
20
+ </style>