@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-beta.0

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 (67) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +70 -67
  3. package/.github/workflows/deploy-storybook.yml +1 -1
  4. package/.storybook/eventBus.js +25 -2
  5. package/.storybook/main.js +17 -21
  6. package/babel.config.js +17 -3
  7. package/dist/css/psui_styles.css +0 -76
  8. package/package.json +36 -23
  9. package/scripts/kill-port.sh +12 -0
  10. package/src/assets/scss/components/PsTableResults.scss +1 -62
  11. package/src/components/accordion/PsAccordion.vue +20 -21
  12. package/src/components/accordion/PsAccordionItem.vue +30 -8
  13. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +6 -3
  14. package/src/components/badges-and-tags/PsCardInfos.vue +3 -1
  15. package/src/components/badges-and-tags/PsChartLegend.vue +19 -5
  16. package/src/components/badges-and-tags/PsCostEffectBar.vue +4 -5
  17. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +1 -1
  18. package/src/components/badges-and-tags/PsTestimonialCard.vue +6 -4
  19. package/src/components/buttons/PsButton.vue +30 -11
  20. package/src/components/chips/PsChips.vue +5 -2
  21. package/src/components/controls/PsCheckbox.vue +5 -2
  22. package/src/components/controls/PsCheckboxSimple.vue +4 -4
  23. package/src/components/controls/PsDraggable.vue +70 -67
  24. package/src/components/controls/PsInlineSelector.vue +13 -14
  25. package/src/components/controls/PsRadioButton.vue +10 -5
  26. package/src/components/controls/PsRadioButtonSimple.vue +3 -3
  27. package/src/components/controls/PsSlider.vue +6 -6
  28. package/src/components/controls/PsSwitch.vue +13 -3
  29. package/src/components/controls/PsToggle.vue +14 -11
  30. package/src/components/data-graphics/PsBarChart.vue +4 -2
  31. package/src/components/datatable/PsDataTable.vue +14 -5
  32. package/src/components/datatable/PsDataTableItem.vue +17 -4
  33. package/src/components/forms/PsDropdown.vue +8 -5
  34. package/src/components/forms/PsDropdownList.vue +1 -1
  35. package/src/components/forms/PsInput.vue +30 -14
  36. package/src/components/forms/PsInputSelect.vue +33 -11
  37. package/src/components/forms/PsInputTextArea.vue +15 -4
  38. package/src/components/navigations/PsBreadcrumb.vue +1 -1
  39. package/src/components/notifications/PsDialog.vue +11 -5
  40. package/src/components/notifications/PsSimpleAlert.vue +22 -10
  41. package/src/components/notifications/PsToast.vue +8 -3
  42. package/src/components/playground/PsScrollBar.vue +122 -50
  43. package/src/components/table-results/PsTableResults.vue +67 -51
  44. package/src/components/table-results/PsTableResultsBody.vue +3 -1
  45. package/src/components/table-results/PsTableResultsHead.vue +27 -8
  46. package/src/components/table-results/PsTableResultsHeadComparison.vue +24 -8
  47. package/src/components/table-results/PsTableResultsHeadFlexible.vue +18 -6
  48. package/src/components/table-results/PsTableResultsRow.vue +6 -2
  49. package/src/components/tabs/PsTabHeader.vue +19 -16
  50. package/src/components/tooltip/PsDialogTooltip.vue +18 -8
  51. package/src/components/tooltip/PsRichTooltip.vue +12 -5
  52. package/src/components/tooltip/PsTooltip.vue +17 -9
  53. package/src/components/ui/PsDotLoader.vue +5 -5
  54. package/src/components/ui/PsIcon.vue +6 -2
  55. package/src/index.js +0 -1
  56. package/src/stories/Button.stories.js +48 -130
  57. package/src/stories/Button.vue +59 -0
  58. package/src/stories/{ElevationSystem.stories.mdx → ElevationSystem.mdx} +1 -1
  59. package/src/stories/Header.stories.js +41 -0
  60. package/src/stories/Header.vue +77 -0
  61. package/src/stories/{Introduction.stories.mdx → Introduction.mdx} +101 -101
  62. package/src/stories/{Typography.stories.mdx → Typography.mdx} +107 -105
  63. package/src/stories/button.css +30 -0
  64. package/src/stories/header.css +32 -0
  65. package/webpack.config.js +22 -0
  66. package/backup-package-lock.json +0 -37194
  67. /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ .storybook
