reshaped 3.1.6 → 3.1.8

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 (61) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/bundle.css +1 -1
  3. package/dist/bundle.js +9 -9
  4. package/dist/cjs/themes/_generator/definitions/reshaped.js +1 -1
  5. package/dist/cjs/themes/reshaped/theme.css +1 -1
  6. package/dist/components/Actionable/Actionable.module.css +1 -1
  7. package/dist/components/Autocomplete/Autocomplete.js +2 -2
  8. package/dist/components/Button/Button.module.css +1 -1
  9. package/dist/components/Card/Card.module.css +1 -1
  10. package/dist/components/Checkbox/Checkbox.module.css +1 -1
  11. package/dist/components/Grid/Grid.module.css +1 -1
  12. package/dist/components/Modal/Modal.js +1 -1
  13. package/dist/components/Modal/Modal.module.css +1 -1
  14. package/dist/components/Overlay/Overlay.js +1 -1
  15. package/dist/components/Radio/Radio.module.css +1 -1
  16. package/dist/components/Resizable/Resizable.module.css +1 -1
  17. package/dist/components/ScrollArea/ScrollArea.js +1 -1
  18. package/dist/components/Slider/Slider.module.css +1 -1
  19. package/dist/components/Slider/SliderControlled.js +2 -1
  20. package/dist/components/Switch/Switch.module.css +1 -1
  21. package/dist/components/Tabs/TabsList.js +1 -1
  22. package/dist/components/Toast/ToastContainer.js +1 -2
  23. package/dist/components/Toast/ToastRegion.js +1 -1
  24. package/dist/components/_private/Flyout/Flyout.types.d.ts +1 -1
  25. package/dist/components/_private/Flyout/FlyoutContent.js +1 -1
  26. package/dist/components/_private/Flyout/FlyoutControlled.js +1 -2
  27. package/dist/components/_private/Flyout/useFlyout.js +1 -1
  28. package/dist/components/_private/Flyout/utilities/getPositionFallbacks.js +1 -1
  29. package/dist/hooks/_private/useSingletonKeyboardMode.js +1 -1
  30. package/dist/hooks/useDrag.js +2 -1
  31. package/dist/hooks/useScrollLock.js +12 -39
  32. package/dist/themes/_generator/definitions/reshaped.js +1 -1
  33. package/dist/themes/reshaped/theme.css +1 -1
  34. package/dist/utilities/a11y/TrapFocus.js +1 -1
  35. package/dist/utilities/a11y/focus.js +1 -1
  36. package/dist/utilities/a11y/index.d.ts +4 -0
  37. package/dist/utilities/a11y/index.js +3 -0
  38. package/dist/utilities/dom/flyout.d.ts +1 -0
  39. package/dist/utilities/{dom.js → dom/flyout.js} +1 -19
  40. package/dist/utilities/dom/index.d.ts +3 -0
  41. package/dist/utilities/dom/index.js +3 -0
  42. package/dist/utilities/dom/shadowDom.d.ts +1 -0
  43. package/dist/utilities/dom/shadowDom.js +4 -0
  44. package/dist/utilities/dom/userSelect.d.ts +2 -0
  45. package/dist/utilities/dom/userSelect.js +6 -0
  46. package/dist/utilities/platform.d.ts +1 -0
  47. package/dist/utilities/platform.js +15 -0
  48. package/dist/utilities/scroll/disable.d.ts +7 -0
  49. package/dist/utilities/scroll/disable.js +13 -0
  50. package/dist/utilities/scroll/helpers.d.ts +1 -0
  51. package/dist/utilities/scroll/helpers.js +17 -0
  52. package/dist/utilities/scroll/index.d.ts +2 -0
  53. package/dist/utilities/scroll/index.js +2 -0
  54. package/dist/utilities/scroll/lock.d.ts +2 -0
  55. package/dist/utilities/scroll/lock.js +24 -0
  56. package/dist/utilities/scroll/lockSafari.d.ts +2 -0
  57. package/dist/utilities/scroll/lockSafari.js +31 -0
  58. package/dist/utilities/scroll/lockStandard.d.ts +2 -0
  59. package/dist/utilities/scroll/lockStandard.js +19 -0
  60. package/package.json +1 -1
  61. package/dist/utilities/dom.d.ts +0 -6
