@shohojdhara/atomix 0.6.4 → 0.6.6
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 +117 -38
- 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 +625 -846
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +30 -1
- package/dist/core.js +659 -873
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +30 -1
- package/dist/forms.js +1171 -1402
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +31 -89
- package/dist/heavy.js +975 -1195
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +383 -140
- package/dist/index.esm.js +1567 -1679
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1556 -1667
- 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 -364
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +32 -251
- 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 +456 -22
- package/src/components/AtomixGlass/shader-utils.ts +19 -77
- 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.test.tsx +6 -6
- package/src/components/Form/Select.tsx +2 -7
- package/src/components/Form/Textarea.stories.tsx +5 -5
- 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 +42 -143
- package/src/lib/composables/useAtomixGlassStyles.ts +61 -77
- package/src/lib/composables/usePerformanceMonitor.ts +5 -66
- package/src/lib/constants/components.ts +363 -46
- package/src/lib/types/components.ts +33 -1
- package/src/styles/01-settings/_settings.atomix-glass.scss +66 -28
- package/src/styles/02-tools/_tools.button.scss +51 -42
- package/src/styles/02-tools/_tools.glass.scss +45 -3
- package/src/styles/06-components/_components.atomix-glass.scss +116 -79
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +0 -171
- package/src/components/AtomixGlass/animation-system.ts +0 -578
- 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,24 @@ 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
|
-
//
|
|
1701
|
-
|
|
2018
|
+
// Interaction intensity multipliers shared by the hook and the imperative style updater
|
|
2019
|
+
INTERACTION: {
|
|
2020
|
+
HOVER_INTENSITY: 1.4,
|
|
2021
|
+
ACTIVE_INTENSITY: 1.6,
|
|
2022
|
+
},
|
|
2023
|
+
// Elasticity physics constants — Apple-tuned: soft springs, fast settling, minimal stretch
|
|
2024
|
+
ELASTICITY_TRANSLATION_FACTOR: 0.06, // Subtler elastic shift (was 0.1)
|
|
1702
2025
|
ELASTICITY_DISTANCE_THRESHOLD: 200,
|
|
1703
2026
|
ELASTICITY_COMPRESSION_FACTOR: 0.3,
|
|
1704
|
-
ELASTICITY_STIFFNESS: 0.1
|
|
1705
|
-
ELASTICITY_DAMPING: 0.76
|
|
2027
|
+
ELASTICITY_STIFFNESS: 0.06, // Softer springs = gentler motion (was 0.1)
|
|
2028
|
+
ELASTICITY_DAMPING: 0.88, // Fast settling, no wobble (was 0.76)
|
|
1706
2029
|
ELASTICITY_VELOCITY_FACTOR: 0.65,
|
|
1707
|
-
ELASTICITY_STRETCH_RATIO: 0.45
|
|
2030
|
+
ELASTICITY_STRETCH_RATIO: 0.25, // Less visible surface tension stretch (was 0.45)
|
|
1708
2031
|
ELASTICITY_MAGNIFICATION_BASE: 1.02,
|
|
1709
2032
|
// Note: This default must match the SCSS variable --atomix-radius-md
|
|
1710
2033
|
// @see src/styles/01-settings/_settings.global.scss
|
|
@@ -1719,28 +2042,16 @@ export const ATOMIX_GLASS = {
|
|
|
1719
2042
|
|
|
1720
2043
|
// Gradient calculation constants
|
|
1721
2044
|
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
|
-
},
|
|
2045
|
+
BASE_ANGLE: GLASS_BORDER_GRADIENT.BASE_ANGLE,
|
|
2046
|
+
ANGLE_MULTIPLIER: GLASS_BORDER_GRADIENT.ANGLE_MULTIPLIER,
|
|
2047
|
+
VELOCITY_ANGLE_MULTIPLIER: GLASS_BORDER_GRADIENT.VELOCITY_ANGLE_MULTIPLIER,
|
|
2048
|
+
CHROMATIC_OFFSET: GLASS_BORDER_GRADIENT.CHROMATIC_OFFSET,
|
|
2049
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.STOP_1 */
|
|
2050
|
+
BORDER_STOP_1: GLASS_BORDER_GRADIENT.STOP_1,
|
|
2051
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.STOP_2 */
|
|
2052
|
+
BORDER_STOP_2: GLASS_BORDER_GRADIENT.STOP_2,
|
|
2053
|
+
/** @deprecated Use ATOMIX_GLASS.BORDER.GRADIENT.OPACITY */
|
|
2054
|
+
BORDER_OPACITY: GLASS_BORDER_GRADIENT.OPACITY,
|
|
1744
2055
|
CENTER_POSITION: 50, // Center position percentage (50%)
|
|
1745
2056
|
HOVER_POSITION: {
|
|
1746
2057
|
DIVISOR_1: 2, // Divisor for hover 1 position calculation
|
|
@@ -1757,7 +2068,7 @@ export const ATOMIX_GLASS = {
|
|
|
1757
2068
|
get BLACK_MID() { return this.BLACK_START / 3; }, // Mid opacity for black hover 1
|
|
1758
2069
|
BLACK_STOP: 30, // Stop percentage for black hover 1
|
|
1759
2070
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 1
|
|
1760
|
-
WHITE_START: 0.
|
|
2071
|
+
WHITE_START: 0.35, // Gentler hover flash — Apple hover is barely visible
|
|
1761
2072
|
get WHITE_STOP() { return this.BLACK_END - 10; }, // Stop percentage for white hover 1
|
|
1762
2073
|
},
|
|
1763
2074
|
HOVER_2: {
|
|
@@ -1765,7 +2076,7 @@ export const ATOMIX_GLASS = {
|
|
|
1765
2076
|
get BLACK_MID() { return this.BLACK_START * 0.375; }, // Mid opacity for black hover 2
|
|
1766
2077
|
BLACK_STOP: 40, // Stop percentage for black hover 2
|
|
1767
2078
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 2
|
|
1768
|
-
WHITE_START:
|
|
2079
|
+
WHITE_START: 0.7, // Gentler hover flash
|
|
1769
2080
|
get WHITE_STOP() { return this.BLACK_END; }, // Stop percentage for white hover 2
|
|
1770
2081
|
},
|
|
1771
2082
|
HOVER_3: {
|
|
@@ -1773,7 +2084,7 @@ export const ATOMIX_GLASS = {
|
|
|
1773
2084
|
get BLACK_MID() { return this.BLACK_START * 0.4; }, // Mid opacity for black hover 3
|
|
1774
2085
|
BLACK_STOP: 50, // Stop percentage for black hover 3
|
|
1775
2086
|
get BLACK_END() { return this.BLACK_STOP * 2; }, // End percentage for black hover 3
|
|
1776
|
-
WHITE_START:
|
|
2087
|
+
WHITE_START: 0.7, // Gentler hover flash
|
|
1777
2088
|
get WHITE_STOP() { return this.BLACK_END; }, // Stop percentage for white hover 3
|
|
1778
2089
|
},
|
|
1779
2090
|
},
|
|
@@ -1781,9 +2092,9 @@ export const ATOMIX_GLASS = {
|
|
|
1781
2092
|
// Base and overlay gradient constants
|
|
1782
2093
|
BASE_GRADIENT: {
|
|
1783
2094
|
ANGLE: 135, // Gradient angle in degrees
|
|
1784
|
-
BLACK_START_BASE: 0.
|
|
2095
|
+
BLACK_START_BASE: 0.10, // Base start opacity for black
|
|
1785
2096
|
get BLACK_START_MULTIPLIER() { return this.BLACK_START_BASE * 0.02; }, // Multiplier for mouse X influence on start
|
|
1786
|
-
BLACK_MID_BASE: 0.
|
|
2097
|
+
BLACK_MID_BASE: 0.07, // Base mid opacity for black
|
|
1787
2098
|
get BLACK_MID_MULTIPLIER() { return this.BLACK_MID_BASE * 0.02; }, // Multiplier for mouse Y influence on mid
|
|
1788
2099
|
BLACK_MID_STOP: 50, // Mid stop percentage
|
|
1789
2100
|
get BLACK_END_BASE() { return this.BLACK_START_BASE * 1.2; }, // Base end opacity for black
|
|
@@ -1792,7 +2103,7 @@ export const ATOMIX_GLASS = {
|
|
|
1792
2103
|
},
|
|
1793
2104
|
|
|
1794
2105
|
OVERLAY_GRADIENT: {
|
|
1795
|
-
BLACK_START_BASE: 0.
|
|
2106
|
+
BLACK_START_BASE: 0.08, // Base start opacity for black overlay
|
|
1796
2107
|
get BLACK_START_MULTIPLIER() { return this.BLACK_START_BASE * 0.025; }, // Multiplier for mouse X influence on start
|
|
1797
2108
|
get BLACK_MID() { return this.BLACK_START_BASE * 0.5; }, // Mid opacity for black overlay
|
|
1798
2109
|
BLACK_MID_STOP: 40, // Mid stop percentage
|
|
@@ -1801,11 +2112,11 @@ export const ATOMIX_GLASS = {
|
|
|
1801
2112
|
get WHITE_OPACITY() { return this.BLACK_START_BASE * 0.416; }, // White opacity for non-overlight mode
|
|
1802
2113
|
},
|
|
1803
2114
|
|
|
1804
|
-
// Overlay highlight constants
|
|
2115
|
+
// Overlay highlight constants — Apple places specular at the top-center
|
|
1805
2116
|
OVERLAY_HIGHLIGHT: {
|
|
1806
|
-
POSITION_X:
|
|
1807
|
-
POSITION_Y:
|
|
1808
|
-
WHITE_OPACITY: 0.
|
|
2117
|
+
POSITION_X: 50, // Centered horizontal — Apple's top-center specular
|
|
2118
|
+
POSITION_Y: 5, // Very top — catches light like a curved glass surface
|
|
2119
|
+
WHITE_OPACITY: 0.28, // Softer specular — visible but not glaring
|
|
1809
2120
|
get STOP() { return this.WHITE_OPACITY * 150; }, // Stop percentage
|
|
1810
2121
|
get OPACITY_MULTIPLIER() { return this.WHITE_OPACITY * 1.75; }, // Multiplier for overlay highlight opacity
|
|
1811
2122
|
},
|
|
@@ -1822,6 +2133,12 @@ export const ATOMIX_GLASS = {
|
|
|
1822
2133
|
HIGH_CONTRAST: 200, // Saturation value for high contrast mode
|
|
1823
2134
|
},
|
|
1824
2135
|
|
|
2136
|
+
// Container shadows — hairline inner catch + soft floating lift (Apple player bar)
|
|
2137
|
+
CONTAINER_SHADOW: {
|
|
2138
|
+
LIGHT:
|
|
2139
|
+
'inset 0 0.5px 0 rgba(255, 255, 255, 0.32), inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08)',
|
|
2140
|
+
},
|
|
2141
|
+
|
|
1825
2142
|
// Phase 1: Animation System Constants
|
|
1826
2143
|
ANIMATION: {
|
|
1827
2144
|
// 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
|
|
|
@@ -19,9 +19,61 @@ $glass-radius: var(--#{config.$prefix}radius-md, 0.75rem) !default;
|
|
|
19
19
|
$glass-position: absolute !default;
|
|
20
20
|
|
|
21
21
|
// ============================================================================
|
|
22
|
-
// Border
|
|
23
|
-
// ============================================================================
|
|
24
|
-
|
|
22
|
+
// Border (liquid glass rim)
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// Hairline refractive edge — Apple liquid glass (~0.5px physical)
|
|
25
|
+
$glass-border-width: max(0.5px, 0.03125rem) !default;
|
|
26
|
+
|
|
27
|
+
// Layer opacity (static fallback when JS gradients are off)
|
|
28
|
+
$glass-border-1-opacity: 0.08 !default;
|
|
29
|
+
|
|
30
|
+
// Rim shadow tokens (inset hairline + inner catch + outer lift)
|
|
31
|
+
$glass-border-color: rgba(255, 255, 255, 0.28) !default;
|
|
32
|
+
$glass-inner-shadow-color: rgba(255, 255, 255, 0.20) !default;
|
|
33
|
+
$glass-outer-shadow-color: rgba(0, 0, 0, 0.08) !default;
|
|
34
|
+
|
|
35
|
+
// Border-only backdrop (ring sampling)
|
|
36
|
+
$glass-border-backdrop-blur: 40px !default;
|
|
37
|
+
$glass-border-backdrop-saturate: 180% !default;
|
|
38
|
+
$glass-border-backdrop-brightness: 102% !default;
|
|
39
|
+
$glass-border-backdrop-filter: blur($glass-border-backdrop-blur) saturate($glass-border-backdrop-saturate)
|
|
40
|
+
brightness($glass-border-backdrop-brightness) !default;
|
|
41
|
+
|
|
42
|
+
// Static gradient fallbacks (dark chrome)
|
|
43
|
+
$glass-border-fallback-rim: conic-gradient(
|
|
44
|
+
from 225deg at 50% 50%,
|
|
45
|
+
rgba(255, 255, 255, 0) 0deg,
|
|
46
|
+
rgba(255, 255, 255, 0.28) 52deg,
|
|
47
|
+
rgba(255, 255, 255, 0.1) 120deg,
|
|
48
|
+
rgba(255, 255, 255, 0.22) 200deg,
|
|
49
|
+
rgba(255, 255, 255, 0.06) 280deg,
|
|
50
|
+
rgba(255, 255, 255, 0) 360deg
|
|
51
|
+
) !default;
|
|
52
|
+
|
|
53
|
+
$glass-border-fallback-inner-highlight: linear-gradient(
|
|
54
|
+
135deg,
|
|
55
|
+
rgba(255, 255, 255, 0.22) 0%,
|
|
56
|
+
rgba(255, 255, 255, 0.06) 28%,
|
|
57
|
+
rgba(255, 255, 255, 0) 55%
|
|
58
|
+
) !default;
|
|
59
|
+
|
|
60
|
+
// Over-light: darker rim + softer inner catch on bright backdrops
|
|
61
|
+
$glass-border-fallback-rim-over-light: conic-gradient(
|
|
62
|
+
from 225deg at 50% 50%,
|
|
63
|
+
rgba(0, 0, 0, 0) 0deg,
|
|
64
|
+
rgba(0, 0, 0, 0.22) 52deg,
|
|
65
|
+
rgba(0, 0, 0, 0.08) 120deg,
|
|
66
|
+
rgba(0, 0, 0, 0.18) 200deg,
|
|
67
|
+
rgba(0, 0, 0, 0.05) 280deg,
|
|
68
|
+
rgba(0, 0, 0, 0) 360deg
|
|
69
|
+
) !default;
|
|
70
|
+
|
|
71
|
+
$glass-border-fallback-inner-over-light: linear-gradient(
|
|
72
|
+
135deg,
|
|
73
|
+
rgba(255, 255, 255, 0.35) 0%,
|
|
74
|
+
rgba(255, 255, 255, 0.12) 30%,
|
|
75
|
+
rgba(255, 255, 255, 0) 55%
|
|
76
|
+
) !default;
|
|
25
77
|
|
|
26
78
|
// ============================================================================
|
|
27
79
|
// Z-Index Layers
|
|
@@ -37,14 +89,10 @@ $glass-z-index-content: 2 !default;
|
|
|
37
89
|
$glass-hover-1-opacity: 0 !default;
|
|
38
90
|
$glass-hover-2-opacity: 0 !default;
|
|
39
91
|
$glass-hover-3-opacity: 0 !default;
|
|
40
|
-
|
|
41
|
-
$glass-
|
|
42
|
-
$glass-overlay-
|
|
43
|
-
|
|
44
|
-
// ============================================================================
|
|
45
|
-
// Border Opacity
|
|
46
|
-
// ============================================================================
|
|
47
|
-
$glass-border-1-opacity: 0.18 !default;
|
|
92
|
+
// Subtle translucency — Apple liquid glass is nearly invisible on its own
|
|
93
|
+
$glass-base-opacity: 0.35 !default;
|
|
94
|
+
$glass-overlay-opacity: 0.20 !default;
|
|
95
|
+
$glass-overlay-highlight-opacity: 0.18 !default;
|
|
48
96
|
|
|
49
97
|
// ============================================================================
|
|
50
98
|
// Over-Light Mode Opacity
|
|
@@ -126,26 +174,22 @@ $glass-overlay-black-end: 0 !default;
|
|
|
126
174
|
// ============================================================================
|
|
127
175
|
// Overlay Highlight
|
|
128
176
|
// ============================================================================
|
|
129
|
-
|
|
177
|
+
// Softer top-center specular (Apple positions the light catch at the top)
|
|
178
|
+
$glass-highlight-start-color: rgba(255, 255, 255, 0.18) !default;
|
|
130
179
|
$glass-highlight-end-color: rgba(255, 255, 255, 0) !default;
|
|
131
|
-
$glass-highlight-opacity-multiplier:
|
|
132
|
-
|
|
133
|
-
// ============================================================================
|
|
134
|
-
// Border Shadow
|
|
135
|
-
// ============================================================================
|
|
136
|
-
$glass-border-color: rgba(255, 255, 255, 0.45) !default;
|
|
137
|
-
$glass-inner-shadow-color: rgba(255, 255, 255, 0.18) !default;
|
|
138
|
-
$glass-outer-shadow-color: rgba(0, 0, 0, 0.28) !default;
|
|
180
|
+
$glass-highlight-opacity-multiplier: 0.9 !default;
|
|
139
181
|
|
|
140
182
|
// ============================================================================
|
|
141
183
|
// Backdrop Filter
|
|
142
184
|
// ============================================================================
|
|
143
|
-
|
|
185
|
+
// Deep frosting with near-neutral brightness — colour comes from the backdrop
|
|
186
|
+
$glass-backdrop-filter: blur(40px) saturate(180%) brightness(102%) !default;
|
|
144
187
|
|
|
145
188
|
// ============================================================================
|
|
146
189
|
// Transition
|
|
147
190
|
// ============================================================================
|
|
148
|
-
$
|
|
191
|
+
// Duration aligned with the global $transition-base token (0.3s).
|
|
192
|
+
// Easing matches the Atomix system easing — fast-start, slow-finish.
|
|
149
193
|
$glass-transition-duration: 0.3s !default;
|
|
150
194
|
$glass-easing: cubic-bezier(0.23, 1, 0.32, 1) !default;
|
|
151
195
|
|
|
@@ -166,9 +210,3 @@ $glass-border-2-blend-mode: overlay !default;
|
|
|
166
210
|
$glass-background-dark-color: var(--#{config.$prefix}gray-9, #1f2937) !default;
|
|
167
211
|
$glass-background-black-color: var(--#{config.$prefix}black, #000000) !default;
|
|
168
212
|
|
|
169
|
-
// ============================================================================
|
|
170
|
-
// Border Backdrop
|
|
171
|
-
// ============================================================================
|
|
172
|
-
$glass-border-backdrop-blur: 30px !default;
|
|
173
|
-
$glass-border-backdrop-saturate: 140% !default;
|
|
174
|
-
$glass-border-backdrop-brightness: 110% !default;
|