@yamada-ui/alert 0.2.1 → 0.3.0

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.d.ts CHANGED
@@ -1,25 +1,24 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as _yamada_ui_core from '@yamada-ui/core';
3
2
  import { HTMLUIProps, ThemeProps } from '@yamada-ui/core';
4
- import * as react from 'react';
5
3
  import * as _yamada_ui_icon from '@yamada-ui/icon';
6
4
  import { LoadingProps } from '@yamada-ui/loading';
5
+ import { FC } from 'react';
7
6
 
8
7
  declare const statuses: {
9
8
  readonly info: {
10
- readonly icon: react.FC<_yamada_ui_icon.IconProps>;
9
+ readonly icon: FC<_yamada_ui_icon.IconProps>;
11
10
  readonly colorScheme: "primary";
12
11
  };
13
12
  readonly success: {
14
- readonly icon: react.FC<_yamada_ui_icon.IconProps>;
13
+ readonly icon: FC<_yamada_ui_icon.IconProps>;
15
14
  readonly colorScheme: "secondary";
16
15
  };
17
16
  readonly warning: {
18
- readonly icon: react.FC<_yamada_ui_icon.IconProps>;
17
+ readonly icon: FC<_yamada_ui_icon.IconProps>;
19
18
  readonly colorScheme: "warning";
20
19
  };
21
20
  readonly error: {
22
- readonly icon: react.FC<_yamada_ui_icon.IconProps>;
21
+ readonly icon: FC<_yamada_ui_icon.IconProps>;
23
22
  readonly colorScheme: "danger";
24
23
  };
25
24
  readonly loading: {
@@ -29,8 +28,13 @@ declare const statuses: {
29
28
  };
30
29
  type Status = keyof typeof statuses;
31
30
  declare const getStatusColorScheme: (status: Status) => "primary" | "secondary" | "warning" | "danger";
32
- declare const getStatusIcon: (status: Status) => react.FC<_yamada_ui_icon.IconProps> | _yamada_ui_core.Component<"svg", LoadingProps>;
31
+ declare const getStatusIcon: (status: Status) => FC<_yamada_ui_icon.IconProps> | _yamada_ui_core.Component<"svg", LoadingProps>;
33
32
  type AlertOptions = {
33
+ /**
34
+ * The status of the alert.
35
+ *
36
+ * @default 'info'
37
+ */
34
38
  status?: Status;
35
39
  };
36
40
  type AlertProps = HTMLUIProps<'div'> & ThemeProps<'Alert'> & AlertOptions;
@@ -38,7 +42,7 @@ declare const Alert: _yamada_ui_core.Component<"div", AlertProps>;
38
42
  type AlertIconProps = HTMLUIProps<'span'> & {
39
43
  variant?: LoadingProps['variant'];
40
44
  };
41
- declare const AlertIcon: ({ className, children, variant, ...rest }: AlertIconProps) => react_jsx_runtime.JSX.Element;
45
+ declare const AlertIcon: FC<AlertIconProps>;
42
46
  type AlertTitleProps = HTMLUIProps<'p'>;
43
47
  declare const AlertTitle: _yamada_ui_core.Component<"p", AlertTitleProps>;
44
48
  type AlertDescriptionProps = HTMLUIProps<'span'>;
package/dist/alert.js CHANGED
@@ -62,7 +62,12 @@ var Alert = (0, import_core.forwardRef)(
62
62
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertProvider, { value: { status, styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.div, { ref, className: (0, import_utils.cx)("ui-alert", className), role: "alert", __css: css, ...rest, children }) });
63
63
  }
64
64
  );
