@vlalg-nimbus/nb-buttons 1.0.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 ADDED
@@ -0,0 +1,43 @@
1
+ # nb-buttons
2
+ > This component is only for [Vue.js 3+](https://vuejs.org/)
3
+
4
+ <br />
5
+
6
+ This lib contains button components.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @vlalg-nimbus/nb-buttons
12
+
13
+ # or
14
+
15
+ yarn add @vlalg-nimbus/nb-buttons
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```js
21
+ // main.js
22
+ import { createApp } from 'vue'
23
+ import App from './App.vue'
24
+
25
+ import NbButtonsComponents from '@vlalg-nimbus/nb-buttons'
26
+ import "@vlalg-nimbus/nb-buttons/dist/style.css";
27
+
28
+ const app = createApp(App)
29
+ app.use(NbButtonsComponents)
30
+ app.mount('#app')
31
+ ```
32
+
33
+ ## Components list
34
+
35
+ The components that are part of this lib are:
36
+
37
+ - <a href="http://nimbus.tec.br/vue-components/nb-buttons/nb-button-mechanical" target="_blank">nb-button-mechanical</a>
38
+
39
+ Click on each one above to find out how to use it, properties, events, etc.
40
+
41
+ ## License
42
+
43
+ [MIT](http://opensource.org/licenses/MIT)
Binary file
@@ -0,0 +1,157 @@
1
+ import { useCssVars as T, unref as j, toRefs as E, computed as a, openBlock as F, createElementBlock as q, normalizeClass as V, normalizeStyle as g, createElementVNode as A, renderSlot as P, createTextVNode as G, createCommentVNode as H } from "vue";
2
+ const J = (e, o) => {
3
+ const n = e.__vccOpts || e;
4
+ for (const [r, u] of o)
5
+ n[r] = u;
6
+ return n;
7
+ }, K = ["id"], Q = /* @__PURE__ */ Object.assign({
8
+ name: "NbButtonMechanical",
9
+ inheritAttrs: !1
10
+ }, {
11
+ __name: "NbButtonMechanical",
12
+ props: {
13
+ nbId: {
14
+ type: String,
15
+ required: !0
16
+ },
17
+ display: {
18
+ type: String,
19
+ default: "b",
20
+ validator: (e = "b") => {
21
+ const o = e ? e.toLowerCase() : "";
22
+ return ["b", "ib"].includes(o);
23
+ }
24
+ },
25
+ textColor: {
26
+ type: String,
27
+ default: "#ffffff"
28
+ },
29
+ containerColor: {
30
+ type: String,
31
+ default: "#ffffff"
32
+ },
33
+ buttonColor: {
34
+ type: String,
35
+ default: "#bbbbbb"
36
+ },
37
+ paddingX: {
38
+ type: Number,
39
+ default: 1,
40
+ validator: (e) => e || 1
41
+ },
42
+ paddingY: {
43
+ type: Number,
44
+ default: 0.2,
45
+ validator: (e) => e || 0.2
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ default: !1,
50
+ validator: (e) => typeof e == "boolean" && [!0, !1].includes(e)
51
+ },
52
+ borderRadius: {
53
+ type: Number,
54
+ default: 0.375
55
+ },
56
+ animationSlow: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ fontFamily: {
61
+ type: String,
62
+ default: "'Lato', sans-serif"
63
+ },
64
+ fontSize: {
65
+ type: String,
66
+ default: "1.6em",
67
+ validator: (e) => e || "1.6em"
68
+ },
69
+ fontWeight: {
70
+ type: Number,
71
+ default: 400,
72
+ validator: (e) => e || 400
73
+ }
74
+ },
75
+ emits: ["clicked"],
76
+ setup(e, { emit: o }) {
77
+ const n = e;
78
+ T((t) => ({
79
+ "3ae6a9db": N.value,
80
+ "2c6fd776": j(u),
81
+ "137d346c": B.value,
82
+ 14622611: k.value
83
+ }));
84
+ const {
85
+ display: r,
86
+ buttonColor: u,
87
+ textColor: p,
88
+ containerColor: b,
89
+ paddingX: s,
90
+ paddingY: d,
91
+ borderRadius: i,
92
+ disabled: C,
93
+ animationSlow: S,
94
+ fontFamily: v,
95
+ fontSize: m,
96
+ fontWeight: c
97
+ } = E(n), l = a(() => {
98
+ const t = C.value ? "component-disabled" : "", y = r.value !== "b" ? "inline-block" : "block", R = b.value ? b.value : "#ffffff", W = u.value ? u.value : "#bbbbbb", X = p.value ? p.value : "#ffffff", Y = !s.value || s.value < 0 ? 1 : s.value, $ = !d.value || d.value < 0 ? 0.2 : d.value, I = !i.value || i.value < 0 ? 0 : i.value, M = S.value ? "" : "component-transition__no-slow", O = v.value ? v.value : "'Lato', sans-serif", D = m.value ? m.value : "1.6em", L = !c.value || c.value < 0 ? 100 : c.value;
99
+ return {
100
+ disabled: t,
101
+ display: y,
102
+ containerColor: R,
103
+ buttonColor: W,
104
+ textColor: X,
105
+ paddingX: Y,
106
+ paddingY: $,
107
+ borderRadius: I,
108
+ animationSlow: M,
109
+ font: O,
110
+ fontSize: D,
111
+ fontWeight: L
112
+ };
113
+ }), _ = a(() => l.value.disabled), h = a(() => ({
114
+ display: l.value.display
115
+ })), x = a(() => {
116
+ const t = l.value;
117
+ return {
118
+ border: `2px solid ${t.containerColor}`,
119
+ color: t.textColor,
120
+ backgroundColor: t.buttonColor,
121
+ padding: `${t.paddingY}rem ${t.paddingX}rem`,
122
+ borderRadius: `${t.borderRadius}rem`,
123
+ fontSize: t.fontSize,
124
+ fontWeight: t.fontWeight
125
+ };
126
+ }), w = a(() => l.value.animationSlow), N = a(() => l.value.font), k = a(() => l.value.textColor), B = a(() => l.value.buttonColor), z = () => {
127
+ o("clicked");
128
+ };
129
+ return (t, y) => e.nbId ? (F(), q("div", {
130
+ key: 0,
131
+ class: V(["nb-wrapper", _.value]),
132
+ style: g([h.value]),
133
+ onClick: z
134
+ }, [
135
+ A("div", {
136
+ id: e.nbId,
137
+ class: V(["nb-reset", "component", "component-transition", w.value]),
138
+ style: g([x.value])
139
+ }, [
140
+ P(t.$slots, "content", {}, () => [
141
+ G("Default Text")
142
+ ], !0)
143
+ ], 14, K)
144
+ ], 6)) : H("", !0);
145
+ }
146
+ }), U = /* @__PURE__ */ J(Q, [["__scopeId", "data-v-05891c86"]]), f = { NbButtonMechanical: U }, ee = {
147
+ install(e) {
148
+ for (const o in f)
149
+ if (Object.prototype.hasOwnProperty.call(f, o)) {
150
+ const n = f[o];
151
+ e.component(n.name, n);
152
+ }
153
+ }
154
+ };
155
+ export {
156
+ ee as default
157
+ };
@@ -0,0 +1 @@
1
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.NbButtons=r(e.Vue))})(this,function(e){"use strict";const r="",v=(t,n)=>{const a=t.__vccOpts||t;for(const[d,u]of n)a[d]=u;return a},C=["id"],s={NbButtonMechanical:v(Object.assign({name:"NbButtonMechanical",inheritAttrs:!1},{__name:"NbButtonMechanical",props:{nbId:{type:String,required:!0},display:{type:String,default:"b",validator:(t="b")=>{const n=t?t.toLowerCase():"";return["b","ib"].includes(n)}},textColor:{type:String,default:"#ffffff"},containerColor:{type:String,default:"#ffffff"},buttonColor:{type:String,default:"#bbbbbb"},paddingX:{type:Number,default:1,validator:t=>t||1},paddingY:{type:Number,default:.2,validator:t=>t||.2},disabled:{type:Boolean,default:!1,validator:t=>typeof t=="boolean"&&[!0,!1].includes(t)},borderRadius:{type:Number,default:.375},animationSlow:{type:Boolean,default:!1},fontFamily:{type:String,default:"'Lato', sans-serif"},fontSize:{type:String,default:"1.6em",validator:t=>t||"1.6em"},fontWeight:{type:Number,default:400,validator:t=>t||400}},emits:["clicked"],setup(t,{emit:n}){const a=t;e.useCssVars(o=>({"3ae6a9db":B.value,"2c6fd776":e.unref(u),"137d346c":z.value,14622611:k.value}));const{display:d,buttonColor:u,textColor:b,containerColor:m,paddingX:i,paddingY:c,borderRadius:f,disabled:S,animationSlow:_,fontFamily:y,fontSize:V,fontWeight:p}=e.toRefs(a),l=e.computed(()=>{const o=S.value?"component-disabled":"",g=d.value!=="b"?"inline-block":"block",W=m.value?m.value:"#ffffff",M=u.value?u.value:"#bbbbbb",T=b.value?b.value:"#ffffff",X=!i.value||i.value<0?1:i.value,Y=!c.value||c.value<0?.2:c.value,$=!f.value||f.value<0?0:f.value,I=_.value?"":"component-transition__no-slow",O=y.value?y.value:"'Lato', sans-serif",j=V.value?V.value:"1.6em",D=!p.value||p.value<0?100:p.value;return{disabled:o,display:g,containerColor:W,buttonColor:M,textColor:T,paddingX:X,paddingY:Y,borderRadius:$,animationSlow:I,font:O,fontSize:j,fontWeight:D}}),h=e.computed(()=>l.value.disabled),x=e.computed(()=>({display:l.value.display})),N=e.computed(()=>{const o=l.value;return{border:`2px solid ${o.containerColor}`,color:o.textColor,backgroundColor:o.buttonColor,padding:`${o.paddingY}rem ${o.paddingX}rem`,borderRadius:`${o.borderRadius}rem`,fontSize:o.fontSize,fontWeight:o.fontWeight}}),w=e.computed(()=>l.value.animationSlow),B=e.computed(()=>l.value.font),k=e.computed(()=>l.value.textColor),z=e.computed(()=>l.value.buttonColor),R=()=>{n("clicked")};return(o,g)=>t.nbId?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["nb-wrapper",h.value]),style:e.normalizeStyle([x.value]),onClick:R},[e.createElementVNode("div",{id:t.nbId,class:e.normalizeClass(["nb-reset","component","component-transition",w.value]),style:e.normalizeStyle([N.value])},[e.renderSlot(o.$slots,"content",{},()=>[e.createTextVNode("Default Text")],!0)],14,C)],6)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-05891c86"]])};return{install(t){for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){const a=s[n];t.component(a.name,a)}}}});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap";.nb-wrapper[data-v-05891c86]{margin:0;padding:0;font-size:62.5%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.nb-reset[data-v-05891c86]{font-family:Lato,sans-serif;font-style:normal;font-weight:light;line-height:1.42857143}.nb-reset *[data-v-05891c86]{margin:0;padding:0}.nb-reset *[data-v-05891c86],.nb-reset *[data-v-05891c86]:before,.nb-reset *[data-v-05891c86]:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.component[data-v-05891c86]{margin:0 3px 5px 0;padding:0;box-sizing:border-box;line-height:1.42857143;font-family:Lato,sans-serif;font-family:var(--3ae6a9db);-webkit-user-select:none;user-select:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;cursor:pointer;text-align:center;-webkit-text-decoration-line:none;text-decoration-line:none;white-space:nowrap;box-shadow:3px 3px 0 -1px var(--2c6fd776),3px 3px 0 var(--2c6fd776)}.component.component-transition[data-v-05891c86]{transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.component.component-transition.component-transition__no-slow[data-v-05891c86]{transition:all .05s ease-in!important}.component[data-v-05891c86]:hover{box-shadow:0 0 0 -1px var(--2c6fd776),0 0 0 var(--2c6fd776);transform:translate(3px,3px)}.component[data-v-05891c86]:active,.component[data-v-05891c86]:focus{outline:2px solid transparent;outline-offset:2px}.component[data-v-05891c86]:active{box-shadow:0 0 #0000,0 0 #0000,0 0 #0000;left:1px;top:1px}.component-disabled[data-v-05891c86]{cursor:not-allowed;pointer-events:none;-webkit-user-select:none;user-select:none}.component-disabled .component[data-v-05891c86]{--disabled-button-color: var(--137d346c);--disabled-color: var(--14622611);background-color:var(--disabled-button-color)!important;color:var(--disabled-color)!important;opacity:.7;border-radius:inherit}
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@vlalg-nimbus/nb-buttons",
3
+ "description": "Button components for Vuejs 3",
4
+ "private": false,
5
+ "version": "1.0.0",
6
+ "type": "module",
7
+ "main": "./dist/nb-buttons.umd.js",
8
+ "module": "./dist/nb-buttons.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/nb-buttons.js",
12
+ "require": "./dist/nb-buttons.umd.js"
13
+ },
14
+ "./dist/style.css": "./dist/style.css",
15
+ "./dist/images": "./dist/images"
16
+ },
17
+ "browser": {
18
+ "./style.css": "./dist/style.css",
19
+ "./dist/images": "./dist/images"
20
+ },
21
+ "sideEffects": false,
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "scripts": {
26
+ "dev": "vite",
27
+ "build": "vite build",
28
+ "preview": "vite preview --port 4173",
29
+ "test:unit": "vitest --environment jsdom",
30
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
31
+ "format:prettier": "prettier --write . '!**/*.{js,vue}'",
32
+ "npm:publish": "vite build && npm login && npm publish --access=public"
33
+ },
34
+ "dependencies": {
35
+ "@vlalg-nimbus/bee-css-reset": "^2.0.2",
36
+ "@vlalg-nimbus/chameleon-grid-layout": "^1.0.2",
37
+ "vue": "^3.3.4"
38
+ },
39
+ "devDependencies": {
40
+ "@rollup/plugin-commonjs": "^25.0.5",
41
+ "@rollup/plugin-image": "^3.0.3",
42
+ "@rollup/plugin-node-resolve": "^15.2.2",
43
+ "@rushstack/eslint-patch": "^1.3.3",
44
+ "@vitejs/plugin-vue": "^4.3.4",
45
+ "@vue/eslint-config-prettier": "^8.0.0",
46
+ "@vue/test-utils": "^2.4.1",
47
+ "eslint": "^8.51.0",
48
+ "eslint-plugin-vue": "^9.17.0",
49
+ "jsdom": "^22.1.0",
50
+ "prettier": "^3.0.3",
51
+ "sass": "^1.69.0",
52
+ "unplugin-vue-components": "^0.25.2",
53
+ "vite": "^4.4.9",
54
+ "vitest": "^0.34.4"
55
+ },
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/VemLavarALoucaGamers/vlalg-nimbus"
59
+ },
60
+ "bugs": {
61
+ "url": "https://github.com/VemLavarALoucaGamers/vlalg-nimbus/issues"
62
+ },
63
+ "homepage": "https://nimbus.tec.br",
64
+ "keywords": [
65
+ "vuejs",
66
+ "vue js",
67
+ "vue plugin",
68
+ "delete button",
69
+ "delete",
70
+ "buttons",
71
+ "button",
72
+ "components",
73
+ "component",
74
+ "vue components",
75
+ "vuejs components",
76
+ "vue js components"
77
+ ],
78
+ "author": "Antonio and Felipe <Vem Lavar a Louca Gamers> (https://vemlavaralouca.com.br)",
79
+ "contributors": [
80
+ "TonhaoSantos (https://github.com/TonhaoSantos)",
81
+ "Felipecss (https://github.com/lipecss)"
82
+ ]
83
+ }