@jamsrui/alert 0.0.16 → 0.0.17

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.
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { WithGlobalConfig } from '@jamsrui/core';
2
3
  import { A as Alert } from './alert-BTqcLoKk.mjs';
3
4
  import 'react';
4
5
  import '@jamsrui/utils';
@@ -15,7 +16,7 @@ declare const AlertConfig: (props: Omit<Partial<AlertConfig.Props>, "children">
15
16
  children: React.ReactNode;
16
17
  }) => react_jsx_runtime.JSX.Element;
17
18
  declare namespace AlertConfig {
18
- interface Props extends Alert.Props {
19
+ interface Props extends WithGlobalConfig<Alert.Props> {
19
20
  merge?: boolean;
20
21
  }
21
22
  }
@@ -1 +1 @@
1
- "use client";import{createConfigContext as e}from"@jamsrui/utils";const[o,r]=e({displayName:"AlertConfigContext"});export{o as AlertConfig,r as useAlertConfig};
1
+ "use client";import{createConfigContext as e}from"@jamsrui/utils";const[t,r]=e({displayName:"AlertConfigContext"});export{t as AlertConfig,r as useAlertConfig};
@@ -1 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import{createContext as n,use as l}from"react";const t=n(null),s=e=>{const{children:r,ctx:o}=e;return x(t,{value:o,children:r})},c=()=>{const e=l(t);if(!e)throw new Error("useAlertContext must be used within AlertContextProvider");return e};export{s as AlertContextProvider,c as useAlertContext};
1
+ "use client";import{jsx as x}from"react/jsx-runtime";import{createContext as n,use as l}from"react";const t=n(null),c=e=>{const{children:r,ctx:o}=e;return x(t,{value:o,children:r})},p=()=>{const e=l(t);if(!e)throw new Error("useAlertContext must be used within AlertContextProvider");return e};export{c as AlertContextProvider,p as useAlertContext};
package/dist/alert.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{jsx as f}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{mergeConfigProps as m}from"@jamsrui/utils";import{useAlertConfig as i}from"./alert-config.mjs";import{AlertContextProvider as l}from"./alert-context.mjs";import{useAlert as c}from"./use-alert.mjs";const g=o=>{const r=i(),t=m(r,r,o),e=c(t),{getRootProps:s}=e,p=n("div",{props:[s({})]});return f(l,{ctx:e,children:p})};export{g as Alert};
1
+ "use client";import{jsx as P}from"react/jsx-runtime";import{useRenderElement as n}from"@jamsrui/hooks";import{mergeConfigProps as m}from"@jamsrui/utils";import{useAlertConfig as i}from"./alert-config.mjs";import{AlertContextProvider as l}from"./alert-context.mjs";import{alertStyles as f}from"./styles.mjs";import{useAlert as c}from"./use-alert.mjs";const v=e=>{const t=i(),o=m(f.defaultVariants,t,e),r=c(o),{getRootProps:s}=r,p=n("div",{props:[s({})]});return P(l,{ctx:r,children:p})};export{v as Alert};
package/dist/icons.mjs CHANGED
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{ErrorIcon as t,InfoIcon as o,SuccessIcon as a,WarningIcon as e}from"@jamsrui/icons";const c={danger:n(t,{}),info:n(o,{}),success:n(a,{}),warning:n(e,{}),default:n(o,{})};export{c as iconMappingDefault};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{ErrorIcon as e,InfoIcon as o,SuccessIcon as t,WarningIcon as a}from"@jamsrui/icons";const r={danger:n(e,{}),info:n(o,{}),success:n(t,{}),warning:n(a,{}),default:n(o,{})};export{r as iconMappingDefault};
package/dist/index.d.mts CHANGED
@@ -1,23 +1,38 @@
1
1
  import * as react from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- export { AlertConfig, useAlertConfig } from './alert-config.mjs';
4
- import { AlertDescription } from './alert-description.mjs';
5
- import { AlertTitle } from './alert-title.mjs';
6
- export { alertStyles } from './styles.mjs';
7
3
  import { A as Alert$1 } from './alert-BTqcLoKk.mjs';
8
4
  export { u as useAlert } from './alert-BTqcLoKk.mjs';
5
+ import { AlertConfig } from './alert-config.mjs';
6
+ export { useAlertConfig } from './alert-config.mjs';
7
+ export { AlertContextProvider, useAlertContext } from './alert-context.mjs';
9
8
  import { AlertContent } from './alert-content.mjs';
9
+ import { AlertDescription } from './alert-description.mjs';
10
10
  import { AlertIcon } from './alert-icon.mjs';
11
- import '@jamsrui/text';
11
+ import { AlertTitle } from './alert-title.mjs';
12
+ export { AlertSlots, AlertVariants, alertStyles } from './styles.mjs';
12
13
  import '@jamsrui/utils';
14
+ import '@jamsrui/core';
15
+ import '@jamsrui/text';
13
16
 
14
- type AlertProps = Alert$1.Props;
15
17
  declare const Alert: ((props: Alert$1.Props) => react_jsx_runtime.JSX.Element) & {
16
- Root: (props: Alert$1.Props) => react_jsx_runtime.JSX.Element;
17
18
  Title: (props: AlertTitle.Props) => react_jsx_runtime.JSX.Element;
18
19
  Description: (props: AlertDescription.Props) => react_jsx_runtime.JSX.Element;
19
20
  Content: (props: AlertContent.Props) => react_jsx_runtime.JSX.Element;
20
21
  Icon: (props: AlertIcon.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
21
22
  };
23
+ declare namespace Alert {
24
+ interface Props extends Alert$1.Props {
25
+ }
26
+ interface Config extends AlertConfig.Props {
27
+ }
28
+ interface Title extends AlertTitle.Props {
29
+ }
30
+ interface Description extends AlertDescription.Props {
31
+ }
32
+ interface Content extends AlertContent.Props {
33
+ }
34
+ interface Icon extends AlertIcon.Props {
35
+ }
36
+ }
22
37
 
23
- export { Alert, AlertDescription, type AlertProps, AlertTitle };
38
+ export { Alert, AlertConfig, AlertContent, AlertDescription, AlertIcon, AlertTitle };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AlertConfig as x,useAlertConfig as C}from"./alert-config.mjs";import{AlertDescription as g}from"./alert-description.mjs";import{AlertTitle as R}from"./alert-title.mjs";import{alertStyles as u}from"./styles.mjs";import{useAlert as I}from"./use-alert.mjs";import{Alert as t}from"./alert.mjs";import{AlertContent as r}from"./alert-content.mjs";import{AlertDescription as o}from"./alert-description.mjs";import{AlertIcon as e}from"./alert-icon.mjs";import{AlertTitle as l}from"./alert-title.mjs";const f=Object.assign(t,{Root:t,Title:l,Description:o,Content:r,Icon:e});export{f as Alert,x as AlertConfig,g as AlertDescription,R as AlertTitle,u as alertStyles,I as useAlert,C as useAlertConfig};
1
+ import{Alert as n}from"./alert.mjs";import{AlertConfig as i,useAlertConfig as p}from"./alert-config.mjs";import{AlertContextProvider as l,useAlertContext as s}from"./alert-context.mjs";import{AlertContent as t}from"./alert-content.mjs";import{AlertDescription as e}from"./alert-description.mjs";import{AlertIcon as r}from"./alert-icon.mjs";import{AlertTitle as o}from"./alert-title.mjs";import{alertStyles as A}from"./styles.mjs";import{useAlert as f}from"./use-alert.mjs";const u=Object.assign(n,{Title:o,Description:e,Content:t,Icon:r});export{u as Alert,i as AlertConfig,t as AlertContent,l as AlertContextProvider,e as AlertDescription,r as AlertIcon,o as AlertTitle,A as alertStyles,f as useAlert,p as useAlertConfig,s as useAlertContext};
@@ -1 +1 @@
1
- import{useCallback as r,useMemo as d}from"react";import{cn as y,dataAttrDev as o,mapPropsVariants as u}from"@jamsrui/utils";import{iconMappingDefault as g}from"./icons.mjs";import{alertStyles as P}from"./styles.mjs";const x=A=>{const[N,s]=u(A,P.variantKeys),{...a}=N,e=P(s),{status:f="default"}=s,l=g[f],n=r(t=>({"data-slot":o("root"),role:"alert",...a,...t,className:e.root({className:y(t.className)})}),[a,e]),c=r(t=>({...t,"data-slot":o("title"),className:e.title({className:t.className}),variant:"h6"}),[e]),i=r(t=>({...t,"data-slot":o("description"),className:e.description({className:t.className})}),[e]),p=r(t=>({...t,"data-slot":o("content"),className:e.content({className:t.className})}),[e]),m=r(t=>({...t,"data-slot":o("icon"),className:e.icon({className:t.className})}),[e]);return d(()=>({icon:l,getRootProps:n,getTitleProps:c,getDescriptionProps:i,getContentProps:p,getIconProps:m}),[p,i,n,c,l,m])};export{x as useAlert};
1
+ "use client";import{useCallback as r,useMemo as d}from"react";import{cn as u,dataAttrDev as o,mapPropsVariants as y}from"@jamsrui/utils";import{iconMappingDefault as g}from"./icons.mjs";import{alertStyles as P}from"./styles.mjs";const x=A=>{const[N,s]=y(A,P.variantKeys),{...a}=N,e=P(s),{status:f="default"}=s,l=g[f],n=r(t=>({"data-slot":o("root"),role:"alert",...a,...t,className:e.root({className:u(t.className)})}),[a,e]),c=r(t=>({...t,"data-slot":o("title"),className:e.title({className:t.className}),variant:"h6"}),[e]),i=r(t=>({...t,"data-slot":o("description"),className:e.description({className:t.className})}),[e]),p=r(t=>({...t,"data-slot":o("content"),className:e.content({className:t.className})}),[e]),m=r(t=>({...t,"data-slot":o("icon"),className:e.icon({className:t.className})}),[e]);return d(()=>({icon:l,getRootProps:n,getTitleProps:c,getDescriptionProps:i,getContentProps:p,getIconProps:m}),[p,i,n,c,l,m])};export{x as useAlert};
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@jamsrui/alert",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "peerDependencies": {
5
5
  "react": ">=19"
6
6
  },
7
7
  "dependencies": {
8
- "@jamsrui/core": "^0.0.13",
9
- "@jamsrui/icons": "^0.0.13",
10
- "@jamsrui/utils": "^0.0.16",
11
- "@jamsrui/hooks": "^0.0.16",
12
- "@jamsrui/text": "^0.0.16"
8
+ "@jamsrui/hooks": "^0.0.17",
9
+ "@jamsrui/core": "^0.0.14",
10
+ "@jamsrui/icons": "^0.0.14",
11
+ "@jamsrui/utils": "^0.0.17",
12
+ "@jamsrui/text": "^0.0.17"
13
13
  },
14
14
  "exports": {
15
15
  ".": {