@celar-ui/svelte 0.0.1

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.
Files changed (58) hide show
  1. package/README.md +58 -0
  2. package/dist/buttons/BaseButton.svelte +48 -0
  3. package/dist/buttons/BaseButton.svelte.d.ts +7 -0
  4. package/dist/buttons/ElevatedButton.svelte +27 -0
  5. package/dist/buttons/ElevatedButton.svelte.d.ts +4 -0
  6. package/dist/buttons/FilledButton.svelte +27 -0
  7. package/dist/buttons/FilledButton.svelte.d.ts +4 -0
  8. package/dist/buttons/IconButton.svelte +56 -0
  9. package/dist/buttons/IconButton.svelte.d.ts +4 -0
  10. package/dist/buttons/OutlinedButton.svelte +24 -0
  11. package/dist/buttons/OutlinedButton.svelte.d.ts +4 -0
  12. package/dist/buttons/TextBaseButton.svelte +64 -0
  13. package/dist/buttons/TextBaseButton.svelte.d.ts +8 -0
  14. package/dist/buttons/TextButton.svelte +21 -0
  15. package/dist/buttons/TextButton.svelte.d.ts +4 -0
  16. package/dist/containment/Avatar.svelte +38 -0
  17. package/dist/containment/Avatar.svelte.d.ts +11 -0
  18. package/dist/containment/Breadcrumb.svelte +34 -0
  19. package/dist/containment/Breadcrumb.svelte.d.ts +4 -0
  20. package/dist/containment/Card.svelte +13 -0
  21. package/dist/containment/Card.svelte.d.ts +4 -0
  22. package/dist/containment/Container.svelte +37 -0
  23. package/dist/containment/Container.svelte.d.ts +10 -0
  24. package/dist/containment/Spacer.svelte +40 -0
  25. package/dist/containment/Spacer.svelte.d.ts +12 -0
  26. package/dist/index.d.ts +25 -0
  27. package/dist/index.js +26 -0
  28. package/dist/inputs/Checkbox.svelte +70 -0
  29. package/dist/inputs/Checkbox.svelte.d.ts +8 -0
  30. package/dist/inputs/ColorInput.svelte +71 -0
  31. package/dist/inputs/ColorInput.svelte.d.ts +8 -0
  32. package/dist/inputs/FileInput.svelte +55 -0
  33. package/dist/inputs/FileInput.svelte.d.ts +9 -0
  34. package/dist/inputs/RadioGroup.svelte +17 -0
  35. package/dist/inputs/RadioGroup.svelte.d.ts +8 -0
  36. package/dist/inputs/RadioItem.svelte +53 -0
  37. package/dist/inputs/RadioItem.svelte.d.ts +8 -0
  38. package/dist/inputs/Slider.svelte +101 -0
  39. package/dist/inputs/Slider.svelte.d.ts +4 -0
  40. package/dist/inputs/Switch.svelte +75 -0
  41. package/dist/inputs/Switch.svelte.d.ts +8 -0
  42. package/dist/inputs/TextInput.svelte +96 -0
  43. package/dist/inputs/TextInput.svelte.d.ts +8 -0
  44. package/dist/misc/DotSpinner.svelte +75 -0
  45. package/dist/misc/DotSpinner.svelte.d.ts +7 -0
  46. package/dist/misc/DuckSpinner.svelte +209 -0
  47. package/dist/misc/DuckSpinner.svelte.d.ts +8 -0
  48. package/dist/misc/Gap.svelte +16 -0
  49. package/dist/misc/Gap.svelte.d.ts +6 -0
  50. package/dist/navigation/AppBar.svelte +61 -0
  51. package/dist/navigation/AppBar.svelte.d.ts +10 -0
  52. package/dist/navigation/NavigationBar.svelte +46 -0
  53. package/dist/navigation/NavigationBar.svelte.d.ts +4 -0
  54. package/dist/navigation/NavigationBarButton.svelte +58 -0
  55. package/dist/navigation/NavigationBarButton.svelte.d.ts +10 -0
  56. package/dist/overlay/Dialog.svelte +133 -0
  57. package/dist/overlay/Dialog.svelte.d.ts +16 -0
  58. package/package.json +71 -0
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # Svelte library
2
+
3
+ Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
+
5
+ Read more about creating a library [in the docs](https://svelte.dev/docs/kit/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
+ npx sv create
14
+
15
+ # create a new project in my-app
16
+ npx sv create 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://svelte.dev/docs/kit/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
+ ```
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import { Button, type ButtonRootProps } from 'bits-ui';
3
+
4
+ export type BaseButtonProps = ButtonRootProps & {
5
+ loading?: boolean;
6
+ };
7
+
8
+ let { children, ...rest }: BaseButtonProps = $props();
9
+ </script>
10
+
11
+ <Button.Root {...rest}>
12
+ {#if children}
13
+ {@render children()}
14
+ {/if}
15
+ </Button.Root>
16
+
17
+ <style>:global([data-button-root]) {
18
+ display: inline-block;
19
+ position: relative;
20
+ box-sizing: border-box;
21
+ padding: 0;
22
+ margin: 0;
23
+ transition-duration: var(--transition-dur);
24
+ transition-property: opacity;
25
+ cursor: pointer;
26
+ border: none;
27
+ width: -moz-fit-content;
28
+ width: fit-content;
29
+ height: -moz-fit-content;
30
+ height: fit-content;
31
+ color: inherit;
32
+ font-size: inherit;
33
+ font-family: inherit;
34
+ -webkit-user-select: none;
35
+ -moz-user-select: none;
36
+ user-select: none;
37
+ text-decoration: none;
38
+ -webkit-tap-highlight-color: transparent;
39
+ }
40
+ :global([data-button-root]):not(:disabled):active {
41
+ top: 1px;
42
+ }
43
+ :global([data-button-root]):not([data-active=true]):disabled {
44
+ opacity: 0.5;
45
+ }
46
+ :global([data-button-root]):disabled {
47
+ cursor: default;
48
+ }</style>
@@ -0,0 +1,7 @@
1
+ import { type ButtonRootProps } from 'bits-ui';
2
+ export type BaseButtonProps = ButtonRootProps & {
3
+ loading?: boolean;
4
+ };
5
+ declare const BaseButton: import("svelte").Component<BaseButtonProps, {}, "">;
6
+ type BaseButton = ReturnType<typeof BaseButton>;
7
+ export default BaseButton;
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import TextBaseButton from './TextBaseButton.svelte';
3
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
4
+
5
+ let props: TextBaseButtonProps = $props();
6
+ </script>
7
+
8
+ <TextBaseButton {...props} data-button-elevated />
9
+
10
+ <style>:global([data-button-elevated]) {
11
+ transition-duration: var(--transition-dur);
12
+ transition-property: background-color, box-shadow, opacity;
13
+ box-shadow: 0 2px 2px var(--color-shadow);
14
+ background-color: var(--color-primary--lighter);
15
+ }
16
+ :global([data-button-elevated]):not(:disabled, [data-active=true]):hover {
17
+ box-shadow: 0 2px 4px var(--color-shadow--strong);
18
+ background-color: var(--color-primary--light);
19
+ }
20
+ :global([data-button-elevated]):not(:disabled):active {
21
+ box-shadow: 0 2px 2px var(--color-shadow--strong);
22
+ }
23
+
24
+ :global([data-button-elevated][data-active="true"]) {
25
+ box-shadow: 0 2px 2px var(--color-shadow--strong);
26
+ background-color: var(--color-alt);
27
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
2
+ declare const ElevatedButton: import("svelte").Component<TextBaseButtonProps, {}, "">;
3
+ type ElevatedButton = ReturnType<typeof ElevatedButton>;
4
+ export default ElevatedButton;
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import TextBaseButton from './TextBaseButton.svelte';
3
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
4
+
5
+ let props: TextBaseButtonProps = $props();
6
+ </script>
7
+
8
+ <TextBaseButton {...props} data-button-filled />
9
+
10
+ <style>:global([data-button-filled]) {
11
+ transition-duration: var(--transition-dur);
12
+ transition-property: background-color, box-shadow, opacity;
13
+ background-color: var(--color-primary);
14
+ }
15
+ :global([data-button-filled]):not(:disabled, [data-active=true]):hover {
16
+ background-color: var(--color-primary--dark);
17
+ box-shadow: 0 2px 4px var(--color-shadow--strong);
18
+ }
19
+ :global([data-button-filled]):not(:disabled):active {
20
+ box-shadow: 0 2px 2px var(--color-shadow--strong);
21
+ }
22
+
23
+ :global([data-button-elevated][data-active="true"]) {
24
+ box-shadow: 0 2px 2px var(--color-shadow--strong);
25
+ background-color: var(--vuuui-color-alt--darker);
26
+ color: var(--vuuui-color-bg);
27
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
2
+ declare const FilledButton: import("svelte").Component<TextBaseButtonProps, {}, "">;
3
+ type FilledButton = ReturnType<typeof FilledButton>;
4
+ export default FilledButton;
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ import DotSpinner from '../misc/DotSpinner.svelte';
3
+ import BaseButton from './BaseButton.svelte';
4
+ import type { BaseButtonProps } from './BaseButton.svelte';
5
+
6
+ let { children, ...rest }: BaseButtonProps = $props();
7
+ </script>
8
+
9
+ {#snippet baseChildren()}
10
+ <div class="button-body" style:visibility={rest.loading ? 'hidden' : 'initial'}>
11
+ {#if children}
12
+ {@render children()}
13
+ {/if}
14
+ </div>
15
+
16
+ {#if rest.loading}
17
+ <div class="button-spinner">
18
+ <DotSpinner size="24px" color="var(--color-primary--text)" />
19
+ </div>
20
+ {/if}
21
+ {/snippet}
22
+
23
+ <BaseButton {...rest} children={baseChildren} data-button-icon />
24
+
25
+ <style>:global([data-button-icon]) {
26
+ flex-grow: 0;
27
+ flex-shrink: 0;
28
+ transition-duration: var(--transition-dur);
29
+ transition-property: background-color, opacity, color;
30
+ border-radius: 50%;
31
+ background-color: transparent;
32
+ padding: var(--gap--half);
33
+ aspect-ratio: 1/1;
34
+ line-height: 1;
35
+ }
36
+ :global([data-button-icon]) .button-spinner {
37
+ display: flex;
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ justify-content: center;
42
+ align-items: center;
43
+ width: 100%;
44
+ height: 100%;
45
+ }
46
+ :global([data-button-icon]) .button-body {
47
+ line-height: 0;
48
+ }
49
+ :global([data-button-icon]):not(:disabled, [data-active=true]):hover {
50
+ background-color: var(--color-primary--light);
51
+ }
52
+
53
+ :global([data-button-icon][data-active="true"]) {
54
+ background-color: var(--color-alt);
55
+ color: var(--color-primary--text);
56
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { BaseButtonProps } from './BaseButton.svelte';
2
+ declare const IconButton: import("svelte").Component<BaseButtonProps, {}, "">;
3
+ type IconButton = ReturnType<typeof IconButton>;
4
+ export default IconButton;
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import TextBaseButton from './TextBaseButton.svelte';
3
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
4
+
5
+ let props: TextBaseButtonProps = $props();
6
+ </script>
7
+
8
+ <TextBaseButton {...props} data-button-outlined />
9
+
10
+ <style>:global([data-button-outlined]) {
11
+ transition-duration: var(--transition-dur);
12
+ transition-property: background-color, border-color;
13
+ background-color: transparent;
14
+ border: 1px solid var(--color-primary--light);
15
+ }
16
+ :global([data-button-outlined]):not(:disabled, [data-active=true]):hover {
17
+ background-color: var(--color-primary--light);
18
+ border-color: var(--color-primary);
19
+ }
20
+
21
+ :global([data-button-text][data-active="true"]) {
22
+ background-color: var(--color-alt);
23
+ border-color: var(--color-primary);
24
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
2
+ declare const OutlinedButton: import("svelte").Component<TextBaseButtonProps, {}, "">;
3
+ type OutlinedButton = ReturnType<typeof OutlinedButton>;
4
+ export default OutlinedButton;
@@ -0,0 +1,64 @@
1
+ <script lang="ts">
2
+ import BaseButton from './BaseButton.svelte';
3
+ import DotSpinner from '../misc/DotSpinner.svelte';
4
+ import type { BaseButtonProps } from './BaseButton.svelte';
5
+ import type { Snippet } from 'svelte';
6
+
7
+ export type TextBaseButtonProps = BaseButtonProps & {
8
+ icon?: Snippet;
9
+ };
10
+
11
+ let { children, loading, icon, ...rest }: TextBaseButtonProps = $props();
12
+ </script>
13
+
14
+ {#snippet baseChildren()}
15
+ <div class="button-body" style:visibility={loading ? 'hidden' : 'initial'}>
16
+ {#if icon}
17
+ <span class="button-icon">
18
+ {@render icon()}
19
+ </span>
20
+ {/if}
21
+
22
+ <span class="button-content">
23
+ {#if children}
24
+ {@render children()}
25
+ {/if}
26
+ </span>
27
+ </div>
28
+
29
+ {#if loading}
30
+ <div class="button-spinner">
31
+ <DotSpinner size="24px" color="var(--color-primary--text)" />
32
+ </div>
33
+ {/if}
34
+ {/snippet}
35
+
36
+ <BaseButton {...rest} children={baseChildren} {loading} data-button-base-text />
37
+
38
+ <style>:global([data-button-base-text]) {
39
+ border-radius: var(--radius);
40
+ }
41
+
42
+ .button-body {
43
+ display: flex;
44
+ align-items: center;
45
+ gap: var(--gap--half);
46
+ padding: 0 var(--gap);
47
+ }
48
+ .button-body .button-content {
49
+ padding: var(--gap--half) 0;
50
+ }
51
+ .button-body .button-icon {
52
+ line-height: 0;
53
+ }
54
+
55
+ .button-spinner {
56
+ display: flex;
57
+ position: absolute;
58
+ top: 0;
59
+ left: 0;
60
+ justify-content: center;
61
+ align-items: center;
62
+ width: 100%;
63
+ height: 100%;
64
+ }</style>
@@ -0,0 +1,8 @@
1
+ import type { BaseButtonProps } from './BaseButton.svelte';
2
+ import type { Snippet } from 'svelte';
3
+ export type TextBaseButtonProps = BaseButtonProps & {
4
+ icon?: Snippet;
5
+ };
6
+ declare const TextBaseButton: import("svelte").Component<TextBaseButtonProps, {}, "">;
7
+ type TextBaseButton = ReturnType<typeof TextBaseButton>;
8
+ export default TextBaseButton;
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import TextBaseButton from './TextBaseButton.svelte';
3
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
4
+
5
+ let props: TextBaseButtonProps = $props();
6
+ </script>
7
+
8
+ <TextBaseButton {...props} data-button-text />
9
+
10
+ <style>:global([data-button-text]) {
11
+ transition-duration: var(--transition-dur);
12
+ transition-property: background-color;
13
+ background-color: transparent;
14
+ }
15
+ :global([data-button-text]):not(:disabled, [data-active=true]):hover {
16
+ background-color: var(--color-primary--light);
17
+ }
18
+
19
+ :global([data-button-text][data-active="true"]) {
20
+ background-color: var(--color-alt);
21
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { TextBaseButtonProps } from './TextBaseButton.svelte';
2
+ declare const TextButton: import("svelte").Component<TextBaseButtonProps, {}, "">;
3
+ type TextButton = ReturnType<typeof TextButton>;
4
+ export default TextButton;
@@ -0,0 +1,38 @@
1
+ <script lang="ts">
2
+ import { Avatar, type AvatarRootProps } from 'bits-ui';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ export type AvatarProps = AvatarRootProps & {
6
+ src: string;
7
+ size?: string;
8
+ alt?: string;
9
+ fallback?: Snippet;
10
+ };
11
+
12
+ let { size = '64px', src, alt, fallback, ...rest }: AvatarProps = $props();
13
+ </script>
14
+
15
+ <Avatar.Root {...rest} style="--size: {size}">
16
+ <Avatar.Image {src} {alt} />
17
+ <Avatar.Fallback>
18
+ {#if fallback}
19
+ {@render fallback()}
20
+ {/if}
21
+ </Avatar.Fallback>
22
+ </Avatar.Root>
23
+
24
+ <style>:global([data-avatar-root]) {
25
+ display: block;
26
+ position: relative;
27
+ background-color: var(--vuuui-color-bg-info);
28
+ aspect-ratio: 1;
29
+ width: var(--size);
30
+ }
31
+
32
+ :global([data-avatar-image], [data-avatar-fallback]) {
33
+ -o-object-fit: cover;
34
+ object-fit: cover;
35
+ border-radius: 50%;
36
+ width: 100%;
37
+ height: 100%;
38
+ }</style>
@@ -0,0 +1,11 @@
1
+ import { Avatar, type AvatarRootProps } from 'bits-ui';
2
+ import type { Snippet } from 'svelte';
3
+ export type AvatarProps = AvatarRootProps & {
4
+ src: string;
5
+ size?: string;
6
+ alt?: string;
7
+ fallback?: Snippet;
8
+ };
9
+ declare const Avatar: import("svelte").Component<AvatarProps, {}, "">;
10
+ type Avatar = ReturnType<typeof Avatar>;
11
+ export default Avatar;
@@ -0,0 +1,34 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+
4
+ let { children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
5
+ </script>
6
+
7
+ <div {...rest} data-breadcrumb>
8
+ {#if children}
9
+ {@render children()}
10
+ {/if}
11
+ </div>
12
+
13
+ <style>:global([data-breadcrumb]) {
14
+ position: relative;
15
+ padding: 0;
16
+ margin: 0;
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ :global([data-breadcrumb] > a) {
21
+ padding: 0;
22
+ margin: 0;
23
+ color: var(--color-text-info);
24
+ text-decoration: none;
25
+ }
26
+ :global([data-breadcrumb] > a):not(:last-child)::after {
27
+ content: "/";
28
+ color: var(--color-text);
29
+ padding: 0 var(--gap--half);
30
+ }
31
+ :global([data-breadcrumb] > a):last-child {
32
+ pointer-events: none;
33
+ color: var(--color-primary--dark);
34
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const Breadcrumb: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type Breadcrumb = ReturnType<typeof Breadcrumb>;
4
+ export default Breadcrumb;
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import Container from './Container.svelte';
3
+ import type { ContainerProps } from './Container.svelte';
4
+
5
+ let props: ContainerProps = $props();
6
+ </script>
7
+
8
+ <Container {...props} data-card />
9
+
10
+ <style>:global([data-card]) {
11
+ box-shadow: 0 var(--gap--sm) var(--gap) var(--color-shadow--md);
12
+ background-color: var(--color-bg);
13
+ }</style>
@@ -0,0 +1,4 @@
1
+ import type { ContainerProps } from './Container.svelte';
2
+ declare const Card: import("svelte").Component<ContainerProps, {}, "">;
3
+ type Card = ReturnType<typeof Card>;
4
+ export default Card;
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+
4
+ export interface ContainerProps extends HTMLAttributes<HTMLElement> {
5
+ xs?: boolean;
6
+ sm?: boolean;
7
+ md?: boolean;
8
+ fluid?: boolean;
9
+ }
10
+
11
+ let { children, xs, sm, md, fluid, ...rest }: ContainerProps = $props();
12
+ </script>
13
+
14
+ <section {...rest} data-container data-xs={xs} data-sm={sm} data-md={md} data-fluid={fluid}>
15
+ {#if children}
16
+ {@render children()}
17
+ {/if}
18
+ </section>
19
+
20
+ <style>[data-container] {
21
+ position: relative;
22
+ margin: 0 auto;
23
+ border-radius: var(--radius);
24
+ padding: var(--gap);
25
+ }
26
+ [data-container][data-xs=true] {
27
+ max-width: var(--break--xs);
28
+ }
29
+ [data-container][data-sm=true] {
30
+ max-width: var(--break--sm);
31
+ }
32
+ [data-container][data-md=true] {
33
+ max-width: var(--break--md);
34
+ }
35
+ [data-container][data-fluid=true] {
36
+ width: 100%;
37
+ }</style>
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ export interface ContainerProps extends HTMLAttributes<HTMLElement> {
3
+ xs?: boolean;
4
+ sm?: boolean;
5
+ md?: boolean;
6
+ fluid?: boolean;
7
+ }
8
+ declare const Container: import("svelte").Component<ContainerProps, {}, "">;
9
+ type Container = ReturnType<typeof Container>;
10
+ export default Container;
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import type { Property } from 'csstype';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ export interface SpacerProps extends HTMLAttributes<HTMLDivElement> {
6
+ gap?: Property.Gap;
7
+ wrap?: Property.FlexWrap;
8
+ justify?: Property.JustifyContent;
9
+ align?: Property.AlignItems;
10
+ direction?: Property.FlexDirection;
11
+ }
12
+
13
+ let { children, gap, wrap, justify, align, direction, ...rest }: SpacerProps = $props();
14
+ </script>
15
+
16
+ <div
17
+ {...rest}
18
+ data-spacer
19
+ style:gap
20
+ style:flex-wrap={wrap}
21
+ style:justify-content={justify}
22
+ style:align-items={align}
23
+ style:flex-direction={direction}
24
+ >
25
+ {#if children}
26
+ {@render children()}
27
+ {/if}
28
+ </div>
29
+
30
+ <style>[data-spacer] {
31
+ padding: 0;
32
+ margin: 0;
33
+ box-sizing: border-box;
34
+ display: flex;
35
+ position: relative;
36
+ flex-wrap: wrap;
37
+ justify-content: flex-start;
38
+ align-items: flex-start;
39
+ gap: var(--gap--half);
40
+ }</style>
@@ -0,0 +1,12 @@
1
+ import type { Property } from 'csstype';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ export interface SpacerProps extends HTMLAttributes<HTMLDivElement> {
4
+ gap?: Property.Gap;
5
+ wrap?: Property.FlexWrap;
6
+ justify?: Property.JustifyContent;
7
+ align?: Property.AlignItems;
8
+ direction?: Property.FlexDirection;
9
+ }
10
+ declare const Spacer: import("svelte").Component<SpacerProps, {}, "">;
11
+ type Spacer = ReturnType<typeof Spacer>;
12
+ export default Spacer;
@@ -0,0 +1,25 @@
1
+ export { default as TextButton } from './buttons/TextButton.svelte';
2
+ export { default as ElevatedButton } from './buttons/ElevatedButton.svelte';
3
+ export { default as FilledButton } from './buttons/FilledButton.svelte';
4
+ export { default as OutlinedButton } from './buttons/OutlinedButton.svelte';
5
+ export { default as IconButton } from './buttons/IconButton.svelte';
6
+ export { default as Container } from './containment/Container.svelte';
7
+ export { default as Spacer } from './containment/Spacer.svelte';
8
+ export { default as Card } from './containment/Card.svelte';
9
+ export { default as Breadcrumb } from './containment/Breadcrumb.svelte';
10
+ export { default as Avatar } from './containment/Avatar.svelte';
11
+ export { default as Dialog } from './overlay/Dialog.svelte';
12
+ export { default as Gap } from './misc/Gap.svelte';
13
+ export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
14
+ export { default as DotSpinner } from './misc/DotSpinner.svelte';
15
+ export { default as TextInput } from './inputs/TextInput.svelte';
16
+ export { default as FileInput } from './inputs/FileInput.svelte';
17
+ export { default as ColorInput } from './inputs/ColorInput.svelte';
18
+ export { default as Checkbox } from './inputs/Checkbox.svelte';
19
+ export { default as RadioGroup } from './inputs/RadioGroup.svelte';
20
+ export { default as RadioItem } from './inputs/RadioItem.svelte';
21
+ export { default as Switch } from './inputs/Switch.svelte';
22
+ export { default as Slider } from './inputs/Slider.svelte';
23
+ export { default as AppBar } from './navigation/AppBar.svelte';
24
+ export { default as NavigationBar } from './navigation/NavigationBar.svelte';
25
+ export { default as NavigationBarButton } from './navigation/NavigationBarButton.svelte';
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ // Reexport your entry components here
2
+ export { default as TextButton } from './buttons/TextButton.svelte';
3
+ export { default as ElevatedButton } from './buttons/ElevatedButton.svelte';
4
+ export { default as FilledButton } from './buttons/FilledButton.svelte';
5
+ export { default as OutlinedButton } from './buttons/OutlinedButton.svelte';
6
+ export { default as IconButton } from './buttons/IconButton.svelte';
7
+ export { default as Container } from './containment/Container.svelte';
8
+ export { default as Spacer } from './containment/Spacer.svelte';
9
+ export { default as Card } from './containment/Card.svelte';
10
+ export { default as Breadcrumb } from './containment/Breadcrumb.svelte';
11
+ export { default as Avatar } from './containment/Avatar.svelte';
12
+ export { default as Dialog } from './overlay/Dialog.svelte';
13
+ export { default as Gap } from './misc/Gap.svelte';
14
+ export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
15
+ export { default as DotSpinner } from './misc/DotSpinner.svelte';
16
+ export { default as TextInput } from './inputs/TextInput.svelte';
17
+ export { default as FileInput } from './inputs/FileInput.svelte';
18
+ export { default as ColorInput } from './inputs/ColorInput.svelte';
19
+ export { default as Checkbox } from './inputs/Checkbox.svelte';
20
+ export { default as RadioGroup } from './inputs/RadioGroup.svelte';
21
+ export { default as RadioItem } from './inputs/RadioItem.svelte';
22
+ export { default as Switch } from './inputs/Switch.svelte';
23
+ export { default as Slider } from './inputs/Slider.svelte';
24
+ export { default as AppBar } from './navigation/AppBar.svelte';
25
+ export { default as NavigationBar } from './navigation/NavigationBar.svelte';
26
+ export { default as NavigationBarButton } from './navigation/NavigationBarButton.svelte';