@tinybigui/react 0.5.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/README.md +60 -40
- package/dist/index.cjs +531 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +365 -124
- package/dist/index.d.ts +365 -124
- package/dist/index.js +527 -317
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1705,232 +1705,273 @@ var FABHeadless = forwardRef(
|
|
|
1705
1705
|
type,
|
|
1706
1706
|
"aria-label": ariaLabel,
|
|
1707
1707
|
title,
|
|
1708
|
-
...
|
|
1708
|
+
...restProps
|
|
1709
1709
|
}, forwardedRef) => {
|
|
1710
1710
|
const internalRef = useRef(null);
|
|
1711
1711
|
const ref = forwardedRef ?? internalRef;
|
|
1712
1712
|
const { buttonProps } = useButton(
|
|
1713
1713
|
{
|
|
1714
|
-
...
|
|
1714
|
+
...restProps,
|
|
1715
1715
|
elementType: "button"
|
|
1716
1716
|
},
|
|
1717
1717
|
ref
|
|
1718
1718
|
);
|
|
1719
|
-
const
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1719
|
+
const {
|
|
1720
|
+
isDisabled: _isDisabled,
|
|
1721
|
+
onPress: _onPress,
|
|
1722
|
+
onPressStart: _onPressStart,
|
|
1723
|
+
onPressEnd: _onPressEnd,
|
|
1724
|
+
onPressChange: _onPressChange,
|
|
1725
|
+
onPressUp: _onPressUp,
|
|
1726
|
+
...htmlAttrs
|
|
1727
|
+
} = restProps;
|
|
1728
|
+
const mergedProps = mergeProps(
|
|
1729
|
+
buttonProps,
|
|
1730
|
+
{
|
|
1731
|
+
tabIndex,
|
|
1732
|
+
className,
|
|
1733
|
+
onMouseDown,
|
|
1734
|
+
"aria-label": ariaLabel,
|
|
1735
|
+
...title !== void 0 && { title }
|
|
1736
|
+
},
|
|
1737
|
+
htmlAttrs
|
|
1738
|
+
);
|
|
1730
1739
|
return (
|
|
1731
|
-
// eslint-disable-next-line react/button-has-type
|
|
1732
|
-
/* @__PURE__ */ jsx("button", { ...mergedProps, ref, children })
|
|
1740
|
+
// eslint-disable-next-line react/button-has-type -- type is dynamically passed from props
|
|
1741
|
+
/* @__PURE__ */ jsx("button", { ...mergedProps, ref, type: type ?? "button", children })
|
|
1733
1742
|
);
|
|
1734
1743
|
}
|
|
1735
1744
|
);
|
|
1736
1745
|
FABHeadless.displayName = "FABHeadless";
|
|
1737
1746
|
var fabVariants = cva(
|
|
1738
1747
|
[
|
|
1739
|
-
//
|
|
1740
|
-
"relative inline-flex items-center justify-center cursor-pointer",
|
|
1741
|
-
"overflow-hidden",
|
|
1742
|
-
"transition-all duration-200",
|
|
1743
|
-
"focus-visible:outline-primary focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
1748
|
+
// Layout — NO overflow-hidden here (focus ring must extend outside)
|
|
1749
|
+
"relative inline-flex items-center justify-center cursor-pointer select-none",
|
|
1744
1750
|
"shrink-0",
|
|
1745
|
-
//
|
|
1746
|
-
|
|
1747
|
-
"
|
|
1748
|
-
|
|
1749
|
-
"
|
|
1750
|
-
"
|
|
1751
|
-
"active:before:opacity-12",
|
|
1752
|
-
// Elevation (floating appearance)
|
|
1753
|
-
"shadow-elevation-3",
|
|
1754
|
-
// Default elevation
|
|
1755
|
-
"hover:shadow-elevation-4"
|
|
1756
|
-
// Hover elevation
|
|
1751
|
+
// Effects transition: color / bg / shadow — standard spring, no overshoot
|
|
1752
|
+
"transition-[color,background-color,box-shadow]",
|
|
1753
|
+
"duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
1754
|
+
// Disabled — self-targeting data-[x]: selectors (not group-data — these target the root itself)
|
|
1755
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38",
|
|
1756
|
+
"data-[disabled]:shadow-none data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none"
|
|
1757
1757
|
],
|
|
1758
1758
|
{
|
|
1759
1759
|
variants: {
|
|
1760
1760
|
/**
|
|
1761
|
-
* FAB size
|
|
1761
|
+
* FAB size — controls container dimensions, corner radius, and icon slot size.
|
|
1762
1762
|
*/
|
|
1763
1763
|
size: {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
"rounded-xl",
|
|
1770
|
-
// 12px corner radius (not fully rounded!)
|
|
1771
|
-
"m-1"
|
|
1772
|
-
// 4px margin for 48×48px touch target
|
|
1773
|
-
],
|
|
1774
|
-
medium: [
|
|
1764
|
+
/**
|
|
1765
|
+
* fab (default) — 56×56dp, 16dp corner radius.
|
|
1766
|
+
* MD3 standard FAB.
|
|
1767
|
+
*/
|
|
1768
|
+
fab: [
|
|
1775
1769
|
"h-14 w-14",
|
|
1776
|
-
//
|
|
1777
|
-
"p-4",
|
|
1778
|
-
// 16px padding for 24px icon
|
|
1770
|
+
// 56dp
|
|
1779
1771
|
"rounded-2xl"
|
|
1780
|
-
//
|
|
1772
|
+
// 16dp corner
|
|
1773
|
+
],
|
|
1774
|
+
/**
|
|
1775
|
+
* medium — 80×80dp, 20dp corner radius.
|
|
1776
|
+
* M3 Expressive Medium FAB. Previously this value mapped to 56dp;
|
|
1777
|
+
* it is now remapped to the Expressive 80dp Medium FAB.
|
|
1778
|
+
*/
|
|
1779
|
+
medium: [
|
|
1780
|
+
"h-20 w-20",
|
|
1781
|
+
// 80dp
|
|
1782
|
+
"rounded-[20px]"
|
|
1783
|
+
// 20dp corner (large-increased shape token)
|
|
1781
1784
|
],
|
|
1785
|
+
/**
|
|
1786
|
+
* large — 96×96dp, 28dp corner radius.
|
|
1787
|
+
*/
|
|
1782
1788
|
large: [
|
|
1783
1789
|
"h-24 w-24",
|
|
1784
|
-
//
|
|
1785
|
-
"p-[30px]",
|
|
1786
|
-
// 30px padding for 36px icon
|
|
1790
|
+
// 96dp
|
|
1787
1791
|
"rounded-[28px]"
|
|
1788
|
-
//
|
|
1792
|
+
// 28dp corner
|
|
1789
1793
|
],
|
|
1794
|
+
/**
|
|
1795
|
+
* extended — 56dp height, variable width, 16dp corner.
|
|
1796
|
+
* Icon + text label side by side.
|
|
1797
|
+
* Padding: 16dp leading (icon side), 20dp trailing (text side).
|
|
1798
|
+
* Gap: 12dp between icon and label (MD3 spec).
|
|
1799
|
+
*/
|
|
1790
1800
|
extended: [
|
|
1791
1801
|
"h-14",
|
|
1792
|
-
//
|
|
1802
|
+
// 56dp height
|
|
1793
1803
|
"rounded-2xl",
|
|
1794
|
-
//
|
|
1804
|
+
// 16dp corner
|
|
1795
1805
|
"pl-4 pr-5",
|
|
1796
|
-
//
|
|
1797
|
-
"gap-
|
|
1798
|
-
//
|
|
1806
|
+
// 16dp leading, 20dp trailing
|
|
1807
|
+
"gap-3"
|
|
1808
|
+
// 12dp gap between icon and label
|
|
1809
|
+
],
|
|
1810
|
+
/**
|
|
1811
|
+
* @deprecated Use `fab` (56dp) instead.
|
|
1812
|
+
* small — 40×40dp, 12dp corner radius. No longer recommended in M3 Expressive.
|
|
1813
|
+
* Kept functional for backward compatibility.
|
|
1814
|
+
*/
|
|
1815
|
+
small: [
|
|
1816
|
+
"h-10 w-10",
|
|
1817
|
+
// 40dp
|
|
1818
|
+
"rounded-xl",
|
|
1819
|
+
// 12dp corner
|
|
1820
|
+
"m-1"
|
|
1821
|
+
// 4dp margin for 48×48dp minimum touch target
|
|
1799
1822
|
]
|
|
1800
1823
|
},
|
|
1801
1824
|
/**
|
|
1802
|
-
*
|
|
1825
|
+
* FAB color — controls container + on-color.
|
|
1826
|
+
* State-layer color in fabStateLayerVariants must match icon/on-color.
|
|
1803
1827
|
*/
|
|
1804
1828
|
color: {
|
|
1805
|
-
primary:
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1829
|
+
"primary-container": [
|
|
1830
|
+
"bg-primary-container text-on-primary-container",
|
|
1831
|
+
// Elevation base=3, hover=4 (state driven), disabled handled by root data-[disabled]
|
|
1832
|
+
"shadow-elevation-3",
|
|
1833
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1834
|
+
// Focus / pressed: return to elevation-3
|
|
1835
|
+
// Doubled attribute selector gives higher specificity than single hover selector
|
|
1836
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1837
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1838
|
+
],
|
|
1839
|
+
"secondary-container": [
|
|
1840
|
+
"bg-secondary-container text-on-secondary-container",
|
|
1841
|
+
"shadow-elevation-3",
|
|
1842
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1843
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1844
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1845
|
+
],
|
|
1846
|
+
"tertiary-container": [
|
|
1847
|
+
"bg-tertiary-container text-on-tertiary-container",
|
|
1848
|
+
"shadow-elevation-3",
|
|
1849
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1850
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1851
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1852
|
+
],
|
|
1853
|
+
primary: [
|
|
1854
|
+
"bg-primary text-on-primary",
|
|
1855
|
+
"shadow-elevation-3",
|
|
1856
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1857
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1858
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1859
|
+
],
|
|
1860
|
+
secondary: [
|
|
1861
|
+
"bg-secondary text-on-secondary",
|
|
1862
|
+
"shadow-elevation-3",
|
|
1863
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1864
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1865
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1866
|
+
],
|
|
1867
|
+
tertiary: [
|
|
1868
|
+
"bg-tertiary text-on-tertiary",
|
|
1869
|
+
"shadow-elevation-3",
|
|
1870
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1871
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1872
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1873
|
+
],
|
|
1874
|
+
/** @deprecated Use `primary-container` instead. */
|
|
1875
|
+
surface: [
|
|
1876
|
+
"bg-surface-container-high text-primary",
|
|
1877
|
+
"shadow-elevation-3",
|
|
1878
|
+
"group-data-[hovered]/fab:shadow-elevation-4",
|
|
1879
|
+
"group-data-[focus-visible]/fab:shadow-elevation-3",
|
|
1880
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:shadow-elevation-3"
|
|
1881
|
+
]
|
|
1816
1882
|
}
|
|
1817
1883
|
},
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
{
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
{
|
|
1882
|
-
color: "tertiary",
|
|
1883
|
-
size: "large",
|
|
1884
|
-
className: "bg-tertiary-container text-on-tertiary-container"
|
|
1885
|
-
},
|
|
1886
|
-
{
|
|
1887
|
-
color: "tertiary",
|
|
1888
|
-
size: "extended",
|
|
1889
|
-
className: "bg-tertiary-container text-on-tertiary-container"
|
|
1890
|
-
},
|
|
1891
|
-
// ====================
|
|
1892
|
-
// SURFACE COLOR
|
|
1893
|
-
// ====================
|
|
1894
|
-
{
|
|
1895
|
-
color: "surface",
|
|
1896
|
-
size: "small",
|
|
1897
|
-
className: "bg-surface text-primary"
|
|
1898
|
-
},
|
|
1899
|
-
{
|
|
1900
|
-
color: "surface",
|
|
1901
|
-
size: "medium",
|
|
1902
|
-
className: "bg-surface text-primary"
|
|
1903
|
-
},
|
|
1904
|
-
{
|
|
1905
|
-
color: "surface",
|
|
1906
|
-
size: "large",
|
|
1907
|
-
className: "bg-surface text-primary"
|
|
1884
|
+
defaultVariants: {
|
|
1885
|
+
size: "fab",
|
|
1886
|
+
color: "primary-container"
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
);
|
|
1890
|
+
var fabStateLayerVariants = cva(
|
|
1891
|
+
[
|
|
1892
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
1893
|
+
// Effects transition — opacity must not overshoot
|
|
1894
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
1895
|
+
// Hover: 8%
|
|
1896
|
+
"group-data-[hovered]/fab:opacity-8",
|
|
1897
|
+
// Focus: 10%
|
|
1898
|
+
"group-data-[focus-visible]/fab:opacity-10",
|
|
1899
|
+
// Pressed: 10% — doubled selector wins over hover's 8%
|
|
1900
|
+
"group-data-[pressed]/fab:group-data-[pressed]/fab:opacity-10",
|
|
1901
|
+
// No state layer when disabled
|
|
1902
|
+
"group-data-[disabled]/fab:hidden"
|
|
1903
|
+
],
|
|
1904
|
+
{
|
|
1905
|
+
variants: {
|
|
1906
|
+
color: {
|
|
1907
|
+
"primary-container": "bg-on-primary-container",
|
|
1908
|
+
"secondary-container": "bg-on-secondary-container",
|
|
1909
|
+
"tertiary-container": "bg-on-tertiary-container",
|
|
1910
|
+
primary: "bg-on-primary",
|
|
1911
|
+
secondary: "bg-on-secondary",
|
|
1912
|
+
tertiary: "bg-on-tertiary",
|
|
1913
|
+
/** @deprecated */
|
|
1914
|
+
surface: "bg-primary"
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
defaultVariants: { color: "primary-container" }
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
var fabFocusRingVariants = cva([
|
|
1921
|
+
"pointer-events-none absolute inset-[-3px] rounded-[inherit]",
|
|
1922
|
+
"outline outline-2 outline-offset-0 outline-secondary",
|
|
1923
|
+
// Effects transition — opacity change must not overshoot
|
|
1924
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
1925
|
+
"opacity-0",
|
|
1926
|
+
"group-data-[focus-visible]/fab:opacity-100"
|
|
1927
|
+
]);
|
|
1928
|
+
var fabIconVariants = cva(
|
|
1929
|
+
[
|
|
1930
|
+
"relative z-10 inline-flex shrink-0 items-center justify-center",
|
|
1931
|
+
// Color transition uses effects token (no spatial overshoot on color)
|
|
1932
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
1933
|
+
],
|
|
1934
|
+
{
|
|
1935
|
+
variants: {
|
|
1936
|
+
size: {
|
|
1937
|
+
fab: "size-6",
|
|
1938
|
+
// 24dp
|
|
1939
|
+
medium: "size-7",
|
|
1940
|
+
// 28dp
|
|
1941
|
+
large: "size-9",
|
|
1942
|
+
// 36dp
|
|
1943
|
+
extended: "size-6",
|
|
1944
|
+
// 24dp
|
|
1945
|
+
small: "size-6"
|
|
1946
|
+
// 24dp
|
|
1908
1947
|
},
|
|
1909
|
-
{
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
className: "bg-surface text-primary"
|
|
1948
|
+
hidden: {
|
|
1949
|
+
true: "invisible",
|
|
1950
|
+
false: ""
|
|
1913
1951
|
}
|
|
1914
|
-
|
|
1915
|
-
/**
|
|
1916
|
-
* Default variants
|
|
1917
|
-
*/
|
|
1952
|
+
},
|
|
1918
1953
|
defaultVariants: {
|
|
1919
|
-
size: "
|
|
1920
|
-
|
|
1921
|
-
isDisabled: false
|
|
1954
|
+
size: "fab",
|
|
1955
|
+
hidden: false
|
|
1922
1956
|
}
|
|
1923
1957
|
}
|
|
1924
1958
|
);
|
|
1959
|
+
var fabLabelVariants = cva([
|
|
1960
|
+
"relative z-10 inline-flex items-center",
|
|
1961
|
+
"text-label-large tracking-[0.1px]"
|
|
1962
|
+
]);
|
|
1925
1963
|
var Spinner2 = () => /* @__PURE__ */ jsxs(
|
|
1926
1964
|
"svg",
|
|
1927
1965
|
{
|
|
1928
1966
|
role: "progressbar",
|
|
1929
1967
|
"aria-label": "Loading",
|
|
1930
|
-
className: "
|
|
1968
|
+
className: "relative z-10 animate-spin",
|
|
1931
1969
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1932
1970
|
fill: "none",
|
|
1933
1971
|
viewBox: "0 0 24 24",
|
|
1972
|
+
width: "1em",
|
|
1973
|
+
height: "1em",
|
|
1974
|
+
style: { fontSize: "inherit" },
|
|
1934
1975
|
children: [
|
|
1935
1976
|
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
1936
1977
|
/* @__PURE__ */ jsx(
|
|
@@ -1946,80 +1987,98 @@ var Spinner2 = () => /* @__PURE__ */ jsxs(
|
|
|
1946
1987
|
);
|
|
1947
1988
|
var FAB = forwardRef(
|
|
1948
1989
|
({
|
|
1949
|
-
// Variant props
|
|
1950
|
-
size = "
|
|
1951
|
-
color = "primary",
|
|
1952
|
-
//
|
|
1990
|
+
// Variant props
|
|
1991
|
+
size = "fab",
|
|
1992
|
+
color = "primary-container",
|
|
1993
|
+
// Content
|
|
1953
1994
|
icon,
|
|
1954
1995
|
children,
|
|
1955
|
-
|
|
1996
|
+
// State
|
|
1956
1997
|
loading = false,
|
|
1957
1998
|
disableRipple = false,
|
|
1999
|
+
isDisabled = false,
|
|
2000
|
+
// Styling
|
|
1958
2001
|
className,
|
|
1959
|
-
//
|
|
1960
|
-
|
|
1961
|
-
onPress,
|
|
1962
|
-
onMouseDown,
|
|
2002
|
+
// Accessibility
|
|
2003
|
+
"aria-label": ariaLabel,
|
|
1963
2004
|
title,
|
|
2005
|
+
// Passthrough — forwarded to FABHeadless
|
|
2006
|
+
tabIndex = 0,
|
|
2007
|
+
type = "button",
|
|
2008
|
+
// Passed through to FABHeadless → useButton
|
|
1964
2009
|
...props
|
|
1965
2010
|
}, ref) => {
|
|
2011
|
+
const fabRef = useRef(null);
|
|
2012
|
+
const resolvedRef = ref ?? fabRef;
|
|
2013
|
+
const isFABDisabled = isDisabled || loading;
|
|
2014
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
2015
|
+
const handlePressStart = useCallback(() => setIsPressed(true), []);
|
|
2016
|
+
const handlePressEnd = useCallback(() => setIsPressed(false), []);
|
|
2017
|
+
const { isHovered, hoverProps } = useHover({ isDisabled: isFABDisabled });
|
|
2018
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
2019
|
+
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
2020
|
+
disabled: isFABDisabled || disableRipple
|
|
2021
|
+
});
|
|
1966
2022
|
if (process.env.NODE_ENV === "development") {
|
|
1967
2023
|
if (!icon) {
|
|
1968
|
-
console.warn("[FAB] FAB must have an icon. Please provide the icon prop.");
|
|
2024
|
+
console.warn("[FAB] FAB must have an icon. Please provide the `icon` prop.");
|
|
1969
2025
|
}
|
|
1970
2026
|
if (size === "extended" && !children) {
|
|
1971
|
-
console.warn("[FAB] Extended FAB requires text label as children
|
|
2027
|
+
console.warn("[FAB] Extended FAB requires a text label as `children`.");
|
|
1972
2028
|
}
|
|
1973
2029
|
if (size !== "extended" && children) {
|
|
1974
2030
|
console.warn(
|
|
1975
|
-
"[FAB]
|
|
2031
|
+
"[FAB] `children` (text label) is only rendered for `size='extended'`. For icon-only FABs, use the `icon` prop only."
|
|
2032
|
+
);
|
|
2033
|
+
}
|
|
2034
|
+
if (size === "small") {
|
|
2035
|
+
console.warn(
|
|
2036
|
+
"[FAB] `size='small'` is deprecated in M3 Expressive. Use `size='fab'` (56dp) instead."
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
if (color === "surface") {
|
|
2040
|
+
console.warn(
|
|
2041
|
+
"[FAB] `color='surface'` is deprecated in M3 Expressive. Use `color='primary-container'` instead."
|
|
1976
2042
|
);
|
|
1977
2043
|
}
|
|
1978
2044
|
}
|
|
1979
|
-
const isDisabled = propIsDisabled || loading;
|
|
1980
|
-
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
1981
|
-
disabled: isDisabled || disableRipple
|
|
1982
|
-
});
|
|
1983
|
-
const mergedOnMouseDown = (e) => {
|
|
1984
|
-
onMouseDown?.(e);
|
|
1985
|
-
handleRipple(e);
|
|
1986
|
-
};
|
|
1987
|
-
const mergedPropsValue = mergeProps(props, {
|
|
1988
|
-
...onPress && { onPress },
|
|
1989
|
-
onMouseDown: mergedOnMouseDown,
|
|
1990
|
-
isDisabled
|
|
1991
|
-
});
|
|
1992
2045
|
return /* @__PURE__ */ jsxs(
|
|
1993
2046
|
FABHeadless,
|
|
1994
2047
|
{
|
|
1995
|
-
|
|
2048
|
+
...mergeProps$1(
|
|
2049
|
+
hoverProps,
|
|
2050
|
+
focusProps,
|
|
2051
|
+
{ onPressStart: handlePressStart, onPressEnd: handlePressEnd },
|
|
2052
|
+
props
|
|
2053
|
+
),
|
|
2054
|
+
ref: resolvedRef,
|
|
2055
|
+
type,
|
|
2056
|
+
isDisabled: isFABDisabled,
|
|
2057
|
+
tabIndex,
|
|
2058
|
+
onMouseDown: handleRipple,
|
|
2059
|
+
"aria-label": ariaLabel,
|
|
2060
|
+
...title !== void 0 && { title },
|
|
2061
|
+
...getInteractionDataAttributes({
|
|
2062
|
+
isHovered,
|
|
2063
|
+
isFocusVisible,
|
|
2064
|
+
isPressed,
|
|
2065
|
+
isDisabled: isFABDisabled
|
|
2066
|
+
}),
|
|
2067
|
+
"data-with-icon": icon ? "" : void 0,
|
|
2068
|
+
"data-loading": loading ? "" : void 0,
|
|
1996
2069
|
className: cn(
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
"
|
|
2000
|
-
"focus-visible:outline-primary focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2001
|
-
"shrink-0",
|
|
2002
|
-
// State layers (hover, focus, active)
|
|
2003
|
-
"before:absolute before:inset-0 before:rounded-[inherit] before:transition-opacity before:duration-200",
|
|
2004
|
-
"before:bg-current before:opacity-0",
|
|
2005
|
-
"hover:before:opacity-8",
|
|
2006
|
-
"focus-visible:before:opacity-12",
|
|
2007
|
-
"active:before:opacity-12",
|
|
2008
|
-
// Elevation
|
|
2009
|
-
"shadow-elevation-3 hover:shadow-elevation-4",
|
|
2010
|
-
// CVA variants
|
|
2011
|
-
fabVariants({ size, color, isDisabled }),
|
|
2012
|
-
// User custom classes
|
|
2070
|
+
fabVariants({ size, color }),
|
|
2071
|
+
// group/fab: enables group-data-[x]/fab child selectors in all slots
|
|
2072
|
+
"group/fab",
|
|
2013
2073
|
className
|
|
2014
2074
|
),
|
|
2015
|
-
"aria-label": ariaLabel,
|
|
2016
|
-
...title && { title },
|
|
2017
|
-
...mergedPropsValue,
|
|
2018
2075
|
children: [
|
|
2019
2076
|
ripples,
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2077
|
+
/* @__PURE__ */ jsx("span", { className: cn(fabStateLayerVariants({ color })), "aria-hidden": "true" }),
|
|
2078
|
+
/* @__PURE__ */ jsx("span", { className: cn(fabFocusRingVariants()), "aria-hidden": "true" }),
|
|
2079
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn(fabIconVariants({ size, hidden: loading })), children: icon }),
|
|
2080
|
+
loading && /* @__PURE__ */ jsx("span", { className: cn(fabIconVariants({ size })), children: /* @__PURE__ */ jsx(Spinner2, {}) }),
|
|
2081
|
+
size === "extended" && children && /* @__PURE__ */ jsx("span", { className: cn(fabLabelVariants()), children })
|
|
2023
2082
|
]
|
|
2024
2083
|
}
|
|
2025
2084
|
);
|
|
@@ -9271,13 +9330,30 @@ var FABMenuHeadless = forwardRef(
|
|
|
9271
9330
|
}
|
|
9272
9331
|
);
|
|
9273
9332
|
FABMenuHeadless.displayName = "FABMenuHeadless";
|
|
9274
|
-
var fabMenuVariants = cva(["relative", "inline-flex"
|
|
9333
|
+
var fabMenuVariants = cva(["relative", "inline-flex"]);
|
|
9334
|
+
var fabMenuListVariants = cva(["absolute", "z-10", "flex", "gap-3"], {
|
|
9275
9335
|
variants: {
|
|
9276
9336
|
direction: {
|
|
9277
|
-
up: ["flex-col-reverse", "
|
|
9278
|
-
down: ["flex-col", "
|
|
9279
|
-
left: [
|
|
9280
|
-
|
|
9337
|
+
up: ["bottom-full", "mb-3", "end-0", "flex-col-reverse", "items-end", "origin-bottom"],
|
|
9338
|
+
down: ["top-full", "mt-3", "end-0", "flex-col", "items-end", "origin-top"],
|
|
9339
|
+
left: [
|
|
9340
|
+
"end-full",
|
|
9341
|
+
"me-3",
|
|
9342
|
+
"top-1/2",
|
|
9343
|
+
"-translate-y-1/2",
|
|
9344
|
+
"flex-row-reverse",
|
|
9345
|
+
"items-center",
|
|
9346
|
+
"origin-right"
|
|
9347
|
+
],
|
|
9348
|
+
right: [
|
|
9349
|
+
"start-full",
|
|
9350
|
+
"ms-3",
|
|
9351
|
+
"top-1/2",
|
|
9352
|
+
"-translate-y-1/2",
|
|
9353
|
+
"flex-row",
|
|
9354
|
+
"items-center",
|
|
9355
|
+
"origin-left"
|
|
9356
|
+
]
|
|
9281
9357
|
}
|
|
9282
9358
|
},
|
|
9283
9359
|
defaultVariants: {
|
|
@@ -9285,19 +9361,129 @@ var fabMenuVariants = cva(["relative", "inline-flex", "items-end"], {
|
|
|
9285
9361
|
}
|
|
9286
9362
|
});
|
|
9287
9363
|
var fabMenuItemVariants = cva(
|
|
9288
|
-
[
|
|
9364
|
+
[
|
|
9365
|
+
// Layout — full-rounded pill, NO overflow-hidden (focus ring extends outside)
|
|
9366
|
+
"relative inline-flex items-center cursor-pointer select-none",
|
|
9367
|
+
"rounded-full",
|
|
9368
|
+
"h-14 pl-4 pr-5 gap-3",
|
|
9369
|
+
// 56dp height, 16dp leading, 20dp trailing, 12dp gap
|
|
9370
|
+
// Effects transition for color/bg/shadow
|
|
9371
|
+
"transition-[color,background-color,box-shadow]",
|
|
9372
|
+
"duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9373
|
+
// Disabled — self-targeting data-[x]: selectors
|
|
9374
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38",
|
|
9375
|
+
"data-[disabled]:shadow-none data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none"
|
|
9376
|
+
],
|
|
9289
9377
|
{
|
|
9290
9378
|
variants: {
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9379
|
+
/**
|
|
9380
|
+
* Color role — controls container background, text color, and elevation.
|
|
9381
|
+
* State-layer color must equal the on-color (see fabMenuItemStateLayerVariants).
|
|
9382
|
+
*
|
|
9383
|
+
* Elevation per state:
|
|
9384
|
+
* base → elevation-3
|
|
9385
|
+
* hover → elevation-4 (group-data-[hovered]/fab-menu-item)
|
|
9386
|
+
* focus → elevation-3 (doubled selector wins over hover)
|
|
9387
|
+
* pressed→ elevation-3 (doubled selector wins over hover)
|
|
9388
|
+
* disabled → shadow-none (self-targeting data-[disabled])
|
|
9389
|
+
*/
|
|
9390
|
+
color: {
|
|
9391
|
+
"primary-container": [
|
|
9392
|
+
"bg-primary-container text-on-primary-container",
|
|
9393
|
+
"shadow-elevation-3",
|
|
9394
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9395
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9396
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9397
|
+
],
|
|
9398
|
+
"secondary-container": [
|
|
9399
|
+
"bg-secondary-container text-on-secondary-container",
|
|
9400
|
+
"shadow-elevation-3",
|
|
9401
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9402
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9403
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9404
|
+
],
|
|
9405
|
+
"tertiary-container": [
|
|
9406
|
+
"bg-tertiary-container text-on-tertiary-container",
|
|
9407
|
+
"shadow-elevation-3",
|
|
9408
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9409
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9410
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9411
|
+
],
|
|
9412
|
+
primary: [
|
|
9413
|
+
"bg-primary text-on-primary",
|
|
9414
|
+
"shadow-elevation-3",
|
|
9415
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9416
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9417
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9418
|
+
],
|
|
9419
|
+
secondary: [
|
|
9420
|
+
"bg-secondary text-on-secondary",
|
|
9421
|
+
"shadow-elevation-3",
|
|
9422
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9423
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9424
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9425
|
+
],
|
|
9426
|
+
tertiary: [
|
|
9427
|
+
"bg-tertiary text-on-tertiary",
|
|
9428
|
+
"shadow-elevation-3",
|
|
9429
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9430
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9431
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9432
|
+
]
|
|
9294
9433
|
}
|
|
9295
9434
|
},
|
|
9296
9435
|
defaultVariants: {
|
|
9297
|
-
|
|
9436
|
+
color: "primary-container"
|
|
9298
9437
|
}
|
|
9299
9438
|
}
|
|
9300
9439
|
);
|
|
9440
|
+
var fabMenuItemStateLayerVariants = cva(
|
|
9441
|
+
[
|
|
9442
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
9443
|
+
// Effects transition — opacity must not overshoot
|
|
9444
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9445
|
+
// Hover: 8%
|
|
9446
|
+
"group-data-[hovered]/fab-menu-item:opacity-8",
|
|
9447
|
+
// Focus: 10%
|
|
9448
|
+
"group-data-[focus-visible]/fab-menu-item:opacity-10",
|
|
9449
|
+
// Pressed: 10% — doubled selector wins over hover's 8%
|
|
9450
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:opacity-10",
|
|
9451
|
+
// No state layer when disabled
|
|
9452
|
+
"group-data-[disabled]/fab-menu-item:hidden"
|
|
9453
|
+
],
|
|
9454
|
+
{
|
|
9455
|
+
variants: {
|
|
9456
|
+
color: {
|
|
9457
|
+
"primary-container": "bg-on-primary-container",
|
|
9458
|
+
"secondary-container": "bg-on-secondary-container",
|
|
9459
|
+
"tertiary-container": "bg-on-tertiary-container",
|
|
9460
|
+
primary: "bg-on-primary",
|
|
9461
|
+
secondary: "bg-on-secondary",
|
|
9462
|
+
tertiary: "bg-on-tertiary"
|
|
9463
|
+
}
|
|
9464
|
+
},
|
|
9465
|
+
defaultVariants: { color: "primary-container" }
|
|
9466
|
+
}
|
|
9467
|
+
);
|
|
9468
|
+
var fabMenuItemFocusRingVariants = cva([
|
|
9469
|
+
"pointer-events-none absolute inset-[-3px] rounded-full",
|
|
9470
|
+
"outline outline-2 outline-offset-0 outline-secondary",
|
|
9471
|
+
// Effects transition — opacity change must not overshoot
|
|
9472
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9473
|
+
"opacity-0",
|
|
9474
|
+
"group-data-[focus-visible]/fab-menu-item:opacity-100"
|
|
9475
|
+
]);
|
|
9476
|
+
var fabMenuItemIconVariants = cva([
|
|
9477
|
+
"relative z-10 inline-flex shrink-0 items-center justify-center",
|
|
9478
|
+
"size-6",
|
|
9479
|
+
// 24dp per MD3 spec
|
|
9480
|
+
// Color transition uses effects token (no spatial overshoot on color)
|
|
9481
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
9482
|
+
]);
|
|
9483
|
+
var fabMenuItemLabelVariants = cva([
|
|
9484
|
+
"relative z-10 inline-flex items-center",
|
|
9485
|
+
"text-title-medium"
|
|
9486
|
+
]);
|
|
9301
9487
|
var FABMenu = forwardRef(
|
|
9302
9488
|
({
|
|
9303
9489
|
open: controlledOpen,
|
|
@@ -9336,7 +9522,7 @@ var FABMenu = forwardRef(
|
|
|
9336
9522
|
setIsOpen(false);
|
|
9337
9523
|
}, [setIsOpen]);
|
|
9338
9524
|
const prevIsOpenRef = useRef(void 0);
|
|
9339
|
-
|
|
9525
|
+
useLayoutEffect(() => {
|
|
9340
9526
|
if (prevIsOpenRef.current === void 0) {
|
|
9341
9527
|
prevIsOpenRef.current = isOpen;
|
|
9342
9528
|
return;
|
|
@@ -9399,119 +9585,143 @@ var FABMenu = forwardRef(
|
|
|
9399
9585
|
}
|
|
9400
9586
|
return child;
|
|
9401
9587
|
});
|
|
9402
|
-
return /* @__PURE__ */ jsx(FABMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9588
|
+
return /* @__PURE__ */ jsx(FABMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { ref: rootRef, className: cn(fabMenuVariants(), className), onKeyDown: handleKeyDown, children: [
|
|
9589
|
+
(isOpen || isExiting) && /* @__PURE__ */ jsx(
|
|
9590
|
+
"div",
|
|
9591
|
+
{
|
|
9592
|
+
className: cn(fabMenuListVariants({ direction })),
|
|
9593
|
+
role: "group",
|
|
9594
|
+
"aria-label": `${ariaLabel} actions`,
|
|
9595
|
+
children: indexedChildren
|
|
9596
|
+
}
|
|
9597
|
+
),
|
|
9598
|
+
/* @__PURE__ */ jsx(
|
|
9599
|
+
FAB,
|
|
9600
|
+
{
|
|
9601
|
+
ref: triggerRef,
|
|
9602
|
+
onPress: toggle,
|
|
9603
|
+
"aria-label": ariaLabel,
|
|
9604
|
+
"aria-expanded": isOpen,
|
|
9605
|
+
icon: /* @__PURE__ */ jsx(
|
|
9606
|
+
"svg",
|
|
9411
9607
|
{
|
|
9608
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9609
|
+
viewBox: "0 0 24 24",
|
|
9610
|
+
fill: "currentColor",
|
|
9412
9611
|
className: cn(
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
direction === "right" && "flex-row"
|
|
9612
|
+
// Expressive fast-spatial: FAB icon is small, high-emphasis — matches FAB enter motion
|
|
9613
|
+
"h-6 w-6 transition-transform",
|
|
9614
|
+
reducedMotion ? "" : "duration-expressive-fast-spatial ease-expressive-fast-spatial",
|
|
9615
|
+
isOpen && "rotate-45"
|
|
9418
9616
|
),
|
|
9419
|
-
|
|
9420
|
-
"
|
|
9421
|
-
children: indexedChildren
|
|
9617
|
+
"aria-hidden": "true",
|
|
9618
|
+
children: /* @__PURE__ */ jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
|
|
9422
9619
|
}
|
|
9423
9620
|
),
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
onPress: toggle,
|
|
9429
|
-
"aria-label": ariaLabel,
|
|
9430
|
-
"aria-expanded": isOpen,
|
|
9431
|
-
icon: /* @__PURE__ */ jsx(
|
|
9432
|
-
"svg",
|
|
9433
|
-
{
|
|
9434
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9435
|
-
viewBox: "0 0 24 24",
|
|
9436
|
-
fill: "currentColor",
|
|
9437
|
-
className: cn(
|
|
9438
|
-
"duration-short4 ease-standard h-6 w-6 transition-transform",
|
|
9439
|
-
isOpen && "rotate-45"
|
|
9440
|
-
),
|
|
9441
|
-
"aria-hidden": "true",
|
|
9442
|
-
children: /* @__PURE__ */ jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
|
|
9443
|
-
}
|
|
9444
|
-
),
|
|
9445
|
-
className: cn(isOpen && "shadow-elevation-4")
|
|
9446
|
-
}
|
|
9447
|
-
)
|
|
9448
|
-
]
|
|
9449
|
-
}
|
|
9450
|
-
) });
|
|
9621
|
+
className: cn(isOpen && "shadow-elevation-4")
|
|
9622
|
+
}
|
|
9623
|
+
)
|
|
9624
|
+
] }) });
|
|
9451
9625
|
}
|
|
9452
9626
|
);
|
|
9453
9627
|
FABMenu.displayName = "FABMenu";
|
|
9454
9628
|
var FABMenuItem = forwardRef(
|
|
9455
|
-
({
|
|
9629
|
+
({
|
|
9630
|
+
icon,
|
|
9631
|
+
label,
|
|
9632
|
+
"aria-label": ariaLabel,
|
|
9633
|
+
onPress,
|
|
9634
|
+
color = "primary-container",
|
|
9635
|
+
isDisabled = false,
|
|
9636
|
+
className,
|
|
9637
|
+
index = 0
|
|
9638
|
+
}, forwardedRef) => {
|
|
9456
9639
|
const internalRef = useRef(null);
|
|
9457
9640
|
const buttonRef = forwardedRef ?? internalRef;
|
|
9458
|
-
const { isOpen, isExiting,
|
|
9641
|
+
const { isOpen, isExiting, reducedMotion, itemCount, direction } = useFABMenuContext();
|
|
9642
|
+
if (process.env.NODE_ENV === "development") {
|
|
9643
|
+
if (!label && !ariaLabel) {
|
|
9644
|
+
console.warn(
|
|
9645
|
+
"[FABMenuItem] Either `label` or `aria-label` must be provided for accessibility."
|
|
9646
|
+
);
|
|
9647
|
+
}
|
|
9648
|
+
}
|
|
9649
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
9650
|
+
const handlePressStart = useCallback(() => setIsPressed(true), []);
|
|
9651
|
+
const handlePressEnd = useCallback(() => setIsPressed(false), []);
|
|
9652
|
+
const { isHovered, hoverProps } = useHover({ isDisabled });
|
|
9653
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
9459
9654
|
const { buttonProps } = useButton(
|
|
9460
9655
|
{
|
|
9461
|
-
...onPress
|
|
9462
|
-
|
|
9463
|
-
|
|
9656
|
+
...onPress ? { onPress } : {},
|
|
9657
|
+
isDisabled,
|
|
9658
|
+
onPressStart: handlePressStart,
|
|
9659
|
+
onPressEnd: handlePressEnd,
|
|
9660
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {},
|
|
9661
|
+
elementType: "button"
|
|
9464
9662
|
},
|
|
9465
9663
|
buttonRef
|
|
9466
9664
|
);
|
|
9467
|
-
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
9468
|
-
disabled: isDisabled
|
|
9469
|
-
});
|
|
9470
|
-
const mergedProps = mergeProps(buttonProps, {
|
|
9471
|
-
type: "button",
|
|
9472
|
-
onMouseDown: handleRipple
|
|
9473
|
-
});
|
|
9665
|
+
const { onMouseDown: handleRipple, ripples } = useRipple({ disabled: isDisabled });
|
|
9474
9666
|
const staggerDelay = reducedMotion ? 0 : isExiting ? Math.max(0, itemCount - 1 - index) * 30 : index * 30;
|
|
9667
|
+
const DIRECTION_ORIGIN = {
|
|
9668
|
+
up: "origin-bottom",
|
|
9669
|
+
down: "origin-top",
|
|
9670
|
+
left: "origin-right",
|
|
9671
|
+
right: "origin-left"
|
|
9672
|
+
};
|
|
9673
|
+
const originClass = reducedMotion ? void 0 : DIRECTION_ORIGIN[direction];
|
|
9475
9674
|
const animationClass = reducedMotion ? void 0 : isOpen ? "animate-md-scale-in" : isExiting ? "animate-md-scale-out" : void 0;
|
|
9476
|
-
const
|
|
9477
|
-
|
|
9478
|
-
|
|
9675
|
+
const mergedButtonProps = mergeProps$1(buttonProps, hoverProps, focusProps, {
|
|
9676
|
+
onMouseDown: handleRipple
|
|
9677
|
+
});
|
|
9678
|
+
const {
|
|
9679
|
+
isDisabled: _isDisabled,
|
|
9680
|
+
onPress: _onPress,
|
|
9681
|
+
onPressStart: _onPressStart,
|
|
9682
|
+
onPressEnd: _onPressEnd,
|
|
9683
|
+
onPressChange: _onPressChange,
|
|
9684
|
+
onPressUp: _onPressUp,
|
|
9685
|
+
...htmlButtonProps
|
|
9686
|
+
} = mergedButtonProps;
|
|
9479
9687
|
return /* @__PURE__ */ jsxs(
|
|
9480
|
-
"
|
|
9688
|
+
"button",
|
|
9481
9689
|
{
|
|
9690
|
+
...htmlButtonProps,
|
|
9691
|
+
ref: buttonRef,
|
|
9692
|
+
type: "button",
|
|
9693
|
+
...getInteractionDataAttributes({
|
|
9694
|
+
isHovered,
|
|
9695
|
+
isFocusVisible,
|
|
9696
|
+
isPressed,
|
|
9697
|
+
isDisabled
|
|
9698
|
+
}),
|
|
9699
|
+
"data-with-icon": icon ? "" : void 0,
|
|
9700
|
+
"data-with-label": label ? "" : void 0,
|
|
9482
9701
|
className: cn(
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9702
|
+
fabMenuItemVariants({ color }),
|
|
9703
|
+
// group/fab-menu-item: enables group-data-[x]/fab-menu-item child selectors in all slots
|
|
9704
|
+
"group/fab-menu-item",
|
|
9705
|
+
// Scale pivot toward the FAB so items appear to emanate from the trigger
|
|
9706
|
+
originClass,
|
|
9707
|
+
// Stagger animation class (animate-md-scale-in / animate-md-scale-out)
|
|
9708
|
+
animationClass,
|
|
9486
9709
|
className
|
|
9487
9710
|
),
|
|
9711
|
+
style: staggerDelay > 0 ? { animationDelay: `${staggerDelay}ms` } : void 0,
|
|
9488
9712
|
children: [
|
|
9489
|
-
|
|
9490
|
-
/* @__PURE__ */
|
|
9491
|
-
"
|
|
9713
|
+
ripples,
|
|
9714
|
+
/* @__PURE__ */ jsx(
|
|
9715
|
+
"span",
|
|
9492
9716
|
{
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
"relative flex size-10 items-center justify-center overflow-hidden rounded-xl",
|
|
9497
|
-
"bg-primary-container text-on-primary-container shadow-elevation-3",
|
|
9498
|
-
animationClass
|
|
9499
|
-
),
|
|
9500
|
-
style: staggerDelay > 0 ? { animationDelay: `${staggerDelay}ms` } : void 0,
|
|
9501
|
-
children: [
|
|
9502
|
-
/* @__PURE__ */ jsx(
|
|
9503
|
-
"span",
|
|
9504
|
-
{
|
|
9505
|
-
"data-state-layer": true,
|
|
9506
|
-
className: "bg-on-primary-container duration-spring-standard-fast-effects ease-spring-standard-fast-effects pointer-events-none absolute inset-0 rounded-xl opacity-0 transition-opacity hover:opacity-8"
|
|
9507
|
-
}
|
|
9508
|
-
),
|
|
9509
|
-
ripples,
|
|
9510
|
-
/* @__PURE__ */ jsx("span", { className: "relative z-10 inline-flex shrink-0", children: icon })
|
|
9511
|
-
]
|
|
9717
|
+
className: cn(fabMenuItemStateLayerVariants({ color })),
|
|
9718
|
+
"data-state-layer": true,
|
|
9719
|
+
"aria-hidden": "true"
|
|
9512
9720
|
}
|
|
9513
9721
|
),
|
|
9514
|
-
|
|
9722
|
+
/* @__PURE__ */ jsx("span", { className: cn(fabMenuItemFocusRingVariants()), "aria-hidden": "true" }),
|
|
9723
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn(fabMenuItemIconVariants()), "aria-hidden": "true", children: icon }),
|
|
9724
|
+
label && /* @__PURE__ */ jsx("span", { className: cn(fabMenuItemLabelVariants()), children: label })
|
|
9515
9725
|
]
|
|
9516
9726
|
}
|
|
9517
9727
|
);
|
|
@@ -15067,6 +15277,6 @@ var DateField = forwardRef((props, forwardedRef) => {
|
|
|
15067
15277
|
});
|
|
15068
15278
|
DateField.displayName = "DateField";
|
|
15069
15279
|
|
|
15070
|
-
export { AppBar, AppBarHeadless, Badge, BadgeContent, BadgeHeadless, BottomSheet, BottomSheetContext, BottomSheetHandle, BottomSheetHeadless, Button, ButtonGroup, ButtonGroupContext, ButtonGroupHeadless, CalendarCore, Card, CardActions, CardContent, CardHeader, CardHeadless, CardMedia, Checkbox, Chip, ChipHeadless, ChipSet, DateField, DatePicker, DatePickerDocked, DatePickerModal, DatePickerModalInput, Dialog, DialogActions, DialogContent, DialogContext, DialogHeadless, DialogHeadline, Divider, DividerHeadless, Drawer, DrawerIconOnlyContext, DrawerItem, DrawerSection, FAB, FABHeadless, FABMenu, FABMenuContext, FABMenuHeadless, FABMenuItem, HeadlessDrawer, HeadlessDrawerItem, HeadlessMenu, HeadlessMenuDivider, HeadlessMenuItem, HeadlessMenuSection, HeadlessMenuTrigger, HeadlessNavigationBar, HeadlessNavigationBarItem, HeadlessTab, HeadlessTabList, HeadlessTabPanel, IconButton, IconButtonHeadless, List, ListHeadless, ListItem, ListItemHeadless, ListItemLeading, ListItemText, ListItemTrailing, Menu, MenuContext, MenuDivider, MenuItem, MenuSection, MenuTrigger, NavigationBar, NavigationBarItem, Progress, ProgressHeadless, Radio, RadioGroup, RadioGroupHeadless, RadioHeadless, RichTooltip, STATE_LAYER_OPACITY, Search, SearchBar, SearchBarHeadless, SearchView, SearchViewHeadless, Slider, SliderHeadless, Snackbar, SnackbarContext, SnackbarHeadless, SnackbarProvider, SplitButton, SplitButtonHeadless, Switch, TYPOGRAPHY_ELEMENT_MAP, TYPOGRAPHY_USAGE, Tab, TabList, TabPanel, Tabs, TextField, TimePicker, TimePickerDial, TimePickerInput, Tooltip, TooltipOverlayHeadless, TooltipTrigger, TooltipTriggerHeadless, applyStateLayer, badgeVariants2 as badgeVariants, bottomSheetAnimationVariants, bottomSheetHandlePillVariants, bottomSheetHandleWrapperVariants, bottomSheetScrimVariants, bottomSheetVariants, buttonGroupFocusRingVariants, buttonGroupRootVariants, buttonGroupVariants, calendarCellVariants, cardVariants, chipVariants, clockDialContainerVariants, clockDialNumberVariants, clockHandCenterVariants, clockHandHandleVariants, clockHandTrackVariants, cn, datePickerActionButtonVariants, datePickerActionVariants, datePickerContainerVariants, datePickerDividerVariants, datePickerHeaderVariants, datePickerHeadlineVariants, datePickerNavVariants, datePickerRangeIndicatorVariants, datePickerScrimVariants, datePickerSupportingTextVariants, datePickerWeekdayVariants, dividerVariants, fabMenuItemVariants, fabMenuVariants, generateMD3Theme, getColorValue, getConnectedRadiusClasses, getFontFamily, getMD3Color, getResponsiveTypography, getTypographyClassName, getTypographyForElement, getTypographyStyle, getTypographyToken, hexToRgb, listItemVariants, listVariants, periodSelectorContainerVariants, periodSelectorItemVariants, pxToRem, remToPx, rgbToHex, richTooltipVariants, searchBarVariants, searchViewHeaderVariants, searchViewVariants, sliderActiveTrackVariants, sliderContainerVariants, sliderHandleStateLayerVariants, sliderHandleVariants, sliderInactiveTrackVariants, sliderTrackLayoutVariants, splitButtonContainerVariants, splitButtonDropdownVariants, splitButtonPrimaryVariants, splitButtonVariants, timeInputFieldVariants, timePickerActionButtonVariants, timePickerActionRowVariants, timePickerContainerVariants, timePickerHeadlineVariants, timePickerModeToggleVariants, timeSelectorContainerVariants, timeSeparatorVariants, tooltipVariants, truncateText, useBottomSheetContext, useBottomSheetDrag, useButtonGroup, useDialogContext, useFABMenuContext, useMenuContext, useOptionalButtonGroup, useSnackbar, withOpacity, yearItemVariants };
|
|
15280
|
+
export { AppBar, AppBarHeadless, Badge, BadgeContent, BadgeHeadless, BottomSheet, BottomSheetContext, BottomSheetHandle, BottomSheetHeadless, Button, ButtonGroup, ButtonGroupContext, ButtonGroupHeadless, CalendarCore, Card, CardActions, CardContent, CardHeader, CardHeadless, CardMedia, Checkbox, Chip, ChipHeadless, ChipSet, DateField, DatePicker, DatePickerDocked, DatePickerModal, DatePickerModalInput, Dialog, DialogActions, DialogContent, DialogContext, DialogHeadless, DialogHeadline, Divider, DividerHeadless, Drawer, DrawerIconOnlyContext, DrawerItem, DrawerSection, FAB, FABHeadless, FABMenu, FABMenuContext, FABMenuHeadless, FABMenuItem, HeadlessDrawer, HeadlessDrawerItem, HeadlessMenu, HeadlessMenuDivider, HeadlessMenuItem, HeadlessMenuSection, HeadlessMenuTrigger, HeadlessNavigationBar, HeadlessNavigationBarItem, HeadlessTab, HeadlessTabList, HeadlessTabPanel, IconButton, IconButtonHeadless, List, ListHeadless, ListItem, ListItemHeadless, ListItemLeading, ListItemText, ListItemTrailing, Menu, MenuContext, MenuDivider, MenuItem, MenuSection, MenuTrigger, NavigationBar, NavigationBarItem, Progress, ProgressHeadless, Radio, RadioGroup, RadioGroupHeadless, RadioHeadless, RichTooltip, STATE_LAYER_OPACITY, Search, SearchBar, SearchBarHeadless, SearchView, SearchViewHeadless, Slider, SliderHeadless, Snackbar, SnackbarContext, SnackbarHeadless, SnackbarProvider, SplitButton, SplitButtonHeadless, Switch, TYPOGRAPHY_ELEMENT_MAP, TYPOGRAPHY_USAGE, Tab, TabList, TabPanel, Tabs, TextField, TimePicker, TimePickerDial, TimePickerInput, Tooltip, TooltipOverlayHeadless, TooltipTrigger, TooltipTriggerHeadless, applyStateLayer, badgeVariants2 as badgeVariants, bottomSheetAnimationVariants, bottomSheetHandlePillVariants, bottomSheetHandleWrapperVariants, bottomSheetScrimVariants, bottomSheetVariants, buttonGroupFocusRingVariants, buttonGroupRootVariants, buttonGroupVariants, calendarCellVariants, cardVariants, chipVariants, clockDialContainerVariants, clockDialNumberVariants, clockHandCenterVariants, clockHandHandleVariants, clockHandTrackVariants, cn, datePickerActionButtonVariants, datePickerActionVariants, datePickerContainerVariants, datePickerDividerVariants, datePickerHeaderVariants, datePickerHeadlineVariants, datePickerNavVariants, datePickerRangeIndicatorVariants, datePickerScrimVariants, datePickerSupportingTextVariants, datePickerWeekdayVariants, dividerVariants, fabMenuItemFocusRingVariants, fabMenuItemIconVariants, fabMenuItemLabelVariants, fabMenuItemStateLayerVariants, fabMenuItemVariants, fabMenuListVariants, fabMenuVariants, generateMD3Theme, getColorValue, getConnectedRadiusClasses, getFontFamily, getMD3Color, getResponsiveTypography, getTypographyClassName, getTypographyForElement, getTypographyStyle, getTypographyToken, hexToRgb, listItemVariants, listVariants, periodSelectorContainerVariants, periodSelectorItemVariants, pxToRem, remToPx, rgbToHex, richTooltipVariants, searchBarVariants, searchViewHeaderVariants, searchViewVariants, sliderActiveTrackVariants, sliderContainerVariants, sliderHandleStateLayerVariants, sliderHandleVariants, sliderInactiveTrackVariants, sliderTrackLayoutVariants, splitButtonContainerVariants, splitButtonDropdownVariants, splitButtonPrimaryVariants, splitButtonVariants, timeInputFieldVariants, timePickerActionButtonVariants, timePickerActionRowVariants, timePickerContainerVariants, timePickerHeadlineVariants, timePickerModeToggleVariants, timeSelectorContainerVariants, timeSeparatorVariants, tooltipVariants, truncateText, useBottomSheetContext, useBottomSheetDrag, useButtonGroup, useDialogContext, useFABMenuContext, useMenuContext, useOptionalButtonGroup, useSnackbar, withOpacity, yearItemVariants };
|
|
15071
15281
|
//# sourceMappingURL=index.js.map
|
|
15072
15282
|
//# sourceMappingURL=index.js.map
|