@bootnodedev/canton-dappbooster 0.3.1 → 0.4.0

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/connect.d.ts CHANGED
@@ -24,7 +24,7 @@ type WalletButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
24
24
  *
25
25
  * @category Components
26
26
  */
27
- declare const WalletButton: (props: WalletButtonProps) => ReactElement;
27
+ export declare const WalletButton: (props: WalletButtonProps) => ReactElement;
28
28
  //#endregion
29
29
  //#region src/components/WalletButton/CancelButton.d.ts
30
30
  /**
@@ -52,7 +52,7 @@ type CancelButtonProps = ComponentPropsWithRef<"button">;
52
52
  *
53
53
  * @category Components
54
54
  */
55
- declare const CancelButton: ({ children, className, onClick, type, ...rest }: CancelButtonProps) => ReactElement;
55
+ export declare const CancelButton: ({ children, className, onClick, type, ...rest }: CancelButtonProps) => ReactElement;
56
56
  //#endregion
57
57
  //#region src/components/WalletButton/ConnectButton.d.ts
58
58
  /**
@@ -76,7 +76,7 @@ type ConnectButtonProps = ComponentPropsWithRef<"button">;
76
76
  *
77
77
  * @category Components
78
78
  */
79
- declare const ConnectButton: ({ children, className, onClick, type, ...rest }: ConnectButtonProps) => ReactElement;
79
+ export declare const ConnectButton: ({ children, className, onClick, type, ...rest }: ConnectButtonProps) => ReactElement;
80
80
  //#endregion
81
81
  //#region src/components/WalletButton/DisconnectButton.d.ts
82
82
  /**
@@ -102,7 +102,7 @@ type DisconnectButtonProps = ComponentPropsWithRef<"button">;
102
102
  *
103
103
  * @category Components
104
104
  */
105
- declare const DisconnectButton: ({ children, className, onClick, type, ...rest }: DisconnectButtonProps) => ReactElement;
105
+ export declare const DisconnectButton: ({ children, className, onClick, type, ...rest }: DisconnectButtonProps) => ReactElement;
106
106
  //#endregion
107
107
  //#region src/hooks/useHoldings.d.ts
108
108
  /**
@@ -130,6 +130,6 @@ interface UseHoldingsResult {
130
130
  *
131
131
  * @category Hooks
132
132
  */
133
- declare const useHoldings: () => UseHoldingsResult;
133
+ export declare const useHoldings: () => UseHoldingsResult;
134
134
  //#endregion
135
- export { CancelButton, type CancelButtonProps, ConnectButton, type ConnectButtonProps, DisconnectButton, type DisconnectButtonProps, type UseHoldingsResult, WalletButton, type WalletButtonProps, useHoldings };
135
+ export type { CancelButtonProps, ConnectButtonProps, DisconnectButtonProps, UseHoldingsResult, WalletButtonProps };
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ interface ExplorerLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>
29
29
  *
30
30
  * @category Components
31
31
  */
32
- declare const ExplorerLink: ({ className, href, ...rest }: ExplorerLinkProps) => ReactElement;
32
+ export declare const ExplorerLink: ({ className, href, ...rest }: ExplorerLinkProps) => ReactElement;
33
33
  //#endregion
34
34
  //#region src/components/Identifier/truncate.d.ts
35
35
  /**
@@ -66,7 +66,7 @@ interface TruncateOptions {
66
66
  *
67
67
  * @category Utilities
68
68
  */
69
- declare const truncateIdentifier: (value: string, options?: TruncateOptions) => string;
69
+ export declare const truncateIdentifier: (value: string, options?: TruncateOptions) => string;
70
70
  /**
71
71
  * The readable half of a party id. Returns the whole value when there is no separator. Reach for
72
72
  * this over {@link truncateIdentifier} where the fingerprint should be dropped rather than
@@ -77,7 +77,7 @@ declare const truncateIdentifier: (value: string, options?: TruncateOptions) =>
77
77
  *
78
78
  * @category Utilities
79
79
  */
80
- declare const partyHint: (value: string) => string;
80
+ export declare const partyHint: (value: string) => string;
81
81
  //#endregion
82
82
  //#region src/hooks/useCopyToClipboard.d.ts
83
83
  /**
@@ -144,7 +144,7 @@ interface UseCopyToClipboardResult {
144
144
  *
145
145
  * @category Hooks
146
146
  */
147
- declare const useCopyToClipboard: (options?: UseCopyToClipboardOptions) => UseCopyToClipboardResult;
147
+ export declare const useCopyToClipboard: (options?: UseCopyToClipboardOptions) => UseCopyToClipboardResult;
148
148
  //#endregion
