@popsure/dirty-swan 0.59.1 → 0.60.1

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.
Files changed (33) hide show
  1. package/dist/cjs/index.js +14 -17
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/badge/index.d.ts +4 -3
  4. package/dist/cjs/lib/components/badge/index.stories.d.ts +8 -2
  5. package/dist/cjs/lib/components/table/Table.d.ts +2 -1
  6. package/dist/cjs/lib/components/table/Table.stories.d.ts +2 -2
  7. package/dist/cjs/lib/components/table/utils/useTableNavigation/useTableNavigation.d.ts +1 -0
  8. package/dist/esm/components/badge/index.js +7 -16
  9. package/dist/esm/components/badge/index.js.map +1 -1
  10. package/dist/esm/components/badge/index.stories.js +25 -4
  11. package/dist/esm/components/badge/index.stories.js.map +1 -1
  12. package/dist/esm/components/table/Table.js +9 -4
  13. package/dist/esm/components/table/Table.js.map +1 -1
  14. package/dist/esm/components/table/Table.stories.js +3 -3
  15. package/dist/esm/components/table/Table.stories.js.map +1 -1
  16. package/dist/esm/components/table/Table.test.js +1 -1
  17. package/dist/esm/components/table/utils/useTableNavigation/useTableNavigation.test.js +1 -1
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/lib/components/badge/index.d.ts +4 -3
  20. package/dist/esm/lib/components/badge/index.stories.d.ts +8 -2
  21. package/dist/esm/lib/components/table/Table.d.ts +2 -1
  22. package/dist/esm/lib/components/table/Table.stories.d.ts +2 -2
  23. package/dist/esm/lib/components/table/utils/useTableNavigation/useTableNavigation.d.ts +1 -0
  24. package/dist/esm/{useTableNavigation-f929fbc9.js → useTableNavigation-17d5cd3c.js} +2 -1
  25. package/dist/esm/useTableNavigation-17d5cd3c.js.map +1 -0
  26. package/package.json +1 -1
  27. package/src/lib/components/badge/index.stories.tsx +65 -0
  28. package/src/lib/components/badge/index.tsx +30 -26
  29. package/src/lib/components/badge/style.module.scss +118 -6
  30. package/src/lib/components/table/Table.stories.tsx +2 -0
  31. package/src/lib/components/table/Table.tsx +10 -2
  32. package/src/lib/components/table/utils/useTableNavigation/useTableNavigation.ts +2 -0
  33. package/dist/esm/useTableNavigation-f929fbc9.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -8649,24 +8649,15 @@ var CurrencyInput = function (_a) {
8649
8649
  } }, props)));
8650
8650
  };
8651
8651
 
