@ilo-org/styles 0.14.2 → 0.16.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 (85) hide show
  1. package/.turbo/turbo-build:lib.log +25 -0
  2. package/CHANGELOG.md +727 -0
  3. package/css/components/accordion.css +1 -1
  4. package/css/components/breadcrumb.css +1 -1
  5. package/css/components/button.css +1 -1
  6. package/css/components/callout.css +1 -1
  7. package/css/components/card.css +1 -1
  8. package/css/components/cardgroup.css +1 -1
  9. package/css/components/checkbox.css +1 -1
  10. package/css/components/container.css +1 -1
  11. package/css/components/contextmenu.css +1 -1
  12. package/css/components/credit.css +1 -1
  13. package/css/components/datacard.css +1 -1
  14. package/css/components/detailcard.css +1 -1
  15. package/css/components/dropdown.css +1 -1
  16. package/css/components/empty.css +1 -1
  17. package/css/components/factlistcard.css +1 -1
  18. package/css/components/featurecard.css +1 -1
  19. package/css/components/fieldset.css +1 -1
  20. package/css/components/file-upload.css +1 -1
  21. package/css/components/footer.css +1 -1
  22. package/css/components/form.css +1 -1
  23. package/css/components/formcontrol.css +1 -1
  24. package/css/components/hero.css +1 -1
  25. package/css/components/herocard.css +1 -1
  26. package/css/components/image.css +1 -1
  27. package/css/components/input.css +1 -1
  28. package/css/components/link.css +1 -1
  29. package/css/components/linklist.css +1 -1
  30. package/css/components/list.css +1 -1
  31. package/css/components/loading.css +1 -1
  32. package/css/components/logo.css +1 -1
  33. package/css/components/logogrid.css +1 -1
  34. package/css/components/modal.css +1 -1
  35. package/css/components/multilinkcard.css +1 -1
  36. package/css/components/navigation.css +1 -1
  37. package/css/components/notification.css +1 -1
  38. package/css/components/pagination.css +1 -1
  39. package/css/components/profile.css +1 -1
  40. package/css/components/promocard.css +1 -1
  41. package/css/components/radio.css +1 -1
  42. package/css/components/readmore.css +1 -1
  43. package/css/components/richtext.css +1 -1
  44. package/css/components/searchfield.css +1 -1
  45. package/css/components/socialmedia.css +1 -1
  46. package/css/components/statcard.css +1 -1
  47. package/css/components/table.css +1 -1
  48. package/css/components/tableofcontents.css +1 -1
  49. package/css/components/tabs.css +1 -1
  50. package/css/components/tag.css +1 -1
  51. package/css/components/textarea.css +1 -1
  52. package/css/components/textcard.css +1 -1
  53. package/css/components/textinput.css +1 -1
  54. package/css/components/toggle.css +1 -1
  55. package/css/components/tooltip.css +1 -1
  56. package/css/components/video.css +1 -1
  57. package/css/global.css +1 -1
  58. package/css/global.css.map +1 -1
  59. package/css/index.css +2 -2
  60. package/css/index.css.map +1 -1
  61. package/css/monorepo.css +2 -2
  62. package/css/monorepo.css.map +1 -1
  63. package/gulpfile.mjs +99 -0
  64. package/package.json +26 -17
  65. package/postcss.config.js +1 -0
  66. package/scss/_mixins.scss +74 -0
  67. package/scss/_normalize.scss +329 -0
  68. package/scss/_reset.scss +62 -113
  69. package/scss/components/_list.scss +28 -69
  70. package/scss/components/_pagination.scss +7 -1
  71. package/scss/components/_richtext.scss +24 -63
  72. package/scss/components/_textcard.scss +3 -3
  73. package/scss/index.scss +3 -0
  74. package/build/css/components/index.css +0 -8494
  75. package/build/css/components/index.css.map +0 -1
  76. package/build/css/global.css +0 -175
  77. package/build/css/global.css.map +0 -1
  78. package/build/css/index.css +0 -8657
  79. package/build/css/index.css.map +0 -1
  80. package/build/css/monorepo.css +0 -8735
  81. package/build/css/monorepo.css.map +0 -1
  82. package/build/minified/index.css +0 -2
  83. package/build/minified/index.css.map +0 -1
  84. package/build/minified/monorepo.css +0 -2
  85. package/build/minified/monorepo.css.map +0 -1
