@zendeskgarden/react-modals 9.12.2 → 9.12.4

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 (41) hide show
  1. package/dist/esm/elements/Body.js +3 -3
  2. package/dist/esm/elements/Close.js +4 -4
  3. package/dist/esm/elements/Drawer/Drawer.js +14 -12
  4. package/dist/esm/elements/Drawer/Header.js +4 -5
  5. package/dist/esm/elements/Footer.js +3 -3
  6. package/dist/esm/elements/FooterItem.js +3 -3
  7. package/dist/esm/elements/Header.js +9 -10
  8. package/dist/esm/elements/Modal.js +15 -15
  9. package/dist/esm/elements/TooltipDialog/Body.js +4 -4
  10. package/dist/esm/elements/TooltipDialog/Close.js +5 -5
  11. package/dist/esm/elements/TooltipDialog/Footer.js +4 -4
  12. package/dist/esm/elements/TooltipDialog/FooterItem.js +4 -4
  13. package/dist/esm/elements/TooltipDialog/Title.js +5 -6
  14. package/dist/esm/elements/TooltipDialog/TooltipDialog.js +26 -22
  15. package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +4 -4
  16. package/dist/esm/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +3 -3
  17. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/alert-error-stroke.svg.js +2 -2
  18. package/dist/esm/node_modules/polished/dist/polished.esm.js +3 -12
  19. package/dist/esm/styled/StyledBackdrop.js +19 -22
  20. package/dist/esm/styled/StyledBody.js +9 -12
  21. package/dist/esm/styled/StyledClose.js +6 -6
  22. package/dist/esm/styled/StyledDrawer.js +6 -7
  23. package/dist/esm/styled/StyledDrawerBody.js +3 -3
  24. package/dist/esm/styled/StyledDrawerClose.js +3 -4
  25. package/dist/esm/styled/StyledDrawerFooter.js +9 -12
  26. package/dist/esm/styled/StyledDrawerFooterItem.js +1 -1
  27. package/dist/esm/styled/StyledDrawerHeader.js +3 -3
  28. package/dist/esm/styled/StyledFooter.js +3 -3
  29. package/dist/esm/styled/StyledFooterItem.js +3 -3
  30. package/dist/esm/styled/StyledHeader.js +8 -9
  31. package/dist/esm/styled/StyledModal.js +9 -10
  32. package/dist/esm/styled/StyledTooltipDialog.js +5 -5
  33. package/dist/esm/styled/StyledTooltipDialogBackdrop.js +3 -3
  34. package/dist/esm/styled/StyledTooltipDialogBody.js +9 -12
  35. package/dist/esm/styled/StyledTooltipDialogClose.js +3 -3
  36. package/dist/esm/styled/StyledTooltipDialogFooter.js +3 -3
  37. package/dist/esm/styled/StyledTooltipDialogFooterItem.js +3 -3
  38. package/dist/esm/styled/StyledTooltipDialogTitle.js +10 -13
  39. package/dist/index.cjs.js +141 -166
  40. package/dist/typings/elements/TooltipDialog/TooltipDialog.d.ts +0 -6
  41. package/package.json +7 -7
package/dist/index.cjs.js CHANGED
@@ -64,26 +64,23 @@ const animationStyles$1 = props => {
64
64
  };
