@groundbrick/svelte-ui 0.1.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.
- package/README.md +125 -0
- package/dist/components/Alert.svelte +335 -0
- package/dist/components/Alert.svelte.d.ts +24 -0
- package/dist/components/AutocompleteInput.svelte +356 -0
- package/dist/components/AutocompleteInput.svelte.d.ts +72 -0
- package/dist/components/Badge.svelte +185 -0
- package/dist/components/Badge.svelte.d.ts +20 -0
- package/dist/components/Button.svelte +415 -0
- package/dist/components/Button.svelte.d.ts +34 -0
- package/dist/components/Card.svelte +181 -0
- package/dist/components/Card.svelte.d.ts +24 -0
- package/dist/components/CardBody.svelte +78 -0
- package/dist/components/CardBody.svelte.d.ts +12 -0
- package/dist/components/CardFooter.svelte +81 -0
- package/dist/components/CardFooter.svelte.d.ts +14 -0
- package/dist/components/CardHeader.svelte +186 -0
- package/dist/components/CardHeader.svelte.d.ts +21 -0
- package/dist/components/Col.svelte +172 -0
- package/dist/components/Col.svelte.d.ts +26 -0
- package/dist/components/Container.svelte +118 -0
- package/dist/components/Container.svelte.d.ts +14 -0
- package/dist/components/Drawer.svelte +233 -0
- package/dist/components/Drawer.svelte.d.ts +13 -0
- package/dist/components/Dropdown.svelte +190 -0
- package/dist/components/Dropdown.svelte.d.ts +26 -0
- package/dist/components/DropdownItem.svelte +103 -0
- package/dist/components/DropdownItem.svelte.d.ts +22 -0
- package/dist/components/DurationInput.svelte +170 -0
- package/dist/components/DurationInput.svelte.d.ts +27 -0
- package/dist/components/EditableTable.svelte +647 -0
- package/dist/components/EditableTable.svelte.d.ts +74 -0
- package/dist/components/EmptyState.svelte +192 -0
- package/dist/components/EmptyState.svelte.d.ts +22 -0
- package/dist/components/FormField.svelte +260 -0
- package/dist/components/FormField.svelte.d.ts +68 -0
- package/dist/components/GridView.svelte +1022 -0
- package/dist/components/GridView.svelte.d.ts +38 -0
- package/dist/components/GridView.types.d.ts +28 -0
- package/dist/components/GridView.types.js +1 -0
- package/dist/components/LoadingSpinner.svelte +253 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +17 -0
- package/dist/components/Modal.svelte +473 -0
- package/dist/components/Modal.svelte.d.ts +42 -0
- package/dist/components/PhoneInput.svelte +406 -0
- package/dist/components/PhoneInput.svelte.d.ts +31 -0
- package/dist/components/PhotoUpload.svelte +529 -0
- package/dist/components/PhotoUpload.svelte.d.ts +46 -0
- package/dist/components/Row.svelte +153 -0
- package/dist/components/Row.svelte.d.ts +18 -0
- package/dist/icons/PawPrintIcon.svelte +41 -0
- package/dist/icons/PawPrintIcon.svelte.d.ts +14 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +49 -0
- package/dist/styles/forms.css +182 -0
- package/dist/styles/tokens.css +243 -0
- package/dist/utils/duration.d.ts +20 -0
- package/dist/utils/duration.js +40 -0
- package/dist/utils/scrollLock.d.ts +7 -0
- package/dist/utils/scrollLock.js +26 -0
- package/package.json +66 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
interface CardBodyProps {
|
|
5
|
+
/** Conteúdo do corpo do card */
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
/** Padding do corpo */
|
|
8
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
9
|
+
/** Classes CSS adicionais */
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
padding = 'md',
|
|
16
|
+
class: additionalClasses = ''
|
|
17
|
+
}: CardBodyProps = $props();
|
|
18
|
+
|
|
19
|
+
const bodyClass = $derived([
|
|
20
|
+
'ap-card-body',
|
|
21
|
+
padding !== 'md' ? `ap-card-body-padding-${padding}` : '',
|
|
22
|
+
additionalClasses
|
|
23
|
+
].filter(Boolean).join(' '));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class={bodyClass}>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
/* ============================================
|
|
32
|
+
CARD BODY - AgendaPet Design System
|
|
33
|
+
============================================ */
|
|
34
|
+
.ap-card-body {
|
|
35
|
+
padding: 1.25rem;
|
|
36
|
+
background-color: transparent;
|
|
37
|
+
color: var(--color-text);
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ===== PADDING VARIANTS ===== */
|
|
42
|
+
.ap-card-body-padding-none {
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ap-card-body-padding-sm {
|
|
47
|
+
padding: 0.875rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ap-card-body-padding-lg {
|
|
51
|
+
padding: 1.5rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ===== TYPOGRAPHY ===== */
|
|
55
|
+
.ap-card-body :global(h3) {
|
|
56
|
+
font-size: var(--font-size-base);
|
|
57
|
+
font-weight: var(--font-weight-medium);
|
|
58
|
+
margin-bottom: 0.375rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ap-card-body :global(p) {
|
|
62
|
+
color: var(--color-text-muted);
|
|
63
|
+
font-size: var(--font-size-sm);
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
margin: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ===== RESPONSIVE ===== */
|
|
69
|
+
@media (max-width: 640px) {
|
|
70
|
+
.ap-card-body {
|
|
71
|
+
padding: 1rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ap-card-body-padding-lg {
|
|
75
|
+
padding: 1.25rem;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
interface CardBodyProps {
|
|
3
|
+
/** Conteúdo do corpo do card */
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
/** Padding do corpo */
|
|
6
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Classes CSS adicionais */
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CardBody: import("svelte").Component<CardBodyProps, {}, "">;
|
|
11
|
+
type CardBody = ReturnType<typeof CardBody>;
|
|
12
|
+
export default CardBody;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
interface CardFooterProps {
|
|
5
|
+
/** Conteúdo do footer do card */
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
/** Mostrar borda superior */
|
|
8
|
+
bordered?: boolean;
|
|
9
|
+
/** Alinhamento do conteúdo */
|
|
10
|
+
align?: 'start' | 'center' | 'end' | 'between';
|
|
11
|
+
/** Classes CSS adicionais */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
bordered = true,
|
|
18
|
+
align = 'start',
|
|
19
|
+
class: additionalClasses = ''
|
|
20
|
+
}: CardFooterProps = $props();
|
|
21
|
+
|
|
22
|
+
const alignClasses: Record<string, string> = {
|
|
23
|
+
start: 'ap-card-footer-start',
|
|
24
|
+
center: 'ap-card-footer-center',
|
|
25
|
+
end: 'ap-card-footer-end',
|
|
26
|
+
between: 'ap-card-footer-between'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const footerClass = $derived([
|
|
30
|
+
'ap-card-footer',
|
|
31
|
+
bordered ? 'ap-card-footer-bordered' : '',
|
|
32
|
+
alignClasses[align],
|
|
33
|
+
additionalClasses
|
|
34
|
+
].filter(Boolean).join(' '));
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div class={footerClass}>
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
/* ============================================
|
|
43
|
+
CARD FOOTER - AgendaPet Design System
|
|
44
|
+
============================================ */
|
|
45
|
+
.ap-card-footer {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 0.5rem;
|
|
49
|
+
padding: 0.875rem 1.25rem;
|
|
50
|
+
background: var(--color-bg-surface-2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ap-card-footer-bordered {
|
|
54
|
+
border-top: 1px solid var(--color-border-subtle);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ===== ALIGNMENT ===== */
|
|
58
|
+
.ap-card-footer-start {
|
|
59
|
+
justify-content: flex-start;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ap-card-footer-center {
|
|
63
|
+
justify-content: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ap-card-footer-end {
|
|
67
|
+
justify-content: flex-end;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ap-card-footer-between {
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ===== RESPONSIVE ===== */
|
|
75
|
+
@media (max-width: 640px) {
|
|
76
|
+
.ap-card-footer {
|
|
77
|
+
padding: 0.75rem 1rem;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
interface CardFooterProps {
|
|
3
|
+
/** Conteúdo do footer do card */
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
/** Mostrar borda superior */
|
|
6
|
+
bordered?: boolean;
|
|
7
|
+
/** Alinhamento do conteúdo */
|
|
8
|
+
align?: 'start' | 'center' | 'end' | 'between';
|
|
9
|
+
/** Classes CSS adicionais */
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const CardFooter: import("svelte").Component<CardFooterProps, {}, "">;
|
|
13
|
+
type CardFooter = ReturnType<typeof CardFooter>;
|
|
14
|
+
export default CardFooter;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
type CardHeaderVariant = "default" | "primary" | "success" | "warning" | "danger" | "info" | "gradient";
|
|
5
|
+
|
|
6
|
+
interface CardHeaderProps {
|
|
7
|
+
/** Título do card */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Subtítulo/descrição do card */
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
/** Conteúdo customizado do header */
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
/** Ações do header (botões, links, etc.) */
|
|
14
|
+
actions?: Snippet;
|
|
15
|
+
/** Mostrar borda inferior */
|
|
16
|
+
bordered?: boolean;
|
|
17
|
+
/** Variante de cor do header */
|
|
18
|
+
variant?: CardHeaderVariant;
|
|
19
|
+
/** Classes CSS adicionais */
|
|
20
|
+
class?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
title,
|
|
25
|
+
subtitle,
|
|
26
|
+
children,
|
|
27
|
+
actions,
|
|
28
|
+
bordered = true,
|
|
29
|
+
variant = "default",
|
|
30
|
+
class: additionalClasses = "",
|
|
31
|
+
}: CardHeaderProps = $props();
|
|
32
|
+
|
|
33
|
+
const headerClass = $derived([
|
|
34
|
+
"ap-card-header",
|
|
35
|
+
bordered ? "ap-card-header-bordered" : "",
|
|
36
|
+
variant !== "default" ? `ap-card-header-${variant}` : "",
|
|
37
|
+
additionalClasses
|
|
38
|
+
].filter(Boolean).join(" "));
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<div class={headerClass}>
|
|
42
|
+
<div class="ap-card-header-content">
|
|
43
|
+
{#if title}
|
|
44
|
+
<h5 class="ap-card-title">{title}</h5>
|
|
45
|
+
{/if}
|
|
46
|
+
{#if subtitle}
|
|
47
|
+
<p class="ap-card-subtitle">{subtitle}</p>
|
|
48
|
+
{/if}
|
|
49
|
+
{#if children}
|
|
50
|
+
{@render children()}
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
53
|
+
{#if actions}
|
|
54
|
+
<div class="ap-card-header-actions">
|
|
55
|
+
{@render actions()}
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
/* ============================================
|
|
62
|
+
CARD HEADER - AgendaPet Design System
|
|
63
|
+
============================================ */
|
|
64
|
+
.ap-card-header {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: var(--spacing-md);
|
|
69
|
+
padding: 1rem 1.25rem;
|
|
70
|
+
background-color: var(--color-bg-surface);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ap-card-header-bordered {
|
|
74
|
+
border-bottom: 1px solid var(--color-border-subtle);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ap-card-header-content {
|
|
78
|
+
flex: 1;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
align-items: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ap-card-title {
|
|
86
|
+
font-size: var(--font-size-base);
|
|
87
|
+
font-weight: var(--font-weight-medium);
|
|
88
|
+
color: var(--color-text);
|
|
89
|
+
margin: 0;
|
|
90
|
+
line-height: 1.4;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ap-card-subtitle {
|
|
94
|
+
font-size: var(--font-size-sm);
|
|
95
|
+
color: var(--color-text-muted);
|
|
96
|
+
margin: var(--spacing-xs) 0 0 0;
|
|
97
|
+
line-height: 1.4;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ap-card-header-actions {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: var(--spacing-sm);
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* ===== GRADIENT VARIANT (Default for cards with icon) ===== */
|
|
108
|
+
.ap-card-header-gradient {
|
|
109
|
+
background: linear-gradient(135deg,
|
|
110
|
+
rgba(21, 185, 255, 0.08) 0%,
|
|
111
|
+
rgba(123, 63, 242, 0.08) 50%,
|
|
112
|
+
rgba(228, 20, 255, 0.06) 100%
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ap-card-header-gradient .ap-card-title {
|
|
117
|
+
background: var(--gradient-brand);
|
|
118
|
+
-webkit-background-clip: text;
|
|
119
|
+
-webkit-text-fill-color: transparent;
|
|
120
|
+
background-clip: text;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ===== SEMANTIC VARIANTS ===== */
|
|
124
|
+
.ap-card-header-primary {
|
|
125
|
+
background-color: rgba(123, 63, 242, 0.08);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ap-card-header-primary .ap-card-title {
|
|
129
|
+
color: var(--color-primary);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ap-card-header-success {
|
|
133
|
+
background-color: var(--color-success-bg);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ap-card-header-success .ap-card-title {
|
|
137
|
+
color: var(--color-success-text);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ap-card-header-warning {
|
|
141
|
+
background-color: var(--color-warning-bg);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ap-card-header-warning .ap-card-title {
|
|
145
|
+
color: var(--color-warning-text);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ap-card-header-danger {
|
|
149
|
+
background-color: var(--color-danger-bg);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ap-card-header-danger .ap-card-title {
|
|
153
|
+
color: var(--color-danger-text);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ap-card-header-info {
|
|
157
|
+
background-color: var(--color-info-bg);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ap-card-header-info .ap-card-title {
|
|
161
|
+
color: var(--color-info-text);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* ===== RESPONSIVE ===== */
|
|
165
|
+
@media (max-width: 768px) {
|
|
166
|
+
.ap-card-header {
|
|
167
|
+
flex-wrap: wrap;
|
|
168
|
+
gap: var(--spacing-sm);
|
|
169
|
+
padding: 0.75rem 1rem;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.ap-card-header-actions {
|
|
173
|
+
flex-shrink: 1;
|
|
174
|
+
flex-wrap: wrap;
|
|
175
|
+
gap: var(--spacing-xs);
|
|
176
|
+
width: 100%;
|
|
177
|
+
justify-content: flex-end;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@media (max-width: 576px) {
|
|
182
|
+
.ap-card-header-actions {
|
|
183
|
+
justify-content: flex-start;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type CardHeaderVariant = "default" | "primary" | "success" | "warning" | "danger" | "info" | "gradient";
|
|
3
|
+
interface CardHeaderProps {
|
|
4
|
+
/** Título do card */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** Subtítulo/descrição do card */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** Conteúdo customizado do header */
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
/** Ações do header (botões, links, etc.) */
|
|
11
|
+
actions?: Snippet;
|
|
12
|
+
/** Mostrar borda inferior */
|
|
13
|
+
bordered?: boolean;
|
|
14
|
+
/** Variante de cor do header */
|
|
15
|
+
variant?: CardHeaderVariant;
|
|
16
|
+
/** Classes CSS adicionais */
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const CardHeader: import("svelte").Component<CardHeaderProps, {}, "">;
|
|
20
|
+
type CardHeader = ReturnType<typeof CardHeader>;
|
|
21
|
+
export default CardHeader;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
interface ColProps {
|
|
5
|
+
/** Largura em todas as telas (1-12) */
|
|
6
|
+
span?: number;
|
|
7
|
+
/** Largura em telas extra pequenas (<576px) */
|
|
8
|
+
xs?: number;
|
|
9
|
+
/** Largura em telas pequenas (576px+) */
|
|
10
|
+
sm?: number;
|
|
11
|
+
/** Largura em telas médias (768px+) */
|
|
12
|
+
md?: number;
|
|
13
|
+
/** Largura em telas grandes (992px+) */
|
|
14
|
+
lg?: number;
|
|
15
|
+
/** Largura em telas extra grandes (1200px+) */
|
|
16
|
+
xl?: number;
|
|
17
|
+
/** Offset (deslocamento) */
|
|
18
|
+
offset?: number;
|
|
19
|
+
/** Auto width */
|
|
20
|
+
auto?: boolean;
|
|
21
|
+
/** Conteúdo da coluna */
|
|
22
|
+
children?: Snippet;
|
|
23
|
+
/** Classes CSS adicionais */
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
span,
|
|
29
|
+
xs,
|
|
30
|
+
sm,
|
|
31
|
+
md,
|
|
32
|
+
lg,
|
|
33
|
+
xl,
|
|
34
|
+
offset,
|
|
35
|
+
auto = false,
|
|
36
|
+
children,
|
|
37
|
+
class: additionalClasses = ''
|
|
38
|
+
}: ColProps = $props();
|
|
39
|
+
|
|
40
|
+
// Construir classes de coluna
|
|
41
|
+
const colClasses = [
|
|
42
|
+
auto ? 'col-auto' : span ? `col-${span}` : 'col',
|
|
43
|
+
xs ? `col-xs-${xs}` : '',
|
|
44
|
+
sm ? `col-sm-${sm}` : '',
|
|
45
|
+
md ? `col-md-${md}` : '',
|
|
46
|
+
lg ? `col-lg-${lg}` : '',
|
|
47
|
+
xl ? `col-xl-${xl}` : '',
|
|
48
|
+
offset ? `offset-${offset}` : '',
|
|
49
|
+
additionalClasses
|
|
50
|
+
].filter(Boolean).join(' ');
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<div class={colClasses}>
|
|
54
|
+
{@render children?.()}
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
/* Base Col - exatamente como Bootstrap 5 */
|
|
59
|
+
.col {
|
|
60
|
+
flex: 1 0 0%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.col-auto {
|
|
64
|
+
flex: 0 0 auto;
|
|
65
|
+
width: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Tamanhos de Coluna (1-12) - exatamente como Bootstrap 5 */
|
|
69
|
+
.col-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
70
|
+
.col-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
71
|
+
.col-3 { flex: 0 0 auto; width: 25%; }
|
|
72
|
+
.col-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
73
|
+
.col-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
74
|
+
.col-6 { flex: 0 0 auto; width: 50%; }
|
|
75
|
+
.col-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
76
|
+
.col-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
77
|
+
.col-9 { flex: 0 0 auto; width: 75%; }
|
|
78
|
+
.col-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
79
|
+
.col-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
80
|
+
.col-12 { flex: 0 0 auto; width: 100%; }
|
|
81
|
+
|
|
82
|
+
/* Offset */
|
|
83
|
+
.offset-1 { margin-left: 8.333333%; }
|
|
84
|
+
.offset-2 { margin-left: 16.666667%; }
|
|
85
|
+
.offset-3 { margin-left: 25%; }
|
|
86
|
+
.offset-4 { margin-left: 33.333333%; }
|
|
87
|
+
.offset-5 { margin-left: 41.666667%; }
|
|
88
|
+
.offset-6 { margin-left: 50%; }
|
|
89
|
+
.offset-7 { margin-left: 58.333333%; }
|
|
90
|
+
.offset-8 { margin-left: 66.666667%; }
|
|
91
|
+
.offset-9 { margin-left: 75%; }
|
|
92
|
+
.offset-10 { margin-left: 83.333333%; }
|
|
93
|
+
.offset-11 { margin-left: 91.666667%; }
|
|
94
|
+
|
|
95
|
+
/* Extra Small (default, <576px) */
|
|
96
|
+
.col-xs-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
97
|
+
.col-xs-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
98
|
+
.col-xs-3 { flex: 0 0 auto; width: 25%; }
|
|
99
|
+
.col-xs-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
100
|
+
.col-xs-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
101
|
+
.col-xs-6 { flex: 0 0 auto; width: 50%; }
|
|
102
|
+
.col-xs-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
103
|
+
.col-xs-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
104
|
+
.col-xs-9 { flex: 0 0 auto; width: 75%; }
|
|
105
|
+
.col-xs-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
106
|
+
.col-xs-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
107
|
+
.col-xs-12 { flex: 0 0 auto; width: 100%; }
|
|
108
|
+
|
|
109
|
+
/* Small (≥576px) */
|
|
110
|
+
@media (min-width: 576px) {
|
|
111
|
+
.col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
112
|
+
.col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
113
|
+
.col-sm-3 { flex: 0 0 auto; width: 25%; }
|
|
114
|
+
.col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
115
|
+
.col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
116
|
+
.col-sm-6 { flex: 0 0 auto; width: 50%; }
|
|
117
|
+
.col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
118
|
+
.col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
119
|
+
.col-sm-9 { flex: 0 0 auto; width: 75%; }
|
|
120
|
+
.col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
121
|
+
.col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
122
|
+
.col-sm-12 { flex: 0 0 auto; width: 100%; }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Medium (≥768px) */
|
|
126
|
+
@media (min-width: 768px) {
|
|
127
|
+
.col-md-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
128
|
+
.col-md-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
129
|
+
.col-md-3 { flex: 0 0 auto; width: 25%; }
|
|
130
|
+
.col-md-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
131
|
+
.col-md-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
132
|
+
.col-md-6 { flex: 0 0 auto; width: 50%; }
|
|
133
|
+
.col-md-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
134
|
+
.col-md-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
135
|
+
.col-md-9 { flex: 0 0 auto; width: 75%; }
|
|
136
|
+
.col-md-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
137
|
+
.col-md-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
138
|
+
.col-md-12 { flex: 0 0 auto; width: 100%; }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Large (≥992px) */
|
|
142
|
+
@media (min-width: 992px) {
|
|
143
|
+
.col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
144
|
+
.col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
145
|
+
.col-lg-3 { flex: 0 0 auto; width: 25%; }
|
|
146
|
+
.col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
147
|
+
.col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
148
|
+
.col-lg-6 { flex: 0 0 auto; width: 50%; }
|
|
149
|
+
.col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
150
|
+
.col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
151
|
+
.col-lg-9 { flex: 0 0 auto; width: 75%; }
|
|
152
|
+
.col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
153
|
+
.col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
154
|
+
.col-lg-12 { flex: 0 0 auto; width: 100%; }
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Extra Large (≥1200px) */
|
|
158
|
+
@media (min-width: 1200px) {
|
|
159
|
+
.col-xl-1 { flex: 0 0 auto; width: 8.333333%; }
|
|
160
|
+
.col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
|
|
161
|
+
.col-xl-3 { flex: 0 0 auto; width: 25%; }
|
|
162
|
+
.col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
|
|
163
|
+
.col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
|
|
164
|
+
.col-xl-6 { flex: 0 0 auto; width: 50%; }
|
|
165
|
+
.col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
|
|
166
|
+
.col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
|
|
167
|
+
.col-xl-9 { flex: 0 0 auto; width: 75%; }
|
|
168
|
+
.col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
|
|
169
|
+
.col-xl-11 { flex: 0 0 auto; width: 91.666667%; }
|
|
170
|
+
.col-xl-12 { flex: 0 0 auto; width: 100%; }
|
|
171
|
+
}
|
|
172
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
interface ColProps {
|
|
3
|
+
/** Largura em todas as telas (1-12) */
|
|
4
|
+
span?: number;
|
|
5
|
+
/** Largura em telas extra pequenas (<576px) */
|
|
6
|
+
xs?: number;
|
|
7
|
+
/** Largura em telas pequenas (576px+) */
|
|
8
|
+
sm?: number;
|
|
9
|
+
/** Largura em telas médias (768px+) */
|
|
10
|
+
md?: number;
|
|
11
|
+
/** Largura em telas grandes (992px+) */
|
|
12
|
+
lg?: number;
|
|
13
|
+
/** Largura em telas extra grandes (1200px+) */
|
|
14
|
+
xl?: number;
|
|
15
|
+
/** Offset (deslocamento) */
|
|
16
|
+
offset?: number;
|
|
17
|
+
/** Auto width */
|
|
18
|
+
auto?: boolean;
|
|
19
|
+
/** Conteúdo da coluna */
|
|
20
|
+
children?: Snippet;
|
|
21
|
+
/** Classes CSS adicionais */
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Col: import("svelte").Component<ColProps, {}, "">;
|
|
25
|
+
type Col = ReturnType<typeof Col>;
|
|
26
|
+
export default Col;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
interface ContainerProps {
|
|
5
|
+
/** Tamanho máximo do container */
|
|
6
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fluid';
|
|
7
|
+
/** Padding vertical */
|
|
8
|
+
py?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
/** Conteúdo do container */
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
/** Classes CSS adicionais */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
size = '2xl',
|
|
17
|
+
py = 'md',
|
|
18
|
+
children,
|
|
19
|
+
class: additionalClasses = ''
|
|
20
|
+
}: ContainerProps = $props();
|
|
21
|
+
|
|
22
|
+
const sizeClasses: Record<string, string> = {
|
|
23
|
+
sm: 'container-sm',
|
|
24
|
+
md: 'container-md',
|
|
25
|
+
lg: 'container-lg',
|
|
26
|
+
xl: 'container-xl',
|
|
27
|
+
'2xl': 'container-2xl',
|
|
28
|
+
full: 'container-full',
|
|
29
|
+
fluid: 'container-fluid'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const pyClasses: Record<string, string> = {
|
|
33
|
+
none: '',
|
|
34
|
+
sm: 'py-2',
|
|
35
|
+
md: 'py-4',
|
|
36
|
+
lg: 'py-5',
|
|
37
|
+
xl: 'py-6'
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const containerClass = [
|
|
41
|
+
'container',
|
|
42
|
+
sizeClasses[size],
|
|
43
|
+
pyClasses[py],
|
|
44
|
+
additionalClasses
|
|
45
|
+
].filter(Boolean).join(' ');
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<div class={containerClass}>
|
|
49
|
+
{@render children?.()}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
.container {
|
|
54
|
+
width: 100%;
|
|
55
|
+
margin-left: auto;
|
|
56
|
+
margin-right: auto;
|
|
57
|
+
padding-left: var(--spacing-md);
|
|
58
|
+
padding-right: var(--spacing-md);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Tamanhos de Container */
|
|
62
|
+
.container-sm {
|
|
63
|
+
max-width: var(--container-sm);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.container-md {
|
|
67
|
+
max-width: var(--container-md);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.container-lg {
|
|
71
|
+
max-width: var(--container-lg);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.container-xl {
|
|
75
|
+
max-width: var(--container-xl);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.container-2xl {
|
|
79
|
+
max-width: var(--container-2xl);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.container-full {
|
|
83
|
+
max-width: 1400px; /* Igual ao header */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.container-fluid {
|
|
87
|
+
max-width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Padding Vertical */
|
|
91
|
+
.py-2 {
|
|
92
|
+
padding-top: var(--spacing-sm);
|
|
93
|
+
padding-bottom: var(--spacing-sm);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.py-4 {
|
|
97
|
+
padding-top: var(--spacing-lg);
|
|
98
|
+
padding-bottom: var(--spacing-lg);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.py-5 {
|
|
102
|
+
padding-top: var(--spacing-xl);
|
|
103
|
+
padding-bottom: var(--spacing-xl);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.py-6 {
|
|
107
|
+
padding-top: var(--spacing-2xl);
|
|
108
|
+
padding-bottom: var(--spacing-2xl);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Responsividade */
|
|
112
|
+
@media (max-width: 576px) {
|
|
113
|
+
.container {
|
|
114
|
+
padding-left: var(--spacing-sm);
|
|
115
|
+
padding-right: var(--spacing-sm);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|