@arcblock/did-connect-react 3.1.40 → 3.1.42

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.
Files changed (81) hide show
  1. package/.aigne/doc-smith/config.yaml +83 -0
  2. package/.aigne/doc-smith/output/structure-plan.json +197 -0
  3. package/.aigne/doc-smith/upload-cache.yaml +168 -0
  4. package/docs/_sidebar.md +18 -0
  5. package/docs/advanced-authentication-methods.ja.md +261 -0
  6. package/docs/advanced-authentication-methods.md +261 -0
  7. package/docs/advanced-authentication-methods.zh-TW.md +261 -0
  8. package/docs/advanced-authentication-methods.zh.md +261 -0
  9. package/docs/advanced-utilities.ja.md +132 -0
  10. package/docs/advanced-utilities.md +132 -0
  11. package/docs/advanced-utilities.zh-TW.md +132 -0
  12. package/docs/advanced-utilities.zh.md +132 -0
  13. package/docs/advanced.ja.md +95 -0
  14. package/docs/advanced.md +95 -0
  15. package/docs/advanced.zh-TW.md +95 -0
  16. package/docs/advanced.zh.md +95 -0
  17. package/docs/api-reference.ja.md +178 -0
  18. package/docs/api-reference.md +178 -0
  19. package/docs/api-reference.zh-TW.md +178 -0
  20. package/docs/api-reference.zh.md +178 -0
  21. package/docs/core-components-did-connect.ja.md +214 -0
  22. package/docs/core-components-did-connect.md +213 -0
  23. package/docs/core-components-did-connect.zh-TW.md +214 -0
  24. package/docs/core-components-did-connect.zh.md +213 -0
  25. package/docs/core-components-session-provider.ja.md +239 -0
  26. package/docs/core-components-session-provider.md +239 -0
  27. package/docs/core-components-session-provider.zh-TW.md +239 -0
  28. package/docs/core-components-session-provider.zh.md +239 -0
  29. package/docs/core-components.ja.md +16 -0
  30. package/docs/core-components.md +16 -0
  31. package/docs/core-components.zh-TW.md +16 -0
  32. package/docs/core-components.zh.md +16 -0
  33. package/docs/getting-started.ja.md +138 -0
  34. package/docs/getting-started.md +138 -0
  35. package/docs/getting-started.zh-TW.md +138 -0
  36. package/docs/getting-started.zh.md +138 -0
  37. package/docs/hooks-use-connect.ja.md +214 -0
  38. package/docs/hooks-use-connect.md +214 -0
  39. package/docs/hooks-use-connect.zh-TW.md +214 -0
  40. package/docs/hooks-use-connect.zh.md +214 -0
  41. package/docs/hooks-use-did.ja.md +107 -0
  42. package/docs/hooks-use-did.md +107 -0
  43. package/docs/hooks-use-did.zh-TW.md +107 -0
  44. package/docs/hooks-use-did.zh.md +107 -0
  45. package/docs/hooks-use-oauth-passkey.ja.md +188 -0
  46. package/docs/hooks-use-oauth-passkey.md +188 -0
  47. package/docs/hooks-use-oauth-passkey.zh-TW.md +188 -0
  48. package/docs/hooks-use-oauth-passkey.zh.md +188 -0
  49. package/docs/hooks.ja.md +23 -0
  50. package/docs/hooks.md +23 -0
  51. package/docs/hooks.zh-TW.md +23 -0
  52. package/docs/hooks.zh.md +23 -0
  53. package/docs/overview.ja.md +159 -0
  54. package/docs/overview.md +159 -0
  55. package/docs/overview.zh-TW.md +159 -0
  56. package/docs/overview.zh.md +160 -0
  57. package/docs/ui-components-address.ja.md +121 -0
  58. package/docs/ui-components-address.md +121 -0
  59. package/docs/ui-components-address.zh-TW.md +121 -0
  60. package/docs/ui-components-address.zh.md +121 -0
  61. package/docs/ui-components-avatar.ja.md +65 -0
  62. package/docs/ui-components-avatar.md +65 -0
  63. package/docs/ui-components-avatar.zh-TW.md +65 -0
  64. package/docs/ui-components-avatar.zh.md +65 -0
  65. package/docs/ui-components-button.ja.md +99 -0
  66. package/docs/ui-components-button.md +99 -0
  67. package/docs/ui-components-button.zh-TW.md +99 -0
  68. package/docs/ui-components-button.zh.md +99 -0
  69. package/docs/ui-components-logo.ja.md +52 -0
  70. package/docs/ui-components-logo.md +52 -0
  71. package/docs/ui-components-logo.zh-TW.md +52 -0
  72. package/docs/ui-components-logo.zh.md +52 -0
  73. package/docs/ui-components.ja.md +57 -0
  74. package/docs/ui-components.md +57 -0
  75. package/docs/ui-components.zh-TW.md +57 -0
  76. package/docs/ui-components.zh.md +57 -0
  77. package/glossary.md +1 -0
  78. package/lib/package.json.js +1 -1
  79. package/package.json +5 -5
  80. package/src/Session/hooks/use-federated.js +3 -0
  81. package/src/Session/libs/federated.js +3 -0
