@ainsleydev/sveltekit-helper 0.2.1 → 0.3.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 +7 -7
- package/dist/components/Grid/Column.svelte +4 -0
- package/dist/components/Grid/Column.svelte.d.ts +4 -0
- package/dist/components/Grid/Column.svelte.d.ts.map +1 -1
- package/dist/components/Grid/Container.svelte +22 -0
- package/dist/components/Grid/Container.svelte.d.ts +22 -0
- package/dist/components/Grid/Container.svelte.d.ts.map +1 -1
- package/dist/components/Grid/Row.svelte +4 -0
- package/dist/components/Grid/Row.svelte.d.ts +4 -0
- package/dist/components/Grid/Row.svelte.d.ts.map +1 -1
- package/dist/components/Hamburger.svelte +9 -0
- package/dist/components/Hamburger.svelte.d.ts +9 -0
- package/dist/components/Hamburger.svelte.d.ts.map +1 -1
- package/dist/components/Sidebar.svelte +18 -3
- package/dist/components/Sidebar.svelte.d.ts +15 -0
- package/dist/components/Sidebar.svelte.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/notifications/Alert.svelte +154 -0
- package/dist/components/notifications/Alert.svelte.d.ts +44 -0
- package/dist/components/notifications/Alert.svelte.d.ts.map +1 -0
- package/dist/components/notifications/Notice.svelte +123 -0
- package/dist/components/notifications/Notice.svelte.d.ts +33 -0
- package/dist/components/notifications/Notice.svelte.d.ts.map +1 -0
- package/dist/components/notifications/alertIcons.d.ts +18 -0
- package/dist/components/notifications/alertIcons.d.ts.map +1 -0
- package/dist/components/notifications/alertIcons.js +10 -0
- package/dist/components/notifications/index.d.ts +5 -0
- package/dist/components/notifications/index.d.ts.map +1 -0
- package/dist/components/notifications/index.js +2 -0
- package/dist/components/payload/PayloadForm.svelte +8 -8
- package/dist/scss/_border-radius.scss +21 -0
- package/dist/scss/_breakpoints.scss +10 -0
- package/dist/scss/_functions.scss +6 -0
- package/dist/scss/_index.scss +5 -0
- package/dist/scss/_mixins.scss +155 -0
- package/dist/scss/_sizes.scss +25 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -219,13 +219,13 @@ Override CSS variables globally from `:root`:
|
|
|
219
219
|
:root {
|
|
220
220
|
--sidebar-width: 400px;
|
|
221
221
|
--sidebar-min-width: 300px;
|
|
222
|
-
--sidebar-
|
|
222
|
+
--sidebar-bg: #1a1a1a;
|
|
223
223
|
--sidebar-border-colour: rgba(255, 255, 255, 0.2);
|
|
224
224
|
--sidebar-overlay-colour: #000;
|
|
225
225
|
--sidebar-overlay-opacity: 0.5;
|
|
226
226
|
|
|
227
227
|
/* Toggle button */
|
|
228
|
-
--sidebar-toggle-
|
|
228
|
+
--sidebar-toggle-bg: #2a2a2a;
|
|
229
229
|
--sidebar-toggle-colour: #fff;
|
|
230
230
|
--sidebar-toggle-padding: 0.5rem 1.5rem;
|
|
231
231
|
--sidebar-toggle-radius: 8px;
|
|
@@ -239,7 +239,7 @@ Override CSS variables globally from `:root`:
|
|
|
239
239
|
Or use inline styles:
|
|
240
240
|
|
|
241
241
|
```svelte
|
|
242
|
-
<Sidebar style="--sidebar-
|
|
242
|
+
<Sidebar style="--sidebar-bg: #2a2a2a; --sidebar-width: 400px">
|
|
243
243
|
<nav>...</nav>
|
|
244
244
|
</Sidebar>
|
|
245
245
|
```
|
|
@@ -359,13 +359,13 @@ Override CSS variables globally:
|
|
|
359
359
|
--form-input-border: 1px solid #e5e7eb;
|
|
360
360
|
--form-input-border-radius: 0.5rem;
|
|
361
361
|
--form-input-bg: #ffffff;
|
|
362
|
-
--form-input-
|
|
363
|
-
--form-error-
|
|
362
|
+
--form-input-colour: #111827;
|
|
363
|
+
--form-error-colour: #ef4444;
|
|
364
364
|
--form-error-bg: #fee2e2;
|
|
365
|
-
--form-success-
|
|
365
|
+
--form-success-colour: #10b981;
|
|
366
366
|
--form-success-bg: #d1fae5;
|
|
367
367
|
--form-button-bg: #3b82f6;
|
|
368
|
-
--form-button-
|
|
368
|
+
--form-button-colour: #ffffff;
|
|
369
369
|
--form-button-hover-bg: #2563eb;
|
|
370
370
|
--form-button-disabled-bg: #9ca3af;
|
|
371
371
|
}
|
|
@@ -15,6 +15,10 @@ const { ...restProps } = $props();
|
|
|
15
15
|
Content
|
|
16
16
|
</Column>
|
|
17
17
|
```
|
|
18
|
+
|
|
19
|
+
CSS Custom Properties:
|
|
20
|
+
- `--col-gap`: Horizontal padding on desktop (default: 1rem)
|
|
21
|
+
- `--col-gap-mobile`: Horizontal padding on mobile (default: var(--col-gap, 0.5rem))
|
|
18
22
|
-->
|
|
19
23
|
<div class="col" {...restProps}>
|
|
20
24
|
<slot />
|
|
@@ -27,6 +27,10 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
27
27
|
* Content
|
|
28
28
|
* </Column>
|
|
29
29
|
* ```
|
|
30
|
+
*
|
|
31
|
+
* CSS Custom Properties:
|
|
32
|
+
* - `--col-gap`: Horizontal padding on desktop (default: 1rem)
|
|
33
|
+
* - `--col-gap-mobile`: Horizontal padding on mobile (default: var(--col-gap, 0.5rem))
|
|
30
34
|
*/
|
|
31
35
|
declare const Column: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Record<string, any>, {
|
|
32
36
|
default: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Column.svelte.ts"],"names":[],"mappings":"AAgBA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE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E,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,MAAM;;;;;;UAAqF,CAAC;AAChF,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,eAAe,MAAM,CAAC"}
|
|
@@ -7,6 +7,28 @@ const { ...restProps } = $props();
|
|
|
7
7
|
|
|
8
8
|
Centre content such as rows & columns horizontally with predefined max-width.
|
|
9
9
|
Uses CSS Grid to provide breakout and full-width layout options.
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```svelte
|
|
13
|
+
<Container>
|
|
14
|
+
<Row>
|
|
15
|
+
<Column class="col-12">Content</Column>
|
|
16
|
+
</Row>
|
|
17
|
+
</Container>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
@example
|
|
21
|
+
```svelte
|
|
22
|
+
<Container>
|
|
23
|
+
<div class="breakout">Full breakout content</div>
|
|
24
|
+
<div class="full-width">Full width content</div>
|
|
25
|
+
</Container>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
CSS Custom Properties:
|
|
29
|
+
- `--container-max-width`: Maximum content width (default: 1328px)
|
|
30
|
+
- `--container-breakout-max-width`: Maximum breakout width (default: 1500px)
|
|
31
|
+
- `--container-padding`: Horizontal padding (default: 1rem)
|
|
10
32
|
-->
|
|
11
33
|
<div class="container" {...restProps}>
|
|
12
34
|
<slot />
|
|
@@ -19,6 +19,28 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
19
19
|
/**
|
|
20
20
|
* Centre content such as rows & columns horizontally with predefined max-width.
|
|
21
21
|
* Uses CSS Grid to provide breakout and full-width layout options.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```svelte
|
|
25
|
+
* <Container>
|
|
26
|
+
* <Row>
|
|
27
|
+
* <Column class="col-12">Content</Column>
|
|
28
|
+
* </Row>
|
|
29
|
+
* </Container>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```svelte
|
|
34
|
+
* <Container>
|
|
35
|
+
* <div class="breakout">Full breakout content</div>
|
|
36
|
+
* <div class="full-width">Full width content</div>
|
|
37
|
+
* </Container>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* CSS Custom Properties:
|
|
41
|
+
* - `--container-max-width`: Maximum content width (default: 1328px)
|
|
42
|
+
* - `--container-breakout-max-width`: Maximum breakout width (default: 1500px)
|
|
43
|
+
* - `--container-padding`: Horizontal padding (default: 1rem)
|
|
22
44
|
*/
|
|
23
45
|
declare const Container: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Record<string, any>, {
|
|
24
46
|
default: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Container.svelte.ts"],"names":[],"mappings":"AAgBA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG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AAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,SAAS;;;;;;UAAqF,CAAC;AACnF,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,eAAe,SAAS,CAAC"}
|
|
@@ -26,6 +26,10 @@ const { noGaps = false, ...restProps }: RowProps = $props();
|
|
|
26
26
|
<Column></Column>
|
|
27
27
|
</Row>
|
|
28
28
|
```
|
|
29
|
+
|
|
30
|
+
CSS Custom Properties:
|
|
31
|
+
- `--row-gap`: Gap between columns (default: 1rem)
|
|
32
|
+
- `--row-gap-mobile`: Gap on mobile screens (default: var(--row-gap, 0.5rem))
|
|
29
33
|
-->
|
|
30
34
|
<div class="row" class:row--no-gaps={noGaps} {...restProps}>
|
|
31
35
|
<slot />
|
|
@@ -35,6 +35,10 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
35
35
|
* <Column></Column>
|
|
36
36
|
* </Row>
|
|
37
37
|
* ```
|
|
38
|
+
*
|
|
39
|
+
* CSS Custom Properties:
|
|
40
|
+
* - `--row-gap`: Gap between columns (default: 1rem)
|
|
41
|
+
* - `--row-gap-mobile`: Gap on mobile screens (default: var(--row-gap, 0.5rem))
|
|
38
42
|
*/
|
|
39
43
|
declare const Row: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<RowProps, {
|
|
40
44
|
default: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Row.svelte.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAiBF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAA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C,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,GAAG;;;;;;UAAqF,CAAC;AAC7E,KAAK,GAAG,GAAG,YAAY,CAAC,OAAO,GAAG,CAAC,CAAC;AACtC,eAAe,GAAG,CAAC"}
|
|
@@ -40,6 +40,15 @@ export type HamburgerProps = {
|
|
|
40
40
|
```svelte
|
|
41
41
|
<Hamburger gap="1rem">
|
|
42
42
|
```
|
|
43
|
+
|
|
44
|
+
CSS Custom Properties:
|
|
45
|
+
- `--hamburger-gap`: Distance from top and right edges (default: 0.8rem)
|
|
46
|
+
- `--hamburger-z-index`: Stacking order (default: 10000)
|
|
47
|
+
- `--hamburger-colour`: Icon color (default: var(--colour-base-light))
|
|
48
|
+
- `--hamburger-layer-width`: Width of each line (default: 24px)
|
|
49
|
+
- `--hamburger-layer-height`: Height of each line (default: 2px)
|
|
50
|
+
- `--hamburger-layer-spacing`: Gap between lines (default: 5px)
|
|
51
|
+
- `--hamburger-border-radius`: Rounding of lines (default: 2px)
|
|
43
52
|
-->
|
|
44
53
|
<div class="hamburger-wrapper {className}" style="--hamburger-gap: {gap}" aria-label="Toggle Menu">
|
|
45
54
|
<SvelteHamburger
|
|
@@ -20,6 +20,15 @@ export type HamburgerProps = {
|
|
|
20
20
|
* ```svelte
|
|
21
21
|
* <Hamburger gap="1rem">
|
|
22
22
|
* ```
|
|
23
|
+
*
|
|
24
|
+
* CSS Custom Properties:
|
|
25
|
+
* - `--hamburger-gap`: Distance from top and right edges (default: 0.8rem)
|
|
26
|
+
* - `--hamburger-z-index`: Stacking order (default: 10000)
|
|
27
|
+
* - `--hamburger-colour`: Icon color (default: var(--colour-base-light))
|
|
28
|
+
* - `--hamburger-layer-width`: Width of each line (default: 24px)
|
|
29
|
+
* - `--hamburger-layer-height`: Height of each line (default: 2px)
|
|
30
|
+
* - `--hamburger-layer-spacing`: Gap between lines (default: 5px)
|
|
31
|
+
* - `--hamburger-border-radius`: Rounding of lines (default: 2px)
|
|
23
32
|
*/
|
|
24
33
|
declare const Hamburger: import("svelte").Component<HamburgerProps, {}, "isOpen">;
|
|
25
34
|
type Hamburger = ReturnType<typeof Hamburger>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hamburger.svelte.d.ts","sourceRoot":"","sources":["../../src/components/Hamburger.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAE5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AA8BF
|
|
1
|
+
{"version":3,"file":"Hamburger.svelte.d.ts","sourceRoot":"","sources":["../../src/components/Hamburger.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAE5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AA8BF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,SAAS,0DAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -135,6 +135,21 @@ export type SidebarProps = {
|
|
|
135
135
|
<nav>...</nav>
|
|
136
136
|
</Sidebar>
|
|
137
137
|
```
|
|
138
|
+
|
|
139
|
+
CSS Custom Properties:
|
|
140
|
+
- `--sidebar-width`: Mobile sidebar width (default: 50vw)
|
|
141
|
+
- `--sidebar-min-width`: Minimum sidebar width (default: 270px)
|
|
142
|
+
- `--sidebar-top`: Desktop sticky position from top (default: 160px)
|
|
143
|
+
- `--sidebar-overlay-opacity`: Overlay opacity when open (default: 0.3)
|
|
144
|
+
- `--sidebar-bg`: Sidebar background color (default: var(--colour-base-black))
|
|
145
|
+
- `--sidebar-border-colour`: Border color (default: rgba(255, 255, 255, 0.1))
|
|
146
|
+
- `--sidebar-overlay-colour`: Overlay background color (default: var(--colour-grey-900))
|
|
147
|
+
- `--sidebar-inner-padding`: Content padding (default: 2rem 1.8rem 0 1.8rem)
|
|
148
|
+
- `--sidebar-toggle-bg`: Toggle button background (default: var(--colour-base-black))
|
|
149
|
+
- `--sidebar-toggle-colour`: Toggle button text color (default: var(--colour-base-light))
|
|
150
|
+
- `--sidebar-toggle-padding`: Toggle button padding (default: 0.25rem 1.5rem)
|
|
151
|
+
- `--sidebar-toggle-radius`: Toggle button border radius (default: 0.375rem)
|
|
152
|
+
- `--sidebar-toggle-font-size`: Toggle button font size (default: 0.9rem)
|
|
138
153
|
-->
|
|
139
154
|
<aside
|
|
140
155
|
class="sidebar sidebar--{toggleStyle} sidebar--{position} {className}"
|
|
@@ -171,7 +186,7 @@ export type SidebarProps = {
|
|
|
171
186
|
display: none;
|
|
172
187
|
bottom: 0;
|
|
173
188
|
right: 1px;
|
|
174
|
-
background-color: var(--sidebar-toggle-
|
|
189
|
+
background-color: var(--sidebar-toggle-bg, var(--colour-base-black));
|
|
175
190
|
color: var(--sidebar-toggle-colour, var(--colour-base-light));
|
|
176
191
|
padding: var(--sidebar-toggle-padding, 0.25rem 1.5rem);
|
|
177
192
|
border-top-right-radius: var(--sidebar-toggle-radius, 0.375rem);
|
|
@@ -191,7 +206,7 @@ export type SidebarProps = {
|
|
|
191
206
|
left: 1px;
|
|
192
207
|
width: calc(100% - 2px);
|
|
193
208
|
height: 10%;
|
|
194
|
-
background: var(--sidebar-toggle-
|
|
209
|
+
background: var(--sidebar-toggle-bg, var(--colour-base-black));
|
|
195
210
|
}
|
|
196
211
|
.sidebar__overlay {
|
|
197
212
|
position: fixed;
|
|
@@ -229,7 +244,7 @@ export type SidebarProps = {
|
|
|
229
244
|
height: 100%;
|
|
230
245
|
width: var(--sidebar-width, 50vw);
|
|
231
246
|
min-width: var(--sidebar-min-width, 270px);
|
|
232
|
-
background-color: var(--sidebar-
|
|
247
|
+
background-color: var(--sidebar-bg, var(--colour-base-black));
|
|
233
248
|
border-color: var(--sidebar-border-colour, rgba(255, 255, 255, 0.1));
|
|
234
249
|
z-index: 1000;
|
|
235
250
|
transition: translate 600ms cubic-bezier(0.1, 0.7, 0.1, 1);
|
|
@@ -34,6 +34,21 @@ export type SidebarProps = {
|
|
|
34
34
|
* <nav>...</nav>
|
|
35
35
|
* </Sidebar>
|
|
36
36
|
* ```
|
|
37
|
+
*
|
|
38
|
+
* CSS Custom Properties:
|
|
39
|
+
* - `--sidebar-width`: Mobile sidebar width (default: 50vw)
|
|
40
|
+
* - `--sidebar-min-width`: Minimum sidebar width (default: 270px)
|
|
41
|
+
* - `--sidebar-top`: Desktop sticky position from top (default: 160px)
|
|
42
|
+
* - `--sidebar-overlay-opacity`: Overlay opacity when open (default: 0.3)
|
|
43
|
+
* - `--sidebar-bg`: Sidebar background color (default: var(--colour-base-black))
|
|
44
|
+
* - `--sidebar-border-colour`: Border color (default: rgba(255, 255, 255, 0.1))
|
|
45
|
+
* - `--sidebar-overlay-colour`: Overlay background color (default: var(--colour-grey-900))
|
|
46
|
+
* - `--sidebar-inner-padding`: Content padding (default: 2rem 1.8rem 0 1.8rem)
|
|
47
|
+
* - `--sidebar-toggle-bg`: Toggle button background (default: var(--colour-base-black))
|
|
48
|
+
* - `--sidebar-toggle-colour`: Toggle button text color (default: var(--colour-base-light))
|
|
49
|
+
* - `--sidebar-toggle-padding`: Toggle button padding (default: 0.25rem 1.5rem)
|
|
50
|
+
* - `--sidebar-toggle-radius`: Toggle button border radius (default: 0.375rem)
|
|
51
|
+
* - `--sidebar-toggle-font-size`: Toggle button font size (default: 0.9rem)
|
|
37
52
|
*/
|
|
38
53
|
declare const Sidebar: import("svelte").Component<SidebarProps, {}, "isOpen">;
|
|
39
54
|
type Sidebar = ReturnType<typeof Sidebar>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.svelte.d.ts","sourceRoot":"","sources":["../../src/components/Sidebar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EA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 +1,5 @@
|
|
|
1
1
|
export { default as Sidebar } from './Sidebar.svelte';
|
|
2
2
|
export { default as Hamburger } from './Hamburger.svelte';
|
|
3
|
+
export { Alert, Notice } from './notifications';
|
|
4
|
+
export type { AlertProps, AlertType, NoticeProps, NoticeType } from './notifications';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Icon as IconType } from '@lucide/svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
export type AlertType = 'info' | 'warning' | 'success' | 'error';
|
|
6
|
+
|
|
7
|
+
export type AlertProps = {
|
|
8
|
+
type?: AlertType;
|
|
9
|
+
title?: string;
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
dismiss?: boolean;
|
|
13
|
+
icon?: typeof IconType;
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
import { X } from '@lucide/svelte'
|
|
19
|
+
import { fade } from 'svelte/transition'
|
|
20
|
+
|
|
21
|
+
import { alertIcons } from './alertIcons.js'
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
type = 'info',
|
|
25
|
+
title = '',
|
|
26
|
+
children,
|
|
27
|
+
visible = $bindable(true),
|
|
28
|
+
dismiss = false,
|
|
29
|
+
icon: customIcon,
|
|
30
|
+
...restProps
|
|
31
|
+
}: AlertProps = $props()
|
|
32
|
+
|
|
33
|
+
const iconDetail = $derived(alertIcons[type])
|
|
34
|
+
const Icon = $derived(customIcon || iconDetail.icon)
|
|
35
|
+
const hide = () => (visible = false)
|
|
36
|
+
const ariaLive = $derived(type === 'error' ? 'assertive' : 'polite')
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<!--
|
|
40
|
+
@component
|
|
41
|
+
|
|
42
|
+
Full-width alert component for displaying important messages with optional body text.
|
|
43
|
+
Supports title, children content, and custom icons with dismissible functionality.
|
|
44
|
+
|
|
45
|
+
@example
|
|
46
|
+
```svelte
|
|
47
|
+
<Alert type="info" title="New features available">
|
|
48
|
+
Check out the latest updates in your dashboard.
|
|
49
|
+
</Alert>
|
|
50
|
+
|
|
51
|
+
<Alert type="warning" title="Maintenance scheduled" dismiss />
|
|
52
|
+
|
|
53
|
+
<Alert type="error" title="Payment failed" dismiss>
|
|
54
|
+
Your card was declined. Please update your payment method.
|
|
55
|
+
</Alert>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
CSS Custom Properties:
|
|
59
|
+
- `--_alert-gap`: Gap between icon and content (default: 12px)
|
|
60
|
+
- `--_alert-padding`: Internal padding (default: 24px)
|
|
61
|
+
- `--_alert-border-radius`: Border radius (default: 6px)
|
|
62
|
+
- `--_alert-bg`: Background color (default: rgba(255, 255, 255, 0.02))
|
|
63
|
+
- `--_alert-content-gap`: Gap between title and text (default: 8px)
|
|
64
|
+
- `--_alert-title-font-weight`: Title font weight (default: var(--font-weight-semibold))
|
|
65
|
+
- `--_alert-title-colour`: Title text color (default: rgba(255, 255, 255, 1))
|
|
66
|
+
- `--_alert-text-line-height`: Text line height (default: 1.4)
|
|
67
|
+
- `--_alert-text-colour`: Text color (default: rgba(255, 255, 255, 50%))
|
|
68
|
+
- `--_alert-icon-colour`: Icon color (set automatically based on type)
|
|
69
|
+
-->
|
|
70
|
+
{#if visible}
|
|
71
|
+
<div
|
|
72
|
+
class="alert alert--{type}"
|
|
73
|
+
role="alert"
|
|
74
|
+
aria-live={ariaLive}
|
|
75
|
+
aria-atomic="true"
|
|
76
|
+
style="--_alert-icon-colour: {iconDetail.colour}"
|
|
77
|
+
transition:fade={{ duration: 300 }}
|
|
78
|
+
{...restProps}
|
|
79
|
+
>
|
|
80
|
+
<!-- Icon -->
|
|
81
|
+
<figure class="alert__icon">
|
|
82
|
+
<Icon size={24} color={iconDetail.colour} strokeWidth={1.2}></Icon>
|
|
83
|
+
</figure>
|
|
84
|
+
<!-- Content -->
|
|
85
|
+
<div class="alert__content">
|
|
86
|
+
{#if title}
|
|
87
|
+
<p class="alert__title">
|
|
88
|
+
{title}
|
|
89
|
+
</p>
|
|
90
|
+
{/if}
|
|
91
|
+
{#if children}
|
|
92
|
+
<p class="alert__text">
|
|
93
|
+
{@render children()}
|
|
94
|
+
</p>
|
|
95
|
+
{/if}
|
|
96
|
+
</div>
|
|
97
|
+
<!-- Dismiss -->
|
|
98
|
+
{#if dismiss}
|
|
99
|
+
<button class="alert__dismiss" onclick={hide} aria-label="Close Alert">
|
|
100
|
+
<X size={24} color={iconDetail.colour} />
|
|
101
|
+
</button>
|
|
102
|
+
{/if}
|
|
103
|
+
</div>
|
|
104
|
+
{/if}
|
|
105
|
+
|
|
106
|
+
<style>.alert {
|
|
107
|
+
position: relative;
|
|
108
|
+
display: flex;
|
|
109
|
+
gap: var(--_alert-gap, 0.75rem);
|
|
110
|
+
width: 100%;
|
|
111
|
+
border-radius: var(--_alert-border-radius, 6px);
|
|
112
|
+
padding: var(--_alert-padding, 1.5rem);
|
|
113
|
+
background-color: var(--_alert-bg, rgba(255, 255, 255, 0.02));
|
|
114
|
+
}
|
|
115
|
+
.alert__icon {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
margin: 0;
|
|
120
|
+
flex-shrink: 0;
|
|
121
|
+
}
|
|
122
|
+
.alert__content {
|
|
123
|
+
display: grid;
|
|
124
|
+
gap: var(--_alert-content-gap, 0.5rem);
|
|
125
|
+
}
|
|
126
|
+
.alert__title {
|
|
127
|
+
font-weight: var(--_alert-title-font-weight, var(--font-weight-semibold));
|
|
128
|
+
margin: 0;
|
|
129
|
+
line-height: 1;
|
|
130
|
+
color: var(--_alert-title-colour, rgb(255, 255, 255));
|
|
131
|
+
}
|
|
132
|
+
.alert__title:empty {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
.alert__text {
|
|
136
|
+
margin: 0;
|
|
137
|
+
line-height: var(--_alert-text-line-height, 1.4);
|
|
138
|
+
color: var(--_alert-text-colour, rgba(255, 255, 255, 0.5));
|
|
139
|
+
}
|
|
140
|
+
.alert__dismiss {
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
margin-left: auto;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
background: none;
|
|
147
|
+
border: none;
|
|
148
|
+
padding: 0;
|
|
149
|
+
color: var(--_alert-icon-colour);
|
|
150
|
+
}
|
|
151
|
+
.alert :global(svg) {
|
|
152
|
+
min-width: 1.4rem;
|
|
153
|
+
min-height: 1.4rem;
|
|
154
|
+
}</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Icon as IconType } from '@lucide/svelte';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export type AlertType = 'info' | 'warning' | 'success' | 'error';
|
|
4
|
+
export type AlertProps = {
|
|
5
|
+
type?: AlertType;
|
|
6
|
+
title?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
dismiss?: boolean;
|
|
10
|
+
icon?: typeof IconType;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Full-width alert component for displaying important messages with optional body text.
|
|
14
|
+
* Supports title, children content, and custom icons with dismissible functionality.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```svelte
|
|
18
|
+
* <Alert type="info" title="New features available">
|
|
19
|
+
* Check out the latest updates in your dashboard.
|
|
20
|
+
* </Alert>
|
|
21
|
+
*
|
|
22
|
+
* <Alert type="warning" title="Maintenance scheduled" dismiss />
|
|
23
|
+
*
|
|
24
|
+
* <Alert type="error" title="Payment failed" dismiss>
|
|
25
|
+
* Your card was declined. Please update your payment method.
|
|
26
|
+
* </Alert>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* CSS Custom Properties:
|
|
30
|
+
* - `--_alert-gap`: Gap between icon and content (default: 12px)
|
|
31
|
+
* - `--_alert-padding`: Internal padding (default: 24px)
|
|
32
|
+
* - `--_alert-border-radius`: Border radius (default: 6px)
|
|
33
|
+
* - `--_alert-bg`: Background color (default: rgba(255, 255, 255, 0.02))
|
|
34
|
+
* - `--_alert-content-gap`: Gap between title and text (default: 8px)
|
|
35
|
+
* - `--_alert-title-font-weight`: Title font weight (default: var(--font-weight-semibold))
|
|
36
|
+
* - `--_alert-title-colour`: Title text color (default: rgba(255, 255, 255, 1))
|
|
37
|
+
* - `--_alert-text-line-height`: Text line height (default: 1.4)
|
|
38
|
+
* - `--_alert-text-colour`: Text color (default: rgba(255, 255, 255, 50%))
|
|
39
|
+
* - `--_alert-icon-colour`: Icon color (set automatically based on type)
|
|
40
|
+
*/
|
|
41
|
+
declare const Alert: import("svelte").Component<AlertProps, {}, "visible">;
|
|
42
|
+
type Alert = ReturnType<typeof Alert>;
|
|
43
|
+
export default Alert;
|
|
44
|
+
//# sourceMappingURL=Alert.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/Alert.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,QAAQ,CAAC;CACvB,CAAC;AAiEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,KAAK,uDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Icon as IconType } from '@lucide/svelte';
|
|
3
|
+
|
|
4
|
+
export type NoticeType = 'info' | 'warning' | 'success' | 'error';
|
|
5
|
+
|
|
6
|
+
export type NoticeProps = {
|
|
7
|
+
type?: NoticeType;
|
|
8
|
+
title: string;
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
dismiss?: boolean;
|
|
11
|
+
icon?: typeof IconType;
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { X } from '@lucide/svelte'
|
|
17
|
+
import { fade } from 'svelte/transition'
|
|
18
|
+
|
|
19
|
+
import { alertIcons } from './alertIcons'
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
type = 'info',
|
|
23
|
+
title = '',
|
|
24
|
+
visible = $bindable(true),
|
|
25
|
+
dismiss = false,
|
|
26
|
+
icon: customIcon,
|
|
27
|
+
...restProps
|
|
28
|
+
}: NoticeProps = $props()
|
|
29
|
+
|
|
30
|
+
const iconDetail = $derived(alertIcons[type])
|
|
31
|
+
const Icon = $derived(customIcon || iconDetail.icon)
|
|
32
|
+
const hide = () => (visible = false)
|
|
33
|
+
const ariaLive = $derived(type === 'error' ? 'assertive' : 'polite')
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<!--
|
|
37
|
+
@component
|
|
38
|
+
|
|
39
|
+
Inline notification component for displaying brief messages with icons.
|
|
40
|
+
Compact design suitable for inline alerts, badges, or status indicators.
|
|
41
|
+
|
|
42
|
+
@example
|
|
43
|
+
```svelte
|
|
44
|
+
<Notice type="success" title="Upload complete" />
|
|
45
|
+
<Notice type="warning" title="Session expiring" dismiss />
|
|
46
|
+
<Notice type="error" title="Connection failed" icon={CustomIcon} />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
CSS Custom Properties:
|
|
50
|
+
- `--_notice-gap`: Gap between icon and title (default: 12px)
|
|
51
|
+
- `--_notice-padding`: Internal padding (default: 0.8rem 12px)
|
|
52
|
+
- `--_notice-border-radius`: Border radius (default: 6px)
|
|
53
|
+
- `--_notice-bg`: Background color (default: rgba(255, 255, 255, 0.025))
|
|
54
|
+
- `--_notice-font-size`: Title font size (default: 1rem)
|
|
55
|
+
- `--_notice-title-colour`: Title text color (default: rgba(255, 255, 255, 1))
|
|
56
|
+
- `--_notice-icon-colour`: Icon color (set automatically based on type)
|
|
57
|
+
-->
|
|
58
|
+
{#if visible}
|
|
59
|
+
<div
|
|
60
|
+
class="notice notice--{type}"
|
|
61
|
+
role="alert"
|
|
62
|
+
aria-live={ariaLive}
|
|
63
|
+
aria-atomic="true"
|
|
64
|
+
style="--_notice-icon-colour: {iconDetail.colour}"
|
|
65
|
+
transition:fade={{ duration: 300 }}
|
|
66
|
+
{...restProps}
|
|
67
|
+
>
|
|
68
|
+
<!-- Icon -->
|
|
69
|
+
<figure class="notice__icon">
|
|
70
|
+
<Icon size={20} color={iconDetail.colour} strokeWidth={1.2}></Icon>
|
|
71
|
+
</figure>
|
|
72
|
+
<!-- Title -->
|
|
73
|
+
<p class="notice__title">
|
|
74
|
+
{title}
|
|
75
|
+
</p>
|
|
76
|
+
<!-- Dismiss -->
|
|
77
|
+
{#if dismiss}
|
|
78
|
+
<button class="notice__dismiss" onclick={hide} aria-label="Close Notice">
|
|
79
|
+
<X size={20} color={iconDetail.colour} />
|
|
80
|
+
</button>
|
|
81
|
+
{/if}
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
|
|
85
|
+
<style>.notice {
|
|
86
|
+
position: relative;
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
width: auto;
|
|
89
|
+
gap: var(--_notice-gap, 0.75rem);
|
|
90
|
+
padding: var(--_notice-padding, 0.8rem 0.75rem);
|
|
91
|
+
border-radius: var(--_notice-border-radius, 6px);
|
|
92
|
+
background-color: var(--_notice-bg, rgba(255, 255, 255, 0.025));
|
|
93
|
+
align-items: center;
|
|
94
|
+
}
|
|
95
|
+
.notice__icon {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
margin: 0;
|
|
100
|
+
flex-shrink: 0;
|
|
101
|
+
}
|
|
102
|
+
.notice__title {
|
|
103
|
+
margin: 0;
|
|
104
|
+
font-size: var(--_notice-font-size, 1rem);
|
|
105
|
+
font-weight: var(--font-weight-medium);
|
|
106
|
+
color: var(--_notice-title-colour, rgb(255, 255, 255));
|
|
107
|
+
line-height: 1;
|
|
108
|
+
}
|
|
109
|
+
.notice__dismiss {
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
margin-left: auto;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
background: none;
|
|
116
|
+
border: none;
|
|
117
|
+
padding: 0;
|
|
118
|
+
color: var(--_notice-icon-colour);
|
|
119
|
+
}
|
|
120
|
+
.notice :global(svg) {
|
|
121
|
+
min-width: 1.4rem;
|
|
122
|
+
min-height: 1.4rem;
|
|
123
|
+
}</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Icon as IconType } from '@lucide/svelte';
|
|
2
|
+
export type NoticeType = 'info' | 'warning' | 'success' | 'error';
|
|
3
|
+
export type NoticeProps = {
|
|
4
|
+
type?: NoticeType;
|
|
5
|
+
title: string;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
dismiss?: boolean;
|
|
8
|
+
icon?: typeof IconType;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Inline notification component for displaying brief messages with icons.
|
|
12
|
+
* Compact design suitable for inline alerts, badges, or status indicators.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```svelte
|
|
16
|
+
* <Notice type="success" title="Upload complete" />
|
|
17
|
+
* <Notice type="warning" title="Session expiring" dismiss />
|
|
18
|
+
* <Notice type="error" title="Connection failed" icon={CustomIcon} />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* CSS Custom Properties:
|
|
22
|
+
* - `--_notice-gap`: Gap between icon and title (default: 12px)
|
|
23
|
+
* - `--_notice-padding`: Internal padding (default: 0.8rem 12px)
|
|
24
|
+
* - `--_notice-border-radius`: Border radius (default: 6px)
|
|
25
|
+
* - `--_notice-bg`: Background color (default: rgba(255, 255, 255, 0.025))
|
|
26
|
+
* - `--_notice-font-size`: Title font size (default: 1rem)
|
|
27
|
+
* - `--_notice-title-colour`: Title text color (default: rgba(255, 255, 255, 1))
|
|
28
|
+
* - `--_notice-icon-colour`: Icon color (set automatically based on type)
|
|
29
|
+
*/
|
|
30
|
+
declare const Notice: import("svelte").Component<NoticeProps, {}, "visible">;
|
|
31
|
+
type Notice = ReturnType<typeof Notice>;
|
|
32
|
+
export default Notice;
|
|
33
|
+
//# sourceMappingURL=Notice.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notice.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/Notice.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,QAAQ,CAAC;CACvB,CAAC;AAuDF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,MAAM,wDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Icon as IconType } from '@lucide/svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Notification type variants
|
|
4
|
+
*/
|
|
5
|
+
type NotificationType = 'info' | 'warning' | 'success' | 'error';
|
|
6
|
+
/**
|
|
7
|
+
* Icon configuration for notification types
|
|
8
|
+
*/
|
|
9
|
+
type IconDetail = {
|
|
10
|
+
icon: typeof IconType;
|
|
11
|
+
colour: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Icon mapping for notification types
|
|
15
|
+
*/
|
|
16
|
+
export declare const alertIcons: Record<NotificationType, IconDetail>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=alertIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertIcons.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/alertIcons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,IAAI,IAAI,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAElG;;GAEG;AACH,KAAK,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE;;GAEG;AACH,KAAK,UAAU,GAAG;IACjB,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAK3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CircleCheck, CircleX, Info, TriangleAlert } from '@lucide/svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Icon mapping for notification types
|
|
4
|
+
*/
|
|
5
|
+
export const alertIcons = {
|
|
6
|
+
info: { icon: Info, colour: 'var(--colour-semantic-info)' },
|
|
7
|
+
success: { icon: CircleCheck, colour: 'var(--colour-semantic-success)' },
|
|
8
|
+
warning: { icon: TriangleAlert, colour: 'var(--colour-semantic-warning)' },
|
|
9
|
+
error: { icon: CircleX, colour: 'var(--colour-semantic-error)' },
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Alert } from './Alert.svelte';
|
|
2
|
+
export { default as Notice } from './Notice.svelte';
|
|
3
|
+
export type { AlertProps, AlertType } from './Alert.svelte';
|
|
4
|
+
export type { NoticeProps, NoticeType } from './Notice.svelte';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -198,14 +198,14 @@ async function handleSubmit(event: SubmitEvent) {
|
|
|
198
198
|
.payload-form__label {
|
|
199
199
|
font-size: 0.875rem;
|
|
200
200
|
font-weight: 500;
|
|
201
|
-
color: var(--form-input-
|
|
201
|
+
color: var(--form-input-colour, #111827);
|
|
202
202
|
}
|
|
203
203
|
.payload-form__label--checkbox {
|
|
204
204
|
font-weight: 400;
|
|
205
205
|
cursor: pointer;
|
|
206
206
|
}
|
|
207
207
|
.payload-form__required {
|
|
208
|
-
color: var(--form-error-
|
|
208
|
+
color: var(--form-error-colour, #ef4444);
|
|
209
209
|
margin-left: 0.25rem;
|
|
210
210
|
}
|
|
211
211
|
.payload-form__input, .payload-form__textarea {
|
|
@@ -213,7 +213,7 @@ async function handleSubmit(event: SubmitEvent) {
|
|
|
213
213
|
border: var(--form-input-border, 1px solid #d1d5db);
|
|
214
214
|
border-radius: var(--form-input-border-radius, 0.375rem);
|
|
215
215
|
background: var(--form-input-bg, #ffffff);
|
|
216
|
-
color: var(--form-input-
|
|
216
|
+
color: var(--form-input-colour, #111827);
|
|
217
217
|
font-size: 1rem;
|
|
218
218
|
font-family: inherit;
|
|
219
219
|
}
|
|
@@ -222,7 +222,7 @@ async function handleSubmit(event: SubmitEvent) {
|
|
|
222
222
|
outline-offset: 2px;
|
|
223
223
|
}
|
|
224
224
|
.payload-form__input--error, .payload-form__textarea--error {
|
|
225
|
-
border-color: var(--form-error-
|
|
225
|
+
border-color: var(--form-error-colour, #ef4444);
|
|
226
226
|
}
|
|
227
227
|
.payload-form__textarea {
|
|
228
228
|
resize: vertical;
|
|
@@ -241,26 +241,26 @@ async function handleSubmit(event: SubmitEvent) {
|
|
|
241
241
|
}
|
|
242
242
|
.payload-form__error {
|
|
243
243
|
font-size: 0.875rem;
|
|
244
|
-
color: var(--form-error-
|
|
244
|
+
color: var(--form-error-colour, #ef4444);
|
|
245
245
|
}
|
|
246
246
|
.payload-form__success {
|
|
247
247
|
padding: 1rem;
|
|
248
248
|
background-color: var(--form-success-bg, #d1fae5);
|
|
249
|
-
color: var(--form-success-
|
|
249
|
+
color: var(--form-success-colour, #10b981);
|
|
250
250
|
border-radius: var(--form-input-border-radius, 0.375rem);
|
|
251
251
|
font-weight: 500;
|
|
252
252
|
}
|
|
253
253
|
.payload-form__alert {
|
|
254
254
|
padding: 1rem;
|
|
255
255
|
background-color: var(--form-error-bg, #fee2e2);
|
|
256
|
-
color: var(--form-error-
|
|
256
|
+
color: var(--form-error-colour, #ef4444);
|
|
257
257
|
border-radius: var(--form-input-border-radius, 0.375rem);
|
|
258
258
|
font-weight: 500;
|
|
259
259
|
}
|
|
260
260
|
.payload-form__submit {
|
|
261
261
|
padding: var(--form-input-padding, 0.75rem) 1.5rem;
|
|
262
262
|
background-color: var(--form-button-bg, #3b82f6);
|
|
263
|
-
color: var(--form-button-
|
|
263
|
+
color: var(--form-button-colour, #ffffff);
|
|
264
264
|
border: none;
|
|
265
265
|
border-radius: var(--form-input-border-radius, 0.375rem);
|
|
266
266
|
font-size: 1rem;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
$border-radius-2: 2px;
|
|
4
|
+
$border-radius-4: 4px;
|
|
5
|
+
$border-radius-6: 6px;
|
|
6
|
+
$border-radius-8: 8px;
|
|
7
|
+
$border-radius-12: 12px;
|
|
8
|
+
$border-radius-16: 16px;
|
|
9
|
+
$border-radius-32: 32px;
|
|
10
|
+
$border-radius-full: 9999999px;
|
|
11
|
+
|
|
12
|
+
$border-radius: (
|
|
13
|
+
'2': $border-radius-2,
|
|
14
|
+
'4': $border-radius-4,
|
|
15
|
+
'6': $border-radius-6,
|
|
16
|
+
'8': $border-radius-8,
|
|
17
|
+
'12': $border-radius-12,
|
|
18
|
+
'16': $border-radius-16,
|
|
19
|
+
'32': $border-radius-32,
|
|
20
|
+
'full': $border-radius-full,
|
|
21
|
+
);
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
@use 'sass:math';
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'breakpoints';
|
|
5
|
+
|
|
6
|
+
// Media Queries
|
|
7
|
+
// ==========================================================================
|
|
8
|
+
|
|
9
|
+
@mixin mq($size) {
|
|
10
|
+
@if map.has-key(breakpoints.$breakpoints, $size) {
|
|
11
|
+
$breakpoint: map.get(breakpoints.$breakpoints, $size);
|
|
12
|
+
@media screen and (min-width: $breakpoint * 1px) {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
} @else if meta.type-of($size) == number {
|
|
16
|
+
@if math.is-unitless($size) {
|
|
17
|
+
@error 'When using a number with @mq() make sure to include a unit';
|
|
18
|
+
} @else {
|
|
19
|
+
@media screen and (min-width: $size) {
|
|
20
|
+
@content;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
} @else {
|
|
24
|
+
@error 'The keyword #{$size} is not in the $breakpoints map';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin mq-max($size) {
|
|
29
|
+
@if map.has-key(breakpoints.$breakpoints, $size) {
|
|
30
|
+
$breakpoint: map.get(breakpoints.$breakpoints, $size);
|
|
31
|
+
@media screen and (max-width: $breakpoint * 1px) {
|
|
32
|
+
@content;
|
|
33
|
+
}
|
|
34
|
+
} @else if meta.type-of($size) == number {
|
|
35
|
+
@if math.is-unitless($size) {
|
|
36
|
+
@error 'When using a number with @mq() make sure to include a unit';
|
|
37
|
+
} @else {
|
|
38
|
+
@media screen and (max-width: $size) {
|
|
39
|
+
@content;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} @else {
|
|
43
|
+
@error 'The keyword #{$size} is not in the $breakpoints map';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@mixin media-small-phones {
|
|
48
|
+
@media (width <= 350px) {
|
|
49
|
+
@content;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//// Pixel to REM Converter
|
|
54
|
+
//// ==========================================================================
|
|
55
|
+
//
|
|
56
|
+
//// @author Ainsley Clark
|
|
57
|
+
//// @param {Number} $pxValue - Pixel amount to convert
|
|
58
|
+
//// @param {String} $property [font-size] - Property to convert
|
|
59
|
+
//// @param {Number} $standard-size - Initial base rem size
|
|
60
|
+
//@mixin px-to-rem($pxValue, $property: 'font-size', $standard-size: 16) {
|
|
61
|
+
// #{$property}: $pxValue + px;
|
|
62
|
+
// #{$property}: $pxValue / å $standard-size + rem;
|
|
63
|
+
//}
|
|
64
|
+
|
|
65
|
+
// Type
|
|
66
|
+
// ==========================================================================
|
|
67
|
+
|
|
68
|
+
@mixin ellipsis($lines) {
|
|
69
|
+
display: -webkit-box;
|
|
70
|
+
-webkit-line-clamp: $lines;
|
|
71
|
+
-webkit-box-orient: vertical;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@function strip-unit($value) {
|
|
76
|
+
@return math.div($value, $value * 0 + 1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Usage:
|
|
80
|
+
// @include fluid-type(34px, 98px);
|
|
81
|
+
@mixin fluid-type($min-font-size, $max-font-size) {
|
|
82
|
+
$u1: math.unit($type-fluid-start-size);
|
|
83
|
+
$u2: math.unit($type-fluid-end-size);
|
|
84
|
+
$u3: math.unit($min-font-size);
|
|
85
|
+
$u4: math.unit($max-font-size);
|
|
86
|
+
|
|
87
|
+
@if $u1 == $u2 and $u1 == $u3 and $u1 == $u4 {
|
|
88
|
+
& {
|
|
89
|
+
font-size: $min-font-size;
|
|
90
|
+
|
|
91
|
+
@media screen and (min-width: $type-fluid-start-size) {
|
|
92
|
+
font-size: calc(
|
|
93
|
+
#{$min-font-size} + #{strip-unit($max-font-size - $min-font-size)} *
|
|
94
|
+
(
|
|
95
|
+
(100vw - #{$type-fluid-start-size}) /
|
|
96
|
+
#{strip-unit($type-fluid-end-size - $type-fluid-start-size)}
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@media screen and (min-width: $type-fluid-end-size) {
|
|
102
|
+
font-size: $max-font-size;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Landscape Mixin
|
|
109
|
+
// ==========================================================================
|
|
110
|
+
|
|
111
|
+
@mixin landscape {
|
|
112
|
+
@media screen and (orientation: landscape) {
|
|
113
|
+
@content;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Browser
|
|
118
|
+
// ==========================================================================
|
|
119
|
+
|
|
120
|
+
@mixin ie11 {
|
|
121
|
+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
122
|
+
@content;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@mixin ie11andedge {
|
|
127
|
+
// stylelint-disable-next-line media-feature-name-no-unknown
|
|
128
|
+
@media screen and (min-device-pixel-ratio: 0) and (-ms-high-contrast: none),
|
|
129
|
+
(-ms-high-contrast: active) {
|
|
130
|
+
@content;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@mixin firefox {
|
|
135
|
+
// stylelint-disable-next-line media-feature-name-no-unknown
|
|
136
|
+
@media screen and (min-device-pixel-ratio: 0) and (resolution >= 0.001dpcm) {
|
|
137
|
+
@content;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@mixin safari {
|
|
142
|
+
@media not all and (resolution >= 0.001dpcm) {
|
|
143
|
+
@supports (-webkit-appearance: none) {
|
|
144
|
+
@content;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Full Height
|
|
150
|
+
// ==========================================================================
|
|
151
|
+
|
|
152
|
+
@mixin full-height {
|
|
153
|
+
height: 100vh; /* Use vh as a fallback for browsers that do not support Custom Properties */
|
|
154
|
+
height: 100svh;
|
|
155
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'functions' as f;
|
|
3
|
+
|
|
4
|
+
$size-2: f.px-to-rem(2);
|
|
5
|
+
$size-4: f.px-to-rem(4);
|
|
6
|
+
$size-8: f.px-to-rem(8);
|
|
7
|
+
$size-12: f.px-to-rem(12);
|
|
8
|
+
$size-16: f.px-to-rem(16);
|
|
9
|
+
$size-24: f.px-to-rem(24);
|
|
10
|
+
$size-32: f.px-to-rem(32);
|
|
11
|
+
$size-40: f.px-to-rem(40);
|
|
12
|
+
$size-48: f.px-to-rem(48);
|
|
13
|
+
|
|
14
|
+
$sizes: (
|
|
15
|
+
'0': 0,
|
|
16
|
+
'2': $size-2,
|
|
17
|
+
'4': $size-4,
|
|
18
|
+
'8': $size-8,
|
|
19
|
+
'12': $size-12,
|
|
20
|
+
'16': $size-16,
|
|
21
|
+
'24': $size-24,
|
|
22
|
+
'32': $size-32,
|
|
23
|
+
'40': $size-40,
|
|
24
|
+
'48': $size-48,
|
|
25
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainsleydev/sveltekit-helper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "SvelteKit utilities, components and helpers for ainsley.dev builds",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"svelte": "./dist/components/payload/index.js",
|
|
45
45
|
"default": "./dist/components/payload/index.js"
|
|
46
46
|
},
|
|
47
|
+
"./components/notifications": {
|
|
48
|
+
"types": "./dist/components/notifications/index.d.ts",
|
|
49
|
+
"svelte": "./dist/components/notifications/index.js",
|
|
50
|
+
"default": "./dist/components/notifications/index.js"
|
|
51
|
+
},
|
|
47
52
|
"./utils/forms": {
|
|
48
53
|
"types": "./dist/utils/forms/index.d.ts",
|
|
49
54
|
"import": "./dist/utils/forms/index.js"
|
|
@@ -73,7 +78,8 @@
|
|
|
73
78
|
}
|
|
74
79
|
},
|
|
75
80
|
"dependencies": {
|
|
76
|
-
"svelte-hamburgers": "^5.0.0"
|
|
81
|
+
"svelte-hamburgers": "^5.0.0",
|
|
82
|
+
"@lucide/svelte": "^0.562.0"
|
|
77
83
|
},
|
|
78
84
|
"devDependencies": {
|
|
79
85
|
"@sveltejs/kit": "^2.0.0",
|