Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ to land under these conventions; subsequent specs follow this shape.

### Changed

- **`TextField` → `TextBox` rename.** The record type
`TextFieldElement` is renamed to `TextBoxElement` for parity with
WinUI's `Microsoft.UI.Xaml.Controls.TextBox`. The `TextField(...)`
factory remains as a non-erroring `[Obsolete]` forwarding alias for
one release; call sites should migrate to `TextBox(...)`. The
alias will be removed in a future release.

### Deprecated

- **`Factories.TextField(...)`** — use `Factories.TextBox(...)` instead.
Emits `CS0618` warning; will be removed in a future release.

- **Spec 045 Phase 2 — §2.29 ready for human review gate.**
Every Phase-2 implementation item in
`docs/specs/tasks/045-docking-windows-implementation.md` is now
Expand Down
4 changes: 2 additions & 2 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Grid(columns: [GridSize.Star(), GridSize.Px(200)],
TitleBar("App") with { Subtitle = "Home", Content = ..., RightHeader = ... }

// Controls
Button("Click", () => ...) TextField(value, setValue, placeholder)
Button("Click", () => ...) TextBox(value, setValue, placeholder)
CheckBox(isChecked, setChecked) ToggleSwitch(on, setOn)
Slider(v, 0, 100, setV) ComboBox(items, index, setIndex)

Expand Down Expand Up @@ -544,7 +544,7 @@ release you depend on.
| `<div>` | `FlexColumn() / FlexRow() / Border()` (prefer over `VStack`/`HStack`) |
| `<span>text</span>` | `TextBlock("text")` |
| `<button onClick={fn}>` | `Button("label", fn)` |
| `<input value={v} onChange={fn}>` | `TextField(v, fn)` |
| `<input value={v} onChange={fn}>` | `TextBox(v, fn)` |
| `{cond && <X/>}` | `cond ? X() : null` |
| `{items.map(i => <X/>)}` | `items.Select(i => X()).ToArray()` |
| `<Component />` | `Component<MyComponent>()` |
Expand Down
12 changes: 6 additions & 6 deletions docs/_pipeline/apps/accessibility/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override Element Render()
TextBlock("Profile")
.FontSize(18).SemiBold()
.HeadingLevel(AutomationHeadingLevel.Level2),
TextField("", _ => { }, placeholder: "Display name")
TextBox("", _ => { }, placeholder: "Display name")
.AutomationName("Display name")
.TabIndex(1)
.AccessKey("N"),
Expand All @@ -42,7 +42,7 @@ class Tier2Demo : Component
public override Element Render()
{
return VStack(12,
TextField("", _ => { }, placeholder: "Search...")
TextBox("", _ => { }, placeholder: "Search...")
.AutomationName("Search products")
.HelpText("Type a product name or SKU to filter results")
.Width(300),
Expand Down Expand Up @@ -75,9 +75,9 @@ public override Element Render()
return VStack(12,
TextBlock("Create Account").FontSize(24).Bold()
.HeadingLevel(AutomationHeadingLevel.Level1),
TextField(name, setName, header: "Full Name")
TextBox(name, setName, header: "Full Name")
.AutomationName("Full name").Required().TabIndex(1),
TextField(email, setEmail, header: "Email")
TextBox(email, setEmail, header: "Email")
.AutomationName("Email address").Required().TabIndex(2)
.HelpText("We'll send a verification link"),
CheckBox(agree, setAgree, label: "I accept the terms")
Expand Down Expand Up @@ -110,7 +110,7 @@ public override Element Render()
).Landmark(AutomationLandmarkType.Main)
.AutomationName("Main content"),

TextField("", _ => { }, placeholder: "Search...")
TextBox("", _ => { }, placeholder: "Search...")
.AutomationName("Site search")
.Landmark(AutomationLandmarkType.Search)
).Padding(24);
Expand Down Expand Up @@ -159,7 +159,7 @@ public override Element Render()
VStack(12,
TextBlock("Modal Dialog").FontSize(18).Bold(),
TextBlock("Tab/Shift+Tab stays inside this panel."),
TextField("", _ => { }, placeholder: "Name")
TextBox("", _ => { }, placeholder: "Name")
.TabIndex(0),
Button("Close", () => setShowModal(false))
.TabIndex(1)
Expand Down
6 changes: 3 additions & 3 deletions docs/_pipeline/apps/advanced/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public override Element Render()

return VStack(12,
SubHeading("UseObservableTree"),
TextField(vm.UserName, v => vm.UserName = v,
TextBox(vm.UserName, v => vm.UserName = v,
header: "User Name"),
ToggleSwitch(vm.DarkMode, v => vm.DarkMode = v,
header: "Dark Mode"),
Expand All @@ -167,7 +167,7 @@ public override Element Render()
return VStack(12,
SubHeading("UseCollection"),
HStack(8,
TextField(input, setInput, placeholder: "New task")
TextBox(input, setInput, placeholder: "New task")
.Width(200),
Button("Add", () => {
if (!string.IsNullOrWhiteSpace(input))
Expand Down Expand Up @@ -196,7 +196,7 @@ public override Element Render()

return VStack(12,
SubHeading("Imperative focus via ElementRef<T>"),
TextField(name, setName, placeholder: "Name").Ref(fieldRef),
TextBox(name, setName, placeholder: "Name").Ref(fieldRef),
Button("Focus the field", () =>
fieldRef.Current?.Focus(FocusState.Programmatic))
).Padding(24);
Expand Down
4 changes: 2 additions & 2 deletions docs/_pipeline/apps/collections/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public override Element Render()
return VStack(12,
SubHeading("VirtualListRef — Imperative Scroll"),
HStack(8,
TextField(targetIndex, setTargetIndex,
TextBox(targetIndex, setTargetIndex,
placeholder: "Index"),
Button("Scroll To", () =>
{
Expand Down Expand Up @@ -219,7 +219,7 @@ public override Element Render()
return VStack(12,
SubHeading("Stable Identity with WithKey"),
HStack(8,
TextField(newItem, setNewItem, placeholder: "New item"),
TextBox(newItem, setNewItem, placeholder: "New item"),
Button("Add", () => {
if (!string.IsNullOrWhiteSpace(newItem)) {
updateItems(l => [.. l, newItem.Trim()]);
Expand Down
4 changes: 2 additions & 2 deletions docs/_pipeline/apps/commanding/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override Element Render()
};

return VStack(12,
TextField(text, v => { setText(v); setSaved(false); })
TextBox(text, v => { setText(v); setSaved(false); })
.Width(400),
HStack(8,
Button(saveCmd),
Expand Down Expand Up @@ -114,7 +114,7 @@ public override Element Render()
secondaryCommands: new[] {
AppBarButton(delete) }
),
TextField(text, setText).Margin(16)
TextBox(text, setText).Margin(16)
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/components/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override Element Render()

return VStack(12,
TextBlock($"Hello, {name}!").FontSize(20).Bold(),
TextField(name, setName, placeholder: "Your name")
TextBox(name, setName, placeholder: "Your name")
.Width(200)
).Padding(16);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/controls/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override Element Render()
var (volume, setVolume) = UseState(60.0);

return VStack(8,
TextField(name, setName, placeholder: "Name").Width(200),
TextBox(name, setName, placeholder: "Name").Width(200),
CheckBox(agree, setAgree, label: "I agree"),
Slider(volume, 0, 100, setVolume).Width(200),
Button("Submit", () => { })
Expand Down
4 changes: 2 additions & 2 deletions docs/_pipeline/apps/dev-tooling/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public override Element Render()
Button("Click me", () => setCount(count + 1)),
TextBlock($"Clicked {count} times").SemiBold()
),
TextField(message, setMessage, placeholder: "Type something")
TextBox(message, setMessage, placeholder: "Type something")
.Width(300)
).Padding(24);
}
Expand Down Expand Up @@ -68,7 +68,7 @@ public override Element Render()
Heading("Iteration Cycle Demo"),
TextBlock("Add items, then edit this code and save to see hot reload."),
HStack(8,
TextField(input, setInput, placeholder: "New item")
TextBox(input, setInput, placeholder: "New item")
.Width(200),
Button("Add", () =>
{
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/dialogs-and-flyouts/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override Element Render()
"Rename file",
VStack(8,
TextBlock("New filename:"),
TextField(name, setName, placeholder: "untitled.txt")
TextBox(name, setName, placeholder: "untitled.txt")
.Width(280)),
primaryButtonText: "Rename") with
{
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/effects/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override Element Render()
}, query);

return VStack(12,
TextField(query, setQuery, placeholder: "Search...").Width(300),
TextBox(query, setQuery, placeholder: "Search...").Width(300),
TextBlock(results).Foreground(Theme.SecondaryText)
).Padding(24);
}
Expand Down
34 changes: 17 additions & 17 deletions docs/_pipeline/apps/forms/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override Element Render()

return VStack(12,
SubHeading("Controlled Input"),
TextField(name, setName, placeholder: "Type your name"),
TextBox(name, setName, placeholder: "Type your name"),
TextBlock($"You typed: {name}").Opacity(0.6)
).Padding(24);
}
Expand All @@ -44,7 +44,7 @@ public override Element Render()
var (priority, setPriority) = UseState(0);

return VStack(12,
TextField(text, setText, placeholder: "Email",
TextBox(text, setText, placeholder: "Email",
header: "Email"),
PasswordBox(password, setPassword,
placeholderText: "Enter password"),
Expand Down Expand Up @@ -78,7 +78,7 @@ public override Element Render()

return VStack(12,
SubHeading("Simple Validation"),
TextField(email, setEmail, placeholder: "user@example.com",
TextBox(email, setEmail, placeholder: "user@example.com",
header: "Email"),
When(!string.IsNullOrEmpty(email) && !emailValid, () =>
TextBlock("Enter a valid email address")
Expand Down Expand Up @@ -112,7 +112,7 @@ public override Element Render()

return VStack(12,
SubHeading("Keeping Submit Reachable"),
TextField(email, setEmail, header: "Email",
TextBox(email, setEmail, header: "Email",
placeholder: "user@example.com"),

// .Immediate() switches NumberBox from commit-on-blur to
Expand Down Expand Up @@ -142,7 +142,7 @@ public override Element Render()

return VStack(12,
SubHeading("Validation Context"),
TextField(email, v => { setEmail(v); ctx.NotifyValueChanged("email", v); },
TextBox(email, v => { setEmail(v); ctx.NotifyValueChanged("email", v); },
placeholder: "user@example.com", header: "Email")
.Validate("email", email,
Validate.Required(),
Expand Down Expand Up @@ -183,13 +183,13 @@ public override Element Render()
return VStack(12,
SubHeading("FormField Helper"),
FormField(
TextField(name, v => { setName(v); ctx.NotifyValueChanged("name", v); })
TextBox(name, v => { setName(v); ctx.NotifyValueChanged("name", v); })
.Validate("name", name, Validate.Required()),
label: "Full Name",
required: true,
description: "As it appears on your ID"),
FormField(
TextField(email, v => { setEmail(v); ctx.NotifyValueChanged("email", v); })
TextBox(email, v => { setEmail(v); ctx.NotifyValueChanged("email", v); })
.Validate("email", email,
Validate.Required(), Validate.Email()),
label: "Email Address",
Expand All @@ -211,10 +211,10 @@ public override Element Render()

return VStack(12,
SubHeading("Masked Input"),
TextField(phoneMask.Apply(phone), v => setPhone(phoneMask.GetRawValue(v)),
TextBox(phoneMask.Apply(phone), v => setPhone(phoneMask.GetRawValue(v)),
placeholder: "(___) ___-____", header: "Phone"),
TextBlock($"Raw: {phone}").FontSize(12).Opacity(0.6),
TextField(dateMask.Apply(date), v => setDate(dateMask.GetRawValue(v)),
TextBox(dateMask.Apply(date), v => setDate(dateMask.GetRawValue(v)),
placeholder: "__/__/____", header: "Date"),
TextBlock($"Raw: {date}").FontSize(12).Opacity(0.6)
).Padding(24);
Expand All @@ -235,10 +235,10 @@ public override Element Render()

return VStack(12,
SubHeading("Input Formatters"),
TextField(currencyFmt.Format(currency, 0).Output,
TextBox(currencyFmt.Format(currency, 0).Output,
v => setCurrency(currencyFmt.Parse(v)),
placeholder: "$0.00", header: "Amount"),
TextField(upperFmt.Format(upper, 0).Output,
TextBox(upperFmt.Format(upper, 0).Output,
v => setUpper(upperFmt.Parse(v)),
placeholder: "UPPERCASE", header: "Code")
).Padding(24);
Expand All @@ -259,17 +259,17 @@ public override Element Render()
var (note, setNote) = UseState("");

return VStack(12,
TextField(qty, setQty, header: "Quantity")
TextBox(qty, setQty, header: "Quantity")
.NumericInput(),
TextField(email, setEmail, header: "Email")
TextBox(email, setEmail, header: "Email")
.EmailInput(),
TextField(url, setUrl, header: "URL")
TextBox(url, setUrl, header: "URL")
.UrlInput(),
TextField(phone, setPhone, header: "Phone")
TextBox(phone, setPhone, header: "Phone")
.PhoneInput(),
TextField(search, setSearch, placeholder: "Search…")
TextBox(search, setSearch, placeholder: "Search…")
.SearchInput(),
TextField(note, setNote, header: "Reference code")
TextBox(note, setNote, header: "Reference code")
.MaxLength(8)
.CharacterCasing(CharacterCasing.Upper)
.TextAlignment(TextAlignment.Center)
Expand Down
6 changes: 3 additions & 3 deletions docs/_pipeline/apps/getting-started/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override Element Render()

return VStack(16,
TextBlock($"Hello, {name}!").FontSize(24).Bold(),
TextField(name, setName, placeholder: "Enter your name").Width(250)
TextBox(name, setName, placeholder: "Enter your name").Width(250)
).Padding(24);
}
}
Expand Down Expand Up @@ -101,8 +101,8 @@ public override Element Render()

return VStack(12,
TextBlock($"Hello, {fullName}!").FontSize(fontSize).Bold(),
TextField(firstName, setFirstName, placeholder: "First name").Width(200),
TextField(lastName, setLastName, placeholder: "Last name").Width(200),
TextBox(firstName, setFirstName, placeholder: "First name").Width(200),
TextBox(lastName, setLastName, placeholder: "Last name").Width(200),
HStack(8,
TextBlock("Font size:"),
Slider(fontSize, 10, 40, setFontSize).Width(200),
Expand Down
10 changes: 5 additions & 5 deletions docs/_pipeline/apps/hooks/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override Element Render()
return VStack(12,
SubHeading("UseState"),
TextBlock("Sample text").FontSize(size).Foreground(color),
TextField(color, setColor, placeholder: "#hex color")
TextBox(color, setColor, placeholder: "#hex color")
.Width(150),
HStack(8,
TextBlock("Size:"),
Expand All @@ -42,7 +42,7 @@ public override Element Render()
return VStack(12,
SubHeading("UseReducer"),
HStack(8,
TextField(input, setInput, placeholder: "Add item")
TextBox(input, setInput, placeholder: "Add item")
.Width(180),
Button("Add", () =>
{
Expand Down Expand Up @@ -141,7 +141,7 @@ public override Element Render()

return VStack(8,
SubHeading("UseMemo"),
TextField(input, setInput).Width(250),
TextBox(input, setInput).Width(250),
TextBlock($"Characters: {stats.Chars}, Words: {stats.Words}"),
Caption($"Uppercased: {stats.Upper}")
);
Expand All @@ -161,7 +161,7 @@ public override Element Render()
return VStack(8,
SubHeading("UseRef"),
TextBlock($"Render count: {renderCount.Current}").SemiBold(),
TextField(value, setValue, placeholder: "Type to trigger renders")
TextBox(value, setValue, placeholder: "Type to trigger renders")
.Width(250),
Caption("UseRef persists across renders without causing them")
);
Expand All @@ -183,7 +183,7 @@ public override Element Render()
return VStack(8,
SubHeading("UseCallback"),
TextBlock($"Count: {count}").FontSize(18),
TextField(label, setLabel, placeholder: "Button label")
TextBox(label, setLabel, placeholder: "Button label")
.Width(200),
Button(label, stableIncrement),
Caption("The callback identity stays stable across renders")
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/input-and-gestures/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public override Element Render()

return VStack(12,
TextBlock("The field below auto-focuses on mount via UseElementFocus()."),
TextField(name, setName, placeholder: "name").Width(280).Ref(inputRef)
TextBox(name, setName, placeholder: "name").Width(280).Ref(inputRef)
).Padding(24);
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/_pipeline/apps/layout/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override Element Render()
columns: [GridSize.Px(120), GridSize.Star(), GridSize.Auto],
rows: [GridSize.Auto, GridSize.Auto],
TextBlock("Label").Bold().Grid(row: 0, column: 0),
TextField("", _ => { }, placeholder: "Input...")
TextBox("", _ => { }, placeholder: "Input...")
.Grid(row: 0, column: 1),
Button("Go").Grid(row: 0, column: 2),
TextBlock("Status").Grid(row: 1, column: 0),
Expand Down
Loading
Loading