@@ -1 +1 @@
1
- [data-rs-theme=reshaped]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-extrabold:800;--rs-font-weight-black:900;--rs-font-size-title-1:6rem;--rs-line-height-title-1:6.25rem;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-1:normal;--rs-font-size-title-2:5rem;--rs-line-height-title-2:5.25rem;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-2:normal;--rs-font-size-title-3:4rem;--rs-line-height-title-3:4.25rem;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-3:normal;--rs-font-size-title-4:3.5rem;--rs-line-height-title-4:3.75rem;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-letter-spacing-title-4:normal;--rs-font-size-title-5:3rem;--rs-line-height-title-5:3.25rem;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-letter-spacing-title-5:normal;--rs-font-size-title-6:2.25rem;--rs-line-height-title-6:2.5rem;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-letter-spacing-title-6:normal;--rs-font-size-featured-1:2rem;--rs-line-height-featured-1:2.5rem;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-letter-spacing-featured-1:normal;--rs-font-size-featured-2:1.5rem;--rs-line-height-featured-2:2rem;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-letter-spacing-featured-2:normal;--rs-font-size-featured-3:1.25rem;--rs-line-height-featured-3:1.75rem;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-letter-spacing-featured-3:normal;--rs-font-size-body-1:1.125rem;--rs-line-height-body-1:1.75rem;--rs-font-family-body-1:var(--rs-font-family-body);--rs-letter-spacing-body-1:normal;--rs-font-size-body-2:1rem;--rs-line-height-body-2:1.5rem;--rs-font-family-body-2:var(--rs-font-family-body);--rs-letter-spacing-body-2:normal;--rs-font-size-body-3:0.875rem;--rs-line-height-body-3:1.25rem;--rs-font-family-body-3:var(--rs-font-family-body);--rs-letter-spacing-body-3:normal;--rs-font-size-caption-1:0.75rem;--rs-line-height-caption-1:1rem;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-letter-spacing-caption-1:normal;--rs-font-size-caption-2:0.625rem;--rs-line-height-caption-2:0.75rem;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-letter-spacing-caption-2:normal;--rs-unit-base:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-radius-small:4px;--rs-radius-medium:8px;--rs-radius-large:12px;--rs-color-brand:#5a58f2;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 5px -4px rgba(0,0,0,.5),0px 4px 8px 0px rgba(0,0,0,.05);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=reshaped][data-rs-color-mode=light]{--rs-color-background-primary:#5a58f2;--rs-color-background-primary-faded:#ecebfe;--rs-color-border-primary:#3b38ed;--rs-color-border-primary-faded:#dedcfb;--rs-color-foreground-primary:#4f4cf0;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fdeded;--rs-color-border-critical:#bf2424;--rs-color-border-critical-faded:#fadbdb;--rs-color-foreground-critical:#c42525;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fffae9;--rs-color-border-warning:#cfa90f;--rs-color-border-warning-faded:#faedbb;--rs-color-foreground-warning:#7b6305;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#edfdf5;--rs-color-border-positive:#0c6e40;--rs-color-border-positive-faded:#d0f3e2;--rs-color-foreground-positive:#0d7544;--rs-color-background-neutral:#dfe2ea;--rs-color-background-neutral-faded:#f1f2f6;--rs-color-border-neutral:#0000001f;--rs-color-border-neutral-faded:#0000001a;--rs-color-foreground-neutral:#14181f;--rs-color-foreground-neutral-faded:#5b667e;--rs-color-background-disabled:#eceef2;--rs-color-background-disabled-faded:#f5f6f9;--rs-color-border-disabled:#dfe2ea;--rs-color-foreground-disabled:#c6ccda;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#f9f9fb;--rs-color-rgb-background-primary:90,88,242;--rs-color-rgb-background-primary-faded:236,235,254;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:253,237,237;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,250,233;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:237,253,245;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:223,226,234;--rs-color-rgb-background-neutral-faded:241,242,246;--rs-color-rgb-background-disabled:236,238,242;--rs-color-rgb-background-disabled-faded:245,246,249;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:249,249,251}[data-rs-theme=reshaped][data-rs-color-mode=dark]{--rs-color-background-primary:#524fea;--rs-color-background-primary-faded:#252544;--rs-color-border-primary:#8c8bf3;--rs-color-border-primary-faded:#323164;--rs-color-foreground-primary:#8b8af7;--rs-color-background-critical:#d02626;--rs-color-background-critical-faded:#3e1f1f;--rs-color-border-critical:#f46969;--rs-color-border-critical-faded:#582929;--rs-color-foreground-critical:#f36a6a;--rs-color-background-warning:#f1c512;--rs-color-background-warning-faded:#2c271f;--rs-color-border-warning:#b4920a;--rs-color-border-warning-faded:#3d3628;--rs-color-foreground-warning:#b4920c;--rs-color-background-positive:#14784a;--rs-color-background-positive-faded:#1f2a23;--rs-color-border-positive:#21ab6b;--rs-color-border-positive-faded:#293b2f;--rs-color-foreground-positive:#18ab66;--rs-color-background-neutral:#494f60;--rs-color-background-neutral-faded:#222835;--rs-color-border-neutral:#ffffff24;--rs-color-border-neutral-faded:#ffffff17;--rs-color-foreground-neutral:#eff1f5;--rs-color-foreground-neutral-faded:#c0c6d6;--rs-color-background-disabled:#1e212a;--rs-color-background-disabled-faded:#171921;--rs-color-border-disabled:#262a34;--rs-color-foreground-disabled:#434959;--rs-color-background-elevation-base:#15171e;--rs-color-background-elevation-raised:#191b23;--rs-color-background-elevation-overlay:#1c1f28;--rs-color-background-page:#0f1116;--rs-color-background-page-faded:#111319;--rs-color-rgb-background-primary:82,79,234;--rs-color-rgb-background-primary-faded:37,37,68;--rs-color-rgb-background-critical:208,38,38;--rs-color-rgb-background-critical-faded:62,31,31;--rs-color-rgb-background-warning:241,197,18;--rs-color-rgb-background-warning-faded:44,39,31;--rs-color-rgb-background-positive:20,120,74;--rs-color-rgb-background-positive-faded:31,42,35;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:73,79,96;--rs-color-rgb-background-neutral-faded:34,40,53;--rs-color-rgb-background-disabled:30,33,42;--rs-color-rgb-background-disabled-faded:23,25,33;--rs-color-rgb-background-elevation-base:21,23,30;--rs-color-rgb-background-elevation-raised:25,27,35;--rs-color-rgb-background-elevation-overlay:28,31,40;--rs-color-rgb-background-page:15,17,22;--rs-color-rgb-background-page-faded:17,19,25}
1
+ [data-rs-theme=reshaped]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-extrabold:800;--rs-font-weight-black:900;--rs-font-size-title-1:6rem;--rs-line-height-title-1:6.25rem;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-1:normal;--rs-font-size-title-2:5rem;--rs-line-height-title-2:5.25rem;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-2:normal;--rs-font-size-title-3:4rem;--rs-line-height-title-3:4.25rem;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-3:normal;--rs-font-size-title-4:3.5rem;--rs-line-height-title-4:3.75rem;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-letter-spacing-title-4:normal;--rs-font-size-title-5:3rem;--rs-line-height-title-5:3.25rem;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-letter-spacing-title-5:normal;--rs-font-size-title-6:2.25rem;--rs-line-height-title-6:2.5rem;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-letter-spacing-title-6:normal;--rs-font-size-featured-1:2rem;--rs-line-height-featured-1:2.5rem;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-letter-spacing-featured-1:normal;--rs-font-size-featured-2:1.5rem;--rs-line-height-featured-2:2rem;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-letter-spacing-featured-2:normal;--rs-font-size-featured-3:1.25rem;--rs-line-height-featured-3:1.75rem;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-letter-spacing-featured-3:normal;--rs-font-size-body-1:1.125rem;--rs-line-height-body-1:1.75rem;--rs-font-family-body-1:var(--rs-font-family-body);--rs-letter-spacing-body-1:normal;--rs-font-size-body-2:1rem;--rs-line-height-body-2:1.5rem;--rs-font-family-body-2:var(--rs-font-family-body);--rs-letter-spacing-body-2:normal;--rs-font-size-body-3:0.875rem;--rs-line-height-body-3:1.25rem;--rs-font-family-body-3:var(--rs-font-family-body);--rs-letter-spacing-body-3:normal;--rs-font-size-caption-1:0.75rem;--rs-line-height-caption-1:1rem;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-letter-spacing-caption-1:normal;--rs-font-size-caption-2:0.625rem;--rs-line-height-caption-2:0.75rem;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-letter-spacing-caption-2:normal;--rs-unit-base:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-radius-small:4px;--rs-radius-medium:8px;--rs-radius-large:12px;--rs-color-brand:#5a58f2;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 5px -4px rgba(0,0,0,.5),0px 4px 8px 0px rgba(0,0,0,.05);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07)}[data-rs-theme=reshaped][data-rs-color-mode=light]{--rs-color-background-primary:#5a58f2;--rs-color-background-primary-faded:#ecebfe;--rs-color-border-primary:#3b38ed;--rs-color-border-primary-faded:#dedcfb;--rs-color-foreground-primary:#4f4cf0;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fdeded;--rs-color-border-critical:#bf2424;--rs-color-border-critical-faded:#fadbdb;--rs-color-foreground-critical:#c42525;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fffae9;--rs-color-border-warning:#cfa90f;--rs-color-border-warning-faded:#faedbb;--rs-color-foreground-warning:#7b6305;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#edfdf5;--rs-color-border-positive:#0c6e40;--rs-color-border-positive-faded:#d0f3e2;--rs-color-foreground-positive:#0d7544;--rs-color-background-neutral:#dfe2ea;--rs-color-background-neutral-faded:#f3f3f5;--rs-color-border-neutral:#0000001f;--rs-color-border-neutral-faded:#0000001a;--rs-color-foreground-neutral:#14181f;--rs-color-foreground-neutral-faded:#5b667e;--rs-color-background-disabled:#eceef2;--rs-color-background-disabled-faded:#f5f6f9;--rs-color-border-disabled:#dfe2ea;--rs-color-foreground-disabled:#c6ccda;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#f9f9fb;--rs-color-rgb-background-primary:90,88,242;--rs-color-rgb-background-primary-faded:236,235,254;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:253,237,237;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,250,233;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:237,253,245;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:223,226,234;--rs-color-rgb-background-neutral-faded:243,243,245;--rs-color-rgb-background-disabled:236,238,242;--rs-color-rgb-background-disabled-faded:245,246,249;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:249,249,251}[data-rs-theme=reshaped][data-rs-color-mode=dark]{--rs-color-background-primary:#524fea;--rs-color-background-primary-faded:#252544;--rs-color-border-primary:#8c8bf3;--rs-color-border-primary-faded:#323164;--rs-color-foreground-primary:#8b8af7;--rs-color-background-critical:#d02626;--rs-color-background-critical-faded:#3e1f1f;--rs-color-border-critical:#f46969;--rs-color-border-critical-faded:#582929;--rs-color-foreground-critical:#f36a6a;--rs-color-background-warning:#f1c512;--rs-color-background-warning-faded:#2c271f;--rs-color-border-warning:#b4920a;--rs-color-border-warning-faded:#3d3628;--rs-color-foreground-warning:#b4920c;--rs-color-background-positive:#14784a;--rs-color-background-positive-faded:#1f2a23;--rs-color-border-positive:#21ab6b;--rs-color-border-positive-faded:#293b2f;--rs-color-foreground-positive:#18ab66;--rs-color-background-neutral:#494f60;--rs-color-background-neutral-faded:#222835;--rs-color-border-neutral:#ffffff24;--rs-color-border-neutral-faded:#ffffff17;--rs-color-foreground-neutral:#eff1f5;--rs-color-foreground-neutral-faded:#c0c6d6;--rs-color-background-disabled:#1e212a;--rs-color-background-disabled-faded:#171921;--rs-color-border-disabled:#262a34;--rs-color-foreground-disabled:#434959;--rs-color-background-elevation-base:#15171e;--rs-color-background-elevation-raised:#191b23;--rs-color-background-elevation-overlay:#1c1f28;--rs-color-background-page:#0f1116;--rs-color-background-page-faded:#111319;--rs-color-rgb-background-primary:82,79,234;--rs-color-rgb-background-primary-faded:37,37,68;--rs-color-rgb-background-critical:208,38,38;--rs-color-rgb-background-critical-faded:62,31,31;--rs-color-rgb-background-warning:241,197,18;--rs-color-rgb-background-warning-faded:44,39,31;--rs-color-rgb-background-positive:20,120,74;--rs-color-rgb-background-positive-faded:31,42,35;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:73,79,96;--rs-color-rgb-background-neutral-faded:34,40,53;--rs-color-rgb-background-disabled:30,33,42;--rs-color-rgb-background-disabled-faded:23,25,33;--rs-color-rgb-background-elevation-base:21,23,30;--rs-color-rgb-background-elevation-raised:25,27,35;--rs-color-rgb-background-elevation-overlay:28,31,40;--rs-color-rgb-background-page:15,17,22;--rs-color-rgb-background-page-faded:17,19,25}
@@ -2,7 +2,7 @@ import Chain from "../Chain.js";
2
2
  import * as keys from "../../constants/keys.js";
