achery-ui 0.11.0 → 0.11.2

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.cjs CHANGED
@@ -3441,7 +3441,7 @@ var SegmentedControl = ({
3441
3441
  role: "radio",
3442
3442
  "aria-checked": opt.value === value2,
3443
3443
  disabled,
3444
- onClick: () => onChange(opt.value),
3444
+ onClick: () => onChange(opt.value === value2 ? null : opt.value),
3445
3445
  className: [
3446
3446
  segment,
3447
3447
  sizeClass,
@@ -3452,6 +3452,20 @@ var SegmentedControl = ({
3452
3452
  opt.value
3453
3453
  )) });
3454
3454
  };
3455
+ var useMediaQuery = (query) => {
3456
+ const [matches, setMatches] = react.useState(
3457
+ () => typeof window !== "undefined" ? window.matchMedia(query).matches : false
3458
+ );
3459
+ react.useEffect(() => {
3460
+ const mq = window.matchMedia(query);
3461
+ setMatches(mq.matches);
3462
+ const handler = (e) => setMatches(e.matches);
3463
+ mq.addEventListener("change", handler);
3464
+ return () => mq.removeEventListener("change", handler);
3465
+ }, [query]);
3466
+ return matches;
3467
+ };
3468
+ var useIsDesktop = (breakpoint = 768) => useMediaQuery(`(min-width: ${breakpoint}px)`);
3455
3469
 
3456
3470
  exports.AcheryProvider = AcheryProvider;
3457
3471
  exports.AppBar = AppBar;
@@ -3503,6 +3517,8 @@ exports.glyphCategory = glyphCategory;
3503
3517
  exports.glyphLabel = glyphLabel;
3504
3518
  exports.searchGlyphs = searchGlyphs;
3505
3519
  exports.useConfirm = useConfirm;
3520
+ exports.useIsDesktop = useIsDesktop;
3521
+ exports.useMediaQuery = useMediaQuery;
3506
3522
  exports.useTheme = useTheme;
3507
3523
  exports.useToast = useToast;
3508
3524
  exports.vars = vars;