@hyphen/hyphen-components 2.18.0 → 2.19.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.
- package/dist/components/Modal/Modal.stories.d.ts +3 -1
- package/dist/components/Modal/components/ModalFooter/ModalFooter.d.ts +1 -1
- package/dist/css/index.css +2 -2
- package/dist/hyphen-components.cjs.development.js +24 -28
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +24 -28
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +3 -1
- package/src/components/Modal/Modal.stories.tsx +37 -9
- package/src/components/Modal/Modal.test.tsx +30 -23
- package/src/components/Modal/Modal.tsx +5 -1
- package/src/components/Modal/components/ModalBody/ModalBody.test.tsx +23 -5
- package/src/components/Modal/components/ModalBody/ModalBody.tsx +0 -2
- package/src/components/Modal/components/ModalFooter/ModalFooter.test.tsx +45 -9
- package/src/components/Modal/components/ModalFooter/ModalFooter.tsx +3 -10
- package/src/components/Modal/components/ModalHeader/ModalHeader.test.tsx +23 -4
- package/src/components/Modal/components/ModalHeader/ModalHeader.tsx +7 -11
- package/src/components/Table/Table.module.scss +2 -1
- package/src/components/Table/TableHead/TableHeaderCell/TableHeaderCell.module.scss +1 -1
|
@@ -3236,31 +3236,25 @@ var FormikToggle = function FormikToggle(_ref) {
|
|
|
3236
3236
|
}, props));
|
|
3237
3237
|
};
|
|
3238
3238
|
|
|
3239
|
-
var _excluded$5 = ["children", "padding", "direction", "alignItems", "justifyContent", "
|
|
3239
|
+
var _excluded$5 = ["children", "padding", "direction", "alignItems", "justifyContent", "gap", "style"];
|
|
3240
3240
|
var ModalFooter = function ModalFooter(_ref) {
|
|
3241
3241
|
var children = _ref.children,
|
|
3242
|
-
|
|
3243
|
-
padding = _ref$padding === void 0 ? 'xl' : _ref$padding,
|
|
3242
|
+
padding = _ref.padding,
|
|
3244
3243
|
_ref$direction = _ref.direction,
|
|
3245
3244
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
3246
3245
|
_ref$alignItems = _ref.alignItems,
|
|
3247
3246
|
alignItems = _ref$alignItems === void 0 ? 'center' : _ref$alignItems,
|
|
3248
3247
|
_ref$justifyContent = _ref.justifyContent,
|
|
3249
3248
|
justifyContent = _ref$justifyContent === void 0 ? 'flex-end' : _ref$justifyContent,
|
|
3250
|
-
_ref$background = _ref.background,
|
|
3251
|
-
background = _ref$background === void 0 ? 'secondary' : _ref$background,
|
|
3252
3249
|
_ref$gap = _ref.gap,
|
|
3253
|
-
gap = _ref$gap === void 0 ? '
|
|
3250
|
+
gap = _ref$gap === void 0 ? 'md' : _ref$gap,
|
|
3254
3251
|
style = _ref.style,
|
|
3255
3252
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
3256
3253
|
return React.createElement(Box, _extends({
|
|
3257
|
-
background: background,
|
|
3258
3254
|
padding: padding,
|
|
3259
3255
|
direction: direction,
|
|
3260
3256
|
alignItems: alignItems,
|
|
3261
3257
|
justifyContent: justifyContent,
|
|
3262
|
-
borderWidth: "sm 0 0 0",
|
|
3263
|
-
borderColor: "default",
|
|
3264
3258
|
gap: gap,
|
|
3265
3259
|
style: _extends({
|
|
3266
3260
|
flexShrink: 0
|
|
@@ -3268,8 +3262,6 @@ var ModalFooter = function ModalFooter(_ref) {
|
|
|
3268
3262
|
}, restProps), children);
|
|
3269
3263
|
};
|
|
3270
3264
|
|
|
3271
|
-
var styles$7 = {"modal-close":"Modal-module_modal-close__1YmMa","modal":"Modal-module_modal__yNG-7","modal-content":"Modal-module_modal-content__GMtBm"};
|
|
3272
|
-
|
|
3273
3265
|
var ModalHeader = function ModalHeader(_ref) {
|
|
3274
3266
|
var id = _ref.id,
|
|
3275
3267
|
onDismiss = _ref.onDismiss,
|
|
@@ -3277,12 +3269,10 @@ var ModalHeader = function ModalHeader(_ref) {
|
|
|
3277
3269
|
title = _ref$title === void 0 ? undefined : _ref$title;
|
|
3278
3270
|
var justifyContentValue = title === undefined && onDismiss ? 'flex-end' : 'space-between';
|
|
3279
3271
|
return React.createElement(Box, {
|
|
3280
|
-
padding: "xl",
|
|
3281
3272
|
direction: "row",
|
|
3282
3273
|
alignItems: "center",
|
|
3283
3274
|
justifyContent: justifyContentValue,
|
|
3284
|
-
|
|
3285
|
-
borderColor: "default",
|
|
3275
|
+
gap: "3xl",
|
|
3286
3276
|
style: {
|
|
3287
3277
|
flexShrink: 0
|
|
3288
3278
|
}
|
|
@@ -3293,30 +3283,26 @@ var ModalHeader = function ModalHeader(_ref) {
|
|
|
3293
3283
|
tablet: 'lg'
|
|
3294
3284
|
},
|
|
3295
3285
|
id: id
|
|
3296
|
-
}, title), onDismiss && React.createElement(
|
|
3286
|
+
}, title), onDismiss && React.createElement(Button, {
|
|
3297
3287
|
"aria-label": "close",
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
})));
|
|
3288
|
+
variant: "tertiary",
|
|
3289
|
+
onClick: onDismiss,
|
|
3290
|
+
iconPrefix: "remove",
|
|
3291
|
+
size: "sm"
|
|
3292
|
+
}));
|
|
3304
3293
|
};
|
|
3305
3294
|
|
|
3306
|
-
var _excluded$4 = ["children", "flex", "
|
|
3295
|
+
var _excluded$4 = ["children", "flex", "overflow", "height"];
|
|
3307
3296
|
var ModalBody = function ModalBody(_ref) {
|
|
3308
3297
|
var children = _ref.children,
|
|
3309
3298
|
_ref$flex = _ref.flex,
|
|
3310
3299
|
flex = _ref$flex === void 0 ? 'auto' : _ref$flex,
|
|
3311
|
-
_ref$padding = _ref.padding,
|
|
3312
|
-
padding = _ref$padding === void 0 ? 'xl' : _ref$padding,
|
|
3313
3300
|
_ref$overflow = _ref.overflow,
|
|
3314
3301
|
overflow = _ref$overflow === void 0 ? 'auto' : _ref$overflow,
|
|
3315
3302
|
_ref$height = _ref.height,
|
|
3316
3303
|
height = _ref$height === void 0 ? '100' : _ref$height,
|
|
3317
3304
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
3318
3305
|
return React.createElement(Box, _extends({
|
|
3319
|
-
padding: padding,
|
|
3320
3306
|
flex: flex,
|
|
3321
3307
|
overflow: overflow,
|
|
3322
3308
|
height: height,
|
|
@@ -3326,6 +3312,8 @@ var ModalBody = function ModalBody(_ref) {
|
|
|
3326
3312
|
}, restProps), children);
|
|
3327
3313
|
};
|
|
3328
3314
|
|
|
3315
|
+
var styles$7 = {"modal-close":"Modal-module_modal-close__1YmMa","modal":"Modal-module_modal__yNG-7","modal-content":"Modal-module_modal-content__GMtBm"};
|
|
3316
|
+
|
|
3329
3317
|
var _excluded$3 = ["ariaLabel", "ariaLabelledBy", "allowPinchZoom", "children", "className", "containerRef", "fullScreenMobile", "initialFocusRef", "isOpen", "maxWidth", "onDismiss", "overflow"];
|
|
3330
3318
|
var ModalBaseComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
3331
3319
|
var _classNames;
|
|
@@ -3359,6 +3347,7 @@ var ModalBaseComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3359
3347
|
fullscreen: fullScreenMobile
|
|
3360
3348
|
});
|
|
3361
3349
|
var contentClassnames = classNames(styles$7['modal-content'], className, maxWidthCss.classes, (_classNames = {}, _classNames["overflow-" + overflow] = overflow, _classNames));
|
|
3350
|
+
if (!isOpen) return null;
|
|
3362
3351
|
var parentElement = containerRef != null && containerRef.current ? containerRef.current : undefined;
|
|
3363
3352
|
return React.createElement(FocusLock, {
|
|
3364
3353
|
autoFocus: true,
|
|
@@ -3379,12 +3368,19 @@ var ModalBaseComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3379
3368
|
ariaHideApp: false,
|
|
3380
3369
|
parentSelector: parentElement ? function () {
|
|
3381
3370
|
return parentElement;
|
|
3382
|
-
} : undefined
|
|
3371
|
+
} : undefined,
|
|
3372
|
+
style: {
|
|
3373
|
+
content: _extends({}, maxWidthCss.styles)
|
|
3374
|
+
}
|
|
3383
3375
|
}, restProps), React.createElement(Box, {
|
|
3384
3376
|
"aria-label": ariaLabel,
|
|
3385
3377
|
"aria-labelledby": ariaLabelledBy,
|
|
3386
|
-
|
|
3387
|
-
|
|
3378
|
+
height: "100",
|
|
3379
|
+
padding: {
|
|
3380
|
+
base: '2xl',
|
|
3381
|
+
tablet: '4xl'
|
|
3382
|
+
},
|
|
3383
|
+
gap: "3xl"
|
|
3388
3384
|
}, children)))));
|
|
3389
3385
|
});
|
|
3390
3386
|
// Actual component is wrapped in an IIFE for the export
|