@ons/design-system 65.1.0 → 65.2.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.
@@ -6,17 +6,17 @@
6
6
  text-transform: uppercase;
7
7
  width: 15.1em;
8
8
 
9
- @media all and (min-width: 375px) {
9
+ @media all and (width >= 375px) {
10
10
  font-size: 20px !important;
11
11
  width: 15.1em !important;
12
12
  }
13
13
 
14
- @media all and (max-width: 374px) {
14
+ @media all and (width <= 374px) {
15
15
  letter-spacing: 0;
16
16
  max-width: 12.6em !important;
17
17
  }
18
18
 
19
- @media all and (max-width: 299px) {
19
+ @media all and (width <= 299px) {
20
20
  max-width: 100%;
21
21
  }
22
22
 
@@ -51,7 +51,7 @@
51
51
  border-bottom: 1px solid var(--ons-color-input-border);
52
52
  }
53
53
 
54
- &:not(&--no-results):not(&--more-results):hover,
54
+ &:not(&--no-results, &--more-results):hover,
55
55
  &--focused:not(&--no-results) {
56
56
  background: var(--ons-color-text-link-hover);
57
57
  border-color: var(--ons-color-text-link-hover);
@@ -63,7 +63,7 @@
63
63
  }
64
64
  }
65
65
 
66
- &:active:not(&--no-results):not(&--more-results) {
66
+ &:active:not(&--no-results, &--more-results) {
67
67
  background: var(--ons-color-focus);
68
68
  color: var(--ons-color-text-link-focus);
69
69
 
@@ -91,11 +91,6 @@
91
91
  }
92
92
  }
93
93
 
94
- &__wrapper {
95
- max-width: max-content;
96
- width: 100%;
97
- }
98
-
99
94
  &__panel.ons-panel--warn {
100
95
  background: none;
101
96
  border: 0;
@@ -133,7 +128,7 @@
133
128
  &--header {
134
129
  .ons-autosuggest__results {
135
130
  border: none;
136
- box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.6);
131
+ box-shadow: 0 0 5px 0 rgb(34 34 34 / 60%);
137
132
  left: 0;
138
133
  position: absolute;
139
134
  z-index: 10;
@@ -36,14 +36,13 @@
36
36
  >
37
37
 
38
38
  {% set autosuggestResults %}
39
- <div class="ons-autosuggest__results ons-js-autosuggest-results">
39
+ <div class="ons-autosuggest__results ons-js-autosuggest-results{% if params.width %} ons-input--w-{{ params.width }}{% else %} ons-input--w-20{% endif %}">
40
40
  <div id="{{ params.resultsTitleId }}" class="ons-autosuggest__results-title ons-u-fs-s">{{ params.resultsTitle }}</div>
41
41
  <ul class="ons-autosuggest__listbox ons-js-autosuggest-listbox" title="{{ params.resultsTitle }}" role="listbox" id="{{ params.id }}-listbox" tabindex="-1"></ul>
42
42
  </div>
43
43
  <div class="ons-autosuggest__instructions ons-u-vh ons-js-autosuggest-instructions" id="{{ params.id }}-instructions" tabindex="-1">{{ params.instructions }}</div>
44
44
  <div class="ons-autosuggest__status ons-u-vh ons-js-autosuggest-aria-status" aria-live="assertive" aria-atomic="true" role="status" tabindex="-1"></div>
45
45
  {% endset %}
46
- <div class="ons-autosuggest__wrapper">
47
46
  {{ onsInput({
48
47
  "id": params.id,
49
48
  "classes": "ons-js-autosuggest-input " + (params.classes if params.classes else ''),
@@ -69,6 +68,5 @@
69
68
  {% if not params.mutuallyExclusive %}
70
69
  {{ autosuggestResults | safe }}
71
70
  {% endif %}
72
- </div>
73
71
  </div>
74
72
  {% endmacro %}
@@ -15,19 +15,16 @@ $button-shadow-size: 3px;
15
15
  position: relative;
16
16
  text-align: center;
17
17
  text-decoration: none;
18
- text-rendering: optimizeLegibility;
18
+ text-rendering: optimizelegibility;
19
19
  vertical-align: top;
20
20
  white-space: nowrap;
21
21
 
22
22
  // Transparent border for IE11 High Contrast mode support due to 'border: 0' on buttons
23
23
  &::after {
24
24
  border: ems($button-shadow-size) solid transparent;
25
- bottom: -(ems($button-shadow-size)); // makes sure button shadow is selectable
25
+ inset: 0 0 - (ems($button-shadow-size)) 0; // makes sure button shadow is selectable
26
26
  content: '';
27
- left: 0;
28
27
  position: absolute;
29
- right: 0;
30
- top: 0;
31
28
  }
32
29
 
33
30
  &--search {
@@ -172,8 +169,8 @@ $button-shadow-size: 3px;
172
169
  text-decoration: none;
173
170
  }
174
171
 
175
- &--link:focus:not(:active):not(&--secondary) &,
176
- &--link:focus:hover:not(:active):not(&--secondary) & {
172
+ &--link:focus:not(:active, &--secondary) &,
173
+ &--link:focus:hover:not(:active, &--secondary) & {
177
174
  outline: inherit;
178
175
 
179
176
  &__inner {
@@ -245,7 +242,8 @@ $button-shadow-size: 3px;
245
242
  &--text-link:active:focus & {
246
243
  &__inner {
247
244
  background-color: var(--ons-color-focus);
248
- box-shadow: 0 -2px var(--ons-color-focus), 0 4px var(--ons-color-text-link-focus) !important;
245
+ box-shadow: 0 -2px var(--ons-color-focus),
246
+ 0 4px var(--ons-color-text-link-focus) !important;
249
247
  color: var(--ons-color-text-link-focus);
250
248
  .ons-icon {
251
249
  fill: var(--ons-color-text-link-focus);
@@ -256,7 +254,7 @@ $button-shadow-size: 3px;
256
254
  &--ghost & {
257
255
  &__inner {
258
256
  background: transparent;
259
- border: 2px solid rgba(255, 255, 255, 0.6);
257
+ border: 2px solid rgb(255 255 255 / 60%);
260
258
  box-shadow: none;
261
259
  color: var(--ons-color-text-inverse);
262
260
  .ons-icon {
@@ -314,7 +312,7 @@ $button-shadow-size: 3px;
314
312
 
315
313
  &--ghost:hover & {
316
314
  &__inner {
317
- background: rgba(0, 0, 0, 0.1);
315
+ background: rgb(0 0 0 / 10%);
318
316
  border-color: var(--ons-color-white);
319
317
  }
320
318
  }
@@ -323,8 +321,8 @@ $button-shadow-size: 3px;
323
321
  &--ghost:active:focus &,
324
322
  &--ghost.active & {
325
323
  &__inner {
326
- background: rgba(0, 0, 0, 0.2);
327
- border-color: rgba(255, 255, 255, 0.6);
324
+ background: rgb(0 0 0 / 20%);
325
+ border-color: rgb(255 255 255 / 60%);
328
326
  color: var(--ons-color-text-inverse);
329
327
  .ons-icon {
330
328
  fill: var(--ons-color-text-inverse);
@@ -514,8 +512,7 @@ $button-shadow-size: 3px;
514
512
 
515
513
  align-items: baseline;
516
514
  display: flex;
517
- flex-direction: row;
518
- flex-wrap: wrap;
515
+ flex-flow: row wrap;
519
516
 
520
517
  & .ons-btn,
521
518
  & a {
@@ -156,12 +156,9 @@ $checkbox-padding: 11px;
156
156
  background: var(--ons-color-white);
157
157
  border: 1px solid var(--ons-color-input-border);
158
158
  border-radius: 3px;
159
- bottom: 0;
159
+ inset: 0;
160
160
  content: '';
161
- left: 0;
162
161
  position: absolute;
163
- right: 0;
164
- top: 0;
165
162
  z-index: -1;
166
163
  }
167
164
 
@@ -49,22 +49,20 @@
49
49
 
50
50
  &__panel--is-visible {
51
51
  background-color: var(--ons-color-white);
52
- bottom: 0;
52
+ inset: 0;
53
53
  display: block;
54
54
  height: calc(100% - 76px); // Height of action buttons
55
- left: 0;
56
55
  overflow-y: scroll;
57
56
  padding: 1rem;
58
57
  position: fixed;
59
- right: 0;
60
- top: 0;
61
58
  z-index: 10;
62
59
  }
63
60
 
64
61
  &__actions {
65
62
  background-color: var(--ons-color-white);
66
63
  bottom: 0;
67
- box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.5), 0 -1px 0 0 rgba(65, 64, 66, 0.5);
64
+ box-shadow: 0 0 5px 0 rgb(34 34 34 / 50%),
65
+ 0 -1px 0 0 rgb(65 64 66 / 50%);
68
66
  display: flex;
69
67
  left: 0;
70
68
  padding: 1rem;
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>This is a paragraph of text with a {{
4
4
  onsExternalLink({
5
- "url": "#1",
5
+ "url": "#0",
6
6
  "linkText": "link to an external website"
7
7
  })
8
8
  }}</p>
@@ -0,0 +1,6 @@
1
+ .ons-pl-grid-col {
2
+ background: var(--ons-color-grey-5);
3
+ font-size: 0.8rem;
4
+ margin: 0 0 1rem;
5
+ padding: 1rem;
6
+ }
@@ -0,0 +1,19 @@
1
+ {% macro patternLibExampleGrid(params) %}
2
+ {% if params.container -%}
3
+ <div class="ons-container">
4
+ {% endif -%}
5
+
6
+ <div class="ons-grid">
7
+ {% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) -%}
8
+ {% for i in range(0, item.repeat | default(1) ) -%}
9
+ <div class="ons-grid__col ons-col-{{ item.col }}@m {{ item.classes }}">
10
+ <div class="ons-pl-grid-col">{{ item.col }} col</div>
11
+ </div>
12
+ {%- endfor %}
13
+ {%- endfor %}
14
+ </div>
15
+
16
+ {% if params.container -%}
17
+ </div>
18
+ {% endif -%}
19
+ {% endmacro %}
@@ -57,13 +57,10 @@
57
57
  @extend %ons-input-focus;
58
58
 
59
59
  border-radius: $input-radius;
60
- bottom: 0;
60
+ inset: 0;
61
61
  content: '';
62
62
  display: block;
63
- left: 0;
64
63
  position: absolute;
65
- right: 0;
66
- top: 0;
67
64
  }
68
65
 
69
66
  &:not(&--prefix) & {
@@ -100,16 +97,13 @@
100
97
 
101
98
  & + .ons-input-type__type::after {
102
99
  border-radius: $input-radius;
103
- bottom: 0;
100
+ inset: 0;
104
101
 
105
102
  // Style input + prefix/suffix for errors
106
103
  box-shadow: 0 0 0 1px var(--ons-color-errors);
107
104
  content: '';
108
105
  display: block;
109
- left: 0;
110
106
  outline: 1px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
111
107
  position: absolute;
112
- right: 0;
113
- top: 0;
114
108
  }
115
109
  }
@@ -1,5 +1,6 @@
1
1
  %ons-input-focus {
2
- box-shadow: 0 0 0 $input-border-width var(--ons-color-input-border), 0 0 0 4px var(--ons-color-focus);
2
+ box-shadow: 0 0 0 $input-border-width var(--ons-color-input-border),
3
+ 0 0 0 4px var(--ons-color-focus);
3
4
 
4
5
  // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
5
6
  outline: 3px solid transparent;
@@ -31,7 +32,7 @@
31
32
  @include mq(s) {
32
33
  &--text,
33
34
  &--select {
34
- &:not(.ons-input--block):not([class*='input--w-']) {
35
+ &:not(.ons-input--block, [class*='input--w-']) {
35
36
  width: $input-width;
36
37
  }
37
38
  }
@@ -131,7 +132,7 @@
131
132
  }
132
133
 
133
134
  .ons-input--ghost {
134
- border: 2px solid rgba(255, 255, 255, 0.6);
135
+ border: 2px solid rgb(255 255 255 / 60%);
135
136
  &:focus {
136
137
  border: 2px solid var(--ons-color-input-border);
137
138
  }
@@ -1,4 +1,4 @@
1
- $backdrop-colour: rgba(0, 0, 0, 0.8);
1
+ $backdrop-colour: rgb(0 0 0 / 80%);
2
2
 
3
3
  .ons-modal {
4
4
  border: none;
@@ -13,7 +13,7 @@ $backdrop-colour: rgba(0, 0, 0, 0.8);
13
13
  position: fixed;
14
14
  top: 0;
15
15
 
16
- @media screen and (min-width: 600px) {
16
+ @media screen and (width >= 600px) {
17
17
  margin-left: auto;
18
18
  margin-right: auto;
19
19
  max-width: 500px;
@@ -21,12 +21,9 @@ $backdrop-colour: rgba(0, 0, 0, 0.8);
21
21
 
22
22
  &-ie11 & {
23
23
  background: var(--ons-color-white);
24
- bottom: 0;
24
+ inset: 50% 0 0;
25
25
  height: 350px;
26
- left: 0;
27
26
  position: fixed;
28
- right: 0;
29
- top: 50%;
30
27
  transform: translate(0, -50%);
31
28
  }
32
29
 
@@ -44,11 +44,15 @@ export default class NavigationToggle {
44
44
  this.navigation.classList.add(this.hideClass);
45
45
  }
46
46
 
47
+ isHidden(el) {
48
+ return el.offsetParent === null;
49
+ }
50
+
47
51
  setAria() {
48
- const viewportDetails = GetViewportDetails();
52
+ const isToggleHidden = this.isHidden(this.toggle);
49
53
  const hasAria = this.navigation.hasAttribute(attrHidden);
50
54
 
51
- if (viewportDetails.width < 980) {
55
+ if (!isToggleHidden) {
52
56
  if (!hasAria) {
53
57
  this.closeNav();
54
58
  }
@@ -2,9 +2,20 @@
2
2
  "fullWidth": true
3
3
  ---
4
4
  {% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
5
+ {% from "components/external-link/_macro.njk" import onsExternalLink %}
6
+
7
+ {% set feedbackLink %}
8
+ {{
9
+ onsExternalLink({
10
+ "url": "#0",
11
+ "linkText": "give feedback"
12
+ })
13
+ }}
14
+ {% endset %}
15
+
5
16
  {{
6
17
  onsPhaseBanner({
7
- "badge": 'Alpha',
8
- "html": 'This is a new service. To help us improve it, <a href="#0">give feedback</a>'
18
+ "badge": "Alpha",
19
+ "html": "This is a new service. To help us improve it, " + feedbackLink
9
20
  })
10
21
  }}
@@ -2,8 +2,19 @@
2
2
  "fullWidth": true
3
3
  ---
4
4
  {% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
5
+ {% from "components/external-link/_macro.njk" import onsExternalLink %}
6
+
7
+ {% set feedbackLink %}
8
+ {{
9
+ onsExternalLink({
10
+ "url": "#0",
11
+ "linkText": "give feedback"
12
+ })
13
+ }}
14
+ {% endset %}
15
+
5
16
  {{
6
17
  onsPhaseBanner({
7
- "html": 'This is a new service. To help us improve it, <a href="#0">give feedback</a>'
8
- })
18
+ "html": "This is a new service. To help us improve it, " + feedbackLink
19
+ })
9
20
  }}
@@ -115,7 +115,9 @@
115
115
  overflow-x: auto;
116
116
  width: 100%;
117
117
  &:focus {
118
- box-shadow: 0 0 0 3px var(--ons-color-page-light), 0 0 0 5px var(--ons-color-text-link-focus), 0 0 0 8px var(--ons-color-focus);
118
+ box-shadow: 0 0 0 3px var(--ons-color-page-light),
119
+ 0 0 0 5px var(--ons-color-text-link-focus),
120
+ 0 0 0 8px var(--ons-color-focus);
119
121
  outline: 3px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
120
122
  outline-offset: 1px;
121
123
  }
@@ -141,13 +143,15 @@
141
143
  .ons-table__right-shadow {
142
144
  right: 0;
143
145
  &.ons-visible {
144
- box-shadow: inset -1px 0 0 0 #bfc1c3, inset -5px 0 0 0 rgba(191, 193, 195, 0.4);
146
+ box-shadow: inset -1px 0 0 0 #bfc1c3,
147
+ inset -5px 0 0 0 rgb(191 193 195 / 40%);
145
148
  }
146
149
  }
147
150
  .ons-table__left-shadow {
148
151
  left: 0;
149
152
  &.ons-visible {
150
- box-shadow: inset 1px 0 0 0 #bfc1c3, inset -5px 0 0 0 rgba(191, 193, 195, 0.4);
153
+ box-shadow: inset 1px 0 0 0 #bfc1c3,
154
+ inset -5px 0 0 0 rgb(191 193 195 / 40%);
151
155
  }
152
156
  }
153
157
  }