@cerberus-design/react 1.2.1 → 1.3.0-rc.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.
Files changed (60) hide show
  1. package/dist/components/admonition/primitives.cjs +5 -5
  2. package/dist/components/admonition/primitives.d.cts +13 -2856
  3. package/dist/components/admonition/primitives.d.ts +13 -2856
  4. package/dist/components/admonition/primitives.js +6 -6
  5. package/dist/components/combobox/use-stateful-collection.cjs +1 -1
  6. package/dist/components/combobox/use-stateful-collection.js +1 -1
  7. package/dist/components/dialog/dialog.cjs +1 -1
  8. package/dist/components/dialog/dialog.js +1 -1
  9. package/dist/components/dialog/index.cjs +1 -0
  10. package/dist/components/dialog/index.js +2 -2
  11. package/dist/components/dialog/primitives.cjs +2 -0
  12. package/dist/components/dialog/primitives.d.cts +5 -2
  13. package/dist/components/dialog/primitives.d.ts +5 -2
  14. package/dist/components/dialog/primitives.js +2 -1
  15. package/dist/components/icon-button/button.cjs +1 -3
  16. package/dist/components/icon-button/button.js +1 -3
  17. package/dist/components/icon-button/primitives.cjs +4 -2
  18. package/dist/components/icon-button/primitives.d.cts +5 -5
  19. package/dist/components/icon-button/primitives.d.ts +5 -5
  20. package/dist/components/icon-button/primitives.js +4 -2
  21. package/dist/components/notifications/center.cjs +7 -23
  22. package/dist/components/notifications/center.d.cts +2 -6
  23. package/dist/components/notifications/center.d.ts +2 -6
  24. package/dist/components/notifications/center.js +8 -23
  25. package/dist/components/notifications/index.cjs +0 -14
  26. package/dist/components/notifications/index.js +3 -3
  27. package/dist/components/notifications/match-icon.cjs +7 -1
  28. package/dist/components/notifications/match-icon.d.cts +1 -5
  29. package/dist/components/notifications/match-icon.d.ts +1 -5
  30. package/dist/components/notifications/match-icon.js +7 -1
  31. package/dist/components/notifications/toaster.d.cts +0 -1
  32. package/dist/components/notifications/toaster.d.ts +0 -1
  33. package/dist/components/notifications/toaster.js +2 -2
  34. package/dist/components/notifications/types.d.cts +4 -30
  35. package/dist/components/notifications/types.d.ts +4 -30
  36. package/dist/components/pagination/triggers.d.cts +2 -3
  37. package/dist/components/pagination/triggers.d.ts +2 -3
  38. package/dist/components/progress/primitives.cjs +2 -2
  39. package/dist/components/progress/primitives.d.cts +7 -1904
  40. package/dist/components/progress/primitives.d.ts +7 -1904
  41. package/dist/components/progress/primitives.js +3 -3
  42. package/dist/components/table/primitives.cjs +10 -10
  43. package/dist/components/table/primitives.d.cts +23 -9488
  44. package/dist/components/table/primitives.d.ts +23 -9488
  45. package/dist/components/table/primitives.js +11 -11
  46. package/dist/components/tooltip/renderer.cjs +11 -0
  47. package/dist/components/tooltip/renderer.d.cts +6 -0
  48. package/dist/components/tooltip/renderer.d.ts +6 -0
  49. package/dist/components/tooltip/renderer.js +11 -0
  50. package/dist/components/tooltip/tooltip.cjs +6 -2
  51. package/dist/components/tooltip/tooltip.d.cts +4 -0
  52. package/dist/components/tooltip/tooltip.d.ts +4 -0
  53. package/dist/components/tooltip/tooltip.js +6 -2
  54. package/dist/index.cjs +4 -5
  55. package/dist/index.client.d.cts +1 -1
  56. package/dist/index.client.d.ts +1 -1
  57. package/dist/index.client.js +2 -2
  58. package/dist/index.js +6 -6
  59. package/dist/panda.buildinfo.json +15 -3
  60. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- import { cerberus, createCerberusPrimitive } from "../../system/index.js";
1
+ import { createCerberusPrimitive } from "../../system/index.js";
2
2
  import { admonition } from "styled-system/recipes";
3
3
  //#region src/components/admonition/primitives.tsx
4
4
  /**
@@ -9,35 +9,35 @@ var { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(admonition);
9
9
  /**
10
10
  * The `AdmonitionRoot` component is the container for the Admonition.
11
11
  */
