@oruga-ui/theme-oruga 0.7.1 → 0.8.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/README.md +4 -4
  2. package/dist/scss/components/_autocomplete.scss +3 -12
  3. package/dist/scss/components/_breadcrumb.scss +122 -103
  4. package/dist/scss/components/_button.scss +228 -173
  5. package/dist/scss/components/_carousel.scss +164 -142
  6. package/dist/scss/components/_checkbox.scss +118 -118
  7. package/dist/scss/components/_collapse.scss +1 -1
  8. package/dist/scss/components/_datepicker.scss +228 -290
  9. package/dist/scss/components/_datetimepicker.scss +8 -2
  10. package/dist/scss/components/_dropdown.scss +191 -164
  11. package/dist/scss/components/_field.scss +68 -39
  12. package/dist/scss/components/_icon.scss +24 -29
  13. package/dist/scss/components/_input.scss +112 -97
  14. package/dist/scss/components/_loading.scss +35 -15
  15. package/dist/scss/components/_menu.scss +113 -109
  16. package/dist/scss/components/_modal.scss +112 -50
  17. package/dist/scss/components/_notification.scss +113 -97
  18. package/dist/scss/components/_pagination.scss +173 -106
  19. package/dist/scss/components/_radio.scss +91 -84
  20. package/dist/scss/components/_select.scss +108 -115
  21. package/dist/scss/components/_sidebar.scss +102 -101
  22. package/dist/scss/components/_skeleton.scss +50 -39
  23. package/dist/scss/components/_slider.scss +221 -159
  24. package/dist/scss/components/_steps.scss +223 -261
  25. package/dist/scss/components/_switch.scss +126 -90
  26. package/dist/scss/components/_table.scss +307 -251
  27. package/dist/scss/components/_tabs.scss +360 -247
  28. package/dist/scss/components/_tag.scss +95 -39
  29. package/dist/scss/components/_taginput.scss +48 -36
  30. package/dist/scss/components/_timepicker.scss +61 -62
  31. package/dist/scss/components/_tooltip.scss +129 -254
  32. package/dist/scss/components/_upload.scss +83 -35
  33. package/dist/scss/theme-build.scss +9 -0
  34. package/dist/scss/theme.scss +42 -0
  35. package/dist/scss/utils/_animations.scss +30 -9
  36. package/dist/scss/utils/_base.scss +6 -4
  37. package/dist/scss/utils/_helpers.scss +84 -22
  38. package/dist/scss/utils/_root.scss +82 -29
  39. package/dist/scss/utils/_variables.scss +64 -42
  40. package/dist/theme.css +2 -0
  41. package/dist/theme.js +1 -1
  42. package/package.json +26 -19
  43. package/dist/oruga.css +0 -2
  44. package/dist/scss/oruga-build.scss +0 -9
  45. package/dist/scss/oruga.scss +0 -42
@@ -1,94 +1,156 @@
1
+ @use "sass:map";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
4
+
1
5
  /* @docs */
