@wizeworks/silicaui-mcp 0.40.0 → 0.42.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.
@@ -3981,14 +3981,22 @@
3981
3981
  "package": "@wizeworks/silicaui-react",
3982
3982
  "category": "Data input",
3983
3983
  "sourceFile": "silicaui-react/src/form.tsx",
3984
- "description": "Silica Form — a `<form>` that coordinates its Fields' validation. Behavior from Base UI: it runs each Field's validation on submit, focuses the first invalid control, and accepts server-returned `errors` keyed by field `name`. Presentational only otherwise — lay it out with `Field`s and utilities. <Form errors={serverErrors} onSubmit={…}> <Field name=\"email\">…</Field> <Button type=\"submit\">Save</Button> </Form>",
3984
+ "description": "Silica Form — a `<form>` that coordinates its Fields' validation. Behavior from Base UI: it runs each Field's validation on submit, moves focus to the first invalid control, and accepts server-returned `errors` keyed by field `name`. Presentational only otherwise — lay it out with `Field`s and utilities. <Form errors={serverErrors} onSubmit={…}> <Field name=\"email\">…</Field> <Button type=\"submit\">Save</Button> </Form> Silica narrows the focus move, which is unconditional and un-opt-out-able upstream: it never selects the control's existing value, and never takes the caret from a text control the user is typing in when a late `errors` update arrives. Use `focusOnError` to soften it further: <Form focusOnError=\"scroll\" errors={serverErrors}>…</Form> // reveal, don't focus <Form focusOnError={false} errors={serverErrors}>…</Form> // leave focus alone",
3985
3985
  "props": [
3986
3986
  {
3987
3987
  "name": "FormProps",
3988
- "members": []
3988
+ "extends": "extends React.ComponentPropsWithoutRef<typeof BaseForm>",
3989
+ "members": [
3990
+ {
3991
+ "name": "focusOnError",
3992
+ "optional": true,
3993
+ "type": "FormFocusOnError",
3994
+ "doc": "How an invalid submit (or a late `errors` update) treats focus. Defaults to `true`."
3995
+ }
3996
+ ]
3989
3997
  }
3990
3998
  ],
3991
- "usageExample": null
3999
+ "usageExample": "import { useState } from \"react\";\nimport {\n Button,\n Field,\n FieldControl,\n FieldError,\n FieldLabel,\n Form,\n PasswordInput,\n ToggleGroup,\n ToggleGroupItem,\n} from \"@wizeworks/silicaui-react\";\nimport type { FormFocusOnError } from \"@wizeworks/silicaui-react\";\nimport { Section, Stack } from \"../lib/Section\";\n\ntype Errors = Record<string, string>;\n\n/**\n * `Form` runs each Field's validation on submit and moves focus to the first\n * invalid control. `focusOnError` decides how far that goes — the sign-in shape\n * below is where it matters, because the rejection arrives from a server long\n * after the user has moved on to the next field.\n */\nexport function FormDemo() {\n const [focusOnError, setFocusOnError] = useState<FormFocusOnError>(true);\n const [errors, setErrors] = useState<Errors>({});\n const [pending, setPending] = useState(false);\n\n function onSubmit(event: React.FormEvent<HTMLFormElement>) {\n event.preventDefault();\n setErrors({});\n setPending(true);\n // Stands in for a sign-in round trip. Type into the password field while\n // it runs: the caret has to stay put when the rejection lands.\n window.setTimeout(() => {\n setPending(false);\n setErrors({ email: \"That address isn't registered.\" });\n }, 1500);\n }\n\n return (\n <>\n <Section title=\"focusOnError\">\n <Stack className=\"max-w-sm\">\n <ToggleGroup\n size=\"sm\"\n value={[String(focusOnError)]}\n onValueChange={(v) => {\n const next = v[0];\n if (next == null) return; // clicking the active item can't clear it\n setFocusOnError(\n next === \"false\" ? false : next === \"scroll\" ? \"scroll\" : true,\n );\n }}\n >\n <ToggleGroupItem value=\"true\">true</ToggleGroupItem>\n <ToggleGroupItem value=\"scroll\">scroll</ToggleGroupItem>\n <ToggleGroupItem value=\"false\">false</ToggleGroupItem>\n </ToggleGroup>\n <p className=\"text-sm\">\n Submit with an invalid email to see the client-side path. For the\n async path, submit a <em>valid</em> address and keep typing your\n password during the 1.5s round trip — the rejection must not take\n the caret.\n </p>\n </Stack>\n </Section>\n\n <Section title=\"Sign in\">\n <Form\n errors={errors}\n focusOnError={focusOnError}\n onSubmit={onSubmit}\n className=\"grid max-w-sm gap-4\"\n >\n <Field name=\"email\">\n <FieldLabel required>Email</FieldLabel>\n <FieldControl\n type=\"email\"\n required\n placeholder=\"you@example.com\"\n data-testid=\"demo-email\"\n />\n <FieldError />\n </Field>\n <Field\n name=\"password\"\n validate={(v) =>\n String(v ?? \"\").length >= 8 ? null : \"Use at least 8 characters.\"\n }\n >\n <FieldLabel required>Password</FieldLabel>\n <FieldControl\n required\n render={<PasswordInput data-testid=\"demo-password\" />}\n />\n <FieldError />\n </Field>\n <Button type=\"submit\" color=\"primary\" loading={pending}>\n {pending ? \"Signing in…\" : \"Sign in\"}\n </Button>\n </Form>\n </Section>\n </>\n );\n}"
3992
4000
  },
3993
4001
  {
3994
4002
  "name": "Input",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizeworks/silicaui-mcp",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "A local MCP server that lets AI coding assistants query the Silica UI design system — real class names, component props, blocks, and behaviors — instead of guessing.",
5
5
  "type": "module",
6
6
  "license": "MIT",