65
65
  const StyledBackdrop = styled__default.default.div.attrs({
66
66
  'data-garden-id': COMPONENT_ID$j,
67
- 'data-garden-version': '9.12.2'
67
+ 'data-garden-version': '9.12.4'
68
68
  }).withConfig({
69
69
  displayName: "StyledBackdrop",
70
70
  componentId: "sc-mzdjpo-0"
71
- })(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.$isCentered && 'center', props => props.$isCentered && 'center', _ref => {
72
- let {
73
- theme
74
- } = _ref;
75
- return reactTheming.getColor({
76
- theme,
77
- hue: 'neutralHue',
78
- transparency: theme.opacity[1000],
79
- light: {
80
- shade: 900
81
- },
82
- dark: {
83
- shade: 1200
84
- }
85
- });
86
- }, props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, reactTheming.componentStyles);
71
+ })(["display:flex;position:fixed;inset:0;align-items:", ";justify-content:", ";z-index:400;background-color:", ";overflow:auto;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";", ";", ";"], props => props.$isCentered && 'center', props => props.$isCentered && 'center', ({
72
+ theme
73
+ }) => reactTheming.getColor({
74
+ theme,
75
+ hue: 'neutralHue',
76
+ transparency: theme.opacity[1000],
77
+ light: {
78
+ shade: 900
79
+ },
80
+ dark: {
81
+ shade: 1200
82
+ }
83
+ }), props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', animationStyles$1, reactTheming.componentStyles);
87
84
  StyledBackdrop.propTypes = {
88
85
  $isCentered: PropTypes__default.default.bool,
89
86
  $isAnimated: PropTypes__default.default.bool
@@ -92,19 +89,16 @@ StyledBackdrop.propTypes = {
92
89
  const COMPONENT_ID$i = 'modals.body';
93
90
  const StyledBody = styled__default.default.div.attrs({
94
91
  'data-garden-id': COMPONENT_ID$i,
95
- 'data-garden-version': '9.12.2'
92
+ 'data-garden-version': '9.12.4'
96
93
  }).withConfig({
97
94
  displayName: "StyledBody",
98
95
  componentId: "sc-14rzecg-0"
99
- })(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
100
- let {
101
- theme
102
- } = _ref;
103
- return reactTheming.getColor({
104
- theme,
105
- variable: 'foreground.default'
106
- });
107
- }, props => props.theme.fontSizes.md, reactTheming.componentStyles);
96
+ })(["display:block;margin:0;padding:", ";height:100%;overflow:auto;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, ({
97
+ theme
98
+ }) => reactTheming.getColor({
99
+ theme,
100
+ variable: 'foreground.default'
101
+ }), props => props.theme.fontSizes.md, reactTheming.componentStyles);
108
102
 
109
103
  const COMPONENT_ID$h = 'modals.close';
