@thl-ui/styles 0.0.0-stage → 0.1.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 (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 +1050 -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,112 @@
1
+ @use '../mixins' as *;
2
+
3
+ .#{$p}-badge {
4
+ --_bg: #{v(color-default)};
5
+ --_fg: #{v(text-strong)};
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ min-width: 20px;
10
+ height: 20px;
11
+ padding: 0 7px;
12
+ font-size: 12px;
13
+ font-weight: 400;
14
+ line-height: 1;
15
+ color: var(--_fg);
16
+ background: var(--_bg);
17
+ border-radius: v(radius-pill);
18
+ @each $c in $colors {
19
+ @if $c != 'default' {
20
+ &--#{$c} {
21
+ --_bg: #{v(color-#{$c})};
22
+ --_fg: #{on($c)};
23
+ }
24
+ }
25
+ }
26
+ &--size-xs {
27
+ font-size: 9px;
28
+ height: 14px;
29
+ min-width: 14px;
30
+ padding: 0 4px;
31
+ }
32
+ &--size-sm {
33
+ font-size: 11px;
34
+ height: 18px;
35
+ min-width: 18px;
36
+ padding: 0 5px;
37
+ }
38
+ &--dot {
39
+ width: 10px;
40
+ height: 10px;
41
+ min-width: 0;
42
+ padding: 0;
43
+ }
44
+ &--square {
45
+ border-radius: v(radius-sm);
46
+ }
47
+ }
48
+ .#{$p}-badge-wrap {
49
+ position: relative;
50
+ display: inline-flex;
51
+ > .#{$p}-badge {
52
+ position: absolute;
53
+ top: -6px;
54
+ inset-inline-end: -8px;
55
+ border: 2px solid v(surface);
56
+ }
57
+ }
58
+
59
+ /* label (inline tag, optional rounded) */
60
+ .#{$p}-label {
61
+ --_bg: #{v(color-default)};
62
+ --_fg: #{v(text-strong)};
63
+ display: inline-block;
64
+ padding: 4px 12px 3px;
65
+ font-size: 75%;
66
+ font-weight: 400;
67
+ letter-spacing: 0.05em;
68
+ line-height: 1.4;
69
+ color: var(--_fg);
70
+ background: var(--_bg);
71
+ border: 1px solid var(--_bg);
72
+ border-radius: v(radius-sm);
73
+ white-space: nowrap;
74
+ @each $c in $colors {
75
+ @if $c != 'default' {
76
+ &--#{$c} {
77
+ --_bg: #{v(color-#{$c})};
78
+ --_fg: #{on($c)};
79
+ --_tx: #{tx($c)};
80
+ }
81
+ }
82
+ }
83
+ &--white {
84
+ --_bg: #fff;
85
+ --_fg: #{v(text-strong)};
86
+ }
87
+ &--rounded {
88
+ border-radius: v(radius-pill);
89
+ padding: 4px 16px 3px;
90
+ }
91
+ &--outline {
92
+ background: transparent;
93
+ color: var(--_tx, var(--_fg));
94
+ }
95
+ &--outline.#{$p}-label--default {
96
+ color: v(text-strong);
97
+ }
98
+ &__close {
99
+ margin-inline-start: 6px;
100
+ background: none;
101
+ border: 0;
102
+ color: inherit;
103
+ cursor: pointer;
104
+ padding: 0;
105
+ font-size: 1.1em;
106
+ line-height: 1;
107
+ opacity: 0.7;
108
+ &:hover {
109
+ opacity: 1;
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,242 @@
1
+ @use '../mixins' as *;
2
+
3
+ .#{$p}-btn {
4
+ --_bg: #{v(color-default)};
5
+ --_fg: #{v(text-strong)};
6
+ --_tx: #{v(text-strong)};
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ gap: 6px;
11
+ height: v(control-height);
12
+ padding: 0 16px;
13
+ font: inherit;
14
+ font-size: v(font-size);
15
+ font-weight: 400;
16
+ line-height: 1;
17
+ color: var(--_fg);
18
+ background: var(--_bg);
19
+ border: 2px solid var(--_bg);
20
+ border-radius: v(radius);
21
+ cursor: pointer;
22
+ white-space: nowrap;
23
+ user-select: none;
24
+ text-decoration: none;
25
+ position: relative;
26
+ overflow: hidden;
27
+ transition:
28
+ opacity v(transition),
29
+ background v(transition),
30
+ color v(transition),
31
+ box-shadow v(transition);
32
+ &:hover {
33
+ opacity: 0.85;
34
+ color: var(--_fg);
35
+ }
36
+ &:active {
37
+ transform: translateY(1px);
38
+ }
39
+ &:disabled,
40
+ &.is-disabled {
41
+ opacity: 0.55;
42
+ cursor: not-allowed;
43
+ pointer-events: none;
44
+ }
45
+
46
+ @each $c in $colors {
47
+ @if $c != 'default' {
48
+ &--#{$c} {
49
+ --_bg: #{v(color-#{$c})};
50
+ --_fg: #{on($c)};
51
+ --_tx: #{tx($c)};
52
+ }
53
+ }
54
+ }
55
+ &--link {
56
+ --_bg: transparent;
57
+ --_fg: #{v(link)};
58
+ --_tx: #{v(link)};
59
+ border-color: transparent;
60
+ &:hover {
61
+ text-decoration: underline;
62
+ }
63
+ }
64
+
65
+ &--outline {
66
+ background: transparent;
67
+ color: var(--_tx);
68
+ transition: all 0.3s;
69
+ &:hover {
70
+ background: var(--_bg);
71
+ color: var(--_fg);
72
+ opacity: 1;
73
+ }
74
+ }
75
+ &--outline.#{$p}-btn--default {
76
+ color: v(text-strong);
77
+ }
78
+
79
+ &--rounded {
80
+ border-radius: v(radius-pill);
81
+ }
82
+ &--circle {
83
+ border-radius: 50%;
84
+ padding: 0;
85
+ width: v(control-height);
86
+ }
87
+ &--block {
88
+ display: flex;
89
+ width: 100%;
90
+ }
91
+
92
+ &--size-xs {
93
+ height: 24px;
94
+ padding: 0 8px;
95
+ font-size: 12px;
96
+ }
97
+ &--size-sm {
98
+ height: v(control-height-sm);
99
+ padding: 0 12px;
100
+ font-size: 13px;
101
+ }
102
+ &--size-lg {
103
+ height: v(control-height-lg);
104
+ padding: 0 20px;
105
+ font-size: 16px;
106
+ }
107
+ &--size-xl {
108
+ height: 56px;
109
+ padding: 0 28px;
110
+ font-size: 18px;
111
+ }
112
+ &--circle {
113
+ &.#{$p}-btn--size-xs,
114
+ &.#{$p}-btn--size-sm,
115
+ &.#{$p}-btn--size-lg,
116
+ &.#{$p}-btn--size-xl {
117
+ padding: 0;
118
+ }
119
+ }
120
+ &--circle.#{$p}-btn--size-xs {
121
+ width: 24px;
122
+ }
123
+ &--circle.#{$p}-btn--size-sm {
124
+ width: v(control-height-sm);
125
+ }
126
+ &--circle.#{$p}-btn--size-lg {
127
+ width: 50px;
128
+ height: 50px;
129
+ font-size: 20px;
130
+ }
131
+ &--circle.#{$p}-btn--size-xl {
132
+ width: 70px;
133
+ height: 70px;
134
+ font-size: 24px;
135
+ }
136
+
137
+ // social brands
138
+ // brand colours; twitter/skype are light so they take dark ink, the rest darkened slightly where needed for AA
139
+ $social: (
140
+ facebook: #3b5998,
141
+ twitter: #55acee,
142
+ googleplus: #c9402e,
143
+ linkedin: #007bb6,
144
+ dribbble: #c7286a,
145
+ instagram: #3f729b,
146
+ pinterest: #cb2027,
147
+ youtube: #bb0000,
148
+ github: #171515,
149
+ skype: #00aff0,
150
+ dropbox: #0071d1,
151
+ tumblr: #32506d,
152
+ );
153
+ $social-dark-ink: (twitter, skype);
154
+ @each $name, $c in $social {
155
+ &--#{$name} {
156
+ --_bg: #{$c};
157
+ --_fg: #fff;
158
+ --_tx: #{$c};
159
+ }
160
+ }
161
+ @each $name in $social-dark-ink {
162
+ &--#{$name} {
163
+ --_fg: #1d2326;
164
+ }
165
+ }
166
+
167
+ &__label {
168
+ background: rgba(0, 0, 0, 0.08);
169
+ align-self: stretch;
170
+ display: inline-flex;
171
+ align-items: center;
172
+ margin-inline: -16px 6px;
173
+ padding: 0 12px;
174
+ }
175
+ &__icon {
176
+ display: inline-flex;
177
+ font-size: 1.1em;
178
+ }
179
+ &__spinner {
180
+ width: 1em;
181
+ height: 1em;
182
+ border: 2px solid currentColor;
183
+ border-right-color: transparent;
184
+ border-radius: 50%;
185
+ animation: #{$p}-spin 0.7s linear infinite;
186
+ }
187
+ &.is-loading {
188
+ pointer-events: none;
189
+ }
190
+
191
+ // ripple effect
192
+ &__ripple {
193
+ position: absolute;
194
+ border-radius: 50%;
195
+ background: rgba(255, 255, 255, 0.4);
196
+ transform: scale(0);
197
+ animation: #{$p}-ripple 0.6s linear;
198
+ pointer-events: none;
199
+ }
200
+ }
201
+ @keyframes #{$p}-ripple {
202
+ to {
203
+ transform: scale(4);
204
+ opacity: 0;
205
+ }
206
+ }
207
+
208
+ .#{$p}-btn-group {
209
+ display: inline-flex;
210
+ vertical-align: middle;
211
+ > .#{$p}-btn:not(:first-child) {
212
+ border-start-start-radius: 0;
213
+ border-end-start-radius: 0;
214
+ margin-inline-start: -2px;
215
+ }
216
+ > .#{$p}-btn:not(:last-child) {
217
+ border-start-end-radius: 0;
218
+ border-end-end-radius: 0;
219
+ }
220
+ &--vertical {
221
+ flex-direction: column;
222
+ > .#{$p}-btn {
223
+ border-radius: 0 !important;
224
+ margin: -2px 0 0 !important;
225
+ }
226
+ > .#{$p}-btn:first-child {
227
+ border-start-start-radius: v(radius) !important;
228
+ border-start-end-radius: v(radius) !important;
229
+ margin-top: 0 !important;
230
+ }
231
+ > .#{$p}-btn:last-child {
232
+ border-end-start-radius: v(radius) !important;
233
+ border-end-end-radius: v(radius) !important;
234
+ }
235
+ }
236
+ &--justified {
237
+ display: flex;
238
+ > .#{$p}-btn {
239
+ flex: 1;
240
+ }
241
+ }
242
+ }
@@ -0,0 +1,211 @@
1
+ @use '../mixins' as *;
2
+
3
+ /* card */
4
+ .#{$p}-card {
5
+ background: v(surface);
6
+ border: 1px solid v(border-color);
7
+ border-radius: v(radius);
8
+ margin-bottom: v(space-7);
9
+ position: relative;
10
+ min-width: 0;
11
+ &--shadow {
12
+ box-shadow: v(shadow-sm);
13
+ }
14
+ &--borderless {
15
+ border-color: transparent;
16
+ }
17
+ &__header {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ gap: v(space-3);
22
+ padding: 20px 25px 0;
23
+ flex-wrap: wrap;
24
+ }
25
+ &__title {
26
+ margin: 0 !important;
27
+ font-weight: 400;
28
+ font-size: v(h3) !important;
29
+ line-height: 30px !important;
30
+ color: v(heading);
31
+ text-transform: none;
32
+ }
33
+ &__subtitle {
34
+ margin: 4px 0 0;
35
+ font-size: 13px;
36
+ color: v(text);
37
+ }
38
+ &__actions {
39
+ display: flex;
40
+ gap: v(space-2);
41
+ align-items: center;
42
+ }
43
+ &__body {
44
+ padding: 25px;
45
+ }
46
+ &__header + &__body {
47
+ padding-top: 20px;
48
+ }
49
+ &--flush &__body {
50
+ padding: 0;
51
+ }
52
+ &__footer {
53
+ padding: 15px 25px;
54
+ border-top: 1px solid v(border-color);
55
+ }
56
+ &__media img {
57
+ display: block;
58
+ width: 100%;
59
+ border-start-start-radius: v(radius);
60
+ border-start-end-radius: v(radius);
61
+ }
62
+ > :last-child {
63
+ margin-bottom: 0;
64
+ }
65
+ }
66
+
67
+ /* .panel */
68
+ .#{$p}-panel {
69
+ --_c: #{v(surface-muted)};
70
+ --_fg: #{v(heading)};
71
+ background: v(surface);
72
+ border: 1px solid v(border-color);
73
+ border-radius: v(radius);
74
+ margin-bottom: v(space-7);
75
+ overflow: hidden;
76
+ position: relative;
77
+ @each $c in $colors {
78
+ @if $c != 'default' {
79
+ &--#{$c} {
80
+ --_c: #{v(color-#{$c})};
81
+ --_fg: #{on($c)};
82
+ border-color: v(color-#{$c});
83
+ }
84
+ }
85
+ }
86
+ &__heading {
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: space-between;
90
+ gap: v(space-3);
91
+ padding: 15px 25px;
92
+ background: var(--_c);
93
+ color: var(--_fg);
94
+ font-weight: 600;
95
+ font-size: 15px;
96
+ text-transform: uppercase;
97
+ border-bottom: 1px solid v(border-color);
98
+ }
99
+ &--primary &__heading,
100
+ &--success &__heading,
101
+ &--info &__heading,
102
+ &--warning &__heading,
103
+ &--danger &__heading,
104
+ &--inverse &__heading,
105
+ &--purple &__heading,
106
+ &--dark &__heading,
107
+ &--red &__heading {
108
+ border-bottom-color: transparent;
109
+ }
110
+ &__actions {
111
+ display: flex;
112
+ gap: 10px;
113
+ button {
114
+ background: none;
115
+ border: 0;
116
+ color: inherit;
117
+ cursor: pointer;
118
+ padding: 2px;
119
+ font-size: 16px;
120
+ opacity: 0.8;
121
+ &:hover {
122
+ opacity: 1;
123
+ }
124
+ }
125
+ }
126
+ &__wrapper {
127
+ display: grid;
128
+ grid-template-rows: 1fr;
129
+ transition: grid-template-rows 0.3s ease;
130
+ > * {
131
+ overflow: hidden;
132
+ }
133
+ }
134
+ &.is-collapsed &__wrapper {
135
+ grid-template-rows: 0fr;
136
+ }
137
+ &__body {
138
+ padding: 25px;
139
+ }
140
+ &__footer {
141
+ padding: 15px 25px;
142
+ border-top: 1px solid v(border-color);
143
+ background: v(surface-muted);
144
+ }
145
+ &.is-fullscreen {
146
+ position: fixed;
147
+ inset: 0;
148
+ z-index: v(z-modal);
149
+ margin: 0;
150
+ border-radius: 0;
151
+ overflow: auto;
152
+ }
153
+ }
154
+
155
+ /* block-ui overlay (blockUI plugin) */
156
+ .#{$p}-block-overlay {
157
+ position: absolute;
158
+ inset: 0;
159
+ z-index: 5;
160
+ display: flex;
161
+ flex-direction: column;
162
+ gap: 8px;
163
+ align-items: center;
164
+ justify-content: center;
165
+ background: color-mix(in srgb, #{v(surface)} 75%, transparent);
166
+ color: v(text-strong);
167
+ animation: #{$p}-fade-in 0.2s;
168
+ }
169
+
170
+ .#{$p}-well {
171
+ padding: 19px;
172
+ margin-bottom: 20px;
173
+ background: v(surface-muted);
174
+ border: 1px solid v(border-color);
175
+ border-radius: v(radius);
176
+ box-shadow: none;
177
+ &--sm {
178
+ padding: 9px;
179
+ }
180
+ &--lg {
181
+ padding: 24px;
182
+ }
183
+ }
184
+
185
+ .#{$p}-divider {
186
+ border: 0;
187
+ border-top: 1px solid v(border-color);
188
+ margin: 20px 0;
189
+ &--text {
190
+ display: flex;
191
+ align-items: center;
192
+ gap: 12px;
193
+ border: 0;
194
+ color: v(text);
195
+ font-size: 13px;
196
+ &::before,
197
+ &::after {
198
+ content: '';
199
+ flex: 1;
200
+ border-top: 1px solid v(border-color);
201
+ }
202
+ }
203
+ &--vertical {
204
+ display: inline-block;
205
+ height: 1em;
206
+ border-top: 0;
207
+ border-inline-start: 1px solid v(border-color);
208
+ margin: 0 8px;
209
+ vertical-align: middle;
210
+ }
211
+ }