@deque/cauldron-react 6.7.0-canary.38e18ca8 → 6.7.0-canary.5a2f12d4

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.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ContentNode } from '../../types';
3
+ declare const BottomSheet: React.ForwardRefExoticComponent<{
4
+ label: ContentNode;
5
+ closeButtonText?: ContentNode | undefined;
6
+ open?: boolean | undefined;
7
+ } & React.HTMLAttributes<HTMLDivElement> & Pick<import("../Drawer").DrawerProps<HTMLElement> & React.RefAttributes<HTMLDivElement>, "open" | "onClose" | "portal" | "focusOptions"> & React.RefAttributes<HTMLDivElement>>;
8
+ export default BottomSheet;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- interface DrawerProps<T extends HTMLElement = HTMLElement> extends React.HTMLAttributes<HTMLDivElement> {
2
+ export interface DrawerProps<T extends HTMLElement = HTMLElement> extends React.HTMLAttributes<HTMLDivElement> {
3
3
  children: React.ReactNode;
4
4
  position: 'top' | 'bottom' | 'left' | 'right';
5
5
  open?: boolean;
package/lib/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export { default as Timeline, TimelineItem } from './components/Timeline';
60
60
  export { default as TextEllipsis } from './components/TextEllipsis';
61
61
  export { default as CopyButton } from './components/CopyButton';
62
62
  export { default as Drawer } from './components/Drawer';
63
+ export { default as BottomSheet } from './components/BottomSheet';
63
64
  /**
64
65
  * Helpers / Utils
65
66
  */
package/lib/index.js CHANGED
@@ -3367,8 +3367,8 @@ var iconTypeMap = {
3367
3367
  };
3368
3368
  var Notice = React.forwardRef(function (_a, ref) {
3369
3369
  var _b;
3370
- var _c = _a.type, type = _c === void 0 ? 'info' : _c, title = _a.title, icon = _a.icon, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, children = _a.children, otherProps = tslib.__rest(_a, ["type", "title", "icon", "variant", "children"]);
3371
- return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Notice', (_b = {},
3370
+ var className = _a.className, _c = _a.type, type = _c === void 0 ? 'info' : _c, title = _a.title, icon = _a.icon, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, children = _a.children, otherProps = tslib.__rest(_a, ["className", "type", "title", "icon", "variant", "children"]);
3371
+ return (React__default["default"].createElement("div", tslib.__assign({ className: classNames__default["default"]('Notice', className, (_b = {},
3372
3372
  _b["Notice--".concat(type)] = type,
3373
3373
  _b["Notice--condensed"] = variant === 'condensed',
3374
3374
  _b)), ref: ref }, otherProps),
@@ -4314,6 +4314,28 @@ var Drawer = React.forwardRef(function (_a, ref) {
4314
4314
  });
4315
4315
  Drawer.displayName = 'Drawer';
4316
4316
 
4317
+ var BottomSheet = React.forwardRef(function (_a, ref) {
4318
+ var label = _a.label, children = _a.children, className = _a.className, _b = _a.closeButtonText, closeButtonText = _b === void 0 ? 'Close' : _b, _c = _a.open, open = _c === void 0 ? false : _c, onClose = _a.onClose, focusOptions = _a.focusOptions, props = tslib.__rest(_a, ["label", "children", "className", "closeButtonText", "open", "onClose", "focusOptions"]);
4319
+ var bottomSheetRef = useSharedRef(ref);
4320
+ var _d = tslib.__read(nextId.useId(1, 'bottom-sheet-label'), 1), labelId = _d[0];
4321
+ var handleClose = React.useCallback(function () {
4322
+ // istanbul ignore else
4323
+ if (typeof onClose === 'function') {
4324
+ onClose();
4325
+ }
4326
+ }, [onClose]);
4327
+ return (React__default["default"].createElement(Drawer, tslib.__assign({ open: open, onClose: handleClose, focusOptions: tslib.__assign({ initialFocus: bottomSheetRef }, focusOptions) }, props, { behavior: "modal", position: "bottom" }),
4328
+ React__default["default"].createElement("div", { ref: bottomSheetRef, className: classNames__default["default"]('BottomSheet', className), tabIndex: -1, role: "dialog", "aria-labelledby": labelId },
4329
+ React__default["default"].createElement("div", { className: "BottomSheet__header" },
4330
+ React__default["default"].createElement("div", { id: labelId, className: "BottomSheet__title" }, label),
4331
+ React__default["default"].createElement(IconButton, { icon: "close", label: closeButtonText, "aria-label": "".concat(closeButtonText), onClick: handleClose, tooltipProps: {
4332
+ show: false,
4333
+ association: 'none'
4334
+ } })),
4335
+ React__default["default"].createElement("div", { className: "BottomSheet__contents" }, children))));
4336
+ });
4337
+ BottomSheet.displayName = 'BottomSheet';
4338
+
4317
4339
  var LIGHT_THEME_CLASS = 'cauldron--theme-light';
4318
4340
  var DARK_THEME_CLASS = 'cauldron--theme-dark';
4319
4341
  var ThemeContext = React.createContext({
@@ -4393,6 +4415,7 @@ exports.AlertContent = AlertContent;
4393
4415
  exports.AriaIsolate = AriaIsolate;
4394
4416
  exports.Badge = Badge;
4395
4417
  exports.BadgeLabel = BadgeLabel;
4418
+ exports.BottomSheet = BottomSheet;
4396
4419
  exports.Breadcrumb = Breadcrumb;
4397
4420
  exports.BreadcrumbItem = BreadcrumbItem;
4398
4421
  exports.BreadcrumbLink = BreadcrumbLink;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.7.0-canary.38e18ca8",
3
+ "version": "6.7.0-canary.5a2f12d4",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",