hp-design-system 0.0.16 → 1.0.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.
@@ -1,26 +1,23 @@
1
- import { defineComponent as o, openBlock as r, createElementBlock as c, Fragment as l, createTextVNode as u, createElementVNode as a, toDisplayString as p } from "vue";
2
- const i = /* @__PURE__ */ o({
1
+ import { defineComponent as o, openBlock as r, createElementBlock as c, toDisplayString as p } from "vue";
2
+ const u = /* @__PURE__ */ o({
3
3
  __name: "Button",
4
4
  props: {
5
5
  text: { type: String, required: !0 }
6
6
  },
7
7
  setup(t) {
8
- return (e, m) => (r(), c(l, null, [
9
- u(" TESTE "),
10
- a("button", null, p(t.text), 1)
11
- ], 64));
8
+ return (e, a) => (r(), c("button", null, p(t.text), 1));
12
9
  }
13
10
  }), n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14
11
  __proto__: null,
15
- HpButton: i
12
+ HpButton: u
16
13
  }, Symbol.toStringTag, { value: "Module" }));
17
- function s(t) {
14
+ function l(t) {
18
15
  Object.keys(n).forEach((e) => {
19
16
  t.component(e, n[e]);
20
17
  });
21
18
  }
22
- const d = { install: s };
19
+ const s = { install: l };
23
20
  export {
24
- i as HpButton,
25
- d as default
21
+ u as HpButton,
22
+ s as default
26
23
  };
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryFn } from "@storybook/vue3";
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const Example: StoryFn<{
5
+ text: string;
6
+ }>;
@@ -1,2 +1,2 @@
1
- import HpButton from './Button.vue';
2
- export { HpButton, };
1
+ import HpButton from './button/Button.vue';
2
+ export { HpButton };
package/package.json CHANGED
@@ -1,24 +1,58 @@
1
1
  {
2
2
  "name": "hp-design-system",
3
- "version": "0.0.16",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/hp-design-system.umd.js",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "clean:cache": "rmdir /s /q node_modules\\.vite",
9
9
  "build": "rimraf dist && vue-tsc && vite build",
10
- "preview": "vite preview"
10
+ "preview": "vite preview",
11
+ "storybook": "storybook dev -p 6006",
12
+ "build-storybook": "storybook build",
13
+ "lint": "eslint src/**/*.{js,vue,ts} --fix",
14
+ "lint:fix": "eslint src/**/*.{js,vue,ts} --fix",
15
+ "commitlint": "commitlint --config commitlinterrc.json"
11
16
  },
12
17
  "dependencies": {
13
18
  "@vitejs/plugin-vue": "^5.0.5",
14
19
  "vue": "^3.4.29"
15
20
  },