package/.eslintrc.js CHANGED
@@ -1,68 +1,71 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true
5
- },
6
- extends: [
7
- 'plugin:vue/essential',
8
- 'eslint:recommended',
9
- ],
10
- parserOptions: {
11
- parser: 'babel-eslint',
12
- requireConfigFile: false,
13
- },
14
- rules: {
15
- 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
17
- 'semi': ['warn', 'never'],
18
- 'quotes': [2, 'single'],
19
- 'vue/order-in-components': ['warn', {
20
- 'order': [
21
- 'el',
22
- 'name',
23
- 'key',
24
- 'parent',
25
- ['components', 'directives', 'filters'],
26
- ['props', 'propsData'],
27
- 'functional',
28
- ['delimiters', 'comments'],
29
- 'extends',
30
- 'mixins',
31
- ['provide', 'inject'],
32
- 'ROUTER_GUARDS',
33
- 'layout',
34
- 'middleware',
35
- 'validate',
36
- 'scrollToTop',
37
- 'transition',
38
- 'loading',
39
- 'inheritAttrs',
40
- 'model',
41
- 'emits',
42
- 'setup',
43
- 'asyncData',
44
- 'data',
45
- 'fetch',
46
- 'head',
47
- 'computed',
48
- 'watch',
49
- 'watchQuery',
50
- 'LIFECYCLE_HOOKS',
51
- 'methods',
52
- ['template', 'render'],
53
- 'renderError'
54
- ]
55
- }]
56
- },
57
- overrides: [
58
- {
59
- files: [
60
- '**/__tests__/*.{j,t}s?(x)',
61
- '**/tests/unit/**/*.spec.{j,t}s?(x)'
62
- ],
63
- env: {
64
- jest: true
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true
5
+ },
6
+ parser: 'vue-eslint-parser',
7
+ parserOptions: {
8
+ parser: '@babel/eslint-parser',
9
+ requireConfigFile: false,
10
+ babelOptions: {
11
+ babelrc: false,
12
+ configFile: false,
13
+ presets: ['@babel/preset-env'],
14
+ },
15
+ },
16
+ extends: ['plugin:vue/vue3-essential', 'eslint:recommended','plugin:vue/vue3-strongly-recommended'],
17
+ rules: {
18
+ 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
19
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
20
+ 'semi': ['warn', 'never'],
21
+ 'quotes': [2, 'single'],
22
+ 'vue/order-in-components': ['warn', {
23
+ 'order': [
24
+ 'el',
25
+ 'name',
26
+ 'key',
27
+ 'parent',
28
+ ['components', 'directives', 'filters'],
29
+ ['props', 'propsData'],
30
+ 'functional',
31
+ ['delimiters', 'comments'],
32
+ 'extends',
33
+ 'mixins',
34
+ ['provide', 'inject'],
35
+ 'ROUTER_GUARDS',
36
+ 'layout',
37
+ 'middleware',
38
+ 'validate',
39
+ 'scrollToTop',
40
+ 'transition',
41
+ 'loading',
42
+ 'inheritAttrs',
43
+ 'model',
44
+ 'emits',
45
+ 'setup',
46
+ 'asyncData',
47
+ 'data',
48
+ 'fetch',
49
+ 'head',
50
+ 'computed',
51
+ 'watch',
52
+ 'watchQuery',
53
+ 'LIFECYCLE_HOOKS',
54
+ 'methods',
55
+ ['template', 'render'],
56
+ 'renderError'
57
+ ]
58
+ }]
59
+ },
60
+ overrides: [
61
+ {
62
+ files: [
63
+ '**/__tests__/*.{j,t}s?(x)',
64
+ '**/tests/unit/**/*.spec.{j,t}s?(x)'
65
+ ],
66
+ env: {
67
+ jest: true
68
+ }
65
69
  }
66
- }
67
- ]
68
- }
70
+ ]
71
+ }
@@ -26,7 +26,7 @@ jobs:
26
26
  - name: Setup Node.js
