@type-dom/ui 0.1.2 → 0.1.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 (132) hide show
  1. package/README.md +134 -134
  2. package/package.json +3 -1
  3. package/src/components/data/td-progress/td-progress.class.js +5 -5
  4. package/src/hooks/use-deprecated/index.js +2 -2
  5. package/src/hooks/use-id/index.js +4 -4
  6. package/src/hooks/use-z-index/index.js +1 -1
  7. package/src/theme-chalk/affix.scss +7 -7
  8. package/src/theme-chalk/alert.scss +115 -115
  9. package/src/theme-chalk/anchor-link.scss +41 -41
  10. package/src/theme-chalk/anchor.scss +88 -88
  11. package/src/theme-chalk/aside.scss +8 -8
  12. package/src/theme-chalk/autocomplete.scss +89 -89
  13. package/src/theme-chalk/avatar.scss +55 -55
  14. package/src/theme-chalk/backtop.scss +29 -29
  15. package/src/theme-chalk/badge.scss +58 -58
  16. package/src/theme-chalk/base.scss +3 -3
  17. package/src/theme-chalk/breadcrumb.scss +62 -62
  18. package/src/theme-chalk/button-group.scss +80 -80
  19. package/src/theme-chalk/button.scss +304 -304
  20. package/src/theme-chalk/calendar.scss +80 -80
  21. package/src/theme-chalk/card.scss +45 -45
  22. package/src/theme-chalk/carousel-item.scss +58 -58
  23. package/src/theme-chalk/carousel.scss +188 -188
  24. package/src/theme-chalk/cascader-panel.scss +138 -138
  25. package/src/theme-chalk/cascader.scss +247 -247
  26. package/src/theme-chalk/check-tag.scss +60 -60
  27. package/src/theme-chalk/checkbox-button.scss +140 -140
  28. package/src/theme-chalk/checkbox-group.scss +7 -7
  29. package/src/theme-chalk/checkbox.scss +298 -298
  30. package/src/theme-chalk/col.scss +48 -48
  31. package/src/theme-chalk/collapse.scss +70 -70
  32. package/src/theme-chalk/color/index.scss +20 -20
  33. package/src/theme-chalk/color-picker.scss +393 -393
  34. package/src/theme-chalk/common/popup.scss +47 -47
  35. package/src/theme-chalk/common/transition.scss +122 -122
  36. package/src/theme-chalk/common/var.scss +1655 -1655
  37. package/src/theme-chalk/container.scss +14 -14
  38. package/src/theme-chalk/dark/css-vars.scss +39 -39
  39. package/src/theme-chalk/dark/var.scss +222 -222
  40. package/src/theme-chalk/date-picker/date-picker.scss +110 -110
  41. package/src/theme-chalk/date-picker/date-range-picker.scss +113 -113
  42. package/src/theme-chalk/date-picker/date-table.scss +158 -158
  43. package/src/theme-chalk/date-picker/month-table.scss +112 -112
  44. package/src/theme-chalk/date-picker/picker-panel.scss +131 -131
  45. package/src/theme-chalk/date-picker/picker.scss +212 -212
  46. package/src/theme-chalk/date-picker/time-picker.scss +90 -90
  47. package/src/theme-chalk/date-picker/time-range-picker.scss +33 -33
  48. package/src/theme-chalk/date-picker/time-spinner.scss +111 -111
  49. package/src/theme-chalk/date-picker/year-table.scss +108 -108
  50. package/src/theme-chalk/date-picker.scss +9 -9
  51. package/src/theme-chalk/descriptions-item.scss +73 -73
  52. package/src/theme-chalk/descriptions.scss +152 -152
  53. package/src/theme-chalk/dialog.scss +192 -192
  54. package/src/theme-chalk/display.scss +12 -12
  55. package/src/theme-chalk/divider.scss +48 -48
  56. package/src/theme-chalk/drawer.scss +155 -155
  57. package/src/theme-chalk/dropdown.scss +208 -208
  58. package/src/theme-chalk/empty.scss +49 -49
  59. package/src/theme-chalk/footer.scss +12 -12
  60. package/src/theme-chalk/form.scss +244 -244
  61. package/src/theme-chalk/header.scss +12 -12
  62. package/src/theme-chalk/icon.scss +45 -45
  63. package/src/theme-chalk/image-viewer.scss +155 -155
  64. package/src/theme-chalk/image.scss +49 -49
  65. package/src/theme-chalk/index.scss +111 -111
  66. package/src/theme-chalk/input-number.scss +186 -186
  67. package/src/theme-chalk/input-tag.scss +220 -220
  68. package/src/theme-chalk/input.scss +474 -474
  69. package/src/theme-chalk/link.scss +90 -90
  70. package/src/theme-chalk/loading.scss +104 -104
  71. package/src/theme-chalk/main.scss +14 -14
  72. package/src/theme-chalk/mention.scss +92 -92
  73. package/src/theme-chalk/menu.scss +339 -339
  74. package/src/theme-chalk/message-box.scss +213 -213
  75. package/src/theme-chalk/message.scss +98 -98
  76. package/src/theme-chalk/mixins/_button.scss +165 -165
  77. package/src/theme-chalk/mixins/_col.scss +33 -33
  78. package/src/theme-chalk/mixins/_var.scss +67 -67
  79. package/src/theme-chalk/mixins/config.scss +5 -5
  80. package/src/theme-chalk/mixins/function.scss +88 -88
  81. package/src/theme-chalk/mixins/mixins.scss +240 -240
  82. package/src/theme-chalk/mixins/utils.scss +39 -39
  83. package/src/theme-chalk/notification.scss +107 -107
  84. package/src/theme-chalk/option-group.scss +33 -33
  85. package/src/theme-chalk/option.scss +71 -71
  86. package/src/theme-chalk/overlay.scss +17 -17
  87. package/src/theme-chalk/page-header.scss +60 -60
  88. package/src/theme-chalk/pagination.scss +238 -238
  89. package/src/theme-chalk/popconfirm.scss +16 -16
  90. package/src/theme-chalk/popover.scss +61 -61
  91. package/src/theme-chalk/popper.scss +106 -106
  92. package/src/theme-chalk/progress.scss +179 -179
  93. package/src/theme-chalk/radio-button.scss +169 -169
  94. package/src/theme-chalk/radio-group.scss +9 -9
  95. package/src/theme-chalk/radio.scss +215 -215
  96. package/src/theme-chalk/rate.scss +108 -108
  97. package/src/theme-chalk/reset.scss +98 -98
  98. package/src/theme-chalk/result.scss +57 -57
  99. package/src/theme-chalk/row.scss +35 -35
  100. package/src/theme-chalk/scrollbar.scss +97 -97
  101. package/src/theme-chalk/segmented.scss +183 -183
  102. package/src/theme-chalk/select-dropdown-v2.scss +1 -1
  103. package/src/theme-chalk/select-dropdown.scss +57 -57
  104. package/src/theme-chalk/select-v2.scss +4 -4
  105. package/src/theme-chalk/select.scss +264 -264
  106. package/src/theme-chalk/skeleton-item.scss +83 -83
  107. package/src/theme-chalk/skeleton.scss +44 -44
  108. package/src/theme-chalk/slider.scss +212 -212
  109. package/src/theme-chalk/space.scss +20 -20
  110. package/src/theme-chalk/spinner.scss +43 -43
  111. package/src/theme-chalk/statistic.scss +35 -35
  112. package/src/theme-chalk/step.scss +316 -316
  113. package/src/theme-chalk/steps.scss +21 -21
  114. package/src/theme-chalk/switch.scss +300 -300
  115. package/src/theme-chalk/table-column.scss +98 -98
  116. package/src/theme-chalk/table-v2.scss +236 -236
  117. package/src/theme-chalk/table.scss +694 -694
  118. package/src/theme-chalk/tabs.scss +660 -660
  119. package/src/theme-chalk/tag.scss +181 -181
  120. package/src/theme-chalk/text.scss +51 -51
  121. package/src/theme-chalk/time-picker.scss +5 -5
  122. package/src/theme-chalk/time-select.scss +37 -37
  123. package/src/theme-chalk/timeline-item.scss +84 -84
  124. package/src/theme-chalk/timeline.scss +46 -46
  125. package/src/theme-chalk/tooltip-v2.scss +95 -95
  126. package/src/theme-chalk/tour.scss +187 -187
  127. package/src/theme-chalk/transfer.scss +203 -203
  128. package/src/theme-chalk/tree-select.scss +41 -41
  129. package/src/theme-chalk/tree.scss +134 -134
  130. package/src/theme-chalk/upload.scss +654 -654
  131. package/src/theme-chalk/var.scss +87 -87
  132. package/src/theme-chalk/virtual-list.scss +40 -40