21
+ "lint-staged": {
22
+ "*.{js,vue,ts}": "npm run lint"
23
+ },
24
+ "husky": {
25
+ "hooks": {
26
+ "commit-msg": "npm run commitlint"
27
+ }
28
+ },
16
29
  "devDependencies": {
30
+ "@chromatic-com/storybook": "^1.5.0",
31
+ "@commitlint/cli": "^19.3.0",
32
+ "@commitlint/config-conventional": "^19.2.2",
33
+ "@commitlint/types": "^19.0.3",
34
+ "@storybook/addon-essentials": "^8.1.10",
35
+ "@storybook/addon-interactions": "^8.1.10",
36
+ "@storybook/addon-links": "^8.1.10",
37
+ "@storybook/blocks": "^8.1.10",
38
+ "@storybook/test": "^8.1.10",
39
+ "@storybook/vue3": "^8.1.10",
40
+ "@storybook/vue3-vite": "^8.1.10",
41
+ "@types/eslint": "^8.56.10",
17
42
  "@types/node": "^20.14.8",
18
43
  "@types/vue": "^2.0.0",
19
44
  "@vue/runtime-dom": "^3.4.30",
45
+ "eslint-config-prettier": "^8.3.0",
46
+ "eslint-plugin-prettier": "^4.0.0",
47
+ "git-commit-msg-linter": "^2.7.0",
48
+ "hp-eslint-vue3": "^1.0.2",
49
+ "husky": "^7.0.4",
50
+ "lint-staged": "^15.2.7",
51
+ "prettier": "^3.3.2",
52
+ "pretty-quick": "^4.0.0",
20
53
  "rimraf": "^5.0.1",
21
54
  "sass": "^1.63.6",
55
+ "storybook": "^8.1.10",
22
56
  "typescript": "^5.5.2",
23
57
  "vite": "^5.3.1",
24
58
  "vue-tsc": "^2.0.21"
package/src/App.vue CHANGED
@@ -1,12 +1,9 @@
1
1
  <template>
2
2
  <div>
3
- OIEe
4
- <HpButton :text="'Clique Aqui'"></HpButton>
3
+ <HpButton text="Clique Aqui"></HpButton>
5
4
  </div>
6
5
  </template>
7
6
 
8
7
  <script setup lang="ts">
9
- import { HpButton } from './components/index';
10
-
8
+ import { HpButton } from './components/index'
11
9
  </script>
12
-
@@ -0,0 +1,40 @@
1
+ // src/components/Button/Button.stories.ts
2
+ import type { Meta, StoryFn } from "@storybook/vue3"; // Importa StoryFn em vez de Story
3
+ import HpButton from "./Button.vue";
4
+
5
+ const meta: Meta = {
6
+ title: "Componentes/Button",
7
+ component: HpButton,
8
+ argTypes: {
9
+ text: {
10
+ control: {
11
+ type: "text",
12
+ },
13
+ table: {
14
+ category: "Propriedades",
15
+ type: {
16
+ summary: "string",
17
+ detail: "Tipo de texto",
18
+ },
19
+ defaultValue: { summary: "Label padrão" },
20
+ },
21
+ description: "Texto do botão",
22
+ },
23
+ },
24
+ };
25
+
26
+ export default meta;
27
+
28
+ const Template: StoryFn<{ text: string }> = (args) => ({
29
+ // Define explicitamente o tipo de args
30
+ components: { HpButton },
31
+ setup() {
32
+ return { args };
33
+ },
34
+ template: '<HpButton :text="args.text" />',
35
+ });
36
+
37
+ export const Example = Template.bind({});
38
+ Example.args = {
39
+ text: "Label",
40
+ };
@@ -1,12 +1,11 @@
1
- <template>
2
- TESTE
3
- <button>{{ text }}</button>
4
- </template>
5
-
6
- <script setup lang="ts">
7
- import { defineProps } from 'vue';
8
-
9
- const props = defineProps({
10
- text: { type: String, required: true }
11
- });
12
- </script>
1
+ <template>
2
+ <button>{{ text }}</button>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { defineProps } from 'vue'
7
+
8
+ defineProps({
9
+ text: { type: String, required: true }
10
+ })
11
+ </script>
@@ -1,5 +1,3 @@
1
- import HpButton from './Button.vue'
1
+ import HpButton from './button/Button.vue'
2
2
 
3
- export {
4
- HpButton,
5
- }
3
+ export { HpButton }
package/src/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { App } from 'vue';
2
- import * as components from './components';
3
-
4
- function install(app: App) {
5
- Object.keys(components).forEach(key => {
6
- app.component(key, components[key as keyof typeof components]);
7
- });
8
- }
9
-
10
- // import '../assets/main.scss';
11
-
12
- export default { install };
13
-
14
- export * from './components';
1
+ import { App } from 'vue'
2
+ import * as components from './components'
3
+
4
+ function install (app: App) {
5
+ Object.keys(components).forEach((key) => {
6
+ app.component(key, components[key as keyof typeof components])
7
+ })
8
+ }
9
+
10
+ // import '../assets/main.scss';
11
+
12
+ export default { install }
13
+
14
+ export * from './components'
package/src/main.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { createApp } from 'vue';
1
+ import { createApp } from 'vue'
2
2
  import './style.css'
3
3
  import App from './App.vue'
4
4
 
5
- const app = createApp(App);
6
- app.mount('#app');
5
+ const app = createApp(App)
6
+ app.mount('#app')