27
27
  uses: actions/setup-node@v2
28
28
  with:
29
- node-version: ^14.0.0
29
+ node-version: 18.19.0
30
30
 
31
31
  - name: Install dependencies
32
32
  run: npm install && npm install vercel@25.1.0 && npm install -g vercel@25.1.0
@@ -1,3 +1,26 @@
1
- import Vue from 'vue';
1
+ // this was a vue2 syntax
2
+ // import Vue from 'vue';
3
+ // export const eventBus = new Vue();
2
4
 
3
- export const eventBus = new Vue();
5
+ // import { createApp } from 'vue';
6
+
7
+ // export const app = createApp({});
8
+ // const emitter = app.config.globalProperties.$emitter = {};
9
+
10
+ // export const eventBus = {
11
+ // on(event, callback) {
12
+ // if (!emitter[event]) {
13
+ // emitter[event] = [];
14
+ // }
15
+ // emitter[event].push(callback);
16
+ // },
17
+ // emit(event, ...args) {
18
+ // if (emitter[event]) {
19
+ // emitter[event].forEach(callback => {
20
+ // callback(...args);
21
+ // });
22
+ // }
23
+ // },
24
+ // };
25
+
26
+ // app.mount('#app');
@@ -1,25 +1,21 @@
1
- module.exports = {
2
- "stories": [
3
- "../src/**/*.stories.mdx",
4
- "../src/**/*.stories.@(js|jsx|ts|tsx)"
5
- ],
6
- previewHead: (head) => (`
7
- ${head}
8
- <link rel="preconnect" href="https://fonts.googleapis.com">
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap" rel="stylesheet">
11
- `),
12
- "addons": [
1
+ /** @type { import('@storybook/vue3-webpack5').StorybookConfig } */
2
+ const config = {
3
+ stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
4
+ addons: [
13
5
  "@storybook/addon-links",
14
6
  "@storybook/addon-essentials",
15
- {
16
- name: '@storybook/addon-postcss',
17
- options: {
18
- postcssLoaderOptions: {
19
- implementation: require('postcss'),
20
- },
7
+ "@storybook/addon-interactions",
8
+ ],
9
+ framework: {
10
+ name: "@storybook/vue3-webpack5",
11
+ options: {
12
+ builder: {
13
+ useSWC: true,
21
14
  },
22
15
  },
23
- ],
24
- "framework": "@storybook/vue"
25
- }
16
+ },
17
+ docs: {
18
+ autodocs: "tag",
19
+ },
20
+ };
21
+ export default config;
package/babel.config.js CHANGED
@@ -1,3 +1,17 @@
1
- module.exports = {
2
- presets: ['@vue/cli-plugin-babel/preset'],
3
- }
1
+ const presets = [
2
+ [
3
+ '@babel/preset-env',
4
+ {
5
+ targets: {
6
+ edge: '17',
7
+ firefox: '60',
8
+ chrome: '67',
9
+ safari: '11.1',
10
+ },
11
+ useBuiltIns: 'usage',
12
+ corejs: '3.6.4',
13
+ },
14
+ ],
15
+ ]
16
+
17
+ module.exports = { presets }
@@ -1932,7 +1932,6 @@ video {
1932
1932
 
1933
1933
  .psui-el-table-results-wrapper.table-flexible {
1934
1934
  padding-right: 1rem;
1935
- padding-bottom: 0.5rem;
1936
1935
  }
1937
1936
 
1938
1937
  .psui-el-table-results {
@@ -2538,87 +2537,12 @@ video {
2538
2537
  margin-left: 4px;
2539
2538
  }
2540
2539
 
2541
- .psui-el-table-results.layout-flexible tbody tr.combined_measure_margin_aux td {
2542
- content: '' !important;
2543
- background-color: white !important;
2544
- max-height: 10px;
2545
- visibility: hidden;
2546
- }
2547
-
2548
- .psui-el-table-results.layout-flexible tbody tr.combined_measure_margin_aux td:nth-child(3) {
2549
- visibility: visible;
2550
- }
2551
-
2552
2540
  .psui-el-table-results.layout-flexible tbody tr.is-disabled td.hover-color {
2553
2541
  background-color: #E6ECF2 !important;
2554
2542
  opacity: 0.99;
2555
2543
  transition: background-color 0.5s ease;
2556
2544
  }
2557
2545
 
2558
- .psui-el-table-results.layout-flexible tbody tr.visible {
2559
- display: none
2560
- }
2561
-
2562
- .psui-el-table-results.layout-flexible tbody tr.appended-row {
2563
- --bg-opacity: 1;
2564
- background-color: #ECF7FB;
2565
- background-color: rgba(236, 247, 251, var(--bg-opacity));
2566
- border-width: 1px;
2567
- border-radius: 0.375rem;
2568
- height: 36px;
2569
- }
2570
-
2571
- .psui-el-table-results.layout-flexible tbody tr.appended-row td {
2572
- --bg-opacity: 1;
2573
- background-color: #F3F6F9;
2574
- background-color: rgba(243, 246, 249, var(--bg-opacity));
2575
- --text-opacity: 1;
2576
- color: #34404A;
2577
- color: rgba(52, 64, 74, var(--text-opacity));
2578
- transition: background-color 0.5s ease;
2579
- }
2580
-
2581
- .psui-el-table-results.layout-flexible tbody tr.appended-row td .title {
2582
- margin-left: 6px;
2583
- }
2584
-
2585
- .psui-el-table-results.layout-flexible tbody tr.appended-row td:first-child {
2586
- position: sticky;
2587
- min-width: 330px;
2588
- }
2589
-
2590
- .psui-el-table-results.layout-flexible tbody tr.appended-row td:first-child:after,.psui-el-table-results.layout-flexible tbody tr.appended-row td:first-child:before {
2591
- content: '';
2592
- position: absolute;
2593
- top: 0;
2594
- }
2595
-
2596
- .psui-el-table-results.layout-flexible tbody tr.appended-row td:first-child:before {
2597
- --bg-opacity: 1;
2598
- background-color: #F3F6F9;
2599
- background-color: rgba(243, 246, 249, var(--bg-opacity));
2600
- border-bottom-left-radius: 9999px;
2601
- box-shadow: -3px 3px 0px 0px #ffffff;
2602
- z-index: 30;
2603
- top: 25px;
2604
- left: 0;
2605
- width: 10px;
2606
- height: 10px;
2607
- }
2608
-
2609
- .psui-el-table-results.layout-flexible tbody tr.appended-row td:first-child:after {
2610
- --bg-opacity: 1;
2611
- background-color: #F3F6F9;
2612
- background-color: rgba(243, 246, 249, var(--bg-opacity));
2613
- border-top-left-radius: 9999px;
2614
- box-shadow: -3px -3px 0px 0px #ffffff;
2615
- z-index: 30;
2616
- top: 0;
2617
- left: 0;
2618
- width: 10px;
2619
- height: 10px;
2620
- }
2621
-
2622
2546
  .psui-el-table-results.layout-flexible tbody tr td {
2623
2547
  --text-opacity: 1;
2624
2548
  color: #34404A;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.89",
3
+ "version": "1.1.90-beta.0",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -12,46 +12,59 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "lint": "vue-cli-service lint",
15
- "build-storybook": "STORYBOOK_ENV=production build-storybook",
15
+ "build-storybook": "storybook build",
16
16
  "build-tailwind": "postcss src/assets/scss/base.scss -o dist/css/psui_styles.css",
17
17
  "build-temp-tailwind": "postcss src/assets/scss/base.scss -o temp/css/psui_styles.css",
18
- "full-publish": "npm run lint && npm run build-tailwind && build-storybook && npm publish",
18
+ "full-publish": "npm run lint && npm run build-tailwind && npm run build-storybook && npm publish --tag beta",
19
19
  "serve": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-tailwind\"",
20
20
  "serve-prod": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-prod-tailwind\"",
21
- "watch-storybook": "start-storybook -p 6006",
22
21
  "watch-prod-tailwind": "watch 'npm run build-tailwind' ./src/assets",
23
- "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets"
22
+ "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets",
23
+ "kill-port": "sh ./scripts/kill-port.sh",
24
+ "storybook": "concurrently \"npm run kill-port\" \"npm run watch-prod-tailwind\" \"storybook dev -p 6006\""
24
25
  },
25
26
  "dependencies": {
27
+ "@vue/compat": "^3.4.5",
26
28
  "core-js": "^3.6.5",
27
29
  "v-tooltip": "^2.1.3",
28
- "vue": "^2.6.11"
30
+ "vue": "^3.4.5"
29
31
  },
30
32
  "devDependencies": {
31
- "@babel/core": "^7.16.7",
32
- "@storybook/addon-actions": "^6.4.13",
33
- "@storybook/addon-essentials": "^6.4.13",
34
- "@storybook/addon-links": "^6.4.13",
35
- "@storybook/addon-postcss": "^2.0.0",
36
- "@storybook/vue": "^6.4.13",
37
- "@vue/cli-plugin-babel": "~4.5.0",
38
- "@vue/cli-plugin-eslint": "~4.5.0",
39
- "@vue/cli-service": "~4.5.0",
40
- "@vue/eslint-config-prettier": "^6.0.0",
33
+ "@babel/cli": "^7.23.4",
34
+ "@babel/core": "^7.23.7",
35
+ "@babel/eslint-parser": "^7.23.3",
36
+ "@babel/preset-env": "^7.23.7",
37
+ "@storybook/addon-essentials": "^7.6.7",
38
+ "@storybook/addon-interactions": "^7.6.7",
39
+ "@storybook/addon-links": "^7.6.7",
40
+ "@storybook/blocks": "^7.6.7",
41
+ "@storybook/test": "^7.6.7",
42
+ "@storybook/vue3": "^7.6.7",
43
+ "@storybook/vue3-webpack5": "^7.6.7",
44
+ "@vue/cli-plugin-eslint": "^5.0.8",
45
+ "@vue/cli-service": "~5.0.8",
46
+ "@vue/compiler-sfc": "^3.4.5",
47
+ "@vue/eslint-config-prettier": "^9.0.0",
41
48
  "babel-eslint": "^10.1.0",
42
- "babel-loader": "^8.2.3",
43
49
  "concurrently": "^7.0.0",
44
- "eslint": "^6.7.2",
45
- "eslint-plugin-prettier": "^3.3.1",
46
- "eslint-plugin-vue": "^6.2.2",
50
+ "eslint": "^8.56.0",
51
+ "eslint-plugin-prettier": "^5.1.2",
52
+ "eslint-plugin-storybook": "^0.6.15",
53
+ "eslint-plugin-vue": "^9.19.2",
47
54
  "postcss": "^8.3.11",
48
55
  "postcss-cli": "^9.0.2",
49
56
  "postcss-import": "^14.0.2",
50
57
  "postcss-nested": "^5.0.6",
51
- "prettier": "^2.2.1",
58
+ "prettier": "^3.1.1",
59
+ "react": "^18.2.0",
60
+ "react-dom": "^18.2.0",
61
+ "storybook": "^7.6.7",
52
62
  "tailwindcss": "^1.9.6",
53
- "vue-loader": "^15.9.8",
54
- "vue-template-compiler": "^2.6.11",
63
+ "vue-eslint-parser": "^9.3.2",
64
+ "vue-loader": "^17.4.2",
55
65
  "watch": "^1.0.2"
66
+ },
67
+ "engines": {
68
+ "node": "18.19.0"
56
69
  }
57
70
  }
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+
3
+ # Find the process using port 3000
4
+ PROCESS_ID=$(lsof -t -i:6006)
5
+
6
+ # Check if a process is using the port
7
+ if [ -n "$PROCESS_ID" ]; then
8
+ echo "Killing process on port 6006 (PID: $PROCESS_ID)"
9
+ kill -9 $PROCESS_ID
10
+ else
11
+ echo "Port 6006 is not in use"
12
+ fi
@@ -3,7 +3,7 @@
3
3
  @apply psui-w-full psui-whitespace-no-wrap psui-flex psui-overflow-auto;
4
4
 
5
5
  &.table-flexible {
6
- @apply psui-pr-4 psui-pb-2;
6
+ @apply psui-pr-4;
7
7
  }
8
8
  }
9
9
 
@@ -481,20 +481,6 @@
481
481
  }
482
482
  }
