sve-ui 0.0.9 → 0.1.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.
@@ -0,0 +1,38 @@
1
+ <script>export let p = 0;
2
+ export let padding = 0;
3
+ export let m = 0;
4
+ export let margin = 0;
5
+ export let w = "";
6
+ export let width = "";
7
+ export let h = "";
8
+ export let height = "";
9
+ export let bg = "transparent";
10
+ export let backgroundColor = "transparent";
11
+ export let color = "inherit";
12
+ export let border = "none";
13
+ export let br = "";
14
+ export let borderRadius = "";
15
+ export let d = "";
16
+ export let display = "";
17
+ export let fontSize = 1;
18
+ export let style = "";
19
+ </script>
20
+
21
+ <div
22
+ style={`
23
+ padding: ${p || padding}rem;
24
+ margin: ${m || margin}rem;
25
+ width: ${w || width || 'auto'};
26
+ height: ${h || height || 'auto'};
27
+ background-color: ${bg || backgroundColor};
28
+ color: ${color};
29
+ border: ${border};
30
+ border-radius: ${br || borderRadius || 'none'};
31
+ display: ${d || display};
32
+ font-size: ${fontSize}rem;
33
+ ${style}
34
+ `}
35
+ {...$$restProps}
36
+ >
37
+ <slot />
38
+ </div>
@@ -1,23 +1,124 @@
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
1
  import { SvelteComponentTyped } from "svelte";
14
2
  declare const __propDef: {
15
3
  props: {
16
- [x: string]: never;
4
+ /**
5
+ * @default 0
6
+ * @description The padding around the box.
7
+ * @type number | undefined
8
+ */
9
+ p?: number | undefined;
10
+ /**
11
+ * @default 0
12
+ * @description The padding around the box.
13
+ * @type number | undefined
14
+ */
15
+ padding?: number | undefined;
16
+ /**
17
+ * @default 0
18
+ * @description The margin around the box.
19
+ * @type number | undefined
20
+ */
21
+ m?: number | undefined;
22
+ /**
23
+ * @default 0
24
+ * @description The margin around the box.
25
+ * @type number | undefined
26
+ */
27
+ margin?: number | undefined;
28
+ /**
29
+ * @default undefined
30
+ * @description The width of the box.
31
+ * @type string | undefined
32
+ */
33
+ w?: string | undefined;
34
+ /**
35
+ * @default undefined
36
+ * @description The width of the box.
37
+ * @type string | undefined
38
+ */
39
+ width?: string | undefined;
40
+ /**
41
+ * @default undefined
42
+ * @description The height of the box.
43
+ * @type string | undefined
44
+ */
45
+ h?: string | undefined;
46
+ /**
47
+ * @default undefined
48
+ * @description The height of the box.
49
+ * @type string | undefined
50
+ */
51
+ height?: string | undefined;
52
+ /**
53
+ * @default undefined
54
+ * @description The background color of the box.
55
+ * @type string | undefined
56
+ */
57
+ bg?: string | undefined;
58
+ /**
59
+ * @default undefined
60
+ * @description The background color of the box.
61
+ * @type string | undefined
62
+ */
63
+ backgroundColor?: string | undefined;
64
+ /**
65
+ * @default 'white'
66
+ * @description The color of the text.
67
+ * @type string | undefined
68
+ */
69
+ color?: string | undefined;
70
+ /**
71
+ * @default undefined
72
+ * @description The border of the box.
73
+ * @type string | undefined
74
+ */
75
+ border?: string | undefined;
76
+ /**
77
+ * @default undefined
78
+ * @description The border radius of the box.
79
+ * @type string | undefined
80
+ */
81
+ br?: string | undefined;
82
+ /**
83
+ * @default undefined
84
+ * @description The border radius of the box.
85
+ * @type string | undefined
86
+ */
87
+ borderRadius?: string | undefined;
88
+ /**
89
+ * @default undefined
90
+ * @description The display of the box.
91
+ * @type string | undefined
92
+ */
93
+ d?: string | undefined;
94
+ /**
95
+ * @default undefined
96
+ * @description The display of the box.
97
+ * @type string | undefined
98
+ */
99
+ display?: string | undefined;
100
+ /**
101
+ * @default undefined
102
+ * @description Style of the box.
103
+ * @type string | undefined
104
+ */
105
+ style?: string | undefined;
17
106
  };
18
107
  events: {
19
108
  [evt: string]: CustomEvent<any>;
20
109
  };
21
- slots: {};
110
+ slots: {
111
+ default: {};
112
+ };
22
113
  };
