@opexa/portal-components 0.0.85 → 0.0.86

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 (120) hide show
  1. package/dist/client/hooks/useCreateGCashDepositMutation.js +2 -1
  2. package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +2 -1
  3. package/dist/client/hooks/useCreateGameSessionMutation.js +2 -1
  4. package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +2 -1
  5. package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -1
  6. package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +2 -1
  7. package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -1
  8. package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +2 -1
  9. package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -1
  10. package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -1
  11. package/dist/components/Account/Account.d.ts +0 -2
  12. package/dist/components/Account/Account.js +10 -8
  13. package/dist/components/Account/AccountTrigger.d.ts +1 -2
  14. package/dist/components/Account/AccountTrigger.js +18 -6
  15. package/dist/components/Bonuses/BonusesTrigger.d.ts +1 -1
  16. package/dist/components/Bonuses/BonusesTrigger.js +3 -3
  17. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  18. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  19. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  20. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  21. package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +1 -6
  22. package/dist/components/DepositWithdrawal/DepositWithdrawal.js +8 -19
  23. package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.d.ts +1 -1
  24. package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +12 -4
  25. package/dist/components/Messages/Message.d.ts +1 -4
  26. package/dist/components/Messages/Message.js +8 -9
  27. package/dist/components/Messages/MessageContext.d.ts +2 -0
  28. package/dist/components/Messages/MessageContext.js +2 -0
  29. package/dist/components/Messages/Messages.d.ts +0 -1
  30. package/dist/components/Messages/Messages.js +9 -8
  31. package/dist/components/Messages/MessagesTrigger.d.ts +1 -1
  32. package/dist/components/Messages/MessagesTrigger.js +8 -4
  33. package/dist/components/PortalProvider/Providers.js +1 -5
  34. package/dist/components/SignUp/SignUpForm.js +2 -1
  35. package/dist/handlers.js +1 -0
  36. package/dist/services/ObjectId.d.ts +0 -14
  37. package/dist/services/ObjectId.js +62 -76
  38. package/dist/services/ObjectType.d.ts +10 -0
  39. package/dist/services/ObjectType.js +10 -0
  40. package/dist/services/index.d.ts +4 -3
  41. package/dist/services/index.js +4 -3
  42. package/dist/styles/theme.css +2 -2
  43. package/dist/ui/AlertDialog/AlertDialog.d.ts +122 -122
  44. package/dist/ui/AlertDialog/AlertDialog.js +2 -1
  45. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  46. package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
  47. package/dist/ui/Avatar/Avatar.d.ts +1 -1
  48. package/dist/ui/Avatar/Avatar.js +1 -1
  49. package/dist/ui/Avatar/avatar.recipe.js +1 -1
  50. package/dist/ui/Badge/Badge.js +1 -1
  51. package/dist/ui/Button/Button.js +1 -1
  52. package/dist/ui/Checkbox/Checkbox.d.ts +24 -24
  53. package/dist/ui/Checkbox/Checkbox.js +1 -1
  54. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  55. package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
  56. package/dist/ui/Clipboard/Clipboard.d.ts +19 -19
  57. package/dist/ui/Clipboard/Clipboard.js +1 -1
  58. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  59. package/dist/ui/Clipboard/clipboard.recipe.js +1 -1
  60. package/dist/ui/Collapsible/Collapsible.d.ts +1 -1
  61. package/dist/ui/Collapsible/Collapsible.js +1 -1
  62. package/dist/ui/Collapsible/collapsible.recipe.js +1 -1
  63. package/dist/ui/Combobox/Combobox.d.ts +43 -43
  64. package/dist/ui/Combobox/Combobox.js +1 -1
  65. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  66. package/dist/ui/Combobox/combobox.recipe.js +1 -1
  67. package/dist/ui/DatePicker/DatePicker.d.ts +337 -337
  68. package/dist/ui/DatePicker/DatePicker.js +1 -1
  69. package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
  70. package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
  71. package/dist/ui/Dialog/Dialog.d.ts +122 -122
  72. package/dist/ui/Dialog/Dialog.js +2 -1
  73. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  74. package/dist/ui/Dialog/dialog.recipe.js +1 -1
  75. package/dist/ui/Drawer/Drawer.d.ts +34 -34
  76. package/dist/ui/Drawer/Drawer.js +2 -1
  77. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  78. package/dist/ui/Drawer/drawer.recipe.js +1 -1
  79. package/dist/ui/Field/Field.d.ts +22 -22
  80. package/dist/ui/Field/Field.js +1 -1
  81. package/dist/ui/Field/field.recipe.d.ts +3 -3
  82. package/dist/ui/Field/field.recipe.js +1 -1
  83. package/dist/ui/IconButton/IconButton.js +1 -1
  84. package/dist/ui/NumberInput/NumberInput.d.ts +1 -1
  85. package/dist/ui/NumberInput/NumberInput.js +1 -1
  86. package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
  87. package/dist/ui/PasswordInput/PasswordInput.d.ts +1 -1
  88. package/dist/ui/PasswordInput/PasswordInput.js +1 -1
  89. package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -1
  90. package/dist/ui/PinInput/PinInput.d.ts +1 -1
  91. package/dist/ui/PinInput/PinInput.js +1 -1
  92. package/dist/ui/PinInput/pinInput.recipe.js +1 -1
  93. package/dist/ui/Popover/Popover.d.ts +89 -89
  94. package/dist/ui/Popover/Popover.js +1 -1
  95. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  96. package/dist/ui/Popover/popover.recipe.js +1 -1
  97. package/dist/ui/Progress/Progress.d.ts +1 -1
  98. package/dist/ui/Progress/Progress.js +1 -1
  99. package/dist/ui/Progress/progress.recipe.js +1 -1
  100. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +1 -1
  101. package/dist/ui/SegmentGroup/SegmentGroup.js +1 -1
  102. package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
  103. package/dist/ui/Select/Select.d.ts +46 -46
  104. package/dist/ui/Select/Select.js +1 -1
  105. package/dist/ui/Select/select.recipe.d.ts +3 -3
  106. package/dist/ui/Select/select.recipe.js +1 -1
  107. package/dist/ui/Table/Table.d.ts +21 -21
  108. package/dist/ui/Table/Table.js +1 -1
  109. package/dist/ui/Table/table.recipe.d.ts +3 -3
  110. package/dist/ui/Tabs/Tabs.d.ts +16 -16
  111. package/dist/ui/Tabs/Tabs.js +1 -1
  112. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  113. package/dist/ui/Tabs/tabs.recipe.js +1 -1
  114. package/package.json +27 -30
  115. package/dist/utils/graphqlRequest.d.ts +0 -4
  116. package/dist/utils/graphqlRequest.js +0 -255
  117. package/dist/utils/httpRequest.d.ts +0 -6
  118. package/dist/utils/httpRequest.js +0 -87
  119. package/dist/utils/sha256.d.ts +0 -4
  120. package/dist/utils/sha256.js +0 -16
