@politicalwatch/tipi-uikit 1.9.15 → 1.9.17

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.
@@ -1,5 +1,5 @@
1
1
  /** @type { import('@storybook/vue3-vite').StorybookConfig } */
2
- const config = {
2
+ export default {
3
3
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4
4
  addons: [
5
5
  '@storybook/addon-links',
@@ -15,5 +15,24 @@ const config = {
15
15
  },
16
16
  docs: {},
17
17
  staticDirs: [{ from: '../src/assets', to: '/assets' }],
18
+ async viteFinal(config, { configType }) {
19
+ const { mergeConfig } = await import('vite');
20
+
21
+ if (configType === 'DEVELOPMENT') {
22
+ // Your development configuration goes here
23
+ }
24
+ if (configType === 'PRODUCTION') {
25
+ // Your production configuration goes here.
26
+ }
27
+ return mergeConfig(config, {
28
+ // Your environment configuration here
29
+ css: {
30
+ preprocessorOptions: {
31
+ scss: {
32
+ additionalData: `@import "@/styles/main.scss";`,
33
+ },
34
+ },
35
+ },
36
+ });
37
+ },
18
38
  };
19
- export default config;
@@ -1,5 +1,3 @@
1
- import '../src/styles/main.scss';
2
-
3
1
  /** @type { import('@storybook/vue3').Preview } */
4
2
  const preview = {
5
3
  parameters: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.9.15",
3
+ "version": "1.9.17",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -12,7 +12,7 @@
12
12
  "build-storybook": "storybook build"
13
13
  },
14
14
  "dependencies": {
15
- "@storybook/test": "^8.2.2",
15
+ "@storybook/test": "^8.2.9",
16
16
  "core-js": "^3.32.2",
17
17
  "d3": "^7.8.5",
18
18
  "d3-cloud": "^1.2.5",
@@ -30,12 +30,12 @@
30
30
  "devDependencies": {
31
31
  "@chromatic-com/storybook": "^1.6.1",
32
32
  "@rushstack/eslint-patch": "^1.1.0",
33
- "@storybook/addon-essentials": "^8.2.2",
34
- "@storybook/addon-interactions": "^8.2.2",
35
- "@storybook/addon-links": "^8.2.2",
36
- "@storybook/blocks": "^8.2.2",
37
- "@storybook/vue3": "^8.2.2",
38
- "@storybook/vue3-vite": "^8.2.2",
33
+ "@storybook/addon-essentials": "^8.2.9",
34
+ "@storybook/addon-interactions": "^8.2.9",
35
+ "@storybook/addon-links": "^8.2.9",
36
+ "@storybook/blocks": "^8.2.9",
37
+ "@storybook/vue3": "^8.2.9",
38
+ "@storybook/vue3-vite": "^8.2.9",
39
39
  "@vitejs/plugin-vue": "^5.0.0",
40
40
  "@vue/eslint-config-prettier": "^9.0.0",
41
41
  "@vue/test-utils": "^2.4.1",
@@ -46,12 +46,12 @@
46
46
  "jsdom": "^24.0.0",
47
47
  "prettier": "^3.0.3",
48
48
  "sass": "^1.67.0",
49
- "storybook": "^8.2.2",
49
+ "storybook": "^8.2.9",
50
50
  "storybook-vue3-router": "^5.0.0",
51
51
  "stylelint": "^16.1.0",
52
52
  "terser": "^5.14.2",
53
53
  "vite": "^5.0.12",
54
- "vitest": "^1.0.0"
54
+ "vitest": "^2.0.0"
55
55
  },
56
56
  "packageManager": "pnpm@7.30.5+sha256.c8d730294f671574458704cd56e81dc0eb8d345a444e4c7a728d8d2cdc4f5045"
57
57
  }
@@ -103,4 +103,183 @@ const getConstituency = () => {
103
103
  };
104
104
  </script>
105
105
 
106
- <style scoped lang="scss"></style>
106
+ <style scoped lang="scss">
107
+ .c-deputy {
108
+ padding: rem($spacer-unit * 8) rem($spacer-unit * 4) rem($spacer-unit * 4);
109
+ background-color: $secondary-light;
110
+ color: $secondary-dark;
111
+
112
+ @media (min-width: $md) {
113
+ margin-bottom: rem($spacer-unit * 4);
114
+ }
115
+
116
+ &__image_container {
117
+ position: relative;
118
+ width: rem($spacer-unit * 20);
119
+ height: rem($spacer-unit * 20);
120
+ margin: 0 auto 30px;
121
+
122
+ @media (min-width: $md) {
123
+ width: rem($spacer-unit * 20);
124
+ height: rem($spacer-unit * 20);
125
+ }
126
+ }
127
+
128
+ &__image {
129
+ width: rem($spacer-unit * 20);
130
+ height: rem($spacer-unit * 20);
131
+ border-radius: 50%;
132
+ object-fit: cover;
133
+ border: 2px solid $secondary;
134
+ margin: 0 auto rem($spacer-unit) auto;
135
+ display: block;
136
+ position: absolute;
137
+ z-index: 0;
138
+
139
+ @media (min-width: $md) {
140
+ margin: 0 0 0 auto;
141
+ }
142
+ }
143
+
144
+ &__name {
145
+ @include th2;
146
+
147
+ & {
148
+ text-align: center;
149
+ margin: 0 0 rem($spacer-unit) 0;
150
+ }
151
+
152
+ @media (min-width: $sm) {
153
+ text-align: left;
154
+ }
155
+ }
156
+
157
+ &__group {
158
+ @include subtitle;
159
+
160
+ & {
161
+ text-transform: uppercase;
162
+ margin: 0 0 rem($spacer-unit) 0;
163
+ text-align: center;
164
+ }
165
+
166
+ @media (min-width: $sm) {
167
+ text-align: left;
168
+ }
169
+
170
+ a {
171
+ text-decoration: none;
172
+ color: $secondary-dark;
173
+ }
174
+ }
175
+
176
+ &__description {
177
+ @include subtitle;
178
+
179
+ & {
180
+ text-align: center;
181
+ }
182
+
183
+ @media (min-width: $sm) {
184
+ text-align: left;
185
+ }
186
+ }
187
+
188
+ &__links {
189
+ @include th6;
190
+
191
+ & {
192
+ color: $secondary-dark;
193
+ text-align: center;
194
+ }
195
+
196
+ @media (min-width: $sm) {
197
+ text-align: left;
198
+ }
199
+
200
+ a {
201
+ color: $secondary-dark;
202
+ text-decoration: none;
203
+ display: block;
204
+
205
+ @media (min-width: $md) {
206
+ display: inline-block;
207
+ margin-right: rem($spacer-unit * 2);
208
+ }
209
+ }
210
+ }
211
+
212
+ &__extra {
213
+ margin-top: 8px;
214
+ margin-bottom: 8px;
215
+ text-align: center;
216
+
217
+ @media (min-width: $md) {
218
+ text-align: left;
219
+ }
220
+ }
221
+
222
+ &__personal {
223
+ margin-right: 16px;
224
+
225
+ span {
226
+ margin-right: 4px;
227
+ }
228
+ }
229
+
230
+ &__more {
231
+ text-align: center;
232
+
233
+ @media (min-width: $md) {
234
+ text-align: left;
235
+ }
236
+
237
+ a,
238
+ a:hover {
239
+ color: $secondary-dark;
240
+ font-weight: 500;
241
+ text-decoration: none;
242
+
243
+ .c-icon {
244
+ margin-left: 8px;
245
+ }
246
+ }
247
+ }
248
+
249
+ &__info {
250
+ display: inline-block;
251
+ vertical-align: top;
252
+ font-size: 14px;
253
+ margin-top: rem($spacer-unit * 8);
254
+
255
+ h3 {
256
+ color: $secondary;
257
+ font-size: 12px;
258
+ }
259
+
260
+ p,
261
+ a {
262
+ margin-top: 8px;
263
+ margin-bottom: 8px;
264
+ }
265
+
266
+ a {
267
+ font-weight: 500;
268
+ color: $secondary-dark;
269
+ }
270
+
271
+ span {
272
+ margin-right: 8px;
273
+ }
274
+ }
275
+
276
+ &__hidden {
277
+ display: none;
278
+ }
279
+
280
+ &__birthday {
281
+ background: url('../assets/birthday_bg.png');
282
+ }
283
+ }
284
+
285
+ </style>
@@ -17,3 +17,43 @@ const props = defineProps({
17
17
 
18
18
  const { title, subtitle } = toRefs(props);
19
19
  </script>
20
+
21
+ <style lang="scss" scoped>
22
+ .c-page-header {
23
+ margin-bottom: rem($spacer-unit * 4);
24
+ padding-bottom: rem($spacer-unit * 4);
25
+ border-bottom: 1px solid $neutral;
26
+
27
+ @media (min-width: $md) {
28
+ margin-bottom: rem($spacer-unit * 8);
29
+ }
30
+
31
+ &__title {
32
+ margin-bottom: rem($spacer-unit * 2);
33
+ color: $secondary-dark;
34
+
35
+ a {
36
+ color: $secondary-dark;
37
+ }
38
+ }
39
+
40
+ &__subtitle {
41
+ @include subtitle;
42
+
43
+ & {
44
+ color: $secondary;
45
+ margin: 0;
46
+ }
47
+ }
48
+
49
+ &--nosub {
50
+ padding-bottom: rem($spacer-unit * 2);
51
+
52
+ .c-page-header {
53
+ &__title {
54
+ margin-bottom: 0;
55
+ }
56
+ }
57
+ }
58
+ }
59
+ </style>
@@ -77,3 +77,95 @@ const getStateMessage = () => {
77
77
  return `${initiative.value['status']} ${formattedDate}`;
78
78
  };
79
79
  </script>
80
+
81
+ <style lang="scss" scoped>
82
+ .c-initiative-meta {
83
+ &__status {
84
+ @include overline;
85
+
86
+ display: block;
87
+ color: $white;
88
+ padding: rem($spacer-unit);
89
+ text-align: center;
90
+
91
+ &--neutral {
92
+ background-color: $secondary;
93
+ color: $black;
94
+ }
95
+
96
+ &--completed {
97
+ background-color: $completed;
98
+ color: $white;
99
+ }
100
+
101
+ &--error {
102
+ background-color: $error;
103
+ color: $white;
104
+ }
105
+ }
106
+
107
+ &__link {
108
+ @include overline;
109
+
110
+ text-transform: none;
111
+ text-decoration: none;
112
+ color: $black;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+
117
+ svg {
118
+ margin-right: rem($spacer-unit);
119
+ }
120
+
121
+ &:hover {
122
+ color: $primary;
123
+
124
+ svg {
125
+ path {
126
+ fill: $primary;
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ .c-icon {
133
+ margin-right: 8px;
134
+ }
135
+
136
+ &__status {
137
+ text-align: left;
138
+ padding: 0 0 0 rem($spacer-unit);
139
+
140
+ &--neutral {
141
+ background-color: transparent;
142
+ border-color: $secondary;
143
+ color: $secondary;
144
+
145
+ svg path {
146
+ fill: $secondary;
147
+ }
148
+ }
149
+
150
+ &--completed {
151
+ background-color: transparent;
152
+ border-color: $completed;
153
+ color: $completed;
154
+
155
+ svg path {
156
+ fill: $completed;
157
+ }
158
+ }
159
+
160
+ &--error {
161
+ background-color: transparent;
162
+ border-color: $error;
163
+ color: $error;
164
+
165
+ svg path {
166
+ fill: $error;
167
+ }
168
+ }
169
+ }
170
+ }
171
+ </style>
@@ -21,3 +21,131 @@ const { title, subtitle } = defineProps({
21
21
  subtitle: String,
22
22
  });
23
23
  </script>
24
+
25
+ <style lang="scss">
26
+ .c-loader {
27
+ padding: rem($spacer-unit * 4) rem($spacer-unit * 2);
28
+ color: $secondary-dark;
29
+ text-align: center;
30
+ background-color: $secondary-light;
31
+
32
+ &__text {
33
+ margin-top: rem($spacer-unit * 2);
34
+ }
35
+
36
+ &__title {
37
+ @include th5;
38
+
39
+ & {
40
+ margin: 0 0 rem($spacer-unit) 0;
41
+ }
42
+
43
+ @media (min-width: $md) {
44
+ @include th4;
45
+
46
+ & {
47
+ margin: 0 0 rem($spacer-unit) 0;
48
+ }
49
+ }
50
+ }
51
+
52
+ &__spinner {
53
+ margin: 0 auto;
54
+ width: rem($spacer-unit * 5);
55
+ height: rem($spacer-unit * 5);
56
+ position: relative;
57
+ animation: sk-chase 2.5s infinite linear both;
58
+ }
59
+
60
+ &__spinner-dot {
61
+ width: 100%;
62
+ height: 100%;
63
+ position: absolute;
64
+ left: 0;
65
+ top: 0;
66
+ animation: sk-chase-dot 2s infinite ease-in-out both;
67
+
68
+ &::before {
69
+ content: '';
70
+ display: block;
71
+ width: 25%;
72
+ height: 25%;
73
+ background-color: $secondary;
74
+ border-radius: 100%;
75
+ animation: sk-chase-dot-before 2s infinite ease-in-out both;
76
+ }
77
+
78
+ &:nth-child(1) {
79
+ animation-delay: -1.1s;
80
+
81
+ &::before {
82
+ animation-delay: -1.1s;
83
+ }
84
+ }
85
+
86
+ &:nth-child(2) {
87
+ animation-delay: -1s;
88
+
89
+ &::before {
90
+ animation-delay: -1s;
91
+ }
92
+ }
93
+
94
+ &:nth-child(3) {
95
+ animation-delay: -0.9s;
96
+
97
+ &::before {
98
+ animation-delay: -0.9s;
99
+ }
100
+ }
101
+
102
+ &:nth-child(4) {
103
+ animation-delay: -0.8s;
104
+
105
+ &::before {
106
+ animation-delay: -0.8s;
107
+ }
108
+ }
109
+
110
+ &:nth-child(5) {
111
+ animation-delay: -0.7s;
112
+
113
+ &::before {
114
+ animation-delay: -0.7s;
115
+ }
116
+ }
117
+
118
+ &:nth-child(6) {
119
+ animation-delay: -0.6s;
120
+
121
+ &::before {
122
+ animation-delay: -0.6s;
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ @keyframes sk-chase {
129
+ 100% {
130
+ transform: rotate(360deg);
131
+ }
132
+ }
133
+
134
+ @keyframes sk-chase-dot {
135
+ 80%,
136
+ 100% {
137
+ transform: rotate(360deg);
138
+ }
139
+ }
140
+
141
+ @keyframes sk-chase-dot-before {
142
+ 50% {
143
+ transform: scale(0.4);
144
+ }
145
+
146
+ 100%,
147
+ 0% {
148
+ transform: scale(1);
149
+ }
150
+ }
151
+ </style>
@@ -25,3 +25,72 @@ const props = defineProps({
25
25
 
26
26
  const { type, icon } = toRefs(props);
27
27
  </script>
28
+
29
+ <style lang="scss" scoped>
30
+ .c-message {
31
+ margin-bottom: rem($spacer-unit * 2);
32
+
33
+ &__wrapper {
34
+ @include tbody2;
35
+
36
+ display: inline-block;
37
+ padding: rem($spacer-unit * 2) rem($spacer-unit * 4);
38
+ background-color: $completed;
39
+ color: $white;
40
+ position: relative;
41
+ }
42
+
43
+ &__icon {
44
+ position: absolute;
45
+ left: rem($spacer-unit * 2);
46
+ margin-top: rem(calc($spacer-unit / 4));
47
+
48
+ svg {
49
+ path {
50
+ fill: $white;
51
+ }
52
+ }
53
+ }
54
+
55
+ &--error {
56
+ .c-message {
57
+ &__wrapper {
58
+ background-color: $error;
59
+ }
60
+ }
61
+ }
62
+
63
+ &--info {
64
+ .c-message {
65
+ &__wrapper {
66
+ color: $secondary-dark;
67
+ background-color: $secondary-light;
68
+ }
69
+
70
+ &__icon {
71
+ svg {
72
+ path {
73
+ fill: $secondary;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ &--icon {
81
+ .c-message {
82
+ &__wrapper {
83
+ padding-left: rem($spacer-unit * 5);
84
+ }
85
+ }
86
+ }
87
+
88
+ &.u-block {
89
+ .c-message {
90
+ &__wrapper {
91
+ display: block;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ </style>