@ongov/ontario-design-system-complete-styles 4.3.0 → 5.0.0-alpha.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.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path d="M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4l5.6 5.6L5 17.6 6.4 19l5.6-5.6 5.6 5.6 1.4-1.4-5.6-5.6L19 6.4z" fill="#000"/></svg>
@@ -0,0 +1,20 @@
1
+ (function () {
2
+ const links = document.querySelectorAll('.ontario-page-navigation-item__link');
3
+
4
+ for (const link of links) {
5
+ link.addEventListener('click', clickHandler);
6
+ }
7
+
8
+ function clickHandler(e) {
9
+ e.preventDefault();
10
+
11
+ const href = this.getAttribute('href');
12
+ const element = document.querySelector(href);
13
+
14
+ if (element) {
15
+ element.scrollIntoView({ behavior: 'smooth' });
16
+ }
17
+
18
+ history.pushState(null, null, href);
19
+ }
20
+ })();
@@ -15,7 +15,7 @@
15
15
  border-radius: globalVariables.$global-radius;
16
16
  margin: spacing.$spacing-0 spacing.$spacing-7 spacing.$spacing-7 spacing.$spacing-0;
17
17
  padding: spacing.$spacing-0;
18
- /*
18
+ /*
19
19
  * Required for cards to stay the same height regardless of content size.
20
20
  * Without subtracting the margin-bottom amount the cards will be too large.
21
21
  */
@@ -47,6 +47,13 @@
47
47
  }
48
48
  }
49
49
 
50
+ .ontario-card--image-true {
51
+ margin-top: spacing.$spacing-2 * -1;
52
+ @at-root .ontario-card__card-type--horizontal & {
53
+ margin-top: spacing.$spacing-0;
54
+ }
55
+ }
56
+
50
57
  .ontario-card__card-type--horizontal {
51
58
  display: flex;
52
59
 
@@ -60,6 +67,10 @@
60
67
  position: relative;
61
68
  }
62
69
 
