@deque/cauldron-react 3.0.1-canary.d3e5ac47 → 3.0.1-canary.db7b06be
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/lib/components/Address/index.d.ts +38 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +46 -11
- package/package.json +1 -1
|
@@ -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 {};
|
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
|
@@ -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"
|
|
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
|
-
|
|
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));
|
|
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;
|