@charcoal-ui/react 3.12.0 → 3.13.0-beta.0

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 (48) hide show
  1. package/dist/components/Modal/index.d.ts +3 -0
  2. package/dist/components/Modal/index.d.ts.map +1 -1
  3. package/dist/index.cjs.js +7 -4
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.esm.js +6 -4
  8. package/dist/index.esm.js.map +1 -1
  9. package/package.json +8 -8
  10. package/src/components/Button/__snapshots__/index.story.storyshot +9 -9
  11. package/src/components/Button/index.story.tsx +1 -1
  12. package/src/components/Checkbox/__snapshots__/index.story.storyshot +6 -6
  13. package/src/components/Checkbox/index.story.tsx +1 -1
  14. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  15. package/src/components/Clickable/index.story.tsx +1 -1
  16. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +1 -1
  17. package/src/components/DropdownSelector/ListItem/index.story.tsx +1 -1
  18. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +3 -3
  19. package/src/components/DropdownSelector/MenuList/index.story.tsx +1 -1
  20. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +1 -1
  21. package/src/components/DropdownSelector/Popover/index.story.tsx +1 -1
  22. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +14 -936
  23. package/src/components/DropdownSelector/index.story.tsx +2 -2
  24. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  25. package/src/components/Icon/index.story.tsx +1 -1
  26. package/src/components/IconButton/__snapshots__/index.story.storyshot +6 -3
  27. package/src/components/IconButton/index.story.tsx +1 -1
  28. package/src/components/IconButton/index.tsx +1 -1
  29. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +4 -4
  30. package/src/components/LoadingSpinner/index.story.tsx +1 -1
  31. package/src/components/Modal/__snapshots__/index.story.storyshot +24 -12
  32. package/src/components/Modal/index.story.tsx +2 -2
  33. package/src/components/Modal/index.tsx +6 -2
  34. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +4 -4
  35. package/src/components/MultiSelect/index.story.tsx +1 -1
  36. package/src/components/Radio/__snapshots__/index.story.storyshot +5 -5
  37. package/src/components/Radio/index.story.tsx +1 -1
  38. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  39. package/src/components/SegmentedControl/index.story.tsx +1 -1
  40. package/src/components/Switch/__snapshots__/index.story.storyshot +4 -4
  41. package/src/components/Switch/index.story.tsx +1 -1
  42. package/src/components/TagItem/__snapshots__/index.story.storyshot +9 -9
  43. package/src/components/TagItem/index.story.tsx +2 -2
  44. package/src/components/TextArea/TextArea.story.tsx +1 -1
  45. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +11 -11
  46. package/src/components/TextField/TextField.story.tsx +1 -1
  47. package/src/components/TextField/__snapshots__/TextField.story.storyshot +13 -13
  48. package/src/index.ts +5 -1