149
149
  //#region src/components/Identifier/index.d.ts
150
150
  /**
@@ -178,7 +178,7 @@ interface IdentifierProps extends Omit<HTMLAttributes<HTMLSpanElement>, "onCopy"
178
178
  *
179
179
  * @category Components
180
180
  */
181
- declare const Identifier: ({ value, label, truncate, copy, announce, href, onCopy, className, ...rest }: IdentifierProps) => ReactElement;
181
+ export declare const Identifier: ({ value, label, truncate, copy, announce, href, onCopy, className, ...rest }: IdentifierProps) => ReactElement;
182
182
  //#endregion
183
183
  //#region src/utils/partyId.d.ts
184
184
  /**
@@ -208,7 +208,7 @@ type PartyIdError = "missing-separator" | "invalid-hint" | "invalid-fingerprint"
208
208
  *
209
209
  * @category Utilities
210
210
  */
211
- declare const validatePartyId: (value: string) => PartyIdError | undefined;
211
+ export declare const validatePartyId: (value: string) => PartyIdError | undefined;
212
212
  /**
213
213
  * Whether a party id is well-formed. Reach for {@link validatePartyId} instead where the reason
214
214
  * matters.
@@ -219,7 +219,7 @@ declare const validatePartyId: (value: string) => PartyIdError | undefined;
219
219
  *
220
220
  * @category Utilities
221
221
  */
222
- declare const isValidPartyId: (value: string) => boolean;
222
+ export declare const isValidPartyId: (value: string) => boolean;
223
223
  //#endregion
224
224
  //#region src/components/PartyIdInput/index.d.ts
225
225
  /**
@@ -252,7 +252,7 @@ interface PartyIdInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
252
252
  *
253
253
  * @category Components
254
254
  */
255
- declare const PartyIdInput: ({ "aria-invalid": ariaInvalid, className, onBlur, onChange, value, ...rest }: PartyIdInputProps) => ReactElement;
255
+ export declare const PartyIdInput: ({ "aria-invalid": ariaInvalid, className, onBlur, onChange, value, ...rest }: PartyIdInputProps) => ReactElement;
256
256
  //#endregion
257
257
  //#region src/utils/tokenAmount.d.ts
258
258
  /**
@@ -264,7 +264,7 @@ declare const PartyIdInput: ({ "aria-invalid": ariaInvalid, className, onBlur, o
264
264
  *
265
265
  * @category Utilities
266
266
  */
267
- declare const DEFAULT_PRECISION = 10;
267
+ export declare const DEFAULT_PRECISION = 10;
268
268
  /**
269
269
  * Why an amount is not usable. Codes rather than sentences: L2 ships no user-facing copy, so the
270
270
  * consumer maps these to their own wording.
@@ -293,7 +293,7 @@ type TokenAmountError = "not-a-number" | "too-many-decimals" | "too-large" | "ab
293
293
  *
294
294
  * @category Utilities
295
295
  */
296
- declare const parseAmount: (value: string, precision?: number) => bigint | undefined;
296
+ export declare const parseAmount: (value: string, precision?: number) => bigint | undefined;
297
297
  /**
298
298
  * The inverse of {@link parseAmount}: a scaled integer back to a canonical decimal string with no
299
299
  * trailing zeros.
@@ -303,7 +303,7 @@ declare const parseAmount: (value: string, precision?: number) => bigint | undef
303
303
  *
304
304
  * @category Utilities
305
305
  */
306
- declare const formatScaled: (scaled: bigint, precision?: number) => string;
306
+ export declare const formatScaled: (scaled: bigint, precision?: number) => string;
307
307
  /**
308
308
  * Groups the integer part for reading and leaves the fraction verbatim, so a value still being
309
309
  * typed (`1.`, `1.50`) survives. `Intl` is handed the string unparsed, which formats it exactly
@@ -315,7 +315,7 @@ declare const formatScaled: (scaled: bigint, precision?: number) => string;
315
315
  *
316
316
  * @category Utilities
317
317
  */
318
- declare const formatAmount: (value: string, locale?: string) => string;
318
+ export declare const formatAmount: (value: string, locale?: string) => string;
319
319
  /**
320
320
  * Reduces raw field input to a decimal: grouping separators and anything that can never belong to
321
321
  * an amount are dropped rather than flagged, so a paste of `1,234.5` lands as `1234.5`. A sign or
@@ -330,7 +330,7 @@ declare const formatAmount: (value: string, locale?: string) => string;
330
330
  *
331
331
  * @category Utilities
332
332
  */