@@ -1,79 +1,65 @@
1
- import bs58 from 'bs58';
2
- import { sha256 } from 'crypto-hash';
3
- import randomBytes from 'randombytes';
4
- const MACHINE_ID = randomBytes(5);
5
- let counter = randomBytes(4).readUInt32BE(0) & 0xffffff;
6
- export class ObjectId {
7
- _buffer;
8
- constructor(buffer) {
9
- this._buffer = buffer;
10
- }
11
- static translate(id, type) {
12
- const buffer = Buffer.from(id.buffer);
13
- buffer[0] = type & 0xff;
14
- return ObjectId.from(buffer);
15
- }
16
- static generate(type) {
17
- const buffer = Buffer.alloc(13);
18
- const time = Math.floor(Date.now() / 1000) & 0xffffffff;
19
- counter = (counter + 1) & 0xffffff;
20
- buffer[0] = (type ?? 0) & 0xff;
21
- buffer[1] = (time >> 24) & 0xff;
22
- buffer[2] = (time >> 16) & 0xff;
23
- buffer[3] = (time >> 8) & 0xff;
24
- buffer[4] = time & 0xff;
25
- buffer[5] = MACHINE_ID[0];
26
- buffer[6] = MACHINE_ID[1];
27
- buffer[7] = MACHINE_ID[2];
28
- buffer[8] = MACHINE_ID[3];
29
- buffer[9] = MACHINE_ID[4];
30
- buffer[10] = (counter >> 16) & 0xff;
31
- buffer[11] = (counter >> 8) & 0xff;
32
- buffer[12] = counter & 0xff;
33
- return new ObjectId(buffer);
34
- }
35
- static async generateFromKey(type, key) {
36
- const buffer = Buffer.alloc(13);
37
- buffer[0] = type & 0xff;
38
- Buffer.from(await sha256(key, { outputFormat: 'buffer' })).copy(buffer, 1, 0, 12);
39
- return new ObjectId(buffer);
40
- }
41
- static from(value) {
42
- if (typeof value === 'string') {
43
- if (value.length > 20) {
44
- throw new Error('String value exceeds the limit of 20 characters');
45
- }
46
- return new ObjectId(Buffer.from(bs58.decode(value)));
47
- }
48
- if (value instanceof Buffer) {
49
- return new ObjectId(value);
50
- }
51
- throw new Error('Invalid value type. Expected string or Buffer.');
52
- }
53
- get type() {
54
- return this.buffer[0];
55
- }
56
- get buffer() {
57
- return this._buffer;
58
- }
59
- compare(other) {
60
- return this._buffer.compare(other._buffer);
61
- }
62
- equals(other) {
63
- return this._buffer.equals(other._buffer);
64
- }
65
- clone() {
66
- const buffer = Buffer.alloc(13);
67
- this.buffer.copy(buffer);
68
- return ObjectId.from(buffer);
69
- }
70
- toString(encoding) {
71
- if (!encoding || encoding === 'bs58') {
72
- return bs58.encode(this._buffer);
73
- }
74
- return this._buffer.toString(encoding);
75
- }
76
- }
1
+ /* ref: https://github.com/HighOutputVentures/opexa/blob/main/packages/object-id/src/libs/object-id.ts */
2
+ // import bs58 from 'bs58';
3
+ // import { sha256 } from 'crypto-hash';
4
+ // import randomBytes from 'randombytes';
5
+ // const MACHINE_ID = randomBytes(5);
6
+ // let counter = randomBytes(4).readUInt32BE(0) & 0xffffff;
7
+ // export class ObjectId {
8
+ // constructor(private readonly _buffer: Buffer) {}
9
+ // /**
10
+ // * @param type The type of the object, e.g. `ObjectType.MemberAccount`
11
+ // * @example
12
+ // * ```ts
13
+ // * import { ObjectId, ObjectType } from '@opexa/portal-components';
14
+ // *
15
+ // * const id = ObjectId.generate(ObjectType.MemberAccount).toString();
16
+ // * ```
17
+ // */
18
+ // static generate(type: number) {
19
+ // const buffer = Buffer.alloc(13);
20
+ // const time = Math.floor(Date.now() / 1000) & 0xffffffff;
21
+ // counter = (counter + 1) & 0xffffff;
22
+ // buffer[0] = type & 0xff;
23
+ // buffer[1] = (time >> 24) & 0xff;
24
+ // buffer[2] = (time >> 16) & 0xff;
25
+ // buffer[3] = (time >> 8) & 0xff;
26
+ // buffer[4] = time & 0xff;
27
+ // buffer[5] = MACHINE_ID[0];
28
+ // buffer[6] = MACHINE_ID[1];
29
+ // buffer[7] = MACHINE_ID[2];
30
+ // buffer[8] = MACHINE_ID[3];
31
+ // buffer[9] = MACHINE_ID[4];
32
+ // buffer[10] = (counter >> 16) & 0xff;
33
+ // buffer[11] = (counter >> 8) & 0xff;
34
+ // buffer[12] = counter & 0xff;
35
+ // return new ObjectId(buffer);
36
+ // }
37
+ // /**
38
+ // *
39
+ // * @param type The type of the object, e.g. `ObjectType.Game`
40
+ // * @param key The key to generate the object ID from, e.g. `Game.id`
41
+ // * @example
42
+ // * ```ts
43
+ // * import { ObjectId, ObjectType } from '@opexa/portal-components';
44
+ // *
45
+ // * const id = (await ObjectId.generateFromKey(ObjectType.Game, gameId)).toString();
46
+ // * ```
47
+ // */
48
+ // static async generateFromKey(type: number, key: string) {
49
+ // const buffer = Buffer.alloc(13);
50
+ // buffer[0] = type & 0xff;
51
+ // Buffer.from(await sha256(key, { outputFormat: 'buffer' })).copy(
52
+ // <Uint8Array>buffer,
53
+ // 1,
54
+ // 0,
55
+ // 12,
56
+ // );
57
+ // return new ObjectId(buffer);
58
+ // }
59
+ // toString() {
60
+ // return bs58.encode(<Uint8Array>this._buffer);
61
+ // }
62
+ // }
77
63
  export const ObjectType = {
78
64
  MemberAccount: 8,
79
65
  MemberVerification: 15,
@@ -0,0 +1,10 @@
1
+ export declare const ObjectType: {
2
+ MemberAccount: number;
3
+ MemberVerification: number;
4
+ Deposit: number;
5
+ Withdrawal: number;
6
+ File: number;
7
+ Game: number;
8
+ GameSession: number;
9
+ MayaSession: number;
10
+ };
@@ -0,0 +1,10 @@
1
+ export const ObjectType = {
2
+ MemberAccount: 8,
3
+ MemberVerification: 15,
4
+ Deposit: 9,
5
+ Withdrawal: 14,
6
+ File: 16,
7
+ Game: 203,
8
+ GameSession: 204,
9
+ MayaSession: 230,
10
+ };
@@ -3,10 +3,11 @@ export * from './auth.service';
3
3
  export * from './cmsPortal.service';
4
4
  export * from './file.service';
5
5
  export * from './game.service';
6
- export * from './graphqlRequest';
7
- export * from './httpRequest';
8
6
  export * from './portal.service';
9
7
  export * from './report.service';
10
- export * from './sha256';
11
8
  export * from './trigger.service';
12
9
  export * from './wallet.service';
10
+ export * from './graphqlRequest';
11
+ export * from './httpRequest';
12
+ export * from './ObjectType';
13
+ export * from './sha256';
@@ -3,10 +3,11 @@ export * from './auth.service.js';
3
3
  export * from './cmsPortal.service.js';
4
4
  export * from './file.service.js';
5
5
  export * from './game.service.js';
6
- export * from './graphqlRequest.js';
7
- export * from './httpRequest.js';
8
6
  export * from './portal.service.js';
9
7
  export * from './report.service.js';
10
- export * from './sha256.js';
11
8
  export * from './trigger.service.js';
12
9
  export * from './wallet.service.js';
10
+ export * from './graphqlRequest.js';
11
+ export * from './httpRequest.js';
12
+ export * from './ObjectType.js';
13
+ export * from './sha256.js';
@@ -1,5 +1,5 @@
1
1
  @plugin '@tailwindcss/typography';
2
- @plugin 'tailwindcss-plugin-zag';
2
+ @plugin 'tailwind-zag';
3
3
 
4
4
  @layer base {
5
5
  html {
@@ -694,4 +694,4 @@
694
694
  @custom-variant scrollbar (&::-webkit-scrollbar);
695
695
  @custom-variant scrollbar-thumb (&::-webkit-scrollbar-thumb);
696
696
  @custom-variant scrollbar-track (&::-webkit-scrollbar-track);
697
- @custom-variant dark (&:where(.dark, .dark *));
697
+ @custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));