sag_components 2.0.0-beta75 → 2.0.0-beta77

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.js CHANGED
@@ -3482,154 +3482,6 @@ const LinnerDataBox = props => {
3482
3482
  }))));
3483
3483
  };
3484
3484
 
3485
- const SagIconButtonWrapper = styled__default["default"].button`
3486
- height: ${props => props.height};
3487
- font-size: 14px;
3488
- font-weight: 400;
3489
- display: flex;
3490
- gap: 8px;
3491
- align-items: center;
3492
- justify-content: center;
3493
- padding: 8px 18px;
3494
- white-space: nowrap;
3495
- color: ${props => props.color};
3496
- border-radius: 8px;
3497
- border: 1px solid ${props => props.color};
3498
- background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3499
- transition: box-shadow 0.3s ease;
3500
- &:hover, &:focus {
3501
- cursor: pointer;
3502
- box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3503
- }
3504
- `;
3505
- const SpanText$1 = styled__default["default"].span`
3506
- `;
3507
-
3508
- const SagIconButton = props => {
3509
- const {
3510
- iconName,
3511
- color,
3512
- backgroundColor,
3513
- activeColor,
3514
- height,
3515
- buttonText,
3516
- iconWidth,
3517
- iconHeight,
3518
- disabled,
3519
- openState,
3520
- onButtonClick,
3521
- className
3522
- } = props;
3523
- const [activeState, setActiveState] = React$1.useState(openState);
3524
- const onClickHandler = event => {
3525
- onButtonClick(event);
3526
- setActiveState(prevState => !prevState);
3527
- };
3528
- const getIcon = icon => {
3529
- switch (icon.toLowerCase()) {
3530
- case 'filter':
3531
- return /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
3532
- height: iconHeight,
3533
- width: iconWidth,
3534
- color: activeState ? activeColor : color
3535
- });
3536
- case 'options':
3537
- return /*#__PURE__*/React__default["default"].createElement(OptionsIcon, {
3538
- height: iconHeight,
3539
- width: iconWidth,
3540
- color: activeState ? activeColor : color
3541
- });
3542
- case 'download':
3543
- return /*#__PURE__*/React__default["default"].createElement(DownloadIcon, {
3544
- height: iconHeight,
3545
- width: iconWidth,
3546
- color: activeState ? activeColor : color
3547
- });
3548
- case 'document':
3549
- return /*#__PURE__*/React__default["default"].createElement(DocumentIcon, {
3550
- height: iconHeight,
3551
- width: iconWidth,
3552
- color: activeState ? activeColor : color
3553
- });
3554
- case 'fly':
3555
- return /*#__PURE__*/React__default["default"].createElement(FlyIcon, {
3556
- height: iconHeight,
3557
- width: iconWidth,
3558
- color: activeState ? activeColor : color
3559
- });
3560
- case 'bell':
3561
- return /*#__PURE__*/React__default["default"].createElement(BellIcon, {
3562
- height: iconHeight,
3563
- width: iconWidth,
3564
- color: activeState ? activeColor : color
3565
- });
3566
- case 'maintenance':
3567
- return /*#__PURE__*/React__default["default"].createElement(MaintenanceIcon, {
3568
- height: iconHeight,
3569
- width: iconWidth,
3570
- color: activeState ? activeColor : color
3571
- });
3572
- case 'exit':
3573
- return /*#__PURE__*/React__default["default"].createElement(ExitIcon, {
3574
- height: iconHeight,
3575
- width: iconWidth,
3576
- color: activeState ? activeColor : color
3577
- });
3578
- case 'eye':
3579
- return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3580
- height: iconHeight,
3581
- width: iconWidth,
3582
- color: activeState ? activeColor : color
3583
- });
3584
- default:
3585
- return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3586
- height: iconHeight,
3587
- width: iconWidth,
3588
- color: activeState ? activeColor : color
3589
- });
3590
- }
3591
- };
3592
- return /*#__PURE__*/React__default["default"].createElement(SagIconButtonWrapper, {
3593
- className: className,
3594
- height: height,
3595
- color: activeState ? activeColor : color,
3596
- backgroundColor: backgroundColor,
3597
- disabled: disabled,
3598
- onClick: event => {
3599
- onClickHandler(event);
3600
- }
3601
- }, getIcon(iconName), buttonText && /*#__PURE__*/React__default["default"].createElement(SpanText$1, null, buttonText));
3602
- };
3603
- SagIconButton.propTypes = {
3604
- className: PropTypes.string,
3605
- iconName: PropTypes.string,
3606
- buttonText: PropTypes.string,
3607
- height: PropTypes.string,
3608
- color: PropTypes.string,
3609
- backgroundColor: PropTypes.string,
3610
- activeColor: PropTypes.string,
3611
- iconHeight: PropTypes.number,
3612
- iconWidth: PropTypes.number,
3613
- openState: PropTypes.bool,
3614
- disabled: PropTypes.bool,
3615
- onButtonClick: PropTypes.func
3616
- };
3617
- SagIconButton.defaultProps = {
3618
- className: '',
3619
- iconName: 'filter',
3620
- buttonText: 'Filter',
3621
- height: '40px',
3622
- color: '#212121',
3623
- activeColor: '#229E38',
3624
- backgroundColor: 'transparent',
3625
- // '#E8F5EB',
3626
- iconHeight: 12,
3627
- iconWidth: 12,
3628
- openState: false,
3629
- disabled: false,
3630
- onButtonClick: () => {}
3631
- };
3632
-
3633
3485
  const TextFieldContainer = styled__default["default"].div`
3634
3486
  position: relative;
3635
3487
  width: ${props => props.width};
@@ -3738,16 +3590,6 @@ const TopRow = styled__default["default"].div`
3738
3590
  display: flex;
