@stack-spot/portal-components 2.25.1 → 2.25.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.25.2](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.25.1...portal-components@v2.25.2) (2025-08-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * banner warning ([#1408](https://github.com/stack-spot/portal-commons/issues/1408)) ([9275385](https://github.com/stack-spot/portal-commons/commit/927538519908b87469c5ac2351eace94087cb4bb))
9
+
3
10
  ## [2.25.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.25.0...portal-components@v2.25.1) (2025-08-14)
4
11
 
5
12
 
@@ -1,10 +1,13 @@
1
+ import { SxProperties } from '@citric/core/dist/sx.js';
1
2
  /**
2
3
  * A styled and dismissible alert box for showing important warnings for the user.
3
4
  *
4
5
  * This renders a yellow box with an exclamation icon. The content passed as parameter is placed on the right of the icon.
5
6
  * @param props an object containing the content (children) to show inside the alert box.
6
7
  */
7
- export declare const BannerWarning: ({ children }: {
8
+ export declare const BannerWarning: ({ children, sx, showCloseButton }: {
8
9
  children: React.ReactNode;
10
+ sx?: SxProperties;
11
+ showCloseButton?: boolean;
9
12
  }) => import("react/jsx-runtime").JSX.Element | null;
10
13
  //# sourceMappingURL=BannerWarning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BannerWarning.d.ts","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,cAAc;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,mDA2ExE,CAAA"}
1
+ {"version":3,"file":"BannerWarning.d.ts","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAMnD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,mCAC5B;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,EAAE,CAAC,EAAE,YAAY,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,mDA6E5E,CAAA"}
@@ -10,7 +10,7 @@ import { getCookie, setCookie } from '../utils/cookie.js';
10
10
  * This renders a yellow box with an exclamation icon. The content passed as parameter is placed on the right of the icon.
11
11
  * @param props an object containing the content (children) to show inside the alert box.
12
12
  */
13
- export const BannerWarning = ({ children }) => {
13
+ export const BannerWarning = ({ children, sx, showCloseButton = true }) => {
14
14
  const bannerKey = 'bannerClosed';
15
15
  const [isVisible, setIsVisible] = useState(() => {
16
16
  if (typeof window !== 'undefined') {
@@ -34,12 +34,14 @@ export const BannerWarning = ({ children }) => {
34
34
  display: 'flex',
35
35
  justifyContent: 'space-between',
36
36
  height: 'auto',
37
+ padding: `${showCloseButton ? '0.5rem' : '1rem'}`,
38
+ ...sx,
37
39
  }, children: [_jsxs(Flex, { sx: {
38
40
  alignItems: 'center',
39
41
  flexWrap: 'nowrap',
40
42
  }, children: [_jsx(IconBox, { size: "sm", colorIcon: "light.500", children: _jsx(ExclamationTriangle, {}) }), _jsx(Text, { sx: {
41
43
  ml: 5,
42
- }, appearance: "body2", colorScheme: "warning.contrastText", children: children })] }), _jsx(Button, { appearance: 'text', onClick: handleClose, sx: {
44
+ }, appearance: "body2", colorScheme: "warning.contrastText", children: children })] }), showCloseButton && _jsx(Button, { appearance: 'text', onClick: handleClose, sx: {
43
45
  p: 0,
44
46
  ml: 2,
45
47
  }, children: _jsx(IconBox, { size: "lg", colorIcon: "light.500", children: _jsx(TimesCircleFill, {}) }) })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"BannerWarning.js","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,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M;aACf,aAED,MAAC,IAAI,IACH,EAAE,EAAE;wBACF,UAAU,EAAE,QAAQ;wBACpB,QAAQ,EAAE,QAAQ;qBACnB,aAED,KAAC,OAAO,IACN,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,WAAW,YAErB,KAAC,mBAAmB,KAAG,GACf,EACV,KAAC,IAAI,IACH,EAAE,EAAE;gCACF,EAAE,EAAC,CAAC;6BACL,EACD,UAAU,EAAC,OAAO,EAClB,WAAW,EAAC,sBAAsB,YAEjC,QAAQ,GACJ,IACF,EAEP,KAAC,MAAM,IACL,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE;wBACF,CAAC,EAAE,CAAC;wBACJ,EAAE,EAAE,CAAC;qBACN,YAED,KAAC,OAAO,IACN,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,WAAW,YAErB,KAAC,eAAe,KAAG,GACX,GACH,IACH,GACH,CACR,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"BannerWarning.js","sourceRoot":"","sources":["../../src/components/BannerWarning.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,eAAe,GAAG,IAAI,EACS,EAAE,EAAE;IAC/E,MAAM,SAAS,GAAG,cAAc,CAAA;IAEhC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE;QA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M,IACzB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE;wBACF,CAAC,EAAE,CAAC;wBACJ,EAAE,EAAE,CAAC;qBACN,YAED,KAAC,OAAO,IACN,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,WAAW,YAErB,KAAC,eAAe,KAAG,GACX,GACH,IACH,GACH,CACR,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-components",
3
- "version": "2.25.1",
3
+ "version": "2.25.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,6 @@
1
1
 
2
2
  import { Button, Flex, IconBox, Text } from '@citric/core'
3
+ import { SxProperties } from '@citric/core/dist/sx'
3
4
  import { ExclamationTriangle, TimesCircleFill } from '@citric/icons'
4
5
  import { Alert } from '@citric/ui'
5
6
  import { useState } from 'react'
@@ -11,7 +12,8 @@ import { getCookie, setCookie } from '../utils/cookie'
11
12
  * This renders a yellow box with an exclamation icon. The content passed as parameter is placed on the right of the icon.
12
13
  * @param props an object containing the content (children) to show inside the alert box.
13
14
  */
14
- export const BannerWarning = ({ children }: { children: React.ReactNode }) => {
15
+ export const BannerWarning = ({ children, sx, showCloseButton = true }:
16
+ { children: React.ReactNode, sx?: SxProperties, showCloseButton?: boolean }) => {
15
17
  const bannerKey = 'bannerClosed'
16
18
 
17
19
  const [isVisible, setIsVisible] = useState(() => {
@@ -41,14 +43,16 @@ export const BannerWarning = ({ children }: { children: React.ReactNode }) => {
41
43
  py: 1,
42
44
  alignItems: 'center',
43
45
  display: 'flex',
44
- justifyContent: 'space-between',
46
+ justifyContent: 'space-between',
45
47
  height: 'auto',
48
+ padding: `${showCloseButton ? '0.5rem' : '1rem'}`,
49
+ ...sx,
46
50
  }}
47
51
  >
48
52
  <Flex
49
53
  sx={{
50
- alignItems: 'center',
51
- flexWrap: 'nowrap',
54
+ alignItems: 'center',
55
+ flexWrap: 'nowrap',
52
56
  }}
53
57
  >
54
58
  <IconBox
@@ -59,7 +63,7 @@ export const BannerWarning = ({ children }: { children: React.ReactNode }) => {
59
63
  </IconBox>
60
64
  <Text
61
65
  sx={{
62
- ml:5,
66
+ ml: 5,
63
67
  }}
64
68
  appearance="body2"
65
69
  colorScheme="warning.contrastText"
@@ -67,8 +71,8 @@ export const BannerWarning = ({ children }: { children: React.ReactNode }) => {
67
71
  {children}
68
72
  </Text>
69
73
  </Flex>
70
-
71
- <Button
74
+
75
+ {showCloseButton && <Button
72
76
  appearance={'text'}
73
77
  onClick={handleClose}
74
78
  sx={{
@@ -82,7 +86,7 @@ export const BannerWarning = ({ children }: { children: React.ReactNode }) => {
82
86
  >
83
87
  <TimesCircleFill />
84
88
  </IconBox>
85
- </Button>
89
+ </Button>}
86
90
  </Alert>
87
91
  </Flex>
88
92
  )