@devup-ui/react 1.0.16 → 1.0.18

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,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Box<T extends React.ElementType = 'div'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Box<T extends React.ElementType = 'div'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAErD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../src/components/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAErD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Button<T extends React.ElementType = 'button'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Button<T extends React.ElementType = 'button'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAE3D,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAE3D,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Center<T extends React.ElementType = 'div'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Center<T extends React.ElementType = 'div'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Center.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/components/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAExD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/components/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAExD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Flex<T extends React.ElementType = 'div'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Flex<T extends React.ElementType = 'div'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Flex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../src/components/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEtD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../src/components/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEtD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Grid<T extends React.ElementType = 'div'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Grid<T extends React.ElementType = 'div'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEtD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEtD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Image<T extends React.ElementType = 'img'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Image<T extends React.ElementType = 'img'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEvD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAEvD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Input<T extends React.ElementType = 'input'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Input<T extends React.ElementType = 'input'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,OAAO,EAEzD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,OAAO,EAEzD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function Text<T extends React.ElementType = 'span'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function Text<T extends React.ElementType = 'span'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=Text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAEvD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/components/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAEvD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,4 +1,4 @@
1
- import { DevupComponentProps } from '../types/props';
1
+ import { DevupComponentBaseProps, DevupComponentProps } from '../types/props';
2
2
  import { Merge } from '../types/utils';
3
- export declare function VStack<T extends React.ElementType = 'div'>(props: Merge<React.ComponentProps<T>, DevupComponentProps<T>>): React.ReactElement;
3
+ export declare function VStack<T extends React.ElementType = 'div'>(props: Merge<DevupComponentBaseProps<T>, DevupComponentProps<T>>): React.ReactElement;
4
4
  //# sourceMappingURL=VStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../src/components/VStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAExD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC5D,KAAK,CAAC,YAAY,CAEpB"}
1
+ {"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../src/components/VStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAExD,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAC/D,KAAK,CAAC,YAAY,CAEpB"}
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),o=require("./use-safe-effect.cjs");let t=null;const u={};let a=null;function f(){const n=l.useId(),[r,s]=l.useState(a);return o.useSafeEffect(()=>{if(a!==null)return;const e=document.documentElement.getAttribute("data-theme");e!==null&&e!==r&&s(e)},[r]),o.useSafeEffect(()=>{const e=document.documentElement;return u[n]=s,t||(t=new MutationObserver(()=>{const c=document.documentElement.getAttribute("data-theme");a=c;for(const i in u)u[i](c)}),t.observe(e,{attributes:!0,attributeFilter:["data-theme"],childList:!1,subtree:!1,characterData:!1,attributeOldValue:!1,characterDataOldValue:!1})),()=>{delete u[n],t&&Object.keys(u).length===0&&t.disconnect()}},[n]),r}exports.useTheme=f;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),r=require("../stores/theme-store.cjs"),e=r.createThemeStore();function o(){return t.useSyncExternalStore(e.subscribe,e.get,e.get)}exports.useTheme=o;
@@ -1,3 +1,2 @@
1
- import { DevupTheme } from '../types/theme';
2
- export declare function useTheme(): keyof DevupTheme | null;
1
+ export declare function useTheme(): null;
3
2
  //# sourceMappingURL=use-theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-theme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAOhD,wBAAgB,QAAQ,IAAI,MAAM,UAAU,GAAG,IAAI,CAqClD"}
1
+ {"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-theme.ts"],"names":[],"mappings":"AAQA,wBAAgB,QAAQ,SAOvB"}
@@ -1,35 +1,14 @@
1
1
  "use client";
