@thecb/components 10.8.0-beta.0 → 10.8.0-beta.2

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/index.d.ts CHANGED
@@ -993,30 +993,21 @@ interface ParagraphProps {
993
993
  declare const Paragraph: React.FC<Expand<ParagraphProps> &
994
994
  React.HTMLAttributes<HTMLElement>>;
995
995
 
996
- /*
997
- Keys within this array will be referenced based on the
998
- valuesToSearchFor` array,.
999
- */
996
+ // Keys within this array will be referenced based on the
997
+ // `valuesToSearchFor` array.
1000
998
  type FlexibleObjectArray = Array<{ [key: string]: any }>;
1001
999
 
1002
1000
  interface SearchProps {
1003
- actions: FieldActions;
1004
- fields: {
1005
- [key: string]: Field;
1006
- };
1001
+ field: Field;
1002
+ fieldActions: FieldActions;
1007
1003
  dataset: FlexibleObjectArray;
1008
1004
  valuesToSearchFor: string[];
1009
- /*
1010
- The callbacks are on the consuming app to implement,
1011
- so they need to be flexible.
1012
- */
1013
1005
  onSearchCallback: () => void;
1014
1006
  onClearCallback: () => void;
1015
1007
  disabled?: boolean;
1016
1008
  placeholder?: string;
1017
1009
  searchOnKeypress?: boolean;
1018
1010
  formWidth?: string;
1019
- searchFieldName?: string;
1020
1011
  autocompleteValue?: string;
1021
1012
  themeValues?: object;
1022
1013
  }
package/dist/index.esm.js CHANGED
@@ -27098,6 +27098,7 @@ var FormInput = function FormInput(_ref15) {
27098
27098
  _ref15$isRequired = _ref15.isRequired,
27099
27099
  isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
27100
27100
  props = _objectWithoutProperties(_ref15, _excluded2);
27101
+ debugger;
27101
27102
  var _useState = useState(false),
27102
27103
  _useState2 = _slicedToArray(_useState, 2),
27103
27104
  showPassword = _useState2[0],
@@ -28581,23 +28582,23 @@ var fallbackValues$w = {
28581
28582
  };
28582
28583
 
28583
28584
  /**
28584
- * Search accepts a redux-freeform field and actions to use
28585
+ * Search requires a redux-freeform field and actions to use
28585
28586
  * for its `FormInput` state, as well as a dataset and the keys you wish
28586
28587
  * to include in your search.
28587
28588
  *
28588
28589
  * The `dataset` expected is a one-dimensional array of objects.
28589
28590
  * Properties within the objects are included in the traversal
28590
- * when they are present in the ``valuesToSearchFor` prop.
28591
+ * when they are present in the `valuesToSearchFor` prop.
28591
28592
  *
28592
28593
  * This component expects implementations of `onSearchCallback` and `onClearCallback`
28593
28594
  * in the consuming application. For example, if you want to filter a table based on
28594
- * this search, this would trigger the adjustment of your table data's state in your
28595
- * consuming application.
28595
+ * this, your callbacks should trigger the adjustment of your table data's state in your
28596
+ * application implementing Search.
28596
28597
  */
28597
28598
 
28598
28599
  var Search = function Search(_ref) {
28599
- var actions = _ref.actions,
28600
- fields = _ref.fields,
28600
+ var field = _ref.field,
28601
+ fieldActions = _ref.fieldActions,
28601
28602
  dataset = _ref.dataset,
28602
28603
  valuesToSearchFor = _ref.valuesToSearchFor,
28603
28604
  onSearchCallback = _ref.onSearchCallback,
@@ -28609,12 +28610,11 @@ var Search = function Search(_ref) {
28609
28610
  searchOnKeypress = _ref$searchOnKeypress === void 0 ? false : _ref$searchOnKeypress,
28610
28611
  _ref$searchContainerW = _ref.searchContainerWidth,
28611
28612
  searchContainerWidth = _ref$searchContainerW === void 0 ? null : _ref$searchContainerW,
28612
- _ref$searchFieldName = _ref.searchFieldName,
28613
- searchFieldName = _ref$searchFieldName === void 0 ? "searchTerm" : _ref$searchFieldName,
28614
- autocompleteValue = _ref.autocompleteValue,
28615
28613
  ariaControlsId = _ref.ariaControlsId,
28616
28614
  themeValues = _ref.themeValues;
28617
- var searchTerm = fields[searchFieldName].rawValue;
28615
+ console.log("🚀 ~ field:", field);
28616
+ console.log("🚀 ~ fieldActions:", fieldActions);
28617
+ var searchTerm = field.rawValue;
28618
28618
  var getFilteredDataset = function getFilteredDataset() {
28619
28619
  if (!searchTerm) return dataset;
28620
28620
  return dataset.filter(function (item) {
@@ -28636,13 +28636,12 @@ var Search = function Search(_ref) {
28636
28636
  id: "searchInput",
28637
28637
  role: "search",
28638
28638
  "aria-controls": ariaControlsId,
28639
- autocompleteValue: autocompleteValue,
28640
28639
  extraStyles: "border-radius: 2px 0 0 2px;",
28641
28640
  onKeyDown: function onKeyDown(e) {
28642
28641
  return searchOnKeypress || e.key === "Enter" ? handleSubmit() : noop;
28643
28642
  },
28644
- field: fields[searchFieldName],
28645
- fieldActions: actions.fields[searchFieldName],
28643
+ field: field,
28644
+ fieldActions: fieldActions,
28646
28645
  placeholder: placeholder,
28647
28646
  errorMessages: {},
28648
28647
  disabled: disabled
@@ -28656,7 +28655,7 @@ var Search = function Search(_ref) {
28656
28655
  text: "Clear Search",
28657
28656
  "aria-label": "Clear Search",
28658
28657
  action: function action() {
28659
- actions.fields[searchFieldName].set("");
28658
+ fieldActions.set("");
28660
28659
  onClearCallback();
28661
28660
  }
28662
28661
  }))), /*#__PURE__*/React.createElement(ButtonWithAction, {
@@ -46239,6 +46238,8 @@ var CloseButton = function CloseButton(_ref) {
46239
46238
  buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
46240
46239
  _ref$closeButtonText = _ref.closeButtonText,
46241
46240
  closeButtonText = _ref$closeButtonText === void 0 ? "" : _ref$closeButtonText,
46241
+ _ref$closeButtonVaria = _ref.closeButtonVariant,
46242
+ closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
46242
46243
  _ref$hideModal = _ref.hideModal,
46243
46244
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46244
46245
  _ref$isMobile = _ref.isMobile,
@@ -46255,7 +46256,7 @@ var CloseButton = function CloseButton(_ref) {
46255
46256
  role: "button",
46256
46257
  text: closeButtonText,
46257
46258
  textExtraStyles: "".concat(fontSize),
46258
- variant: "primary"
46259
+ variant: closeButtonVariant
46259
46260
  });
46260
46261
  };
46261
46262
 
@@ -46351,6 +46352,8 @@ var Modal$2 = function Modal(_ref) {
46351
46352
  children = _ref$children === void 0 ? [] : _ref$children,
46352
46353
  _ref$closeButtonText = _ref.closeButtonText,
46353
46354
  closeButtonText = _ref$closeButtonText === void 0 ? "Close" : _ref$closeButtonText,
46355
+ _ref$closeButtonVaria = _ref.closeButtonVariant,
46356
+ closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
46354
46357
  _ref$continueAction = _ref.continueAction,
46355
46358
  continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
46356
46359
  _ref$continueButtonTe = _ref.continueButtonText,
@@ -46505,6 +46508,7 @@ var Modal$2 = function Modal(_ref) {
46505
46508
  }), hasCloseButton && /*#__PURE__*/React.createElement(CloseButton, {
46506
46509
  buttonExtraStyles: buttonExtraStyles,
46507
46510
  closeButtonText: closeButtonText,
46511
+ closeButtonVariant: closeButtonVariant,
46508
46512
  hideModal: hideModal,
46509
46513
  isMobile: isMobile,
46510
46514
  key: "close"