110
104
  const BASE_MULTIPLIERS$1 = {
@@ -114,7 +108,7 @@ const BASE_MULTIPLIERS$1 = {
114
108
  };
115
109
  const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
116
110
  'data-garden-id': COMPONENT_ID$h,
117
- 'data-garden-version': '9.12.2'
111
+ 'data-garden-version': '9.12.4'
118
112
  }).withConfig({
119
113
  displayName: "StyledClose",
120
114
  componentId: "sc-iseudj-0"
@@ -123,7 +117,7 @@ const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
123
117
  const COMPONENT_ID$g = 'modals.footer';
124
118
  const StyledFooter = styled__default.default.div.attrs({
125
119
  'data-garden-id': COMPONENT_ID$g,
126
- 'data-garden-version': '9.12.2'
120
+ 'data-garden-version': '9.12.4'
127
121
  }).withConfig({
128
122
  displayName: "StyledFooter",
129
123
  componentId: "sc-d8pfdu-0"
@@ -135,18 +129,17 @@ const StyledFooter = styled__default.default.div.attrs({
135
129
  const COMPONENT_ID$f = 'modals.footer_item';
136
130
  const StyledFooterItem = styled__default.default.span.attrs({
137
131
  'data-garden-id': COMPONENT_ID$f,
138
- 'data-garden-version': '9.12.2'
132
+ 'data-garden-version': '9.12.4'
139
133
  }).withConfig({
140
134
  displayName: "StyledFooterItem",
141
135
  componentId: "sc-1mb76hl-0"
142
136
  })(["display:flex;margin-", ":", "px;min-width:0;&:first-child{margin-", ":0;}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 5, props => props.theme.rtl ? 'right' : 'left', reactTheming.componentStyles);
143
137
 
144
138
  const COMPONENT_ID$e = 'modals.header';
145
- const colorStyles$2 = _ref => {
146
- let {
147
- $isDanger,
148
- theme
149
- } = _ref;
139
+ const colorStyles$2 = ({
140
+ $isDanger,
141
+ theme
142
+ }) => {
150
143
  const bottomBorderColor = reactTheming.getColor({
151
144
  theme,
152
145
  variable: 'border.subtle'
@@ -159,7 +152,7 @@ const colorStyles$2 = _ref => {
159
152
  };
160
153
  const StyledHeader = styled__default.default.div.attrs({
161
154
  'data-garden-id': COMPONENT_ID$e,
162
- 'data-garden-version': '9.12.2'
155
+ 'data-garden-version': '9.12.4'
163
156
  }).withConfig({
164
157
  displayName: "StyledHeader",
165
158
  componentId: "sc-1787r9v-0"
@@ -206,10 +199,9 @@ const animationStyles = props => {
206
199
  }
207
200
  return '';
208
201
  };
209
- const colorStyles$1 = _ref => {
210
- let {
211
- theme
212
- } = _ref;
202
+ const colorStyles$1 = ({
203
+ theme
204
+ }) => {
213
205
  const offsetY = `${theme.space.base * 5}px`;
214
206
  const blurRadius = `${theme.space.base * 7}px`;
215
207
  const shadowColor = reactTheming.getColor({
@@ -232,7 +224,7 @@ const sizeStyles$2 = props => {
232
224
  };
233
225
  const StyledModal = styled__default.default.div.attrs({
234
226
  'data-garden-id': COMPONENT_ID$d,
235
- 'data-garden-version': '9.12.2'
227
+ 'data-garden-version': '9.12.4'
236
228
  }).withConfig({
237
229
  displayName: "StyledModal",
238
230
  componentId: "sc-1pe1axu-0"
@@ -313,9 +305,9 @@ function _wrapNativeSuper(t) {
313
305
  return Wrapper.prototype = Object.create(t.prototype, {
314
306
  constructor: {
315
307
  value: Wrapper,
316
- enumerable: !1,
317
- writable: !0,
318
- configurable: !0
308
+ enumerable: false,
309
+ writable: true,
310
+ configurable: true
319
311
  }
320
312
  }), _setPrototypeOf(Wrapper, t);
321
313
  }, _wrapNativeSuper(t);
@@ -817,17 +809,13 @@ function hslToHex(hue, saturation, lightness) {
817
809
  return hslToRgb(hue, saturation, lightness, convertToHex);
818
810
  }
819
811
  function hsl(value, saturation, lightness) {
820
- if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
821
- return hslToHex(value, saturation, lightness);
822
- } else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
812
+ if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
823
813
  return hslToHex(value.hue, value.saturation, value.lightness);
824
814
  }
825
815
  throw new PolishedError(1);
826
816
  }
827
817
  function hsla(value, saturation, lightness, alpha) {
828
- if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
829
- return "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
830
- } else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
818
+ if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
831
819
  return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
832
820
  }
833
821
  throw new PolishedError(2);
@@ -841,12 +829,7 @@ function rgb(value, green, blue) {
841
829
  throw new PolishedError(6);
842
830
  }
843
831
  function rgba(firstValue, secondValue, thirdValue, fourthValue) {
844
- if (typeof firstValue === 'string' && typeof secondValue === 'number') {
845
- var rgbValue = parseToRgb(firstValue);
846
- return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
847
- } else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
848
- return "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
849
- } else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
832
+ if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
850
833
  return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
851
834
  }
852
835
  throw new PolishedError(7);
@@ -1006,7 +989,7 @@ curry (transparentize);
1006
989
  const COMPONENT_ID$c = 'modals.tooltip_dialog.backdrop';
1007
990
  const StyledTooltipDialogBackdrop = styled__default.default.div.attrs({
1008
991
  'data-garden-id': COMPONENT_ID$c,
1009
- 'data-garden-version': '9.12.2'
992
+ 'data-garden-version': '9.12.4'
1010
993
  }).withConfig({
1011
994
  displayName: "StyledTooltipDialogBackdrop",
1012
995
  componentId: "sc-zrk625-0"
@@ -1027,7 +1010,7 @@ const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
1027
1010
  const COMPONENT_ID$b = 'modals.tooltip_dialog.close';
1028
1011
  const StyledTooltipDialogClose = styled__default.default(StyledClose).attrs({
1029
1012
  'data-garden-id': COMPONENT_ID$b,
1030
- 'data-garden-version': '9.12.2'
1013
+ 'data-garden-version': '9.12.4'
1031
1014
  }).withConfig({
1032
1015
  displayName: "StyledTooltipDialogClose",
1033
1016
  componentId: "sc-18xlgfi-0"
@@ -1044,7 +1027,7 @@ const sizeStyles$1 = props => `
1044
1027
  `;
1045
1028
  const StyledTooltipDialog = styled__default.default.div.attrs(props => ({
1046
1029
  'data-garden-id': COMPONENT_ID$a,
1047
- 'data-garden-version': '9.12.2',
1030
+ 'data-garden-version': '9.12.4',
1048
1031
  className: props.$isAnimated ? 'is-animated' : undefined
1049
1032
  })).withConfig({
1050
1033
  displayName: "StyledTooltipDialog",
@@ -1069,41 +1052,35 @@ const sizeStyles = props => `
1069
1052
  `;
1070
1053
  const StyledTooltipDialogTitle = styled__default.default.div.attrs({
1071
1054
  'data-garden-id': COMPONENT_ID$9,
1072
- 'data-garden-version': '9.12.2'
1055
+ 'data-garden-version': '9.12.4'
1073
1056
  }).withConfig({
1074
1057
  displayName: "StyledTooltipDialogTitle",
1075
1058
  componentId: "sc-1rceixg-0"
1076
- })(["margin:0;color:", ";font-weight:", ";", ";", ";"], _ref => {
1077
- let {
1078
- theme
1079
- } = _ref;
1080
- return reactTheming.getColor({
1081
- variable: 'foreground.default',
1082
- theme
1083
- });
1084
- }, props => props.theme.fontWeights.semibold, props => sizeStyles(props), reactTheming.componentStyles);
1059
+ })(["margin:0;color:", ";font-weight:", ";", ";", ";"], ({
1060
+ theme
1061
+ }) => reactTheming.getColor({
1062
+ variable: 'foreground.default',
1063
+ theme
1064
+ }), props => props.theme.fontWeights.semibold, props => sizeStyles(props), reactTheming.componentStyles);
1085
1065
 
1086
1066
  const COMPONENT_ID$8 = 'modals.tooltip_dialog.body';
1087
1067
  const StyledTooltipDialogBody = styled__default.default.div.attrs({
1088
1068
  'data-garden-id': COMPONENT_ID$8,
1089
- 'data-garden-version': '9.12.2'
1069
+ 'data-garden-version': '9.12.4'
1090
1070
  }).withConfig({
1091
1071
  displayName: "StyledTooltipDialogBody",
1092
1072
  componentId: "sc-132lcoq-0"
1093
- })(["display:block;margin:0;padding-top:", "px;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, _ref => {
1094
- let {
1095
- theme
1096
- } = _ref;
1097
- return reactTheming.getColor({
1098
- variable: 'foreground.default',
1099
- theme
1100
- });
1101
- }, props => props.theme.fontSizes.md, reactTheming.componentStyles);
1073
+ })(["display:block;margin:0;padding-top:", "px;line-height:", ";color-scheme:only ", ";color:", ";font-size:", ";", ";"], props => props.theme.space.base * 1.5, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), p => p.theme.colors.base, ({
1074
+ theme
1075
+ }) => reactTheming.getColor({
1076
+ variable: 'foreground.default',
1077
+ theme
1078
+ }), props => props.theme.fontSizes.md, reactTheming.componentStyles);
1102
1079
 
1103
1080
  const COMPONENT_ID$7 = 'modals.tooltip_dialog.footer';
1104
1081
  const StyledTooltipDialogFooter = styled__default.default.div.attrs({
1105
1082
  'data-garden-id': COMPONENT_ID$7,
1106
- 'data-garden-version': '9.12.2'
1083
+ 'data-garden-version': '9.12.4'
1107
1084
  }).withConfig({
1108
1085
  displayName: "StyledTooltipDialogFooter",
1109
1086
  componentId: "sc-kjomsm-0"
@@ -1112,7 +1089,7 @@ const StyledTooltipDialogFooter = styled__default.default.div.attrs({
1112
1089
  const COMPONENT_ID$6 = 'modals.tooltip_dialog.footer_item';
1113
1090
  const StyledTooltipDialogFooterItem = styled__default.default(StyledFooterItem).attrs({
1114
1091
  'data-garden-id': COMPONENT_ID$6,
1115
- 'data-garden-version': '9.12.2'
1092
+ 'data-garden-version': '9.12.4'
1116
1093
  }).withConfig({
1117
1094
  displayName: "StyledTooltipDialogFooterItem",
1118
1095
  componentId: "sc-u2rmo8-0"
@@ -1120,10 +1097,9 @@ const StyledTooltipDialogFooterItem = styled__default.default(StyledFooterItem).
1120
1097
 
1121
1098
  const COMPONENT_ID$5 = 'modals.drawer_modal';
1122
1099
  const DRAWER_WIDTH = 380;
1123
- const colorStyles = _ref => {
1124
- let {
1125
- theme
1126
- } = _ref;
1100
+ const colorStyles = ({
1101
+ theme
1102
+ }) => {
1127
1103
  const offsetY = `${theme.space.base * 5}px`;
1128
1104
  const blurRadius = `${theme.space.base * 7}px`;
1129
1105
  const shadowColor = reactTheming.getColor({
@@ -1143,7 +1119,7 @@ const colorStyles = _ref => {
1143
1119
  };
1144
1120
  const StyledDrawer = styled__default.default.div.attrs({
1145
1121
  'data-garden-id': COMPONENT_ID$5,
1146
- 'data-garden-version': '9.12.2'
1122
+ 'data-garden-version': '9.12.4'
1147
1123
  }).withConfig({
1148
1124
  displayName: "StyledDrawer",
1149
1125
  componentId: "sc-zp66t3-0"
@@ -1151,13 +1127,12 @@ const StyledDrawer = styled__default.default.div.attrs({
1151
1127
 
1152
1128
  const COMPONENT_ID$4 = 'modals.drawer_modal.close';
1153
1129
  const BASE_MULTIPLIERS = {
1154
- top: BASE_MULTIPLIERS$1.top,
1155
1130
  side: 2,
1156
1131
  size: BASE_MULTIPLIERS$1.size
1157
1132
  };
1158
1133
  const StyledDrawerClose = styled__default.default(StyledClose).attrs({
1159
1134
  'data-garden-id': COMPONENT_ID$4,
1160
- 'data-garden-version': '9.12.2'
1135
+ 'data-garden-version': '9.12.4'
1161
1136
  }).withConfig({
1162
1137
  displayName: "StyledDrawerClose",
1163
1138
  componentId: "sc-1a0xt3x-0"
@@ -1166,7 +1141,7 @@ const StyledDrawerClose = styled__default.default(StyledClose).attrs({
1166
1141
  const COMPONENT_ID$3 = 'modals.drawer_modal.header';
1167
1142
  const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
1168
1143
  'data-garden-id': COMPONENT_ID$3,
1169
- 'data-garden-version': '9.12.2'
1144
+ 'data-garden-version': '9.12.4'
1170
1145
  }).withConfig({
1171
1146
  displayName: "StyledDrawerHeader",
1172
1147
  componentId: "sc-y4mgkj-0"
@@ -1175,7 +1150,7 @@ const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
1175
1150
  const COMPONENT_ID$2 = 'modals.drawer_modal.body';
1176
1151
  const StyledDrawerBody = styled__default.default(StyledBody).attrs({
1177
1152
  'data-garden-id': COMPONENT_ID$2,
1178
- 'data-garden-version': '9.12.2'
1153
+ 'data-garden-version': '9.12.4'
1179
1154
  }).withConfig({
1180
1155
  displayName: "StyledDrawerBody",
1181
1156
  componentId: "sc-13qufyn-0"
@@ -1184,24 +1159,21 @@ const StyledDrawerBody = styled__default.default(StyledBody).attrs({
1184
1159
  const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
1185
1160
  const StyledDrawerFooter = styled__default.default.div.attrs({
1186
1161
  'data-garden-id': COMPONENT_ID$1,
1187
- 'data-garden-version': '9.12.2'
1162
+ 'data-garden-version': '9.12.4'
1188
1163
  }).withConfig({
1189
1164
  displayName: "StyledDrawerFooter",
1190
1165
  componentId: "sc-kc7e6p-0"
1191
- })(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], _ref => {
1192
- let {
1193
- theme
1194
- } = _ref;
1195
- return `${theme.borders.sm} ${reactTheming.getColor({
1196
- theme,
1197
- variable: 'border.subtle'
1198
- })}`;
1199
- }, props => props.theme.space.base * 5, reactTheming.componentStyles);
1166
+ })(["display:flex;flex-shrink:0;justify-content:flex-end;border-top:", ";padding:", "px;", ";"], ({
1167
+ theme
1168
+ }) => `${theme.borders.sm} ${reactTheming.getColor({
1169
+ theme,
1170
+ variable: 'border.subtle'
1171
+ })}`, props => props.theme.space.base * 5, reactTheming.componentStyles);
1200
1172
 
1201
1173
  const COMPONENT_ID = 'modals.drawer_modal.footer_item';
1202
1174
  const StyledDrawerFooterItem = styled__default.default(StyledFooterItem).attrs({
1203
1175
  'data-garden-id': COMPONENT_ID,
1204
- 'data-garden-version': '9.12.2'
1176
+ 'data-garden-version': '9.12.4'
1205
1177
  }).withConfig({
1206
1178
  displayName: "StyledDrawerFooterItem",
1207
1179
  componentId: "sc-m2yul4-0"
@@ -1278,13 +1250,12 @@ const FooterItem$2 = React__namespace.default.forwardRef((props, ref) => React__
1278
1250
  }, props)));
1279
1251
  FooterItem$2.displayName = 'Modal.FooterItem';
1280
1252
 
1281
- const Header$1 = React.forwardRef((_ref, ref) => {
1282
- let {
1283
- children,
1284
- isDanger,
1285
- tag = 'div',
1286
- ...other
1287
- } = _ref;
1253
+ const Header$1 = React.forwardRef(({
1254
+ children,
1255
+ isDanger,
1256
+ tag = 'div',
1257
+ ...other
1258
+ }, ref) => {
1288
1259
  const {
1289
1260
  isCloseButtonPresent,
1290
1261
  hasHeader,
@@ -1326,20 +1297,19 @@ const isOverflowing = element => {
1326
1297
  const marginRight = parseInt(style.getPropertyValue('margin-right'), 10);
1327
1298
  return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;
1328
1299
  };
1329
- const ModalComponent = React.forwardRef((_ref, ref) => {
1330
- let {
1331
- backdropProps,
1332
- children,
1333
- onClose,
1334
- isLarge,
1335
- isCentered = true,
1336
- isAnimated = true,
1337
- id,
1338
- appendToNode,
1339
- focusOnMount,
1340
- restoreFocus,
1341
- ...modalProps
1342
- } = _ref;
1300
+ const ModalComponent = React.forwardRef(({
1301
+ backdropProps,
1302
+ children,
1303
+ onClose,
1304
+ isLarge,
1305
+ isCentered = true,
1306
+ isAnimated = true,
1307
+ id,
1308
+ appendToNode,
1309
+ focusOnMount,
1310
+ restoreFocus,
1311
+ ...modalProps
1312
+ }, ref) => {
1343
1313
  const theme = React.useContext(styled.ThemeContext);
1344
1314
  const modalRef = React.useRef(null);
1345
1315
  const environment = reactTheming.useDocument(theme);
@@ -1356,7 +1326,8 @@ const ModalComponent = React.forwardRef((_ref, ref) => {
1356
1326
  onClose,
1357
1327
  modalRef,
1358
1328
  focusOnMount,
1359
- restoreFocus
1329
+ restoreFocus,
1330
+ environment
1360
1331
  });
1361
1332
  React.useEffect(() => {
1362
1333
  if (!environment) {
@@ -1464,12 +1435,11 @@ const useTooltipDialogContext = () => {
1464
1435
 
1465
1436
  const PLACEMENT = ['auto', ...reactTheming.PLACEMENT];
1466
1437
 
1467
- const TitleComponent = React.forwardRef((_ref, ref) => {
1468
- let {
1469
- children,
1470
- tag = 'div',
1471
- ...other
1472
- } = _ref;
1438
+ const TitleComponent = React.forwardRef(({
1439
+ children,
1440
+ tag = 'div',
1441
+ ...other
1442
+ }, ref) => {
1473
1443
  const {
1474
1444
  getTitleProps,
1475
1445
  hasTitle,
@@ -1536,30 +1506,33 @@ FooterItemComponent$1.displayName = 'TooltipDialog.FooterItem';
1536
1506
  const FooterItem$1 = FooterItemComponent$1;
1537
1507
 
1538
1508
  const PLACEMENT_DEFAULT = 'top';
1539
- const TooltipDialogComponent = React__namespace.default.forwardRef((_ref, ref) => {
1540
- let {
1541
- appendToNode,
1542
- referenceElement,
1543
- placement: _placement = 'auto',
1544
- fallbackPlacements: _fallbackPlacements,
1545
- offset: _offset,
1546
- onClose,
1547
- hasArrow = true,
1548
- keepMounted,
1549
- isAnimated,
1550
- zIndex,
1551
- backdropProps,
1552
- focusOnMount = true,
1553
- restoreFocus = true,
1554
- id,
1555
- ...props
1556
- } = _ref;
1509
+ const TooltipDialogComponent = React__namespace.default.forwardRef(({
1510
+ appendToNode,
1511
+ referenceElement,
1512
+ placement: _placement = 'auto',
1513
+ fallbackPlacements: _fallbackPlacements,
1514
+ offset: _offset,
1515
+ onClose,
1516
+ hasArrow = true,
1517
+ keepMounted,
1518
+ isAnimated,
1519
+ zIndex,
1520
+ backdropProps,
1521
+ focusOnMount = true,
1522
+ restoreFocus = true,
1523
+ id,
1524
+ ...props
1525
+ }, ref) => {
1557
1526
  const theme = React.useContext(styled.ThemeContext) || reactTheming.DEFAULT_THEME;
1527
+ const environment = reactTheming.useDocument(theme);
1558
1528
  const previousReferenceElementRef = React.useRef();
1559
1529
  const modalRef = React.useRef(null);
1560
1530
  const transitionRef = React.useRef(null);
1561
1531
  const [floatingElement, setFloatingElement] = React.useState();
1562
1532
  const [hasTitle, setHasTitle] = React.useState(false);
1533
+ const handleClose = event => {
1534
+ referenceElement && onClose?.(event);
1535
+ };
1563
1536
  const {
1564
1537
  getTitleProps,
1565
1538
  getCloseProps,
@@ -1568,10 +1541,11 @@ const TooltipDialogComponent = React__namespace.default.forwardRef((_ref, ref) =
1568
1541
  getModalProps
1569
1542
  } = containerModal.useModal({
1570
1543
  idPrefix: id,
1571
- onClose,
1544
+ onClose: handleClose,
1572
1545
  modalRef,
1573
1546
  focusOnMount,
1574
- restoreFocus: false
1547
+ restoreFocus: false,
1548
+ environment
1575
1549
  });
1576
1550
  const [floatingPlacement, fallbackPlacements] = reactTheming.getFloatingPlacements(theme, _placement === 'auto' ? PLACEMENT_DEFAULT : _placement, _fallbackPlacements);
1577
1551
  const {
@@ -1691,11 +1665,10 @@ TooltipDialog.Footer = Footer$1;
1691
1665
  TooltipDialog.FooterItem = FooterItem$1;
1692
1666
  TooltipDialog.Title = Title;
1693
1667
 
1694
- const HeaderComponent = React.forwardRef((_ref, ref) => {
1695
- let {
1696
- tag = 'div',
1697
- ...other
1698
- } = _ref;
1668
+ const HeaderComponent = React.forwardRef(({
1669
+ tag = 'div',
1670
+ ...other
1671
+ }, ref) => {
1699
1672
  const {
1700
1673
  isCloseButtonPresent,
1701
1674
  hasHeader,
@@ -1767,17 +1740,16 @@ const FooterItemComponent = React.forwardRef((props, ref) => React__namespace.de
1767
1740
  FooterItemComponent.displayName = 'Drawer.FooterItem';
1768
1741
  const FooterItem = FooterItemComponent;
1769
1742
 
1770
- const DrawerComponent = React.forwardRef((_ref, ref) => {
1771
- let {
1772
- id,
1773
- isOpen,
1774
- onClose,
1775
- backdropProps,
1776
- appendToNode,
1777
- focusOnMount = true,
1778
- restoreFocus = true,
1779
- ...props
1780
- } = _ref;
1743
+ const DrawerComponent = React.forwardRef(({
1744
+ id,
1745
+ isOpen,
1746
+ onClose,
1747
+ backdropProps,
1748
+ appendToNode,
1749
+ focusOnMount = true,
1750
+ restoreFocus = true,
1751
+ ...props
1752
+ }, ref) => {
1781
1753
  const modalRef = React.useRef(null);
1782
1754
  const transitionRef = React.useRef(null);
1783
1755
  const triggerRef = React.useRef(null);
@@ -1785,6 +1757,9 @@ const DrawerComponent = React.forwardRef((_ref, ref) => {
1785
1757
  const environment = reactTheming.useDocument(theme);
1786
1758
  const [isCloseButtonPresent, setIsCloseButtonPresent] = React.useState(false);
1787
1759
  const [hasHeader, setHasHeader] = React.useState(false);
1760
+ const handleClose = event => {
1761
+ isOpen && onClose?.(event);
1762
+ };
1788
1763
  const {
1789
1764
  getTitleProps,
1790
1765
  getCloseProps,
@@ -1797,7 +1772,7 @@ const DrawerComponent = React.forwardRef((_ref, ref) => {
1797
1772
  focusOnMount: false ,
1798
1773
  restoreFocus: false ,
1799
1774
  environment,
1800
- onClose
1775
+ onClose: handleClose
1801
1776
  });
1802
1777
  React.useEffect(() => {
1803
1778
  if (environment) {
@@ -11,12 +11,6 @@ import { Body } from './Body';
11
11
  import { Close } from './Close';
12
12
  import { Footer } from './Footer';
13
13
  import { FooterItem } from './FooterItem';
14
- /**
15
- * 1. When content is kept mounted we must manually focus on re-open
16
- * 2. Hide only at 'exited' so exit animations finish
17
- * and floating-ui sizing/focus logic remain valid during 'exiting'.
18
- * Earlier hiding would cut animation and risk focus/layout issues.
19
- */
20
14
  declare const TooltipDialogComponent: React.ForwardRefExoticComponent<ITooltipDialogProps & React.RefAttributes<HTMLDivElement>>;
21
15
  /**
22
16
  * @extends HTMLAttributes<HTMLDivElement>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-modals",
3
- "version": "9.12.2",
3
+ "version": "9.12.4",
4
4
  "description": "Components relating to modals in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -22,9 +22,9 @@
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
24
  "@floating-ui/react-dom": "^2.0.0",
25
- "@zendeskgarden/container-modal": "^1.0.21",
26
- "@zendeskgarden/container-utilities": "^2.0.0",
27
- "@zendeskgarden/react-buttons": "^9.12.2",
25
+ "@zendeskgarden/container-modal": "^1.0.22",
26
+ "@zendeskgarden/container-utilities": "^2.0.4",
27
+ "@zendeskgarden/react-buttons": "^9.12.4",
28
28
  "dom-helpers": "^5.1.0",
29
29
  "prop-types": "^15.5.7",
30
30
  "react-merge-refs": "^2.0.0",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/react-transition-group": "4.4.12",
41
- "@zendeskgarden/react-theming": "^9.12.2",
42
- "@zendeskgarden/svg-icons": "7.5.0"
41
+ "@zendeskgarden/react-theming": "^9.12.4",
42
+ "@zendeskgarden/svg-icons": "7.6.0"
43
43
  },
44
44
  "keywords": [
45
45
  "components",
@@ -51,5 +51,5 @@
51
51
  "access": "public"
52
52
  },
53
53
  "zendeskgarden:src": "src/index.ts",
54
- "gitHead": "9b6f34bf0eda4bee3b47f97a437aa9b7f3008af4"
54
+ "gitHead": "e79e9687e6bcbd097c059add2938cdae59a5173b"
55
55
  }