duckylib 0.1.20 → 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.
@@ -15,9 +15,10 @@
15
15
  sizeEm?: number;
16
16
 
17
17
  maxLines?: number;
18
+ lineHeightEm?: number;
18
19
  }
19
20
 
20
- let { children, inheritColor = false, sizePx = 24, classList = [], weight = "normal", monospace = false, sizeEm = 0, maxLines = 0 }: TextProps = $props();
21
+ let { children, inheritColor = false, sizePx = 24, classList = [], weight = "normal", monospace = false, sizeEm = 0, maxLines = 0, lineHeightEm = 0 }: TextProps = $props();
21
22
 
22
23
  function lineClamp(lines: number): string {
23
24
  return `
@@ -32,7 +33,7 @@
32
33
  </script>
33
34
 
34
35
 
35
- <p class="{classList.join(" ")} font-{monospace ? "mono-" : ""}{weight}" style="color: {inheritColor ? "inherit" : "var(--text)"};user-select:none;{sizeEm > 0 ? `font-size: ${sizeEm}em;` : ""}{maxLines > 0 ? lineClamp(maxLines) : ""}">{@render children()}</p>
36
+ <p class="{classList.join(" ")} font-{monospace ? "mono-" : ""}{weight}" style="color: {inheritColor ? "inherit" : "var(--text)"};user-select:none;{sizeEm > 0 ? `font-size: ${sizeEm}em;` : ""}{maxLines > 0 ? lineClamp(maxLines) : ""}line-height:{lineHeightEm === 0 ? "normal" : `${lineHeightEm}em`};">{@render children()}</p>
36
37
 
37
38
 
38
39
  <style>
@@ -9,6 +9,7 @@ export interface TextProps {
9
9
  monospace?: boolean;
10
10
  sizeEm?: number;
11
11
  maxLines?: number;
12
+ lineHeightEm?: number;
12
13
  }
13
14
  declare const Text: import("svelte").Component<TextProps, {}, "">;
14
15
  type Text = ReturnType<typeof Text>;
@@ -223,5 +223,5 @@ p {
223
223
 
224
224
 
225
225
  * {
226
- line-height: 1.2em;
226
+ line-height: normal;
227
227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "duckylib",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",