@eturnity/eturnity_reusable_components 7.33.2 → 7.33.4-EPDM-11766.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 (42) hide show
  1. package/package.json +30 -33
  2. package/src/Test.vue +10 -0
  3. package/src/components/buttons/closeButton/CloseButton.stories.js +16 -19
  4. package/src/components/buttons/closeButton/index.vue +1 -0
  5. package/src/components/icon/index.vue +1 -1
  6. package/src/components/inputs/toggle/toggle.spec.js +1 -1
  7. package/src/components/modals/modal/modal.stories.js +4 -4
  8. package/src/stories/Button.stories.js +48 -0
  9. package/src/stories/Button.vue +52 -0
  10. package/src/stories/Configure.mdx +364 -0
  11. package/src/stories/Header.stories.js +41 -0
  12. package/src/stories/Header.vue +59 -0
  13. package/src/stories/Page.stories.js +30 -0
  14. package/src/stories/Page.vue +83 -0
  15. package/src/stories/assets/accessibility.png +0 -0
  16. package/src/stories/assets/accessibility.svg +1 -0
  17. package/src/stories/assets/addon-library.png +0 -0
  18. package/src/stories/assets/assets.png +0 -0
  19. package/src/stories/assets/avif-test-image.avif +0 -0
  20. package/src/stories/assets/context.png +0 -0
  21. package/src/stories/assets/discord.svg +1 -0
  22. package/src/stories/assets/docs.png +0 -0
  23. package/src/stories/assets/figma-plugin.png +0 -0
  24. package/src/stories/assets/github.svg +1 -0
  25. package/src/stories/assets/share.png +0 -0
  26. package/src/stories/assets/styling.png +0 -0
  27. package/src/stories/assets/testing.png +0 -0
  28. package/src/stories/assets/theming.png +0 -0
  29. package/src/stories/assets/tutorials.svg +1 -0
  30. package/src/stories/assets/youtube.svg +1 -0
  31. package/src/stories/button.css +30 -0
  32. package/src/stories/header.css +32 -0
  33. package/src/stories/page.css +69 -0
  34. package/.eslintrc.js +0 -186
  35. package/.prettierrc +0 -9
  36. package/.storybook/main.js +0 -8
  37. package/.storybook/preview.js +0 -46
  38. package/babel.config.js +0 -7
  39. package/jest.config.js +0 -19
  40. package/postcss.config.js +0 -6
  41. package/src/components/banner/banner/banner.stories.js +0 -31
  42. /package/src/components/icon/{iconCache.js → iconCache.mjs} +0 -0
package/package.json CHANGED
@@ -1,27 +1,36 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.33.2",
3
+ "version": "7.33.4-EPDM-11766.0",
4
+ "files": [
5
+ "dist",
6
+ "src"
7
+ ],
8
+ "main": "./dist/main.umd.js",
9
+ "module": "./dist/main.es.js",
4
10
  "private": false,
5
11
  "scripts": {
6
- "dev": "vue-cli-service serve",
7
- "build": "vue-cli-service build",
12
+ "dev": "vite",
13
+ "build": "vite build",
8
14
  "lint": "vue-cli-service lint",
9
- "storybook": "start-storybook -p 6006",
10
- "build-storybook": "build-storybook",
15
+ "storybook": "storybook dev -p 6006",
16
+ "build-storybook": "storybook build",
11
17
  "prettier": "prettier --write 'src/**/*.{js,vue}'",
12
18
  "test": "jest",
19
+ "test-coverage": "jest --coverage",
13
20
  "prepublishOnly": "npm run test"
14
21
  },
15
22
  "dependencies": {
16
- "@storybook/vue3": "7.0.18",
23
+ "@originjs/vite-plugin-commonjs": "1.0.3",
24
+ "@storybook/vue3": "8.2.8",
17
25
  "@vue/compat": "3.3.4",
18
26
  "@vueform/slider": "2.1.10",
19
27
  "@vuepic/vue-datepicker": "6.1.0",
20
28
  "click-outside-vue3": "4.0.1",
21
29
  "html-loader": "0.5.5",
22
30
  "postcss": "8.4.25",
31
+ "vite-plugin-require": "1.1.14",
23
32
  "vue": "3.3.4",
24
- "vue-router": "^4.4.2",
33
+ "vue-router": "4.2.2",
25
34
  "vue3-styled-components": "1.2.1",
26
35
  "vuedraggable": "4.1.0"
27
36
  },
@@ -29,7 +38,16 @@
29
38
  "@babel/core": "^7.25.2",
