compote-ui 0.13.0 → 0.14.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.
@@ -13,7 +13,7 @@ export declare const button: import("tailwind-variants").TVReturnType<{
13
13
  'icon-sm': string;
14
14
  'icon-lg': string;
15
15
  };
16
- }, undefined, "focus-visible:outline-ring inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50", {
16
+ }, undefined, "inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50", {
17
17
  variant: {
18
18
  default: string;
19
19
  outline: string;
@@ -41,6 +41,6 @@ export declare const button: import("tailwind-variants").TVReturnType<{
41
41
  'icon-sm': string;
42
42
  'icon-lg': string;
43
43
  };
44
- }, undefined, "focus-visible:outline-ring inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50", unknown, unknown, undefined>>;
44
+ }, undefined, "inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50", unknown, unknown, undefined>>;
45
45
  export type ButtonVariant = VariantProps<typeof button>['variant'];
46
46
  export type ButtonSize = VariantProps<typeof button>['size'];
@@ -1,6 +1,6 @@
1
1
  import { tv } from 'tailwind-variants';
2
2
  export const button = tv({
3
- base: 'focus-visible:outline-ring inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
3
+ base: 'inline-flex cursor-pointer items-center justify-center rounded bg-transparent text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50',
4
4
  variants: {
5
5
  variant: {
6
6
  default: 'bg-primary text-ink-inverse hover:bg-primary/90 active:bg-primary/80',
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
3
+ import { button, type ButtonVariant, type ButtonSize } from './button.variants';
4
+
5
+ type Props = Omit<HTMLAnchorAttributes, 'class'> & {
6
+ variant?: ButtonVariant;
7
+ size?: ButtonSize;
8
+ class?: string;
9
+ };
10
+
11
+ let { variant, size, class: className, children, ...rest }: Props = $props();
12
+ </script>
13
+
14
+ <a class={button({ variant, size, class: className })} {...rest}>
15
+ {@render children?.()}
16
+ </a>
@@ -0,0 +1,10 @@
1
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
2
+ import { type ButtonVariant, type ButtonSize } from './button.variants';
3
+ type Props = Omit<HTMLAnchorAttributes, 'class'> & {
4
+ variant?: ButtonVariant;
5
+ size?: ButtonSize;
6
+ class?: string;
7
+ };
8
+ declare const LinkButton: import("svelte").Component<Props, {}, "">;
9
+ type LinkButton = ReturnType<typeof LinkButton>;
10
+ export default LinkButton;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
6
+ </script>
7
+
8
+ <div class={cn('p-6 pt-0', className)} {...rest}>
9
+ {@render children?.()}
10
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const CardContent: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type CardContent = ReturnType<typeof CardContent>;
4
+ export default CardContent;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLParagraphElement> = $props();
6
+ </script>
7
+
8
+ <p class={cn('text-sm text-ink-dim', className)} {...rest}>
9
+ {@render children?.()}
10
+ </p>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const CardDescription: import("svelte").Component<HTMLAttributes<HTMLParagraphElement>, {}, "">;
3
+ type CardDescription = ReturnType<typeof CardDescription>;
4
+ export default CardDescription;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
6
+ </script>
7
+
8
+ <div class={cn('flex items-center p-6 pt-0', className)} {...rest}>
9
+ {@render children?.()}
10
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const CardFooter: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type CardFooter = ReturnType<typeof CardFooter>;
4
+ export default CardFooter;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
6
+ </script>
7
+
8
+ <div class={cn('flex flex-col gap-1.5 p-6', className)} {...rest}>
9
+ {@render children?.()}
10
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const CardHeader: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type CardHeader = ReturnType<typeof CardHeader>;
4
+ export default CardHeader;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLHeadingElement> = $props();
6
+ </script>
7
+
8
+ <h3 class={cn('text-base font-semibold leading-none', className)} {...rest}>
9
+ {@render children?.()}
10
+ </h3>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const CardTitle: import("svelte").Component<HTMLAttributes<HTMLHeadingElement>, {}, "">;
3
+ type CardTitle = ReturnType<typeof CardTitle>;
4
+ export default CardTitle;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn } from 'tailwind-variants';
4
+
5
+ let { class: className, children, ...rest }: HTMLAttributes<HTMLDivElement> = $props();
6
+ </script>
7
+
8
+ <div class={cn('rounded-xl border border-border bg-surface-1 text-ink', className)} {...rest}>
9
+ {@render children?.()}
10
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ declare const Card: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type Card = ReturnType<typeof Card>;
4
+ export default Card;
@@ -0,0 +1,6 @@
1
+ export { default as Root } from './card.svelte';
2
+ export { default as Header } from './card-header.svelte';
3
+ export { default as Title } from './card-title.svelte';
4
+ export { default as Description } from './card-description.svelte';
5
+ export { default as Content } from './card-content.svelte';
6
+ export { default as Footer } from './card-footer.svelte';
@@ -0,0 +1,6 @@
1
+ export { default as Root } from './card.svelte';
2
+ export { default as Header } from './card-header.svelte';
3
+ export { default as Title } from './card-title.svelte';
4
+ export { default as Description } from './card-description.svelte';
5
+ export { default as Content } from './card-content.svelte';
6
+ export { default as Footer } from './card-footer.svelte';
@@ -15,7 +15,7 @@
15
15
  <Checkbox.Control
16
16
  class="{children
17
17
  ? 'mt-0.5'
18
- : ''} data-focus-visible:outline-ring flex size-5 shrink-0 items-center justify-center rounded-sm border bg-transparent transition-colors hover:border-primary/50 data-disabled:pointer-events-none data-disabled:opacity-50 data-focus-visible:outline-2 data-focus-visible:outline-offset-2 data-invalid:border-danger data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary"
18
+ : ''} flex size-5 shrink-0 items-center justify-center rounded-sm border bg-transparent transition-colors hover:border-primary/50 data-disabled:pointer-events-none data-disabled:opacity-50 data-focus-visible:outline-2 data-focus-visible:outline-offset-2 data-focus-visible:outline-ring data-invalid:border-danger data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary"
19
19
  >
20
20
  <Checkbox.Indicator>
21
21
  <PhCheck class="size-3.5 text-ink-inverse" />
@@ -100,8 +100,8 @@
100
100
 
101
101
  <Combobox.Control
102
102
  class={cn(
103
- 'flex min-h-9 items-center gap-1 rounded border px-3 shadow-sm',
104
- 'focus-within:ring-1 focus-within:ring-primary',
103
+ 'flex min-h-9 items-center gap-1 rounded border bg-surface-1 px-3 shadow-sm',
104
+ 'focus-within:ring-1 focus-within:ring-ring',
105
105
  'data-invalid:border-danger data-invalid:focus-within:ring-danger',
106
106
  multiple && 'flex-wrap py-1'
107
107
  )}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { default as Button } from './components/button/button.svelte';
2
+ export { default as LinkButton } from './components/button/link-button.svelte';
3
+ export * as Card from './components/card';
2
4
  export { loadImage, fileToDataUrl, cropImage, processImage } from './utils/image-processing';
3
5
  export type { ProcessImageOptions, CropRegion } from './utils/image-processing';
4
6
  export { default as Carousel } from './components/carousel/carousel.svelte';
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // Reexport your entry components here
2
2
  export { default as Button } from './components/button/button.svelte';
3
+ export { default as LinkButton } from './components/button/link-button.svelte';
4
+ export * as Card from './components/card';
3
5
  export { loadImage, fileToDataUrl, cropImage, processImage } from './utils/image-processing';
4
6
  export { default as Carousel } from './components/carousel/carousel.svelte';
5
7
  export { default as Checkbox } from './components/checkbox/checkbox.svelte';
package/dist/theme.css CHANGED
@@ -35,8 +35,12 @@
35
35
  --compote-ring: var(--compote-primary);
36
36
  }
37
37
 
38
- .dark { color-scheme: dark; }
39
- .light { color-scheme: light; }
38
+ .dark {
39
+ color-scheme: dark;
40
+ }
41
+ .light {
42
+ color-scheme: light;
43
+ }
40
44
 
41
45
  @theme inline {
42
46
  --color-ink: var(--compote-ink);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",