@primitiv-ui/react 0.1.9 → 0.1.11

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/package.json +1 -1
  2. package/src/Tabs/types.ts +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitiv-ui/react",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Headless, accessible React components built on the WAI-ARIA authoring patterns. Zero styles ship with this package — bring your own (CSS, Tailwind, CSS-in-JS, design tokens).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/Tabs/types.ts CHANGED
@@ -51,8 +51,16 @@ export type ControlledTabsRootProps = {
51
51
 
52
52
  /** Props for `Tabs.Root` — the state owner and context provider. Extends the
53
53
  * native `<div>` props (minus `onChange`) and resolves to either the
54
- * controlled or uncontrolled prop shape. */
55
- export type TabsRootProps = Omit<ComponentProps<"div">, "onChange"> & {
54
+ * controlled or uncontrolled prop shape.
55
+ *
56
+ * `ref` is omitted from the inherited `<div>` props deliberately: `Tabs.Root`
57
+ * is a `forwardRef` component whose ref is the {@link TabsImperativeApi}
58
+ * imperative handle, **not** the underlying `HTMLDivElement`. The component
59
+ * type re-adds the correct `ref` via `RefAttributes<TabsImperativeApi>`. Were
60
+ * the `HTMLDivElement` `ref` left in, a styled wrapper that spreads these props
61
+ * straight back into `Tabs.Root` (`<Tabs.Root {...props} />`) would fail to
62
+ * type-check on incompatible `ref` types (D58). */
63
+ export type TabsRootProps = Omit<ComponentProps<"div">, "onChange" | "ref"> & {
56
64
  orientation?: TabsOrientation;
57
65
  dir?: TabsReadingDirection;
58
66
  activationMode?: TabsActivationMode;