@refraction-ui/react 0.19.2 → 0.20.1

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 (59) hide show
  1. package/dist/{chunk-UJ6BBWQM.js → chunk-TOZBR4GL.js} +3 -3
  2. package/dist/{chunk-UJ6BBWQM.js.map → chunk-TOZBR4GL.js.map} +1 -1
  3. package/dist/chunk-WSPJTQAV.js +59 -0
  4. package/dist/chunk-WSPJTQAV.js.map +7 -0
  5. package/dist/form.cjs.map +1 -1
  6. package/dist/form.js.map +1 -1
  7. package/dist/index.cjs +2590 -33429
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +1 -0
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/internal/react-badge/index.d.cts +5 -0
  13. package/dist/internal/react-badge/index.d.ts +5 -0
  14. package/dist/internal/react-callout/index.d.cts +4 -0
  15. package/dist/internal/react-callout/index.d.ts +4 -0
  16. package/dist/internal/react-card/index.d.cts +8 -1
  17. package/dist/internal/react-card/index.d.ts +8 -1
  18. package/dist/internal/react-form/index.d.cts +2 -21
  19. package/dist/internal/react-form/index.d.ts +2 -21
  20. package/dist/internal/react-link-card/index.d.cts +8 -2
  21. package/dist/internal/react-link-card/index.d.ts +8 -2
  22. package/dist/internal/react-slot/index.d.cts +23 -0
  23. package/dist/internal/react-slot/index.d.ts +23 -0
  24. package/dist/react-analytics.js +6 -6
  25. package/dist/react-analytics.js.map +3 -3
  26. package/dist/react-avatar-group.js +5 -5
  27. package/dist/react-avatar-group.js.map +1 -1
  28. package/dist/react-badge.js +17 -1
  29. package/dist/react-badge.js.map +2 -2
  30. package/dist/react-callout.js +19 -3
  31. package/dist/react-callout.js.map +2 -2
  32. package/dist/react-card.js +18 -2
  33. package/dist/react-card.js.map +2 -2
  34. package/dist/react-empty-state.js +2 -2
  35. package/dist/react-empty-state.js.map +1 -1
  36. package/dist/react-input.js +1 -1
  37. package/dist/react-link-card.js +15 -1
  38. package/dist/react-link-card.js.map +2 -2
  39. package/dist/react-password-input.js +1 -1
  40. package/dist/react-presence-indicator.js +5 -5
  41. package/dist/react-presence-indicator.js.map +1 -1
  42. package/dist/react-progress-display.js +2 -2
  43. package/dist/react-progress-display.js.map +1 -1
  44. package/dist/react-slot.js +7 -0
  45. package/dist/react-slot.js.map +7 -0
  46. package/dist/react-status-indicator.js +12 -12
  47. package/dist/react-status-indicator.js.map +1 -1
  48. package/dist/react-toast.js +3 -3
  49. package/dist/react-toast.js.map +2 -2
  50. package/dist/styles.css +15 -0
  51. package/package.json +2 -1
  52. package/dist/applicationinsights-web-H7OBLIVJ.js +0 -23393
  53. package/dist/applicationinsights-web-H7OBLIVJ.js.map +0 -1
  54. package/dist/chunk-GFXGXZDB.js +0 -23543
  55. package/dist/chunk-GFXGXZDB.js.map +0 -7
  56. package/dist/chunk-O4R4W2KY.js +0 -6460
  57. package/dist/chunk-O4R4W2KY.js.map +0 -7
  58. package/dist/module-X3HTTRQK.js +0 -6438
  59. package/dist/module-X3HTTRQK.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -37,6 +37,7 @@ export * from './internal/react-search-bar/index.cjs';
37
37
  export * from './internal/react-sidebar/index.cjs';
38
38
  export * from './internal/react-sheet/index.cjs';
39
39
  export * from './internal/react-skeleton/index.cjs';
40
+ export * from './internal/react-slot/index.cjs';
40
41
  export * from './internal/react-tabs/index.cjs';
41
42
  export * from './internal/react-textarea/index.cjs';
42
43
  export * from './internal/react-toast/index.cjs';
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ export * from './internal/react-search-bar/index.js';
37
37
  export * from './internal/react-sidebar/index.js';
38
38
  export * from './internal/react-sheet/index.js';
39
39
  export * from './internal/react-skeleton/index.js';
