@open-pioneer/notifier 4.9.0-dev.20261002130116 → 4.9.0

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,6 +1,14 @@
1
1
  # @open-pioneer/notifier
2
2
 
3
- ## 4.9.0-dev.20261002130116
3
+ ## 4.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3e6931d: Export the `defaultIcons` used by the notifier.
8
+
9
+ ### Patch Changes
10
+
11
+ - 42ca366: Update dependencies
4
12
 
5
13
  ## 4.8.0
6
14
 
@@ -84,29 +92,29 @@
84
92
  - 9f074d8: **Breaking**: The `position` property has moved from the `<Notifier />` component to package properties.
85
93
  In order to change to location of notifications, you need to customize the package properties.
86
94
 
87
- Before:
88
-
89
- ```jsx
90
- // App.jsx
91
- <Notifier position="top-right" />
92
- ```
93
-
94
- After:
95
-
96
- ```ts
97
- // app.ts
98
- const Element = createCustomElement({
99
- // ...
100
- config: {
101
- properties: {
102
- "@open-pioneer/notifier": {
103
- position: "top-right",
104
- } satisfies NotifierProperties,
105
- },
106
- },
107
- // or use resolveConfig()
108
- });
109
- ```
95
+ Before:
96
+
97
+ ```jsx
98
+ // App.jsx
99
+ <Notifier position="top-right" />
100
+ ```
101
+
102
+ After:
103
+
104
+ ```ts
105
+ // app.ts
106
+ const Element = createCustomElement({
107
+ // ...
108
+ config: {
109
+ properties: {
110
+ "@open-pioneer/notifier": {
111
+ position: "top-right"
112
+ } satisfies NotifierProperties
113
+ }
114
+ }
115
+ // or use resolveConfig()
116
+ });
117
+ ```
110
118
 
111
119
  ### Patch Changes
112
120
 
@@ -123,13 +131,13 @@
123
131
  ### Major Changes
124
132
 
125
133
  - 9477e54: Update dependencies
126
- - React 19
127
- - Vite 6
128
- - FormatJS 3
129
- - Open Pioneer Build Tools
130
- - ...
134
+ - React 19
135
+ - Vite 6
136
+ - FormatJS 3
137
+ - Open Pioneer Build Tools
138
+ - ...
131
139
 
132
- For more details, see https://github.com/open-pioneer/trails-core-packages/pull/81
140
+ For more details, see https://github.com/open-pioneer/trails-core-packages/pull/81
133
141
 
134
142
  ## 2.4.0
135
143
 
@@ -137,13 +145,13 @@
137
145
 
138
146
  - e4ba048: Introduce new convenience methods on the `NotificationService` in addition to the existing `notify()` method:
139
147
 
140
- ```js
141
- const notifier = ...; // injected
142
- notifier.success(/* ... */)
143
- notifier.info(/* ... */)
144
- notifier.warning(/* ... */)
145
- notifier.error(/* ... */)
146
- ```
148
+ ```js
149
+ const notifier = ...; // injected
150
+ notifier.success(/* ... */)
151
+ notifier.info(/* ... */)
152
+ notifier.warning(/* ... */)
153
+ notifier.error(/* ... */)
154
+ ```
147
155
 
148
156
  ### Patch Changes
149
157
 
@@ -189,7 +197,7 @@
189
197
  ### Patch Changes
190
198
 
191
199
  - 4eac7c7: Move packages into core-packages repository.
192
- - @open-pioneer/runtime@2.1.2
200
+ - @open-pioneer/runtime@2.1.2
193
201
 
194
202
  ## 0.3.0
195
203
 
package/Notifier.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Portal, Toaster as Toaster$1, Toast, Spinner, Stack, useToastStyles, Icon } from '@chakra-ui/react';
3
3
  import { useIntl, useService } from './_virtual/hooks.js';
4
4
  import { memo, useState, useEffect } from 'react';
5
- import { LuTriangleAlert, LuCircleAlert, LuCircleCheck, LuInfo } from 'react-icons/lu';
5
+ import { defaultIcons } from './icons.js';
6
6
 
7
7
  function Notifier(props) {
8
8
  const notificationService = useService(
@@ -55,15 +55,9 @@ const Toaster = memo(function Toaster2(props) {
55
55
  }
56
56
  ) });
57
57
  });
