@matchain/matchid-sdk-react 0.1.56-alpha.2 → 0.1.56-alpha.3

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/dist/ui.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  Skeleton_default,
17
17
  Switch,
18
18
  Tabs
19
- } from "./chunk-NIGHV7RT.mjs";
19
+ } from "./chunk-KDVKIXOS.mjs";
20
20
  import "./chunk-JX73EY6V.mjs";
21
21
  import "./chunk-UA6XHZHX.mjs";
22
22
  import "./chunk-IZOOVZAD.mjs";
@@ -0,0 +1,38 @@
1
+ import {useModal} from "@matchain/matchid-sdk-react/hooks";
2
+ import {Input, Button} from "@matchain/matchid-sdk-react/ui";
3
+ import ButtonGroup from "@/components/ButtonGroup";
4
+ import {useState} from "react";
5
+
6
+ export default function ModalDemo(){
7
+ const modal = useModal()
8
+ const openModal = ()=>{
9
+ modal.open({
10
+ title:"Modal Title",
11
+ content:({close})=>{
12
+ const [value,setValue] = useState("")
13
+
14
+ const addModal = ()=>{
15
+ modal.open({
16
+ title:"Modal 2",
17
+ content:({close})=>{
18
+ return <div>
19
+ <p>{value}</p>
20
+ <Button onClick={close}>Close</Button>
21
+ </div>
22
+ }
23
+ })
24
+ }
25
+
26
+ return <div>
27
+ <Input value={value} onChange={(e)=>setValue(e.target.value)}/>
28
+
29
+ <Button onClick={addModal}>Add Modal</Button>
30
+
31
+ </div>
32
+ }
33
+ })
34
+ }
35
+ return<ButtonGroup title={"Modal"}>
36
+ <Button onClick={openModal}>Open Modal</Button>
37
+ </ButtonGroup>
38
+ }
@@ -2,6 +2,7 @@ import SwitchDemo from "@/pages/UI/components/Switch";
2
2
  import AlphaAvatarDemo from "@/pages/UI/components/AlphaAvatar";
3
3
  import RadioDemo from "@/pages/UI/components/Radio";
4
4
  import TabsDemo from "@/pages/UI/components/Tabs";
5
+ import ModalDemo from "@/pages/UI/components/Modal";
5
6
 
6
7
  export default function UI(){
7
8
  return <div>
@@ -9,5 +10,6 @@ export default function UI(){
9
10
  <AlphaAvatarDemo/>
10
11
  <RadioDemo/>
11
12
  <TabsDemo/>
13
+ <ModalDemo/>
12
14
  </div>
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matchain/matchid-sdk-react",
3
- "version": "0.1.56-alpha.2",
3
+ "version": "0.1.56-alpha.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {