@gtkx/cli 0.16.0 → 0.17.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/cli",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "CLI for GTKX - create and develop GTK4 React applications",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -58,19 +58,19 @@
58
58
  "ejs": "^4.0.1",
59
59
  "react-refresh": "^0.18.0",
60
60
  "vite": "^7.3.1",
61
- "@gtkx/mcp": "0.16.0",
62
- "@gtkx/ffi": "0.16.0",
63
- "@gtkx/react": "0.16.0"
61
+ "@gtkx/mcp": "0.17.1",
62
+ "@gtkx/react": "0.17.1",
63
+ "@gtkx/ffi": "0.17.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/ejs": "^3.1.5",
67
67
  "@types/react-refresh": "^0.14.7",
68
- "memfs": "^4.56.9",
69
- "@gtkx/testing": "0.16.0"
68
+ "memfs": "^4.56.10",
69
+ "@gtkx/testing": "0.17.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^19",
73
- "@gtkx/testing": "0.16.0"
73
+ "@gtkx/testing": "0.17.1"
74
74
  },
75
75
  "peerDependenciesMeta": {
76
76
  "@gtkx/testing": {
@@ -717,3 +717,38 @@ const StackNavigation = () => {
717
717
  );
718
718
  };
719
719
  ```
720
+
721
+ ---
722
+
723
+ ## Animated Card with Toggle
724
+
725
+ ```tsx
726
+ import * as Gtk from "@gtkx/ffi/gtk";
727
+ import { GtkBox, GtkButton, GtkLabel, x } from "@gtkx/react";
728
+ import { useState } from "react";
729
+
730
+ const AnimatedCard = () => {
731
+ const [visible, setVisible] = useState(true);
732
+
733
+ return (
734
+ <GtkBox orientation={Gtk.Orientation.VERTICAL} spacing={12} marginStart={16} marginEnd={16} marginTop={16} marginBottom={16}>
735
+ <GtkButton label={visible ? "Hide Card" : "Show Card"} onClicked={() => setVisible(!visible)} halign={Gtk.Align.START} />
736
+ {visible && (
737
+ <x.Animation
738
+ mode="spring"
739
+ initial={{ opacity: 0, scale: 0.8, translateY: -20 }}
740
+ animate={{ opacity: 1, scale: 1, translateY: 0 }}
741
+ exit={{ opacity: 0, scale: 0.8, translateY: 20 }}
742
+ transition={{ damping: 0.7, stiffness: 200 }}
743
+ animateOnMount
744
+ >
745
+ <GtkBox orientation={Gtk.Orientation.VERTICAL} spacing={8} cssClasses={["card"]} marginStart={12} marginEnd={12} marginTop={8} marginBottom={8}>
746
+ <GtkLabel label="Animated Card" cssClasses={["title-4"]} halign={Gtk.Align.START} />
747
+ <GtkLabel label="This card animates in with a spring effect and fades out when dismissed." wrap />
748
+ </GtkBox>
749
+ </x.Animation>
750
+ )}
751
+ </GtkBox>
752
+ );
753
+ };
754
+ ```
@@ -67,6 +67,20 @@ Some widgets require children in specific slots:
67
67
  </GtkHeaderBar>
68
68
  ```
69
69
 
70
+ ### Animations
71
+
72
+ ```tsx
73
+ <x.Animation
74
+ mode="spring"
75
+ initial={{ opacity: 0, scale: 0.8 }}
76
+ animate={{ opacity: 1, scale: 1 }}
77
+ transition={{ damping: 0.8, stiffness: 200 }}
78
+ animateOnMount
79
+ >
80
+ <GtkLabel label="Animated!" />
81
+ </x.Animation>
82
+ ```
83
+
70
84
  ## Key Constraints
71
85
 
72
86
  - GTK is single-threaded: all widget operations on main thread
@@ -633,17 +633,22 @@ Wrap widgets in `x.Animation` for declarative animations with spring or timed tr
633
633
 
634
634
  ```tsx
635
635
  <x.Animation
636
- initial={{ opacity: 0, scaleX: 0.8 }}
637
- animate={{ opacity: 1, scaleX: 1 }}
638
- transition={{ type: "spring", stiffness: 300, damping: 20 }}
636
+ mode="spring"
637
+ initial={{ opacity: 0, scale: 0.8 }}
638
+ animate={{ opacity: 1, scale: 1 }}
639
+ transition={{ damping: 0.8, stiffness: 200, mass: 1 }}
640
+ animateOnMount
639
641
  onAnimationComplete={() => console.log("done")}
640
642
  >
641
643
  <GtkBox>...</GtkBox>
642
644
  </x.Animation>
643
645
  ```
644
646
 
645
- **Props:** `initial`, `animate`, `transition`, `onAnimationComplete`
646
- **Transition types:** `{ type: "spring", stiffness, damping }` or `{ type: "timed", duration, easing }`
647
+ **Props:** `mode` (`"spring"` | `"timed"`), `initial`, `animate`, `exit`, `transition`, `animateOnMount`, `onAnimationStart`, `onAnimationComplete`
648
+
649
+ **Spring transition:** `damping`, `stiffness`, `mass`, `initialVelocity`, `clamp`, `delay`
650
+
651
+ **Timed transition:** `duration`, `easing` (from `Adw.Easing`), `delay`, `repeat`, `reverse`, `alternate`
647
652
 
648
653
  ---
649
654