@checkstack/ui 0.0.4 → 0.1.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
@@ -1,5 +1,34 @@
1
1
  # @checkstack/ui
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8e43507: # Button component defaults to type="button"
8
+
9
+ The `Button` component now defaults to `type="button"` instead of the HTML default `type="submit"`. This prevents accidental form submissions when buttons are placed inside forms but aren't intended to submit.
10
+
11
+ ## Changes
12
+
13
+ - Default `type` prop is now `"button"` instead of the HTML implicit `"submit"`
14
+ - Form submission buttons must now explicitly set `type="submit"`
15
+
16
+ ## Migration
17
+
18
+ No migration needed if your submit buttons already have `type="submit"` explicitly set (recommended practice). If you have buttons that should submit forms but don't have an explicit type, add `type="submit"`:
19
+
20
+ ```diff
21
+ - <Button onClick={handleSubmit}>Submit</Button>
22
+ + <Button type="submit">Submit</Button>
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - 97c5a6b: Fixed DOM clobbering issue in DynamicForm by prefixing field IDs with 'field-'. Previously, schema fields with names matching native DOM properties (like 'nodeName', 'tagName', 'innerHTML') could shadow those properties, causing floating-ui and React to crash during DOM traversal.
28
+ - Updated dependencies [8e43507]
29
+ - @checkstack/common@0.1.0
30
+ - @checkstack/frontend-api@0.0.4
31
+
3
32
  ## 0.0.4
4
33
 
5
34
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/ui",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "dependencies": {
@@ -39,12 +39,16 @@ export interface ButtonProps
39
39
  }
40
40
 
41
41
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
42
- ({ className, variant, size, asChild = false, ...props }, ref) => {
42
+ (
43
+ { className, variant, size, asChild = false, type = "button", ...props },
44
+ ref
45
+ ) => {
43
46
  const Comp = asChild ? Slot : "button";
44
47
  return (
45
48
  <Comp
46
49
  className={cn(buttonVariants({ variant, size, className }))}
47
50
  ref={ref}
51
+ type={asChild ? undefined : type}
48
52
  {...props}
49
53
  />
50
54
  );
@@ -109,7 +109,9 @@ export const DynamicForm: React.FC<DynamicFormProps> = ({
109
109
  return (
110
110
  <FormField
111
111
  key={key}
112
- id={key}
112
+ // Prefix with 'field-' to prevent DOM clobbering when field names
113
+ // match native DOM properties (e.g., nodeName, tagName, innerHTML)
114
+ id={`field-${key}`}
113
115
  label={label}
114
116
  propSchema={propSchema}
115
117
  value={value[key]}