UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

33 lines (28 loc) 1.17 kB
'use client'; 'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const factory = require('../../node_modules/.pnpm/@ark-ui_react@5.29.1_react-dom@19.2.1_react@19.2.1__react@19.2.1/node_modules/@ark-ui/react/dist/components/factory.cjs'); const recipes = require('styled-system/recipes'); const cerberus = require('../../context/cerberus.cjs'); const spinner = require('../spinner/spinner.cjs'); const center = require('./center.cjs'); function MatchNotificationIcon(props) { const { icons } = cerberus.useCerberusContext(); const type = props.type?.split("-")[0] || "info"; const styles = recipes.toast(); const key = `${type}Notification`; const Icon = icons[key] || ToastLoadingIcon; return /* @__PURE__ */ jsxRuntime.jsx( factory.ark.div, { "data-emphasis": center.getEmphasis(props.type), className: styles.icon, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) } ); } function ToastLoadingIcon() { return /* @__PURE__ */ jsxRuntime.jsx(spinner.Spinner, { size: "1rem" }); } exports.MatchNotificationIcon = MatchNotificationIcon;