@knocklabs/react 0.3.0-rc.0 → 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/CHANGELOG.md +44 -5
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/modules/core/utils.js +2 -0
- package/dist/cjs/modules/core/utils.js.map +1 -0
- package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -1
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +2 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js +2 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js.map +1 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js +2 -0
- package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js.map +1 -0
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +1 -1
- package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
- package/dist/esm/index.mjs +38 -43
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/modules/core/utils.mjs +8 -0
- package/dist/esm/modules/core/utils.mjs.map +1 -0
- package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -1
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +43 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs +17 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs.map +1 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs +15 -0
- package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs.map +1 -0
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +24 -26
- package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/types/App.d.ts +0 -1
- package/dist/types/App.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/main.d.ts +0 -1
- package/dist/types/modules/core/components/Button/Button.d.ts +0 -1
- package/dist/types/modules/core/components/Button/ButtonGroup.d.ts +0 -1
- package/dist/types/modules/core/components/Button/ButtonSpinner.d.ts +0 -1
- package/dist/types/modules/core/components/Icons/Bell.d.ts +0 -1
- package/dist/types/modules/core/components/Icons/CheckmarkCircle.d.ts +0 -1
- package/dist/types/modules/core/components/Icons/ChevronDown.d.ts +0 -1
- package/dist/types/modules/core/components/Icons/CloseCircle.d.ts +0 -1
- package/dist/types/modules/core/components/Spinner/Spinner.d.ts +0 -1
- package/dist/types/modules/core/hooks/useOnBottomScroll.d.ts +0 -1
- package/dist/types/modules/core/hooks/useOutsideClick.d.ts +0 -1
- package/dist/types/modules/core/utils.d.ts +2 -0
- package/dist/types/modules/core/utils.d.ts.map +1 -0
- package/dist/types/modules/feed/components/EmptyFeed/EmptyFeed.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationCell/ArchiveButton.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationCell/Avatar.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationCell/NotificationCell.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeed/Dropdown.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeed/MarkAsRead.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeed/NotificationFeed.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeed/NotificationFeedHeader.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.d.ts +0 -1
- package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts +0 -1
- package/dist/types/modules/feed/components/UnseenBadge/UnseenBadge.d.ts +0 -1
- package/dist/types/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.d.ts +8 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthButton/index.d.ts +2 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthButton/index.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.d.ts +6 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthContainer/index.d.ts +2 -0
- package/dist/types/modules/ms-teams/components/MsTeamsAuthContainer/index.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.d.ts +7 -0
- package/dist/types/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/components/MsTeamsIcon/index.d.ts +2 -0
- package/dist/types/modules/ms-teams/components/MsTeamsIcon/index.d.ts.map +1 -0
- package/dist/types/modules/ms-teams/index.d.ts +3 -0
- package/dist/types/modules/ms-teams/index.d.ts.map +1 -0
- package/dist/types/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackAuthButton/SlackAuthButton.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackAuthButton/SlackAuthButton.d.ts.map +1 -1
- package/dist/types/modules/slack/components/SlackAuthContainer/SlackAuthContainer.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackChannelListBox.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackChannelOption.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackConnectedChannelTag.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackConnectedChannelTagList.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/SlackConnectionError.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/CheckmarkIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/CloseIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/HashtagIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/InfoIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/LockIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackChannelCombobox/icons/SearchIcon.d.ts +0 -1
- package/dist/types/modules/slack/components/SlackIcon/SlackIcon.d.ts +0 -1
- package/package.json +14 -18
- package/dist/cjs/modules/in-app-messages/components/Banner/Banner.js +0 -2
- package/dist/cjs/modules/in-app-messages/components/Banner/Banner.js.map +0 -1
- package/dist/cjs/modules/in-app-messages/components/Card/Card.js +0 -2
- package/dist/cjs/modules/in-app-messages/components/Card/Card.js.map +0 -1
- package/dist/cjs/modules/in-app-messages/components/Modal/Modal.js +0 -2
- package/dist/cjs/modules/in-app-messages/components/Modal/Modal.js.map +0 -1
- package/dist/esm/modules/in-app-messages/components/Banner/Banner.mjs +0 -97
- package/dist/esm/modules/in-app-messages/components/Banner/Banner.mjs.map +0 -1
- package/dist/esm/modules/in-app-messages/components/Card/Card.mjs +0 -109
- package/dist/esm/modules/in-app-messages/components/Card/Card.mjs.map +0 -1
- package/dist/esm/modules/in-app-messages/components/Modal/Modal.mjs +0 -113
- package/dist/esm/modules/in-app-messages/components/Modal/Modal.mjs.map +0 -1
- package/dist/types/modules/in-app-messages/components/Banner/Banner.d.ts +0 -52
- package/dist/types/modules/in-app-messages/components/Banner/Banner.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/Banner/index.d.ts +0 -2
- package/dist/types/modules/in-app-messages/components/Banner/index.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/Card/Card.d.ts +0 -57
- package/dist/types/modules/in-app-messages/components/Card/Card.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/Card/index.d.ts +0 -2
- package/dist/types/modules/in-app-messages/components/Card/index.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/Modal/Modal.d.ts +0 -70
- package/dist/types/modules/in-app-messages/components/Modal/Modal.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/Modal/index.d.ts +0 -2
- package/dist/types/modules/in-app-messages/components/Modal/index.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/index.d.ts +0 -4
- package/dist/types/modules/in-app-messages/components/index.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/components/types.d.ts +0 -5
- package/dist/types/modules/in-app-messages/components/types.d.ts.map +0 -1
- package/dist/types/modules/in-app-messages/index.d.ts +0 -2
- package/dist/types/modules/in-app-messages/index.d.ts.map +0 -1
@@ -1,109 +0,0 @@
|
|
1
|
-
import { useInAppMessagesChannel as C, useInAppMessage as w } from "@knocklabs/react-core";
|
2
|
-
import c from "clsx";
|
3
|
-
import t, { useEffect as f } from "react";
|
4
|
-
/* empty css */
|
5
|
-
const h = "card", i = ({
|
6
|
-
children: e,
|
7
|
-
className: n,
|
8
|
-
...a
|
9
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card", n), ...a }, e);
|
10
|
-
i.displayName = "CardView.Root";
|
11
|
-
const l = ({
|
12
|
-
children: e,
|
13
|
-
className: n,
|
14
|
-
...a
|
15
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__message", n), ...a }, e);
|
16
|
-
l.displayName = "CardView.Content";
|
17
|
-
const k = ({
|
18
|
-
children: e,
|
19
|
-
className: n,
|
20
|
-
...a
|
21
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__header", n), ...a }, e);
|
22
|
-
k.displayName = "CardView.Header";
|
23
|
-
const E = ({
|
24
|
-
headline: e,
|
25
|
-
className: n,
|
26
|
-
...a
|
27
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__headline", n), ...a }, e);
|
28
|
-
E.displayName = "CardView.Headline";
|
29
|
-
const s = ({
|
30
|
-
title: e,
|
31
|
-
className: n,
|
32
|
-
...a
|
33
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__title", n), ...a }, e);
|
34
|
-
s.displayName = "CardView.Title";
|
35
|
-
const o = ({
|
36
|
-
body: e,
|
37
|
-
className: n,
|
38
|
-
...a
|
39
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__body", n), ...a }, e);
|
40
|
-
o.displayName = "CardView.Body";
|
41
|
-
const m = ({
|
42
|
-
children: e,
|
43
|
-
className: n,
|
44
|
-
...a
|
45
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: c("knock-iam-card__actions", n), ...a }, e);
|
46
|
-
m.displayName = "CardView.Actions";
|
47
|
-
const d = ({
|
48
|
-
text: e,
|
49
|
-
action: n,
|
50
|
-
className: a,
|
51
|
-
...r
|
52
|
-
}) => /* @__PURE__ */ t.createElement("a", { href: n, className: c("knock-iam-card__action", a), ...r }, e);
|
53
|
-
d.displayName = "CardView.PrimaryAction";
|
54
|
-
const u = ({
|
55
|
-
text: e,
|
56
|
-
action: n,
|
57
|
-
className: a,
|
58
|
-
...r
|
59
|
-
}) => /* @__PURE__ */ t.createElement("a", { href: n, className: c("knock-iam-card__action knock-iam-card__action--secondary", a), ...r }, e);
|
60
|
-
u.displayName = "CardView.SecondaryAction";
|
61
|
-
const _ = ({
|
62
|
-
className: e,
|
63
|
-
...n
|
64
|
-
}) => /* @__PURE__ */ t.createElement("button", { className: c("knock-iam-card__close", e), ...n }, /* @__PURE__ */ t.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none" }, /* @__PURE__ */ t.createElement("g", { fill: "#60646C", fillRule: "evenodd", clipRule: "evenodd" }, /* @__PURE__ */ t.createElement("path", { d: "M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z" }), /* @__PURE__ */ t.createElement("path", { d: "M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z" }))));
|
65
|
-
_.displayName = "CardView.DismissButton";
|
66
|
-
const p = ({
|
67
|
-
content: e,
|
68
|
-
colorMode: n = "light",
|
69
|
-
onInteract: a,
|
70
|
-
onDismiss: r
|
71
|
-
}) => /* @__PURE__ */ t.createElement(i, { "data-knock-color-mode": n, onClick: a }, /* @__PURE__ */ t.createElement(l, null, /* @__PURE__ */ t.createElement(k, null, /* @__PURE__ */ t.createElement(E, { headline: e.headline }), e.dismissible && /* @__PURE__ */ t.createElement(_, { onClick: r })), /* @__PURE__ */ t.createElement(s, { title: e.title }), /* @__PURE__ */ t.createElement(o, { body: e.body })), /* @__PURE__ */ t.createElement(m, null, e.primary_button && /* @__PURE__ */ t.createElement(d, { text: e.primary_button.text, action: e.primary_button.action }), e.secondary_button && /* @__PURE__ */ t.createElement(u, { text: e.secondary_button.text, action: e.secondary_button.action })));
|
72
|
-
p.displayName = "CardView.Default";
|
73
|
-
const A = ({
|
74
|
-
filters: e
|
75
|
-
}) => {
|
76
|
-
const {
|
77
|
-
colorMode: n
|
78
|
-
} = C(), {
|
79
|
-
message: a,
|
80
|
-
inAppMessagesClient: r
|
81
|
-
} = w(h, e);
|
82
|
-
if (f(() => {
|
83
|
-
!a || a.seen_at !== null || r.markAsSeen(a);
|
84
|
-
}, [a, r]), !a || a.archived_at) return null;
|
85
|
-
const y = () => {
|
86
|
-
r.markAsArchived(a);
|
87
|
-
}, N = () => {
|
88
|
-
r.markAsInteracted(a);
|
89
|
-
};
|
90
|
-
return /* @__PURE__ */ t.createElement(p, { content: a.content, colorMode: n, onDismiss: y, onInteract: N });
|
91
|
-
};
|
92
|
-
A.displayName = "Card";
|
93
|
-
const v = {};
|
94
|
-
Object.assign(v, {
|
95
|
-
Default: p,
|
96
|
-
Root: i,
|
97
|
-
Content: l,
|
98
|
-
Title: s,
|
99
|
-
Body: o,
|
100
|
-
Actions: m,
|
101
|
-
PrimaryAction: d,
|
102
|
-
SecondaryAction: u,
|
103
|
-
DismissButton: _
|
104
|
-
});
|
105
|
-
export {
|
106
|
-
A as Card,
|
107
|
-
v as CardView
|
108
|
-
};
|
109
|
-
//# sourceMappingURL=Card.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Card.mjs","sources":["../../../../../../src/modules/in-app-messages/components/Card/Card.tsx"],"sourcesContent":["import {\n ColorMode,\n UseInAppMessageOptions,\n useInAppMessage,\n useInAppMessagesChannel,\n} from \"@knocklabs/react-core\";\nimport clsx from \"clsx\";\nimport React, { useEffect } from \"react\";\n\nimport { ActionContent } from \"../types\";\n\nimport \"./styles.css\";\n\nconst MESSAGE_TYPE = \"card\";\n\nexport interface CardProps {\n filters?: UseInAppMessageOptions;\n}\n\nexport interface CardContent {\n headline: string;\n title: string;\n body: string;\n primary_button?: {\n text: string;\n action: string;\n };\n secondary_button?: {\n text: string;\n action: string;\n };\n dismissible?: boolean;\n}\n\nconst Root: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card\", className)} {...props}>\n {children}\n </div>\n );\n};\nRoot.displayName = \"CardView.Root\";\n\nconst Content: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card__message\", className)} {...props}>\n {children}\n </div>\n );\n};\nContent.displayName = \"CardView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"CardView.Header\";\n\nconst Headline: React.FC<\n { headline: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ headline, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card__headline\", className)} {...props}>\n {headline}\n </div>\n );\n};\nHeadline.displayName = \"CardView.Headline\";\n\nconst Title: React.FC<\n { title: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ title, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card__title\", className)} {...props}>\n {title}\n </div>\n );\n};\nTitle.displayName = \"CardView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <div className={clsx(\"knock-iam-card__body\", className)} {...props}>\n {body}\n </div>\n );\n};\nBody.displayName = \"CardView.Body\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-card__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"CardView.Actions\";\n\nconst PrimaryAction: React.FC<\n ActionContent & React.ComponentPropsWithRef<\"a\">\n> = ({ text, action, className, ...props }) => {\n return (\n <a\n href={action}\n className={clsx(\"knock-iam-card__action\", className)}\n {...props}\n >\n {text}\n </a>\n );\n};\nPrimaryAction.displayName = \"CardView.PrimaryAction\";\n\nconst SecondaryAction: React.FC<\n ActionContent & React.ComponentPropsWithRef<\"a\">\n> = ({ text, action, className, ...props }) => {\n return (\n <a\n href={action}\n className={clsx(\n \"knock-iam-card__action knock-iam-card__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </a>\n );\n};\nSecondaryAction.displayName = \"CardView.SecondaryAction\";\n\nconst DismissButton: React.FC<React.ComponentPropsWithRef<\"button\">> = ({\n className,\n ...props\n}) => {\n return (\n <button className={clsx(\"knock-iam-card__close\", className)} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n >\n <g fill=\"#60646C\" fillRule=\"evenodd\" clipRule=\"evenodd\">\n <path d=\"M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z\" />\n <path d=\"M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z\" />\n </g>\n </svg>\n </button>\n );\n};\nDismissButton.displayName = \"CardView.DismissButton\";\n\nconst DefaultView: React.FC<{\n content: CardContent;\n colorMode?: ColorMode;\n onInteract?: () => void;\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({ content, colorMode = \"light\", onInteract, onDismiss }) => {\n return (\n <Root data-knock-color-mode={colorMode} onClick={onInteract}>\n <Content>\n <Header>\n <Headline headline={content.headline} />\n {content.dismissible && <DismissButton onClick={onDismiss} />}\n </Header>\n\n <Title title={content.title} />\n <Body body={content.body} />\n </Content>\n <Actions>\n {content.primary_button && (\n <PrimaryAction\n text={content.primary_button.text}\n action={content.primary_button.action}\n />\n )}\n\n {content.secondary_button && (\n <SecondaryAction\n text={content.secondary_button.text}\n action={content.secondary_button.action}\n />\n )}\n </Actions>\n </Root>\n );\n};\nDefaultView.displayName = \"CardView.Default\";\n\nconst Card: React.FC<CardProps> = ({ filters }) => {\n const { colorMode } = useInAppMessagesChannel();\n const { message, inAppMessagesClient } = useInAppMessage<CardContent>(\n MESSAGE_TYPE,\n filters,\n );\n\n // Mark the message as seen on render\n useEffect(() => {\n if (!message || message.seen_at !== null) return;\n\n inAppMessagesClient.markAsSeen(message);\n }, [message, inAppMessagesClient]);\n\n // Exclude archived messages\n if (!message || message.archived_at) return null;\n\n const onDismiss = () => {\n inAppMessagesClient.markAsArchived(message);\n };\n\n const onInteract = () => {\n inAppMessagesClient.markAsInteracted(message);\n };\n\n return (\n <DefaultView\n content={message.content}\n colorMode={colorMode}\n onDismiss={onDismiss}\n onInteract={onInteract}\n />\n );\n};\nCard.displayName = \"Card\";\n\nconst CardView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Content: typeof Content;\n Headline: typeof Headline;\n Title: typeof Title;\n Body: typeof Body;\n Actions: typeof Actions;\n PrimaryAction: typeof PrimaryAction;\n SecondaryAction: typeof SecondaryAction;\n DismissButton: typeof DismissButton;\n};\n\nObject.assign(CardView, {\n Default: DefaultView,\n Root,\n Content,\n Title,\n Body,\n Actions,\n PrimaryAction,\n SecondaryAction,\n DismissButton,\n});\n\nexport { Card, CardView };\n"],"names":["MESSAGE_TYPE","Root","children","className","props","React","clsx","displayName","Content","Header","Headline","headline","Title","title","Body","body","Actions","PrimaryAction","text","action","SecondaryAction","DismissButton","DefaultView","content","colorMode","onInteract","onDismiss","dismissible","primary_button","secondary_button","Card","filters","useInAppMessagesChannel","message","inAppMessagesClient","useInAppMessage","useEffect","seen_at","markAsSeen","archived_at","markAsArchived","markAsInteracted","CardView","Object","assign","Default"],"mappings":";;;;AAaA,MAAMA,IAAe,QAqBfC,IAEFA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAW,GAAGC;AAAM,MAEjCC,gBAAAA,EAAA,cAAC,SAAI,WAAWC,EAAK,kBAAkBH,CAAS,GAAG,GAAIC,EAAAA,GACpDF,CACH;AAGJD,EAAKM,cAAc;AAEnB,MAAMC,IAEFA,CAAC;AAAA,EAAEN,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAW,GAAGC;AAAM,MAEjCC,gBAAAA,EAAA,cAAC,SAAI,WAA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A,EACAI,OAAAA;AAAAA,EACAE,MAAAA;AAAAA,EACAE,SAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAG,iBAAAA;AAAAA,EACAC,eAAAA;AACF,CAAC;"}
|
@@ -1,113 +0,0 @@
|
|
1
|
-
import { useInAppMessagesChannel as A, useInAppMessage as h } from "@knocklabs/react-core";
|
2
|
-
import * as r from "@radix-ui/react-dialog";
|
3
|
-
import n from "clsx";
|
4
|
-
import t, { useEffect as g } from "react";
|
5
|
-
/* empty css */
|
6
|
-
const v = "modal", i = ({
|
7
|
-
children: e,
|
8
|
-
onOpenChange: l,
|
9
|
-
...a
|
10
|
-
}) => /* @__PURE__ */ t.createElement(r.Root, { defaultOpen: !0, onOpenChange: l, ...a }, /* @__PURE__ */ t.createElement(r.Portal, null, e));
|
11
|
-
i.displayName = "ModalView.Root";
|
12
|
-
const s = t.forwardRef(({
|
13
|
-
className: e,
|
14
|
-
...l
|
15
|
-
}, a) => /* @__PURE__ */ t.createElement(r.Overlay, { className: n("knock-iam-modal__overlay", e), ref: a, ...l }));
|
16
|
-
s.displayName = "ModalView.Overlay";
|
17
|
-
const m = t.forwardRef(({
|
18
|
-
children: e,
|
19
|
-
className: l,
|
20
|
-
...a
|
21
|
-
}, o) => /* @__PURE__ */ t.createElement(r.Content, { className: n("knock-iam-modal", l), ref: o, ...a }, e));
|
22
|
-
m.displayName = "ModalView.Content";
|
23
|
-
const f = ({
|
24
|
-
children: e,
|
25
|
-
className: l,
|
26
|
-
...a
|
27
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: n("knock-iam-modal__header", l), ...a }, e);
|
28
|
-
f.displayName = "ModalView.Header";
|
29
|
-
const d = ({
|
30
|
-
title: e,
|
31
|
-
className: l,
|
32
|
-
...a
|
33
|
-
}) => /* @__PURE__ */ t.createElement(r.Title, { className: n("knock-iam-modal__title", l), ...a }, e);
|
34
|
-
d.displayName = "ModalView.Title";
|
35
|
-
const u = ({
|
36
|
-
body: e,
|
37
|
-
className: l,
|
38
|
-
...a
|
39
|
-
}) => /* @__PURE__ */ t.createElement(r.Description, { className: n("knock-iam-modal__body", l), ...a }, e);
|
40
|
-
u.displayName = "ModalView.Body";
|
41
|
-
const p = ({
|
42
|
-
children: e,
|
43
|
-
className: l,
|
44
|
-
...a
|
45
|
-
}) => /* @__PURE__ */ t.createElement("div", { className: n("knock-iam-modal__actions", l), ...a }, e);
|
46
|
-
p.displayName = "ModalView.Actions";
|
47
|
-
const y = ({
|
48
|
-
text: e,
|
49
|
-
action: l,
|
50
|
-
className: a,
|
51
|
-
...o
|
52
|
-
}) => /* @__PURE__ */ t.createElement("a", { href: l, className: n("knock-iam-modal__action", a), ...o }, e);
|
53
|
-
y.displayName = "ModalView.PrimaryAction";
|
54
|
-
const E = ({
|
55
|
-
text: e,
|
56
|
-
action: l,
|
57
|
-
className: a,
|
58
|
-
...o
|
59
|
-
}) => /* @__PURE__ */ t.createElement("a", { href: l, className: n("knock-iam-modal__action knock-iam-modal__action--secondary", a), ...o }, e);
|
60
|
-
E.displayName = "ModalView.SecondaryAction";
|
61
|
-
const _ = ({
|
62
|
-
className: e,
|
63
|
-
...l
|
64
|
-
}) => /* @__PURE__ */ t.createElement(r.Close, { className: n("knock-iam-modal__close", e), ...l }, /* @__PURE__ */ t.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none" }, /* @__PURE__ */ t.createElement("g", { fill: "#60646C", fillRule: "evenodd", clipRule: "evenodd" }, /* @__PURE__ */ t.createElement("path", { d: "M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z" }), /* @__PURE__ */ t.createElement("path", { d: "M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z" }))));
|
65
|
-
_.displayName = "ModalView.Close";
|
66
|
-
const k = ({
|
67
|
-
content: e,
|
68
|
-
colorMode: l = "light",
|
69
|
-
onOpenChange: a,
|
70
|
-
onInteract: o,
|
71
|
-
onDismiss: c
|
72
|
-
}) => /* @__PURE__ */ t.createElement(i, { onOpenChange: a, onClick: o }, /* @__PURE__ */ t.createElement(s, null), /* @__PURE__ */ t.createElement(m, { "data-knock-color-mode": l }, /* @__PURE__ */ t.createElement(f, null, /* @__PURE__ */ t.createElement(d, { title: e.title }), e.dismissible && /* @__PURE__ */ t.createElement(_, { onClick: c })), /* @__PURE__ */ t.createElement(u, { body: e.body }), /* @__PURE__ */ t.createElement(p, null, e.secondary_button && /* @__PURE__ */ t.createElement(E, { text: e.secondary_button.text, action: e.secondary_button.action }), e.primary_button && /* @__PURE__ */ t.createElement(y, { text: e.primary_button.text, action: e.primary_button.action }))));
|
73
|
-
k.displayName = "ModalView.Default";
|
74
|
-
const V = ({
|
75
|
-
filters: e
|
76
|
-
}) => {
|
77
|
-
const {
|
78
|
-
colorMode: l
|
79
|
-
} = A(), {
|
80
|
-
message: a,
|
81
|
-
inAppMessagesClient: o
|
82
|
-
} = h(v, e);
|
83
|
-
if (g(() => {
|
84
|
-
!a || a.seen_at !== null || o.markAsSeen(a);
|
85
|
-
}, [a, o]), !a || a.archived_at) return null;
|
86
|
-
const c = (w) => {
|
87
|
-
w || o.markAsArchived(a);
|
88
|
-
}, M = () => {
|
89
|
-
o.markAsArchived(a);
|
90
|
-
}, N = () => {
|
91
|
-
o.markAsInteracted(a);
|
92
|
-
};
|
93
|
-
return /* @__PURE__ */ t.createElement(k, { content: a.content, colorMode: l, onOpenChange: c, onDismiss: M, onInteract: N });
|
94
|
-
};
|
95
|
-
V.displayName = "Modal";
|
96
|
-
const C = {};
|
97
|
-
Object.assign(C, {
|
98
|
-
Default: k,
|
99
|
-
Root: i,
|
100
|
-
Overlay: s,
|
101
|
-
Content: m,
|
102
|
-
Title: d,
|
103
|
-
Body: u,
|
104
|
-
Actions: p,
|
105
|
-
PrimaryAction: y,
|
106
|
-
SecondaryAction: E,
|
107
|
-
Close: _
|
108
|
-
});
|
109
|
-
export {
|
110
|
-
V as Modal,
|
111
|
-
C as ModalView
|
112
|
-
};
|
113
|
-
//# sourceMappingURL=Modal.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../../../../src/modules/in-app-messages/components/Modal/Modal.tsx"],"sourcesContent":["import {\n ColorMode,\n UseInAppMessageOptions,\n useInAppMessage,\n useInAppMessagesChannel,\n} from \"@knocklabs/react-core\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport clsx from \"clsx\";\nimport React, { useEffect } from \"react\";\n\nimport { ActionContent } from \"../types\";\n\nimport \"./styles.css\";\n\nconst MESSAGE_TYPE = \"modal\";\n\nexport interface ModalProps {\n filters?: UseInAppMessageOptions;\n}\n\nexport interface ModalContent {\n title: string;\n body: string;\n primary_button?: {\n text: string;\n action: string;\n };\n secondary_button?: {\n text: string;\n action: string;\n };\n dismissible?: boolean;\n}\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>;\n\nconst Root = ({ children, onOpenChange, ...props }: RootProps) => {\n return (\n <Dialog.Root defaultOpen onOpenChange={onOpenChange} {...props}>\n <Dialog.Portal>{children}</Dialog.Portal>\n </Dialog.Root>\n );\n};\nRoot.displayName = \"ModalView.Root\";\n\ntype OverlayProps = React.ComponentPropsWithoutRef<typeof Dialog.Overlay> &\n React.ComponentPropsWithRef<\"div\">;\ntype OverlayRef = React.ElementRef<\"div\">;\n\n// TODO: Causes layout shift...\nconst Overlay = React.forwardRef<OverlayRef, OverlayProps>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <Dialog.Overlay\n className={clsx(\"knock-iam-modal__overlay\", className)}\n ref={forwardedRef}\n {...props}\n />\n );\n },\n);\nOverlay.displayName = \"ModalView.Overlay\";\n\ntype ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> &\n React.ComponentPropsWithRef<\"div\">;\ntype ContentRef = React.ElementRef<\"div\">;\n\nconst Content = React.forwardRef<ContentRef, ContentProps>(\n ({ children, className, ...props }, forwardedRef) => {\n return (\n <Dialog.Content\n className={clsx(\"knock-iam-modal\", className)}\n ref={forwardedRef}\n {...props}\n >\n {children}\n </Dialog.Content>\n );\n },\n);\nContent.displayName = \"ModalView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-modal__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"ModalView.Header\";\n\ntype TitleProps = React.ComponentPropsWithoutRef<typeof Dialog.Title> &\n React.ComponentPropsWithRef<\"div\"> & {\n title: string;\n };\n\nconst Title = ({ title, className, ...props }: TitleProps) => {\n return (\n <Dialog.Title\n className={clsx(\"knock-iam-modal__title\", className)}\n {...props}\n >\n {title}\n </Dialog.Title>\n );\n};\nTitle.displayName = \"ModalView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <Dialog.Description\n className={clsx(\"knock-iam-modal__body\", className)}\n {...props}\n >\n {body}\n </Dialog.Description>\n );\n};\nBody.displayName = \"ModalView.Body\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={clsx(\"knock-iam-modal__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"ModalView.Actions\";\n\nconst PrimaryAction: React.FC<\n ActionContent & React.ComponentPropsWithRef<\"a\">\n> = ({ text, action, className, ...props }) => {\n return (\n <a\n href={action}\n className={clsx(\"knock-iam-modal__action\", className)}\n {...props}\n >\n {text}\n </a>\n );\n};\nPrimaryAction.displayName = \"ModalView.PrimaryAction\";\n\nconst SecondaryAction: React.FC<\n ActionContent & React.ComponentPropsWithRef<\"a\">\n> = ({ text, action, className, ...props }) => {\n return (\n <a\n href={action}\n className={clsx(\n \"knock-iam-modal__action knock-iam-modal__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </a>\n );\n};\nSecondaryAction.displayName = \"ModalView.SecondaryAction\";\n\ntype CloseProps = React.ComponentPropsWithoutRef<typeof Dialog.Close> &\n React.ComponentPropsWithRef<\"button\">;\n\nconst Close = ({ className, ...props }: CloseProps) => {\n return (\n <Dialog.Close\n className={clsx(\"knock-iam-modal__close\", className)}\n {...props}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n >\n <g fill=\"#60646C\" fillRule=\"evenodd\" clipRule=\"evenodd\">\n <path d=\"M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z\" />\n <path d=\"M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z\" />\n </g>\n </svg>\n </Dialog.Close>\n );\n};\nClose.displayName = \"ModalView.Close\";\n\nconst DefaultView: React.FC<{\n content: ModalContent;\n colorMode?: ColorMode;\n onOpenChange?: (open: boolean) => void;\n onInteract?: () => void;\n onDismiss?: React.MouseEventHandler<HTMLButtonElement>;\n}> = ({\n content,\n colorMode = \"light\",\n onOpenChange,\n onInteract,\n onDismiss,\n}) => {\n return (\n <Root onOpenChange={onOpenChange} onClick={onInteract}>\n <Overlay />\n {/* Must pass color mode to content for css variables to be set properly */}\n <Content data-knock-color-mode={colorMode}>\n <Header>\n <Title title={content.title} />\n {content.dismissible && <Close onClick={onDismiss} />}\n </Header>\n\n <Body body={content.body} />\n\n <Actions>\n {content.secondary_button && (\n <SecondaryAction\n text={content.secondary_button.text}\n action={content.secondary_button.action}\n />\n )}\n {content.primary_button && (\n <PrimaryAction\n text={content.primary_button.text}\n action={content.primary_button.action}\n />\n )}\n </Actions>\n </Content>\n </Root>\n );\n};\nDefaultView.displayName = \"ModalView.Default\";\n\nconst Modal: React.FC<ModalProps> = ({ filters }) => {\n const { colorMode } = useInAppMessagesChannel();\n const { message, inAppMessagesClient } = useInAppMessage<ModalContent>(\n MESSAGE_TYPE,\n filters,\n );\n\n // Mark the message as seen on render\n useEffect(() => {\n if (!message || message.seen_at !== null) return;\n\n inAppMessagesClient.markAsSeen(message);\n }, [message, inAppMessagesClient]);\n\n // Exclude archived messages\n if (!message || message.archived_at) return null;\n\n const onOpenChange = (open: boolean) => {\n if (!open) {\n inAppMessagesClient.markAsArchived(message);\n }\n };\n\n const onDismiss = () => {\n inAppMessagesClient.markAsArchived(message);\n };\n\n const onInteract = () => {\n inAppMessagesClient.markAsInteracted(message);\n };\n\n return (\n <DefaultView\n content={message.content}\n colorMode={colorMode}\n onOpenChange={onOpenChange}\n onDismiss={onDismiss}\n onInteract={onInteract}\n />\n );\n};\nModal.displayName = \"Modal\";\n\nconst ModalView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Overlay: typeof Overlay;\n Content: typeof Content;\n Title: typeof Title;\n Body: typeof Body;\n Actions: typeof Actions;\n PrimaryAction: typeof PrimaryAction;\n SecondaryAction: typeof SecondaryAction;\n Close: typeof Close;\n};\n\nObject.assign(ModalView, {\n Default: DefaultView,\n Root,\n Overlay,\n Content,\n Title,\n Body,\n Actions,\n PrimaryAction,\n SecondaryAction,\n Close,\n});\n\nexport { Modal, ModalView };\n"],"names":["MESSAGE_TYPE","Root","children","onOpenChange","props","React","Dialog","displayName","Overlay","forwardRef","className","forwardedRef","clsx","Content","Header","Title","title","Body","body","Actions","PrimaryAction","text","action","SecondaryAction","Close","DefaultView","content","colorMode","onInteract","onDismiss","dismissible","secondary_button","primary_button","Modal","filters","useInAppMessagesChannel","message","inAppMessagesClient","useInAppMessage","useEffect","seen_at","markAsSeen","archived_at","open","markAsArchived","markAsInteracted","ModalView","Object","assign","Default"],"mappings":";;;;;AAcA,MAAMA,IAAe,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EAAQI,YAAY,QAEpCH,EAAoBI,WAAWL,CAAO;AAAA,EAAA,GACrC,CAACA,GAASC,CAAmB,CAAC,GAG7B,CAACD,KAAWA,EAAQM,YAAoB,QAAA;AAEtCvC,QAAAA,IAAeA,CAACwC,MAAkB;AACtC,IAAKA,KACHN,EAAoBO,eAAeR,CAAO;AAAA,EAC5C,GAGIP,IAAYA,MAAM;AACtBQ,IAAAA,EAAoBO,eAAeR,CAAO;AAAA,EAAA,GAGtCR,IAAaA,MAAM;AACvBS,IAAAA,EAAoBQ,iBAAiBT,CAAO;AAAA,EAAA;AAI5C,SAAA/B,gBAAAA,EAAA,cAACoB,KACC,SAASW,EAAQV,SACjB,WAAAC,GACA,cAAAxB,GACA,WAAA0B,GACA,YAAAD,EACA,CAAA;AAEN;AACAK,EAAM1B,cAAc;AAEpB,MAAMuC,IAAY,CAAC;AAanBC,OAAOC,OAAOF,GAAW;AAAA,EACvBG,SAASxB;AAAAA,EACTxB,MAAAA;AAAAA,EACAO,SAAAA;AAAAA,EACAK,SAAAA;AAAAA,EACAE,OAAAA;AAAAA,EACAE,MAAAA;AAAAA,EACAE,SAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAG,iBAAAA;AAAAA,EACAC,OAAAA;AACF,CAAC;"}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { ColorMode, UseInAppMessageOptions } from '@knocklabs/react-core';
|
2
|
-
import { default as React } from 'react';
|
3
|
-
import { ActionContent } from '../types';
|
4
|
-
|
5
|
-
export interface BannerProps {
|
6
|
-
filters?: UseInAppMessageOptions;
|
7
|
-
}
|
8
|
-
export interface BannerContent {
|
9
|
-
title: string;
|
10
|
-
body: string;
|
11
|
-
primary_button?: {
|
12
|
-
text: string;
|
13
|
-
action: string;
|
14
|
-
};
|
15
|
-
secondary_button?: {
|
16
|
-
text: string;
|
17
|
-
action: string;
|
18
|
-
};
|
19
|
-
dismissible?: boolean;
|
20
|
-
}
|
21
|
-
declare const Root: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
22
|
-
declare const Content: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
23
|
-
declare const Title: React.FC<{
|
24
|
-
title: string;
|
25
|
-
} & React.ComponentPropsWithRef<"div">>;
|
26
|
-
declare const Body: React.FC<{
|
27
|
-
body: string;
|
28
|
-
} & React.ComponentPropsWithRef<"div">>;
|
29
|
-
declare const Actions: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
30
|
-
declare const PrimaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
31
|
-
declare const SecondaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
32
|
-
declare const DismissButton: React.FC<React.ComponentPropsWithRef<"button">>;
|
33
|
-
declare const DefaultView: React.FC<{
|
34
|
-
content: BannerContent;
|
35
|
-
colorMode?: ColorMode;
|
36
|
-
onInteract?: () => void;
|
37
|
-
onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
|
38
|
-
}>;
|
39
|
-
declare const Banner: React.FC<BannerProps>;
|
40
|
-
declare const BannerView: {
|
41
|
-
Default: typeof DefaultView;
|
42
|
-
Root: typeof Root;
|
43
|
-
Content: typeof Content;
|
44
|
-
Title: typeof Title;
|
45
|
-
Body: typeof Body;
|
46
|
-
Actions: typeof Actions;
|
47
|
-
PrimaryAction: typeof PrimaryAction;
|
48
|
-
SecondaryAction: typeof SecondaryAction;
|
49
|
-
DismissButton: typeof DismissButton;
|
50
|
-
};
|
51
|
-
export { Banner, BannerView };
|
52
|
-
//# sourceMappingURL=Banner.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,sBAAsB,EAGvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,E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qBAAqB,CAAC,GAAG,CAAC,CAWjD,CAAC;AAGF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAC7B,aAAa,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAcjD,CAAC;AAGF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAmBlE,CAAC;AAGF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACxD,CA0BA,CAAC;AAGF,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkCjC,CAAC;AAGF,QAAA,MAAM,UAAU,EAAS;IACvB,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,aAAa,EAAE,OAAO,aAAa,CAAC;CACrC,CAAC;AAcF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import { ColorMode, UseInAppMessageOptions } from '@knocklabs/react-core';
|
2
|
-
import { default as React } from 'react';
|
3
|
-
import { ActionContent } from '../types';
|
4
|
-
|
5
|
-
export interface CardProps {
|
6
|
-
filters?: UseInAppMessageOptions;
|
7
|
-
}
|
8
|
-
export interface CardContent {
|
9
|
-
headline: string;
|
10
|
-
title: string;
|
11
|
-
body: string;
|
12
|
-
primary_button?: {
|
13
|
-
text: string;
|
14
|
-
action: string;
|
15
|
-
};
|
16
|
-
secondary_button?: {
|
17
|
-
text: string;
|
18
|
-
action: string;
|
19
|
-
};
|
20
|
-
dismissible?: boolean;
|
21
|
-
}
|
22
|
-
declare const Root: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
23
|
-
declare const Content: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
24
|
-
declare const Headline: React.FC<{
|
25
|
-
headline: string;
|
26
|
-
} & React.ComponentPropsWithRef<"div">>;
|
27
|
-
declare const Title: React.FC<{
|
28
|
-
title: string;
|
29
|
-
} & React.ComponentPropsWithRef<"div">>;
|
30
|
-
declare const Body: React.FC<{
|
31
|
-
body: string;
|
32
|
-
} & React.ComponentPropsWithRef<"div">>;
|
33
|
-
declare const Actions: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
34
|
-
declare const PrimaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
35
|
-
declare const SecondaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
36
|
-
declare const DismissButton: React.FC<React.ComponentPropsWithRef<"button">>;
|
37
|
-
declare const DefaultView: React.FC<{
|
38
|
-
content: CardContent;
|
39
|
-
colorMode?: ColorMode;
|
40
|
-
onInteract?: () => void;
|
41
|
-
onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
|
42
|
-
}>;
|
43
|
-
declare const Card: React.FC<CardProps>;
|
44
|
-
declare const CardView: {
|
45
|
-
Default: typeof DefaultView;
|
46
|
-
Root: typeof Root;
|
47
|
-
Content: typeof Content;
|
48
|
-
Headline: typeof Headline;
|
49
|
-
Title: typeof Title;
|
50
|
-
Body: typeof Body;
|
51
|
-
Actions: typeof Actions;
|
52
|
-
PrimaryAction: typeof PrimaryAction;
|
53
|
-
SecondaryAction: typeof SecondaryAction;
|
54
|
-
DismissButton: typeof DismissButton;
|
55
|
-
};
|
56
|
-
export { Card, CardView };
|
57
|
-
//# sourceMappingURL=Card.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,sBAAsB,EAGvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,cAAc,CAAC;AAItB,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,gBAAgB,CAAC,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAClB,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAO5D,CAAC;AAGF,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CACrB,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAO5D,CAAC;AAcF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C,SAAS,CAiC7B,CAAC;AAGF,QAAA,MAAM,QAAQ,EAAS;IACrB,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,aAAa,EAAE,OAAO,aAAa,CAAC;CACrC,CAAC;AAcF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import { ColorMode, UseInAppMessageOptions } from '@knocklabs/react-core';
|
2
|
-
import { default as React } from 'react';
|
3
|
-
import { ActionContent } from '../types';
|
4
|
-
|
5
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
6
|
-
export interface ModalProps {
|
7
|
-
filters?: UseInAppMessageOptions;
|
8
|
-
}
|
9
|
-
export interface ModalContent {
|
10
|
-
title: string;
|
11
|
-
body: string;
|
12
|
-
primary_button?: {
|
13
|
-
text: string;
|
14
|
-
action: string;
|
15
|
-
};
|
16
|
-
secondary_button?: {
|
17
|
-
text: string;
|
18
|
-
action: string;
|
19
|
-
};
|
20
|
-
dismissible?: boolean;
|
21
|
-
}
|
22
|
-
type RootProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog.Root>, "modal"> & React.PropsWithChildren<React.ComponentPropsWithRef<"div">>;
|
23
|
-
declare const Root: {
|
24
|
-
({ children, onOpenChange, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
25
|
-
displayName: string;
|
26
|
-
};
|
27
|
-
type OverlayProps = React.ComponentPropsWithoutRef<typeof Dialog.Overlay> & React.ComponentPropsWithRef<"div">;
|
28
|
-
declare const Overlay: React.ForwardRefExoticComponent<Omit<OverlayProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
29
|
-
type ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> & React.ComponentPropsWithRef<"div">;
|
30
|
-
declare const Content: React.ForwardRefExoticComponent<Omit<ContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
31
|
-
type TitleProps = React.ComponentPropsWithoutRef<typeof Dialog.Title> & React.ComponentPropsWithRef<"div"> & {
|
32
|
-
title: string;
|
33
|
-
};
|
34
|
-
declare const Title: {
|
35
|
-
({ title, className, ...props }: TitleProps): import("react/jsx-runtime").JSX.Element;
|
36
|
-
displayName: string;
|
37
|
-
};
|
38
|
-
declare const Body: React.FC<{
|
39
|
-
body: string;
|
40
|
-
} & React.ComponentPropsWithRef<"div">>;
|
41
|
-
declare const Actions: React.FC<React.PropsWithChildren<React.ComponentPropsWithRef<"div">>>;
|
42
|
-
declare const PrimaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
43
|
-
declare const SecondaryAction: React.FC<ActionContent & React.ComponentPropsWithRef<"a">>;
|
44
|
-
type CloseProps = React.ComponentPropsWithoutRef<typeof Dialog.Close> & React.ComponentPropsWithRef<"button">;
|
45
|
-
declare const Close: {
|
46
|
-
({ className, ...props }: CloseProps): import("react/jsx-runtime").JSX.Element;
|
47
|
-
displayName: string;
|
48
|
-
};
|
49
|
-
declare const DefaultView: React.FC<{
|
50
|
-
content: ModalContent;
|
51
|
-
colorMode?: ColorMode;
|
52
|
-
onOpenChange?: (open: boolean) => void;
|
53
|
-
onInteract?: () => void;
|
54
|
-
onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
|
55
|
-
}>;
|
56
|
-
declare const Modal: React.FC<ModalProps>;
|
57
|
-
declare const ModalView: {
|
58
|
-
Default: typeof DefaultView;
|
59
|
-
Root: typeof Root;
|
60
|
-
Overlay: typeof Overlay;
|
61
|
-
Content: typeof Content;
|
62
|
-
Title: typeof Title;
|
63
|
-
Body: typeof Body;
|
64
|
-
Actions: typeof Actions;
|
65
|
-
PrimaryAction: typeof PrimaryAction;
|
66
|
-
SecondaryAction: typeof SecondaryAction;
|
67
|
-
Close: typeof Close;
|
68
|
-
};
|
69
|
-
export { Modal, ModalView };
|
70
|
-
//# sourceMappingURL=Modal.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,sBAAsB,EAGvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,cAAc,CAAC;AAItB,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,gBAAgB,CAAC,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,KAAK,SAAS,GAAG,IAAI,CACnB,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,EAClD,OAAO,CACR,GACC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,qBAA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O,MAAM,CAAC,KAAK,CAAC,GACnE,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AAExC,QAAA,MAAM,KAAK;8BAA6B,UAAU;;CAmBjD,CAAC;AAGF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACxD,CAoCA,CAAC;AAGF,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwC/B,CAAC;AAGF,QAAA,MAAM,SAAS,EAAS;IACtB,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB,CAAC;AAeF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/in-app-messages/components/Modal/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/in-app-messages/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/in-app-messages/components/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/in-app-messages/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|