bref-ui 2.1.3 → 2.1.4
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fly } from 'svelte/transition';
|
|
3
3
|
import { elasticOut } from 'svelte/easing';
|
|
4
|
+
import { prefersReducedMotion } from 'svelte/motion';
|
|
4
5
|
import Icon from '../icon/icon.svelte';
|
|
5
6
|
import type { CheckboxProps } from './types.js';
|
|
6
7
|
|
|
@@ -10,7 +11,14 @@
|
|
|
10
11
|
<div data-checkbox data-size={size}>
|
|
11
12
|
<input {...attributes} type="checkbox" bind:checked />
|
|
12
13
|
{#if checked}
|
|
13
|
-
<span
|
|
14
|
+
<span
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
transition:fly={{
|
|
17
|
+
duration: prefersReducedMotion.current ? 0 : 350,
|
|
18
|
+
y: prefersReducedMotion.current ? 0 : -6,
|
|
19
|
+
easing: elasticOut
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
14
22
|
<Icon name="check" style="font-variation-settings: 'wght' 500" />
|
|
15
23
|
</span>
|
|
16
24
|
{/if}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from '../button/button.svelte';
|
|
3
3
|
import Icon from '../icon/icon.svelte';
|
|
4
|
+
import { fly } from 'svelte/transition';
|
|
5
|
+
import { prefersReducedMotion } from 'svelte/motion';
|
|
4
6
|
import type { DialogHeaderProps } from './types.js';
|
|
5
7
|
|
|
6
8
|
let { title, description, icon, dismissible, id, onDismiss }: DialogHeaderProps = $props();
|
|
@@ -8,10 +10,18 @@
|
|
|
8
10
|
|
|
9
11
|
<header>
|
|
10
12
|
<div>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
{#key `${icon?.name ?? ''}:${title}`}
|
|
14
|
+
<div
|
|
15
|
+
data-title
|
|
16
|
+
in:fly={{
|
|
17
|
+
y: prefersReducedMotion.current ? 0 : 8,
|
|
18
|
+
duration: prefersReducedMotion.current ? 0 : 180
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
{#if icon}<Icon {...icon} size="medium" color="foreground" label={undefined} />{/if}
|
|
22
|
+
<h2 id={`${id}-title`}>{title}</h2>
|
|
23
|
+
</div>
|
|
24
|
+
{/key}
|
|
15
25
|
{#if description}<p id={`${id}-description`}>{description}</p>{/if}
|
|
16
26
|
</div>
|
|
17
27
|
{#if dismissible}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -166,6 +166,19 @@ Run `bun run dev` in the repository for the gallery and current API documentatio
|
|
|
166
166
|
Explore the [component exports](src/lib/index.ts) and [component source](src/lib)
|
|
167
167
|
to inspect and customize the implementation.
|
|
168
168
|
|
|
169
|
+
## Themes and examples
|
|
170
|
+
|
|
171
|
+
Explore [bref-ui-themes](https://github.com/feuersteiner/bref-ui-themes) for reusable
|
|
172
|
+
Svelte themes and interactive example sites built with Bref-ui. Browse the
|
|
173
|
+
[live showcase](https://feuersteiner.github.io/bref-ui-themes/) or try the demos:
|
|
174
|
+
|
|
175
|
+
- [Relay](https://feuersteiner.github.io/bref-ui-themes/relay): a project and task
|
|
176
|
+
management app with search, filtering and task editing.
|
|
177
|
+
- [Forma](https://feuersteiner.github.io/bref-ui-themes/forma): a furniture store
|
|
178
|
+
with product filtering, a shopping cart and simulated checkout.
|
|
179
|
+
- [Elsewhere](https://feuersteiner.github.io/bref-ui-themes/elsewhere): a website
|
|
180
|
+
audit app with simulated runs, history and finding review.
|
|
181
|
+
|
|
169
182
|
## Roadmap
|
|
170
183
|
|
|
171
184
|
- **Component foundation:** inputs/textarea, pills, tree views, loading/progress,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fly } from 'svelte/transition';
|
|
3
3
|
import { elasticOut } from 'svelte/easing';
|
|
4
|
+
import { prefersReducedMotion } from 'svelte/motion';
|
|
4
5
|
import Icon from '../icon/icon.svelte';
|
|
5
6
|
import type { CheckboxProps } from './types.js';
|
|
6
7
|
|
|
@@ -10,7 +11,14 @@
|
|
|
10
11
|
<div data-checkbox data-size={size}>
|
|
11
12
|
<input {...attributes} type="checkbox" bind:checked />
|
|
12
13
|
{#if checked}
|
|
13
|
-
<span
|
|
14
|
+
<span
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
transition:fly={{
|
|
17
|
+
duration: prefersReducedMotion.current ? 0 : 350,
|
|
18
|
+
y: prefersReducedMotion.current ? 0 : -6,
|
|
19
|
+
easing: elasticOut
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
14
22
|
<Icon name="check" style="font-variation-settings: 'wght' 500" />
|
|
15
23
|
</span>
|
|
16
24
|
{/if}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from '../button/button.svelte';
|
|
3
3
|
import Icon from '../icon/icon.svelte';
|
|
4
|
+
import { fly } from 'svelte/transition';
|
|
5
|
+
import { prefersReducedMotion } from 'svelte/motion';
|
|
4
6
|
import type { DialogHeaderProps } from './types.js';
|
|
5
7
|
|
|
6
8
|
let { title, description, icon, dismissible, id, onDismiss }: DialogHeaderProps = $props();
|
|
@@ -8,10 +10,18 @@
|
|
|
8
10
|
|
|
9
11
|
<header>
|
|
10
12
|
<div>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
{#key `${icon?.name ?? ''}:${title}`}
|
|
14
|
+
<div
|
|
15
|
+
data-title
|
|
16
|
+
in:fly={{
|
|
17
|
+
y: prefersReducedMotion.current ? 0 : 8,
|
|
18
|
+
duration: prefersReducedMotion.current ? 0 : 180
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
{#if icon}<Icon {...icon} size="medium" color="foreground" label={undefined} />{/if}
|
|
22
|
+
<h2 id={`${id}-title`}>{title}</h2>
|
|
23
|
+
</div>
|
|
24
|
+
{/key}
|
|
15
25
|
{#if description}<p id={`${id}-description`}>{description}</p>{/if}
|
|
16
26
|
</div>
|
|
17
27
|
{#if dismissible}
|