@tishlang/tish-desktop-ui-theme 1.1.1 → 1.1.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tishlang/tish-desktop-ui-theme",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "Shared shadcn-like theme tokens and lattish UI primitives for Tish Desktop",
5
5
  "license": "PIF",
6
6
  "type": "module",
package/src/ui/Badge.tish CHANGED
@@ -1,21 +1,34 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
8
10
  fn toneClass(tone) {
9
- if (tone === "primary") return "bg-primary text-primary-foreground border-transparent"
10
- if (tone === "destructive") return "bg-destructive text-destructive-foreground border-transparent"
11
- if (tone === "outline") return "bg-transparent text-foreground border-border"
12
- if (tone === "accent") return "bg-accent text-accent-foreground border-transparent"
11
+ if (tone === "primary") {
12
+ return "bg-primary text-primary-foreground border-transparent"
13
+ }
14
+ if (tone === "destructive") {
15
+ return "bg-destructive text-destructive-foreground border-transparent"
16
+ }
17
+ if (tone === "outline") {
18
+ return "bg-transparent text-foreground border-border"
19
+ }
20
+ if (tone === "accent") {
21
+ return "bg-accent text-accent-foreground border-transparent"
22
+ }
13
23
  return "bg-muted text-muted-foreground border-transparent"
14
24
  }
15
25
 
16
26
  export fn Badge(props) {
17
27
  let tone = props.tone !== null && props.tone !== undefined ? props.tone : "muted"
18
- return <span class={cx("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium", cx(toneClass(tone), props.class))}>
28
+ return <span class={cx(
29
+ "inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",
30
+ cx(toneClass(tone), props.class)
31
+ )}>
19
32
  {props.children}
20
33
  </span>
21
34
  }
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
@@ -25,9 +27,15 @@ fn variantClass(variant) {
25
27
  }
26
28
 
27
29
  fn sizeClass(size) {
28
- if (size === "sm") return "h-8 px-3 text-xs"
29
- if (size === "lg") return "h-11 px-5 text-base"
30
- if (size === "icon") return "h-9 w-9 p-0"
30
+ if (size === "sm") {
31
+ return "h-8 px-3 text-xs"
32
+ }
33
+ if (size === "lg") {
34
+ return "h-11 px-5 text-base"
35
+ }
36
+ if (size === "icon") {
37
+ return "h-9 w-9 p-0"
38
+ }
31
39
  return "h-9 px-4 text-sm"
32
40
  }
33
41
 
@@ -38,12 +46,7 @@ export fn Button(props) {
38
46
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg font-medium transition-opacity disabled:pointer-events-none disabled:opacity-50",
39
47
  cx(variantClass(variant), cx(sizeClass(size), props.class))
40
48
  )
41
- return <button
42
- type={props.type !== null && props.type !== undefined ? props.type : "button"}
43
- class={className}
44
- disabled={props.disabled}
45
- onClick={props.onClick}
46
- >
49
+ return <button type={props.type !== null && props.type !== undefined ? props.type : "button"} class={className} disabled={props.disabled} onClick={props.onClick}>
47
50
  {props.children}
48
51
  </button>
49
52
  }
package/src/ui/Card.tish CHANGED
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
@@ -24,7 +26,10 @@ export fn CardBody(props) {
24
26
  }
25
27
 
26
28
  export fn CardFooter(props) {
27
- return <div class={cx("flex items-center gap-2 p-4 border-t border-border text-muted-foreground", props.class)}>
29
+ return <div class={cx(
30
+ "flex items-center gap-2 p-4 border-t border-border text-muted-foreground",
31
+ props.class
32
+ )}>
28
33
  {props.children}
29
34
  </div>
30
35
  }
package/src/ui/Input.tish CHANGED
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
@@ -10,14 +12,5 @@ export fn Input(props) {
10
12
  "flex h-9 w-full rounded-lg border border-input bg-background px-3 py-1 text-sm text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-2 ring-ring disabled:cursor-not-allowed disabled:opacity-50",
11
13
  props.class
12
14
  )
13
- return <input
14
- type={props.type !== null && props.type !== undefined ? props.type : "text"}
15
- class={className}
16
- value={props.value}
17
- placeholder={props.placeholder}
18
- disabled={props.disabled}
19
- onInput={props.onInput}
20
- onChange={props.onChange}
21
- onKeyDown={props.onKeyDown}
22
- />
15
+ return <input type={props.type !== null && props.type !== undefined ? props.type : "text"} class={className} value={props.value} placeholder={props.placeholder} disabled={props.disabled} onInput={props.onInput} onChange={props.onChange} onKeyDown={props.onKeyDown} />
23
16
  }
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
@@ -1,14 +1,14 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
8
10
  export fn Separator(props) {
9
11
  let vertical = props.orientation === "vertical"
10
- let className = vertical
11
- ? "shrink-0 bg-border w-px h-full"
12
- : "shrink-0 bg-border h-px w-full"
12
+ let className = vertical ? "shrink-0 bg-border w-px h-full" : "shrink-0 bg-border h-px w-full"
13
13
  return <div role="separator" class={cx(className, props.class)} />
14
14
  }
@@ -1,18 +1,17 @@
1
1
  /** @jsxImportSource lattish */
2
2
 
3
3
  fn cx(base, extra) {
4
- if (extra === null || extra === undefined || extra === "") return base
4
+ if (extra === null || extra === undefined || extra === "") {
5
+ return base
6
+ }
5
7
  return base + " " + extra
6
8
  }
7
9
 
8
10
  export fn Toolbar(props) {
9
- return <div
10
- class={cx(
11
- "flex items-center gap-2 h-12 px-4 border-b border-border bg-background select-none",
12
- props.class
13
- )}
14
- onMouseDown={props.onMouseDown}
15
- >
11
+ return <div class={cx(
12
+ "flex items-center gap-2 h-12 px-4 border-b border-border bg-background select-none",
13
+ props.class
14
+ )} onMouseDown={props.onMouseDown}>
16
15
  {props.children}
17
16
  </div>
18
17
  }