hp-design-system 1.0.2 → 1.0.4
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/dist/hp-design-system.es.js +51 -39
- package/dist/types/index.d.ts +1 -0
- package/dist/types/views/tokens/Colors.stories.d.ts +6 -0
- package/dist/types/views/tokens/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/index.ts +6 -1
- package/src/views/tokens/Colors.stories.ts +39 -0
- package/src/views/tokens/index.ts +3 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import { computed as
|
2
|
-
const
|
1
|
+
import { computed as m, openBlock as a, createElementBlock as i, normalizeClass as h, normalizeStyle as d, createElementVNode as o, defineComponent as f, createVNode as g, createCommentVNode as k, toDisplayString as l, pushScopeId as S, popScopeId as P, createTextVNode as _ } from "vue";
|
2
|
+
const C = ["xlink:href"], b = {
|
3
3
|
__name: "Icon",
|
4
4
|
props: {
|
5
5
|
name: {
|
@@ -16,26 +16,26 @@ const _ = ["xlink:href"], f = {
|
|
16
16
|
}
|
17
17
|
},
|
18
18
|
setup(e) {
|
19
|
-
const n = e, t =
|
19
|
+
const n = e, t = m(() => ({
|
20
20
|
sm: "icon-small",
|
21
21
|
md: "icon-medium",
|
22
22
|
lg: "icon-large"
|
23
23
|
})[n.size] || "icon-medium");
|
24
|
-
return (
|
25
|
-
class:
|
24
|
+
return (c, r) => (a(), i("svg", {
|
25
|
+
class: h(["icon", t.value]),
|
26
26
|
xmlns: "http://www.w3.org/2000/svg",
|
27
27
|
"aria-hidden": "true",
|
28
28
|
style: d({ fill: e.color })
|
29
29
|
}, [
|
30
30
|
o("use", {
|
31
31
|
"xlink:href": `#icon-${e.name}`
|
32
|
-
}, null, 8,
|
32
|
+
}, null, 8, C)
|
33
33
|
], 6));
|
34
34
|
}
|
35
|
-
},
|
35
|
+
}, x = ["aria-label", "aria-disabled"], O = {
|
36
36
|
key: 0,
|
37
37
|
class: "button-icon"
|
38
|
-
},
|
38
|
+
}, v = { class: "button-label" }, I = /* @__PURE__ */ f({
|
39
39
|
__name: "Button",
|
40
40
|
props: {
|
41
41
|
label: {
|
@@ -73,26 +73,26 @@ const _ = ["xlink:href"], f = {
|
|
73
73
|
},
|
74
74
|
emits: ["click"],
|
75
75
|
setup(e, { emit: n }) {
|
76
|
-
const t = e,
|
77
|
-
t.disabled ||
|
76
|
+
const t = e, c = n, r = (u) => {
|
77
|
+
t.disabled || c("click", u);
|
78
78
|
};
|
79
|
-
return (u,
|
79
|
+
return (u, V) => (a(), i("button", {
|
80
80
|
class: "button",
|
81
81
|
"aria-label": e.ariaLabel || e.label,
|
82
82
|
onClick: r,
|
83
83
|
"aria-disabled": e.disabled
|
84
84
|
}, [
|
85
|
-
e.icon ? (
|
86
|
-
|
85
|
+
e.icon ? (a(), i("span", O, [
|
86
|
+
g(b, {
|
87
87
|
name: e.icon,
|
88
88
|
size: "sm",
|
89
89
|
color: "white"
|
90
90
|
}, null, 8, ["name"])
|
91
91
|
])) : k("", !0),
|
92
|
-
o("span",
|
93
|
-
], 8,
|
92
|
+
o("span", v, l(e.label), 1)
|
93
|
+
], 8, x));
|
94
94
|
}
|
95
|
-
}),
|
95
|
+
}), j = (e) => (S("data-v-7d29c03a"), e = e(), P(), e), w = ["checked"], z = /* @__PURE__ */ j(() => /* @__PURE__ */ o("label", {
|
96
96
|
class: "check",
|
97
97
|
for: "check"
|
98
98
|
}, [
|
@@ -105,7 +105,7 @@ const _ = ["xlink:href"], f = {
|
|
105
105
|
/* @__PURE__ */ o("polyline", { points: "1 5 4 8 11 1" })
|
106
106
|
])
|
107
107
|
])
|
108
|
-
], -1)),
|
108
|
+
], -1)), B = { class: "checkbox-label" }, H = /* @__PURE__ */ f({
|
109
109
|
__name: "Checkbox",
|
110
110
|
props: {
|
111
111
|
checked: {
|
@@ -130,7 +130,7 @@ const _ = ["xlink:href"], f = {
|
|
130
130
|
}
|
131
131
|
},
|
132
132
|
setup(e) {
|
133
|
-
return (n, t) => (
|
133
|
+
return (n, t) => (a(), i("div", {
|
134
134
|
class: "checkbox",
|
135
135
|
style: d({
|
136
136
|
"--background-color": e.backgroundColor || "#8f44fd",
|
@@ -145,16 +145,16 @@ const _ = ["xlink:href"], f = {
|
|
145
145
|
type: "checkbox",
|
146
146
|
style: { display: "none" }
|
147
147
|
}, null, 8, w),
|
148
|
-
|
149
|
-
o("span",
|
148
|
+
z,
|
149
|
+
o("span", B, l(e.label), 1)
|
150
150
|
], 4));
|
151
151
|
}
|
152
|
-
}),
|
152
|
+
}), y = (e, n) => {
|
153
153
|
const t = e.__vccOpts || e;
|
154
|
-
for (const [
|
155
|
-
t[
|
154
|
+
for (const [c, r] of n)
|
155
|
+
t[c] = r;
|
156
156
|
return t;
|
157
|
-
},
|
157
|
+
}, N = /* @__PURE__ */ y(H, [["__scopeId", "data-v-7d29c03a"]]), q = {
|
158
158
|
name: "Teste",
|
159
159
|
props: {
|
160
160
|
textProp: {
|
@@ -219,8 +219,8 @@ const _ = ["xlink:href"], f = {
|
|
219
219
|
}
|
220
220
|
}
|
221
221
|
};
|
222
|
-
function
|
223
|
-
return
|
222
|
+
function T(e, n, t, c, r, u) {
|
223
|
+
return a(), i("div", null, [
|
224
224
|
o("h1", null, l(t.textProp), 1),
|
225
225
|
o("p", null, "Boolean: " + l(t.booleanProp), 1),
|
226
226
|
o("p", null, "Number: " + l(t.numberProp), 1),
|
@@ -234,7 +234,7 @@ function q(e, n, t, a, r, u) {
|
|
234
234
|
o("p", null, "Object: " + l(t.objectProp), 1),
|
235
235
|
o("p", null, "Array: " + l(t.arrayProp), 1),
|
236
236
|
o("p", null, [
|
237
|
-
|
237
|
+
_(" Color: "),
|
238
238
|
o("span", {
|
239
239
|
style: d({ backgroundColor: t.colorProp })
|
240
240
|
}, l(t.colorProp), 5)
|
@@ -243,23 +243,35 @@ function q(e, n, t, a, r, u) {
|
|
243
243
|
o("p", null, "File: " + l(t.fileProp ? t.fileProp.name : "No file selected"), 1)
|
244
244
|
]);
|
245
245
|
}
|
246
|
-
const
|
246
|
+
const A = /* @__PURE__ */ y(q, [["render", T], ["__scopeId", "data-v-65be170a"]]), s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
247
247
|
__proto__: null,
|
248
|
-
HpButton:
|
249
|
-
HpCheckbox:
|
250
|
-
HpIcon:
|
251
|
-
HpTeste:
|
248
|
+
HpButton: I,
|
249
|
+
HpCheckbox: N,
|
250
|
+
HpIcon: b,
|
251
|
+
HpTeste: A
|
252
|
+
}, Symbol.toStringTag, { value: "Module" })), R = {
|
253
|
+
primary: "#3498db",
|
254
|
+
secondary: "#2ecc71",
|
255
|
+
error: "#e74c3c",
|
256
|
+
warning: "#f39c12",
|
257
|
+
success: "#2ecc71"
|
258
|
+
}, p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
259
|
+
__proto__: null,
|
260
|
+
colors: R
|
252
261
|
}, Symbol.toStringTag, { value: "Module" }));
|
253
|
-
function
|
262
|
+
function E(e) {
|
254
263
|
Object.keys(s).forEach((n) => {
|
255
264
|
e.component(n, s[n]);
|
265
|
+
}), Object.keys(p).forEach((n) => {
|
266
|
+
e.component(n, p[n]);
|
256
267
|
});
|
257
268
|
}
|
258
|
-
const
|
269
|
+
const M = { install: E };
|
259
270
|
export {
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
271
|
+
I as HpButton,
|
272
|
+
N as HpCheckbox,
|
273
|
+
b as HpIcon,
|
274
|
+
A as HpTeste,
|
275
|
+
R as colors,
|
276
|
+
M as default
|
265
277
|
};
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
import { App } from 'vue'
|
2
2
|
import * as components from './components'
|
3
|
+
import * as tokens from './views/tokens'
|
3
4
|
|
4
|
-
function install
|
5
|
+
function install(app: App) {
|
5
6
|
Object.keys(components).forEach((key) => {
|
6
7
|
app.component(key, components[key as keyof typeof components])
|
7
8
|
})
|
9
|
+
Object.keys(tokens).forEach((key) => {
|
10
|
+
app.component(key, tokens[key as keyof typeof tokens])
|
11
|
+
})
|
8
12
|
}
|
9
13
|
|
10
14
|
// import '../assets/main.scss';
|
@@ -12,3 +16,4 @@ function install (app: App) {
|
|
12
16
|
export default { install }
|
13
17
|
|
14
18
|
export * from './components'
|
19
|
+
export * from './views/tokens'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3'
|
2
|
+
import HpColors from './Colors.vue'
|
3
|
+
|
4
|
+
const meta: Meta = {
|
5
|
+
title: 'Componentes/Colors',
|
6
|
+
component: HpColors,
|
7
|
+
argTypes: {
|
8
|
+
label: {
|
9
|
+
control: {
|
10
|
+
type: 'text'
|
11
|
+
},
|
12
|
+
table: {
|
13
|
+
category: 'Propriedades',
|
14
|
+
type: {
|
15
|
+
summary: 'string',
|
16
|
+
detail: 'Tipo de texto'
|
17
|
+
},
|
18
|
+
defaultValue: { summary: 'Label padrão' }
|
19
|
+
},
|
20
|
+
description: 'Texto do botão'
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
export default meta
|
26
|
+
|
27
|
+
const Template: StoryFn<{ label: string }> = (args) => ({
|
28
|
+
// Define explicitamente o tipo de args
|
29
|
+
components: { HpColors },
|
30
|
+
setup() {
|
31
|
+
return { args }
|
32
|
+
},
|
33
|
+
template: '<HpColors :label="args.label" />'
|
34
|
+
})
|
35
|
+
|
36
|
+
export const Example = Template.bind({})
|
37
|
+
Example.args = {
|
38
|
+
label: 'Label'
|
39
|
+
}
|