@politicalwatch/tipi-uikit 1.11.0 → 1.11.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 (39) hide show
  1. package/.stylelintrc.json +15 -0
  2. package/eslint.config.js +16 -0
  3. package/package.json +8 -5
  4. package/src/components/Charts/d3.chart.js +1 -1
  5. package/src/components/Charts/d3.chart.vue +1 -1
  6. package/src/components/Charts/styles.scss +3 -2
  7. package/src/components/Deputy/Deputy.vue +3 -3
  8. package/src/components/Loader/Loader.vue +2 -2
  9. package/src/components/Navbar/Navbar.vue +3 -3
  10. package/src/components/PartyLogo/PartyLogo.vue +0 -1
  11. package/src/components/PartyLogo/PartyLogoIcon.vue +0 -1
  12. package/src/components/TipiCharts/TipiBarchart.vue +9 -0
  13. package/src/styles/01_settings/_settings__breakpoints.scss +0 -4
  14. package/src/styles/01_settings/_settings__colors.scss +0 -2
  15. package/src/styles/01_settings/_settings__fonts.scss +1 -1
  16. package/src/styles/01_settings/_settings__variables.scss +2 -9
  17. package/src/styles/02_tools/_tools__mixins.scss +4 -5
  18. package/src/styles/03_generic/_generic__box-sizing.scss +0 -1
  19. package/src/styles/03_generic/_generic__normalize.scss +33 -5
  20. package/src/styles/04_base/_base__forms.scss +3 -4
  21. package/src/styles/04_base/_base__tables.scss +1 -5
  22. package/src/styles/05_objects/_objects__columns.scss +0 -1
  23. package/src/styles/05_objects/_objects__masonry.scss +0 -1
  24. package/src/styles/05_objects/_objects__media.scss +0 -1
  25. package/src/styles/06_components/_components__button.scss +0 -13
  26. package/src/styles/06_components/_components__forms.scss +1 -1
  27. package/src/styles/06_components/_components__initiative-card.scss +1 -1
  28. package/src/styles/06_components/_components__text.scss +1 -1
  29. package/src/styles/06_components/_components__topic-link.scss +0 -1
  30. package/src/styles/06_components/_components__topics.scss +1 -3
  31. package/src/styles/07_trumps/_trumps__borders.scss +1 -1
  32. package/src/styles/07_trumps/_trumps__colors.scss +3 -3
  33. package/src/styles/07_trumps/_trumps__helpers.scss +5 -5
  34. package/.eslintrc.js +0 -11
  35. package/.stylelintrc +0 -24
  36. package/dist/tipi-uikit.css +0 -2
  37. package/dist/tipi-uikit.es.js +0 -24390
  38. package/dist/tipi-uikit.umd.js +0 -155
  39. /package/{svgo.config.js → svgo.config.cjs} +0 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": ["stylelint-config-standard", "stylelint-config-standard-scss"],
3
+ "ignoreFiles": ["dist/**", "node_modules/**"],
4
+ "overrides": [
5
+ {
6
+ "files": ["**/*.vue"],
7
+ "customSyntax": "postcss-html"
8
+ }
9
+ ],
10
+ "rules": {
11
+ "selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": ["deep", "slotted", "global"] }],
12
+ "selector-class-pattern": null,
13
+ "scss/dollar-variable-pattern": null
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ import pluginVue from 'eslint-plugin-vue';
2
+ import prettier from 'eslint-config-prettier';
3
+ import storybook from 'eslint-plugin-storybook';
4
+
5
+ export default [
6
+ ...pluginVue.configs['flat/essential'],
7
+ ...storybook.configs['flat/recommended'],
8
+ prettier,
9
+ {
10
+ rules: {
11
+ 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13
+ },
14
+ },
15
+ { ignores: ['dist/**', 'node_modules/**'] },
16
+ ];
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
+ "type": "module",
4
5
  "main": "src/components/index.js",
5
6
  "scripts": {
6
7
  "dev": "vite",
7
8
  "build": "vite build",
8
9
  "serve": "vite preview",
9
10
  "test:unit": "vitest --environment jsdom",
10
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
11
+ "lint": "eslint . --fix",
12
+ "lint:style": "stylelint \"src/**/*.{vue,scss,css}\" --fix",
11
13
  "storybook": "storybook dev -p 6006",
12
14
  "build-storybook": "storybook build"
13
15
  },
@@ -20,7 +22,6 @@
20
22
  "pluralize": "^8.0.0",
21
23
  "qs": "^6.11.2",
22
24
  "save-svg-as-png": "^1.4.17",
23
- "stylelint-config-standard": "^40.0.0",
24
25
  "vite-svg-loader": "^5.1.0",
