@opendesign-plus-test/components 0.0.1-rc.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.
Files changed (52) hide show
  1. package/dist/components.cjs.js +1 -0
  2. package/dist/components.css +1 -0
  3. package/dist/components.es.js +1193 -0
  4. package/dist/components.umd.js +1 -0
  5. package/docs/design.md +27 -0
  6. package/docs/design_banner.md +41 -0
  7. package/docs/design_section.md +27 -0
  8. package/package.json +47 -0
  9. package/scripts/generate-components-index.js +81 -0
  10. package/src/assets/svg-icons/icon-chevron-right.svg +3 -0
  11. package/src/assets/svg-icons/icon-close.svg +3 -0
  12. package/src/assets/svg-icons/icon-delete.svg +3 -0
  13. package/src/assets/svg-icons/icon-header-back.svg +3 -0
  14. package/src/assets/svg-icons/icon-header-delete.svg +3 -0
  15. package/src/assets/svg-icons/icon-header-search.svg +4 -0
  16. package/src/assets/svg-icons/icon-moon.svg +3 -0
  17. package/src/assets/svg-icons/icon-sun.svg +3 -0
  18. package/src/components/OBanner.vue +390 -0
  19. package/src/components/OCookieNotice.vue +417 -0
  20. package/src/components/OCookieNoticeEl.vue +403 -0
  21. package/src/components/OHeaderSearch.vue +601 -0
  22. package/src/components/OPlusConfigProvider.vue +32 -0
  23. package/src/components/OSection.vue +178 -0
  24. package/src/components/OThemeSwitcher.vue +108 -0
  25. package/src/components/common/ClientOnlyWrapper.ts +21 -0
  26. package/src/components/common/ContentWrapper.vue +85 -0
  27. package/src/draft/Banner.vue +265 -0
  28. package/src/draft/ButtonCards.vue +106 -0
  29. package/src/draft/Feature.vue +134 -0
  30. package/src/draft/Footer.vue +512 -0
  31. package/src/draft/HorizontalAnchor.vue +165 -0
  32. package/src/draft/ItemSwiper.vue +133 -0
  33. package/src/draft/Logo.vue +141 -0
  34. package/src/draft/LogoCard.vue +75 -0
  35. package/src/draft/LogoV2.vue +19 -0
  36. package/src/draft/MainCard.vue +38 -0
  37. package/src/draft/MultiCard.vue +95 -0
  38. package/src/draft/MultiIconCard.vue +74 -0
  39. package/src/draft/OInfoCard.vue +176 -0
  40. package/src/draft/Process.vue +81 -0
  41. package/src/draft/Section.vue +167 -0
  42. package/src/draft/SingleTabCard.vue +85 -0
  43. package/src/draft/SliderCard.vue +110 -0
  44. package/src/env.d.ts +1 -0
  45. package/src/i18n/en.ts +20 -0
  46. package/src/i18n/index.ts +42 -0
  47. package/src/i18n/zh.ts +9 -0
  48. package/src/index.ts +34 -0
  49. package/src/shared/provide.ts +6 -0
  50. package/src/vue.d.ts +10 -0
  51. package/tsconfig.json +33 -0
  52. package/vite.config.ts +90 -0