58
- const icons = {
59
- info: LuInfo,
60
- success: LuCircleCheck,
61
- warning: LuCircleAlert,
62
- error: LuTriangleAlert
63
- };
64
58
  function ToastIndicator(props) {
65
59
  const styles = useToastStyles();
66
- const Component = icons[props.type];
60
+ const Component = defaultIcons[props.type];
67
61
  if (!Component) return null;
68
62
  return /* @__PURE__ */ jsx(Icon, { css: styles.indicator, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Component, { style: { width: "100%", height: "100%" } }) }) });
69
63
  }
package/Notifier.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Notifier.js","sources":["Notifier.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n BoxProps,\n Toaster as ChakraToaster,\n Icon,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToasterProps,\n useToastStyles\n} from \"@chakra-ui/react\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { memo, useEffect, useState } from \"react\";\nimport { LuCircleAlert, LuCircleCheck, LuInfo, LuTriangleAlert } from \"react-icons/lu\";\nimport { InternalNotificationAPI, ToasterObject } from \"./NotificationServiceImpl\";\n\n/** Props supported by the {@link Notifier} component. */\nexport interface NotifierProps {\n /**\n * Props to be added to the notifier's root container.\n *\n * NOTE: Chakra's toaster currently hard codes many style properties using element styles.\n * These styles cannot be easily overwritten, unless one uses `!important`.\n **/\n rootProps?: BoxProps;\n}\n\n/**\n * Shows notifications sent via the `NotificationService`.\n *\n * Only one instance of `<Notifier />` should be present in the application.\n * It currently does not matter where the Notifier is located in the react tree.\n *\n * ```ts\n * import { Notifier } from \"@open-pioneer/notifier\";\n *\n * export function AppUI() {\n * return (\n * <>\n * <Notifier />\n * <h1>Your application</h1>\n * </>\n * );\n * }\n * ```\n */\nexport function Notifier(props: NotifierProps) {\n const notificationService = useService(\n \"notifier.NotificationService\"\n ) as InternalNotificationAPI;\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n const handle = notificationService.registerUI();\n if (!handle) {\n return;\n }\n\n setActive(true);\n return () => {\n setActive(false);\n handle.destroy();\n };\n }, [notificationService]);\n\n return active && <Toaster rootProps={props.rootProps} toaster={notificationService.toaster} />;\n}\n\nconst Toaster = memo(function Toaster(props: { rootProps?: BoxProps; toaster: ToasterObject }) {\n const { rootProps, toaster } = props;\n const intl = useIntl();\n\n return (\n <Portal>\n <ChakraToaster\n insetInline={{ mdDown: \"4\" }}\n aria-label={intl.formatMessage({\n id: \"regionLabel\"\n })}\n className=\"notifier-toast-group\"\n {...(rootProps as ToasterProps | undefined)}\n toaster={toaster}\n >\n {(toast) => (\n <Toast.Root className=\"notifier-toast\" width={{ md: \"sm\" }} alignItems=\"center\">\n {toast.type === \"loading\" ? (\n <Spinner size=\"sm\" color=\"blue.solid\" />\n ) : (\n <ToastIndicator type={toast.type ?? \"\"} />\n )}\n {/* Adjust max width down from 100% (should match internal gaps). Otherwise, the container may grow too large for its parent. */}\n <Stack gap=\"1\" flex=\"1\" maxWidth={\"calc( 100% - {sizes.5} - {spacing.2} )\"}>\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && (\n <Toast.Description>{toast.description}</Toast.Description>\n )}\n </Stack>\n {toast.action && (\n <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>\n )}\n {toast.meta?.closable && (\n <Toast.CloseTrigger\n cursor=\"pointer\"\n aria-label={intl.formatMessage({\n id: \"notification.close\"\n })}\n />\n )}\n </Toast.Root>\n )}\n </ChakraToaster>\n </Portal>\n );\n});\n\nconst icons: Record<string, React.ElementType> = {\n info: LuInfo,\n success: LuCircleCheck,\n warning: LuCircleAlert,\n error: LuTriangleAlert\n};\n\nfunction ToastIndicator(props: { type: string }) {\n const styles = useToastStyles();\n\n const Component = icons[props.type];\n if (!Component) return null;\n\n return (\n <Icon css={styles.indicator}>\n <span>\n <Component style={{ width: \"100%\", height: \"100%\" }} />\n </span>\n </Icon>\n );\n}\n"],"names":["Toaster","ChakraToaster"],"mappings":";;;;;;AAiDO,SAAS,SAAS,KAAA,EAAsB;AAC3C,EAAA,MAAM,mBAAA,GAAsB,UAAA;AAAA,IACxB;AAAA,GACJ;AACA,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,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AA,EAAA,EACG,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,QAAQ,MAAA,EAAO,EAAG,GACzD,CAAA,EACJ,CAAA;AAER;;"}
1
+ {"version":3,"file":"Notifier.js","sources":["Notifier.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n BoxProps,\n Toaster as ChakraToaster,\n Icon,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToasterProps,\n useToastStyles\n} from \"@chakra-ui/react\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { memo, useEffect, useState } from \"react\";\nimport { IconType } from \"react-icons/lib\";\nimport { defaultIcons } from \"./icons\";\nimport { InternalNotificationAPI, ToasterObject } from \"./NotificationServiceImpl\";\n\n/** Props supported by the {@link Notifier} component. */\nexport interface NotifierProps {\n /**\n * Props to be added to the notifier's root container.\n *\n * NOTE: Chakra's toaster currently hard codes many style properties using element styles.\n * These styles cannot be easily overwritten, unless one uses `!important`.\n **/\n rootProps?: BoxProps;\n}\n\n/**\n * Shows notifications sent via the `NotificationService`.\n *\n * Only one instance of `<Notifier />` should be present in the application.\n * It currently does not matter where the Notifier is located in the react tree.\n *\n * ```ts\n * import { Notifier } from \"@open-pioneer/notifier\";\n *\n * export function AppUI() {\n * return (\n * <>\n * <Notifier />\n * <h1>Your application</h1>\n * </>\n * );\n * }\n * ```\n */\nexport function Notifier(props: NotifierProps) {\n const notificationService = useService(\n \"notifier.NotificationService\"\n ) as InternalNotificationAPI;\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n const handle = notificationService.registerUI();\n if (!handle) {\n return;\n }\n\n setActive(true);\n return () => {\n setActive(false);\n handle.destroy();\n };\n }, [notificationService]);\n\n return active && <Toaster rootProps={props.rootProps} toaster={notificationService.toaster} />;\n}\n\nconst Toaster = memo(function Toaster(props: { rootProps?: BoxProps; toaster: ToasterObject }) {\n const { rootProps, toaster } = props;\n const intl = useIntl();\n\n return (\n <Portal>\n <ChakraToaster\n insetInline={{ mdDown: \"4\" }}\n aria-label={intl.formatMessage({\n id: \"regionLabel\"\n })}\n className=\"notifier-toast-group\"\n {...(rootProps as ToasterProps | undefined)}\n toaster={toaster}\n >\n {(toast) => (\n <Toast.Root className=\"notifier-toast\" width={{ md: \"sm\" }} alignItems=\"center\">\n {toast.type === \"loading\" ? (\n <Spinner size=\"sm\" color=\"blue.solid\" />\n ) : (\n <ToastIndicator type={toast.type ?? \"\"} />\n )}\n {/* Adjust max width down from 100% (should match internal gaps). Otherwise, the container may grow too large for its parent. */}\n <Stack gap=\"1\" flex=\"1\" maxWidth={\"calc( 100% - {sizes.5} - {spacing.2} )\"}>\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && (\n <Toast.Description>{toast.description}</Toast.Description>\n )}\n </Stack>\n {toast.action && (\n <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>\n )}\n {toast.meta?.closable && (\n <Toast.CloseTrigger\n cursor=\"pointer\"\n aria-label={intl.formatMessage({\n id: \"notification.close\"\n })}\n />\n )}\n </Toast.Root>\n )}\n </ChakraToaster>\n </Portal>\n );\n});\n\nfunction ToastIndicator(props: { type: string }) {\n const styles = useToastStyles();\n\n const Component = defaultIcons[props.type as keyof typeof defaultIcons] as IconType | undefined;\n if (!Component) return null;\n\n return (\n <Icon css={styles.indicator}>\n <span>\n <Component style={{ width: \"100%\", height: \"100%\" }} />\n </span>\n </Icon>\n );\n}\n"],"names":["Toaster","ChakraToaster"],"mappings":";;;;;;AAkDO,SAAS,SAAS,KAAA,EAAsB;AAC3C,EAAA,MAAM,mBAAA,GAAsB,UAAA;AAAA,IACxB;AAAA,GACJ;AACA,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE1C,EAAA,SAAA,CAAU,MAAM;AACZ,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119
119
  notificationService.closeAll();
120
120
  ```
121
121
 
122
+ ### Default icons
123
+
124
+ This package exports the default icons that will be used by its notifications.
125
+ You can use those icons to implement components with a consistent look:
126
+
127
+ ```tsx
128
+ import { Icon } from "@chakra-ui/react";
129
+ import { defaultIcons } from "@open-pioneer/notifier";
130
+
131
+ // Prefer `Icon` over raw <defaultIcons.info /> because it automatically applies aria-hidden and also supports chakra's styling props.
132
+ <Icon as={defaultIcons.info} />;
133
+ ```
134
+
122
135
  ## License
123
136
 
124
137
  Apache-2.0 (see `LICENSE` file)
package/icons.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The default icons used by the `Notifier` component.
3
+ *
4
+ * Usage:
5
+ *
6
+ * ```tsx
7
+ * import { Icon } from "@chakra-ui/react";
8
+ * import { defaultIcons } from "@open-pioneer/notifier";
9
+ *
10
+ * // Prefer `Icon` over raw svg because it automatically applies aria-hidden and also supports chakra's styling props.
11
+ * <Icon as={defaultIcons.info} />
12
+ * ```
13
+ */
14
+ export declare const defaultIcons: Readonly<{
15
+ readonly info: import("react-icons/lib").IconType;
16
+ readonly success: import("react-icons/lib").IconType;
17
+ readonly warning: import("react-icons/lib").IconType;
18
+ readonly error: import("react-icons/lib").IconType;
19
+ }>;
package/icons.js ADDED
@@ -0,0 +1,11 @@
1
+ import { LuTriangleAlert, LuCircleAlert, LuCircleCheck, LuInfo } from 'react-icons/lu';
2
+
3
+ const defaultIcons = Object.freeze({
4
+ info: LuInfo,
5
+ success: LuCircleCheck,
6
+ warning: LuCircleAlert,
7
+ error: LuTriangleAlert
8
+ });
9
+
10
+ export { defaultIcons };
11
+ //# sourceMappingURL=icons.js.map
package/icons.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","sources":["icons.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LuCircleAlert, LuCircleCheck, LuInfo, LuTriangleAlert } from \"react-icons/lu\";\n\n/**\n * The default icons used by the `Notifier` component.\n *\n * Usage:\n *\n * ```tsx\n * import { Icon } from \"@chakra-ui/react\";\n * import { defaultIcons } from \"@open-pioneer/notifier\";\n *\n * // Prefer `Icon` over raw svg because it automatically applies aria-hidden and also supports chakra's styling props.\n * <Icon as={defaultIcons.info} />\n * ```\n */\nexport const defaultIcons = Object.freeze({\n info: LuInfo,\n success: LuCircleCheck,\n warning: LuCircleAlert,\n error: LuTriangleAlert\n} as const);\n"],"names":[],"mappings":";;AAkBO,MAAM,YAAA,GAAe,OAAO,MAAA,CAAO;AAAA,EACtC,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO;AACX,CAAU;;"}
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./api";
2
2
  export { Notifier, type NotifierProps } from "./Notifier";
3
+ export { defaultIcons } from "./icons";
package/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { Notifier } from './Notifier.js';
2
+ export { defaultIcons } from './icons.js';
2
3
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/notifier",
4
- "version": "4.9.0-dev.20261002130116",
4
+ "version": "4.9.0",
5
5
  "description": "Provides support for application-wide notifications.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -15,9 +15,9 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@chakra-ui/react": "^3.37.0",
18
- "@open-pioneer/core": "4.9.0-dev.20261002130116",
19
- "@open-pioneer/runtime": "4.9.0-dev.20261002130116",
20
- "react": "^19.3.0",
18
+ "@open-pioneer/core": "4.9.0",
19
+ "@open-pioneer/runtime": "4.9.0",
20
+ "react": "^19.3.1",
21
21
  "react-icons": "^5.7.0"
22
22
  },
23
23
  "publishConfig": {