30
39
  "@babel/plugin-syntax-import-meta": "^7.10.4",
31
40
  "@babel/preset-env": "^7.25.3",
41
+ "@chromatic-com/storybook": "^1.6.1",
42
+ "@storybook/addon-essentials": "^8.2.8",
43
+ "@storybook/addon-interactions": "^8.2.8",
44
+ "@storybook/addon-links": "^8.2.8",
45
+ "@storybook/addon-onboarding": "^8.2.8",
46
+ "@storybook/blocks": "^8.2.8",
47
+ "@storybook/test": "^8.2.8",
48
+ "@storybook/testing-library": "^0.2.1",
32
49
  "@types/node": "^22.1.0",
50
+ "@vitejs/plugin-vue": "2.0.1",
33
51
  "@vue/cli-plugin-babel": "^5.0.8",
34
52
  "@vue/cli-plugin-eslint": "5.0.8",
35
53
  "@vue/cli-service": "^5.0.8",
@@ -40,34 +58,14 @@
40
58
  "eslint": "8.0.1",
41
59
  "eslint-config-prettier": "8.8.0",
42
60
  "eslint-plugin-prettier": "4.2.1",
61
+ "eslint-plugin-storybook": "^0.8.0",
43
62
  "eslint-plugin-vue": "9.14.1",
44
63
  "jest": "^26.6.3",
45
64
  "prettier": "2.8.4",
46
- "vue-jest": "^5.0.0-alpha.10"
47
- },
48
- "jest": {
49
- "preset": "@vue/cli-plugin-unit-jest",
50
- "transform": {
51
- "^.+\\.vue$": "vue-jest",
52
- "^.+\\.js$": "babel-jest"
53
- },
54
- "moduleFileExtensions": [
55
- "js",
56
- "json",
57
- "vue"
58
- ],
59
- "transformIgnorePatterns": [
60
- "<rootDir>/node_modules/"
61
- ],
62
- "testMatch": [
63
- "**/tests/unit/**/*.spec.js"
64
- ],
65
- "collectCoverageFrom": [
66
- "src/**/*.{js,vue}",
67
- "!src/main.js",
68
- "!src/router/index.js",
69
- "!**/node_modules/**"
70
- ]
65
+ "storybook": "^8.2.8",
66
+ "vite": "2.7.2",
67
+ "vue-jest": "^5.0.0-alpha.10",
68
+ "vue-loader": "^17.4.2"
71
69
  },
72
70
  "browserslist": [
73
71
  "> 1%",
@@ -75,7 +73,6 @@
75
73
  "not dead"
76
74
  ],
77
75
  "description": "## Project setup ``` npm install ```",