3
3
  import TrapScreenReader from "./TrapScreenReader.js";
4
4
  import { getActiveElement, getFocusableElements, focusElement, getFocusData } from "./focus.js";
5
- import { getShadowRoot } from "../dom.js";
5
+ import { getShadowRoot } from "../dom/index.js";
6
6
  import { checkKeyboardMode } from "./keyboardMode.js";
7
7
  class TrapFocus {
8
8
  static chain = new Chain();
@@ -1,4 +1,4 @@
1
- import { getShadowRoot } from "../dom.js";
1
+ import { getShadowRoot } from "../dom/index.js";
2
2
  const pseudoFocusAttribute = "data-rs-focus";
3
3
  export const focusableSelector = 'a,button,input:not([type="hidden"]),textarea,select,details,[tabindex]:not([tabindex="-1"])';
4
4
  export const getActiveElement = (originEl) => {
@@ -0,0 +1,4 @@
1
+ export { focusableSelector, getActiveElement, focusNextElement, focusPreviousElement, focusFirstElement, focusLastElement, } from "./focus";
2
+ export { enableKeyboardMode, disableKeyboardMode, checkKeyboardMode } from "./keyboardMode";
3
+ export { default as TrapFocus } from "./TrapFocus";
4
+ export type { TrapMode, FocusableElement } from "./types";
@@ -0,0 +1,3 @@
1
+ export { focusableSelector, getActiveElement, focusNextElement, focusPreviousElement, focusFirstElement, focusLastElement, } from "./focus.js";
2
+ export { enableKeyboardMode, disableKeyboardMode, checkKeyboardMode } from "./keyboardMode.js";
3
+ export { default as TrapFocus } from "./TrapFocus.js";
@@ -0,0 +1 @@
1
+ export declare const getClosestFlyoutTarget: (el: HTMLElement | null, iteration?: number) => HTMLElement;
@@ -1,3 +1,4 @@
1
+ import { getShadowRoot } from "./shadowDom.js";
1
2
  export const getClosestFlyoutTarget = (el, iteration = 0) => {
2
3
  const style = el && window.getComputedStyle(el);
3
4
  const overflowY = style?.overflowY;
@@ -16,22 +17,3 @@ export const getClosestFlyoutTarget = (el, iteration = 0) => {
16
17
  return el;
17
18
  return getClosestFlyoutTarget(el.parentElement, iteration + 1);
18
19
  };
19
- export const disableUserSelect = () => {
20
- document.body.style.userSelect = "none";
21
- };
22
- export const enableUserSelect = () => {
23
- document.body.style.userSelect = "";
24
- };
25
- const preventDefault = (e) => e.preventDefault();
26
- export const disableScroll = () => {
27
- window.addEventListener("wheel", preventDefault, { passive: false });
28
- window.addEventListener("touchmove", preventDefault, { passive: false });
29
- };
30
- export const enableScroll = () => {
31
- window.removeEventListener("wheel", preventDefault);
32
- window.removeEventListener("touchmove", preventDefault);
33
- };
34
- export const getShadowRoot = (el) => {
35
- const rootNode = el?.getRootNode();
36
- return rootNode instanceof ShadowRoot ? rootNode : null;
37
- };
@@ -0,0 +1,3 @@
1
+ export { getClosestFlyoutTarget } from "./flyout";
2
+ export { getShadowRoot } from "./shadowDom";
3
+ export { enableUserSelect, disableUserSelect } from "./userSelect";
@@ -0,0 +1,3 @@
1
+ export { getClosestFlyoutTarget } from "./flyout.js";
2
+ export { getShadowRoot } from "./shadowDom.js";
3
+ export { enableUserSelect, disableUserSelect } from "./userSelect.js";
@@ -0,0 +1 @@
1
+ export declare const getShadowRoot: (el: HTMLElement | null) => ShadowRoot | null;
@@ -0,0 +1,4 @@
1
+ export const getShadowRoot = (el) => {
2
+ const rootNode = el?.getRootNode();
3
+ return rootNode instanceof ShadowRoot ? rootNode : null;
4
+ };
@@ -0,0 +1,2 @@
1
+ export declare const disableUserSelect: () => void;
2
+ export declare const enableUserSelect: () => void;
@@ -0,0 +1,6 @@
1
+ export const disableUserSelect = () => {
2
+ document.body.style.userSelect = "none";
3
+ };
4
+ export const enableUserSelect = () => {
5
+ document.body.style.userSelect = "";
6
+ };
@@ -0,0 +1 @@
1
+ export declare const isIOS: () => boolean;
@@ -0,0 +1,15 @@
1
+ const testPlatform = (re) => {
2
+ // Using experimentral and deprecated features here since that's the only way to detect platform consistently
3
+ const platform =
4
+ // @ts-ignore
5
+ window.navigator.userAgentData?.platform || window.navigator.platform;
6
+ return typeof window !== "undefined" ? re.test(platform) : false;
7
+ };
8
+ const isIPhone = () => testPlatform(/^iPhone/i);
9
+ const isMac = () => testPlatform(/^Mac/i);
10
+ const isIPad = () => {
11
+ return (testPlatform(/^iPad/i) ||
12
+ // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
13
+ (isMac() && navigator.maxTouchPoints > 1));
14
+ };
15
+ export const isIOS = () => isIPhone() || isIPad();
@@ -0,0 +1,7 @@
1
+ export declare const preventDefault: (e: Event) => void;
2
+ /**
3
+ * Prevent scrolling events for the cases when dragging elements
4
+ * without locking the page with overflow
5
+ */
6
+ export declare const disableScroll: () => void;
7
+ export declare const enableScroll: () => void;
@@ -0,0 +1,13 @@
1
+ export const preventDefault = (e) => e.preventDefault();
2
+ /**
3
+ * Prevent scrolling events for the cases when dragging elements
4
+ * without locking the page with overflow
5
+ */
6
+ export const disableScroll = () => {
7
+ window.addEventListener("wheel", preventDefault, { passive: false });
8
+ window.addEventListener("touchmove", preventDefault, { passive: false });
9
+ };
10
+ export const enableScroll = () => {
11
+ window.removeEventListener("wheel", preventDefault);
12
+ window.removeEventListener("touchmove", preventDefault);
13
+ };
@@ -0,0 +1 @@
1
+ export declare const getScrollbarWidth: () => number;
@@ -0,0 +1,17 @@
1
+ export const getScrollbarWidth = (() => {
2
+ let scrollbarWidth;
3
+ return () => {
4
+ if (scrollbarWidth)
5
+ return scrollbarWidth;
6
+ const scrollDiv = document.createElement("div");
7
+ scrollDiv.style.position = "absolute";
8
+ scrollDiv.style.top = "-9999px";
9
+ scrollDiv.style.width = "50px";
10
+ scrollDiv.style.height = "50px";
11
+ scrollDiv.style.overflow = "scroll";
12
+ document.body.appendChild(scrollDiv);
13
+ scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
14
+ document.body.removeChild(scrollDiv);
15
+ return scrollbarWidth;
16
+ };
17
+ })();
@@ -0,0 +1,2 @@
1
+ export { disableScroll, enableScroll } from "./disable";
2
+ export { lockScroll, unlockScroll } from "./lock";
@@ -0,0 +1,2 @@
1
+ export { disableScroll, enableScroll } from "./disable.js";
2
+ export { lockScroll, unlockScroll } from "./lock.js";
@@ -0,0 +1,2 @@
1
+ export declare const lockScroll: (cb?: () => void) => void;
2
+ export declare const unlockScroll: (cb?: () => void) => void;
@@ -0,0 +1,24 @@
1
+ import { isIOS } from "../platform.js";
2
+ import lockSafariScroll from "./lockSafari.js";
3
+ import lockStandardScroll from "./lockStandard.js";
4
+ let lockedCount = 0;
5
+ let reset = () => { };
6
+ export const lockScroll = (cb) => {
7
+ lockedCount += 1;
8
+ if (lockedCount > 1)
9
+ return;
10
+ if (isIOS()) {
11
+ reset = lockSafariScroll();
12
+ }
13
+ else {
14
+ reset = lockStandardScroll();
15
+ }
16
+ cb?.();
17
+ };
18
+ export const unlockScroll = (cb) => {
19
+ lockedCount -= 1;
20
+ if (lockedCount > 0)
21
+ return;
22
+ reset();
23
+ cb?.();
24
+ };
@@ -0,0 +1,2 @@
1
+ declare const lockSafariScroll: () => () => void;
2
+ export default lockSafariScroll;
@@ -0,0 +1,31 @@
1
+ let originalStyles = {};
2
+ const lockSafariScroll = () => {
3
+ const bodyStyle = document.body.style;
4
+ const offsetLeft = window.visualViewport?.offsetLeft || 0;
5
+ const offsetTop = window.visualViewport?.offsetTop || 0;
6
+ const scrollX = window.scrollX;
7
+ const scrollY = window.scrollY;
8
+ console.log(scrollY);
9
+ originalStyles = {
10
+ position: bodyStyle.position,
11
+ top: bodyStyle.top,
12
+ left: bodyStyle.left,
13
+ right: bodyStyle.right,
14
+ overflowX: bodyStyle.overflowX,
15
+ overflowY: bodyStyle.overflowY,
16
+ };
17
+ Object.assign(bodyStyle, {
18
+ position: "fixed",
19
+ top: `${-(scrollY - Math.floor(offsetTop))}px`,
20
+ left: `${-(scrollX - Math.floor(offsetLeft))}px`,
21
+ right: "0",
22
+ overflow: "hidden",
23
+ });
24
+ return () => {
25
+ Object.assign(bodyStyle, originalStyles);
26
+ window.scrollTo({ top: scrollY, left: scrollX, behavior: "instant" });
27
+ // window.scrollTo(scrollX, scrollY);
28
+ originalStyles = {};
29
+ };
30
+ };
31
+ export default lockSafariScroll;
@@ -0,0 +1,2 @@
1
+ declare const lockStandardScroll: () => () => void;
2
+ export default lockStandardScroll;
@@ -0,0 +1,19 @@
1
+ import { getScrollbarWidth } from "./helpers.js";
2
+ let originalBodyStyles = {};
3
+ const lockStandardScroll = () => {
4
+ const { body } = document;
5
+ const rect = body.getBoundingClientRect();
6
+ const isOverflowing = rect.left + rect.right < window.innerWidth;
7
+ originalBodyStyles.overflow = body.style.overflow;
8
+ body.style.overflow = "hidden";
9
+ if (isOverflowing) {
10
+ const scrollBarWidth = getScrollbarWidth();
11
+ originalBodyStyles.paddingRight = body.style.paddingRight;
12
+ body.style.paddingRight = `${scrollBarWidth}px`;
13
+ }
14
+ return () => {
15
+ Object.assign(body.style, originalBodyStyles);
16
+ originalBodyStyles = {};
17
+ };
18
+ };
19
+ export default lockStandardScroll;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reshaped",
3
3
  "description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
4
- "version": "3.1.6",
4
+ "version": "3.1.8",
5
5
  "license": "MIT",
6
6
  "email": "hello@reshaped.so",
7
7
  "homepage": "https://reshaped.so",
@@ -1,6 +0,0 @@
1
- export declare const getClosestFlyoutTarget: (el: HTMLElement | null, iteration?: number) => HTMLElement;
2
- export declare const disableUserSelect: () => void;
3
- export declare const enableUserSelect: () => void;
4
- export declare const disableScroll: () => void;
5
- export declare const enableScroll: () => void;
6
- export declare const getShadowRoot: (el: HTMLElement | null) => ShadowRoot | null;