package/gulpfile.mjs ADDED
@@ -0,0 +1,99 @@
1
+ import gulp from "gulp";
2
+ import gulpSass from "gulp-sass";
3
+ import dartSass from "sass";
4
+ import rename from "gulp-rename";
5
+ import cleanCSS from "gulp-clean-css";
6
+ import { deleteAsync } from "del";
7
+ import cssnano from "gulp-cssnano";
8
+ import postcss from "gulp-postcss";
9
+ import sourcemaps from "gulp-sourcemaps";
10
+
11
+ const sass = gulpSass(dartSass);
12
+
13
+ const SRC = "scss";
14
+ const TEMP = "temp";
15
+ const BUILD = "css";
16
+ const COMPILABLE_COMPONENTS = `${TEMP}/compilable_components`;
17
+ const COMPILED_COMPONENTS = `${BUILD}/components`;
18
+
19
+ // Copy all files in the scss folder into a temp folder that's safe to work in
20
+ gulp.task("create temp dir", function () {
21
+ return gulp.src(`${SRC}/**/*`).pipe(gulp.dest(TEMP));
22
+ });
23
+
24
+ // Create stand-alone scss files for each of the components so they can be compiled individually
25
+ gulp.task("create temp components", function () {
26
+ return gulp
27
+ .src(`${TEMP}/components/_*.scss`)
28
+ .pipe(
29
+ rename(function (path) {
30
+ path.basename = path.basename.replace(/^_/, "");
31
+ })
32
+ )
33
+ .pipe(gulp.dest(COMPILABLE_COMPONENTS));
34
+ });
35
+
36
+ // Compile the component partials into stand-alone css files
37
+ gulp.task("compile components into css", function () {
38
+ return gulp
39
+ .src(`${COMPILABLE_COMPONENTS}/*.scss`)
40
+ .pipe(sass({ includePaths: ["node_modules"] }).on("error", sass.logError))
41
+ .pipe(cleanCSS())
42
+ .pipe(
43
+ rename(function (path) {
44
+ path.basename = path.basename.replace(/\.scss$/, "css");
45
+ })
46
+ )
47
+ .pipe(gulp.dest(COMPILED_COMPONENTS));
48
+ });
49
+
50
+ // Minify compiled css components
51
+ gulp.task("minify css components", function () {
52
+ return gulp
53
+ .src(`${COMPILED_COMPONENTS}/*.css`)
54
+ .pipe(postcss())
55
+ .pipe(cssnano({ zindex: false }))
56
+ .pipe(gulp.dest(COMPILED_COMPONENTS));
57
+ });
58
+
59
+ gulp.task("clean temp components", function () {
60
+ return deleteAsync([TEMP]);
61
+ });
62
+
63
+ // Bundle the main scss file into a single css file
64
+ gulp.task("bundle main css", function () {
65
+ return gulp
66
+ .src(`${SRC}/*.scss`)
67
+ .pipe(sourcemaps.init()) // Initialize source maps
68
+ .pipe(sass({ includePaths: ["node_modules"] }).on("error", sass.logError))
69
+ .pipe(cleanCSS())
70
+ .pipe(
71
+ rename(function (path) {
72
+ path.basename = path.basename.replace(/\.scss$/, "css");
73
+ })
74
+ )
75
+ .pipe(sourcemaps.write(".")) // Write source maps
76
+ .pipe(gulp.dest(BUILD));
77
+ });
78
+
79
+ // Minify compiled css files
80
+ gulp.task("minify main css bundle", function () {
81
+ return gulp
82
+ .src(`${SRC}/*.css`)
83
+ .pipe(postcss())
84
+ .pipe(cssnano({ zindex: false }))
85
+ .pipe(gulp.dest(BUILD));
86
+ });
87
+
88
+ gulp.task(
89
+ "default",
90
+ gulp.series(
91
+ "create temp dir",
92
+ "create temp components",
93
+ "compile components into css",
94
+ "minify css components",
95
+ "clean temp components",
96
+ "bundle main css",
97
+ "minify main css bundle"
98
+ )
99
+ );
package/package.json CHANGED
@@ -1,29 +1,44 @@
1
1
  {
2
2
  "name": "@ilo-org/styles",
3
3
  "description": "Styles for products using ILO's Design System",
4
- "version": "0.14.2",
4
+ "version": "0.16.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
8
8
  "directory": "packages/styles"
9
9
  },
10
+ "contributors": [
11
+ {
12
+ "name": "Justin Smith",
13
+ "email": "smithj@ilo.org",
14
+ "url": "https://github.com/justintemps"
15
+ },
16
+ {
17
+ "name": "Prabashwara Seneviratne",
18
+ "url": "https://www.bash.lk"
19
+ },
20
+ {
21
+ "name": "Shashika Boteju",
22
+ "email": "Shashikaboteju3@gmail.com",
23
+ "url": "https://github.com/Shashika6"
24
+ },
25
+ {
26
+ "name": "Giorgi Kapanadze",
27
+ "email": "doublegkapanadze@gmail.com",
28
+ "url": "https://github.com/ggkapanadze"
29
+ }
30
+ ],
10
31
  "publishConfig": {
11
32
  "access": "public"
12
33
  },