333
- declare const sanitizeAmountInput: (input: string, locale?: string) => string;
333
+ export declare const sanitizeAmountInput: (input: string, locale?: string) => string;
334
334
  /**
335
335
  * Checks an amount against the token's precision, the `Numeric 38,10` ceiling, and an optional
336
336
  * range. Returns `undefined` when nothing is wrong, including for the empty string: empty is empty,
@@ -342,7 +342,7 @@ declare const sanitizeAmountInput: (input: string, locale?: string) => string;
342
342
  *
343
343
  * @category Utilities
344
344
  */
345
- declare const validateAmount: (value: string, { precision, max }?: {
345
+ export declare const validateAmount: (value: string, { precision, max }?: {
346
346
  precision?: number;
347
347
  max?: string;
348
348
  }) => TokenAmountError | undefined;
@@ -408,7 +408,7 @@ type TokenInputProps = TokenInputOwnProps & ({
408
408
  *
409
409
  * @category Components
410
410
  */
411
- declare const TokenInput: ({ "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, balance, balanceState, className, disabled, favoriteIds, id, label, onBlur, onChange, onFocus, onTokenSelect, usdValue, token, value, ...rest }: TokenInputProps) => ReactElement;
411
+ export declare const TokenInput: ({ "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, balance, balanceState, className, disabled, favoriteIds, id, label, onBlur, onChange, onFocus, onTokenSelect, usdValue, token, value, ...rest }: TokenInputProps) => ReactElement;
412
412
  //#endregion
413
413
  //#region src/components/TokenInput/formatFigure.d.ts
414
414
  /**
@@ -436,7 +436,7 @@ interface FormatFigureOptions {
436
436
  *
437
437
  * @category Utilities
438
438
  */
439
- declare const formatFigure: (value: string | undefined, { locale, places }?: FormatFigureOptions) => string | undefined;
439
+ export declare const formatFigure: (value: string | undefined, { locale, places }?: FormatFigureOptions) => string | undefined;
440
440
  //#endregion
441
441
  //#region src/hooks/useExplorerLink.d.ts
442
442
  /**
@@ -489,7 +489,7 @@ interface GetExplorerLinkParams {
489
489
  *
490
490
  * @category Utilities
491
491
  */
492
- declare const getExplorerLink: ({ explorer, value, entity }: GetExplorerLinkParams) => string | undefined;
492
+ export declare const getExplorerLink: ({ explorer, value, entity }: GetExplorerLinkParams) => string | undefined;
493
493
  /**
494
494
  * Holds an explorer config so call sites pass only an identifier, and returns
495
495
  * {@link getExplorerLink} bound to it.
@@ -504,7 +504,7 @@ declare const getExplorerLink: ({ explorer, value, entity }: GetExplorerLinkPara
504
504
  *
505
505
  * @category Hooks
506
506
  */
507
- declare const useExplorerLink: (explorer: ExplorerConfig) => ((value: string, entity?: ExplorerEntity) => string | undefined);
507
+ export declare const useExplorerLink: (explorer: ExplorerConfig) => ((value: string, entity?: ExplorerEntity) => string | undefined);
508
508
  //#endregion
509
509
  //#region src/providers/ThemeProvider/index.d.ts
510
510
  /**
@@ -540,7 +540,7 @@ interface ThemeProviderProps {
540
540
  *
541
541
  * @category Components
542
542
  */
543
- declare const ThemeProvider: ({ children, storageKey }: ThemeProviderProps) => ReactElement;
543
+ export declare const ThemeProvider: ({ children, storageKey }: ThemeProviderProps) => ReactElement;
544
544
  //#endregion
545
545
  //#region src/providers/ThemeProvider/context.d.ts
546
546
  /**
@@ -591,7 +591,7 @@ interface UseThemeResult {
591
591
  *
592
592
  * @category Hooks
593
593
  */
594
- declare const useTheme: () => UseThemeResult;
594
+ export declare const useTheme: () => UseThemeResult;
595
595
  //#endregion
596
596
  //#region src/providers/TokenListProvider/index.d.ts
597
597
  /**
@@ -618,7 +618,7 @@ interface TokenListProviderProps {
618
618
  *
619
619
  * @category Components
620
620
  */
621
- declare const TokenListProvider: ({ children, tokens }: TokenListProviderProps) => ReactElement;
621
+ export declare const TokenListProvider: ({ children, tokens }: TokenListProviderProps) => ReactElement;
622
622
  //#endregion
623
623
  //#region src/providers/TokenListProvider/useTokenList.d.ts
624
624
  /**
@@ -633,7 +633,7 @@ declare const TokenListProvider: ({ children, tokens }: TokenListProviderProps)
633
633
  *
634
634
  * @category Hooks
635
635
  */
636
- declare const useTokenList: () => UseTokenListResult;
636
+ export declare const useTokenList: () => UseTokenListResult;
637
637
  //#endregion
638
638
  //#region src/utils/mergeTokens.d.ts
639
639
  /**
@@ -658,7 +658,7 @@ type PartialToken = Partial<Omit<Token, "instrumentId">> & {
658
658
  *
659
659
  * @category Utilities
660
660
  */
661
- declare const mergeTokens: (sources: readonly (readonly PartialToken[])[]) => readonly Token[];
661
+ export declare const mergeTokens: (sources: readonly (readonly PartialToken[])[]) => readonly Token[];
662
662
  //#endregion
663
663
  //#region src/utils/readInstruments.d.ts
664
664
  /**
@@ -687,7 +687,7 @@ interface Instrument {
687
687
  *
688
688
  * @category Utilities
689
689
  */
690
- declare const readInstruments: (registryUrl: string) => Promise<readonly Instrument[]>;
690
+ export declare const readInstruments: (registryUrl: string) => Promise<readonly Instrument[]>;
691
691
  //#endregion
692
692
  //#region src/utils/tokenKey.d.ts
693
693
  /**
@@ -699,6 +699,6 @@ declare const readInstruments: (registryUrl: string) => Promise<readonly Instrum
699
699
  *
700
700
  * @category Utilities
701
701
  */
702
- declare const tokenKey: ({ admin, id }: InstrumentId) => string;
702
+ export declare const tokenKey: ({ admin, id }: InstrumentId) => string;
703
703
  //#endregion
704
- export { type CopyOutcome, type CopyState, DEFAULT_PRECISION, type ExplorerConfig, type ExplorerEntity, ExplorerLink, type ExplorerLinkProps, type FormatFigureOptions, type GetExplorerLinkParams, type Holding, Identifier, type IdentifierProps, type Instrument, type InstrumentBalance, type InstrumentId, type PartialToken, type PartyIdError, PartyIdInput, type PartyIdInputProps, type ResolvedTheme, type ThemeMode, ThemeProvider, type ThemeProviderProps, type Token, type TokenAmountError, TokenInput, type TokenInputProps, TokenListProvider, type TokenListProviderProps, type TokenMeta, type TruncateOptions, type UseCopyToClipboardOptions, type UseCopyToClipboardResult, type UseThemeResult, type UseTokenListResult, formatAmount, formatFigure, formatScaled, getExplorerLink, isValidPartyId, mergeTokens, parseAmount, partyHint, readInstruments, sanitizeAmountInput, sumHoldings, tokenKey, truncateIdentifier, useCopyToClipboard, useExplorerLink, useTheme, useTokenList, validateAmount, validatePartyId };
704
+ export { type CopyOutcome, type CopyState, type ExplorerConfig, type ExplorerEntity, type ExplorerLinkProps, type FormatFigureOptions, type GetExplorerLinkParams, type Holding, type IdentifierProps, type Instrument, type InstrumentBalance, type InstrumentId, type PartialToken, type PartyIdError, type PartyIdInputProps, type ResolvedTheme, type ThemeMode, type ThemeProviderProps, type Token, type TokenAmountError, type TokenInputProps, type TokenListProviderProps, type TokenMeta, type TruncateOptions, type UseCopyToClipboardOptions, type UseCopyToClipboardResult, type UseThemeResult, type UseTokenListResult, sumHoldings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bootnodedev/canton-dappbooster",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Reusable UI components for Canton dApps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "devDependencies": {
47
- "@bootnodedev/canton-connect": "^0.3.1",
47
+ "@bootnodedev/canton-connect": "^0.4.0",
48
48
  "@testing-library/dom": "^10.4.1",
49
49
  "@testing-library/jest-dom": "^7.0.0",
50
50
  "@testing-library/react": "^16.3.2",
@@ -54,13 +54,13 @@
54
54
  "jsdom": "^30.0.0",
55
55
  "react": "^19.2.8",
56
56
  "react-dom": "^19.2.8",
57
- "tsdown": "^0.22.14",
57
+ "tsdown": "^0.23.0",
58
58
  "typescript": "^5.9.3",
59
59
  "vite": "^8.1.5",
60
- "vitest": "^4.1.10"
60
+ "vitest": "^5.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@bootnodedev/canton-connect": "^0.3.1",
63
+ "@bootnodedev/canton-connect": "^0.4.0",
64
64
  "react": "^19.0.0",
65
65
  "react-dom": "^19.0.0"
66
66
  },