@ilo-org/styles 0.8.4 → 0.9.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.
Files changed (45) hide show
  1. package/build/css/components/index.css +481 -251
  2. package/build/css/components/index.css.map +1 -1
  3. package/build/css/global.css +1 -1
  4. package/build/css/global.css.map +1 -1
  5. package/build/css/index.css +481 -251
  6. package/build/css/index.css.map +1 -1
  7. package/build/css/monorepo.css +481 -251
  8. package/build/css/monorepo.css.map +1 -1
  9. package/build/minified/index.css +1 -1
  10. package/build/minified/index.css.map +1 -1
  11. package/build/minified/monorepo.css +1 -1
  12. package/build/minified/monorepo.css.map +1 -1
  13. package/css/components/checkbox.css +1 -1
  14. package/css/components/datepicker.css +1 -1
  15. package/css/components/dropdown.css +1 -1
  16. package/css/components/fieldset.css +1 -1
  17. package/css/components/file-upload.css +1 -1
  18. package/css/components/form.css +1 -1
  19. package/css/components/formcontrol.css +1 -0
  20. package/css/components/input.css +1 -1
  21. package/css/components/navigation.css +1 -1
  22. package/css/components/radio.css +1 -1
  23. package/css/components/textarea.css +1 -1
  24. package/css/components/textinput.css +1 -0
  25. package/css/components/toggle.css +1 -0
  26. package/css/global.css.map +1 -1
  27. package/css/index.css +1 -1
  28. package/css/index.css.map +1 -1
  29. package/css/monorepo.css +1 -1
  30. package/css/monorepo.css.map +1 -1
  31. package/package.json +2 -2
  32. package/scss/components/_checkbox.scss +5 -36
  33. package/scss/components/_datepicker.scss +3 -23
  34. package/scss/components/_fieldset.scss +74 -53
  35. package/scss/components/_file-upload.scss +25 -57
  36. package/scss/components/_form.scss +37 -16
  37. package/scss/components/_formcontrol.scss +182 -0
  38. package/scss/components/_navigation.scss +13 -2
  39. package/scss/components/_radio.scss +4 -52
  40. package/scss/components/_textarea.scss +2 -2
  41. package/scss/components/_textinput.scss +65 -0
  42. package/scss/components/_toggle.scss +135 -0
  43. package/scss/components/index.scss +3 -1
  44. package/css/components/formgroup.css +0 -1
  45. package/scss/components/_formgroup.scss +0 -9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ilo-org/styles",
3
3
  "description": "Styles for products using ILO's Design System",
4
- "version": "0.8.4",
4
+ "version": "0.9.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@ilo-org/fonts": "0.1.0",
22
22
  "@ilo-org/icons": "0.2.1",
