@innovaccer/design-system 2.17.0 → 2.18.0

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.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /**
3
- * Generated on: 1690223582934
3
+ * Generated on: 1691474887138
4
4
  * Package: @innovaccer/design-system
5
- * Version: v2.17.0
5
+ * Version: v2.18.0
6
6
  * License: MIT
7
7
  * Docs: https://innovaccer.github.io/design-system
8
8
  */
@@ -2622,7 +2622,7 @@ var isSpaceKey = function isSpaceKey(e) {
2622
2622
  return e.key === 'Space';
2623
2623
  };
2624
2624
 
2625
- var _excluded$y = ["onClick", "onKeyDown", "role"];
2625
+ var _excluded$y = ["onClick", "onKeyDown", "role", "tabIndex"];
2626
2626
  var allowed = {
2627
2627
  button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
2628
2628
  link: new Set(['Enter']),
@@ -2645,12 +2645,13 @@ var useAccessibilityProps = function useAccessibilityProps(_ref) {
2645
2645
  _onKeyDown = _ref.onKeyDown,
2646
2646
  _ref$role = _ref.role,
2647
2647
  role = _ref$role === void 0 ? 'button' : _ref$role,
2648
+ tabIndex = _ref.tabIndex,
2648
2649
  rest = _objectWithoutProperties(_ref, _excluded$y);
2649
2650
 
2650
2651
  return _objectSpread2({}, onClick ? {
2651
2652
  onClick: onClick,
2652
2653
  role: role,
2653
- tabIndex: 0,
2654
+ tabIndex: tabIndex || 0,
2654
2655
  'aria-label': rest['aria-label'],
2655
2656
  onKeyDown: function onKeyDown(e) {
2656
2657
  if (_onKeyDown) {
@@ -2670,6 +2671,7 @@ var useAccessibilityProps = function useAccessibilityProps(_ref) {
2670
2671
  }
2671
2672
  } : {
2672
2673
  role: role,
2674
+ tabIndex: tabIndex,
2673
2675
  'aria-label': rest['aria-label']
2674
2676
  });
2675
2677
  };
@@ -2775,7 +2777,8 @@ var GenericChip = function GenericChip(props) {
2775
2777
  className = props.className,
2776
2778
  selected = props.selected,
2777
2779
  onClose = props.onClose,
2778
- onClick = props.onClick;
2780
+ onClick = props.onClick,
2781
+ labelPrefix = props.labelPrefix;
2779
2782
  var baseProps = extractBaseProps(props);
2780
2783
 
2781
2784
  var iconClass = function iconClass(align) {
@@ -2809,11 +2812,16 @@ var GenericChip = function GenericChip(props) {
2809
2812
 
2810
2813
  var renderLabel = function renderLabel() {
2811
2814
  if (typeof label === 'string') {
2812
- return /*#__PURE__*/React.createElement(Text, {
2815
+ return /*#__PURE__*/React.createElement(React.Fragment, null, labelPrefix && /*#__PURE__*/React.createElement(Text, {
2816
+ "data-test": "DesignSystem-GenericChip--LabelPrefix",
2817
+ weight: "medium",
2818
+ color: textColor,
2819
+ className: "Chip-text mr-3"
2820
+ }, labelPrefix), /*#__PURE__*/React.createElement(Text, {
2813
2821
  "data-test": "DesignSystem-GenericChip--Text",
2814
2822
  color: textColor,
2815
2823
  className: "Chip-text"
2816
- }, label);
2824
+ }, label));
2817
2825
  }
2818
2826
 
2819
2827
  return label;
@@ -2863,7 +2871,8 @@ var Chip = function Chip(props) {
2863
2871
  onClose = props.onClose,
2864
2872
  onClick = props.onClick,
2865
2873
  name = props.name,
2866
- className = props.className;
2874
+ className = props.className,
2875
+ labelPrefix = props.labelPrefix;
2867
2876
  var baseProps = extractBaseProps(props);
2868
2877
 
2869
2878
  var onCloseHandler = function onCloseHandler() {
@@ -2890,7 +2899,8 @@ var Chip = function Chip(props) {
2890
2899
  className: chipClass,
2891
2900
  onClose: onCloseHandler,
2892
2901
  onClick: onClickHandler,
2893
- name: name
2902
+ name: name,
2903
+ labelPrefix: labelPrefix
2894
2904
  }));
2895
2905
  };
2896
2906
  Chip.displayName = 'Chip';
@@ -3245,7 +3255,7 @@ var Trigger$1 = function Trigger(props) {
3245
3255
  }));
3246
3256
  };
3247
3257
 
3248
- var _excluded$t = ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children"];
3258
+ var _excluded$t = ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children", "view"];
3249
3259
  var DatePicker = /*#__PURE__*/function (_React$Component) {
3250
3260
  _inherits(DatePicker, _React$Component);
3251
3261
 
@@ -3387,6 +3397,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
3387
3397
  showTodayDate = _this$props4$showToda === void 0 ? true : _this$props4$showToda,
3388
3398
  _this$props4$children = _this$props4.children,
3389
3399
  children = _this$props4$children === void 0 ? /*#__PURE__*/React.createElement(React.Fragment, null) : _this$props4$children,
3400
+ view = _this$props4.view,
3390
3401
  rest = _objectWithoutProperties(_this$props4, _excluded$t);
3391
3402
 
3392
3403
  var date = this.state.date;
@@ -3411,16 +3422,23 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
3411
3422
  return !isTodayDateDisabled;
3412
3423
  };
3413
3424
 
3425
+ var todayChipClass = classnames({
3426
+ 'd-flex justify-content-center': true,
3427
+ 'pb-5': size === 'small',
3428
+ 'pb-6': size === 'large',
3429
+ 'pt-3': size === 'large' && view === 'year'
3430
+ });
3414
3431
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3415
3432
  className: "d-flex"
3416
3433
  }, children, /*#__PURE__*/React.createElement(Calendar, _extends$2({}, rest, {
3417
3434
  size: size,
3418
3435
  date: currDate,
3436
+ view: view,
3419
3437
  disabledBefore: dateDisabledBefore,
3420
3438
  disabledAfter: dateDisabledAfter,
3421
3439
  onDateChange: this.onDateChangeHandler
3422
3440
  }))), showTodayDate && /*#__PURE__*/React.createElement("div", {
3423
- className: "d-flex justify-content-center pb-6",
3441
+ className: todayChipClass,
3424
3442
  "data-test": "DesignSystem-Select--TodaysDate-wrapper"
3425
3443
  }, /*#__PURE__*/React.createElement(Chip, {
3426
3444
  label: "Today, ".concat(todayMonthAndDate),
@@ -6884,6 +6902,7 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
6884
6902
  'd-flex flex-column flex-grow-1': true
6885
6903
  }, className);
6886
6904
  }, [className]);
