Skip to content

Commit

Permalink
Repo Refactor (#2)
Browse files Browse the repository at this point in the history
- [x] slipmatio/slipmatio#16
- [x] Bump packages
- [x] Refactor project to Vite
- [x] Refactor components to modern Vue / script setup
- [x] Update README
- [x] Add LICENSE
- [x] Add Renovate config

Fixes slipmatio/slipmatio#15
  • Loading branch information
Uninen authored Jun 25, 2023
1 parent 9a422d8 commit 4c6a6b2
Show file tree
Hide file tree
Showing 40 changed files with 2,020 additions and 10,774 deletions.
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

26 changes: 26 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": [
"config:base",
"group:all",
"schedule:weekly"
],
"enabledManagers": [
"npm"
],
"packageRules": [
{
"matchManagers": [
"npm"
],
"stabilityDays": 2
},
{
"matchPackagePatterns": [
"npm"
],
"rangeStrategy": "auto"
}
],
"timezone": "Europe/Helsinki",
"dependencyDashboard": true
}
40 changes: 40 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?


*.html
*.config.js
*.json
*.lock
src/
__tests__
./*.cjs
./*.ts
env.d.ts
vite.config.ts

dist/*.svg
vite-env.d.ts
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.0.8 (2021-02-02)

- Bumped deps.

## 0.0.7 (2021-01-29)

- Refactor: tweaked colors for v3 dark mode.
Expand All @@ -11,4 +12,4 @@

## 0.0.1 (2020-12-01)

- First release.
- First release.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Ville Säävuori

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,45 @@

Warning: this project is under active development and not intended for public use yet. **Do not use in production.**

## Usage

1. Install `@slipmatio/ui`
2. Import a component
3. Import styles: `import '@slipmatio/ui/style.css'`
4. Profit!11

## Developing

### Basic Commands

You need `yarn` (classic) installed.
You need `pnpm` installed.

#### Project setup

```
yarn install
pnpm i
```

#### Start development server

```
yarn dev
pnpm dev
```

#### Build for production

```
yarn build
pnpm build
```

#### TBA: Run end-to-end tests

```
yarn test:e2e
pnpm test:e2e
```

### Publishing

```
yarn publish --new-version "0.0.2" --access public
pnpm publish --access public
```
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions dev/serve.ts

This file was deleted.

24 changes: 0 additions & 24 deletions dev/serve.vue

This file was deleted.

29 changes: 29 additions & 0 deletions dist/components/SlipmatButton.vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { PropType as __PropType } from 'vue';
declare const _sfc_main: import("vue").DefineComponent<{
icon: {
type: __PropType<string | undefined>;
required: false;
};
isWorking: {
type: __PropType<boolean | undefined>;
required: false;
};
workingText: {
type: __PropType<string | undefined>;
required: false;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
icon: {
type: __PropType<string | undefined>;
required: false;
};
isWorking: {
type: __PropType<boolean | undefined>;
required: false;
};
workingText: {
type: __PropType<string | undefined>;
required: false;
};
}>>, {}, {}>;
export default _sfc_main;
2 changes: 2 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import SlipmatButton from './components/SlipmatButton.vue';
export { SlipmatButton };
1 change: 1 addition & 0 deletions dist/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/ui.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=n=>(e.pushScopeId("data-v-4829d22e"),n=n(),e.popScopeId(),n),c=["type"],d={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",class:"w-4 h-4 mr-1 -ml-1 animate-spin"},m=t(()=>e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1)),u=t(()=>e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)),h=[m,u],p={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"w-4 h-4 mr-1 -ml-1"},v=t(()=>e.createElementVNode("path",{"fill-rule":"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1)),_=[v],k={key:2,class:"w-4 h-4 mr-1 -ml-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},w=t(()=>e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)),g=[w],f={key:3,class:"w-4 h-4 mr-1 -ml-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},B=t(()=>e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},null,-1)),V=t(()=>e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)),y=[B,V],C={key:4,class:"w-4 h-4 mr-1 -ml-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},N=t(()=>e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)),E=[N],z={key:5,class:"w-4 h-4 mr-1 -ml-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},S=t(()=>e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1)),M=[S],W={key:6,class:"w-4 h-4 mr-1 -ml-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},H=t(()=>e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z","clip-rule":"evenodd"},null,-1)),b=[H],A=e.defineComponent({__name:"SlipmatButton",props:{icon:{},isWorking:{type:Boolean},workingText:{}},setup(n){const r=e.ref(!1),l=e.ref(!1),s=e.ref("button"),a=e.ref(!1),i=e.useAttrs();return i.primary!==void 0?r.value=!0:i.secondary!==void 0&&(l.value=!0),i.submit!==void 0&&(s.value="submit"),i["full-width"]!==void 0&&(a.value=!0),(o,x)=>(e.openBlock(),e.createElementBlock("button",{type:s.value,class:e.normalizeClass(["btn",{primary:r.value,secondary:l.value,"full-width":a.value}])},[o.isWorking?(e.openBlock(),e.createElementBlock("svg",d,h)):e.createCommentVNode("",!0),o.icon==="trash"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",p,_)):e.createCommentVNode("",!0),o.icon==="new"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",k,g)):e.createCommentVNode("",!0),o.icon==="edit"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",f,y)):e.createCommentVNode("",!0),o.icon==="download"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",C,E)):e.createCommentVNode("",!0),o.icon==="upload"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",z,M)):e.createCommentVNode("",!0),o.icon==="reset"&&!o.isWorking?(e.openBlock(),e.createElementBlock("svg",W,b)):e.createCommentVNode("",!0),o.isWorking?e.createCommentVNode("",!0):e.renderSlot(o.$slots,"default",{key:7},void 0,!0),o.isWorking?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[e.createTextVNode(e.toDisplayString(o.workingText),1)],64)):e.createCommentVNode("",!0)],10,c))}});const T=(n,r)=>{const l=n.__vccOpts||n;for(const[s,a]of r)l[s]=a;return l},j=T(A,[["__scopeId","data-v-4829d22e"]]);exports.SlipmatButton=j;
Loading

0 comments on commit 4c6a6b2

Please sign in to comment.