@infonomic/uikit 5.44.0 → 6.0.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/README.md +1 -1
- package/dist/components/accordion/accordion.d.ts +9 -9
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +4 -4
- package/dist/components/accordion/accordion.module.css +6 -5
- package/dist/components/accordion/accordion_module.css +4 -4
- package/dist/components/avatar/avatar.js +2 -2
- package/dist/components/badge/badge.d.ts +5 -13
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +12 -9
- package/dist/components/button/button-group.d.ts +9 -7
- package/dist/components/button/button-group.d.ts.map +1 -1
- package/dist/components/button/button-group.js +26 -36
- package/dist/components/button/button.d.ts +6 -13
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +19 -18
- package/dist/components/button/button.module.css +32 -54
- package/dist/components/button/button_module.css +7 -10
- package/dist/components/button/combo-button.d.ts +1 -1
- package/dist/components/button/combo-button.d.ts.map +1 -1
- package/dist/components/button/combo-button.js +13 -9
- package/dist/components/button/combo-button.module.css +16 -7
- package/dist/components/button/combo-button_module.css +22 -4
- package/dist/components/button/icon-button.d.ts +2 -3
- package/dist/components/button/icon-button.d.ts.map +1 -1
- package/dist/components/card/card.d.ts +5 -12
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +13 -9
- package/dist/components/chips/chip.d.ts +5 -11
- package/dist/components/chips/chip.d.ts.map +1 -1
- package/dist/components/chips/chip.js +36 -28
- package/dist/components/chips/chip.module.css +22 -36
- package/dist/components/chips/chip_module.css +3 -6
- package/dist/components/dropdown/dropdown.d.ts +28 -14
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.js +34 -20
- package/dist/components/forms/calendar.d.ts +1 -1
- package/dist/components/forms/calendar.d.ts.map +1 -1
- package/dist/components/forms/calendar.js +38 -29
- package/dist/components/forms/checkbox.astro +13 -8
- package/dist/components/forms/checkbox.d.ts +6 -2
- package/dist/components/forms/checkbox.d.ts.map +1 -1
- package/dist/components/forms/checkbox.js +11 -7
- package/dist/components/forms/checkbox.module.css +20 -20
- package/dist/components/forms/checkbox_module.css +13 -10
- package/dist/components/forms/input.module.css +10 -11
- package/dist/components/forms/input_module.css +3 -5
- package/dist/components/forms/radio-group.d.ts +6 -5
- package/dist/components/forms/radio-group.d.ts.map +1 -1
- package/dist/components/forms/radio-group.js +9 -4
- package/dist/components/forms/radio-group.module.css +13 -22
- package/dist/components/forms/radio-group_module.css +6 -24
- package/dist/components/forms/select.d.ts +4 -5
- package/dist/components/forms/select.d.ts.map +1 -1
- package/dist/components/forms/select.js +27 -29
- package/dist/components/forms/select.module.css +22 -22
- package/dist/components/forms/select.module.js +15 -15
- package/dist/components/forms/select_module.css +15 -15
- package/dist/components/notifications/@types/toast.d.ts +9 -7
- package/dist/components/notifications/@types/toast.d.ts.map +1 -1
- package/dist/components/notifications/toast.d.ts +12 -16
- package/dist/components/notifications/toast.d.ts.map +1 -1
- package/dist/components/notifications/toast.js +73 -57
- package/dist/components/notifications/toast.module.css +151 -177
- package/dist/components/notifications/toast.module.js +8 -12
- package/dist/components/notifications/toast_module.css +114 -159
- package/dist/components/pager/first-button.d.ts +2 -2
- package/dist/components/pager/first-button.d.ts.map +1 -1
- package/dist/components/pager/first-button.js +23 -16
- package/dist/components/pager/last-button.d.ts +2 -2
- package/dist/components/pager/last-button.d.ts.map +1 -1
- package/dist/components/pager/last-button.js +23 -16
- package/dist/components/pager/next-button.d.ts +2 -2
- package/dist/components/pager/next-button.d.ts.map +1 -1
- package/dist/components/pager/next-button.js +27 -20
- package/dist/components/pager/number-button.d.ts +2 -2
- package/dist/components/pager/number-button.d.ts.map +1 -1
- package/dist/components/pager/number-button.js +28 -23
- package/dist/components/pager/pagination.d.ts +8 -13
- package/dist/components/pager/pagination.d.ts.map +1 -1
- package/dist/components/pager/previous-button.d.ts +2 -2
- package/dist/components/pager/previous-button.d.ts.map +1 -1
- package/dist/components/pager/previous-button.js +25 -18
- package/dist/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +4 -2
- package/dist/components/tabs/tabs.d.ts +13 -13
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +8 -8
- package/dist/components/tabs/tabs.module.css +8 -17
- package/dist/components/tabs/tabs_module.css +1 -1
- package/dist/components/tooltip/tooltip.d.ts +6 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +49 -20
- package/dist/components/tooltip/tooltip.module.css +43 -10
- package/dist/components/tooltip/tooltip.module.js +7 -1
- package/dist/components/tooltip/tooltip_module.css +36 -4
- package/dist/hooks/use-focus-trap/index.d.ts +2 -0
- package/dist/hooks/use-focus-trap/index.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/index.js +1 -0
- package/dist/hooks/use-focus-trap/scope-tab.d.ts +11 -0
- package/dist/hooks/use-focus-trap/scope-tab.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/scope-tab.js +19 -0
- package/dist/hooks/use-focus-trap/tabbable.d.ts +14 -0
- package/dist/hooks/use-focus-trap/tabbable.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/tabbable.js +36 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.d.ts +11 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.js +45 -0
- package/dist/icons/chevron-up-icon.d.ts +7 -0
- package/dist/icons/chevron-up-icon.d.ts.map +1 -0
- package/dist/icons/chevron-up-icon.js +27 -0
- package/dist/lib/ripple.d.ts +25 -0
- package/dist/lib/ripple.d.ts.map +1 -0
- package/dist/lib/ripple.js +53 -0
- package/dist/styles/components-vanilla.css +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
- package/dist/widgets/datepicker/datepicker.js +118 -116
- package/dist/widgets/datepicker/datepicker.module.css +6 -5
- package/dist/widgets/datepicker/datepicker_module.css +4 -4
- package/dist/widgets/drawer/drawer-wrapper.d.ts.map +1 -1
- package/dist/widgets/drawer/drawer-wrapper.js +1 -1
- package/dist/widgets/modal/modal-wrapper.d.ts.map +1 -1
- package/dist/widgets/modal/modal-wrapper.js +1 -1
- package/package.json +2 -6
- package/src/components/accordion/accordion.module.css +6 -5
- package/src/components/accordion/accordion.stories.tsx +10 -13
- package/src/components/accordion/accordion.tsx +13 -13
- package/src/components/avatar/avatar.tsx +2 -2
- package/src/components/badge/badge.tsx +20 -29
- package/src/components/button/button-group.tsx +60 -44
- package/src/components/button/button.module.css +32 -54
- package/src/components/button/button.tsx +35 -47
- package/src/components/button/combo-button.module.css +16 -7
- package/src/components/button/combo-button.tsx +17 -9
- package/src/components/button/icon-button.tsx +3 -5
- package/src/components/card/card.tsx +20 -32
- package/src/components/chips/chip.module.css +22 -36
- package/src/components/chips/chip.stories.tsx +2 -2
- package/src/components/chips/chip.tsx +59 -57
- package/src/components/dropdown/dropdown.stories.tsx +2 -4
- package/src/components/dropdown/dropdown.tsx +86 -40
- package/src/components/forms/calendar.tsx +43 -33
- package/src/components/forms/checkbox-group.tsx +1 -1
- package/src/components/forms/checkbox.astro +13 -8
- package/src/components/forms/checkbox.module.css +20 -20
- package/src/components/forms/checkbox.tsx +11 -6
- package/src/components/forms/input.module.css +10 -11
- package/src/components/forms/radio-group.module.css +13 -22
- package/src/components/forms/radio-group.tsx +13 -11
- package/src/components/forms/select.module.css +22 -22
- package/src/components/forms/select.tsx +36 -33
- package/src/components/notifications/@types/toast.ts +9 -7
- package/src/components/notifications/toast.module.css +151 -177
- package/src/components/notifications/toast.stories.tsx +21 -23
- package/src/components/notifications/toast.tsx +90 -86
- package/src/components/pager/first-button.tsx +24 -26
- package/src/components/pager/last-button.tsx +24 -25
- package/src/components/pager/next-button.tsx +24 -23
- package/src/components/pager/number-button.tsx +37 -36
- package/src/components/pager/pagination.tsx +4 -11
- package/src/components/pager/previous-button.tsx +24 -24
- package/src/components/scroll-area/scroll-area.tsx +3 -3
- package/src/components/tabs/tabs.module.css +8 -17
- package/src/components/tabs/tabs.stories.tsx +5 -5
- package/src/components/tabs/tabs.tsx +17 -16
- package/src/components/tooltip/tooltip.module.css +43 -10
- package/src/components/tooltip/tooltip.stories.tsx +4 -4
- package/src/components/tooltip/tooltip.tsx +56 -28
- package/src/hooks/use-focus-trap/index.ts +1 -0
- package/src/hooks/use-focus-trap/scope-tab.ts +48 -0
- package/src/hooks/use-focus-trap/tabbable.ts +72 -0
- package/src/hooks/use-focus-trap/use-focus-trap.ts +83 -0
- package/src/icons/chevron-up-icon.tsx +37 -0
- package/src/lib/ripple.ts +95 -0
- package/src/widgets/datepicker/datepicker.module.css +6 -5
- package/src/widgets/datepicker/datepicker.tsx +137 -135
- package/src/widgets/drawer/drawer-wrapper.tsx +1 -1
- package/src/widgets/modal/modal-wrapper.tsx +1 -1
|
@@ -19,14 +19,14 @@ import type { Icons as i, Position as p, Intent as t } from '../../@types/shared
|
|
|
19
19
|
*/
|
|
20
20
|
export type Intent = 'primary' | t;
|
|
21
21
|
/**
|
|
22
|
-
* Screen corner position for the toast
|
|
22
|
+
* Screen corner position for the toast viewport.
|
|
23
23
|
*
|
|
24
24
|
* - `top-left` — top-left corner of the viewport
|
|
25
25
|
* - `top-right` — top-right corner of the viewport (default)
|
|
26
26
|
* - `bottom-left` — bottom-left corner of the viewport
|
|
27
27
|
* - `bottom-right` — bottom-right corner of the viewport
|
|
28
28
|
*
|
|
29
|
-
* @default '
|
|
29
|
+
* @default 'bottom-right'
|
|
30
30
|
*/
|
|
31
31
|
export type Position = 'top-right' | p;
|
|
32
32
|
/**
|
|
@@ -35,10 +35,12 @@ export type Position = 'top-right' | p;
|
|
|
35
35
|
*/
|
|
36
36
|
export type IconType = 'success' | i;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Use this to sync dismissal with external state.
|
|
40
|
-
*
|
|
41
|
-
* @param open - `true` when the toast becomes visible, `false` when dismissed
|
|
38
|
+
* Custom data passed to each toast via the toast manager's `add()` method.
|
|
42
39
|
*/
|
|
43
|
-
export
|
|
40
|
+
export interface ToastData {
|
|
41
|
+
intent?: Intent;
|
|
42
|
+
iconType?: IconType;
|
|
43
|
+
icon?: boolean;
|
|
44
|
+
close?: boolean;
|
|
45
|
+
}
|
|
44
46
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../src/components/notifications/@types/toast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,CAAC,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,wBAAwB,CAAA;AAEpF;;GAEG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAA;AAElC;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,CAAC,CAAA;AAEtC;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,CAAA;AAEpC
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../src/components/notifications/@types/toast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,CAAC,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,wBAAwB,CAAA;AAEpF;;GAEG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAA;AAElC;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,CAAC,CAAA;AAEtC;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,CAAA;AAEpC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
2
|
+
import type { Position, ToastData } from './@types/toast.js';
|
|
3
|
+
export declare const useToastManager: () => import("@base-ui/react").UseToastManagerReturnValue<ToastData>;
|
|
4
|
+
export declare const createToastManager: () => import("@base-ui/react").ToastManager<ToastData>;
|
|
5
|
+
export interface ToastProviderProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
toastManager?: ReturnType<typeof createToastManager>;
|
|
10
|
+
}
|
|
11
|
+
export declare function ToastProvider({ children, timeout, limit, toastManager, }: ToastProviderProps): React.JSX.Element;
|
|
12
|
+
export interface ToastViewportProps {
|
|
6
13
|
position?: Position;
|
|
7
|
-
title: string;
|
|
8
|
-
message: string;
|
|
9
|
-
icon?: boolean;
|
|
10
|
-
iconType?: IconType;
|
|
11
|
-
close?: boolean;
|
|
12
|
-
open: boolean;
|
|
13
|
-
onOpenChange: OnOpenChange;
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
17
|
-
export declare const ToastViewport: React.ForwardRefExoticComponent<ToastPrimitive.ToastViewportProps & React.RefAttributes<HTMLOListElement>>;
|
|
18
|
-
export declare const Toast: ({ ref, intent, position, title, message, icon, iconType, close, open, onOpenChange, className, }: ToastProps & {
|
|
19
|
-
ref?: React.RefObject<HTMLLIElement>;
|
|
20
|
-
}) => React.JSX.Element;
|
|
16
|
+
export declare function ToastViewport({ position, className }: ToastViewportProps): React.JSX.Element;
|
|
21
17
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/notifications/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAU5D,eAAO,MAAM,eAAe,sEAA4C,CAAA;AACxE,eAAO,MAAM,kBAAkB,wDAA+C,CAAA;AAE9E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;CACrD;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAc,EACd,KAAS,EACT,YAAY,GACb,EAAE,kBAAkB,qBAMpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAyB,EAAE,SAAS,EAAE,EAAE,kBAAkB,qBAazF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import react from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Toast } from "@base-ui/react/toast";
|
|
5
5
|
import classnames from "classnames";
|
|
6
|
-
import { Toast as external_radix_ui_Toast } from "radix-ui";
|
|
7
6
|
import { CloseIcon } from "../../icons/close-icon.js";
|
|
8
7
|
import { DangerIcon } from "../../icons/danger-icon.js";
|
|
9
8
|
import { InfoIcon } from "../../icons/info-icon.js";
|
|
@@ -17,66 +16,83 @@ const toastIcons = {
|
|
|
17
16
|
warning: WarningIcon,
|
|
18
17
|
danger: DangerIcon
|
|
19
18
|
};
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
const useToastManager = Toast.useToastManager;
|
|
20
|
+
const createToastManager = Toast.createToastManager;
|
|
21
|
+
function ToastProvider({ children, timeout = 5000, limit = 3, toastManager }) {
|
|
22
|
+
return /*#__PURE__*/ jsx(Toast.Provider, {
|
|
23
|
+
timeout: timeout,
|
|
24
|
+
limit: limit,
|
|
25
|
+
toastManager: toastManager,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function ToastViewport({ position = 'bottom-right', className }) {
|
|
30
|
+
const { toasts } = Toast.useToastManager();
|
|
31
|
+
return /*#__PURE__*/ jsx(Toast.Portal, {
|
|
32
|
+
children: /*#__PURE__*/ jsx(Toast.Viewport, {
|
|
33
|
+
className: classnames('infonomic-toast-viewport', toast_module.viewport, toast_module[position], className),
|
|
34
|
+
children: toasts.map((toast)=>/*#__PURE__*/ jsx(ToastItem, {
|
|
35
|
+
toast: toast
|
|
36
|
+
}, toast.id))
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function ToastItem({ toast }) {
|
|
41
|
+
const { intent = 'success', iconType = 'success', icon = true, close = true } = toast.data ?? {};
|
|
23
42
|
const eventDateRef = react.useRef(new Date());
|
|
24
|
-
react.useRef(0);
|
|
25
|
-
const focusTrapRef = useFocusTrap();
|
|
26
|
-
const mergedRef = useMergedRef(ref, focusTrapRef);
|
|
27
43
|
const Icon = toastIcons[iconType];
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
const swipeDirection = react.useMemo(()=>[
|
|
45
|
+
'down',
|
|
46
|
+
'right'
|
|
47
|
+
], []);
|
|
48
|
+
return /*#__PURE__*/ jsx(Toast.Root, {
|
|
49
|
+
toast: toast,
|
|
50
|
+
swipeDirection: swipeDirection,
|
|
51
|
+
className: classnames('infonomic-toast', toast_module.root),
|
|
52
|
+
children: /*#__PURE__*/ jsxs(Toast.Content, {
|
|
53
|
+
className: classnames('infonomic-toast-content', toast_module.content),
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ jsxs("div", {
|
|
56
|
+
className: classnames('infonomic-toast-header', toast_module.header),
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsx("time", {
|
|
59
|
+
dateTime: eventDateRef.current.toISOString(),
|
|
60
|
+
className: "text-sm",
|
|
61
|
+
children: new Intl.DateTimeFormat('default', {
|
|
62
|
+
hour12: true,
|
|
63
|
+
hour: 'numeric',
|
|
64
|
+
minute: 'numeric'
|
|
65
|
+
}).format(eventDateRef.current)
|
|
66
|
+
}),
|
|
67
|
+
close && /*#__PURE__*/ jsx(Toast.Close, {
|
|
68
|
+
render: /*#__PURE__*/ jsx(Button, {
|
|
69
|
+
intent: intent,
|
|
70
|
+
tabIndex: 0,
|
|
71
|
+
variant: "filled",
|
|
72
|
+
"aria-label": "Close",
|
|
73
|
+
className: classnames('infonomic-toast-close', toast_module.close),
|
|
74
|
+
type: "button"
|
|
75
|
+
}),
|
|
60
76
|
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
61
77
|
height: "12px",
|
|
62
78
|
width: "12px"
|
|
63
79
|
})
|
|
64
80
|
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ jsxs(Toast.Title, {
|
|
84
|
+
className: classnames('infonomic-toast-title', toast_module.title),
|
|
85
|
+
children: [
|
|
86
|
+
icon && Icon && /*#__PURE__*/ jsx(Icon, {}),
|
|
87
|
+
toast.title
|
|
88
|
+
]
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ jsx(Toast.Description, {
|
|
91
|
+
className: classnames("infonomic-toast-description", toast_module.description),
|
|
92
|
+
children: toast.description
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
})
|
|
80
96
|
});
|
|
81
|
-
}
|
|
82
|
-
export { ToastProvider, ToastViewport,
|
|
97
|
+
}
|
|
98
|
+
export { ToastProvider, ToastViewport, createToastManager, useToastManager };
|
|
@@ -1,17 +1,104 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
/*
|
|
10
|
-
|
|
9
|
+
/* ============================================
|
|
10
|
+
Viewport — fixed-position container for toasts.
|
|
11
|
+
Position classes are applied here.
|
|
12
|
+
============================================ */
|
|
13
|
+
|
|
14
|
+
.viewport,
|
|
15
|
+
:global(.infonomic-toast-viewport) {
|
|
16
|
+
--viewport-padding: 16px;
|
|
17
|
+
position: fixed;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
z-index: var(--z-index-toast);
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Mobile: full-width at all positions */
|
|
26
|
+
|
|
27
|
+
.top-left,
|
|
28
|
+
:global(.infonomic-toast-top-left) {
|
|
29
|
+
top: 88px;
|
|
30
|
+
right: var(--viewport-padding);
|
|
31
|
+
left: var(--viewport-padding);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.top-right,
|
|
35
|
+
:global(.infonomic-toast-top-right) {
|
|
36
|
+
top: 88px;
|
|
37
|
+
right: var(--viewport-padding);
|
|
38
|
+
left: var(--viewport-padding);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bottom-left,
|
|
42
|
+
:global(.infonomic-toast-bottom-left) {
|
|
43
|
+
bottom: var(--viewport-padding);
|
|
44
|
+
right: var(--viewport-padding);
|
|
45
|
+
left: var(--viewport-padding);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bottom-right,
|
|
49
|
+
:global(.infonomic-toast-bottom-right) {
|
|
50
|
+
bottom: var(--viewport-padding);
|
|
51
|
+
right: var(--viewport-padding);
|
|
52
|
+
left: var(--viewport-padding);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (min-width: 48rem) {
|
|
56
|
+
|
|
57
|
+
.bottom-right,
|
|
58
|
+
:global(.infonomic-toast-bottom-right) {
|
|
59
|
+
bottom: var(--viewport-padding);
|
|
60
|
+
right: var(--viewport-padding);
|
|
61
|
+
left: auto;
|
|
62
|
+
width: 100%;
|
|
63
|
+
max-width: 390px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bottom-left,
|
|
67
|
+
:global(.infonomic-toast-bottom-left) {
|
|
68
|
+
bottom: var(--viewport-padding);
|
|
69
|
+
left: var(--viewport-padding);
|
|
70
|
+
right: auto;
|
|
71
|
+
width: 100%;
|
|
72
|
+
max-width: 390px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.top-left,
|
|
76
|
+
:global(.infonomic-toast-top-left) {
|
|
77
|
+
top: 88px;
|
|
78
|
+
left: var(--viewport-padding);
|
|
79
|
+
right: auto;
|
|
80
|
+
bottom: auto;
|
|
81
|
+
width: 100%;
|
|
82
|
+
max-width: 390px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.top-right,
|
|
86
|
+
:global(.infonomic-toast-top-right) {
|
|
87
|
+
top: 88px;
|
|
88
|
+
right: var(--viewport-padding);
|
|
89
|
+
bottom: auto;
|
|
90
|
+
left: auto;
|
|
91
|
+
width: 100%;
|
|
92
|
+
max-width: 390px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ============================================
|
|
97
|
+
Root — individual toast wrapper
|
|
98
|
+
============================================ */
|
|
11
99
|
|
|
12
100
|
.root,
|
|
13
101
|
:global(.infonomic-toast-root) {
|
|
14
|
-
position: fixed;
|
|
15
102
|
display: flex;
|
|
16
103
|
flex-direction: column;
|
|
17
104
|
gap: var(--gap-1);
|
|
@@ -23,51 +110,83 @@
|
|
|
23
110
|
border-style: var(--border-style-solid);
|
|
24
111
|
border-radius: var(--border-radius-md);
|
|
25
112
|
box-shadow: var(--shadow-sm);
|
|
113
|
+
transform: translateX(var(--toast-swipe-movement-x, 0)) translateY(var(--toast-swipe-movement-y, 0));
|
|
114
|
+
transition:
|
|
115
|
+
transform 200ms ease-out,
|
|
116
|
+
opacity 150ms ease-in;
|
|
26
117
|
}
|
|
27
118
|
|
|
28
119
|
:global(.dark),
|
|
29
120
|
:global([data-theme="dark"]) {
|
|
121
|
+
|
|
30
122
|
.root,
|
|
31
123
|
:global(.infonomic-toast-root) {
|
|
32
124
|
background: var(--canvas-800);
|
|
33
125
|
}
|
|
34
126
|
}
|
|
35
127
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
128
|
+
/* Entry animation */
|
|
129
|
+
.root[data-starting-style],
|
|
130
|
+
:global(.infonomic-toast-root[data-starting-style]) {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
transform: translateY(calc(100% + var(--viewport-padding)));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (min-width: 48rem) {
|
|
136
|
+
|
|
137
|
+
.viewport.top-right .root[data-starting-style],
|
|
138
|
+
.viewport.bottom-right .root[data-starting-style],
|
|
139
|
+
:global(.infonomic-toast-viewport.top-right .infonomic-toast-root[data-starting-style]),
|
|
140
|
+
:global(.infonomic-toast-viewport.bottom-right .infonomic-toast-root[data-starting-style]) {
|
|
141
|
+
opacity: 0;
|
|
142
|
+
transform: translateX(calc(100% + var(--viewport-padding)));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.viewport.top-left .root[data-starting-style],
|
|
146
|
+
.viewport.bottom-left .root[data-starting-style],
|
|
147
|
+
:global(.infonomic-toast-viewport.top-left .infonomic-toast-root[data-starting-style]),
|
|
148
|
+
:global(.infonomic-toast-viewport.bottom-left .infonomic-toast-root[data-starting-style]) {
|
|
149
|
+
opacity: 0;
|
|
150
|
+
transform: translateX(calc(-100% - var(--viewport-padding)));
|
|
151
|
+
}
|
|
39
152
|
}
|
|
40
153
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
154
|
+
/* Exit animation */
|
|
155
|
+
.root[data-ending-style],
|
|
156
|
+
:global(.infonomic-toast-root[data-ending-style]) {
|
|
157
|
+
opacity: 0;
|
|
44
158
|
}
|
|
45
159
|
|
|
46
|
-
.root[data-swipe="
|
|
47
|
-
:global(.infonomic-toast-root[data-swipe="
|
|
48
|
-
transform: translateX(var(--
|
|
160
|
+
.root[data-ending-style][data-swipe-direction="right"],
|
|
161
|
+
:global(.infonomic-toast-root[data-ending-style][data-swipe-direction="right"]) {
|
|
162
|
+
transform: translateX(calc(var(--toast-swipe-movement-x, 0) + 100% + var(--viewport-padding)));
|
|
49
163
|
}
|
|
50
164
|
|
|
51
|
-
.root[data-swipe="
|
|
52
|
-
:global(.infonomic-toast-root[data-swipe="
|
|
53
|
-
transform: translateX(0);
|
|
54
|
-
transition: transform 200ms ease-out;
|
|
165
|
+
.root[data-ending-style][data-swipe-direction="left"],
|
|
166
|
+
:global(.infonomic-toast-root[data-ending-style][data-swipe-direction="left"]) {
|
|
167
|
+
transform: translateX(calc(var(--toast-swipe-movement-x, 0) - 100% - var(--viewport-padding)));
|
|
55
168
|
}
|
|
56
169
|
|
|
57
|
-
.root
|
|
58
|
-
.root
|
|
59
|
-
|
|
60
|
-
:global(.infonomic-toast-root.bottom-right[data-swipe="end"]) {
|
|
61
|
-
animation: swipeOutToRight 100ms ease-out;
|
|
170
|
+
.root[data-ending-style][data-swipe-direction="down"],
|
|
171
|
+
:global(.infonomic-toast-root[data-ending-style][data-swipe-direction="down"]) {
|
|
172
|
+
transform: translateY(calc(var(--toast-swipe-movement-y, 0) + 150%));
|
|
62
173
|
}
|
|
63
174
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
175
|
+
/* ============================================
|
|
176
|
+
Content — overflow container for stacking
|
|
177
|
+
============================================ */
|
|
178
|
+
|
|
179
|
+
.content,
|
|
180
|
+
:global(.infonomic-toast-content) {
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
gap: var(--gap-1);
|
|
69
184
|
}
|
|
70
185
|
|
|
186
|
+
/* ============================================
|
|
187
|
+
Header / Close / Title / Description / Action
|
|
188
|
+
============================================ */
|
|
189
|
+
|
|
71
190
|
.header,
|
|
72
191
|
:global(.infonomic-toast-header) {
|
|
73
192
|
display: flex;
|
|
@@ -122,149 +241,4 @@
|
|
|
122
241
|
justify-content: end;
|
|
123
242
|
padding: 0 12px 0 12px;
|
|
124
243
|
}
|
|
125
|
-
|
|
126
|
-
/* Positions are relative to the toast viewport which is set
|
|
127
|
-
globally in components/toast.css */
|
|
128
|
-
|
|
129
|
-
.top-left,
|
|
130
|
-
:global(.infonomic-toast-top-left) {
|
|
131
|
-
top: 88px;
|
|
132
|
-
right: 16px;
|
|
133
|
-
left: 16px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.top-right,
|
|
137
|
-
:global(.infonomic-toast-top-right) {
|
|
138
|
-
top: 88px;
|
|
139
|
-
right: 16px;
|
|
140
|
-
left: 16px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.bottom-left,
|
|
144
|
-
:global(.infonomic-toast-bottom-left) {
|
|
145
|
-
bottom: 16px;
|
|
146
|
-
right: 16px;
|
|
147
|
-
left: 16px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.bottom-right,
|
|
151
|
-
:global(.infonomic-toast-bottom-right) {
|
|
152
|
-
bottom: 16px;
|
|
153
|
-
right: 16px;
|
|
154
|
-
left: 16px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
@media (min-width: 48rem) {
|
|
158
|
-
.root.top-right[data-state="open"],
|
|
159
|
-
.root.bottom-right[data-state="open"],
|
|
160
|
-
:global(.infonomic-toast-root.top-right[data-state="open"]),
|
|
161
|
-
:global(.infonomic-toast-root.bottom-right[data-state="open"]) {
|
|
162
|
-
animation: slideInFromRight 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.root.top-left[data-state="open"],
|
|
166
|
-
.root.bottom-left[data-state="open"],
|
|
167
|
-
:global(.infonomic-toast-root.top-left[data-state="open"]),
|
|
168
|
-
:global(.infonomic-toast-root.bottom-left[data-state="open"]) {
|
|
169
|
-
animation: slideInFromLeft 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.bottom-right,
|
|
173
|
-
:global(.infonomic-toast-bottom-right) {
|
|
174
|
-
bottom: 16px;
|
|
175
|
-
right: 16px;
|
|
176
|
-
left: auto;
|
|
177
|
-
width: 100%;
|
|
178
|
-
max-width: 390px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.bottom-left,
|
|
182
|
-
:global(.infonomic-toast-bottom-left) {
|
|
183
|
-
bottom: 16px;
|
|
184
|
-
left: 16px;
|
|
185
|
-
right: auto;
|
|
186
|
-
width: 100%;
|
|
187
|
-
max-width: 390px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.top-left,
|
|
191
|
-
:global(.infonomic-toast-top-left) {
|
|
192
|
-
top: 88px;
|
|
193
|
-
left: 16px;
|
|
194
|
-
right: auto;
|
|
195
|
-
bottom: auto;
|
|
196
|
-
width: 100%;
|
|
197
|
-
max-width: 390px;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.top-right,
|
|
201
|
-
:global(.infonomic-toast-top-right) {
|
|
202
|
-
top: 88px;
|
|
203
|
-
right: 16px;
|
|
204
|
-
bottom: auto;
|
|
205
|
-
left: auto;
|
|
206
|
-
width: 100%;
|
|
207
|
-
max-width: 390px;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@keyframes slideInFromRight {
|
|
212
|
-
from {
|
|
213
|
-
transform: translateX(calc(100% + var(--viewport-padding)));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
to {
|
|
217
|
-
transform: translateX(0);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
@keyframes slideInFromLeft {
|
|
222
|
-
from {
|
|
223
|
-
transform: translateX(calc(-100% - var(--viewport-padding)));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
to {
|
|
227
|
-
transform: translateX(0);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
@keyframes slideInFromBottom {
|
|
232
|
-
from {
|
|
233
|
-
transform: translateY(calc(100% + var(--viewport-padding)));
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
to {
|
|
237
|
-
transform: translateY(0);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
@keyframes swipeOutToRight {
|
|
242
|
-
from {
|
|
243
|
-
transform: translateX(var(--radix-toast-swipe-end-x));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
to {
|
|
247
|
-
transform: translateX(calc(100% + var(--viewport-padding)));
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@keyframes swipeOutToLeft {
|
|
252
|
-
from {
|
|
253
|
-
transform: translateX(var(--radix-toast-swipe-end-x));
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
to {
|
|
257
|
-
transform: translateX(calc(-100% - var(--viewport-padding)));
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@keyframes hide {
|
|
262
|
-
from {
|
|
263
|
-
opacity: 1;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
to {
|
|
267
|
-
opacity: 0;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
244
|
+
}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import "./toast_module.css";
|
|
2
2
|
const toast_module = {
|
|
3
|
-
|
|
4
|
-
slideInFromBottom: "slideInFromBottom-O94u9U",
|
|
5
|
-
hide: "hide-vlOoW0",
|
|
6
|
-
"top-right": "top-right-OsKbVb",
|
|
7
|
-
topRight: "top-right-OsKbVb",
|
|
8
|
-
"bottom-right": "bottom-right-Nzuhur",
|
|
9
|
-
bottomRight: "bottom-right-Nzuhur",
|
|
10
|
-
swipeOutToRight: "swipeOutToRight-FWaeVx",
|
|
3
|
+
viewport: "viewport-x4CvHl",
|
|
11
4
|
"top-left": "top-left-dy_IMc",
|
|
12
5
|
topLeft: "top-left-dy_IMc",
|
|
6
|
+
"top-right": "top-right-OsKbVb",
|
|
7
|
+
topRight: "top-right-OsKbVb",
|
|
13
8
|
"bottom-left": "bottom-left-_RdEZn",
|
|
14
9
|
bottomLeft: "bottom-left-_RdEZn",
|
|
15
|
-
|
|
10
|
+
"bottom-right": "bottom-right-Nzuhur",
|
|
11
|
+
bottomRight: "bottom-right-Nzuhur",
|
|
12
|
+
root: "root-dWN7jD",
|
|
13
|
+
content: "content-o83ZAp",
|
|
16
14
|
header: "header-ItoxDs",
|
|
17
15
|
close: "close-HwTMjn",
|
|
18
16
|
title: "title-qfQE8M",
|
|
19
17
|
description: "description-nQWtgX",
|
|
20
|
-
action: "action-PunqB2"
|
|
21
|
-
slideInFromRight: "slideInFromRight-G4Hu_M",
|
|
22
|
-
slideInFromLeft: "slideInFromLeft-m703fy"
|
|
18
|
+
action: "action-PunqB2"
|
|
23
19
|
};
|
|
24
20
|
export default toast_module;
|