12
- var AdmonitionRoot = withSlotRecipe(cerberus.aside, "root", { defaultProps: {
12
+ var AdmonitionRoot = withSlotRecipe("animateMotion", "root", { defaultProps: {
13
13
  "data-scope": "admonition",
14
14
  "data-part": "root"
15
15
  } });
16
16
  /**
17
17
  * The `AdmonitionIndicator` component is the indicator for the Admonition.
18
18
  */
19
- var AdmonitionIndicator = withNoRecipe(cerberus.span, { defaultProps: {
19
+ var AdmonitionIndicator = withNoRecipe("span", { defaultProps: {
20
20
  "data-scope": "admonition",
21
21
  "data-part": "indicator"
22
22
  } });
23
23
  /**
24
24
  * The `AdmonitionContent` component is the content for the Admonition.
25
25
  */
26
- var AdmonitionContent = withNoRecipe(cerberus.div, { defaultProps: {
26
+ var AdmonitionContent = withNoRecipe("div", { defaultProps: {
27
27
  "data-scope": "admonition",
28
28
  "data-part": "content"
29
29
  } });
30
30
  /**
31
31
  * The `AdmonitionHeading` component is the heading title for the Admonition.
32
32
  */
33
- var AdmonitionHeading = withSlotRecipe(cerberus.p, "heading", { defaultProps: {
33
+ var AdmonitionHeading = withSlotRecipe("p", "heading", { defaultProps: {
34
34
  "data-scope": "admonition",
35
35
  "data-part": "heading"
36
36
  } });
37
37
  /**
38
38
  * The `AdmonitionDescription` component is the description for the Admonition.
39
39
  */
40
- var AdmonitionDescription = withSlotRecipe(cerberus.p, "description", { defaultProps: {
40
+ var AdmonitionDescription = withSlotRecipe("p", "description", { defaultProps: {
41
41
  "data-scope": "admonition",
42
42
  "data-part": "description"
43
43
  } });
@@ -15,7 +15,7 @@ function useStatefulCollection(initialItems = []) {
15
15
  const collection = (0, react.useMemo)(() => require_primitives.createSelectCollection(items), [items]);
16
16
  const handleInputChange = (0, react.useCallback)((details) => {
17
17
  if (details.inputValue === "") return setItems(initialItems);
18
- setItems((prev) => prev.filter((item) => item.value.includes(details.inputValue.toLowerCase())));
18
+ setItems((prev) => prev.filter((item) => item.value.toLowerCase().includes(details.inputValue.toLowerCase()) || item.label.toLowerCase().includes(details.inputValue.toLowerCase())));
19
19
  setFilterValue(details.inputValue.split(""));
20
20
  }, [initialItems]);
21
21
  return (0, react.useMemo)(() => ({
@@ -15,7 +15,7 @@ function useStatefulCollection(initialItems = []) {
15
15
  const collection = useMemo(() => createSelectCollection(items), [items]);
16
16
  const handleInputChange = useCallback((details) => {
17
17
  if (details.inputValue === "") return setItems(initialItems);
18
- setItems((prev) => prev.filter((item) => item.value.includes(details.inputValue.toLowerCase())));
18
+ setItems((prev) => prev.filter((item) => item.value.toLowerCase().includes(details.inputValue.toLowerCase()) || item.label.toLowerCase().includes(details.inputValue.toLowerCase())));
19
19
  setFilterValue(details.inputValue.split(""));
20
20
  }, [initialItems]);
21
21
  return useMemo(() => ({
@@ -1,5 +1,5 @@
1
- const require_primitives = require("./primitives.cjs");
2
1
  const require_portal = require("../portal/portal.cjs");
2
+ const require_primitives = require("./primitives.cjs");
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
4
  //#region src/components/dialog/dialog.tsx
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { DialogBackdrop, DialogContent, DialogPositioner } from "./primitives.js";
2
1
  import { Portal } from "../portal/portal.js";
2
+ import { DialogBackdrop, DialogContent, DialogPositioner } from "./primitives.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/dialog/dialog.tsx
5
5
  /**
@@ -8,6 +8,7 @@ exports.DialogBackdrop = require_primitives.DialogBackdrop;
8
8
  exports.DialogCloseIconTrigger = require_close_icon_trigger.DialogCloseIconTrigger;
9
9
  exports.DialogCloseTrigger = require_primitives.DialogCloseTrigger;
10
10
  exports.DialogContent = require_primitives.DialogContent;
11
+ exports.DialogContext = require_primitives.DialogContext;
11
12
  exports.DialogDescription = require_primitives.DialogDescription;
12
13
  exports.DialogHeading = require_primitives.DialogHeading;
13
14
  exports.DialogParts = require_parts.DialogParts;
@@ -1,5 +1,5 @@
1
- import { DialogBackdrop, DialogCloseTrigger, DialogContent, DialogDescription, DialogHeading, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger } from "./primitives.js";
1
+ import { DialogBackdrop, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogHeading, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger } from "./primitives.js";
2
2
  import { DialogCloseIconTrigger } from "./close-icon-trigger.js";
3
3
  import { DialogParts } from "./parts.js";
4
4
  import { Dialog } from "./dialog.js";
5
- export { Dialog, DialogBackdrop, DialogCloseIconTrigger, DialogCloseTrigger, DialogContent, DialogDescription, DialogHeading, DialogParts, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger };
5
+ export { Dialog, DialogBackdrop, DialogCloseIconTrigger, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogHeading, DialogParts, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger };
@@ -19,10 +19,12 @@ var DialogContent = withSlotRecipe(_ark_ui_react_dialog.Dialog.Content, "content
19
19
  var DialogHeading = withSlotRecipe(_ark_ui_react_dialog.Dialog.Title, "title");
20
20
  var DialogDescription = withSlotRecipe(_ark_ui_react_dialog.Dialog.Description, "description");
21
21
  var DialogCloseTrigger = withNoRecipe(_ark_ui_react_dialog.Dialog.CloseTrigger);
22
+ var DialogContext = _ark_ui_react_dialog.Dialog.Context;
22
23
  //#endregion
23
24
  exports.DialogBackdrop = DialogBackdrop;
24
25
  exports.DialogCloseTrigger = DialogCloseTrigger;
25
26
  exports.DialogContent = DialogContent;
27
+ exports.DialogContext = DialogContext;
26
28
  exports.DialogDescription = DialogDescription;
27
29
  exports.DialogHeading = DialogHeading;
28
30
  exports.DialogPositioner = DialogPositioner;
@@ -1,7 +1,7 @@
1
- import { Dialog, DialogBackdropProps as ArkDialogBackdropProps, DialogContentProps as ArkDialogContentProps, DialogDescriptionProps as ArkDialogDescriptionProps, DialogPositionerProps as ArkDialogPositionerProps, DialogRootProps as ArkDialogRootProps, DialogTitleProps as ArkDialogTitleProps, DialogTriggerProps as ArkDialogTriggerProps } from '@ark-ui/react/dialog';
1
+ import { Dialog, DialogRootProviderProps as ArkDialogRootProviderProps, DialogBackdropProps as ArkDialogBackdropProps, DialogContentProps as ArkDialogContentProps, DialogDescriptionProps as ArkDialogDescriptionProps, DialogPositionerProps as ArkDialogPositionerProps, DialogRootProps as ArkDialogRootProps, DialogTitleProps as ArkDialogTitleProps, DialogTriggerProps as ArkDialogTriggerProps, DialogContextProps as ArkDialogContextProps } from '@ark-ui/react/dialog';
2
2
  import { DialogVariantProps } from 'styled-system/recipes';
3
3
  import { CerberusPrimitiveProps } from '../../system/index';
4
- import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ import { ForwardRefExoticComponent, RefAttributes, ReactNode } from 'react';
5
5
  /**
6
6
  * The provider that controls the dialog components.
7
7
  */
@@ -46,3 +46,6 @@ export declare const DialogDescription: ForwardRefExoticComponent<Omit<CerberusP
46
46
  */
47
47
  export type DialogCloseTriggerProps = CerberusPrimitiveProps<ArkDialogTriggerProps>;
48
48
  export declare const DialogCloseTrigger: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Dialog.CloseTriggerProps & RefAttributes<HTMLButtonElement>>, "ref"> & RefAttributes<HTMLElement>>;
49
+ export type DialogContextProps = CerberusPrimitiveProps<ArkDialogContextProps>;
50
+ export declare const DialogContext: (props: Dialog.ContextProps) => ReactNode;
51
+ export type DialogRootProviderProps = CerberusPrimitiveProps<ArkDialogRootProviderProps>;
@@ -1,7 +1,7 @@
1
- import { Dialog, DialogBackdropProps as ArkDialogBackdropProps, DialogContentProps as ArkDialogContentProps, DialogDescriptionProps as ArkDialogDescriptionProps, DialogPositionerProps as ArkDialogPositionerProps, DialogRootProps as ArkDialogRootProps, DialogTitleProps as ArkDialogTitleProps, DialogTriggerProps as ArkDialogTriggerProps } from '@ark-ui/react/dialog';
1
+ import { Dialog, DialogRootProviderProps as ArkDialogRootProviderProps, DialogBackdropProps as ArkDialogBackdropProps, DialogContentProps as ArkDialogContentProps, DialogDescriptionProps as ArkDialogDescriptionProps, DialogPositionerProps as ArkDialogPositionerProps, DialogRootProps as ArkDialogRootProps, DialogTitleProps as ArkDialogTitleProps, DialogTriggerProps as ArkDialogTriggerProps, DialogContextProps as ArkDialogContextProps } from '@ark-ui/react/dialog';
2
2
  import { DialogVariantProps } from 'styled-system/recipes';
3
3
  import { CerberusPrimitiveProps } from '../../system/index';
4
- import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ import { ForwardRefExoticComponent, RefAttributes, ReactNode } from 'react';
5
5
  /**
6
6
  * The provider that controls the dialog components.
7
7
  */
@@ -46,3 +46,6 @@ export declare const DialogDescription: ForwardRefExoticComponent<Omit<CerberusP
46
46
  */
47
47
  export type DialogCloseTriggerProps = CerberusPrimitiveProps<ArkDialogTriggerProps>;
48
48
  export declare const DialogCloseTrigger: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Dialog.CloseTriggerProps & RefAttributes<HTMLButtonElement>>, "ref"> & RefAttributes<HTMLElement>>;
49
+ export type DialogContextProps = CerberusPrimitiveProps<ArkDialogContextProps>;
50
+ export declare const DialogContext: (props: Dialog.ContextProps) => ReactNode;
51
+ export type DialogRootProviderProps = CerberusPrimitiveProps<ArkDialogRootProviderProps>;
@@ -19,5 +19,6 @@ var DialogContent = withSlotRecipe(Dialog.Content, "content");
19
19
  var DialogHeading = withSlotRecipe(Dialog.Title, "title");
20
20
  var DialogDescription = withSlotRecipe(Dialog.Description, "description");
21
21
  var DialogCloseTrigger$1 = withNoRecipe(Dialog.CloseTrigger);
22
+ var DialogContext = Dialog.Context;
22
23
  //#endregion
23
- export { DialogBackdrop, DialogCloseTrigger$1 as DialogCloseTrigger, DialogContent, DialogDescription, DialogHeading, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger };
24
+ export { DialogBackdrop, DialogCloseTrigger$1 as DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogHeading, DialogPositioner, DialogProvider, DialogRoot, DialogTrigger };
@@ -9,9 +9,7 @@ function IconButton(props) {
9
9
  const { ariaLabel, clipboard, ...rootProps } = props;
10
10
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives.IconButtonRoot, {
11
11
  ...rootProps,
12
- ...!clipboard && { "aria-label": ariaLabel },
13
- "data-scope": "icon-button",
14
- "data-part": "root"
12
+ ...!clipboard && { "aria-label": ariaLabel }
15
13
  });
16
14
  }
17
15
  //#endregion
@@ -9,9 +9,7 @@ function IconButton(props) {
9
9
  const { ariaLabel, clipboard, ...rootProps } = props;
10
10
  return /* @__PURE__ */ jsx(IconButtonRoot, {
11
11
  ...rootProps,
12
- ...!clipboard && { "aria-label": ariaLabel },
13
- "data-scope": "icon-button",
14
- "data-part": "root"
12
+ ...!clipboard && { "aria-label": ariaLabel }
15
13
  });
16
14
  }
17
15
  //#endregion
@@ -1,12 +1,14 @@
1
1
  const require_index = require("../../system/index.cjs");
2
2
  let styled_system_recipes = require("styled-system/recipes");
3
- let _ark_ui_react_factory = require("@ark-ui/react/factory");
4
3
  //#region src/components/icon-button/primitives.ts
5
4
  /**
6
5
  * This module contains the IconButton component primitives.
7
6
  * @module @cerberus-design/react/components/icon-button/primitives
8
7
  */
9
8
  var { withRecipe } = require_index.createCerberusPrimitive(styled_system_recipes.iconButton);
10
- var IconButtonRoot = withRecipe(_ark_ui_react_factory.ark.button);
9
+ var IconButtonRoot = withRecipe("button", { defaultProps: {
10
+ "data-scope": "icon-button",
11
+ "data-part": "root"
12
+ } });
11
13
  //#endregion
12
14
  exports.IconButtonRoot = IconButtonRoot;
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes, ForwardRefExoticComponent, ClassAttributes, ButtonHTMLAttributes, RefAttributes } from 'react';
2
1
  import { IconButtonVariantProps } from 'styled-system/recipes';
3
- import { CerberusPrimitiveProps } from '../../system/index';
4
- import { PolymorphicProps } from '@ark-ui/react';
5
- export type IconButtonRootProps = CerberusPrimitiveProps<HTMLAttributes<HTMLButtonElement> & IconButtonVariantProps>;
6
- export declare const IconButtonRoot: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps< ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & PolymorphicProps>, "ref"> & RefAttributes<HTMLElement>>;
2
+ import { CerberusProps } from '../../system/index';
3
+ import { ForwardRefExoticComponent, DetailedHTMLProps, ButtonHTMLAttributes, RefAttributes } from 'react';
4
+ import { CerberusPrimitiveProps } from '../..';
5
+ export type IconButtonRootProps = CerberusProps<'button'> & IconButtonVariantProps;
6
+ export declare const IconButtonRoot: ForwardRefExoticComponent<Omit< CerberusPrimitiveProps<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, "ref"> & RefAttributes<HTMLElement>>;
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes, ForwardRefExoticComponent, ClassAttributes, ButtonHTMLAttributes, RefAttributes } from 'react';
2
1
  import { IconButtonVariantProps } from 'styled-system/recipes';
3
- import { CerberusPrimitiveProps } from '../../system/index';
4
- import { PolymorphicProps } from '@ark-ui/react';
5
- export type IconButtonRootProps = CerberusPrimitiveProps<HTMLAttributes<HTMLButtonElement> & IconButtonVariantProps>;
6
- export declare const IconButtonRoot: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps< ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & PolymorphicProps>, "ref"> & RefAttributes<HTMLElement>>;
2
+ import { CerberusProps } from '../../system/index';
3
+ import { ForwardRefExoticComponent, DetailedHTMLProps, ButtonHTMLAttributes, RefAttributes } from 'react';
4
+ import { CerberusPrimitiveProps } from '../..';
5
+ export type IconButtonRootProps = CerberusProps<'button'> & IconButtonVariantProps;
6
+ export declare const IconButtonRoot: ForwardRefExoticComponent<Omit< CerberusPrimitiveProps<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>, "ref"> & RefAttributes<HTMLElement>>;
@@ -1,12 +1,14 @@
1
1
  import { createCerberusPrimitive } from "../../system/index.js";
2
2
  import { iconButton } from "styled-system/recipes";
3
- import { ark } from "@ark-ui/react/factory";
4
3
  //#region src/components/icon-button/primitives.ts
5
4
  /**
6
5
  * This module contains the IconButton component primitives.
7
6
  * @module @cerberus-design/react/components/icon-button/primitives
8
7
  */
9
8
  var { withRecipe } = createCerberusPrimitive(iconButton);
10
- var IconButtonRoot = withRecipe(ark.button);
9
+ var IconButtonRoot = withRecipe("button", { defaultProps: {
10
+ "data-scope": "icon-button",
11
+ "data-part": "root"
12
+ } });
11
13
  //#endregion
12
14
  export { IconButtonRoot };
@@ -3,9 +3,10 @@
3
3
  const require_show = require("../show/show.cjs");
4
4
  const require_button = require("../button/button.cjs");
5
5
  const require_parts = require("./parts.cjs");
6
- const require_match_icon = require("./match-icon.cjs");
7
6
  const require_close_trigger = require("./close-trigger.cjs");
7
+ const require_match_icon = require("./match-icon.cjs");
8
8
  const require_toaster = require("./toaster.cjs");
9
+ let react = require("react");
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
11
  let styled_system_jsx = require("styled-system/jsx");
11
12
  let _ark_ui_react_toast = require("@ark-ui/react/toast");
@@ -14,8 +15,9 @@ let _ark_ui_react_toast = require("@ark-ui/react/toast");
14
15
  * This module contains an abstraction of the Notification parts.
15
16
  * @module 'notification/center'
16
17
  */
17
- function getEmphasis(type) {
18
- return type.includes("subtle") ? "low" : "high";
18
+ function getEmphasis(options) {
19
+ if (options.usage === "subtle") return "low";
20
+ return "high";
19
21
  }
20
22
  /**
21
23
  * The NotificationCenter component is an abstraction for the Notification
@@ -23,9 +25,9 @@ function getEmphasis(type) {
23
25
  */
24
26
  function NotificationCenter(props) {
25
27
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ark_ui_react_toast.Toaster, {
26
- toaster: props.toaster || require_toaster.toaster,
28
+ toaster: (0, react.useMemo)(() => props.toaster || require_toaster.toaster, [props.toaster]),
27
29
  children: (toast) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_parts.NotificationParts.Root, {
28
- "data-emphasis": getEmphasis(toast.type ?? "info"),
30
+ "data-emphasis": getEmphasis(toast),
29
31
  children: [
30
32
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_match_icon.MatchNotificationIcon, { type: toast.type }),
31
33
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(styled_system_jsx.Box, {
@@ -53,24 +55,6 @@ function NotificationCenter(props) {
53
55
  }, toast.id)
54
56
  });
55
57
  }
56
- /**
57
- * @deprecated use `toaster` instead
58
- */
59
- function useNotificationCenter() {
60
- function notify(options) {
61
- require_toaster.toaster.create({
62
- title: options.heading,
63
- description: options.description,
64
- type: options.palette,
65
- action: options.action
66
- });
67
- }
68
- return {
69
- ...require_toaster.toaster,
70
- notify
71
- };
72
- }
73
58
  //#endregion
74
59
  exports.NotificationCenter = NotificationCenter;
75
60
  exports.getEmphasis = getEmphasis;
76
- exports.useNotificationCenter = useNotificationCenter;
@@ -1,10 +1,10 @@
1
1
  import { CreateToasterReturn } from '@ark-ui/react/toast';
2
- import { NotifyOptionsType, UseNotificationCenterReturn } from './types';
2
+ import { NotifyOptions } from './types';
3
3
  /**
4
4
  * This module contains an abstraction of the Notification parts.
5
5
  * @module 'notification/center'
6
6
  */
7
- export declare function getEmphasis(type: NotifyOptionsType): "high" | "low";
7
+ export declare function getEmphasis(options: NotifyOptions): "high" | "low";
8
8
  export interface NotificationCenterProps {
9
9
  toaster?: CreateToasterReturn;
10
10
  }
@@ -13,7 +13,3 @@ export interface NotificationCenterProps {
13
13
  * component. It manages displaying all the toasts in the center.
14
14
  */
15
15
  export declare function NotificationCenter(props: NotificationCenterProps): import("react/jsx-runtime").JSX.Element;
16
- /**
17
- * @deprecated use `toaster` instead
18
- */
19
- export declare function useNotificationCenter(): UseNotificationCenterReturn;
@@ -1,10 +1,10 @@
1
1
  import { CreateToasterReturn } from '@ark-ui/react/toast';
2
- import { NotifyOptionsType, UseNotificationCenterReturn } from './types';
2
+ import { NotifyOptions } from './types';
3
3
  /**
4
4
  * This module contains an abstraction of the Notification parts.
5
5
  * @module 'notification/center'
6
6
  */
7
- export declare function getEmphasis(type: NotifyOptionsType): "high" | "low";
7
+ export declare function getEmphasis(options: NotifyOptions): "high" | "low";
8
8
  export interface NotificationCenterProps {
9
9
  toaster?: CreateToasterReturn;
10
10
  }
@@ -13,7 +13,3 @@ export interface NotificationCenterProps {
13
13
  * component. It manages displaying all the toasts in the center.
14
14
  */
15
15
  export declare function NotificationCenter(props: NotificationCenterProps): import("react/jsx-runtime").JSX.Element;
16
- /**
17
- * @deprecated use `toaster` instead
18
- */
19
- export declare function useNotificationCenter(): UseNotificationCenterReturn;
@@ -3,9 +3,10 @@
3
3
  import { Show } from "../show/show.js";
4
4
  import { Button } from "../button/button.js";
5
5
  import { NotificationParts } from "./parts.js";
6
- import { MatchNotificationIcon } from "./match-icon.js";
7
6
  import { ToastCloseTrigger } from "./close-trigger.js";
7
+ import { MatchNotificationIcon } from "./match-icon.js";
8
8
  import { toaster } from "./toaster.js";
9
+ import { useMemo } from "react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  import { Box } from "styled-system/jsx";
11
12
  import { Toaster } from "@ark-ui/react/toast";
@@ -14,8 +15,9 @@ import { Toaster } from "@ark-ui/react/toast";
14
15
  * This module contains an abstraction of the Notification parts.
15
16
  * @module 'notification/center'
16
17
  */
17
- function getEmphasis(type) {
18
- return type.includes("subtle") ? "low" : "high";
18
+ function getEmphasis(options) {
19
+ if (options.usage === "subtle") return "low";
20
+ return "high";
19
21
  }
20
22
  /**
21
23
  * The NotificationCenter component is an abstraction for the Notification
@@ -23,9 +25,9 @@ function getEmphasis(type) {
23
25
  */
24
26
  function NotificationCenter(props) {
25
27
  return /* @__PURE__ */ jsx(Toaster, {
26
- toaster: props.toaster || toaster,
28
+ toaster: useMemo(() => props.toaster || toaster, [props.toaster]),
27
29
  children: (toast) => /* @__PURE__ */ jsxs(NotificationParts.Root, {
28
- "data-emphasis": getEmphasis(toast.type ?? "info"),
30
+ "data-emphasis": getEmphasis(toast),
29
31
  children: [
30
32
  /* @__PURE__ */ jsx(MatchNotificationIcon, { type: toast.type }),
31
33
  /* @__PURE__ */ jsxs(Box, {
@@ -53,22 +55,5 @@ function NotificationCenter(props) {
53
55
  }, toast.id)
54
56
  });
55
57
  }
56
- /**
57
- * @deprecated use `toaster` instead
58
- */
59
- function useNotificationCenter() {
60
- function notify(options) {
61
- toaster.create({
62
- title: options.heading,
63
- description: options.description,
64
- type: options.palette,
65
- action: options.action
66
- });
67
- }
68
- return {
69
- ...toaster,
70
- notify
71
- };
72
- }
73
58
  //#endregion
74
- export { NotificationCenter, getEmphasis, useNotificationCenter };
59
+ export { NotificationCenter, getEmphasis };
@@ -3,7 +3,6 @@ const require_primitives = require("./primitives.cjs");
3
3
  const require_parts = require("./parts.cjs");
4
4
  const require_toaster = require("./toaster.cjs");
5
5
  const require_center = require("./center.cjs");
6
- let _ark_ui_react_toast = require("@ark-ui/react/toast");
7
6
  exports.NotificationActionTrigger = require_primitives.NotificationActionTrigger;
8
7
  exports.NotificationCenter = require_center.NotificationCenter;
9
8
  exports.NotificationCloseTrigger = require_primitives.NotificationCloseTrigger;
@@ -12,18 +11,5 @@ exports.NotificationHeading = require_primitives.NotificationHeading;
12
11
  exports.NotificationParts = require_parts.NotificationParts;
13
12
  exports.NotificationProvider = require_primitives.NotificationProvider;
14
13
  exports.NotificationRoot = require_primitives.NotificationRoot;
15
- Object.defineProperty(exports, "Toaster", {
16
- enumerable: true,
17
- get: function() {
18
- return _ark_ui_react_toast.Toaster;
19
- }
20
- });
21
- Object.defineProperty(exports, "createToaster", {
22
- enumerable: true,
23
- get: function() {
24
- return _ark_ui_react_toast.createToaster;
25
- }
26
- });
27
14
  exports.getEmphasis = require_center.getEmphasis;
28
15
  exports.toaster = require_toaster.toaster;
29
- exports.useNotificationCenter = require_center.useNotificationCenter;
@@ -1,5 +1,5 @@
1
1
  import { NotificationActionTrigger, NotificationCloseTrigger, NotificationDescription, NotificationHeading, NotificationProvider, NotificationRoot } from "./primitives.js";
2
2
  import { NotificationParts } from "./parts.js";
3
- import { Toaster, createToaster, toaster } from "./toaster.js";
4
- import { NotificationCenter, getEmphasis, useNotificationCenter } from "./center.js";
5
- export { NotificationActionTrigger, NotificationCenter, NotificationCloseTrigger, NotificationDescription, NotificationHeading, NotificationParts, NotificationProvider, NotificationRoot, Toaster, createToaster, getEmphasis, toaster, useNotificationCenter };
3
+ import { toaster } from "./toaster.js";
4
+ import { NotificationCenter, getEmphasis } from "./center.js";
5
+ export { NotificationActionTrigger, NotificationCenter, NotificationCloseTrigger, NotificationDescription, NotificationHeading, NotificationParts, NotificationProvider, NotificationRoot, getEmphasis, toaster };
@@ -7,13 +7,19 @@ let styled_system_recipes = require("styled-system/recipes");
7
7
  let _ark_ui_react_factory = require("@ark-ui/react/factory");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  //#region src/components/notifications/match-icon.tsx
10
+ /**
11
+ * This private module contains a component that returns the correct icon for a
12
+ * notification based on the palette. If there is no result, it is assumed to
13
+ * be a 'loading' type.
14
+ * @module 'notification/match-icon'
15
+ */
10
16
  function MatchNotificationIcon(props) {
11
17
  const { icons } = require_cerberus.useCerberusContext();
12
18
  const type = props.type?.split("-")[0] || "info";
13
19
  const styles = (0, styled_system_recipes.toast)();
14
20
  const Icon = icons[`${type}Notification`] || ToastLoadingIcon;
15
21
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ark_ui_react_factory.ark.div, {
16
- "data-emphasis": require_center.getEmphasis(props.type),
22
+ "data-emphasis": require_center.getEmphasis(props),
17
23
  className: styles.icon,
18
24
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {})
19
25
  });
@@ -5,8 +5,4 @@ import { NotifyOptions } from './types';
5
5
  * be a 'loading' type.
6
6
  * @module 'notification/match-icon'
7
7
  */
8
- interface MatchNotificationIconProps {
9
- type?: NotifyOptions['palette'];
10
- }
11
- export declare function MatchNotificationIcon(props: MatchNotificationIconProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
8
+ export declare function MatchNotificationIcon(props: NotifyOptions): import("react/jsx-runtime").JSX.Element;
@@ -5,8 +5,4 @@ import { NotifyOptions } from './types';
5
5
  * be a 'loading' type.
6
6
  * @module 'notification/match-icon'
7
7
  */
8
- interface MatchNotificationIconProps {
9
- type?: NotifyOptions['palette'];
10
- }
11
- export declare function MatchNotificationIcon(props: MatchNotificationIconProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
8
+ export declare function MatchNotificationIcon(props: NotifyOptions): import("react/jsx-runtime").JSX.Element;
@@ -7,13 +7,19 @@ import { toast } from "styled-system/recipes";
7
7
  import { ark } from "@ark-ui/react/factory";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  //#region src/components/notifications/match-icon.tsx
10
+ /**
11
+ * This private module contains a component that returns the correct icon for a
12
+ * notification based on the palette. If there is no result, it is assumed to
13
+ * be a 'loading' type.
14
+ * @module 'notification/match-icon'
15
+ */
10
16
  function MatchNotificationIcon(props) {
11
17
  const { icons } = useCerberusContext();
12
18
  const type = props.type?.split("-")[0] || "info";
13
19
  const styles = toast();
14
20
  const Icon = icons[`${type}Notification`] || ToastLoadingIcon;
15
21
  return /* @__PURE__ */ jsx(ark.div, {
16
- "data-emphasis": getEmphasis(props.type),
22
+ "data-emphasis": getEmphasis(props),
17
23
  className: styles.icon,
18
24
  children: /* @__PURE__ */ jsx(Icon, {})
19
25
  });
@@ -1,3 +1,2 @@
1
1
  import { CreateToasterReturn } from '@ark-ui/react/toast';
2
2
  export declare const toaster: CreateToasterReturn;
3
- export { createToaster, Toaster } from '@ark-ui/react/toast';
@@ -1,3 +1,2 @@
1
1
  import { CreateToasterReturn } from '@ark-ui/react/toast';
2
2
  export declare const toaster: CreateToasterReturn;
3
- export { createToaster, Toaster } from '@ark-ui/react/toast';
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  "use client";
3
- import { Toaster as Toaster$1, createToaster, createToaster as createToaster$1 } from "@ark-ui/react/toast";
3
+ import { createToaster } from "@ark-ui/react/toast";
4
4
  //#region src/components/notifications/toaster.ts
5
5
  var toaster = createToaster({
6
6
  gap: 16,
@@ -8,4 +8,4 @@ var toaster = createToaster({
8
8
  placement: "top-end"
9
9
  });
10
10
  //#endregion
11
- export { Toaster$1 as Toaster, createToaster$1 as createToaster, toaster };
11
+ export { toaster };
@@ -1,31 +1,5 @@
1
- import { CreateToasterReturn } from '@ark-ui/react/toast';
2
- import { ReactNode } from 'react';
3
- export type NotifyOptionsType = 'info' | 'info-subtle' | 'success' | 'success-subtle' | 'warning' | 'warning-subtle' | 'error' | 'error-subtle' | 'loading' | 'loading-subtle';
4
- export interface NotifyOptions {
5
- /**
6
- * The palette of the notification.
7
- * @default 'info'
8
- */
9
- palette?: NotifyOptionsType;
10
- /**
11
- * The heading of the notification.
12
- */
13
- heading: string;
14
- /**
15
- * The description of the notification.
16
- */
17
- description?: ReactNode;
18
- /**
19
- * The action to take when the notification is closed
20
- */
21
- action?: {
22
- label: string;
23
- onClick: () => void;
24
- };
1
+ import { ToastOptions } from '@ark-ui/react/toast';
2
+ export type NotifyOptionsType = ToastOptions['type'];
3
+ export interface NotifyOptions extends ToastOptions {
4
+ usage?: 'subtle' | 'default';
25
5
  }
26
- export type UseNotificationCenterReturn = CreateToasterReturn & {
27
- /**
28
- * @deprecated use `create` instead
29
- */
30
- notify: (options: NotifyOptions) => void;
31
- };
@@ -1,31 +1,5 @@
1
- import { CreateToasterReturn } from '@ark-ui/react/toast';
2
- import { ReactNode } from 'react';
3
- export type NotifyOptionsType = 'info' | 'info-subtle' | 'success' | 'success-subtle' | 'warning' | 'warning-subtle' | 'error' | 'error-subtle' | 'loading' | 'loading-subtle';
4
- export interface NotifyOptions {
5
- /**
6
- * The palette of the notification.
7
- * @default 'info'
8
- */
9
- palette?: NotifyOptionsType;
10
- /**
11
- * The heading of the notification.
12
- */
13
- heading: string;
14
- /**
15
- * The description of the notification.
16
- */
17
- description?: ReactNode;
18
- /**
19
- * The action to take when the notification is closed
20
- */
21
- action?: {
22
- label: string;
23
- onClick: () => void;
24
- };
1
+ import { ToastOptions } from '@ark-ui/react/toast';
2
+ export type NotifyOptionsType = ToastOptions['type'];
3
+ export interface NotifyOptions extends ToastOptions {
4
+ usage?: 'subtle' | 'default';
25
5
  }
26
- export type UseNotificationCenterReturn = CreateToasterReturn & {
27
- /**
28
- * @deprecated use `create` instead
29
- */
30
- notify: (options: NotifyOptions) => void;
31
- };
@@ -1,8 +1,7 @@
1
- import { IconButtonProps } from '../icon-button/index';
2
1
  import { GroupProps } from '../group';
2
+ import { IconButtonRootProps } from '../icon-button/index';
3
3
  export declare function PrevTrigger(props: TriggerProps): import("react/jsx-runtime").JSX.Element;
4
4
  export declare function NextTrigger(props: TriggerProps): import("react/jsx-runtime").JSX.Element;
5
- export interface TriggerBaseProps {
5
+ export interface TriggerProps extends IconButtonRootProps {
6
6
  layout?: GroupProps['layout'];
7
7
  }
8
- export type TriggerProps = TriggerBaseProps & Omit<IconButtonProps, 'clipboard'>;