@gtkx/cli 0.5.2 → 0.6.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.
Files changed (2) hide show
  1. package/dist/create.js +27 -27
  2. package/package.json +3 -3
package/dist/create.js CHANGED
@@ -72,8 +72,8 @@ export default function App() {
72
72
  return (
73
73
  <ApplicationWindow title="${title}" defaultWidth={400} defaultHeight={300} onCloseRequest={quit}>
74
74
  <Box orientation={Gtk.Orientation.VERTICAL} spacing={20} marginTop={40} marginStart={40} marginEnd={40}>
75
- <Label.Root label="Welcome to GTKX!" />
76
- <Label.Root label={\`Count: \${count}\`} />
75
+ <Label label="Welcome to GTKX!" />
76
+ <Label label={\`Count: \${count}\`} />
77
77
  <Button label="Increment" onClicked={() => setCount((c) => c + 1)} />
78
78
  </Box>
79
79
  </ApplicationWindow>
@@ -116,7 +116,7 @@ import * as Gtk from "@gtkx/ffi/gtk";
116
116
  const App = () => (
117
117
  <ApplicationWindow title="My App" defaultWidth={800} defaultHeight={600}>
118
118
  <Box orientation={Gtk.Orientation.VERTICAL} spacing={12}>
119
- <Label.Root label="Hello, GTKX!" />
119
+ <Label label="Hello, GTKX!" />
120
120
  <Button label="Quit" onClicked={quit} />
121
121
  </Box>
122
122
  </ApplicationWindow>
@@ -132,8 +132,8 @@ render(<App />, "com.example.myapp");
132
132
  **Box** - Linear layout:
133
133
  \`\`\`tsx
134
134
  <Box orientation={Gtk.Orientation.VERTICAL} spacing={12}>
135
- <Label.Root label="First" />
136
- <Label.Root label="Second" />
135
+ <Label label="First" />
136
+ <Label label="Second" />
137
137
  </Box>
138
138
  \`\`\`
139
139
 
@@ -141,10 +141,10 @@ render(<App />, "com.example.myapp");
141
141
  \`\`\`tsx
142
142
  <Grid.Root spacing={10}>
143
143
  <Grid.Child column={0} row={0}>
144
- <Label.Root label="Top-left" />
144
+ <Label label="Top-left" />
145
145
  </Grid.Child>
146
146
  <Grid.Child column={1} row={0} columnSpan={2}>
147
- <Label.Root label="Spans 2 columns" />
147
+ <Label label="Spans 2 columns" />
148
148
  </Grid.Child>
149
149
  </Grid.Root>
150
150
  \`\`\`
@@ -153,10 +153,10 @@ render(<App />, "com.example.myapp");
153
153
  \`\`\`tsx
154
154
  <Stack.Root visibleChildName="page1">
155
155
  <Stack.Page name="page1" title="Page 1">
156
- <Label.Root label="Content 1" />
156
+ <Label label="Content 1" />
157
157
  </Stack.Page>
158
158
  <Stack.Page name="page2" title="Page 2">
159
- <Label.Root label="Content 2" />
159
+ <Label label="Content 2" />
160
160
  </Stack.Page>
161
161
  </Stack.Root>
162
162
  \`\`\`
@@ -192,7 +192,7 @@ render(<App />, "com.example.myapp");
192
192
  <ListView.Root
193
193
  vexpand
194
194
  renderItem={(item: Item | null) => (
195
- <Label.Root label={item?.text ?? ""} />
195
+ <Label label={item?.text ?? ""} />
196
196
  )}
197
197
  >
198
198
  {items.map(item => (
@@ -213,7 +213,7 @@ render(<App />, "com.example.myapp");
213
213
  id="name"
214
214
  expand
215
215
  renderCell={(item: Item | null) => (
216
- <Label.Root label={item?.name ?? ""} />
216
+ <Label label={item?.name ?? ""} />
217
217
  )}
218
218
  />
219
219
  {items.map(item => (
@@ -311,8 +311,8 @@ Linear layout container.
311
311
 
312
312
  \`\`\`tsx
313
313
  <Box orientation={Gtk.Orientation.VERTICAL} spacing={12}>
314
- <Label.Root label="Child 1" />
315
- <Label.Root label="Child 2" />
314
+ <Label label="Child 1" />
315
+ <Label label="Child 2" />
316
316
  </Box>
317
317
  \`\`\`
318
318
 
@@ -327,10 +327,10 @@ Props:
327
327
  \`\`\`tsx
328
328
  <Grid.Root spacing={10} rowSpacing={5} columnSpacing={5}>
329
329
  <Grid.Child column={0} row={0}>
330
- <Label.Root label="Top-left" />
330
+ <Label label="Top-left" />
331
331
  </Grid.Child>
332
332
  <Grid.Child column={1} row={0} columnSpan={2}>
333
- <Label.Root label="Spans 2 columns" />
333
+ <Label label="Spans 2 columns" />
334
334
  </Grid.Child>
335
335
  </Grid.Root>
336
336
  \`\`\`
@@ -411,7 +411,7 @@ High-performance scrollable list with virtual rendering.
411
411
  <ListView.Root
412
412
  vexpand
413
413
  renderItem={(item: Item | null) => (
414
- <Label.Root label={item?.text ?? ""} />
414
+ <Label label={item?.text ?? ""} />
415
415
  )}
416
416
  >
417
417
  {items.map(item => (
@@ -439,7 +439,7 @@ Table with sortable columns.
439
439
  expand
440
440
  resizable
441
441
  renderCell={(item: Item | null) => (
442
- <Label.Root label={item?.name ?? ""} />
442
+ <Label label={item?.name ?? ""} />
443
443
  )}
444
444
  />
445
445
  {items.map(item => (
@@ -492,9 +492,9 @@ const [active, setActive] = useState(false);
492
492
 
493
493
  ## Display Widgets
494
494
 
495
- ### Label.Root
495
+ ### Label
496
496
  \`\`\`tsx
497
- <Label.Root label="Hello World" halign={Gtk.Align.START} wrap useMarkup />
497
+ <Label label="Hello World" halign={Gtk.Align.START} wrap useMarkup />
498
498
  \`\`\`
499
499
 
500
500
  ### Button
@@ -603,7 +603,7 @@ export const App = () => {
603
603
  return (
604
604
  <ApplicationWindow title="Todo App" defaultWidth={400} defaultHeight={500} onCloseRequest={quit}>
605
605
  <Box orientation={Orientation.VERTICAL} spacing={16} marginTop={16} marginStart={16} marginEnd={16}>
606
- <Label.Root label="Todo App" />
606
+ <Label label="Todo App" />
607
607
  </Box>
608
608
  </ApplicationWindow>
609
609
  );
@@ -628,13 +628,13 @@ const FormLayout = () => {
628
628
  return (
629
629
  <Grid.Root rowSpacing={8} columnSpacing={12}>
630
630
  <Grid.Child column={0} row={0}>
631
- <Label.Root label="Name:" halign={Gtk.Align.END} />
631
+ <Label label="Name:" halign={Gtk.Align.END} />
632
632
  </Grid.Child>
633
633
  <Grid.Child column={1} row={0}>
634
634
  <Entry text={name} onChanged={(e) => setName(e.getText())} hexpand />
635
635
  </Grid.Child>
636
636
  <Grid.Child column={0} row={1}>
637
- <Label.Root label="Email:" halign={Gtk.Align.END} />
637
+ <Label label="Email:" halign={Gtk.Align.END} />
638
638
  </Grid.Child>
639
639
  <Grid.Child column={1} row={1}>
640
640
  <Entry text={email} onChanged={(e) => setEmail(e.getText())} hexpand />
@@ -665,10 +665,10 @@ const TabContainer = () => (
665
665
  />
666
666
  <Stack.Root transitionType={Gtk.StackTransitionType.SLIDE_LEFT_RIGHT} transitionDuration={200}>
667
667
  <Stack.Page name="page1" title="First">
668
- <Label.Root label="First Page Content" />
668
+ <Label label="First Page Content" />
669
669
  </Stack.Page>
670
670
  <Stack.Page name="page2" title="Second">
671
- <Label.Root label="Second Page Content" />
671
+ <Label label="Second Page Content" />
672
672
  </Stack.Page>
673
673
  </Stack.Root>
674
674
  </Box>
@@ -699,7 +699,7 @@ const TaskList = () => (
699
699
  <ListView.Root
700
700
  vexpand
701
701
  renderItem={(task: Task | null) => (
702
- <Label.Root
702
+ <Label
703
703
  label={task?.title ?? ""}
704
704
  cssClasses={task?.completed ? ["dim-label"] : []}
705
705
  halign={Gtk.Align.START}
@@ -731,7 +731,7 @@ const MenuDemo = () => {
731
731
 
732
732
  return (
733
733
  <Box orientation={Gtk.Orientation.VERTICAL} spacing={12}>
734
- <Label.Root label={\`Last action: \${lastAction ?? "(none)"}\`} />
734
+ <Label label={\`Last action: \${lastAction ?? "(none)"}\`} />
735
735
  <MenuButton.Root label="Actions">
736
736
  <MenuButton.Popover>
737
737
  <PopoverMenu.Root>
@@ -769,7 +769,7 @@ interface TodoItemProps {
769
769
  export const TodoItem = ({ todo, onToggle, onDelete }: TodoItemProps) => (
770
770
  <Box orientation={Orientation.HORIZONTAL} spacing={8}>
771
771
  <CheckButton active={todo.completed} onToggled={() => onToggle(todo.id)} />
772
- <Label.Root label={todo.text} hexpand cssClasses={todo.completed ? ["dim-label"] : []} />
772
+ <Label label={todo.text} hexpand cssClasses={todo.completed ? ["dim-label"] : []} />
773
773
  <Button iconName="edit-delete-symbolic" onClicked={() => onDelete(todo.id)} cssClasses={["flat"]} />
774
774
  </Box>
775
775
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/cli",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "description": "CLI for GTKX - create and develop GTK4 React applications",
5
5
  "keywords": [
6
6
  "gtk",
@@ -47,8 +47,8 @@
47
47
  "@vitejs/plugin-react": "5.1.2",
48
48
  "citty": "0.1.6",
49
49
  "vite": "7.2.7",
50
- "@gtkx/ffi": "0.5.2",
51
- "@gtkx/react": "0.5.2"
50
+ "@gtkx/ffi": "0.6.1",
51
+ "@gtkx/react": "0.6.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": "^19"