@mictonode/widget 0.3.15 → 0.3.17

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 (69) hide show
  1. package/.github/FUNDING.yml +3 -3
  2. package/.github/workflows/npm-publish.yml +34 -34
  3. package/.prettierrc.json +9 -9
  4. package/.vscode/extensions.json +3 -3
  5. package/LICENSE +674 -674
  6. package/README.md +41 -41
  7. package/dist/{main-3096050c.js → main-465ae991.js} +155 -150
  8. package/dist/ping-widget.js +2 -2
  9. package/dist/ping-widget.umd.cjs +17 -17
  10. package/dist/{query.lcd-1625d320.js → query.lcd-d9c6163c.js} +1 -1
  11. package/dist/{query.rpc.Query-45d48ded.js → query.rpc.Query-a479e6f9.js} +1 -1
  12. package/dist/{tx.rpc.msg-0e09f357.js → tx.rpc.msg-7444045d.js} +1 -1
  13. package/example/.vscode/extensions.json +3 -3
  14. package/example/README.md +7 -7
  15. package/example/index.html +12 -12
  16. package/example/package.json +19 -19
  17. package/example/pnpm-lock.yaml +465 -465
  18. package/example/public/cdn.html +19 -19
  19. package/example/src/App.vue +73 -73
  20. package/example/src/main.js +4 -4
  21. package/example/vite.config.js +7 -7
  22. package/index.html +12 -12
  23. package/lib/components/ConnectWallet/index.vue +262 -262
  24. package/lib/components/TokenConvert/index.vue +1033 -1033
  25. package/lib/components/TokenConvert/tokens.ts +36 -36
  26. package/lib/components/TxDialog/index.vue +13 -9
  27. package/lib/components/TxDialog/messages/Delegate.vue +174 -174
  28. package/lib/components/TxDialog/messages/Deposit.vue +96 -96
  29. package/lib/components/TxDialog/messages/Redelegate.vue +160 -160
  30. package/lib/components/TxDialog/messages/Send.vue +142 -142
  31. package/lib/components/TxDialog/messages/Transfer.vue +248 -248
  32. package/lib/components/TxDialog/messages/Unbond.vue +103 -103
  33. package/lib/components/TxDialog/messages/Vote.vue +62 -62
  34. package/lib/components/TxDialog/messages/Withdraw.vue +55 -55
  35. package/lib/components/TxDialog/messages/WithdrawCommission.vue +74 -74
  36. package/lib/components/TxDialog/wasm/ClearAdmin.vue +55 -55
  37. package/lib/components/TxDialog/wasm/ExecuteContract.vue +98 -98
  38. package/lib/components/TxDialog/wasm/InstantiateContract.vue +108 -108
  39. package/lib/components/TxDialog/wasm/MigrateContract.vue +76 -76
  40. package/lib/components/TxDialog/wasm/MigrateContract2.vue +76 -76
  41. package/lib/components/TxDialog/wasm/StoreCode.vue +100 -100
  42. package/lib/components/TxDialog/wasm/UpdateAdmin.vue +74 -74
  43. package/lib/main.css +132 -7
  44. package/lib/main.ts +23 -23
  45. package/lib/utils/TokenUnitConverter.ts +44 -44
  46. package/lib/utils/format.ts +16 -16
  47. package/lib/utils/http.ts +154 -154
  48. package/lib/utils/type.ts +56 -56
  49. package/lib/wallet/EthermintMessageAdapter.ts +135 -135
  50. package/lib/wallet/UniClient.ts +144 -144
  51. package/lib/wallet/Wallet.ts +142 -133
  52. package/lib/wallet/wallets/KeplerWallet.ts +141 -141
  53. package/lib/wallet/wallets/LeapWallet.ts +141 -141
  54. package/lib/wallet/wallets/LedgerWallet.ts +202 -202
  55. package/lib/wallet/wallets/MetamaskSnapWallet.ts +105 -105
  56. package/lib/wallet/wallets/MetamaskWallet.ts +173 -173
  57. package/lib/wallet/wallets/OKXWallet.ts +202 -202
  58. package/lib/wallet/wallets/UnisatWallet.ts +198 -198
  59. package/package.json +3 -3
  60. package/postcss.config.js +6 -6
  61. package/src/App.vue +225 -225
  62. package/src/main.ts +7 -4
  63. package/src/styles/design-system.css +150 -0
  64. package/src/vite-env.d.ts +1 -1
  65. package/tailwind.config.js +211 -34
  66. package/tsconfig.json +25 -25
  67. package/tsconfig.node.json +10 -10
  68. package/vite.config.ts +62 -62
  69. package/vue-shim.d.ts +6 -6
