@charcoal-ui/react 4.0.0-beta.11 → 4.0.0-beta.13

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 (33) hide show
  1. package/dist/components/IconButton/index.d.ts +1 -2
  2. package/dist/components/IconButton/index.d.ts.map +1 -1
  3. package/dist/components/Modal/useCustomModalOverlay.d.ts +1 -1
  4. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -1
  5. package/dist/index.cjs.js +8 -6
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.esm.js +8 -6
  8. package/dist/index.esm.js.map +1 -1
  9. package/package.json +11 -15
  10. package/src/_lib/index.ts +1 -1
  11. package/src/components/Button/__snapshots__/index.story.storyshot +9 -9
  12. package/src/components/Checkbox/CheckboxInput/__snapshots__/index.story.storyshot +6 -6
  13. package/src/components/Checkbox/__snapshots__/index.story.storyshot +6 -6
  14. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  15. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -3
  16. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +3 -3
  17. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +5 -5
  18. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +53 -53
  19. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  20. package/src/components/IconButton/__snapshots__/index.story.storyshot +3 -3
  21. package/src/components/IconButton/index.tsx +3 -6
  22. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +8 -8
  23. package/src/components/Modal/__snapshots__/index.story.storyshot +45 -28
  24. package/src/components/Modal/index.story.tsx +2 -0
  25. package/src/components/Modal/index.tsx +1 -1
  26. package/src/components/Modal/useCustomModalOverlay.tsx +7 -1
  27. package/src/components/Radio/__snapshots__/index.story.storyshot +10 -10
  28. package/src/components/Radio/index.test.tsx +4 -3
  29. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  30. package/src/components/Switch/__snapshots__/index.story.storyshot +4 -4
  31. package/src/components/TagItem/__snapshots__/index.story.storyshot +16 -16
  32. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +31 -31
  33. package/src/components/TextField/__snapshots__/TextField.story.storyshot +25 -25
package/dist/index.esm.js CHANGED
@@ -65,14 +65,13 @@ var IconButton = forwardRef3(function IconButtonInner({
65
65
  size = "M",
66
66
  icon,
67
67
  isActive = false,
68
- componentAs,
69
- as,
68
+ component,
70
69
  ...rest
71
70
  }, ref) {
72
71
  validateIconSize(size, icon);
73
- const Component = useMemo4(() => as ?? "button", [as]);
72
+ const Component = useMemo4(() => component ?? "button", [component]);
74
73
  const classNames = useClassNames("charcoal-icon-button", rest.className);
75
- return /* @__PURE__ */ jsx4(Component, { ...rest, as: componentAs, ref, className: classNames, "data-size": size, "data-active": isActive, "data-variant": variant, children: /* @__PURE__ */ jsx4("pixiv-icon", { name: icon }) });
74
+ return /* @__PURE__ */ jsx4(Component, { ...rest, ref, className: classNames, "data-size": size, "data-active": isActive, "data-variant": variant, children: /* @__PURE__ */ jsx4("pixiv-icon", { name: icon }) });
76
75
  });
77
76
  var IconButton_default = IconButton;
78
77
  function validateIconSize(size, icon) {
@@ -579,8 +578,11 @@ function useCharcoalModalOverlay(props, state, ref) {
579
578
  underlayProps
580
579
  };
581
580
  }
581
+ function isWindowDefined() {
582
+ return typeof window !== "undefined";
583
+ }
582
584
  function useWindowWidth() {
583
- const [width, setWidth] = React11.useState(window.innerWidth);
585
+ const [width, setWidth] = React11.useState(isWindowDefined() ? window.innerWidth : null);
584
586
  React11.useEffect(() => {
585
587
  const handleResize = () => {
586
588
  setWidth(window.innerWidth);
@@ -623,7 +625,7 @@ var Modal = forwardRef15(function ModalInner({
623
625
  onClose,
624
626
  isOpen
625
627
  }, ref);
626
- const isMobile = useWindowWidth() < 744;
628
+ const isMobile = (useWindowWidth() ?? Infinity) < 744;
627
629
  const transitionEnabled = isMobile && bottomSheet !== false;
628
630
  const showDismiss = !isMobile || bottomSheet !== true;
629
631
  const transition = useTransition(isOpen, {