@x33025/sveltely 0.1.19 → 0.1.21

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.
@@ -31,4 +31,11 @@
31
31
  <Label label="Enabled" orientation="trailing" width="fit">
32
32
  <Switch bind:checked={enabled} />
33
33
  </Label>
34
+
35
+ <Label orientation="leading" width="fit">
36
+ {#snippet labelContent()}
37
+ <span>Name <span class="text-[var(--sveltely-text-tertiary-color)]">optional</span></span>
38
+ {/snippet}
39
+ <TextField bind:value={name} placeholder="Sveltely" />
40
+ </Label>
34
41
  </HStack>
@@ -7,6 +7,7 @@
7
7
  type Props = {
8
8
  children?: Snippet;
9
9
  label?: string;
10
+ labelContent?: Snippet;
10
11
  icon?: Component<{ class?: string; size?: number | string }>;
11
12
  iconSize?: number | string;
12
13
  iconColor?: string;
@@ -17,6 +18,7 @@
17
18
  let {
18
19
  children,
19
20
  label,
21
+ labelContent,
20
22
  icon,
21
23
  iconSize,
22
24
  iconColor,
@@ -93,7 +95,7 @@
93
95
  </script>
94
96
 
95
97
  <div class="label" data-orientation={orientation} style={rootStyle}>
96
- {#if icon || label}
98
+ {#if icon || label || labelContent}
97
99
  <span class="label-heading">
98
100
  {#if icon}
99
101
  {@const Icon = icon}
@@ -104,6 +106,10 @@
104
106
 
105
107
  {#if label}
106
108
  <span class="label-text">{label}</span>
109
+ {:else if labelContent}
110
+ <span class="label-text">
111
+ {@render labelContent()}
112
+ </span>
107
113
  {/if}
108
114
  </span>
109
115
  {/if}
@@ -5,6 +5,7 @@ import { type StyleProps } from '../../../style/surface';
5
5
  type Props = {
6
6
  children?: Snippet;
7
7
  label?: string;
8
+ labelContent?: Snippet;
8
9
  icon?: Component<{
9
10
  class?: string;
10
11
  size?: number | string;
package/dist/style.css CHANGED
@@ -556,6 +556,9 @@
556
556
  .text-\[var\(--sveltely-text-secondary-color\)\] {
557
557
  color: var(--sveltely-text-secondary-color);
558
558
  }
559
+ .text-\[var\(--sveltely-text-tertiary-color\)\] {
560
+ color: var(--sveltely-text-tertiary-color);
561
+ }
559
562
  .text-gray-700 {
560
563
  color: var(--color-gray-700);
561
564
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x33025/sveltely",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",