@@ -0,0 +1,512 @@
1
+ <script setup lang="ts">
2
+ import { ref, watch, type PropType } from 'vue';
3
+
4
+ import { linksData2, quickNav, friendshipLinks, filingData, localeData } from '@/data/footer';
5
+
6
+ import { ODivider } from '@opensig/opendesign';
7
+ import ContentWrapper from './ContentWrapper.vue';
8
+
9
+ import LogoFooter from '@/assets/category/footer/footer-logo2.png';
10
+ import LogoFooter1 from '@/assets/category/footer/footer-logo1.png';
11
+ import LogoAtom from '@/assets/category/footer/atom-logo.png';
12
+
13
+ // 公众号、小助手
14
+ import CodeTitleXzs from '@/assets/category/footer/img-xzs.png';
15
+ import CodeTitleGzh from '@/assets/category/footer/img-gzh.png';
16
+ import CodeImgXzs from '@/assets/category/footer/code-xzs.png';
17
+ import CodeImgZgz from '@/assets/category/footer/code-zgz.png';
18
+
19
+ import { useLocale } from '@/composables/useLocale';
20
+
21
+ const { t } = useLocale();
22
+
23
+ const props = defineProps({
24
+ lang: {
25
+ type: String as PropType<'zh' | 'en'>,
26
+ default: document.documentElement.getAttribute('lang') || 'zh',
27
+ },
28
+ target: {
29
+ type: String,
30
+ default: '_blank',
31
+ },
32
+ });
33
+
34
+ const locale = ref({});
35
+ watch(
36
+ () => props.lang,
37
+ (val) => {
38
+ locale.value = localeData[val];
39
+ },
40
+ { immediate: true }
41
+ );
42
+
43
+ // 公众号、小助手
44
+ const footerCodeList = [
45
+ {
46
+ img: CodeTitleGzh,
47
+ code: CodeImgZgz,
48
+ label: locale.qrAssistant,
49
+ },
50
+ {
51
+ img: CodeTitleXzs,
52
+ code: CodeImgXzs,
53
+ label: locale.qrCode,
54
+ },
55
+ ];
56
+ </script>
57
+
58
+ <template>
59
+ <div id="tour_footer" class="footer">
60
+ <ContentWrapper :pc-top="0" :mobile-top="0">
61
+ <div class="atom">
62
+ <p class="atom-text">{{ t('footer.atomText') }}</p>
63
+ <a href="https://openatom.cn" target="_blank">
64
+ <img :src="LogoAtom" class="atom-logo" alt="" />
65
+ </a>
66
+ </div>
67
+ <ODivider
68
+ :style="{
69
+ '--o-divider-bd-color': 'rgba(229, 229, 229, 0.12)',
70
+ '--o-divider-gap': '16px',
71
+ }"
72
+ />
73
+ </ContentWrapper>
74
+ <div class="footer-content">
75
+ <ContentWrapper :pc-top="0" :mobile-top="0">
76
+ <div class="quick-nav">
77
+ <div v-for="category in quickNav[lang]" class="category">
78
+ <div class="category-title">
79
+ {{ category.title }}
80
+ </div>
81
+ <ul class="navs">
82
+ <li v-for="nav in category.list" class="nav">
83
+ <a :href="nav.link" target="_blank" rel="noopener noreferrer">{{ nav.title }}</a>
84
+ </li>
85
+ </ul>
86
+ </div>
87
+ </div>
88
+ <div class="friendship-link">
89
+ <div class="friendship-link-title">
90
+ {{ locale.friendshipLink }}
91
+ </div>
92
+ <div class="friendship-link-box">
93
+ <a v-for="link in friendshipLinks[lang]" class="friendship-link-item" :href="link.link" :key="link.link" target="_blank">{{ link.title }}</a>
94
+ </div>
95
+ </div>
96
+ <div class="inner">
97
+ <div class="footer-logo">
98
+ <img class="show-pc" :src="LogoFooter" alt="" />
99
+ <img class="show-mo" :src="LogoFooter1" alt="" />
100
+ <p>
101
+ <a class="email" href="mailto:contact@openeuler.io" target="_blank"> contact@openeuler.io </a>
102
+ </p>
103
+ </div>
104
+ <div class="footer-option">
105
+ <div class="footer-option-item">
106
+ <template v-for="(link, index) in linksData2[lang]" :key="link.URL">
107
+ <a :target="target" :href="link.URL" class="link">{{ link.NAME }}</a>
108
+ <ODivider
109
+ v-if="index !== linksData2[lang].length - 1"
110
+ :style="{
111
+ '--o-divider-bd-color': 'var(--o-color-white)',
112
+ '--o-divider-label-gap': '0 8px',
113
+ }"
114
+ direction="v"
115
+ />
116
+ </template>
117
+ </div>
118
+ <p class="license">
119
+ <span>{{ locale.license_1 }}</span>
120
+ {{ locale.license_2 }}
121
+ </p>
122
+ <div class="copyright">
123
+ <p>{{ locale.copyRight1 }} {{ new Date().getFullYear() }} {{ locale.copyRight2 }},</p>
124
+ <div class="filing">
125
+ <a :href="filingData.link" target="_blank" class="filing-link">
126
+ {{ locale.filingText1 }}
127
+ </a>
128
+ <img :src="filingData.icon" class="filing-img" />
129
+ <p>{{ locale.filingText2 }}</p>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ <div class="footer-right">
134
+ <div v-if="lang === 'zh'" class="code-box">
135
+ <div v-for="(item, index) in footerCodeList" :key="index" class="code-pop">
136
+ <img :src="item.img" class="code-img" alt="" />
137
+ <div class="code-layer">
138
+ <img :src="item.code" alt="" />
139
+ <p class="txt">{{ item.label }}</p>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ </ContentWrapper>
146
+ </div>
147
+ </div>
148
+ </template>
149
+
150
+ <style lang="scss" scoped>
151
+ $color: #fff;
152
+ .o-divider {
153
+ @include tip2;
154
+ }
155
+ .footer {
156
+ &.is-doc {
157
+ margin-left: 300px;
158
+ @media (max-width: 1100px) {
159
+ margin-left: 0;
160
+ }
161
+ }
162
+ overflow: hidden;
163
+ background: #121214;
164
+ :deep(.app-content) {
165
+ padding-bottom: 0;
166
+ }
167
+ .atom {
168
+ text-align: center;
169
+ margin-top: 24px;
170
+ position: relative;
171
+
172
+ .atom-text {
173
+ color: $color;
174
+ @include h4;
175
+ }
176
+ .atom-logo {
177
+ height: 32px;
178
+ margin-top: 12px;
179
+ @include respond-to('<=pad_v') {
180
+ margin-top: 16px;
181
+ height: 30px;
182
+ }
183
+ }
184
+ }
185
+
186
+ .footer-content {
187
+ @include tip1;
188
+ background: url('@/assets/category/footer/footer-bg.png') no-repeat bottom center;
189
+ @include respond-to('<=pad_v') {
190
+ background: url('@/assets/category/footer/footer-bg-mo.png') no-repeat bottom center;
191
+ }
192
+ .quick-nav {
193
+ margin: 16px auto 0;
194
+ display: flex;
195
+ justify-content: space-between;
196
+ max-width: 1140px;
197
+ @include respond-to('<=pad_v') {
198
+ display: none;
199
+ }
200
+ .category {
201
+ text-align: left;
202
+ .category-title {
203
+ @include h4;
204
+ color: var(--o-color-white);
205
+ }
206
+ .navs {
207
+ display: flex;
208
+ flex-direction: column;
209
+ .nav {
210
+ margin-top: 8px;
211
+ @include tip1;
212
+ a {
213
+ color: rgba(255, 255, 255, 0.6);
214
+ @include hover {
215
+ color: rgba(255, 255, 255, 1);
216
+ }
217
+ }
218
+ }
219
+ .nav:first-child {
220
+ margin-top: 10px;
221
+ }
222
+ }
223
+ }
224
+ }
225
+ .friendship-link {
226
+ margin-top: 16px;
227
+ padding-bottom: 12px;
228
+ display: flex;
229
+ @include tip2;
230
+ //TODO: 颜色变量
231
+ border-bottom: 1px solid rgba(229, 229, 229, 0.12);
232
+ @include respond-to('<=pad_v') {
233
+ flex-direction: column;
234
+ padding-bottom: 16px;
235
+ .friendship-link-box {
236
+ margin-top: 12px;
237
+ }
238
+ }
239
+ .friendship-link-title {
240
+ color: var(--o-color-white);
241
+ margin-right: 38px;
242
+ @include respond-to('<=pad') {
243
+ margin-right: 24px;
244
+ min-width: 48px;
245
+ }
246
+ }
247
+ .friendship-link-item {
248
+ white-space: nowrap;
249
+ &:not(:last-of-type) {
250
+ margin-right: 24px;
251
+ @include respond-to('<=pad') {
252
+ margin-right: 12px;
253
+ }
254
+ }
255
+ color: rgba(255, 255, 255, 0.6);
256
+ @include hover {
257
+ color: rgba(255, 255, 255, 1);
258
+ }
259
+ }
260
+ }
261
+ .inner {
262
+ display: flex;
263
+ align-items: center;
264
+ justify-content: space-between;
265
+ padding: 8px 0 32px;
266
+ position: relative;
267
+ @include respond-to('<=pad_v') {
268
+ margin: 0 auto;
269
+ padding: 12px 0 24px;
270
+ flex-direction: column;
271
+ justify-content: space-between;
272
+ align-items: center;
273
+ }
274
+ }
275
+ }
276
+ .footer-logo {
277
+ flex: 1;
278
+ img {
279
+ height: 46px;
280
+ }
281
+ .show-pc {
282
+ display: block;
283
+ }
284
+ .show-mo {
285
+ display: none;
286
+ }
287
+ @include respond-to('<=pad_v') {
288
+ text-align: center;
289
+ margin: 16px 0;
290
+ .show-pc {
291
+ display: none;
292
+ }
293
+ .show-mo {
294
+ display: inline-block;
295
+ height: 20px;
296
+ }
297
+ p {
298
+ margin-top: 4px;
299
+ }
300
+ }
301
+ }
302
+
303
+ .copyright {
304
+ margin-top: 6px;
305
+ color: rgba(255, 255, 255, 0.6);
306
+ display: flex;
307
+ gap: var(--o-gap-2);
308
+
309
+ @include respond-to('<=pad') {
310
+ flex-direction: column;
311
+ gap: 6px;
312
+ }
313
+ @include respond-to('<=pad_v') {
314
+ margin-top: 4px;
315
+ gap: 4px;
316
+ }
317
+
318
+ .filing {
319
+ display: flex;
320
+ gap: var(--o-gap-2);
321
+
322
+ .filing-link {
323
+ color: rgba(255, 255, 255, 0.6);
324
+ @include hover {
325
+ color: rgba(255, 255, 255, 1);
326
+ }
327
+ }
328
+ .filing-img {
329
+ height: 16px;
330
+ width: 16px;
331
+ align-self: center;
332
+ }
333
+ }
334
+ }
335
+ .license {
336
+ color: $color;
337
+ margin-top: 6px;
338
+ span {
339
+ color: rgba(255, 255, 255, 0.6);
340
+ }
341
+ @include respond-to('<=pad_v') {
342
+ margin-top: 4px;
343
+ }
344
+ }
345
+
346
+ .footer-option {
347
+ text-align: center;
348
+ @include tip1;
349
+ .link {
350
+ color: $color;
351
+ display: inline-block;
352
+ }
353
+ .footer-option-item {
354
+ align-items: center;
355
+ }
356
+ @include respond-to('<=pad_v') {
357
+ order: -1;
358
+ }
359
+ }
360
+
361
+ .footer-right {
362
+ flex: 1;
363
+ .code-box {
364
+ display: flex;
365
+ justify-content: right;
366
+ gap: 16px;
367
+ .code-pop {
368
+ cursor: pointer;
369
+ position: relative;
370
+ height: 20px;
371
+ display: block;
372
+ > img {
373
+ height: 100%;
374
+ object-fit: cover;
375
+ }
376
+ .code-layer {
377
+ position: absolute;
378
+ top: -105px;
379
+ left: -32px;
380
+ z-index: 99;
381
+ display: none;
382
+ background: #fff;
383
+ padding: 6px;
384
+ img {
385
+ width: 78px;
386
+ height: 78px;
387
+ }
388
+ .txt {
389
+ margin-top: 8px;
390
+ color: $color;
391
+ display: none;
392
+ }
393
+ &::after {
394
+ border: 10px solid transparent;
395
+ content: '';
396
+ border-top-color: #fff;
397
+ position: absolute;
398
+ bottom: -20px;
399
+ left: 50%;
400
+ transform: translateX(-50%);
401
+ display: block;
402
+ }
403
+ @include respond-to('<=pad_v') {
404
+ display: block;
405
+ position: initial;
406
+ background: none;
407
+ padding: 0;
408
+ text-align: center;
409
+ &::after {
410
+ display: none !important;
411
+ }
412
+ .txt {
413
+ display: block;
414
+ }
415
+ }
416
+ }
417
+ @include hover {
418
+ .code-layer {
419
+ display: block;
420
+ }
421
+ }
422
+ @include respond-to('pad_h') {
423
+ height: 18px;
424
+ }
425
+ @include respond-to('<=pad_v') {
426
+ height: auto;
427
+ > img {
428
+ display: none;
429
+ }
430
+ }
431
+ }
432
+ @include respond-to('<=pad_v') {
433
+ justify-content: space-between;
434
+ }
435
+ }
436
+ .footer-links {
437
+ display: flex;
438
+ justify-content: right;
439
+ align-items: center;
440
+ gap: 12px;
441
+ margin-left: 24px;
442
+ .links-logo {
443
+ display: flex;
444
+ align-items: center;
445
+ height: 26px;
446
+ padding: 0 14px;
447
+ background-color: #2b2b2f;
448
+ border-radius: var(--o-radius-xs);
449
+ @include respond-to('pad_h') {
450
+ height: 26px;
451
+ padding: 0 8px;
452
+ }
453
+ @include respond-to('<=pad_v') {
454
+ height: 26px;
455
+ padding: 0 8px;
456
+ }
457
+ .logo {
458
+ object-fit: cover;
459
+ }
460
+ }
461
+ @include respond-to('pad_h') {
462
+ margin-left: 32px;
463
+ }
464
+ @include respond-to('<=pad_v') {
465
+ justify-content: center;
466
+ display: flex;
467
+ text-align: center;
468
+ margin-left: 0;
469
+ }
470
+ &.iszh {
471
+ margin-top: 12px;
472
+ gap: 12px 8px;
473
+ .links-logo {
474
+ padding: 0 9px;
475
+ height: 20px;
476
+ }
477
+ @include respond-to('<=pad') {
478
+ display: flex;
479
+ flex-wrap: wrap;
480
+ text-align: center;
481
+ }
482
+ }
483
+ }
484
+
485
+ p {
486
+ color: $color;
487
+ margin-top: var(--o-spacing-h8);
488
+ }
489
+ }
490
+
491
+ .email {
492
+ color: $color;
493
+ }
494
+ }
495
+
496
+ [lang='en'] {
497
+ .footer {
498
+ .footer-content {
499
+ .inner {
500
+ @include respond-to('<=pad_v') {
501
+ margin: 0 auto;
502
+ max-width: fit-content;
503
+ padding: 14px 0 24px;
504
+ flex-direction: column;
505
+ justify-content: space-between;
506
+ align-items: center;
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ </style>
@@ -0,0 +1,165 @@
1
+ <script lang="ts" setup>
2
+ import { ref, type PropType } from 'vue';
3
+
4
+ import { useIntersectionObserver } from '@vueuse/core';
5
+
6
+ import { OAnchor, OAnchorItem } from '@opensig/opendesign';
7
+ import ContentWrapper from './ContentWrapper.vue';
8
+
9
+ const target = ref(null);
10
+ const showAnchor = ref(false);
11
+ defineProps({
12
+ anchorData: {
13
+ type: Object,
14
+ required: true,
15
+ default: () => null,
16
+ },
17
+ wrapClass: {
18
+ type: [String, Array] as PropType<string | any[]>,
19
+ default: undefined,
20
+ },
21
+ transparent: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+ });
26
+
27
+ useIntersectionObserver(target, ([entry]) => {
28
+ showAnchor.value = !entry?.isIntersecting;
29
+ });
30
+ </script>
31
+ <template>
32
+ <div v-show="showAnchor" :class="[transparent ? 'anchor-transparent' : 'anchor-header', wrapClass]">
33
+ <ContentWrapper :style="{
34
+ '--content-wrapper-vertical-paddingTop': '0',
35
+ '--content-wrapper-vertical-paddingBottom': '0',
36
+ }">
37
+ <div class="anchor-container">
38
+ <OAnchor container="#app > .o-scroller > .o-scroller-container" :targetOffset="160">
39
+ <OAnchorItem v-for="anchor in anchorData" :key="anchor.id" :title="anchor.title" :href="`#${anchor.id}`">
40
+ </OAnchorItem>
41
+ </OAnchor>
42
+ </div>
43
+ </ContentWrapper>
44
+ </div>
45
+ <div ref="target"></div>
46
+ </template>
47
+
48
+ <style lang="scss" scoped>
49
+ .anchor-header {
50
+ position: fixed;
51
+ top: 0;
52
+ height: 68px;
53
+ z-index: 10;
54
+ background-color: var(--o-color-control2-light);
55
+ @include text1;
56
+
57
+ @include respond-to('<=pad_v') {
58
+ top: 48px;
59
+ height: 54px;
60
+ }
61
+
62
+ .anchor-container {
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ max-width: 920px;
67
+ margin: 0 auto;
68
+ height: 68px;
69
+
70
+ @include respond-to('<=pad_v') {
71
+ height: 54px;
72
+ }
73
+
74
+
75
+ :deep(.o-anchor) {
76
+ width: 100%;
77
+
78
+ .o-anchor-line {
79
+ display: none;
80
+ }
81
+
82
+ .o-anchor-items {
83
+ display: flex;
84
+ max-width: 920px;
85
+ width: 100%;
86
+ gap: var(--o-gap-4);
87
+ background-color: var(--o-color-control3-light);
88
+ padding: var(--o-gap-1);
89
+ border-radius: var(--o-radius-xs);
90
+ }
91
+
92
+ .o-anchor-item {
93
+ flex: 1 1 auto;
94
+ --anchor-item-link-bg-color-hover: transparent;
95
+ --anchor-item-link-color-hover: --anchor-item-link-gap: 0;
96
+ --anchor-item-link-radius: var(--o-radius-xs);
97
+ --anchor-item-min-width: 60px;
98
+ --anchor-item-link-gap: 0px;
99
+
100
+ .o-anchor-item-link {
101
+ @include text1;
102
+ --anchor-item-link-bg-color-active: var(--o-color-control5-light);
103
+ --anchor-item-link-color-active: var(--o-color-primary1);
104
+ --anchor-item-link-color-hover: var(--o-color-primary1);
105
+ --anchor-item-link-color: var(--o-color-info2);
106
+ --anchor-item-link-padding: 6px 0;
107
+ font-weight: 500;
108
+ display: block;
109
+ text-align: center;
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ .anchor-transparent {
117
+ position: fixed;
118
+ top: 0;
119
+ height: 48px;
120
+ backdrop-filter: blur(10px);
121
+ z-index: 10;
122
+ background-color: rgba($color: var(--o-mixedgray-1), $alpha: 0.25);
123
+ @include text1;
124
+
125
+ @include respond-to('<=pad_v') {
126
+ display: none;
127
+ }
128
+
129
+ .anchor-container {
130
+ display: flex;
131
+ align-items: center;
132
+ height: 48px;
133
+
134
+ :deep(.o-anchor) {
135
+ .o-anchor-line {
136
+ display: none;
137
+ }
138
+
139
+ .o-anchor-items {
140
+ display: flex;
141
+ flex-wrap: wrap;
142
+ }
143
+
144
+ .o-anchor-item {
145
+ --anchor-item-width: auto;
146
+ --anchor-item-min-width: auto;
147
+ --anchor-item-link-bg-color-hover: transparent;
148
+ --anchor-item-link-bg-color-active: transparent;
149
+ --anchor-item-link-color: var(--o-color-info3);
150
+ --anchor-item-link-color-active: var(--o-color-info1);
151
+ --anchor-item-link-color-hover: --anchor-item-link-gap: 0;
152
+ --anchor-item-link-padding: 0 32px 0 0;
153
+
154
+ .o-anchor-item-link {
155
+ @include hover {
156
+ &:not(.is-active) {
157
+ color: var(--o-color-info2);
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ </style>