6905
+ var isValueEqualPlaceholder = value === defaultPlaceholderValue;
6887
6906
  return /*#__PURE__*/React.createElement("div", {
6888
6907
  className: classes,
6889
6908
  "data-test": "DesignSystem-InputMask--Wrapper"
@@ -6892,8 +6911,13 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
6892
6911
  error: error,
6893
6912
  required: required,
6894
6913
  onFocus: onFocusHandler,
6895
- onChange: onChangeHandler,
6896
- onClear: onClearHandler,
6914
+ onChange: onChangeHandler
6915
+ /**
6916
+ * input right cross icon should be visible only
6917
+ * when user provides value
6918
+ */
6919
+ ,
6920
+ onClear: !isValueEqualPlaceholder ? onClearHandler : undefined,
6897
6921
  onBlur: onBlurHandler,
6898
6922
  onPaste: onPasteHandler,
6899
6923
  autoComplete: 'off',
@@ -6982,7 +7006,7 @@ var Label = function Label(props) {
6982
7006
  "data-test": "DesignSystem-Label--Text",
6983
7007
  className: classes,
6984
7008
  componentType: "label"
6985
- }, rest), children), renderInfo(required, optional), info && renderIndicator(info));
7009
+ }, rest), children, renderInfo(required, optional), info && renderIndicator(info)));
6986
7010
  };
6987
7011
  Label.displayName = 'Label';
6988
7012
 
@@ -13787,7 +13811,7 @@ var ChipInput = function ChipInput(props) {
13787
13811
  }, [value]);
13788
13812
  var ChipInputClass = classnames((_classNames = {
13789
13813
  ChipInput: true
13790
- }, _defineProperty$1(_classNames, 'ChipInput--disabled', disabled), _defineProperty$1(_classNames, 'ChipInput--withChips', chips.length > 0), _classNames), className);
13814
+ }, _defineProperty$1(_classNames, 'ChipInput--disabled', disabled), _defineProperty$1(_classNames, 'ChipInput--withChips', chips && chips.length > 0), _classNames), className);
13791
13815
 
