milk-lib 0.0.5 → 0.0.6

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.
@@ -1,2 +1,2 @@
1
- import type { IThemeVars } from "./ThemeProvider.types";
2
- export declare let vars: IThemeVars;
1
+ import type { ITheme } from "./ThemeProvider.types";
2
+ export declare const themeDefault: ITheme;
@@ -1,4 +1,4 @@
1
- export let vars = {
1
+ export const themeDefault = {
2
2
  '--panel-base': '#f3f5f6',
3
3
  '--panel-primary': '#FFF9E5',
4
4
  '--panel-success': '#DDF9E6',
@@ -1,16 +1,16 @@
1
1
  <script lang="ts">
2
2
 
3
- import { vars } from './ThemeDefault';
4
3
  import type { Snippet } from 'svelte';
4
+ import type { ITheme } from './ThemeProvider.types'
5
+
6
+ let { children, theme } : { children: Snippet, theme : ITheme } = $props();
5
7
 
6
8
  let cssVars = $derived.by(() => {
7
- return Object.entries(vars)
9
+ return Object.entries(theme)
8
10
  .map((([k,v]) => `${k}:${v}`))
9
11
  .join(';');
10
12
  });
11
13
 
12
- let { children } : { children: Snippet } = $props();
13
-
14
14
  </script>
15
15
 
16
16
  <div style={cssVars} class="ThemeProvider">
@@ -1,6 +1,8 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { ITheme } from './ThemeProvider.types';
2
3
  type $$ComponentProps = {
3
4
  children: Snippet;
5
+ theme: ITheme;
4
6
  };
5
7
  declare const ThemeProvider: import("svelte").Component<$$ComponentProps, {}, "">;
6
8
  type ThemeProvider = ReturnType<typeof ThemeProvider>;
@@ -1,5 +1,5 @@
1
1
  export type ThemeVars = Record<string, string | number>;
2
- export interface IThemeVars {
2
+ export interface ITheme {
3
3
  '--panel-base': string;
4
4
  '--panel-primary': string;
5
5
  '--panel-success': string;
@@ -1 +1,2 @@
1
1
  export { default as ThemeProvider } from './ThemeProvider.svelte';
2
+ export { themeDefault } from './ThemeDefault';
@@ -1 +1,2 @@
1
1
  export { default as ThemeProvider } from './ThemeProvider.svelte';
2
+ export { themeDefault } from './ThemeDefault';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "milk-lib",
3
3
  "license": "MIT",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",