@immich/ui 0.12.0 → 0.12.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.
@@ -1,16 +1,26 @@
1
1
  <script lang="ts">
2
2
  import type { Size, TextColor } from '../../types.js';
3
+ import { cleanClass } from '../../utils.js';
3
4
  import type { Snippet } from 'svelte';
5
+ import type { HTMLAttributes } from 'svelte/elements';
4
6
  import { tv } from 'tailwind-variants';
5
7
 
6
8
  type Props = {
7
9
  color?: TextColor;
8
10
  size?: Size;
9
11
  variant?: 'filled';
12
+ class?: string;
10
13
  children: Snippet;
11
- };
14
+ } & HTMLAttributes<HTMLElement>;
12
15
 
13
- const { size = 'medium', variant, color = 'secondary', children }: Props = $props();
16
+ const {
17
+ class: className,
18
+ size = 'medium',
19
+ variant,
20
+ color = 'secondary',
21
+ children,
22
+ ...restProps
23
+ }: Props = $props();
14
24
 
15
25
  const styles = tv({
16
26
  base: 'font-monospace',
@@ -53,10 +63,14 @@
53
63
  </script>
54
64
 
55
65
  <code
56
- class={styles({
57
- filled: variant === 'filled',
58
- filledColor: variant === 'filled' && color,
59
- textColor: color,
60
- size,
61
- })}>{@render children()}</code
66
+ class={cleanClass(
67
+ styles({
68
+ filled: variant === 'filled',
69
+ filledColor: variant === 'filled' && color,
70
+ textColor: color,
71
+ size,
72
+ }),
73
+ className,
74
+ )}
75
+ {...restProps}>{@render children()}</code
62
76
  >
@@ -1,9 +1,11 @@
1
1
  import type { Size, TextColor } from '../../types.js';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
3
4
  declare const Code: import("svelte").Component<{
4
5
  color?: TextColor;
5
6
  size?: Size;
6
7
  variant?: "filled";
8
+ class?: string;
7
9
  children: Snippet;
8
- }, {}, "">;
10
+ } & HTMLAttributes<HTMLElement>, {}, "">;
9
11
  export default Code;
@@ -20,7 +20,7 @@
20
20
  const helperTextChildren = $derived(getChildSnippet(ChildKey.HelperText));
21
21
  </script>
22
22
 
23
- <div>
23
+ <div class="w-full">
24
24
  {@render children()}
25
25
  {#if helperTextChildren}
26
26
  <div class={cleanClass('pt-1', helperTextChildren.class)}>
@@ -73,12 +73,12 @@
73
73
  const labelId = `label-${id}`;
74
74
  </script>
75
75
 
76
- <div class="flex flex-col gap-1" bind:this={containerRef}>
76
+ <div class="flex w-full flex-col gap-1" bind:this={containerRef}>
77
77
  {#if label}
78
78
  <label id={labelId} for={inputId} class={labelStyles({ size })}>{label}</label>
79
79
  {/if}
80
80
 
81
- <div class="relative mt-1.5">
81
+ <div class="relative mt-1.5 w-full">
82
82
  <input
83
83
  id={label && inputId}
84
84
  aria-labelledby={label && labelId}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "scripts": {
6
6
  "create": "node scripts/create.js",