@refraction-ui/react 0.12.1 → 0.12.3

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/dist/index.js CHANGED
@@ -662,6 +662,13 @@ var Breadcrumbs = React11.forwardRef(
662
662
  Breadcrumbs.displayName = "Breadcrumbs";
663
663
 
664
664
  // ../button/dist/index.js
665
+ var BUTTON_VARIANT_ALIASES = {
666
+ primary: "default"
667
+ };
668
+ function resolveButtonVariant(variant) {
669
+ if (!variant) return variant;
670
+ return BUTTON_VARIANT_ALIASES[variant] ?? variant;
671
+ }
665
672
  function createButton(props = {}) {
666
673
  const { disabled = false, loading = false } = props;
667
674
  const isInteractive = !disabled && !loading;
@@ -710,6 +717,10 @@ var buttonVariants = cva({
710
717
  variants: {
711
718
  variant: {
712
719
  default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
720
+ // Alias for `default` — see resolveButtonVariant + issue #201. Same classes
721
+ // so styling stays identical even if a consumer reaches into `buttonVariants`
722
+ // directly without going through resolveButtonVariant.
723
+ primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
713
724
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
714
725
  outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
715
726
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
@@ -1019,8 +1030,9 @@ function ShortcutBadge({ keys, platform = true, className }) {
1019
1030
  ShortcutBadge.displayName = "ShortcutBadge";
1020
1031
  var Button = React11.forwardRef(
1021
1032
  ({ variant, size, loading, asChild, className, disabled, children, shortcut, action, ...props }, ref) => {
1033
+ const resolvedVariant = resolveButtonVariant(variant);
1022
1034
  const api = createButton({ disabled, loading, type: props.type });
1023
- const classes = cn(buttonVariants({ variant, size }), className);
1035
+ const classes = cn(buttonVariants({ variant: resolvedVariant, size }), className);
1024
1036
  const internalRef = React11.useRef(null);
1025
1037
  const mergedRef = React11.useCallback(
1026
1038
  (node) => {
@@ -3688,7 +3700,11 @@ ${sel}
3688
3700
  h(
3689
3701
  "div",
3690
3702
  {
3691
- className: "overflow-hidden rounded-2xl border border-border bg-background transition focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/40"
3703
+ className: (
3704
+ // Subtle focus: slight border darkening + a soft shadow lift — no
3705
+ // bright colored ring (matches Claude/ChatGPT).
3706
+ "overflow-hidden rounded-2xl border border-border bg-background shadow-sm transition-shadow focus-within:border-foreground/25 focus-within:shadow-md"
3707
+ )
3692
3708
  },
3693
3709
  // error banner
3694
3710
  error ? h(
@@ -14010,22 +14026,36 @@ var statusPulseVariants = cva({
14010
14026
  }
14011
14027
  });
14012
14028
  var statusLabelStyles = "text-sm text-muted-foreground";
14013
-
14014
- // ../react-status-indicator/dist/index.js
14029
+ function deriveAriaLabel(label, children, fallback) {
14030
+ if (label) return label;
14031
+ if (typeof children === "string" || typeof children === "number") {
14032
+ return String(children);
14033
+ }
14034
+ return fallback;
14035
+ }
14015
14036
  function StatusIndicator({
14016
14037
  type,
14017
14038
  label,
14039
+ children,
14018
14040
  pulse,
14019
14041
  showLabel = true,
14020
14042
  className
14021
14043
  }) {
14022
14044
  const api = createStatusIndicator({ type, label, pulse });
14045
+ const ariaLabel = deriveAriaLabel(label, children, api.label);
14046
+ const visibleLabel = label ?? children ?? api.label;
14023
14047
  const dotClassName = api.pulse ? statusPulseVariants({ type }) : statusDotVariants({ type });
14024
- return React11.createElement(
14048
+ return /* @__PURE__ */ jsxs(
14025
14049
  "span",
14026
- { ...api.ariaProps, className: cn(statusContainerStyles, className) },
14027
- React11.createElement("span", { className: dotClassName }),
14028
- showLabel && React11.createElement("span", { className: statusLabelStyles }, api.label)
14050
+ {
14051
+ ...api.ariaProps,
14052
+ "aria-label": ariaLabel,
14053
+ className: cn(statusContainerStyles, className),
14054
+ children: [
14055
+ /* @__PURE__ */ jsx("span", { className: dotClassName }),
14056
+ showLabel && /* @__PURE__ */ jsx("span", { className: statusLabelStyles, children: visibleLabel })
14057
+ ]
14058
+ }
14029
14059
  );
14030
14060
  }
14031
14061
  StatusIndicator.displayName = "StatusIndicator";
@@ -16458,7 +16488,7 @@ function createClientSdkSink(opts) {
16458
16488
  }
16459
16489
  const mod = await import(
16460
16490
  /* @vite-ignore */
16461
- './applicationinsights-web-62HUCH3W.js'
16491
+ './applicationinsights-web-H7OBLIVJ.js'
16462
16492
  );
16463
16493
  const ai = new mod.ApplicationInsights({
16464
16494
  config: {