3739
3591
  align-items: center;
3740
3592
  gap: 20px;
3741
- `;
3742
- const Headline$1 = styled__default["default"].span`
3743
- font-size: 18px;
3744
- font-weight: 500;
3745
- margin-right: auto;
3746
- `;
3747
- const Nav = styled__default["default"].nav`
3748
- display: flex;
3749
- flex-direction: row;
3750
-
3751
3593
  `;
3752
3594
  const TabActionLine = styled__default["default"].div`
3753
3595
  margin-left: auto;
@@ -3755,20 +3597,28 @@ const TabActionLine = styled__default["default"].div`
3755
3597
  align-items: center;
3756
3598
  height: 100%;
3757
3599
  `;
3600
+ const Headline$1 = styled__default["default"].span`
3601
+ font-size: 18px;
3602
+ font-weight: 500;
3603
+ margin-right: auto;
3604
+ `;
3758
3605
  const Tabs = styled__default["default"].div`
3759
3606
  position: relative;
3760
3607
  display: flex;
3761
3608
  align-items: center;
3762
3609
  width: 100%;
3763
3610
  `;
3764
- const Tab = styled__default["default"].div`
3611
+ const Tab = styled__default["default"].button`
3765
3612
  cursor: pointer;
3766
3613
  position: relative;
3767
3614
  text-align: center;
3768
3615
  padding: 8px 12px;
3769
3616
  font-size: 16px;
3770
3617
  color: #000000;
3618
+ border: none;
3771
3619
  border-bottom: 2px solid #D0D0D0;
