UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

52 lines (51 loc) 1.23 kB
"use client"; import { without as N } from "../../internal/utils/without.js"; var r = /* @__PURE__ */ ((I) => (I.NOTIFICATION_CLOSE = "NOTIFICATION_CLOSE", I.NOTIFICATION_OPEN = "NOTIFICATION_OPEN", I.NOTIFICATION_REGISTER = "NOTIFICATION_REGISTER", I.NOTIFICATION_RE_OPEN = "NOTIFICATION_RE_OPEN", I))(r || {}); const s = { open: [], props: {}, instances: {} }, o = (I, O) => { const n = { ...I }; return delete n[O], n; }, c = (I = s, O) => { switch (O.type) { case "NOTIFICATION_CLOSE": { const { id: n } = O, e = N(n, I.open), T = o(I.instances, n); return { ...I, open: e, instances: T }; } case "NOTIFICATION_REGISTER": { const { id: n, props: e } = O; return { ...I, props: { ...I.props, [n]: e } }; } case "NOTIFICATION_OPEN": { const { id: n, instance: e } = O; return { ...I, open: [...N(n, I.open), n], instances: { ...I.instances, [n]: e } }; } default: return I; } }; export { r as Actions, c as NotificationReducer, s as initialState }; //# sourceMappingURL=NotificationReducer.js.map