@shohojdhara/atomix 0.6.3 → 0.6.5
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/atomix.css +119 -40
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/atomix.umd.js +1 -1
- package/dist/atomix.umd.js.map +1 -1
- package/dist/atomix.umd.min.js +1 -1
- package/dist/charts.d.ts +30 -1
- package/dist/charts.js +566 -597
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +30 -1
- package/dist/core.js +600 -624
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +30 -1
- package/dist/forms.js +1122 -1163
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +31 -89
- package/dist/heavy.js +1015 -1045
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +378 -104
- package/dist/index.esm.js +10959 -10837
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10935 -10812
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +2 -5
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +14 -16
- package/src/components/AtomixGlass/AtomixGlass.tsx +137 -355
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +32 -249
- package/src/components/AtomixGlass/GlassFilter.tsx +62 -68
- package/src/components/AtomixGlass/README.md +2 -1
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +19 -18
- package/src/components/AtomixGlass/glass-border-styles.test.ts +58 -0
- package/src/components/AtomixGlass/glass-border-styles.ts +136 -0
- package/src/components/AtomixGlass/glass-utils.ts +411 -6
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +158 -537
- package/src/components/AtomixGlass/stories/Border.stories.tsx +149 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +229 -89
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +29 -340
- package/src/components/AtomixGlass/stories/argTypes.ts +30 -13
- package/src/components/AtomixGlass/stories/premium-presets.ts +206 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +52 -8
- package/src/components/Badge/Badge.tsx +4 -4
- package/src/components/Button/Button.tsx +2 -6
- package/src/components/Callout/Callout.test.tsx +4 -3
- package/src/components/Callout/Callout.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +3 -7
- package/src/components/Form/Checkbox.tsx +2 -8
- package/src/components/Form/Input.tsx +2 -9
- package/src/components/Form/Radio.tsx +2 -9
- package/src/components/Form/Select.tsx +2 -7
- package/src/components/Form/Textarea.tsx +2 -9
- package/src/components/Messages/Messages.tsx +2 -8
- package/src/components/Modal/Modal.tsx +4 -5
- package/src/components/Navigation/Nav/Nav.tsx +2 -6
- package/src/components/Navigation/Navbar/Navbar.tsx +2 -9
- package/src/components/Navigation/SideMenu/SideMenu.tsx +2 -6
- package/src/components/Pagination/Pagination.tsx +2 -10
- package/src/components/Popover/Popover.tsx +2 -9
- package/src/components/Progress/Progress.tsx +2 -7
- package/src/components/Rating/Rating.tsx +2 -10
- package/src/components/Spinner/Spinner.tsx +2 -7
- package/src/components/Steps/Steps.tsx +2 -10
- package/src/components/Tabs/Tabs.tsx +2 -9
- package/src/components/Toggle/Toggle.tsx +2 -10
- package/src/components/Tooltip/Tooltip.tsx +2 -5
- package/src/lib/composables/useAtomixGlass.ts +41 -10
- package/src/lib/composables/useAtomixGlassStyles.ts +59 -75
- package/src/lib/composables/usePerformanceMonitor.ts +5 -0
- package/src/lib/constants/components.ts +358 -46
- package/src/lib/types/components.ts +33 -1
- package/src/styles/01-settings/_settings.atomix-glass.scss +69 -31
- package/src/styles/02-tools/_tools.glass.scss +45 -3
- package/src/styles/06-components/_components.atomix-glass.scss +114 -77
- package/src/components/AtomixGlass/deprecated/AtomixGlass.deprecated.tsx +0 -390
|
@@ -1620,6 +1620,311 @@ export const FOOTER = {
|
|
|
1620
1620
|
},
|
|
1621
1621
|
};
|
|
1622
1622
|
|
|
1623
|
+
/**
|
|
1624
|
+
* Per-component AtomixGlass default configurations.
|
|
1625
|
+
*
|
|
1626
|
+
* These are the canonical glass-effect settings used by each component when
|
|
1627
|
+
* `glass={true}` is passed and no override props are supplied. They follow the
|
|
1628
|
+
* Apple "liquid glass" design language introduced in the AtomixGlass refinement:
|
|
1629
|
+
*
|
|
1630
|
+
* - Displacement is lower than the raw ATOMIX_GLASS.DEFAULTS (55) for tight
|
|
1631
|
+
* UI elements (Button, Badge, Accordion) and raised for overlay/panel surfaces.
|
|
1632
|
+
* - Elasticity is 0 for all static / overlay components — only interactive
|
|
1633
|
+
* standalone glass cards should use non-zero elasticity.
|
|
1634
|
+
* - Shader mode is enabled for surfaces ≥ "medium" viewport area (Navbar, Nav,
|
|
1635
|
+
* Popover, Tabs) where the refraction effect is visible and worth the cost.
|
|
1636
|
+
* - blurAmount is omitted where the SCSS $glass-backdrop-filter token is
|
|
1637
|
+
* sufficient on its own (Button, Accordion, Dropdown, EdgePanel).
|
|
1638
|
+
*/
|
|
1639
|
+
export const GLASS_DEFAULTS = {
|
|
1640
|
+
/**
|
|
1641
|
+
* Button — compact interactive element.
|
|
1642
|
+
* Low displacement + no blur override so the backdrop token handles frosting.
|
|
1643
|
+
* Zero elasticity: the button itself handles press/hover feedback.
|
|
1644
|
+
*/
|
|
1645
|
+
BUTTON: {
|
|
1646
|
+
displacementScale: 16,
|
|
1647
|
+
saturation: 180,
|
|
1648
|
+
elasticity: 0,
|
|
1649
|
+
},
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Badge — pill-shaped tag. Tiny surface, minimal distortion.
|
|
1653
|
+
* borderRadius is set dynamically at runtime; this serves as a safe fallback.
|
|
1654
|
+
*/
|
|
1655
|
+
BADGE: {
|
|
1656
|
+
displacementScale: 14,
|
|
1657
|
+
borderRadius: 16,
|
|
1658
|
+
elasticity: 0,
|
|
1659
|
+
},
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Accordion — block-level content container.
|
|
1663
|
+
* Gentle displacement; zero elasticity so open/close animation isn't jittery.
|
|
1664
|
+
*/
|
|
1665
|
+
ACCORDION: {
|
|
1666
|
+
displacementScale: 18,
|
|
1667
|
+
elasticity: 0,
|
|
1668
|
+
},
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Callout — notification / alert banner.
|
|
1672
|
+
* Slightly more frosted than Accordion to give it visual priority.
|
|
1673
|
+
*/
|
|
1674
|
+
CALLOUT: {
|
|
1675
|
+
displacementScale: 22,
|
|
1676
|
+
borderRadius: 8,
|
|
1677
|
+
elasticity: 0,
|
|
1678
|
+
},
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Dropdown — floating menu. Small surface, should feel light and airy.
|
|
1682
|
+
* No blur override — rely on the backdrop token.
|
|
1683
|
+
*/
|
|
1684
|
+
DROPDOWN: {
|
|
1685
|
+
displacementScale: 16,
|
|
1686
|
+
elasticity: 0,
|
|
1687
|
+
},
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* EdgePanel — full-height side drawer.
|
|
1691
|
+
* Empty config: the panel inherits all ATOMIX_GLASS.DEFAULTS.
|
|
1692
|
+
* borderRadius and size are managed by the panel's own SCSS.
|
|
1693
|
+
*/
|
|
1694
|
+
EDGE_PANEL: {} as Record<string, never>,
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* Modal — full-screen overlay dialog. Shader mode for premium refraction.
|
|
1698
|
+
* displacementScale omitted — set dynamically from modal content height at runtime.
|
|
1699
|
+
* elasticity: 0 — modals should not wobble when the user interacts with them.
|
|
1700
|
+
*/
|
|
1701
|
+
MODAL: {
|
|
1702
|
+
blurAmount: 28,
|
|
1703
|
+
elasticity: 0,
|
|
1704
|
+
mode: 'shader' as const,
|
|
1705
|
+
shaderMode: 'premiumGlass',
|
|
1706
|
+
},
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Navbar — sticky / fixed navigation bar spanning full width.
|
|
1710
|
+
* Shader gives the top edge a polished lens look.
|
|
1711
|
+
* borderRadius: 0 — navbars run edge-to-edge.
|
|
1712
|
+
* elasticity: 0 — no wobble on a fixed chrome element.
|
|
1713
|
+
*/
|
|
1714
|
+
NAVBAR: {
|
|
1715
|
+
displacementScale: 24,
|
|
1716
|
+
blurAmount: 24,
|
|
1717
|
+
borderRadius: 0,
|
|
1718
|
+
elasticity: 0,
|
|
1719
|
+
mode: 'shader' as const,
|
|
1720
|
+
shaderVariant: 'premiumGlass' as const,
|
|
1721
|
+
},
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Nav (inline nav list) — narrower than a full Navbar, standard mode is
|
|
1725
|
+
* enough. Rounded corners to match typical pill / tab nav designs.
|
|
1726
|
+
*/
|
|
1727
|
+
NAV: {
|
|
1728
|
+
displacementScale: 24,
|
|
1729
|
+
blurAmount: 20,
|
|
1730
|
+
borderRadius: 8,
|
|
1731
|
+
elasticity: 0,
|
|
1732
|
+
mode: 'shader' as const,
|
|
1733
|
+
},
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* SideMenu — persistent sidebar navigation.
|
|
1737
|
+
* Moderate displacement; shader for depth. Zero elasticity.
|
|
1738
|
+
*/
|
|
1739
|
+
SIDE_MENU: {
|
|
1740
|
+
displacementScale: 24,
|
|
1741
|
+
blurAmount: 24,
|
|
1742
|
+
borderRadius: 0,
|
|
1743
|
+
elasticity: 0,
|
|
1744
|
+
mode: 'shader' as const,
|
|
1745
|
+
},
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* Popover — small floating card above content.
|
|
1749
|
+
* Shader mode + aberration for the characteristic lens fringe.
|
|
1750
|
+
* Low displacement so the content remains readable.
|
|
1751
|
+
*/
|
|
1752
|
+
POPOVER: {
|
|
1753
|
+
displacementScale: 22,
|
|
1754
|
+
blurAmount: 20,
|
|
1755
|
+
saturation: 180,
|
|
1756
|
+
aberrationIntensity: 0.35,
|
|
1757
|
+
borderRadius: 12,
|
|
1758
|
+
elasticity: 0,
|
|
1759
|
+
mode: 'shader' as const,
|
|
1760
|
+
},
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* Tooltip — tiny single-line label.
|
|
1764
|
+
* Higher displacement than other small elements because tooltips float
|
|
1765
|
+
* freely and the distortion reads as depth. No shader (too small to matter).
|
|
1766
|
+
*/
|
|
1767
|
+
TOOLTIP: {
|
|
1768
|
+
displacementScale: 18,
|
|
1769
|
+
blurAmount: 16,
|
|
1770
|
+
elasticity: 0,
|
|
1771
|
+
},
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Tabs — tabbed content panel. Shader for the nav strip refraction.
|
|
1775
|
+
*/
|
|
1776
|
+
TABS: {
|
|
1777
|
+
displacementScale: 24,
|
|
1778
|
+
blurAmount: 20,
|
|
1779
|
+
saturation: 180,
|
|
1780
|
+
aberrationIntensity: 0.35,
|
|
1781
|
+
borderRadius: 12,
|
|
1782
|
+
elasticity: 0,
|
|
1783
|
+
mode: 'shader' as const,
|
|
1784
|
+
},
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* Toggle — switch control. Compact, pill shape.
|
|
1788
|
+
* Relies on borderRadius from the component's own SCSS.
|
|
1789
|
+
*/
|
|
1790
|
+
TOGGLE: {
|
|
1791
|
+
displacementScale: 16,
|
|
1792
|
+
elasticity: 0,
|
|
1793
|
+
},
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* Form inputs (Input, Textarea, Select, Checkbox, Radio).
|
|
1797
|
+
* Unified glass feel for all form controls — subtle displacement,
|
|
1798
|
+
* rounded corners matching the $input-border-radius token (≈ 6px).
|
|
1799
|
+
*/
|
|
1800
|
+
INPUT: {
|
|
1801
|
+
displacementScale: 18,
|
|
1802
|
+
borderRadius: 6,
|
|
1803
|
+
elasticity: 0,
|
|
1804
|
+
},
|
|
1805
|
+
TEXTAREA: {
|
|
1806
|
+
displacementScale: 18,
|
|
1807
|
+
borderRadius: 6,
|
|
1808
|
+
elasticity: 0,
|
|
1809
|
+
},
|
|
1810
|
+
SELECT: {
|
|
1811
|
+
displacementScale: 18,
|
|
1812
|
+
borderRadius: 6,
|
|
1813
|
+
elasticity: 0,
|
|
1814
|
+
},
|
|
1815
|
+
CHECKBOX: {
|
|
1816
|
+
displacementScale: 14,
|
|
1817
|
+
borderRadius: 4,
|
|
1818
|
+
elasticity: 0,
|
|
1819
|
+
},
|
|
1820
|
+
RADIO: {
|
|
1821
|
+
displacementScale: 14,
|
|
1822
|
+
borderRadius: 99,
|
|
1823
|
+
elasticity: 0,
|
|
1824
|
+
},
|
|
1825
|
+
|
|
1826
|
+
/**
|
|
1827
|
+
* Pagination — row of page buttons.
|
|
1828
|
+
* Thin, horizontal strip; low displacement so numbers stay legible.
|
|
1829
|
+
*/
|
|
1830
|
+
PAGINATION: {
|
|
1831
|
+
displacementScale: 18,
|
|
1832
|
+
borderRadius: 8,
|
|
1833
|
+
elasticity: 0,
|
|
1834
|
+
},
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Progress — horizontal bar track.
|
|
1838
|
+
* Very low displacement — the bar should not distort.
|
|
1839
|
+
*/
|
|
1840
|
+
PROGRESS: {
|
|
1841
|
+
displacementScale: 10,
|
|
1842
|
+
borderRadius: 99,
|
|
1843
|
+
elasticity: 0,
|
|
1844
|
+
},
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Rating — star picker.
|
|
1848
|
+
* Compact inline element; minimal glass, no shader needed.
|
|
1849
|
+
*/
|
|
1850
|
+
RATING: {
|
|
1851
|
+
displacementScale: 16,
|
|
1852
|
+
elasticity: 0,
|
|
1853
|
+
},
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* Spinner — loading indicator.
|
|
1857
|
+
* Barely-there glass; the spinner itself provides visual interest.
|
|
1858
|
+
*/
|
|
1859
|
+
SPINNER: {
|
|
1860
|
+
displacementScale: 12,
|
|
1861
|
+
elasticity: 0,
|
|
1862
|
+
},
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Steps — horizontal / vertical stepper.
|
|
1866
|
+
* Moderate displacement so the connector lines remain crisp.
|
|
1867
|
+
*/
|
|
1868
|
+
STEPS: {
|
|
1869
|
+
displacementScale: 22,
|
|
1870
|
+
borderRadius: 8,
|
|
1871
|
+
elasticity: 0,
|
|
1872
|
+
},
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Messages / chat bubbles.
|
|
1876
|
+
* Rounded pill-like bubbles; gentle glass to aid readability.
|
|
1877
|
+
*/
|
|
1878
|
+
MESSAGES: {
|
|
1879
|
+
displacementScale: 20,
|
|
1880
|
+
borderRadius: 16,
|
|
1881
|
+
elasticity: 0,
|
|
1882
|
+
},
|
|
1883
|
+
} as const;
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* Liquid glass border gradient math (canonical; mirrors _settings.atomix-glass.scss).
|
|
1887
|
+
*/
|
|
1888
|
+
export const GLASS_BORDER_GRADIENT = {
|
|
1889
|
+
BASE_ANGLE: 135,
|
|
1890
|
+
ANGLE_MULTIPLIER: 0.5,
|
|
1891
|
+
VELOCITY_ANGLE_MULTIPLIER: 0.5,
|
|
1892
|
+
CHROMATIC_OFFSET: 1.5,
|
|
1893
|
+
STOP_1: {
|
|
1894
|
+
MIN: 10,
|
|
1895
|
+
BASE: 33,
|
|
1896
|
+
get MULTIPLIER() {
|
|
1897
|
+
return this.BASE * 0.009;
|
|
1898
|
+
},
|
|
1899
|
+
},
|
|
1900
|
+
STOP_2: {
|
|
1901
|
+
MAX: 90,
|
|
1902
|
+
BASE: 66,
|
|
1903
|
+
get MULTIPLIER() {
|
|
1904
|
+
return this.BASE * 0.006;
|
|
1905
|
+
},
|
|
1906
|
+
},
|
|
1907
|
+
OPACITY: {
|
|
1908
|
+
/** Matches $glass-border-1-opacity (0.08) */
|
|
1909
|
+
BASE_1: 0.08,
|
|
1910
|
+
get BASE_2() {
|
|
1911
|
+
return this.BASE_1 * 3.33;
|
|
1912
|
+
},
|
|
1913
|
+
get BASE_3() {
|
|
1914
|
+
return this.BASE_1 * 2.66;
|
|
1915
|
+
},
|
|
1916
|
+
get BASE_4() {
|
|
1917
|
+
return this.BASE_1 * 5;
|
|
1918
|
+
},
|
|
1919
|
+
get MULTIPLIER_LOW() {
|
|
1920
|
+
return this.BASE_1 * 0.066;
|
|
1921
|
+
},
|
|
1922
|
+
get MULTIPLIER_HIGH() {
|
|
1923
|
+
return this.BASE_1 * 0.1;
|
|
1924
|
+
},
|
|
1925
|
+
},
|
|
1926
|
+
} as const;
|
|
1927
|
+
|
|
1623
1928
|
/**
|
|
1624
1929
|
* AtomixGlass-specific constants
|
|
1625
1930
|
*/
|
|
@@ -1634,6 +1939,18 @@ export const ATOMIX_GLASS = {
|
|
|
1634
1939
|
BORDER_BACKDROP_CLASS: 'c-atomix-glass__border-backdrop',
|
|
1635
1940
|
BORDER_1_CLASS: 'c-atomix-glass__border-1',
|
|
1636
1941
|
BORDER_2_CLASS: 'c-atomix-glass__border-2',
|
|
1942
|
+
/** Centralized liquid glass rim configuration */
|
|
1943
|
+
BORDER: {
|
|
1944
|
+
WIDTH_CSS_VAR: '--atomix-glass-border-width',
|
|
1945
|
+
DEFAULT_WIDTH: '0.5px',
|
|
1946
|
+
GRADIENT_CSS_VARS: {
|
|
1947
|
+
GRADIENT_1: '--atomix-glass-border-gradient-1',
|
|
1948
|
+
GRADIENT_2: '--atomix-glass-border-gradient-2',
|
|
1949
|
+
},
|
|
1950
|
+
GRADIENT: GLASS_BORDER_GRADIENT,
|
|
1951
|
+
OVER_LIGHT: { opacity: 0.7 },
|
|
1952
|
+
DARK: { opacity: 0.35 },
|
|
1953
|
+
},
|
|
1637
1954
|
HOVER_1_CLASS: 'c-atomix-glass__hover-1',
|
|
1638
1955
|
HOVER_2_CLASS: 'c-atomix-glass__hover-2',
|
|
1639
1956
|
HOVER_3_CLASS: 'c-atomix-glass__hover-3',
|
|
@@ -1662,21 +1979,22 @@ export const ATOMIX_GLASS = {
|
|
|
1662
1979
|
SHADER: 'c-atomix-glass--shader',
|
|
1663
1980
|
},
|
|
1664
1981
|
DEFAULTS: {
|
|
1665
|
-
|
|
1982
|
+
/** Subtle refraction — Apple UI chrome avoids heavy liquid distortion */
|
|
1983
|
+
DISPLACEMENT_SCALE: 28,
|
|
1666
1984
|
get BLUR_AMOUNT() {
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
get SATURATION() {
|
|
1670
|
-
return 100 + (this.DISPLACEMENT_SCALE * 0.5); // Saturate relative to intensity
|
|
1985
|
+
// Apple Music sidebar / player bar: ~20–40px frost (see $glass-backdrop-filter)
|
|
1986
|
+
return Math.max(20, this.DISPLACEMENT_SCALE * 0.72);
|
|
1671
1987
|
},
|
|
1988
|
+
/** Fixed 180% matches Apple's saturate(180%) backdrop recipe */
|
|
1989
|
+
SATURATION: 180,
|
|
1672
1990
|
get ABERRATION_INTENSITY() {
|
|
1673
|
-
return this.DISPLACEMENT_SCALE * 0.
|
|
1991
|
+
return this.DISPLACEMENT_SCALE * 0.02;
|
|
1674
1992
|
},
|
|
1675
|
-
ELASTICITY: 0.
|
|
1993
|
+
ELASTICITY: 0.05,
|
|
1676
1994
|
get CORNER_RADIUS() {
|
|
1677
1995
|
return 16; // Use 16 to match SCSS design system (was 20)
|
|
1678
1996
|
},
|
|
1679
|
-
|
|
1997
|
+
|
|
1680
1998
|
MODE: 'standard' as const,
|
|
1681
1999
|
OVER_LIGHT: false as const,
|
|
1682
2000
|
ENABLE_OVER_LIGHT_LAYERS: true,
|
|
@@ -1692,19 +2010,19 @@ export const ATOMIX_GLASS = {
|
|
|
1692
2010
|
},
|
|
1693
2011
|
CONSTANTS: {
|
|
1694
2012
|
ACTIVATION_ZONE: 200,
|
|
1695
|
-
LERP_FACTOR: 0.
|
|
2013
|
+
LERP_FACTOR: 0.05, // Lower = more viscous, liquid-smooth tracking (Apple feel)
|
|
1696
2014
|
SMOOTHSTEP_POWER: 2.5,
|
|
1697
2015
|
MIN_BLUR: 0.1,
|
|
1698
2016
|
MOUSE_INFLUENCE_DIVISOR: 100,
|
|
1699
2017
|
EDGE_FADE_PIXELS: 2,
|
|
1700
|
-
// Elasticity physics constants
|
|
1701
|
-
ELASTICITY_TRANSLATION_FACTOR: 0.1
|
|
2018
|
+
// Elasticity physics constants — Apple-tuned: soft springs, fast settling, minimal stretch
|
|
2019
|
+
ELASTICITY_TRANSLATION_FACTOR: 0.06, // Subtler elastic shift (was 0.1)
|
|
1702
2020
|
ELASTICITY_DISTANCE_THRESHOLD: 200,
|
|
1703
2021
|
ELASTICITY_COMPRESSION_FACTOR: 0.3,
|
|
1704
|
-
ELASTICITY_STIFFNESS: 0.1
|
|
1705
|
-
ELASTICITY_DAMPING: 0.76
|
|
2022
|
+
ELASTICITY_STIFFNESS: 0.06, // Softer springs = gentler motion (was 0.1)
|
|
2023
|
+
ELASTICITY_DAMPING: 0.88, // Fast settling, no wobble (was 0.76)
|
|
1706
2024
|
ELASTICITY_VELOCITY_FACTOR: 0.65,
|
|
1707
|
-
ELASTICITY_STRETCH_RATIO: 0.45
|
|
2025
|
+
ELASTICITY_STRETCH_RATIO: 0.25, // Less visible surface tension stretch (was 0.45)
|
|
1708
2026
|
ELASTICITY_MAGNIFICATION_BASE: 1.02,
|
|
1709
2027
|
// Note: This default must match the SCSS variable --atomix-radius-md
|
|
1710
2028
|
// @see src/styles/01-settings/_settings.global.scss
|
|
@@ -1719,28 +2037,16 @@ export const ATOMIX_GLASS = {
|
|
|
1719
2037
|
|
|
1720
2038
|
// Gradient calculation constants
|
|
1721
2039
|
GRADIENT: {
|
|
1722
|
-
BASE_ANGLE:
|
|
1723
|
-
ANGLE_MULTIPLIER:
|
|
1724
|
-
VELOCITY_ANGLE_MULTIPLIER:
|
|
1725
|
-
CHROMATIC_OFFSET:
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
MAX: 90, // Maximum percentage for border stop 2
|
|
1733
|
-
BASE: 66, // Base percentage for border stop 2
|
|
1734
|
-
get MULTIPLIER() { return this.BASE * 0.006; }, // Multiplier for mouse Y influence
|
|
1735
|
-
},
|
|
1736
|
-
BORDER_OPACITY: {
|
|
1737
|
-
BASE_1: 0.12, // Base opacity for border gradient 1
|
|
1738
|
-
get BASE_2() { return this.BASE_1 * 3.33; }, // Base opacity for border gradient 2
|
|
1739
|
-
get BASE_3() { return this.BASE_1 * 2.66; }, // Base opacity for border gradient 3
|
|
1740
|
-
get BASE_4() { return this.BASE_1 * 5; }, // Base opacity for border gradient 4
|
|
1741
|
-
get MULTIPLIER_LOW() { return this.BASE_1 * 0.066; }, // Low multiplier for mouse influence on opacity
|
|
1742
|
-
get MULTIPLIER_HIGH() { return this.BASE_1 * 0.1; }, // High multiplier for mouse influence on opacity
|
|
1743
|
-
},
|
|
2040
|
+
BASE_ANGLE: GLASS_BORDER_GRADIENT.BASE_ANGLE,
|
|
2041
|
+
ANGLE_MULTIPLIER: GLASS_BORDER_GRADIENT.ANGLE_MULTIPLIER,
|
|
2042
|
+
VELOCITY_ANGLE_MULTIPLIER: GLASS_BORDER_GRADIENT.VELOCITY_ANGLE_MULTIPLIER,
|
|
2043
|
+
CHROMATIC_OFFSET: GLASS_BORDER_GRADIENT.CHROMATIC_OFFSET,
|
|
2044
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.STOP_1 */
|
|
2045
|
+
BORDER_STOP_1: GLASS_BORDER_GRADIENT.STOP_1,
|
|
2046
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.STOP_2 */
|
|
2047
|
+
BORDER_STOP_2: GLASS_BORDER_GRADIENT.STOP_2,
|
|
2048
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.OPACITY */
|
|
2049
|
+
BORDER_OPACITY: GLASS_BORDER_GRADIENT.OPACITY,
|
|
1744
2050
|
CENTER_POSITION: 50, // Center position percentage (50%)
|
|
1745
2051
|
HOVER_POSITION: {
|
|
1746
2052
|
DIVISOR_1: 2, // Divisor for hover 1 position calculation
|
|
@@ -1757,7 +2063,7 @@ export const ATOMIX_GLASS = {
|
|
|
1757
2063
|
get BLACK_MID() { return this.BLACK_START / 3; }, // Mid opacity for black hover 1
|
|
1758
2064
|
BLACK_STOP: 30, // Stop percentage for black hover 1
|
|
1759
2065
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 1
|
|
1760
|
-
WHITE_START: 0.
|
|
2066
|
+
WHITE_START: 0.35, // Gentler hover flash — Apple hover is barely visible
|
|
1761
2067
|
get WHITE_STOP() { return this.BLACK_END - 10; }, // Stop percentage for white hover 1
|
|
1762
2068
|
},
|
|
1763
2069
|
HOVER_2: {
|
|
@@ -1765,7 +2071,7 @@ export const ATOMIX_GLASS = {
|
|
|
1765
2071
|
get BLACK_MID() { return this.BLACK_START * 0.375; }, // Mid opacity for black hover 2
|
|
1766
2072
|
BLACK_STOP: 40, // Stop percentage for black hover 2
|
|
1767
2073
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 2
|
|
1768
|
-
WHITE_START:
|
|
2074
|
+
WHITE_START: 0.7, // Gentler hover flash
|
|
1769
2075
|
get WHITE_STOP() { return this.BLACK_END; }, // Stop percentage for white hover 2
|
|
1770
2076
|
},
|
|
1771
2077
|
HOVER_3: {
|
|
@@ -1773,7 +2079,7 @@ export const ATOMIX_GLASS = {
|
|
|
1773
2079
|
get BLACK_MID() { return this.BLACK_START * 0.4; }, // Mid opacity for black hover 3
|
|
1774
2080
|
BLACK_STOP: 50, // Stop percentage for black hover 3
|
|
1775
2081
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 3
|
|
1776
|
-
WHITE_START:
|
|
2082
|
+
WHITE_START: 0.7, // Gentler hover flash
|
|
1777
2083
|
get WHITE_STOP() { return this.BLACK_END; }, // Stop percentage for white hover 3
|
|
1778
2084
|
},
|
|
1779
2085
|
},
|
|
@@ -1781,9 +2087,9 @@ export const ATOMIX_GLASS = {
|
|
|
1781
2087
|
// Base and overlay gradient constants
|
|
1782
2088
|
BASE_GRADIENT: {
|
|
1783
2089
|
ANGLE: 135, // Gradient angle in degrees
|
|
1784
|
-
BLACK_START_BASE: 0.
|
|
2090
|
+
BLACK_START_BASE: 0.10, // Base start opacity for black
|
|
1785
2091
|
get BLACK_START_MULTIPLIER() { return this.BLACK_START_BASE * 0.02; }, // Multiplier for mouse X influence on start
|
|
1786
|
-
BLACK_MID_BASE: 0.
|
|
2092
|
+
BLACK_MID_BASE: 0.07, // Base mid opacity for black
|
|
1787
2093
|
get BLACK_MID_MULTIPLIER() { return this.BLACK_MID_BASE * 0.02; }, // Multiplier for mouse Y influence on mid
|
|
1788
2094
|
BLACK_MID_STOP: 50, // Mid stop percentage
|
|
1789
2095
|
get BLACK_END_BASE() { return this.BLACK_START_BASE * 1.2; }, // Base end opacity for black
|
|
@@ -1792,7 +2098,7 @@ export const ATOMIX_GLASS = {
|
|
|
1792
2098
|
},
|
|
1793
2099
|
|
|
1794
2100
|
OVERLAY_GRADIENT: {
|
|
1795
|
-
BLACK_START_BASE: 0.
|
|
2101
|
+
BLACK_START_BASE: 0.08, // Base start opacity for black overlay
|
|
1796
2102
|
get BLACK_START_MULTIPLIER() { return this.BLACK_START_BASE * 0.025; }, // Multiplier for mouse X influence on start
|
|
1797
2103
|
get BLACK_MID() { return this.BLACK_START_BASE * 0.5; }, // Mid opacity for black overlay
|
|
1798
2104
|
BLACK_MID_STOP: 40, // Mid stop percentage
|
|
@@ -1801,11 +2107,11 @@ export const ATOMIX_GLASS = {
|
|
|
1801
2107
|
get WHITE_OPACITY() { return this.BLACK_START_BASE * 0.416; }, // White opacity for non-overlight mode
|
|
1802
2108
|
},
|
|
1803
2109
|
|
|
1804
|
-
// Overlay highlight constants
|
|
2110
|
+
// Overlay highlight constants — Apple places specular at the top-center
|
|
1805
2111
|
OVERLAY_HIGHLIGHT: {
|
|
1806
|
-
POSITION_X:
|
|
1807
|
-
POSITION_Y:
|
|
1808
|
-
WHITE_OPACITY: 0.
|
|
2112
|
+
POSITION_X: 50, // Centered horizontal — Apple's top-center specular
|
|
2113
|
+
POSITION_Y: 5, // Very top — catches light like a curved glass surface
|
|
2114
|
+
WHITE_OPACITY: 0.28, // Softer specular — visible but not glaring
|
|
1809
2115
|
get STOP() { return this.WHITE_OPACITY * 150; }, // Stop percentage
|
|
1810
2116
|
get OPACITY_MULTIPLIER() { return this.WHITE_OPACITY * 1.75; }, // Multiplier for overlay highlight opacity
|
|
1811
2117
|
},
|
|
@@ -1822,6 +2128,12 @@ export const ATOMIX_GLASS = {
|
|
|
1822
2128
|
HIGH_CONTRAST: 200, // Saturation value for high contrast mode
|
|
1823
2129
|
},
|
|
1824
2130
|
|
|
2131
|
+
// Container shadows — hairline inner catch + soft floating lift (Apple player bar)
|
|
2132
|
+
CONTAINER_SHADOW: {
|
|
2133
|
+
LIGHT:
|
|
2134
|
+
'inset 0 0.5px 0 rgba(255, 255, 255, 0.32), inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.16)',
|
|
2135
|
+
},
|
|
2136
|
+
|
|
1825
2137
|
// Phase 1: Animation System Constants
|
|
1826
2138
|
ANIMATION: {
|
|
1827
2139
|
// Breathing effect timing (in milliseconds)
|
|
@@ -210,6 +210,30 @@ export interface OverLightObjectConfig {
|
|
|
210
210
|
* saturationBoost: 2.0
|
|
211
211
|
*/
|
|
212
212
|
saturationBoost?: number;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Rim opacity multiplier for animated border gradients (0.1 - 1.0)
|
|
216
|
+
*
|
|
217
|
+
* @default 0.7 when over-light is active, 0.35 otherwise
|
|
218
|
+
*/
|
|
219
|
+
borderOpacity?: number;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Liquid glass rim configuration (Apple-style hairline border).
|
|
224
|
+
*/
|
|
225
|
+
export interface GlassBorderConfig {
|
|
226
|
+
/** Whether border layers render. @default true */
|
|
227
|
+
enabled?: boolean;
|
|
228
|
+
/** Rim width — maps to `--atomix-glass-border-width`. @default 0.5px */
|
|
229
|
+
width?: string | number;
|
|
230
|
+
/** Multiplier on rim gradient opacities. @default 1 */
|
|
231
|
+
opacity?: number;
|
|
232
|
+
/**
|
|
233
|
+
* When false, skips JS gradient vars so SCSS static fallbacks apply.
|
|
234
|
+
* @default true
|
|
235
|
+
*/
|
|
236
|
+
animated?: boolean;
|
|
213
237
|
}
|
|
214
238
|
|
|
215
239
|
/**
|
|
@@ -226,7 +250,7 @@ export interface AtomixGlassProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
226
250
|
globalMousePosition?: MousePosition;
|
|
227
251
|
mouseOffset?: MousePosition;
|
|
228
252
|
mouseContainer?: React.RefObject<HTMLElement | null> | null;
|
|
229
|
-
|
|
253
|
+
|
|
230
254
|
height?: string | number;
|
|
231
255
|
width?: string | number;
|
|
232
256
|
overLight?: OverLightConfig;
|
|
@@ -264,6 +288,14 @@ export interface AtomixGlassProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
264
288
|
highContrast?: boolean;
|
|
265
289
|
withoutEffects?: boolean;
|
|
266
290
|
withLiquidBlur?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Liquid glass rim — boolean shorthand or structured config.
|
|
293
|
+
* Takes precedence over legacy `withBorder` when provided.
|
|
294
|
+
*/
|
|
295
|
+
border?: boolean | GlassBorderConfig;
|
|
296
|
+
/**
|
|
297
|
+
* @deprecated Use `border` instead. When `border` is omitted, defaults to this value.
|
|
298
|
+
*/
|
|
267
299
|
withBorder?: boolean;
|
|
268
300
|
withOverLightLayers?: boolean;
|
|
269
301
|
|