@stokr/components-library 2.3.65-beta.1 → 2.3.65-beta.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.
Files changed (49) hide show
  1. package/dist/components/2FA/main-flow.js +28 -7
  2. package/dist/components/2FA/main-flow.stories.js +144 -15
  3. package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
  4. package/dist/components/AdminDashboard/Table/ReactTable.stories.js +509 -2
  5. package/dist/components/Chips/Chip.js +1 -2
  6. package/dist/components/Icon/Icon.stories.js +108 -0
  7. package/dist/components/Input/Input.js +33 -33
  8. package/dist/components/Input/Input.stories.js +83 -8
  9. package/dist/components/Input/MultiSelect.js +319 -0
  10. package/dist/components/Input/MultiSelect.stories.js +264 -0
  11. package/dist/components/Input/SearchInput.js +78 -0
  12. package/dist/components/Input/SearchInput.stories.js +366 -0
  13. package/dist/components/Input/SearchInput.styles.js +25 -0
  14. package/dist/components/Input/Select.js +51 -28
  15. package/dist/components/Input/Select.stories.js +345 -6
  16. package/dist/components/Modal/SideModal.js +82 -0
  17. package/dist/components/Modal/SideModal.stories.js +342 -0
  18. package/dist/components/Modal/SideModal.styles.js +21 -0
  19. package/dist/components/Payment/PaymentDetailsCard.js +189 -0
  20. package/dist/components/Payment/PaymentDetailsCard.stories.js +198 -0
  21. package/dist/components/Payment/PaymentDisplay.js +2 -12
  22. package/dist/components/ProfileBox/ProfileBox.js +2 -1
  23. package/dist/components/Snackbar/Snackbar.js +193 -0
  24. package/dist/components/Snackbar/Snackbar.stories.js +292 -0
  25. package/dist/components/Snackbar/Snackbar.styles.js +97 -0
  26. package/dist/components/Snackbar/SnackbarProvider.js +81 -0
  27. package/dist/components/Snackbar/index.js +32 -0
  28. package/dist/components/Snackbar/useSnackbar.js +43 -0
  29. package/dist/components/StatusTag/StatusTag.js +175 -0
  30. package/dist/components/StatusTag/StatusTag.stories.js +262 -0
  31. package/dist/components/StatusTag/StatusTag.styles.js +37 -0
  32. package/dist/components/StepsProgress/StepIndicator.js +59 -0
  33. package/dist/components/StepsProgress/StepIndicator.stories.js +153 -0
  34. package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
  35. package/dist/components/TextLink/TextLink.stories.js +35 -0
  36. package/dist/components/TextLink/TextLink.styles.js +1 -1
  37. package/dist/components/Timeline/TimelineStep.js +2 -2
  38. package/dist/components/logo/Logo.stories.js +260 -0
  39. package/dist/constants/globalVariables.js +41 -2
  40. package/dist/context/Checkbox/CheckboxContext.js +0 -1
  41. package/dist/index.js +66 -0
  42. package/dist/static/images/bmn2-logo.svg +9 -0
  43. package/dist/static/images/document-icon.svg +3 -0
  44. package/dist/static/images/plus-icon.svg +4 -0
  45. package/dist/static/images/search-icon.svg +3 -0
  46. package/dist/static/images/sent-icon.svg +10 -0
  47. package/dist/static/images/transfer-icon.svg +10 -0
  48. package/dist/utils/formatCurrencyValue.js +43 -3
  49. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithStatusBasedHover = exports.WithRowSpecificHover = exports.WithRowHover = exports.WithHoverStylesAndContent = exports.WithHoverContent = exports.WithFixedColumnWidths = exports.WithCustomStyling = exports.DefaultWrapper = exports.Default = exports.CustomStyledTable = exports.BoxStyleTable = exports.BlueWrapper = exports.BlueTable = void 0;
