@thl-ui/styles 0.0.0-stage → 0.1.1

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -2
  3. package/dist/components/alert.css +1 -0
  4. package/dist/components/app.css +1 -0
  5. package/dist/components/avatar.css +1 -0
  6. package/dist/components/badge.css +1 -0
  7. package/dist/components/button.css +1 -0
  8. package/dist/components/card.css +1 -0
  9. package/dist/components/form.css +1 -0
  10. package/dist/components/nav.css +1 -0
  11. package/dist/components/overlay.css +1 -0
  12. package/dist/components/pages.css +1 -0
  13. package/dist/components/progress.css +1 -0
  14. package/dist/components/ribbon.css +1 -0
  15. package/dist/components/table.css +1 -0
  16. package/dist/components/widgets.css +1 -0
  17. package/dist/fonts/OFL.txt +93 -0
  18. package/dist/fonts/open-sans-cyrillic-ext-wght-normal.woff2 +0 -0
  19. package/dist/fonts/open-sans-cyrillic-wght-normal.woff2 +0 -0
  20. package/dist/fonts/open-sans-greek-ext-wght-normal.woff2 +0 -0
  21. package/dist/fonts/open-sans-greek-wght-normal.woff2 +0 -0
  22. package/dist/fonts/open-sans-latin-ext-wght-normal.woff2 +0 -0
  23. package/dist/fonts/open-sans-latin-wght-normal.woff2 +0 -0
  24. package/dist/fonts/open-sans-vietnamese-wght-normal.woff2 +0 -0
  25. package/dist/fonts.css +70 -0
  26. package/dist/thl-ui.css +447 -0
  27. package/dist/tokens.css +376 -0
  28. package/package.json +48 -4
  29. package/src/_base.scss +408 -0
  30. package/src/_mixins.scss +53 -0
  31. package/src/components/_alert.scss +183 -0
  32. package/src/components/_avatar.scss +75 -0
  33. package/src/components/_badge.scss +112 -0
  34. package/src/components/_button.scss +242 -0
  35. package/src/components/_card.scss +211 -0
  36. package/src/components/_form.scss +959 -0
  37. package/src/components/_nav.scss +738 -0
  38. package/src/components/_overlay.scss +382 -0
  39. package/src/components/_progress.scss +103 -0
  40. package/src/components/_ribbon.scss +136 -0
  41. package/src/components/_table.scss +215 -0
  42. package/src/components/_widgets.scss +1102 -0
  43. package/src/index.scss +16 -0
  44. package/src/layout/_app.scss +804 -0
  45. package/src/pages/_pages.scss +691 -0
