@topjoao/top-design-system 0.1.0-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.
- package/README.md +71 -0
- package/dist/components/TopButton.vue.d.ts +40 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +2 -0
- package/dist/tokens/colors.d.ts +67 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# TopSolutions Design System
|
|
2
|
+
|
|
3
|
+
Biblioteca compartilhada de componentes Vue 3, tokens visuais e estilos da
|
|
4
|
+
TopSolutions.
|
|
5
|
+
|
|
6
|
+
## Desenvolvimento
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install
|
|
10
|
+
npm run check
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Consumo local
|
|
14
|
+
|
|
15
|
+
Gere e inspecione o pacote:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm pack --dry-run
|
|
19
|
+
npm pack
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Instale o arquivo `.tgz` gerado em uma aplicação Vue e importe o componente e
|
|
23
|
+
os estilos:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { TopButton } from '@topjoao/top-design-system'
|
|
27
|
+
import '@topjoao/top-design-system/style.css'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Esta versão experimental é publicada no escopo pessoal `@topjoao` com a tag
|
|
31
|
+
`beta`. O nome definitivo da organização será definido posteriormente.
|
|
32
|
+
|
|
33
|
+
## TopButton
|
|
34
|
+
|
|
35
|
+
O `TopButton` preserva a API do `CustomButton` do TopSolutions Licitação:
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { TopButton } from '@topjoao/top-design-system'
|
|
40
|
+
import '@topjoao/top-design-system/style.css'
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<TopButton label="Salvar" icon="pi pi-save" @click="salvar" />
|
|
45
|
+
|
|
46
|
+
<TopButton label="Cancelar" secondary />
|
|
47
|
+
|
|
48
|
+
<TopButton label="Consultar" outlined>
|
|
49
|
+
<template #icon>
|
|
50
|
+
<i class="pi pi-search" />
|
|
51
|
+
</template>
|
|
52
|
+
</TopButton>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Props disponíveis:
|
|
57
|
+
|
|
58
|
+
| Prop | Tipo | Padrão |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| `tooltip` | `string` | `''` |
|
|
61
|
+
| `label` | `string` | `''` |
|
|
62
|
+
| `icon` | `string` | `''` |
|
|
63
|
+
| `loading` | `boolean` | `false` |
|
|
64
|
+
| `class` | `string` | `''` |
|
|
65
|
+
| `outlined` | `boolean` | `false` |
|
|
66
|
+
| `secondary` | `boolean` | `false` |
|
|
67
|
+
| `disabled` | `boolean` | `false` |
|
|
68
|
+
| `unstyled` | `boolean` | `false` |
|
|
69
|
+
| `type` | `'button' | 'submit' | 'reset'` | `'button'` |
|
|
70
|
+
|
|
71
|
+
O componente emite `click` sem payload e oferece o slot nomeado `icon`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
tooltip?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
outlined?: boolean;
|
|
8
|
+
secondary?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
unstyled?: boolean;
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
};
|
|
13
|
+
declare var __VLS_10: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
icon?: (props: typeof __VLS_10) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
click: () => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onClick?: (() => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
icon: string;
|
|
23
|
+
tooltip: string;
|
|
24
|
+
label: string;
|
|
25
|
+
loading: boolean;
|
|
26
|
+
class: string;
|
|
27
|
+
outlined: boolean;
|
|
28
|
+
secondary: boolean;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
unstyled: boolean;
|
|
31
|
+
type: "button" | "submit" | "reset";
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("vue"),l=require("primevue/button");l=s(l,1);let u=require("primevue/tooltip");u=s(u,1);let d=require("tailwind-merge");var f={class:`h-fit w-fit rounded-[12px] bg-transparent`},p=(0,c.defineComponent)({__name:`TopButton`,props:{tooltip:{default:``},label:{default:``},icon:{default:``},loading:{type:Boolean,default:!1},class:{default:``},outlined:{type:Boolean,default:!1},secondary:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1},type:{default:`button`}},emits:[`click`],setup(e,{emit:t}){let n=(0,c.useSlots)(),r=(0,c.computed)(()=>!!n.icon),i=e,a=t,o=(0,c.computed)(()=>{let e=i.unstyled?``:i.secondary?`rounded-[10px] border px-2 py-2 font-bold`:i.outlined?`shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50`:`rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 `;return(0,d.twMerge)(e,i.class)});return(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`span`,f,[(0,c.withDirectives)(((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(l.default),{type:e.type,label:e.label,disabled:e.disabled||e.loading,icon:r.value?void 0:e.icon||void 0,loading:e.loading,outlined:e.outlined||e.secondary,severity:e.secondary?`secondary`:void 0,class:(0,c.normalizeClass)(o.value),pt:{root:{class:o.value}},onClick:n[0]||=e=>a(`click`)},(0,c.createSlots)({_:2},[r.value?{name:`icon`,fn:(0,c.withCtx)(()=>[(0,c.renderSlot)(t.$slots,`icon`)]),key:`0`}:void 0]),1032,[`type`,`label`,`disabled`,`icon`,`loading`,`outlined`,`severity`,`class`,`pt`])),[[(0,c.unref)(u.default),e.tooltip,void 0,{top:!0}]])]))}}),m={primary:{50:`#EEF9FF`,100:`#DFF4FF`,200:`#C5E6F8`,300:`#8EC4DF`,400:`#66ACD1`,500:`#2488BC`,600:`#036DA3`,700:`#1B5783`,800:`#02466B`,900:`#052F4A`,950:`#0C192D`},secondary:{50:`#FAFAFA`,100:`#F4F4F5`,200:`#E9E9E9`,300:`#D8D8D8`,400:`#B8B8B8`,500:`#8E8E8E`,600:`#676767`,700:`#4B4B4B`,800:`#343434`,900:`#1C1917`,950:`#0C0A09`},success:{50:`#FAFFFA`,100:`#F4FBF6`,200:`#DFF6DE`,300:`#CBE3CA`,400:`#A3CCA1`,500:`#6BA968`,600:`#358F30`,700:`#2C7B27`,800:`#1E631A`,900:`#10430D`,950:`#062804`},warn:{50:`#FFF7ED`,100:`#FDF3D8`,200:`#FDE9B2`,300:`#FDD566`,400:`#FFB900`,500:`#FFA515`,600:`#FD9024`,700:`#DD781F`,800:`#BC4E00`,900:`#A42D02`,950:`#792202`},danger:{50:`#F8E6E4`,100:`#FFDDD9`,200:`#EEC1BC`,300:`#E3938C`,400:`#E3675C`,500:`#DC3F32`,600:`#CF150E`,700:`#B10404`,800:`#820907`,900:`#5D0803`,950:`#450501`}},h={install(e){e.component(`TopButton`,p)}};exports.TopButton=p,exports.TopSolutionsDesignSystem=h,exports.colors=m;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/components/TopButton.vue","../src/components/TopButton.vue","../src/tokens/colors.ts","../src/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport Button from 'primevue/button'\nimport vTooltip from 'primevue/tooltip'\nimport { twMerge } from 'tailwind-merge'\n\nconst slots = useSlots()\nconst outrosIcones = computed(() => Boolean(slots.icon))\n\nconst props = withDefaults(\n defineProps<{\n tooltip?: string\n label?: string\n icon?: string\n loading?: boolean\n class?: string\n outlined?: boolean\n secondary?: boolean\n disabled?: boolean\n unstyled?: boolean\n type?: 'button' | 'submit' | 'reset'\n }>(),\n {\n tooltip: '',\n label: '',\n icon: '',\n loading: false,\n class: '',\n outlined: false,\n secondary: false,\n disabled: false,\n unstyled: false,\n type: 'button',\n },\n)\n\nconst emit = defineEmits<{\n click: []\n}>()\n\nconst buttonClasses = computed(() => {\n const baseClasses = !props.unstyled\n ? props.secondary\n ? 'rounded-[10px] border px-2 py-2 font-bold'\n : props.outlined\n ? 'shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50'\n : 'rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 '\n : ''\n\n return twMerge(baseClasses, props.class)\n})\n</script>\n\n<template>\n <span class=\"h-fit w-fit rounded-[12px] bg-transparent\">\n <Button\n v-tooltip.top=\"tooltip\"\n :type=\"type\"\n :label=\"label\"\n :disabled=\"disabled || loading\"\n :icon=\"outrosIcones ? undefined : icon || undefined\"\n :loading=\"loading\"\n :outlined=\"outlined || secondary\"\n :severity=\"secondary ? 'secondary' : undefined\"\n :class=\"buttonClasses\"\n :pt=\"{\n root: { class: buttonClasses },\n }\"\n @click=\"emit('click')\"\n >\n <template v-if=\"outrosIcones\" #icon>\n <slot name=\"icon\" />\n </template>\n </Button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport Button from 'primevue/button'\nimport vTooltip from 'primevue/tooltip'\nimport { twMerge } from 'tailwind-merge'\n\nconst slots = useSlots()\nconst outrosIcones = computed(() => Boolean(slots.icon))\n\nconst props = withDefaults(\n defineProps<{\n tooltip?: string\n label?: string\n icon?: string\n loading?: boolean\n class?: string\n outlined?: boolean\n secondary?: boolean\n disabled?: boolean\n unstyled?: boolean\n type?: 'button' | 'submit' | 'reset'\n }>(),\n {\n tooltip: '',\n label: '',\n icon: '',\n loading: false,\n class: '',\n outlined: false,\n secondary: false,\n disabled: false,\n unstyled: false,\n type: 'button',\n },\n)\n\nconst emit = defineEmits<{\n click: []\n}>()\n\nconst buttonClasses = computed(() => {\n const baseClasses = !props.unstyled\n ? props.secondary\n ? 'rounded-[10px] border px-2 py-2 font-bold'\n : props.outlined\n ? 'shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50'\n : 'rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 '\n : ''\n\n return twMerge(baseClasses, props.class)\n})\n</script>\n\n<template>\n <span class=\"h-fit w-fit rounded-[12px] bg-transparent\">\n <Button\n v-tooltip.top=\"tooltip\"\n :type=\"type\"\n :label=\"label\"\n :disabled=\"disabled || loading\"\n :icon=\"outrosIcones ? undefined : icon || undefined\"\n :loading=\"loading\"\n :outlined=\"outlined || secondary\"\n :severity=\"secondary ? 'secondary' : undefined\"\n :class=\"buttonClasses\"\n :pt=\"{\n root: { class: buttonClasses },\n }\"\n @click=\"emit('click')\"\n >\n <template v-if=\"outrosIcones\" #icon>\n <slot name=\"icon\" />\n </template>\n </Button>\n </span>\n</template>\n","export const colors = {\n primary: {\n 50: '#EEF9FF',\n 100: '#DFF4FF',\n 200: '#C5E6F8',\n 300: '#8EC4DF',\n 400: '#66ACD1',\n 500: '#2488BC',\n 600: '#036DA3',\n 700: '#1B5783',\n 800: '#02466B',\n 900: '#052F4A',\n 950: '#0C192D',\n },\n secondary: {\n 50: '#FAFAFA',\n 100: '#F4F4F5',\n 200: '#E9E9E9',\n 300: '#D8D8D8',\n 400: '#B8B8B8',\n 500: '#8E8E8E',\n 600: '#676767',\n 700: '#4B4B4B',\n 800: '#343434',\n 900: '#1C1917',\n 950: '#0C0A09',\n },\n success: {\n 50: '#FAFFFA',\n 100: '#F4FBF6',\n 200: '#DFF6DE',\n 300: '#CBE3CA',\n 400: '#A3CCA1',\n 500: '#6BA968',\n 600: '#358F30',\n 700: '#2C7B27',\n 800: '#1E631A',\n 900: '#10430D',\n 950: '#062804',\n },\n warn: {\n 50: '#FFF7ED',\n 100: '#FDF3D8',\n 200: '#FDE9B2',\n 300: '#FDD566',\n 400: '#FFB900',\n 500: '#FFA515',\n 600: '#FD9024',\n 700: '#DD781F',\n 800: '#BC4E00',\n 900: '#A42D02',\n 950: '#792202',\n },\n danger: {\n 50: '#F8E6E4',\n 100: '#FFDDD9',\n 200: '#EEC1BC',\n 300: '#E3938C',\n 400: '#E3675C',\n 500: '#DC3F32',\n 600: '#CF150E',\n 700: '#B10404',\n 800: '#820907',\n 900: '#5D0803',\n 950: '#450501',\n },\n} as const\n","import type { App, Plugin } from 'vue'\nimport TopButton from './components/TopButton.vue'\nimport './styles/index.css'\n\nexport { TopButton }\nexport { colors } from './tokens/colors'\n\nexport const TopSolutionsDesignSystem: Plugin = {\n install(app: App) {\n app.component('TopButton', TopButton)\n },\n}\n"],"mappings":"imCAMA,IAAM,GAAA,EAAQ,EAAA,SAAA,CAAS,EACjB,GAAA,EAAe,EAAA,SAAA,KAAe,EAAQ,EAAM,IAAK,EAEjD,EAAQ,EA2BR,EAAO,EAIP,GAAA,EAAgB,EAAA,SAAA,KAAe,CACnC,IAAM,EAAe,EAAM,SAMvB,GALA,EAAM,UACJ,4CACA,EAAM,SACJ,4FACA,mIAGR,OAAA,EAAO,EAAA,QAAA,CAAQ,EAAa,EAAM,KAAK,CACzC,CAAC,iBAIC,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,mBAAA,CAoBO,OApBP,EAoBO,EAAA,EAnBL,EAAA,eAAA,GAAA,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,YAAA,EAAA,EAkBS,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAhBN,KAAM,EAAA,KACN,MAAO,EAAA,MACP,SAAU,EAAA,UAAY,EAAA,QACtB,KAAM,EAAA,MAAe,IAAA,GAAY,EAAA,MAAQ,IAAA,GACzC,QAAS,EAAA,QACT,SAAU,EAAA,UAAY,EAAA,UACtB,SAAU,EAAA,UAAS,YAAiB,IAAA,GACpC,OAAA,EAAK,EAAA,eAAA,CAAE,EAAA,KAAa,EACpB,GAAE,CAA2B,KAAA,CAAA,MAAA,EAAA,KAAa,CAAA,EAG1C,QAAK,AAAA,EAAA,KAAA,GAAE,EAAI,OAAA,CAEI,GAAA,EAAA,EAAA,YAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,CAAe,KAAA,OAC7B,IAAA,EAAA,EAAA,QAAA,KAAoB,EAAA,EAApB,EAAA,WAAA,CAAoB,EAAA,OAAA,MAAA,CAAA,CAAA,oIAfP,EAAA,eAAL,CAAA,IAAV,EAAuB,WExDhB,EAAS,CACpB,QAAS,CACP,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SACP,EACA,UAAW,CACT,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SACP,EACA,QAAS,CACP,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SACP,EACA,KAAM,CACJ,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SACP,EACA,OAAQ,CACN,GAAI,UACJ,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,SACP,CACF,EC3Da,EAAmC,CAC9C,QAAQ,EAAU,CAChB,EAAI,UAAU,YAAa,CAAS,CACtC,CACF"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createElementBlock as n, createSlots as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, unref as c, useSlots as l, withCtx as u, withDirectives as d } from "vue";
|
|
2
|
+
import f from "primevue/button";
|
|
3
|
+
import p from "primevue/tooltip";
|
|
4
|
+
import { twMerge as m } from "tailwind-merge";
|
|
5
|
+
//#region src/components/TopButton.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var h = { class: "h-fit w-fit rounded-[12px] bg-transparent" }, g = /* @__PURE__ */ i({
|
|
7
|
+
__name: "TopButton",
|
|
8
|
+
props: {
|
|
9
|
+
tooltip: { default: "" },
|
|
10
|
+
label: { default: "" },
|
|
11
|
+
icon: { default: "" },
|
|
12
|
+
loading: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
class: { default: "" },
|
|
17
|
+
outlined: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
secondary: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
unstyled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
type: { default: "button" }
|
|
34
|
+
},
|
|
35
|
+
emits: ["click"],
|
|
36
|
+
setup(i, { emit: g }) {
|
|
37
|
+
let _ = l(), v = e(() => !!_.icon), y = i, b = g, x = e(() => {
|
|
38
|
+
let e = y.unstyled ? "" : y.secondary ? "rounded-[10px] border px-2 py-2 font-bold" : y.outlined ? "shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50" : "rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 ";
|
|
39
|
+
return m(e, y.class);
|
|
40
|
+
});
|
|
41
|
+
return (e, l) => (o(), n("span", h, [d((o(), t(c(f), {
|
|
42
|
+
type: i.type,
|
|
43
|
+
label: i.label,
|
|
44
|
+
disabled: i.disabled || i.loading,
|
|
45
|
+
icon: v.value ? void 0 : i.icon || void 0,
|
|
46
|
+
loading: i.loading,
|
|
47
|
+
outlined: i.outlined || i.secondary,
|
|
48
|
+
severity: i.secondary ? "secondary" : void 0,
|
|
49
|
+
class: a(x.value),
|
|
50
|
+
pt: { root: { class: x.value } },
|
|
51
|
+
onClick: l[0] ||= (e) => b("click")
|
|
52
|
+
}, r({ _: 2 }, [v.value ? {
|
|
53
|
+
name: "icon",
|
|
54
|
+
fn: u(() => [s(e.$slots, "icon")]),
|
|
55
|
+
key: "0"
|
|
56
|
+
} : void 0]), 1032, [
|
|
57
|
+
"type",
|
|
58
|
+
"label",
|
|
59
|
+
"disabled",
|
|
60
|
+
"icon",
|
|
61
|
+
"loading",
|
|
62
|
+
"outlined",
|
|
63
|
+
"severity",
|
|
64
|
+
"class",
|
|
65
|
+
"pt"
|
|
66
|
+
])), [[
|
|
67
|
+
c(p),
|
|
68
|
+
i.tooltip,
|
|
69
|
+
void 0,
|
|
70
|
+
{ top: !0 }
|
|
71
|
+
]])]));
|
|
72
|
+
}
|
|
73
|
+
}), _ = {
|
|
74
|
+
primary: {
|
|
75
|
+
50: "#EEF9FF",
|
|
76
|
+
100: "#DFF4FF",
|
|
77
|
+
200: "#C5E6F8",
|
|
78
|
+
300: "#8EC4DF",
|
|
79
|
+
400: "#66ACD1",
|
|
80
|
+
500: "#2488BC",
|
|
81
|
+
600: "#036DA3",
|
|
82
|
+
700: "#1B5783",
|
|
83
|
+
800: "#02466B",
|
|
84
|
+
900: "#052F4A",
|
|
85
|
+
950: "#0C192D"
|
|
86
|
+
},
|
|
87
|
+
secondary: {
|
|
88
|
+
50: "#FAFAFA",
|
|
89
|
+
100: "#F4F4F5",
|
|
90
|
+
200: "#E9E9E9",
|
|
91
|
+
300: "#D8D8D8",
|
|
92
|
+
400: "#B8B8B8",
|
|
93
|
+
500: "#8E8E8E",
|
|
94
|
+
600: "#676767",
|
|
95
|
+
700: "#4B4B4B",
|
|
96
|
+
800: "#343434",
|
|
97
|
+
900: "#1C1917",
|
|
98
|
+
950: "#0C0A09"
|
|
99
|
+
},
|
|
100
|
+
success: {
|
|
101
|
+
50: "#FAFFFA",
|
|
102
|
+
100: "#F4FBF6",
|
|
103
|
+
200: "#DFF6DE",
|
|
104
|
+
300: "#CBE3CA",
|
|
105
|
+
400: "#A3CCA1",
|
|
106
|
+
500: "#6BA968",
|
|
107
|
+
600: "#358F30",
|
|
108
|
+
700: "#2C7B27",
|
|
109
|
+
800: "#1E631A",
|
|
110
|
+
900: "#10430D",
|
|
111
|
+
950: "#062804"
|
|
112
|
+
},
|
|
113
|
+
warn: {
|
|
114
|
+
50: "#FFF7ED",
|
|
115
|
+
100: "#FDF3D8",
|
|
116
|
+
200: "#FDE9B2",
|
|
117
|
+
300: "#FDD566",
|
|
118
|
+
400: "#FFB900",
|
|
119
|
+
500: "#FFA515",
|
|
120
|
+
600: "#FD9024",
|
|
121
|
+
700: "#DD781F",
|
|
122
|
+
800: "#BC4E00",
|
|
123
|
+
900: "#A42D02",
|
|
124
|
+
950: "#792202"
|
|
125
|
+
},
|
|
126
|
+
danger: {
|
|
127
|
+
50: "#F8E6E4",
|
|
128
|
+
100: "#FFDDD9",
|
|
129
|
+
200: "#EEC1BC",
|
|
130
|
+
300: "#E3938C",
|
|
131
|
+
400: "#E3675C",
|
|
132
|
+
500: "#DC3F32",
|
|
133
|
+
600: "#CF150E",
|
|
134
|
+
700: "#B10404",
|
|
135
|
+
800: "#820907",
|
|
136
|
+
900: "#5D0803",
|
|
137
|
+
950: "#450501"
|
|
138
|
+
}
|
|
139
|
+
}, v = { install(e) {
|
|
140
|
+
e.component("TopButton", g);
|
|
141
|
+
} };
|
|
142
|
+
//#endregion
|
|
143
|
+
export { g as TopButton, v as TopSolutionsDesignSystem, _ as colors };
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/components/TopButton.vue","../src/components/TopButton.vue","../src/tokens/colors.ts","../src/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport Button from 'primevue/button'\nimport vTooltip from 'primevue/tooltip'\nimport { twMerge } from 'tailwind-merge'\n\nconst slots = useSlots()\nconst outrosIcones = computed(() => Boolean(slots.icon))\n\nconst props = withDefaults(\n defineProps<{\n tooltip?: string\n label?: string\n icon?: string\n loading?: boolean\n class?: string\n outlined?: boolean\n secondary?: boolean\n disabled?: boolean\n unstyled?: boolean\n type?: 'button' | 'submit' | 'reset'\n }>(),\n {\n tooltip: '',\n label: '',\n icon: '',\n loading: false,\n class: '',\n outlined: false,\n secondary: false,\n disabled: false,\n unstyled: false,\n type: 'button',\n },\n)\n\nconst emit = defineEmits<{\n click: []\n}>()\n\nconst buttonClasses = computed(() => {\n const baseClasses = !props.unstyled\n ? props.secondary\n ? 'rounded-[10px] border px-2 py-2 font-bold'\n : props.outlined\n ? 'shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50'\n : 'rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 '\n : ''\n\n return twMerge(baseClasses, props.class)\n})\n</script>\n\n<template>\n <span class=\"h-fit w-fit rounded-[12px] bg-transparent\">\n <Button\n v-tooltip.top=\"tooltip\"\n :type=\"type\"\n :label=\"label\"\n :disabled=\"disabled || loading\"\n :icon=\"outrosIcones ? undefined : icon || undefined\"\n :loading=\"loading\"\n :outlined=\"outlined || secondary\"\n :severity=\"secondary ? 'secondary' : undefined\"\n :class=\"buttonClasses\"\n :pt=\"{\n root: { class: buttonClasses },\n }\"\n @click=\"emit('click')\"\n >\n <template v-if=\"outrosIcones\" #icon>\n <slot name=\"icon\" />\n </template>\n </Button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport Button from 'primevue/button'\nimport vTooltip from 'primevue/tooltip'\nimport { twMerge } from 'tailwind-merge'\n\nconst slots = useSlots()\nconst outrosIcones = computed(() => Boolean(slots.icon))\n\nconst props = withDefaults(\n defineProps<{\n tooltip?: string\n label?: string\n icon?: string\n loading?: boolean\n class?: string\n outlined?: boolean\n secondary?: boolean\n disabled?: boolean\n unstyled?: boolean\n type?: 'button' | 'submit' | 'reset'\n }>(),\n {\n tooltip: '',\n label: '',\n icon: '',\n loading: false,\n class: '',\n outlined: false,\n secondary: false,\n disabled: false,\n unstyled: false,\n type: 'button',\n },\n)\n\nconst emit = defineEmits<{\n click: []\n}>()\n\nconst buttonClasses = computed(() => {\n const baseClasses = !props.unstyled\n ? props.secondary\n ? 'rounded-[10px] border px-2 py-2 font-bold'\n : props.outlined\n ? 'shrink-0 rounded-[10px] border-primary-800 px-4 py-2 text-primary-800 hover:bg-primary-50'\n : 'rounded-[10px] !border-primary-900 bg-primary-900 px-3 py-2 font-bold text-white hover:!border-primary-800 hover:bg-primary-800 '\n : ''\n\n return twMerge(baseClasses, props.class)\n})\n</script>\n\n<template>\n <span class=\"h-fit w-fit rounded-[12px] bg-transparent\">\n <Button\n v-tooltip.top=\"tooltip\"\n :type=\"type\"\n :label=\"label\"\n :disabled=\"disabled || loading\"\n :icon=\"outrosIcones ? undefined : icon || undefined\"\n :loading=\"loading\"\n :outlined=\"outlined || secondary\"\n :severity=\"secondary ? 'secondary' : undefined\"\n :class=\"buttonClasses\"\n :pt=\"{\n root: { class: buttonClasses },\n }\"\n @click=\"emit('click')\"\n >\n <template v-if=\"outrosIcones\" #icon>\n <slot name=\"icon\" />\n </template>\n </Button>\n </span>\n</template>\n","export const colors = {\n primary: {\n 50: '#EEF9FF',\n 100: '#DFF4FF',\n 200: '#C5E6F8',\n 300: '#8EC4DF',\n 400: '#66ACD1',\n 500: '#2488BC',\n 600: '#036DA3',\n 700: '#1B5783',\n 800: '#02466B',\n 900: '#052F4A',\n 950: '#0C192D',\n },\n secondary: {\n 50: '#FAFAFA',\n 100: '#F4F4F5',\n 200: '#E9E9E9',\n 300: '#D8D8D8',\n 400: '#B8B8B8',\n 500: '#8E8E8E',\n 600: '#676767',\n 700: '#4B4B4B',\n 800: '#343434',\n 900: '#1C1917',\n 950: '#0C0A09',\n },\n success: {\n 50: '#FAFFFA',\n 100: '#F4FBF6',\n 200: '#DFF6DE',\n 300: '#CBE3CA',\n 400: '#A3CCA1',\n 500: '#6BA968',\n 600: '#358F30',\n 700: '#2C7B27',\n 800: '#1E631A',\n 900: '#10430D',\n 950: '#062804',\n },\n warn: {\n 50: '#FFF7ED',\n 100: '#FDF3D8',\n 200: '#FDE9B2',\n 300: '#FDD566',\n 400: '#FFB900',\n 500: '#FFA515',\n 600: '#FD9024',\n 700: '#DD781F',\n 800: '#BC4E00',\n 900: '#A42D02',\n 950: '#792202',\n },\n danger: {\n 50: '#F8E6E4',\n 100: '#FFDDD9',\n 200: '#EEC1BC',\n 300: '#E3938C',\n 400: '#E3675C',\n 500: '#DC3F32',\n 600: '#CF150E',\n 700: '#B10404',\n 800: '#820907',\n 900: '#5D0803',\n 950: '#450501',\n },\n} as const\n","import type { App, Plugin } from 'vue'\nimport TopButton from './components/TopButton.vue'\nimport './styles/index.css'\n\nexport { TopButton }\nexport { colors } from './tokens/colors'\n\nexport const TopSolutionsDesignSystem: Plugin = {\n install(app: App) {\n app.component('TopButton', TopButton)\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,IAAM,IAAQ,EAAS,GACjB,IAAe,QAAe,EAAQ,EAAM,IAAK,GAEjD,IAAQ,GA2BR,IAAO,GAIP,IAAgB,QAAe;GACnC,IAAM,IAAe,EAAM,WAMvB,KALA,EAAM,YACJ,8CACA,EAAM,WACJ,8FACA;GAGR,OAAO,EAAQ,GAAa,EAAM,KAAK;EACzC,CAAC;oBAIC,EAAA,GAAA,EAoBO,QApBP,GAoBO,CAnBL,GAAA,EAAA,GAAA,EAkBS,EAAA,CAAA,GAAA;GAhBN,MAAM,EAAA;GACN,OAAO,EAAA;GACP,UAAU,EAAA,YAAY,EAAA;GACtB,MAAM,EAAA,QAAe,KAAA,IAAY,EAAA,QAAQ,KAAA;GACzC,SAAS,EAAA;GACT,UAAU,EAAA,YAAY,EAAA;GACtB,UAAU,EAAA,YAAS,cAAiB,KAAA;GACpC,OAAK,EAAE,EAAA,KAAa;GACpB,IAAE,EAA2B,MAAA,EAAA,OAAA,EAAA,MAAa,EAAA;GAG1C,SAAK,AAAA,EAAA,QAAA,MAAE,EAAI,OAAA;EAEI,GAAA,EAAA,EAAA,GAAA,EAAA,GAAA,CAAA,EAAA,QAAA;GAAe,MAAA;GAC7B,IAAA,QAAoB,CAApB,EAAoB,EAAA,QAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;;GAfP,EAAA;;GAAL,EAAA,KAAV,GAAuB;;;IExDhB,IAAS;CACpB,SAAS;EACP,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,WAAW;EACT,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,SAAS;EACP,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,MAAM;EACJ,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,QAAQ;EACN,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;AACF,GC3Da,IAAmC,EAC9C,QAAQ,GAAU;CAChB,EAAI,UAAU,aAAa,CAAS;AACtC,EACF"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.h-fit{height:fit-content}.w-fit{width:fit-content}.shrink-0{flex-shrink:0}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.border{border-width:1px}.\!border-primary-900{border-color:var(--top-primary-900)!important}.border-primary-800{border-color:var(--top-primary-800)}.bg-primary-900{background-color:var(--top-primary-900)}.bg-transparent{background-color:#0000}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.font-bold{font-weight:700}.text-primary-800{color:var(--top-primary-800)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}:root{--top-primary-50:#eef9ff;--top-primary-100:#dff4ff;--top-primary-200:#c5e6f8;--top-primary-300:#8ec4df;--top-primary-400:#66acd1;--top-primary-500:#2488bc;--top-primary-600:#036da3;--top-primary-700:#1b5783;--top-primary-800:#02466b;--top-primary-900:#052f4a;--top-primary-950:#0c192d;--top-secondary-50:#fafafa;--top-secondary-100:#f4f4f5;--top-secondary-200:#e9e9e9;--top-secondary-300:#d8d8d8;--top-secondary-400:#b8b8b8;--top-secondary-500:#8e8e8e;--top-secondary-600:#676767;--top-secondary-700:#4b4b4b;--top-secondary-800:#343434;--top-secondary-900:#1c1917;--top-secondary-950:#0c0a09}.hover\:\!border-primary-800:hover{border-color:var(--top-primary-800)!important}.hover\:bg-primary-50:hover{background-color:var(--top-primary-50)}.hover\:bg-primary-800:hover{background-color:var(--top-primary-800)}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const colors: {
|
|
2
|
+
readonly primary: {
|
|
3
|
+
readonly 50: "#EEF9FF";
|
|
4
|
+
readonly 100: "#DFF4FF";
|
|
5
|
+
readonly 200: "#C5E6F8";
|
|
6
|
+
readonly 300: "#8EC4DF";
|
|
7
|
+
readonly 400: "#66ACD1";
|
|
8
|
+
readonly 500: "#2488BC";
|
|
9
|
+
readonly 600: "#036DA3";
|
|
10
|
+
readonly 700: "#1B5783";
|
|
11
|
+
readonly 800: "#02466B";
|
|
12
|
+
readonly 900: "#052F4A";
|
|
13
|
+
readonly 950: "#0C192D";
|
|
14
|
+
};
|
|
15
|
+
readonly secondary: {
|
|
16
|
+
readonly 50: "#FAFAFA";
|
|
17
|
+
readonly 100: "#F4F4F5";
|
|
18
|
+
readonly 200: "#E9E9E9";
|
|
19
|
+
readonly 300: "#D8D8D8";
|
|
20
|
+
readonly 400: "#B8B8B8";
|
|
21
|
+
readonly 500: "#8E8E8E";
|
|
22
|
+
readonly 600: "#676767";
|
|
23
|
+
readonly 700: "#4B4B4B";
|
|
24
|
+
readonly 800: "#343434";
|
|
25
|
+
readonly 900: "#1C1917";
|
|
26
|
+
readonly 950: "#0C0A09";
|
|
27
|
+
};
|
|
28
|
+
readonly success: {
|
|
29
|
+
readonly 50: "#FAFFFA";
|
|
30
|
+
readonly 100: "#F4FBF6";
|
|
31
|
+
readonly 200: "#DFF6DE";
|
|
32
|
+
readonly 300: "#CBE3CA";
|
|
33
|
+
readonly 400: "#A3CCA1";
|
|
34
|
+
readonly 500: "#6BA968";
|
|
35
|
+
readonly 600: "#358F30";
|
|
36
|
+
readonly 700: "#2C7B27";
|
|
37
|
+
readonly 800: "#1E631A";
|
|
38
|
+
readonly 900: "#10430D";
|
|
39
|
+
readonly 950: "#062804";
|
|
40
|
+
};
|
|
41
|
+
readonly warn: {
|
|
42
|
+
readonly 50: "#FFF7ED";
|
|
43
|
+
readonly 100: "#FDF3D8";
|
|
44
|
+
readonly 200: "#FDE9B2";
|
|
45
|
+
readonly 300: "#FDD566";
|
|
46
|
+
readonly 400: "#FFB900";
|
|
47
|
+
readonly 500: "#FFA515";
|
|
48
|
+
readonly 600: "#FD9024";
|
|
49
|
+
readonly 700: "#DD781F";
|
|
50
|
+
readonly 800: "#BC4E00";
|
|
51
|
+
readonly 900: "#A42D02";
|
|
52
|
+
readonly 950: "#792202";
|
|
53
|
+
};
|
|
54
|
+
readonly danger: {
|
|
55
|
+
readonly 50: "#F8E6E4";
|
|
56
|
+
readonly 100: "#FFDDD9";
|
|
57
|
+
readonly 200: "#EEC1BC";
|
|
58
|
+
readonly 300: "#E3938C";
|
|
59
|
+
readonly 400: "#E3675C";
|
|
60
|
+
readonly 500: "#DC3F32";
|
|
61
|
+
readonly 600: "#CF150E";
|
|
62
|
+
readonly 700: "#B10404";
|
|
63
|
+
readonly 800: "#820907";
|
|
64
|
+
readonly 900: "#5D0803";
|
|
65
|
+
readonly 950: "#450501";
|
|
66
|
+
};
|
|
67
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@topjoao/top-design-system",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "Design system e biblioteca de componentes Vue da TopSolutions",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/",
|
|
11
|
+
"tag": "beta"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"require": "./dist/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./style.css": "./dist/style.css"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite build --watch",
|
|
32
|
+
"build": "vue-tsc -b && vite build",
|
|
33
|
+
"typecheck": "vue-tsc -b",
|
|
34
|
+
"test": "vitest run --passWithNoTests",
|
|
35
|
+
"check": "npm run typecheck && npm run test && npm run build",
|
|
36
|
+
"pack:dry": "npm pack --dry-run",
|
|
37
|
+
"prepack": "npm run check"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@primeuix/themes": "^1.2.0",
|
|
41
|
+
"primeicons": "^7.0.0",
|
|
42
|
+
"primevue": "^4.4.0",
|
|
43
|
+
"vue": "^3.5.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"tailwind-merge": "^3.6.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@primeuix/themes": "^1.2.5",
|
|
50
|
+
"@types/node": "^24.13.3",
|
|
51
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
52
|
+
"@vue/test-utils": "^2.5.0",
|
|
53
|
+
"@vue/tsconfig": "^0.9.1",
|
|
54
|
+
"autoprefixer": "^10.5.4",
|
|
55
|
+
"jsdom": "^29.1.1",
|
|
56
|
+
"postcss": "^8.5.26",
|
|
57
|
+
"primeicons": "^7.0.0",
|
|
58
|
+
"primevue": "^4.4.1",
|
|
59
|
+
"tailwindcss": "^3.4.18",
|
|
60
|
+
"typescript": "~6.0.2",
|
|
61
|
+
"vite": "^8.2.2",
|
|
62
|
+
"vite-plugin-dts": "^5.0.3",
|
|
63
|
+
"vitest": "^4.1.11",
|
|
64
|
+
"vue": "^3.5.42",
|
|
65
|
+
"vue-tsc": "^3.3.11"
|
|
66
|
+
}
|
|
67
|
+
}
|