6
+ exports.default = exports.WrapperWithSubTable = exports.WithoutPagination = exports.WithSubTable = exports.WithStatusBasedHover = exports.WithRowSpecificHover = exports.WithRowHover = exports.WithRowClick = exports.WithHoverStylesAndContent = exports.WithHoverContent = exports.WithFixedColumnWidths = exports.WithCustomStyling = exports.SortableHeaders = exports.RowClickWithExpandedContent = exports.RowClickWithButtons = exports.PerColumnHeaderClick = exports.HeaderClick = exports.FilterableHeaders = exports.ExpandedWithRichContent = exports.DefaultWrapper = exports.Default = exports.CustomStyledTable = exports.CustomExpandedContent = exports.BoxStyleTable = exports.BlueWrapper = exports.BlueTable = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _ReactTable = require("./ReactTable");
9
9
  var _ReactTableWrapper = require("./ReactTableWrapper");
@@ -403,4 +403,511 @@ CustomStyledTable.args = _objectSpread(_objectSpread({}, Default.args), {}, {
403
403
  textTransform: 'uppercase',
404
404
  letterSpacing: '0.5px'
405
405
  })
406
- });
406
+ });
407
+
408
+ // ============================================
409
+ // NEW FEATURE STORIES: onRowClick & renderExpandedContent
410
+ // ============================================
411
+
412
+ // Row Click Handler - Basic
413
+ const WithRowClick = exports.WithRowClick = Template.bind({});
414
+ WithRowClick.args = _objectSpread(_objectSpread({}, Default.args), {}, {
415
+ onRowClick: (rowData, rowIndex, event) => {
416
+ alert("Clicked row ".concat(rowIndex + 1, ": ").concat(rowData.name, " (").concat(rowData.status, ")"));
417
+ }
418
+ });
419
+ WithRowClick.parameters = {
420
+ docs: {
421
+ description: {
422
+ story: 'Click anywhere on a row to trigger an action. Buttons and links inside cells will NOT trigger the row click.'
423
+ }
424
+ }
425
+ };
426
+
427
+ // Row Click with Buttons Inside - Demonstrates click isolation
428
+ const columnsWithActions = [...columns.slice(0, 3), {
429
+ Header: 'Actions',
430
+ accessor: 'actions',
431
+ width: '40%',
432
+ Cell: _ref => {
433
+ let {
434
+ row
435
+ } = _ref;
436
+ return /*#__PURE__*/_react.default.createElement("div", {
437
+ style: {
438
+ display: 'flex',
439
+ gap: '8px'
440
+ }
441
+ }, /*#__PURE__*/_react.default.createElement("button", {
442
+ style: {
443
+ padding: '6px 12px',
444
+ backgroundColor: '#0050ca',
445
+ color: 'white',
446
+ border: 'none',
447
+ borderRadius: '4px',
448
+ cursor: 'pointer'
449
+ },
450
+ onClick: () => alert("Edit button clicked for ".concat(row.original.name))
451
+ }, "Edit"), /*#__PURE__*/_react.default.createElement("button", {
452
+ style: {
453
+ padding: '6px 12px',
454
+ backgroundColor: '#dc3545',
455
+ color: 'white',
456
+ border: 'none',
457
+ borderRadius: '4px',
458
+ cursor: 'pointer'
459
+ },
460
+ onClick: () => alert("Delete button clicked for ".concat(row.original.name))
461
+ }, "Delete"));
462
+ }
463
+ }];
464
+ const RowClickWithButtons = exports.RowClickWithButtons = Template.bind({});
465
+ RowClickWithButtons.args = {
466
+ columns: columnsWithActions,
467
+ data: data,
468
+ noPagination: false,
469
+ onRowClick: (rowData, rowIndex) => {
470
+ alert("Row clicked: ".concat(rowData.name));
471
+ }
472
+ };
473
+ RowClickWithButtons.parameters = {
474
+ docs: {
475
+ description: {
476
+ story: 'Demonstrates that clicking buttons inside cells does NOT trigger onRowClick. Only clicking on non-interactive areas triggers the row click.'
477
+ }
478
+ }
479
+ };
480
+
481
+ // Custom Expanded Content - Simple
482
+ const CustomExpandedContent = exports.CustomExpandedContent = Template.bind({});
483
+ CustomExpandedContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
484
+ renderExpandedContent: (row, toggleExpanded) => {
485
+ var _row$original$subData;
486
+ return /*#__PURE__*/_react.default.createElement("div", {
487
+ style: {
488
+ padding: '20px',
489
+ backgroundColor: '#f8f9fa',
490
+ borderRadius: '8px'
491
+ }
492
+ }, /*#__PURE__*/_react.default.createElement("h4", {
493
+ style: {
494
+ margin: '0 0 12px 0'
495
+ }
496
+ }, "Details for ", row.original.name), /*#__PURE__*/_react.default.createElement("p", {
497
+ style: {
498
+ margin: '0 0 8px 0'
499
+ }
500
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "ID:"), " ", row.original.id), /*#__PURE__*/_react.default.createElement("p", {
501
+ style: {
502
+ margin: '0 0 8px 0'
503
+ }
504
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Status:"), " ", row.original.status), /*#__PURE__*/_react.default.createElement("p", {
505
+ style: {
506
+ margin: '0 0 16px 0'
507
+ }
508
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Sub-items:"), " ", ((_row$original$subData = row.original.subData) === null || _row$original$subData === void 0 ? void 0 : _row$original$subData.length) || 0), /*#__PURE__*/_react.default.createElement("button", {
509
+ style: {
510
+ padding: '8px 16px',
511
+ backgroundColor: '#6c757d',
512
+ color: 'white',
513
+ border: 'none',
514
+ borderRadius: '4px',
515
+ cursor: 'pointer'
516
+ },
517
+ onClick: () => toggleExpanded()
518
+ }, "Collapse"));
519
+ }
520
+ });
521
+ CustomExpandedContent.parameters = {
522
+ docs: {
523
+ description: {
524
+ story: 'Click on a row to expand and show custom content instead of a sub-table. The toggleExpanded function allows you to collapse the row programmatically.'
525
+ }
526
+ }
527
+ };
528
+
529
+ // Custom Expanded Content - Rich Component
530
+ const ExpandedWithRichContent = exports.ExpandedWithRichContent = Template.bind({});
531
+ ExpandedWithRichContent.args = _objectSpread(_objectSpread({}, Default.args), {}, {
532
+ renderExpandedContent: row => {
533
+ var _row$original$subData2;
534
+ return /*#__PURE__*/_react.default.createElement("div", {
535
+ style: {
536
+ padding: '24px'
537
+ }
538
+ }, /*#__PURE__*/_react.default.createElement("div", {
539
+ style: {
540
+ display: 'grid',
541
+ gridTemplateColumns: '1fr 1fr',
542
+ gap: '24px'
543
+ }
544
+ }, /*#__PURE__*/_react.default.createElement("div", {
545
+ style: {
546
+ padding: '16px',
547
+ backgroundColor: '#fff',
548
+ border: '1px solid #e1e1e1',
549
+ borderRadius: '8px'
550
+ }
551
+ }, /*#__PURE__*/_react.default.createElement("h4", {
552
+ style: {
553
+ margin: '0 0 16px 0',
554
+ color: '#0050ca'
555
+ }
556
+ }, "User Information"), /*#__PURE__*/_react.default.createElement("div", {
557
+ style: {
558
+ display: 'flex',
559
+ flexDirection: 'column',
560
+ gap: '8px'
561
+ }
562
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("strong", null, "Name:"), " ", row.original.name), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("strong", null, "ID:"), " #", row.original.id), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("strong", null, "Status:"), ' ', /*#__PURE__*/_react.default.createElement("span", {
563
+ style: {
564
+ padding: '2px 8px',
565
+ borderRadius: '12px',
566
+ backgroundColor: row.original.status === 'Active' ? '#d4edda' : row.original.status === 'Inactive' ? '#f8d7da' : '#fff3cd',
567
+ color: row.original.status === 'Active' ? '#155724' : row.original.status === 'Inactive' ? '#721c24' : '#856404',
568
+ fontSize: '12px'
569
+ }
570
+ }, row.original.status)))), /*#__PURE__*/_react.default.createElement("div", {
571
+ style: {
572
+ padding: '16px',
573
+ backgroundColor: '#fff',
574
+ border: '1px solid #e1e1e1',
575
+ borderRadius: '8px'
576
+ }
577
+ }, /*#__PURE__*/_react.default.createElement("h4", {
578
+ style: {
579
+ margin: '0 0 16px 0',
580
+ color: '#0050ca'
581
+ }
582
+ }, "Sub Items"), ((_row$original$subData2 = row.original.subData) === null || _row$original$subData2 === void 0 ? void 0 : _row$original$subData2.length) > 0 ? /*#__PURE__*/_react.default.createElement("ul", {
583
+ style: {
584
+ margin: 0,
585
+ paddingLeft: '20px'
586
+ }
587
+ }, row.original.subData.map(item => /*#__PURE__*/_react.default.createElement("li", {
588
+ key: item.detailId,
589
+ style: {
590
+ marginBottom: '8px'
591
+ }
592
+ }, item.detailName, " (ID: ", item.detailId, ")"))) : /*#__PURE__*/_react.default.createElement("p", {
593
+ style: {
594
+ margin: 0,
595
+ color: '#6c757d',
596
+ fontStyle: 'italic'
597
+ }
598
+ }, "No sub-items"))), /*#__PURE__*/_react.default.createElement("div", {
599
+ style: {
600
+ marginTop: '16px',
601
+ display: 'flex',
602
+ gap: '8px',
603
+ justifyContent: 'flex-end'
604
+ }
605
+ }, /*#__PURE__*/_react.default.createElement("button", {
606
+ style: {
607
+ padding: '8px 16px',
608
+ backgroundColor: '#0050ca',
609
+ color: 'white',
610
+ border: 'none',
611
+ borderRadius: '4px',
612
+ cursor: 'pointer'
613
+ },
614
+ onClick: () => alert("Edit ".concat(row.original.name))
615
+ }, "Edit User"), /*#__PURE__*/_react.default.createElement("button", {
616
+ style: {
617
+ padding: '8px 16px',
618
+ backgroundColor: 'transparent',
619
+ color: '#0050ca',
620
+ border: '1px solid #0050ca',
621
+ borderRadius: '4px',
622
+ cursor: 'pointer'
623
+ },
624
+ onClick: () => alert("View full profile for ".concat(row.original.name))
625
+ }, "View Profile")));
626
+ }
627
+ });
628
+ ExpandedWithRichContent.parameters = {
629
+ docs: {
630
+ description: {
631
+ story: 'A more complex example showing a rich expanded content with multiple panels, styled badges, and action buttons.'
632
+ }
633
+ }
634
+ };
635
+
636
+ // Combined: Row Click + Custom Expanded Content
637
+ const RowClickWithExpandedContent = exports.RowClickWithExpandedContent = Template.bind({});
638
+ RowClickWithExpandedContent.args = {
639
+ columns: columnsWithActions,
640
+ data: data,
641
+ noPagination: false,
642
+ onRowClick: (rowData, rowIndex) => {
643
+ console.log('Row clicked (but not triggering anything in this demo)');
644
+ },
645
+ renderExpandedContent: (row, toggleExpanded) => /*#__PURE__*/_react.default.createElement("div", {
646
+ style: {
647
+ padding: '20px',
648
+ backgroundColor: '#e3f2fd',
649
+ borderLeft: '4px solid #0050ca'
650
+ }
651
+ }, /*#__PURE__*/_react.default.createElement("p", {
652
+ style: {
653
+ margin: '0 0 12px 0'
654
+ }
655
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Expanded details for:"), " ", row.original.name), /*#__PURE__*/_react.default.createElement("p", {
656
+ style: {
657
+ margin: 0,
658
+ color: '#666'
659
+ }
660
+ }, "Click anywhere on the row to expand/collapse. Buttons work independently."))
661
+ };
662
+ RowClickWithExpandedContent.parameters = {
663
+ docs: {
664
+ description: {
665
+ story: 'Combined example: rows are clickable AND expandable. The onRowClick and renderExpandedContent work together. Buttons inside cells remain independent.'
666
+ }
667
+ }
668
+ };
669
+
670
+ // ============================================
671
+ // HEADER CLICK STORIES: onHeaderClick & renderHeaderContent
672
+ // ============================================
673
+
674
+ // Basic Header Click - shows alert
675
+ const HeaderClick = exports.HeaderClick = Template.bind({});
676
+ HeaderClick.args = _objectSpread(_objectSpread({}, Default.args), {}, {
677
+ onHeaderClick: (column, event) => {
678
+ alert("Header clicked: ".concat(column.id || column.Header));
679
+ }
680
+ });
681
+ HeaderClick.parameters = {
682
+ docs: {
683
+ description: {
684
+ story: 'Click on any column header to trigger an action. Useful for implementing custom sorting or filtering.'
685
+ }
686
+ }
687
+ };
688
+
689
+ // Header Click with Sort State (External Control)
690
+ const SortableTableDemo = () => {
691
+ const [sortConfig, setSortConfig] = _react.default.useState({
692
+ key: null,
693
+ direction: 'asc'
694
+ });
695
+ const [tableData, setTableData] = _react.default.useState(data);
696
+ const handleHeaderClick = column => {
697
+ // Skip non-sortable columns (like actions)
698
+ if (column.id === 'dropdown' || column.id === 'actions') return;
699
+ let direction = 'asc';
700
+ if (sortConfig.key === column.id && sortConfig.direction === 'asc') {
701
+ direction = 'desc';
702
+ }
703
+ setSortConfig({
704
+ key: column.id,
705
+ direction
706
+ });
707
+
708
+ // Sort the data
709
+ const sorted = [...data].sort((a, b) => {
710
+ const aVal = a[column.id];
711
+ const bVal = b[column.id];
712
+ if (aVal < bVal) return direction === 'asc' ? -1 : 1;
713
+ if (aVal > bVal) return direction === 'asc' ? 1 : -1;
714
+ return 0;
715
+ });
716
+ setTableData(sorted);
717
+ };
718
+
719
+ // Add sort indicators to headers
720
+ const renderHeaderContent = (column, defaultContent) => {
721
+ // Skip non-sortable columns
722
+ if (column.id === 'dropdown' || column.id === 'actions') {
723
+ return defaultContent;
724
+ }
725
+ const isSorted = sortConfig.key === column.id;
726
+ const arrow = isSorted ? sortConfig.direction === 'asc' ? ' ↑' : ' ↓' : '';
727
+ return /*#__PURE__*/_react.default.createElement("span", {
728
+ style: {
729
+ display: 'flex',
730
+ alignItems: 'center',
731
+ gap: '4px'
732
+ }
733
+ }, defaultContent, /*#__PURE__*/_react.default.createElement("span", {
734
+ style: {
735
+ opacity: isSorted ? 1 : 0.3
736
+ }
737
+ }, isSorted ? arrow : ' ↕'));
738
+ };
739
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement("div", {
740
+ style: {
741
+ marginBottom: '16px'
742
+ }
743
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Current sort:"), ' ', sortConfig.key ? "".concat(sortConfig.key, " (").concat(sortConfig.direction, ")") : 'None'), /*#__PURE__*/_react.default.createElement(_ReactTable.ReactTable, {
744
+ columns: columns,
745
+ data: tableData,
746
+ noPagination: false,
747
+ onHeaderClick: handleHeaderClick,
748
+ renderHeaderContent: renderHeaderContent
749
+ }));
750
+ };
751
+ const SortableHeaders = exports.SortableHeaders = {
752
+ render: () => /*#__PURE__*/_react.default.createElement(SortableTableDemo, null),
753
+ parameters: {
754
+ docs: {
755
+ description: {
756
+ story: 'External sorting controlled by parent component. Click headers to sort. Uses onHeaderClick for the action and renderHeaderContent for the sort indicators.'
757
+ }
758
+ }
759
+ }
760
+ };
761
+
762
+ // Header with Custom Dropdown Filter
763
+ const FilterableTableDemo = () => {
764
+ const [filters, setFilters] = _react.default.useState({});
765
+ const [activeDropdown, setActiveDropdown] = _react.default.useState(null);
766
+ const [tableData, setTableData] = _react.default.useState(data);
767
+
768
+ // Get unique values for a column
769
+ const getUniqueValues = columnId => {
770
+ return [...new Set(data.map(row => row[columnId]))];
771
+ };
772
+ const handleFilter = (columnId, value) => {
773
+ const newFilters = _objectSpread({}, filters);
774
+ if (value === 'all') {
775
+ delete newFilters[columnId];
776
+ } else {
777
+ newFilters[columnId] = value;
778
+ }
779
+ setFilters(newFilters);
780
+ setActiveDropdown(null);
781
+
782
+ // Apply filters
783
+ let filtered = [...data];
784
+ Object.keys(newFilters).forEach(key => {
785
+ filtered = filtered.filter(row => row[key] === newFilters[key]);
786
+ });
787
+ setTableData(filtered);
788
+ };
789
+
790
+ // Custom header with filter dropdown
791
+ const renderHeaderContent = (column, defaultContent) => {
792
+ // Only add filter to specific columns
793
+ if (!['status'].includes(column.id)) {
794
+ return defaultContent;
795
+ }
796
+ const isActive = activeDropdown === column.id;
797
+ const hasFilter = filters[column.id];
798
+ return /*#__PURE__*/_react.default.createElement("div", {
799
+ style: {
800
+ position: 'relative'
801
+ }
802
+ }, /*#__PURE__*/_react.default.createElement("span", {
803
+ style: {
804
+ display: 'flex',
805
+ alignItems: 'center',
806
+ gap: '8px'
807
+ },
808
+ "data-clickable": "true",
809
+ onClick: e => {
810
+ e.stopPropagation();
811
+ setActiveDropdown(isActive ? null : column.id);
812
+ }
813
+ }, defaultContent, /*#__PURE__*/_react.default.createElement("span", {
814
+ style: {
815
+ fontSize: '10px',
816
+ padding: '2px 6px',
817
+ borderRadius: '4px',
818
+ backgroundColor: hasFilter ? '#0050ca' : '#e1e1e1',
819
+ color: hasFilter ? 'white' : '#666'
820
+ }
821
+ }, hasFilter ? '✓' : '▼')), isActive && /*#__PURE__*/_react.default.createElement("div", {
822
+ style: {
823
+ position: 'absolute',
824
+ top: '100%',
825
+ left: 0,
826
+ marginTop: '4px',
827
+ backgroundColor: 'white',
828
+ border: '1px solid #e1e1e1',
829
+ borderRadius: '4px',
830
+ boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
831
+ zIndex: 100,
832
+ minWidth: '120px'
833
+ }
834
+ }, /*#__PURE__*/_react.default.createElement("div", {
835
+ style: {
836
+ padding: '8px 12px',
837
+ cursor: 'pointer',
838
+ borderBottom: '1px solid #e1e1e1'
839
+ },
840
+ onClick: () => handleFilter(column.id, 'all')
841
+ }, "All"), getUniqueValues(column.id).map(value => /*#__PURE__*/_react.default.createElement("div", {
842
+ key: value,
843
+ style: {
844
+ padding: '8px 12px',
845
+ cursor: 'pointer',
846
+ backgroundColor: filters[column.id] === value ? '#f0f8ff' : 'transparent'
847
+ },
848
+ onClick: () => handleFilter(column.id, value)
849
+ }, value))));
850
+ };
851
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement("div", {
852
+ style: {
853
+ marginBottom: '16px'
854
+ }
855
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Active filters:"), ' ', Object.keys(filters).length > 0 ? Object.entries(filters).map(_ref2 => {
856
+ let [k, v] = _ref2;
857
+ return "".concat(k, ": ").concat(v);
858
+ }).join(', ') : 'None'), /*#__PURE__*/_react.default.createElement(_ReactTable.ReactTable, {
859
+ columns: columns,
860
+ data: tableData,
861
+ noPagination: false,
862
+ renderHeaderContent: renderHeaderContent
863
+ }));
864
+ };
865
+ const FilterableHeaders = exports.FilterableHeaders = {
866
+ render: () => /*#__PURE__*/_react.default.createElement(FilterableTableDemo, null),
867
+ parameters: {
868
+ docs: {
869
+ description: {
870
+ story: 'Custom filter dropdown in the "Status" header. Click the dropdown icon to filter. Uses renderHeaderContent to add the dropdown UI.'
871
+ }
872
+ }
873
+ }
874
+ };
875
+
876
+ // Per-Column Header Click Handler
877
+ const columnsWithColumnClick = [{
878
+ Header: 'ID (Click me!)',
879
+ accessor: 'id',
880
+ width: '15%',
881
+ onHeaderClick: column => {
882
+ alert('ID column has its own click handler!');
883
+ }
884
+ }, {
885
+ Header: 'Name',
886
+ accessor: 'name',
887
+ width: '30%'
888
+ }, {
889
+ Header: 'Status',
890
+ accessor: 'status',
891
+ width: '20%'
892
+ }, {
893
+ Header: 'Actions (No click)',
894
+ accessor: 'dropdown',
895
+ width: '35%'
896
+ // No onHeaderClick - won't trigger global onHeaderClick either
897
+ }];
898
+ const PerColumnHeaderClick = exports.PerColumnHeaderClick = Template.bind({});
899
+ PerColumnHeaderClick.args = {
900
+ columns: columnsWithColumnClick,
901
+ data: data,
902
+ noPagination: false,
903
+ onHeaderClick: column => {
904
+ alert("Global header click: ".concat(column.id));
905
+ }
906
+ };
907
+ PerColumnHeaderClick.parameters = {
908
+ docs: {
909
+ description: {
910
+ story: 'Columns can have their own onHeaderClick handlers. The "ID" column has a custom handler. Other columns use the global onHeaderClick. The "Actions" column has neither.'
911
+ }
912
+ }
913
+ };
@@ -28,10 +28,9 @@ const Chip = _ref => {
28
28
  }, props), /*#__PURE__*/_react.default.createElement(_ChipStyles.ChipText, null, children), tooltip && /*#__PURE__*/_react.default.createElement(_InfoIcon.default, _extends({
29
29
  title: tooltip,
30
30
  position: "top",
31
- noIcon: true,
32
31
  noMarginLeft: true,
33
32
  noMarginRight: true
34
- }, tooltipProps), /*#__PURE__*/_react.default.createElement(_ChipStyles.TooltipChipIcon, null)));
33
+ }, tooltipProps)));
35
34
  };
