@pieai/swimmer-ui-kit 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to `@pieai/swimmer-ui-kit`.
4
4
  Format: [Keep a Changelog](https://keepachangelog.com); versioning: semver.
5
5
 
6
+ ## 1.9.0
7
+
8
+ ### Added
9
+
10
+ - **`<LiquidGroup>`, a budgeted liquid-merge primitive.** Two or more nearby
11
+ children share one gooey silhouette while their own content stays crisp: an
12
+ SVG blur-plus-contrast filter builds the merged shape, and the content is
13
+ drawn unfiltered on top. It is a one-shot primitive for celebrations, merge
14
+ moments and transitions — not a resident background, not behind body text,
15
+ and not on navigation. `blur`, `contrast` and `filterPadding` are the shape
16
+ knobs; `motion="reduced"` snaps instead of springing.
17
+ - **`stroke` on `<LiquidGroup>`.** The border belongs to the merged silhouette,
18
+ not to the pieces. Passing a CSS border shorthand draws one continuous
19
+ outline that deforms with the merge, including across the liquid bridge. A
20
+ child that draws its own `border` will show a static circle that refuses to
21
+ merge — that is the bug this prop exists to remove, and the story documents
22
+ it as a rule rather than a preference.
23
+
24
+ ## 1.8.1
25
+
26
+ ### Fixed
27
+
28
+ - **`<LiquidMetalButton>` came apart in a stretched container.** The host is
29
+ `inline-flex` and the button inside it was `fit-content`, so in a flex or
30
+ grid column that stretches — a pricing card, a form footer — the host took
31
+ the full width while the button kept its own. The opaque plate and the outer
32
+ glow are painted on the host and the rim, the sweep and the label on the
33
+ button, so the control rendered as a wide dark pill with a short metal
34
+ button parked at its left edge. The button now fills the host; in an inline
35
+ context, where the host was already the button's width, nothing changes.
36
+
6
37
  ## 1.8.0
7
38
 
8
39
  ### Added
package/NOTICE CHANGED
@@ -32,6 +32,48 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
32
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
33
  SOFTWARE.
34
34
 
35
+ Liquid-gooey morph filter
36
+ -------------------------
37
+ The liquid morph primitive in `src/LiquidGroup.tsx` and its supporting filter,
38
+ geometry, shadow, and spring modules is an original SwimmerUIKit
39
+ implementation informed by the `liquid-gooey` package in the Libraries
40
+ repository (https://github.com/Jakubantalik/Libraries/tree/main/packages/liquid-gooey),
41
+ Copyright (c) 2026 Jakub Antalik, licensed under the MIT License.
42
+
43
+ We took the donor's morph-specific ideas and small implementation patterns:
44
+ the SVG silhouette/content split, the Gaussian-blur plus alpha color-matrix
45
+ filter, rounded-rectangle geometry, token-compatible shadow passes, and spring
46
+ to easing compilation. We did not take its move, melt, bend, or dissolve
47
+ systems, its general observer, or its image-melt engine. We changed the
48
+ implementation for this kit by making fill and shadow values token-driven,
49
+ adding a process-wide animated-group and filter-area budget, and putting the
50
+ shared requestAnimationFrame clock to sleep after stillness. The actual
51
+ interactive content remains outside the filtered SVG layer.
52
+
53
+ The MIT License text for that material:
54
+
55
+ MIT License
56
+
57
+ Copyright (c) 2026 Jakub
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ of this software and associated documentation files (the "Software"), to deal
61
+ in the Software without restriction, including without limitation the rights
62
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all
67
+ copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ SOFTWARE.
76
+
35
77
  Fonts
36
78
  -----
37
79
  Baloo 2 and Geist Variable are licensed under the SIL Open Font License.
package/dist/index.d.ts CHANGED
@@ -589,6 +589,20 @@ export declare type ClayIconStyle = 'game' | 'line';
589
589
 
590
590
  export declare type ClayTokenCategory = keyof typeof CLAY_UI_TOKENS;
591
591
 
592
+ declare type CornerRadii = [number, number, number, number];
593
+
594
+ /**
595
+ * Process-wide budget for animated liquid-gooey groups.
596
+ *
597
+ * SVG filters do not consume WebGL contexts, but they can still be expensive
598
+ * to repaint. The default allows two animated groups and rejects regions
599
+ * larger than the configured filter-area ceiling. A rejected group keeps its
600
+ * SVG filter and snaps its content to each new state without animating.
601
+ */
602
+ export declare const DEFAULT_LIQUID_GOOEY_ANIMATION_BUDGET = 2;
603
+
604
+ export declare const DEFAULT_LIQUID_GOOEY_FILTER_AREA_BUDGET = 480000;
605
+
592
606
  /**
593
607
  * Process-wide ledger for liquid-metal WebGL2 contexts.
594
608
  *
@@ -1924,11 +1938,62 @@ export declare function getClayIconStyles(icon: ClayIconName): ClayIconStyle[];
1924
1938
 
1925
1939
  export declare function getClaySourceAssetPath(icon: ClayIconName, style?: ClayIconStyle): string;
1926
1940
 
1941
+ export declare function getLiquidGooeyBudget(): LiquidGooeyBudgetState;
1942
+
1927
1943
  export declare function getLiquidMetalContextBudget(): {
1928
1944
  limit: number;
1929
1945
  used: number;
1930
1946
  };
1931
1947
 
1948
+ declare interface LiquidGooeyBudgetOptions {
1949
+ maxAnimatedGroups?: number;
1950
+ maxFilterArea?: number;
1951
+ }
1952
+
1953
+ declare interface LiquidGooeyBudgetState {
1954
+ maxAnimatedGroups: number;
1955
+ maxFilterArea: number;
1956
+ activeGroups: number;
1957
+ }
1958
+
1959
+ export declare const LiquidGroup: ForwardRefExoticComponent<LiquidGroupProps & RefAttributes<HTMLDivElement>> & {
1960
+ Item: ForwardRefExoticComponent<LiquidItemProps & RefAttributes<HTMLDivElement>>;
1961
+ };
1962
+
1963
+ export declare interface LiquidGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
1964
+ children: ReactNode;
1965
+ /** Goo blur sigma in px. Larger values bridge larger gaps. */
1966
+ blur?: number;
1967
+ /** Alpha-contrast slope. Larger values make the liquid edge harder. */
1968
+ contrast?: number;
1969
+ /** Surface fill. Defaults to the kit's theme surface token. */
1970
+ fill?: string;
1971
+ /** Extra filter-region slack in px for the silhouette's painted edges. */
1972
+ filterPadding?: number;
1973
+ /** Optional token-based box-shadow syntax rebuilt on the merged silhouette. */
1974
+ shadow?: string;
1975
+ /** Optional stroke syntax rebuilt on the merged silhouette. Note: Do NOT add border to children directly! */
1976
+ stroke?: string;
1977
+ /** Deterministic reduced-motion override for previews; auto follows the OS. */
1978
+ motion?: 'auto' | 'reduced';
1979
+ }
1980
+
1981
+ export declare const LiquidItem: ForwardRefExoticComponent<LiquidItemProps & RefAttributes<HTMLDivElement>>;
1982
+
1983
+ export declare interface LiquidItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
1984
+ children: ReactNode;
1985
+ /** Mirrored translation applied to the content wrapper and SVG silhouette. */
1986
+ x?: number;
1987
+ y?: number;
1988
+ scale?: number;
1989
+ /** Spring preset/config or an explicit duration/easing pair. */
1990
+ transition?: Transition;
1991
+ /** Delay before this item starts its group-clock transition, in ms. */
1992
+ delay?: number;
1993
+ /** Override the measured content border radius for the silhouette. */
1994
+ radius?: number | CornerRadii;
1995
+ }
1996
+
1932
1997
  export declare function LiquidMetalButton({ children, className, onClick, sound, type, renderer, ...props }: LiquidMetalButtonProps): ReactNode;
1933
1998
 
1934
1999
  export declare interface LiquidMetalButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
@@ -1970,6 +2035,23 @@ export declare function setClayAssetBasePath(basePath: string): void;
1970
2035
  */
1971
2036
  export declare function setClayAssetMode(mode: ClayAssetMode): void;
1972
2037
 
2038
+ /** Update one or both host-side performance limits. */
2039
+ export declare function setLiquidGooeyBudget(next: number | LiquidGooeyBudgetOptions): void;
2040
+
1973
2041
  export declare function setLiquidMetalContextBudget(nextLimit: number): void;
1974
2042
 
2043
+ /** Small spring-to-easing compiler used by the shared group clock. */
2044
+ declare interface SpringConfig {
2045
+ stiffness?: number;
2046
+ damping?: number;
2047
+ mass?: number;
2048
+ }
2049
+
2050
+ declare type Transition = TransitionPreset | SpringConfig | {
2051
+ duration: number;
2052
+ ease?: string;
2053
+ };
2054
+
2055
+ declare type TransitionPreset = 'snappy' | 'smooth' | 'bouncy';
2056
+
1975
2057
  export { }