25
26
  "vue": "^3.4.0",
26
27
  "vue-inline-svg": "^4.0.0",
@@ -28,11 +29,13 @@
28
29
  },
29
30
  "devDependencies": {
30
31
  "@chromatic-com/storybook": "^5.2.1",
31
- "@rushstack/eslint-patch": "^1.1.0",
32
+ "eslint-config-prettier": "^10.0.0",
33
+ "postcss-html": "^1.8.1",
34
+ "stylelint-config-standard": "^40.0.0",
35
+ "stylelint-config-standard-scss": "^17.0.0",
32
36
  "@storybook/addon-links": "^10.4.6",
33
37
  "@storybook/vue3-vite": "^10.4.6",
34
38
  "@vitejs/plugin-vue": "^6.0.7",
35
- "@vue/eslint-config-prettier": "^10.1.0",
36
39
  "@vue/test-utils": "^2.4.1",
37
40
  "autoprefixer": "^10.4.16",
38
41
  "eslint": "^10.0.0",
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-console */
1
+
2
2
  import {select} from 'd3-selection';
3
3
 
4
4
  const d3 = {select};
@@ -70,7 +70,7 @@ export default {
70
70
  }, 10);
71
71
  },
72
72
  },
73
- beforeDestroy() {
73
+ beforeUnmount() {
74
74
  this.chart.destroyChart();
75
75
  },
76
76
  };
