testio-tailwind 0.8.0 → 0.8.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testio-tailwind",
3
- "version": "0.8.0",
3
+ "version": "0.8.6",
4
4
  "description": "Tailwind based design system for Test IO",
5
5
  "scripts": {
6
6
  "clean": "del dist",
@@ -1,10 +1,11 @@
1
-
2
1
  .btn,
3
- input.btn,
2
+ input.btn,
4
3
  input[type="submit"].btn {
5
4
  @apply inline-flex justify-start items-center h-btn px-md text-buttons whitespace-nowrap text-primary border-0 rounded cursor-pointer select-none;
6
5
 
7
- &:hover, &:focus, &:active {
6
+ &:hover,
7
+ &:focus,
8
+ &:active {
8
9
  @apply text-white bg-link-hover border-link-hover;
9
10
  .icon {
10
11
  @apply text-white;
@@ -12,8 +13,8 @@ input[type="submit"].btn {
12
13
  }
13
14
  }
14
15
 
15
- .btn-primary,
16
- input.btn-primary,
16
+ .btn-primary,
17
+ input.btn-primary,
17
18
  input[type="submit"].btn-primary {
18
19
  @apply text-white bg-primary;
19
20
  }
@@ -67,13 +68,13 @@ input[type="submit"].btn-ghost-inverted {
67
68
  }
68
69
 
69
70
  .btn-danger,
70
- input[type="submit"].btn-danger,
71
+ input[type="submit"].btn-danger,
71
72
  .btn-warning,
72
73
  input[type="submit"].btn-warning {
73
74
  @apply text-white bg-danger;
74
75
  }
75
76
 
76
- .btn-success,
77
+ .btn-success,
77
78
  input[type="submit"].btn-success {
78
79
  @apply text-white bg-success;
79
80
  }
@@ -107,7 +108,7 @@ input[type="submit"].btn-white-secondary {
107
108
  @apply h-btn-lg w-btn-lg p-0;
108
109
 
109
110
  .icon {
110
- @apply m-0;
111
+ @apply m-0;
111
112
  }
112
113
  }
113
114
 
@@ -120,7 +121,6 @@ input[type="submit"].btn-white-secondary {
120
121
  line-height: 1.2;
121
122
  }
122
123
 
123
-
124
124
  .btn-dashed,
125
125
  input[type="submit"].btn-dashed {
126
126
  @apply border-primary border-dashed border-1 bg-transparent;
@@ -143,38 +143,38 @@ input[type="submit"].btn-dashed {
143
143
 
144
144
  .btn-intercom {
145
145
  @apply flex items-center justify-center w-btn h-btn rounded-full bg-info hover:bg-link-hover focus:bg-link-hover;
146
- box-shadow: 4px 4px 8px rgba(0, 0, 0, .2);
146
+ box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
147
147
 
148
148
  .icon-intercom::before {
149
149
  @apply text-white;
150
150
  }
151
151
  }
152
152
 
153
-
154
- .btn:disabled,
155
- .btn[disabled],
156
- button:disabled,
157
- button[disabled],
158
- .btn.disabled,
159
- .btn-sm:disabled,
160
- .btn-sm[disabled],
161
- .btn-sm.disabled,
162
- .btn-lg-wrapper:disabled .btn-lg,
163
- .btn-lg-wrapper[disabled] .btn-lg,
164
- .btn-lg-wrapper.disabled .btn-lg,
165
- .btn-lg:disabled,
166
- .btn-lg[disabled],
167
- .btn-lg.disabled,
168
- .btn-xl:disabled,
169
- .btn-xl[disabled],
170
- .btn-xl.disabled,
171
- input[type="submit"].btn[disabled],
172
- input.btn[disabled],
173
- input.btn-sm[disabled],
153
+ .btn:disabled,
154
+ .btn[disabled],
155
+ button:disabled,
156
+ button[disabled],
157
+ .btn.disabled,
158
+ .btn-sm:disabled,
159
+ .btn-sm[disabled],
160
+ .btn-sm.disabled,
161
+ .btn-lg-wrapper:disabled .btn-lg,
162
+ .btn-lg-wrapper[disabled] .btn-lg,
163
+ .btn-lg-wrapper.disabled .btn-lg,
164
+ .btn-lg:disabled,
165
+ .btn-lg[disabled],
166
+ .btn-lg.disabled,
167
+ .btn-xl:disabled,
168
+ .btn-xl[disabled],
169
+ .btn-xl.disabled,
170
+ input[type="submit"].btn[disabled],
171
+ input.btn[disabled],
172
+ input.btn-sm[disabled],
174
173
  input.btn-lg[disabled] {
175
174
  @apply text-disabled border border-disabled bg-pattern-disabled-bright hover:bg-pattern-disabled-bright bg-transparent hover:bg-transparent hover:text-disabled shadow-none cursor-not-allowed;
176
175
 
177
- &:hover .icon, &:focus .icon {
176
+ &:hover .icon,
177
+ &:focus .icon {
178
178
  @apply text-disabled;
179
179
  }
180
180
 
@@ -187,7 +187,10 @@ input.btn-lg[disabled] {
187
187
  }
188
188
  }
189
189
 
190
+ button {
191
+ @apply font-semibold;
192
+ }
190
193
 
191
194
  .btn-gray {
192
195
  @apply bg-gray-lighter text-black;
193
- }
196
+ }
@@ -1,13 +1,23 @@
1
-
2
1
  .form-group {
3
2
  @apply relative grid grid-cols-1 md:grid-cols-1-3 md:gap-grid-gutter;
4
3
  }
5
4
 
6
5
  .form-label {
7
6
  @apply text-label text-label leading-tight;
7
+
8
+ &.optional::after {
9
+ content: "(optional)";
10
+ @apply ml-1 inline-block;
11
+ }
12
+
13
+ &.optional-non-en::after {
14
+ content: attr(data-optional-non-en);
15
+ @apply ml-1 inline-block;
16
+ }
8
17
  }
9
18
 
10
- .form-group .form-label {
19
+ .form-group .form-label,
20
+ .form-group .field_with_errors {
11
21
  @apply pb-xxs md:pt-sm;
12
22
  }
13
23
 
@@ -15,15 +25,15 @@
15
25
  @apply text-label-inverted-color;
16
26
  }
17
27
 
18
- .form-control,
28
+ .form-control,
19
29
  .form-control-static {
20
30
  @apply h-btn w-full text-base border border-bordercolor;
21
31
  }
22
32
 
23
- .form-check .field_with_errors input[type=checkbox],
24
- .form-check .field_with_errors input[type=checkbox]:checked,
25
- .form-radio .field_with_errors input[type=radio],
26
- .form-radio .field_with_errors input[type=radio]:checked,
33
+ .form-check .field_with_errors input[type="checkbox"],
34
+ .form-check .field_with_errors input[type="checkbox"]:checked,
35
+ .form-radio .field_with_errors input[type="radio"],
36
+ .form-radio .field_with_errors input[type="radio"]:checked,
27
37
  .field_with_errors.dropzone,
28
38
  .field_with_errors .form-control {
29
39
  @apply border-danger;
@@ -37,8 +47,8 @@
37
47
  }
38
48
 
39
49
  .form-hint {
40
- @apply flex items-start text-sm mt-xs;
41
-
50
+ @apply flex items-center text-sm mt-xs mb-xs;
51
+
42
52
  &::before {
43
53
  @apply inline-block h-icon w-icon mr-xs bg-gray;
44
54
  content: "";
@@ -73,14 +83,12 @@ textarea.form-control {
73
83
  line-height: 1.2;
74
84
  }
75
85
 
76
-
77
86
  .form-control::placeholder {
78
87
  @apply text-disabled italic;
79
88
  }
80
89
 
81
-
82
- .form-control:disabled,
83
- .form-control.disabled,
90
+ .form-control:disabled,
91
+ .form-control.disabled,
84
92
  .form-control[readonly] {
85
93
  @apply bg-disabled;
86
94
  }
@@ -103,4 +111,3 @@ textarea.form-control {
103
111
  .form-date .form-control {
104
112
  @apply pr-lg;
105
113
  }
106
-
@@ -1,4 +1,3 @@
1
-
2
1
  .modal-wrapper {
3
2
  position: relative;
4
3
  }
@@ -8,13 +7,14 @@
8
7
  }
9
8
 
10
9
  .modal-wrapper[open] .modal-trigger::before {
11
- @apply fixed w-screen h-screen top-0 left-0 z-10;
10
+ @apply fixed w-screen h-screen top-0 left-0 z-50;
12
11
  content: "";
13
- background-color: rgba(0,0,0,.75);
12
+ background-color: rgba(0, 0, 0, 0.75);
14
13
  }
15
14
 
16
15
  .modal-wrapper[open] .modal-container {
17
- @apply fixed flex justify-center items-start top-0 left-0 w-screen h-screen p-lg z-20 overflow-y-scroll pointer-events-none;
16
+ @apply fixed flex justify-center items-start top-0 left-0 w-screen h-screen p-lg overflow-y-scroll pointer-events-none;
17
+ z-index: 51;
18
18
  }
19
19
 
20
20
  .modal-wrapper[open] .modal {
@@ -25,16 +25,15 @@
25
25
  height: auto;
26
26
  max-width: 100vw;
27
27
  pointer-events: all;
28
- z-index: 11;
28
+ z-index: 52;
29
29
 
30
30
  &.modal-sm {
31
31
  @apply w-modal-sm;
32
32
  }
33
-
33
+
34
34
  &.modal-lg {
35
35
  @apply w-modal-lg;
36
36
  }
37
-
38
37
  }
39
38
 
40
39
  .modal-wrapper[open] .modal-header {
@@ -82,15 +81,15 @@
82
81
  opacity: 0.25;
83
82
  }
84
83
 
85
- .btn.disabled, :disabled.btn {
84
+ .btn.disabled,
85
+ :disabled.btn {
86
86
  @apply bg-transparent text-disabled;
87
87
  background-image: url("/assets/images/btn-disabled-petrol.png");
88
88
  background-repeat: repeat;
89
89
  }
90
90
 
91
-
92
91
  /* prevent autoclosing when clicking on fade bg */
93
92
 
94
93
  .modal-wrapper[open].fade-close-disabled .modal-trigger::before {
95
94
  @apply pointer-events-none;
96
- }
95
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  .form-select {
3
2
  @apply w-full;
4
3
  }
@@ -45,7 +44,14 @@ select {
45
44
 
46
45
  .form-select-native option {
47
46
  @apply appearance-none py-xxs;
48
- &:hover, &:focus {
47
+ &:hover,
48
+ &:focus {
49
49
  @apply bg-link-hover;
50
50
  }
51
- }
51
+ }
52
+
53
+ /*///// Validation errors /////*/
54
+
55
+ .form-select-native .field_with_errors select {
56
+ @apply bg-danger border-danger;
57
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  select.select2 {
3
2
  display: none !important;
4
3
  }
@@ -29,7 +28,6 @@ select.select2 {
29
28
  }
30
29
 
31
30
  .select2-container {
32
-
33
31
  .select2-selection,
34
32
  .select2-dropdown,
35
33
  .select2-search__field {
@@ -67,7 +65,6 @@ select.select2 {
67
65
  /*/ Dropdown open */
68
66
 
69
67
  &.select2-container--open {
70
-
71
68
  .select2-selection {
72
69
  @apply border-link-hover;
73
70
  }
@@ -92,7 +89,6 @@ select.select2 {
92
89
  }
93
90
 
94
91
  .select2-container {
95
-
96
92
  .select2-selection,
97
93
  .select2-search__field {
98
94
  @apply bg-primary border-primary text-white;
@@ -119,7 +115,6 @@ select.select2 {
119
115
  }
120
116
 
121
117
  &.select2-container--open {
122
-
123
118
  &.select2-container--below .select2-selection {
124
119
  @apply border-primary;
125
120
  }
@@ -142,10 +137,8 @@ select.select2 {
142
137
  @apply py-xs px-sm;
143
138
  }
144
139
 
145
-
146
140
  /*///// Multi select /////*/
147
141
 
148
-
149
142
  .select2-selection.select2-selection--multiple {
150
143
  @apply min-h-btn p-xs;
151
144
  }
@@ -167,7 +160,6 @@ select.select2 {
167
160
  width: 100% !important;
168
161
  }
169
162
 
170
-
171
163
  /*/ multi select items */
172
164
 
173
165
  .select2-container--testio li.select2-selection__choice {
@@ -200,7 +192,6 @@ select.select2 {
200
192
  }
201
193
  }
202
194
 
203
-
204
195
  /*///// Optgroups /////*/
205
196
 
206
197
  .select2-results__group {
@@ -215,14 +206,13 @@ select.select2 {
215
206
  overflow: visible;
216
207
  }
217
208
 
218
-
219
209
  /*///// Disabled /////*/
220
210
 
221
211
  .select2-container--disabled .select2-selection {
222
212
  @apply border border-bordercolor text-disabled cursor-not-allowed bg-transparent;
223
213
  background-image: url("/assets/images/pattern-striped-bright.png");
224
214
  background-repeat: repeat;
225
- &:hover{
215
+ &:hover {
226
216
  @apply text-disabled;
227
217
  }
228
218
  &::before {
@@ -250,3 +240,12 @@ select.select2 {
250
240
  .multi-select-inputs .select2-container {
251
241
  @apply m-xs mr-0;
252
242
  }
243
+
244
+ /*///// Validation errors /////*/
245
+
246
+ .form-select .field_with_errors .select2-container {
247
+ .select2-selection,
248
+ .select2-search__field {
249
+ @apply bg-danger border-danger;
250
+ }
251
+ }
@@ -1,18 +1,18 @@
1
-
2
1
  .form-group.trix-editor {
3
2
  @apply gap-grid-gutter grid-rows-auto;
4
3
  grid-template-rows: auto;
5
4
  @screen md {
6
- grid-template-areas: "label trix-toolbar"
7
- "label trix-editor";
8
- }
5
+ grid-template-areas:
6
+ "label trix-toolbar"
7
+ "label trix-editor";
8
+ }
9
9
  }
10
10
 
11
11
  .trix-editor .trix-content {
12
12
  @apply -mt-grid-gutter;
13
13
  @screen md {
14
14
  grid-area: trix-editor;
15
- }
15
+ }
16
16
  }
17
17
 
18
18
  .trix-editor .form-control {
@@ -23,7 +23,7 @@ trix-toolbar {
23
23
  @apply border border-bordercolor rounded-t;
24
24
  @screen md {
25
25
  grid-area: trix-toolbar;
26
- }
26
+ }
27
27
  }
28
28
 
29
29
  trix-toolbar .trix-button-group {
@@ -36,8 +36,8 @@ trix-toolbar .trix-button-row {
36
36
 
37
37
  .trix-button-row::-webkit-scrollbar {
38
38
  display: none;
39
- -ms-overflow-style: none; /* IE and Edge */
40
- scrollbar-width: none; /* Firefox */
39
+ -ms-overflow-style: none; /* IE and Edge */
40
+ scrollbar-width: none; /* Firefox */
41
41
  }
42
42
 
43
43
  .trix-button-group.trix-button-group--history-tools {
@@ -47,7 +47,8 @@ trix-toolbar .trix-button-row {
47
47
  trix-toolbar .trix-button {
48
48
  @apply inline-flex justify-center items-center flex-shrink-0 w-btn-sm h-btn-sm min-w-btn-sm border-0 rounded bg-transparent;
49
49
  font-size: 0; /* Fix for safari bug, we don't need to show any text in those buttons */
50
- &:hover, &:focus {
50
+ &:hover,
51
+ &:focus {
51
52
  @apply text-white bg-link-hover;
52
53
  }
53
54
  &::before {
@@ -124,7 +125,6 @@ trix-toolbar .trix-button--icon-attach::before {
124
125
  mask-image: url("/assets/images/redo.svg");
125
126
  }
126
127
 
127
-
128
128
  /*//// Add link/URL popover ////*/
129
129
 
130
130
  trix-toolbar .trix-dialog {
@@ -147,7 +147,6 @@ trix-toolbar .trix-input--dialog {
147
147
  @apply w-full h-btn-sm px-xs border border-bordercolor rounded;
148
148
  }
149
149
 
150
-
151
150
  /*//// Attachments ////*/
152
151
 
153
152
  trix-editor .attachment-gallery .attachment,
@@ -172,3 +171,16 @@ trix-editor .attachment__progress {
172
171
  @apply h-progress-bar-thin-height bg-info;
173
172
  }
174
173
  }
174
+
175
+ /*///// Validation errors /////*/
176
+
177
+ .field_with_errors {
178
+ trix-toolbar {
179
+ @apply mb-5;
180
+ }
181
+
182
+ .trix-content,
183
+ select {
184
+ @apply border-red-500 border-1;
185
+ }
186
+ }
@@ -7,6 +7,14 @@ title: Forms
7
7
  .form-group
8
8
  %label.form-label Input
9
9
  %input.form-control{type:'text', placeholder:"Some delicious placeholder text"}
10
+ .form-group
11
+ %label.form-label.optional Not required input
12
+ %input.form-control{type:'text', placeholder:"Some delicious placeholder text"}
13
+ .form-group
14
+ %label.form-label.optional-non-en{"data-optional-non-en": "(freiwillig)"} Not required input
15
+ %div
16
+ %input.form-control{type:'text', placeholder:"Some delicious placeholder text"}
17
+ .form-hint For most cases you can use the english optional label, but we also added support for any translation you might need. Just add the data-optional-non-en => t(optional)
10
18
  .form-group
11
19
  %label.form-label Input disabled
12
20
  %input.form-control{type:'text', value:"Some delicious readonly value text", disabled:"true"}
@@ -20,4 +28,4 @@ title: Forms
20
28
  %label.form-label Input with errors
21
29
  .field_with_errors
22
30
  %input.form-control{type:'text', value:""}
23
- .form-hint.error You made a mistake, which is why you see this form validation error message with some helpful Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
31
+ .form-hint.error You made a mistake, which is why you see this form validation error message with some helpful Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
@@ -33,7 +33,7 @@ title: Select native
33
33
  %option{value:"Option 6"} WHY
34
34
  %option{value:"Option 7"} XYZ
35
35
  .form-hint.error
36
- You made a mistake, which is why you see this form validation error message with some helpful Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
36
+ You made a mistake
37
37
  %p.mt-3 Use opt-groups to display hints inside the select
38
38
  .form-group.form-select-native
39
39
  %label.form-label Optgroup select
@@ -8,3 +8,14 @@ title: Trix Editor
8
8
  input#space_branding_full_description_trix_input_space_branding_8(type='hidden', name='space_branding[full_description]', value='<h1><strong>Some text before image</strong></h1><div><br><i>some italic text after</i><br><br>LIst&nbsp;</div><ul><li>1<ul><li>2</li></ul></li><li>3<ul><li>4<br><br><br></li></ul></li></ul><div>Numbered list</div><div><br></div><ol><li>one<ol><li>two</li></ol></li><li>three<ol><li>four<br><br></li></ol></li></ol><div>Little bit of code<br><br></div><pre>def add(b, c)\b + c\end</pre>', autocomplete='off')
9
9
  trix-editor#space_branding_full_description.form-control.trix-content
10
10
 
11
+
12
+ p.mt-3 If you have some errors on the field
13
+
14
+ .form-group.trix-editor
15
+ .field_with_errors
16
+ label.form-label(for='space_branding_full_description') Full description
17
+ .field_with_errors
18
+ input#space_branding_full_description_trix_input_space_branding_8(type='hidden', name='space_branding[full_description]', value='<h1><strong>Some text before image</strong></h1><div><br><i>some italic text after</i><br><br>LIst&nbsp;</div><ul><li>1<ul><li>2</li></ul></li><li>3<ul><li>4<br><br><br></li></ul></li></ul><div>Numbered list</div><div><br></div><ol><li>one<ol><li>two</li></ol></li><li>three<ol><li>four<br><br></li></ol></li></ol><div>Little bit of code<br><br></div><pre>def add(b, c)\b + c\end</pre>', autocomplete='off')
19
+ trix-editor#space_branding_full_description.form-control.trix-content
20
+ .form-hint.error can't be blank
21
+