package/README.md CHANGED
@@ -1,134 +1,134 @@
1
- ## 项目说明
2
-
3
- > 这是一个基于前端框架TypeDom创建的UI组件库。
4
- > 框架基于TypeDom框架开发,TypeDom框架基于TypeScript开发。
5
- > 对标 element-plus 的组件开发。
6
-
7
- ## 安装
8
-
9
- > npm install @type-dom/ui
10
-
11
- ## 框架介绍
12
-
13
- 1、技术栈
14
- – type-dom框架
15
- – webpack
16
- – typescript
17
- – 抽象类
18
- – 实体类
19
- 2、项目结构
20
- – src
21
- – components
22
- - basic
23
- - data
24
- - feedback
25
- - form
26
- - navigation
27
- - other
28
- – constants
29
- - hooks
30
- - locale
31
- - styles
32
- - theme-chalk
33
- - utils
34
- - index.ts
35
- - test
36
-
37
- # type-dom UI组件库
38
-
39
- ## basic 基础组件(共8项,完成8项)
40
-
41
- Button 按钮 ✔️
42
- Container 容器 ✔️
43
- td-header
44
- td-aside
45
- td-main
46
- td-footer
47
- Icon 图标 ✔️
48
- Layout 布局 ✔️
49
- Row
50
- Col
51
- Link 链接 ✔️
52
- Text 文本 ✔️
53
- Scrollbar 滚动条 ✔️
54
- Space 间距 ✔️
55
-
56
- ## data 数据组件(共23项,完成12项)
57
-
58
- Avatar 头像 ✔️
59
- Badge 徽章 ✔️
60
- Calendar 日历
61
- Card 卡片 ✔️
62
- Carousel 走马灯
63
- Collapse 折叠面板 ✔️
64
- Descriptions 描述列表 ✔️
65
- Empty 空状态 ✔️
66
- Image 图片 ✔️
67
- Infinite Scroll 无限滚动
68
- Pagination 分页
69
- Progress 进度条 ✔️
70
- Result 结果 ✔️
71
- Skeleton 骨架屏
72
- Table 表格
73
- Virtualized Table 虚拟化表
74
- Tag 标签 ✔️
75
- Timeline 时间线
76
- Tree 树形控件
77
- TreeSelect 树形选择
78
- Virtualized Tree 虚拟化树形控件
79
- Statistic 统计组件 ✔️
80
- Segmented 分段控制器 ✔️
81
-
82
- ## form 表单组件(共20项,完成7项)
83
-
84
- Autocomplete 自动补全输入框
85
- Cascader 级联选择器
86
- Checkbox 多选框 ✔️
87
- ColorPicker 颜色选择器
88
- DatePicker 日期选择器
89
- DateTimePicker 日期时间选择器
90
- Form 表单 ⚠️
91
- Input 输入框 ✔️
92
- Input Number 数字输入框 ✔️
93
- Input Tag 标签输入框
94
- Radio 单选框 ✔️
95
- Rate 评分 ✔️
96
- Select 选择器 🔄
97
- Virtualized Select 虚拟化选择器
98
- Slider 滑块 ✔️
99
- Switch 开关 ✔️
100
- TimePicker 时间选择器
101
- TimeSelect 时间选择
102
- Transfer 穿梭框
103
- Upload 上传 ⚠️
104
-
105
-
106
- ## feedback 反馈组件(共10项,完成8项)
107
-
108
- Alert 提示 ✔️
109
- Dialog 对话框 ✔️
110
- Drawer 抽屉
111
- Loading 加载
112
- Message 消息提示 ✔️
113
- Message Box 消息弹出框 ✔️
114
- Notification 通知 ✔️
115
- Popconfirm 气泡确认框 ✔️
116
- Popover 弹出框 ✔️
117
- Tooltip 文字提示 ✔️
118
-
119
- ## navigation 导航组件(共9项,完成2项)
120
-
121
- Affix 固钉 ⚠️
122
- Anchor 锚点 ⚠️
123
- Backtop 回到顶部 ✔️
124
- Breadcrumb 面包屑 ✔️
125
- Dropdown 下拉菜单
126
- Menu 菜单 🔄
127
- Page Header 页头
128
- Steps 步骤条
129
- Tabs 标签页 🔄
130
-
131
- ## other 其它组件
132
-
133
- Divider 分割线 ✔️
134
- Watermark 水印
1
+ ## 项目说明
2
+
3
+ > 这是一个基于前端框架TypeDom创建的UI组件库。
4
+ > 框架基于TypeDom框架开发,TypeDom框架基于TypeScript开发。
5
+ > 对标 element-plus 的组件开发。
6
+
7
+ ## 安装
8
+
9
+ > npm install @type-dom/ui
10
+
11
+ ## 框架介绍
12
+
13
+ 1、技术栈
14
+ – type-dom框架
15
+ – webpack
16
+ – typescript
17
+ – 抽象类
18
+ – 实体类
19
+ 2、项目结构
20
+ – src
21
+ – components
22
+ - basic
23
+ - data
24
+ - feedback
25
+ - form
26
+ - navigation
27
+ - other
28
+ – constants
29
+ - hooks
30
+ - locale
31
+ - styles
32
+ - theme-chalk
33
+ - utils
34
+ - index.ts
35
+ - test
36
+
37
+ # type-dom UI组件库
38
+
39
+ ## basic 基础组件(共8项,完成8项)
40
+
41
+ Button 按钮 ✔️
42
+ Container 容器 ✔️
43
+ td-header
44
+ td-aside
45
+ td-main
46
+ td-footer
47
+ Icon 图标 ✔️
48
+ Layout 布局 ✔️
49
+ Row
50
+ Col
51
+ Link 链接 ✔️
52
+ Text 文本 ✔️
53
+ Scrollbar 滚动条 ✔️
54
+ Space 间距 ✔️
55
+
56
+ ## data 数据组件(共23项,完成12项)
57
+
58
+ Avatar 头像 ✔️
59
+ Badge 徽章 ✔️
60
+ Calendar 日历
61
+ Card 卡片 ✔️
62
+ Carousel 走马灯
63
+ Collapse 折叠面板 ✔️
64
+ Descriptions 描述列表 ✔️
65
+ Empty 空状态 ✔️
66
+ Image 图片 ✔️
67
+ Infinite Scroll 无限滚动
68
+ Pagination 分页
69
+ Progress 进度条 ✔️
70
+ Result 结果 ✔️
71
+ Skeleton 骨架屏
72
+ Table 表格
73
+ Virtualized Table 虚拟化表
74
+ Tag 标签 ✔️
75
+ Timeline 时间线
76
+ Tree 树形控件
77
+ TreeSelect 树形选择
78
+ Virtualized Tree 虚拟化树形控件
79
+ Statistic 统计组件 ✔️
80
+ Segmented 分段控制器 ✔️
81
+
82
+ ## form 表单组件(共20项,完成7项)
83
+
84
+ Autocomplete 自动补全输入框
85
+ Cascader 级联选择器
86
+ Checkbox 多选框 ✔️
87
+ ColorPicker 颜色选择器
88
+ DatePicker 日期选择器
89
+ DateTimePicker 日期时间选择器
90
+ Form 表单 ⚠️
91
+ Input 输入框 ✔️
92
+ Input Number 数字输入框 ✔️
93
+ Input Tag 标签输入框
94
+ Radio 单选框 ✔️
95
+ Rate 评分 ✔️
96
+ Select 选择器 🔄
97
+ Virtualized Select 虚拟化选择器
98
+ Slider 滑块 ✔️
99
+ Switch 开关 ✔️
100
+ TimePicker 时间选择器
101
+ TimeSelect 时间选择
102
+ Transfer 穿梭框
103
+ Upload 上传 ⚠️
104
+
105
+
106
+ ## feedback 反馈组件(共10项,完成8项)
107
+
108
+ Alert 提示 ✔️
109
+ Dialog 对话框 ✔️
110
+ Drawer 抽屉
111
+ Loading 加载
112
+ Message 消息提示 ✔️
113
+ Message Box 消息弹出框 ✔️
114
+ Notification 通知 ✔️
115
+ Popconfirm 气泡确认框 ✔️
116
+ Popover 弹出框 ✔️
117
+ Tooltip 文字提示 ✔️
118
+
119
+ ## navigation 导航组件(共9项,完成2项)
120
+
121
+ Affix 固钉 ⚠️
122
+ Anchor 锚点 ⚠️
123
+ Backtop 回到顶部 ✔️
124
+ Breadcrumb 面包屑 ✔️
125
+ Dropdown 下拉菜单
126
+ Menu 菜单 🔄
127
+ Page Header 页头
128
+ Steps 步骤条
129
+ Tabs 标签页 🔄
130
+
131
+ ## other 其它组件
132
+
133
+ Divider 分割线 ✔️
134
+ Watermark 水印
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@type-dom/ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "dependencies": {
5
+ "lodash": "^4.17.21",
6
+ "sass-embedded": "^1.86.3",
5
7
  "@type-dom/async-validator": "*",
6
8
  "@type-dom/color": "*",
7
9
  "@type-dom/css-type": "*",
@@ -51,11 +51,11 @@ class TdProgress extends framework_1.TypeDiv {
51
51
  const trackPath = (0, signals_1.computed)(() => {
52
52
  const r = radius.get();
53
53
  const isDashboard = props.type === 'dashboard';
54
- return `
55
- M 50 50
56
- m 0 ${isDashboard ? '' : '-'}${r}
57
- a ${r} ${r} 0 1 1 0 ${isDashboard ? '-' : ''}${r * 2}
58
- a ${r} ${r} 0 1 1 0 ${isDashboard ? '' : '-'}${r * 2}
54
+ return `
55
+ M 50 50
56
+ m 0 ${isDashboard ? '' : '-'}${r}
57
+ a ${r} ${r} 0 1 1 0 ${isDashboard ? '-' : ''}${r * 2}
58
+ a ${r} ${r} 0 1 1 0 ${isDashboard ? '' : '-'}${r * 2}
59
59
  `;
60
60
  });
61
61
  const perimeter = (0, signals_1.computed)(() => 2 * Math.PI * radius.get());
@@ -6,8 +6,8 @@ const utils_1 = require("@type-dom/utils");
6
6
  const useDeprecated = ({ from, replacement, scope, version, ref, type = 'API' }, condition) => {
7
7
  (0, signals_1.watch)(() => (0, signals_1.unref)(condition), (val) => {
8
8
  if (val) {
9
- (0, utils_1.debugWarn)(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
10
- For more detail, please visit: ${ref}
9
+ (0, utils_1.debugWarn)(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
10
+ For more detail, please visit: ${ref}
11
11
  `);
12
12
  }
13
13
  }, {
@@ -19,10 +19,10 @@ const useId = (deterministicId) => {
19
19
  // const idInjection = defaultIdInjection;
20
20
  const idInjection = (0, exports.useIdInjection)();
21
21
  if (!utils_1.isClient && idInjection === defaultIdInjection) {
22
- console.warn('IdInjection', `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
23
- usage: app.provide(ID_INJECTION_KEY, {
24
- prefix: number,
25
- current: number,
22
+ console.warn('IdInjection', `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
23
+ usage: app.provide(ID_INJECTION_KEY, {
24
+ prefix: number,
25
+ current: number,
26
26
  })`);
27
27
  }
28
28
  // NOTE: Here we use `computedEager` to calculate the id value immediately, avoiding inconsistent id generation due to the lazy feature of `computed` when server rendering.
@@ -35,7 +35,7 @@ const useZIndex = (zIndexOverrides) => {
35
35
  return currentZIndex.get();
36
36
  };
37
37
  if (!utils_1.isClient && !(0, framework_1.inject)(exports.ZINDEX_INJECTION_KEY)) {
38
- (0, utils_1.debugWarn)('ZIndexInjection', `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
38
+ (0, utils_1.debugWarn)('ZIndexInjection', `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
39
39
  usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
40
40
  }
41
41
  return {
@@ -1,7 +1,7 @@
1
- @use 'mixins/mixins' as *;
2
-
3
- @include b(affix) {
4
- @include m(fixed) {
5
- position: fixed;
6
- }
7
- }
1
+ @use 'mixins/mixins' as *;
2
+
3
+ @include b(affix) {
4
+ @include m(fixed) {
5
+ position: fixed;
6
+ }
7
+ }
@@ -1,115 +1,115 @@
1
- @use 'mixins/mixins' as *;
2
- @use 'mixins/var' as *;
3
- @use 'common/var' as *;
4
-
5
- @include b(alert) {
6
- @include set-component-css-var('alert', $alert);
7
-
8
- width: 100%;
9
- padding: getCssVar('alert', 'padding');
10
- margin: 0;
11
- box-sizing: border-box;
12
- border-radius: getCssVar('alert', 'border-radius-base');
13
- position: relative;
14
- background-color: getCssVar('color', 'white');
15
- overflow: hidden;
16
- opacity: 1;
17
- display: flex;
18
- align-items: center;
19
- transition: opacity getCssVar('transition-duration', 'fast');
20
-
21
- @include when(light) {
22
- .#{$namespace}-alert__close-btn {
23
- color: getCssVar('text-color', 'placeholder');
24
- }
25
- }
26
-
27
- @include when(dark) {
28
- .#{$namespace}-alert__close-btn {
29
- color: getCssVar('color', 'white');
30
- }
31
- .#{$namespace}-alert__description {
32
- color: getCssVar('color', 'white');
33
- }
34
- }
35
-
36
- @include when(center) {
37
- justify-content: center;
38
- }
39
-
40
- @each $type in (success, info, warning, error) {
41
- @include m($type) {
42
- @include css-var-from-global(
43
- ('alert', 'bg-color'),
44
- ('color', $type, 'light-9')
45
- );
46
-
47
- &.is-light {
48
- background-color: getCssVar('alert', 'bg-color');
49
- color: getCssVar('color', $type);
50
-
51
- .#{$namespace}-alert__description {
52
- color: getCssVar('color', $type);
53
- }
54
- }
55
-
56
- &.is-dark {
57
- background-color: getCssVar('color', $type);
58
- color: getCssVar('color', 'white');
59
- }
60
- }
61
- }
62
-
63
- @include e(content) {
64
- display: flex;
65
- flex-direction: column;
66
- gap: 4px;
67
- }
68
-
69
- & .#{$namespace}-alert__icon {
70
- font-size: getCssVar('alert', 'icon-size');
71
- width: getCssVar('alert', 'icon-size');
72
- margin-right: 8px;
73
-
74
- @include when(big) {
75
- font-size: getCssVar('alert', 'icon-large-size');
76
- width: getCssVar('alert', 'icon-large-size');
77
- margin-right: 12px;
78
- }
79
- }
80
-
81
- @include e(title) {
82
- font-size: getCssVar('alert', 'title-font-size');
83
- line-height: 24px;
84
-
85
- &.with-description {
86
- font-size: getCssVar('alert', 'title-with-description-font-size');
87
- }
88
- }
89
-
90
- & .#{$namespace}-alert__description {
91
- font-size: getCssVar('alert', 'description-font-size');
92
- margin: 0;
93
- }
94
-
95
- & .#{$namespace}-alert__close-btn {
96
- font-size: getCssVar('alert', 'close-font-size');
97
- opacity: 1;
98
- position: absolute;
99
- top: 12px;
100
- right: 16px;
101
- cursor: pointer;
102
-
103
- @include when(customed) {
104
- font-style: normal;
105
- font-size: getCssVar('alert', 'close-customed-font-size');
106
- line-height: 24px;
107
- top: 8px;
108
- }
109
- }
110
- }
111
-
112
- .#{$namespace}-alert-fade-enter-from,
113
- .#{$namespace}-alert-fade-leave-active {
114
- opacity: 0;
115
- }
1
+ @use 'mixins/mixins' as *;
2
+ @use 'mixins/var' as *;
3
+ @use 'common/var' as *;
4
+
5
+ @include b(alert) {
6
+ @include set-component-css-var('alert', $alert);
7
+
8
+ width: 100%;
9
+ padding: getCssVar('alert', 'padding');
10
+ margin: 0;
11
+ box-sizing: border-box;
12
+ border-radius: getCssVar('alert', 'border-radius-base');
13
+ position: relative;
14
+ background-color: getCssVar('color', 'white');
15
+ overflow: hidden;
16
+ opacity: 1;
17
+ display: flex;
18
+ align-items: center;
19
+ transition: opacity getCssVar('transition-duration', 'fast');
20
+
21
+ @include when(light) {
22
+ .#{$namespace}-alert__close-btn {
23
+ color: getCssVar('text-color', 'placeholder');
24
+ }
25
+ }
26
+
27
+ @include when(dark) {
28
+ .#{$namespace}-alert__close-btn {
29
+ color: getCssVar('color', 'white');
30
+ }
31
+ .#{$namespace}-alert__description {
32
+ color: getCssVar('color', 'white');
33
+ }
34
+ }
35
+
36
+ @include when(center) {
37
+ justify-content: center;
38
+ }
39
+
40
+ @each $type in (success, info, warning, error) {
41
+ @include m($type) {
42
+ @include css-var-from-global(
43
+ ('alert', 'bg-color'),
44
+ ('color', $type, 'light-9')
45
+ );
46
+
47
+ &.is-light {
48
+ background-color: getCssVar('alert', 'bg-color');
49
+ color: getCssVar('color', $type);
50
+
51
+ .#{$namespace}-alert__description {
52
+ color: getCssVar('color', $type);
53
+ }
54
+ }
55
+
56
+ &.is-dark {
57
+ background-color: getCssVar('color', $type);
58
+ color: getCssVar('color', 'white');
59
+ }
60
+ }
61
+ }
62
+
63
+ @include e(content) {
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 4px;
67
+ }
68
+
69
+ & .#{$namespace}-alert__icon {
70
+ font-size: getCssVar('alert', 'icon-size');
71
+ width: getCssVar('alert', 'icon-size');
72
+ margin-right: 8px;
73
+
74
+ @include when(big) {
75
+ font-size: getCssVar('alert', 'icon-large-size');
76
+ width: getCssVar('alert', 'icon-large-size');
77
+ margin-right: 12px;
78
+ }
79
+ }
80
+
81
+ @include e(title) {
82
+ font-size: getCssVar('alert', 'title-font-size');
83
+ line-height: 24px;
84
+
85
+ &.with-description {
86
+ font-size: getCssVar('alert', 'title-with-description-font-size');
87
+ }
88
+ }
89
+
90
+ & .#{$namespace}-alert__description {
91
+ font-size: getCssVar('alert', 'description-font-size');
92
+ margin: 0;
93
+ }
94
+
95
+ & .#{$namespace}-alert__close-btn {
96
+ font-size: getCssVar('alert', 'close-font-size');
97
+ opacity: 1;
98
+ position: absolute;
99
+ top: 12px;
100
+ right: 16px;
101
+ cursor: pointer;
102
+
103
+ @include when(customed) {
104
+ font-style: normal;
105
+ font-size: getCssVar('alert', 'close-customed-font-size');
106
+ line-height: 24px;
107
+ top: 8px;
108
+ }
109
+ }
110
+ }
111
+
112
+ .#{$namespace}-alert-fade-enter-from,
113
+ .#{$namespace}-alert-fade-leave-active {
114
+ opacity: 0;
115
+ }
@@ -1,41 +1,41 @@
1
- @use 'sass:map';
2
-
3
- @use 'mixins/mixins' as *;
4
- @use 'mixins/var' as *;
5
- @use 'common/var' as *;
6
-
7
- @include b(anchor) {
8
- @include e(item) {
9
- overflow: hidden;
10
- display: flex;
11
- flex-direction: column;
12
- }
13
-
14
- @include e(link) {
15
- font-size: getCssVar('anchor-font-size');
16
- line-height: getCssVar('anchor-line-height');
17
- padding: 4px 0;
18
- color: getCssVar('anchor-color');
19
- transition: color getCssVar('transition-duration');
20
- white-space: nowrap;
21
- text-decoration: none;
22
- text-overflow: ellipsis;
23
- overflow: hidden;
24
- max-width: 100%;
25
- outline: none;
26
- cursor: pointer;
27
-
28
- &:hover,
29
- &:focus {
30
- color: getCssVar('anchor-color');
31
- }
32
-
33
- @include when(active) {
34
- color: getCssVar('anchor-active-color');
35
- }
36
- }
37
-
38
- & .#{$namespace}-anchor__list .#{$namespace}-anchor__item a {
39
- display: inline-block;
40
- }
41
- }
1
+ @use 'sass:map';
2
+
3
+ @use 'mixins/mixins' as *;
4
+ @use 'mixins/var' as *;
5
+ @use 'common/var' as *;
6
+
7
+ @include b(anchor) {
8
+ @include e(item) {
9
+ overflow: hidden;
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ @include e(link) {
15
+ font-size: getCssVar('anchor-font-size');
16
+ line-height: getCssVar('anchor-line-height');
17
+ padding: 4px 0;
18
+ color: getCssVar('anchor-color');
19
+ transition: color getCssVar('transition-duration');
20
+ white-space: nowrap;
21
+ text-decoration: none;
22
+ text-overflow: ellipsis;
23
+ overflow: hidden;
24
+ max-width: 100%;
25
+ outline: none;
26
+ cursor: pointer;
27
+
28
+ &:hover,
29
+ &:focus {
30
+ color: getCssVar('anchor-color');
31
+ }
32
+
33
+ @include when(active) {
34
+ color: getCssVar('anchor-active-color');
35
+ }
36
+ }
37
+
38
+ & .#{$namespace}-anchor__list .#{$namespace}-anchor__item a {
39
+ display: inline-block;
40
+ }
41
+ }