@daffodil/design 0.42.2 → 0.43.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.
- package/esm2020/atoms/button/button.component.mjs +1 -1
- package/esm2020/molecules/callout/callout/callout.component.mjs +2 -2
- package/esm2020/molecules/card/card/card.component.mjs +2 -2
- package/esm2020/molecules/hero/hero/hero.component.mjs +2 -2
- package/esm2020/molecules/image-list/image-list.component.mjs +2 -2
- package/esm2020/molecules/list/list/list.component.mjs +2 -2
- package/esm2020/molecules/paginator/paginator.component.mjs +2 -2
- package/fesm2015/daffodil-design.mjs +12 -12
- package/fesm2015/daffodil-design.mjs.map +1 -1
- package/fesm2020/daffodil-design.mjs +12 -12
- package/fesm2020/daffodil-design.mjs.map +1 -1
- package/package.json +1 -1
- package/{src/scss → scss}/README.md +0 -0
- package/scss/accessibility/_errors.scss +12 -0
- package/scss/accessibility/_index.scss +1 -0
- package/scss/core/_index.scss +4 -0
- package/scss/core/map/map-deep-check/map-deep-check.scss +26 -0
- package/scss/core/map/map-deep-check/map-deep-check.spec.scss +43 -0
- package/scss/core/map/map-deep-get/map-deep-get.scss +27 -0
- package/scss/core/map/map-deep-get/map-deep-get.spec.scss +25 -0
- package/scss/core/string/split/string-split.scss +33 -0
- package/scss/core/string/split/string-split.spec.scss +35 -0
- package/scss/daff-global.scss +49 -0
- package/scss/daff-typography.scss +55 -0
- package/scss/daff-util.scss +21 -0
- package/scss/interactions/_index.scss +1 -0
- package/scss/interactions/mouse/_clickable.scss +22 -0
- package/scss/layout/_breakpoint.scss +21 -0
- package/scss/layout/_index.scss +2 -0
- package/scss/layout/_variables.scss +13 -0
- package/scss/theme.scss +77 -0
- package/scss/theming/README.md +59 -0
- package/scss/theming/_color-palettes.scss +116 -0
- package/scss/theming/_configure-palette.scss +20 -0
- package/scss/theming/_configure-theme.scss +68 -0
- package/scss/theming/_get-color.scss +18 -0
- package/scss/theming/_index.scss +6 -0
- package/scss/theming/_theme-css-variables.scss +43 -0
- package/scss/theming/contrast/_index.scss +5 -0
- package/scss/theming/contrast/contrast-ratio/contrast-ratio.scss +11 -0
- package/scss/theming/contrast/contrast-ratio/contrast-ratio.spec.scss +0 -0
- package/scss/theming/contrast/luminance/_variables.scss +268 -0
- package/scss/theming/contrast/luminance/luminance.scss +19 -0
- package/scss/theming/contrast/luminance/luminance.spec.scss +24 -0
- package/scss/theming/contrast/text-contrast/text-contrast.scss +34 -0
- package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +0 -0
- package/scss/theming/illuminate/illuminate.scss +145 -0
- package/scss/theming/illuminate/illuminate.spec.scss +15 -0
- package/scss/theming/prebuilt/internal-theme.scss +13 -0
- package/scss/typography/README.md +88 -0
- package/scss/typography/_classes.scss +20 -0
- package/scss/typography/_index.scss +5 -0
- package/scss/typography/mixins/_font-weight.scss +18 -0
- package/scss/typography/mixins/_sizes.scss +84 -0
- package/scss/typography/mixins/_text-transform.scss +4 -0
- package/scss/typography/mixins/_text-truncate.scss +23 -0
- package/scss/typography/utilities/_index.scss +1 -0
- package/scss/typography/utilities/_variables.scss +12 -0
- package/src/atoms/button/README.md +16 -11
- package/src/atoms/button/button-theme-variants/button.scss +35 -0
- package/src/atoms/button/button-theme-variants/focus.scss +6 -0
- package/src/atoms/button/button-theme-variants/icon.scss +21 -0
- package/src/atoms/button/button-theme-variants/raised.scss +56 -0
- package/src/atoms/button/button-theme-variants/stroked.scss +36 -0
- package/src/atoms/button/button-theme-variants/underline.scss +9 -0
- package/src/atoms/button/button-theme.scss +570 -0
- package/src/atoms/form/error-message/error-message-theme.scss +7 -0
- package/src/atoms/form/form-field/form-field/form-field-theme.scss +38 -0
- package/src/atoms/form/input/input-theme.scss +16 -0
- package/src/atoms/form/radio/radio.scss +0 -0
- package/src/atoms/form/select/select/select-theme.scss +19 -0
- package/src/atoms/loading-icon/loading-icon-theme.scss +57 -0
- package/src/atoms/progress-indicator/progress-indicator-theme.scss +60 -0
- package/src/molecules/accordion/accordion-item/accordion-item-theme.scss +12 -0
- package/src/molecules/article/article/_stops-article-cascade.scss +7 -0
- package/src/molecules/article/article/article-theme.scss +78 -0
- package/src/molecules/callout/callout-theme.scss +59 -0
- package/src/molecules/card/card/card-theme-variants/basic-card.scss +6 -0
- package/src/molecules/card/card/card-theme-variants/linkable-card.scss +23 -0
- package/src/molecules/card/card/card-theme-variants/stroked-card.scss +3 -0
- package/src/molecules/card/card/card-theme.scss +186 -0
- package/src/molecules/hero/hero-theme.scss +59 -0
- package/src/molecules/list/list/list-theme.scss +68 -0
- package/src/molecules/media-gallery/media-gallery-theme.scss +20 -0
- package/src/molecules/modal/modal-theme.scss +9 -0
- package/src/molecules/navbar/navbar-theme.scss +57 -0
- package/src/molecules/paginator/paginator-theme.scss +72 -0
- package/src/molecules/sidebar/sidebar/sidebar-theme.scss +13 -0
- package/src/molecules/sidebar/sidebar-viewport/sidebar-viewport-theme.scss +11 -0
- package/daff-global.scss +0 -2
- package/daff-theme.scss +0 -3633
- package/daff-typography.scss +0 -505
- package/daff-util.scss +0 -377
package/daff-util.scss
DELETED
@@ -1,377 +0,0 @@
|
|
1
|
-
// @docs
|
2
|
-
//
|
3
|
-
// `daff-util` is a utility library that contains common functions,
|
4
|
-
// mixins and variables that make writing SCSS style-sheets a bit
|
5
|
-
// easier.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
// @note You can import this as often as you like, as it only contains SCSS
|
9
|
-
// variables, mixins, and functions; thus it won't effect your final
|
10
|
-
// compiled stylesheet size.
|
11
|
-
//
|
12
|
-
// @usage
|
13
|
-
// ```
|
14
|
-
//
|
15
|
-
// ```
|
16
|
-
|
17
|
-
// Variables
|
18
|
-
$body-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
|
19
|
-
Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
20
|
-
$base-font-family: $body-font-family;
|
21
|
-
$monospace-font-family: ui-monospace, 'SFMono-Regular', SF Mono, Menlo, Consolas,
|
22
|
-
'Liberation Mono', monospace;
|
23
|
-
|
24
|
-
// deprecated
|
25
|
-
$desktop-font-size: 16px;
|
26
|
-
$mobile-font-size: 16px;
|
27
|
-
|
28
|
-
$large-font-size: 1.5rem;
|
29
|
-
$medium-font-size: 1.25rem;
|
30
|
-
$normal-font-size: 1rem;
|
31
|
-
$small-font-size: 0.875rem;
|
32
|
-
|
33
|
-
//
|
34
|
-
// @docs
|
35
|
-
//
|
36
|
-
// Sensible breakpoints to be used for layouts and interfaces.
|
37
|
-
// These breakpoints are based on common devices viewport widths.
|
38
|
-
$breakpoints: (
|
39
|
-
desktop: 1920px,
|
40
|
-
laptop: 1440px,
|
41
|
-
small-laptop: 1200px,
|
42
|
-
big-tablet: 1024px,
|
43
|
-
tablet: 768px,
|
44
|
-
mobile: 480px
|
45
|
-
);
|
46
|
-
|
47
|
-
|
48
|
-
// Daffodil SASS Core
|
49
|
-
//
|
50
|
-
// @docs
|
51
|
-
// @private
|
52
|
-
// Splits a string into an array based on a separator
|
53
|
-
// Remember, string arrays begin at 1 in SASS.
|
54
|
-
//
|
55
|
-
// @returns comma-list
|
56
|
-
//
|
57
|
-
@function daff-string-split($string, $separator) {
|
58
|
-
$list: ();
|
59
|
-
$index: str-index($string, $separator);
|
60
|
-
|
61
|
-
@if ($index == null) {
|
62
|
-
@return $list;
|
63
|
-
}
|
64
|
-
|
65
|
-
@while $index !=null {
|
66
|
-
$item: str-slice($string, 1, $index - 1);
|
67
|
-
|
68
|
-
@if ($item != '') {
|
69
|
-
$list: append($list, $item, 'comma');
|
70
|
-
}
|
71
|
-
|
72
|
-
$string: str-slice($string, $index + 1);
|
73
|
-
$index: str-index($string, $separator);
|
74
|
-
}
|
75
|
-
|
76
|
-
@if ($string != '') {
|
77
|
-
$list: append($list, $string, 'comma');
|
78
|
-
}
|
79
|
-
|
80
|
-
@return $list;
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
//
|
85
|
-
// Checks whether or not a map has a nested key
|
86
|
-
//
|
87
|
-
// @param $map - the map being checked
|
88
|
-
// @param $keys - an list of ordered keys to traverse down
|
89
|
-
//
|
90
|
-
// @returns boolean
|
91
|
-
// @throws error
|
92
|
-
//
|
93
|
-
@function daff-map-deep-check($map, $keys) {
|
94
|
-
@if (type-of($map) != 'map') {
|
95
|
-
@error 'Expected first parameter to be of type `map`';
|
96
|
-
}
|
97
|
-
|
98
|
-
@each $key in $keys {
|
99
|
-
@if (not map-has-key($map, $key)) {
|
100
|
-
@return false;
|
101
|
-
}
|
102
|
-
|
103
|
-
$map: map-get($map, $key);
|
104
|
-
}
|
105
|
-
|
106
|
-
@return true;
|
107
|
-
}
|
108
|
-
|
109
|
-
//
|
110
|
-
// @docs
|
111
|
-
// @private
|
112
|
-
// Splits a string into an array based on a separator
|
113
|
-
// Remember, string arrays begin at 1 in SASS.
|
114
|
-
//
|
115
|
-
// @returns comma-list
|
116
|
-
//
|
117
|
-
@function daff-string-split($string, $separator) {
|
118
|
-
$list: ();
|
119
|
-
$index: str-index($string, $separator);
|
120
|
-
|
121
|
-
@if ($index == null) {
|
122
|
-
@return $list;
|
123
|
-
}
|
124
|
-
|
125
|
-
@while $index !=null {
|
126
|
-
$item: str-slice($string, 1, $index - 1);
|
127
|
-
|
128
|
-
@if ($item != '') {
|
129
|
-
$list: append($list, $item, 'comma');
|
130
|
-
}
|
131
|
-
|
132
|
-
$string: str-slice($string, $index + 1);
|
133
|
-
$index: str-index($string, $separator);
|
134
|
-
}
|
135
|
-
|
136
|
-
@if ($string != '') {
|
137
|
-
$list: append($list, $string, 'comma');
|
138
|
-
}
|
139
|
-
|
140
|
-
@return $list;
|
141
|
-
}
|
142
|
-
|
143
|
-
//
|
144
|
-
// Checks whether or not a map has a nested key
|
145
|
-
//
|
146
|
-
// @param $map - the map being checked
|
147
|
-
// @param $keys - an list of ordered keys to traverse down
|
148
|
-
//
|
149
|
-
// @returns boolean
|
150
|
-
// @throws error
|
151
|
-
//
|
152
|
-
@function daff-map-deep-check($map, $keys) {
|
153
|
-
@if (type-of($map) != 'map') {
|
154
|
-
@error 'Expected first parameter to be of type `map`';
|
155
|
-
}
|
156
|
-
|
157
|
-
@each $key in $keys {
|
158
|
-
@if (not map-has-key($map, $key)) {
|
159
|
-
@return false;
|
160
|
-
}
|
161
|
-
|
162
|
-
$map: map-get($map, $key);
|
163
|
-
}
|
164
|
-
|
165
|
-
@return true;
|
166
|
-
}
|
167
|
-
|
168
|
-
|
169
|
-
//
|
170
|
-
// Return a the value of a nested key in a map if it exists.
|
171
|
-
// If the key doesn't exist, it throw an error.
|
172
|
-
//
|
173
|
-
// Note: This function doesn't support the use
|
174
|
-
// of the search character in your map key names.
|
175
|
-
//
|
176
|
-
// @usage daff-map-deep-get($map, "nested.map.key");
|
177
|
-
// @returns any
|
178
|
-
// @throws error
|
179
|
-
@function daff-map-deep-get($map, $key, $search-character: '.') {
|
180
|
-
$keys: daff-string-split($key, $search-character);
|
181
|
-
|
182
|
-
@if not daff-map-deep-check($map, $keys) {
|
183
|
-
@error 'The map doesn\'t contain the $key: `#{$key}`\'';
|
184
|
-
}
|
185
|
-
|
186
|
-
@each $key in $keys {
|
187
|
-
$map: map-get($map, $key);
|
188
|
-
}
|
189
|
-
|
190
|
-
@return $map;
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
// Sass Mixins & Functions
|
196
|
-
//
|
197
|
-
// @docs
|
198
|
-
//
|
199
|
-
// The clickable() mixin sets mouse cursor to display when the mouse
|
200
|
-
// pointer is over an element for all supported browsers
|
201
|
-
//
|
202
|
-
// Supported browsers: Chrome all/Safari all/Firefox all/IE 10+
|
203
|
-
//
|
204
|
-
// @usage
|
205
|
-
// ```
|
206
|
-
// @include clickable();
|
207
|
-
// ```
|
208
|
-
@mixin clickable() {
|
209
|
-
cursor: pointer;
|
210
|
-
-webkit-user-select: none;
|
211
|
-
/// Chrome all / Safari all ///
|
212
|
-
-moz-user-select: none;
|
213
|
-
/// Firefox all ///
|
214
|
-
-ms-user-select: none;
|
215
|
-
/// IE 10+ ///
|
216
|
-
user-select: none;
|
217
|
-
}
|
218
|
-
|
219
|
-
//
|
220
|
-
// Take a the list of breakpoints and retrieves the defined point.
|
221
|
-
// If an invalid breakpoint is defined, it will display a warning.
|
222
|
-
//
|
223
|
-
// @usage
|
224
|
-
// ```
|
225
|
-
// @include breakpoint(mobile) {}
|
226
|
-
// ```
|
227
|
-
//
|
228
|
-
@mixin breakpoint($point) {
|
229
|
-
@if not map-has-key($map: $breakpoints, $key: $point) {
|
230
|
-
@warn 'breakpoint(): "#{$key}" is not defined in your $breakpoints setting.';
|
231
|
-
}
|
232
|
-
|
233
|
-
@media (min-width: map-get($breakpoints, $point)) {
|
234
|
-
@content;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
|
238
|
-
//
|
239
|
-
// @docs
|
240
|
-
//
|
241
|
-
// Changes the weight (boldness) of text to 700
|
242
|
-
//
|
243
|
-
// @usage
|
244
|
-
// ```
|
245
|
-
// @include embolden(500);
|
246
|
-
// ```
|
247
|
-
//
|
248
|
-
@mixin embolden($weight: 700) {
|
249
|
-
font-weight: $weight;
|
250
|
-
}
|
251
|
-
|
252
|
-
//
|
253
|
-
// @docs
|
254
|
-
//
|
255
|
-
// Changes the casing of a piece of text to uppercase
|
256
|
-
//
|
257
|
-
// @usage
|
258
|
-
// ```
|
259
|
-
// @include uppercase();
|
260
|
-
// ```
|
261
|
-
//
|
262
|
-
@mixin uppercase() {
|
263
|
-
text-transform: uppercase;
|
264
|
-
}
|
265
|
-
|
266
|
-
//
|
267
|
-
// @docs
|
268
|
-
//
|
269
|
-
// Forces a line of text (with a fixed width) to ellipsis
|
270
|
-
// once it reaches the width of its container.
|
271
|
-
//
|
272
|
-
// @usage
|
273
|
-
// ```
|
274
|
-
// @include single-line-ellipsis();
|
275
|
-
// ```
|
276
|
-
@mixin single-line-ellipsis() {
|
277
|
-
display: block;
|
278
|
-
overflow: hidden;
|
279
|
-
text-overflow: ellipsis;
|
280
|
-
white-space: nowrap;
|
281
|
-
}
|
282
|
-
|
283
|
-
@mixin headline-xl() {
|
284
|
-
@include embolden();
|
285
|
-
font-size: 2.5rem;
|
286
|
-
line-height: 2.75rem;
|
287
|
-
|
288
|
-
@include breakpoint(tablet) {
|
289
|
-
font-size: 3.5rem;
|
290
|
-
line-height: 4rem;
|
291
|
-
}
|
292
|
-
}
|
293
|
-
|
294
|
-
@mixin headline-lg() {
|
295
|
-
@include embolden();
|
296
|
-
font-size: 2rem;
|
297
|
-
line-height: 2.25rem;
|
298
|
-
|
299
|
-
@include breakpoint(tablet) {
|
300
|
-
font-size: 3rem;
|
301
|
-
line-height: 3.5rem;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
|
305
|
-
@mixin headline-md() {
|
306
|
-
@include embolden();
|
307
|
-
font-size: 1.5rem;
|
308
|
-
line-height: 1.75rem;
|
309
|
-
|
310
|
-
@include breakpoint(tablet) {
|
311
|
-
font-size: 2rem;
|
312
|
-
line-height: 2.5rem;
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
@mixin headline-sm() {
|
317
|
-
@include embolden();
|
318
|
-
font-size: 1.25rem;
|
319
|
-
line-height: 1.5rem;
|
320
|
-
|
321
|
-
@include breakpoint(tablet) {
|
322
|
-
font-size: 1.5rem;
|
323
|
-
line-height: 2rem;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
@mixin body-lg() {
|
327
|
-
font-size: 1.5rem;
|
328
|
-
font-weight: 400;
|
329
|
-
line-height: 2rem;
|
330
|
-
}
|
331
|
-
|
332
|
-
@mixin body-md() {
|
333
|
-
font-size: 1.25rem;
|
334
|
-
font-weight: 400;
|
335
|
-
line-height: 1.75rem;
|
336
|
-
}
|
337
|
-
|
338
|
-
@mixin body-sm() {
|
339
|
-
font-size: 1rem;
|
340
|
-
font-weight: 400;
|
341
|
-
line-height: 1.5rem;
|
342
|
-
}
|
343
|
-
|
344
|
-
@mixin body-xs() {
|
345
|
-
font-size: 0.875rem;
|
346
|
-
font-weight: 400;
|
347
|
-
line-height: 1.25rem;
|
348
|
-
}
|
349
|
-
|
350
|
-
@mixin subheading() {
|
351
|
-
@include uppercase();
|
352
|
-
font-size: 0.875rem;
|
353
|
-
font-weight: 600;
|
354
|
-
letter-spacing: 0.03125rem;
|
355
|
-
line-height: 1rem;
|
356
|
-
}
|
357
|
-
|
358
|
-
@mixin caption() {
|
359
|
-
font-size: 0.75rem;
|
360
|
-
line-height: 1rem;
|
361
|
-
font-weight: 400;
|
362
|
-
}
|
363
|
-
|
364
|
-
|
365
|
-
// Accessibility
|
366
|
-
/* stylelint-disable */
|
367
|
-
$wcag-aa-errors: (
|
368
|
-
'text-contrast': 'WCAG 2.0 level AA requires text and its background color to have a contrast ratio of at least 4.5:1',
|
369
|
-
'icon-contrast': 'WCAG 2.0 level AA requires the icon and its background color to have a contrast ratio of at least 3:1'
|
370
|
-
);
|
371
|
-
|
372
|
-
$wcag-aaa-errors: (
|
373
|
-
map-merge($wcag-aa-errors, (
|
374
|
-
'text-contrast': 'WCAG 2.0 level AA requires text and its background color to have a contrast ratio of at least 7:1',
|
375
|
-
))
|
376
|
-
);
|
377
|
-
/* stylelint-enable */
|