@invopop/popui 0.1.59 → 0.1.61

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.
@@ -9,14 +9,16 @@
9
9
  label = '',
10
10
  value = '',
11
11
  monospaced = false,
12
+ vertical = false,
12
13
  children,
13
14
  onCopy,
14
15
  onLink
15
16
  }: DataListItemProps = $props()
16
17
 
17
18
  let valueStyles = $derived(
18
- clsx('text-foreground font-medium text-base truncate min-w-0', {
19
- 'font-mono slashed-zero tabular-nums lining-nums': monospaced
19
+ clsx('text-foreground font-medium text-base min-w-0', {
20
+ 'font-mono slashed-zero tabular-nums lining-nums': monospaced,
21
+ truncate: !children
20
22
  })
21
23
  )
22
24
 
@@ -35,20 +37,30 @@
35
37
  }
36
38
  </script>
37
39
 
38
- <div class="flex gap-6 items-center group">
39
- <div class="text-foreground-default-secondary text-base min-w-[125px]">
40
+ <div
41
+ class={clsx('flex group', {
42
+ 'flex-col gap-1.5': vertical,
43
+ 'gap-6 items-center': !vertical
44
+ })}
45
+ >
46
+ <div
47
+ class={clsx('text-foreground-default-secondary text-base', {
48
+ 'pl-2': vertical,
49
+ 'min-w-[125px]': !vertical
50
+ })}
51
+ >
40
52
  {label}
41
53
  </div>
42
54
  <!-- svelte-ignore a11y_click_events_have_key_events -->
43
55
  <!-- svelte-ignore a11y_no_static_element_interactions -->
44
56
  <div
45
57
  class={clsx(
46
- 'flex flex-1 gap-1 items-center group-hover:bg-background-default-secondary py-1 pl-2 pr-1 rounded-md min-w-0',
58
+ 'flex flex-1 gap-1 items-start group-hover:bg-background-default-secondary py-1 pl-2 pr-1 rounded-md min-w-0 min-h-8',
47
59
  { 'cursor-pointer': clickAction }
48
60
  )}
49
61
  onclick={clickAction ? handleAreaClick : undefined}
50
62
  >
51
- <div class="flex-1 min-w-0 h-8">
63
+ <div class="flex-1 min-w-0 overflow-x-auto">
52
64
  <div class={valueStyles}>
53
65
  {#if children}
54
66
  {@render children()}
@@ -59,6 +71,7 @@
59
71
  </div>
60
72
  {#if onCopy}
61
73
  <BaseButton
74
+ size="sm"
62
75
  variant="outline"
63
76
  icon={Duplicate}
64
77
  onclick={async () => {
@@ -70,6 +83,7 @@
70
83
  {/if}
71
84
  {#if onLink}
72
85
  <BaseButton
86
+ size="sm"
73
87
  variant="outline"
74
88
  icon={ExternalLink}
75
89
  onclick={onLink}
package/dist/types.d.ts CHANGED
@@ -308,7 +308,7 @@ export interface DataListItemProps {
308
308
  label?: string;
309
309
  value?: string;
310
310
  monospaced?: boolean;
311
- fullWidth?: boolean;
311
+ vertical?: boolean;
312
312
  children?: Snippet;
313
313
  onCopy?: () => void;
314
314
  onLink?: () => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.59",
4
+ "version": "0.1.61",
5
5
  "repository": {
6
6
  "url": "https://github.com/invopop/popui"
7
7
  },