2
- import { useId as m, useState as i } from "react";
3
- import { useSafeEffect as s } from "./use-safe-effect.js";
4
- let t = null;
5
- const n = {};
6
- let u = null;
7
- function h() {
8
- const r = m(), [a, l] = i(u);
9
- return s(() => {
10
- if (u !== null) return;
11
- const e = document.documentElement.getAttribute("data-theme");
12
- e !== null && e !== a && l(e);
13
- }, [a]), s(() => {
14
- const e = document.documentElement;
15
- return n[r] = l, t || (t = new MutationObserver(() => {
16
- const o = document.documentElement.getAttribute("data-theme");
17
- u = o;
18
- for (const c in n)
19
- n[c](o);
20
- }), t.observe(e, {
21
- attributes: !0,
22
- attributeFilter: ["data-theme"],
23
- childList: !1,
24
- subtree: !1,
25
- characterData: !1,
26
- attributeOldValue: !1,
27
- characterDataOldValue: !1
28
- })), () => {
29
- delete n[r], t && Object.keys(n).length === 0 && t.disconnect();
30
- };
31
- }, [r]), a;
2
+ import { useSyncExternalStore as t } from "react";
3
+ import { createThemeStore as r } from "../stores/theme-store.js";
4
+ const e = r();
5
+ function c() {
6
+ return t(
7
+ e.subscribe,
8
+ e.get,
9
+ e.get
10
+ );
32
11
  }
33
12
  export {
34
- h as useTheme
13
+ c as useTheme
35
14
  };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=null;function a(){if(typeof window>"u")return{get:()=>u,set:()=>{},subscribe:()=>()=>{}};const o=document.documentElement,r=new Set;let n=u;const i=()=>n,s=e=>{n=e,r.forEach(t=>t(n))},c=e=>(r.add(e),s(o.getAttribute("data-theme")),()=>r.delete(e));return new MutationObserver(e=>{for(const t of e)t.type==="attributes"&&t.target instanceof HTMLElement&&s(t.target.getAttribute("data-theme"))}).observe(o,{attributes:!0,attributeFilter:["data-theme"],subtree:!1}),{get:i,set:s,subscribe:c}}exports.createThemeStore=a;
@@ -0,0 +1,14 @@
1
+ import { DevupTheme } from '../types/theme';
2
+ type Theme = keyof DevupTheme | null;
3
+ type StoreChangeEvent = (newTheme: Theme) => void;
4
+ export declare function createThemeStore(): {
5
+ get: () => null;
6
+ set: () => void;
7
+ subscribe: () => () => void;
8
+ } | {
9
+ get: () => null;
10
+ set: (newTheme: Theme) => void;
11
+ subscribe: (onStoreChange: StoreChangeEvent) => () => boolean;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=theme-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-store.d.ts","sourceRoot":"","sources":["../../src/stores/theme-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,KAAK,KAAK,GAAG,MAAM,UAAU,GAAG,IAAI,CAAA;AACpC,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAA;AAIjD,wBAAgB,gBAAgB;;;;;;oBAYP,KAAK;+BAKM,gBAAgB;EAqBnD"}
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ function a() {
3
+ if (typeof window > "u")
4
+ return {
5
+ get: () => null,
6
+ set: () => {
7
+ },
8
+ subscribe: () => () => {
9
+ }
10
+ };
11
+ const i = document.documentElement, n = /* @__PURE__ */ new Set();
12
+ let r = null;
13
+ const o = () => r, s = (e) => {
14
+ r = e, n.forEach((t) => t(r));
15
+ }, u = (e) => (n.add(e), s(i.getAttribute("data-theme")), () => n.delete(e));
16
+ return new MutationObserver((e) => {
17
+ for (const t of e)
18
+ t.type === "attributes" && t.target instanceof HTMLElement && s(t.target.getAttribute("data-theme"));
19
+ }).observe(i, {
20
+ attributes: !0,
21
+ attributeFilter: ["data-theme"],
22
+ subtree: !1
23
+ }), {
24
+ get: o,
25
+ set: s,
26
+ subscribe: u
27
+ };
28
+ }
29
+ export {
30
+ a as createThemeStore
31
+ };
@@ -25,4 +25,11 @@ export interface DevupComponentProps<T extends React.ElementType> extends DevupP
25
25
  as?: T;
26
26
  styleVars?: Record<string, string | undefined>;
27
27
  }
28
+ export type DevupComponentBaseProps<T extends React.ElementType> = DevupElementTypeProps<T> & DevupComponentAdditionalProps<T>;
29
+ export type DevupElementTypeProps<T extends React.ElementType> = T extends string ? React.ComponentProps<T> : object;
30
+ export type DevupComponentAdditionalProps<T extends React.ElementType, P extends React.ComponentProps<T> = React.ComponentProps<T>> = Partial<P> extends P ? {
31
+ props?: P;
32
+ } : {
33
+ props: P;
34
+ };
28
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/props/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,KAAK,EAAE,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qB,CAAC,CAAC,CAAC,GAAG,6BAA6B,CAAC,CAAC,CAAC,CAAA;AAE7D,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAC3D,CAAC,SAAS,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;AAErD,MAAM,MAAM,6BAA6B,CACvC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC3B,CAAC,SAAS,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAE3D,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAChB;IACE,KAAK,CAAC,EAAE,CAAC,CAAA;CACV,GACD;IACE,KAAK,EAAE,CAAC,CAAA;CACT,CAAA"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "css-in-js-framework",
17
17
  "react"
18
18
  ],
19
- "version": "1.0.16",
19
+ "version": "1.0.18",
20
20
  "type": "module",
21
21
  "publishConfig": {
22
22
  "access": "public"
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "rollup-plugin-preserve-directives": "^0.4.0",
43
- "vite": "^7.1.3",
43
+ "vite": "^7.1.5",
44
44
  "vite-plugin-dts": "^4.5.4",
45
45
  "typescript": "^5.9.2",
46
46
  "@types/react": "^19"
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=typeof window>"u"?e.useEffect:e.useLayoutEffect;exports.useSafeEffect=t;
@@ -1,6 +0,0 @@
1
- "use client";
2
- import { useEffect as e, useLayoutEffect as f } from "react";
3
- const o = typeof window > "u" ? e : f;
4
- export {
5
- o as useSafeEffect
6
- };