78
- "main": "babel.config.js",
79
76
  "repository": {
80
77
  "type": "git",
81
78
  "url": "git+https://aaronenser@bitbucket.org/eturnitydevs/eturnity_reusable_components.git"
package/src/Test.vue CHANGED
@@ -1,5 +1,13 @@
1
1
  <template>
2
2
  <PageContainer>
3
+ <ToggleComponent
4
+ :disabled="false"
5
+ info-text-message="My info message"
6
+ :is-checked="true"
7
+ label="My Label Text"
8
+ label-align="right"
9
+ toggle-color="red"
10
+ />
3
11
  <br />
4
12
  <InputNumber
5
13
  background-color="transparent"
@@ -55,6 +63,7 @@
55
63
  <script>
56
64
  import styled from 'vue3-styled-components'
57
65
  import InputNumber from '@/components/inputs/inputNumber'
66
+ import ToggleComponent from '@/components/inputs/toggle'
58
67
 
59
68
  const PageContainer = styled.div`
60
69
  padding: 40px;
@@ -65,6 +74,7 @@
65
74
  components: {
66
75
  PageContainer,
67
76
  InputNumber,
77
+ ToggleComponent,
68
78
  },
69
79
  data() {
70
80
  return {
@@ -3,27 +3,24 @@ import CloseButton from './index.vue'
3
3
  export default {
4
4
  title: 'CloseButton',
5
5
  component: CloseButton,
6
- // argTypes: {},
6
+ tags: ['autodocs'],
7
7
  }
8
8
 
9
- const Template = (args, { argTypes }) => ({
10
- // Components used in your story `template` are defined in the `components` object
11
- components: { CloseButton },
12
- // The story's `args` need to be mapped into the template through the `setup()` method
13
- props: Object.keys(argTypes),
14
- template: '<close-button v-bind="$props" />',
9
+ // // To use:
10
+ // // import CloseButton from "@eturnity/eturnity_reusable_components/src/components/buttons/closeButton"
11
+ // // <close-button
12
+ // // color="#fff"
13
+ // // />
14
+ // })
15
15
 
16
- // To use:
17
- // import CloseButton from "@eturnity/eturnity_reusable_components/src/components/buttons/closeButton"
18
- // <close-button
19
- // color="#fff"
20
- // />
21
- })
22
-
23
- export const Default = Template.bind({})
24
- Default.args = {}
16
+ export const Default = {
17
+ args: {
18
+ color: 'red',
19
+ },
20
+ }
25
21
 
26
- export const ColorButton = Template.bind({})
27
- ColorButton.args = {
28
- color: 'orange',
22
+ export const ColorButton = {
23
+ args: {
24
+ color: 'blue',
25
+ },
29
26
  }
@@ -55,6 +55,7 @@
55
55
  props: {
56
56
  color: {
57
57
  required: false,
58
+ default: '',
58
59
  },
59
60
  },
60
61
  }
@@ -26,7 +26,7 @@
26
26
 
27
27
  import { onMounted, reactive, watch } from 'vue'
28
28
  import styled from 'vue3-styled-components'
29
- import { fetchIcon } from './iconCache'
29
+ import { fetchIcon } from './iconCache.mjs'
30
30
 
31
31
  const props = defineProps({
32
32
  disabled: {
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'
3
3
  import RCToggle from '@/components/inputs/toggle'
4
4
  import theme from '@/assets/theme'
5
5
 
6
- jest.mock('@/components/icon/iconCache', () => ({
6
+ jest.mock('@/components/icon/iconCache.mjs', () => ({
7
7
  // need to mock this due to how jest handles import.meta
8
8
  fetchIcon: jest.fn(() => Promise.resolve('mocked-icon-url.svg')),
9
9
  }))
@@ -1,7 +1,7 @@
1
1
  import Modal from './index.vue'
2
2
 
3
3
  export default {
4
- title: 'Modal',
4
+ title: 'Components/Modal',
5
5
  component: Modal,
6
6
  // argTypes: {},
7
7
  }
@@ -21,11 +21,11 @@ const Template = (args, { argTypes }) => ({
21
21
  // </modal>
22
22
  })
23
23
 
24
- export const Default = Template.bind({
24
+ export const Default = Template.bind({})
25
+ Default.args = {
25
26
  isOpen: true,
26
27
  preventOutsideClose: true,
27
28
  isLoading: false,
28
29
  hideClose: false,
29
30
  backdrop: 'dark',
30
- })
31
- Default.args = {}
31
+ }
@@ -0,0 +1,48 @@
1
+ import MyButton from './Button.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/Button',
6
+ component: MyButton,
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ backgroundColor: {
10
+ control: 'color',
11
+ },
12
+ onClick: {},
13
+ size: {
14
+ control: {
15
+ type: 'select',
16
+ },
17
+ options: ['small', 'medium', 'large'],
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
+ primary: true,
26
+ label: 'Button',
27
+ },
28
+ };
29
+
30
+ export const Secondary = {
31
+ args: {
32
+ label: 'Button',
33
+ },
34
+ };
35
+
36
+ export const Large = {
37
+ args: {
38
+ size: 'large',
39
+ label: 'Button',
40
+ },
41
+ };
42
+
43
+ export const Small = {
44
+ args: {
45
+ size: 'small',
46
+ label: 'Button',
47
+ },
48
+ };
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
3
+ </template>
4
+
5
+ <script>
6
+ import './button.css';
7
+ import { reactive, computed } from 'vue';
8
+
9
+ export default {
10
+ name: 'my-button',
11
+
12
+ props: {
13
+ label: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ primary: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ size: {
22
+ type: String,
23
+ validator: function (value) {
24
+ return ['small', 'medium', 'large'].indexOf(value) !== -1;
25
+ },
26
+ },
27
+ backgroundColor: {
28
+ type: String,
29
+ },
30
+ },
31
+
32
+ emits: ['click'],
33
+
34
+ setup(props, { emit }) {
35
+ props = reactive(props);
36
+ return {
37
+ classes: computed(() => ({
38
+ 'storybook-button': true,
39
+ 'storybook-button--primary': props.primary,
40
+ 'storybook-button--secondary': !props.primary,
41
+ [`storybook-button--${props.size || 'medium'}`]: true,
42
+ })),
43
+ style: computed(() => ({
44
+ backgroundColor: props.backgroundColor,
45
+ })),
46
+ onClick() {
47
+ emit('click');
48
+ },
49
+ };
50
+ },
51
+ };
52
+ </script>