36
35
  exports.Chip = Chip;
37
36
  Chip.propTypes = {
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.AllSvgIcons = exports.AllIcons = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _Icon = require("./Icon.style");
9
+ var _global = _interopRequireDefault(require("../../styles/global"));
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _colors = _interopRequireDefault(require("../../styles/colors"));
12
+ var _transferIcon = require("../../static/images/transfer-icon.svg");
13
+ var _plusIcon = require("../../static/images/plus-icon.svg");
14
+ var _documentIcon = require("../../static/images/document-icon.svg");
15
+ var _sentIcon = require("../../static/images/sent-icon.svg");
16
+ var _searchIcon = require("../../static/images/search-icon.svg");
17
+ var _checkIcon = require("../../static/images/check-icon.svg");
18
+ var _crossIcon = require("../../static/images/cross-icon.svg");
19
+ var _copy_icon = require("../../static/images/copy_icon.svg");
20
+ var _usdcLogo = require("../../static/images/usdc-logo.svg");
21
+ var _warningFilled = require("../../static/images/warning-filled.svg");
22
+ var _download_icon = require("../../static/images/download_icon.svg");
23
+ var _profInv = require("../../static/images/prof-inv.svg");
24
+ var _upload = require("../../static/images/upload.svg");
25
+ var _refresh = require("../../static/images/refresh.svg");
26
+ var _logo = require("../../static/images/logo.svg");
27
+ var _earlyAdopter = require("../../static/images/early-adopter.svg");
28
+ var _eth = require("../../static/images/eth.svg");
29
+ var _eur = require("../../static/images/eur.svg");
30
+ var _faceScanIcon = require("../../static/images/face-scan-icon.svg");
31
+ var _adminBadge = require("../../static/images/admin-badge.svg");
32
+ var _arrowDownBlack = require("../../static/images/arrow-down-black.svg");
33
+ var _capsLock = require("../../static/images/caps-lock.svg");
34
+ var _Glassess = require("../../static/images/Glassess.svg");
35
+ var _VerifiedBadge = require("../../static/images/VerifiedBadge.svg");
36
+ var _playBtn = require("../../static/images/play-btn.svg");
37
+ var _mangopay = require("../../static/images/mangopay.svg");
38
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
39
+ // SVG Icons from static/images
40
+
41
+ // Map of all SVG icons for easy iteration
42
+ const svgIcons = {
43
+ 'transfer-icon': _transferIcon.ReactComponent,
44
+ 'plus-icon': _plusIcon.ReactComponent,
45
+ 'document-icon': _documentIcon.ReactComponent,
46
+ 'sent-icon': _sentIcon.ReactComponent,
47
+ 'search-icon': _searchIcon.ReactComponent,
48
+ 'check-icon': _checkIcon.ReactComponent,
49
+ 'cross-icon': _crossIcon.ReactComponent,
50
+ 'copy-icon': _copy_icon.ReactComponent,
51
+ 'usdc-logo': _usdcLogo.ReactComponent,
52
+ 'warning-filled': _warningFilled.ReactComponent,
53
+ 'download-icon': _download_icon.ReactComponent,
54
+ 'prof-inv': _profInv.ReactComponent,
55
+ upload: _upload.ReactComponent,
56
+ refresh: _refresh.ReactComponent,
57
+ logo: _logo.ReactComponent,
58
+ 'early-adopter': _earlyAdopter.ReactComponent,
59
+ eth: _eth.ReactComponent,
60
+ eur: _eur.ReactComponent,
61
+ 'face-scan-icon': _faceScanIcon.ReactComponent,
62
+ 'admin-badge': _adminBadge.ReactComponent,
63
+ 'arrow-down-black': _arrowDownBlack.ReactComponent,
64
+ 'caps-lock': _capsLock.ReactComponent,
65
+ glasses: _Glassess.ReactComponent,
66
+ 'verified-badge': _VerifiedBadge.ReactComponent,
67
+ 'play-btn': _playBtn.ReactComponent,
68
+ mangopay: _mangopay.ReactComponent
69
+ };
70
+ const IconsGrid = _styledComponents.default.div.withConfig({
71
+ displayName: "Iconstories__IconsGrid",
72
+ componentId: "sc-ue519l-0"
73
+ })(["display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:24px;padding:24px;"]);
74
+ const IconBox = _styledComponents.default.div.withConfig({
75
+ displayName: "Iconstories__IconBox",
76
+ componentId: "sc-ue519l-1"
77
+ })(["display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px;border:1px solid ", ";border-radius:4px;background:", ";&:hover{background:", ";}"], _colors.default.lightGrey, _colors.default.white, _colors.default.lightGrey);
78
+ const IconName = _styledComponents.default.span.withConfig({
79
+ displayName: "Iconstories__IconName",
80
+ componentId: "sc-ue519l-2"
81
+ })(["font-family:'Open Sans',sans-serif;font-size:11px;color:", ";text-align:center;word-break:break-word;"], _colors.default.grey2);
82
+ var _default = exports.default = {
83
+ title: 'Components Library/Icon',
84
+ component: _Icon.Icon,
85
+ decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(Story, null))]
86
+ };
87
+ const AllIcons = () => /*#__PURE__*/_react.default.createElement(IconsGrid, null, Object.entries(_Icon.iconsMap).map(_ref => {
88
+ let [name, iconCode] = _ref;
89
+ return /*#__PURE__*/_react.default.createElement(IconBox, {
90
+ key: name
91
+ }, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
92
+ icon: iconCode,
93
+ size: 24,
94
+ color: _colors.default.dark
95
+ }), /*#__PURE__*/_react.default.createElement(IconName, null, name));
96
+ }));
97
+ exports.AllIcons = AllIcons;
98
+ const SvgIconWrapper = _styledComponents.default.div.withConfig({
99
+ displayName: "Iconstories__SvgIconWrapper",
100
+ componentId: "sc-ue519l-3"
101
+ })(["width:32px;height:32px;display:flex;align-items:center;justify-content:center;svg{max-width:100%;max-height:100%;}"]);
102
+ const AllSvgIcons = () => /*#__PURE__*/_react.default.createElement(IconsGrid, null, Object.entries(svgIcons).map(_ref2 => {
103
+ let [name, SvgComponent] = _ref2;
104
+ return /*#__PURE__*/_react.default.createElement(IconBox, {
105
+ key: name
106
+ }, /*#__PURE__*/_react.default.createElement(SvgIconWrapper, null, /*#__PURE__*/_react.default.createElement(SvgComponent, null)), /*#__PURE__*/_react.default.createElement(IconName, null, name));
107
+ }));
108
+ exports.AllSvgIcons = AllSvgIcons;