sve-ui 0.0.1 → 0.0.3

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 CHANGED
@@ -1,58 +1,5 @@
1
- # create-svelte
1
+ # Sve-UI
2
2
 
3
- Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
3
+ Sve-UI is a collection of reusable Svelte components that provide an easy and customizable way to build user interfaces for web applications [`sve-ui`](https://github.com/rodriabregu/sve-ui).
4
4
 
5
- Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
6
-
7
- ## Creating a project
8
-
9
- If you're seeing this, you've probably already done this step. Congrats!
10
-
11
- ```bash
12
- # create a new project in the current directory
13
- npm create svelte@latest
14
-
15
- # create a new project in my-app
16
- npm create svelte@latest my-app
17
- ```
18
-
19
- ## Developing
20
-
21
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
-
23
- ```bash
24
- npm run dev
25
-
26
- # or start the server and open the app in a new browser tab
27
- npm run dev -- --open
28
- ```
29
-
30
- Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
-
32
- ## Building
33
-
34
- To build your library:
35
-
36
- ```bash
37
- npm run package
38
- ```
39
-
40
- To create a production version of your showcase app:
41
-
42
- ```bash
43
- npm run build
44
- ```
45
-
46
- You can preview the production build with `npm run preview`.
47
-
48
- > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
49
-
50
- ## Publishing
51
-
52
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
-
54
- To publish your library to [npm](https://www.npmjs.com):
55
-
56
- ```bash
57
- npm publish
58
- ```
5
+ #### to do list of components.
File without changes
@@ -0,0 +1,23 @@
1
+ /** @typedef {typeof __propDef.props} BoxProps */
2
+ /** @typedef {typeof __propDef.events} BoxEvents */
3
+ /** @typedef {typeof __propDef.slots} BoxSlots */
4
+ export default class Box extends SvelteComponentTyped<{
5
+ [x: string]: never;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {}> {
9
+ }
10
+ export type BoxProps = typeof __propDef.props;
11
+ export type BoxEvents = typeof __propDef.events;
12
+ export type BoxSlots = typeof __propDef.slots;
13
+ import { SvelteComponentTyped } from "svelte";
14
+ declare const __propDef: {
15
+ props: {
16
+ [x: string]: never;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export {};
@@ -1,15 +1,30 @@
1
+ <!-- TO DO
2
+ La idea seria que reciba Padding 1, 2, 3, 4
3
+ Y utilizar una clase css global para que se aplique el padding
4
+
5
+ ej:
6
+ .padding-style-1 {
7
+ padding: 2px 4px;
8
+ }
9
+
10
+ -->
11
+
1
12
  <script>export let label = "Button";
2
13
  export let onClick = () => {
3
14
  };
4
15
  export let color = "blue";
5
- export let size = "medium";
16
+ export let size = "md";
6
17
  export let disabled = false;
18
+ export let style = "";
19
+ export let bg = "";
20
+ export let p = "3";
7
21
  let props = { ...$$restProps };
8
22
  </script>
9
23
 
10
24
  <button
11
- class={`${props.class} ${props.style} button ${color} ${size}`}
25
+ class={`${props.class} button padding-${p} ${color} ${size} ${style}`}
12
26
  on:click={onClick}
27
+ style={`background-color: ${bg}`}
13
28
  {disabled}
14
29
  >
15
30
  <slot>{label}</slot>
@@ -19,7 +34,7 @@ let props = { ...$$restProps };
19
34
  .button {
20
35
  border: none;
21
36
  border-radius: 4px;
22
- font-size: 16px;
37
+ font-size: 1rem;
23
38
  font-weight: bold;
24
39
  padding: 8px 16px;
25
40
  cursor: pointer;
@@ -36,20 +51,45 @@ let props = { ...$$restProps };
36
51
  background-color: #28a745;
37
52
  color: #fff;
38
53
  }
39
- .small {
54
+
55
+ .xsm {
56
+ font-size: 8px;
57
+ padding: 2px 4px;
58
+ }
59
+
60
+ .sm {
40
61
  font-size: 12px;
41
62
  padding: 4px 8px;
42
63
  }
43
- .medium {
64
+
65
+ .md {
44
66
  font-size: 16px;
45
67
  padding: 8px 16px;
46
68
  }
47
- .large {
69
+
70
+ .lg {
48
71
  font-size: 24px;
49
72
  padding: 12px 24px;
50
73
  }
74
+
75
+ .xl {
76
+ font-size: 32px;
77
+ padding: 16px 32px;
78
+ }
79
+
80
+ .xxl {
81
+ font-size: 48px;
82
+ padding: 24px 48px;
83
+ }
84
+
85
+ .xxxl {
86
+ font-size: 64px;
87
+ padding: 32px 64px;
88
+ }
89
+
51
90
  .button:hover {
52
91
  opacity: 0.94;
92
+ transition: 0.2s ease-in-out;
53
93
  }
54
94
  button:disabled {
55
95
  cursor: not-allowed;
@@ -58,4 +98,20 @@ let props = { ...$$restProps };
58
98
  button:disabled:hover {
59
99
  opacity: 0.5;
60
100
  }
101
+
102
+ .padding-1 {
103
+ padding: 2px 4px;
104
+ }
105
+
106
+ .padding-2 {
107
+ padding: 4px 8px;
108
+ }
109
+
110
+ .padding-3 {
111
+ padding: 8px 16px;
112
+ }
113
+
114
+ .padding-4 {
115
+ padding: 16px 32px;
116
+ }
61
117
  </style>
@@ -1,11 +1,13 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+
3
+ export type ButtonSize = 'xsm' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
2
4
  declare const __propDef: {
3
5
  props: {
4
6
  [x: string]: any;
5
7
  label?: string | undefined;
6
8
  onClick?: (() => void) | undefined;
7
9
  color?: string | undefined;
8
- size?: string | undefined;
10
+ size?: ButtonSize | undefined;
9
11
  disabled?: boolean | undefined;
10
12
  };
11
13
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sve-ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -47,5 +47,22 @@
47
47
  "svelte": "./dist/index.js",
48
48
  "types": "./dist/index.d.ts",
49
49
  "type": "module",
50
- "license": "MIT"
50
+ "license": "MIT",
51
+ "author": "Rodrigo Abregu <me@rodriab.io> (https://rodriab.io/)",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/rodriabregu/sve-ui.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/rodriabregu/sve-ui/issues"
58
+ },
59
+ "description": "Sve-UI is a collection of customizable UI components for Svelte applications. These components are designed to be easy to use and highly flexible, allowing developers to quickly build beautiful interfaces. Sve-UI includes buttons, forms, modals, and other commonly used UI elements, all built with Svelte's lightweight and efficient framework.",
60
+ "keywords": [
61
+ "components",
62
+ "svelte",
63
+ "kit",
64
+ "ui",
65
+ "vite",
66
+ "component library"
67
+ ]
51
68
  }