23
- "@ilo-org/themes": "0.2.0"
23
+ "@ilo-org/themes": "0.3.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cssnano": "^5.1.13",
@@ -5,15 +5,16 @@
5
5
  .ilo--checkbox {
6
6
  -webkit-appearance: none;
7
7
  -moz-appearance: none;
8
+ appearance: none;
8
9
  border: none;
9
10
  display: grid;
10
11
  height: px-to-rem(24px);
11
12
  margin: 0;
12
- order: 1;
13
13
  position: relative;
14
14
  place-content: center;
15
15
  width: px-to-rem(24px);
16
16
  transform: none;
17
+ cursor: pointer;
17
18
 
18
19
  &:before {
19
20
  content: "";
@@ -74,10 +75,10 @@
74
75
  }
75
76
 
76
77
  &:invalid,
77
- &.error,
78
- .error & {
78
+ &__error,
79
+ &__error & {
79
80
  &:after {
80
- background-color: $color-base-red-medium;
81
+ border-color: $color-base-red-medium;
81
82
  }
82
83
 
83
84
  &:checked {
@@ -87,35 +88,3 @@
87
88
  }
88
89
  }
89
90
  }
90
-
91
- .ilo--fieldset--input--checkbox {
92
- align-items: center;
93
- clear: both;
94
- display: flex;
95
- flex-wrap: wrap;
96
- justify-content: flex-start;
97
- margin-bottom: px-to-rem(22px);
98
-
99
- .ilo--fieldset--label {
100
- color: $color-base-neutrals-black;
101
- font-family: $fonts-copy;
102
- font-size: 14.9px;
103
- font-weight: 400;
104
- line-height: 1;
105
- margin-left: px-to-rem($spacing-padding-1);
106
- margin-bottom: 0;
107
- margin-top: 1px;
108
- order: 2;
109
-
110
- .right-to-left & {
111
- margin-left: 0;
112
- margin-right: px-to-rem($spacing-padding-1);
113
- }
114
- }
115
-
116
- .ilo--fieldset--error,
117
- .ilo--fieldset--helper {
118
- order: 3;
119
- width: 100%;
120
- }
121
- }
@@ -3,29 +3,9 @@
3
3
  @import "../mixins";
4
4
 
5
5
  .ilo--datepicker {
6
- &--range {
7
- display: flex;
6
+ cursor: pointer;
8
7
 
9
- & > .ilo--fieldset {
10
- width: 50%;
11
-
12
- &:nth-of-type(1) {
13
- .ilo--input {
14
- border-right: none;
15
- }
16
- }
17
- }
18
- }
19
-
20
- .right-to-left & {
21
- direction: rtl;
8
+ &::-webkit-calendar-picker-indicator {
9
+ cursor: pointer;
22
10
  }
23
11
  }
24
-
25
- .right-to-left
26
- .ilo--datepicker--range
27
- > .ilo--fieldset:nth-of-type(1)
28
- .ilo--input {
29
- border-left: none;
30
- border-right: 0.1071811361rem solid rgb(184, 196, 204);
31
- }
@@ -3,36 +3,79 @@
3
3
  @import "../mixins";
4
4
 
5
5
  .ilo--fieldset {
6
- -webkit-appearance: none;
7
- -moz-appearance: none;
6
+ $gap: 24px;
7
+
8
+ @mixin flex($value) {
9
+ display: flex;
10
+ justify-content: flex-start;
11
+ align-items: flex-start;
12
+ flex-direction: $value;
13
+ @include textmargin("gap", $gap, "label-medium", "display", 0, 0);
14
+ }
15
+
8
16
  appearance: none;
9
- @include textmargin("margin-bottom", 34px, "label-medium", "display", 0, 0);
17
+ $c: &;
10
18
 
11
- &--label {
12
- display: inline-flex;
13
- float: left;
19
+ &--legend-wrapper {
20
+ @include textmargin("margin-bottom", $gap, "label-medium", "display", 0, 0);
21
+ }
22
+
23
+ &--legend {
14
24
  font-family: $fonts-display;
15
25
  font-weight: map-get($type, "weights", "label");
16
26
  @include font-styles("label-medium");
17
- @include textmargin("margin-bottom", 14px, "label-medium", "display", 0, 0);
18
27
  }
19
28
 
20
- &--helper {
21
- color: $color-base-neutrals-medium;
22
- font-family: $fonts-copy;
23
- @include font-styles("body-xxs");
24
- @include textmargin(
25
- "margin-top",
26
- map-get($spacing, "padding-1-5"),
27
- "body-xxs",
28
- "copy",
29
- 0,
30
- 0
31
- );
29
+ &--direction__column {
30
+ > #{$c}--elements {
31
+ @include flex(column);
32
+ }
32
33
  }
33
34
 
34
- &--error {
35
- color: $color-base-red-dark;
35
+ &--direction__row {
36
+ > #{$c}--elements {
37
+ @include flex(row);
38
+ }
39
+ }
40
+
41
+ &--direction__row-reverse {
42
+ > #{$c}--elements {
43
+ @include flex(row-reverse);
44
+ }
45
+ }
46
+
47
+ &--direction__column-reverse {
48
+ > #{$c}--elements {
49
+ @include flex(column-reverse);
50
+ }
51
+ }
52
+
53
+ &--wrap__nowrap {
54
+ > #{$c}--elements {
55
+ flex-wrap: nowrap;
56
+ }
57
+ }
58
+
59
+ &--wrap__wrap {
60
+ > #{$c}--elements {
61
+ flex-wrap: wrap;
62
+ }
63
+ }
64
+
65
+ &--wrap__wrap-reverse {
66
+ > #{$c}--elements {
67
+ flex-wrap: wrap-reverse;
68
+ }
69
+ }
70
+
71
+ &--wrap__reverse {
72
+ > #{$c}--elements {
73
+ flex-wrap: reverse;
74
+ }
75
+ }
76
+
77
+ &--helper,
78
+ &__error {
36
79
  font-family: $fonts-copy;
37
80
  @include font-styles("body-xxs");
38
81
  @include textmargin(
@@ -45,43 +88,21 @@
45
88
  );
46
89
  }
