@loja-integrada/admin-components 0.19.3 → 0.19.5

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.
@@ -10,5 +10,5 @@ interface TabsItemProps extends TabsItemInterface {
10
10
  */
11
11
  onChange: (arg0: string) => void;
12
12
  }
13
- export declare const TabsItem: ({ id, title, active, disabled, onChange, }: TabsItemProps) => JSX.Element;
13
+ export declare const TabsItem: ({ id, title, titleComplement, active, disabled, onChange, }: TabsItemProps) => JSX.Element;
14
14
  export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface TabsItemInterface {
2
3
  /**
3
4
  * Item identification
@@ -7,6 +8,10 @@ export interface TabsItemInterface {
7
8
  * Item visible title
8
9
  */
9
10
  title: string;
11
+ /**
12
+ * Complement to title
13
+ * */
14
+ titleComplement?: string | React.ReactNode;
10
15
  /**
11
16
  * Disabled a specific tab
12
17
  */
@@ -8,7 +8,7 @@ declare const InformationBoxTypes: Record<InformationBoxTypesOptions, {
8
8
  icon: IconProps['icon'];
9
9
  iconClass: string;
10
10
  }>;
11
- export declare const InformationBox: React.MemoExoticComponent<({ type, subtitle, title, }: InformationBoxProps) => JSX.Element>;
11
+ export declare const InformationBox: React.MemoExoticComponent<({ type, title, subtitle, showClose, onClose, }: InformationBoxProps) => JSX.Element | null>;
12
12
  export interface InformationBoxProps {
13
13
  /** InformationBox color
14
14
  * @default info
@@ -22,5 +22,13 @@ export interface InformationBoxProps {
22
22
  * InformationBox text below title
23
23
  */
24
24
  subtitle?: string | React.ReactNode;
25
+ /** Show close button
26
+ * @default false
27
+ */
28
+ showClose?: boolean;
29
+ /**
30
+ * Function to close InformationBox (also activate `showClose`)
31
+ */
32
+ onClose?: () => void;
25
33
  }
26
34
  export {};
@@ -34756,7 +34756,7 @@ cov_1urw57c37o();
34756
34756
 
34757
34757
  function cov_1s85yl253c() {
34758
34758
  var path = "/runner/_work/admin-components/admin-components/styleguide/src/Indicators/InformationBox/InformationBox.tsx";
34759
- var hash = "bbddf25b9d522fb9cc25ddaaf1d133ec8011ff91";
34759
+ var hash = "196d0c3db97edecf529f8af6f14208a122fb1109";
34760
34760
  var global = new Function("return this")();
34761
34761
  var gcv = "__coverage__";
34762
34762
  var coverageData = {
@@ -34778,27 +34778,87 @@ function cov_1s85yl253c() {
34778
34778
  column: 32
34779
34779
  },
34780
34780
  end: {
34781
- line: 41,
34781
+ line: 50,
34782
34782
  column: 1
34783
34783
  }
34784
34784
  },
34785
34785
  "2": {
34786
34786
  start: {
34787
34787
  line: 34,
34788
+ column: 60
34789
+ },
34790
+ end: {
34791
+ line: 34,
34792
+ column: 74
34793
+ }
34794
+ },
34795
+ "3": {
34796
+ start: {
34797
+ line: 35,
34798
+ column: 26
34799
+ },
34800
+ end: {
34801
+ line: 38,
34802
+ column: 5
34803
+ }
34804
+ },
34805
+ "4": {
34806
+ start: {
34807
+ line: 36,
34808
+ column: 8
34809
+ },
34810
+ end: {
34811
+ line: 36,
34812
+ column: 39
34813
+ }
34814
+ },
34815
+ "5": {
34816
+ start: {
34817
+ line: 37,
34818
+ column: 8
34819
+ },
34820
+ end: {
34821
+ line: 37,
34822
+ column: 20
34823
+ }
34824
+ },
34825
+ "6": {
34826
+ start: {
34827
+ line: 39,
34788
34828
  column: 4
34789
34829
  },
34790
34830
  end: {
34791
34831
  line: 40,
34792
- column: 140
34832
+ column: 20
34793
34833
  }
34794
34834
  },
34795
- "3": {
34835
+ "7": {
34796
34836
  start: {
34797
- line: 42,
34837
+ line: 40,
34838
+ column: 8
34839
+ },
34840
+ end: {
34841
+ line: 40,
34842
+ column: 20
34843
+ }
34844
+ },
34845
+ "8": {
34846
+ start: {
34847
+ line: 41,
34848
+ column: 4
34849
+ },
34850
+ end: {
34851
+ line: 49,
34852
+ column: 70
34853
+ }
34854
+ },
34855
+ "9": {
34856
+ start: {
34857
+ line: 51,
34798
34858
  column: 30
34799
34859
  },
34800
34860
  end: {
34801
- line: 42,
34861
+ line: 51,
34802
34862
  column: 65
34803
34863
  }
34804
34864
  }
@@ -34819,14 +34879,38 @@ function cov_1s85yl253c() {
34819
34879
  loc: {
34820
34880
  start: {
34821
34881
  line: 33,
34822
- column: 73
34882
+ column: 101
34823
34883
  },
34824
34884
  end: {
34825
- line: 41,
34885
+ line: 50,
34826
34886
  column: 1
34827
34887
  }
34828
34888
  },
34829
34889
  line: 33
34890
+ },
34891
+ "1": {
34892
+ name: "(anonymous_1)",
34893
+ decl: {
34894
+ start: {
34895
+ line: 35,
34896
+ column: 26
34897
+ },
34898
+ end: {
34899
+ line: 35,
34900
+ column: 27
34901
+ }
34902
+ },
34903
+ loc: {
34904
+ start: {
34905
+ line: 35,
34906
+ column: 32
34907
+ },
34908
+ end: {
34909
+ line: 38,
34910
+ column: 5
34911
+ }
34912
+ },
34913
+ line: 35
34830
34914
  }
34831
34915
  },
34832
34916
  branchMap: {
@@ -34857,86 +34941,195 @@ function cov_1s85yl253c() {
34857
34941
  "1": {
34858
34942
  loc: {
34859
34943
  start: {
34860
- line: 39,
34861
- column: 141
34944
+ line: 33,
34945
+ column: 67
34862
34946
  },
34863
34947
  end: {
34864
- line: 39,
34865
- column: 181
34948
+ line: 33,
34949
+ column: 84
34866
34950
  }
34867
34951
  },
34868
- type: "binary-expr",
34952
+ type: "default-arg",
34869
34953
  locations: [{
34954
+ start: {
34955
+ line: 33,
34956
+ column: 79
34957
+ },
34958
+ end: {
34959
+ line: 33,
34960
+ column: 84
34961
+ }
34962
+ }],
34963
+ line: 33
34964
+ },
34965
+ "2": {
34966
+ loc: {
34870
34967
  start: {
34871
34968
  line: 39,
34872
- column: 141
34969
+ column: 4
34873
34970
  },
34874
34971
  end: {
34972
+ line: 40,
34973
+ column: 20
34974
+ }
34975
+ },
34976
+ type: "if",
34977
+ locations: [{
34978
+ start: {
34875
34979
  line: 39,
34876
- column: 146
34980
+ column: 4
34981
+ },
34982
+ end: {
34983
+ line: 40,
34984
+ column: 20
34877
34985
  }
34878
34986
  }, {
34879
34987
  start: {
34880
- line: 39,
34881
- column: 150
34988
+ line: undefined,
34989
+ column: undefined
34882
34990
  },
34883
34991
  end: {
34884
- line: 39,
34885
- column: 181
34992
+ line: undefined,
34993
+ column: undefined
34886
34994
  }
34887
34995
  }],
34888
34996
  line: 39
34889
34997
  },
34890
- "2": {
34998
+ "3": {
34891
34999
  loc: {
34892
35000
  start: {
34893
- line: 40,
35001
+ line: 46,
35002
+ column: 145
35003
+ },
35004
+ end: {
35005
+ line: 46,
35006
+ column: 185
35007
+ }
35008
+ },
35009
+ type: "binary-expr",
35010
+ locations: [{
35011
+ start: {
35012
+ line: 46,
35013
+ column: 145
35014
+ },
35015
+ end: {
35016
+ line: 46,
35017
+ column: 150
35018
+ }
35019
+ }, {
35020
+ start: {
35021
+ line: 46,
35022
+ column: 154
35023
+ },
35024
+ end: {
35025
+ line: 46,
35026
+ column: 185
35027
+ }
35028
+ }],
35029
+ line: 46
35030
+ },
35031
+ "4": {
35032
+ loc: {
35033
+ start: {
35034
+ line: 47,
34894
35035
  column: 16
34895
35036
  },
34896
35037
  end: {
34897
- line: 40,
35038
+ line: 47,
34898
35039
  column: 135
34899
35040
  }
34900
35041
  },
34901
35042
  type: "binary-expr",
34902
35043
  locations: [{
34903
35044
  start: {
34904
- line: 40,
35045
+ line: 47,
34905
35046
  column: 16
34906
35047
  },
34907
35048
  end: {
34908
- line: 40,
35049
+ line: 47,
34909
35050
  column: 24
34910
35051
  }
34911
35052
  }, {
34912
35053
  start: {
34913
- line: 40,
35054
+ line: 47,
34914
35055
  column: 29
34915
35056
  },
34916
35057
  end: {
34917
- line: 40,
35058
+ line: 47,
34918
35059
  column: 134
34919
35060
  }
34920
35061
  }],
34921
- line: 40
35062
+ line: 47
35063
+ },
35064
+ "5": {
35065
+ loc: {
35066
+ start: {
35067
+ line: 48,
35068
+ column: 8
35069
+ },
35070
+ end: {
35071
+ line: 49,
35072
+ column: 67
35073
+ }
35074
+ },
35075
+ type: "binary-expr",
35076
+ locations: [{
35077
+ start: {
35078
+ line: 48,
35079
+ column: 9
35080
+ },
35081
+ end: {
35082
+ line: 48,
35083
+ column: 18
35084
+ }
35085
+ }, {
35086
+ start: {
35087
+ line: 48,
35088
+ column: 22
35089
+ },
35090
+ end: {
35091
+ line: 48,
35092
+ column: 29
35093
+ }
35094
+ }, {
35095
+ start: {
35096
+ line: 48,
35097
+ column: 35
35098
+ },
35099
+ end: {
35100
+ line: 49,
35101
+ column: 66
35102
+ }
35103
+ }],
35104
+ line: 48
34922
35105
  }
34923
35106
  },
34924
35107
  s: {
34925
35108
  "0": 0,
34926
35109
  "1": 0,
34927
35110
  "2": 0,
34928
- "3": 0
35111
+ "3": 0,
35112
+ "4": 0,
35113
+ "5": 0,
35114
+ "6": 0,
35115
+ "7": 0,
35116
+ "8": 0,
35117
+ "9": 0
34929
35118
  },
34930
35119
  f: {
34931
- "0": 0
35120
+ "0": 0,
35121
+ "1": 0
34932
35122
  },
34933
35123
  b: {
34934
35124
  "0": [0],
34935
- "1": [0, 0],
34936
- "2": [0, 0]
35125
+ "1": [0],
35126
+ "2": [0, 0],
35127
+ "3": [0, 0],
35128
+ "4": [0, 0],
35129
+ "5": [0, 0, 0]
34937
35130
  },
34938
35131
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
34939
- hash: "bbddf25b9d522fb9cc25ddaaf1d133ec8011ff91"
35132
+ hash: "196d0c3db97edecf529f8af6f14208a122fb1109"
34940
35133
  };
34941
35134
  var coverage = global[gcv] || (global[gcv] = {});
34942
35135
 
@@ -34990,10 +35183,38 @@ cov_1s85yl253c().s[1]++;
34990
35183
  var InformationBoxComponent = function InformationBoxComponent(_ref) {
34991
35184
  var _ref$type = _ref.type,
34992
35185
  type = _ref$type === void 0 ? (cov_1s85yl253c().b[0][0]++, 'info') : _ref$type,
35186
+ title = _ref.title,
34993
35187
  subtitle = _ref.subtitle,
34994
- title = _ref.title;
35188
+ _ref$showClose = _ref.showClose,
35189
+ showClose = _ref$showClose === void 0 ? (cov_1s85yl253c().b[1][0]++, false) : _ref$showClose,
35190
+ onClose = _ref.onClose;
34995
35191
  cov_1s85yl253c().f[0]++;
34996
- cov_1s85yl253c().s[2]++;
35192
+
35193
+ var _ref2 = (cov_1s85yl253c().s[2]++, React.useState(true)),
35194
+ isInformationBoxOpen = _ref2[0],
35195
+ setIsInformationBoxOpen = _ref2[1];
35196
+
35197
+ cov_1s85yl253c().s[3]++;
35198
+
35199
+ var handleOnClose = function handleOnClose() {
35200
+ cov_1s85yl253c().f[1]++;
35201
+ cov_1s85yl253c().s[4]++;
35202
+ setIsInformationBoxOpen(false);
35203
+ cov_1s85yl253c().s[5]++;
35204
+ onClose == null ? void 0 : onClose();
35205
+ };
35206
+
35207
+ cov_1s85yl253c().s[6]++;
35208
+
35209
+ if (!isInformationBoxOpen) {
35210
+ cov_1s85yl253c().b[2][0]++;
35211
+ cov_1s85yl253c().s[7]++;
35212
+ return null;
35213
+ } else {
35214
+ cov_1s85yl253c().b[2][1]++;
35215
+ }
35216
+
35217
+ cov_1s85yl253c().s[8]++;
34997
35218
  return /*#__PURE__*/React__default.createElement("div", {
34998
35219
  className: "InformationBox pl-4 pr-6 pt-5 pb-6 rounded w-full relative flex items-start mb-3 " + InformationBoxTypes[type]["class"]
34999
35220
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -35007,13 +35228,19 @@ var InformationBoxComponent = function InformationBoxComponent(_ref) {
35007
35228
  }, /*#__PURE__*/React__default.createElement("div", {
35008
35229
  className: "flex flex-col justify-center min-w-0 break-words tracking-4 leading-6 text-on-base"
35009
35230
  }, /*#__PURE__*/React__default.createElement("span", {
35010
- className: "InformationBox-title text-f5 font-bold " + InformationBoxTypes[type].titleClass
35011
- }, (cov_1s85yl253c().b[1][0]++, title) || (cov_1s85yl253c().b[1][1]++, InformationBoxTypes[type].title)), (cov_1s85yl253c().b[2][0]++, subtitle) && (cov_1s85yl253c().b[2][1]++, /*#__PURE__*/React__default.createElement("span", {
35231
+ className: "InformationBox-title text-f5 font-semibold " + InformationBoxTypes[type].titleClass
35232
+ }, (cov_1s85yl253c().b[3][0]++, title) || (cov_1s85yl253c().b[3][1]++, InformationBoxTypes[type].title)), (cov_1s85yl253c().b[4][0]++, subtitle) && (cov_1s85yl253c().b[4][1]++, /*#__PURE__*/React__default.createElement("span", {
35012
35233
  className: "InformationBox-subtitle text-f6 font-regular mt-1"
35013
- }, subtitle)))));
35234
+ }, subtitle)))), ((cov_1s85yl253c().b[5][0]++, showClose) || (cov_1s85yl253c().b[5][1]++, onClose)) && (cov_1s85yl253c().b[5][2]++, /*#__PURE__*/React__default.createElement("button", {
35235
+ className: "InformationBox-close absolute top-4 right-4 text-on-base-2",
35236
+ onClick: handleOnClose
35237
+ }, /*#__PURE__*/React__default.createElement(Icon, {
35238
+ icon: "close",
35239
+ size: 4
35240
+ }))));
35014
35241
  };
