@oruga-ui/theme-oruga 0.7.0 → 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 +16 -20
  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 -243
  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 +38 -27
  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,179 +1,179 @@
1
1
  @use "sass:list";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
2
4
 
3
5
  /* @docs */
4
- $checkbox-active-background-color: var(--#{$prefix}primary) !default;
5
- $checkbox-background-color: var(--#{$prefix}primary) !default;
6
- $checkbox-box-shadow: $control-box-shadow !default;
7
- $checkbox-border-color: var(--#{$prefix}primary) !default;
6
+ $checkbox-spacer: h.useVar("control-spacer") !default;
7
+ $checkbox-height: 1.2em !default;
8
+ $checkbox-width: 1.2em !default;
9
+
10
+ $checkbox-color: h.useVar("font-color") !default;
11
+ $checkbox-font-size: h.useVar("font-size") !default;
12
+ $checkbox-font-weight: h.useVar("font-weight") !default;
13
+ $checkbox-line-height: h.useVar("line-height") !default;
14
+
15
+ $checkbox-box-shadow: h.useVar("control-box-shadow-inset") !default;
16
+ $checkbox-border-color: h.useVar("primary") !default;
17
+ $checkbox-border-width: calc(2 * h.useVar("control-border-width")) !default;
8
18
  $checkbox-border-style: solid !default;
9
- $checkbox-border-radius: var(--#{$prefix}base-border-radius) !default;
10
- $checkbox-border-width: 2px !default;
11
- $checkbox-checked-box-shadow-length: 0 0 0.5em !default;
12
- $checkbox-checked-box-shadow-opacity: 0.8 !default;
13
- $checkbox-checkmark-color: $primary-invert !default;
14
- $checkbox-disabled-opacity: var(--#{$prefix}base-disabled-opacity) !default;
15
- $checkbox-label-padding: 0 0 0 0.5em !default;
16
- $checkbox-margin-sibiling: 0.5em !default;
17
- $checkbox-size: 1rem !default;
18
- $checkbox-line-height: 1.5 !default;
19
+ $checkbox-border-radius: h.useVar("border-radius") !default;
20
+ $checkbox-background-color: h.useVar("primary") !default;
21
+ $checkbox-active-background-color: h.useVar("primary") !default;
22
+
23
+ $checkbox-checkmark-color: vars.$primary-invert !default;
24
+ $checkbox-disabled-opacity: h.useVar("control-disabled-opacity") !default;
19
25
  /* @docs */
20
26
 
21
27
  // checkmark svg calculation
22
28
  @function svg_checkmark($color) {
23
- $start: '<svg width="100%" height="100%" viewBox="0 0 234 225" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">';
29
+ $start: '<svg width="100%" height="100%" viewBox="0 0 234 225" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">';
24
30
  $content: '<g transform="matrix(4.16667,0,0,4.16667,0,0)"><g transform="matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)"><path style="fill:#{$color}" d="M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z"></path></g></g>';
25
31
  $end: "</svg>";
26
32
 
27
- @return svg-encode("#{$start}#{$content}#{$end}");
33
+ @return h.svg-encode("#{$start}#{$content}#{$end}");
28
34
  }
29
35
 
30
36
  // indeterminate svg calculation
31
37
  @function svg_indeterminate($color) {
32
- $start: '<svg width="100%" height="100%" viewBox="0 0 417 417" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">';
38
+ $start: '<svg width="100%" height="100%" viewBox="0 0 417 417" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">';
33
39
  $content: '<g transform="matrix(4.16667,0,0,4.16667,0,0)"><g transform="matrix(6.96176,0,0,20.5682,-118.661,-806.753)"><path style="fill:#{$color}" d="M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z"/></g></g>';
34
40
  $end: "</svg>";
35
41
 
36
- @return svg-encode("#{$start}#{$content}#{$end}");
42
+ @return h.svg-encode("#{$start}#{$content}#{$end}");
37
43
  }
38
44
 
39
45
  .o-checkbox {
40
- @include unselectable;
46
+ @include h.defineVar("checkbox-color", $checkbox-color);
47
+ @include h.defineVar("checkbox-font-size", $checkbox-font-size);
48
+ @include h.defineVar("checkbox-font-weight", $checkbox-font-weight);
49
+ @include h.defineVar("checkbox-line-height", $checkbox-line-height);
50
+ @include h.defineVar("checkbox-width", $checkbox-width);
51
+ @include h.defineVar("checkbox-height", $checkbox-height);
52
+ @include h.defineVar("checkbox-spacer", $checkbox-spacer);
53
+ @include h.defineVar("checkbox-box-shadow", $checkbox-box-shadow);
54
+ @include h.defineVar(
55
+ "checkbox-background-color",
56
+ $checkbox-background-color
57
+ );
58
+ @include h.defineVar("checkbox-border-radius", $checkbox-border-radius);
59
+ @include h.defineVar("checkbox-border-width", $checkbox-border-width);
60
+ @include h.defineVar("checkbox-border-style", $checkbox-border-style);
61
+ @include h.defineVar("checkbox-border-color", $checkbox-border-color);
62
+ @include h.defineVar(
63
+ "checkbox-active-background-color",
64
+ $checkbox-active-background-color
65
+ );
66
+ @include h.defineVar(
67
+ "checkbox-disabled-opacity",
68
+ $checkbox-disabled-opacity
69
+ );
70
+ @include h.defineVar(
71
+ "checkbox-checkmark",
72
+ url(svg_checkmark($checkbox-checkmark-color))
73
+ );
74
+ @include h.defineVar(
75
+ "checkbox-indeterminate",
76
+ url(svg_indeterminate($checkbox-checkmark-color))
77
+ );
78
+
79
+ // define focus shadow effect
80
+ @include h.focusable(".o-checkbox__input");
81
+
82
+ // add clickable cursor
83
+ @include h.clickable;
41
84
 
42
85
  display: inline-flex;
43
86
  align-items: center;
44
- cursor: pointer;
45
87
  position: relative;
46
88
 
47
- line-height: var(--#{$prefix}checkbox-line-height, $checkbox-line-height);
48
- margin-right: var(
49
- --#{$prefix}checkbox-margin-sibiling,
50
- $checkbox-margin-sibiling
51
- );
89
+ color: h.useVar("checkbox-color");
90
+ font-size: h.useVar("checkbox-font-size");
91
+ font-weight: h.useVar("checkbox-font-weight");
92
+ line-height: h.useVar("checkbox-line-height");
52
93
 
53
94
  &__input {
54
- width: var(--#{$prefix}checkbox-size, $checkbox-size);
55
- height: var(--#{$prefix}checkbox-size, $checkbox-size);
56
- margin: 0;
57
- outline: none;
58
- vertical-align: top;
59
- -webkit-appearance: none;
60
- -moz-appearance: none;
61
- appearance: none;
95
+ // add clickable cursor
96
+ @include h.clickable;
97
+
98
+ // remove default appearance
99
+ @include h.removeAppearance;
62
100
  -webkit-print-color-adjust: exact;
63
101
  print-color-adjust: exact;
64
- flex-shrink: 0;
65
- cursor: pointer;
66
-
67
- box-shadow: var(--#{$prefix}checkbox-box-shadow, $checkbox-box-shadow);
68
- background-color: var(
69
- --#{$prefix}checkbox-background-color,
70
- $checkbox-background-color
71
- );
102
+
103
+ font-size: inherit;
104
+ outline: none;
105
+ vertical-align: top;
106
+ width: h.useVar("checkbox-width");
107
+ height: h.useVar("checkbox-height");
108
+
109
+ transition: background h.useVar("transition-duration")
110
+ h.useVar("transition-timing");
111
+
112
+ box-shadow: h.useVar("checkbox-box-shadow");
113
+
114
+ background-color: h.useVar("checkbox-background-color");
72
115
  background-position: center;
73
116
  background-size: contain;
74
117
  background-repeat: no-repeat;
75
118
 
76
- transition: background var(--#{$prefix}transition-duration)
77
- var(--#{$prefix}transition-timing);
78
-
79
- border-radius: var(
80
- --#{$prefix}checkbox-border-radius,
81
- $checkbox-border-radius
82
- );
83
- border-width: var(
84
- --#{$prefix}checkbox-border-width,
85
- $checkbox-border-width
86
- );
87
- border-color: var(
88
- --#{$prefix}checkbox-border-color,
89
- $checkbox-border-color
90
- );
91
- border-style: var(
92
- --#{$prefix}checkbox-border-style,
93
- $checkbox-border-style
94
- );
119
+ border-radius: h.useVar("checkbox-border-radius");
120
+ border-width: h.useVar("checkbox-border-width");
121
+ border-color: h.useVar("checkbox-border-color");
122
+ border-style: h.useVar("checkbox-border-style");
123
+
124
+ &:checked,
125
+ &:indeterminate {
126
+ background-color: h.useVar("checkbox-active-background-color");
127
+ border-color: h.useVar("checkbox-active-background-color");
128
+ }
95
129
 
96
130
  &:checked {
97
- background-color: var(
98
- --#{$prefix}checkbox-active-background-color,
99
- $checkbox-active-background-color
100
- );
101
- border-color: var(
102
- --#{$prefix}checkbox-active-background-color,
103
- $checkbox-active-background-color
104
- );
105
- background-image: url(svg_checkmark($checkbox-checkmark-color));
131
+ background-image: h.useVar("checkbox-checkmark");
106
132
  }
107
133
 
108
134
  &:indeterminate {
109
- background-color: var(
110
- --#{$prefix}checkbox-active-background-color,
111
- $checkbox-active-background-color
112
- );
113
- border-color: var(
114
- --#{$prefix}checkbox-active-background-color,
115
- $checkbox-active-background-color
116
- );
117
- background-image: url(svg_indeterminate($checkbox-checkmark-color));
135
+ background-image: h.useVar("checkbox-indeterminate");
118
136
  }
119
137
  }
120
138
 
121
139
  &__label {
122
- padding: var(
123
- --#{$prefix}checkbox-label-padding,
124
- $checkbox-label-padding
125
- );
140
+ padding: 0 h.useVar("checkbox-spacer");
126
141
  }
127
142
 
128
143
  &--disabled {
129
- opacity: var(
130
- --#{$prefix}checkbox-disabled-opacity,
131
- $checkbox-disabled-opacity
132
- );
144
+ @include h.disabled(h.useVar("checkbox-disabled-opacity"));
133
145
  }
134
146
 
135
147
  // size variants
136
- @each $name, $value in $sizes {
148
+ @each $name, $value in vars.$sizes {
137
149
  &--#{$name} {
138
- font-size: var(--#{$prefix}checkbox-font-size-#{$name}, $value);
139
-
140
- .o-checkbox__input {
141
- width: var(--#{$prefix}checkbox-font-size-#{$name}, $value);
142
- height: var(--#{$prefix}checkbox-font-size-#{$name}, $value);
143
- }
150
+ @include h.defineVar(
151
+ "checkbox-font-size",
152
+ h.useVar("size-#{$name}")
153
+ );
144
154
  }
145
155
  }
146
156
 
147
157
  // color variants
148
- @each $name, $pair in $colors {
158
+ @each $name, $pair in vars.$colors {
149
159
  $color: list.nth($pair, 1);
150
160
  $color-invert: list.nth($pair, 2);
151
161
 
152
162
  &--#{$name} {
153
- --#{$prefix}focus: #{createFocus($color)};
154
-
155
- .o-checkbox__input {
156
- border-color: var(--#{$prefix}variant-#{$name}, $color);
157
- background-color: var(--#{$prefix}variant-#{$name}, $color);
158
-
159
- &:checked {
160
- background-image: url(svg_checkmark($color-invert));
161
- }
162
-
163
- &:indeterminate {
164
- background-image: url(svg_indeterminate($color-invert));
165
- }
166
- }
167
- }
168
- }
169
-
170
- // focus effect
171
- &:focus,
172
- &:focus-visible,
173
- &:focus-within {
174
- .o-checkbox__input {
175
- box-shadow: 0 0 0 0.25rem var(--#{$prefix}focus);
176
- outline: none;
163
+ @include h.defineVar("checkbox-background-color", h.useVar($name));
164
+ @include h.defineVar(
165
+ "checkbox-active-background-color",
166
+ h.useVar($name)
167
+ );
168
+ @include h.defineVar("checkbox-border-color", h.useVar($name));
169
+ @include h.defineVar(
170
+ "checkbox-checkmark",
171
+ url(svg_checkmark($color-invert))
172
+ );
173
+ @include h.defineVar(
174
+ "checkbox-indeterminate",
175
+ url(svg_indeterminate($color-invert))
176
+ );
177
177
  }
178
178
  }
179
179
  }
@@ -3,8 +3,8 @@
3
3
 
4
4
  .o-collapse {
5
5
  &__trigger {
6
- cursor: pointer;
7
6
  display: inline-block;
7
+ cursor: pointer;
8
8
 
9
9
  &--expanded {
10
10
  width: 100%;