47
90
 
48
- &.ilo--choice-group {
49
- .ilo--fieldset--legend {
50
- display: inline-flex;
51
- float: left;
52
- font-family: $fonts-display;
53
- font-weight: map-get($type, "weights", "label");
54
- @include font-styles("label-medium");
55
- margin: 0;
56
-
57
- & + .ilo--fieldset--helper,
58
- & + .ilo--fieldset--error {
59
- clear: both;
60
- display: block;
61
- }
62
- }
91
+ &--helper {
92
+ color: $color-base-neutrals-medium;
93
+ }
63
94
 
64
- div[class^="ilo--fieldset--input"]:first-of-type,
65
- div[class*=" ilo--fieldset--input"]:first-of-type {
66
- clear: both;
67
- padding-top: px-to-rem($spacing-padding-3);
68
- }
95
+ &__error {
96
+ color: $color-base-red-dark;
97
+ }
98
+
99
+ &__disabled {
100
+ opacity: 50%;
101
+ pointer-events: none;
69
102
  }
70
103
 
71
104
  .ilo--tooltip--wrapper {
72
105
  margin-left: 8px;
73
106
  margin-top: 3px;
74
107
  }
75
-
76
- .right-to-left & {
77
- direction: rtl;
78
-
79
- .ilo--fieldset--label {
80
- float: right;
81
- }
82
-
83
- &.ilo--choice-group .ilo--fieldset--legend {
84
- float: right;
85
- }
86
- }
87
108
  }
@@ -3,14 +3,15 @@
3
3
  @import "../mixins";
4
4
 