2
- $modal-content-background-color: var(--#{$prefix}white) !default;
3
- $modal-content-border-radius: var(--#{$prefix}base-border-radius) !default;
4
- $modal-overlay-background-color: hsla(0, 0%, 4%, 0.86) !default;
5
- $modal-close-border-radius: var(
6
- --#{$prefix}base-border-radius-rounded
7
- ) !default;
8
- $modal-close-right: 20px !default;
9
- $modal-close-top: 20px !default;
10
- $modal-close-size: 32px !default;
11
- $modal-close-color: var(--#{$prefix}white) !default;
12
- $modal-content-fullscreen-background-color: $control-brackground-color !default;
6
+ $modal-zindex: map.get(vars.$zindex, "fixed") !default;
7
+
8
+ $modal-overlay-background-color: h.useVar("overlay-background-color") !default;
9
+ $modal-overlay-zindex: map.get(vars.$zindex, "overlay") !default;
10
+
11
+ $modal-content-zindex: map.get(vars.$zindex, "modal") !default;
13
12
  $modal-content-max-height: calc(100vh - 160px) !default;
14
- $modal-content-margin: 0 auto !default;
15
- $modal-zindex: 40 !default;
13
+ $modal-content-max-width: calc(100vw - 160px) !default;
14
+ $modal-content-box-shadow: h.useVar("overlay-box-shadow") !default;
15
+ $modal-content-border-radius: h.useVar("border-radius") !default;
16
+ $modal-content-background-color: h.useVar("control-brackground-color") !default;
17
+
18
+ $modal-close-top: 20px !default;
19
+ $modal-close-right: 20px !default;
20
+ $modal-close-color: h.useVar("white") !default;
21
+ $modal-close-size: 2rem !default;
22
+ $modal-close-border-radius: h.useVar("border-radius-rounded") !default;
23
+ $modal-close-background-color: h.useVar("control-shadow-color") !default;
16
24
  /* @docs */
17
25
 
18
26
  .o-modal {
27
+ @include h.defineVar("modal-zindex", $modal-zindex);
28
+ @include h.defineVar(
29
+ "modal-overlay-background-color",
30
+ $modal-overlay-background-color
31
+ );
32
+ @include h.defineVar("modal-overlay-zindex", $modal-overlay-zindex);
33
+
34
+ @include h.defineVar("modal-content-zindex", $modal-content-zindex);
35
+ @include h.defineVar("modal-content-box-shadow", $modal-content-box-shadow);
36
+ @include h.defineVar("modal-content-max-height", $modal-content-max-height);
37
+ @include h.defineVar("modal-content-max-width", $modal-content-max-width);
38
+ @include h.defineVar(
39
+ "modal-content-border-radius",
40
+ $modal-content-border-radius
41
+ );
42
+ @include h.defineVar(
43
+ "modal-content-background-color",
44
+ $modal-content-background-color
45
+ );
46
+
47
+ @include h.defineVar("modal-close-top", $modal-close-top);
48
+ @include h.defineVar("modal-close-right", $modal-close-right);
49
+ @include h.defineVar("modal-close-color", $modal-close-color);
50
+ @include h.defineVar("modal-close-size", $modal-close-size);
51
+ @include h.defineVar(
52
+ "modal-close-border-radius",
53
+ $modal-close-border-radius
54
+ );
55
+ @include h.defineVar(
56
+ "modal-close-background-color",
57
+ $modal-close-background-color
58
+ );
59
+
19
60
  display: flex;
20
61
  flex-direction: column;
21
62
  justify-content: center;
22
63
  align-items: center;
23
64
  overflow: hidden;
65
+
66
+ // disable clickable
67
+ pointer-events: none;
68
+
24
69
  position: fixed;
25
70
  bottom: 0;
26
71
  left: 0;
27
72
  right: 0;
28
73
  top: 0;
29
- z-index: var(--#{$prefix}modal-zindex, $modal-zindex);
74
+ height: 100%;
75
+ width: 100%;
76
+ z-index: h.useVar("modal-zindex");
30
77
 
31
78
  &__overlay {
79
+ pointer-events: auto;
80
+ position: absolute;
32
81
  bottom: 0;
33
82
  left: 0;
34
- position: absolute;
35
83
  right: 0;
36
84
  top: 0;
37
- background-color: var(
38
- --#{$prefix}modal-overlay-background-color,
39
- $modal-overlay-background-color
40
- );
85
+ background-color: h.useVar("modal-overlay-background-color");
86
+ z-index: h.useVar("modal-overlay-zindex");
41
87
  }
42
88
 
43
89
  &__content {
44
- overflow: auto;
90
+ pointer-events: auto;
45
91
  position: relative;
46
- margin: var(--#{$prefix}modal-content-margin, $modal-content-margin);
47
- max-height: var(
48
- --#{$prefix}modal-content-max-height,
49
- $modal-content-max-height
50
- );
51
- background-color: var(
52
- --#{$prefix}modal-content-background-color,
53
- $modal-content-background-color
54
- );
55
- border-radius: var(
56
- --#{$prefix}modal-content-border-radius,
57
- $modal-content-border-radius
58
- );
92
+ overflow: auto;
93
+ margin: 0 auto;
94
+ z-index: h.useVar("modal-content-zindex");
95
+
96
+ max-height: h.useVar("modal-content-max-height");
97
+ max-width: h.useVar("modal-content-max-width");
98
+ background-color: h.useVar("modal-content-background-color");
99
+ border-radius: h.useVar("modal-content-border-radius");
59
100
 
101
+ box-shadow: h.useVar("modal-content-box-shadow");
102
+
103
+ /// @deprecated
60
104
  &--full-screen {
61
105
  width: 100%;
62
106
  height: 100%;
107
+ max-width: 100vh;
63
108
  max-height: 100vh;
64
109
  margin: 0;
65
- background-color: var(
66
- --#{$prefix}modal-content-fullscreen-background-color,
67
- $modal-content-fullscreen-background-color
68
- );
110
+ }
111
+
112
+ &--fullwidth {
113
+ width: 100%;
114
+ max-width: 100%;
115
+ }
116
+
117
+ &--fullheight {
118
+ height: 100%;
119
+ max-height: 100%;
69
120
  }
70
121
  }
71
122
 
72
123
  &__close {
73
- background: none;
124
+ // add clickable cursor
125
+ @include h.clickable;
126
+
74
127
  position: fixed;
128
+ top: h.useVar("modal-close-top");
129
+ right: h.useVar("modal-close-right");
130
+
131
+ display: inline-flex;
132
+ align-items: center;
133
+ justify-content: center;
134
+
135
+ height: h.useVar("modal-close-size");
136
+ width: h.useVar("modal-close-size");
137
+ padding: 0;
138
+
139
+ color: h.useVar("modal-close-color");
140
+
75
141
  border: none;
76
- display: inline-block;
77
- vertical-align: top;
78
- border-radius: var(
79
- --#{$prefix}modal-close-border-radius,
80
- $modal-close-border-radius
81
- );
82
- right: var(--#{$prefix}modal-close-right, $modal-close-right);
83
- top: var(--#{$prefix}modal-close-top, $modal-close-top);
84
- height: var(--#{$prefix}modal-close-size, $modal-close-size);
85
- width: var(--#{$prefix}modal-close-size, $modal-close-size);
86
- color: var(--#{$prefix}modal-close-color, $modal-close-color);
142
+ border-radius: h.useVar("modal-close-border-radius");
143
+ background-color: h.useVar("modal-close-background-color");
87
144
  }
88
145
 
89
146
  &--mobile {
90
147
  .o-modal__content {
91
- width: 100%;
148
+ @media screen and (max-width: 1199px) {
149
+ width: 75vw;
150
+ }
151
+ @media screen and (max-width: 575px) {
152
+ width: 90vw;
153
+ }
92
154
  }
93
155
  }
94
156
  }
@@ -1,44 +1,91 @@
1
1
  @use "sass:list";
2
+ @use "sass:map";
3
+ @use "../utils/helpers" as h;
4
+ @use "../utils/variables" as vars;
2
5
 
3
6
  /* @docs */
4
- $notification-background-color: var(--#{$prefix}primary) !default;
5
- $notification-border-radius: 4px !default;
7
+ $notification-spacer: calc(2 * h.useVar("control-spacer")) !default;
6
8
  $notification-padding: 1.75em 1.75em !default;
7
- $notification-margin-bottom: 1.5rem !default;
8
- $notification-animantion: append-animate 0.3s linear !default;
9
- $notification-color: var(--#{$prefix}white) !default;
10
- $notification-close-border-radius: var(
11
- --#{$prefix}base-border-radius-rounded
12
- ) !default;
13
- $notification-close-right: 0.5rem !default;
14
- $notification-close-top: 0.5rem !default;
15
- $notification-close-size: 20px !default;
16
- $notification-close-color: var(--#{$prefix}white) !default;
17
- $notification-close-background-color: hsla(0, 0%, 4%, 0.2) !default;
18
- $notification-icon-margin-right: 1rem !default;
9
+ $notification-animation: append-animate h.useVar("animation-speed") linear !default;
10
+
11
+ $notification-color: h.useVar("primary-invert") !default;
12
+ $notification-background-color: h.useVar("primary") !default;
13
+ $notification-border-radius: h.useVar("border-radius") !default;
14
+
15
+ $notification-close-top: 0.5em !default;
16
+ $notification-close-right: 0.5em !default;
17
+ $notification-close-color: h.useVar("white") !default;
18
+ $notification-close-size: 1.5rem !default;
19
+ $notification-close-border-radius: h.useVar("border-radius-rounded") !default;
20
+ $notification-close-background-color: h.useVar("control-shadow-color") !default;
21
+
19
22
  $notification-notices-padding: 2em !default;
20
- $notification-notices-zindex: 1000 !default;
23
+ $notification-notices-max-width: 600px !default;
24
+ $notification-notices-zindex: map.get(vars.$zindex, "tooltip") !default;
21
25
  /* @docs */
22
26
 
23
27
  .o-notification {
24
- position: relative;
25
- transform-origin: 50% 0;
26
- // Modifiers
27
- background-color: var(
28
- --#{$prefix}notification-background-color,
28
+ @include h.defineVar("notification-spacer", $notification-spacer);
29
+ @include h.defineVar("notification-padding", $notification-padding);
30
+ @include h.defineVar("notification-animation", $notification-animation);
31
+ @include h.defineVar("notification-color", $notification-color);
32
+ @include h.defineVar(
33
+ "notification-background-color",
29
34
  $notification-background-color
30
35
  );
31
- color: var(--#{$prefix}notification-color, $notification-color);
32
- border-radius: var(
33
- --#{$prefix}notification-border-radius,
36
+ @include h.defineVar(
37
+ "notification-border-radius",
34
38
  $notification-border-radius
35
39
  );
36
- padding: var(--#{$prefix}notification-padding, $notification-padding);
37
- margin-bottom: var(
38
- --#{$prefix}notification-margin-bottom,
39
- $notification-margin-bottom
40
+
41
+ @include h.defineVar("notification-close-top", $notification-close-top);
42
+ @include h.defineVar("notification-close-right", $notification-close-right);
43
+ @include h.defineVar("notification-close-color", $notification-close-color);
44
+ @include h.defineVar("notification-close-size", $notification-close-size);
45
+ @include h.defineVar(
46
+ "notification-close-border-radius",
47
+ $notification-close-border-radius
48
+ );
49
+ @include h.defineVar(
50
+ "notification-close-background-color",
51
+ $notification-close-background-color
40
52
  );
41
53
 
54
+ display: inline-flex;
55
+ flex-direction: row-reverse;
56
+ position: relative;
57
+ transform-origin: 50% 0;
58
+
59
+ padding: h.useVar("notification-padding");
60
+ margin-bottom: h.useVar("notification-spacer");
61
+
62
+ color: h.useVar("notification-color");
63
+
64
+ background-color: h.useVar("notification-background-color");
65
+ border-radius: h.useVar("notification-border-radius");
66
+
67
+ animation: h.useVar("notification-animation");
68
+ -webkit-animation: h.useVar("notification-animation");
69
+
70
+ // color variants
71
+ @each $name, $pair in vars.$colors {
72
+ &--#{$name} {
73
+ @include h.defineVar(
74
+ "notification-color",
75
+ h.useVar("#{$name}-invert")
76
+ );
77
+ @include h.defineVar(
78
+ "notification-background-color",
79
+ h.useVar($name)
80
+ );
81
+
82
+ &:hover {
83
+ // darken color on hover
84
+ filter: brightness(95%);
85
+ }
86
+ }
87
+ }
88
+
42
89
  &__content {
43
90
  flex-basis: auto;
44
91
  flex-grow: 1;
@@ -49,8 +96,8 @@ $notification-notices-zindex: 1000 !default;
49
96
  }
50
97
 
51
98
  &__wrapper {
52
- align-items: center;
53
99
  display: flex;
100
+ align-items: center;
54
101
  text-align: inherit;
55
102
  padding-top: 0;
56
103
  border: 0;
@@ -60,93 +107,66 @@ $notification-notices-zindex: 1000 !default;
60
107
  flex-basis: auto;
61
108
  flex-grow: 0;
62
109
  flex-shrink: 0;
63
- margin-right: var(
64
- --#{$prefix}notification-icon-margin-right,
65
- $notification-icon-margin-right
66
- );
110
+ margin-right: h.useVar("notification-spacer");
67
111
  }
68
112
 
69
113
  &__close {
114
+ // add clickable cursor
115
+ @include h.clickable;
116
+
70
117
  position: absolute;
71
- border: none;
72
- cursor: pointer;
73
- pointer-events: auto;
74
- display: flex;
75
- justify-content: center;
118
+ top: h.useVar("notification-close-top");
119
+ right: h.useVar("notification-close-right");
120
+
121
+ display: inline-flex;
76
122
  align-items: center;
77
- flex-grow: 0;
78
- flex-shrink: 0;
79
- vertical-align: top;
80
- background-color: var(
81
- --#{$prefix}notification-close-background-color,
82
- $notification-close-background-color
83
- );
84
- border-radius: var(
85
- --#{$prefix}notification-close-border-radius,
86
- $notification-close-border-radius
87
- );
88
- right: var(
89
- --#{$prefix}notification-close-right,
90
- $notification-close-right
91
- );
92
- top: var(--#{$prefix}notification-close-top, $notification-close-top);
93
- height: var(
94
- --#{$prefix}notification-close-size,
95
- $notification-close-size
96
- );
97
- width: var(
98
- --#{$prefix}notification-close-size,
99
- $notification-close-size
100
- );
101
- color: var(
102
- --#{$prefix}notification-close-color,
103
- $notification-close-color
104
- );
105
- }
123
+ justify-content: center;
106
124
 
107
- @each $name, $pair in $colors {
108
- $color: list.nth($pair, 1);
109
- $color-invert: list.nth($pair, 2);
110
- &--#{$name} {
111
- border-color: transparent;
112
- background-color: var(--#{$prefix}variant-#{$name}, $color);
113
- color: var(--#{$prefix}variant-invert-#{$name}, $color-invert);
125
+ height: h.useVar("notification-close-size");
126
+ width: h.useVar("notification-close-size");
127
+ padding: 0;
114
128
 
115
- &:hover {
116
- // background-color: darken($color, 2.5%)
117
- // IE 11 needs polyfill
118
- filter: brightness(97.5%);
119
- }
120
- }
129
+ color: h.useVar("notification-close-color");
130
+
131
+ border: none;
132
+ border-radius: h.useVar("notification-close-border-radius");
133
+ background-color: h.useVar("notification-close-background-color");
121
134
  }
122
135
  }
123
136
 
124
137
  .o-notices {
138
+ @include h.defineVar(
139
+ "notification-notices-zindex",
140
+ $notification-notices-zindex
141
+ );
142
+ @include h.defineVar(
143
+ "notification-notices-padding",
144
+ $notification-notices-padding
145
+ );
146
+ @include h.defineVar(
147
+ "notification-notices-max-width",
148
+ $notification-notices-max-width
149
+ );
150
+
125
151
  position: fixed;
126
152
  display: flex;
127
153
  top: 0;
128
154
  bottom: 0;
129
155
  left: 0;
130
156
  right: 0;
157
+
131
158
  overflow: hidden;
159
+ // disable clickable
132
160
  pointer-events: none;
133
- padding: var(
134
- --#{$prefix}notification-notices-padding,
135
- $notification-notices-padding
136
- );
137
- z-index: var(
138
- --#{$prefix}notification-notices-zindex,
139
- $notification-notices-zindex
140
- );
161
+
162
+ padding: h.useVar("notification-notices-padding");
163
+ z-index: h.useVar("notification-notices-zindex");
141
164
 
142
165
  .o-notification {
143
166
  pointer-events: stroke;
144
- max-width: 600px;
145
- animation: var(
146
- --#{$prefix}notification-animantion,
147
- $notification-animantion
148
- );
167
+ max-width: h.useVar("notification-notices-max-width");
149
168
 
169
+ // position variants
150
170
  &--top,
151
171
  &--bottom {
152
172
  align-self: center;
@@ -176,12 +196,8 @@ $notification-notices-zindex: 1000 !default;
176
196
  margin-bottom: 0;
177
197
 
178
198
  &:not(:first-child) {
179
- margin-bottom: $notification-margin-bottom;
199
+ margin-bottom: h.useVar("notification-spacer");
180
200
  }
181
201
  }
182
202
  }
183
-
184
- &__custom-container {
185
- position: absolute;
186
- }
187
203
  }