@refraction-ui/react 0.12.2 → 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) => {
@@ -14014,22 +14026,36 @@ var statusPulseVariants = cva({
14014
14026
  }
14015
14027
  });
14016
14028
  var statusLabelStyles = "text-sm text-muted-foreground";
14017
-
14018
- // ../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
+ }
14019
14036
  function StatusIndicator({
14020
14037
  type,
14021
14038
  label,
14039
+ children,
14022
14040
  pulse,
14023
14041
  showLabel = true,
14024
14042
  className
14025
14043
  }) {
14026
14044
  const api = createStatusIndicator({ type, label, pulse });
14045
+ const ariaLabel = deriveAriaLabel(label, children, api.label);
14046
+ const visibleLabel = label ?? children ?? api.label;
14027
14047
  const dotClassName = api.pulse ? statusPulseVariants({ type }) : statusDotVariants({ type });
14028
- return React11.createElement(
14048
+ return /* @__PURE__ */ jsxs(
14029
14049
  "span",
14030
- { ...api.ariaProps, className: cn(statusContainerStyles, className) },
14031
- React11.createElement("span", { className: dotClassName }),
14032
- 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
+ }
14033
14059
  );
14034
14060
  }
14035
14061
  StatusIndicator.displayName = "StatusIndicator";
@@ -16462,7 +16488,7 @@ function createClientSdkSink(opts) {
16462
16488
  }
16463
16489
  const mod = await import(
16464
16490
  /* @vite-ignore */
16465
- './applicationinsights-web-62HUCH3W.js'
16491
+ './applicationinsights-web-H7OBLIVJ.js'
16466
16492
  );
16467
16493
  const ai = new mod.ApplicationInsights({
16468
16494
  config: {