bref-ui 2.1.2 → 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 aria-hidden="true" transition:fly|global={{ duration: 350, y: -6, easing: elasticOut }}>
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
- <div data-title>
12
- {#if icon}<Icon {...icon} size="medium" color="foreground" label={undefined} />{/if}
13
- <h2 id={`${id}-title`}>{title}</h2>
14
- </div>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bref-ui",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "A Svelte-first, human-first, agent-first UI library for building beautiful sites and apps with components you can make your own.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/readme.md CHANGED
@@ -7,6 +7,8 @@ and apps with components you can make your own.
7
7
  [![Discord](https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white)](https://discord.gg/JpgQRTUsVS)
8
8
  [![MIT license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
9
9
 
10
+ https://github.com/user-attachments/assets/09b9a73d-c6fb-4e8d-b4f5-2267c4552ad7
11
+
10
12
  ## Get started
11
13
 
12
14
  ### Explore the gallery
@@ -89,6 +91,10 @@ is available from `bref-ui/types`. Copied components include the helper in
89
91
 
90
92
  ## Why Bref-ui?
91
93
 
94
+ [Watch Bref-ui in 60 seconds](https://feuersteiner.github.io/bref-ui/#why-bref-ui): themes,
95
+ scoped Svelte CSS, npm installation and CLI source ownership.
96
+ The [demo video](static/bref-ui-demo.mp4) is also available in this repository.
97
+
92
98
  1. **Svelte-first.** The goal is modern components with zero runtime dependencies
93
99
  beyond Svelte, built from scoped CSS, familiar HTML, native events, bindings and
94
100
  snippets. Readable styles, with no class-name vocabulary to memorize. The
@@ -160,6 +166,19 @@ Run `bun run dev` in the repository for the gallery and current API documentatio
160
166
  Explore the [component exports](src/lib/index.ts) and [component source](src/lib)
161
167
  to inspect and customize the implementation.
162
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
+
163
182
  ## Roadmap
164
183
 
165
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 aria-hidden="true" transition:fly|global={{ duration: 350, y: -6, easing: elasticOut }}>
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
- <div data-title>
12
- {#if icon}<Icon {...icon} size="medium" color="foreground" label={undefined} />{/if}
13
- <h2 id={`${id}-title`}>{title}</h2>
14
- </div>
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}