@@ -0,0 +1,99 @@
1
+ # 按鈕
2
+
3
+ `ConnectButton` 元件提供了一個預設樣式且易於識別的按鈕,用於啟動 DID Connect 身份驗證過程。它簡化了為您的應用程式登入流程建立一致使用者體驗的過程。該按鈕採用 DID Connect 官方品牌設計,包括標誌和配色方案,為使用者提供了清晰的行動號召。
4
+
5
+ ## 匯入
6
+
7
+ 若要使用此按鈕,請從函式庫的 `Button` 模組中匯入。
8
+
9
+ ```javascript icon=logos:javascript
10
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
11
+ ```
12
+
13
+ ## 基本用法
14
+
15
+ 最常見的使用案例是將 `ConnectButton` 與 `useConnect` hook 搭配使用。按鈕的 `onClick` 屬性可以直接對應到 hook 回傳的 `open` 函式,以觸發連線對話框。
16
+
17
+ ```javascript Basic Usage icon=logos:react
18
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
19
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
20
+
21
+ export default function MyLoginComponent() {
22
+ const { open } = useConnect();
23
+
24
+ return (
25
+ <ConnectButton onClick={open} />
26
+ );
27
+ }
28
+ ```
29
+
30
+ 預設情況下,按鈕會顯示文字「Continue With」,後面跟著 DID Connect 標誌。
31
+
32
+ ## 自訂
33
+
34
+ 您可以輕鬆自訂按鈕的外觀和行為。
35
+
36
+ ### 自訂文字
37
+
38
+ 若要變更預設文字,只需將您想要的內容作為 children 傳遞給元件即可。
39
+
40
+ ```javascript Customizing Button Text icon=logos:react
41
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
42
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
43
+
44
+ export default function CustomLoginComponent() {
45
+ const { open } = useConnect();
46
+
47
+ return (
48
+ <ConnectButton onClick={open}>
49
+ 使用 DID 錢包登入
50
+ </ConnectButton>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ### 額外屬性
56
+
57
+ `ConnectButton` 是 `@arcblock/ux/lib/Button` 元件(基於 Material-UI 的 Button)的封裝,並接受其所有標準屬性。這允許進行廣泛的自訂,例如禁用按鈕、使其全寬,或使用 `sx` 屬性應用自訂樣式。
58
+
59
+ ```javascript Passing Additional Props icon=logos:react
60
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
61
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
62
+
63
+ export default function DisabledButtonComponent() {
64
+ const { open } = useConnect();
65
+
66
+ // 範例:在某個程序執行時禁用按鈕
67
+ const isLoading = true;
68
+
69
+ return (
70
+ <ConnectButton
71
+ onClick={open}
72
+ disabled={isLoading}
73
+ fullWidth
74
+ sx={{ mt: 2, mb: 2 }}
75
+ >
76
+ {isLoading ? '連線中...' : '使用 DID 錢包登入'}
77
+ </ConnectButton>
78
+ );
79
+ }
80
+ ```
81
+
82
+ ## 屬性
83
+
84
+ <x-field-group>
85
+ <x-field data-name="children" data-type="React.ReactNode" data-required="false">
86
+ <x-field-desc markdown>要顯示在按鈕內的內容。如果未提供,預設為 `"Continue With"`。</x-field-desc>
87
+ </x-field>
88
+ <x-field data-name="...rest" data-type="ButtonProps" data-required="false">
89
+ <x-field-desc markdown>`ConnectButton` 接受任何其他對底層 Material-UI `Button` 元件有效的屬性。這包括 `onClick`、`disabled`、`variant`、`color`、`fullWidth` 和 `sx` 等常見屬性。</x-field-desc>
90
+ </x-field>
91
+ </x-field-group>
92
+
93
+ ## 後續步驟
94
+
95
+ 現在您已經知道如何新增 `ConnectButton`,下一步理所當然是了解為其功能提供支援的 hook。
96
+
97
+ <x-card data-title="useConnect Hook" data-href="/hooks/use-connect" data-icon="lucide:hook">
98
+ 了解如何使用 useConnect hook 以程式化方式開啟、關閉和管理 DidConnect UI 對話框。
99
+ </x-card>
@@ -0,0 +1,99 @@
1
+ # 按钮
2
+
3
+ `ConnectButton` 组件提供了一个预设样式且易于识别的按钮,用于启动 DID Connect 身份验证过程。它简化了为你的应用程序登录流程创建一致用户体验的过程。该按钮采用官方 DID Connect 品牌风格,包括徽标和配色方案,为用户提供了清晰的操作指引。
4
+
5
+ ## 导入
6
+
7
+ 要使用该按钮,请从库的 `Button` 模块中导入它。
8
+
9
+ ```javascript icon=logos:javascript
10
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
11
+ ```
12
+
13
+ ## 基本用法
14
+
15
+ 最常见的用例是将 `ConnectButton` 与 `useConnect` 钩子配对使用。按钮的 `onClick` 属性可以直接映射到钩子返回的 `open` 函数,以触发连接模态框。
16
+
17
+ ```javascript Basic Usage icon=logos:react
18
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
19
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
20
+
21
+ export default function MyLoginComponent() {
22
+ const { open } = useConnect();
23
+
24
+ return (
25
+ <ConnectButton onClick={open} />
26
+ );
27
+ }
28
+ ```
29
+
30
+ 默认情况下,按钮会渲染文本“Continue With”,后面跟着 DID Connect 徽标。
31
+
32
+ ## 自定义
33
+
34
+ 你可以轻松自定义按钮的外观和行为。
35
+
36
+ ### 自定义文本
37
+
38
+ 要更改默认文本,只需将你想要的内容作为子元素传递给组件即可。
39
+
40
+ ```javascript Customizing Button Text icon=logos:react
41
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
42
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
43
+
44
+ export default function CustomLoginComponent() {
45
+ const { open } = useConnect();
46
+
47
+ return (
48
+ <ConnectButton onClick={open}>
49
+ Login with DID Wallet
50
+ </ConnectButton>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ### 额外属性
56
+
57
+ `ConnectButton` 是对 `@arcblock/ux/lib/Button` 组件(该组件基于 Material-UI 的 Button)的封装,并接受其所有标准属性。这允许进行广泛的自定义,例如禁用按钮、使其全宽或使用 `sx` 属性应用自定义样式。
58
+
59
+ ```javascript Passing Additional Props icon=logos:react
60
+ import { useConnect } from '@arcblock/did-connect-react/lib/Connect/use-connect';
61
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
62
+
63
+ export default function DisabledButtonComponent() {
64
+ const { open } = useConnect();
65
+
66
+ // Example: disable the button while a process is running
67
+ const isLoading = true;
68
+
69
+ return (
70
+ <ConnectButton
71
+ onClick={open}
72
+ disabled={isLoading}
73
+ fullWidth
74
+ sx={{ mt: 2, mb: 2 }}
75
+ >
76
+ {isLoading ? 'Connecting...' : 'Login with DID Wallet'}
77
+ </ConnectButton>
78
+ );
79
+ }
80
+ ```
81
+
82
+ ## 属性
83
+
84
+ <x-field-group>
85
+ <x-field data-name="children" data-type="React.ReactNode" data-required="false">
86
+ <x-field-desc markdown>要在按钮内部显示的内容。如果未提供,则默认为 `"Continue With"`。</x-field-desc>
87
+ </x-field>
88
+ <x-field data-name="...rest" data-type="ButtonProps" data-required="false">
89
+ <x-field-desc markdown>`ConnectButton` 接受任何对底层 Material-UI `Button` 组件有效的其他属性。这包括 `onClick`、`disabled`、`variant`、`color`、`fullWidth` 和 `sx` 等常见属性。</x-field-desc>
90
+ </x-field>
91
+ </x-field-group>
92
+
93
+ ## 下一步
94
+
95
+ 既然你已经知道如何添加 `ConnectButton`,下一个合乎逻辑的步骤是了解为其功能提供支持的钩子。
96
+
97
+ <x-card data-title="useConnect 钩子" data-href="/hooks/use-connect" data-icon="lucide:hook">
98
+ 学习如何使用 useConnect 钩子以编程方式打开、关闭和管理 DidConnect UI 模态框。
99
+ </x-card>
@@ -0,0 +1,52 @@
1
+ # ロゴ
2
+
3
+ `Logo`コンポーネントは、アプリケーション内に公式のDID Connectロゴをシンプルかつ一貫して表示する方法を提供します。これはブランド表現のために設計された単純なビジュアルコンポーネントであり、ユーザーがおなじみの分散型ID接続方法を認識できるようにします。
4
+
5
+ ## 使用方法
6
+
7
+ コンポーネントを使用するには、インポートしてJSXに含めるだけです。`size`プロップを使用してサイズを制御できます。
8
+
9
+ ```jsx MyHeader.js icon=logos:react
10
+ import React from 'react';
11
+ import Logo from '@arcblock/did-connect-react/lib/Logo';
12
+
13
+ export default function AppHeader() {
14
+ return (
15
+ <header style={{ display: 'flex', alignItems: 'center', padding: '16px', borderBottom: '1px solid #eee' }}>
16
+ <Logo size={40} />
17
+ <h1 style={{ marginLeft: '12px', fontSize: '24px' }}>My Application</h1>
18
+ </header>
19
+ );
20
+ }
21
+ ```
22
+
23
+ ## プロップ
24
+
25
+ `Logo`コンポーネントはSVG要素のラッパーであり、以下のプロップを受け付けます:
26
+
27
+ <x-field-group>
28
+ <x-field data-name="size" data-type="number" data-default="24" data-desc="ロゴの幅と高さをピクセル単位で設定します。"></x-field>
29
+ <x-field data-name="...rest" data-type="any" data-desc="その他のプロップは、基になるSVG要素に直接渡され、`className`や`style`などの属性でカスタマイズできます。"></x-field>
30
+ </x-field-group>
31
+
32
+ ## 使用する場面
33
+
34
+ - アプリケーションのヘッダーまたはフッターに表示して、DID Connectを利用していることを示します。
35
+ - ログイン画面や接続画面で、ブランドの一貫性を保つために`Button`の近くや`DidConnect`モーダル内に配置します。
36
+ - 利用可能な認証方法を説明する情報ページや「About」ページに表示します。
37
+
38
+ ## 次のステップ
39
+
40
+ `Logo`を追加した後、他のUIコンポーネントを調べてユーザーインターフェースを完成させてください:
41
+
42
+ <x-cards>
43
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
44
+ 事前にスタイル設定されたButtonコンポーネントを使用して、DID Connectフローをトリガーします。
45
+ </x-card>
46
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle">
47
+ ユーザーが正常にログインした後、そのプロフィール写真を表示します。
48
+ </x-card>
49
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:fingerprint">
50
+ ユーザーの分散型識別子(DID)を整形された読みやすい方法で表示します。
51
+ </x-card>
52
+ </x-cards>
@@ -0,0 +1,52 @@
1
+ # Logo
2
+
3
+ The `Logo` component provides a simple and consistent way to display the official DID Connect logo within your application. It's a straightforward visual component designed for brand representation, ensuring your users recognize the familiar decentralized identity connection method.
4
+
5
+ ## Usage
6
+
7
+ To use the component, simply import it and include it in your JSX. You can control its size using the `size` prop.
8
+
9
+ ```jsx MyHeader.js icon=logos:react
10
+ import React from 'react';
11
+ import Logo from '@arcblock/did-connect-react/lib/Logo';
12
+
13
+ export default function AppHeader() {
14
+ return (
15
+ <header style={{ display: 'flex', alignItems: 'center', padding: '16px', borderBottom: '1px solid #eee' }}>
16
+ <Logo size={40} />
17
+ <h1 style={{ marginLeft: '12px', fontSize: '24px' }}>My Application</h1>
18
+ </header>
19
+ );
20
+ }
21
+ ```
22
+
23
+ ## Props
24
+
25
+ The `Logo` component is a wrapper around an SVG element and accepts the following props:
26
+
27
+ <x-field-group>
28
+ <x-field data-name="size" data-type="number" data-default="24" data-desc="Sets both the width and height of the logo in pixels."></x-field>
29
+ <x-field data-name="...rest" data-type="any" data-desc="Any other props are passed directly to the underlying SVG element, allowing for customization with attributes like `className` or `style`."></x-field>
30
+ </x-field-group>
31
+
32
+ ## When to Use
33
+
34
+ - In the header or footer of your application to show that it's powered by DID Connect.
35
+ - On login or connection screens, often placed near the `Button` or within the `DidConnect` modal for brand consistency.
36
+ - On informational or "About" pages that describe the authentication methods available.
37
+
38
+ ## Next Steps
39
+
40
+ After adding the `Logo`, explore other UI components to complete your user interface:
41
+
42
+ <x-cards>
43
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
44
+ Use the pre-styled Button component to trigger the DID Connect flow.
45
+ </x-card>
46
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle">
47
+ Display a user's profile picture after they have successfully logged in.
48
+ </x-card>
49
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:fingerprint">
50
+ Show the user's decentralized identifier (DID) in a formatted and readable way.
51
+ </x-card>
52
+ </x-cards>
@@ -0,0 +1,52 @@
1
+ # Logo
2
+
3
+ `Logo` 組件提供了一種簡單且一致的方式,在您的應用程式中顯示官方的 DID Connect 標誌。它是一個專為品牌形象設計的直觀視覺組件,確保您的用戶能識別出這種熟悉的去中心化身份連接方式。
4
+
5
+ ## 使用方式
6
+
7
+ 若要使用此組件,只需匯入並將其包含在您的 JSX 中。您可以使用 `size` prop 控制其大小。
8
+
9
+ ```jsx MyHeader.js icon=logos:react
10
+ import React from 'react';
11
+ import Logo from '@arcblock/did-connect-react/lib/Logo';
12
+
13
+ export default function AppHeader() {
14
+ return (
15
+ <header style={{ display: 'flex', alignItems: 'center', padding: '16px', borderBottom: '1px solid #eee' }}>
16
+ <Logo size={40} />
17
+ <h1 style={{ marginLeft: '12px', fontSize: '24px' }}>My Application</h1>
18
+ </header>
19
+ );
20
+ }
21
+ ```
22
+
23
+ ## 屬性
24
+
25
+ `Logo` 組件是 SVG 元素的封裝,可接受以下屬性:
26
+
27
+ <x-field-group>
28
+ <x-field data-name="size" data-type="number" data-default="24" data-desc="設定標誌的寬度和高度(以像素為單位)。"></x-field>
29
+ <x-field data-name="...rest" data-type="any" data-desc="任何其他屬性都會直接傳遞給底層的 SVG 元素,允許使用 `className` 或 `style` 等屬性進行自訂。"></x-field>
30
+ </x-field-group>
31
+
32
+ ## 何時使用
33
+
34
+ - 在您的應用程式的頁首或頁尾,用以顯示其由 DID Connect 提供支援。
35
+ - 在登入或連接畫面上,通常放置在 `Button` 附近或 `DidConnect` 彈出視窗內,以保持品牌一致性。
36
+ - 在描述可用身份驗證方法的資訊頁或「關於」頁面。
37
+
38
+ ## 後續步驟
39
+
40
+ 新增 `Logo` 後,您可以探索其他 UI 組件來完善您的使用者介面:
41
+
42
+ <x-cards>
43
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
44
+ 使用預先設定樣式的按鈕組件來觸發 DID Connect 流程。
45
+ </x-card>
46
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle">
47
+ 在使用者成功登入後,顯示其個人資料圖片。
48
+ </x-card>
49
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:fingerprint">
50
+ 以格式化且易於閱讀的方式顯示使用者的去中心化識別碼 (DID)。
51
+ </x-card>
52
+ </x-cards>
@@ -0,0 +1,52 @@
1
+ # Logo
2
+
3
+ `Logo` 组件提供了一种简单且一致的方式,在您的应用程序中显示官方的 DID Connect 徽标。它是一个专为品牌展示而设计的直观视觉组件,确保您的用户能够识别这种熟悉的去中心化身份连接方式。
4
+
5
+ ## 用法
6
+
7
+ 要使用该组件,只需导入它并将其包含在您的 JSX 中。您可以使用 `size` 属性来控制其大小。
8
+
9
+ ```jsx MyHeader.js icon=logos:react
10
+ import React from 'react';
11
+ import Logo from '@arcblock/did-connect-react/lib/Logo';
12
+
13
+ export default function AppHeader() {
14
+ return (
15
+ <header style={{ display: 'flex', alignItems: 'center', padding: '16px', borderBottom: '1px solid #eee' }}>
16
+ <Logo size={40} />
17
+ <h1 style={{ marginLeft: '12px', fontSize: '24px' }}>我的应用</h1>
18
+ </header>
19
+ );
20
+ }
21
+ ```
22
+
23
+ ## 属性
24
+
25
+ `Logo` 组件是 SVG 元素的包装器,接受以下属性:
26
+
27
+ <x-field-group>
28
+ <x-field data-name="size" data-type="number" data-default="24" data-desc="设置徽标的宽度和高度,单位为像素。"></x-field>
29
+ <x-field data-name="...rest" data-type="any" data-desc="任何其他属性都会直接传递给底层的 SVG 元素,从而允许使用 `className` 或 `style` 等属性进行自定义。"></x-field>
30
+ </x-field-group>
31
+
32
+ ## 何时使用
33
+
34
+ - 在应用程序的页眉或页脚中,以表明它由 DID Connect 提供支持。
35
+ - 在登录或连接屏幕上,通常放置在 `Button` 附近或 `DidConnect` 模态框内,以保持品牌一致性。
36
+ - 在描述可用身份验证方法的信息性或“关于”页面上。
37
+
38
+ ## 后续步骤
39
+
40
+ 添加 `Logo` 后,探索其他 UI 组件以完善您的用户界面:
41
+
42
+ <x-cards>
43
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
44
+ 使用预设样式的 Button 组件来触发 DID Connect 流程。
45
+ </x-card>
46
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle">
47
+ 在用户成功登录后,显示其个人资料图片。
48
+ </x-card>
49
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:fingerprint">
50
+ 以格式化且易于阅读的方式显示用户的去中心化标识符(DID)。
51
+ </x-card>
52
+ </x-cards>
@@ -0,0 +1,57 @@
1
+ # UIコンポーネント
2
+
3
+ `@arcblock/did-connect-react`ライブラリには、DID関連情報を一貫性があり、美しく表示するのに役立つように設計された、事前にスタイル設定された補助的なUIコンポーネントのセットが含まれています。これらのコンポーネントは、コア接続フローとシームレスに連携し、堅牢な`@arcblock/ux`および`@mui/material`ライブラリ上に構築されており、アプリケーションにまとまりのあるルックアンドフィールを保証します。
4
+
5
+ このセクションでは、これらのコンポーネントの概要を説明します。いずれかのカードをクリックすると、プロパティや使用例を含む詳細なドキュメントが表示されます。
6
+
7
+ <x-cards data-columns="2">
8
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle-2">
9
+ ユーザーのアバターを表示するために設計されたコンポーネントで、DIDから自動的に派生します。
10
+ </x-card>
11
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:key-round">
12
+ ユーザーのDIDアドレスを、読みやすさを向上させるためにフォーマットされ、オプションで短縮された形式で表示するために使用されます。
13
+ </x-card>
14
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
15
+ 一貫したデザインでDID Connectフローを開始するための、事前にスタイル設定されたボタン、具体的には`ConnectButton`。
16
+ </x-card>
17
+ <x-card data-title="Logo" data-href="/ui-components/logo" data-icon="lucide:hexagon">
18
+ 公式のDID Connectロゴを表示するためのシンプルなコンポーネントで、ブランディングとUIの一貫性に役立ちます。
19
+ </x-card>
20
+ </x-cards>
21
+
22
+ ## 組み合わせた使用例
23
+
24
+ これらのコンポーネントは、ユーザーインターフェースを構築するために組み合わせて使用できるように設計されています。`Avatar`、`Address`、`ConnectButton`を使用して簡単なユーザープロフィール表示を作成する方法の例を次に示します。
25
+
26
+ ```javascript Combined UI Example icon=logos:react
27
+ import Avatar from '@arcblock/did-connect-react/lib/Avatar';
28
+ import Address from '@arcblock/did-connect-react/lib/Address';
29
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
30
+ import { Box, Typography, Paper } from '@mui/material';
31
+
32
+ function UserDisplay({ userDid, userName }) {
33
+ if (!userDid) {
34
+ return <ConnectButton />;
35
+ }
36
+
37
+ return (
38
+ <Paper elevation={2} sx={{ padding: '16px', display: 'flex', alignItems: 'center', gap: '16px' }}>
39
+ <Avatar size={60} did={userDid} />
40
+ <Box>
41
+ <Typography variant="h6" component="div">{userName || 'Anonymous'}</Typography>
42
+ <Address variant="body2" color="text.secondary">{userDid}</Address>
43
+ </Box>
44
+ </Paper>
45
+ );
46
+ }
47
+
48
+ // 使用例:
49
+ // <UserDisplay userDid="z123..." userName="Alice" />
50
+ // <UserDisplay userDid={null} />
51
+ ```
52
+
53
+ この例は、提供されているコンポーネントを使用して、ログイン状態とログアウト状態の一般的なUIパターンをいかに簡単に構築できるかを示しています。
54
+
55
+ ### 次のステップ
56
+
57
+ UIコンポーネントに慣れたら、認証フローとセッションデータをよりプログラム的に制御するために、ライブラリの[Hooks](./hooks.md)を調べてみるとよいでしょう。
@@ -0,0 +1,57 @@
1
+ # UI Components
2
+
3
+ The `@arcblock/did-connect-react` library includes a set of pre-styled, supplementary UI components designed to help you display DID-related information consistently and beautifully. These components work seamlessly with the core connection flow and are built upon the robust `@arcblock/ux` and `@mui/material` libraries, ensuring a cohesive look and feel in your application.
4
+
5
+ This section provides an overview of these components. Click on any card to view detailed documentation, including properties and usage examples.
6
+
7
+ <x-cards data-columns="2">
8
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle-2">
9
+ A component designed to display a user's avatar, which is automatically derived from their DID.
10
+ </x-card>
11
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:key-round">
12
+ Used for displaying a user's DID address in a formatted and optionally shortened manner for better readability.
13
+ </x-card>
14
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
15
+ A pre-styled button, specifically the `ConnectButton`, for initiating the DID Connect flow with a consistent design.
16
+ </x-card>
17
+ <x-card data-title="Logo" data-href="/ui-components/logo" data-icon="lucide:hexagon">
18
+ A simple component to display the official DID Connect logo, useful for branding and UI consistency.
19
+ </x-card>
20
+ </x-cards>
21
+
22
+ ## Combined Usage Example
23
+
24
+ These components are designed to be composed together to build user interfaces. Here is an example of how you might use `Avatar`, `Address`, and `ConnectButton` to create a simple user profile display.
25
+
26
+ ```javascript Combined UI Example icon=logos:react
27
+ import Avatar from '@arcblock/did-connect-react/lib/Avatar';
28
+ import Address from '@arcblock/did-connect-react/lib/Address';
29
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
30
+ import { Box, Typography, Paper } from '@mui/material';
31
+
32
+ function UserDisplay({ userDid, userName }) {
33
+ if (!userDid) {
34
+ return <ConnectButton />;
35
+ }
36
+
37
+ return (
38
+ <Paper elevation={2} sx={{ padding: '16px', display: 'flex', alignItems: 'center', gap: '16px' }}>
39
+ <Avatar size={60} did={userDid} />
40
+ <Box>
41
+ <Typography variant="h6" component="div">{userName || 'Anonymous'}</Typography>
42
+ <Address variant="body2" color="text.secondary">{userDid}</Address>
43
+ </Box>
44
+ </Paper>
45
+ );
46
+ }
47
+
48
+ // Example usage:
49
+ // <UserDisplay userDid="z123..." userName="Alice" />
50
+ // <UserDisplay userDid={null} />
51
+ ```
52
+
53
+ This example demonstrates how easily you can construct a common UI pattern for logged-in and logged-out states using the provided components.
54
+
55
+ ### Next Steps
56
+
57
+ After familiarizing yourself with the UI components, you may want to explore the library's [Hooks](./hooks.md) for more programmatic control over the authentication flow and session data.
@@ -0,0 +1,57 @@
1
+ # UI 元件
2
+
3
+ `@arcblock/did-connect-react` 函式庫包含一組預先設計樣式的輔助 UI 元件,旨在幫助您以一致且美觀的方式顯示 DID 相關資訊。這些元件與核心連接流程無縫協作,並建立在強大的 `@arcblock/ux` 和 `@mui/material` 函式庫之上,確保您的應用程式具有一致的外觀和風格。
4
+
5
+ 本節提供這些元件的概述。點擊任何卡片以查看詳細文件,包括屬性和使用範例。
6
+
7
+ <x-cards data-columns="2">
8
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle-2">
9
+ 一個用於顯示使用者頭像的元件,頭像會根據其 DID 自動產生。
10
+ </x-card>
11
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:key-round">
12
+ 用於以格式化且可選縮短的方式顯示使用者的 DID 位址,以提高可讀性。
13
+ </x-card>
14
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
15
+ 一個預先設計樣式的按鈕,特別是 `ConnectButton`,用於以一致的設計啟動 DID Connect 流程。
16
+ </x-card>
17
+ <x-card data-title="Logo" data-href="/ui-components/logo" data-icon="lucide:hexagon">
18
+ 一個用於顯示官方 DID Connect 標誌的簡單元件,有助於品牌推廣和 UI 一致性。
19
+ </x-card>
20
+ </x-cards>
21
+
22
+ ## 組合使用範例
23
+
24
+ 這些元件設計用於組合在一起以建構使用者介面。以下是如何使用 `Avatar`、`Address` 和 `ConnectButton` 建立簡單使用者個人資料顯示的範例。
25
+
26
+ ```javascript 組合 UI 範例 icon=logos:react
27
+ import Avatar from '@arcblock/did-connect-react/lib/Avatar';
28
+ import Address from '@arcblock/did-connect-react/lib/Address';
29
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
30
+ import { Box, Typography, Paper } from '@mui/material';
31
+
32
+ function UserDisplay({ userDid, userName }) {
33
+ if (!userDid) {
34
+ return <ConnectButton />;
35
+ }
36
+
37
+ return (
38
+ <Paper elevation={2} sx={{ padding: '16px', display: 'flex', alignItems: 'center', gap: '16px' }}>
39
+ <Avatar size={60} did={userDid} />
40
+ <Box>
41
+ <Typography variant="h6" component="div">{userName || 'Anonymous'}</Typography>
42
+ <Address variant="body2" color="text.secondary">{userDid}</Address>
43
+ </Box>
44
+ </Paper>
45
+ );
46
+ }
47
+
48
+ // Example usage:
49
+ // <UserDisplay userDid="z123..." userName="Alice" />
50
+ // <UserDisplay userDid={null} />
51
+ ```
52
+
53
+ 此範例展示了如何使用提供的元件輕鬆建構登入和登出狀態的常見 UI 模式。
54
+
55
+ ### 後續步驟
56
+
57
+ 熟悉 UI 元件後,您可能想探索該函式庫的 [Hooks](./hooks.md),以對身份驗證流程和會話資料進行更多程式化控制。
@@ -0,0 +1,57 @@
1
+ # UI 组件
2
+
3
+ `@arcblock/did-connect-react` 库包含一组预设样式、辅助性的 UI 组件,旨在帮助你以一致且美观的方式显示 DID 相关信息。这些组件与核心连接流程无缝协作,并基于强大的 `@arcblock/ux` 和 `@mui/material` 库构建,确保在你的应用程序中拥有一致的外观和感觉。
4
+
5
+ 本节提供了这些组件的概述。点击任一卡片即可查看详细文档,包括属性和使用示例。
6
+
7
+ <x-cards data-columns="2">
8
+ <x-card data-title="Avatar" data-href="/ui-components/avatar" data-icon="lucide:user-circle-2">
9
+ 一个旨在显示用户头像的组件,该头像根据用户的 DID 自动派生。
10
+ </x-card>
11
+ <x-card data-title="Address" data-href="/ui-components/address" data-icon="lucide:key-round">
12
+ 用于以格式化且可选缩短的方式显示用户的 DID 地址,以提高可读性。
13
+ </x-card>
14
+ <x-card data-title="Button" data-href="/ui-components/button" data-icon="lucide:mouse-pointer-click">
15
+ 一个预设样式的按钮,特别是 `ConnectButton`,用于以一致的设计启动 DID Connect 流程。
16
+ </x-card>
17
+ <x-card data-title="Logo" data-href="/ui-components/logo" data-icon="lucide:hexagon">
18
+ 一个用于显示官方 DID Connect 徽标的简单组件,有助于品牌推广和 UI 一致性。
19
+ </x-card>
20
+ </x-cards>
21
+
22
+ ## 组合使用示例
23
+
24
+ 这些组件旨在组合在一起以构建用户界面。以下是一个示例,说明如何使用 `Avatar`、`Address` 和 `ConnectButton` 创建一个简单的用户个人资料展示。
25
+
26
+ ```javascript Combined UI Example icon=logos:react
27
+ import Avatar from '@arcblock/did-connect-react/lib/Avatar';
28
+ import Address from '@arcblock/did-connect-react/lib/Address';
29
+ import ConnectButton from '@arcblock/did-connect-react/lib/Button';
30
+ import { Box, Typography, Paper } from '@mui/material';
31
+
32
+ function UserDisplay({ userDid, userName }) {
33
+ if (!userDid) {
34
+ return <ConnectButton />;
35
+ }
36
+
37
+ return (
38
+ <Paper elevation={2} sx={{ padding: '16px', display: 'flex', alignItems: 'center', gap: '16px' }}>
39
+ <Avatar size={60} did={userDid} />
40
+ <Box>
41
+ <Typography variant="h6" component="div">{userName || 'Anonymous'}</Typography>
42
+ <Address variant="body2" color="text.secondary">{userDid}</Address>
43
+ </Box>
44
+ </Paper>
45
+ );
46
+ }
47
+
48
+ // 用法示例:
49
+ // <UserDisplay userDid="z123..." userName="Alice" />
50
+ // <UserDisplay userDid={null} />
51
+ ```
52
+
53
+ 此示例演示了如何使用提供的组件轻松构建适用于登录和登出状态的通用 UI 模式。
54
+
55
+ ### 后续步骤
56
+
57
+ 熟悉 UI 组件后,你可能希望探索该库的 [Hooks](./hooks.md) 以便对身份验证流程和会话数据进行更多编程控制。
package/glossary.md ADDED
@@ -0,0 +1 @@
1
+ Federated: Means Federated Login Group, zh translation should be '统一登录站点群', don't translate to other words
@@ -1,4 +1,4 @@
1
- const o = "3.1.40", s = {
1
+ const o = "3.1.42", s = {
2
2
  version: o
3
3
  };
4
4
  export {