40
+ export * from './internal/react-slot/index.js';
40
41
  export * from './internal/react-tabs/index.js';
41
42
  export * from './internal/react-textarea/index.js';
42
43
  export * from './internal/react-toast/index.js';
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ export * from './react-search-bar.js';
38
38
  export * from './react-sidebar.js';
39
39
  export * from './react-sheet.js';
40
40
  export * from './react-skeleton.js';
41
+ export * from './react-slot.js';
41
42
  export * from './react-tabs.js';
42
43
  export * from './react-textarea.js';
43
44
  export * from './react-toast.js';
@@ -5,6 +5,11 @@ export { BadgeSize, BadgeVariant, badgeVariants } from '../badge/index.cjs';
5
5
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  variant?: BadgeVariant;
7
7
  size?: BadgeSize;
8
+ /** Merge the badge's classes/props onto the single child element instead of
9
+ * rendering a `<div>` (Radix-style `asChild`) — e.g.
10
+ * `<Badge asChild><a href="/x">…</a></Badge>` for a linked badge. Expects
11
+ * exactly one React element child. */
12
+ asChild?: boolean;
8
13
  }
9
14
  /**
10
15
  * Badge component — renders a styled badge with variant and size support.
@@ -5,6 +5,11 @@ export { BadgeSize, BadgeVariant, badgeVariants } from '../badge/index.js';
5
5
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
6
6
  variant?: BadgeVariant;
7
7
  size?: BadgeSize;
8
+ /** Merge the badge's classes/props onto the single child element instead of
9
+ * rendering a `<div>` (Radix-style `asChild`) — e.g.
10
+ * `<Badge asChild><a href="/x">…</a></Badge>` for a linked badge. Expects
11
+ * exactly one React element child. */
12
+ asChild?: boolean;
8
13
  }
9
14
  /**
10
15
  * Badge component — renders a styled badge with variant and size support.
@@ -2,6 +2,10 @@ import * as React from 'react';
2
2
 
3
3
  interface CalloutProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  variant?: 'default' | 'destructive' | 'success' | 'warning' | 'info';
5
+ /** Merge the callout's classes/props onto the single child element instead
6
+ * of rendering a `<div>` (Radix-style `asChild`). Expects exactly one React
7
+ * element child. */
8
+ asChild?: boolean;
5
9
  }
6
10
  declare const Callout: React.ForwardRefExoticComponent<CalloutProps & React.RefAttributes<HTMLDivElement>>;
7
11
  declare const CalloutIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -2,6 +2,10 @@ import * as React from 'react';
2
2
 
3
3
  interface CalloutProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  variant?: 'default' | 'destructive' | 'success' | 'warning' | 'info';
5
+ /** Merge the callout's classes/props onto the single child element instead
6
+ * of rendering a `<div>` (Radix-style `asChild`). Expects exactly one React
7
+ * element child. */
8
+ asChild?: boolean;
5
9
  }
6
10
  declare const Callout: React.ForwardRefExoticComponent<CalloutProps & React.RefAttributes<HTMLDivElement>>;
7
11
  declare const CalloutIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -1,10 +1,17 @@
1
1
  import * as React from 'react';
2
2
  export { CardAPI, CardProps, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants } from '../card/index.cjs';
3
3
 
4
+ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Merge the card's classes/props onto the single child element instead of
6
+ * rendering a `<div>` (Radix-style `asChild`) — e.g.
7
+ * `<Card asChild><a href="/x">…</a></Card>` for a clickable card. Expects
8
+ * exactly one React element child. */
9
+ asChild?: boolean;
10
+ }
4
11
  /**
5
12
  * Card -- a container with rounded corners, border, and shadow.
6
13
  */
7
- declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
8
15
  /**
9
16
  * CardHeader -- top section of a card, typically contains title and description.
10
17
  */
@@ -1,10 +1,17 @@
1
1
  import * as React from 'react';
2
2
  export { CardAPI, CardProps, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants } from '../card/index.js';
3
3
 
4
+ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Merge the card's classes/props onto the single child element instead of
6
+ * rendering a `<div>` (Radix-style `asChild`) — e.g.
7
+ * `<Card asChild><a href="/x">…</a></Card>` for a clickable card. Expects
8
+ * exactly one React element child. */
9
+ asChild?: boolean;
10
+ }
4
11
  /**
5
12
  * Card -- a container with rounded corners, border, and shadow.
6
13
  */
