@deque/cauldron-react 3.0.1-canary.03388cec → 3.0.1-canary.58741b89

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): JSX.Element | null;
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): JSX.Element | null;
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'
@@ -2249,7 +2249,7 @@ var Select = React__default.forwardRef(function (_a, ref) {
2249
2249
  })
2250
2250
  : children),
2251
2251
  React__default.createElement("div", { className: "arrow-down" })),
2252
- React__default.createElement("div", { className: "Error", id: errorId }, error)));
2252
+ error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
2253
2253
  /* eslint-disable jsx-a11y/no-onchange */
2254
2254
  });
2255
2255
  Select.displayName = 'Select';
@@ -2296,13 +2296,13 @@ var RadioGroup = function (_a) {
2296
2296
  handleChange(radioValue);
2297
2297
  onChange(radio, (_a = inputs.current) === null || _a === void 0 ? void 0 : _a[index]);
2298
2298
  }, disabled: disabled, checked: isChecked }, other)),
2299
+ React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2300
+ 'Field__label--disabled': disabled
2301
+ }) }, label),
2299
2302
  React__default.createElement(Icon, { className: classNames('Radio__overlay', {
2300
2303
  'Radio__overlay--focused': isFocused,
2301
2304
  'Radio__overlay--disabled': disabled
2302
- }), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } }),
2303
- React__default.createElement("label", { htmlFor: id, className: classNames('Field__label', {
2304
- 'Field__label--disabled': disabled
2305
- }) }, label)));
2305
+ }), type: isChecked ? 'radio-checked' : 'radio-unchecked', "aria-hidden": "true", onClick: function () { return onRadioClick(index); } })));
2306
2306
  });
2307
2307
  // reset the input refs array
2308
2308
  // refs get clobbered every re-render anyway and this supports "dynamic" radios
@@ -2352,6 +2352,9 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2352
2352
  onChange(e);
2353
2353
  }
2354
2354
  } }, other)),
2355
+ React__default.createElement("label", { className: classNames('Field__label', {
2356
+ 'Field__label--disabled': disabled
2357
+ }), htmlFor: id }, label),
2355
2358
  React__default.createElement(Icon, { className: classNames('Checkbox__overlay', {
2356
2359
  'Checkbox__overlay--disabled': disabled,
2357
2360
  'Checkbox__overlay--focused': focused,
@@ -2364,11 +2367,8 @@ var Checkbox = React.forwardRef(function (_a, ref) {
2364
2367
  else {
2365
2368
  (_b = checkRef.current) === null || _b === void 0 ? void 0 : _b.click();
2366
2369
  }
2367
- } }),
2368
- React__default.createElement("label", { className: classNames('Field__label', {
2369
- 'Field__label--disabled': disabled
2370
- }), htmlFor: id }, label)),
2371
- React__default.createElement("div", { id: errorId, className: "Error" }, error)));
2370
+ } })),
2371
+ error && (React__default.createElement("div", { id: errorId, className: "Error" }, error))));
2372
2372
  });
2373
2373
  Checkbox.displayName = 'Checkbox';
2374
2374
 
@@ -2475,7 +2475,7 @@ var TextField = /** @class */ (function (_super) {
2475
2475
  _this.input = input;
2476
2476
  setRef(fieldRef, input);
2477
2477
  } }, other, inputProps)),
2478
- React__default.createElement("div", { className: "Error", id: this.errorId }, error)));
2478
+ error && (React__default.createElement("div", { className: "Error", id: this.errorId }, error))));
2479
2479
  };
2480
2480
  TextField.prototype.onChange = function (e) {
2481
2481
  var _a, _b;
@@ -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)) : null;
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(' '))) : null;
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.58741b89",
4
4
  "description": "Fully accessible react components library for Deque Cauldron",
5
5
  "publishConfig": {
6
6
  "access": "public"