@@ -13,6 +13,7 @@ export type ModalProps = AriaModalOverlayProps & AriaDialogProps & {
13
13
  isOpen: boolean;
14
14
  onClose: () => void;
15
15
  className?: string;
16
+ closeButtonAriaLabel?: string;
16
17
  /**
17
18
  * https://github.com/adobe/react-spectrum/issues/3787
18
19
  * Next.jsで使用する際に発生するエラーの一時的な回避策でdocument.bodyを指定する必要がある
@@ -28,6 +29,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
28
29
  isOpen: boolean;
29
30
  onClose: () => void;
30
31
  className?: string | undefined;
32
+ closeButtonAriaLabel?: string | undefined;
31
33
  /**
32
34
  * https://github.com/adobe/react-spectrum/issues/3787
33
35
  * Next.jsで使用する際に発生するエラーの一時的な回避策でdocument.bodyを指定する必要がある
@@ -45,6 +47,7 @@ export declare const ModalContext: React.Context<{
45
47
  showDismiss: boolean;
46
48
  bottomSheet: BottomSheet;
47
49
  }>;
50
+ export declare const ModalCloseButton: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../IconButton").IconButtonProps & React.RefAttributes<import("../Clickable").ClickableElement>>, import("styled-components").DefaultTheme, {}, never>;
48
51
  export declare function ModalTitle(props: React.HTMLAttributes<HTMLHeadingElement>): JSX.Element;
49
52
  export declare function ModalDismissButton({ children, ...props }: ButtonProps): JSX.Element | null;
50
53
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAW,MAAM,sBAAsB,CAAA;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAI1D,OAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAO/C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;AAC1C,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAElC,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAC5C,eAAe,GAAG;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,WAAW,CAAA;CAC9B,CAAA;;;;;;;;;;IALC;;;OAGG;;;AAmJP,wBAA0B;AAE1B,eAAO,MAAM,YAAY;IACvB;;OAEG;gBACS,MAAM,cAAc,CAAC,WAAW,CAAC;WACtC,MAAM;mBACC,IAAI;iBACL,OAAO;iBACP,WAAW;EAOxB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B5B,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,eAOzE;AAQD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,sBAYrE"}
package/dist/index.cjs.js CHANGED
@@ -42,6 +42,7 @@ __export(src_exports, {
42
42
  ModalAlign: () => ModalAlign,
43
43
  ModalBody: () => ModalBody,
44
44
  ModalButtons: () => ModalButtons,
45
+ ModalCloseButton: () => ModalCloseButton,
45
46
  ModalHeader: () => ModalHeader,
46
47
  MultiSelect: () => MultiSelect_default,
47
48
  MultiSelectGroup: () => MultiSelectGroup,
@@ -239,7 +240,7 @@ var IconButton = (0, import_react3.forwardRef)(function IconButtonInner({
239
240
  ...rest
240
241
  }, ref) {
241
242
  validateIconSize(size, icon);
242
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledIconButton, { ...rest, ref, $size: size, $variant: variant, $isActive: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pixiv-icon", { name: icon }) });
243
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledIconButton, { ...rest, ref, $size: size, $variant: variant, $isActive: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pixiv-icon", { "aria-hidden": "true", name: icon }) });
243
244
  });
244
245
  var IconButton_default = IconButton;
245
246
  var StyledIconButton = (0, import_styled_components4.default)(Clickable_default).attrs(styledProps).withConfig({
@@ -996,7 +997,8 @@ var Modal = (0, import_react13.forwardRef)(function ModalInner({
996
997
  isDismissable,
997
998
  onClose,
998
999
  className,
999
- isOpen = false
1000
+ isOpen = false,
1001
+ closeButtonAriaLabel = "Close"
1000
1002
  } = props;
1001
1003
  const ref = (0, import_utils8.useObjectRef)(external);
1002
1004
  const {
@@ -1061,7 +1063,7 @@ var Modal = (0, import_react13.forwardRef)(function ModalInner({
1061
1063
  bottomSheet
1062
1064
  }, children: [
1063
1065
  children,
1064
- isDismissable === true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalCrossButton, { size: "S", icon: "24/Close", onClick: onClose })
1066
+ isDismissable === true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalCloseButton, { size: "S", icon: "24/Close", type: "button", "aria-label": closeButtonAriaLabel, onClick: onClose })
1065
1067
  ] }) }) }) }) }));
1066
1068
  });
1067
1069
  var Modal_default = (0, import_react13.memo)(Modal);
@@ -1079,7 +1081,7 @@ var ModalBackground = (0, import_react_spring2.animated)(import_styled_component
1079
1081
  }) => zIndex, ({
1080
1082
  theme
1081
1083
  }) => (0, import_utils7.maxWidth)(theme.breakpoint.screen1), (p) => p.$bottomSheet !== false && (0, import_styled_components12.css)(["padding:0;"])));
1082
- var ModalCrossButton = (0, import_styled_components12.default)(IconButton_default).withConfig({
1084
+ var ModalCloseButton = (0, import_styled_components12.default)(IconButton_default).withConfig({
1083
1085
  componentId: "ccl__sc-h2bc55-1"
1084
1086
  })(["position:absolute;top:8px;right:8px;color:var(--charcoal-text3);transition:0.2s color;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{color:var(--charcoal-text3-hover);}&:active{color:var(--charcoal-text3-press);}}"]);
1085
1087
  function ModalTitle(props) {
@@ -1797,6 +1799,7 @@ var TranslatedLabel = import_styled_components23.default.div.withConfig({
1797
1799
  ModalAlign,
1798
1800
  ModalBody,
1799
1801
  ModalButtons,
1802
+ ModalCloseButton,
1800
1803
  ModalHeader,
1801
1804
  MultiSelect,
1802
1805
  MultiSelectGroup,