@djb25/digit-ui-module-fsm 1.0.9 → 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.
@@ -2286,6 +2286,71 @@ InputCard.defaultProps = {
2286
2286
  t: value => value
2287
2287
  };
2288
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
+
2289
2354
  const FormStep = ({
2290
2355
  t,
2291
2356
  children,
@@ -2304,9 +2369,11 @@ const FormStep = ({
2304
2369
  showErrorBelowChildren: _showErrorBelowChildren = false,
2305
2370
  childrenAtTheBottom: _childrenAtTheBottom = true,
2306
2371
  textInputStyle,
2307
- className
2372
+ className,
2373
+ isCollapsible: _isCollapsible2 = true,
2374
+ defaultOpen: _defaultOpen2 = true
2308
2375
  }) => {
2309
- var _config$inputs;
2376
+ var _config$inputs, _config$texts;
2310
2377
  const {
2311
2378
  register,
2312
2379
  watch,
@@ -2382,14 +2449,35 @@ const FormStep = ({
2382
2449
  })));
2383
2450
  }
2384
2451
  });
2452
+ const _isCollapsible = config.isCollapsible !== undefined ? config.isCollapsible : _isCollapsible2;
2453
+ const _defaultOpen = config.defaultOpen !== undefined ? config.defaultOpen : _defaultOpen2;
2385
2454
  return /*#__PURE__*/React.createElement("form", {
2386
2455
  style: {
2387
2456
  flex: "1"
2388
2457
  },
2389
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
2390
2462
  }, /*#__PURE__*/React.createElement(InputCard, Object.assign({}, {
2391
2463
  isDisable: isDisable,
2392
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
2393
2481
  }, config, {
2394
2482
  cardStyle: _cardStyle,
2395
2483
  submit: true
@@ -14281,10 +14369,10 @@ const ApplicationDetails$1 = props => {
14281
14369
  setShowToast(null);
14282
14370
  };
14283
14371
  const handleViewTimeline = () => {
14284
- const timelineSection = document.getElementById('timeline');
14372
+ const timelineSection = document.getElementById("timeline");
14285
14373
  if (timelineSection) {
14286
14374
  timelineSection.scrollIntoView({
14287
- behavior: 'smooth'
14375
+ behavior: "smooth"
14288
14376
  });
14289
14377
  }
14290
14378
  setViewTimeline(true);