@bloxwap/hig 0.6.0 → 0.7.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/chart/README.md +1 -1
- package/contracts/README.md +1 -1
- package/contracts/dist/index.d.ts +16 -0
- package/contracts/dist/index.js +22 -0
- package/contracts/dist/messages.d.ts +6 -0
- package/contracts/dist/messages.js +3 -1
- package/feedback/README.md +1 -1
- package/native/README.md +1 -1
- package/native/dist/account-block.d.ts +53 -7
- package/native/dist/account-block.js +42 -9
- package/native/dist/animated-number-model.d.ts +7 -1
- package/native/dist/animated-number-model.js +50 -1
- package/native/dist/animated-number.d.ts +3 -1
- package/native/dist/animated-number.js +8 -5
- package/native/dist/asset-balance-row.d.ts +17 -1
- package/native/dist/asset-balance-row.js +13 -8
- package/native/dist/bar-mark.d.ts +14 -2
- package/native/dist/bar-mark.js +19 -5
- package/native/dist/bar-pnl.js +5 -4
- package/native/dist/blocks.d.ts +8 -14
- package/native/dist/blocks.js +5 -6
- package/native/dist/button.js +3 -1
- package/native/dist/data.d.ts +1 -1
- package/native/dist/data.js +6 -4
- package/native/dist/field.d.ts +14 -4
- package/native/dist/field.js +33 -7
- package/native/dist/figure.d.ts +23 -0
- package/native/dist/figure.js +10 -0
- package/native/dist/language-block.d.ts +5 -1
- package/native/dist/language-block.js +3 -3
- package/native/dist/list-group.d.ts +42 -8
- package/native/dist/list-group.js +71 -13
- package/native/dist/manage-position-block.d.ts +28 -2
- package/native/dist/manage-position-block.js +36 -11
- package/native/dist/market-row.d.ts +46 -0
- package/native/dist/market-row.js +30 -0
- package/native/dist/notifications-block.d.ts +30 -2
- package/native/dist/notifications-block.js +16 -8
- package/native/dist/pickers.d.ts +24 -2
- package/native/dist/pickers.js +16 -8
- package/native/dist/position-block.d.ts +66 -10
- package/native/dist/position-block.js +45 -11
- package/native/dist/profile-block.d.ts +29 -5
- package/native/dist/profile-block.js +25 -5
- package/native/dist/provider.d.ts +9 -3
- package/native/dist/provider.js +7 -3
- package/native/dist/radio-group.d.ts +9 -3
- package/native/dist/radio-group.js +4 -5
- package/native/dist/recipes.d.ts +6 -0
- package/native/dist/recipes.js +6 -0
- package/native/dist/reward-block.d.ts +45 -6
- package/native/dist/reward-block.js +30 -12
- package/native/dist/screen-header.d.ts +49 -0
- package/native/dist/screen-header.js +29 -0
- package/native/dist/selection.d.ts +2 -2
- package/native/dist/setting-header.d.ts +2 -8
- package/native/dist/setting-header.js +2 -11
- package/native/dist/setting-switch.d.ts +14 -1
- package/native/dist/setting-switch.js +5 -2
- package/native/dist/signals-block.d.ts +26 -2
- package/native/dist/signals-block.js +14 -4
- package/native/dist/sound-haptics-block.d.ts +29 -2
- package/native/dist/sound-haptics-block.js +18 -7
- package/native/dist/status.d.ts +6 -5
- package/native/dist/status.js +5 -5
- package/native/dist/sticky-header.d.ts +28 -0
- package/native/dist/sticky-header.js +21 -0
- package/native/dist/surface.d.ts +3 -1
- package/native/dist/surface.js +2 -1
- package/native/dist/swap-panel-block.d.ts +2 -1
- package/native/dist/swap-panel-block.js +9 -6
- package/native/dist/swap-parts.d.ts +5 -3
- package/native/dist/swap-parts.js +2 -2
- package/native/dist/swap-shared.d.ts +6 -0
- package/native/dist/swap-views.js +5 -3
- package/native/dist/switch-row.d.ts +3 -2
- package/native/dist/switch-row.js +5 -3
- package/native/dist/switch.d.ts +4 -2
- package/native/dist/switch.js +3 -3
- package/native/dist/target-block.d.ts +33 -6
- package/native/dist/target-block.js +19 -6
- package/native/dist/token-action-block.d.ts +17 -9
- package/native/dist/token-action-block.js +14 -6
- package/native/dist/trade-history-detail-block.d.ts +26 -1
- package/native/dist/trade-history-detail-block.js +17 -9
- package/native/dist/trade-history-list-block.d.ts +71 -5
- package/native/dist/trade-history-list-block.js +50 -15
- package/native/dist/wallet-address-core.d.ts +25 -0
- package/native/dist/wallet-address-core.js +31 -0
- package/native/dist/wallet-address.d.ts +6 -10
- package/native/dist/wallet-address.js +16 -20
- package/native-fonts/README.md +1 -1
- package/og-fonts/README.md +1 -1
- package/package.json +21 -1
- package/react/README.md +1 -1
- package/react/dist/animated-number-model.d.ts +6 -0
- package/react/dist/animated-number-model.js +33 -0
- package/react/dist/animated-number.d.ts +5 -1
- package/react/dist/animated-number.js +12 -8
- package/react/dist/asset-balance-row.d.ts +17 -1
- package/react/dist/asset-balance-row.js +11 -3
- package/react/dist/bar-mark.d.ts +5 -2
- package/react/dist/bar-mark.js +5 -3
- package/react/dist/blocks/account-block.d.ts +53 -7
- package/react/dist/blocks/account-block.js +45 -10
- package/react/dist/blocks/language-block.d.ts +5 -1
- package/react/dist/blocks/language-block.js +6 -5
- package/react/dist/blocks/manage-position-block.d.ts +28 -2
- package/react/dist/blocks/manage-position-block.js +23 -4
- package/react/dist/blocks/market-row.d.ts +20 -9
- package/react/dist/blocks/market-row.js +12 -4
- package/react/dist/blocks/notifications-block.d.ts +25 -2
- package/react/dist/blocks/notifications-block.js +11 -2
- package/react/dist/blocks/pickers.d.ts +21 -1
- package/react/dist/blocks/pickers.js +30 -10
- package/react/dist/blocks/position-block.d.ts +34 -11
- package/react/dist/blocks/position-block.js +16 -5
- package/react/dist/blocks/profile-block.d.ts +29 -6
- package/react/dist/blocks/profile-block.js +31 -5
- package/react/dist/blocks/reward-block.d.ts +53 -14
- package/react/dist/blocks/reward-block.js +20 -10
- package/react/dist/blocks/screen-header.d.ts +26 -2
- package/react/dist/blocks/screen-header.js +13 -5
- package/react/dist/blocks/setting-switch.d.ts +14 -1
- package/react/dist/blocks/setting-switch.js +8 -4
- package/react/dist/blocks/signals-block.d.ts +21 -2
- package/react/dist/blocks/signals-block.js +5 -5
- package/react/dist/blocks/sound-haptics-block.d.ts +25 -3
- package/react/dist/blocks/sound-haptics-block.js +11 -7
- package/react/dist/blocks/sticky-header.d.ts +9 -0
- package/react/dist/blocks/sticky-header.js +43 -0
- package/react/dist/blocks/swap/amount-card.js +2 -1
- package/react/dist/blocks/swap/settings.js +2 -2
- package/react/dist/blocks/swap/shared.d.ts +7 -1
- package/react/dist/blocks/swap/shared.js +6 -4
- package/react/dist/blocks/swap-panel-block.d.ts +2 -0
- package/react/dist/blocks/swap-panel-block.js +6 -6
- package/react/dist/blocks/target-block.d.ts +28 -6
- package/react/dist/blocks/target-block.js +17 -9
- package/react/dist/blocks/token-action-block.d.ts +17 -8
- package/react/dist/blocks/token-action-block.js +9 -6
- package/react/dist/blocks/trade-history-detail-block.d.ts +21 -1
- package/react/dist/blocks/trade-history-detail-block.js +5 -4
- package/react/dist/blocks/trade-history-list-block.d.ts +29 -5
- package/react/dist/blocks/trade-history-list-block.js +15 -8
- package/react/dist/blocks.d.ts +8 -8
- package/react/dist/blocks.js +2 -2
- package/react/dist/button.js +6 -4
- package/react/dist/data.js +3 -3
- package/react/dist/field.d.ts +14 -4
- package/react/dist/field.js +19 -6
- package/react/dist/figure.d.ts +23 -0
- package/react/dist/figure.js +12 -0
- package/react/dist/list-group.d.ts +41 -8
- package/react/dist/list-group.js +44 -12
- package/react/dist/provider.d.ts +40 -3
- package/react/dist/provider.js +63 -6
- package/react/dist/selection.d.ts +8 -2
- package/react/dist/selection.js +11 -6
- package/react/dist/styles.css +164 -9
- package/react/dist/surface.d.ts +5 -1
- package/react/dist/surface.js +1 -1
- package/react/dist/wallet-address-core.d.ts +23 -0
- package/react/dist/wallet-address-core.js +24 -0
- package/react/dist/wallet-address.d.ts +6 -12
- package/react/dist/wallet-address.js +5 -16
- package/tokens/README.md +1 -1
package/react/dist/styles.css
CHANGED
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
.hig-surface > :first-child { margin-block-start:0; }
|
|
46
46
|
.hig-surface > :last-child { margin-block-end:0; }
|
|
47
47
|
.hig-text { font-size:1rem;line-height:1.5; }
|
|
48
|
+
.hig-text[data-tone='muted'] { color:var(--hig-muted); }
|
|
49
|
+
.hig-text[data-size='caption'] { font-size:var(--hig-type-caption-size,.75rem);line-height:var(--hig-type-caption-line-height,1.125rem); }
|
|
48
50
|
.hig-heading { line-height:1.25; }
|
|
49
51
|
.hig-input { width:100%;min-width:0;min-height:var(--hig-button);border-radius:9999px;border:1px solid transparent;padding: max(4px,calc((var(--hig-button) - 1.5em - 2px)/2)) 20px;background:var(--hig-fill);color:var(--hig-text);font:inherit;line-height:1.5; }
|
|
50
52
|
.hig-input::placeholder { color:var(--hig-muted);opacity:1; }
|
|
@@ -136,6 +138,16 @@ textarea.hig-input { border-radius:var(--hig-radius-xl,14px);resize:vertical; }
|
|
|
136
138
|
.hig-market-row[data-mode='presentation'] .hig-market-identity { display:flex;align-items:center;gap:8px;min-width:0; }
|
|
137
139
|
.hig-market-row[data-mode='presentation'] :is(.hig-market-price,.hig-market-change,.hig-market-volume) { text-align:end; }
|
|
138
140
|
.hig-market-row[data-mode='presentation'] .hig-number { font-family:inherit; }
|
|
141
|
+
/* Host options: a row without price or change, or with trailing content or a check, flows into as many columns as it has cells. */
|
|
142
|
+
.hig-market-row[data-mode='presentation'][data-flow] { grid-template-columns:minmax(0,1fr);grid-auto-flow:column;grid-auto-columns:auto; }
|
|
143
|
+
.hig-market-row[data-mode='presentation'] .hig-market-trailing { text-align:end; }
|
|
144
|
+
.hig-market-row[data-flow] .hig-market-identity { flex:1 1 auto;min-width:0; }
|
|
145
|
+
.hig-market-text { display:flex;flex-direction:column;align-items:flex-start;min-width:0;text-align:start; }
|
|
146
|
+
.hig-market-detail { font-size:.875rem;line-height:1.43;font-weight:400;color:var(--hig-muted); }
|
|
147
|
+
.hig-market-trailing { display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0; }
|
|
148
|
+
.hig-market-check { flex:none;color:var(--hig-text); }
|
|
149
|
+
.hig-market-row[data-active] { border-radius:var(--hig-radius-xl,14px);background:var(--hig-fill); }
|
|
150
|
+
.hig-market-row[data-disabled] :is(.hig-market-name,.hig-market-price,.hig-market-change,.hig-market-volume,.hig-market-trailing,.hig-market-icon) { opacity:.5; }
|
|
139
151
|
.hig-badge { display:inline-flex;align-items:center;gap:4px;width:fit-content;max-width:100%;min-width:0;padding:4px 10px;border-radius:9999px;background:var(--hig-fill);color:var(--hig-text);line-height:1.5;vertical-align:middle;overflow-wrap:anywhere; }
|
|
140
152
|
.hig-badge[data-tone='positive'] { color:var(--hig-positive);background:color-mix(in srgb,var(--hig-positive) 15%,transparent); }
|
|
141
153
|
.hig-badge[data-tone='negative'] { color:var(--hig-negative);background:color-mix(in srgb,var(--hig-negative) 15%,transparent); }
|
|
@@ -531,25 +543,69 @@ button.hig-asset-row:active { background:var(--hig-fill-raised); }
|
|
|
531
543
|
.hig-asset-row-amounts { flex:none;align-items:flex-end;text-align:end; }
|
|
532
544
|
.hig-asset-row strong { font-size:1rem;line-height:1.5;font-weight:600;color:var(--hig-text); }
|
|
533
545
|
.hig-asset-row .hig-number { font-family:inherit; }
|
|
546
|
+
/* A tag is a caption under the figures; the trailing slot and the selected check follow them, 12px apart like the rest of the row. */
|
|
547
|
+
.hig-asset-row-tag { font-size:.75rem;line-height:1.5;color:var(--hig-muted); }
|
|
548
|
+
.hig-asset-row-trailing { flex:none;display:flex;align-items:center;gap:8px;color:var(--hig-muted); }
|
|
549
|
+
.hig-asset-row-check { flex:none;color:var(--hig-text); }
|
|
550
|
+
/* Unavailable: the well fill stays, the text and artwork go muted, and a press does nothing. */
|
|
551
|
+
.hig-asset-row:is(:disabled,[aria-disabled='true']) { cursor:default; }
|
|
552
|
+
button.hig-asset-row:disabled:active { background:var(--hig-fill); }
|
|
553
|
+
.hig-asset-row:is(:disabled,[aria-disabled='true']) strong { color:var(--hig-muted); }
|
|
554
|
+
.hig-asset-row:is(:disabled,[aria-disabled='true']) .hig-asset-row-icon { opacity:.5; }
|
|
534
555
|
/* ScreenHeader: Back, a centred title and a trailing control, shared by the cards that are their own screen.
|
|
535
556
|
AccountBlock: that header, the total with the deposit action, then the holdings 8px apart. */
|
|
536
557
|
.hig-account-block { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
537
558
|
.hig-screen-header { display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px;min-height:44px; }
|
|
538
559
|
.hig-screen-header-side { display:grid;place-items:center;min-width:0; }
|
|
539
560
|
.hig-screen-title { margin:0;font-size:1.0625rem;line-height:1.4;font-weight:600;text-align:center;overflow-wrap:anywhere; }
|
|
561
|
+
/* hideTitle: the heading leaves the flow, so the trailing side keeps its own column. */
|
|
562
|
+
.hig-screen-header > .hig-screen-header-side:last-child { grid-column:3; }
|
|
563
|
+
.hig-screen-header .hig-swap-back:disabled { color:var(--hig-faint);background:transparent;cursor:default; }
|
|
564
|
+
/* stickyHeader: pinned in the nearest scroller, transparent at rest so whatever the host draws behind it shows through, and filled
|
|
565
|
+
once content scrolls under it. The script marks that moment with data-scrolled; where scroll-driven animations exist the fill
|
|
566
|
+
also follows the scroll position itself (the header's parent leaving the top of the scroller), which needs no script. */
|
|
567
|
+
.hig-screen-header[data-sticky] { position:sticky;inset-block-start:0;z-index:1;background-color:transparent;transition:background-color var(--hig-motion-duration-fast) var(--hig-motion-easing-standard,ease); }
|
|
568
|
+
.hig-screen-header[data-sticky][data-scrolled] { background-color:var(--hig-sticky-header-background,var(--hig-screen-background,var(--hig-background))); }
|
|
569
|
+
@keyframes hig-sticky-fill { from { background-color:transparent; } to { background-color:var(--hig-sticky-header-background,var(--hig-screen-background,var(--hig-background))); } }
|
|
570
|
+
@supports (animation-timeline:view()) {
|
|
571
|
+
:has(> .hig-screen-header[data-sticky]) { view-timeline:--hig-sticky-header block; }
|
|
572
|
+
.hig-screen-header[data-sticky] { animation:hig-sticky-fill linear both;animation-timeline:--hig-sticky-header;animation-range:exit-crossing 0px exit-crossing 12px; }
|
|
573
|
+
/* Not when the parent is itself the scroller (data-sticky-own): its view timeline would follow an outer scroller, so the script's data-scrolled rule fills it. */
|
|
574
|
+
.hig-screen-header[data-sticky][data-sticky-own] { animation:none; }
|
|
575
|
+
}
|
|
576
|
+
@media(prefers-reduced-motion:reduce) { .hig-screen-header[data-sticky] { transition:none;animation:none; } }
|
|
577
|
+
[data-hig-motion='reduced'] .hig-screen-header[data-sticky] { transition:none;animation:none; }
|
|
540
578
|
.hig-account-summary { display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px; }
|
|
541
579
|
.hig-account-balance { min-width:0;font-size:2rem;line-height:1.25;font-weight:600; }
|
|
542
580
|
.hig-account-balance .hig-number { font-family:inherit; }
|
|
543
581
|
.hig-account-assets { display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none; }
|
|
582
|
+
.hig-account-sections { display:flex;flex-direction:column;gap:24px;min-width:0; }
|
|
583
|
+
.hig-account-section { display:flex;flex-direction:column;gap:8px;min-width:0; }
|
|
584
|
+
.hig-account-section-header { display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding-inline:4px;color:var(--hig-muted);font-size:.875rem;line-height:1.43;font-weight:500; }
|
|
585
|
+
.hig-account-section-header > h3 { margin:0;min-width:0;font:inherit;overflow-wrap:anywhere; }
|
|
586
|
+
.hig-account-section-total { flex:none; }
|
|
587
|
+
.hig-account-section-total .hig-number { font-family:inherit; }
|
|
544
588
|
/* TokenActionBlock: header, the assets and chains bars 8px apart, then equal full-width actions 16px below. */
|
|
545
589
|
.hig-token-card { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
546
590
|
.hig-token-bars,.hig-token-actions { display:flex;flex-direction:column;gap:8px; }
|
|
591
|
+
.hig-token-card > .hig-token-note { margin:0; }
|
|
592
|
+
.hig-token-card > .hig-token-actions + .hig-token-note { margin-block-start:-8px; }
|
|
547
593
|
/* ManagePositionBlock: header, two bars 8px apart, action rows and the position row 16px below each other. */
|
|
548
594
|
.hig-manage-position-block { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
549
595
|
/* The two bars are read-only, so they sit on the page without a card, further apart than cards would be. */
|
|
550
596
|
.hig-token-card > .hig-token-bars,.hig-manage-position-block > .hig-token-bars { gap:20px;padding-inline:4px; }
|
|
551
597
|
.hig-position-side[data-side='long'],.hig-position-row [data-tone='up'] { color:var(--hig-positive); }
|
|
552
598
|
.hig-position-side[data-side='short'],.hig-position-row [data-tone='down'] { color:var(--hig-negative); }
|
|
599
|
+
/* An action row's trailing value (a resting trigger's price) is muted unless the host gives it a tone. */
|
|
600
|
+
.hig-manage-action-value .hig-number { font-family:inherit; }
|
|
601
|
+
.hig-manage-action-value[data-tone='positive'] { color:var(--hig-positive); }
|
|
602
|
+
.hig-manage-action-value[data-tone='negative'] { color:var(--hig-negative); }
|
|
603
|
+
.hig-manage-action-value[data-tone='muted'] { color:var(--hig-muted); }
|
|
604
|
+
/* The position's name can carry a small host badge, such as a venue. */
|
|
605
|
+
.hig-position-name { display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0; }
|
|
606
|
+
.hig-position-badge { padding:0 8px;font-size:.75rem;line-height:1.5;font-weight:500;color:var(--hig-muted); }
|
|
607
|
+
/* The caption under the position row, such as a stale or estimated result: 8 under the row, on its end inset. */
|
|
608
|
+
.hig-position-caption { margin:-8px 0 0;padding-inline:16px;color:var(--hig-muted);font-size:.8125rem;line-height:1.5; }
|
|
553
609
|
/* SoundHapticsBlock, SignalsBlock and NotificationsBlock: a header, then settings as cards 8px apart. Cards inside a list share one rounded container, 2px apart. */
|
|
554
610
|
.hig-settings-block { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
555
611
|
.hig-setting-cards,.hig-setting-body,.hig-setting-volume,.hig-notifications-item,.hig-signals-group { display:flex;flex-direction:column;gap:8px; }
|
|
@@ -560,6 +616,16 @@ button.hig-asset-row:active { background:var(--hig-fill-raised); }
|
|
|
560
616
|
/* A switch sits flush with the trailing edge and level with the first line of its label, however long the text beside it runs. */
|
|
561
617
|
.hig-setting-switch { display:flex;align-items:flex-start;gap:12px;min-height:var(--hig-control);padding:0;line-height:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent; }
|
|
562
618
|
.hig-setting-switch[data-disabled] { opacity:.5;cursor:not-allowed; }
|
|
619
|
+
.hig-setting-switch[data-locked] { cursor:default; }
|
|
620
|
+
.hig-setting-switch-accessory { display:inline-flex;align-items:center;margin-inline-start:8px;vertical-align:middle; }
|
|
621
|
+
.hig-setting-hint { margin:0;padding-inline:20px;color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
622
|
+
.hig-settings-description { margin:0;padding-inline:4px;color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
623
|
+
.hig-notifications-group { display:flex;flex-direction:column;gap:8px;margin-block-start:8px; }
|
|
624
|
+
.hig-notifications-action { margin-block-start:8px; }
|
|
625
|
+
.hig-setting-notes {display:flex;flex-direction:column;gap:4px;padding-block-end:12px; }
|
|
626
|
+
.hig-setting-notes > p { padding-inline:0; }
|
|
627
|
+
.hig-setting-body > .hig-setting-action:not(:first-child) { margin-block-start:8px; }
|
|
628
|
+
.hig-setting-choices legend { margin-block-end:4px;color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
563
629
|
.hig-setting-switch-text { flex:1;display:flex;flex-direction:column;gap:2px;min-width:0;padding-block:calc((var(--hig-control) - 1.5em)/2);overflow-wrap:anywhere; }
|
|
564
630
|
.hig-setting-switch-description,.hig-setting-caption { color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
565
631
|
.hig-setting-switch > .hig-switch { flex:none;display:inline-flex;align-items:center;justify-content:flex-end;height:var(--hig-control); }
|
|
@@ -587,6 +653,16 @@ button.hig-asset-row:active { background:var(--hig-fill-raised); }
|
|
|
587
653
|
.hig-position-note { margin:-8px 0 0;padding-inline:20px;color:var(--hig-muted);font-size:.8125rem;line-height:1.5; }
|
|
588
654
|
/* ListGroups stack 24 apart, the standard gap between groups. */
|
|
589
655
|
.hig-position-groups { display:flex;flex-direction:column;gap:24px; }
|
|
656
|
+
/* A struck value is a charge that does not apply; the line is drawn over the figure so it crosses animated digits too. */
|
|
657
|
+
.hig-position-struck { position:relative;display:inline-block; }
|
|
658
|
+
.hig-position-struck::after { content:'';position:absolute;inset-inline:0;inset-block-start:50%;border-block-start:1px solid currentColor;pointer-events:none; }
|
|
659
|
+
.hig-position-details dt:has(> .hig-position-label-accessory) { display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px 6px;min-width:0; }
|
|
660
|
+
.hig-position-label-accessory { display:inline-flex;align-items:center; }
|
|
661
|
+
/* A switch row toggles from anywhere on it. */
|
|
662
|
+
.hig-position-groups .hig-list-row:has(> .hig-list-row-trailing .hig-switch):not([aria-disabled='true']) { cursor:pointer; }
|
|
663
|
+
/* The paper trading row's action sits on the row's card, 8 under the switch. */
|
|
664
|
+
.hig-position-flag-card { display:flex;flex-direction:column;background:var(--hig-fill); }
|
|
665
|
+
.hig-position-flag-action { display:flex;padding:4px 20px 16px; }
|
|
590
666
|
/* RewardBlock: header, the promotion card, the standings choice, the viewer's row on a tint, then the ranked rows 2px apart in one rounded container. */
|
|
591
667
|
.hig-reward-block { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
592
668
|
.hig-reward-promo { display:flex;flex-direction:column;gap:12px; }
|
|
@@ -626,6 +702,13 @@ button.hig-asset-row:active { background:var(--hig-fill-raised); }
|
|
|
626
702
|
.hig-reward-verified { flex:none;display:inline-flex;color:var(--hig-warning); }
|
|
627
703
|
.hig-reward-score { flex:none;font-weight:600; }
|
|
628
704
|
.hig-reward-row[data-you] :is(.hig-reward-identity > strong,.hig-reward-score) { color:var(--hig-action); }
|
|
705
|
+
a.hig-reward-rules,a.hig-reward-action { text-decoration:none; }
|
|
706
|
+
.hig-reward-status { margin:0;padding-inline:4px;color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
707
|
+
.hig-reward-skeleton { min-height:64px;border-radius:20px; }
|
|
708
|
+
.hig-reward-pagination { display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px; }
|
|
709
|
+
.hig-reward-pagination > :first-child { justify-self:start; }
|
|
710
|
+
.hig-reward-pagination > :last-child { justify-self:end; }
|
|
711
|
+
.hig-reward-page { color:var(--hig-muted);font-size:.875rem;text-align:center; }
|
|
629
712
|
@media(prefers-reduced-motion:reduce) { .hig-reward-track > span { transition:none; } }
|
|
630
713
|
[data-hig-motion='reduced'] .hig-reward-track > span { transition:none; }
|
|
631
714
|
@media(forced-colors:active) { .hig-reward-track > span { forced-color-adjust:none; } }
|
|
@@ -650,6 +733,14 @@ button.hig-asset-row:active { background:var(--hig-fill-raised); }
|
|
|
650
733
|
.hig-target-block .hig-segmented-control > legend { position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
|
|
651
734
|
.hig-target-presets,.hig-target-actions { display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px; }
|
|
652
735
|
.hig-target-presets > .hig-button { padding-inline:8px; }
|
|
736
|
+
/* The Custom row holding the host's value reads as the selected choice: the value on its trailing edge and a ring in the kind's colour. */
|
|
737
|
+
.hig-target-block .hig-swap-setting[aria-pressed='true'] { box-shadow:inset 0 0 0 2px var(--hig-target-tone); }
|
|
738
|
+
.hig-target-block .hig-swap-setting[aria-pressed='true'] > .hig-swap-setting-value { color:var(--hig-target-tone); }
|
|
739
|
+
/* The info button beside a host header control: both sides of the header widen together so the title stays centred. */
|
|
740
|
+
.hig-target-header-actions { display:inline-flex;align-items:center;gap:4px; }
|
|
741
|
+
.hig-target-block > .hig-screen-header:has(.hig-target-header-actions) { grid-template-columns:92px minmax(0,1fr) 92px; }
|
|
742
|
+
.hig-target-block > .hig-screen-header:has(.hig-target-header-actions) > .hig-screen-header-side:first-child { justify-items:start; }
|
|
743
|
+
.hig-target-block > .hig-screen-header:has(.hig-target-header-actions) > .hig-screen-header-side:last-child { justify-items:end; }
|
|
653
744
|
@media(prefers-reduced-motion:reduce) { .hig-target-rest,.hig-target-move { transition:none; } }
|
|
654
745
|
[data-hig-motion='reduced'] .hig-target-rest,[data-hig-motion='reduced'] .hig-target-move { transition:none; }
|
|
655
746
|
@media(forced-colors:active) { .hig-target-move { forced-color-adjust:none; } }
|
|
@@ -665,15 +756,28 @@ button.hig-trade-row:active { background:var(--hig-fill-raised); }
|
|
|
665
756
|
.hig-trade-row-result { flex:none;align-items:flex-end;text-align:end; }
|
|
666
757
|
.hig-trade-row strong { font-size:1rem;line-height:1.5;font-weight:600;color:var(--hig-text); }
|
|
667
758
|
.hig-trade-row-side { display:inline-flex;align-items:center;gap:4px;font-weight:600; }
|
|
668
|
-
.hig-trade-row-side[data-side='long'] { color:var(--hig-
|
|
669
|
-
.hig-trade-row-side[data-side='short'] { color:var(--hig-
|
|
670
|
-
.hig-trade-row .hig-trade-pnl[data-tone='up'] { color:var(--hig-
|
|
671
|
-
.hig-trade-row .hig-trade-pnl[data-tone='down'] { color:var(--hig-
|
|
759
|
+
.hig-trade-row-side[data-side='long'] { color:var(--hig-up,var(--hig-buy)); }
|
|
760
|
+
.hig-trade-row-side[data-side='short'] { color:var(--hig-down,var(--hig-sell)); }
|
|
761
|
+
.hig-trade-row .hig-trade-pnl[data-tone='up'] { color:var(--hig-up,var(--hig-buy)); }
|
|
762
|
+
.hig-trade-row .hig-trade-pnl[data-tone='down'] { color:var(--hig-down,var(--hig-sell)); }
|
|
763
|
+
.hig-trade-row-note,.hig-trade-leverage-note { color:var(--hig-muted);font-weight:400; }
|
|
764
|
+
.hig-trade-row-note { margin-inline-start:4px; }
|
|
765
|
+
.hig-trade-row-meta { display:inline-flex;align-items:center;gap:4px;min-width:0; }
|
|
766
|
+
.hig-trade-row-tag { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
|
|
767
|
+
.hig-trade-skeleton { min-height:56px;border-radius:28px; }
|
|
768
|
+
.hig-trade-error { color:var(--hig-negative); }
|
|
769
|
+
.hig-trade-empty-title,.hig-trade-empty-description { display:block; }
|
|
770
|
+
.hig-trade-empty-title { color:var(--hig-text);font-weight:600; }
|
|
771
|
+
.hig-trade-notice,.hig-trade-footer { display:flex;flex-direction:column;gap:8px;min-width:0; }
|
|
772
|
+
.hig-trade-note { margin:0;color:var(--hig-muted);font-size:.875rem;line-height:1.5; }
|
|
773
|
+
.hig-screen-badge { font-size:.75rem;line-height:1.33;font-weight:600;vertical-align:middle; }
|
|
672
774
|
.hig-trade-row-chevron { flex:none;color:var(--hig-muted); }
|
|
673
775
|
[dir='rtl'] .hig-trade-row-chevron { transform:scaleX(-1); }
|
|
674
776
|
@media(hover:hover) and (pointer:fine) { button.hig-trade-row:hover { background:var(--hig-fill-raised); } }
|
|
675
|
-
.hig-trade-pnl[data-tone='up'],.hig-trade-result[data-tone='up'] :is(.hig-trade-figure,.hig-trade-return) { color:var(--hig-
|
|
676
|
-
.hig-trade-pnl[data-tone='down'],.hig-trade-result[data-tone='down'] :is(.hig-trade-figure,.hig-trade-return) { color:var(--hig-
|
|
777
|
+
.hig-trade-pnl[data-tone='up'],.hig-trade-result[data-tone='up'] :is(.hig-trade-figure,.hig-trade-return) { color:var(--hig-up,var(--hig-buy)); }
|
|
778
|
+
.hig-trade-pnl[data-tone='down'],.hig-trade-result[data-tone='down'] :is(.hig-trade-figure,.hig-trade-return) { color:var(--hig-down,var(--hig-sell)); }
|
|
779
|
+
.hig-trade-side[data-side='long'] { color:var(--hig-up,var(--hig-buy)); }
|
|
780
|
+
.hig-trade-side[data-side='short'] { color:var(--hig-down,var(--hig-sell)); }
|
|
677
781
|
.hig-trade-detail { display:flex;flex-direction:column;gap:16px;min-width:0; }
|
|
678
782
|
.hig-trade-summary { display:flex;flex-direction:column;gap:20px;padding-inline:4px; }
|
|
679
783
|
.hig-trade-side { font-weight:600;text-transform:uppercase; }
|
|
@@ -706,6 +810,17 @@ button.hig-trade-row:active { background:var(--hig-fill-raised); }
|
|
|
706
810
|
.hig-profile-name { display:flex;align-items:center;justify-content:center;gap:4px;max-width:100%; }
|
|
707
811
|
.hig-profile-name > h2 { margin:0;min-width:0;font-size:1.75rem;line-height:1.2;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
|
|
708
812
|
.hig-profile-name > .hig-button { flex:none;color:var(--hig-muted); }
|
|
813
|
+
.hig-profile-name-accessory { flex:none;display:inline-flex;align-items:center; }
|
|
814
|
+
button.hig-profile-artwork { appearance:none;margin:0;padding:0;border:0;background:none;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation; }
|
|
815
|
+
button.hig-profile-artwork:active { opacity:.85; }
|
|
816
|
+
.hig-profile-identity > .hig-profile-action { align-self:stretch; }
|
|
817
|
+
.hig-profile-value[data-tone='positive'] { color:var(--hig-positive); }
|
|
818
|
+
.hig-profile-value[data-tone='warning'] { color:var(--hig-warning); }
|
|
819
|
+
.hig-profile-value[data-tone='negative'] { color:var(--hig-negative); }
|
|
820
|
+
.hig-profile-value[data-tone='muted'] { color:var(--hig-muted); }
|
|
821
|
+
.hig-profile-value .hig-number { font-family:inherit; }
|
|
822
|
+
.hig-profile-block .hig-list-row:has(> .hig-list-row-trailing .hig-switch):not([aria-disabled='true']) { cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation; }
|
|
823
|
+
.hig-profile-footer { min-width:0; }
|
|
709
824
|
/* BarMark: one bar divided among its elements. Segments are flex shares of the bar with a 2px gap that shows the card, and the
|
|
710
825
|
remainder of a larger total is an empty track segment. Colours come from tone roles (or a host colour) through one custom property. */
|
|
711
826
|
.hig-bar-mark { display:flex;flex-direction:column;gap:12px; }
|
|
@@ -722,6 +837,7 @@ button.hig-trade-row:active { background:var(--hig-fill-raised); }
|
|
|
722
837
|
.hig-bar-mark-legend > li { display:inline-flex;align-items:center;gap:6px;min-width:0; }
|
|
723
838
|
.hig-bar-mark-dot { flex:none;width:8px;height:8px;border-radius:9999px;background:var(--hig-bar-mark-color,var(--hig-muted)); }
|
|
724
839
|
.hig-bar-mark-detail { color:var(--hig-faint); }
|
|
840
|
+
.hig-bar-mark-detail .hig-number { font-family:inherit; }
|
|
725
841
|
.hig-bar-mark [data-tone='positive'] { --hig-bar-mark-color:var(--hig-positive); }
|
|
726
842
|
.hig-bar-mark [data-tone='info'] { --hig-bar-mark-color:var(--hig-info); }
|
|
727
843
|
.hig-bar-mark [data-tone='warning'] { --hig-bar-mark-color:var(--hig-warning); }
|
|
@@ -761,6 +877,9 @@ button.hig-list-row:active,a.hig-list-row:active { background:var(--hig-fill-rai
|
|
|
761
877
|
.hig-list-row-leading { flex:none;display:grid;place-items:center;color:var(--hig-muted); }
|
|
762
878
|
.hig-list-row-label { flex:1;min-width:0;overflow-wrap:anywhere; }
|
|
763
879
|
.hig-list-row-value { flex:none;max-width:50%;color:var(--hig-muted);text-align:end;overflow-wrap:anywhere; }
|
|
880
|
+
.hig-list-row-value[data-tone='positive'] { color:var(--hig-positive); }
|
|
881
|
+
.hig-list-row-value[data-tone='warning'] { color:var(--hig-warning); }
|
|
882
|
+
.hig-list-row-value[data-tone='negative'] { color:var(--hig-negative); }
|
|
764
883
|
.hig-list-row-trailing { flex:none;display:inline-flex;align-items:center;gap:8px;color:var(--hig-muted); }
|
|
765
884
|
.hig-list-row-trailing .hig-switch > span { position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
|
|
766
885
|
/* The switch's own trailing padding would sit it short of the row's edge. */
|
|
@@ -773,9 +892,39 @@ button.hig-list-row:active,a.hig-list-row:active { background:var(--hig-fill-rai
|
|
|
773
892
|
.hig-list-row-chevron { flex:none;color:var(--hig-muted); }
|
|
774
893
|
[dir='rtl'] .hig-list-row-chevron { transform:scaleX(-1); }
|
|
775
894
|
@media(hover:hover) and (pointer:fine) { button.hig-list-row:hover,a.hig-list-row:hover { background:var(--hig-fill-raised); } }
|
|
895
|
+
/* Additions: a description line, label tones, the selected check, the busy spinner and the whole-row switch. */
|
|
896
|
+
.hig-list-row-text { flex:1;display:flex;flex-direction:column;min-width:0;padding-block:6px; }
|
|
897
|
+
.hig-list-row-text > .hig-list-row-label { flex:none; }
|
|
898
|
+
.hig-list-row-description { min-width:0;color:var(--hig-muted);font-size:.875rem;line-height:1.43;overflow-wrap:anywhere; }
|
|
899
|
+
.hig-list-row:has(> .hig-list-row-trailing .hig-switch) > .hig-list-row-text { padding-block:calc((48px - 1.5em)/2); }
|
|
900
|
+
.hig-list-row-label[data-tone='destructive'] { color:var(--hig-negative); }
|
|
901
|
+
.hig-list-row-label[data-tone='muted'] { color:var(--hig-muted); }
|
|
902
|
+
.hig-list-row-check { flex:none;color:var(--hig-text); }
|
|
903
|
+
.hig-list-row-spinner { margin:2px;color:var(--hig-muted); }
|
|
904
|
+
.hig-list-row[aria-busy='true'] { cursor:progress; }
|
|
905
|
+
.hig-list-row[data-switch]:not([aria-disabled='true']) { cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation; }
|
|
906
|
+
.hig-list-group-header { display:flex;align-items:center;gap:12px;min-width:0; }
|
|
907
|
+
.hig-list-group-header > .hig-list-group-title { flex:1;min-width:0; }
|
|
908
|
+
.hig-list-group-header > .hig-list-group-action:first-child { margin-inline-start:auto; }
|
|
909
|
+
.hig-list-group-title[data-accessory] { display:flex;flex-wrap:wrap;align-items:baseline;gap:8px; }
|
|
910
|
+
.hig-list-group-title-accessory { min-width:0;font-variant-numeric:tabular-nums; }
|
|
911
|
+
.hig-list-group-action { appearance:none;position:relative;flex:none;min-width:44px;min-height:44px;margin-block:-12px;padding:0 4px;border:0;border-radius:var(--hig-radius-sm,6px);background:transparent;color:var(--hig-text);font:inherit;font-size:.875rem;line-height:1.43;font-weight:600;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation; }
|
|
912
|
+
.hig-list-group-action:disabled { opacity:.5;cursor:not-allowed; }
|
|
913
|
+
.hig-list-group-action:active:not(:disabled) { color:var(--hig-muted); }
|
|
914
|
+
.hig-list-group-intro { min-width:0;padding-inline:4px; }
|
|
915
|
+
.hig-segment > span.hig-press-decoration[data-kind] { min-height:0; }
|
|
916
|
+
.hig-field p[data-tone='positive'] { color:var(--hig-positive); }
|
|
917
|
+
.hig-search-input[data-trailing] > .hig-input { padding-inline-end:48px; }
|
|
918
|
+
.hig-search-input[data-trailing] > .hig-input::-webkit-search-cancel-button { display:none;-webkit-appearance:none; }
|
|
919
|
+
.hig-search-trailing { position:absolute;inset-block:0;inset-inline-end:0;display:flex;align-items:center;gap:4px; }
|
|
920
|
+
.hig-search-clear { appearance:none;position:relative;display:grid;place-items:center;min-width:var(--hig-button,44px);height:100%;margin:0;padding:0;border:0;border-radius:9999px;background:transparent;color:var(--hig-muted);cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation; }
|
|
921
|
+
.hig-search-clear > svg { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round; }
|
|
922
|
+
.hig-search-clear:active:not(:disabled) { color:var(--hig-text); }
|
|
923
|
+
.hig-search-clear:disabled { opacity:.5;cursor:not-allowed; }
|
|
776
924
|
.hig-bar-pnl { display:flex;flex-direction:column;gap:12px;--hig-bar-pnl-tone:var(--hig-muted); }
|
|
777
|
-
|
|
778
|
-
.hig-bar-pnl[data-result='
|
|
925
|
+
/* The result follows the market direction roles (HIGProvider marketColors), which default to buy and sell. */
|
|
926
|
+
.hig-bar-pnl[data-result='profit'] { --hig-bar-pnl-tone:var(--hig-up,var(--hig-buy)); }
|
|
927
|
+
.hig-bar-pnl[data-result='loss'] { --hig-bar-pnl-tone:var(--hig-down,var(--hig-sell)); }
|
|
779
928
|
.hig-bar-pnl-bar { position:relative;display:flex;height:24px;border-radius:var(--hig-radius-md,8px);overflow:hidden; }
|
|
780
929
|
.hig-bar-pnl-rest,.hig-bar-pnl-move { flex:0 1 0;min-width:0;transition:flex-grow var(--hig-motion-duration-base) var(--hig-motion-easing-standard,ease); }
|
|
781
930
|
.hig-bar-pnl-rest { background:var(--hig-fill-raised); }
|
|
@@ -806,4 +955,10 @@ button.hig-list-row:active,a.hig-list-row:active { background:var(--hig-fill-rai
|
|
|
806
955
|
.hig-language-text { flex:1;display:flex;flex-direction:column;min-width:0;font-size:.875rem;line-height:1.43;color:var(--hig-muted);overflow-wrap:anywhere; }
|
|
807
956
|
.hig-language-text > strong { font-size:1rem;line-height:1.5;font-weight:600;color:var(--hig-text); }
|
|
808
957
|
.hig-language-check { flex:none;color:var(--hig-text); }
|
|
809
|
-
|
|
958
|
+
.hig-language-row:disabled { opacity:.5;cursor:not-allowed; }
|
|
959
|
+
@media(hover:hover) and (pointer:fine) { .hig-language-row:not(:disabled):hover { background:var(--hig-fill); } }
|
|
960
|
+
/* Press decoration: the host layer HIGProvider pressDecoration draws inside a pressable control. Out of flow, so it changes no
|
|
961
|
+
layout; it catches no pointer events itself, its children do. Zero specificity keeps a control that is already positioned as it is. */
|
|
962
|
+
:where(:has(> .hig-press-decoration)) { position:relative; }
|
|
963
|
+
span.hig-press-decoration[data-kind],.hig-list-row-trailing .hig-switch > span.hig-press-decoration[data-kind] { position:absolute;inset:0;display:block;width:auto;height:auto;margin:0;padding:0;border:0;border-radius:inherit;overflow:hidden;clip:auto;white-space:normal;pointer-events:none; }
|
|
964
|
+
span.hig-press-decoration[data-kind] > * { pointer-events:auto; }
|
package/react/dist/surface.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
3
|
+
tone?: 'muted'; /** `caption` draws the 12/18 caption size instead of the 16/24 body size. */
|
|
4
|
+
size?: 'caption';
|
|
5
|
+
}
|
|
6
|
+
export declare function Text({ tone, size, ...props }: TextProps): React.JSX.Element;
|
|
3
7
|
export declare function Heading({ level, ...props }: React.HTMLAttributes<HTMLHeadingElement> & {
|
|
4
8
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
9
|
}): React.DetailedReactHTMLElement<{
|
package/react/dist/surface.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export function Text(props) { return _jsx("p", { ...props, className: `hig-text ${props.className ?? ''}` }); }
|
|
3
|
+
export function Text({ tone, size, ...props }) { return _jsx("p", { "data-tone": tone, "data-size": size, ...props, className: `hig-text ${props.className ?? ''}` }); }
|
|
4
4
|
export function Heading({ level = 2, ...props }) { return React.createElement(`h${level}`, { ...props, className: `hig-heading ${props.className ?? ''}` }); }
|
|
5
5
|
export function Stack(props) { return _jsx("div", { ...props, className: `hig-stack ${props.className ?? ''}` }); }
|
|
6
6
|
export function Inline(props) { return _jsx("div", { ...props, className: `hig-inline ${props.className ?? ''}` }); }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AddressKind } from './data.js';
|
|
3
|
+
export { VerticalAddress, addressKind, type AddressKind } from './data.js';
|
|
4
|
+
export interface WalletAddressCoreProps {
|
|
5
|
+
address: string;
|
|
6
|
+
/** Row layout; inferred from the address when omitted (`0x…` is Ethereum-style). */
|
|
7
|
+
kind?: AddressKind;
|
|
8
|
+
/** The QR code, drawn by the host (its own encoder, or a `cuer` QR it renders itself), sized to `size`. It is named by the built-in “QR code” label, so keep the host's drawing hidden from assistive technology. */
|
|
9
|
+
qr: React.ReactNode;
|
|
10
|
+
/** QR edge in CSS pixels; default 196. The address column is exactly as tall. */
|
|
11
|
+
size?: number;
|
|
12
|
+
/** Host clipboard adapter. When set the whole component is one button that copies the address and shows the Tap to copy hint. */
|
|
13
|
+
onCopy?: () => Promise<void> | void;
|
|
14
|
+
/** `false` raises no “Address copied” notice and no status text after a copy, for a host that confirms the copy itself. Defaults to `true`. */
|
|
15
|
+
announce?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `WalletAddress` without the QR encoder: the host passes the code as `qr`, so the optional `cuer` peer is not needed.
|
|
21
|
+
* The address column, the copy button, its hint and the notice are the same as `WalletAddress` from `wallet-address`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function WalletAddress({ address, kind, qr, size, onCopy, announce, className, style }: WalletAddressCoreProps): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import * as en from '@bloxwap/hig/contracts/messages';
|
|
5
|
+
import { PressDecoration, useHIG } from './provider.js';
|
|
6
|
+
import { VerticalAddress, addressKind, addressRows } from './data.js';
|
|
7
|
+
import { notify } from './notify.js';
|
|
8
|
+
export { VerticalAddress, addressKind } from './data.js';
|
|
9
|
+
/**
|
|
10
|
+
* `WalletAddress` without the QR encoder: the host passes the code as `qr`, so the optional `cuer` peer is not needed.
|
|
11
|
+
* The address column, the copy button, its hint and the notice are the same as `WalletAddress` from `wallet-address`.
|
|
12
|
+
*/
|
|
13
|
+
export function WalletAddress({ address, kind, qr, size = 196, onCopy, announce = true, className, style }) {
|
|
14
|
+
const { messages } = useHIG();
|
|
15
|
+
const [status, setStatus] = useState('');
|
|
16
|
+
const rows = addressRows(address, kind ?? addressKind(address)).length;
|
|
17
|
+
const copy = () => { Promise.resolve().then(onCopy).then(() => { if (!announce)
|
|
18
|
+
return; const text = messages.addressCopied ?? en.addressCopied; setStatus(notify(text, { severity: 'success', id: 'hig-wallet-address', dismissName: (messages.dismissNotice ?? en.dismissNotice)(text, messages.dismiss ?? en.dismiss) }) ? '' : text); }).catch(() => setStatus('')); };
|
|
19
|
+
const body = _jsxs(_Fragment, { children: [_jsxs("span", { className: 'hig-wallet-address-body', children: [_jsx("span", { className: 'hig-wallet-address-qr', role: 'img', "aria-label": messages.qrCode ?? en.qrCode, children: qr }), _jsx(VerticalAddress, { address: address, kind: kind, rowHeight: size / rows })] }), onCopy && _jsxs("span", { className: 'hig-wallet-address-hint', children: [_jsxs("svg", { "aria-hidden": 'true', focusable: 'false', viewBox: '0 0 20 20', children: [_jsx("rect", { x: '7', y: '7', width: '9.5', height: '9.5', rx: '2' }), _jsx("path", { d: 'M4.5 13H4a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 4 3.5h6.5A1.5 1.5 0 0 1 12 5v.5' })] }), messages.tapToCopy ?? en.tapToCopy] })] });
|
|
20
|
+
const shared = { className: `hig-wallet-address${className ? ` ${className}` : ''}`, style: { '--hig-qr': `${size}px`, ...style } };
|
|
21
|
+
return onCopy
|
|
22
|
+
? _jsxs(_Fragment, { children: [_jsxs("button", { type: 'button', ...shared, "aria-label": (messages.copyAddress ?? en.copyAddress) + ': ' + address, onClick: copy, children: [body, _jsx(PressDecoration, { kind: 'row' })] }), announce && _jsx("span", { className: 'hig-sr-only', role: 'status', children: status })] })
|
|
23
|
+
: _jsx("div", { ...shared, children: body });
|
|
24
|
+
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type WalletAddressCoreProps } from './wallet-address-core.js';
|
|
3
3
|
export { VerticalAddress, addressKind, type AddressKind } from './data.js';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
/** Row layout; inferred from the address when omitted (`0x…` is Ethereum-style). */
|
|
7
|
-
kind?: AddressKind;
|
|
4
|
+
export type { WalletAddressCoreProps } from './wallet-address-core.js';
|
|
5
|
+
export interface WalletAddressProps extends Omit<WalletAddressCoreProps, 'qr'> {
|
|
8
6
|
/** QR payload when it differs from the address, for example an EIP-681 or Solana Pay URI. Defaults to the address. */
|
|
9
7
|
qrValue?: string;
|
|
10
8
|
/** Image URL shown in the centre of the QR; the code then uses high error correction. */
|
|
11
9
|
arena?: string;
|
|
12
|
-
/** QR
|
|
13
|
-
|
|
14
|
-
/** Host clipboard adapter. When set the whole component is one button that copies the address and shows the Tap to copy hint. */
|
|
15
|
-
onCopy?: () => Promise<void> | void;
|
|
16
|
-
className?: string;
|
|
17
|
-
style?: React.CSSProperties;
|
|
10
|
+
/** The host's own QR drawing in place of the Cuer code; `qrValue` and `arena` are then unused. Without `cuer` installed, import `WalletAddress` from `wallet-address-core` instead. */
|
|
11
|
+
qr?: React.ReactNode;
|
|
18
12
|
}
|
|
19
13
|
/**
|
|
20
14
|
* A wallet address to scan or copy: a Cuer QR code beside the address in HIG's vertical style, for Ethereum-style and
|
|
21
15
|
* Solana addresses. Needs the optional `cuer` peer. The host owns the clipboard through `onCopy`.
|
|
22
16
|
*/
|
|
23
|
-
export declare function WalletAddress({
|
|
17
|
+
export declare function WalletAddress({ qrValue, arena, qr, ...props }: WalletAddressProps): React.JSX.Element;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { Cuer } from 'cuer';
|
|
5
|
-
import
|
|
6
|
-
import { useHIG } from './provider.js';
|
|
7
|
-
import { VerticalAddress, addressKind, addressRows } from './data.js';
|
|
8
|
-
import { notify } from './notify.js';
|
|
4
|
+
import { WalletAddress as WalletAddressCore } from './wallet-address-core.js';
|
|
9
5
|
export { VerticalAddress, addressKind } from './data.js';
|
|
10
6
|
/**
|
|
11
7
|
* A wallet address to scan or copy: a Cuer QR code beside the address in HIG's vertical style, for Ethereum-style and
|
|
12
8
|
* Solana addresses. Needs the optional `cuer` peer. The host owns the clipboard through `onCopy`.
|
|
13
9
|
*/
|
|
14
|
-
export function WalletAddress({
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
const rows = addressRows(address, kind ?? addressKind(address)).length;
|
|
18
|
-
const copy = () => { Promise.resolve().then(onCopy).then(() => { const text = messages.addressCopied ?? en.addressCopied; setStatus(notify(text, { severity: 'success', id: 'hig-wallet-address', dismissName: (messages.dismissNotice ?? en.dismissNotice)(text, messages.dismiss ?? en.dismiss) }) ? '' : text); }).catch(() => setStatus('')); };
|
|
19
|
-
const body = _jsxs(_Fragment, { children: [_jsxs("span", { className: 'hig-wallet-address-body', children: [_jsx("span", { className: 'hig-wallet-address-qr', role: 'img', "aria-label": messages.qrCode ?? en.qrCode, children: _jsxs(Cuer.Root, { value: qrValue ?? address, errorCorrection: arena ? 'high' : 'medium', color: 'currentColor', "aria-hidden": 'true', children: [_jsx(Cuer.Finder, {}), _jsx(Cuer.Cells, {}), arena && _jsx(Cuer.Arena, { children: _jsx("img", { src: arena, alt: '', style: { width: '100%', height: '100%', objectFit: 'cover', borderRadius: 1 } }) })] }) }), _jsx(VerticalAddress, { address: address, kind: kind, rowHeight: size / rows })] }), onCopy && _jsxs("span", { className: 'hig-wallet-address-hint', children: [_jsxs("svg", { "aria-hidden": 'true', focusable: 'false', viewBox: '0 0 20 20', children: [_jsx("rect", { x: '7', y: '7', width: '9.5', height: '9.5', rx: '2' }), _jsx("path", { d: 'M4.5 13H4a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 4 3.5h6.5A1.5 1.5 0 0 1 12 5v.5' })] }), messages.tapToCopy ?? en.tapToCopy] })] });
|
|
20
|
-
const shared = { className: `hig-wallet-address${className ? ` ${className}` : ''}`, style: { '--hig-qr': `${size}px`, ...style } };
|
|
21
|
-
return onCopy
|
|
22
|
-
? _jsxs(_Fragment, { children: [_jsx("button", { type: 'button', ...shared, "aria-label": (messages.copyAddress ?? en.copyAddress) + ': ' + address, onClick: copy, children: body }), _jsx("span", { className: 'hig-sr-only', role: 'status', children: status })] })
|
|
23
|
-
: _jsx("div", { ...shared, children: body });
|
|
10
|
+
export function WalletAddress({ qrValue, arena, qr, ...props }) {
|
|
11
|
+
const code = qr ?? _jsxs(Cuer.Root, { value: qrValue ?? props.address, errorCorrection: arena ? 'high' : 'medium', color: 'currentColor', "aria-hidden": 'true', children: [_jsx(Cuer.Finder, {}), _jsx(Cuer.Cells, {}), arena && _jsx(Cuer.Arena, { children: _jsx("img", { src: arena, alt: '', style: { width: '100%', height: '100%', objectFit: 'cover', borderRadius: 1 } }) })] });
|
|
12
|
+
return _jsx(WalletAddressCore, { ...props, qr: code });
|
|
24
13
|
}
|
package/tokens/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bloxwap/hig/tokens
|
|
2
2
|
|
|
3
|
-
Version 0.
|
|
3
|
+
Version 0.7.0, an entry of `@bloxwap/hig`. See the HIG architecture and platform limitations before adoption.
|
|
4
4
|
|
|
5
5
|
`resolvePrimaryColor('#ff0000')` resolves a custom brand's `action`, `focus`, and
|
|
6
6
|
`onAction` roles. Input is opaque sRGB hex (`#RGB` or `#RRGGBB`); the foreground
|