@@ -1,5 +1,4 @@
1
1
  .chart {
2
-
3
2
  /* Wrapper div (chart, title and source) */
4
3
  &__wrapper {
5
4
  margin: 20px 0;
@@ -23,12 +22,14 @@
23
22
  /* Download */
24
23
  &__source {
25
24
  font-size: 12px;
25
+
26
26
  span {
27
27
  cursor: pointer;
28
28
  background: #f4f6f8;
29
29
  color: #394d5c;
30
30
  padding: 2px 5px;
31
31
  transition: opacity 250ms ease;
32
+
32
33
  &:hover {
33
34
  opacity: 0.5;
34
35
  }
@@ -56,7 +57,7 @@
56
57
  /* Axis */
57
58
  &__axis {
58
59
  font-size: 12px;
59
- shape-rendering: crispEdges;
60
+ shape-rendering: crispedges;
60
61
 
61
62
  /* Axis title */
62
63
  &-title {}
@@ -131,7 +131,7 @@ const getConstituency = () => {
131
131
  border-radius: 50%;
132
132
  object-fit: cover;
133
133
  border: 2px solid $secondary;
134
- margin: 0 auto rem($spacer-unit) auto;
134
+ margin: 0 auto rem($spacer-unit);
135
135
  display: block;
136
136
  position: absolute;
137
137
  z-index: 0;
@@ -146,7 +146,7 @@ const getConstituency = () => {
146
146
 
147
147
  & {
148
148
  text-align: center;
149
- margin: 0 0 rem($spacer-unit) 0;
149
+ margin: 0 0 rem($spacer-unit);
150
150
  }
151
151
 
152
152
  @media (min-width: $sm) {
@@ -159,7 +159,7 @@ const getConstituency = () => {
159
159
 
160
160
  & {
161
161
  text-transform: uppercase;
162
- margin: 0 0 rem($spacer-unit) 0;
162
+ margin: 0 0 rem($spacer-unit);
163
163
  text-align: center;
164
164
  }
165
165
 
@@ -37,14 +37,14 @@ const { title, subtitle } = defineProps({
37
37
  @include th5;
38
38
 
39
39
  & {
40
- margin: 0 0 rem($spacer-unit) 0;
40
+ margin: 0 0 rem($spacer-unit);
41
41
  }
42
42
 
43
43
  @media (min-width: $md) {
44
44
  @include th4;
45
45
 
46
46
  & {
47
- margin: 0 0 rem($spacer-unit) 0;
47
+ margin: 0 0 rem($spacer-unit);
48
48
  }
49
49
  }
50
50
  }
@@ -143,7 +143,7 @@ const closeMenuMobile = () => {
143
143
 
144
144
  .c-navbar {
145
145
  transition: height 1.3s ease;
146
- box-shadow: inset 0 -2px 2px 0 rgba(0, 0, 0, 0.1);
146
+ box-shadow: inset 0 -2px 2px 0 rgb(0 0 0 / 10%);
147
147
  background-color: $navbar-background-color;
148
148
 
149
149
  &__wrapper {
@@ -281,7 +281,7 @@ const closeMenuMobile = () => {
281
281
  }
282
282
 
283
283
  &__submenu {
284
- margin: rem($spacer-unit * 2) 0 0 0;
284
+ margin: rem($spacer-unit * 2) 0 0;
285
285
  padding: 0;
286
286
 
287
287
  @media (min-width: $md) {
@@ -296,7 +296,7 @@ const closeMenuMobile = () => {
296
296
  margin: 0;
297
297
  padding: rem($spacer-unit);
298
298
  background: $white;
299
- box-shadow: inset 0 -2px 2px 0 rgba(0, 0, 0, 0.1);
299
+ box-shadow: inset 0 -2px 2px 0 rgb(0 0 0 / 10%);
300
300
  z-index: 10;
301
301
  }
302
302
 
@@ -63,7 +63,6 @@ watchEffect(async () => {
63
63
  border-radius: 50%;
64
64
  object-fit: cover;
65
65
  display: block;
66
- position: absolute;
67
66
  bottom: rem($spacer-unit * 10 * -0.25);
68
67
  left: rem($spacer-unit * 10 * -0.25);
69
68
  position: absolute;
@@ -214,7 +214,6 @@ const getName = computed(() => {
214
214
  <style scoped lang="scss">
215
215
  .c-party_logo_icon {
216
216
  display: block;
217
- border-radius: 50%;
218
217
  object-fit: cover;
219
218
  width: 5rem;
220
219
  height: 5rem;
@@ -138,10 +138,12 @@ export default {
138
138
  &__row {
139
139
  display: flex;
140
140
  position: relative;
141
+
141
142
  &:hover .tipichart__tooltip {
142
143
  display: block;
143
144
  }
144
145
  }
146
+
145
147
  &__tooltip {
146
148
  position: absolute;
147
149
  left: 0;
@@ -151,6 +153,7 @@ export default {
151
153
  display: none;
152
154
  pointer-events: none;
153
155
  }
156
+
154
157
  &__tip {
155
158
  background: black;
156
159
  color: white;
@@ -160,20 +163,24 @@ export default {
160
163
  line-height: 1.5;
161
164
  border-radius: 3px;
162
165
  }
166
+
163
167
  &__icon {
164
168
  background-repeat: no-repeat;
165
169
  background-position: center;
166
170
  margin-right: 6px;
167
171
  }
172
+
168
173
  &__bar {
169
174
  flex: 1 1 auto;
170
175
  overflow: hidden;
171
176
  border-radius: 3px;
172
177
  position: relative;
173
178
  }
179
+
174
180
  &__backbar {
175
181
  width: 100%;
176
182
  }
183
+
177
184
  &__overbar {
178
185
  position: absolute;
179
186
  z-index: 9;
@@ -190,10 +197,12 @@ export default {
190
197
  &-move {
191
198
  transition: 350ms cubic-bezier(0.59, 0.12, 0.34, 0.95);
192
199
  transition-property: opacity, transform;
200
+
193
201
  .tipichart__overbar {
194
202
  width: 0 !important;
195
203
  }
196
204
  }
205
+
197
206
  &-enter,
198
207
  &-leave-to {
199
208
  opacity: 0;
@@ -3,13 +3,11 @@ $sm: 768px !default;
3
3
  $md: 992px !default;
4
4
  $lg: 1024px !default;
5
5
  $xl: 1200px !default;
6
-
7
6
  $xxs-max: $xs - 0.1 !default;
8
7
  $xs-max: $sm - 0.1 !default;
9
8
  $sm-max: $md - 0.1 !default;
10
9
  $md-max: $lg - 0.1 !default;
11
10
  $lg-max: $xl - 0.1 !default;
12
-
13
11
  $breakpoints: (
14
12
  xs: $xs,
15
13
  sm: $sm,
@@ -17,12 +15,10 @@ $breakpoints: (
17
15
  lg: $lg,
18
16
  xl: $xl
19
17
  ) !default;
20
-
21
18
  $breakpoints-max: (
22
19
  max-xs: $xs-max,
23
20
  max-sm: $sm-max,
24
21
  max-md: $md-max,
25
22
  max-lg: $lg-max
26
23
  ) !default;
27
-
28
24
  $breakpoint-class: '\\@' !default;
@@ -9,7 +9,6 @@ $primary-dark: #d64949 !default;
9
9
  $primary-light: #ffe0e0 !default;
10
10
  $error: #e81c1c !default;
11
11
  $completed: #4dca7f !default;
12
-
13
12
  $colors: (
14
13
  "primary": $primary,
15
14
  "primary-dark": $primary-dark,
@@ -23,7 +22,6 @@ $colors: (
23
22
  "completed": $completed,
24
23
  "neutral": $neutral,
25
24
  ) !default;
26
-
27
25
  $navbar-background-color: $white !default;
28
26
  $menu-link-color: $secondary-dark !default;
29
27
  $navbar-toogle-color: $secondary-dark !default;
@@ -1,3 +1,3 @@
1
- @import url('https://fonts.googleapis.com/css?family=Rubik:300,400,500&display=swap');
1
+ @import 'https://fonts.googleapis.com/css?family=Rubik:300,400,500&display=swap';
2
2
 
3
3
  $font-primary: 'Rubik', sans-serif !default;
@@ -1,15 +1,11 @@
1
1
  $base-radius: 4px;
2
-
3
2
  $o-container: 1120px !default;
4
- $o-container__gutter: 32px !default;
5
- $o-container__gutter-single: calc($o-container__gutter / 2) !default;
3
+ $o-container__gutter: 32px !default;
4
+ $o-container__gutter-single: calc($o-container__gutter / 2) !default;
6
5
  $container-max: $o-container + $o-container__gutter !default;
7
-
8
6
  $grid-gap: 32px !default;
9
7
  $grid-gap-single: calc($grid-gap / 2) !default;
10
-
11
8
  $spacer-unit: 8px !default;
12
-
13
9
  $grid-fractions: (
14
10
  '1': calc(1 / 12),
15
11
  '2': calc(2 / 12),
@@ -25,10 +21,8 @@ $grid-fractions: (
25
21
  '11': calc(11 / 12),
26
22
  '12': calc(12 / 12)
27
23
  ) !default;
28
-
29
24
  $o-section-gap: $spacer-unit * 4 !default;
30
25
  $o-section-gap-lg: $o-section-gap !default;
31
-
32
26
  $percent-widths: (
33
27
  15,
34
28
  20,
@@ -37,7 +31,6 @@ $percent-widths: (
37
31
  40,
38
32
  50
39
33
  ) !default;
40
-
41
34
  $logo-mobile-width: 200px !default;
42
35
  $logo-desktop-width: 350px !default;
43
36
  $decorator-mobile-height: $spacer-unit !default;
@@ -130,7 +130,7 @@
130
130
  }
131
131
  }
132
132
 
133
- //colors
133
+ // colors
134
134
  @mixin background-colors() {
135
135
  @each $color-name, $color-value in $colors {
136
136
 
@@ -158,7 +158,7 @@
158
158
  }
159
159
  }
160
160
 
161
- //aligns
161
+ // aligns
162
162
  @mixin text-aligns() {
163
163
  @each $align in (left, right, center) {
164
164
 
@@ -179,9 +179,8 @@
179
179
  }
180
180
  }
181
181
 
182
- //borders
182
+ // borders
183
183
  @mixin borders() {
184
-
185
184
  .u-border {
186
185
  border: 1px solid $neutral;
187
186
  }
@@ -203,7 +202,7 @@
203
202
  }
204
203
  }
205
204
 
206
- //Text styles
205
+ // Text styles
207
206
  @mixin th1 {
208
207
  font-family: $font-primary;
209
208
  font-size: rem(40px);
@@ -3,7 +3,6 @@ html {
3
3
  }
4
4
 
5
5
  * {
6
-
7
6
  &,
8
7
  &::before,
9
8
  &::after {
@@ -10,8 +10,10 @@
10
10
 
11
11
  html {
12
12
  line-height: 1.15;
13
+
13
14
  /* 1 */
14
- -webkit-text-size-adjust: 100%;
15
+ text-size-adjust: 100%;
16
+
15
17
  /* 2 */
16
18
  }
17
19
 
@@ -46,10 +48,13 @@ h1 {
46
48
 
47
49
  hr {
48
50
  box-sizing: content-box;
51
+
49
52
  /* 1 */
50
53
  height: 0;
54
+
51
55
  /* 1 */
52
56
  overflow: visible;
57
+
53
58
  /* 2 */
54
59
  }
55
60
 
@@ -60,8 +65,10 @@ hr {
60
65
 
61
66
  pre {
62
67
  font-family: monospace, monospace;
68
+
63
69
  /* 1 */
64
70
  font-size: 1em;
71
+
65
72
  /* 2 */
66
73
  }
67
74
 
@@ -83,10 +90,13 @@ a {
83
90
 
84
91
  abbr[title] {
85
92
  border-bottom: none;
93
+
86
94
  /* 1 */
87
95
  text-decoration: underline;
96
+
88
97
  /* 2 */
89
98
  text-decoration: underline dotted;
99
+
90
100
  /* 2 */
91
101
  }
92
102
 
@@ -108,8 +118,10 @@ code,
108
118
  kbd,
109
119
  samp {
110
120
  font-family: monospace, monospace;
121
+
111
122
  /* 1 */
112
123
  font-size: 1em;
124
+
113
125
  /* 2 */
114
126
  }
115
127
 
@@ -167,12 +179,16 @@ optgroup,
167
179
  select,
168
180
  textarea {
169
181
  font-family: inherit;
182
+
170
183
  /* 1 */
171
184
  font-size: 100%;
185
+
172
186
  /* 1 */
173
187
  line-height: 1.15;
188
+
174
189
  /* 1 */
175
190
  margin: 0;
191
+
176
192
  /* 2 */
177
193
  }
178
194
 
@@ -206,7 +222,7 @@ button,
206
222
  [type="button"],
207
223
  [type="reset"],
208
224
  [type="submit"] {
209
- -webkit-appearance: button;
225
+ appearance: button;
210
226
  }
211
227
 
212
228
  /**
@@ -249,16 +265,22 @@ fieldset {
249
265
 
250
266
  legend {
251
267
  box-sizing: border-box;
268
+
252
269
  /* 1 */
253
270
  color: inherit;
271
+
254
272
  /* 2 */
255
273
  display: table;
274
+
256
275
  /* 1 */
257
276
  max-width: 100%;
277
+
258
278
  /* 1 */
259
279
  padding: 0;
280
+
260
281
  /* 3 */
261
282
  white-space: normal;
283
+
262
284
  /* 1 */
263
285
  }
264
286
 
@@ -286,8 +308,10 @@ textarea {
286
308
  [type="checkbox"],
287
309
  [type="radio"] {
288
310
  box-sizing: border-box;
311
+
289
312
  /* 1 */
290
313
  padding: 0;
314
+
291
315
  /* 2 */
292
316
  }
293
317
 
@@ -306,9 +330,11 @@ textarea {
306
330
  */
307
331
 
308
332
  [type="search"] {
309
- -webkit-appearance: textfield;
333
+ appearance: textfield;
334
+
310
335
  /* 1 */
311
336
  outline-offset: -2px;
337
+
312
338
  /* 2 */
313
339
  }
314
340
 
@@ -317,7 +343,7 @@ textarea {
317
343
  */
318
344
 
319
345
  [type="search"]::-webkit-search-decoration {
320
- -webkit-appearance: none;
346
+ appearance: none;
321
347
  }
322
348
 
323
349
  /**
@@ -326,9 +352,11 @@ textarea {
326
352
  */
327
353
 
328
354
  ::-webkit-file-upload-button {
329
- -webkit-appearance: button;
355
+ appearance: button;
356
+
330
357
  /* 1 */
331
358
  font: inherit;
359
+
332
360
  /* 2 */
333
361
  }
334
362
 
@@ -1,8 +1,7 @@
1
1
  input {
2
-
3
- &[type=text],
4
- &[type=email],
5
- &[type=password] {
2
+ &[type="text"],
3
+ &[type="email"],
4
+ &[type="password"] {
6
5
  @include tbody;
7
6
 
8
7
  display: block;
@@ -7,7 +7,6 @@ table {
7
7
  }
8
8
 
9
9
  thead {
10
-
11
10
  tr {
12
11
  @media (min-width: $md) {
13
12
  background-color: $secondary-dark;
@@ -30,7 +29,6 @@ table {
30
29
  }
31
30
 
32
31
  tbody {
33
-
34
32
  tr {
35
33
  display: block;
36
34
  margin-bottom: 1px;
@@ -42,7 +40,7 @@ table {
42
40
  th,
43
41
  td {
44
42
  display: block;
45
- padding: rem($spacer-unit) 0 0 0;
43
+ padding: rem($spacer-unit) 0 0;
46
44
 
47
45
  @media (min-width: $md) {
48
46
  display: table-cell;
@@ -80,10 +78,8 @@ table {
80
78
  }
81
79
 
82
80
  &:nth-child(even) {
83
-
84
81
  th,
85
82
  td {
86
-
87
83
  &[data-label] {
88
84
  background-color: $white;
89
85
  }
@@ -1,5 +1,4 @@
1
1
  .o-columns {
2
-
3
2
  p,
4
3
  li {
5
4
  break-inside: avoid;
@@ -1,5 +1,4 @@
1
1
  .o-masonry {
2
-
3
2
  &__item {
4
3
  padding-bottom: rem($grid-gap);
5
4
  width: 100%;
@@ -8,7 +8,6 @@
8
8
  }
9
9
 
10
10
  &--16x9 {
11
-
12
11
  &::before {
13
12
  padding-top: 56.25%;
14
13
  }