5
5
  .ilo--file-upload {
6
- color: transparent;
7
- order: 3;
6
+ &--input {
7
+ order: 3;
8
8
 
9
- &::-webkit-file-upload-button {
10
- visibility: hidden;
11
- }
9
+ input {
10
+ visibility: hidden;
11
+ color: transparent;
12
+ width: 0;
13
+ }
12
14
 
13
- &:before {
14
15
  background-color: map-get($color, "ux", "background", "default");
15
16
  border: map-get($borders, "small")
16
17
  map-get($color, "ux", "borders", "default") solid;
@@ -23,10 +24,12 @@
23
24
  @include borderradius("button");
24
25
  @include boxpadding("button", "medium");
25
26
  @include font-styles("label-medium");
26
- }
27
27
 
28
- &:hover {
29
- &:before {
28
+ .ilo--form__theme__dark & {
29
+ color: map-get($color, "ux", "labels", "actionable");
30
+ }
31
+
32
+ &:hover {
30
33
  background-color: map-get($color, "ux", "background", "hover");
31
34
  border: map-get($borders, "small")
32
35
  map-get($color, "ux", "borders", "hover") solid;
@@ -34,40 +37,34 @@
34
37
  color: map-get($color, "ux", "labels", "hover");
35
38
  outline: none;
36
39
  }
37
- }
38
40
 
39
- &:focus {
40
- &:before {
41
+ &:focus {
41
42
  background-color: map-get($color, "ux", "background", "focus");
42
43
  border: map-get($borders, "small")
43
44
  map-get($color, "ux", "borders", "hover") solid;
44
45
  color: map-get($color, "ux", "labels", "focus");
45
46
  outline: none;
46
47
  }
47
- }
48
48
 
49
- &:focus-visible {
50
- outline: none;
51
- }
49
+ &:focus-visible {
50
+ outline: none;
51
+ }
52
52
 
53
- &:active {
54
- &:before {
53
+ &:active {
55
54
  background-color: map-get($color, "ux", "background", "active");
56
55
  border: map-get($borders, "base")
57
56
  map-get($color, "ux", "borders", "active") solid;
58
57
  color: map-get($color, "ux", "labels", "active");
59
58
  }
60
- }
61
59
 
62
- &:disabled {
63
- opacity: 45%;
64
- pointer-events: none;
65
- }
60
+ &:disabled {
61
+ opacity: 45%;
62
+ pointer-events: none;
63
+ }
66
64
 
67
- &:invalid,
68
- &.error,
69
- .error & {
70
- &:before {
65
+ &:invalid,
66
+ &.error,
67
+ .error & {
71
68
  background-color: map-get(
72
69
  $color,
73
70
  "formelements",
@@ -84,6 +81,7 @@
84
81
  }
85
82
 
86
83
  &--list-item {
84
+ display: inline-block;
87
85
  background-color: $color-formelements-uploadedfile-default-background;
88
86
  @include bordervalues("uploadedfile", "formelements", "default");
89
87
  box-sizing: border-box;
@@ -96,35 +94,5 @@
96
94
  @include spacingvalues("margin", "uploadedfile", "formelements");
97
95
  outline: none;
98
96
  @include spacingvalues("padding", "uploadedfile", "formelements");
99
- width: map-get(
100
- $spacing,
101
- "formelements",
102
- "uploadedfile",
103
- "default",
104
- "width"
105
- );
106
- }
107
- }
108
-
109
- .file-upload div {
110
- display: flex;
111
- flex-direction: column;
112
-
113
- .ilo--fieldset--label {
114
- order: 1;
115
- }
116
-
117
- .ilo--fieldset--helper,
118
- .ilo--fieldset--error {
119
- margin-top: 0;
120
- @include textmargin(
121
- "margin-bottom",
122
- map-get($spacing, "padding-3"),
123
- "label-small",
124
- "display",
125
- 0,
126
- 0
127
- );
128
- order: 2;
129
97
  }
130
98
  }
@@ -2,23 +2,44 @@
2
2
  @use "../functions" as *;
3
3
  @import "../mixins";
4
4
 
5
- .ilo--formgroup {
6
- &--legend {
7
- display: block;
8
- font-family: $fonts-display;
9
- font-weight: map-get($type, "weights", "label");
10
- @include font-styles("legend");
11
- @include textmargin(
12
- "margin-bottom",
13
- map-get($spacing, "padding-5"),
14
- "legend",
15
- "display",
16
- "label-small",
17
- "display"
18
- );
5
+ .ilo--form {
6
+ $gap: 32px;
7
+ $c: &;
8
+
9
+ display: flex;
10
+ justify-content: flex-start;
11
+ align-items: flex-start;
12
+ flex-direction: column;
13
+ appearance: none;
14
+ gap: $gap;
15
+ color: $color-base-neutrals-black;
16
+
17
+ &__theme {
18
+ &__light {
19
+ color: $color-base-neutrals-black;
20
+
21
+ label,
22
+ p {
23
+ color: $color-base-neutrals-black;
24
+ }
25
+ }
26
+
27
+ &__dark {
28
+ color: $color-base-neutrals-lighter;
29
+
30
+ label,
31
+ p {
32
+ color: $color-base-neutrals-lighter;
33
+ }
34
+
35
+ legend {
36
+ color: $color-base-yellow;
37
+ }
38
+ }
19
39
  }
20
40
 
21
- .right-to-left & {
22
- direction: rtl;
41
+ &__disabled {
42
+ opacity: 50%;
43
+ pointer-events: none;
23
44
  }
24
45
  }
@@ -0,0 +1,182 @@
1
+ @use "../tokens" as *;
2
+ @use "../functions" as *;
3
+ @use "sass:math";
4
+ @import "../mixins";
5
+
6
+ .ilo--form-control {
7
+ $c: &;
8
+
9
+ grid-area: input;
10
+ display: inline-grid;
11
+ grid-template-rows: auto;
12
+ grid-template-columns: auto;
13
+ gap: px-to-rem($spacing-padding-1);
14
+
15
+ &__label-placement {
16
+ // Label is to the flex start of form element
17
+ &__start {
18
+ // Label
19
+ :first-child {
20
+ grid-area: 1 / 1 / 2 / 2;
21
+ }
22
+
23
+ // Field
24
+ :nth-child(2) {
25
+ grid-area: 1 / 2 / 2 / 3;
26
+ }
27
+
28
+ // Helper
29
+ :nth-child(3) {
30
+ grid-area: 2 / 2 / 3 / 3;
31
+ }
32
+
33
+ // Upload
34
+ :nth-child(4) {
35
+ grid-area: 3 / 1 / 4 / 3;
36
+ }
37
+ }
38
+
39
+ // Label is at the end of the form element
40
+ &__end {
41
+ // Label
42
+ :first-child {
43
+ grid-area: 1 / 2 / 2 / 3;
44
+ }
45
+
46
+ // Field
47
+ :nth-child(2) {
48
+ grid-area: 1 / 1 / 2 / 2;
49
+ }
50
+
51
+ // Helper
52
+ :nth-child(3) {
53
+ grid-area: 2 / 1 / 3 / 3;
54
+ }
55
+
56
+ // Upload
57
+ :nth-child(4) {
58
+ grid-area: 3 / 1 / 4 / 3;
59
+ }
60
+ }
61
+
62
+ // Label is above form element
63
+ &__top {
64
+ // Label
65
+ :first-child {
66
+ grid-area: 1 / 1 / 2 / 2;
67
+ }
68
+
69
+ // Field
70
+ :nth-child(2) {
71
+ grid-area: 2 / 1 / 3 / 2;
72
+ }
73
+
74
+ // Helper
75
+ :nth-child(3) {
76
+ grid-area: 3 / 1 / 4 / 2;
77
+ }
78
+
79
+ // Upload
80
+ :nth-child(4) {
81
+ grid-area: 4 / 1 / 5 / 2;
82
+ }
83
+ }
84
+
85
+ // Label is below form element
86
+ &__bottom {
87
+ // Label
88
+ :first-child {
89
+ grid-area: 3 / 1 / 4 / 2;
90
+ }
91
+
92
+ // Field
93
+ :nth-child(2) {
94
+ grid-area: 2 / 1 / 3 / 2;
95
+ }
96
+
97
+ // Helper
98
+ :nth-child(3) {
99
+ grid-area: 1 / 1 / 2 / 2;
100
+ }
101
+
102
+ // Upload
103
+ :nth-child(4) {
104
+ grid-area: 4 / 1 / 5 / 2;
105
+ }
106
+ }
107
+ }
108
+
109
+ &__disabled {
110
+ #{$c}--label,
111
+ #{$c}--helper {
112
+ opacity: 0.5;
113
+ pointer-events: none;
114
+ }
115
+ }
116
+
117
+ &__error {
118
+ #{$c}--helper {
119
+ color: $color-base-red-dark;
120
+ }
121
+ }
122
+
123
+ &--label {
124
+ color: $color-base-neutrals-black;
125
+ grid-area: label;
126
+ display: flex;
127
+ flex-flow: row nowrap;
128
+ align-items: center;
129
+ justify-content: flex-start;
130
+
131
+ &__size {
132
+ &__small {
133
+ font-family: $fonts-copy;
134
+ font-size: px-to-rem(map-get($type, "label-small", "size"));
135
+ letter-spacing: px-to-rem(
136
+ map-get($type, "label-small", "letter-spacing")
137
+ );
138
+ line-height: px-to-rem(map-get($type, "label-small", "line-height"));
139
+ font-weight: 400;
140
+ }
141
+
142
+ &__medium {
143
+ font-family: $fonts-display;
144
+ font-size: px-to-rem(map-get($type, "label-medium", "size"));
145
+ letter-spacing: px-to-rem(
146
+ map-get($type, "label-medium", "letter-spacing")
147
+ );
148
+ line-height: px-to-rem(map-get($type, "label-medium", "line-height"));
149
+ font-weight: 700;
150
+ }
151
+
152
+ &__large {
153
+ font-family: $fonts-display;
154
+ font-size: px-to-rem(map-get($type, "label-large", "size"));
155
+ letter-spacing: px-to-rem(
156
+ map-get($type, "label-large", "letter-spacing")
157
+ );
158
+ line-height: px-to-rem(map-get($type, "label-large", "line-height"));
159
+ font-weight: 700;
160
+ }
161
+ }
162
+
163
+ label {
164
+ font-family: inherit;
165
+ font-size: inherit;
166
+ letter-spacing: inherit;
167
+ line-height: inherit;
168
+ font-weight: inherit;
169
+ }
170
+
171
+ div[class*="tooltip"] {
172
+ margin-left: px-to-rem(math.div($spacing-padding-1, 2));
173
+ }
174
+ }
175
+
176
+ &--helper {
177
+ grid-area: helper;
178
+ color: $color-base-neutrals-medium;
179
+ font-family: $fonts-copy;
180
+ @include font-styles("body-xxs");
181
+ }
182
+ }
@@ -367,6 +367,7 @@
367
367
  background-position: calc(100% - 16px) 55%;
368
368
  background-repeat: no-repeat;
369
369
  background-size: 24px;
370
+ background-position-y: center;
370
371
  border: none;
371
372
  color: $brand-ilo-dark-blue;
372
373
  cursor: pointer;
@@ -374,6 +375,7 @@
374
375
  font-family: $fonts-display;
375
376
  font-weight: 500;
376
377
  padding: 16px 36px 16px 8px;
378
+ line-height: 24px;
377
379
  text-align: left;
378
380
  transition: all 150ms ease-out;
379
381
  width: 100%;
@@ -554,6 +556,7 @@
554
556
  background-position: calc(100% - 16px) 55%;
555
557
  background-repeat: no-repeat;
556
558
  background-size: 16px;
559
+ background-position-y: center;
557
560
  border: none;
558
561
  color: $brand-ilo-dark-blue;
559
562
  cursor: pointer;
@@ -561,6 +564,7 @@
561
564
  font-family: $fonts-display;
562
565
  font-weight: 500;
563
566
  padding: 16px 36px 16px 8px;
567
+ line-height: 16px;
564
568
  text-align: left;
565
569
  transition: all 150ms ease-out;
566
570
  width: 100%;
@@ -579,7 +583,12 @@
579
583
  }
580
584
 
581
585
  &--search {
582
- .ilo--searchfield {
586
+ padding: px-to-rem(32px) 0 px-to-rem(24px);
587
+
588
+ .ilo--searchfield,
589
+ .ilo--form,
590
+ .ilo--fieldset,
591
+ .ilo--form-control {
583
592
  width: 100%;
584
593
  }
585
594
 
@@ -892,12 +901,14 @@
892
901
  padding: 80px 20px;
893
902
  }
894
903
 
904
+ .ilo--form,
895
905
  .ilo--searchfield {
896
906
  max-width: 618px;
897
907
  width: 100%;
898
908
  }
899
909
 
900
- .ilo--fieldset {
910
+ .ilo--fieldset,
911
+ .ilo--form-control {
901
912
  width: 100%;
902
913
  }
903
914
  }