8652
- var css_248z$A = ".style-module_badge--small__cHO6v, .style-module_badge--medium__3CekE {\n padding-bottom: 6px;\n padding-top: 6px;\n}\n.style-module_badge--large__3_tWC {\n padding-bottom: 8px;\n padding-top: 8px;\n}";
8653
- var styles$z = {"badge--small":"style-module_badge--small__cHO6v","badge--medium":"style-module_badge--medium__3CekE","badge--large":"style-module_badge--large__3_tWC"};
8652
+ var css_248z$A = ".style-module_badge__7H1Jt {\n border: 1px solid #fff;\n position: relative;\n gap: 6px;\n}\n.style-module_badge--xsmall__2lIav {\n padding: 4px 10px;\n}\n.style-module_badge--small__cHO6v {\n padding: 6px 12px;\n}\n.style-module_badge--medium__3CekE {\n padding: 6px 16px;\n}\n.style-module_badge--large__3_tWC {\n gap: 8px;\n padding: 8px 16px;\n}\n.style-module_badge--white__QtwA_ {\n background-color: #fff;\n border-color: #f7f7fd;\n}\n.style-module_badge--neutral__7yAYx {\n background-color: #f7f7fd;\n border-color: #f2f2f8;\n}\n.style-module_badge--neutralStrong__1JHph {\n background-color: #e7e7ed;\n border-color: #e7e7ed;\n}\n.style-module_badge--information__1tegJ {\n background-color: #E5F0FF;\n border-color: #DAE8FC;\n}\n.style-module_badge--warning__2UCOz, .style-module_badge--primary__1JGTF {\n background-color: #FEECD3;\n border-color: #FCDAAB;\n}\n.style-module_badge--error__1g5DA {\n background-color: #FEE6E6;\n border-color: #FED7D7;\n}\n.style-module_badge--success__YJJ9N {\n background-color: #E6FAF1;\n border-color: #D5F6E7;\n}\n.style-module_badge--black__sdqec {\n background-color: #26262e;\n border-color: #26262e;\n color: #fff;\n}\n.style-module_badge--secondary__1kblP {\n background-color: #EEEEFE;\n border-color: #E8E7FE;\n}\n.style-module_badge--secondaryStrong__33FDy {\n background-color: #8883D8;\n border-color: #8883D8;\n color: #fff;\n}\n\n.style-module_badgeDot__N2_h5 {\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n}\n.style-module_badgeDot--primary__q-_rt, .style-module_badgeDot--warning__1xu_H {\n background-color: #C6824E;\n}\n.style-module_badgeDot--white__2Zi0j {\n background-color: #b8b8c0;\n}\n.style-module_badgeDot--neutral__3Y6Z9 {\n background-color: #919199;\n}\n.style-module_badgeDot--neutralStrong__3KzHS {\n background-color: #696971;\n}\n.style-module_badgeDot--information__1t-rb {\n background-color: #5F7BA0;\n}\n.style-module_badgeDot--error__3Lh5R {\n background-color: #C64848;\n}\n.style-module_badgeDot--success__7tHPA {\n background-color: #599278;\n}\n.style-module_badgeDot--black__2YWa7 {\n background-color: #fff;\n}\n.style-module_badgeDot--secondary__RU2iJ {\n background-color: #6A65AE;\n}\n.style-module_badgeDot--secondaryStrong__3AN6H {\n background-color: #fff;\n}";
8653
+ var styles$z = {"badge":"style-module_badge__7H1Jt","badge--xsmall":"style-module_badge--xsmall__2lIav","badge--small":"style-module_badge--small__cHO6v","badge--medium":"style-module_badge--medium__3CekE","badge--large":"style-module_badge--large__3_tWC","badge--white":"style-module_badge--white__QtwA_","badge--neutral":"style-module_badge--neutral__7yAYx","badge--neutralStrong":"style-module_badge--neutralStrong__1JHph","badge--information":"style-module_badge--information__1tegJ","badge--warning":"style-module_badge--warning__2UCOz","badge--primary":"style-module_badge--primary__1JGTF","badge--error":"style-module_badge--error__1g5DA","badge--success":"style-module_badge--success__YJJ9N","badge--black":"style-module_badge--black__sdqec","badge--secondary":"style-module_badge--secondary__1kblP","badge--secondaryStrong":"style-module_badge--secondaryStrong__33FDy","badgeDot":"style-module_badgeDot__N2_h5","badgeDot--primary":"style-module_badgeDot--primary__q-_rt","badgeDot--warning":"style-module_badgeDot--warning__1xu_H","badgeDot--white":"style-module_badgeDot--white__2Zi0j","badgeDot--neutral":"style-module_badgeDot--neutral__3Y6Z9","badgeDot--neutralStrong":"style-module_badgeDot--neutralStrong__3KzHS","badgeDot--information":"style-module_badgeDot--information__1t-rb","badgeDot--error":"style-module_badgeDot--error__3Lh5R","badgeDot--success":"style-module_badgeDot--success__7tHPA","badgeDot--black":"style-module_badgeDot--black__2YWa7","badgeDot--secondary":"style-module_badgeDot--secondary__RU2iJ","badgeDot--secondaryStrong":"style-module_badgeDot--secondaryStrong__3AN6H"};
8654
8654
  styleInject(css_248z$A);
8655
8655
 