7
- declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
8
15
  /**
9
16
  * CardHeader -- top section of a card, typically contains title and description.
10
17
  */
@@ -3,6 +3,7 @@ import * as react_hook_form from 'react-hook-form';
3
3
  import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
4
  export { Controller, FieldPath, FieldValues, FormProvider, SubmitErrorHandler, SubmitHandler, UseFormProps, UseFormReturn, useController, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
5
5
  import * as React from 'react';
6
+ export { Slot, SlotProps } from '../react-slot/index.cjs';
6
7
 
7
8
  /**
8
9
  * Form — RHF FormProvider wrapper.
@@ -62,24 +63,4 @@ interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
62
63
  }
63
64
  declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.RefAttributes<HTMLParagraphElement>>;
64
65
 
65
- /**
66
- * Minimal Slot implementation.
67
- *
68
- * Why not @radix-ui/react-slot? Per package policy, no external runtime deps
69
- * are allowed in @refraction-ui/* packages. This Slot does the small amount
70
- * of work we actually need:
71
- * - Forwards a single React child
72
- * - Merges incoming props onto that child (event handlers are chained,
73
- * className is concatenated, style is shallow-merged)
74
- * - Merges refs (callback refs and ref objects)
75
- *
76
- * It is intentionally simpler than Radix Slot — no <Slottable/>, no asChild
77
- * recursion. FormControl renders exactly one child input/textarea/etc., which
78
- * is all we need here.
79
- */
80
- interface SlotProps extends React.HTMLAttributes<HTMLElement> {
81
- children?: React.ReactNode;
82
- }
83
- declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
84
-
85
- export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Slot, type SlotProps, formItemVariants, formLabelVariants, useFormField };
66
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, formItemVariants, formLabelVariants, useFormField };
@@ -3,6 +3,7 @@ import * as react_hook_form from 'react-hook-form';
3
3
  import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
4
4
  export { Controller, FieldPath, FieldValues, FormProvider, SubmitErrorHandler, SubmitHandler, UseFormProps, UseFormReturn, useController, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
5
5
  import * as React from 'react';
6
+ export { Slot, SlotProps } from '../react-slot/index.js';
6
7
 
7
8
  /**
8
9
  * Form — RHF FormProvider wrapper.
@@ -62,24 +63,4 @@ interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
62
63
  }
63
64
  declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & React.RefAttributes<HTMLParagraphElement>>;
64
65
 
65
- /**
66
- * Minimal Slot implementation.
67
- *
68
- * Why not @radix-ui/react-slot? Per package policy, no external runtime deps
69
- * are allowed in @refraction-ui/* packages. This Slot does the small amount
70
- * of work we actually need:
71
- * - Forwards a single React child
72
- * - Merges incoming props onto that child (event handlers are chained,
73
- * className is concatenated, style is shallow-merged)
74
- * - Merges refs (callback refs and ref objects)
75
- *
76
- * It is intentionally simpler than Radix Slot — no <Slottable/>, no asChild
77
- * recursion. FormControl renders exactly one child input/textarea/etc., which
78
- * is all we need here.
79
- */
80
- interface SlotProps extends React.HTMLAttributes<HTMLElement> {
81
- children?: React.ReactNode;
82
- }
83
- declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
84
-
85
- export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Slot, type SlotProps, formItemVariants, formLabelVariants, useFormField };
66
+ export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, formItemVariants, formLabelVariants, useFormField };
@@ -1,5 +1,11 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare const LinkCard: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
3
+ interface LinkCardProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
+ /** Merge the link card's classes/props onto the single child element
5
+ * instead of rendering an `<a>` (Radix-style `asChild`) — e.g. compose with
6
+ * a router `<Link>`. Expects exactly one React element child. */
7
+ asChild?: boolean;
8
+ }
9
+ declare const LinkCard: React.ForwardRefExoticComponent<LinkCardProps & React.RefAttributes<HTMLAnchorElement>>;
4
10
 
5
- export { LinkCard };
11
+ export { LinkCard, type LinkCardProps };
@@ -1,5 +1,11 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare const LinkCard: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
3
+ interface LinkCardProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
+ /** Merge the link card's classes/props onto the single child element
5
+ * instead of rendering an `<a>` (Radix-style `asChild`) — e.g. compose with
6
+ * a router `<Link>`. Expects exactly one React element child. */
7
+ asChild?: boolean;
8
+ }
9
+ declare const LinkCard: React.ForwardRefExoticComponent<LinkCardProps & React.RefAttributes<HTMLAnchorElement>>;
4
10
 