23
- export {};
114
+ export type BoxProps = typeof __propDef.props;
115
+ export type BoxEvents = typeof __propDef.events;
116
+ export type BoxSlots = typeof __propDef.slots;
117
+
118
+ /**
119
+ * A box component is used to create a container for other components. Is a wrapper for the HTML div element.
120
+ * @see Docs https://sveui.org/components/box
121
+ */
122
+ export default class Box extends SvelteComponentTyped<BoxProps, BoxEvents, BoxSlots> {
123
+ }
124
+ export { Box, BoxProps };
@@ -0,0 +1,10 @@
1
+ <script>export let width = "100%";
2
+ export let height = "100%";
3
+ </script>
4
+
5
+ <div
6
+ style="display: flex; justify-content: center; align-items: center; width: {width}; height: {height}"
7
+ {...$$restProps}
8
+ >
9
+ <slot />
10
+ </div>
@@ -0,0 +1,20 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ width?: string | undefined;
6
+ height?: string | undefined;
7
+ };
8
+ events: {
9
+ [evt: string]: CustomEvent<any>;
10
+ };
11
+ slots: {
12
+ default: {};
13
+ };
14
+ };
15
+ export type CenterProps = typeof __propDef.props;
16
+ export type CenterEvents = typeof __propDef.events;
17
+ export type CenterSlots = typeof __propDef.slots;
18
+ export default class Center extends SvelteComponentTyped<CenterProps, CenterEvents, CenterSlots> {
19
+ }
20
+ export {};
@@ -0,0 +1,9 @@
1
+ <script>
2
+ import Square from '../Square/Square.svelte';
3
+
4
+ export let size = '1rem';
5
+ </script>
6
+
7
+ <Square {size} borderRadius="100%" {...$$restProps}>
8
+ <slot />
9
+ </Square>
@@ -0,0 +1,29 @@
1
+ /** @typedef {typeof __propDef.props} CircleProps */
2
+ /** @typedef {typeof __propDef.events} CircleEvents */
3
+ /** @typedef {typeof __propDef.slots} CircleSlots */
4
+ export default class Circle extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ size?: string | undefined;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {
10
+ default: {};
11
+ }> {
12
+ }
13
+ export type CircleProps = typeof __propDef.props;
14
+ export type CircleEvents = typeof __propDef.events;
15
+ export type CircleSlots = typeof __propDef.slots;
16
+ import { SvelteComponentTyped } from "svelte";
17
+ declare const __propDef: {
18
+ props: {
19
+ [x: string]: any;
20
+ size?: string | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {
26
+ default: {};
27
+ };
28
+ };
29
+ export {};
@@ -0,0 +1,26 @@
1
+ <script>import Box from "../Box/Box.svelte";
2
+ export let dir = "row";
3
+ export let direction = "row";
4
+ export let justify = "flex-start";
5
+ export let align = "stretch";
6
+ export let wrap = "nowrap";
7
+ export let gap = 0;
8
+ export let d = "";
9
+ export let display = "";
10
+ export let style = "";
11
+ </script>
12
+
13
+ <Box
14
+ style={`
15
+ display: ${d || display || 'flex'};
16
+ flex-direction: ${dir || direction};
17
+ justify-content: ${justify};
18
+ align-items: ${align};
19
+ flex-wrap: ${wrap};
20
+ gap: ${gap}rem;
21
+ ${style}
22
+ `}
23
+ {...$$restProps}
24
+ >
25
+ <slot />
26
+ </Box>
@@ -0,0 +1,30 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { BoxProps } from '../Box/Box.svelte';
3
+
4
+ declare const __propDef: {
5
+ props: {
6
+ [x: string]: any;
7
+ dir?: string | undefined;
8
+ direction?: string | undefined;
9
+ justify?: string | undefined;
10
+ align?: string | undefined;
11
+ wrap?: string | undefined;
12
+ gap?: number | undefined;
13
+ d?: string | undefined;
14
+ display?: string | undefined;
15
+ style?: string | undefined;
16
+ } & BoxProps;
17
+ events: {
18
+ [evt: string]: CustomEvent<any>;
19
+ };
20
+ slots: {
21
+ // eslint-disable-next-line @typescript-eslint/ban-types
22
+ default: {};
23
+ };
24
+ };
25
+ export type FlexProps = typeof __propDef.props;
26
+ export type FlexEvents = typeof __propDef.events;
27
+ export type FlexSlots = typeof __propDef.slots;
28
+ export default class Flex extends SvelteComponentTyped<FlexProps, FlexEvents, FlexSlots> {
29
+ }
30
+ export { Flex, FlexProps };
@@ -0,0 +1,4 @@
1
+ <script>export let size = 1;
2
+ </script>
3
+
4
+ <div style={`width: ${size}rem; height: ${size}rem;`} />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ size?: number | undefined;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type SpacerProps = typeof __propDef.props;
12
+ export type SpacerEvents = typeof __propDef.events;
13
+ export type SpacerSlots = typeof __propDef.slots;
14
+ export default class Spacer extends SvelteComponentTyped<SpacerProps, SpacerEvents, SpacerSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,17 @@
1
+ <script>
2
+ import Flex from '../Flex/Flex.svelte';
3
+
4
+ export let size = '1rem';
5
+ </script>
6
+
7
+ <Flex
8
+ d="flex"
9
+ align="center"
10
+ justify="center"
11
+ color={'white'}
12
+ width={size}
13
+ height={size}
14
+ {...$$restProps}
15
+ >
16
+ <slot />
17
+ </Flex>
@@ -0,0 +1,29 @@
1
+ /** @typedef {typeof __propDef.props} SquareProps */
2
+ /** @typedef {typeof __propDef.events} SquareEvents */
3
+ /** @typedef {typeof __propDef.slots} SquareSlots */
4
+ export default class Square extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ size?: string | undefined;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {
10
+ default: {};
11
+ }> {
12
+ }
13
+ export type SquareProps = typeof __propDef.props;
14
+ export type SquareEvents = typeof __propDef.events;
15
+ export type SquareSlots = typeof __propDef.slots;
16
+ import { SvelteComponentTyped } from "svelte";
17
+ declare const __propDef: {
18
+ props: {
19
+ [x: string]: any;
20
+ size?: string | undefined;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {
26
+ default: {};
27
+ };
28
+ };
29
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,2 +1,12 @@
1
- export { default as Button } from "./components/Button/Button.svelte";
2
- export { default as CodeExample } from "./components/CodeExample/CodeExample.svelte";
1
+ export { default as Button } from './components/Button/Button.svelte';
2
+ export type { ButtonProps } from './components/Button/Button.svelte';
3
+ export { default as CodeExample } from './components/CodeExample/CodeExample.svelte';
4
+ export type { CodeExampleProps } from './components/CodeExample/CodeExample.svelte';
5
+ export { default as Box } from './components/Box/Box.svelte';
6
+ export type { BoxProps } from './components/Box/Box.svelte';
7
+ export { default as Flex } from './components/Flex/Flex.svelte';
8
+ export type { FlexProps } from './components/Flex/Flex.svelte';
9
+ export { default as Center } from './components/Center/Center.svelte';
10
+ export { default as Spacer } from './components/Spacer/Spacer.svelte';
11
+ export { default as Square } from './components/Square/Square.svelte';
12
+ export { default as Circle } from './components/Circle/Circle.svelte';
package/dist/index.js CHANGED
@@ -1,3 +1,9 @@
1
1
  // Reexport your entry components here
2
2
  export { default as Button } from './components/Button/Button.svelte';
3
3
  export { default as CodeExample } from './components/CodeExample/CodeExample.svelte';
4
+ export { default as Box } from './components/Box/Box.svelte';
5
+ export { default as Flex } from './components/Flex/Flex.svelte';
6
+ export { default as Center } from './components/Center/Center.svelte';
7
+ export { default as Spacer } from './components/Spacer/Spacer.svelte';
8
+ export { default as Square } from './components/Square/Square.svelte';
9
+ export { default as Circle } from './components/Circle/Circle.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sve-ui",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",