@ornikar/bumper 3.6.2 → 3.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/CHANGELOG.md +9 -0
- package/dist/definitions/system/actions/Button/Button.d.ts +3 -3
- package/dist/definitions/system/actions/IconButton/IconButton.d.ts +1 -1
- package/dist/definitions/system/content/icon/Icon.d.ts +1 -1
- package/dist/definitions/system/content/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/system/types.d.ts +13 -2
- package/dist/definitions/system/types.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +2 -1
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +2 -1
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.22.cjs.js +2 -1
- package/dist/index-node-22.22.cjs.js.map +1 -1
- package/dist/index-node-22.22.cjs.web.js +2 -1
- package/dist/index-node-22.22.cjs.web.js.map +1 -1
- package/dist/index-node-22.22.es.mjs +2 -1
- package/dist/index-node-22.22.es.mjs.map +1 -1
- package/dist/index-node-22.22.es.web.mjs +2 -1
- package/dist/index-node-22.22.es.web.mjs.map +1 -1
- package/dist/index.es.js +2 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +2 -1
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Bumper.mdx +5 -0
- package/src/system/actions/Button/Button.features.stories.tsx +13 -0
- package/src/system/actions/Button/Button.mdx +86 -0
- package/src/system/actions/Button/Button.stories.tsx +0 -1
- package/src/system/actions/Button/__snapshots__/Button.features.stories.tsx.snap +166 -0
- package/src/system/actions/Button/__snapshots_web__/Button.features.stories.tsx.snap +60 -0
- package/src/system/actions/IconButton/IconButton.features.stories.tsx +8 -0
- package/src/system/actions/IconButton/IconButton.mdx +74 -0
- package/src/system/actions/IconButton/IconButton.stories.tsx +0 -1
- package/src/system/actions/IconButton/__snapshots__/IconButton.features.stories.tsx.snap +76 -0
- package/src/system/actions/IconButton/__snapshots_web__/IconButton.features.stories.tsx.snap +39 -0
- package/src/system/content/icon/Icon.features.stories.tsx +12 -0
- package/src/system/content/icon/__snapshots__/Icon.features.stories.tsx.snap +28 -0
- package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +32 -0
- package/src/system/content/typography/Typography.features.stories.tsx +8 -0
- package/src/system/content/typography/Typography.tsx +3 -1
- package/src/system/content/typography/TypographyIcon.features.stories.tsx +9 -0
- package/src/system/content/typography/TypographyLink.features.stories.tsx +9 -0
- package/src/system/content/typography/__snapshots__/Typography.features.stories.tsx.snap +29 -0
- package/src/system/content/typography/__snapshots__/TypographyIcon.features.stories.tsx.snap +45 -0
- package/src/system/content/typography/__snapshots__/TypographyLink.features.stories.tsx.snap +55 -0
- package/src/system/content/typography/__snapshots_web__/Typography.features.stories.tsx.snap +29 -0
- package/src/system/content/typography/__snapshots_web__/TypographyIcon.features.stories.tsx.snap +41 -0
- package/src/system/content/typography/__snapshots_web__/TypographyLink.features.stories.tsx.snap +36 -0
- package/src/system/core/primitives/Center.features.stories.tsx +17 -0
- package/src/system/core/primitives/Pressable.features.stories.tsx +18 -0
- package/src/system/core/primitives/ScrollView/ScrollView.features.stories.tsx +14 -0
- package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.features.stories.tsx.snap +350 -0
- package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.features.stories.tsx.snap +130 -0
- package/src/system/core/primitives/Stack.features.stories.tsx +29 -0
- package/src/system/core/primitives/View.features.stories.tsx +30 -0
- package/src/system/core/primitives/__snapshots__/Center.features.stories.tsx.snap +50 -0
- package/src/system/core/primitives/__snapshots__/Pressable.features.stories.tsx.snap +60 -0
- package/src/system/core/primitives/__snapshots__/Stack.features.stories.tsx.snap +126 -0
- package/src/system/core/primitives/__snapshots__/View.features.stories.tsx.snap +126 -0
- package/src/system/core/primitives/__snapshots_web__/Center.features.stories.tsx.snap +34 -1
- package/src/system/core/primitives/__snapshots_web__/Pressable.features.stories.tsx.snap +35 -0
- package/src/system/core/primitives/__snapshots_web__/Stack.features.stories.tsx.snap +55 -0
- package/src/system/core/primitives/__snapshots_web__/View.features.stories.tsx.snap +55 -0
- package/src/system/dataDisplays/Badge/Badge.features.stories.tsx +10 -0
- package/src/system/dataDisplays/Badge/__snapshots__/Badge.features.stories.tsx.snap +30 -0
- package/src/system/dataDisplays/Badge/__snapshots_web__/Badge.features.stories.tsx.snap +27 -0
- package/src/system/types.ts +14 -3
package/package.json
CHANGED
package/src/Bumper.mdx
CHANGED
|
@@ -27,6 +27,11 @@ spacing, color, radius, and typography.
|
|
|
27
27
|
- [TypographyLink](?path=/docs/bumper-content-typographylink--docs) — Interactive link with underline and disabled states.
|
|
28
28
|
- [Icon](?path=/docs/bumper-content-icon--docs) — Standalone icon wrapper. Color and size via tokens.
|
|
29
29
|
|
|
30
|
+
## Actions
|
|
31
|
+
|
|
32
|
+
- [Button](?path=/docs/bumper-actions-button--docs) — Primary action component with text, icon, and badge slots.
|
|
33
|
+
- [IconButton](?path=/docs/bumper-actions-iconbutton--docs) — Square icon-only button for toolbar actions and compact layouts.
|
|
34
|
+
|
|
30
35
|
## Data Displays
|
|
31
36
|
|
|
32
37
|
- [Badge](?path=/docs/bumper-data-displays-badge--docs) — Numeric count or dot indicator.
|
|
@@ -220,3 +220,16 @@ export const StateFocusVisible: Story = {
|
|
|
220
220
|
</HStack>
|
|
221
221
|
),
|
|
222
222
|
};
|
|
223
|
+
|
|
224
|
+
export const Responsive: Story = {
|
|
225
|
+
render: () => (
|
|
226
|
+
<VStack gap="$space.16">
|
|
227
|
+
<Button stretch size="small" $medium={{ stretch: false, size: 'small' }}>
|
|
228
|
+
<Button.Text>Small stretched → Large non-stretched</Button.Text>
|
|
229
|
+
</Button>
|
|
230
|
+
<Button stretch type="secondary" size="small" $medium={{ size: 'large', stretch: false }}>
|
|
231
|
+
<Button.Text>Small stretched → Large non-stretched</Button.Text>
|
|
232
|
+
</Button>
|
|
233
|
+
</VStack>
|
|
234
|
+
),
|
|
235
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Primary, Controls, Canvas } from '@storybook/blocks';
|
|
2
|
+
import * as ButtonStories from './Button.stories';
|
|
3
|
+
import * as ButtonFeatures from './Button.features.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={ButtonStories} />
|
|
6
|
+
<Title />
|
|
7
|
+
<Subtitle />
|
|
8
|
+
|
|
9
|
+
<Primary />
|
|
10
|
+
<Controls />
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
`Button` is the primary action component. It uses a compound API — compose `Button.Text`, `Button.Icon`, and `Button.Badge` as children to build the button content. Defaults to `type="secondary"` and `size="large"`.
|
|
15
|
+
|
|
16
|
+
## Types
|
|
17
|
+
|
|
18
|
+
Use `type` to communicate the intent of the action. `primary` for the main call-to-action, `secondary` for alternative actions, `tertiary` for low-emphasis actions, and `danger` for destructive operations.
|
|
19
|
+
|
|
20
|
+
<Canvas of={ButtonFeatures.Types} />
|
|
21
|
+
|
|
22
|
+
## Sizes
|
|
23
|
+
|
|
24
|
+
`Button` comes in `large` (48px, default) and `small` (36px). Use `small` in compact layouts like table rows or inline toolbars.
|
|
25
|
+
|
|
26
|
+
<Canvas of={ButtonFeatures.Sizes} />
|
|
27
|
+
|
|
28
|
+
## With icon
|
|
29
|
+
|
|
30
|
+
Add `Button.Icon` before `Button.Text` to pair an icon with the label. The icon color automatically adapts to the button `type`.
|
|
31
|
+
|
|
32
|
+
<Canvas of={ButtonFeatures.WithIcon} />
|
|
33
|
+
|
|
34
|
+
## With badge
|
|
35
|
+
|
|
36
|
+
Append `Button.Badge` after `Button.Text` to surface a count or dot indicator. Pass `count` for a number, or omit it for a simple dot. Use `maxCount` to cap the displayed value (e.g. `99+`).
|
|
37
|
+
|
|
38
|
+
<Canvas of={ButtonFeatures.WithBadge} />
|
|
39
|
+
|
|
40
|
+
## Disabled
|
|
41
|
+
|
|
42
|
+
Set `disabled` to prevent interaction. Pointer events and focus are removed, and `aria-disabled` is set. The visual treatment differs by type — `primary` uses `$bg.disabled.mid`, while `secondary` and `danger` show a `$border.disabled` outline.
|
|
43
|
+
|
|
44
|
+
<Canvas of={ButtonFeatures.Disabled} />
|
|
45
|
+
|
|
46
|
+
## Loading
|
|
47
|
+
|
|
48
|
+
Set `isLoading` to replace the button content with a `Loader` spinner. The button preserves its original dimensions by hiding (not unmounting) its children, preventing layout shifts.
|
|
49
|
+
|
|
50
|
+
<Canvas of={ButtonFeatures.Loading} />
|
|
51
|
+
|
|
52
|
+
## Stretch
|
|
53
|
+
|
|
54
|
+
Set `stretch` to make the button fill the width of its container. The button switches from `align-self: flex-start` to `flex-grow: 1`.
|
|
55
|
+
|
|
56
|
+
<Canvas of={ButtonFeatures.Stretch} />
|
|
57
|
+
|
|
58
|
+
## On contrasted backgrounds
|
|
59
|
+
|
|
60
|
+
Set `isOnContrasted` when the button sits on a dark or accent background. This switches to the `onContrasted` token variants for background and border colors so the button remains legible.
|
|
61
|
+
|
|
62
|
+
<Canvas of={ButtonFeatures.OnContrasted} />
|
|
63
|
+
|
|
64
|
+
## Interaction states
|
|
65
|
+
|
|
66
|
+
### Hover
|
|
67
|
+
|
|
68
|
+
<Canvas of={ButtonFeatures.StateHover} />
|
|
69
|
+
|
|
70
|
+
### Press
|
|
71
|
+
|
|
72
|
+
<Canvas of={ButtonFeatures.StatePress} />
|
|
73
|
+
|
|
74
|
+
### Focus visible
|
|
75
|
+
|
|
76
|
+
<Canvas of={ButtonFeatures.StateFocusVisible} />
|
|
77
|
+
|
|
78
|
+
## Responsive
|
|
79
|
+
|
|
80
|
+
All props support responsive overrides via Tamagui media query props (`$medium`, `$large`, etc.). Use this to adapt size, stretch, or type across breakpoints.
|
|
81
|
+
|
|
82
|
+
<Canvas of={ButtonFeatures.Responsive} />
|
|
83
|
+
|
|
84
|
+
## Related
|
|
85
|
+
|
|
86
|
+
- [IconButton](?path=/docs/bumper-actions-iconbutton--docs)
|
|
@@ -1642,6 +1642,172 @@ exports[`Bumper/Actions/Button/Features OnContrasted 1`] = `
|
|
|
1642
1642
|
</RNCSafeAreaProvider>
|
|
1643
1643
|
`;
|
|
1644
1644
|
|
|
1645
|
+
exports[`Bumper/Actions/Button/Features Responsive 1`] = `
|
|
1646
|
+
<RNCSafeAreaProvider
|
|
1647
|
+
onInsetsChange={[Function]}
|
|
1648
|
+
style={
|
|
1649
|
+
[
|
|
1650
|
+
{
|
|
1651
|
+
"flex": 1,
|
|
1652
|
+
},
|
|
1653
|
+
undefined,
|
|
1654
|
+
]
|
|
1655
|
+
}
|
|
1656
|
+
>
|
|
1657
|
+
<View
|
|
1658
|
+
style={
|
|
1659
|
+
{
|
|
1660
|
+
"flexDirection": "column",
|
|
1661
|
+
"gap": 16,
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
>
|
|
1665
|
+
<View
|
|
1666
|
+
focusVisibleStyle={
|
|
1667
|
+
{
|
|
1668
|
+
"outlineColor": "$border.focus",
|
|
1669
|
+
"outlineStyle": "solid",
|
|
1670
|
+
"outlineWidth": 3,
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
onBlur={[Function]}
|
|
1674
|
+
onClick={[Function]}
|
|
1675
|
+
onFocus={[Function]}
|
|
1676
|
+
onResponderGrant={[Function]}
|
|
1677
|
+
onResponderMove={[Function]}
|
|
1678
|
+
onResponderRelease={[Function]}
|
|
1679
|
+
onResponderTerminate={[Function]}
|
|
1680
|
+
onResponderTerminationRequest={[Function]}
|
|
1681
|
+
onStartShouldSetResponder={[Function]}
|
|
1682
|
+
role="button"
|
|
1683
|
+
style={
|
|
1684
|
+
{
|
|
1685
|
+
"alignItems": "center",
|
|
1686
|
+
"alignSelf": "unset",
|
|
1687
|
+
"backgroundColor": "transparent",
|
|
1688
|
+
"borderBottomColor": "#563B56",
|
|
1689
|
+
"borderBottomLeftRadius": 4,
|
|
1690
|
+
"borderBottomRightRadius": 4,
|
|
1691
|
+
"borderBottomWidth": 1,
|
|
1692
|
+
"borderLeftColor": "#563B56",
|
|
1693
|
+
"borderLeftWidth": 1,
|
|
1694
|
+
"borderRightColor": "#563B56",
|
|
1695
|
+
"borderRightWidth": 1,
|
|
1696
|
+
"borderStyle": "solid",
|
|
1697
|
+
"borderTopColor": "#563B56",
|
|
1698
|
+
"borderTopLeftRadius": 4,
|
|
1699
|
+
"borderTopRightRadius": 4,
|
|
1700
|
+
"borderTopWidth": 1,
|
|
1701
|
+
"flexDirection": "row",
|
|
1702
|
+
"flexGrow": 1,
|
|
1703
|
+
"gap": 8,
|
|
1704
|
+
"height": 36,
|
|
1705
|
+
"justifyContent": "center",
|
|
1706
|
+
"paddingBottom": 8,
|
|
1707
|
+
"paddingLeft": 12,
|
|
1708
|
+
"paddingRight": 12,
|
|
1709
|
+
"paddingTop": 8,
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
>
|
|
1713
|
+
<View
|
|
1714
|
+
style={
|
|
1715
|
+
{
|
|
1716
|
+
"flexDirection": "column",
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
>
|
|
1720
|
+
<Text
|
|
1721
|
+
style={
|
|
1722
|
+
{
|
|
1723
|
+
"color": "#563B56",
|
|
1724
|
+
"fontFamily": "GTStandardSemibold",
|
|
1725
|
+
"fontSize": 14,
|
|
1726
|
+
"letterSpacing": 0,
|
|
1727
|
+
"lineHeight": 18,
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
suppressHighlighting={true}
|
|
1731
|
+
>
|
|
1732
|
+
Small stretched → Large non-stretched
|
|
1733
|
+
</Text>
|
|
1734
|
+
</View>
|
|
1735
|
+
</View>
|
|
1736
|
+
<View
|
|
1737
|
+
focusVisibleStyle={
|
|
1738
|
+
{
|
|
1739
|
+
"outlineColor": "$border.focus",
|
|
1740
|
+
"outlineStyle": "solid",
|
|
1741
|
+
"outlineWidth": 3,
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
onBlur={[Function]}
|
|
1745
|
+
onClick={[Function]}
|
|
1746
|
+
onFocus={[Function]}
|
|
1747
|
+
onResponderGrant={[Function]}
|
|
1748
|
+
onResponderMove={[Function]}
|
|
1749
|
+
onResponderRelease={[Function]}
|
|
1750
|
+
onResponderTerminate={[Function]}
|
|
1751
|
+
onResponderTerminationRequest={[Function]}
|
|
1752
|
+
onStartShouldSetResponder={[Function]}
|
|
1753
|
+
role="button"
|
|
1754
|
+
style={
|
|
1755
|
+
{
|
|
1756
|
+
"alignItems": "center",
|
|
1757
|
+
"alignSelf": "unset",
|
|
1758
|
+
"backgroundColor": "transparent",
|
|
1759
|
+
"borderBottomColor": "#563B56",
|
|
1760
|
+
"borderBottomLeftRadius": 4,
|
|
1761
|
+
"borderBottomRightRadius": 4,
|
|
1762
|
+
"borderBottomWidth": 1,
|
|
1763
|
+
"borderLeftColor": "#563B56",
|
|
1764
|
+
"borderLeftWidth": 1,
|
|
1765
|
+
"borderRightColor": "#563B56",
|
|
1766
|
+
"borderRightWidth": 1,
|
|
1767
|
+
"borderStyle": "solid",
|
|
1768
|
+
"borderTopColor": "#563B56",
|
|
1769
|
+
"borderTopLeftRadius": 4,
|
|
1770
|
+
"borderTopRightRadius": 4,
|
|
1771
|
+
"borderTopWidth": 1,
|
|
1772
|
+
"flexDirection": "row",
|
|
1773
|
+
"flexGrow": 1,
|
|
1774
|
+
"gap": 8,
|
|
1775
|
+
"height": 36,
|
|
1776
|
+
"justifyContent": "center",
|
|
1777
|
+
"paddingBottom": 8,
|
|
1778
|
+
"paddingLeft": 12,
|
|
1779
|
+
"paddingRight": 12,
|
|
1780
|
+
"paddingTop": 8,
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
>
|
|
1784
|
+
<View
|
|
1785
|
+
style={
|
|
1786
|
+
{
|
|
1787
|
+
"flexDirection": "column",
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
>
|
|
1791
|
+
<Text
|
|
1792
|
+
style={
|
|
1793
|
+
{
|
|
1794
|
+
"color": "#563B56",
|
|
1795
|
+
"fontFamily": "GTStandardSemibold",
|
|
1796
|
+
"fontSize": 14,
|
|
1797
|
+
"letterSpacing": 0,
|
|
1798
|
+
"lineHeight": 18,
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
suppressHighlighting={true}
|
|
1802
|
+
>
|
|
1803
|
+
Small stretched → Large non-stretched
|
|
1804
|
+
</Text>
|
|
1805
|
+
</View>
|
|
1806
|
+
</View>
|
|
1807
|
+
</View>
|
|
1808
|
+
</RNCSafeAreaProvider>
|
|
1809
|
+
`;
|
|
1810
|
+
|
|
1645
1811
|
exports[`Bumper/Actions/Button/Features Sizes 1`] = `
|
|
1646
1812
|
<RNCSafeAreaProvider
|
|
1647
1813
|
onInsetsChange={[Function]}
|
|
@@ -494,6 +494,66 @@ exports[`Bumper/Actions/Button/Features OnContrasted 1`] = `
|
|
|
494
494
|
</DocumentFragment>
|
|
495
495
|
`;
|
|
496
496
|
|
|
497
|
+
exports[`Bumper/Actions/Button/Features Responsive 1`] = `
|
|
498
|
+
<DocumentFragment>
|
|
499
|
+
<div
|
|
500
|
+
class="css-view-g5y9jx r-flex-13awgt0"
|
|
501
|
+
>
|
|
502
|
+
<span
|
|
503
|
+
class=""
|
|
504
|
+
style="display: contents;"
|
|
505
|
+
>
|
|
506
|
+
<span
|
|
507
|
+
class=" "
|
|
508
|
+
style="display: contents;"
|
|
509
|
+
>
|
|
510
|
+
<span
|
|
511
|
+
class=" t_light is_Theme"
|
|
512
|
+
style="display: contents;"
|
|
513
|
+
>
|
|
514
|
+
<div
|
|
515
|
+
class="is_VStack _dsp-flex _alignItems-stretch _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-column _gap-t-space-spa1366020313"
|
|
516
|
+
>
|
|
517
|
+
<div
|
|
518
|
+
class="is_Button _outlineWidth-0focus-visible-3px _outlineColor-0focus-visible-border--foc3742 _outlineStyle-0focus-visible-solid _backgroundColor-0hover-button--bg-1610009989 _backgroundColor-0active-button--bg-1610009989 _dsp-flex _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-row _alignItems-center _justifyContent-center _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410 _alignSelf-unset _gap-t-space-spa94482166 _cur-pointer _btc-border--bas1187721777 _brc-border--bas1187721777 _borderBottomColor-border--bas1187721777 _borderLeftColor-border--bas1187721777 _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _backgroundColor-button--bg-253058202 _borderBottomStyle-solid _borderTopStyle-solid _borderLeftStyle-solid _borderRightStyle-solid _flexGrow-1 _height-36px _paddingRight-12px _paddingLeft-12px _paddingTop-8px _paddingBottom-8px"
|
|
519
|
+
data-disable-theme="true"
|
|
520
|
+
role="button"
|
|
521
|
+
tabindex="0"
|
|
522
|
+
>
|
|
523
|
+
<div
|
|
524
|
+
class="is_VStack _dsp-flex _alignItems-stretch _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-column"
|
|
525
|
+
>
|
|
526
|
+
<span
|
|
527
|
+
class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-labe105292 _lh-f-lineHeigh1842530171 _ls-f-letterSpa379059034 _fw-f-weight-se1074390495 _col-content--ac3049896"
|
|
528
|
+
>
|
|
529
|
+
Small stretched → Large non-stretched
|
|
530
|
+
</span>
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
<div
|
|
534
|
+
class="is_Button _outlineWidth-0focus-visible-3px _outlineColor-0focus-visible-border--foc3742 _outlineStyle-0focus-visible-solid _backgroundColor-0hover-button--bg-1610009989 _backgroundColor-0active-button--bg-1610009989 _dsp-flex _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-row _alignItems-center _justifyContent-center _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410 _alignSelf-unset _gap-t-space-spa94482166 _cur-pointer _btc-border--bas1187721777 _brc-border--bas1187721777 _borderBottomColor-border--bas1187721777 _borderLeftColor-border--bas1187721777 _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _flexGrow-1 _backgroundColor-button--bg-253058202 _borderBottomStyle-solid _borderTopStyle-solid _borderLeftStyle-solid _borderRightStyle-solid _height-36px _paddingRight-12px _paddingLeft-12px _paddingTop-8px _paddingBottom-8px"
|
|
535
|
+
data-disable-theme="true"
|
|
536
|
+
role="button"
|
|
537
|
+
tabindex="0"
|
|
538
|
+
>
|
|
539
|
+
<div
|
|
540
|
+
class="is_VStack _dsp-flex _alignItems-stretch _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-column"
|
|
541
|
+
>
|
|
542
|
+
<span
|
|
543
|
+
class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-labe105292 _lh-f-lineHeigh1842530171 _ls-f-letterSpa379059034 _fw-f-weight-se1074390495 _col-content--ac3049896"
|
|
544
|
+
>
|
|
545
|
+
Small stretched → Large non-stretched
|
|
546
|
+
</span>
|
|
547
|
+
</div>
|
|
548
|
+
</div>
|
|
549
|
+
</div>
|
|
550
|
+
</span>
|
|
551
|
+
</span>
|
|
552
|
+
</span>
|
|
553
|
+
</div>
|
|
554
|
+
</DocumentFragment>
|
|
555
|
+
`;
|
|
556
|
+
|
|
497
557
|
exports[`Bumper/Actions/Button/Features Sizes 1`] = `
|
|
498
558
|
<DocumentFragment>
|
|
499
559
|
<div
|
|
@@ -184,3 +184,11 @@ export const StateFocusVisible: Story = {
|
|
|
184
184
|
</HStack>
|
|
185
185
|
),
|
|
186
186
|
};
|
|
187
|
+
|
|
188
|
+
export const Responsive: Story = {
|
|
189
|
+
render: () => (
|
|
190
|
+
<IconButton size="small" $medium={{ size: 'large' }}>
|
|
191
|
+
<IconButton.Icon icon={<StarIcon />} />
|
|
192
|
+
</IconButton>
|
|
193
|
+
),
|
|
194
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Primary, Controls, Canvas } from '@storybook/blocks';
|
|
2
|
+
import * as IconButtonStories from './IconButton.stories';
|
|
3
|
+
import * as IconButtonFeatures from './IconButton.features.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={IconButtonStories} />
|
|
6
|
+
<Title />
|
|
7
|
+
<Subtitle />
|
|
8
|
+
|
|
9
|
+
<Primary />
|
|
10
|
+
<Controls />
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
`IconButton` is a square button that contains only an icon — no text label. It extends `Button` internally but removes the `stretch` prop and adjusts padding to produce a square hit target. Use it for toolbar actions, close buttons, or anywhere a label would add unnecessary noise. Compose with `IconButton.Icon` and optionally `IconButton.Badge`.
|
|
15
|
+
|
|
16
|
+
## Types
|
|
17
|
+
|
|
18
|
+
Use `type` to set the visual intent: `primary`, `secondary` (default), `tertiary`, or `danger`.
|
|
19
|
+
|
|
20
|
+
<Canvas of={IconButtonFeatures.Types} />
|
|
21
|
+
|
|
22
|
+
## Sizes
|
|
23
|
+
|
|
24
|
+
`IconButton` comes in `large` (48px, default) and `small` (36px). Both produce a square button with equal horizontal and vertical padding.
|
|
25
|
+
|
|
26
|
+
<Canvas of={IconButtonFeatures.Sizes} />
|
|
27
|
+
|
|
28
|
+
## With badge
|
|
29
|
+
|
|
30
|
+
Append `IconButton.Badge` to overlay a count or dot indicator on the button. Pass `count` for a number, or omit it for a simple dot.
|
|
31
|
+
|
|
32
|
+
<Canvas of={IconButtonFeatures.WithBadge} />
|
|
33
|
+
|
|
34
|
+
## Disabled
|
|
35
|
+
|
|
36
|
+
Set `disabled` to prevent interaction. Pointer events and focus are removed, and `aria-disabled` is set.
|
|
37
|
+
|
|
38
|
+
<Canvas of={IconButtonFeatures.Disabled} />
|
|
39
|
+
|
|
40
|
+
## Loading
|
|
41
|
+
|
|
42
|
+
Set `isLoading` to replace the icon with a `Loader` spinner. The button preserves its dimensions to prevent layout shifts.
|
|
43
|
+
|
|
44
|
+
<Canvas of={IconButtonFeatures.Loading} />
|
|
45
|
+
|
|
46
|
+
## On contrasted backgrounds
|
|
47
|
+
|
|
48
|
+
Set `isOnContrasted` when the button sits on a dark or accent background to switch to `onContrasted` token variants.
|
|
49
|
+
|
|
50
|
+
<Canvas of={IconButtonFeatures.OnContrasted} />
|
|
51
|
+
|
|
52
|
+
## Interaction states
|
|
53
|
+
|
|
54
|
+
### Hover
|
|
55
|
+
|
|
56
|
+
<Canvas of={IconButtonFeatures.StateHover} />
|
|
57
|
+
|
|
58
|
+
### Press
|
|
59
|
+
|
|
60
|
+
<Canvas of={IconButtonFeatures.StatePress} />
|
|
61
|
+
|
|
62
|
+
### Focus visible
|
|
63
|
+
|
|
64
|
+
<Canvas of={IconButtonFeatures.StateFocusVisible} />
|
|
65
|
+
|
|
66
|
+
## Responsive
|
|
67
|
+
|
|
68
|
+
All props support responsive overrides via Tamagui media query props (`$medium`, `$large`, etc.).
|
|
69
|
+
|
|
70
|
+
<Canvas of={IconButtonFeatures.Responsive} />
|
|
71
|
+
|
|
72
|
+
## Related
|
|
73
|
+
|
|
74
|
+
- [Button](?path=/docs/bumper-actions-button--docs)
|
|
@@ -1507,6 +1507,82 @@ exports[`Bumper/Actions/IconButton/Features OnContrasted 1`] = `
|
|
|
1507
1507
|
</RNCSafeAreaProvider>
|
|
1508
1508
|
`;
|
|
1509
1509
|
|
|
1510
|
+
exports[`Bumper/Actions/IconButton/Features Responsive 1`] = `
|
|
1511
|
+
<RNCSafeAreaProvider
|
|
1512
|
+
onInsetsChange={[Function]}
|
|
1513
|
+
style={
|
|
1514
|
+
[
|
|
1515
|
+
{
|
|
1516
|
+
"flex": 1,
|
|
1517
|
+
},
|
|
1518
|
+
undefined,
|
|
1519
|
+
]
|
|
1520
|
+
}
|
|
1521
|
+
>
|
|
1522
|
+
<View
|
|
1523
|
+
focusVisibleStyle={
|
|
1524
|
+
{
|
|
1525
|
+
"outlineColor": "$border.focus",
|
|
1526
|
+
"outlineStyle": "solid",
|
|
1527
|
+
"outlineWidth": 3,
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
onBlur={[Function]}
|
|
1531
|
+
onClick={[Function]}
|
|
1532
|
+
onFocus={[Function]}
|
|
1533
|
+
onResponderGrant={[Function]}
|
|
1534
|
+
onResponderMove={[Function]}
|
|
1535
|
+
onResponderRelease={[Function]}
|
|
1536
|
+
onResponderTerminate={[Function]}
|
|
1537
|
+
onResponderTerminationRequest={[Function]}
|
|
1538
|
+
onStartShouldSetResponder={[Function]}
|
|
1539
|
+
role="button"
|
|
1540
|
+
style={
|
|
1541
|
+
{
|
|
1542
|
+
"alignItems": "center",
|
|
1543
|
+
"alignSelf": "flex-start",
|
|
1544
|
+
"backgroundColor": "transparent",
|
|
1545
|
+
"borderBottomColor": "#563B56",
|
|
1546
|
+
"borderBottomLeftRadius": 4,
|
|
1547
|
+
"borderBottomRightRadius": 4,
|
|
1548
|
+
"borderBottomWidth": 1,
|
|
1549
|
+
"borderLeftColor": "#563B56",
|
|
1550
|
+
"borderLeftWidth": 1,
|
|
1551
|
+
"borderRightColor": "#563B56",
|
|
1552
|
+
"borderRightWidth": 1,
|
|
1553
|
+
"borderStyle": "solid",
|
|
1554
|
+
"borderTopColor": "#563B56",
|
|
1555
|
+
"borderTopLeftRadius": 4,
|
|
1556
|
+
"borderTopRightRadius": 4,
|
|
1557
|
+
"borderTopWidth": 1,
|
|
1558
|
+
"flexDirection": "row",
|
|
1559
|
+
"gap": 8,
|
|
1560
|
+
"height": 36,
|
|
1561
|
+
"justifyContent": "center",
|
|
1562
|
+
"paddingBottom": 8,
|
|
1563
|
+
"paddingLeft": 8,
|
|
1564
|
+
"paddingRight": 8,
|
|
1565
|
+
"paddingTop": 8,
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
>
|
|
1569
|
+
<View
|
|
1570
|
+
style={
|
|
1571
|
+
{
|
|
1572
|
+
"height": 20,
|
|
1573
|
+
"width": 20,
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
>
|
|
1577
|
+
<svg
|
|
1578
|
+
color="#563B56"
|
|
1579
|
+
data-file-name="star.inline.svg"
|
|
1580
|
+
/>
|
|
1581
|
+
</View>
|
|
1582
|
+
</View>
|
|
1583
|
+
</RNCSafeAreaProvider>
|
|
1584
|
+
`;
|
|
1585
|
+
|
|
1510
1586
|
exports[`Bumper/Actions/IconButton/Features Sizes 1`] = `
|
|
1511
1587
|
<RNCSafeAreaProvider
|
|
1512
1588
|
onInsetsChange={[Function]}
|
package/src/system/actions/IconButton/__snapshots_web__/IconButton.features.stories.tsx.snap
CHANGED
|
@@ -473,6 +473,45 @@ exports[`Bumper/Actions/IconButton/Features OnContrasted 1`] = `
|
|
|
473
473
|
</DocumentFragment>
|
|
474
474
|
`;
|
|
475
475
|
|
|
476
|
+
exports[`Bumper/Actions/IconButton/Features Responsive 1`] = `
|
|
477
|
+
<DocumentFragment>
|
|
478
|
+
<div
|
|
479
|
+
class="css-view-g5y9jx r-flex-13awgt0"
|
|
480
|
+
>
|
|
481
|
+
<span
|
|
482
|
+
class=""
|
|
483
|
+
style="display: contents;"
|
|
484
|
+
>
|
|
485
|
+
<span
|
|
486
|
+
class=" "
|
|
487
|
+
style="display: contents;"
|
|
488
|
+
>
|
|
489
|
+
<span
|
|
490
|
+
class=" t_light is_Theme"
|
|
491
|
+
style="display: contents;"
|
|
492
|
+
>
|
|
493
|
+
<div
|
|
494
|
+
class="is_Button _outlineWidth-0focus-visible-3px _outlineColor-0focus-visible-border--foc3742 _outlineStyle-0focus-visible-solid _backgroundColor-0hover-button--bg-1610009989 _backgroundColor-0active-button--bg-1610009989 _dsp-flex _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-row _alignItems-center _justifyContent-center _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410 _alignSelf-flex-start _gap-t-space-spa94482166 _cur-pointer _btc-border--bas1187721777 _brc-border--bas1187721777 _borderBottomColor-border--bas1187721777 _borderLeftColor-border--bas1187721777 _btw-1px _brw-1px _borderBottomWidth-1px _borderLeftWidth-1px _backgroundColor-button--bg-253058202 _borderBottomStyle-solid _borderTopStyle-solid _borderLeftStyle-solid _borderRightStyle-solid _height-36px _paddingRight-8px _paddingLeft-8px _paddingTop-8px _paddingBottom-8px"
|
|
495
|
+
data-disable-theme="true"
|
|
496
|
+
role="button"
|
|
497
|
+
tabindex="0"
|
|
498
|
+
>
|
|
499
|
+
<div
|
|
500
|
+
class="is_Icon _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _width-t-bumperIco1504282965 _height-t-bumperIco1504282965"
|
|
501
|
+
>
|
|
502
|
+
<svg
|
|
503
|
+
color="var(--content--accent)"
|
|
504
|
+
data-file-name="star.inline.svg"
|
|
505
|
+
/>
|
|
506
|
+
</div>
|
|
507
|
+
</div>
|
|
508
|
+
</span>
|
|
509
|
+
</span>
|
|
510
|
+
</span>
|
|
511
|
+
</div>
|
|
512
|
+
</DocumentFragment>
|
|
513
|
+
`;
|
|
514
|
+
|
|
476
515
|
exports[`Bumper/Actions/IconButton/Features Sizes 1`] = `
|
|
477
516
|
<DocumentFragment>
|
|
478
517
|
<div
|
|
@@ -37,6 +37,18 @@ export const Sizes: Story = {
|
|
|
37
37
|
),
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
export const Responsive: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<Icon
|
|
43
|
+
icon={<StarIcon />}
|
|
44
|
+
size="$icon.s"
|
|
45
|
+
color="$content.base.hi"
|
|
46
|
+
$medium={{ size: '$icon.m' }}
|
|
47
|
+
$large={{ size: '$icon.l', color: '$content.accent' }}
|
|
48
|
+
/>
|
|
49
|
+
),
|
|
50
|
+
};
|
|
51
|
+
|
|
40
52
|
export const DefaultSize: Story = {
|
|
41
53
|
render: () => (
|
|
42
54
|
<HStack gap="$space.16" alignItems="center">
|
|
@@ -420,6 +420,34 @@ exports[`Bumper/Content/Icon/Features DefaultSize 1`] = `
|
|
|
420
420
|
</RNCSafeAreaProvider>
|
|
421
421
|
`;
|
|
422
422
|
|
|
423
|
+
exports[`Bumper/Content/Icon/Features Responsive 1`] = `
|
|
424
|
+
<RNCSafeAreaProvider
|
|
425
|
+
onInsetsChange={[Function]}
|
|
426
|
+
style={
|
|
427
|
+
[
|
|
428
|
+
{
|
|
429
|
+
"flex": 1,
|
|
430
|
+
},
|
|
431
|
+
undefined,
|
|
432
|
+
]
|
|
433
|
+
}
|
|
434
|
+
>
|
|
435
|
+
<View
|
|
436
|
+
style={
|
|
437
|
+
{
|
|
438
|
+
"height": 16,
|
|
439
|
+
"width": 16,
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
>
|
|
443
|
+
<svg
|
|
444
|
+
color="#101010"
|
|
445
|
+
data-file-name="star.inline.svg"
|
|
446
|
+
/>
|
|
447
|
+
</View>
|
|
448
|
+
</RNCSafeAreaProvider>
|
|
449
|
+
`;
|
|
450
|
+
|
|
423
451
|
exports[`Bumper/Content/Icon/Features Sizes 1`] = `
|
|
424
452
|
<RNCSafeAreaProvider
|
|
425
453
|
onInsetsChange={[Function]}
|