@deque/cauldron-react 3.0.1-canary.03388cec → 3.0.1-canary.1470cc39

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,38 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface AddressProps extends React.HTMLAttributes<HTMLElement> {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const Address: {
7
+ ({ children, className, ...other }: AddressProps): JSX.Element;
8
+ displayName: string;
9
+ propTypes: {
10
+ children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
11
+ className: PropTypes.Requireable<string>;
12
+ };
13
+ };
14
+ declare type AddressLineProps = React.HTMLAttributes<HTMLElement>;
15
+ export declare const AddressLine: {
16
+ ({ children, className, ...other }: AddressLineProps): false | JSX.Element;
17
+ displayName: string;
18
+ propTypes: {
19
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
+ className: PropTypes.Requireable<string>;
21
+ };
22
+ };
23
+ interface AddressCityStateZipProps extends React.HTMLAttributes<HTMLElement> {
24
+ city: React.ReactNode;
25
+ state: React.ReactNode;
26
+ zip: React.ReactNode;
27
+ }
28
+ export declare const AddressCityStateZip: {
29
+ ({ city, state, zip, className, ...other }: AddressCityStateZipProps): false | JSX.Element;
30
+ displayName: string;
31
+ propTypes: {
32
+ city: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
+ state: PropTypes.Requireable<PropTypes.ReactNodeLike>;
34
+ zip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
+ className: PropTypes.Requireable<string>;
36
+ };
37
+ };
38
+ export {};
@@ -11,7 +11,7 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
11
11
  portal?: React.RefObject<HTMLElement> | HTMLElement;
12
12
  hideElementOnHidden?: boolean;
13
13
  }
14
- declare function Tooltip({ id: propId, placement: initialPlacement, children, portal, target, association, variant, show: showProp, hideElementOnHidden, ...props }: TooltipProps): React.ReactPortal | null;
14
+ declare function Tooltip({ id: propId, placement: initialPlacement, children, portal, target, association, variant, show: showProp, hideElementOnHidden, className, ...props }: TooltipProps): React.ReactPortal | null;
15
15
  declare namespace Tooltip {
16
16
  var displayName: string;
17
17
  var propTypes: {
package/lib/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetai
43
43
  export { default as Stepper, Step } from './components/Stepper';
44
44
  export { default as Panel } from './components/Panel';
45
45
  export { default as ProgressBar } from './components/ProgressBar';
46
+ export { Address, AddressLine, AddressCityStateZip } from './components/Address';
46
47
  /**
47
48
  * Helpers / Utils
48
49
  */
package/lib/index.js CHANGED
@@ -1467,7 +1467,7 @@ var fireCustomEvent = function (show, button) {
1467
1467
  };
1468
1468
  function Tooltip(_a) {
1469
1469
  var _this = this;
1470
- var propId = _a.id, _b = _a.placement, initialPlacement = _b === void 0 ? 'auto' : _b, children = _a.children, portal = _a.portal, target = _a.target, _c = _a.association, association = _c === void 0 ? 'aria-describedby' : _c, _d = _a.variant, variant = _d === void 0 ? 'text' : _d, _e = _a.show, showProp = _e === void 0 ? false : _e, _f = _a.hideElementOnHidden, hideElementOnHidden = _f === void 0 ? false : _f, props = tslib.__rest(_a, ["id", "placement", "children", "portal", "target", "association", "variant", "show", "hideElementOnHidden"]);
1470
+ var propId = _a.id, _b = _a.placement, initialPlacement = _b === void 0 ? 'auto' : _b, children = _a.children, portal = _a.portal, target = _a.target, _c = _a.association, association = _c === void 0 ? 'aria-describedby' : _c, _d = _a.variant, variant = _d === void 0 ? 'text' : _d, _e = _a.show, showProp = _e === void 0 ? false : _e, _f = _a.hideElementOnHidden, hideElementOnHidden = _f === void 0 ? false : _f, className = _a.className, props = tslib.__rest(_a, ["id", "placement", "children", "portal", "target", "association", "variant", "show", "hideElementOnHidden", "className"]);
1471
1471
  var id = (propId ? [propId] : nextId.useId(1, 'tooltip'))[0];
1472
1472
  var hovering = React.useRef(false);
1473
1473
  var _g = React.useState(initialPlacement), placement = _g[0], setPlacement = _g[1];
@@ -1588,7 +1588,7 @@ function Tooltip(_a) {
1588
1588
  }
1589
1589
  }, [targetElement, id]);
1590
1590
  return showTooltip || hideElementOnHidden
1591
- ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, {
1591
+ ? reactDom.createPortal(React__default.createElement("div", tslib.__assign({ id: id, className: classNames('Tooltip', "Tooltip--" + placement, className, {
1592
1592
  TooltipInfo: variant === 'info',
1593
1593
  'Tooltip--hidden': !showTooltip && hideElementOnHidden,
1594
1594
  'Tooltip--big': variant === 'big'
@@ -8205,6 +8205,38 @@ var ProgressBar = React.forwardRef(function (_a, ref) {
8205
8205
  });
8206
8206
  ProgressBar.displayName = 'ProgressBar';
8207
8207
 
8208
+ var Address = function (_a) {
8209
+ var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
8210
+ return (React__default.createElement("address", tslib.__assign({ className: classNames('Address', className) }, other), children));
8211
+ };
8212
+ Address.displayName = 'Address';
8213
+ Address.propTypes = {
8214
+ children: PropTypes.node.isRequired,
8215
+ className: PropTypes.string
8216
+ };
8217
+ var AddressLine = function (_a) {
8218
+ var children = _a.children, className = _a.className, other = tslib.__rest(_a, ["children", "className"]);
8219
+ return !!children && (React__default.createElement("div", tslib.__assign({ className: classNames('Address__line', className) }, other), children));
8220
+ };
8221
+ AddressLine.displayName = 'AddressLine';
8222
+ AddressLine.propTypes = {
8223
+ children: PropTypes.node,
8224
+ className: PropTypes.string
8225
+ };
8226
+ var AddressCityStateZip = function (_a) {
8227
+ var city = _a.city, state = _a.state, zip = _a.zip, className = _a.className, other = tslib.__rest(_a, ["city", "state", "zip", "className"]);
8228
+ return !!(city || state || zip) && (React__default.createElement("div", tslib.__assign({ className: classNames('Address__city-state-zip', className) }, other), [[city, state].filter(Boolean).join(', '), zip]
8229
+ .filter(Boolean)
8230
+ .join(' ')));
8231
+ };
8232
+ AddressCityStateZip.displayName = 'AddressCityStateZip';
8233
+ AddressCityStateZip.propTypes = {
8234
+ city: PropTypes.node,
8235
+ state: PropTypes.node,
8236
+ zip: PropTypes.node,
8237
+ className: PropTypes.string
8238
+ };
8239
+
8208
8240
  /**
8209
8241
  * Hook to be used similarly to the React.Component#componentDidMount.
8210
8242
  * Executes the provided `effect` when `dependencies` change but does not
@@ -8273,6 +8305,9 @@ ThemeProvider.propTypes = {
8273
8305
  initialTheme: PropTypes.string
8274
8306
  };
8275
8307
 
8308
+ exports.Address = Address;
8309
+ exports.AddressCityStateZip = AddressCityStateZip;
8310
+ exports.AddressLine = AddressLine;
8276
8311
  exports.Alert = Alert;
8277
8312
  exports.AlertActions = AlertActions;
8278
8313
  exports.AlertContent = AlertContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "3.0.1-canary.03388cec",
3
+ "version": "3.0.1-canary.1470cc39",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"