3620
+ background: transparent;
3621
+ z-index: 2;
3772
3622
  &.active {
3773
3623
  font-weight: 600;
3774
3624
  color: ${props => props.color};
@@ -3826,12 +3676,158 @@ const ActionsWrapper = styled__default["default"].div`
3826
3676
  gap: 10px;
3827
3677
  width: 100%;
3828
3678
  `;
3829
- const SagIconButtonWrap = styled__default["default"](SagIconButton)`
3830
- `;
3831
3679
  const SearchInputWrap = styled__default["default"](SearchInput)`
3832
3680
  margin-left: auto;
3833
3681
  `;
3834
3682
 
3683
+ const SagIconButtonWrapper = styled__default["default"].button`
3684
+ height: ${props => props.height};
3685
+ font-size: 14px;
3686
+ font-weight: 400;
3687
+ display: flex;
3688
+ gap: 8px;
3689
+ align-items: center;
3690
+ justify-content: center;
3691
+ padding: 8px 18px;
3692
+ white-space: nowrap;
3693
+ color: ${props => props.color};
3694
+ border-radius: 8px;
3695
+ border: 1px solid ${props => props.color};
3696
+ background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3697
+ transition: box-shadow 0.3s ease;
3698
+ &:hover, &:focus {
3699
+ cursor: pointer;
3700
+ box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3701
+ }
3702
+ `;
3703
+ const SpanText$1 = styled__default["default"].span`
3704
+ `;
3705
+
3706
+ const SagIconButton = props => {
3707
+ const {
3708
+ iconName,
3709
+ color,
3710
+ backgroundColor,
3711
+ activeColor,
3712
+ height,
3713
+ buttonText,
3714
+ iconWidth,
3715
+ iconHeight,
3716
+ disabled,
3717
+ openState,
3718
+ onButtonClick,
3719
+ className
3720
+ } = props;
3721
+ const [activeState, setActiveState] = React$1.useState(openState);
3722
+ const onClickHandler = event => {
3723
+ onButtonClick(event);
3724
+ setActiveState(prevState => !prevState);
3725
+ };
3726
+ const getIcon = icon => {
3727
+ switch (icon.toLowerCase()) {
3728
+ case 'filter':
3729
+ return /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
3730
+ height: iconHeight,
3731
+ width: iconWidth,
3732
+ color: activeState ? activeColor : color
3733
+ });
3734
+ case 'options':
3735
+ return /*#__PURE__*/React__default["default"].createElement(OptionsIcon, {
3736
+ height: iconHeight,
3737
+ width: iconWidth,
3738
+ color: activeState ? activeColor : color
3739
+ });
3740
+ case 'download':
3741
+ return /*#__PURE__*/React__default["default"].createElement(DownloadIcon, {
3742
+ height: iconHeight,
3743
+ width: iconWidth,
3744
+ color: activeState ? activeColor : color
3745
+ });
3746
+ case 'document':
3747
+ return /*#__PURE__*/React__default["default"].createElement(DocumentIcon, {
3748
+ height: iconHeight,
3749
+ width: iconWidth,
3750
+ color: activeState ? activeColor : color
3751
+ });
3752
+ case 'fly':
3753
+ return /*#__PURE__*/React__default["default"].createElement(FlyIcon, {
3754
+ height: iconHeight,
3755
+ width: iconWidth,
3756
+ color: activeState ? activeColor : color
3757
+ });
3758
+ case 'bell':
3759
+ return /*#__PURE__*/React__default["default"].createElement(BellIcon, {
3760
+ height: iconHeight,
3761
+ width: iconWidth,
3762
+ color: activeState ? activeColor : color
3763
+ });
3764
+ case 'maintenance':
3765
+ return /*#__PURE__*/React__default["default"].createElement(MaintenanceIcon, {
3766
+ height: iconHeight,
3767
+ width: iconWidth,
3768
+ color: activeState ? activeColor : color
3769
+ });
3770
+ case 'exit':
3771
+ return /*#__PURE__*/React__default["default"].createElement(ExitIcon, {
3772
+ height: iconHeight,
3773
+ width: iconWidth,
3774
+ color: activeState ? activeColor : color
3775
+ });
3776
+ case 'eye':
3777
+ return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3778
+ height: iconHeight,
3779
+ width: iconWidth,
3780
+ color: activeState ? activeColor : color
3781
+ });
3782
+ default:
3783
+ return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3784
+ height: iconHeight,
3785
+ width: iconWidth,
3786
+ color: activeState ? activeColor : color
3787
+ });
3788
+ }
3789
+ };
3790
+ return /*#__PURE__*/React__default["default"].createElement(SagIconButtonWrapper, {
3791
+ className: className,
3792
+ height: height,
3793
+ color: activeState ? activeColor : color,
3794
+ backgroundColor: backgroundColor,
3795
+ disabled: disabled,
3796
+ onClick: event => {
3797
+ onClickHandler(event);
3798
+ }
3799
+ }, getIcon(iconName), buttonText && /*#__PURE__*/React__default["default"].createElement(SpanText$1, null, buttonText));
3800
+ };
3801
+ SagIconButton.propTypes = {
3802
+ className: PropTypes.string,
3803
+ iconName: PropTypes.string,
3804
+ buttonText: PropTypes.string,
3805
+ height: PropTypes.string,
3806
+ color: PropTypes.string,
3807
+ backgroundColor: PropTypes.string,
3808
+ activeColor: PropTypes.string,
3809
+ iconHeight: PropTypes.number,
3810
+ iconWidth: PropTypes.number,
3811
+ openState: PropTypes.bool,
3812
+ disabled: PropTypes.bool,
3813
+ onButtonClick: PropTypes.func
3814
+ };
3815
+ SagIconButton.defaultProps = {
3816
+ className: '',
3817
+ iconName: 'filter',
3818
+ buttonText: 'Filter',
3819
+ height: '40px',
3820
+ color: '#212121',
3821
+ activeColor: '#229E38',
3822
+ backgroundColor: 'transparent',
3823
+ // '#E8F5EB',
3824
+ iconHeight: 12,
3825
+ iconWidth: 12,
3826
+ openState: false,
3827
+ disabled: false,
3828
+ onButtonClick: () => {}
3829
+ };
3830
+
3835
3831
  const TabMenu = props => {
3836
3832
  const {
3837
3833
  activeColor,
@@ -3839,7 +3835,6 @@ const TabMenu = props => {
3839
3835
  className,
3840
3836
  color,
3841
3837
  currentTab,
3842
- headlineInsteadTabs,
3843
3838
  headlineText,
3844
3839
  inputWidth,
3845
3840
  onFilterButtonClick,
@@ -3871,14 +3866,14 @@ const TabMenu = props => {
3871
3866
  }, [currentTab]);
3872
3867
  return /*#__PURE__*/React__default["default"].createElement(TabMenuContainer, {
3873
3868
  className: className
3874
- }, /*#__PURE__*/React__default["default"].createElement(TopRow, null, showFilterButton && /*#__PURE__*/React__default["default"].createElement(SagIconButtonWrap, {
3869
+ }, /*#__PURE__*/React__default["default"].createElement(TopRow, null, showFilterButton && /*#__PURE__*/React__default["default"].createElement(SagIconButton, {
3875
3870
  id: "filterButton",
3876
3871
  iconName: "Filter",
3877
3872
  buttonText: "",
3878
3873
  openState: panelIsOpen,
3879
3874
  activeColor: activeColor,
3880
3875
  onButtonClick: onFilterButtonClick
3881
- }), headlineInsteadTabs ? /*#__PURE__*/React__default["default"].createElement(Headline$1, null, headlineText) : /*#__PURE__*/React__default["default"].createElement(Nav, {
3876
+ }), headlineText && headlineText !== '' ? /*#__PURE__*/React__default["default"].createElement(Headline$1, null, headlineText) : /*#__PURE__*/React__default["default"].createElement("nav", {
3882
3877
  className: "Nav"
3883
3878
  }, /*#__PURE__*/React__default["default"].createElement(Tabs, {
3884
3879
  className: "Tabs"
@@ -30364,6 +30359,13 @@ const BubbleChart = _ref => {
30364
30359
  const distance = Math.max(Math.abs(max - median), Math.abs(min - median));
30365
30360
  return [median - distance, median + distance];
30366
30361
  };
30362
+
30363
+ // const calculateDomainBasedOnMedian = (min, max, median) => {
30364
+ // // Always include all data points, and add a small padding
30365
+ // const padding = (max - min) * 0.1 || 1; // fallback to 1 if min==max
30366
+ // return [min - padding, max + padding];
30367
+ // };
30368
+
30367
30369
  const xDom = calculateDomainBasedOnMedian(minX, maxX, medianX);
30368
30370
  const yDom = calculateDomainBasedOnMedian(minY, maxY, medianY);
30369
30371
 
@@ -30805,10 +30807,10 @@ const BubbleChart = _ref => {
30805
30807
  onMouseMove: handleChartMouseMove,
30806
30808
  cursor: curosrMouse,
30807
30809
  margin: {
30808
- top: 60,
30810
+ top: 80,
30809
30811
  right: 190,
30810
- bottom: 50,
30811
- left: 180
30812
+ bottom: 80,
30813
+ left: 190
30812
30814
  },
30813
30815
  "data-testid": "scatter-chart"
30814
30816
  }, renderGradients(), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
@@ -30864,7 +30866,7 @@ const BubbleChart = _ref => {
30864
30866
  label: xMedian >= viewDomain.x[0] && xMedian <= viewDomain.x[1] ? {
30865
30867
  value: topHeader,
30866
30868
  position: "top",
30867
- offset: 40,
30869
+ offset: 60,
30868
30870
  fill: '#484A4C',
30869
30871
  fontSize: 16,
30870
30872
  fontWeight: 500
@@ -30890,7 +30892,7 @@ const BubbleChart = _ref => {
30890
30892
  label: xMedian >= viewDomain.x[0] && xMedian <= viewDomain.x[1] ? {
30891
30893
  value: bottomHeader,
30892
30894
  position: "bottom",
30893
- offset: 30,
30895
+ offset: 60,
30894
30896
  fill: '#484A4C',
30895
30897
  fontSize: 16,
30896
30898
  fontWeight: 500
@@ -31003,6 +31005,25 @@ const BubbleChart = _ref => {
31003
31005
  // Calculate the exact position of the median point in the SVG
31004
31006
  const xPos = viewBox.x + (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]) * viewBox.width;
31005
31007
  const yPos = viewBox.y + (1 - (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0])) * viewBox.height;
31008
+
31009
+ // Calculate normalized position of median in domain
31010
+ // const xNorm = (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]);
31011
+ // const yNorm = (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0]);
31012
+
31013
+ // // If median is within 2% of the edge, center the label
31014
+ // const isXEdge = xNorm < 0.02 || xNorm > 0.98;
31015
+ // const isYEdge = yNorm < 0.02 || yNorm > 0.98;
31016
+
31017
+ // let xPos, yPos;
31018
+ // if (isXEdge || isYEdge) {
31019
+ // // Center of SVG
31020
+ // xPos = viewBox.x + viewBox.width / 2;
31021
+ // yPos = viewBox.y + viewBox.height / 2;
31022
+ // } else {
31023
+ // // Median's data position
31024
+ // xPos = viewBox.x + xNorm * viewBox.width;
31025
+ // yPos = viewBox.y + (1 - yNorm) * viewBox.height;
31026
+ // }
31006
31027
  return /*#__PURE__*/React__default["default"].createElement("text", {
31007
31028
  x: xPos,
31008
31029
  y: yPos,