@@ -0,0 +1,738 @@
1
+ @use '../mixins' as *;
2
+
3
+ /* ---------- tabs ---------- */
4
+ .#{$p}-tabs {
5
+ &__list {
6
+ display: flex;
7
+ flex-wrap: nowrap;
8
+ overflow-x: auto;
9
+ scrollbar-width: none;
10
+ gap: 0;
11
+ margin: 0;
12
+ padding: 0;
13
+ list-style: none;
14
+ border-bottom: 1px solid v(border-color);
15
+ &::-webkit-scrollbar {
16
+ display: none;
17
+ }
18
+ }
19
+ &__tab {
20
+ flex-shrink: 0;
21
+ display: inline-flex;
22
+ align-items: center;
23
+ gap: 8px;
24
+ padding: 10px 18px;
25
+ margin-bottom: -1px;
26
+ color: v(text);
27
+ background: none;
28
+ font: inherit;
29
+ border: 1px solid transparent;
30
+ border-radius: v(radius) v(radius) 0 0;
31
+ cursor: pointer;
32
+ white-space: nowrap;
33
+ transition: color v(transition);
34
+ &:hover {
35
+ color: v(theme-text);
36
+ }
37
+ &.is-active {
38
+ color: v(heading);
39
+ background: v(surface);
40
+ border-color: v(border-color) v(border-color) v(surface);
41
+ }
42
+ &:disabled {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ }
46
+ }
47
+ &__panel {
48
+ padding: 20px 0;
49
+ animation: #{$p}-fade-in 0.25s;
50
+ &:focus-visible {
51
+ outline: none;
52
+ }
53
+ }
54
+ &--justified &__tab {
55
+ flex: 1;
56
+ justify-content: center;
57
+ }
58
+
59
+ /* underline: underline in theme color */
60
+ &--underline &__tab {
61
+ border: 0;
62
+ border-bottom: 2px solid transparent;
63
+ border-radius: 0;
64
+ &.is-active {
65
+ border-bottom-color: v(theme);
66
+ color: v(theme-text);
67
+ background: transparent;
68
+ }
69
+ }
70
+ /* filled: filled theme tabs */
71
+ &--filled &__list {
72
+ border-bottom: 0;
73
+ gap: 4px;
74
+ }
75
+ &--filled &__tab {
76
+ border: 0;
77
+ border-radius: v(radius-sm);
78
+ margin: 0;
79
+ &.is-active {
80
+ background: v(theme);
81
+ color: v(on-theme);
82
+ }
83
+ }
84
+ /* pills */
85
+ &--pills &__list,
86
+ &--pills-rounded &__list {
87
+ border: 0;
88
+ gap: 6px;
89
+ }
90
+ &--pills &__tab,
91
+ &--pills-rounded &__tab {
92
+ border: 0;
93
+ border-radius: v(radius);
94
+ margin: 0;
95
+ &.is-active {
96
+ background: v(theme);
97
+ color: v(on-theme);
98
+ }
99
+ }
100
+ &--pills-rounded &__tab {
101
+ border-radius: v(radius-pill);
102
+ }
103
+ /* line */
104
+ &--line &__tab {
105
+ border: 0;
106
+ border-radius: 0;
107
+ position: relative;
108
+ &::after {
109
+ content: '';
110
+ position: absolute;
111
+ inset-inline: 0;
112
+ bottom: 0;
113
+ height: 3px;
114
+ background: v(theme);
115
+ transform: scaleX(0);
116
+ transition: transform 0.3s;
117
+ }
118
+ &.is-active {
119
+ background: transparent;
120
+ color: v(theme-text);
121
+ &::after {
122
+ transform: scaleX(1);
123
+ }
124
+ }
125
+ }
126
+ /* vertical */
127
+ &--vertical {
128
+ display: flex;
129
+ gap: 0;
130
+ }
131
+ &--vertical &__list {
132
+ flex-direction: column;
133
+ border-bottom: 0;
134
+ border-inline-end: 1px solid v(border-color);
135
+ min-width: 160px;
136
+ }
137
+ &--vertical &__tab {
138
+ border: 0;
139
+ border-inline-end: 2px solid transparent;
140
+ border-radius: 0;
141
+ margin: 0;
142
+ margin-inline-end: -1px;
143
+ justify-content: flex-start;
144
+ &.is-active {
145
+ border-inline-end-color: v(theme);
146
+ background: v(surface-muted);
147
+ color: v(theme-text);
148
+ }
149
+ }
150
+ &--vertical &__panel {
151
+ padding: 0 20px;
152
+ flex: 1;
153
+ }
154
+ @include down(sm) {
155
+ &--vertical {
156
+ flex-direction: column;
157
+ }
158
+ &--vertical &__list {
159
+ flex-direction: row;
160
+ overflow-x: auto;
161
+ border-inline-end: 0;
162
+ border-bottom: 1px solid v(border-color);
163
+ }
164
+ }
165
+ }
166
+
167
+ /* ---------- breadcrumb ---------- */
168
+ .#{$p}-breadcrumb {
169
+ display: flex;
170
+ flex-wrap: wrap;
171
+ align-items: center;
172
+ gap: 6px;
173
+ margin: 0;
174
+ padding: 0;
175
+ list-style: none;
176
+ font-size: 14px;
177
+ &__item {
178
+ display: inline-flex;
179
+ align-items: center;
180
+ gap: 6px;
181
+ color: v(text);
182
+ a {
183
+ color: v(text-strong);
184
+ display: inline-flex;
185
+ align-items: center;
186
+ gap: 6px;
187
+ &:hover {
188
+ color: v(theme-text);
189
+ }
190
+ }
191
+ & + &::before {
192
+ content: '/';
193
+ color: v(text);
194
+ opacity: 0.6;
195
+ }
196
+ &.is-active {
197
+ color: v(theme-text);
198
+ }
199
+ }
200
+ }
201
+
202
+ /* ---------- pagination ---------- */
203
+ .#{$p}-pagination {
204
+ display: flex;
205
+ flex-wrap: wrap;
206
+ align-items: center;
207
+ gap: 0;
208
+ margin: 10px 0;
209
+ row-gap: 6px;
210
+ padding: 0;
211
+ list-style: none;
212
+ &__item {
213
+ min-width: 36px;
214
+ height: 36px;
215
+ padding: 0 10px;
216
+ display: inline-flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ font: inherit;
220
+ color: v(text-strong);
221
+ background: v(surface);
222
+ border: 1px solid v(border-color);
223
+ margin-inline-start: -1px;
224
+ cursor: pointer;
225
+ &:hover {
226
+ background: v(surface-muted);
227
+ color: v(theme-text);
228
+ }
229
+ &.is-active {
230
+ background: v(theme);
231
+ border-color: v(theme);
232
+ color: v(on-theme);
233
+ z-index: 1;
234
+ }
235
+ &:disabled {
236
+ opacity: 0.5;
237
+ cursor: not-allowed;
238
+ }
239
+ &--ellipsis {
240
+ cursor: default;
241
+ &:hover {
242
+ background: v(surface);
243
+ color: v(text-strong);
244
+ }
245
+ }
246
+ }
247
+ > li:first-child .#{$p}-pagination__item {
248
+ border-start-start-radius: v(radius);
249
+ border-end-start-radius: v(radius);
250
+ margin-inline-start: 0;
251
+ }
252
+ > li:last-child .#{$p}-pagination__item {
253
+ border-start-end-radius: v(radius);
254
+ border-end-end-radius: v(radius);
255
+ }
256
+ &--split {
257
+ gap: 6px;
258
+ .#{$p}-pagination__item {
259
+ border-radius: v(radius) !important;
260
+ margin: 0;
261
+ }
262
+ }
263
+ &--rounded {
264
+ gap: 6px;
265
+ .#{$p}-pagination__item {
266
+ border-radius: 50% !important;
267
+ margin: 0;
268
+ padding: 0;
269
+ }
270
+ }
271
+ &--size-sm &__item {
272
+ min-width: 30px;
273
+ height: 30px;
274
+ font-size: 12px;
275
+ }
276
+ &--size-lg &__item {
277
+ min-width: 46px;
278
+ height: 46px;
279
+ font-size: 18px;
280
+ }
281
+ &__total {
282
+ margin-inline-end: 12px;
283
+ color: v(text);
284
+ font-size: 13px;
285
+ }
286
+ &__size {
287
+ margin-inline-start: 12px;
288
+ }
289
+ }
290
+
291
+ /* ---------- steps ---------- */
292
+ .#{$p}-steps {
293
+ display: flex;
294
+ margin: 0 0 20px;
295
+ padding: 0;
296
+ list-style: none;
297
+ counter-reset: step;
298
+ &__item {
299
+ flex: 1;
300
+ position: relative;
301
+ display: flex;
302
+ gap: 12px;
303
+ align-items: center;
304
+ padding: 15px 20px;
305
+ background: v(surface-muted);
306
+ color: v(text);
307
+ min-width: 0;
308
+ border: 0;
309
+ font: inherit;
310
+ text-align: start;
311
+ &.is-active {
312
+ background: v(theme);
313
+ color: v(on-theme);
314
+ .#{$p}-steps__title {
315
+ color: v(on-theme);
316
+ }
317
+ .#{$p}-steps__desc {
318
+ color: v(on-theme);
319
+ }
320
+ }
321
+ &.is-done {
322
+ .#{$p}-steps__number {
323
+ background: v(color-success);
324
+ color: v(on-success);
325
+ border-color: v(color-success);
326
+ }
327
+ }
328
+ &.is-clickable {
329
+ cursor: pointer;
330
+ }
331
+ }
332
+ &__number {
333
+ width: 36px;
334
+ height: 36px;
335
+ flex-shrink: 0;
336
+ border-radius: 50%;
337
+ display: inline-flex;
338
+ align-items: center;
339
+ justify-content: center;
340
+ font-size: 18px;
341
+ font-weight: 600;
342
+ border: 2px solid currentColor;
343
+ }
344
+ &__title {
345
+ font-weight: 600;
346
+ color: v(heading);
347
+ font-size: 15px;
348
+ }
349
+ &__desc {
350
+ font-size: 12px;
351
+ }
352
+ /* no-bg */
353
+ &--no-bg &__item {
354
+ background: transparent;
355
+ border-bottom: 3px solid v(border-color);
356
+ &.is-active {
357
+ background: transparent;
358
+ color: v(theme-text);
359
+ border-bottom-color: v(theme);
360
+ .#{$p}-steps__title {
361
+ color: v(theme-text);
362
+ }
363
+ .#{$p}-steps__desc {
364
+ color: v(text-strong);
365
+ }
366
+ }
367
+ &.is-done {
368
+ border-bottom-color: v(color-success);
369
+ }
370
+ }
371
+ /* thin: compact */
372
+ &--thin &__item {
373
+ padding: 8px 14px;
374
+ }
375
+ &--thin &__number {
376
+ width: 26px;
377
+ height: 26px;
378
+ font-size: 13px;
379
+ }
380
+ /* line: dots + connecting line */
381
+ &--line &__item {
382
+ flex-direction: column;
383
+ text-align: center;
384
+ background: transparent;
385
+ padding: 0 8px;
386
+ &::before {
387
+ content: '';
388
+ position: absolute;
389
+ top: 18px;
390
+ inset-inline-start: calc(-50% + 18px);
391
+ width: calc(100% - 36px);
392
+ height: 2px;
393
+ background: v(border-color);
394
+ }
395
+ &:first-child::before {
396
+ display: none;
397
+ }
398
+ &.is-done::before,
399
+ &.is-active::before {
400
+ background: v(theme);
401
+ }
402
+ &.is-active {
403
+ background: transparent;
404
+ color: v(theme-text);
405
+ .#{$p}-steps__title {
406
+ color: v(theme-text);
407
+ }
408
+ .#{$p}-steps__desc {
409
+ color: v(text-strong);
410
+ }
411
+ .#{$p}-steps__number {
412
+ background: v(theme);
413
+ color: v(on-theme);
414
+ border-color: v(theme);
415
+ }
416
+ }
417
+ }
418
+ &--line &__number {
419
+ background: v(surface);
420
+ }
421
+ &--vertical {
422
+ flex-direction: column;
423
+ gap: 4px;
424
+ }
425
+ @include down(sm) {
426
+ &:not(&--line) {
427
+ flex-direction: column;
428
+ }
429
+ }
430
+ }
431
+
432
+ /* ---------- timeline ---------- */
433
+ .#{$p}-timeline {
434
+ list-style: none;
435
+ padding: 20px 0;
436
+ margin: 0;
437
+ position: relative;
438
+ &::before {
439
+ content: '';
440
+ position: absolute;
441
+ top: 0;
442
+ bottom: 0;
443
+ inset-inline-start: 50%;
444
+ width: 3px;
445
+ margin-inline-start: -1.5px;
446
+ background: v(border-color);
447
+ }
448
+ &__item {
449
+ position: relative;
450
+ margin-bottom: 30px;
451
+ display: flex;
452
+ justify-content: flex-start;
453
+ padding-inline-end: calc(50% + 40px);
454
+ &--inverted {
455
+ justify-content: flex-end;
456
+ padding-inline-end: 0;
457
+ padding-inline-start: calc(50% + 40px);
458
+ }
459
+ }
460
+ &__badge {
461
+ --_c: #{v(color-inverse)};
462
+ --_on: #{on('inverse')};
463
+ position: absolute;
464
+ top: 16px;
465
+ inset-inline-start: 50%;
466
+ margin-inline-start: -25px;
467
+ width: 50px;
468
+ height: 50px;
469
+ border-radius: 50%;
470
+ z-index: 1;
471
+ display: flex;
472
+ align-items: center;
473
+ justify-content: center;
474
+ color: var(--_on, #fff);
475
+ background: var(--_c);
476
+ font-size: 1.3em;
477
+ overflow: hidden;
478
+ img {
479
+ width: 100%;
480
+ height: 100%;
481
+ object-fit: cover;
482
+ }
483
+ @each $c in $colors {
484
+ &--#{$c} {
485
+ --_c: #{v(color-#{$c})};
486
+ --_on: #{on($c)};
487
+ }
488
+ }
489
+ }
490
+ &__panel {
491
+ position: relative;
492
+ width: 100%;
493
+ padding: 20px;
494
+ background: v(surface);
495
+ border: 1px solid v(border-color);
496
+ border-radius: v(radius);
497
+ box-shadow: v(shadow);
498
+ &::before {
499
+ content: '';
500
+ position: absolute;
501
+ top: 26px;
502
+ inset-inline-end: -15px;
503
+ border: 15px solid transparent;
504
+ border-inline-start-color: v(border-color);
505
+ border-inline-end: 0;
506
+ }
507
+ &::after {
508
+ content: '';
509
+ position: absolute;
510
+ top: 27px;
511
+ inset-inline-end: -14px;
512
+ border: 14px solid transparent;
513
+ border-inline-start-color: v(surface);
514
+ border-inline-end: 0;
515
+ }
516
+ }
517
+ &__item--inverted &__panel {
518
+ &::before {
519
+ inset-inline-end: auto;
520
+ inset-inline-start: -15px;
521
+ border-inline-start: 0;
522
+ border-inline-end: 15px solid v(border-color);
523
+ }
524
+ &::after {
525
+ inset-inline-end: auto;
526
+ inset-inline-start: -14px;
527
+ border-inline-start: 0;
528
+ border-inline-end: 14px solid v(surface);
529
+ }
530
+ }
531
+ &__title {
532
+ margin: 0 0 6px !important;
533
+ color: v(heading);
534
+ font-weight: 400;
535
+ font-size: 16px !important;
536
+ line-height: 22px !important;
537
+ }
538
+ &__time {
539
+ font-size: 12px;
540
+ color: v(text);
541
+ display: block;
542
+ margin-bottom: 8px;
543
+ }
544
+ /* left-aligned variant */
545
+ &--left::before {
546
+ inset-inline-start: 25px;
547
+ }
548
+ &--left &__item,
549
+ &--left &__item--inverted {
550
+ padding-inline: 80px 0;
551
+ justify-content: flex-start;
552
+ }
553
+ &--left &__badge {
554
+ inset-inline-start: 25px;
555
+ }
556
+ &--left &__panel::before {
557
+ inset-inline-end: auto;
558
+ inset-inline-start: -15px;
559
+ border-inline-start: 0;
560
+ border-inline-end: 15px solid v(border-color);
561
+ }
562
+ &--left &__panel::after {
563
+ inset-inline-end: auto;
564
+ inset-inline-start: -14px;
565
+ border-inline-start: 0;
566
+ border-inline-end: 14px solid v(surface);
567
+ }
568
+ @include down(sm) {
569
+ &::before {
570
+ inset-inline-start: 25px;
571
+ }
572
+ &__item,
573
+ &__item--inverted {
574
+ padding-inline: 80px 0;
575
+ justify-content: flex-start;
576
+ }
577
+ &__badge {
578
+ inset-inline-start: 25px;
579
+ }
580
+ &__panel::before {
581
+ inset-inline-end: auto !important;
582
+ inset-inline-start: -15px !important;
583
+ border-inline-start: 0 !important;
584
+ border-inline-end: 15px solid v(border-color) !important;
585
+ }
586
+ &__panel::after {
587
+ inset-inline-end: auto !important;
588
+ inset-inline-start: -14px !important;
589
+ border-inline-start: 0 !important;
590
+ border-inline-end: 14px solid v(surface) !important;
591
+ }
592
+ }
593
+ }
594
+ /* activity feed */
595
+ .#{$p}-activity-feed {
596
+ position: relative;
597
+ border-inline-start: 1px solid v(border-color);
598
+ margin-inline-start: 20px;
599
+ &__item {
600
+ display: flex;
601
+ gap: 15px;
602
+ margin-top: -10px;
603
+ margin-bottom: 30px;
604
+ }
605
+ &__left {
606
+ margin-inline-start: -20px;
607
+ flex-shrink: 0;
608
+ width: 40px;
609
+ height: 40px;
610
+ border-radius: 50%;
611
+ overflow: hidden;
612
+ display: flex;
613
+ align-items: center;
614
+ justify-content: center;
615
+ color: v(on-theme);
616
+ background: v(theme);
617
+ img {
618
+ width: 100%;
619
+ height: 100%;
620
+ object-fit: cover;
621
+ }
622
+ }
623
+ &__right {
624
+ flex: 1;
625
+ min-width: 0;
626
+ padding-top: 6px;
627
+ }
628
+ &__time {
629
+ font-size: 12px;
630
+ color: v(text);
631
+ margin-inline-start: 6px;
632
+ }
633
+ }
634
+ /* horizontal timeline */
635
+ .#{$p}-htimeline {
636
+ position: relative;
637
+ &__track {
638
+ display: flex;
639
+ position: relative;
640
+ overflow-x: auto;
641
+ padding: 30px 10px 20px;
642
+ gap: 0;
643
+ }
644
+ &__dot {
645
+ --dot: 14px;
646
+ flex: 1;
647
+ min-width: 100px;
648
+ position: relative;
649
+ text-align: center;
650
+ background: none;
651
+ border: 0;
652
+ font: inherit;
653
+ color: v(text);
654
+ cursor: pointer;
655
+ padding: 0 0 calc(var(--dot) + 12px);
656
+ font-size: 13px;
657
+ /* the track line: one segment per item, through the centre of the dot */
658
+ &::before {
659
+ content: '';
660
+ position: absolute;
661
+ inset-inline: 0;
662
+ bottom: calc(var(--dot) / 2 - 1px);
663
+ height: 2px;
664
+ background: v(border-color);
665
+ transition: background 0.3s;
666
+ }
667
+ &:first-child::before {
668
+ inset-inline-start: 50%;
669
+ }
670
+ &:last-child::before {
671
+ inset-inline-end: 50%;
672
+ }
673
+ &::after {
674
+ content: '';
675
+ position: absolute;
676
+ left: 50%;
677
+ bottom: 0;
678
+ transform: translateX(-50%);
679
+ width: var(--dot);
680
+ height: var(--dot);
681
+ box-sizing: border-box;
682
+ border-radius: 50%;
683
+ border: 2px solid v(border-color);
684
+ background: v(surface);
685
+ transition:
686
+ transform 0.3s,
687
+ background 0.3s,
688
+ border-color 0.3s;
689
+ }
690
+ &:hover::after,
691
+ &:focus-visible::after {
692
+ border-color: v(theme);
693
+ }
694
+ &.is-done::before {
695
+ background: v(theme);
696
+ }
697
+ &.is-done::after {
698
+ border-color: v(theme);
699
+ background: v(theme);
700
+ }
701
+ /* active: line filled up to the dot */
702
+ &.is-active::before {
703
+ background: linear-gradient(to right, #{v(theme)} 50%, #{v(border-color)} 50%);
704
+ }
705
+ &.is-active:first-child::before {
706
+ background: v(border-color);
707
+ }
708
+ &.is-active:last-child::before {
709
+ background: v(theme);
710
+ }
711
+ &.is-active {
712
+ color: v(theme-text);
713
+ font-weight: 600;
714
+ &::after {
715
+ border-color: v(theme);
716
+ background: v(theme);
717
+ transform: translateX(-50%) scale(1.3);
718
+ }
719
+ }
720
+ }
721
+ [dir='rtl'] &__dot.is-active:not(:first-child):not(:last-child)::before {
722
+ background: linear-gradient(to left, #{v(theme)} 50%, #{v(border-color)} 50%);
723
+ }
724
+ &__content {
725
+ padding: 20px 10px;
726
+ animation: #{$p}-fade-in 0.3s;
727
+ > :first-child {
728
+ font-size: v(h3);
729
+ line-height: 30px;
730
+ color: v(heading);
731
+ margin: 10px 0;
732
+ }
733
+ }
734
+ &__nav {
735
+ display: flex;
736
+ justify-content: space-between;
737
+ }
738
+ }