@hexdspace/react 0.0.8 → 0.0.10

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { QueryClient, QueryKey } from '@tanstack/react-query';
3
3
  import { ResultOk, ResultError } from '@hexdspace/util';
4
- import React from 'react';
4
+ import React, { CSSProperties } from 'react';
5
5
 
6
6
  type NotificationVariant = 'success' | 'warning' | 'error' | 'info';
7
7
  declare const DEFAULT_NOTIFICATION_CHANNEL = "app.notifications";
@@ -39,17 +39,87 @@ declare class NotifierController {
39
39
  }
40
40
  declare const notifierController: NotifierController;
41
41
 
42
+ type ToastTransition = {
43
+ enter: string;
44
+ exit: string;
45
+ collapseDuration?: number;
46
+ };
47
+ type ToastTheme = {
48
+ lightBg?: string;
49
+ lightText?: string;
50
+ lightProgress?: string;
51
+ darkBg?: string;
52
+ darkText?: string;
53
+ darkProgress?: string;
54
+ progressInfo?: string;
55
+ progressSuccess?: string;
56
+ progressWarning?: string;
57
+ progressError?: string;
58
+ width?: string;
59
+ contentPadding?: string;
60
+ bodyColumnGap?: string;
61
+ bodyRowGap?: string;
62
+ transition?: ToastTransition;
63
+ action?: Partial<ToastActionTheme>;
64
+ iconColors?: Partial<Record<NotificationVariant, string>>;
65
+ };
66
+ type ToastifyCSSVars = CSSProperties & {
67
+ '--toastify-color-light'?: string;
68
+ '--toastify-text-color-light'?: string;
69
+ '--toastify-color-progress-light'?: string;
70
+ '--toastify-color-dark'?: string;
71
+ '--toastify-text-color-dark'?: string;
72
+ '--toastify-color-progress-dark'?: string;
73
+ '--toastify-color-progress-info'?: string;
74
+ '--toastify-color-progress-success'?: string;
75
+ '--toastify-color-progress-warning'?: string;
76
+ '--toastify-color-progress-error'?: string;
77
+ '--toastify-toast-width'?: string;
78
+ };
79
+ type ToastActionTheme = {
80
+ padding: string;
81
+ borderRadius: string;
82
+ background: string;
83
+ hoverBackground: string;
84
+ focusOutline: string;
85
+ focusOutlineOffset: string;
86
+ fontWeight: number | string;
87
+ transition: string;
88
+ focusTransform: string;
89
+ activeTransform: string;
90
+ color?: string;
91
+ hoverColor?: string;
92
+ marginLeft?: string;
93
+ marginTop?: string;
94
+ };
95
+ type ResolvedToastTheme = {
96
+ lightBg: string;
97
+ lightText: string;
98
+ lightProgress: string;
99
+ darkBg: string;
100
+ darkText: string;
101
+ darkProgress: string;
102
+ progressInfo: string;
103
+ progressSuccess: string;
104
+ progressWarning: string;
105
+ progressError: string;
106
+ width: string;
107
+ contentPadding: string;
108
+ bodyColumnGap: string;
109
+ bodyRowGap: string;
110
+ transition?: ToastTransition;
111
+ action: ToastActionTheme;
112
+ iconColors: Record<NotificationVariant, string>;
113
+ };
114
+ declare function resolveToastTheme(theme?: ToastTheme): ResolvedToastTheme;
115
+
42
116
  type NotificationHostProps = {
43
117
  channel?: string;
44
118
  isDark?: () => boolean;
119
+ theme?: ToastTheme;
45
120
  };
46
121
  declare const NotificationHost: React.FC<NotificationHostProps>;
47
122
 
48
- declare const NotifierProvider: React.FC<{
49
- children: React.ReactNode;
50
- }>;
51
- declare function useNotifierController(): NotifierController;
52
-
53
123
  type InstructionContext = {
54
124
  queryClient: QueryClient;
55
125
  };