483
483
 
484
- &.combined_measure_margin_aux {
485
-
486
- td {
487
- content: '' !important;
488
- background-color: white !important;
489
- max-height: 10px;
490
- visibility: hidden;
491
-
492
- &:nth-child(3) {
493
- visibility: visible;
494
- }
495
-
496
- }
497
- }
498
484
 
499
485
  &.is-disabled {
500
486
  td {
@@ -506,53 +492,6 @@
506
492
  }
507
493
  }
508
494
 
509
- &.visible {
510
- display: none
511
- }
512
-
513
- &.appended-row {
514
- @apply psui-bg-blue-10 psui-border psui-rounded-md;
515
- height: 36px;
516
-
517
- td {
518
- @apply psui-bg-gray-10 psui-text-gray-70;
519
- transition: background-color 0.5s ease;
520
-
521
- .title {
522
- margin-left: 6px;
523
- }
524
-
525
- &:first-child {
526
- @apply psui-sticky;
527
- min-width: 330px;
528
-
529
- &:after,&:before {
530
- content: '';
531
- @apply psui-absolute psui-top-0;
532
- }
533
-
534
- &:before {
535
- @apply psui-bg-gray-10 psui-rounded-bl-full ;
536
- box-shadow: -3px 3px 0px 0px #ffffff;
537
- z-index: 30;
538
- top: 25px;
539
- left: 0;
540
- width: 10px;
541
- height: 10px;
542
- }
543
-
544
- &:after {
545
- @apply psui-bg-gray-10 psui-rounded-tl-full ;
546
- box-shadow: -3px -3px 0px 0px #ffffff;
547
- z-index: 30;
548
- top: 0;
549
- left: 0;
550
- width: 10px;
551
- height: 10px;
552
- }
553
- }
554
- }
555
- }
556
495
 
