duckylib 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 (37) hide show
  1. package/README.md +65 -0
  2. package/dist/components/buttons/LoginButton.svelte +56 -0
  3. package/dist/components/buttons/LoginButton.svelte.d.ts +7 -0
  4. package/dist/components/buttons/ThemeButton.svelte +126 -0
  5. package/dist/components/buttons/ThemeButton.svelte.d.ts +7 -0
  6. package/dist/components/buttons/UserToast.svelte +269 -0
  7. package/dist/components/buttons/UserToast.svelte.d.ts +7 -0
  8. package/dist/components/containers/Column.svelte +54 -0
  9. package/dist/components/containers/Column.svelte.d.ts +23 -0
  10. package/dist/components/containers/Row.svelte +53 -0
  11. package/dist/components/containers/Row.svelte.d.ts +23 -0
  12. package/dist/components/containers/Website.svelte +81 -0
  13. package/dist/components/containers/Website.svelte.d.ts +12 -0
  14. package/dist/components/containers/cards/InfoCard.svelte +78 -0
  15. package/dist/components/containers/cards/InfoCard.svelte.d.ts +8 -0
  16. package/dist/components/containers/cards/LinkCard.svelte +143 -0
  17. package/dist/components/containers/cards/LinkCard.svelte.d.ts +14 -0
  18. package/dist/components/containers/navigation/Footer.svelte +133 -0
  19. package/dist/components/containers/navigation/Footer.svelte.d.ts +13 -0
  20. package/dist/components/containers/navigation/Header.svelte +177 -0
  21. package/dist/components/containers/navigation/Header.svelte.d.ts +20 -0
  22. package/dist/components/text/Markdown.svelte +205 -0
  23. package/dist/components/text/Markdown.svelte.d.ts +5 -0
  24. package/dist/components/text/Symbol.svelte +17 -0
  25. package/dist/components/text/Symbol.svelte.d.ts +9 -0
  26. package/dist/components/text/Typewriter.svelte +47 -0
  27. package/dist/components/text/Typewriter.svelte.d.ts +6 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +15 -0
  30. package/dist/styles/emojis.css +10 -0
  31. package/dist/styles/fonts.css +226 -0
  32. package/dist/styles/globals.css +55 -0
  33. package/dist/styles/icons.css +27 -0
  34. package/dist/styles/theme.css +107 -0
  35. package/dist/types.d.ts +24 -0
  36. package/dist/types.js +5 -0
  37. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,65 @@
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
+ ```sh
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
+ To recreate this project with the same configuration:
20
+
21
+ ```sh
22
+ # recreate this project
23
+ npx sv create --template library --types ts --install npm .
24
+ ```
25
+
26
+ ## Developing
27
+
28
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
29
+
30
+ ```sh
31
+ npm run dev
32
+
33
+ # or start the server and open the app in a new browser tab
34
+ npm run dev -- --open
35
+ ```
36
+
37
+ Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
38
+
39
+ ## Building
40
+
41
+ To build your library:
42
+
43
+ ```sh
44
+ npm pack
45
+ ```
46
+
47
+ To create a production version of your showcase app:
48
+
49
+ ```sh
50
+ npm run build
51
+ ```
52
+
53
+ You can preview the production build with `npm run preview`.
54
+
55
+ > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
56
+
57
+ ## Publishing
58
+
59
+ 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/)).
60
+
61
+ To publish your library to [npm](https://www.npmjs.com):
62
+
63
+ ```sh
64
+ npm publish
65
+ ```
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ import Symbol from "../text/Symbol.svelte";
3
+
4
+ interface LoginButtonProps {
5
+ label?: string;
6
+ withIcon?: boolean;
7
+ }
8
+
9
+ let {label = "Log In", withIcon = true}: LoginButtonProps = $props();
10
+
11
+ function login() {
12
+ console.log("login")
13
+ }
14
+ </script>
15
+
16
+ <button onclick={login}>
17
+ {#if withIcon}<Symbol name="account_circle" inheritColor={true} sizePx={20} hoverEffect={false} />{/if}
18
+ <p class="font-bold">{label}</p>
19
+ </button>
20
+
21
+ <style>
22
+ @import url("$lib/styles/globals.css");
23
+
24
+ button {
25
+ cursor: pointer;
26
+
27
+ display: flex;
28
+ flex-direction: row;
29
+
30
+ align-items: center;
31
+ justify-content: center;
32
+
33
+ outline: none;
34
+ border: none;
35
+
36
+ padding: 0.1em 0.66em;
37
+ border-radius: var(--border-md);
38
+ background-color: var(--mantle);
39
+ color: var(--text);
40
+ gap: 0.66em;
41
+
42
+ font-size: 0.95em;
43
+ }
44
+
45
+ button:hover {
46
+ transition: all 0.2s;
47
+ transform: scale(1.02);
48
+ filter: brightness(1.1);
49
+ }
50
+
51
+ button:not(:hover) {
52
+ transition: all 0.2s;
53
+ transform: scale(1);
54
+ filter: brightness(1);
55
+ }
56
+ </style>
@@ -0,0 +1,7 @@
1
+ interface LoginButtonProps {
2
+ label?: string;
3
+ withIcon?: boolean;
4
+ }
5
+ declare const LoginButton: import("svelte").Component<LoginButtonProps, {}, "">;
6
+ type LoginButton = ReturnType<typeof LoginButton>;
7
+ export default LoginButton;
@@ -0,0 +1,126 @@
1
+ <script lang="ts">
2
+ import { browser } from "$app/environment";
3
+ import Symbol from "../text/Symbol.svelte";
4
+ import {getTheme} from "../../index.js"
5
+ import { onMount } from "svelte";
6
+
7
+ interface ThemeButtonProps {
8
+ mode: "icon_only" | "with_text";
9
+ changeTheme: (theme: string) => void;
10
+ }
11
+
12
+ let {mode, changeTheme}: ThemeButtonProps = $props();
13
+
14
+ const themeSymbolMap = {
15
+ "dark": "dark_mode",
16
+ "system": "desktop_windows",
17
+ "light": "light_mode",
18
+ }
19
+
20
+ const themesTooltipMap = {
21
+ "dark": "Dark Mode",
22
+ "light": "Light Mode",
23
+ "system": "Match System Theme"
24
+ }
25
+
26
+ let systemMode = browser ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "dark";
27
+
28
+ const themes: string[] = Object.keys(themeSymbolMap);
29
+
30
+ let theme = $state(getTheme());
31
+
32
+ onMount(() => {
33
+ if(browser) {
34
+ themes.filter(t => t !== (theme === "system" ? systemMode : theme)).forEach(t => document.body.classList.remove(t))
35
+ document.body.classList.add(theme === "system" ? systemMode : theme)
36
+ }
37
+ })
38
+
39
+ function switchTheme() {
40
+ let ind = themes.indexOf(theme) + 1;
41
+ if(!themes[ind]) ind = 0;
42
+ let it = themes[ind]
43
+ theme = it as any;
44
+ if(browser) {
45
+ window.localStorage.setItem("theme", it)
46
+
47
+ let ev = new CustomEvent("theme", {detail: {theme: it}})
48
+ window.dispatchEvent(ev);
49
+
50
+ themes.filter(t => t !== (theme === "system" ? systemMode : theme)).forEach(t => document.body.classList.remove(t))
51
+ document.body.classList.add(theme === "system" ? systemMode : theme)
52
+ }
53
+
54
+ changeTheme(it);
55
+
56
+ }
57
+ </script>
58
+
59
+ <button onclick={switchTheme} class="{mode} btn-{theme === "system" ? systemMode : theme}" title={themesTooltipMap[theme]} data-theme="{theme}">
60
+ {#if mode === "icon_only"}
61
+ <Symbol name={themeSymbolMap[theme]} inheritColor={true} />
62
+ {:else if mode === "with_text"}
63
+ <Symbol name={themeSymbolMap[theme]} inheritColor={true} sizePx={24} />
64
+ <p class="font-bold">{themesTooltipMap[theme]}</p>
65
+ {/if}
66
+ </button>
67
+
68
+ <style>
69
+ @import url("$lib/styles/globals.css");
70
+
71
+ button {
72
+ cursor: pointer;
73
+
74
+ display: flex;
75
+ flex-direction: row;
76
+
77
+ align-items: center;
78
+ justify-content: center;
79
+
80
+ outline: none;
81
+ border: none;
82
+
83
+ color: var(--text);
84
+ }
85
+
86
+ .icon_only {
87
+ background-color: transparent;
88
+
89
+ aspect-ratio: 1/1;
90
+ }
91
+
92
+ .icon_only[data-theme="dark"] {
93
+ color: var(--yellow);
94
+ }
95
+
96
+ .icon_only[data-theme="light"] {
97
+ color: var(--accent);
98
+ }
99
+
100
+ .icon_only[data-theme="system"] {
101
+ color: var(--teal)
102
+ }
103
+
104
+ .with_text {
105
+ padding: 0.2em 0.66em;
106
+ border-radius: var(--border-md);
107
+ background-color: var(--overlay-2);
108
+ color: var(--base);
109
+ gap: 0.66em;
110
+
111
+ font-size: 1em;
112
+ }
113
+
114
+ .btn-dark:not(.icon_only):not([data-theme="system"]) {
115
+ color: var(--yellow);
116
+ & {
117
+ p {
118
+ color: var(--base);
119
+ }
120
+ }
121
+ }
122
+
123
+ .btn-light:not(.icon_only) {
124
+ color: var(--surface-0);
125
+ }
126
+ </style>
@@ -0,0 +1,7 @@
1
+ interface ThemeButtonProps {
2
+ mode: "icon_only" | "with_text";
3
+ changeTheme: (theme: string) => void;
4
+ }
5
+ declare const ThemeButton: import("svelte").Component<ThemeButtonProps, {}, "">;
6
+ type ThemeButton = ReturnType<typeof ThemeButton>;
7
+ export default ThemeButton;
@@ -0,0 +1,269 @@
1
+ <script lang="ts">
2
+ import { browser } from "$app/environment";
3
+ import { goto } from "$app/navigation";
4
+ import { page } from "$app/state";
5
+ import { PUBLIC_TABLET_SIZE_PX } from "$env/static/public";
6
+ import type { Auth } from "../../types.js";
7
+ import { onMount } from "svelte";
8
+ import { MediaQuery } from "svelte/reactivity";
9
+ import Symbol from "../text/Symbol.svelte";
10
+ import Row from "../containers/Row.svelte";
11
+
12
+ interface UserToastProps {
13
+ user: Auth.User;
14
+ }
15
+
16
+ let { user }: UserToastProps = $props();
17
+
18
+ let showContextMenu = $state(false);
19
+
20
+ let switchingAccounts = $state(false);
21
+
22
+ let tabletQuery = new MediaQuery(`max-width:${PUBLIC_TABLET_SIZE_PX}px`);
23
+
24
+ let copystate: "copying" | "failed" | "success" | null = $state(null);
25
+
26
+ onMount(() => {
27
+ if (!user && browser) goto(`/login?from=${page.url.pathname}`);
28
+ });
29
+ </script>
30
+
31
+ <div>
32
+ {#if !tabletQuery.current}
33
+ <p class="font-bold">{user.username}</p>
34
+ {/if}
35
+ <!-- svelte-ignore a11y_invalid_attribute -->
36
+ <a
37
+ href="#"
38
+ onclick={() => {
39
+ showContextMenu = !showContextMenu;
40
+ }}
41
+ oncontextmenu={(ev) => {
42
+ ev.preventDefault();
43
+ showContextMenu = !showContextMenu;
44
+ }}
45
+ ><img
46
+ src={user.avatarUrl}
47
+ alt="avatar"
48
+ draggable="false"
49
+ title={user.username}
50
+ /></a
51
+ >
52
+ </div>
53
+
54
+ <contextmenu
55
+ style="visibility:{showContextMenu ? 'visible' : 'hidden'};"
56
+ class={showContextMenu ? "show" : "hide"}
57
+ >
58
+ {#if !switchingAccounts}
59
+ {#if tabletQuery.current}
60
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
61
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
62
+ <contextentry data-disabled="true" id="informative-username">
63
+ <span class="material-symbols-outlined">account_circle</span>
64
+ {user.username}
65
+ </contextentry>
66
+ {/if}
67
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
68
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
69
+ <contextentry
70
+ data-disabled="false"
71
+ id="log-out"
72
+ onclick={(e: any) => {}}
73
+ >
74
+ <span class="material-symbols-outlined">logout</span>
75
+ <red>Log Out</red>
76
+ </contextentry>
77
+ <hr />
78
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
79
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
80
+ <contextentry
81
+ data-disabled={copystate === "copying"}
82
+ id="informative-id"
83
+ title="Click to Copy"
84
+ onclick={async (e: CustomEvent) => {
85
+ let copied = false;
86
+ copystate = "copying";
87
+
88
+ if (browser) {
89
+ window.navigator.clipboard
90
+ .writeText(user.id)
91
+ .then(() => {
92
+ setTimeout(() => {
93
+ copied = true;
94
+ copystate = "success";
95
+ }, 2e2);
96
+ })
97
+ .catch((e) => {
98
+ copied = false;
99
+ copystate = "failed";
100
+ })
101
+ .finally(() => {
102
+ setTimeout(() => {
103
+ copystate = null;
104
+ }, 1e3);
105
+ });
106
+ }
107
+ }}
108
+ >
109
+ <!-- <span class="material-symbols-outlined">logout</span> -->
110
+ <Row widthPx="fit" gapEm={0.33}>
111
+ <p class="font-bold">ID:</p>
112
+ {#if copystate === null}
113
+ <p class="font-normal">(Click to Copy)</p>
114
+ {:else if copystate === "copying"}
115
+ <p class="font-bold yellow">Copying...</p>
116
+ {:else if copystate === "failed"}
117
+ <p class="font-bold red">Copy Failed</p>
118
+ {:else if copystate === "success"}
119
+ <p class="font-bold green">Copied!</p>
120
+ {/if}
121
+ <p class="font-normal" id="copy"></p>
122
+ </Row>
123
+ </contextentry>
124
+ {/if}
125
+ </contextmenu>
126
+
127
+ <style>
128
+ @import url("$lib/styles/globals.css");
129
+
130
+ red {
131
+ color: var(--red);
132
+ }
133
+
134
+ div {
135
+ display: flex;
136
+ flex-wrap: nowrap;
137
+ align-items: center;
138
+ justify-content: center;
139
+ gap: 0.33em;
140
+ }
141
+
142
+ p {
143
+ font-size: 1em;
144
+ }
145
+
146
+ img {
147
+ width: 2em;
148
+ aspect-ratio: 1/1;
149
+ border-radius: 100px;
150
+ cursor: pointer;
151
+ user-select: none;
152
+ }
153
+
154
+ @keyframes show {
155
+ from {
156
+ display: none;
157
+ opacity: 0;
158
+ top: 3em;
159
+ right: 0.33em;
160
+ }
161
+ to {
162
+ display: flex;
163
+ opacity: 1;
164
+ top: 3.66em;
165
+ right: 0.66em;
166
+ }
167
+ }
168
+
169
+ @keyframes hide {
170
+ from {
171
+ display: flex;
172
+ opacity: 1;
173
+ top: 3.66em;
174
+ right: 0.66em;
175
+ }
176
+ to {
177
+ display: none;
178
+ opacity: 0;
179
+ top: 3em;
180
+ right: 0.33em;
181
+ }
182
+ }
183
+
184
+ .show {
185
+ animation: show 0.1s ease-in forwards;
186
+ }
187
+
188
+ .hide {
189
+ animation: hide 0.1s ease-in forwards;
190
+ }
191
+
192
+ contextmenu hr {
193
+ height: 2px;
194
+ border-radius: 8px;
195
+ margin-left: auto;
196
+ margin-right: auto;
197
+ background-color: var(--overlay-0);
198
+ opacity: 0.6;
199
+ margin: 0.66em 0;
200
+ margin-left: 0.33em;
201
+ width: 92%;
202
+ border: none;
203
+ }
204
+
205
+ contextmenu {
206
+ /* display: flex; */
207
+ flex-direction: column;
208
+ align-items: flex-start;
209
+ justify-content: flex-start;
210
+ width: 250px;
211
+
212
+ position: absolute;
213
+ top: 3.66em;
214
+ right: 0.66em;
215
+
216
+ user-select: none;
217
+ background-color: var(--surface-0);
218
+ filter: drop-shadow(0 3px 5px 1px var(--crust));
219
+
220
+ padding: 0.33em 0.33em;
221
+
222
+ border-radius: 8px;
223
+
224
+ /* animation: ; */
225
+ }
226
+
227
+ contextentry {
228
+ transition: opacity 10s ease-out;
229
+ display: flex;
230
+ flex-direction: row;
231
+ align-items: center;
232
+ justify-content: flex-start;
233
+
234
+ gap: 0.66em;
235
+
236
+ width: 95%;
237
+ cursor: pointer;
238
+ padding: 0.1em 0.33em;
239
+ margin: 0.1em 0em;
240
+
241
+ border-radius: 8px;
242
+
243
+ font-family: "Noto Sans", sans-serif;
244
+ font-weight: 600;
245
+ font-size: 0.9em;
246
+ }
247
+
248
+ contextentry[data-disabled="true"]:not(:hover) {
249
+ transition: all 0.5s;
250
+ opacity: 0.5;
251
+ }
252
+
253
+ contextentry[data-disabled="true"]:hover {
254
+ transition: all 0.5s;
255
+ background: var(--overlay-0);
256
+ cursor: not-allowed;
257
+ opacity: 0.3;
258
+ }
259
+
260
+ contextentry:not([data-disabled="true"]):hover {
261
+ transition: all 0.5s;
262
+ background: var(--overlay-0);
263
+ }
264
+
265
+ contextentry:not([data-disabled="true"]):not(:hover) {
266
+ transition: all 0.5s;
267
+ background: transparent;
268
+ }
269
+ </style>
@@ -0,0 +1,7 @@
1
+ import type { Auth } from "../../types.ts";
2
+ interface UserToastProps {
3
+ user: Auth.User;
4
+ }
5
+ declare const UserToast: import("svelte").Component<UserToastProps, {}, "">;
6
+ type UserToast = ReturnType<typeof UserToast>;
7
+ export default UserToast;
@@ -0,0 +1,54 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+
4
+ interface ColumnProps {
5
+ children: Snippet;
6
+
7
+ justifyContent?: "center" | "flex-start" | "flex-end" | "space-between";
8
+ alignItems?: "center" | "flex-start" | "flex-end" | "space-between";
9
+ textAlign?: "center" | "left" | "right" | "justify";
10
+ gapEm?: number;
11
+ textWrap?: boolean;
12
+ flexWrap?: boolean;
13
+
14
+ backgroundColor?: string | "transparent";
15
+
16
+ borderRadiusPx?: number;
17
+ widthPx?: number | "fill" | "fit";
18
+ heightPx?: number | "fill" | "fit";
19
+ widthPercent?: number;
20
+ heightPercent?: number;
21
+
22
+ marginRightPx?: number | "auto";
23
+ marginLeftPx?: number | "auto";
24
+ marginTopPx?: number | "auto";
25
+ marginBottomPx?: number | "auto";
26
+ }
27
+
28
+ const { children, textWrap = false, flexWrap = false, justifyContent = "center", alignItems = "center", textAlign = "center", gapEm = 1, backgroundColor = "transparent", borderRadiusPx = 0, widthPx = "fill", heightPx = "fill", widthPercent = 0, heightPercent = 0, marginBottomPx = 0, marginLeftPx = 0, marginRightPx = 0, marginTopPx = 0 }: ColumnProps = $props();
29
+ </script>
30
+
31
+ <div style="{`
32
+ width: ${widthPercent !== 0 ? `${widthPercent}%` : widthPx === "fill" ? "100%" : widthPx === "fit" ? "auto" : `${widthPx}px`};
33
+ height: ${heightPercent !== 0 ? `${heightPercent}%` : heightPx === "fill" ? "100%" : heightPx === "fit" ? "auto" : `${heightPx}px`};
34
+ text-wrap: ${textWrap ? "wrap" : "nowrap"};
35
+ display: flex;
36
+ flex-direction: column;
37
+ flex-wrap: ${flexWrap ? "wrap" : "nowrap"};
38
+ justify-content: ${justifyContent};
39
+ align-items: ${alignItems};
40
+ gap: ${gapEm}em;
41
+ border-radius: ${borderRadiusPx}px;
42
+ text-align: ${textAlign};
43
+ margin-left: ${marginLeftPx === "auto" ? "auto" : `${marginLeftPx}px`};
44
+ margin-right: ${marginRightPx === "auto" ? "auto" : `${marginRightPx}px`};
45
+ margin-bottom: ${marginBottomPx === "auto" ? "auto" : `${marginBottomPx}px`};
46
+ margin-top: ${marginTopPx === "auto" ? "auto" : `${marginTopPx}px`};
47
+
48
+ `}">
49
+ {@render children()}
50
+ </div>
51
+
52
+ <style>
53
+ @import url("$lib/styles/globals.css");
54
+ </style>
@@ -0,0 +1,23 @@
1
+ import type { Snippet } from "svelte";
2
+ interface ColumnProps {
3
+ children: Snippet;
4
+ justifyContent?: "center" | "flex-start" | "flex-end" | "space-between";
5
+ alignItems?: "center" | "flex-start" | "flex-end" | "space-between";
6
+ textAlign?: "center" | "left" | "right" | "justify";
7
+ gapEm?: number;
8
+ textWrap?: boolean;
9
+ flexWrap?: boolean;
10
+ backgroundColor?: string | "transparent";
11
+ borderRadiusPx?: number;
12
+ widthPx?: number | "fill" | "fit";
13
+ heightPx?: number | "fill" | "fit";
14
+ widthPercent?: number;
15
+ heightPercent?: number;
16
+ marginRightPx?: number | "auto";
17
+ marginLeftPx?: number | "auto";
18
+ marginTopPx?: number | "auto";
19
+ marginBottomPx?: number | "auto";
20
+ }
21
+ declare const Column: import("svelte").Component<ColumnProps, {}, "">;
22
+ type Column = ReturnType<typeof Column>;
23
+ export default Column;
@@ -0,0 +1,53 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+
4
+ interface RowProps {
5
+ children: Snippet;
6
+
7
+ justifyContent?: "center" | "flex-start" | "flex-end" | "space-between";
8
+ alignItems?: "center" | "flex-start" | "flex-end" | "space-between";
9
+ textAlign?: "center" | "left" | "right" | "justify";
10
+ gapEm?: number;
11
+ textWrap?: boolean;
12
+ flexWrap?: boolean;
13
+
14
+ backgroundColor?: string | "transparent";
15
+
16
+ borderRadiusPx?: number;
17
+ widthPx?: number | "fill" | "fit";
18
+ heightPx?: number | "fill" | "fit";
19
+ widthPercent?: number;
20
+ heightPercent?: number;
21
+
22
+ marginRightPx?: number | "auto";
23
+ marginLeftPx?: number | "auto";
24
+ marginTopPx?: number | "auto";
25
+ marginBottomPx?: number | "auto";
26
+ }
27
+
28
+ const { children, textWrap = false, flexWrap = false,justifyContent = "center", alignItems = "center", textAlign = "center", gapEm = 1, backgroundColor = "transparent", borderRadiusPx = 0, widthPx = "fill", heightPx = "fill", widthPercent = 0, heightPercent = 0, marginBottomPx = 0, marginLeftPx = 0, marginRightPx = 0, marginTopPx = 0 }: RowProps = $props();
29
+ </script>
30
+
31
+ <div style="{`
32
+ width: ${widthPercent !== 0 ? `${widthPercent}%` : widthPx === "fill" ? "100%" : widthPx === "fit" ? "auto" : `${widthPx}px`};
33
+ height: ${heightPercent !== 0 ? `${heightPercent}%` : heightPx === "fill" ? "100%" : heightPx === "fit" ? "auto" : `${heightPx}px`};
34
+ text-wrap: ${textWrap ? "wrap" : "nowrap"};
35
+ display: flex;
36
+ flex-direction: row;
37
+ flex-wrap: ${flexWrap ? "wrap" : "nowrap"};
38
+ justify-content: ${justifyContent};
39
+ align-items: ${alignItems};
40
+ gap: ${gapEm}em;
41
+ border-radius: ${borderRadiusPx}px;
42
+ text-align: ${textAlign};
43
+ margin-left: ${marginLeftPx === "auto" ? "auto" : `${marginLeftPx}px`};
44
+ margin-right: ${marginRightPx === "auto" ? "auto" : `${marginRightPx}px`};
45
+ margin-bottom: ${marginBottomPx === "auto" ? "auto" : `${marginBottomPx}px`};
46
+ margin-top: ${marginTopPx === "auto" ? "auto" : `${marginTopPx}px`};
47
+ `}">
48
+ {@render children()}
49
+ </div>
50
+
51
+ <style>
52
+ @import url("$lib/styles/globals.css");
53
+ </style>