@primitiv-ui/react 0.1.19 → 0.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitiv-ui/react",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
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/Slot/Slot.tsx CHANGED
@@ -20,6 +20,9 @@ import {
20
20
  cloneElement,
21
21
  Children,
22
22
  RefObject,
23
+ type ForwardRefExoticComponent,
24
+ type PropsWithoutRef,
25
+ type RefAttributes,
23
26
  } from "react";
24
27
  import { SlotProps } from "./types";
25
28
  import { AnyProps, PossibleRef } from "../types";
@@ -137,7 +140,9 @@ function mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {
137
140
  * return <button {...buttonProps}>{children}</button>;
138
141
  * ```
139
142
  */
140
- export const Slot = forwardRef<HTMLElement, SlotProps>(
143
+ export const Slot: ForwardRefExoticComponent<
144
+ PropsWithoutRef<SlotProps> & RefAttributes<HTMLElement>
145
+ > = forwardRef<HTMLElement, SlotProps>(
141
146
  ({ children, ...slotProps }, forwardedRef) => {
142
147
  if (Children.count(children) !== 1 || !isValidElement(children)) {
143
148
  throw new Error("Slot requires exactly one React element child.");
package/src/index.ts CHANGED
@@ -27,6 +27,8 @@ export * from "./RadioGroup/index.ts";
27
27
  export * from "./Select/index.ts";
28
28
  export * from "./SkipNav/index.ts";
29
29
  export * from "./Slider/index.ts";
30
+ export { Slot } from "./Slot/index.ts";
31
+ export type { SlotProps } from "./Slot/index.ts";
30
32
  export * from "./Status/index.ts";
31
33
  export * from "./Switch/index.ts";
32
34
  export * from "./Table/index.ts";