@djb25/digit-ui-module-fsm 1.0.8 → 1.0.10

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.
@@ -549,7 +549,7 @@ const SelectGender = ({
549
549
  return /*#__PURE__*/React.createElement(Loader, null);
550
550
  }
551
551
  if (userType === "employee") {
552
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$2, {
552
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$2, {
553
553
  className: "payment-form-text-input-correction",
554
554
  isMandatory: config.isMandatory,
555
555
  selected: genderType,
@@ -2249,12 +2249,14 @@ const InputCard = ({
2249
2249
  style: _cardStyle
2250
2250
  }, _texts.headerCaption && /*#__PURE__*/React.createElement(CardCaption, null, t(_texts.headerCaption)), (_texts === null || _texts === void 0 ? void 0 : _texts.header) && /*#__PURE__*/React.createElement(CardHeader, null, t(_texts.header)), (_texts === null || _texts === void 0 ? void 0 : _texts.cardText) && /*#__PURE__*/React.createElement(CardText, null, t(_texts.cardText)), /*#__PURE__*/React.createElement("div", {
2251
2251
  className: "formcomposer-section-grid"
2252
- }, children), _texts.submitBarLabel ? /*#__PURE__*/React.createElement(SubmitBar, {
2252
+ }, children), _texts.submitBarLabel ? /*#__PURE__*/React.createElement("div", {
2253
+ className: "formcomposer-section-button"
2254
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
2253
2255
  disabled: isDisable,
2254
2256
  submit: _submit,
2255
2257
  label: t(_texts.submitBarLabel),
2256
2258
  onSubmit: onNext
2257
- }) : null, _texts.skipLabel ? /*#__PURE__*/React.createElement(CardText, {
2259
+ }), " ") : null, _texts.skipLabel ? /*#__PURE__*/React.createElement(CardText, {
2258
2260
  style: {
2259
2261
  marginTop: "10px",
2260
2262
  textAlign: isMobile ? "center" : "left"
@@ -2284,6 +2286,71 @@ InputCard.defaultProps = {
2284
2286
  t: value => value
2285
2287
  };
2286
2288
 
2289
+ const ArrowDown = ({
2290
+ className,
2291
+ onClick,
2292
+ styles,
2293
+ disable
2294
+ }) => /*#__PURE__*/React.createElement("svg", {
2295
+ style: {
2296
+ ...styles
2297
+ },
2298
+ xmlns: "http://www.w3.org/2000/svg",
2299
+ viewBox: "0 0 24 24",
2300
+ fill: disable ? "#9E9E9E" : "black",
2301
+ className: className,
2302
+ onClick: onClick,
2303
+ width: "18px",
2304
+ height: "18px"
2305
+ }, /*#__PURE__*/React.createElement("path", {
2306
+ d: "M0 0h24v24H0V0z",
2307
+ fill: "none"
2308
+ }), /*#__PURE__*/React.createElement("path", {
2309
+ d: "M7 10l5 5 5-5H7z"
2310
+ }));
2311
+
2312
+ const CollapsibleCardPage = ({
2313
+ number,
2314
+ title,
2315
+ children,
2316
+ defaultOpen: _defaultOpen = false,
2317
+ tabs: _tabs = null,
2318
+ defaultTab: _defaultTab = "",
2319
+ onTabChange: _onTabChange = () => {},
2320
+ style,
2321
+ className
2322
+ }) => {
2323
+ const [isOpen, setIsOpen] = useState(_defaultOpen);
2324
+ const [activeTab, setActiveTab] = useState(_defaultTab || _tabs && _tabs[0] || "");
2325
+ const handleTabClick = tab => {
2326
+ setActiveTab(tab);
2327
+ _onTabChange(tab);
2328
+ };
2329
+ return /*#__PURE__*/React.createElement("div", {
2330
+ className: `collapsible-card ${className ? className : ""}`,
2331
+ style: style
2332
+ }, /*#__PURE__*/React.createElement("div", {
2333
+ className: "collapsible-card-header",
2334
+ onClick: () => setIsOpen(!isOpen)
2335
+ }, /*#__PURE__*/React.createElement("h3", {
2336
+ className: "collapsible-card-title"
2337
+ }, number ? `${number}. ` : "", title), /*#__PURE__*/React.createElement("span", {
2338
+ className: `collapsible-card-arrow ${isOpen ? "rotate" : ""}`
2339
+ }, /*#__PURE__*/React.createElement(ArrowDown, null))), isOpen && /*#__PURE__*/React.createElement("div", {
2340
+ className: "collapsible-card-body"
2341
+ }, _tabs && /*#__PURE__*/React.createElement("div", {
2342
+ className: "collapsible-card-tabs"
2343
+ }, _tabs.map((tab, index) => /*#__PURE__*/React.createElement("button", {
2344
+ key: index,
2345
+ onClick: () => handleTabClick(tab),
2346
+ className: `collapsible-card-tab-button ${activeTab === tab ? "active" : ""}`
2347
+ }, tab))), /*#__PURE__*/React.createElement("div", {
2348
+ className: "collapsible-card-tab-content"
2349
+ }, _tabs ? /*#__PURE__*/React.createElement(React.Fragment, {
2350
+ key: activeTab
2351
+ }, children(activeTab)) : children)));
2352
+ };
2353
+
2287
2354
  const FormStep = ({
2288
2355
  t,
2289
2356
  children,
@@ -2302,9 +2369,11 @@ const FormStep = ({
2302
2369
  showErrorBelowChildren: _showErrorBelowChildren = false,
2303
2370
  childrenAtTheBottom: _childrenAtTheBottom = true,
2304
2371
  textInputStyle,
2305
- className
2372
+ className,
2373
+ isCollapsible: _isCollapsible2 = true,
2374
+ defaultOpen: _defaultOpen2 = true
2306
2375
  }) => {
2307
- var _config$inputs;
2376
+ var _config$inputs, _config$texts;
2308
2377
  const {
2309
2378
  register,
2310
2379
  watch,
@@ -2380,14 +2449,35 @@ const FormStep = ({
2380
2449
  })));
2381
2450
  }
2382
2451
  });
2452
+ const _isCollapsible = config.isCollapsible !== undefined ? config.isCollapsible : _isCollapsible2;
2453
+ const _defaultOpen = config.defaultOpen !== undefined ? config.defaultOpen : _defaultOpen2;
2383
2454
  return /*#__PURE__*/React.createElement("form", {
2384
2455
  style: {
2385
2456
  flex: "1"
2386
2457
  },
2387
2458
  onSubmit: handleSubmit(goNext)
2459
+ }, _isCollapsible ? /*#__PURE__*/React.createElement(CollapsibleCardPage, {
2460
+ title: t(config === null || config === void 0 ? void 0 : (_config$texts = config.texts) === null || _config$texts === void 0 ? void 0 : _config$texts.header),
2461
+ defaultOpen: _defaultOpen
2388
2462
  }, /*#__PURE__*/React.createElement(InputCard, Object.assign({}, {
2389
2463
  isDisable: isDisable,
2390
2464
  isMultipleAllow: _isMultipleAllow
2465
+ }, config, {
2466
+ texts: {
2467
+ ...config.texts,
2468
+ header: null
2469
+ },
2470
+ cardStyle: _cardStyle,
2471
+ submit: true
2472
+ }, {
2473
+ onSkip: onSkip,
2474
+ onAdd: onAdd
2475
+ }, {
2476
+ t: t,
2477
+ className: className || ""
2478
+ }), !_childrenAtTheBottom && children, inputs, forcedError && !_showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)), _childrenAtTheBottom && children, forcedError && _showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)))) : /*#__PURE__*/React.createElement(InputCard, Object.assign({}, {
2479
+ isDisable: isDisable,
2480
+ isMultipleAllow: _isMultipleAllow
2391
2481
  }, config, {
2392
2482
  cardStyle: _cardStyle,
2393
2483
  submit: true
@@ -14279,10 +14369,10 @@ const ApplicationDetails$1 = props => {
14279
14369
  setShowToast(null);
14280
14370
  };
14281
14371
  const handleViewTimeline = () => {
14282
- const timelineSection = document.getElementById('timeline');
14372
+ const timelineSection = document.getElementById("timeline");
14283
14373
  if (timelineSection) {
14284
14374
  timelineSection.scrollIntoView({
14285
- behavior: 'smooth'
14375
+ behavior: "smooth"
14286
14376
  });
14287
14377
  }
14288
14378
  setViewTimeline(true);