65
- var AlertIcon = ({ className, children, variant = "oval", ...rest }) => {
65
+ var AlertIcon = ({
66
+ className,
67
+ children,
68
+ variant = "oval",
69
+ ...rest
70
+ }) => {
66
71
  const { status, styles } = useAlert();
67
72
  const Icon = getStatusIcon(status);
68
73
  const css = {
package/dist/alert.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  AlertTitle,
6
6
  getStatusColorScheme,
7
7
  getStatusIcon
8
- } from "./chunk-HFQA7RKI.mjs";
8
+ } from "./chunk-G632DWL6.mjs";
9
9
  export {
10
10
  Alert,
11
11
  AlertDescription,
@@ -38,7 +38,12 @@ var Alert = forwardRef(
38
38
  return /* @__PURE__ */ jsx(AlertProvider, { value: { status, styles }, children: /* @__PURE__ */ jsx(ui.div, { ref, className: cx("ui-alert", className), role: "alert", __css: css, ...rest, children }) });
39
39
  }
40
40
  );
41
- var AlertIcon = ({ className, children, variant = "oval", ...rest }) => {
41
+ var AlertIcon = ({
42
+ className,
43
+ children,
44
+ variant = "oval",
45
+ ...rest
46
+ }) => {
42
47
  const { status, styles } = useAlert();
43
48
  const Icon = getStatusIcon(status);
44
49
  const css = {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export { Alert, AlertDescription, AlertDescriptionProps, AlertIcon, AlertIconProps, AlertProps, AlertTitle, AlertTitleProps, getStatusColorScheme, getStatusIcon } from './alert.js';
2
- import 'react/jsx-runtime';
1
+ export { Alert, AlertDescription, AlertDescriptionProps, AlertIcon, AlertIconProps, AlertProps, AlertTitle, AlertTitleProps } from './alert.js';
3
2
  import '@yamada-ui/core';
4
- import 'react';
5
3
  import '@yamada-ui/icon';
6
4
  import '@yamada-ui/loading';
5
+ import 'react';
package/dist/index.js CHANGED
@@ -23,9 +23,7 @@ __export(src_exports, {
23
23
  Alert: () => Alert,
24
24
  AlertDescription: () => AlertDescription,
25
25
  AlertIcon: () => AlertIcon,
26
- AlertTitle: () => AlertTitle,
27
- getStatusColorScheme: () => getStatusColorScheme,
28
- getStatusIcon: () => getStatusIcon
26
+ AlertTitle: () => AlertTitle
29
27
  });
30
28
  module.exports = __toCommonJS(src_exports);
31
29
 
@@ -64,7 +62,12 @@ var Alert = (0, import_core.forwardRef)(
64
62
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertProvider, { value: { status, styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.div, { ref, className: (0, import_utils.cx)("ui-alert", className), role: "alert", __css: css, ...rest, children }) });
65
63
  }
66
64
  );
67
- var AlertIcon = ({ className, children, variant = "oval", ...rest }) => {
65
+ var AlertIcon = ({
66
+ className,
67
+ children,
68
+ variant = "oval",
69
+ ...rest
70
+ }) => {
68
71
  const { status, styles } = useAlert();
69
72
  const Icon = getStatusIcon(status);
70
73
  const css = {
@@ -99,7 +102,5 @@ var AlertDescription = (0, import_core.forwardRef)(
99
102
  Alert,
100
103
  AlertDescription,
101
104
  AlertIcon,
102
- AlertTitle,
103
- getStatusColorScheme,
104
- getStatusIcon
105
+ AlertTitle
105
106
  });
package/dist/index.mjs CHANGED
@@ -2,15 +2,11 @@ import {
2
2
  Alert,
3
3
  AlertDescription,
4
4
  AlertIcon,
5
- AlertTitle,
6
- getStatusColorScheme,
7
- getStatusIcon
8
- } from "./chunk-HFQA7RKI.mjs";
5
+ AlertTitle
6
+ } from "./chunk-G632DWL6.mjs";
9
7
  export {
10
8
  Alert,
11
9
  AlertDescription,
12
10
  AlertIcon,
13
- AlertTitle,
14
- getStatusColorScheme,
15
- getStatusIcon
11
+ AlertTitle
16
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/alert",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Yamada UI alert component",
5
5
  "keywords": [
6
6
  "yamada",
@@ -35,10 +35,10 @@
35
35
  "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@yamada-ui/core": "0.3.0",
38
+ "@yamada-ui/core": "0.3.1",
39
39
  "@yamada-ui/utils": "0.1.1",
40
- "@yamada-ui/icon": "0.1.11",
41
- "@yamada-ui/loading": "0.2.8"
40
+ "@yamada-ui/icon": "0.2.0",
41
+ "@yamada-ui/loading": "0.3.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "react": "^18.0.0",
@@ -72,6 +72,6 @@
72
72
  "build:fast": "tsup src",
73
73
  "clean": "rimraf dist .turbo",
74
74
  "typecheck": "tsc --noEmit",
75
- "gen:types": "tsx ../../../scripts/generate-types"
75
+ "gen:docs": "tsx ../../../scripts/generate-docs"
76
76
  }
77
77
  }