@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,116 +1,132 @@
1
- @use "sass:list";
1
+ @use "sass:map";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
2
4
 
3
5
  /* @docs */
4
- $sidebar-overlay: hsla(0, 0%, 4%, 0.86) !default;
5
- $sidebar-box-shadow: 5px 0px 13px 3px rgba(var(--#{$prefix}black), 0.1) !default;
6
- $sidebar-content-background-color: var(--#{$prefix}grey-lighter) !default;
7
- $sidebar-border-radius: var(--#{$prefix}base-border-radius) !default;
8
- $sidebar-border-width: 1px !default;
9
- $sidebar-border-color: rgba(0, 0, 0, 0.175) !default;
10
- $sidebar-reduced-width: 80px !default;
11
- $sidebar-width: 260px !default;
12
- $sidebar-zindex: 100 !default;
6
+ $sidebar-zindex: map.get(vars.$zindex, "fixed") !default;
7
+
8
+ $sidebar-overlay-background-color: h.useVar(
9
+ "overlay-background-color"
10
+ ) !default;
11
+ $sidebar-overlay-zindex: map.get(vars.$zindex, "overlay") !default;
12
+
13
+ $sidebar-content-zindex: map.get(vars.$zindex, "sidebar") !default;
14
+ $sidebar-content-max-width: 50vw !default;
15
+ $sidebar-content-max-height: 50vh !default;
16
+ $sidebar-content-box-shadow: h.useVar("overlay-box-shadow") !default;
17
+ $sidebar-content-background-color: h.useVar(
18
+ "control-brackground-color"
19
+ ) !default;
20
+ $sidebar-content-border-radius: h.useVar("border-radius") !default;
21
+ $sidebar-content-border-width: h.useVar("control-border-width") !default;
22
+ $sidebar-content-border-style: solid !default;
23
+ $sidebar-content-border-color: h.useVar("control-border-color") !default;
13
24
  /* @docs */
14
25
 
15
26
  .o-sidebar {
27
+ @include h.defineVar("sidebar-zindex", $sidebar-zindex);
28
+ @include h.defineVar(
29
+ "sidebar-overlay-background-color",
30
+ $sidebar-overlay-background-color
31
+ );
32
+ @include h.defineVar("sidebar-overlay-zindex", $sidebar-overlay-zindex);
33
+
34
+ @include h.defineVar("sidebar-content-zindex", $sidebar-content-zindex);
35
+ @include h.defineVar(
36
+ "sidebar-content-box-shadow",
37
+ $sidebar-content-box-shadow
38
+ );
39
+ @include h.defineVar(
40
+ "sidebar-content-background-color",
41
+ $sidebar-content-background-color
42
+ );
43
+ @include h.defineVar(
44
+ "sidebar-content-border-radius",
45
+ $sidebar-content-border-radius
46
+ );
47
+ @include h.defineVar(
48
+ "sidebar-content-border-width",
49
+ $sidebar-content-border-width
50
+ );
51
+ @include h.defineVar(
52
+ "sidebar-content-border-style",
53
+ $sidebar-content-border-style
54
+ );
55
+ @include h.defineVar(
56
+ "sidebar-content-border-color",
57
+ $sidebar-content-border-color
58
+ );
59
+
60
+ display: flex;
61
+ flex-direction: column;
62
+ justify-content: center;
63
+ align-items: center;
64
+ overflow: hidden;
65
+
66
+ // disable clickable
67
+ pointer-events: none;
68
+
16
69
  position: fixed;
17
- top: 0;
70
+ bottom: 0;
18
71
  left: 0;
72
+ right: 0;
73
+ top: 0;
19
74
  height: 100%;
20
75
  width: 100%;
21
- display: none;
76
+ z-index: h.useVar("sidebar-zindex");
77
+
78
+ &__overlay {
79
+ pointer-events: auto;
80
+ position: absolute;
81
+ bottom: 0;
82
+ left: 0;
83
+ right: 0;
84
+ top: 0;
85
+ background-color: h.useVar("sidebar-overlay-background-color");
86
+ z-index: h.useVar("sidebar-overlay-zindex");
87
+ }
22
88
 
23
89
  &__content {
90
+ pointer-events: auto;
24
91
  position: absolute;
25
- background-color: var(
26
- --#{$prefix}sidebar-content-background-color,
27
- $sidebar-content-background-color
28
- );
29
- border-radius: var(
30
- --#{$prefix}sidebar-border-radius,
31
- $sidebar-border-radius
32
- );
33
- box-shadow: var(--#{$prefix}sidebar-box-shadow, $sidebar-box-shadow);
34
-
35
- @each $name, $pair in $colors {
36
- $color: list.nth($pair, 1);
37
- &--#{$name} {
38
- background-color: var(--#{$prefix}variant-#{$name}), $color;
39
- }
40
- }
92
+ overflow: auto;
93
+ z-index: h.useVar("sidebar-content-zindex");
41
94
 
42
- // position
43
- &--right,
44
- &--left {
45
- transition: width var(--#{$prefix}transition-duration)
46
- var(--#{$prefix}transition-timing);
47
- width: var(--#{$prefix}sidebar-width, $sidebar-width);
48
- }
95
+ background-color: h.useVar("sidebar-content-background-color");
96
+ border-width: 0;
97
+ border-style: h.useVar("sidebar-content-border-style");
98
+ border-color: h.useVar("sidebar-content-border-color");
99
+ border-radius: h.useVar("sidebar-content-border-radius");
49
100
 
50
- &--top,
51
- &--bottom {
52
- transition: height var(--#{$prefix}transition-duration)
53
- var(--#{$prefix}transition-timing);
54
- height: var(--#{$prefix}sidebar-width, $sidebar-width);
55
- }
101
+ box-shadow: h.useVar("sidebar-content-box-shadow");
102
+
103
+ transition:
104
+ width h.useVar("transition-duration") h.useVar("transition-timing"),
105
+ height h.useVar("transition-duration") h.useVar("transition-timing");
56
106
 
107
+ // position
57
108
  &--right {
58
109
  left: auto;
59
110
  right: 0;
60
- border-left: var(
61
- --#{$prefix}sidebar-border-width,
62
- $sidebar-border-width
63
- )
64
- solid
65
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
111
+ border-left-width: h.useVar("sidebar-content-border-width");
66
112
  }
67
113
 
68
114
  &--left {
69
115
  left: 0;
70
116
  right: auto;
71
- border-right: var(
72
- --#{$prefix}sidebar-border-width,
73
- $sidebar-border-width
74
- )
75
- solid
76
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
117
+ border-right-width: h.useVar("sidebar-content-border-width");
77
118
  }
78
119
 
79
120
  &--top {
80
121
  top: 0;
81
122
  bottom: auto;
82
- border-bottom: var(
83
- --#{$prefix}sidebar-border-width,
84
- $sidebar-border-width
85
- )
86
- solid
87
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
123
+ border-bottom-width: h.useVar("sidebar-content-border-width");
88
124
  }
89
125
 
90
126
  &--bottom {
91
127
  top: auto;
92
128
  bottom: 0;
93
- border-top: var(
94
- --#{$prefix}sidebar-border-width,
95
- $sidebar-border-width
96
- )
97
- solid
98
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
99
- }
100
-
101
- &--reduced {
102
- width: var(
103
- --#{$prefix}sidebar-reduced-width,
104
- $sidebar-reduced-width
105
- );
106
- }
107
-
108
- &--hover-expand {
109
- &:hover {
110
- transition: width var(--#{$prefix}transition-duration)
111
- var(--#{$prefix}transition-timing);
112
- width: var(--#{$prefix}sidebar-width, $sidebar-width);
113
- }
129
+ border-top-width: h.useVar("sidebar-content-border-width");
114
130
  }
115
131
 
116
132
  &--fullwidth {
@@ -124,32 +140,17 @@ $sidebar-zindex: 100 !default;
124
140
  }
125
141
  }
126
142
 
127
- &__overlay {
128
- position: absolute;
129
- bottom: 0;
130
- left: 0;
131
- right: 0;
132
- top: 0;
133
- background: var(--#{$prefix}sidebar-overlay, $sidebar-overlay);
134
- }
135
-
136
- &--active {
137
- display: block;
138
- }
139
-
140
143
  &--inline {
141
- position: relative;
144
+ @include h.defineVar("sidebar-zindex", "unset");
145
+ @include h.defineVar("sidebar-content-zindex", "unset");
142
146
 
143
- .o-sidebar__overlay {
144
- position: absolute;
145
- }
147
+ position: relative;
146
148
 
147
149
  .o-sidebar__content {
148
150
  position: relative;
151
+ border-width: 0;
152
+ width: 100%;
153
+ height: 100%;
149
154
  }
150
155
  }
151
-
152
- &:not(&--inline) {
153
- z-index: var(--#{$prefix}sidebar-zindex, $sidebar-zindex);
154
- }
155
156
  }
@@ -1,34 +1,42 @@
1
+ @use "../utils/helpers" as h;
2
+ @use "../utils/variables" as vars;
3
+
1
4
  /* @docs */
5
+ $skeleton-spacer: 0.5em !default;
6
+ $skeleton-duration: 1.5s !default;
7
+ $skeleton-font-size: h.useVar("font-size") !default;
8
+ $skeleton-background-color: vars.$grey-lighter !default;
2
9
  $skeleton-background: linear-gradient(
3
10
  90deg,
4
- $grey-lighter 25%,
5
- rgba($grey-lighter, 0.5) 50%,
6
- $grey-lighter 75%
11
+ $skeleton-background-color 25%,
12
+ rgba($skeleton-background-color, 0.5) 50%,
13
+ $skeleton-background-color 75%
7
14
  ) !default;
8
- $skeleton-border-radius: var(--#{$prefix}base-border-radius) !default;
9
- $skeleton-duration: 1.5s !default;
10
- $skeleton-margin: 0.5rem 0 0 0 !default;
15
+ $skeleton-border-radius: h.useVar("border-radius") !default;
16
+ $skeleton-border-radius-rounded: h.useVar("border-radius-rounded") !default;
11
17
  /* @docs */
12
18
 
13
- @keyframes skeleton-loading {
14
- 0% {
15
- background-position: 100% 50%;
16
- }
19
+ .o-skeleton {
20
+ @include h.defineVar("skeleton-duration", $skeleton-duration);
21
+ @include h.defineVar("skeleton-spacer", $skeleton-spacer);
22
+ @include h.defineVar("skeleton-font-size", $skeleton-font-size);
23
+ @include h.defineVar("skeleton-background", $skeleton-background);
24
+ @include h.defineVar("skeleton-border-radius", $skeleton-border-radius);
25
+ @include h.defineVar(
26
+ "skeleton-border-radius-rounded",
27
+ $skeleton-border-radius-rounded
28
+ );
17
29
 
18
- 100% {
19
- background-position: 0 50%;
20
- }
21
- }
30
+ @keyframes skeleton-loading {
31
+ 0% {
32
+ background-position: 100% 50%;
33
+ }
22
34
 
23
- @mixin steps-size($size, $name: null) {
24
- @if $name {
25
- line-height: var(--#{$prefix}skeleton-font-size-#{$name}, $size);
26
- } @else {
27
- line-height: var(--#{$prefix}skeleton-font-size, $size);
35
+ 100% {
36
+ background-position: 0 50%;
37
+ }
28
38
  }
29
- }
30
39
 
31
- .o-skeleton {
32
40
  display: inline-flex;
33
41
  flex-direction: column;
34
42
  vertical-align: middle;
@@ -36,21 +44,14 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
36
44
 
37
45
  &__item {
38
46
  width: 100%;
39
- background: var(--#{$prefix}skeleton-background, $skeleton-background);
40
- margin: var(--#{$prefix}skeleton-margin, $skeleton-margin);
41
-
42
- @include steps-size($base-font-size);
43
-
44
- @each $name, $value in $sizes {
45
- &--#{$name} {
46
- @include steps-size($value, $name);
47
- }
48
- }
47
+ background: h.useVar("skeleton-background");
48
+ line-height: h.useVar("skeleton-font-size");
49
+ border-radius: h.useVar("skeleton-border-radius");
49
50
 
50
51
  &--rounded {
51
- border-radius: var(
52
- --#{$prefix}skeleton-border-radius,
53
- $skeleton-border-radius
52
+ @include h.defineVar(
53
+ "skeleton-border-radius",
54
+ h.useVar("skeleton-border-radius-rounded")
54
55
  );
55
56
  }
56
57
 
@@ -58,15 +59,26 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
58
59
  background-size: 400% 100%;
59
60
  animation-name: skeleton-loading;
60
61
  animation-iteration-count: infinite;
61
- animation-duration: var(
62
- --#{$prefix}skeleton-duration,
63
- $skeleton-duration
64
- );
62
+ animation-duration: h.useVar("skeleton-duration");
65
63
  }
66
64
 
67
65
  &::after {
68
66
  content: "\00a0";
69
67
  }
68
+
69
+ // size variants
70
+ @each $name, $value in vars.$sizes {
71
+ &--#{$name} {
72
+ @include h.defineVar(
73
+ "skeleton-font-size",
74
+ h.useVar("size-#{$name}")
75
+ );
76
+ }
77
+ }
78
+
79
+ & + .o-skeleton__item {
80
+ margin-top: h.useVar("skeleton-spacer");
81
+ }
70
82
  }
71
83
 
72
84
  &--centered {
@@ -75,6 +87,5 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
75
87
 
76
88
  &--right {
77
89
  align-items: flex-end;
78
- margin: var(--#{$prefix}skeleton-margin, $skeleton-margin);
79
90
  }
80
91
  }