@@ -93,4 +163,4 @@ type ResponsiveMutation<Args, Res> = {
93
163
 
94
164
  declare function useResponsiveMutation<Args, Res>(responsiveMutation: ResponsiveMutation<Args, Res>, queryClient: QueryClient): _tanstack_react_query.UseMutationResult<UIOk<Res>, UIFail, Args, OptimisticSnapshot | undefined>;
95
165
 
96
- export { type CacheInstruction, type CustomInstruction, DEFAULT_NOTIFICATION_CHANNEL, type Instruction, type InstructionContext, type Notification, type NotificationAction, NotificationHost, type NotificationInstruction, type NotificationVariant, NotifierController, NotifierProvider, type OptimisticSnapshot, type ResponsiveMutation, type UIFail, type UIOk, type UIResult, notifierController, ui, useNotifierController, useResponsiveMutation };
166
+ export { type CacheInstruction, type CustomInstruction, DEFAULT_NOTIFICATION_CHANNEL, type Instruction, type InstructionContext, type Notification, type NotificationAction, NotificationHost, type NotificationInstruction, type NotificationVariant, NotifierController, type OptimisticSnapshot, type ResolvedToastTheme, type ResponsiveMutation, type ToastActionTheme, type ToastTheme, type ToastTransition, type ToastifyCSSVars, type UIFail, type UIOk, type UIResult, notifierController, resolveToastTheme, ui, useResponsiveMutation };
package/dist/index.js CHANGED
@@ -102,50 +102,301 @@ var subscribe = new SubscribeUseCase(bus);
102
102
  var notifierController = new NotifierController(sendNotification, subscribe);
103
103
 
104
104
  // src/feature/notifier/infra/web/react/NotificationHost.tsx
105
- import { useEffect, useMemo as useMemo2 } from "react";
106
- import { ToastContainer, toast } from "react-toastify";
107
- import { AlertTriangleIcon, CheckCircleIcon, InfoIcon, XCircleIcon } from "lucide-react";
105
+ import { useCallback, useEffect, useMemo as useMemo2 } from "react";
106
+ import { toast as toast2, ToastContainer } from "react-toastify";
108
107
 
109
108
  // src/feature/notifier/entity/notification.ts
110
109
  var DEFAULT_NOTIFICATION_CHANNEL = "app.notifications";
111
110
 
112
- // src/feature/notifier/infra/web/react/NotifierProvider.tsx
113
- import { createContext, useContext, useMemo } from "react";
114
- import { jsx } from "react/jsx-runtime";
115
- var NotifierContext = createContext(null);
116
- var NotifierProvider = ({ children }) => {
117
- const controller = useMemo(() => notifierController, []);
118
- return /* @__PURE__ */ jsx(NotifierContext.Provider, { value: { controller }, children });
119
- };
120
- function useNotifierController() {
121
- const ctx = useContext(NotifierContext);
122
- if (!ctx) throw new Error("useNotifierController must be used within <NotifierProvider>");
123
- return ctx.controller;
124
- }
125
-
126
111
  // src/feature/notifier/infra/web/react/CustomToastTransition.tsx
127
112
  import { cssTransition } from "react-toastify";
113
+ var CUSTOM_TRANSITION_STYLE_ID = "hexd-toast-transition-styles";
114
+ var CUSTOM_TRANSITION_STYLES = `
115
+ @keyframes slideIn {
116
+ from { transform: translateY(-20px); opacity: 0; }
117
+ to { transform: translateY(0); opacity: 1; }
118
+ }
119
+
120
+ @keyframes slideOut {
121
+ from { transform: translateY(0); opacity: 1; }
122
+ to { transform: translateY(-20px); opacity: 0; }
123
+ }
124
+
125
+ .slideIn {
126
+ animation: slideIn 0.35s forwards;
127
+ }
128
+
129
+ .slideOut {
130
+ animation: slideOut 0.25s forwards;
131
+ }
132
+ `;
133
+ var ensureCustomToastTransitionStyles = () => {
134
+ if (typeof document === "undefined") return;
135
+ if (document.getElementById(CUSTOM_TRANSITION_STYLE_ID)) return;
136
+ const style = document.createElement("style");
137
+ style.id = CUSTOM_TRANSITION_STYLE_ID;
138
+ style.textContent = CUSTOM_TRANSITION_STYLES;
139
+ document.head.appendChild(style);
140
+ };
128
141
  var SlideUp = cssTransition({
129
142
  enter: "slideIn",
130
143
  exit: "slideOut",
131
- collapseDuration: 300,
132
- appendPosition: false,
133
- collapse: true
144
+ collapseDuration: 300
134
145
  });
146
+ var buildToastTransition = (transition) => {
147
+ ensureCustomToastTransitionStyles();
148
+ if (!transition) return SlideUp;
149
+ return cssTransition(transition);
150
+ };
151
+
152
+ // src/feature/notifier/infra/web/react/ToastContent.tsx
153
+ import { useMemo, useState } from "react";
154
+ import { toast } from "react-toastify";
155
+ import { AlertTriangleIcon, CheckCircleIcon, InfoIcon, XCircleIcon } from "lucide-react";
156
+ import { jsx, jsxs } from "react/jsx-runtime";
157
+ var DEFAULT_NOTIFICATION_VARIANT = "info";
158
+ var TOAST_ICON_BY_VARIANT = {
159
+ success: CheckCircleIcon,
160
+ warning: AlertTriangleIcon,
161
+ error: XCircleIcon,
162
+ info: InfoIcon
163
+ };
164
+ var ToastContent = ({ notification, theme, mode }) => {
165
+ const { title, content, action } = notification;
166
+ const variant = notification.variant ?? DEFAULT_NOTIFICATION_VARIANT;
167
+ const Icon = TOAST_ICON_BY_VARIANT[variant];
168
+ const iconColor = theme.iconColors[variant];
169
+ const [isHovered, setIsHovered] = useState(false);
170
+ const [isFocused, setIsFocused] = useState(false);
171
+ const [isActive, setIsActive] = useState(false);
172
+ const textColor = mode === "dark" ? theme.darkText : theme.lightText;
173
+ const actionTextColor = theme.action.color ?? textColor;
174
+ const actionHoverColor = theme.action.hoverColor ?? actionTextColor;
175
+ const actionStyle = useMemo(() => {
176
+ const background = isHovered ? theme.action.hoverBackground : theme.action.background;
177
+ const color = isHovered ? actionHoverColor : actionTextColor;
178
+ const transform = isActive ? theme.action.activeTransform : isFocused ? theme.action.focusTransform : void 0;
179
+ return {
180
+ alignSelf: "flex-start",
181
+ padding: theme.action.padding,
182
+ borderRadius: theme.action.borderRadius,
183
+ background,
184
+ color,
185
+ font: "inherit",
186
+ fontWeight: theme.action.fontWeight,
187
+ cursor: "pointer",
188
+ transition: theme.action.transition,
189
+ outline: isFocused ? theme.action.focusOutline : "none",
190
+ outlineOffset: isFocused ? theme.action.focusOutlineOffset : void 0,
191
+ transform,
192
+ marginLeft: theme.action.marginLeft
193
+ };
194
+ }, [actionHoverColor, actionTextColor, isActive, isFocused, isHovered, theme.action]);
195
+ const handleActionClick = async () => {
196
+ if (!action) return;
197
+ try {
198
+ await action.onClick?.();
199
+ } catch (error) {
200
+ console.error("Notification action failed", error);
201
+ } finally {
202
+ toast.dismiss(notification.id);
203
+ }
204
+ };
205
+ return /* @__PURE__ */ jsxs(
206
+ "div",
207
+ {
208
+ style: {
209
+ padding: theme.contentPadding,
210
+ display: "flex",
211
+ flexDirection: "column",
212
+ gap: "0.5rem",
213
+ width: "100%",
214
+ textAlign: "left"
215
+ },
216
+ children: [
217
+ /* @__PURE__ */ jsxs(
218
+ "div",
219
+ {
220
+ style: {
221
+ display: "flex",
222
+ alignItems: "center",
223
+ gap: "0.5rem"
224
+ },
225
+ children: [
226
+ /* @__PURE__ */ jsx(
227
+ Icon,
228
+ {
229
+ style: { color: iconColor, padding: "0.125rem", width: "1.25rem", height: "1.25rem", flexShrink: 0 },
230
+ "aria-hidden": "true"
231
+ }
232
+ ),
233
+ /* @__PURE__ */ jsx("span", { className: "font-semibold leading-tight", children: title })
234
+ ]
235
+ }
236
+ ),
237
+ (content || action) && /* @__PURE__ */ jsxs(
238
+ "div",
239
+ {
240
+ style: {
241
+ display: "grid",
242
+ gridTemplateColumns: action ? "1fr auto" : "1fr",
243
+ columnGap: theme.bodyColumnGap,
244
+ rowGap: theme.bodyRowGap,
245
+ alignItems: "center",
246
+ width: "100%"
247
+ },
248
+ children: [
249
+ content && /* @__PURE__ */ jsx(
250
+ "span",
251
+ {
252
+ style: {
253
+ minWidth: 0,
254
+ textAlign: "left",
255
+ fontSize: "0.875rem",
256
+ color: textColor,
257
+ opacity: 0.9
258
+ },
259
+ children: content
260
+ }
261
+ ),
262
+ action && /* @__PURE__ */ jsx(
263
+ "button",
264
+ {
265
+ type: "button",
266
+ style: {
267
+ ...actionStyle,
268
+ marginTop: theme.action.marginTop,
269
+ fontSize: "0.875rem"
270
+ },
271
+ onMouseEnter: () => setIsHovered(true),
272
+ onMouseLeave: () => {
273
+ setIsHovered(false);
274
+ setIsActive(false);
275
+ },
276
+ onFocus: () => setIsFocused(true),
277
+ onBlur: () => {
278
+ setIsFocused(false);
279
+ setIsActive(false);
280
+ },
281
+ onMouseDown: () => setIsActive(true),
282
+ onMouseUp: () => setIsActive(false),
283
+ onClick: handleActionClick,
284
+ children: action.label
285
+ }
286
+ )
287
+ ]
288
+ }
289
+ )
290
+ ]
291
+ }
292
+ );
293
+ };
294
+
295
+ // src/feature/notifier/entity/toast-theme.ts
296
+ var DEFAULT_ACTION_THEME = {
297
+ padding: "0.35rem 0.75rem",
298
+ borderRadius: "0.5rem",
299
+ background: "rgba(79, 70, 229, 0.12)",
300
+ hoverBackground: "rgba(79, 70, 229, 0.2)",
301
+ focusOutline: "2px solid #4338ca",
302
+ focusOutlineOffset: "2px",
303
+ fontWeight: 600,
304
+ transition: "background-color 0.2s ease, color 0.2s ease, transform 0.2s ease",
305
+ focusTransform: "translateY(-1px)",
306
+ activeTransform: "translateY(0)",
307
+ marginLeft: "auto",
308
+ marginTop: "0.15rem"
309
+ };
310
+ var DEFAULT_ICON_COLORS = {
311
+ info: "#2563eb",
312
+ success: "#16a34a",
313
+ warning: "#f59e0b",
314
+ error: "#dc2626"
315
+ };
316
+ var DEFAULT_THEME_BASE = {
317
+ lightBg: "#f8fafc",
318
+ lightText: "#0f172a",
319
+ lightProgress: "#4f46e5",
320
+ darkBg: "#111827",
321
+ darkText: "#e5e7eb",
322
+ darkProgress: "#a5b4fc",
323
+ progressInfo: "#60a5fa",
324
+ progressSuccess: "#34d399",
325
+ progressWarning: "#fbbf24",
326
+ progressError: "#f87171",
327
+ width: "min(24rem, calc(100vw - 2rem))",
328
+ contentPadding: "0.5rem 0.75rem 1rem 0.5rem",
329
+ bodyColumnGap: "0.75rem",
330
+ bodyRowGap: "0.25rem",
331
+ transition: {
332
+ enter: "slideIn",
333
+ exit: "slideOut",
334
+ collapseDuration: 300
335
+ }
336
+ };
337
+ function resolveToastTheme(theme) {
338
+ return {
339
+ lightBg: theme?.lightBg ?? DEFAULT_THEME_BASE.lightBg,
340
+ lightText: theme?.lightText ?? DEFAULT_THEME_BASE.lightText,
341
+ lightProgress: theme?.lightProgress ?? DEFAULT_THEME_BASE.lightProgress,
342
+ darkBg: theme?.darkBg ?? DEFAULT_THEME_BASE.darkBg,
343
+ darkText: theme?.darkText ?? DEFAULT_THEME_BASE.darkText,
344
+ darkProgress: theme?.darkProgress ?? DEFAULT_THEME_BASE.darkProgress,
345
+ progressInfo: theme?.progressInfo ?? DEFAULT_THEME_BASE.progressInfo,
346
+ progressSuccess: theme?.progressSuccess ?? DEFAULT_THEME_BASE.progressSuccess,
347
+ progressWarning: theme?.progressWarning ?? DEFAULT_THEME_BASE.progressWarning,
348
+ progressError: theme?.progressError ?? DEFAULT_THEME_BASE.progressError,
349
+ width: theme?.width ?? DEFAULT_THEME_BASE.width,
350
+ contentPadding: theme?.contentPadding ?? DEFAULT_THEME_BASE.contentPadding,
351
+ bodyColumnGap: theme?.bodyColumnGap ?? DEFAULT_THEME_BASE.bodyColumnGap,
352
+ bodyRowGap: theme?.bodyRowGap ?? DEFAULT_THEME_BASE.bodyRowGap,
353
+ transition: theme?.transition ?? DEFAULT_THEME_BASE.transition,
354
+ action: {
355
+ ...DEFAULT_ACTION_THEME,
356
+ ...theme?.action ?? {}
357
+ },
358
+ iconColors: {
359
+ ...DEFAULT_ICON_COLORS,
360
+ ...theme?.iconColors ?? {}
361
+ }
362
+ };
363
+ }
135
364
 
136
365
  // src/feature/notifier/infra/web/react/NotificationHost.tsx
137
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
138
- var NotificationHost = ({ channel = DEFAULT_NOTIFICATION_CHANNEL, isDark }) => {
139
- const controller = useNotifierController();
366
+ import { jsx as jsx2 } from "react/jsx-runtime";
367
+ var NotificationHost = ({ channel = DEFAULT_NOTIFICATION_CHANNEL, isDark, theme }) => {
368
+ const resolvedTheme = useMemo2(() => resolveToastTheme(theme), [theme]);
369
+ const mode = useMemo2(() => {
370
+ if (!isDark) {
371
+ return "light";
372
+ }
373
+ return isDark() ? "dark" : "light";
374
+ }, [isDark]);
375
+ const style = useMemo2(() => ({
376
+ "--toastify-color-light": resolvedTheme.lightBg,
377
+ "--toastify-text-color-light": resolvedTheme.lightText,
378
+ "--toastify-color-progress-light": resolvedTheme.lightProgress,
379
+ "--toastify-color-dark": resolvedTheme.darkBg,
380
+ "--toastify-text-color-dark": resolvedTheme.darkText,
381
+ "--toastify-color-progress-dark": resolvedTheme.darkProgress,
382
+ "--toastify-color-progress-info": resolvedTheme.progressInfo,
383
+ "--toastify-color-progress-success": resolvedTheme.progressSuccess,
384
+ "--toastify-color-progress-warning": resolvedTheme.progressWarning,
385
+ "--toastify-color-progress-error": resolvedTheme.progressError,
386
+ "--toastify-toast-width": resolvedTheme.width
387
+ }), [resolvedTheme]);
388
+ const renderToast = useCallback((notification) => {
389
+ toast2(/* @__PURE__ */ jsx2(ToastContent, { notification, theme: resolvedTheme, mode }), {
390
+ toastId: notification.id,
391
+ icon: false
392
+ });
393
+ }, [mode, resolvedTheme]);
394
+ const transition = useMemo2(() => buildToastTransition(resolvedTheme.transition), [resolvedTheme.transition]);
140
395
  useEffect(() => {
141
396
  let unsub;
142
397
  let disposed = false;
143
- const listener = {
144
- notify(notification) {
145
- renderToast(notification);
146
- }
147
- };
148
- controller.handleSubscribe(channel, listener).then((unsubHandler) => {
398
+ const listener = { notify: renderToast };
399
+ notifierController.handleSubscribe(channel, listener).then((unsubHandler) => {
149
400
  if (disposed) {
150
401
  unsubHandler();
151
402
  return;
@@ -158,84 +409,23 @@ var NotificationHost = ({ channel = DEFAULT_NOTIFICATION_CHANNEL, isDark }) => {
158
409
  disposed = true;
159
410
  if (unsub) unsub();
160
411
  };
161
- }, [channel, controller]);
162
- const theme = useMemo2(() => {
163
- if (!isDark) {
164
- return "light";
165
- }
166
- return isDark() ? "dark" : "light";
167
- }, []);
412
+ }, [channel, renderToast]);
168
413
  return /* @__PURE__ */ jsx2(
169
414
  ToastContainer,
170
415
  {
416
+ style,
171
417
  position: "bottom-right",
172
- transition: SlideUp,
418
+ transition,
173
419
  newestOnTop: true,
174
420
  draggable: true,
175
421
  pauseOnFocusLoss: false,
176
422
  icon: false,
177
423
  pauseOnHover: true,
178
424
  hideProgressBar: false,
179
- className: "custom-toast-container",
180
- theme
425
+ theme: mode
181
426
  }
182
427
  );
183
428
  };
184
- var DEFAULT_NOTIFICATION_VARIANT = "info";
185
- var TOAST_ICON_BY_VARIANT = {
186
- success: { Icon: CheckCircleIcon, color: "var(--success)" },
187
- warning: { Icon: AlertTriangleIcon, color: "var(--warning)" },
188
- error: { Icon: XCircleIcon, color: "var(--danger)" },
189
- info: { Icon: InfoIcon, color: "var(--accent)" }
190
- };
191
- function renderToast(notification) {
192
- const variant = notification.variant ?? DEFAULT_NOTIFICATION_VARIANT;
193
- toast(/* @__PURE__ */ jsx2(ToastContent, { notification }), {
194
- type: variant,
195
- toastId: notification.id,
196
- icon: false
197
- });
198
- }
199
- var ToastContent = ({ notification }) => {
200
- const { title, content, action } = notification;
201
- const variant = notification.variant ?? DEFAULT_NOTIFICATION_VARIANT;
202
- const { Icon, color } = TOAST_ICON_BY_VARIANT[variant];
203
- const handleActionClick = async () => {
204
- if (!action) return;
205
- try {
206
- await action.onClick?.();
207
- } catch (error) {
208
- console.error("Notification action failed", error);
209
- } finally {
210
- toast.dismiss(notification.id);
211
- }
212
- };
213
- return /* @__PURE__ */ jsxs("div", { className: "toast-content flex w-full flex-col gap-2", children: [
214
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
215
- /* @__PURE__ */ jsx2(
216
- Icon,
217
- {
218
- className: "h-4 w-4 shrink-0",
219
- style: { color },
220
- "aria-hidden": "true"
221
- }
222
- ),
223
- /* @__PURE__ */ jsx2("span", { className: "font-semibold", children: title })
224
- ] }),
225
- (content || action) && /* @__PURE__ */ jsxs("div", { className: "flex w-full items-start gap-3", children: [
226
- content && /* @__PURE__ */ jsx2("span", { className: "flex-1 text-sm text-muted-foreground", children: content }),
227
- action && /* @__PURE__ */ jsx2(
228
- "button",
229
- {
230
- type: "button",
231
- className: "toast-action text-sm font-medium ml-auto shrink-0 self-end",
232
- onClick: handleActionClick,
233
- children: action.label
234
- }
235
- )
236
- ] })
237
- ] });
238
- };
239
429
 
240
430
  // src/util/responsive-query/use-responsive-mutation.ts
241
431
  function useResponsiveMutation(responsiveMutation, queryClient) {
@@ -281,9 +471,8 @@ export {
281
471
  DEFAULT_NOTIFICATION_CHANNEL,
282
472
  NotificationHost,
283
473
  NotifierController,
284
- NotifierProvider,
285
474
  notifierController,
475
+ resolveToastTheme,
286
476
  ui,
287
- useNotifierController,
288
477
  useResponsiveMutation
289
478
  };
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@hexdspace/react",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
- ".": "./dist/index.js"
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
9
12
  },
10
13
  "files": [
11
14
  "dist"
package/dist/index.css DELETED
@@ -1,79 +0,0 @@
1
- /* src/feature/notifier/infra/web/react/notification-host.css */
2
- @layer base {
3
- .custom-toast-container {
4
- --toastify-color-light: var(--surface-3);
5
- --toastify-text-color-light: var(--text-1);
6
- --toastify-color-progress-light: color-mix(in oklab, var(--accent-high), transparent 30%);
7
- --toastify-color-dark: var(--surface-1);
8
- --toastify-text-color-dark: var(--text-1);
9
- --toastify-color-progress-dark: color-mix(in oklab, var(--accent-high), transparent 30%);
10
- --toastify-color-progress-info: color-mix(in oklab, var(--accent), transparent 30%);
11
- --toastify-color-progress-success: color-mix(in oklab, var(--success), transparent 30%);
12
- --toastify-color-progress-warning: color-mix(in oklab, var(--warning), transparent 30%);
13
- --toastify-color-progress-error: color-mix(in oklab, var(--danger), transparent 30%);
14
- --toastify-toast-width: min(24rem, calc(100vw - 2rem));
15
- }
16
- }
17
- @supports (color-mix(in oklab, white, transparent)) {
18
- @layer base {
19
- .custom-toast-container {
20
- }
21
- }
22
- }
23
- @layer components {
24
- .toast-content {
25
- padding: 0.5rem 0.75rem 1rem 0.5rem;
26
- }
27
- .toast-action {
28
- align-self: flex-start;
29
- padding: 0.35rem 0.75rem;
30
- border-radius: var(--shape-radius-btn);
31
- background: color-mix(in oklab, var(--secondary-3), transparent 30%);
32
- color: var(--color-contrast-inverted);
33
- font: inherit;
34
- font-weight: 600;
35
- cursor: pointer;
36
- transition:
37
- background-color 0.2s ease,
38
- color 0.2s ease,
39
- transform 0.2s ease;
40
- }
41
- .toast-action:hover {
42
- background: var(--secondary-3);
43
- color: var(--contrast-inverted);
44
- }
45
- .toast-action:focus-visible {
46
- outline: 2px solid var(--focus);
47
- outline-offset: 2px;
48
- transform: translateY(-1px);
49
- }
50
- .toast-action:active {
51
- transform: translateY(0);
52
- }
53
- }
54
- @keyframes slideIn {
55
- from {
56
- transform: translateY(-20px);
57
- opacity: 0;
58
- }
59
- to {
60
- transform: translateY(0);
61
- opacity: 1;
62
- }
63
- }
64
- @keyframes slideOut {
65
- from {
66
- transform: translateY(0);
67
- opacity: 1;
68
- }
69
- to {
70
- transform: translateY(-20px);
71
- opacity: 0;
72
- }
73
- }
74
- .slideIn {
75
- animation: slideIn 0.35s forwards;
76
- }
77
- .slideOut {
78
- animation: slideOut 0.25s forwards;
79
- }