557
496
  td {
558
497
  @apply psui-text-gray-70 psui-h-10 psui-text-right psui-text-small;
@@ -1,28 +1,27 @@
1
1
  <template>
2
- <div class="psui-el-accordion" :class="getComponentClass">
3
- <slot></slot>
2
+ <div
3
+ class="psui-el-accordion"
4
+ :class="getComponentClass"
5
+ >
6
+ <slot />
4
7
  </div>
5
8
  </template>
6
9
 
7
- <script>
8
- export const layouts = ['big', 'medium']
9
- export default {
10
- name: 'PsAccordion',
11
- props: {
12
- /**
13
- * It defines the size of the accordion items. eg: text size and font.
14
- */
15
- layout: {
16
- type: String,
17
- default: 'medium',
18
- validator: (value) => ['medium','big'].includes(value),
19
- },
10
+ <script setup>
11
+ import { computed } from 'vue'
12
+
13
+ const props = defineProps({
14
+ layout:{
15
+ type: String,
16
+ default: 'medium',
17
+ validator: (value) => ['big', 'medium'].includes(value)
20
18
  },
21
- computed: {
22
- getComponentClass() {
23
- return `layout-${this.layout}`
24
- }
25
- }
26
- }
19
+ })
20
+
21
+ const getComponentClass = computed(() => {
22
+ return `layout-${props.layout}`
23
+ })
24
+
27
25
  </script>
26
+
28
27
  <style> /* Please, use the file src/assets/scss/components/PsAccordion.scss */</style>
@@ -1,11 +1,30 @@
1
1
  <template>
2
- <div class="psui-el-accordion-item" :class="{'status-opened':isOpen, 'disabled':disabled}">
2
+ <div
3
+ class="psui-el-accordion-item"
4
+ :class="{'status-opened':isOpen, 'disabled':disabled}"
5
+ >
3
6
  <div class="psui-el-accordion-item-header">
4
- <slot name='custom-header' :toggle="toggle" :isOpen="isOpen">
5
- <div @click="toggle" class="psui-el-accordion-item-header-wrapper" v-if="!hasCustomHeader">
6
- <h2 v-if="title" class="psui-el-accordion-item-title">{{ title }}</h2>
7
- <slot name='header-additionals'></slot>
8
- <i v-if="!disabled" class="psui-el-accordion-item-icon">{{ getIcon }}</i>
7
+ <slot
8
+ name="custom-header"
9
+ :toggle="toggle"
10
+ :is-open="isOpen"
11
+ >
12
+ <div
13
+ @click="toggle"
14
+ class="psui-el-accordion-item-header-wrapper"
15
+ v-if="!hasCustomHeader"
16
+ >
17
+ <h2
18
+ v-if="title"
19
+ class="psui-el-accordion-item-title"
20
+ >
21
+ {{ title }}
22
+ </h2>
23
+ <slot name="header-additionals" />
24
+ <i
25
+ v-if="!disabled"
26
+ class="psui-el-accordion-item-icon"
27
+ >{{ getIcon }}</i>
9
28
  </div>
10
29
  </slot>
11
30
  </div>
@@ -16,8 +35,11 @@
16
35
  @before-leave="start"
17
36
  @after-leave="end"
18
37
  >
19
- <div v-if="isOpen" class="psui-el-accordion-item-content">
20
- <slot></slot>
38
+ <div
39
+ v-if="isOpen"
40
+ class="psui-el-accordion-item-content"
41
+ >
42
+ <slot />
21
43
  </div>
22
44
  </transition>
23
45
  </div>
@@ -1,11 +1,14 @@
1
1
  <template>
2
- <div class="psui-el-badge-with-icon" :class="getComponentClass">
2
+ <div
3
+ class="psui-el-badge-with-icon"
4
+ :class="getComponentClass"
5
+ >
3
6
  <i
4
7
  v-if="icon"
5
8
  :class="iconClass"
6
9
  class="psui-el-badge-with-icon-icon"
7
- >{{icon}}</i>
8
- <span class="psui-el-badge-with-icon-message">{{message}}</span>
10
+ >{{ icon }}</i>
11
+ <span class="psui-el-badge-with-icon-message">{{ message }}</span>
9
12
  </div>
10
13
  </template>
11
14
 
@@ -8,7 +8,9 @@
8
8
  </h5>
9
9
  <div class="psui-el-card-infos-content">
10
10
  <span class="psui-el-card-infos-icon material-icons-round">{{ icon }}</span>
11
- <h5 class="psui-text-gray-80">{{ total }}</h5>
11
+ <h5 class="psui-text-gray-80">
12
+ {{ total }}
13
+ </h5>
12
14
  </div>
13
15
  </div>
14
16
  </template>