@opentui-ui/toast 0.0.1

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.
@@ -0,0 +1,118 @@
1
+ import { a as MINIMAL_ICONS, n as DEFAULT_ICONS } from "./icons-DXx_5j_z.mjs";
2
+
3
+ //#region src/themes.ts
4
+ /**
5
+ * @opentui-ui/toast/themes
6
+ *
7
+ * Optional theme presets for the toaster.
8
+ * These override the built-in defaults with alternative visual styles.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { ToasterRenderable } from '@opentui-ui/toast'
13
+ * import { minimal } from '@opentui-ui/toast/themes'
14
+ *
15
+ * const toaster = new ToasterRenderable(ctx, minimal)
16
+ * ```
17
+ */
18
+ /**
19
+ * Minimal theme - clean and unobtrusive
20
+ *
21
+ * No borders, subtle styling. Perfect for apps where
22
+ * toasts should be informative but not distracting.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import { ToasterRenderable } from '@opentui-ui/toast';
27
+ * import { minimal } from '@opentui-ui/toast/themes';
28
+ *
29
+ * const toaster = new ToasterRenderable(ctx, minimal);
30
+ *
31
+ * // Or customize it
32
+ * const toaster = new ToasterRenderable(ctx, {
33
+ * ...minimal,
34
+ * position: 'top-center',
35
+ * stackingMode: 'stack',
36
+ * });
37
+ * ```
38
+ */
39
+ const minimal = {
40
+ name: "Minimal",
41
+ description: "Clean and unobtrusive, no borders",
42
+ position: "bottom-right",
43
+ stackingMode: "single",
44
+ icons: MINIMAL_ICONS,
45
+ toastOptions: {
46
+ style: {
47
+ border: false,
48
+ backgroundColor: "#262626",
49
+ foregroundColor: "#e5e5e5",
50
+ mutedColor: "#737373",
51
+ paddingX: 2,
52
+ paddingY: 1
53
+ },
54
+ success: { style: { foregroundColor: "#4ade80" } },
55
+ error: { style: { foregroundColor: "#f87171" } },
56
+ warning: { style: { foregroundColor: "#fbbf24" } },
57
+ info: { style: { foregroundColor: "#60a5fa" } }
58
+ }
59
+ };
60
+ /**
61
+ * Monochrome theme - grayscale only
62
+ *
63
+ * No colors, just shades of gray. Useful for
64
+ * accessibility or when color is not desired.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * import { ToasterRenderable } from '@opentui-ui/toast';
69
+ * import { monochrome } from '@opentui-ui/toast/themes';
70
+ *
71
+ * const toaster = new ToasterRenderable(ctx, monochrome);
72
+ * ```
73
+ */
74
+ const monochrome = {
75
+ name: "Monochrome",
76
+ description: "Grayscale only, no colors",
77
+ position: "bottom-right",
78
+ stackingMode: "single",
79
+ icons: DEFAULT_ICONS,
80
+ toastOptions: {
81
+ style: {
82
+ border: true,
83
+ borderStyle: "single",
84
+ borderColor: "#525252",
85
+ backgroundColor: "#171717",
86
+ foregroundColor: "#fafafa",
87
+ mutedColor: "#a3a3a3",
88
+ paddingX: 1,
89
+ paddingY: 0,
90
+ minHeight: 3
91
+ },
92
+ default: { style: { borderColor: "#525252" } },
93
+ success: { style: { borderColor: "#a3a3a3" } },
94
+ error: { style: { borderColor: "#fafafa" } },
95
+ warning: { style: { borderColor: "#d4d4d4" } },
96
+ info: { style: { borderColor: "#737373" } },
97
+ loading: { style: { borderColor: "#525252" } }
98
+ }
99
+ };
100
+ /**
101
+ * All available themes as a single object
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * import { themes } from '@opentui-ui/toast/themes';
106
+ *
107
+ * // Access themes by name
108
+ * const toaster = new ToasterRenderable(ctx, themes.minimal);
109
+ * ```
110
+ */
111
+ const themes = {
112
+ minimal,
113
+ monochrome
114
+ };
115
+
116
+ //#endregion
117
+ export { minimal, monochrome, themes };
118
+ //# sourceMappingURL=themes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.mjs","names":["minimal: ToasterTheme","monochrome: ToasterTheme"],"sources":["../src/themes.ts"],"sourcesContent":["/**\n * @opentui-ui/toast/themes\n *\n * Optional theme presets for the toaster.\n * These override the built-in defaults with alternative visual styles.\n *\n * @example\n * ```ts\n * import { ToasterRenderable } from '@opentui-ui/toast'\n * import { minimal } from '@opentui-ui/toast/themes'\n *\n * const toaster = new ToasterRenderable(ctx, minimal)\n * ```\n */\n\nimport { DEFAULT_ICONS, MINIMAL_ICONS } from \"./icons\";\nimport type { ToasterOptions } from \"./types\";\n\n/**\n * A theme configuration for the toaster.\n * Extends ToasterOptions with metadata.\n */\nexport interface ToasterTheme extends ToasterOptions {\n /** Human-readable name for the theme */\n name: string;\n /** Brief description of the theme */\n description: string;\n}\n\n// =============================================================================\n// Theme Definitions\n// =============================================================================\n\n/**\n * Minimal theme - clean and unobtrusive\n *\n * No borders, subtle styling. Perfect for apps where\n * toasts should be informative but not distracting.\n *\n * @example\n * ```ts\n * import { ToasterRenderable } from '@opentui-ui/toast';\n * import { minimal } from '@opentui-ui/toast/themes';\n *\n * const toaster = new ToasterRenderable(ctx, minimal);\n *\n * // Or customize it\n * const toaster = new ToasterRenderable(ctx, {\n * ...minimal,\n * position: 'top-center',\n * stackingMode: 'stack',\n * });\n * ```\n */\nexport const minimal: ToasterTheme = {\n name: \"Minimal\",\n description: \"Clean and unobtrusive, no borders\",\n position: \"bottom-right\",\n stackingMode: \"single\",\n icons: MINIMAL_ICONS,\n toastOptions: {\n style: {\n border: false,\n backgroundColor: \"#262626\",\n foregroundColor: \"#e5e5e5\",\n mutedColor: \"#737373\",\n paddingX: 2,\n paddingY: 1,\n },\n success: { style: { foregroundColor: \"#4ade80\" } },\n error: { style: { foregroundColor: \"#f87171\" } },\n warning: { style: { foregroundColor: \"#fbbf24\" } },\n info: { style: { foregroundColor: \"#60a5fa\" } },\n },\n};\n\n/**\n * Monochrome theme - grayscale only\n *\n * No colors, just shades of gray. Useful for\n * accessibility or when color is not desired.\n *\n * @example\n * ```ts\n * import { ToasterRenderable } from '@opentui-ui/toast';\n * import { monochrome } from '@opentui-ui/toast/themes';\n *\n * const toaster = new ToasterRenderable(ctx, monochrome);\n * ```\n */\nexport const monochrome: ToasterTheme = {\n name: \"Monochrome\",\n description: \"Grayscale only, no colors\",\n position: \"bottom-right\",\n stackingMode: \"single\",\n icons: DEFAULT_ICONS,\n toastOptions: {\n style: {\n border: true,\n borderStyle: \"single\",\n borderColor: \"#525252\",\n backgroundColor: \"#171717\",\n foregroundColor: \"#fafafa\",\n mutedColor: \"#a3a3a3\",\n paddingX: 1,\n paddingY: 0,\n minHeight: 3,\n },\n default: { style: { borderColor: \"#525252\" } },\n success: { style: { borderColor: \"#a3a3a3\" } },\n error: { style: { borderColor: \"#fafafa\" } },\n warning: { style: { borderColor: \"#d4d4d4\" } },\n info: { style: { borderColor: \"#737373\" } },\n loading: { style: { borderColor: \"#525252\" } },\n },\n};\n\n// =============================================================================\n// Utilities\n// =============================================================================\n\n/**\n * All available themes as a single object\n *\n * @example\n * ```ts\n * import { themes } from '@opentui-ui/toast/themes';\n *\n * // Access themes by name\n * const toaster = new ToasterRenderable(ctx, themes.minimal);\n * ```\n */\nexport const themes = {\n minimal,\n monochrome,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAaA,UAAwB;CACnC,MAAM;CACN,aAAa;CACb,UAAU;CACV,cAAc;CACd,OAAO;CACP,cAAc;EACZ,OAAO;GACL,QAAQ;GACR,iBAAiB;GACjB,iBAAiB;GACjB,YAAY;GACZ,UAAU;GACV,UAAU;GACX;EACD,SAAS,EAAE,OAAO,EAAE,iBAAiB,WAAW,EAAE;EAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,WAAW,EAAE;EAChD,SAAS,EAAE,OAAO,EAAE,iBAAiB,WAAW,EAAE;EAClD,MAAM,EAAE,OAAO,EAAE,iBAAiB,WAAW,EAAE;EAChD;CACF;;;;;;;;;;;;;;;AAgBD,MAAaC,aAA2B;CACtC,MAAM;CACN,aAAa;CACb,UAAU;CACV,cAAc;CACd,OAAO;CACP,cAAc;EACZ,OAAO;GACL,QAAQ;GACR,aAAa;GACb,aAAa;GACb,iBAAiB;GACjB,iBAAiB;GACjB,YAAY;GACZ,UAAU;GACV,UAAU;GACV,WAAW;GACZ;EACD,SAAS,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC9C,SAAS,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC9C,OAAO,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC5C,SAAS,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC9C,MAAM,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC3C,SAAS,EAAE,OAAO,EAAE,aAAa,WAAW,EAAE;EAC/C;CACF;;;;;;;;;;;;AAiBD,MAAa,SAAS;CACpB;CACA;CACD"}