package/src/App.vue CHANGED
@@ -1,225 +1,225 @@
1
- <script setup lang="ts">
2
- import { onMounted, ref } from 'vue';
3
- import pingWidget from '../lib/main';
4
- import { ethToEthermint, ethermintToEth } from '../lib/utils/format';
5
-
6
- // const sender = 'evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z';
7
- // const endpoint = 'https://api-cosmoshub-ia.cosmosia.notional.ventures'// 'https://rest.stargaze-apis.com';
8
- // const endpoint = 'https://api.uni.junonetwork.io'
9
-
10
- interface Config {
11
- sender: string,
12
- endpoint: string;
13
- chainId: string;
14
- hdPath: string;
15
- chainName: string
16
- params: string
17
- }
18
-
19
- // @ts-ignore
20
- const EVMOS: Config = {
21
- sender: 'evmos1ayp22xk4nwc9lhjh6tvdat2j2klnvvk29yx87m',
22
- endpoint: 'https://rest.bd.evmos.org:1317',
23
- chainId: 'evmos_9001-2',
24
- hdPath: "m/44'/60/0'/0/0",
25
- chainName: 'evmos',
26
- params: JSON.stringify({
27
- proposal_id: '1',
28
- validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
29
- chain_name: 'evmos',
30
- contract: 'add',
31
- fees: { amount: '6000000000000000', denom: '', },
32
- })
33
- }
34
-
35
- // @ts-ignore
36
- const JUNO: Config = {
37
- sender: 'juno1m8mma95ta2zajqtmfp5c5y3wgeyqzcrcgcnv4a',
38
- endpoint: 'https://juno-api.polkachu.com',
39
- chainId: 'juno-1',
40
- hdPath: "m/44'/118/0'/0/0",
41
- chainName: 'juno',
42
- params: JSON.stringify({
43
- proposal_id: '1',
44
- validator_address: "junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2",
45
- chain_name: 'juno',
46
- contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
47
- fees: {amount: '2000', denom: ''}
48
- })
49
- }
50
-
51
- // @ts-ignore
52
- const NEUTRON: Config = {
53
- sender: 'neutron1m8mma95ta2zajqtmfp5c5y3wgeyqzcrc64e4gx',
54
- endpoint: 'https://neutron-api.polkachu.com',
55
- chainId: 'neutron-1',
56
- hdPath: "m/44'/118/0'/0/0",
57
- chainName: 'neutron',
58
- params: JSON.stringify({
59
- chain_name: 'neutron',
60
- contract: 'neutron198sxsrjvt2v2lln2ajn82ks76k97mj72mtgl7309jehd0vy8rezs7e6c56',
61
- fees: {amount: '2000', denom: ''}
62
- })
63
- }
64
-
65
- // @ts-ignore
66
- const COSMOS: Config = {
67
- sender: 'cosmos1jxv0u20scum4trha72c7ltfgfqef6nscj25050',
68
- endpoint: 'https://rest.cosmos.directory/cosmoshub',
69
- chainId: 'cosmoshub-4',
70
- hdPath: "m/44'/118/0'/0/0",
71
- chainName: 'cosmos',
72
- params: JSON.stringify({
73
- proposal_id: '1',
74
- validator_address: "cosmosvaloper1jxv0u20scum4trha72c7ltfgfqef6nsch7q6cu",
75
- chain_name: 'cosmos',
76
- contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
77
- fees: {amount: '6000', denom: ''}
78
- })
79
- }
80
-
81
- // @ts-ignore
82
- const Archway: Config = {
83
- sender: 'archway1jtdje5vq42sknl22r4wu9sahryu5wcrd3yd7z8',
84
- endpoint: 'https://api.constantine.archway.tech',
85
- chainId: 'constantine-3',
86
- hdPath: "m/44'/118/0'/0/0",
87
- chainName: 'archway',
88
- params: JSON.stringify({
89
- chain_name: 'archway',
90
- contract: 'archway1tc7k4683zqn8krm3vq7ed5jd4l23c2h9kyswc75zpc8aeln6smqsz79j44',
91
- fees: {amount: '2000', denom: ''}
92
- })
93
- }
94
-
95
- // @ts-ignore
96
- const btc: Config = {
97
- sender: 'bc1qjdyxk9t90jxmeqpdwkn8cd7nj6cu7x3m688xlj',
98
- endpoint: 'https://devnet-2-rest.side.one',
99
- chainId: 'taproot-1', // side-testnet-1
100
- hdPath: "m/44'/118/0'/0/0",
101
- chainName: 'S2-testnet-2',
102
- params: JSON.stringify({
103
- // wallet: ['okex', 'unisat']
104
- // proposal_id: '1',
105
- // validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
106
- // chain_name: 'evmos',
107
- // contract: 'add',
108
- // fees: {amount: '6000000000000000', denom: ''}
109
- })
110
- }
111
-
112
-
113
- const conf = ref(JUNO)
114
- // const conf = ref(btc)
115
-
116
- const types = [
117
- 'send',
118
- 'delegate',
119
- 'vote',
120
- 'redelegate',
121
- 'unbond',
122
- 'transfer',
123
- 'deposit',
124
- 'withdraw',
125
- 'withdraw_commission',
126
- 'wasm_instantiate_contract',
127
- 'wasm_execute_contract',
128
- 'wasm_store_code',
129
- 'wasm_migrate_contract',
130
- 'wasm_update_admin',
131
- 'wasm_clear_admin',
132
- ];
133
- const toOpen = ref('send');
134
-
135
- const theme = ref('light');
136
- const switchTheme = () => {
137
- if (theme.value === 'light') {
138
- theme.value = 'dark';
139
- document.documentElement.classList.add('dark');
140
- } else {
141
- theme.value = 'light';
142
- document.documentElement.classList.remove('dark');
143
- }
144
- document.documentElement.setAttribute('data-theme', theme.value);
145
- };
146
-
147
- onMounted(() => {
148
- document.documentElement.classList.add('light');
149
- document.documentElement.setAttribute('data-theme', 'light');
150
- });
151
- const walletStateChange = (res: any) => {
152
- console.log(res, 'resres');
153
- };
154
-
155
- console.log("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1")
156
- console.log(ethToEthermint("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1", "evmos"))
157
- console.log(ethermintToEth("evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z"))
158
-
159
- </script>
160
-
161
- <template>
162
- <div class="bg-gray-50 dark:bg-[#1c1f2e] dark:text-white min-h-[100vh]">
163
- Ping Widget Version: {{ pingWidget?.version }}
164
-
165
- <div class="btn dark:bg-[#1f67f5] dark:hover:bg-[#1c1f2e] btn-sm normal-case" @click="switchTheme()">
166
- Theme: {{ theme }}
167
- </div>
168
-
169
- <div>&nbsp;</div>
170
- <ping-connect-wallet
171
- :chain-id="conf.chainId"
172
- :hd-path="conf.hdPath"
173
- @change="walletStateChange"
174
- />
175
-
176
- <textarea v-model="conf.params" cols="80" rows="5"></textarea>
177
- <div></div>
178
-
179
- <select v-model="toOpen">
180
- <option v-for="i in types">{{ i }}</option>
181
- </select>
182
-
183
- <br />
184
-
185
- <label :for="toOpen" class="btn dark:bg-[#1f67f5] dark:hover:bg-[#1c1f2e] dark:text-white">{{ toOpen }}</label>
186
- <ping-tx-dialog
187
- :type="toOpen"
188
- :sender="conf.sender"
189
- :registry-name="conf.chainName"
190
- :endpoint="conf.endpoint"
191
- :hd-path="conf.hdPath"
192
- :params="conf.params"
193
- ></ping-tx-dialog>
194
-
195
- <br />
196
- // example:<br />
197
- <label for="withdraw" class="btn dark:bg-[#1f67f5] dark:hover:bg-[#1c1f2e] dark:text-white">Withdraw</label>
198
- <ping-tx-dialog
199
- type="withdraw"
200
- :sender="conf.sender"
201
- :endpoint="conf.endpoint"
202
- :hd-path="conf.hdPath"
203
- :params="conf.params"
204
- ></ping-tx-dialog>
205
-
206
- <label for="store_code" class="btn dark:bg-[#1f67f5] dark:hover:bg-[#1c1f2e] dark:text-white">Store Code</label>
207
- <ping-tx-dialog
208
- type="store_code"
209
- :sender="conf.sender"
210
- :endpoint="conf.endpoint"
211
- :registry-name="conf.chainName"
212
- :hd-path="conf.hdPath"
213
- :params="conf.params"
214
- ></ping-tx-dialog>
215
-
216
- <label for="PingTokenConvert" class="btn dark:bg-[#1f67f5] dark:hover:bg-[#1c1f2e] dark:text-white">Token Convert</label>
217
- <ping-token-convert
218
- :chain-name="conf.chainName"
219
- :endpoint="conf.endpoint"
220
- hd-path="m/44'/118/0'/0/0"
221
- ></ping-token-convert>
222
- </div>
223
- </template>
224
-
225
- <style scoped></style>
1
+ <script setup lang="ts">
2
+ import { onMounted, ref } from 'vue';
3
+ import pingWidget from '../lib/main';
4
+ import { ethToEthermint, ethermintToEth } from '../lib/utils/format';
5
+
6
+ // const sender = 'evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z';
7
+ // const endpoint = 'https://api-cosmoshub-ia.cosmosia.notional.ventures'// 'https://rest.stargaze-apis.com';
8
+ // const endpoint = 'https://api.uni.junonetwork.io'
9
+
10
+ interface Config {
11
+ sender: string,
12
+ endpoint: string;
13
+ chainId: string;
14
+ hdPath: string;
15
+ chainName: string
16
+ params: string
17
+ }
18
+
19
+ // @ts-ignore
20
+ const EVMOS: Config = {
21
+ sender: 'evmos1ayp22xk4nwc9lhjh6tvdat2j2klnvvk29yx87m',
22
+ endpoint: 'https://rest.bd.evmos.org:1317',
23
+ chainId: 'evmos_9001-2',
24
+ hdPath: "m/44'/60/0'/0/0",
25
+ chainName: 'evmos',
26
+ params: JSON.stringify({
27
+ proposal_id: '1',
28
+ validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
29
+ chain_name: 'evmos',
30
+ contract: 'add',
31
+ fees: { amount: '6000000000000000', denom: '', },
32
+ })
33
+ }
34
+
35
+ // @ts-ignore
36
+ const JUNO: Config = {
37
+ sender: 'juno1m8mma95ta2zajqtmfp5c5y3wgeyqzcrcgcnv4a',
38
+ endpoint: 'https://juno-api.polkachu.com',
39
+ chainId: 'juno-1',
40
+ hdPath: "m/44'/118/0'/0/0",
41
+ chainName: 'juno',
42
+ params: JSON.stringify({
43
+ proposal_id: '1',
44
+ validator_address: "junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2",
45
+ chain_name: 'juno',
46
+ contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
47
+ fees: {amount: '2000', denom: ''}
48
+ })
49
+ }
50
+
51
+ // @ts-ignore
52
+ const NEUTRON: Config = {
53
+ sender: 'neutron1m8mma95ta2zajqtmfp5c5y3wgeyqzcrc64e4gx',
54
+ endpoint: 'https://neutron-api.polkachu.com',
55
+ chainId: 'neutron-1',
56
+ hdPath: "m/44'/118/0'/0/0",
57
+ chainName: 'neutron',
58
+ params: JSON.stringify({
59
+ chain_name: 'neutron',
60
+ contract: 'neutron198sxsrjvt2v2lln2ajn82ks76k97mj72mtgl7309jehd0vy8rezs7e6c56',
61
+ fees: {amount: '2000', denom: ''}
62
+ })
63
+ }
64
+
65
+ // @ts-ignore
66
+ const COSMOS: Config = {
67
+ sender: 'cosmos1jxv0u20scum4trha72c7ltfgfqef6nscj25050',
68
+ endpoint: 'https://rest.cosmos.directory/cosmoshub',
69
+ chainId: 'cosmoshub-4',
70
+ hdPath: "m/44'/118/0'/0/0",
71
+ chainName: 'cosmos',
72
+ params: JSON.stringify({
73
+ proposal_id: '1',
74
+ validator_address: "cosmosvaloper1jxv0u20scum4trha72c7ltfgfqef6nsch7q6cu",
75
+ chain_name: 'cosmos',
76
+ contract: 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2',
77
+ fees: {amount: '6000', denom: ''}
78
+ })
79
+ }
80
+
81
+ // @ts-ignore
82
+ const Archway: Config = {
83
+ sender: 'archway1jtdje5vq42sknl22r4wu9sahryu5wcrd3yd7z8',
84
+ endpoint: 'https://api.constantine.archway.tech',
85
+ chainId: 'constantine-3',
86
+ hdPath: "m/44'/118/0'/0/0",
87
+ chainName: 'archway',
88
+ params: JSON.stringify({
89
+ chain_name: 'archway',
90
+ contract: 'archway1tc7k4683zqn8krm3vq7ed5jd4l23c2h9kyswc75zpc8aeln6smqsz79j44',
91
+ fees: {amount: '2000', denom: ''}
92
+ })
93
+ }
94
+
95
+ // @ts-ignore
96
+ const btc: Config = {
97
+ sender: 'bc1qjdyxk9t90jxmeqpdwkn8cd7nj6cu7x3m688xlj',
98
+ endpoint: 'https://devnet-2-rest.side.one',
99
+ chainId: 'taproot-1', // side-testnet-1
100
+ hdPath: "m/44'/118/0'/0/0",
101
+ chainName: 'S2-testnet-2',
102
+ params: JSON.stringify({
103
+ // wallet: ['okex', 'unisat']
104
+ // proposal_id: '1',
105
+ // validator_address: "evmosvaloper1tdss4m3x7jy9mlepm2dwy8820l7uv6m2vx6z88",
106
+ // chain_name: 'evmos',
107
+ // contract: 'add',
108
+ // fees: {amount: '6000000000000000', denom: ''}
109
+ })
110
+ }
111
+
112
+
113
+ const conf = ref(JUNO)
114
+ // const conf = ref(btc)
115
+
116
+ const types = [
117
+ 'send',
118
+ 'delegate',
119
+ 'vote',
120
+ 'redelegate',
121
+ 'unbond',
122
+ 'transfer',
123
+ 'deposit',
124
+ 'withdraw',
125
+ 'withdraw_commission',
126
+ 'wasm_instantiate_contract',
127
+ 'wasm_execute_contract',
128
+ 'wasm_store_code',
129
+ 'wasm_migrate_contract',
130
+ 'wasm_update_admin',
131
+ 'wasm_clear_admin',
132
+ ];
133
+ const toOpen = ref('send');
134
+
135
+ const theme = ref('light');
136
+ const switchTheme = () => {
137
+ if (theme.value === 'light') {
138
+ theme.value = 'dark';
139
+ document.documentElement.classList.add('dark');
140
+ } else {
141
+ theme.value = 'light';
142
+ document.documentElement.classList.remove('dark');
143
+ }
144
+ document.documentElement.setAttribute('data-theme', theme.value);
145
+ };
146
+
147
+ onMounted(() => {
148
+ document.documentElement.classList.add('light');
149
+ document.documentElement.setAttribute('data-theme', 'light');
150
+ });
151
+ const walletStateChange = (res: any) => {
152
+ console.log(res, 'resres');
153
+ };
154
+
155
+ console.log("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1")
156
+ console.log(ethToEthermint("0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1", "evmos"))
157
+ console.log(ethermintToEth("evmos13zl7c4ea60jt05hxhl2dp443r7zrlz4plc5m8z"))
158
+
159
+ </script>
160
+
161
+ <template>
162
+ <div class="bg-gray-50 dark:bg-[#0f1419] dark:text-white min-h-[100vh]">
163
+ Ping Widget Version: {{ pingWidget?.version }}
164
+
165
+ <div class="btn dark:bg-[#0066ff] dark:hover:bg-[#0f1419] btn-sm normal-case" @click="switchTheme()">
166
+ Theme: {{ theme }}
167
+ </div>
168
+
169
+ <div>&nbsp;</div>
170
+ <ping-connect-wallet
171
+ :chain-id="conf.chainId"
172
+ :hd-path="conf.hdPath"
173
+ @change="walletStateChange"
174
+ />
175
+
176
+ <textarea v-model="conf.params" cols="80" rows="5"></textarea>
177
+ <div></div>
178
+
179
+ <select v-model="toOpen">
180
+ <option v-for="i in types">{{ i }}</option>
181
+ </select>
182
+
183
+ <br />
184
+
185
+ <label :for="toOpen" class="btn dark:bg-[#0066ff] dark:hover:bg-[#0f1419] dark:text-white">{{ toOpen }}</label>
186
+ <ping-tx-dialog
187
+ :type="toOpen"
188
+ :sender="conf.sender"
189
+ :registry-name="conf.chainName"
190
+ :endpoint="conf.endpoint"
191
+ :hd-path="conf.hdPath"
192
+ :params="conf.params"
193
+ ></ping-tx-dialog>
194
+
195
+ <br />
196
+ // example:<br />
197
+ <label for="withdraw" class="btn dark:bg-[#0066ff] dark:hover:bg-[#0f1419] dark:text-white">Withdraw</label>
198
+ <ping-tx-dialog
199
+ type="withdraw"
200
+ :sender="conf.sender"
201
+ :endpoint="conf.endpoint"
202
+ :hd-path="conf.hdPath"
203
+ :params="conf.params"
204
+ ></ping-tx-dialog>
205
+
206
+ <label for="store_code" class="btn dark:bg-[#0066ff] dark:hover:bg-[#0f1419] dark:text-white">Store Code</label>
207
+ <ping-tx-dialog
208
+ type="store_code"
209
+ :sender="conf.sender"
210
+ :endpoint="conf.endpoint"
211
+ :registry-name="conf.chainName"
212
+ :hd-path="conf.hdPath"
213
+ :params="conf.params"
214
+ ></ping-tx-dialog>
215
+
216
+ <label for="PingTokenConvert" class="btn dark:bg-[#0066ff] dark:hover:bg-[#0f1419] dark:text-white">Token Convert</label>
217
+ <ping-token-convert
218
+ :chain-name="conf.chainName"
219
+ :endpoint="conf.endpoint"
220
+ hd-path="m/44'/118/0'/0/0"
221
+ ></ping-token-convert>
222
+ </div>
223
+ </template>
224
+
225
+ <style scoped></style>
package/src/main.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
-
4
- createApp(App).mount('#app')
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+
4
+ // Import MictoNode Design System (aligned with Explorer Phase 7)
5
+ import './styles/design-system.css'
6
+
7
+ createApp(App).mount('#app')
@@ -0,0 +1,150 @@
1
+ /**
2
+ * MictoNode Widget Design System
3
+ * Aligned with Explorer Design System (Phase 7)
4
+ *
5
+ * Theme: "The Data Cathedral" - Premium Blockchain Explorer
6
+ *
7
+ * Color Philosophy:
8
+ * - LCH (Lightness, Chroma, Hue) for perceptual uniformity
9
+ * - 60-30-10 Rule: 60% neutral, 30% brand, 10% accent
10
+ * - Protected Palette: #0066ff (primary), #0f1419 (dark base)
11
+ *
12
+ * Token Structure:
13
+ * - Semantic naming (not color names)
14
+ * - Scale-based variants (50-950)
15
+ * - LCH values for precise color manipulation
16
+ */
17
+
18
+ :root {
19
+ /* ==========================================================================
20
+ LCH COLOR TOKENS
21
+ ========================================================================== */
22
+
23
+ /* Primary Scale - Deep Blue (#0066ff base) */
24
+ --color-primary-50: lch(95% 15% 250deg);
25
+ --color-primary-100: lch(90% 20% 250deg);
26
+ --color-primary-200: lch(82% 30% 250deg);
27
+ --color-primary-300: lch(72% 45% 250deg);
28
+ --color-primary-400: lch(60% 60% 250deg);
29
+ --color-primary-500: lch(52% 70% 250deg); /* #0066ff equivalent */
30
+ --color-primary-600: lch(48% 75% 250deg);
31
+ --color-primary-700: lch(42% 70% 250deg);
32
+ --color-primary-800: lch(35% 60% 250deg);
33
+ --color-primary-900: lch(28% 50% 250deg);
34
+ --color-primary-950: lch(20% 35% 250deg);
35
+
36
+ /* Accent Scale - Teal/Cyan for modern feel */
37
+ --color-accent-50: lch(96% 10% 190deg);
38
+ --color-accent-100: lch(92% 15% 190deg);
39
+ --color-accent-200: lch(85% 25% 190deg);
40
+ --color-accent-300: lch(78% 40% 190deg);
41
+ --color-accent-400: lch(70% 55% 190deg);
42
+ --color-accent-500: lch(65% 65% 190deg);
43
+ --color-accent-600: lch(60% 70% 190deg);
44
+ --color-accent-700: lch(52% 65% 190deg);
45
+ --color-accent-800: lch(45% 55% 190deg);
46
+ --color-accent-900: lch(38% 45% 190deg);
47
+ --color-accent-950: lch(28% 30% 190deg);
48
+
49
+ /* Neutral Scale - Cool greys for "Data Cathedral" mood */
50
+ --color-neutral-50: lch(98% 2% 250deg);
51
+ --color-neutral-100: lch(95% 3% 250deg);
52
+ --color-neutral-200: lch(90% 4% 250deg);
53
+ --color-neutral-300: lch(80% 5% 250deg);
54
+ --color-neutral-400: lch(65% 6% 250deg);
55
+ --color-neutral-500: lch(50% 8% 250deg);
56
+ --color-neutral-600: lch(40% 10% 250deg);
57
+ --color-neutral-700: lch(30% 12% 250deg);
58
+ --color-neutral-800: lch(20% 10% 250deg);
59
+ --color-neutral-900: lch(12% 6% 250deg);
60
+ --color-neutral-950: lch(8% 4% 250deg);
61
+
62
+ /* Semantic Colors */
63
+ --color-success: lch(65% 55% 145deg); /* #3fb68b equivalent */
64
+ --color-warning: lch(75% 60% 45deg); /* #f59e0b equivalent */
65
+ --color-error: lch(60% 65% 25deg); /* #ff5353 equivalent */
66
+ --color-info: lch(60% 70% 250deg); /* #0066ff equivalent */
67
+
68
+ /* ==========================================================================
69
+ SPACING TOKENS (8-Point Grid)
70
+ ========================================================================== */
71
+ --space-0: 0;
72
+ --space-1: 0.25rem; /* 4px */
73
+ --space-2: 0.5rem; /* 8px */
74
+ --space-3: 0.75rem; /* 12px */
75
+ --space-4: 1rem; /* 16px */
76
+ --space-5: 1.25rem; /* 20px */
77
+ --space-6: 1.5rem; /* 24px */
78
+ --space-8: 2rem; /* 32px */
79
+ --space-10: 2.5rem; /* 40px */
80
+ --space-12: 3rem; /* 48px */
81
+ --space-16: 4rem; /* 64px */
82
+ --space-20: 5rem; /* 80px */
83
+ --space-24: 6rem; /* 96px */
84
+
85
+ /* ==========================================================================
86
+ RADIUS TOKENS
87
+ ========================================================================== */
88
+ --radius-none: 0;
89
+ --radius-sm: 0.25rem; /* 4px */
90
+ --radius-md: 0.5rem; /* 8px */
91
+ --radius-lg: 0.75rem; /* 12px */
92
+ --radius-xl: 1rem; /* 16px */
93
+ --radius-2xl: 1.5rem; /* 24px */
94
+ --radius-full: 9999px;
95
+
96
+ /* ==========================================================================
97
+ SHADOW TOKENS (Multi-layer for depth)
98
+ ========================================================================== */
99
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
100
+ --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
101
+ --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
102
+ --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 8px 10px rgba(0, 0, 0, 0.1);
103
+ --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
104
+ --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
105
+ --shadow-glow-primary: 0 0 20px lch(52% 70% 250deg / 0.3);
106
+ --shadow-glow-accent: 0 0 20px lch(65% 65% 190deg / 0.3);
107
+
108
+ /* ==========================================================================
109
+ Z-INDEX LAYERS
110
+ ========================================================================== */
111
+ --z-base: 0;
112
+ --z-above: 10;
113
+ --z-dropdown: 100;
114
+ --z-sticky: 200;
115
+ --z-fixed: 300;
116
+ --z-modal-backdrop: 400;
117
+ --z-modal: 500;
118
+ --z-popover: 600;
119
+ --z-tooltip: 700;
120
+
121
+ /* ==========================================================================
122
+ TRANSITION TOKENS
123
+ ========================================================================== */
124
+ --duration-fast: 150ms;
125
+ --duration-base: 200ms;
126
+ --duration-slow: 300ms;
127
+ --duration-slower: 500ms;
128
+
129
+ --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
130
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
131
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
132
+ --ease-in-out: cubic-bezier(0.4, 0, 0.6, 1);
133
+ --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Physics-based bounce */
134
+ }
135
+
136
+ /* Dark Mode Overrides */
137
+ @media (prefers-color-scheme: dark) {
138
+ :root {
139
+ /* Adjust luminance for dark mode while preserving hue/chroma */
140
+ --color-primary-500: lch(60% 70% 250deg); /* Brighter for contrast */
141
+ --color-accent-500: lch(70% 65% 190deg);
142
+ }
143
+ }
144
+
145
+ /* Manual dark mode class support */
146
+ html.dark,
147
+ html[data-theme='dark'] {
148
+ --color-primary-500: lch(60% 70% 250deg);
149
+ --color-accent-500: lch(70% 65% 190deg);
150
+ }
package/src/vite-env.d.ts CHANGED
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />