@jamsrui/alert 0.0.15 → 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.
- package/dist/alert-config.d.mts +2 -1
- package/dist/alert-config.mjs +1 -1
- package/dist/alert-context.mjs +1 -1
- package/dist/alert.mjs +1 -1
- package/dist/icons.mjs +1 -1
- package/dist/index.d.mts +23 -8
- package/dist/index.mjs +1 -1
- package/dist/use-alert.mjs +1 -1
- package/package.json +6 -6
package/dist/alert-config.d.mts
CHANGED
|
@@ -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
|
}
|
package/dist/alert-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createConfigContext as e}from"@jamsrui/utils";const[
|
|
1
|
+
"use client";import{createConfigContext as e}from"@jamsrui/utils";const[t,r]=e({displayName:"AlertConfigContext"});export{t as AlertConfig,r as useAlertConfig};
|
package/dist/alert-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as x}from"react/jsx-runtime";import{createContext as n,use as l}from"react";const t=n(null),
|
|
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
|
|
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
|
|
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 '
|
|
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,
|
|
38
|
+
export { Alert, AlertConfig, AlertContent, AlertDescription, AlertIcon, AlertTitle };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/dist/use-alert.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as r,useMemo as d}from"react";import{cn as
|
|
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.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jamsrui/
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/icons": "^0.0.
|
|
11
|
-
"@jamsrui/
|
|
12
|
-
"@jamsrui/
|
|
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
|
".": {
|