@tempoxyz/ds 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.
- package/dist/docs/AGENTS.md +10 -6
- package/dist/docs/arsenal.md +44 -0
- package/dist/docs/marketing.md +703 -4
- package/dist/docs/product/components/actions.md +53 -1
- package/dist/docs/product/components/blockchain.md +147 -3
- package/dist/docs/product/components/feedback-and-status.md +137 -7
- package/dist/docs/product/components/navigation.md +1 -1
- package/dist/docs/product/documents.md +225 -0
- package/dist/docs/product/foundations.md +2 -1
- package/dist/docs/product/patterns.md +3 -22
- package/dist/document/Document.d.ts +46 -0
- package/dist/document/Document.d.ts.map +1 -0
- package/dist/document/Document.js +190 -0
- package/dist/document/Document.js.map +1 -0
- package/dist/document/Enhance.d.ts +13 -0
- package/dist/document/Enhance.d.ts.map +1 -0
- package/dist/document/Enhance.js +421 -0
- package/dist/document/Enhance.js.map +1 -0
- package/dist/document/bin.d.ts +3 -0
- package/dist/document/bin.d.ts.map +1 -0
- package/dist/document/bin.js +38 -0
- package/dist/document/bin.js.map +1 -0
- package/dist/document/document.css +373 -0
- package/dist/document/index.d.ts +3 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +3 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/internal/Cli.d.ts +43 -0
- package/dist/document/internal/Cli.d.ts.map +1 -0
- package/dist/document/internal/Cli.js +87 -0
- package/dist/document/internal/Cli.js.map +1 -0
- package/dist/document/internal/Template.d.ts +21 -0
- package/dist/document/internal/Template.d.ts.map +1 -0
- package/dist/document/internal/Template.js +15 -0
- package/dist/document/internal/Template.js.map +1 -0
- package/dist/document/script.d.ts +2 -0
- package/dist/document/script.d.ts.map +1 -0
- package/dist/document/script.js +379 -0
- package/dist/document/templates/brief.html +96 -0
- package/dist/document/templates/essay.html +70 -0
- package/dist/document/templates/post.html +69 -0
- package/dist/marketing/index.js.zyzz.json +1 -1
- package/dist/marketing/vars.d.ts +618 -758
- package/dist/marketing/vars.d.ts.map +1 -1
- package/dist/marketing/vars.js +8 -5
- package/dist/marketing/vars.js.map +1 -1
- package/dist/marketing/vars.js.zyzz.json +1 -1
- package/dist/marketing/zyzz.config.d.ts +3042 -3757
- package/dist/marketing/zyzz.config.d.ts.map +1 -1
- package/dist/marketing/zyzz.config.js +1 -1
- package/dist/marketing/zyzz.config.js.map +1 -1
- package/dist/marketing/zyzz.config.js.zyzz.json +1 -1
- package/dist/mobile/components/Button.d.ts +115 -15
- package/dist/mobile/components/Button.d.ts.map +1 -1
- package/dist/mobile/components/Button.js +85 -14
- package/dist/mobile/components/Button.js.map +1 -1
- package/dist/mobile/components/IconButton.d.ts +129 -40
- package/dist/mobile/components/IconButton.d.ts.map +1 -1
- package/dist/mobile/components/IconButton.js +97 -28
- package/dist/mobile/components/IconButton.js.map +1 -1
- package/dist/mobile/components/TextInput.d.ts +132 -11
- package/dist/mobile/components/TextInput.d.ts.map +1 -1
- package/dist/mobile/components/TextInput.js +115 -14
- package/dist/mobile/components/TextInput.js.map +1 -1
- package/dist/mobile/index.d.ts +1 -0
- package/dist/mobile/index.d.ts.map +1 -1
- package/dist/mobile/index.js +1 -0
- package/dist/mobile/index.js.map +1 -1
- package/dist/mobile/vars.d.ts +103 -0
- package/dist/mobile/vars.d.ts.map +1 -1
- package/dist/mobile/vars.js +74 -0
- package/dist/mobile/vars.js.map +1 -1
- package/dist/mobile/zyzz.config.d.ts +408 -0
- package/dist/mobile/zyzz.config.d.ts.map +1 -1
- package/dist/web/components/AddressCard.js.zyzz.json +1 -1
- package/dist/web/components/Amount.css +1 -1
- package/dist/web/components/Amount.d.ts +9 -0
- package/dist/web/components/Amount.d.ts.map +1 -1
- package/dist/web/components/Amount.js +8 -5
- package/dist/web/components/Amount.js.map +1 -1
- package/dist/web/components/Amount.js.zyzz.json +1 -1
- package/dist/web/components/CopyButton.d.ts +6 -0
- package/dist/web/components/CopyButton.d.ts.map +1 -1
- package/dist/web/components/CopyButton.js +4 -1
- package/dist/web/components/CopyButton.js.map +1 -1
- package/dist/web/components/CopyButton.js.zyzz.json +1 -1
- package/dist/web/components/Hex.css +1 -1
- package/dist/web/components/Hex.d.ts +84 -3
- package/dist/web/components/Hex.d.ts.map +1 -1
- package/dist/web/components/Hex.js +20 -13
- package/dist/web/components/Hex.js.map +1 -1
- package/dist/web/components/Hex.js.zyzz.json +1 -1
- package/dist/web/components/Progress.css +1 -1
- package/dist/web/components/Progress.d.ts +12 -2
- package/dist/web/components/Progress.d.ts.map +1 -1
- package/dist/web/components/Progress.js +9 -5
- package/dist/web/components/Progress.js.map +1 -1
- package/dist/web/components/Progress.js.zyzz.json +1 -1
- package/dist/web/components/SecretValue.js.zyzz.json +1 -1
- package/dist/web/components/SidebarMenu.d.ts +4 -4
- package/dist/web/components/SidebarMenu.js +6 -6
- package/dist/web/components/SidebarMenu.js.map +1 -1
- package/dist/web/components/Snippet.js.zyzz.json +1 -1
- package/dist/web/index.js.zyzz.json +1 -1
- package/package.json +19 -1
- package/src/document/Document.ts +277 -0
- package/src/document/Enhance.ts +434 -0
- package/src/document/bin.ts +38 -0
- package/src/document/document.css +373 -0
- package/src/document/index.ts +2 -0
- package/src/document/internal/Cli.ts +132 -0
- package/src/document/internal/Template.ts +25 -0
- package/src/document/script.ts +8 -0
- package/src/document/templates/brief.html +96 -0
- package/src/document/templates/essay.html +70 -0
- package/src/document/templates/post.html +69 -0
- package/src/marketing/README.md +1 -1
- package/src/marketing/vars.ts +526 -604
- package/src/marketing/zyzz.config.ts +5 -4
- package/src/mobile/README.md +19 -6
- package/src/mobile/components/Button.tsx +94 -17
- package/src/mobile/components/IconButton.tsx +122 -30
- package/src/mobile/components/TextInput.tsx +139 -24
- package/src/mobile/index.ts +1 -0
- package/src/mobile/vars.ts +74 -0
- package/src/web/components/Amount.tsx +37 -3
- package/src/web/components/CopyButton.tsx +8 -0
- package/src/web/components/Hex.tsx +79 -13
- package/src/web/components/Progress.tsx +8 -2
- package/src/web/components/SidebarMenu.tsx +6 -6
|
@@ -1232,7 +1232,7 @@ namespace styles {
|
|
|
1232
1232
|
|
|
1233
1233
|
#### Keep the Built-In Confirmation
|
|
1234
1234
|
|
|
1235
|
-
After a copy, the icon turns into a check for two seconds and screen readers announce Copied. If the clipboard refuses the write, the button shows no confirmation and
|
|
1235
|
+
After a copy, the icon turns into a check for two seconds and screen readers announce Copied. If the clipboard refuses the write, the button shows no confirmation and calls `onCopyError` instead of `onCopy`, so keep the value selectable as text.
|
|
1236
1236
|
|
|
1237
1237
|
**Do:** Let the check icon confirm the copy.
|
|
1238
1238
|
|
|
@@ -1491,6 +1491,7 @@ A copy button renders an icon-only [Button](#button) with a visually hidden stat
|
|
|
1491
1491
|
|
|
1492
1492
|
* **Name What It Copies (aria-label):** Name the value, such as "Copy address". A raw address reads poorly.
|
|
1493
1493
|
* **Announce Parent Failures (copied):** If a parent copies on its own click, announce failures from that parent.
|
|
1494
|
+
* **Recover From Failures (onCopyError):** If the clipboard refuses the write, say so and keep the value selectable.
|
|
1494
1495
|
|
|
1495
1496
|
### Related
|
|
1496
1497
|
|
|
@@ -1592,6 +1593,57 @@ export function Demo() {
|
|
|
1592
1593
|
|
|
1593
1594
|
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/CopyButton/Disabled.tsx)
|
|
1594
1595
|
|
|
1596
|
+
#### Copy Error
|
|
1597
|
+
|
|
1598
|
+
Pass `onCopyError` to show a recovery when the clipboard refuses the write. The button keeps its copy icon and name.
|
|
1599
|
+
|
|
1600
|
+
```tsx
|
|
1601
|
+
/**
|
|
1602
|
+
* CopyButton demo for the Copy Error example: a recovery message after a refused write.
|
|
1603
|
+
* @module
|
|
1604
|
+
*/
|
|
1605
|
+
import { CopyButton, style } from '@tempoxyz/ds'
|
|
1606
|
+
import { useState } from 'react'
|
|
1607
|
+
|
|
1608
|
+
const link = 'https://tempo.xyz/invite/example'
|
|
1609
|
+
|
|
1610
|
+
/** Renders a selectable value whose copy button reports a refused write. */
|
|
1611
|
+
export function Demo() {
|
|
1612
|
+
const [failed, setFailed] = useState(false)
|
|
1613
|
+
|
|
1614
|
+
return (
|
|
1615
|
+
<div {...styles.stack()}>
|
|
1616
|
+
<span {...styles.row()}>
|
|
1617
|
+
<span {...styles.value()}>{link}</span>
|
|
1618
|
+
<CopyButton
|
|
1619
|
+
aria-label="Copy invite link"
|
|
1620
|
+
onCopy={() => setFailed(false)}
|
|
1621
|
+
onCopyError={() => setFailed(true)}
|
|
1622
|
+
value={link}
|
|
1623
|
+
/>
|
|
1624
|
+
</span>
|
|
1625
|
+
{failed && (
|
|
1626
|
+
<span role="alert" {...styles.error()}>
|
|
1627
|
+
Couldn’t copy. Select the link and copy it.
|
|
1628
|
+
</span>
|
|
1629
|
+
)}
|
|
1630
|
+
</div>
|
|
1631
|
+
)
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
namespace styles {
|
|
1635
|
+
export const error = style({ color: 'content.negative', typography: 'body.b2' })
|
|
1636
|
+
|
|
1637
|
+
export const row = style({ alignItems: 'center', columnGap: '4', display: 'flex' })
|
|
1638
|
+
|
|
1639
|
+
export const stack = style({ display: 'grid', gap: '8', justifyItems: 'start' })
|
|
1640
|
+
|
|
1641
|
+
export const value = style({ color: 'content.primary', typography: 'mono.m1' })
|
|
1642
|
+
}
|
|
1643
|
+
```
|
|
1644
|
+
|
|
1645
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/CopyButton/Error.tsx)
|
|
1646
|
+
|
|
1595
1647
|
## SplitButton
|
|
1596
1648
|
|
|
1597
1649
|
Pairs a primary action with a menu of alternatives.
|
|
@@ -696,6 +696,78 @@ namespace styles {
|
|
|
696
696
|
}
|
|
697
697
|
```
|
|
698
698
|
|
|
699
|
+
#### Mask the Value, Not Its Look
|
|
700
|
+
|
|
701
|
+
Set `masked` on every amount while balances are hidden, including totals and converted values. Every masked amount shows the same six dots, which reveal neither its size nor its unit.
|
|
702
|
+
|
|
703
|
+
**Do:** Set `masked`, which renders the mask in place of the value.
|
|
704
|
+
|
|
705
|
+
```tsx
|
|
706
|
+
/**
|
|
707
|
+
* Do example for "Mask the Value, Not Its Look" on the Amount page.
|
|
708
|
+
* Set `masked`, which renders a fixed mask in place of the value.
|
|
709
|
+
* @module
|
|
710
|
+
*/
|
|
711
|
+
import { Amount, style } from '@tempoxyz/ds'
|
|
712
|
+
|
|
713
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
714
|
+
export function Demo() {
|
|
715
|
+
return (
|
|
716
|
+
<div {...styles.row()}>
|
|
717
|
+
<span {...styles.label()}>Balance</span>
|
|
718
|
+
<Amount masked size="md" symbol="PathUSD" value="1240.50" />
|
|
719
|
+
</div>
|
|
720
|
+
)
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
namespace styles {
|
|
724
|
+
export const label = style({ color: 'content.secondary', typography: 'body.b2' })
|
|
725
|
+
|
|
726
|
+
export const row = style({
|
|
727
|
+
alignItems: 'baseline',
|
|
728
|
+
display: 'flex',
|
|
729
|
+
gap: '16',
|
|
730
|
+
justifyContent: 'space-between',
|
|
731
|
+
width: '100% !custom',
|
|
732
|
+
})
|
|
733
|
+
}
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
**Don't:** Blur the amount. People can still select and copy it.
|
|
737
|
+
|
|
738
|
+
```tsx
|
|
739
|
+
/**
|
|
740
|
+
* Don't example for "Mask the Value, Not Its Look" on the Amount page.
|
|
741
|
+
* Don't blur the amount. The value stays in the page, where people can select and copy it.
|
|
742
|
+
* @module
|
|
743
|
+
*/
|
|
744
|
+
import { Amount, style } from '@tempoxyz/ds'
|
|
745
|
+
|
|
746
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
747
|
+
export function Demo() {
|
|
748
|
+
return (
|
|
749
|
+
<div {...styles.row()}>
|
|
750
|
+
<span {...styles.label()}>Balance</span>
|
|
751
|
+
<Amount {...styles.blurred()} size="md" symbol="PathUSD" value="1240.50" />
|
|
752
|
+
</div>
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
namespace styles {
|
|
757
|
+
export const blurred = style({ filter: 'blur(6px) !custom' })
|
|
758
|
+
|
|
759
|
+
export const label = style({ color: 'content.secondary', typography: 'body.b2' })
|
|
760
|
+
|
|
761
|
+
export const row = style({
|
|
762
|
+
alignItems: 'baseline',
|
|
763
|
+
display: 'flex',
|
|
764
|
+
gap: '16',
|
|
765
|
+
justifyContent: 'space-between',
|
|
766
|
+
width: '100% !custom',
|
|
767
|
+
})
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
699
771
|
#### Size by Importance
|
|
700
772
|
|
|
701
773
|
* **Small (sm):** The default, for lists, tables, and rows.
|
|
@@ -710,16 +782,18 @@ Amount renders as a block and ignores the alignment of a table cell. Set `align=
|
|
|
710
782
|
* Label each amount by its role, such as You send, Network fee, or Available balance.
|
|
711
783
|
* Don't repeat the unit in text, such as USD after $1,250.50.
|
|
712
784
|
* Don't abbreviate amounts people act on, such as 1.2K.
|
|
785
|
+
* Keep the label of a masked amount, such as Available balance, so people know what it hides.
|
|
713
786
|
|
|
714
787
|
### Accessibility
|
|
715
788
|
|
|
716
|
-
Renders a `<span>` with no role. Screen readers read the formatted text as written. How they read symbols, such as `$`, `−`, or the `<` in `<$0.01`, depends on the screen reader and its settings.
|
|
789
|
+
Renders a `<span>` with no role. Screen readers read the formatted text as written, or Hidden for a masked amount. How they read symbols, such as `$`, `−`, or the `<` in `<$0.01`, depends on the screen reader and its settings.
|
|
717
790
|
|
|
718
791
|
#### Semantics
|
|
719
792
|
|
|
720
793
|
* **Root (span):** Plain text. Screen readers read the number with its sign and unit.
|
|
721
794
|
* **Locale (locale):** Formats in `en-US`. Set `locale` to the page language for other separators.
|
|
722
795
|
* **Strikethrough (strikethrough):** Visual only. Say in text that an amount is superseded.
|
|
796
|
+
* **Masked (masked):** Reads Hidden instead of the dots. The value is absent from the page.
|
|
723
797
|
|
|
724
798
|
#### Your Responsibilities
|
|
725
799
|
|
|
@@ -961,6 +1035,31 @@ namespace styles {
|
|
|
961
1035
|
|
|
962
1036
|
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Amount/Locale.tsx)
|
|
963
1037
|
|
|
1038
|
+
#### Masked
|
|
1039
|
+
|
|
1040
|
+
Set `masked` to show six dots in place of the amount, such as while people hide their balances. The value stays out of the page, so nobody can read, select, or copy it.
|
|
1041
|
+
|
|
1042
|
+
```tsx
|
|
1043
|
+
import { Amount, style } from '@tempoxyz/ds'
|
|
1044
|
+
|
|
1045
|
+
export const fill = true
|
|
1046
|
+
export function Demo() {
|
|
1047
|
+
return (
|
|
1048
|
+
<div {...styles.stack()}>
|
|
1049
|
+
<Amount currency="USD" size="lg" value="2097.75" />
|
|
1050
|
+
<Amount currency="USD" masked size="lg" value="2097.75" />
|
|
1051
|
+
<Amount masked symbol="PathUSD" value="1240.50" />
|
|
1052
|
+
</div>
|
|
1053
|
+
)
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
namespace styles {
|
|
1057
|
+
export const stack = style({ display: 'grid', gap: '12', maxWidth: '24rem !custom' })
|
|
1058
|
+
}
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Amount/Masked.tsx)
|
|
1062
|
+
|
|
964
1063
|
## AssetChip
|
|
965
1064
|
|
|
966
1065
|
Labels a supported asset or network in a small chip, which can also pick one.
|
|
@@ -1404,6 +1503,7 @@ import { Hex } from '@tempoxyz/ds'
|
|
|
1404
1503
|
|
|
1405
1504
|
* Show an address or transaction hash in a row, table, or card where it may not fit.
|
|
1406
1505
|
* Show a receive address as a standalone field with `variant="filled"`. The whole row copies.
|
|
1506
|
+
* Show every character with `truncate={false}` where people check or select the value by hand, such as a receive address.
|
|
1407
1507
|
|
|
1408
1508
|
#### When Not to Use
|
|
1409
1509
|
|
|
@@ -1510,7 +1610,7 @@ namespace styles {
|
|
|
1510
1610
|
|
|
1511
1611
|
#### Show the Full Address Before Sending
|
|
1512
1612
|
|
|
1513
|
-
Look-alike addresses can match the first and last four characters of a real one.
|
|
1613
|
+
Look-alike addresses can match the first and last four characters of a real one. Set `truncate={false}` on a payment review so every character shows, and ask people to check it against its source.
|
|
1514
1614
|
|
|
1515
1615
|
**Do:** Show every character of the recipient on review.
|
|
1516
1616
|
|
|
@@ -1527,7 +1627,12 @@ export function Demo() {
|
|
|
1527
1627
|
return (
|
|
1528
1628
|
<div {...styles.field()}>
|
|
1529
1629
|
<span {...styles.label()}>Recipient</span>
|
|
1530
|
-
<Hex
|
|
1630
|
+
<Hex
|
|
1631
|
+
copy
|
|
1632
|
+
truncate={false}
|
|
1633
|
+
value="0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
|
|
1634
|
+
variant="filled"
|
|
1635
|
+
/>
|
|
1531
1636
|
</div>
|
|
1532
1637
|
)
|
|
1533
1638
|
}
|
|
@@ -1654,6 +1759,7 @@ namespace styles {
|
|
|
1654
1759
|
* **Inline (inline):** The default, for text, rows, and table cells.
|
|
1655
1760
|
* **Filled (filled):** A tinted field that copies on click, for standalone values.
|
|
1656
1761
|
* **No Prefix (evm={false}):** For hex values without a `0x` prefix.
|
|
1762
|
+
* **Full Value (truncate={false}):** Every character, wrapped, for values people check.
|
|
1657
1763
|
|
|
1658
1764
|
### Accessibility
|
|
1659
1765
|
|
|
@@ -1663,6 +1769,7 @@ Hex renders a `<span>` with the truncated value on screen and the full value for
|
|
|
1663
1769
|
|
|
1664
1770
|
* **Truncated Text (aria-hidden):** Hidden. Screen readers read the full value from hidden text.
|
|
1665
1771
|
* **Short Values:** Values that fit render as plain text, with no hidden copy of the value.
|
|
1772
|
+
* **Full Value (truncate={false}):** Every character renders as plain text, with no hidden copy.
|
|
1666
1773
|
* **Hex.Copy (button):** Named "Copy" and the value, or `aria-label`. A copy renames it "Copied" for two seconds and announces it.
|
|
1667
1774
|
* **Filled Variant (filled):** A click anywhere on the row copies. The button stays the keyboard path.
|
|
1668
1775
|
|
|
@@ -1782,6 +1889,43 @@ namespace styles {
|
|
|
1782
1889
|
|
|
1783
1890
|
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Hex/Copy.tsx)
|
|
1784
1891
|
|
|
1892
|
+
#### Truncate
|
|
1893
|
+
|
|
1894
|
+
Set `truncate={false}` to show every character and wrap the value across lines. A filled row grows from its height and copies only from its button, so people can select the value.
|
|
1895
|
+
|
|
1896
|
+
```tsx
|
|
1897
|
+
/**
|
|
1898
|
+
* Hex demo for the Truncate example: full values that wrap beside their copy buttons.
|
|
1899
|
+
* @module
|
|
1900
|
+
*/
|
|
1901
|
+
import { Hex, style } from '@tempoxyz/ds'
|
|
1902
|
+
|
|
1903
|
+
const address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
|
|
1904
|
+
const transaction = '0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060'
|
|
1905
|
+
|
|
1906
|
+
/** Renders an inline and a filled Hex that show every character. */
|
|
1907
|
+
export function Demo() {
|
|
1908
|
+
return (
|
|
1909
|
+
<div {...styles.stack()}>
|
|
1910
|
+
<Hex copy truncate={false} value={transaction} />
|
|
1911
|
+
<Hex copy truncate={false} value={address} variant="filled" />
|
|
1912
|
+
</div>
|
|
1913
|
+
)
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
namespace styles {
|
|
1917
|
+
export const stack = style({
|
|
1918
|
+
display: 'grid',
|
|
1919
|
+
gap: '12',
|
|
1920
|
+
justifyItems: 'start',
|
|
1921
|
+
maxWidth: '100% !custom',
|
|
1922
|
+
width: '16rem !custom',
|
|
1923
|
+
})
|
|
1924
|
+
}
|
|
1925
|
+
```
|
|
1926
|
+
|
|
1927
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Hex/Truncate.tsx)
|
|
1928
|
+
|
|
1785
1929
|
#### Evm
|
|
1786
1930
|
|
|
1787
1931
|
Set `evm={false}` for values without a `0x` prefix.
|
|
@@ -1835,7 +1835,7 @@ Figma: [Progress](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=30
|
|
|
1835
1835
|
|
|
1836
1836
|
### Overview
|
|
1837
1837
|
|
|
1838
|
-
A bar that fills in the `intent` color as a task advances, with an optional label and printed value.
|
|
1838
|
+
A bar that fills in the `intent` color as a task advances or a measurement nears its limit, with an optional label and printed value.
|
|
1839
1839
|
|
|
1840
1840
|
### Anatomy
|
|
1841
1841
|
|
|
@@ -1861,10 +1861,11 @@ import { Progress } from '@tempoxyz/ds'
|
|
|
1861
1861
|
* Count through a batch, such as 3 of 5 payments in a payout run.
|
|
1862
1862
|
* Track a long sync with a known end, such as block indexing up to the current height.
|
|
1863
1863
|
* Show an indeterminate bar for a named task of unknown length, such as a bridge deposit confirmation.
|
|
1864
|
+
* Show the share of a limit used as a meter, such as an app's daily spending limit.
|
|
1864
1865
|
|
|
1865
1866
|
#### When Not to Use
|
|
1866
1867
|
|
|
1867
|
-
* Use [Gauge](#gauge) for a measurement
|
|
1868
|
+
* Use [Gauge](#gauge) for a measurement in a compact ring, such as storage used.
|
|
1868
1869
|
* Use [Spinner](#spinner) for a short wait in a region or control.
|
|
1869
1870
|
* Use [Skeleton](#skeleton) for content with a known shape.
|
|
1870
1871
|
* Use `loading` on a [Button](actions.md#button) while its action runs.
|
|
@@ -1982,7 +1983,7 @@ namespace styles {
|
|
|
1982
1983
|
|
|
1983
1984
|
#### Move Forward Only
|
|
1984
1985
|
|
|
1985
|
-
Use an indeterminate bar for a phase you cannot measure.
|
|
1986
|
+
Use an indeterminate bar for a phase you cannot measure. A meter moves in either direction as its measurement changes.
|
|
1986
1987
|
|
|
1987
1988
|
**Do:** If a task has phases, such as upload then verification, change the label for each.
|
|
1988
1989
|
|
|
@@ -2081,13 +2082,76 @@ namespace styles {
|
|
|
2081
2082
|
#### Report the Outcome
|
|
2082
2083
|
|
|
2083
2084
|
* **Success (positive):** Set `intent` to `positive` and change the label. Then replace the bar with the result, such as a link to the file.
|
|
2084
|
-
* **Failure (Alert):**
|
|
2085
|
+
* **Failure (Alert):** Don't turn the bar `negative` for a failed task. Replace it with a `negative` [Alert](#alert) that offers Retry.
|
|
2086
|
+
|
|
2087
|
+
#### State the Reading in Text
|
|
2088
|
+
|
|
2089
|
+
The `warning` and `negative` intents add color, which not every reader perceives.
|
|
2090
|
+
|
|
2091
|
+
**Do:** Print the amount in `Progress.Value`, such as $90.00 of a daily limit.
|
|
2092
|
+
|
|
2093
|
+
```tsx
|
|
2094
|
+
/** Do example for "State the Reading in Text" on the Progress page: print the amount. @module */
|
|
2095
|
+
import { Progress, style } from '@tempoxyz/ds'
|
|
2096
|
+
|
|
2097
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
2098
|
+
export function Demo() {
|
|
2099
|
+
return (
|
|
2100
|
+
<Progress.Root
|
|
2101
|
+
format={{ currency: 'USD', style: 'currency' }}
|
|
2102
|
+
intent="warning"
|
|
2103
|
+
role="meter"
|
|
2104
|
+
value={90}
|
|
2105
|
+
{...styles.progress()}
|
|
2106
|
+
>
|
|
2107
|
+
<Progress.Label>Daily limit</Progress.Label>
|
|
2108
|
+
<Progress.Value />
|
|
2109
|
+
<Progress.Track>
|
|
2110
|
+
<Progress.Indicator />
|
|
2111
|
+
</Progress.Track>
|
|
2112
|
+
</Progress.Root>
|
|
2113
|
+
)
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
namespace styles {
|
|
2117
|
+
export const progress = style({ maxWidth: '20rem !custom' })
|
|
2118
|
+
}
|
|
2119
|
+
```
|
|
2120
|
+
|
|
2121
|
+
**Don't:** Rely on the `warning` color alone to report a low limit.
|
|
2122
|
+
|
|
2123
|
+
```tsx
|
|
2124
|
+
/** Don't example for "State the Reading in Text" on the Progress page: color alone. @module */
|
|
2125
|
+
import { Progress, style } from '@tempoxyz/ds'
|
|
2126
|
+
|
|
2127
|
+
/** Renders the static preview, which the guideline card shows inert. */
|
|
2128
|
+
export function Demo() {
|
|
2129
|
+
return (
|
|
2130
|
+
<Progress.Root
|
|
2131
|
+
aria-label="Daily limit"
|
|
2132
|
+
intent="warning"
|
|
2133
|
+
role="meter"
|
|
2134
|
+
value={90}
|
|
2135
|
+
{...styles.progress()}
|
|
2136
|
+
>
|
|
2137
|
+
<Progress.Track>
|
|
2138
|
+
<Progress.Indicator />
|
|
2139
|
+
</Progress.Track>
|
|
2140
|
+
</Progress.Root>
|
|
2141
|
+
)
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
namespace styles {
|
|
2145
|
+
export const progress = style({ maxWidth: '20rem !custom' })
|
|
2146
|
+
}
|
|
2147
|
+
```
|
|
2085
2148
|
|
|
2086
2149
|
### Content
|
|
2087
2150
|
|
|
2088
2151
|
* **Label:** A verb ending in -ing and its object, such as Uploading payouts.csv.
|
|
2089
2152
|
* **Units:** If a percentage hides the size of the job, count files, payments, or blocks.
|
|
2090
2153
|
* **Time estimate:** Add one only when it is reliable, and round it, such as About 2 minutes left.
|
|
2154
|
+
* **Meter value:** State the amount and its limit, such as $90.00 of $100.00 per week.
|
|
2091
2155
|
|
|
2092
2156
|
### Accessibility
|
|
2093
2157
|
|
|
@@ -2100,6 +2164,7 @@ The bar is not a live region. A changed value is read only when the reader retur
|
|
|
2100
2164
|
* **Progress.Label (aria-labelledby):** Names the bar.
|
|
2101
2165
|
* **Progress.Value (aria-hidden):** Screen readers skip it and read the value text once.
|
|
2102
2166
|
* **Indeterminate Bars (value={null}):** Reports no current value. Under reduced motion, the sliding segment becomes a dimmed full bar.
|
|
2167
|
+
* **Meters (role="meter"):** Reports a measurement, such as a limit used, with the same range, value, and label.
|
|
2103
2168
|
|
|
2104
2169
|
#### Your Responsibilities
|
|
2105
2170
|
|
|
@@ -2111,7 +2176,7 @@ The bar is not a live region. A changed value is read only when the reader retur
|
|
|
2111
2176
|
|
|
2112
2177
|
[Gauge](#gauge)
|
|
2113
2178
|
|
|
2114
|
-
Use for a measurement
|
|
2179
|
+
Use for a measurement in a compact ring.
|
|
2115
2180
|
|
|
2116
2181
|
[Spinner](#spinner)
|
|
2117
2182
|
|
|
@@ -2154,7 +2219,7 @@ namespace styles {
|
|
|
2154
2219
|
|
|
2155
2220
|
#### Intent
|
|
2156
2221
|
|
|
2157
|
-
Set `intent` to `neutral` (default) or `
|
|
2222
|
+
Set `intent` to `neutral` (default), `positive`, `warning`, or `negative`. Use `warning` and `negative` for a meter that nears or reaches its limit.
|
|
2158
2223
|
|
|
2159
2224
|
```tsx
|
|
2160
2225
|
import { Progress, style } from '@tempoxyz/ds'
|
|
@@ -2163,7 +2228,7 @@ export const fill = true
|
|
|
2163
2228
|
export function Demo() {
|
|
2164
2229
|
return (
|
|
2165
2230
|
<div {...styles.stack()}>
|
|
2166
|
-
{(['neutral', 'positive'] as const).map((intent, index) => (
|
|
2231
|
+
{(['neutral', 'positive', 'warning', 'negative'] as const).map((intent, index) => (
|
|
2167
2232
|
<Progress.Root intent={intent} key={intent} value={20 + index * 20}>
|
|
2168
2233
|
<Progress.Label>{intent}</Progress.Label>
|
|
2169
2234
|
<Progress.Value />
|
|
@@ -2214,6 +2279,71 @@ namespace styles {
|
|
|
2214
2279
|
|
|
2215
2280
|
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Progress/Value.tsx)
|
|
2216
2281
|
|
|
2282
|
+
#### Meter
|
|
2283
|
+
|
|
2284
|
+
If the bar shows a measurement against a limit, such as the share of a spending limit used, pass `role="meter"`. Pass `getAriaValueText` to read the limit too.
|
|
2285
|
+
|
|
2286
|
+
```tsx
|
|
2287
|
+
import { Progress, style } from '@tempoxyz/ds'
|
|
2288
|
+
|
|
2289
|
+
export const fill = true
|
|
2290
|
+
export function Demo() {
|
|
2291
|
+
return (
|
|
2292
|
+
<div {...styles.stack()}>
|
|
2293
|
+
<Progress.Root
|
|
2294
|
+
format={{ currency: 'USD', style: 'currency' }}
|
|
2295
|
+
getAriaValueText={(value) => `${value} of $100.00 per day`}
|
|
2296
|
+
role="meter"
|
|
2297
|
+
value={20}
|
|
2298
|
+
>
|
|
2299
|
+
<Progress.Label>Daily limit</Progress.Label>
|
|
2300
|
+
<Progress.Value />
|
|
2301
|
+
<Progress.Track>
|
|
2302
|
+
<Progress.Indicator />
|
|
2303
|
+
</Progress.Track>
|
|
2304
|
+
</Progress.Root>
|
|
2305
|
+
<Progress.Root
|
|
2306
|
+
format={{ currency: 'USD', style: 'currency' }}
|
|
2307
|
+
getAriaValueText={(value) => `${value} of $100.00 per week`}
|
|
2308
|
+
intent="warning"
|
|
2309
|
+
role="meter"
|
|
2310
|
+
value={90}
|
|
2311
|
+
>
|
|
2312
|
+
<Progress.Label>Weekly limit</Progress.Label>
|
|
2313
|
+
<Progress.Value />
|
|
2314
|
+
<Progress.Track>
|
|
2315
|
+
<Progress.Indicator />
|
|
2316
|
+
</Progress.Track>
|
|
2317
|
+
</Progress.Root>
|
|
2318
|
+
<Progress.Root
|
|
2319
|
+
format={{ currency: 'USD', style: 'currency' }}
|
|
2320
|
+
getAriaValueText={(value) => `${value} of $100.00 per month`}
|
|
2321
|
+
intent="negative"
|
|
2322
|
+
role="meter"
|
|
2323
|
+
value={100}
|
|
2324
|
+
>
|
|
2325
|
+
<Progress.Label>Monthly limit</Progress.Label>
|
|
2326
|
+
<Progress.Value />
|
|
2327
|
+
<Progress.Track>
|
|
2328
|
+
<Progress.Indicator />
|
|
2329
|
+
</Progress.Track>
|
|
2330
|
+
</Progress.Root>
|
|
2331
|
+
</div>
|
|
2332
|
+
)
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
namespace styles {
|
|
2336
|
+
export const stack = style({
|
|
2337
|
+
display: 'flex',
|
|
2338
|
+
flexDirection: 'column',
|
|
2339
|
+
gap: '16',
|
|
2340
|
+
maxWidth: '24rem !custom',
|
|
2341
|
+
})
|
|
2342
|
+
}
|
|
2343
|
+
```
|
|
2344
|
+
|
|
2345
|
+
[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/Progress/Meter.tsx)
|
|
2346
|
+
|
|
2217
2347
|
## Skeleton
|
|
2218
2348
|
|
|
2219
2349
|
Holds the place of content while it loads.
|
|
@@ -1730,7 +1730,7 @@ namespace styles {
|
|
|
1730
1730
|
|
|
1731
1731
|
#### Account Row
|
|
1732
1732
|
|
|
1733
|
-
Render a `SidebarMenu.AccountRow` in a `SidebarMenu.Account`, which draws the divider above it at the bottom of the sidebar. Pass the row to `Menu.Trigger` through `render` to open the account menu. The row ends in
|
|
1733
|
+
Render a `SidebarMenu.AccountRow` in a `SidebarMenu.Account`, which draws the divider above it at the bottom of the sidebar. Pass the row to `Menu.Trigger` through `render` to open the account menu. The row ends in an up and down chevron only while it opens a menu.
|
|
1734
1734
|
|
|
1735
1735
|
```tsx
|
|
1736
1736
|
/** Shows the account row at the bottom of a sidebar, under its divider, opening the account menu. @module */
|