13
34
  "author": "@justintemps, @johnpauldavis, @avrilpearl, @ghlost",
14
35
  "license": "Apache-2.0",
15
- "files": [
16
- "build",
17
- "scss",
18
- "css"
19
- ],
20
36
  "dependencies": {
21
- "@ilo-org/fonts": "0.1.2",
22
- "@ilo-org/icons": "0.2.1",
23
- "@ilo-org/themes": "0.7.2"
37
+ "@ilo-org/fonts": "0.2.0",
38
+ "@ilo-org/icons": "0.3.0",
39
+ "@ilo-org/themes": "0.8.0"
24
40
  },
25
41
  "devDependencies": {
26
- "cssnano": "^5.1.13",
27
42
  "del": "^7.0.0",
28
43
  "gulp": "^4.0.2",
29
44
  "gulp-clean-css": "^4.3.0",
@@ -32,18 +47,12 @@
32
47
  "gulp-rename": "^2.0.0",
33
48
  "gulp-sass": "^5.1.0",
34
49
  "gulp-sourcemaps": "^3.0.0",
35
- "postcss": "^8.4.31",
36
- "postcss-cli": "^10.0.0",
37
50
  "sass": "^1.62.1"
38
51
  },
39
52
  "scripts": {
40
- "build:legacy": "sass scss:build/css --load-path=./node_modules && postcss build/css/index.css --base/css build/css --dir build/minified && postcss build/css/monorepo.css --base/css build/css --dir build/minified",
41
- "build:next": "gulp",
42
- "build": "pnpm build:legacy && pnpm build:next",
53
+ "build": "gulp",
43
54
  "build:lib": "pnpm build",
44
55
  "build:docs": "pnpm build",
45
- "gulp": "gulp",
46
- "minify": "postcss build/css/index.css --base/css build/css --dir build/minified && postcss build/css/monorepo.css --base/css build/css --dir build/minified",
47
56
  "format": "prettier --check . --ignore-path ../../.prettierignore",
48
57
  "format:fix": "prettier --write . --ignore-path ../../.prettierignore",
49
58
  "lint": "eslint --ext .js,.ts,.tsx",
@@ -0,0 +1 @@
1
+ module.exports = {};
package/scss/_mixins.scss CHANGED
@@ -412,3 +412,77 @@
412
412
  $spacing-hero-card-corner-cut-height-sm
413
413
  auto;
414
414
  }