70
+ .ontario-card__heading {
71
+ border-radius: 0;
72
+ }
73
+
63
74
  a {
64
75
  &:focus-within {
65
76
  box-shadow: none;
@@ -88,35 +99,18 @@
88
99
  padding: (spacing.$spacing-5 - spacing.$spacing-1) spacing.$spacing-5 spacing.$spacing-2 spacing.$spacing-5;
89
100
  transition: text-decoration 0.3s ease-in-out;
90
101
  background-color: colours.$ontario-colour-white;
102
+ max-width: none;
91
103
 
92
104
  .ontario-card:hover & {
93
105
  text-decoration-line: underline;
94
106
  text-decoration-color: colours.$ontario-colour-black;
95
107
  }
96
108
 
97
- .ontario-card__header-type--light & {
98
- background-color: colours.$ontario-greyscale-5;
99
- padding-top: spacing.$spacing-4;
100
- padding-bottom: spacing.$spacing-4;
101
- padding-right: spacing.$spacing-9;
102
- border-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;
103
- }
104
-
105
- .ontario-card__header-type--dark & {
106
- background-color: colours.$ontario-colour-black;
107
- padding-top: spacing.$spacing-4;
108
- padding-bottom: spacing.$spacing-4;
109
- border-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;
110
- }
111
-
112
- .ontario-card__header-type--dark:hover & {
113
- text-decoration-line: underline;
114
- text-decoration-color: colours.$ontario-colour-white;
115
- }
116
-
117
- .ontario-card--no-description & {
118
- padding: spacing.$spacing-4 spacing.$spacing-5;
119
- border-radius: 0 0 globalVariables.$global-radius globalVariables.$global-radius;
109
+ .ontario-card--image-true & {
110
+ border-radius: 0;
111
+ @at-root .ontario-card__card-type--horizontal & {
112
+ border-radius: 0 globalVariables.$global-radius 0 0;
113
+ }
120
114
  }
121
115
 
122
116
  a {
@@ -124,10 +118,6 @@
124
118
  text-decoration: none;
125
119
  outline: none;
126
120
 
127
- .ontario-card__header-type--dark & {
128
- color: colours.$ontario-colour-white;
129
- }
130
-
131
121
  &::after {
132
122
  content: '';
133
123
  position: absolute;
@@ -153,6 +143,47 @@
153
143
  }
154
144
  }
155
145
 
146
+ // ontario-card's header colour options
147
+
148
+ $ontario-card-heading-colours: (
149
+ 'light-accent': colours.$ontario-greyscale-5,
150
+ 'dark-accent': colours.$ontario-colour-black,
151
+ 'light-gold': colours.$ontario-colour-light-gold,
152
+ 'light-yellow': colours.$ontario-colour-light-yellow,
153
+ 'light-taupe': colours.$ontario-colour-light-taupe,
154
+ 'light-green': colours.$ontario-colour-light-green,
155
+ 'light-lime': colours.$ontario-colour-light-lime,
156
+ 'light-teal': colours.$ontario-colour-light-teal,
157
+ 'light-sky': colours.$ontario-colour-light-sky,
158
+ 'light-purple': colours.$ontario-colour-light-purple,
159
+ 'light-orange': colours.$ontario-colour-light-orange,
160
+ 'light-red': colours.$ontario-colour-light-red,
161
+ 'light-magenta': colours.$ontario-colour-light-magenta,
162
+ 'gold': colours.$ontario-colour-gold,
163
+ 'yellow': colours.$ontario-colour-yellow,
164
+ 'taupe': colours.$ontario-colour-taupe,
165
+ 'green': colours.$ontario-colour-green,
166
+ 'lime': colours.$ontario-colour-lime,
167
+ 'teal': colours.$ontario-colour-teal,
168
+ 'sky': colours.$ontario-colour-sky,
169
+ 'purple': colours.$ontario-colour-purple,
170
+ 'orange': colours.$ontario-colour-orange,
171
+ 'red': colours.$ontario-colour-red,
172
+ 'magenta': colours.$ontario-colour-magenta,
173
+ );
174
+
175
+ @each $colour-name, $colour-value in $ontario-card-heading-colours {
176
+ .ontario-card__background--#{$colour-name} {
177
+ background-color: $colour-value;
178
+ }
179
+
180
+ .ontario-card__heading--#{$colour-name} {
181
+ background-color: $colour-value;
182
+ padding-top: spacing.$spacing-4;
183
+ padding-bottom: spacing.$spacing-4;
184
+ }
185
+ }
186
+
156
187
  .ontario-card__text-container {
157
188
  .ontario-card__card-type--horizontal & {
158
189
  width: 66.6%;
@@ -182,18 +213,8 @@
182
213
  margin-bottom: spacing.$spacing-0;
183
214
  }
184
215
 
185
- .ontario-card__header-type--light &,
186
- .ontario-card__header-type--dark & {
187
- padding-top: spacing.$spacing-4;
188
- }
189
-
190
216
  @media screen and (max-width: breakpoints.$medium-breakpoint) {
191
217
  padding: spacing.$spacing-2 spacing.$spacing-4 spacing.$spacing-5 spacing.$spacing-4;
192
-
193
- .ontario-card__header-type--light &,
194
- .ontario-card__header-type--dark & {
195
- padding-top: spacing.$spacing-4;
196
- }
197
218
  }
198
219
  }
199
220
 
@@ -16,7 +16,6 @@ $ontario-checkboxes-size: globalFunctions.px-to-rem(28);
16
16
  $ontario-checkboxes-size-mobile: globalFunctions.px-to-rem(32);
17
17
  $ontario-checkbox-border-size: globalFunctions.px-to-rem(2);
18
18
  $ontario-checkbox-box-shadow-outline: globalFunctions.px-to-rem(4);
19
- $ontario-input-border-width: 0.125rem;
20
19
 
21
20
  :host {
22
21
  --checkbox-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M0 2.667C0 1.194 1.194 0 2.667 0h18.667C22.806 0 24 1.194 24 2.667v18.667C24 22.806 22.806 24 21.333 24H2.667C1.194 24 0 22.806 0 21.333V2.667z' fill='%231a1a1a'/%3E%3Cpath d='M2.667 12.616l6.667 6.718 12-12.092-1.88-1.908L9.333 15.53l-4.787-4.8-1.88 1.894z' fill='%23fff'/%3E%3C/svg%3E");
@@ -57,10 +57,6 @@
57
57
 
58
58
  .ontario-service-subheader .ontario-header-button {
59
59
  display: flex;
60
-
61
- &:last-of-type {
62
- display: none;
63
- }
64
60
  }
65
61
 
66
62
  .ontario-service-subheader .ontario-header-button {
@@ -19,7 +19,6 @@
19
19
  $ontario-radios-size: 32px;
20
20
  $ontario-radios-size-mobile: 36px;
21
21
  $ontario-input-offset: math.div((globalVariables.$touch-target-size - $ontario-radios-size), 2);
22
- $ontario-input-border-width: 0.125rem;
23
22
 
24
23
  .ontario-radios__item {
25
24
  position: relative;
@@ -0,0 +1,141 @@
1
+ @use 'sass:math';
2
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;
3
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;
4
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;
5
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/breakpoints.variables' as breakpoints;
6
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/typography.variables' as typography;
7
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/line-heights.variables' as lineheight;
8
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;
9
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/functions/global.functions' as globalFunctions;
10
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/placeholder/focus.placeholders' as
11
+ focusPlaceholders;
12
+ @use '@ongov/ontario-design-system-global-styles/dist/styles/scss/4-elements/_global.elements.scss';
13
+ @use '../../styles/form.scss';
14
+
15
+ $ontario-input-height: globalFunctions.px-to-rem(48);
16
+ $ontario-search-icon-size: 2rem;
17
+ $ontario-reset-icon-size: 1.5rem;
18
+ $ontario-search-button-width: 5rem;
19
+ $ontario-search-button-width--mobile: 3rem;
20
+ $ontario-search-input-padding: 8.5rem;
21
+ $ontario-search-input-padding--mobile: 7.75rem;
22
+ $ontario-search-desktop-width: 34rem;
23
+ $ontario-search-mobile-width: 20.5rem;
24
+
25
+ .ontario-search__container {
26
+ max-width: $ontario-search-desktop-width;
27
+ margin-bottom: spacing.$spacing-7;
28
+ }
29
+
30
+ .ontario-search__input-container {
31
+ position: relative;
32
+ }
33
+
34
+ .ontario-search__input.ontario-input {
35
+ border: 2px solid colours.$ontario-colour-black;
36
+ margin-bottom: spacing.$spacing-0;
37
+ height: $ontario-input-height;
38
+ padding-left: spacing.$spacing-3;
39
+ padding-right: $ontario-search-input-padding;
40
+ width: 100%;
41
+
42
+ &:invalid + input[type='reset'] {
43
+ display: none;
44
+ }
45
+
46
+ &:focus {
47
+ @extend %ontario-focus;
48
+ }
49
+ }
50
+
51
+ input[type='reset'].ontario-search__reset {
52
+ position: absolute;
53
+ display: flex;
54
+ align-items: center;
55
+ top: spacing.$spacing-3;
56
+ right: $ontario-search-button-width + spacing.$spacing-4;
57
+ height: $ontario-reset-icon-size;
58
+ width: $ontario-reset-icon-size;
59
+ color: colours.$ontario-colour-black;
60
+ margin: spacing.$spacing-0;
61
+ padding: spacing.$spacing-1;
62
+ background-size: $ontario-reset-icon-size;
63
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTE5IDYuNEwxNy42IDUgMTIgMTAuNiA2LjQgNSA1IDYuNGw1LjYgNS42TDUgMTcuNiA2LjQgMTlsNS42LTUuNiA1LjYgNS42IDEuNC0xLjQtNS42LTUuNkwxOSA2LjR6IiBmaWxsPSIjMDAwIi8+PC9zdmc+);
64
+ background-position: center center;
65
+ background-repeat: no-repeat;
66
+ background-color: transparent;
67
+ outline: none;
68
+ border: none;
69
+ cursor: pointer;
70
+
71
+ &:focus {
72
+ box-shadow: inset 0 0 0 globalVariables.$global-radius colours.$ontario-colour-focus;
73
+ }
74
+
75
+ @media screen and (max-width: breakpoints.$small-breakpoint) {
76
+ right: $ontario-search-button-width--mobile + spacing.$spacing-7;
77
+ }
78
+ }
79
+
80
+ .ontario-search__submit {
81
+ border: 0;
82
+ border-radius: 0 3px 3px 0;
83
+ background-color: colours.$ontario-colour-link;
84
+ color: colours.$ontario-colour-black;
85
+
86
+ display: flex;
87
+ justify-content: center;
88
+ align-items: center;
89
+
90
+ font-family: typography.$ontario-font-open-sans;
91
+ font-weight: fontWeights.$ontario-font-weights-semi-bold;
92
+ font-size: 1.125rem;
93
+ width: $ontario-search-button-width;
94
+ line-height: lineheight.$ontario-line-height-8;
95
+
96
+ position: absolute;
97
+ right: spacing.$spacing-0;
98
+ bottom: spacing.$spacing-0;
99
+ top: spacing.$spacing-0;
100
+ cursor: pointer;
101
+
102
+ &:hover {
103
+ background-color: colours.$ontario-colour-link--hover;
104
+ color: colours.$ontario-colour-white;
105
+ }
106
+
107
+ &:focus {
108
+ outline: none;
109
+ box-shadow: 0 0 0 globalVariables.$global-radius colours.$ontario-colour-focus;
110
+ background-color: colours.$ontario-colour-link--hover;
111
+ color: colours.$ontario-colour-white;
112
+ }
113
+
114
+ &:active {
115
+ background-color: colours.$ontario-colour-link--active;
116
+ color: colours.$ontario-colour-white;
117
+ }
118
+
119
+ svg {
120
+ fill: colours.$ontario-colour-white;
121
+ margin-right: spacing.$spacing-0;
122
+ margin-bottom: spacing.$spacing-0;
123
+ width: $ontario-search-icon-size;
124
+ height: $ontario-search-icon-size;
125
+ display: inline-block;
126
+ vertical-align: middle;
127
+ overflow: hidden;
128
+ }
129
+
130
+ @media screen and (max-width: breakpoints.$small-breakpoint) {
131
+ width: $ontario-search-button-width--mobile;
132
+ }
133
+ }
134
+
135
+ // remove default cancel button for input with type="search"
136
+ input[type='search'].ontario-search__input::-webkit-search-decoration,
137
+ input[type='search'].ontario-search__input::-webkit-search-cancel-button,
138
+ input[type='search'].ontario-search__input::-webkit-search-results-button,
139
+ input[type='search'].ontario-search__input::-webkit-search-results-decoration {
140
+ -webkit-appearance: none;
141
+ }
@@ -24,6 +24,7 @@
24
24
  @forward "./../../components/ontario-loading-indicator/ontario-loading-indicator.scss";
25
25
  @forward "./../../components/ontario-page-alert/ontario-page-alert.scss";
26
26
  @forward "./../../components/ontario-radio-buttons/ontario-radio-buttons.scss";
27
+ @forward "./../../components/ontario-search-box/ontario-search-box.scss";
27
28
  @forward "./../../components/ontario-step-indicator/ontario-step-indicator.scss";
28
29
  @forward "./../../components/ontario-table/ontario-table.scss";
29
30
  @forward "./../../components/ontario-textarea/ontario-textarea.scss";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ongov/ontario-design-system-complete-styles",
3
- "version": "4.3.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "private": false,
5
5
  "description": "Complete styles package for the Ontario Design System containing all SASS and CSS for use independently of the Component Library.",
6
6
  "license": "Apache-2.0",
@@ -20,9 +20,9 @@
20
20
  "docs:copy:readme": "ts-node ../../scripts/documentation-helper.ts -f README.md -p \"---\ntitle: Complete Styles\n---\n\" -df ../app-web-components-documentation/docs/06-readme-complete-styles.md"
21
21
  },
22
22
  "dependencies": {
23
- "@ongov/ontario-design-system-component-library": "4.3.0",
24
- "@ongov/ontario-design-system-design-tokens": "4.3.0",
25
- "@ongov/ontario-design-system-global-styles": "4.3.0",
23
+ "@ongov/ontario-design-system-component-library": "5.0.0-alpha.1",
24
+ "@ongov/ontario-design-system-design-tokens": "4.3.1-alpha.1",
25
+ "@ongov/ontario-design-system-global-styles": "4.3.1-alpha.1",
26
26
  "gulp-flatten": "^0.4.0"
27
27
  },
28
28
  "devDependencies": {
@@ -48,5 +48,5 @@
48
48
  }
49
49
  ],
50
50
  "sass": "dist/styles/scss/theme.scss",
51
- "gitHead": "788db424e1fbcb72a4b9bf8da801da4765ab6154"
51
+ "gitHead": "2941db5cb66d3a161e359f36543b489922853b02"
52
52
  }