@deskhero/dh_ui 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,40 @@
1
+ # dh_ui
2
+
3
+ This template should help get you started developing with Vue 3 in Vite.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8
+
9
+ ## Type Support for `.vue` Imports in TS
10
+
11
+ TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12
+
13
+ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14
+
15
+ 1. Disable the built-in TypeScript Extension
16
+ 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
+ 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
+ 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19
+
20
+ ## Customize configuration
21
+
22
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
23
+
24
+ ## Project Setup
25
+
26
+ ```sh
27
+ npm install
28
+ ```
29
+
30
+ ### Compile and Hot-Reload for Development
31
+
32
+ ```sh
33
+ npm run dev
34
+ ```
35
+
36
+ ### Type-Check, Compile and Minify for Production
37
+
38
+ ```sh
39
+ npm run build
40
+ ```
@@ -0,0 +1,59 @@
1
+ import { reactive, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, toDisplayString } from "vue";
2
+ var button = /* @__PURE__ */ (() => ".button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.button--primary{color:#fff;background-color:purple}.button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.button--small{font-size:12px;padding:10px 16px}.button--medium{font-size:14px;padding:11px 20px}.button--large{font-size:16px;padding:12px 24px}\n")();
3
+ var _export_sfc = (sfc, props) => {
4
+ const target = sfc.__vccOpts || sfc;
5
+ for (const [key, val] of props) {
6
+ target[key] = val;
7
+ }
8
+ return target;
9
+ };
10
+ const _sfc_main = {
11
+ name: "dh-button",
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
+ emits: ["click"],
32
+ setup(props, { emit }) {
33
+ props = reactive(props);
34
+ return {
35
+ classes: computed(() => ({
36
+ "button": true,
37
+ "button--primary": props.primary,
38
+ "button--secondary": !props.primary,
39
+ [`button--${props.size || "medium"}`]: true
40
+ })),
41
+ style: computed(() => ({
42
+ backgroundColor: props.backgroundColor
43
+ })),
44
+ onClick() {
45
+ emit("click");
46
+ }
47
+ };
48
+ }
49
+ };
50
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
51
+ return openBlock(), createElementBlock("button", {
52
+ type: "button",
53
+ class: normalizeClass($setup.classes),
54
+ onClick: _cache[0] || (_cache[0] = (...args) => $setup.onClick && $setup.onClick(...args)),
55
+ style: normalizeStyle($setup.style)
56
+ }, toDisplayString($props.label), 7);
57
+ }
58
+ var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
59
+ export { Button as DhButton };
@@ -0,0 +1,2 @@
1
+ (function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.dh_ui={},n.Vue))})(this,function(n,e){"use strict";var p=(()=>`.button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.button--primary{color:#fff;background-color:purple}.button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.button--small{font-size:12px;padding:10px 16px}.button--medium{font-size:14px;padding:11px 20px}.button--large{font-size:16px;padding:12px 24px}
2
+ `)(),a=(t,o)=>{const i=t.__vccOpts||t;for(const[r,l]of o)i[r]=l;return i};const u={name:"dh-button",props:{label:{type:String,required:!0},primary:{type:Boolean,default:!1},size:{type:String,validator:function(t){return["small","medium","large"].indexOf(t)!==-1}},backgroundColor:{type:String}},emits:["click"],setup(t,{emit:o}){return t=e.reactive(t),{classes:e.computed(()=>({button:!0,"button--primary":t.primary,"button--secondary":!t.primary,[`button--${t.size||"medium"}`]:!0})),style:e.computed(()=>({backgroundColor:t.backgroundColor})),onClick(){o("click")}}}};function s(t,o,i,r,l,f){return e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(r.classes),onClick:o[0]||(o[0]=(...d)=>r.onClick&&r.onClick(...d)),style:e.normalizeStyle(r.style)},e.toDisplayString(i.label),7)}var c=a(u,[["render",s]]);n.DhButton=c,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
Binary file
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.button--primary{color:#fff;background-color:purple}.button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.button--small{font-size:12px;padding:10px 16px}.button--medium{font-size:14px;padding:11px 20px}.button--large{font-size:16px;padding:12px 24px}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@deskhero/dh_ui",
3
+ "version": "1.0.0",
4
+ "files": [
5
+ "dist"
6
+ ],
7
+ "main": "dist/dh_ui.umd.js",
8
+ "module": "dist/dh_ui.es.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/dh_ui.es.js",
12
+ "require": "./dist/dh_ui.umd.js"
13
+ },
14
+ "./dist/style.css": "./dist/style.css"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://gabrielrgf:wEwbTMPyDXYhetqM5VRD@bitbucket.org/deskhero_com/dh_ui.git"
19
+ },
20
+ "scripts": {
21
+ "dev": "vite",
22
+ "commit": "cz",
23
+ "build": "run-p type-check build-only",
24
+ "preview": "vite preview --port 4173",
25
+ "build-only": "vite build",
26
+ "type-check": "vue-tsc --noEmit",
27
+ "storybook": "start-storybook -p 6006",
28
+ "build-storybook": "build-storybook",
29
+ "chromatic": "npx chromatic --project-token=9b1dd74e6816"
30
+ },
31
+ "dependencies": {
32
+ "@storybook/addons": "^6.5.9",
33
+ "@storybook/theming": "^6.5.9",
34
+ "vue": "^3.2.36"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/core": "^7.18.5",
38
+ "@storybook/addon-actions": "^6.5.9",
39
+ "@storybook/addon-essentials": "^6.5.9",
40
+ "@storybook/addon-interactions": "^6.5.9",
41
+ "@storybook/addon-links": "^6.5.9",
42
+ "@storybook/builder-vite": "^0.1.36",
43
+ "@storybook/testing-library": "^0.0.13",
44
+ "@storybook/vue3": "^6.5.9",
45
+ "@types/node": "^16.11.36",
46
+ "@vitejs/plugin-vue": "^2.3.3",
47
+ "@vue/tsconfig": "^0.1.3",
48
+ "babel-loader": "^8.2.5",
49
+ "chromatic": "^6.6.2",
50
+ "cz-conventional-changelog": "^3.3.0",
51
+ "npm-run-all": "^4.1.5",
52
+ "semantic-release": "^19.0.3",
53
+ "@semantic-release/changelog": "^6.0.1",
54
+ "@semantic-release/git": "^10.0.1",
55
+ "typescript": "~4.7.2",
56
+ "vite": "^2.9.9",
57
+ "vue-loader": "^16.8.3",
58
+ "vue-tsc": "^0.35.2"
59
+ },
60
+ "config": {
61
+ "commitizen": {
62
+ "path": "./node_modules/cz-conventional-changelog"
63
+ }
64
+ },
65
+ "release": {
66
+ "plugins": [
67
+ "@semantic-release/commit-analyzer",
68
+ "@semantic-release/release-notes-generator",
69
+ "@semantic-release/npm",
70
+ "@semantic-release/changelog",
71
+ "@semantic-release/git"
72
+ ],
73
+ "branches": [
74
+ "master"
75
+ ]
76
+ }
77
+ }