@oruga-ui/theme-oruga 0.7.1 → 0.8.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 (48) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -5
  3. package/dist/scss/components/_autocomplete.scss +3 -12
  4. package/dist/scss/components/_breadcrumb.scss +122 -103
  5. package/dist/scss/components/_button.scss +228 -173
  6. package/dist/scss/components/_carousel.scss +164 -142
  7. package/dist/scss/components/_checkbox.scss +118 -118
  8. package/dist/scss/components/_collapse.scss +1 -1
  9. package/dist/scss/components/_datepicker.scss +228 -290
  10. package/dist/scss/components/_datetimepicker.scss +8 -2
  11. package/dist/scss/components/_dialog.scss +243 -0
  12. package/dist/scss/components/_dropdown.scss +190 -164
  13. package/dist/scss/components/_field.scss +68 -39
  14. package/dist/scss/components/_icon.scss +24 -29
  15. package/dist/scss/components/_input.scss +112 -97
  16. package/dist/scss/components/_listbox.scss +176 -0
  17. package/dist/scss/components/_loading.scss +35 -15
  18. package/dist/scss/components/_menu.scss +113 -109
  19. package/dist/scss/components/_modal.scss +112 -50
  20. package/dist/scss/components/_notification.scss +113 -97
  21. package/dist/scss/components/_pagination.scss +173 -106
  22. package/dist/scss/components/_radio.scss +91 -84
  23. package/dist/scss/components/_select.scss +108 -115
  24. package/dist/scss/components/_sidebar.scss +102 -101
  25. package/dist/scss/components/_skeleton.scss +50 -39
  26. package/dist/scss/components/_slider.scss +221 -159
  27. package/dist/scss/components/_steps.scss +223 -261
  28. package/dist/scss/components/_switch.scss +126 -90
  29. package/dist/scss/components/_table.scss +307 -251
  30. package/dist/scss/components/_tabs.scss +360 -247
  31. package/dist/scss/components/_tag.scss +95 -39
  32. package/dist/scss/components/_taginput.scss +48 -36
  33. package/dist/scss/components/_timepicker.scss +61 -62
  34. package/dist/scss/components/_tooltip.scss +129 -254
  35. package/dist/scss/components/_upload.scss +83 -35
  36. package/dist/scss/theme-build.scss +9 -0
  37. package/dist/scss/theme.scss +44 -0
  38. package/dist/scss/utils/_animations.scss +30 -9
  39. package/dist/scss/utils/_base.scss +6 -4
  40. package/dist/scss/utils/_helpers.scss +84 -22
  41. package/dist/scss/utils/_root.scss +82 -29
  42. package/dist/scss/utils/_variables.scss +64 -42
  43. package/dist/theme.css +2 -0
  44. package/dist/theme.js +1 -1
  45. package/package.json +27 -20
  46. package/dist/oruga.css +0 -2
  47. package/dist/scss/oruga-build.scss +0 -9
  48. package/dist/scss/oruga.scss +0 -42
@@ -1,87 +1,131 @@
1
1
  @use "sass:list";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
2
4
 
3
5
  /* @docs */
