@impulse-ui-native/toast 9.0.0 → 9.1.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/dist/components/toast.js
CHANGED
|
@@ -17,6 +17,8 @@ const ToastComponent = memo(function ToastComponent2({
|
|
|
17
17
|
...props
|
|
18
18
|
}) {
|
|
19
19
|
const tokens = useComponentsTokens().toast;
|
|
20
|
+
const hasDescription = description !== null && description !== void 0;
|
|
21
|
+
const hasAction = action !== null && action !== void 0;
|
|
20
22
|
return /* @__PURE__ */ jsxs(Toast.Root, { ...props, tone, children: [
|
|
21
23
|
!hideIcon ? /* @__PURE__ */ jsx(Toast.Icon, { children: /* @__PURE__ */ jsx(
|
|
22
24
|
Icon,
|
|
@@ -28,10 +30,10 @@ const ToastComponent = memo(function ToastComponent2({
|
|
|
28
30
|
) }) : null,
|
|
29
31
|
/* @__PURE__ */ jsxs(Toast.Content, { children: [
|
|
30
32
|
title ? /* @__PURE__ */ jsx(Toast.Title, { children: title }) : null,
|
|
31
|
-
|
|
33
|
+
hasDescription ? /* @__PURE__ */ jsx(Toast.Description, { children: description }) : null,
|
|
32
34
|
children
|
|
33
35
|
] }),
|
|
34
|
-
|
|
36
|
+
hasAction ? /* @__PURE__ */ jsx(Toast.Action, { ...actionProps, children: action }) : null,
|
|
35
37
|
!hideClose ? /* @__PURE__ */ jsx(Toast.Close, { children: /* @__PURE__ */ jsx(
|
|
36
38
|
Icon,
|
|
37
39
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/toast.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Icon } from \"@impulse-ui-native/icon\";\nimport { XIcon } from \"@impulse-ui-native/icon/icons/x\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ToastProps } from \"../types\";\nimport { ToastIcons } from \"../constants/toast-icons.constants\";\nimport { Toast } from \"./toast-parts\";\n\nexport const ToastComponent = memo(function ToastComponent({\n children,\n title,\n description,\n action,\n actionProps,\n tone = \"success\",\n hideIcon = false,\n hideClose = false,\n ...props\n}: ToastProps) {\n const tokens = useComponentsTokens().toast;\n\n return (\n <Toast.Root {...props} tone={tone}>\n {!hideIcon ? (\n <Toast.Icon>\n <Icon\n icon={ToastIcons[tone]}\n size={tokens.iconSize}\n color={tokens.tones[tone].value}\n />\n </Toast.Icon>\n ) : null}\n <Toast.Content>\n {title ? <Toast.Title>{title}</Toast.Title> : null}\n {
|
|
1
|
+
{"version":3,"sources":["../../src/components/toast.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Icon } from \"@impulse-ui-native/icon\";\nimport { XIcon } from \"@impulse-ui-native/icon/icons/x\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ToastProps } from \"../types\";\nimport { ToastIcons } from \"../constants/toast-icons.constants\";\nimport { Toast } from \"./toast-parts\";\n\nexport const ToastComponent = memo(function ToastComponent({\n children,\n title,\n description,\n action,\n actionProps,\n tone = \"success\",\n hideIcon = false,\n hideClose = false,\n ...props\n}: ToastProps) {\n const tokens = useComponentsTokens().toast;\n\n const hasDescription = description !== null && description !== undefined;\n const hasAction = action !== null && action !== undefined;\n\n return (\n <Toast.Root {...props} tone={tone}>\n {!hideIcon ? (\n <Toast.Icon>\n <Icon\n icon={ToastIcons[tone]}\n size={tokens.iconSize}\n color={tokens.tones[tone].value}\n />\n </Toast.Icon>\n ) : null}\n <Toast.Content>\n {title ? <Toast.Title>{title}</Toast.Title> : null}\n {hasDescription ? (\n <Toast.Description>{description}</Toast.Description>\n ) : null}\n {children}\n </Toast.Content>\n {hasAction ? (\n <Toast.Action {...actionProps}>{action}</Toast.Action>\n ) : null}\n {!hideClose ? (\n <Toast.Close>\n <Icon\n icon={XIcon}\n size={tokens.closeIconSize}\n color={tokens.closeColor}\n />\n </Toast.Close>\n ) : null}\n </Toast.Root>\n );\n});\n"],"mappings":"AA8BU,cAOJ,YAPI;AA9BV,SAAS,YAAY;AAErB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,2BAA2B;AAGpC,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AAEf,MAAM,iBAAiB,KAAK,SAASA,gBAAe;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,GAAG;AACL,GAAe;AACb,QAAM,SAAS,oBAAoB,EAAE;AAErC,QAAM,iBAAiB,gBAAgB,QAAQ,gBAAgB;AAC/D,QAAM,YAAY,WAAW,QAAQ,WAAW;AAEhD,SACE,qBAAC,MAAM,MAAN,EAAY,GAAG,OAAO,MACpB;AAAA,KAAC,WACA,oBAAC,MAAM,MAAN,EACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,WAAW,IAAI;AAAA,QACrB,MAAM,OAAO;AAAA,QACb,OAAO,OAAO,MAAM,IAAI,EAAE;AAAA;AAAA,IAC5B,GACF,IACE;AAAA,IACJ,qBAAC,MAAM,SAAN,EACE;AAAA,cAAQ,oBAAC,MAAM,OAAN,EAAa,iBAAM,IAAiB;AAAA,MAC7C,iBACC,oBAAC,MAAM,aAAN,EAAmB,uBAAY,IAC9B;AAAA,MACH;AAAA,OACH;AAAA,IACC,YACC,oBAAC,MAAM,QAAN,EAAc,GAAG,aAAc,kBAAO,IACrC;AAAA,IACH,CAAC,YACA,oBAAC,MAAM,OAAN,EACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,OAAO;AAAA,QACb,OAAO,OAAO;AAAA;AAAA,IAChB,GACF,IACE;AAAA,KACN;AAEJ,CAAC;","names":["ToastComponent"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@impulse-ui-native/toast",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "Compound toast notifications for ImpulseUI Native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"source": "src/index.ts",
|
|
13
13
|
"module": "dist/index.js",
|
|
14
14
|
"types": "dist/index.d.mts",
|
|
15
|
-
"react-native": "
|
|
15
|
+
"react-native": "dist/index.js",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.mts",
|
|
19
|
-
"react-native": "./
|
|
19
|
+
"react-native": "./dist/index.js",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@impulse-ui-native/
|
|
31
|
-
"@impulse-ui-native/
|
|
32
|
-
"@impulse-ui-native/
|
|
33
|
-
"@impulse-ui-native/core": "9.
|
|
34
|
-
"@impulse-ui-native/
|
|
30
|
+
"@impulse-ui-native/primitives": "9.1.2",
|
|
31
|
+
"@impulse-ui-native/theme": "9.1.2",
|
|
32
|
+
"@impulse-ui-native/icon": "9.1.2",
|
|
33
|
+
"@impulse-ui-native/core": "9.1.2",
|
|
34
|
+
"@impulse-ui-native/overlay": "9.1.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "~19.2.14",
|