@tangle-network/ui 11.28.1 → 11.28.2

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,11 @@
1
1
  # @tangle-network/ui
2
2
 
3
+ ## 11.28.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9f4d5b8: A file `Input`'s selector button inherits the field's text size, so `sm`, `lg` and coarse-pointer file inputs no longer keep a 14px button.
8
+
3
9
  ## 11.28.1
4
10
 
5
11
  ### Patch Changes
@@ -8,7 +8,7 @@ import { cva } from "class-variance-authority";
8
8
  import * as React from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  //#region src/primitives/input.tsx
11
- const inputVariants = cva(cn("flex w-full border py-1 placeholder:text-[var(--text-dim)] disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:font-medium file:text-sm", fieldPresentation, fieldTouchText), {
11
+ const inputVariants = cva(cn("flex w-full border py-1 placeholder:text-[var(--text-dim)] disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:font-medium", fieldPresentation, fieldTouchText), {
12
12
  variants: {
13
13
  variant: {
14
14
  default: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "11.28.1",
3
+ "version": "11.28.2",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -63,6 +63,13 @@ describe("shared control presentation", () => {
63
63
  }
64
64
  });
65
65
 
66
+ it("lets a file input's selector button take the field's text size", () => {
67
+ render(<Input type="file" size="lg" aria-label="Upload" />);
68
+ const classes = screen.getByLabelText("Upload").className.split(" ");
69
+ expect(classes).toContain("text-[length:var(--control-text-lg,1rem)]");
70
+ expect(classes.filter((name) => name.startsWith("file:text-"))).toEqual([]);
71
+ });
72
+
66
73
  it("gives icon buttons squares on the same heights", () => {
67
74
  render(<><Button size="icon-sm" aria-label="Small" /><Button size="icon" aria-label="Medium" /><Button size="icon-lg" aria-label="Large" /></>);
68
75
  expect(screen.getByLabelText("Small").className).toContain("size-[var(--control-height-sm,2rem)]");
@@ -13,7 +13,7 @@ import { cva, type VariantProps } from "class-variance-authority";
13
13
  // and a Button at the same size share a height, text size and corner.
14
14
  const inputVariants = cva(
15
15
  cn(
16
- "flex w-full border py-1 placeholder:text-[var(--text-dim)] disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:font-medium file:text-sm",
16
+ "flex w-full border py-1 placeholder:text-[var(--text-dim)] disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:font-medium",
17
17
  fieldPresentation,
18
18
  fieldTouchText,
19
19
  ),