8656
- var getVariantClassNames = function (variant) { return ({
8657
- information: 'bg-blue-100',
8658
- neutral: 'bg-white',
8659
- neutral200: 'bg-neutral-100',
8660
- neutral300: 'bg-neutral-300',
8661
- warning: 'bg-yellow-200',
8662
- error: 'bg-red-100',
8663
- success: 'bg-green-100',
8664
- primary: 'bg-purple-300',
8665
- primary900: 'bg-purple-900 tc-white',
8666
- }[variant]); };
8667
8656
  var Badge = function (_a) {
8668
- var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.variant, variant = _d === void 0 ? 'information' : _d, children = _a.children;
8669
- return (jsxRuntime.jsx("div", { role: "status", className: classNames$1(className, 'px16 br8 d-inline-block ai-center fw-bold p-p', { 'p-p--small': size === 'small' }, styles$z["badge--".concat(size)], getVariantClassNames(variant)), children: children }));
8657
+ var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.variant, variant = _d === void 0 ? 'information' : _d, children = _a.children, _e = _a.showDot, showDot = _e === void 0 ? false : _e;
8658
+ return (jsxRuntime.jsxs("div", { role: "status", className: classNames$1(className, 'br8 d-inline-flex ai-center fw-bold p-p', styles$z.badge, styles$z["badge--".concat(size)], styles$z["badge--".concat(variant)], {
8659
+ 'p-p--small': size === 'small' || size === 'xsmall',
8660
+ }), children: [showDot && (jsxRuntime.jsx("span", { className: classNames$1(styles$z.badgeDot, styles$z["badgeDot--".concat(variant)]) })), children] }));
8670
8661
  };
8671
8662
 
8672
8663
  var css_248z$z = ".styles-module_container__3zJJC {\n max-width: 100%;\n}\n\n.styles-module_narrow__2p34b {\n max-width: 424px;\n}";
@@ -16579,6 +16570,7 @@ var useTableNavigation = function (_a) {
16579
16570
  return {
16580
16571
  activeSection: activeSection + 1,
16581
16572
  navigateTable: handleScrollToSection,
16573
+ setActiveSection: setActiveSection,
16582
16574
  };
16583
16575
  };
16584
16576
 
@@ -16626,7 +16618,7 @@ var defaultTextOverrides = {
16626
16618
  };
16627
16619
  var Table = function (_a) {
16628
16620
  var _b, _c, _d, _e, _f, _g, _h, _j;
16629
- var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _k = _a.hideColumns, hideColumns = _k === void 0 ? [] : _k, hideDetails = _a.hideDetails, _l = _a.hideRows, hideRows = _l === void 0 ? [] : _l, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, _m = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _m === void 0 ? 0 : _m, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title;
16621
+ var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _k = _a.hideColumns, hideColumns = _k === void 0 ? [] : _k, hideDetails = _a.hideDetails, _l = _a.hideRows, hideRows = _l === void 0 ? [] : _l, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, _m = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _m === void 0 ? 0 : _m, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title, externalActiveSection = _a.activeSection;
16630
16622
  var textOverrides = __assign(__assign({}, defaultTextOverrides), definedTextOverrides);
16631
16623
  var isMobile = useMediaQuery('BELOW_MOBILE');
16632
16624
  var _o = React.useState(null), infoModalData = _o[0], setInfoModalData = _o[1];
@@ -16639,7 +16631,7 @@ var Table = function (_a) {
16639
16631
  enabled: isMobile,
16640
16632
  containerRef: containerRef,
16641
16633
  onSelectionChanged: onSelectionChanged,
16642
- }), activeSection = _q.activeSection, navigateTable = _q.navigateTable;
16634
+ }), activeSection = _q.activeSection, navigateTable = _q.navigateTable, setActiveSection = _q.setActiveSection;
16643
16635
  var titleCell = __assign({ text: '' }, ((_d = (_c = (_b = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _b === void 0 ? void 0 : _b.rows) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d[0]) || {});
16644
16636
  var currentActiveSection = (_g = (_f = (_e = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _e === void 0 ? void 0 : _e.rows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g[activeSection];
16645
16637
  var currentActiveSectionReplacements = (currentActiveSection.cellId &&
@@ -16651,6 +16643,11 @@ var Table = function (_a) {
16651
16643
  onModalOpen === null || onModalOpen === void 0 ? void 0 : onModalOpen({ body: body, title: title });
16652
16644
  setInfoModalData({ body: body, title: title });
16653
16645
  }, []);
16646
+ React.useEffect(function () {
16647
+ if (externalActiveSection && externalActiveSection !== activeSection) {
16648
+ setActiveSection(externalActiveSection - 1);
16649
+ }
16650
+ }, [externalActiveSection]);
16654
16651
  return (jsxRuntime.jsxs("div", { className: classNames$1(styles$5.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(titleCell === null || titleCell === void 0 ? void 0 : titleCell.text) && (jsxRuntime.jsx(TableCell, __assign({}, titleCell, { align: 'left', isNavigation: true, isTopLeftCell: true, type: undefined }))), jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, (isBaseCell(currentActiveSection)
16655
16652
  ? {
16656
16653
  openModal: function (body) {