13792
13816
  var onUpdateChips = function onUpdateChips(updatedChips) {
13793
13817
  if (onChange) onChange(updatedChips);
@@ -13873,7 +13897,7 @@ var ChipInput = function ChipInput(props) {
13873
13897
  type: type,
13874
13898
  disabled: disabled,
13875
13899
  key: index,
13876
- className: "my-2 mx-2",
13900
+ className: "my-3 mx-2",
13877
13901
  onClick: function onClick() {
13878
13902
  return _onClick && _onClick(chip, index);
13879
13903
  },
@@ -13888,11 +13912,15 @@ var ChipInput = function ChipInput(props) {
13888
13912
  /* TODO(a11y): fix accessibility */
13889
13913
 
13890
13914
  /* eslint-disable */
13891
- React.createElement("div", _extends$2({
13915
+ React.createElement("div", {
13916
+ "data-test": "DesignSystem-ChipInput--Border",
13917
+ className: "ChipInput-border"
13918
+ }, /*#__PURE__*/React.createElement("div", _extends$2({
13892
13919
  "data-test": "DesignSystem-ChipInput"
13893
13920
  }, baseProps, {
13894
13921
  className: ChipInputClass,
13895
- onClick: onClickHandler
13922
+ onClick: onClickHandler,
13923
+ tabIndex: disabled ? -1 : 0
13896
13924
  }), /*#__PURE__*/React.createElement("div", {
13897
13925
  className: "ChipInput-wrapper"
13898
13926
  }, chips && chips.length > 0 && chipComponents, /*#__PURE__*/React.createElement("input", {
@@ -13900,7 +13928,7 @@ var ChipInput = function ChipInput(props) {
13900
13928
  ref: inputRef,
13901
13929
  className: "ChipInput-input",
13902
13930
  autoFocus: autoFocus,
13903
- placeholder: placeholder,
13931
+ placeholder: chips && chips.length > 0 ? '' : placeholder,
13904
13932
  disabled: disabled,
13905
13933
  value: inputValue,
13906
13934
  onBlur: onBlur,
@@ -13910,10 +13938,11 @@ var ChipInput = function ChipInput(props) {
13910
13938
  })), chips.length > 0 && /*#__PURE__*/React.createElement(Icon, {
13911
13939
  "data-test": "DesignSystem-ChipInput--Icon",
13912
13940
  name: "close",
13913
- appearance: "subtle",
13941
+ appearance: disabled ? 'disabled' : 'subtle',
13914
13942
  className: "ChipInput-icon",
13915
- onClick: onDeleteAllHandler
13916
- }))
13943
+ onClick: onDeleteAllHandler,
13944
+ tabIndex: disabled ? -1 : 0
13945
+ })))
13917
13946
  );
13918
13947
  };
13919
13948
  ChipInput.displayName = 'ChipInput';
@@ -15944,15 +15973,10 @@ var EditableInput = function EditableInput(props) {
15944
15973
  position: "right",
15945
15974
  className: "px-6 py-6 d-flex align-items-center",
15946
15975
  on: "hover"
15947
- }, /*#__PURE__*/React.createElement(Icon, {
15948
- name: "error",
15949
- appearance: 'alert',
15950
- className: "mr-4"
15951
- }), /*#__PURE__*/React.createElement(Text, {
15952
- "data-test": "DesignSystem-EditableInput--ErrorPopper",
15953
- appearance: "destructive",
15954
- weight: "medium"
15955
- }, errorMessage)) : inputComponent;
15976
+ }, /*#__PURE__*/React.createElement(InlineMessage, {
15977
+ appearance: "alert",
15978
+ description: errorMessage
15979
+ })) : inputComponent;
15956
15980
  }
15957
15981
 
