glasslikeui 1.3.0 → 1.4.0

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.
@@ -111,7 +111,7 @@
111
111
  {#if title}
112
112
  <header class="sheet-header">
113
113
  <HStack alignment="center">
114
- <button class="sheet-close-btn" onclick={close} aria-label="Close">
114
+ <button type="button" class="sheet-close-btn" onclick={close} aria-label="Close">
115
115
  <svg
116
116
  xmlns="http://www.w3.org/2000/svg"
117
117
  width="20"
@@ -8,7 +8,12 @@
8
8
  fullWidth?: boolean;
9
9
  disabled?: boolean;
10
10
  href?: string | undefined;
11
+ /** Anchor target (href only). target="_blank" gets rel="noopener noreferrer" unless rel is set. */
12
+ target?: '_blank' | '_self' | '_parent' | '_top' | undefined;
13
+ rel?: string | undefined;
11
14
  onclick?: ((e: MouseEvent) => void) | undefined;
15
+ /** Native button type. Left unset, a button inside a form submits it (browser default). */
16
+ type?: 'button' | 'submit' | 'reset' | undefined;
12
17
  class?: string;
13
18
  }
14
19
 
@@ -19,7 +24,10 @@
19
24
  fullWidth = false,
20
25
  disabled = false,
21
26
  href,
27
+ target,
28
+ rel,
22
29
  onclick,
30
+ type,
23
31
  class: className = ''
24
32
  }: Props = $props();
25
33
 
@@ -35,6 +43,8 @@
35
43
  {#if href}
36
44
  <a
37
45
  {href}
46
+ {target}
47
+ rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}
38
48
  class="button variant-{variant} size-{size} {className}"
39
49
  class:full-width={fullWidth}
40
50
  class:disabled
@@ -52,6 +62,7 @@
52
62
  class:full-width={fullWidth}
53
63
  {disabled}
54
64
  {onclick}
65
+ {type}
55
66
  style="
56
67
  --btn-padding: {styles.padding};
57
68
  --btn-font-size: {styles.fontSize};
@@ -6,7 +6,12 @@ interface Props {
6
6
  fullWidth?: boolean;
7
7
  disabled?: boolean;
8
8
  href?: string | undefined;
9
+ /** Anchor target (href only). target="_blank" gets rel="noopener noreferrer" unless rel is set. */
10
+ target?: '_blank' | '_self' | '_parent' | '_top' | undefined;
11
+ rel?: string | undefined;
9
12
  onclick?: ((e: MouseEvent) => void) | undefined;
13
+ /** Native button type. Left unset, a button inside a form submits it (browser default). */
14
+ type?: 'button' | 'submit' | 'reset' | undefined;
10
15
  class?: string;
11
16
  }
12
17
  declare const Button: import("svelte").Component<Props, {}, string>;
@@ -7,6 +7,9 @@
7
7
  size?: 'sm' | 'md' | 'lg';
8
8
  label?: string | undefined;
9
9
  onclick?: ((e: MouseEvent) => void) | undefined;
10
+ disabled?: boolean;
11
+ /** Native button type. Left unset, a button inside a form submits it (browser default). */
12
+ type?: 'button' | 'submit' | 'reset' | undefined;
10
13
  class?: string;
11
14
  }
12
15
 
@@ -16,6 +19,8 @@
16
19
  size = 'md',
17
20
  label = '',
18
21
  onclick,
22
+ disabled = false,
23
+ type,
19
24
  class: className = ''
20
25
  }: Props = $props();
21
26
 
@@ -31,6 +36,8 @@
31
36
  aria-label={label}
32
37
  title={label}
33
38
  {onclick}
39
+ {disabled}
40
+ {type}
34
41
  style="--btn-size: {sizeMap[size]}px"
35
42
  >
36
43
  {@render children()}
@@ -55,6 +62,11 @@
55
62
  color: var(--color-text);
56
63
  }
57
64
 
65
+ .icon-button:disabled {
66
+ opacity: 0.5;
67
+ pointer-events: none;
68
+ }
69
+
58
70
  .icon-button.variant-plain {
59
71
  background: transparent;
60
72
  }
@@ -5,6 +5,9 @@ interface Props {
5
5
  size?: 'sm' | 'md' | 'lg';
6
6
  label?: string | undefined;
7
7
  onclick?: ((e: MouseEvent) => void) | undefined;
8
+ disabled?: boolean;
9
+ /** Native button type. Left unset, a button inside a form submits it (browser default). */
10
+ type?: 'button' | 'submit' | 'reset' | undefined;
8
11
  class?: string;
9
12
  }
10
13
  declare const IconButton: import("svelte").Component<Props, {}, string>;
@@ -98,6 +98,7 @@
98
98
  <HStack spacing="xs" justify="center" class="tab-bar">
99
99
  {#each tabs as tab (tab.id)}
100
100
  <button
101
+ type="button"
101
102
  class="tab-item"
102
103
  class:active={activeTab === tab.id}
103
104
  onclick={() => selectTab(tab.id)}
@@ -59,7 +59,7 @@
59
59
  </HStack>
60
60
  </a>
61
61
  {:else if onclick}
62
- <button class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider} {onclick}>
62
+ <button type="button" class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider} {onclick}>
63
63
  <HStack spacing="sm" alignment="center" class="row-content">
64
64
  {#if leading}
65
65
  <div class="row-leading">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glasslikeui",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Svelte component library with frosted glass materials",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "type": "module",