@bitrise/bitkit-v2 0.3.177 → 0.3.179
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/components/BitkitAlert/BitkitAlert.d.ts +4 -10
- package/dist/components/BitkitAlert/BitkitAlert.js +25 -48
- package/dist/components/BitkitMarkdown/BitkitMarkdown.d.ts +11 -0
- package/dist/components/BitkitMarkdown/BitkitMarkdown.js +104 -0
- package/dist/components/BitkitMarkdown/BitkitMarkdown.sample.d.ts +2 -0
- package/dist/components/BitkitMarkdownCard/BitkitMarkdownCard.d.ts +22 -0
- package/dist/components/BitkitMarkdownCard/BitkitMarkdownCard.js +62 -0
- package/dist/components/BitkitToast/BitkitToast.d.ts +14 -0
- package/dist/components/BitkitToast/BitkitToast.js +21 -0
- package/dist/components/BitkitToast/BitkitToaster.d.ts +2 -0
- package/dist/components/BitkitToast/BitkitToaster.js +56 -0
- package/dist/components/common/notificationMaps.d.ts +10 -0
- package/dist/components/common/notificationMaps.js +24 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/main.js +27 -24
- package/dist/providers/BitkitProvider.js +13 -8
- package/dist/theme/common/AlertAndToast.common.d.ts +6 -0
- package/dist/theme/common/AlertAndToast.common.js +50 -0
- package/dist/theme/slot-recipes/Alert.recipe.js +13 -55
- package/dist/theme/slot-recipes/Markdown.recipe.d.ts +20 -0
- package/dist/theme/slot-recipes/Markdown.recipe.js +24 -0
- package/dist/theme/slot-recipes/MarkdownCard.recipe.d.ts +45 -0
- package/dist/theme/slot-recipes/MarkdownCard.recipe.js +86 -0
- package/dist/theme/slot-recipes/Toast.recipe.js +71 -0
- package/dist/theme/slot-recipes/index.js +36 -30
- package/package.json +3 -2
- package/dist/theme/slot-recipes/Alert.recipe.d.ts +0 -65
- package/dist/theme/slot-recipes/index.d.ts +0 -1255
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { AlertRootProps } from '@chakra-ui/react/alert';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export type ActionProps = {
|
|
7
|
-
href?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
onClick?: () => void;
|
|
10
|
-
target?: HTMLAnchorElement['target'];
|
|
11
|
-
};
|
|
2
|
+
import { NotificationVariant } from '../../theme/common/AlertAndToast.common';
|
|
3
|
+
import { NotificationAction } from '../common/notificationMaps';
|
|
4
|
+
export type AlertVariants = NotificationVariant;
|
|
5
|
+
export type ActionProps = NotificationAction;
|
|
12
6
|
export interface BitkitAlertProps extends AlertRootProps {
|
|
13
7
|
action?: ActionProps;
|
|
14
8
|
dismissible?: boolean;
|
|
@@ -1,66 +1,43 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { rem as o } from "../../theme/themeUtils.js";
|
|
8
|
-
import s from "../BitkitColorButton/BitkitColorButton.js";
|
|
9
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
-
import { Alert as u } from "@chakra-ui/react/alert";
|
|
11
|
-
import { Spinner as d } from "@chakra-ui/react/spinner";
|
|
1
|
+
import e from "../BitkitCloseButton/BitkitCloseButton.js";
|
|
2
|
+
import { rem as t } from "../../theme/themeUtils.js";
|
|
3
|
+
import n from "../BitkitColorButton/BitkitColorButton.js";
|
|
4
|
+
import { BUTTON_COLORS_MAP as r, ICON_COMPONENTS_MAP as i } from "../common/notificationMaps.js";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Alert as s } from "@chakra-ui/react/alert";
|
|
12
7
|
//#region lib/components/BitkitAlert/BitkitAlert.tsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
info: "blue",
|
|
17
|
-
progress: "purple",
|
|
18
|
-
success: "green",
|
|
19
|
-
warning: "yellow"
|
|
20
|
-
}, p = {
|
|
21
|
-
ai: /* @__PURE__ */ c(r, {}),
|
|
22
|
-
critical: /* @__PURE__ */ c(t, {}),
|
|
23
|
-
info: /* @__PURE__ */ c(n, {}),
|
|
24
|
-
progress: /* @__PURE__ */ c(d, {
|
|
25
|
-
width: "20",
|
|
26
|
-
height: "20",
|
|
27
|
-
margin: "2"
|
|
28
|
-
}),
|
|
29
|
-
success: /* @__PURE__ */ c(e, {}),
|
|
30
|
-
warning: /* @__PURE__ */ c(i, {})
|
|
31
|
-
}, m = (e) => {
|
|
32
|
-
let { action: t, dismissible: n, messageText: r, onClose: i, titleText: d, variant: m, ...h } = e;
|
|
33
|
-
return /* @__PURE__ */ l(u.Root, {
|
|
8
|
+
var c = (c) => {
|
|
9
|
+
let { action: l, dismissible: u, messageText: d, onClose: f, titleText: p, variant: m, ...h } = c, g = i[m];
|
|
10
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
34
11
|
variant: m,
|
|
35
12
|
...h,
|
|
36
13
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ a(s.Indicator, {
|
|
38
15
|
asChild: m !== "progress",
|
|
39
|
-
children:
|
|
16
|
+
children: /* @__PURE__ */ a(g, {})
|
|
40
17
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
!!
|
|
43
|
-
as:
|
|
44
|
-
colorPalette:
|
|
45
|
-
...
|
|
46
|
-
href:
|
|
47
|
-
target:
|
|
18
|
+
/* @__PURE__ */ o(s.Content, { children: [p && /* @__PURE__ */ a(s.Title, { children: p }), /* @__PURE__ */ a(s.Description, { children: d })] }),
|
|
19
|
+
!!l && /* @__PURE__ */ a(n, {
|
|
20
|
+
as: l.href ? "a" : "button",
|
|
21
|
+
colorPalette: r[m],
|
|
22
|
+
...l.href && {
|
|
23
|
+
href: l.href,
|
|
24
|
+
target: l.target
|
|
48
25
|
},
|
|
49
|
-
onClick:
|
|
26
|
+
onClick: l.onClick,
|
|
50
27
|
marginInlineStart: "16",
|
|
51
28
|
marginInlineEnd: "12",
|
|
52
29
|
whiteSpace: "nowrap",
|
|
53
|
-
children:
|
|
30
|
+
children: l.label
|
|
54
31
|
}),
|
|
55
|
-
!!
|
|
32
|
+
!!u && /* @__PURE__ */ a(e, {
|
|
56
33
|
alignSelf: "flex-start",
|
|
57
|
-
marginBlockStart:
|
|
34
|
+
marginBlockStart: t(7),
|
|
58
35
|
size: "sm",
|
|
59
|
-
onClick:
|
|
60
|
-
colorPalette:
|
|
36
|
+
onClick: f,
|
|
37
|
+
colorPalette: r[m]
|
|
61
38
|
})
|
|
62
39
|
]
|
|
63
40
|
});
|
|
64
41
|
};
|
|
65
42
|
//#endregion
|
|
66
|
-
export {
|
|
43
|
+
export { c as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StackProps } from '@chakra-ui/react/stack';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { default as Markdown, Components } from 'react-markdown';
|
|
4
|
+
export interface BitkitMarkdownProps extends Omit<StackProps, 'children'> {
|
|
5
|
+
children: string;
|
|
6
|
+
components?: Components | null;
|
|
7
|
+
rehypePlugins?: ComponentProps<typeof Markdown>['rehypePlugins'];
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
}
|
|
10
|
+
declare const BitkitMarkdown: import('react').ForwardRefExoticComponent<BitkitMarkdownProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default BitkitMarkdown;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import e from "../BitkitCodeSnippet/BitkitCodeSnippet.js";
|
|
2
|
+
import t from "../BitkitLink/BitkitLink.js";
|
|
3
|
+
import n from "../BitkitOrderedList/BitkitOrderedList.js";
|
|
4
|
+
import r from "../BitkitUnorderedList/BitkitUnorderedList.js";
|
|
5
|
+
import { chakra as i, useSlotRecipe as a } from "@chakra-ui/react/styled-system";
|
|
6
|
+
import { Text as o } from "@chakra-ui/react/text";
|
|
7
|
+
import { createContext as s, forwardRef as c, isValidElement as l } from "react";
|
|
8
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
9
|
+
import { Separator as d } from "@chakra-ui/react/separator";
|
|
10
|
+
import { Stack as f } from "@chakra-ui/react/stack";
|
|
11
|
+
import { Heading as p } from "@chakra-ui/react/heading";
|
|
12
|
+
import m from "react-markdown";
|
|
13
|
+
//#region lib/components/BitkitMarkdown/BitkitMarkdown.tsx
|
|
14
|
+
var h = s("unordered"), g = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(g).join("") : l(e) ? g(e.props.children) : "", _ = (a, s) => {
|
|
15
|
+
let c = a === "lg" ? "lg" : "md", l = a === "lg" ? "lg" : "md";
|
|
16
|
+
return {
|
|
17
|
+
a: ({ node: e, ...n }) => /* @__PURE__ */ u(t, {
|
|
18
|
+
colorScheme: "purple",
|
|
19
|
+
rel: "noopener noreferrer",
|
|
20
|
+
target: "_blank",
|
|
21
|
+
...n
|
|
22
|
+
}),
|
|
23
|
+
blockquote: ({ node: e, ...t }) => /* @__PURE__ */ u(i.blockquote, {
|
|
24
|
+
css: s,
|
|
25
|
+
...t
|
|
26
|
+
}),
|
|
27
|
+
code: ({ node: t, children: n }) => /* @__PURE__ */ u(e, {
|
|
28
|
+
variant: "inline",
|
|
29
|
+
size: c,
|
|
30
|
+
children: String(n)
|
|
31
|
+
}),
|
|
32
|
+
h1: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
33
|
+
as: "h1",
|
|
34
|
+
textStyle: "heading/h1",
|
|
35
|
+
...t
|
|
36
|
+
}),
|
|
37
|
+
h2: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
38
|
+
as: "h2",
|
|
39
|
+
textStyle: "heading/h2",
|
|
40
|
+
...t
|
|
41
|
+
}),
|
|
42
|
+
h3: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
43
|
+
as: "h3",
|
|
44
|
+
textStyle: "heading/h3",
|
|
45
|
+
...t
|
|
46
|
+
}),
|
|
47
|
+
h4: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
48
|
+
as: "h4",
|
|
49
|
+
textStyle: "heading/h4",
|
|
50
|
+
...t
|
|
51
|
+
}),
|
|
52
|
+
h5: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
53
|
+
as: "h5",
|
|
54
|
+
textStyle: "heading/h5",
|
|
55
|
+
...t
|
|
56
|
+
}),
|
|
57
|
+
h6: ({ node: e, ...t }) => /* @__PURE__ */ u(p, {
|
|
58
|
+
as: "h6",
|
|
59
|
+
textStyle: "heading/h6",
|
|
60
|
+
...t
|
|
61
|
+
}),
|
|
62
|
+
hr: () => /* @__PURE__ */ u(d, {}),
|
|
63
|
+
li: ({ node: e, ...t }) => /* @__PURE__ */ u(h.Consumer, { children: (e) => u(e === "ordered" ? n.Item : r.Item, { children: t.children }) }),
|
|
64
|
+
ol: ({ node: e, ...t }) => /* @__PURE__ */ u(h.Provider, {
|
|
65
|
+
value: "ordered",
|
|
66
|
+
children: /* @__PURE__ */ u(n, {
|
|
67
|
+
size: l,
|
|
68
|
+
children: t.children
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
p: ({ node: e, ...t }) => /* @__PURE__ */ u(o, { ...t }),
|
|
72
|
+
pre: ({ node: t, children: n }) => /* @__PURE__ */ u(e, {
|
|
73
|
+
variant: "multi",
|
|
74
|
+
size: c,
|
|
75
|
+
children: g(n)
|
|
76
|
+
}),
|
|
77
|
+
ul: ({ node: e, ...t }) => /* @__PURE__ */ u(h.Provider, {
|
|
78
|
+
value: "unordered",
|
|
79
|
+
children: /* @__PURE__ */ u(r, {
|
|
80
|
+
size: l,
|
|
81
|
+
children: t.children
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
}, v = c((e, t) => {
|
|
86
|
+
let { children: n, components: r, rehypePlugins: i, size: o = "md", ...s } = e, c = a({ key: "markdown" })({ size: o }), l = {
|
|
87
|
+
..._(o, c.blockquote),
|
|
88
|
+
...r ?? {}
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ u(f, {
|
|
91
|
+
ref: t,
|
|
92
|
+
gap: "16",
|
|
93
|
+
css: c.root,
|
|
94
|
+
...s,
|
|
95
|
+
children: /* @__PURE__ */ u(m, {
|
|
96
|
+
components: l,
|
|
97
|
+
rehypePlugins: i,
|
|
98
|
+
children: n
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
v.displayName = "BitkitMarkdown";
|
|
103
|
+
//#endregion
|
|
104
|
+
export { v as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const SAMPLE_MARKDOWN = "Body text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n# Heading level 1\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n## Heading level 2\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n### Heading level 3\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n#### Heading level 4\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n##### Heading level 5\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n###### Heading level 6\n\nBody text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n---\n\n- List item A\n- List item B\n- List item C\n\n1. List item A\n2. List item B\n3. List item C\n\n```\nconst greet = (name: string): string => {\n return `Hello, ${name}!`;\n};\n```\n\nHere is some `inline code` in a sentence.\n\n> Block quote\n\nHere is a [link example](https://bitrise.io) for demonstration purposes.\n";
|
|
2
|
+
export default SAMPLE_MARKDOWN;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react/box';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type Status = 'critical' | 'info' | 'success' | 'warning';
|
|
4
|
+
type UncontrolledProps = {
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: never;
|
|
7
|
+
open?: never;
|
|
8
|
+
};
|
|
9
|
+
type ControlledProps = {
|
|
10
|
+
defaultOpen?: never;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
open: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type BitkitMarkdownCardProps = Omit<BoxProps, 'children'> & {
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
children: string;
|
|
17
|
+
collapsedHeight?: string;
|
|
18
|
+
size?: 'sm' | 'md' | 'lg';
|
|
19
|
+
status?: Status;
|
|
20
|
+
} & (UncontrolledProps | ControlledProps);
|
|
21
|
+
declare const BitkitMarkdownCard: import('react').ForwardRefExoticComponent<BitkitMarkdownCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export default BitkitMarkdownCard;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import e from "../../icons/IconCheck.js";
|
|
2
|
+
import t from "../../icons/IconChevronDown.js";
|
|
3
|
+
import n from "../../icons/IconChevronUp.js";
|
|
4
|
+
import r from "../../icons/IconErrorCircleFilled.js";
|
|
5
|
+
import i from "../../icons/IconInfoCircle.js";
|
|
6
|
+
import a from "../../icons/IconWarning.js";
|
|
7
|
+
import o from "../BitkitButton/BitkitButton.js";
|
|
8
|
+
import s from "../BitkitMarkdown/BitkitMarkdown.js";
|
|
9
|
+
import { Box as c } from "@chakra-ui/react/box";
|
|
10
|
+
import { useSlotRecipe as l } from "@chakra-ui/react/styled-system";
|
|
11
|
+
import { forwardRef as u } from "react";
|
|
12
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
13
|
+
import { Card as m } from "@chakra-ui/react/card";
|
|
14
|
+
import { Collapsible as h } from "@chakra-ui/react/collapsible";
|
|
15
|
+
import { HStack as g } from "@chakra-ui/react/stack";
|
|
16
|
+
//#region lib/components/BitkitMarkdownCard/BitkitMarkdownCard.tsx
|
|
17
|
+
var _ = {
|
|
18
|
+
critical: /* @__PURE__ */ f(r, { size: "24" }),
|
|
19
|
+
info: /* @__PURE__ */ f(i, { size: "24" }),
|
|
20
|
+
success: /* @__PURE__ */ f(e, { size: "24" }),
|
|
21
|
+
warning: /* @__PURE__ */ f(a, { size: "24" })
|
|
22
|
+
}, v = u((e, r) => {
|
|
23
|
+
let { actions: i, children: a, collapsedHeight: u = "200px", defaultOpen: v, onOpenChange: y, open: b, size: x = "md", status: S = "info", ...C } = e, w = l({ key: "markdownCard" })({ status: S }), T = y ? (e) => y(e.open) : void 0;
|
|
24
|
+
return /* @__PURE__ */ f(m.Root, {
|
|
25
|
+
ref: r,
|
|
26
|
+
css: w.root,
|
|
27
|
+
...C,
|
|
28
|
+
children: /* @__PURE__ */ p(g, {
|
|
29
|
+
align: "stretch",
|
|
30
|
+
gap: "0",
|
|
31
|
+
children: [/* @__PURE__ */ f(c, {
|
|
32
|
+
css: w.iconBar,
|
|
33
|
+
children: _[S]
|
|
34
|
+
}), /* @__PURE__ */ f(c, {
|
|
35
|
+
css: w.content,
|
|
36
|
+
children: /* @__PURE__ */ p(h.Root, {
|
|
37
|
+
open: b,
|
|
38
|
+
defaultOpen: v,
|
|
39
|
+
collapsedHeight: u,
|
|
40
|
+
onOpenChange: T,
|
|
41
|
+
children: [/* @__PURE__ */ f(h.Content, { children: /* @__PURE__ */ f(s, {
|
|
42
|
+
size: x,
|
|
43
|
+
children: a
|
|
44
|
+
}) }), /* @__PURE__ */ f(h.Context, { children: (e) => /* @__PURE__ */ p(d, { children: [!e.open && /* @__PURE__ */ f(c, { css: w.gradient }), /* @__PURE__ */ p(g, {
|
|
45
|
+
gap: "16",
|
|
46
|
+
css: w.footerButtons,
|
|
47
|
+
children: [i, /* @__PURE__ */ f(o, {
|
|
48
|
+
...e.getTriggerProps(),
|
|
49
|
+
size: "sm",
|
|
50
|
+
suffixIcon: e.open ? n : t,
|
|
51
|
+
variant: "secondary",
|
|
52
|
+
children: e.open ? "Show less" : "Show more"
|
|
53
|
+
})]
|
|
54
|
+
})] }) })]
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
v.displayName = "BitkitMarkdownCard";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { v as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NotificationVariant } from '../../theme/common/AlertAndToast.common';
|
|
2
|
+
import { NotificationAction } from '../common/notificationMaps';
|
|
3
|
+
export type BitkitToastVariant = NotificationVariant;
|
|
4
|
+
export type BitkitToastProps = {
|
|
5
|
+
action?: NotificationAction;
|
|
6
|
+
dismissible?: boolean;
|
|
7
|
+
messageText: string;
|
|
8
|
+
timestamp?: string;
|
|
9
|
+
titleText?: string;
|
|
10
|
+
variant: BitkitToastVariant;
|
|
11
|
+
};
|
|
12
|
+
export declare const toaster: import('@zag-js/toast').Store<any>;
|
|
13
|
+
declare const createBitkitToast: (props: BitkitToastProps) => string;
|
|
14
|
+
export default createBitkitToast;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createToaster as e } from "@chakra-ui/react/toast";
|
|
2
|
+
//#region lib/components/BitkitToast/BitkitToast.tsx
|
|
3
|
+
var t = e({
|
|
4
|
+
max: 5,
|
|
5
|
+
placement: "top-end",
|
|
6
|
+
pauseOnPageIdle: !0
|
|
7
|
+
}), n = (e) => {
|
|
8
|
+
let { action: n, dismissible: r = !0, messageText: i, timestamp: a, titleText: o, variant: s } = e;
|
|
9
|
+
return t.create({
|
|
10
|
+
closable: r,
|
|
11
|
+
description: i,
|
|
12
|
+
meta: {
|
|
13
|
+
action: n,
|
|
14
|
+
timestamp: a
|
|
15
|
+
},
|
|
16
|
+
title: o,
|
|
17
|
+
type: s
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as default, t as toaster };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import e from "../BitkitCloseButton/BitkitCloseButton.js";
|
|
2
|
+
import t from "../BitkitColorButton/BitkitColorButton.js";
|
|
3
|
+
import { BUTTON_COLORS_MAP as n, ICON_COMPONENTS_MAP as r } from "../common/notificationMaps.js";
|
|
4
|
+
import { toaster as i } from "./BitkitToast.js";
|
|
5
|
+
import { Box as a } from "@chakra-ui/react/box";
|
|
6
|
+
import { useSlotRecipe as o } from "@chakra-ui/react/styled-system";
|
|
7
|
+
import { Text as s } from "@chakra-ui/react/text";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import { Toast as u, Toaster as d } from "@chakra-ui/react/toast";
|
|
10
|
+
//#region lib/components/BitkitToast/BitkitToaster.tsx
|
|
11
|
+
var f = () => {
|
|
12
|
+
let f = o({ key: "toast" });
|
|
13
|
+
return /* @__PURE__ */ c(d, {
|
|
14
|
+
toaster: i,
|
|
15
|
+
children: (i) => {
|
|
16
|
+
let o = i.type, d = f({ variant: o }), p = r[o];
|
|
17
|
+
return /* @__PURE__ */ l(u.Root, {
|
|
18
|
+
variant: o,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ c(p, { css: d.icon }),
|
|
21
|
+
/* @__PURE__ */ l(a, {
|
|
22
|
+
css: d.content,
|
|
23
|
+
children: [
|
|
24
|
+
!!i.title && /* @__PURE__ */ c(u.Title, { children: i.title }),
|
|
25
|
+
/* @__PURE__ */ c(u.Description, { children: i.description }),
|
|
26
|
+
!!i.meta?.action && /* @__PURE__ */ c(t, {
|
|
27
|
+
as: i.meta.action.href ? "a" : "button",
|
|
28
|
+
colorPalette: n[o],
|
|
29
|
+
css: d.actionTrigger,
|
|
30
|
+
...i.meta.action.href && {
|
|
31
|
+
href: i.meta.action.href,
|
|
32
|
+
target: i.meta.action.target
|
|
33
|
+
},
|
|
34
|
+
onClick: i.meta.action.onClick,
|
|
35
|
+
children: i.meta.action.label
|
|
36
|
+
}),
|
|
37
|
+
!!i.meta?.timestamp && /* @__PURE__ */ c(s, {
|
|
38
|
+
css: d.timestamp,
|
|
39
|
+
children: i.meta.timestamp
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
i.closable && /* @__PURE__ */ c(u.CloseTrigger, {
|
|
44
|
+
asChild: !0,
|
|
45
|
+
children: /* @__PURE__ */ c(e, {
|
|
46
|
+
colorPalette: n[o],
|
|
47
|
+
size: "sm"
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { f as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { NotificationVariant } from '../../theme/common/AlertAndToast.common';
|
|
3
|
+
export type NotificationAction = {
|
|
4
|
+
href?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
target?: HTMLAnchorElement['target'];
|
|
8
|
+
};
|
|
9
|
+
export declare const BUTTON_COLORS_MAP: Record<NotificationVariant, string>;
|
|
10
|
+
export declare const ICON_COMPONENTS_MAP: Record<NotificationVariant, ElementType>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "../../icons/IconCheck.js";
|
|
2
|
+
import t from "../../icons/IconErrorCircleFilled.js";
|
|
3
|
+
import n from "../../icons/IconInfoCircle.js";
|
|
4
|
+
import r from "../../icons/IconSparkleFilled.js";
|
|
5
|
+
import i from "../../icons/IconWarning.js";
|
|
6
|
+
import { Spinner as a } from "@chakra-ui/react/spinner";
|
|
7
|
+
//#region lib/components/common/notificationMaps.tsx
|
|
8
|
+
var o = {
|
|
9
|
+
ai: "indigo",
|
|
10
|
+
critical: "red",
|
|
11
|
+
info: "blue",
|
|
12
|
+
progress: "purple",
|
|
13
|
+
success: "green",
|
|
14
|
+
warning: "yellow"
|
|
15
|
+
}, s = {
|
|
16
|
+
ai: r,
|
|
17
|
+
critical: t,
|
|
18
|
+
info: n,
|
|
19
|
+
progress: a,
|
|
20
|
+
success: e,
|
|
21
|
+
warning: i
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as BUTTON_COLORS_MAP, s as ICON_COMPONENTS_MAP };
|
|
@@ -32,6 +32,8 @@ export { default as BitkitLabel, type BitkitLabelProps } from './BitkitLabel/Bit
|
|
|
32
32
|
export { default as BitkitLabelTooltip, type BitkitLabelTooltipProps } from './BitkitLabelTooltip/BitkitLabelTooltip';
|
|
33
33
|
export { default as BitkitLink, type BitkitLinkProps } from './BitkitLink/BitkitLink';
|
|
34
34
|
export { default as BitkitLinkButton, type BitkitLinkButtonProps } from './BitkitLinkButton/BitkitLinkButton';
|
|
35
|
+
export { default as BitkitMarkdown, type BitkitMarkdownProps } from './BitkitMarkdown/BitkitMarkdown';
|
|
36
|
+
export { default as BitkitMarkdownCard, type BitkitMarkdownCardProps } from './BitkitMarkdownCard/BitkitMarkdownCard';
|
|
35
37
|
export { default as BitkitNativeSelect, type BitkitNativeSelectProps } from './BitkitNativeSelect/BitkitNativeSelect';
|
|
36
38
|
export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
|
|
37
39
|
export { default as BitkitOrderedList, type BitkitOrderedListItemProps, type BitkitOrderedListProps, } from './BitkitOrderedList/BitkitOrderedList';
|
|
@@ -51,6 +53,7 @@ export { default as BitkitTabs } from './BitkitTabs/BitkitTabs';
|
|
|
51
53
|
export { default as BitkitTag, type BitkitTagProps } from './BitkitTag/BitkitTag';
|
|
52
54
|
export { default as BitkitTagsInput, type BitkitTagsInputProps } from './BitkitTagsInput/BitkitTagsInput';
|
|
53
55
|
export { default as BitkitTextInput, type BitkitTextInputProps } from './BitkitTextInput/BitkitTextInput';
|
|
56
|
+
export { type BitkitToastProps, default as createBitkitToast } from './BitkitToast/BitkitToast';
|
|
54
57
|
export { default as BitkitToggle, type BitkitToggleProps } from './BitkitToggle';
|
|
55
58
|
export { default as BitkitToggleButton, type BitkitToggleButtonProps } from './BitkitToggleButton/BitkitToggleButton';
|
|
56
59
|
export { default as BitkitTooltip, type BitkitTooltipProps } from './BitkitTooltip/BitkitTooltip';
|
package/dist/main.js
CHANGED
|
@@ -313,27 +313,30 @@ import Hi from "./components/BitkitInlineLoading/BitkitInlineLoading.js";
|
|
|
313
313
|
import Ui from "./components/BitkitInteractiveTooltip/BitkitInteractiveTooltip.js";
|
|
314
314
|
import Wi from "./components/BitkitLink/BitkitLink.js";
|
|
315
315
|
import Gi from "./components/BitkitLinkButton/BitkitLinkButton.js";
|
|
316
|
-
import Ki from "./components/
|
|
317
|
-
import qi from "./components/
|
|
318
|
-
import Ji from "./components/
|
|
319
|
-
import Yi from "./components/
|
|
320
|
-
import Xi from "./components/
|
|
321
|
-
import Zi from "./components/
|
|
322
|
-
import Qi from "./components/
|
|
323
|
-
import $i from "./components/
|
|
324
|
-
import ea from "./components/
|
|
325
|
-
import ta from "./components/
|
|
326
|
-
import na from "./components/
|
|
327
|
-
import ra from "./components/
|
|
328
|
-
import ia from "./components/
|
|
329
|
-
import aa from "./components/
|
|
330
|
-
import oa from "./components/
|
|
331
|
-
import sa from "./components/
|
|
332
|
-
import ca from "./components/
|
|
333
|
-
import la from "./components/
|
|
334
|
-
import ua from "./components/
|
|
335
|
-
import da from "./components/
|
|
336
|
-
import fa from "./components/
|
|
337
|
-
import pa from "./
|
|
338
|
-
import ma from "./
|
|
339
|
-
|
|
316
|
+
import Ki from "./components/BitkitOrderedList/BitkitOrderedList.js";
|
|
317
|
+
import qi from "./components/BitkitUnorderedList/BitkitUnorderedList.js";
|
|
318
|
+
import Ji from "./components/BitkitMarkdown/BitkitMarkdown.js";
|
|
319
|
+
import Yi from "./components/BitkitMarkdownCard/BitkitMarkdownCard.js";
|
|
320
|
+
import Xi from "./components/BitkitNativeSelect/BitkitNativeSelect.js";
|
|
321
|
+
import Zi from "./components/BitkitNumberInput/BitkitNumberInput.js";
|
|
322
|
+
import Qi from "./components/BitkitOverflowTooltip/BitkitOverflowTooltip.js";
|
|
323
|
+
import $i from "./components/BitkitPaginationLoadMore/BitkitPaginationLoadMore.js";
|
|
324
|
+
import ea from "./components/BitkitRadio/BitkitRadio.js";
|
|
325
|
+
import ta from "./components/BitkitRadioGroup/BitkitRadioGroup.js";
|
|
326
|
+
import na from "./components/BitkitRibbon/BitkitRibbon.js";
|
|
327
|
+
import ra from "./components/BitkitSearchInput/BitkitSearchInput.js";
|
|
328
|
+
import ia from "./components/BitkitSectionHeading/BitkitSectionHeading.js";
|
|
329
|
+
import aa from "./components/BitkitSegmentedControl/BitkitSegmentedControl.js";
|
|
330
|
+
import oa from "./components/BitkitSelect/BitkitSelect.js";
|
|
331
|
+
import sa from "./components/BitkitSelectableTag/BitkitSelectableTag.js";
|
|
332
|
+
import ca from "./components/BitkitSplitButton/BitkitSplitButton.js";
|
|
333
|
+
import la from "./components/BitkitTabs/BitkitTabs.js";
|
|
334
|
+
import ua from "./components/BitkitTag/BitkitTag.js";
|
|
335
|
+
import da from "./components/BitkitTagsInput/BitkitTagsInput.js";
|
|
336
|
+
import fa from "./components/BitkitTextInput/BitkitTextInput.js";
|
|
337
|
+
import pa from "./components/BitkitToast/BitkitToast.js";
|
|
338
|
+
import ma from "./components/BitkitToggle/BitkitToggle.js";
|
|
339
|
+
import ha from "./components/BitkitToggleButton/BitkitToggleButton.js";
|
|
340
|
+
import ga from "./theme/index.js";
|
|
341
|
+
import _a from "./providers/BitkitProvider.js";
|
|
342
|
+
export { e as BitkitAccordion, pi as BitkitActionBar, hi as BitkitAlert, gi as BitkitAvatar, _i as BitkitBadge, vi as BitkitButton, bi as BitkitCalendar, xi as BitkitCard, Si as BitkitCheckbox, Ci as BitkitCheckboxGroup, fi as BitkitCloseButton, Ti as BitkitCodeSnippet, Di as BitkitCollapsible, mi as BitkitColorButton, ki as BitkitCombobox, Ai as BitkitControlButton, ji as BitkitDefinitionTooltip, Fi as BitkitDialog, Mi as BitkitDialogBody, Ni as BitkitDialogContent, Pi as BitkitDialogRoot, Ii as BitkitEmptyState, Li as BitkitExpandableCard, Ri as BitkitExplainerList, Oi as BitkitField, zi as BitkitFileInput, Bi as BitkitGroupHeading, Vi as BitkitIconButton, Hi as BitkitInlineLoading, Ui as BitkitInteractiveTooltip, Ei as BitkitLabel, di as BitkitLabelTooltip, Wi as BitkitLink, Gi as BitkitLinkButton, Ji as BitkitMarkdown, Yi as BitkitMarkdownCard, Xi as BitkitNativeSelect, Zi as BitkitNumberInput, Ki as BitkitOrderedList, Qi as BitkitOverflowTooltip, $i as BitkitPaginationLoadMore, _a as BitkitProvider, ea as BitkitRadio, ta as BitkitRadioGroup, na as BitkitRibbon, ra as BitkitSearchInput, ia as BitkitSectionHeading, aa as BitkitSegmentedControl, oa as BitkitSelect, yi as BitkitSelectMenu, sa as BitkitSelectableTag, ca as BitkitSplitButton, la as BitkitTabs, ua as BitkitTag, da as BitkitTagsInput, fa as BitkitTextInput, ma as BitkitToggle, ha as BitkitToggleButton, wi as BitkitTooltip, qi as BitkitUnorderedList, n as IconAbortCircle, r as IconAbortCircleFilled, i as IconAddons, a as IconAgent, o as IconAnchor, s as IconAndroid, c as IconApp, u as IconAppSettings, d as IconAppStore, f as IconAppStoreColor, l as IconApple, p as IconArchive, m as IconArchiveDelete, h as IconArchiveRestore, g as IconArrowBackAndDown, _ as IconArrowBackAndUp, v as IconArrowDown, y as IconArrowForwardAndDown, b as IconArrowForwardAndUp, x as IconArrowLeft, S as IconArrowNortheast, C as IconArrowNorthwest, w as IconArrowRight, D as IconArrowUp, T as IconArrowsHorizontal, E as IconArrowsVertical, O as IconAutomation, k as IconAws, A as IconAwsColor, j as IconBadge3RdParty, M as IconBadgeBitrise, N as IconBadgeUpgrade, P as IconBadgeVersionOk, F as IconBazel, I as IconBell, L as IconBitbot, R as IconBitbotError, z as IconBitbucket, B as IconBitbucketColor, V as IconBitbucketNeutral, H as IconBitbucketWhite, U as IconBlockCircle, W as IconBook, G as IconBoxArrowDown, K as IconBoxDot, q as IconBoxLinesOverflow, J as IconBoxLinesWrap, Y as IconBranch, X as IconBrowserstackColor, Z as IconBug, Q as IconBuild, $ as IconBuildCache, ee as IconBuildCacheFilled, te as IconBuildEnvSetup, ne as IconCalendar, re as IconChangePlan, ie as IconChat, ae as IconCheck, oe as IconCheckCircle, se as IconCheckCircleFilled, ce as IconChevronDown, le as IconChevronLeft, ue as IconChevronRight, de as IconChevronUp, fe as IconCi, pe as IconCiFilled, me as IconCircle, he as IconCircleDashed, ge as IconCircleHalfFilled, _e as IconClaude, ve as IconClaudeColor, ye as IconClock, be as IconCode, xe as IconCodePush, Se as IconCodeSigning, Ce as IconCoffee, we as IconCommit, Te as IconConfigure, Ee as IconConnectedAccounts, De as IconContainer, Oe as IconCopy, ke as IconCordova, Ae as IconCpu, je as IconCreditcard, Me as IconCredits, Ne as IconCross, Pe as IconCrossCircle, Fe as IconCrossCircleFilled, Ie as IconCrown, Le as IconCycle, Re as IconDashboard, ze as IconDashboardFilled, Be as IconDeployment, Ve as IconDetails, He as IconDoc, Ue as IconDollar, We as IconDot, Ge as IconDotnet, Ke as IconDotnetColor, qe as IconDotnetText, Je as IconDotnetTextColor, Ye as IconDoubleCircle, Xe as IconDownload, Ze as IconEc2Ami, Qe as IconEnterprise, $e as IconErrorCircle, et as IconErrorCircleFilled, tt as IconExpand, nt as IconExtraBuildCapacity, rt as IconEye, it as IconEyeSlash, at as IconFastlane, ot as IconFileDoc, st as IconFilePdf, ct as IconFilePlist, lt as IconFileZip, ut as IconFilter, dt as IconFlag, ft as IconFlutter, pt as IconFolder, mt as IconFullscreen, ht as IconFullscreenExit, gt as IconGauge, _t as IconGit, vt as IconGithub, yt as IconGitlab, bt as IconGitlabColor, xt as IconGitlabWhite, St as IconGlobe, Ct as IconGo, wt as IconGoogleColor, Tt as IconGooglePlay, Et as IconGooglePlayColor, Dt as IconGradle, Ot as IconGroup, kt as IconHashtag, At as IconHeadset, jt as IconHeart, Mt as IconHistory, Nt as IconHourglass, Pt as IconImage, Ft as IconInfoCircle, It as IconInfoCircleFilled, Lt as IconInsights, Rt as IconInsightsFilled, zt as IconInstall, Bt as IconInteraction, Vt as IconInvoice, Ht as IconIonic, Ut as IconJapanese, Wt as IconJava, Gt as IconJavaColor, Kt as IconJavaDuke, qt as IconJavaDukeColor, Jt as IconKey, Yt as IconKotlin, Xt as IconKotlinColor, Zt as IconKotlinWhite, Qt as IconLaptop, $t as IconLaunchdarkly, en as IconLegacyApp, tn as IconLightbulb, nn as IconLink, rn as IconLinux, an as IconLock, on as IconLockOpen, sn as IconLogin, cn as IconLogout, ln as IconMacos, un as IconMagicWand, dn as IconMagnifier, fn as IconMail, pn as IconMedal, mn as IconMemory, hn as IconMenuGrid, gn as IconMenuHamburger, _n as IconMessage, vn as IconMessageAlert, yn as IconMessageQuestion, bn as IconMicrophone, xn as IconMinus, Sn as IconMinusCircle, Cn as IconMinusCircleFilled, wn as IconMobile, Tn as IconMobileLandscape, En as IconMonitorChart, Dn as IconMoreHorizontal, On as IconMoreVertical, kn as IconNews, An as IconNextjs, jn as IconNodejs, Mn as IconOpenInNew, Nn as IconOther, Pn as IconOutsideContributor, Fn as IconOverview, In as IconPause, Ln as IconPencil, Rn as IconPeople, zn as IconPercent, Bn as IconPerson, Vn as IconPersonWithDesk, Hn as IconPlay, Un as IconPlus, Wn as IconPlusCircle, Gn as IconPlusCircleFilled, Kn as IconPower, qn as IconProject, Jn as IconProjectSettings, Yn as IconPull, Xn as IconPush, Zn as IconPuzzle, Qn as IconPython, $n as IconPythonColor, er as IconQuestionCircle, tr as IconQuestionCircleFilled, nr as IconReact, rr as IconRefresh, ir as IconRegex, ar as IconRelease, or as IconReleaseFilled, sr as IconRemoteAccess, cr as IconReplace, lr as IconResponsiveness, ur as IconReviewerApproved, dr as IconReviewerAssigned, fr as IconReviewerRejected, pr as IconRuby, mr as IconRubyColor, hr as IconSave, gr as IconSecurityShield, _r as IconSettings, vr as IconSettingsFilled, yr as IconShuffle, br as IconSiren, xr as IconSkipCircle, Sr as IconSkipCircleFilled, Cr as IconSlack, wr as IconSlackColor, Tr as IconSparkle, Er as IconSparkleFilled, Dr as IconSpinnerOnDisabled, Or as IconSpinnerPurple, kr as IconSpinnerPurpleDouble, Ar as IconSpinnerWhite, jr as IconStability, Mr as IconStack, Nr as IconStar, Pr as IconStep, Fr as IconStop, Ir as IconStopwatch, Lr as IconTag, Rr as IconTasks, zr as IconTeams, Br as IconTeamsColor, Vr as IconTemplateCode, Hr as IconTerminal, Ur as IconTestQuarantine, Wr as IconThemeDarkToggle, Gr as IconThumbDown, Kr as IconThumbUp, qr as IconTools, Jr as IconTrash, Yr as IconTrigger, Xr as IconUbuntu, Zr as IconUbuntuColor, Qr as IconUnity3D, $r as IconUpload, ei as IconValidateShield, ti as IconVideo, ni as IconWarning, ri as IconWarningYellow, ai as IconWebUi, ii as IconWebhooks, oi as IconWorkflow, si as IconWorkflowFlow, ui as IconXTwitter, ci as IconXamarin, li as IconXcode, t as bitkitIcon, ga as bitriseTheme, pa as createBitkitToast };
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import e from "../components/BitkitToast/BitkitToaster.js";
|
|
3
|
+
import t from "../theme/index.js";
|
|
4
|
+
import { ChakraProvider as n } from "@chakra-ui/react/styled-system";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
6
|
import "@fontsource-variable/figtree/index.css";
|
|
6
7
|
import "@fontsource-variable/source-code-pro/index.css";
|
|
7
8
|
//#region lib/providers/BitkitProvider.tsx
|
|
8
|
-
var
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var a = (a) => {
|
|
10
|
+
let { children: o, ...s } = a;
|
|
11
|
+
return /* @__PURE__ */ i(n, {
|
|
12
|
+
...s,
|
|
13
|
+
value: t,
|
|
14
|
+
children: [o, /* @__PURE__ */ r(e, {})]
|
|
15
|
+
});
|
|
16
|
+
};
|
|
12
17
|
//#endregion
|
|
13
|
-
export {
|
|
18
|
+
export { a as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SystemStyleObject } from '@chakra-ui/react/styled-system';
|
|
2
|
+
export declare const NOTIFICATION_VARIANTS: readonly ["ai", "critical", "info", "progress", "success", "warning"];
|
|
3
|
+
export type NotificationVariant = (typeof NOTIFICATION_VARIANTS)[number];
|
|
4
|
+
export declare const ROOT_MAP: Record<NotificationVariant, SystemStyleObject>;
|
|
5
|
+
export declare const ICONS_MAP: Record<NotificationVariant, string>;
|
|
6
|
+
export declare const TEXT_MAP: Record<NotificationVariant, string>;
|