@politicalwatch/tipi-uikit 1.5.10 → 1.5.12
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/.eslintrc.js +1 -1
- package/.storybook/main.js +17 -0
- package/.storybook/preview.js +16 -0
- package/package.json +15 -2
- package/src/components/Charts/WordsCloud/d3.wordscloud.js +1 -1
- package/src/components/Navbar/Navbar.vue +1 -1
- package/src/stories/InitiativeMeta.stories.js +43 -0
- package/src/stories/Message.stories.js +49 -0
package/.eslintrc.js
CHANGED
|
@@ -3,7 +3,7 @@ require('@rushstack/eslint-patch/modern-module-resolution');
|
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
root: true,
|
|
6
|
-
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/eslint-config-prettier'],
|
|
6
|
+
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/eslint-config-prettier', 'plugin:storybook/recommended'],
|
|
7
7
|
rules: {
|
|
8
8
|
'no-console': import.meta.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
9
9
|
'no-debugger': import.meta.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
4
|
+
addons: [
|
|
5
|
+
'@storybook/addon-links',
|
|
6
|
+
'@storybook/addon-essentials',
|
|
7
|
+
'@storybook/addon-interactions',
|
|
8
|
+
],
|
|
9
|
+
framework: {
|
|
10
|
+
name: '@storybook/vue3-vite',
|
|
11
|
+
options: {},
|
|
12
|
+
},
|
|
13
|
+
docs: {
|
|
14
|
+
autodocs: 'tag',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export default config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '../src/styles/main.scss';
|
|
2
|
+
|
|
3
|
+
/** @type { import('@storybook/vue3').Preview } */
|
|
4
|
+
const preview = {
|
|
5
|
+
parameters: {
|
|
6
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
7
|
+
controls: {
|
|
8
|
+
matchers: {
|
|
9
|
+
color: /(background|color)$/i,
|
|
10
|
+
date: /Date$/,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default preview;
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@politicalwatch/tipi-uikit",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.12",
|
|
4
4
|
"main": "src/components/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "vite build",
|
|
8
8
|
"serve": "vite preview",
|
|
9
9
|
"test:unit": "vitest --environment jsdom",
|
|
10
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
|
10
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build"
|
|
11
13
|
},
|
|
12
14
|
"dependencies": {
|
|
13
15
|
"core-js": "^3.32.2",
|
|
@@ -27,15 +29,26 @@
|
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
31
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
32
|
+
"@storybook/addon-essentials": "^7.4.6",
|
|
33
|
+
"@storybook/addon-interactions": "^7.4.6",
|
|
34
|
+
"@storybook/addon-links": "^7.4.6",
|
|
35
|
+
"@storybook/blocks": "^7.4.6",
|
|
36
|
+
"@storybook/testing-library": "^0.2.2",
|
|
37
|
+
"@storybook/vue3": "^7.4.6",
|
|
38
|
+
"@storybook/vue3-vite": "^7.4.6",
|
|
30
39
|
"@vitejs/plugin-vue": "^4.4.0",
|
|
31
40
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
32
41
|
"@vue/test-utils": "^2.4.1",
|
|
33
42
|
"autoprefixer": "^10.4.16",
|
|
34
43
|
"eslint": "^8.5.0",
|
|
44
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
35
45
|
"eslint-plugin-vue": "^9.0.0",
|
|
36
46
|
"jsdom": "^20.0.0",
|
|
37
47
|
"prettier": "^3.0.3",
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
38
50
|
"sass": "^1.67.0",
|
|
51
|
+
"storybook": "^7.4.6",
|
|
39
52
|
"stylelint": "^15.10.3",
|
|
40
53
|
"terser": "^5.14.2",
|
|
41
54
|
"vite": "^4.4.9",
|
|
@@ -3,7 +3,7 @@ import { select, selectAll } from 'd3-selection';
|
|
|
3
3
|
import { scaleOrdinal, scaleLinear } from 'd3-scale';
|
|
4
4
|
import { min, max, extent } from 'd3-array';
|
|
5
5
|
import { transition } from 'd3-transition';
|
|
6
|
-
import
|
|
6
|
+
import cloud from 'd3-cloud';
|
|
7
7
|
import {
|
|
8
8
|
easeLinear,
|
|
9
9
|
easePolyIn,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<a v-if="disclaimerLink.external" :href="disclaimerLink.route" target="_blank" v-html="disclaimerLink.name"></a>
|
|
5
5
|
<router-link v-else :to="{name: disclaimerLink.route}" v-html="disclaimerLink.name"></router-link>
|
|
6
6
|
|
|
7
|
-
<a class="c-disclaimer__close" href="#" @click="closeDisclaimer"><icon icon="
|
|
7
|
+
<a class="c-disclaimer__close" href="#" @click="closeDisclaimer"><icon icon="icon_close" color="#fff" /></a>
|
|
8
8
|
</div>
|
|
9
9
|
<div v-if="preImage" class="c-decorator" :style="`background-image: url(${preImage})`"></div>
|
|
10
10
|
<div class="c-navbar__wrapper o-container">
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import InitiativeMeta from '@/components/InitiativeMeta/InitiativeMeta.vue';
|
|
2
|
+
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/InitiativeMeta',
|
|
6
|
+
component: InitiativeMeta,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
|
|
9
|
+
// argTypes: {
|
|
10
|
+
// type: {
|
|
11
|
+
// control: {
|
|
12
|
+
// type: 'select',
|
|
13
|
+
// },
|
|
14
|
+
// options: ['success', 'error', 'info'],
|
|
15
|
+
// },
|
|
16
|
+
// icon: {
|
|
17
|
+
// control: 'boolean',
|
|
18
|
+
// },
|
|
19
|
+
// },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// More on writing stories with args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
23
|
+
export const Primary = {
|
|
24
|
+
args: {
|
|
25
|
+
initiative: {
|
|
26
|
+
id: '130-000096',
|
|
27
|
+
created: '2023-05-12T00:00:00+00:00',
|
|
28
|
+
authors: ['Gobierno'],
|
|
29
|
+
reference: '130/000096',
|
|
30
|
+
updated: '2023-07-06T00:00:00+00:00',
|
|
31
|
+
oldid: 'bae7d6e4a95882e8b862ab8c689a3d7298438210',
|
|
32
|
+
url: 'https://www.congreso.es/es/busqueda-de-iniciativas?p_p_id=iniciativas&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&_iniciativas_mode=mostrarDetalle&_iniciativas_legislatura=XIV&_iniciativas_id=130%2F000096',
|
|
33
|
+
tagged: [],
|
|
34
|
+
initiative_type_alt: 'Real Decreto-Ley',
|
|
35
|
+
deputies: [],
|
|
36
|
+
title:
|
|
37
|
+
'Real Decreto-ley 4/2023, de 11 de mayo, por el que se adoptan medidas urgentes en materia agraria y de aguas en respuesta a la sequía y al agravamiento de las condiciones del sector primario derivado del conflicto bélico en Ucrania y de las condiciones climatológicas, así como de promoción del uso del transporte público colectivo terrestre por parte de los jóvenes y prevención de riesgos laborales en episodios de elevadas temperaturas.',
|
|
38
|
+
place: '',
|
|
39
|
+
initiative_type: '130',
|
|
40
|
+
status: 'Convalidada',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import Message from '@/components/Message/Message.vue';
|
|
2
|
+
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/Message',
|
|
6
|
+
component: Message,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
render: (args) => ({
|
|
9
|
+
// Components used in your story `template` are defined in the `components` object
|
|
10
|
+
components: {
|
|
11
|
+
Message,
|
|
12
|
+
},
|
|
13
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
14
|
+
setup() {
|
|
15
|
+
// Story args can be spread into the returned object
|
|
16
|
+
return {
|
|
17
|
+
...args,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
// Then, the spread values can be accessed directly in the template
|
|
21
|
+
template: `
|
|
22
|
+
<Message :type="type" :icon="icon">
|
|
23
|
+
<template #default>
|
|
24
|
+
<p>This is the default slot content</p>
|
|
25
|
+
</template>
|
|
26
|
+
</Message>
|
|
27
|
+
`,
|
|
28
|
+
}),
|
|
29
|
+
|
|
30
|
+
argTypes: {
|
|
31
|
+
type: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'select',
|
|
34
|
+
},
|
|
35
|
+
options: ['success', 'error', 'info'],
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// More on writing stories with args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
44
|
+
export const Primary = {
|
|
45
|
+
args: {
|
|
46
|
+
type: 'success',
|
|
47
|
+
icon: true,
|
|
48
|
+
},
|
|
49
|
+
};
|