35015
35242
 
35016
- var InformationBox = ( /*#__PURE__*/cov_1s85yl253c().s[3]++, /*#__PURE__*/React__default.memo(InformationBoxComponent));
35243
+ var InformationBox = ( /*#__PURE__*/cov_1s85yl253c().s[9]++, /*#__PURE__*/React__default.memo(InformationBoxComponent));
35017
35244
 
35018
35245
  function cov_1sn1apcwbq() {
35019
35246
  var path = "/runner/_work/admin-components/admin-components/styleguide/src/Indicators/InformationBox/index.tsx";
@@ -37338,7 +37565,7 @@ cov_2exnju1afb();
37338
37565
 
37339
37566
  function cov_24egftxhy6() {
37340
37567
  var path = "/runner/_work/admin-components/admin-components/styleguide/src/Components/Tabs/TabsItem.tsx";
37341
- var hash = "4288533066e0b8cff705b891655875aff0a189d0";
37568
+ var hash = "c2837541f0ed508efe6e1885324ef0b072d7f2ef";
37342
37569
  var global = new Function("return this")();
37343
37570
  var gcv = "__coverage__";
37344
37571
  var coverageData = {
@@ -37390,7 +37617,7 @@ function cov_24egftxhy6() {
37390
37617
  column: 24
37391
37618
  },
37392
37619
  end: {
37393
- line: 9,
37620
+ line: 11,
37394
37621
  column: 1
37395
37622
  }
37396
37623
  },
@@ -37400,8 +37627,8 @@ function cov_24egftxhy6() {
37400
37627
  column: 4
37401
37628
  },
37402
37629
  end: {
37403
- line: 8,
37404
- column: 232
37630
+ line: 10,
37631
+ column: 102
37405
37632
  }
37406
37633
  },
37407
37634
  "6": {
@@ -37455,10 +37682,10 @@ function cov_24egftxhy6() {
37455
37682
  loc: {
37456
37683
  start: {
37457
37684
  line: 6,
37458
- column: 88
37685
+ column: 105
37459
37686
  },
37460
37687
  end: {
37461
- line: 9,
37688
+ line: 11,
37462
37689
  column: 1
37463
37690
  }
37464
37691
  },
@@ -37527,22 +37754,22 @@ function cov_24egftxhy6() {
37527
37754
  loc: {
37528
37755
  start: {
37529
37756
  line: 6,
37530
- column: 38
37757
+ column: 55
37531
37758
  },
37532
37759
  end: {
37533
37760
  line: 6,
37534
- column: 52
37761
+ column: 69
37535
37762
  }
37536
37763
  },
37537
37764
  type: "default-arg",
37538
37765
  locations: [{
37539
37766
  start: {
37540
37767
  line: 6,
37541
- column: 47
37768
+ column: 64
37542
37769
  },
37543
37770
  end: {
37544
37771
  line: 6,
37545
- column: 52
37772
+ column: 69
37546
37773
  }
37547
37774
  }],
37548
37775
  line: 6
@@ -37551,22 +37778,22 @@ function cov_24egftxhy6() {
37551
37778
  loc: {
37552
37779
  start: {
37553
37780
  line: 6,
37554
- column: 54
37781
+ column: 71
37555
37782
  },
37556
37783
  end: {
37557
37784
  line: 6,
37558
- column: 70
37785
+ column: 87
37559
37786
  }
37560
37787
  },
37561
37788
  type: "default-arg",
37562
37789
  locations: [{
37563
37790
  start: {
37564
37791
  line: 6,
37565
- column: 65
37792
+ column: 82
37566
37793
  },
37567
37794
  end: {
37568
37795
  line: 6,
37569
- column: 70
37796
+ column: 87
37570
37797
  }
37571
37798
  }],
37572
37799
  line: 6
@@ -37669,6 +37896,39 @@ function cov_24egftxhy6() {
37669
37896
  }
37670
37897
  }],
37671
37898
  line: 8
37899
+ },
37900
+ "6": {
37901
+ loc: {
37902
+ start: {
37903
+ line: 10,
37904
+ column: 12
37905
+ },
37906
+ end: {
37907
+ line: 10,
37908
+ column: 98
37909
+ }
37910
+ },
37911
+ type: "binary-expr",
37912
+ locations: [{
37913
+ start: {
37914
+ line: 10,
37915
+ column: 12
37916
+ },
37917
+ end: {
37918
+ line: 10,
37919
+ column: 27
37920
+ }
37921
+ }, {
37922
+ start: {
37923
+ line: 10,
37924
+ column: 31
37925
+ },
37926
+ end: {
37927
+ line: 10,
37928
+ column: 98
37929
+ }
37930
+ }],
37931
+ line: 10
37672
37932
  }
37673
37933
  },
37674
37934
  s: {
@@ -37691,10 +37951,11 @@ function cov_24egftxhy6() {
37691
37951
  "2": [0],
37692
37952
  "3": [0, 0],
37693
37953
  "4": [0, 0],
37694
- "5": [0, 0]
37954
+ "5": [0, 0],
37955
+ "6": [0, 0]
37695
37956
  },
37696
37957
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
37697
- hash: "4288533066e0b8cff705b891655875aff0a189d0"
37958
+ hash: "c2837541f0ed508efe6e1885324ef0b072d7f2ef"
37698
37959
  };
37699
37960
  var coverage = global[gcv] || (global[gcv] = {});
37700
37961
 
@@ -37728,6 +37989,7 @@ cov_24egftxhy6().s[4]++;
37728
37989
  var TabsItem = function TabsItem(_ref) {
37729
37990
  var id = _ref.id,
37730
37991
  title = _ref.title,
37992
+ titleComplement = _ref.titleComplement,
37731
37993
  _ref$active = _ref.active,
37732
37994
  active = _ref$active === void 0 ? (cov_24egftxhy6().b[1][0]++, false) : _ref$active,
37733
37995
  _ref$disabled = _ref.disabled,
@@ -37748,7 +38010,9 @@ var TabsItem = function TabsItem(_ref) {
37748
38010
  }, /*#__PURE__*/React__default.createElement("span", {
37749
38011
  className: "block tracking-4 text-f6 text-sm py-4 border-b-4 break-words " + (disabled ? (cov_24egftxhy6().b[5][0]++, '') : (cov_24egftxhy6().b[5][1]++, 'group-hover:font-semibold')) + " " + activeStyles(active) + " " + boldFixStyle,
37750
38012
  "data-title": title
37751
- }, title));
38013
+ }, title, (cov_24egftxhy6().b[6][0]++, titleComplement) && (cov_24egftxhy6().b[6][1]++, /*#__PURE__*/React__default.createElement("span", {
38014
+ className: "ml-2"
38015
+ }, titleComplement))));
37752
38016
  };
37753
38017
 
37754
38018
  function cov_natr76kqj() {