415
+
416
+ // ======================================
417
+ // List with markers that don't get chopped
418
+ // off by containers with overflow: hidden;
419
+ // Applies list styles to the List component
420
+ // and also lists in RichText.
421
+ // ======================================
422
+
423
+ @mixin invincible-list {
424
+ // Ordered list shows numbers
425
+ ol {
426
+ counter-reset: item;
427
+
428
+ li {
429
+ counter-increment: item;
430
+ display: table;
431
+ }
432
+
433
+ li::before {
434
+ content: counter(item) ".";
435
+ display: table-cell;
436
+ text-align: right;
437
+ padding-inline-end: spacing(2);
438
+ }
439
+ }
440
+
441
+ // Unordered list shows triangles
442
+ ul {
443
+ li {
444
+ position: relative;
445
+ padding-inline-start: spacing(6);
446
+
447
+ &::before {
448
+ content: "";
449
+ position: absolute;
450
+ height: px-to-rem(14px);
451
+ width: px-to-rem(12px);
452
+ top: px-to-rem(6px);
453
+ @include dataurlicon("listarrow", $color-base-neutrals-light);
454
+ background-repeat: no-repeat;
455
+
456
+ // Left takes precedence in LTR layouts
457
+ // Right takes precents in RTL layouts
458
+ left: 0;
459
+ right: 0;
460
+
461
+ // We have to rotate the bullet in RTL
462
+ [dir="rtl"] & {
463
+ transform: rotate(180deg);
464
+ }
465
+
466
+ @include breakpoint("medium") {
467
+ top: px-to-rem(7px);
468
+ }
469
+ }
470
+ }
471
+ }
472
+
473
+ li {
474
+ @include font-styles("body-small");
475
+ font-family: $fonts-copy;
476
+ margin-bottom: spacing(4);
477
+
478
+ b,
479
+ strong {
480
+ font-weight: 700;
481
+ letter-spacing: $type-label-small-letter-spacing;
482
+ }
483
+
484
+ @include breakpoint("medium") {
485
+ @include font-styles("base");
486
+ }
487
+ }
488
+ }
@@ -0,0 +1,329 @@
1
+ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2
+
3
+ /* Sections
4
+ ========================================================================== */
5
+
6
+ /**
7
+ * Render the `main` element consistently in IE.
8
+ */
9
+ main {
10
+ display: block;
11
+ }
12
+
13
+ /**
14
+ * Correct the font size and margin on `h1` elements within `section` and
15
+ * `article` contexts in Chrome, Firefox, and Safari.
16
+ */
17
+
18
+ h1 {
19
+ font-size: 2em;
20
+ margin: 0.67em 0;
21
+ }
22
+
23
+ /* Grouping content
24
+ ========================================================================== */
25
+
26
+ /**
27
+ * 1. Add the correct box sizing in Firefox.
28
+ * 2. Show the overflow in Edge and IE.
29
+ */
30
+
31
+ hr {
32
+ box-sizing: content-box; /* 1 */
33
+ height: 0; /* 1 */
34
+ overflow: visible; /* 2 */
35
+ }
36
+
37
+ /**
38
+ * 1. Correct the inheritance and scaling of font size in all browsers.
39
+ * 2. Correct the odd `em` font sizing in all browsers.
40
+ */
41
+
42
+ pre {
43
+ font-family: monospace, monospace; /* 1 */
44
+ font-size: 1em; /* 2 */
45
+ }
46
+
47
+ /* Text-level semantics
48
+ ========================================================================== */
49
+
50
+ /**
51
+ * Remove the gray background on active links in IE 10.
52
+ */
53
+
54
+ a {
55
+ background-color: transparent;
56
+ }
57
+
58
+ /**
59
+ * 1. Remove the bottom border in Chrome 57-
60
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
61
+ */
62
+
63
+ abbr[title] {
64
+ border-bottom: none; /* 1 */
65
+ text-decoration: underline; /* 2 */
66
+ text-decoration: underline dotted; /* 2 */
67
+ }
68
+
69
+ /**
70
+ * Add the correct font weight in Chrome, Edge, and Safari.
71
+ */
72
+
73
+ b,
74
+ strong {
75
+ font-weight: bolder;
76
+ }
77
+
78
+ /**
79
+ * 1. Correct the inheritance and scaling of font size in all browsers.
80
+ * 2. Correct the odd `em` font sizing in all browsers.
81
+ */
82
+
83
+ code,
84
+ kbd,
85
+ samp {
86
+ font-family: monospace, monospace; /* 1 */
87
+ font-size: 1em; /* 2 */
88
+ }
89
+
90
+ /**
91
+ * Add the correct font size in all browsers.
92
+ */
93
+
94
+ small {
95
+ font-size: 80%;
96
+ }
97
+
98
+ /**
99
+ * Prevent `sub` and `sup` elements from affecting the line height in
100
+ * all browsers.
101
+ */
102
+
103
+ sub,
104
+ sup {
105
+ font-size: 75%;
106
+ line-height: 0;
107
+ position: relative;
108
+ vertical-align: baseline;
109
+ }
110
+
111
+ sub {
112
+ bottom: -0.25em;
113
+ }
114
+
115
+ sup {
116
+ top: -0.5em;
117
+ }
118
+
119
+ /* Embedded content
120
+ ========================================================================== */
121
+
122
+ /**
123
+ * Remove the border on images inside links in IE 10.
124
+ */
125
+
126
+ img {
127
+ border-style: none;
128
+ }
129
+
130
+ /* Forms
131
+ ========================================================================== */
132
+
133
+ /**
134
+ * 1. Change the font styles in all browsers.
135
+ * 2. Remove the margin in Firefox and Safari.
136
+ */
137
+
138
+ button,
139
+ input,
140
+ optgroup,
141
+ select,
142
+ textarea {
143
+ font-family: inherit; /* 1 */
144
+ font-size: 100%; /* 1 */
145
+ line-height: 1; /* 1 */
146
+ margin: 0; /* 2 */
147
+ }
148
+
149
+ /**
150
+ * Show the overflow in IE.
151
+ * 1. Show the overflow in Edge.
152
+ */
153
+
154
+ button,
155
+ input {
156
+ /* 1 */
157
+ overflow: visible;
158
+ }
159
+
160
+ /**
161
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
162
+ * 1. Remove the inheritance of text transform in Firefox.
163
+ */
164
+
165
+ button,
166
+ select {
167
+ /* 1 */
168
+ text-transform: none;
169
+ }
170
+
171
+ /**
172
+ * Correct the inability to style clickable types in iOS and Safari.
173
+ */
174
+
175
+ button,
176
+ [type="button"],
177
+ [type="reset"],
178
+ [type="submit"] {
179
+ -webkit-appearance: button;
180
+ }
181
+
182
+ /**
183
+ * Remove the inner border and padding in Firefox.
184
+ */
185
+
186
+ button::-moz-focus-inner,
187
+ [type="button"]::-moz-focus-inner,
188
+ [type="reset"]::-moz-focus-inner,
189
+ [type="submit"]::-moz-focus-inner {
190
+ border-style: none;
191
+ padding: 0;
192
+ }
193
+
194
+ /**
195
+ * Restore the focus styles unset by the previous rule.
196
+ */
197
+
198
+ button:-moz-focusring,
199
+ [type="button"]:-moz-focusring,
200
+ [type="reset"]:-moz-focusring,
201
+ [type="submit"]:-moz-focusring {
202
+ outline: 1px dotted ButtonText;
203
+ }
204
+
205
+ /**
206
+ * Correct the padding in Firefox.
207
+ */
208
+
209
+ fieldset {
210
+ padding: 0.35em 0.75em 0.625em;
211
+ }
212
+
213
+ /**
214
+ * 1. Correct the text wrapping in Edge and IE.
215
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
216
+ * 3. Remove the padding so developers are not caught out when they zero out
217
+ * `fieldset` elements in all browsers.
218
+ */
219
+
220
+ legend {
221
+ box-sizing: border-box; /* 1 */
222
+ color: inherit; /* 2 */
223
+ display: table; /* 1 */
224
+ max-width: 100%; /* 1 */
225
+ padding: 0; /* 3 */
226
+ white-space: normal; /* 1 */
227
+ }
228
+
229
+ /**
230
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
231
+ */
232
+
233
+ progress {
234
+ vertical-align: baseline;
235
+ }
236
+
237
+ /**
238
+ * Remove the default vertical scrollbar in IE 10+.
239
+ */
240
+
241
+ textarea {
242
+ overflow: auto;
243
+ }
244
+
245
+ /**
246
+ * 1. Add the correct box sizing in IE 10.
247
+ * 2. Remove the padding in IE 10.
248
+ */
249
+
250
+ [type="checkbox"],
251
+ [type="radio"] {
252
+ box-sizing: border-box; /* 1 */
253
+ padding: 0; /* 2 */
254
+ }
255
+
256
+ /**
257
+ * Correct the cursor style of increment and decrement buttons in Chrome.
258
+ */
259
+
260
+ [type="number"]::-webkit-inner-spin-button,
261
+ [type="number"]::-webkit-outer-spin-button {
262
+ height: auto;
263
+ }
264
+
265
+ /**
266
+ * 1. Correct the odd appearance in Chrome and Safari.
267
+ * 2. Correct the outline style in Safari.
268
+ */
269
+
270
+ [type="search"] {
271
+ -webkit-appearance: textfield; /* 1 */
272
+ outline-offset: -2px; /* 2 */
273
+ }
274
+
275
+ /**
276
+ * Remove the inner padding in Chrome and Safari on macOS.
277
+ */
278
+
279
+ [type="search"]::-webkit-search-decoration {
280
+ -webkit-appearance: none;
281
+ }
282
+
283
+ /**
284
+ * 1. Correct the inability to style clickable types in iOS and Safari.
285
+ * 2. Change font properties to `inherit` in Safari.
286
+ */
287
+
288
+ ::-webkit-file-upload-button {
289
+ -webkit-appearance: button; /* 1 */
290
+ font: inherit; /* 2 */
291
+ }
292
+
293
+ /* Interactive
294
+ ========================================================================== */
295
+
296
+ /*
297
+ * Add the correct display in Edge, IE 10+, and Firefox.
298
+ */
299
+
300
+ details {
301
+ display: block;
302
+ }
303
+
304
+ /*
305
+ * Add the correct display in all browsers.
306
+ */
307
+
308
+ summary {
309
+ display: list-item;
310
+ }
311
+
312
+ /* Misc
313
+ ========================================================================== */
314
+
315
+ /**
316
+ * Add the correct display in IE 10+.
317
+ */
318
+
319
+ template {
320
+ display: none;
321
+ }
322
+
323
+ /**
324
+ * Add the correct display in IE 10.
325
+ */
326
+
327
+ [hidden] {
328
+ display: none;
329
+ }