4
- $steps-title-background-color: hsl(0, 0%, 100%) !default;
5
- $steps-title-padding: 0.2em !default;
6
- $steps-title-font-weight: 500 !default;
7
- $steps-marker-background: var(--#{$prefix}grey-light) !default;
8
- $steps-marker-color: var(--#{$prefix}primary-invert) !default;
9
- $steps-marker-border: 0.2em solid #fff !default;
10
- $steps-marker-font-weight: 700 !default;
11
- $steps-marker-rounded-border-radius: var(
12
- --#{$prefix}base-border-radius-rounded
13
- ) !default;
14
- $steps-color: var(--#{$prefix}grey-lighter) !default;
15
- $steps-previous-color: var(--#{$prefix}primary) !default;
16
- $steps-active-color: var(--#{$prefix}primary) !default;
17
- $steps-divider-height: 0.2em !default;
18
- $steps-vertical-padding: 1em 0 !default;
19
- $steps-item-line-height: var(--#{$prefix}base-line-height) !default;
20
- $steps-link-color: hsl(0, 0%, 29%) !default;
21
- $steps-content-spacer: 1rem !default;
22
- $steps-content-padding: 1rem !default;
23
- $steps-font-size: var(--#{$prefix}base-font-size) !default;
6
+ $steps-disabled-opacity: h.useVar("control-disabled-opacity") !default;
7
+ $steps-vertical-padding: calc(2 * h.useVar("control-spacer")) 0 !default;
8
+
9
+ $steps-step-color: h.useVar("font-color") !default;
10
+ $steps-step-font-size: h.useVar("font-size") !default;
11
+ $steps-step-font-weight: 500 !default;
12
+ $steps-step-line-height: h.useVar("line-height") !default;
13
+
14
+ $steps-step-border-color: h.useVar(
15
+ "control-brackground-color"
16
+ ) !default; // color scheme is inverted for steps
17
+ $steps-step-background-color: h.useVar(
18
+ "control-border-color"
19
+ ) !default; // color scheme is inverted for steps
20
+ $steps-step-active-border-color: h.useVar("primary") !default;
21
+ $steps-step-active-background-color: h.useVar("primary-invert") !default;
22
+ $steps-step-previous-border-color: $steps-step-active-background-color !default; // previus is the inverted active color scheme
23
+ $steps-step-previous-background-color: $steps-step-active-border-color !default; // previus is the inverted active color scheme
24
+
25
+ $steps-step-border-radius: h.useVar("border-radius") !default;
26
+ $steps-step-border-radius-rounded: h.useVar("border-radius-rounded") !default;
27
+
28
+ $steps-step-divider-height: 0.2em !default;
29
+
30
+ $steps-step-label-padding: 0.2em !default;
31
+ $steps-step-label-background-color: h.useVar("white") !default;
32
+
33
+ $steps-content-padding: calc(2 * h.useVar("control-spacer")) !default;
24
34
  /* @docs */
25
35
 
26
- @mixin steps-size($size, $name: null) {
27
- $sizeVarName: if($name != null, "size-" + #{$name}, "steps-size");
28
-
29
- font-size: var(--#{$prefix}#{$sizeVarName}, $size);
30
- min-height: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
31
-
32
- .o-steps__divider {
33
- height: var(--#{$prefix}steps-divider-height, $steps-divider-height);
34
- top: var(--#{$prefix}#{$sizeVarName}, $size);
35
- }
36
-
37
- .o-steps__marker {
38
- height: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
39
- width: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 2);
40
- }
41
-
42
- .o-steps__step-label {
43
- font-size: calc(var(--#{$prefix}#{$sizeVarName}, $size) * 1.2);
44
- line-height: var(--#{$prefix}#{$sizeVarName}, $size);
45
- }
46
- }
47
-
48
36
  .o-steps {
49
- @include steps-size($steps-font-size);
50
-
51
- @each $name, $value in $sizes {
37
+ @include h.defineVar("steps-disabled-opacity", $steps-disabled-opacity);
38
+ @include h.defineVar("steps-vertical-padding", $steps-vertical-padding);
39
+
40
+ @include h.defineVar("steps-step-color", $steps-step-color);
41
+ @include h.defineVar("steps-step-font-size", $steps-step-font-size);
42
+ @include h.defineVar("steps-step-font-weight", $steps-step-font-weight);
43
+ @include h.defineVar("steps-step-line-height", $steps-step-line-height);
44
+
45
+ @include h.defineVar("steps-step-border-color", $steps-step-border-color);
46
+ @include h.defineVar(
47
+ "steps-step-background-color",
48
+ $steps-step-background-color
49
+ );
50
+ @include h.defineVar(
51
+ "steps-step-active-border-color",
52
+ $steps-step-active-border-color
53
+ );
54
+ @include h.defineVar(
55
+ "steps-step-active-background-color",
56
+ $steps-step-active-background-color
57
+ );
58
+ @include h.defineVar(
59
+ "steps-step-previous-border-color",
60
+ $steps-step-previous-border-color
61
+ );
62
+ @include h.defineVar(
63
+ "steps-step-previous-background-color",
64
+ $steps-step-previous-background-color
65
+ );
66
+
67
+ @include h.defineVar("steps-step-border-radius", $steps-step-border-radius);
68
+ @include h.defineVar(
69
+ "steps-step-border-radius-rounded",
70
+ $steps-step-border-radius-rounded
71
+ );
72
+
73
+ @include h.defineVar(
74
+ "steps-step-divider-height",
75
+ $steps-step-divider-height
76
+ );
77
+
78
+ @include h.defineVar("steps-step-label-padding", $steps-step-label-padding);
79
+ @include h.defineVar(
80
+ "steps-step-label-background-color",
81
+ $steps-step-label-background-color
82
+ );
83
+
84
+ @include h.defineVar("steps-content-padding", $steps-content-padding);
85
+
86
+ // size variants
87
+ @each $name, $value in vars.$sizes {
52
88
  &--#{$name} {
53
- @include steps-size($value, $name);
89
+ @include h.defineVar(
90
+ "steps-step-font-size",
91
+ h.useVar("size-#{$name}")
92
+ );
54
93
  }
55
94
  }
56
95
 
57
96
  &__list {
58
97
  display: flex;
59
98
  flex-wrap: wrap;
99
+ flex-grow: 1;
100
+ flex-shrink: 0;
101
+
60
102
  margin: 0;
61
103
  padding: 0;
104
+
105
+ transition: background h.useVar("transition-duration")
106
+ h.useVar("transition-timing");
62
107
  }
63
108
 
64
109
  &__step {
65
110
  position: relative;
111
+
66
112
  display: flex;
67
113
  flex-grow: 1;
68
114
  flex-basis: 1em;
69
115
  flex-direction: column;
70
116
  justify-content: center;
71
117
  align-items: center;
72
- list-style: none;
73
- background: transparent;
74
- border: transparent;
75
- cursor: pointer;
76
- text-decoration: none;
77
- color: var(--#{$prefix}steps-link-color, $steps-link-color);
118
+
78
119
  margin: 0;
79
120
  padding: 0;
80
- margin-top: 0;
81
- line-height: var(
82
- --#{$prefix}steps-item-line-height,
83
- $steps-item-line-height
84
- );
121
+
122
+ color: h.useVar("steps-step-color");
123
+ font-size: h.useVar("steps-step-font-size");
124
+ font-weight: h.useVar("steps-step-font-weight");
125
+ line-height: h.useVar("steps-step-line-height");
126
+
127
+ background: transparent;
128
+ border: transparent;
85
129
 
86
130
  &--right {
87
131
  flex-direction: row;
@@ -91,82 +135,68 @@ $steps-font-size: var(--#{$prefix}base-font-size) !default;
91
135
  flex-direction: row-reverse;
92
136
  }
93
137
 
94
- &:hover {
95
- text-decoration: none;
138
+ &--clickable {
139
+ // add clickable cursor
140
+ @include h.clickable;
96
141
  }
97
142
 
98
- &:not(&--clickable) {
99
- cursor: not-allowed;
143
+ &--disabled {
144
+ @include h.disabled(h.useVar("steps-disabled-opacity"));
100
145
  }
101
146
 
102
- @each $name, $pair in $colors {
103
- $color: list.nth($pair, 1);
104
- $color-invert: list.nth($pair, 2);
105
- $bgVarName: if(
106
- $name != null,
107
- "steps-divider-color-bg-" + #{$name},
108
- "steps-divider-color-bg"
147
+ &--active {
148
+ @include h.defineVar(
149
+ "steps-step-border-color",
150
+ h.useVar("steps-step-active-border-color")
109
151
  );
110
- $colorVarName: if(
111
- $name != null,
112
- "steps-divider-color-" + #{$name},
113
- "steps-divider-color"
152
+ @include h.defineVar(
153
+ "steps-step-background-color",
154
+ h.useVar("steps-step-active-background-color")
114
155
  );
156
+ }
115
157
 
158
+ &--previous {
159
+ @include h.defineVar(
160
+ "steps-step-border-color",
161
+ h.useVar("steps-step-previous-border-color")
162
+ );
163
+ @include h.defineVar(
164
+ "steps-step-background-color",
165
+ h.useVar("steps-step-previous-background-color")
166
+ );
167
+ }
168
+
169
+ &--previous,
170
+ &--active {
171
+ .o-steps__divider {
172
+ background-position: left bottom;
173
+ }
174
+ }
175
+
176
+ // color variants
177
+ @each $name, $pair in vars.$colors {
116
178
  &--#{$name} {
117
- &.o-steps__step--active {
118
- .o-steps__marker {
119
- background-color: var(
120
- --#{$prefix}variant-invert-#{$name},
121
- $color-invert
122
- );
123
- border-color: var(--#{$prefix}variant-#{$name}, $color);
124
- color: var(--#{$prefix}variant-#{$name}, $color);
125
- }
126
-
127
- .o-steps__divider {
128
- background: linear-gradient(
129
- to left,
130
- var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
131
- var(--#{$prefix}#{$colorVarName}, $color) 50%
132
- );
133
- background-size: 200% 100%;
134
- }
135
- }
136
-
137
- &.o-steps__step--previous {
138
- .o-steps__marker {
139
- color: var(
140
- --#{$prefix}variant-invert-#{$name},
141
- $color-invert
142
- );
143
- background-color: var(
144
- --#{$prefix}variant-#{$name},
145
- $color
146
- );
147
- }
148
-
149
- .o-steps__divider {
150
- background: linear-gradient(
151
- to left,
152
- var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
153
- var(--#{$prefix}#{$colorVarName}, $color) 50%
154
- );
155
- background-size: 200% 100%;
156
- }
157
- }
179
+ @include h.defineVar(
180
+ "steps-step-active-border-color",
181
+ h.useVar($name)
182
+ );
183
+ @include h.defineVar(
184
+ "steps-step-active-background-color",
185
+ h.useVar("#{$name}-invert")
186
+ );
187
+ @include h.defineVar(
188
+ "steps-step-previous-border-color",
189
+ h.useVar("#{$name}-invert")
190
+ );
191
+ @include h.defineVar(
192
+ "steps-step-previous-background-color",
193
+ h.useVar($name)
194
+ );
158
195
  }
159
196
  }
160
197
  }
161
198
 
162
199
  &__divider {
163
- background: linear-gradient(
164
- to left,
165
- var(--#{$prefix}steps-divider-color-bg, $steps-color) 50%,
166
- var(--#{$prefix}steps-divider-color, var(--#{$prefix}primary)) 50%
167
- );
168
- background-size: 200% 100%;
169
- background-position: right bottom;
170
200
  // This will contain the divider
171
201
  content: " ";
172
202
  display: block;
@@ -174,112 +204,79 @@ $steps-font-size: var(--#{$prefix}base-font-size) !default;
174
204
  bottom: 0;
175
205
  left: -50%;
176
206
  width: 100%;
177
- }
178
-
179
- &__content {
180
- position: relative;
181
- overflow: visible;
182
- display: flex;
183
- flex-direction: column;
184
- margin-top: var(
185
- --#{$prefix}steps-content-spacer,
186
- $steps-content-spacer
187
- );
188
-
189
- &-transitioning {
190
- overflow: hidden;
191
- }
192
-
193
- &:not(:has(.o-steps__panel:empty)) {
194
- padding: var(
195
- --#{$prefix}steps-content-padding,
196
- $steps-content-padding
197
- );
198
- }
199
- }
207
+ top: h.useVar("steps-step-font-size");
208
+ height: h.useVar("steps-step-divider-height");
200
209
 
201
- &--animated {
202
- .o-steps__divider {
203
- transition: background var(--#{$prefix}transition-duration)
204
- var(--#{$prefix}transition-timing);
205
- }
206
- }
207
-
208
- &__step-label {
209
- text-align: center;
210
- z-index: 1;
211
- background-color: var(
212
- --#{$prefix}steps-title-background-color,
213
- $steps-title-background-color
214
- );
215
- padding: var(--#{$prefix}steps-title-padding, $steps-title-padding);
216
- font-weight: var(
217
- --#{$prefix}steps-title-font-weight,
218
- $steps-title-font-weight
210
+ background: linear-gradient(
211
+ to left,
212
+ h.useVar("steps-step-background-color") 50%,
213
+ h.useVar("steps-step-border-color") 50%
219
214
  );
215
+ background-size: 200% 100%;
216
+ background-position: right bottom;
220
217
  }
221
218
 
219
+ // marker inside the step
222
220
  &__marker {
223
- align-items: center;
221
+ z-index: 1;
224
222
  display: flex;
223
+ align-items: center;
225
224
  justify-content: center;
226
225
  overflow: hidden;
227
- z-index: 1;
228
- font-weight: var(
229
- --#{$prefix}steps-marker-font-weight,
230
- $steps-marker-font-weight
231
- );
232
- background: var(
233
- --#{$prefix}steps-marker-background,
234
- $steps-marker-background
235
- );
236
- color: var(--#{$prefix}steps-marker-color, $steps-marker-color);
237
- border: var(--#{$prefix}steps-marker-border, $steps-marker-border);
226
+
227
+ height: calc(h.useVar("steps-step-font-size") * 2);
228
+ width: calc(h.useVar("steps-step-font-size") * 2);
229
+
230
+ color: h.useVar("steps-step-border-color");
231
+
232
+ border-width: h.useVar("steps-step-divider-height");
233
+ border-style: solid;
234
+ border-color: h.useVar("steps-step-border-color");
235
+ border-radius: h.useVar("steps-step-border-radius");
236
+
237
+ background-color: h.useVar("steps-step-background-color");
238
238
 
239
239
  &--rounded {
240
- border-radius: var(
241
- --#{$prefix}steps-marker-rounded-border-radius,
242
- $steps-marker-rounded-border-radius
240
+ @include h.defineVar(
241
+ "steps-step-border-radius",
242
+ h.useVar("steps-step-border-radius-rounded")
243
243
  );
244
244
  }
245
245
  }
246
246
 
247
- &__step--active {
248
- .o-steps__link {
249
- cursor: default;
250
- }
247
+ // label inside the step
248
+ &__step-label {
249
+ z-index: 1;
250
+ text-align: center;
251
251
 
252
- .o-steps__marker {
253
- background-color: var(
254
- --#{$prefix}steps-marker-color,
255
- $steps-marker-color
256
- );
257
- border-color: var(
258
- --#{$prefix}steps-active-color,
259
- $steps-active-color
260
- );
261
- color: var(--#{$prefix}steps-active-color, $steps-active-color);
262
- }
252
+ font-size: calc(h.useVar("steps-step-font-size") * 1.2);
263
253
 
264
- .o-steps__divider {
265
- background-position: left bottom;
266
- }
254
+ padding: h.useVar("steps-step-label-padding");
255
+
256
+ background-color: h.useVar("steps-step-label-background-color");
267
257
  }
268
258
 
269
- &__step--previous {
270
- .o-steps__marker {
271
- color: var(--#{$prefix}steps-marker-color, $steps-marker-color);
272
- background-color: var(
273
- --#{$prefix}steps-previous-color,
274
- $steps-previous-color
275
- );
259
+ &__content {
260
+ position: relative;
261
+ overflow: visible;
262
+
263
+ display: flex;
264
+ flex-direction: column;
265
+
266
+ &-transitioning {
267
+ overflow: hidden;
276
268
  }
277
269
 
278
- .o-steps__divider {
279
- background-position: left bottom;
270
+ &:not(:has(.o-steps__panel:empty)) {
271
+ padding: h.useVar("steps-content-padding");
280
272
  }
281
273
  }
282
274
 
275
+ &:not(:last-child) {
276
+ margin-bottom: h.useVar("tabs-content-padding");
277
+ }
278
+
279
+ // content item
283
280
  &__item {
284
281
  flex-shrink: 0;
285
282
  flex-basis: auto;
@@ -290,71 +287,36 @@ $steps-font-size: var(--#{$prefix}base-font-size) !default;
290
287
  flex-direction: row;
291
288
  flex-wrap: wrap;
292
289
 
293
- .o-steps__list {
294
- height: 100%;
295
- flex-direction: column;
296
- }
297
-
298
- .o-steps__step {
299
- width: 100%;
300
- display: flex;
301
- align-items: center;
302
- justify-content: center;
290
+ .o-steps {
291
+ &__list {
292
+ height: 100%;
293
+ flex-direction: column;
294
+ }
303
295
 
304
- padding: var(
305
- --#{$prefix}steps-vertical-padding,
306
- $steps-vertical-padding
307
- );
296
+ &__step {
297
+ width: 100%;
298
+ display: flex;
299
+ align-items: center;
300
+ justify-content: center;
308
301
 
309
- // Override marker connector color per step
310
- @each $name, $pair in $colors {
311
- $color: list.nth($pair, 1);
312
- $bgVarName: if(
313
- $name != null,
314
- "steps-divider-color-bg-" + #{$name},
315
- "steps-divider-color-bg"
316
- );
317
- $colorVarName: if(
318
- $name != null,
319
- "steps-divider-color-" + #{$name},
320
- "steps-divider-color"
321
- );
322
-
323
- &--#{$name} {
324
- .o-steps__divider {
325
- background: linear-gradient(
326
- to left,
327
- var(--#{$prefix}#{$bgVarName}, $steps-color) 50%,
328
- var(--#{$prefix}#{$colorVarName}, $color) 50%
329
- );
330
- background-size: 100% 200%;
331
- background-position: left bottom;
332
- }
333
- }
302
+ padding: h.useVar("steps-vertical-padding");
334
303
  }
335
- }
336
304
 
337
- .o-steps__divider {
338
- height: 100%;
339
- width: var(--#{$prefix}steps-divider-height, $steps-divider-height);
340
- top: -50%;
341
- left: calc(50% - #{$steps-divider-height * 0.5});
342
- }
343
-
344
- .o-steps__item--active,
345
- .o-steps__item--previous {
346
- .o-steps__divider {
347
- background-position: right top;
305
+ &__divider {
306
+ height: 100%;
307
+ width: h.useVar("steps-step-divider-height");
308
+ top: -50%;
309
+ left: calc(50% - h.useVar("steps-step-divider-height") * 0.5);
348
310
  }
349
- }
350
311
 
351
- .o-steps__content {
352
- flex-grow: 1;
353
- flex-basis: 70%;
354
- }
312
+ &__content {
313
+ flex-grow: 1;
314
+ flex-basis: 70%;
315
+ }
355
316
 
356
- .o-steps__navigation {
357
- flex-basis: 100%;
317
+ &__navigation {
318
+ flex-basis: 100%;
319
+ }
358
320
  }
359
321
 
360
322
  &.o-steps--position-right {