5
- export { LinkCard };
11
+ export { LinkCard, type LinkCardProps };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Minimal Slot implementation — the shared `asChild` primitive.
5
+ *
6
+ * Why not @radix-ui/react-slot? Per package policy, no external runtime deps
7
+ * are allowed in @refraction-ui/* packages. This Slot does the small amount
8
+ * of work we actually need:
9
+ * - Forwards a single React child
10
+ * - Merges incoming props onto that child (event handlers are chained,
11
+ * className is concatenated, style is shallow-merged)
12
+ * - Merges refs (callback refs and ref objects)
13
+ *
14
+ * It is intentionally simpler than Radix Slot — no <Slottable/>, no asChild
15
+ * recursion. `asChild` components render exactly one child element, which is
16
+ * all we need here. Non-element children (text, arrays, null) render nothing.
17
+ */
18
+ interface SlotProps extends React.HTMLAttributes<HTMLElement> {
19
+ children?: React.ReactNode;
20
+ }
21
+ declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
22
+
23
+ export { Slot, type SlotProps };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Minimal Slot implementation — the shared `asChild` primitive.
5
+ *
6
+ * Why not @radix-ui/react-slot? Per package policy, no external runtime deps
7
+ * are allowed in @refraction-ui/* packages. This Slot does the small amount
8
+ * of work we actually need:
9
+ * - Forwards a single React child
10
+ * - Merges incoming props onto that child (event handlers are chained,
11
+ * className is concatenated, style is shallow-merged)
12
+ * - Merges refs (callback refs and ref objects)
13
+ *
14
+ * It is intentionally simpler than Radix Slot — no <Slottable/>, no asChild
15
+ * recursion. `asChild` components render exactly one child element, which is
16
+ * all we need here. Non-element children (text, arrays, null) render nothing.
17
+ */
18
+ interface SlotProps extends React.HTMLAttributes<HTMLElement> {
19
+ children?: React.ReactNode;
20
+ }
21
+ declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
22
+
23
+ export { Slot, type SlotProps };
@@ -1128,6 +1128,7 @@ function mapEvent2(ev) {
1128
1128
  var DEFAULT_INGEST_ENDPOINT = "https://dc.services.visualstudio.com";
1129
1129
  var NO_RETRY2 = /* @__PURE__ */ new Set([400, 401, 403, 413]);
1130
1130
  var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
1131
+ var appInsightsWebSpecifier = "@microsoft/applicationinsights-web";
1131
1132
  function createClientSdkSink(opts) {
1132
1133
  const name = opts.name ?? "app-insights";
1133
1134
  let instance = opts.appInsights;
@@ -1143,10 +1144,7 @@ function createClientSdkSink(opts) {
1143
1144
  });
1144
1145
  return instance;
1145
1146
  }
1146
- const mod = await import(
1147
- /* @vite-ignore */
1148
- "./chunk-GFXGXZDB.js"
1149
- );
1147
+ const mod = await import(appInsightsWebSpecifier);
1150
1148
  const ai = new mod.ApplicationInsights({
1151
1149
  config: {
1152
1150
  connectionString: opts.connectionString,
@@ -1495,8 +1493,9 @@ function createPostHogHttpSink(options) {
1495
1493
  }
1496
1494
  };
1497
1495
  }
1496
+ var posthogJsSpecifier = "posthog-js";
1498
1497
  async function defaultLoad() {
1499
- const mod = await import("./chunk-O4R4W2KY.js");
1498
+ const mod = await import(posthogJsSpecifier);
1500
1499
  return "default" in mod ? mod.default : mod;
1501
1500
  }
1502
1501
  function createPostHogClientSdkSink(options) {
@@ -1586,8 +1585,9 @@ function createPostHogSink(options) {
1586
1585
  }
1587
1586
 
1588
1587
  // ../analytics-sink-posthog/dist/replay.js
1588
+ var posthogJsSpecifier2 = "posthog-js";
1589
1589
  async function defaultLoad2() {
1590
- const mod = await import("./chunk-O4R4W2KY.js");
1590
+ const mod = await import(posthogJsSpecifier2);
1591
1591
  return "default" in mod ? mod.default : mod;
1592
1592
  }
1593
1593
  async function startSessionReplay(options) {