15958
15982
  return /*#__PURE__*/React.createElement("div", {
@@ -18972,52 +18996,6 @@ var context = /*#__PURE__*/React.createContext(_objectSpread2(_objectSpread2({},
18972
18996
  }));
18973
18997
  var GridProvider = context.Provider;
18974
18998
 
18975
- var GridNestedRow = function GridNestedRow(props) {
18976
- var context$1 = React.useContext(context);
18977
- var schema = context$1.schema,
18978
- loading = context$1.loading,
18979
- nestedRowRenderer = context$1.nestedRowRenderer;
18980
- var data = props.data,
18981
- rowIndex = props.rowIndex;
18982
- if (nestedRowRenderer) return nestedRowRenderer({
18983
- data: data,
18984
- schema: schema,
18985
- loading: loading,
18986
- rowIndex: rowIndex
18987
- }); // return (
18988
- // <Text>{JSON.stringify(data)}</Text>
18989
- // )
18990
- // const {
18991
- // schema: propSchema
18992
- // } = _this.props;
18993
- // if (data._expanded) {
18994
- // const showHead = data._expanded.showHead;
18995
- // const schema = data._expanded.schema || propSchema;
18996
- // let gridData = data._expanded.data;
18997
- // if (!gridData) {
18998
- // const {
18999
- // _uid,
19000
- // _expanded,
19001
- // ...rest
19002
- // } = data;
19003
- // gridData = [rest];
19004
- // }
19005
- // return (
19006
- // <div className="Grid-expandedRow">
19007
- // <Grid
19008
- // key={'expanedRow'}
19009
- // showHead={showHead}
19010
- // data={gridData}
19011
- // schema={schema}
19012
- // totalRecords={gridData.length}
19013
- // />
19014
- // </div>
19015
- // );
19016
- // }
19017
-
19018
- return null;
19019
- };
19020
-
19021
18999
  var HeaderCell = function HeaderCell(props) {
19022
19000
  var context$1 = React.useContext(context);
19023
19001
  var schema = props.schema,
@@ -19204,7 +19182,8 @@ var BodyCell = function BodyCell(props) {
19204
19182
  schema = props.schema,
19205
19183
  expandedState = props.expandedState,
19206
19184
  rowIndex = props.rowIndex,
19207
- colIndex = props.colIndex;
19185
+ colIndex = props.colIndex,
19186
+ nestedRowData = props.nestedRowData;
19208
19187
  var size = context$1.size,
19209
19188
  loading = context$1.loading,
19210
19189
  nestedRows = context$1.nestedRows;
@@ -19222,20 +19201,15 @@ var BodyCell = function BodyCell(props) {
19222
19201
  loading: loading,
19223
19202
  expanded: expanded
19224
19203
  };
19225
- var nestedProps = {
19226
- data: data,
19227
- rowIndex: rowIndex
19228
- };
19229
- var isNestedRowDisabled = !GridNestedRow(nestedProps);
19230
19204
  return /*#__PURE__*/React.createElement("div", {
19231
19205
  className: "Grid-cellContent"
19232
- }, colIndex === 0 && nestedRows && /*#__PURE__*/React.createElement(React.Fragment, null, !isNestedRowDisabled ? /*#__PURE__*/React.createElement(Icon, {
19206
+ }, colIndex === 0 && nestedRows && /*#__PURE__*/React.createElement(React.Fragment, null, nestedRowData ? /*#__PURE__*/React.createElement(Icon, {
19233
19207
  className: 'Grid-nestedRowTrigger',
19234
19208
  name: expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
19235
19209
  size: 20,
19236
19210
  appearance: 'default',
19237
19211
  onClick: function onClick(e) {
19238
- if (!isNestedRowDisabled) {
19212
+ if (nestedRowData) {
19239
19213
  e.stopPropagation();
19240
19214
  setExpanded(!expanded);
19241
19215
  }
@@ -19261,7 +19235,8 @@ var Cell = function Cell(props) {
19261
19235
  onMenuChange = _ref.onMenuChange,
19262
19236
  onFilterChange = _ref.onFilterChange,
19263
19237
  updateColumnSchema = _ref.updateColumnSchema,
19264
- reorderColumn = _ref.reorderColumn;
19238
+ reorderColumn = _ref.reorderColumn,
19239
+ nestedRowData = _ref.nestedRowData;
19265
19240
  var draggable = context$1.draggable,
19266
19241
  separator = context$1.separator,
19267
19242
  nestedRows = context$1.nestedRows,
@@ -19360,7 +19335,8 @@ var Cell = function Cell(props) {
19360
19335
  colIndex: colIndex,
19361
19336
  data: data,
19362
19337
  schema: schema,
19363
- expandedState: expandedState
19338
+ expandedState: expandedState,
19339
+ nestedRowData: nestedRowData
19364
19340
  }));
19365
19341
  };
19366
19342
 
@@ -19436,6 +19412,54 @@ var GridHead = function GridHead(props) {
19436
19412
  }, renderSchema(leftPinnedSchema, !!leftPinnedSchema.length, 'left'), renderSchema(unpinnedSchema, !leftPinnedSchema.length && !!unpinnedSchema.length), renderSchema(rightPinnedSchema, false, 'right')));
19437
19413
  };
19438
19414
 
19415
+ var GridNestedRow = function GridNestedRow(props) {
19416
+ var context$1 = React.useContext(context);
19417
+ var schema = context$1.schema,
19418
+ loading = context$1.loading,
19419
+ nestedRowRenderer = context$1.nestedRowRenderer;
19420
+ var data = props.data,
19421
+ rowIndex = props.rowIndex,
19422
+ expanded = props.expanded;
19423
+ if (nestedRowRenderer) return nestedRowRenderer({
19424
+ data: data,
19425
+ schema: schema,
19426
+ loading: loading,
19427
+ rowIndex: rowIndex,
19428
+ expanded: expanded
19429
+ }); // return (
19430
+ // <Text>{JSON.stringify(data)}</Text>
19431
+ // )
19432
+ // const {
19433
+ // schema: propSchema
19434
+ // } = _this.props;
19435
+ // if (data._expanded) {
19436
+ // const showHead = data._expanded.showHead;
19437
+ // const schema = data._expanded.schema || propSchema;
19438
+ // let gridData = data._expanded.data;
19439
+ // if (!gridData) {
19440
+ // const {
19441
+ // _uid,
19442
+ // _expanded,
19443
+ // ...rest
19444
+ // } = data;
19445
+ // gridData = [rest];
19446
+ // }
19447
+ // return (
19448
+ // <div className="Grid-expandedRow">
19449
+ // <Grid
19450
+ // key={'expanedRow'}
19451
+ // showHead={showHead}
19452
+ // data={gridData}
19453
+ // schema={schema}
19454
+ // totalRecords={gridData.length}
19455
+ // />
19456
+ // </div>
19457
+ // );
19458
+ // }
19459
+
19460
+ return null;
19461
+ };
19462
+
19439
19463
  var GridRow = function GridRow(props) {
19440
19464
  var context$1 = React.useContext(context);
19441
19465
  var type = context$1.type,
@@ -19478,6 +19502,12 @@ var GridRow = function GridRow(props) {
19478
19502
  var unpinnedSchema = schema.filter(function (s) {
19479
19503
  return !s.hidden && !s.pinned;
19480
19504
  });
19505
+ var nestedProps = {
19506
+ data: data,
19507
+ rowIndex: rI,
19508
+ expanded: expanded
19509
+ };
19510
+ var nestedRowData = GridNestedRow(nestedProps);
19481
19511
 
19482
19512
  var renderCheckbox = function renderCheckbox(show) {
19483
19513
  if (!show || !withCheckbox) return null;
@@ -19520,7 +19550,8 @@ var GridRow = function GridRow(props) {
19520
19550
  firstCell: !index,
19521
19551
  schema: s,
19522
19552
  data: data,
19523
- expandedState: [expanded, setExpanded]
19553
+ expandedState: [expanded, setExpanded],
19554
+ nestedRowData: nestedRowData
19524
19555
  });
19525
19556
  }));
19526
19557
  }
@@ -19540,10 +19571,7 @@ var GridRow = function GridRow(props) {
19540
19571
  ref: rowRef
19541
19572
  }, renderSchema(leftPinnedSchema, !!leftPinnedSchema.length, 'left'), renderSchema(unpinnedSchema, !leftPinnedSchema.length && !!unpinnedSchema.length), renderSchema(rightPinnedSchema, false, 'right')), nestedRows && expanded && /*#__PURE__*/React.createElement("div", {
19542
19573
  className: "Grid-nestedRow"
19543
- }, /*#__PURE__*/React.createElement(GridNestedRow, {
19544
- data: data,
19545
- rowIndex: rI
19546
- })));
19574
+ }, nestedRowData));
19547
19575
  };
19548
19576
  GridRow.defaultProps = {
19549
19577
  data: {}
@@ -21817,6 +21845,6 @@ LinkButton.defaultProps = {
21817
21845
  iconAlign: 'left'
21818
21846
  };
21819
21847
 
21820
- var version = "2.17.0";
21848
+ var version = "2.18.0";
21821
21849
 
21822
21850
  export { Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HelpText, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, LinkButton, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };