@stack-spot/portal-components 1.5.1 → 2.0.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 +22 -0
- package/dist/components/ChatBot.d.ts +0 -2
- package/dist/components/ChatBot.d.ts.map +1 -1
- package/dist/components/ChatBot.js +1 -3
- package/dist/components/ChatBot.js.map +1 -1
- package/dist/components/Placeholder.d.ts +19 -0
- package/dist/components/Placeholder.d.ts.map +1 -0
- package/dist/components/Placeholder.js +16 -0
- package/dist/components/Placeholder.js.map +1 -0
- package/dist/components/error/index.d.ts +1 -1
- package/dist/components/error/index.d.ts.map +1 -1
- package/dist/components/error/index.js.map +1 -1
- package/dist/hooks/date.d.ts +0 -12
- package/dist/hooks/date.d.ts.map +1 -1
- package/dist/hooks/date.js +0 -18
- package/dist/hooks/date.js.map +1 -1
- package/dist/hooks/service-now.d.ts +2 -0
- package/dist/hooks/service-now.d.ts.map +1 -1
- package/dist/hooks/service-now.js +2 -1
- package/dist/hooks/service-now.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -5
- package/readme.md +0 -4
- package/src/components/ChatBot.tsx +1 -4
- package/src/components/Placeholder.tsx +82 -0
- package/src/components/error/index.ts +2 -1
- package/src/hooks/date.ts +0 -20
- package/src/hooks/service-now.tsx +2 -1
- package/src/index.ts +3 -2
- package/dist/components/Tour/StepContainer.d.ts +0 -29
- package/dist/components/Tour/StepContainer.d.ts.map +0 -1
- package/dist/components/Tour/StepContainer.js +0 -52
- package/dist/components/Tour/StepContainer.js.map +0 -1
- package/dist/components/Tour/StepNavigation.d.ts +0 -29
- package/dist/components/Tour/StepNavigation.d.ts.map +0 -1
- package/dist/components/Tour/StepNavigation.js +0 -38
- package/dist/components/Tour/StepNavigation.js.map +0 -1
- package/dist/components/Tour/StepTitle.d.ts +0 -17
- package/dist/components/Tour/StepTitle.d.ts.map +0 -1
- package/dist/components/Tour/StepTitle.js +0 -9
- package/dist/components/Tour/StepTitle.js.map +0 -1
- package/dist/components/Tour/context.d.ts +0 -28
- package/dist/components/Tour/context.d.ts.map +0 -1
- package/dist/components/Tour/context.js +0 -59
- package/dist/components/Tour/context.js.map +0 -1
- package/dist/components/Tour/index.d.ts +0 -9
- package/dist/components/Tour/index.d.ts.map +0 -1
- package/dist/components/Tour/index.js +0 -4
- package/dist/components/Tour/index.js.map +0 -1
- package/dist/components/Tour/utils.d.ts +0 -51
- package/dist/components/Tour/utils.d.ts.map +0 -1
- package/dist/components/Tour/utils.js +0 -60
- package/dist/components/Tour/utils.js.map +0 -1
- package/src/components/Tour/StepContainer.tsx +0 -83
- package/src/components/Tour/StepNavigation.tsx +0 -72
- package/src/components/Tour/StepTitle.tsx +0 -27
- package/src/components/Tour/context.tsx +0 -67
- package/src/components/Tour/index.ts +0 -7
- package/src/components/Tour/utils.tsx +0 -100
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.6.0...portal-components@v2.0.0) (2024-06-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **portal-components:** removed Tour related componets
|
|
9
|
+
* **portal-layout:** Adds a new reworked Tour structure compatible with module federation
|
|
10
|
+
* new Tour strategy
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* new Tour strategy ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
15
|
+
* **portal-components:** removed Tour related componets ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
16
|
+
* **portal-layout:** Adds a new reworked Tour structure compatible with module federation ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
17
|
+
|
|
18
|
+
## [1.6.0](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.5.1...portal-components@v1.6.0) (2024-06-27)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* placeholder component ([3077d63](https://github.com/stack-spot/portal-commons/commit/3077d630525bbe4e28c4ac2b36f13cf3c335b541))
|
|
24
|
+
|
|
3
25
|
## [1.5.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.5.0...portal-components@v1.5.1) (2024-06-27)
|
|
4
26
|
|
|
5
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBot.d.ts","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatBot.d.ts","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":"AA8CA;;;;GAIG;AACH,eAAO,MAAM,OAAO,+CA8BnB,CAAA"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Flex, IconBox } from '@citric/core';
|
|
3
3
|
import { QuestionAnswer, Times } from '@citric/icons';
|
|
4
|
-
import { getServiceNowLauncher, hideChatWindow, showChatWindow } from '../hooks/service-now.js';
|
|
5
|
-
export const CHAT_BUTTON_ID = 'service-now-button';
|
|
6
|
-
export const CHAT_BUTTON_WRAPPER_ID = 'service-now-content';
|
|
4
|
+
import { CHAT_BUTTON_ID, CHAT_BUTTON_WRAPPER_ID, getServiceNowLauncher, hideChatWindow, showChatWindow } from '../hooks/service-now.js';
|
|
7
5
|
const styles = {
|
|
8
6
|
content: {
|
|
9
7
|
position: 'fixed',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBot.js","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ChatBot.js","sourceRoot":"","sources":["../../src/components/ChatBot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEpI,MAAM,MAAM,GAAW;IACrB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE;YACjB,OAAO,EAAE,OAAO;SACjB;QACD,oBAAoB,EAAE;YACpB,OAAO,EAAE,MAAM;SAChB;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,MAAM;SAChB;QACD,WAAW,EAAE;YACX,OAAO,EAAE,OAAO;SACjB;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE;YACR,OAAO,EAAE,GAAG;SACb;QACD,kBAAkB,EAAE;YAClB,UAAU,EAAE,aAAa;SAC1B;KACF;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,uBAAuB;KACnC;CACF,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAA;QAC1C,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YACvD,IAAI,SAAS,EAAE,CAAC;gBACd,cAAc,EAAE,CAAA;YAClB,CAAC;iBAAM,CAAC;gBACN,cAAc,EAAE,CAAA;YAClB,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,YAClD,KAAC,MAAM,IACL,OAAO,EAAE,iBAAiB,EAC1B,EAAE,EAAE,cAAc,EAClB,EAAE,EAAE,MAAM,CAAC,MAAM,YAEjB,MAAC,OAAO,IACN,SAAS,EAAC,WAAW,EACrB,EAAE,EAAE,MAAM,CAAC,IAAI,EACf,IAAI,EAAC,IAAI,aACT,KAAC,KAAK,IAAC,SAAS,EAAC,OAAO,GAAG,EAC3B,KAAC,cAAc,IAAC,SAAS,EAAC,UAAU,GAAG,IAC/B,GACH,GACJ,CACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SxProperties } from '@citric/core/dist/sx.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
img: React.ReactElement;
|
|
7
|
+
button?: React.ReactElement | null;
|
|
8
|
+
show?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
sx?: SxProperties;
|
|
11
|
+
sxCard?: SxProperties;
|
|
12
|
+
}
|
|
13
|
+
interface PropsCallToACtion extends Props {
|
|
14
|
+
subDescription?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Placeholder: ({ title, description, button, img, fullWidth, show, sx }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export declare const PlaceholderCallToAction: ({ title, description, subDescription, img, button, fullWidth, show, sx, sxCard, }: PropsCallToACtion) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/components/Placeholder.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,UAAU,iBAAkB,SAAQ,KAAK;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,6DAAqE,KAAK,mDAsBjG,CAAA;AAED,eAAO,MAAM,uBAAuB,sFAUjC,iBAAiB,mDA4BnB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Text } from '@citric/core';
|
|
3
|
+
import { Card, CardContent } from '@citric/ui';
|
|
4
|
+
export const Placeholder = ({ title, description, button, img, fullWidth, show = true, sx }) => {
|
|
5
|
+
if (!show) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return (_jsx(Card, { sx: { ...(fullWidth ? { w: '100%' } : {}) }, children: _jsxs(CardContent, { as: Flex, py: 27, justifyContent: "center", flexDirection: "column", alignItems: "center", sx: sx, children: [img, title && _jsx(Text, { as: "label", appearance: "h4", mb: "3", pt: 5, children: title }), _jsx(Text, { mb: "3", appearance: "body2", colorScheme: "light.700", children: description }), button] }) }));
|
|
9
|
+
};
|
|
10
|
+
export const PlaceholderCallToAction = ({ title, description, subDescription, img, button, fullWidth, show = true, sx, sxCard, }) => {
|
|
11
|
+
if (!show) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (_jsx(Card, { sx: { w: fullWidth ? '100%' : 'auto', bg: 'transparent', ...sxCard }, children: _jsxs(CardContent, { as: Flex, alignItems: "center", justifyContent: "center", py: 15, sx: { gap: '92px', ...sx }, children: [img, _jsxs(Box, { children: [title && _jsx(Text, { appearance: "h4", mb: "3", "aria-live": "assertive", children: title }), _jsx(Text, { mb: "3", appearance: "body2", colorScheme: "light.700", children: description }), _jsx(Text, { mb: "3", appearance: "body2", colorScheme: "light.700", children: subDescription }), button] })] }) }));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Placeholder.js","sourceRoot":"","sources":["../../src/components/Placeholder.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAiB9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAS,EAAE,EAAE;IACpG,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,KAAC,IAAI,I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AK,IAAI,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,eAAW,WAAW,YACzD,KAAK,GACD,EAEP,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,WAAW,YACpD,WAAW,GACP,EAEP,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,WAAW,YACpD,cAAc,GACV,EAEN,MAAM,IACH,IACM,GACT,CACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/hooks/date.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
3
|
-
* @param date
|
|
4
|
-
* @returns the formatted date
|
|
5
|
-
*/
|
|
6
|
-
export declare function useFormatDate(date?: string): string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
9
|
-
* @param date
|
|
10
|
-
* @returns the formatted date with its time
|
|
11
|
-
*/
|
|
12
|
-
export declare function useFormatDateWithTime(date?: string): string | undefined;
|
|
13
1
|
/**
|
|
14
2
|
* A utility for formatting dates.
|
|
15
3
|
* @param date
|
package/dist/hooks/date.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,gBAAgB;wBAGR,MAAM;gCACE,MAAM;EAErC"}
|
package/dist/hooks/date.js
CHANGED
|
@@ -7,24 +7,6 @@ function formatDate(date, locale, includeTime) {
|
|
|
7
7
|
? format(new Date(date), `dd/MM/yyyy${time}`, { locale: ptBR })
|
|
8
8
|
: format(new Date(date), `MMMM dd yyyy${time}`);
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
12
|
-
* @param date
|
|
13
|
-
* @returns the formatted date
|
|
14
|
-
*/
|
|
15
|
-
export function useFormatDate(date) {
|
|
16
|
-
const locale = useLanguage();
|
|
17
|
-
return date ? formatDate(date, locale, false) : undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
21
|
-
* @param date
|
|
22
|
-
* @returns the formatted date with its time
|
|
23
|
-
*/
|
|
24
|
-
export function useFormatDateWithTime(date) {
|
|
25
|
-
const locale = useLanguage();
|
|
26
|
-
return date ? formatDate(date, locale, true) : undefined;
|
|
27
|
-
}
|
|
28
10
|
/**
|
|
29
11
|
* A utility for formatting dates.
|
|
30
12
|
* @param date
|
package/dist/hooks/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,SAAS,UAAU,CAAC,IAAY,EAAE,MAAgB,EAAE,WAAoB;IACtE,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IACxC,OAAO,MAAM,KAAK,IAAI;QACpB,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,aAAa,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC/D,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC,CAAA;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,SAAS,UAAU,CAAC,IAAY,EAAE,MAAgB,EAAE,WAAoB;IACtE,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IACxC,OAAO,MAAM,KAAK,IAAI;QACpB,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,aAAa,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC/D,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC,CAAA;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,WAAW,EAAE,CAAA;IAC5B,OAAO;QACL,UAAU,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACjF,kBAAkB,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KACzF,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const CHAT_BUTTON_ID = "service-now-button";
|
|
2
|
+
export declare const CHAT_BUTTON_WRAPPER_ID = "service-now-content";
|
|
1
3
|
interface Options {
|
|
2
4
|
/**
|
|
3
5
|
* Function to run when the chat button is hidden, i.e. when the user clicks the close button that appears when the chat button is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-now.d.ts","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-now.d.ts","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,uBAAuB,CAAA;AAClD,eAAO,MAAM,sBAAsB,wBAAwB,CAAA;AAoC3D,UAAU,OAAO;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAuBD;;GAEG;AACH,wBAAgB,qBAAqB,uBAEpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,SAIjC;AAuBD;;GAEG;AACH,wBAAgB,cAAc,SAE7B;AAED;;GAEG;AACH,wBAAgB,cAAc,SAE7B;AAyED;;;GAGG;AACH,wBAAgB,iCAAiC,YAIhD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,OAAO,QAIpD;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAaD,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getLanguage, translate } from '@stack-spot/portal-translate';
|
|
2
2
|
import { pull } from 'lodash';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { CHAT_BUTTON_ID, CHAT_BUTTON_WRAPPER_ID } from '../components/ChatBot.js';
|
|
5
4
|
import { useEffectOnce } from './use-effect-once.js';
|
|
6
5
|
const CHAT_IFRAME_ID = 'sn_va_web_client';
|
|
6
|
+
export const CHAT_BUTTON_ID = 'service-now-button';
|
|
7
|
+
export const CHAT_BUTTON_WRAPPER_ID = 'service-now-content';
|
|
7
8
|
const closeButtonStyle = `
|
|
8
9
|
position: absolute;
|
|
9
10
|
bottom: -64px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-now.js","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"service-now.js","sourceRoot":"","sources":["../../src/hooks/service-now.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACjF,OAAO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AAC;QACP,MAAM,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;QAC9C,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;IACjC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iCAAiC;IAC/C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,6BAA6B,EAAE,CAAC,CAAA;IACvE,aAAa,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1D,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAiB;IACnD,aAAa,CAAC,GAAG,EAAE;QACjB,cAAc,CAAC,OAAO,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,EAAE,EAAE;QACF,eAAe,EAAE,6CAA6C;QAC9D,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,+BAA+B;QAC5C,aAAa,EAAE,+FAA+F;KAC/G;IACD,EAAE,EAAE;QACF,eAAe,EAAE,uCAAuC;QACxD,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,+BAA+B;QAC5C,aAAa,EAAE,0GAA0G;KAC1H;CACmB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
export { AsyncContent } from './components/AsyncContent.js';
|
|
1
2
|
export { BannerWarning } from './components/BannerWarning.js';
|
|
2
3
|
export { ChatBot } from './components/ChatBot.js';
|
|
3
|
-
export {
|
|
4
|
+
export { useDateFormatter } from './hooks/date.js';
|
|
4
5
|
export { useKeyboardControls } from './hooks/keyboard.js';
|
|
5
6
|
export { openServiceNowChat, dictionary as serviceNowDictionary, useServiceNowChatButtonVisibility, useServiceNowEffect } from './hooks/service-now.js';
|
|
6
7
|
export { useCheckTextOverflow } from './hooks/text.js';
|
|
7
8
|
export { titleEffect, useTitleEffect } from './hooks/title.js';
|
|
8
9
|
export { useEffectOnce } from './hooks/use-effect-once.js';
|
|
9
|
-
export { useDateFormatter } from './hooks/date.js';
|
|
10
10
|
export * from './utils/accessibility.js';
|
|
11
11
|
export * from './utils/cookie.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACpJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
export { AsyncContent } from './components/AsyncContent.js';
|
|
1
2
|
export { BannerWarning } from './components/BannerWarning.js';
|
|
2
3
|
export { ChatBot } from './components/ChatBot.js';
|
|
3
|
-
export {
|
|
4
|
+
export { useDateFormatter } from './hooks/date.js';
|
|
4
5
|
export { useKeyboardControls } from './hooks/keyboard.js';
|
|
5
6
|
export { openServiceNowChat, dictionary as serviceNowDictionary, useServiceNowChatButtonVisibility, useServiceNowEffect } from './hooks/service-now.js';
|
|
6
7
|
export { useCheckTextOverflow } from './hooks/text.js';
|
|
7
8
|
export { titleEffect, useTitleEffect } from './hooks/title.js';
|
|
8
9
|
export { useEffectOnce } from './hooks/use-effect-once.js';
|
|
9
|
-
export { useDateFormatter } from './hooks/date.js';
|
|
10
10
|
export * from './utils/accessibility.js';
|
|
11
11
|
export * from './utils/cookie.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,UAAU,IAAI,oBAAoB,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACpJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/portal-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
9
|
"./Breadcrumb": "./dist/components/Breadcrumb/index.js",
|
|
10
|
-
"./ErrorFeedback": "./dist/components/error/ErrorFeedback.js",
|
|
11
10
|
"./SelectionList": "./dist/components/SelectionList.js",
|
|
12
|
-
"./Tour": "./dist/components/Tour/index.js",
|
|
13
11
|
"./LazyMarkdown": "./dist/components/LazyMarkdown/index.js",
|
|
14
12
|
"./Notifications": "./dist/components/Notifications/index.js",
|
|
15
13
|
"./StatusCircle": "./dist/components/StatusCircle.js",
|
|
16
14
|
"./InfiniteScroll": "./dist/components/InfiniteScroll.js",
|
|
15
|
+
"./Placeholder": "./dist/components/Placeholder.js",
|
|
17
16
|
"./ScrollView": "./dist/components/ScrollView.js",
|
|
18
17
|
"./svg": "./dist/svg/index.js",
|
|
19
18
|
"./anchor": "./dist/context/anchor.js",
|
|
@@ -38,7 +37,6 @@
|
|
|
38
37
|
"@types/react": "^18.2.37",
|
|
39
38
|
"@types/react-dom": "^18.2.15",
|
|
40
39
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
41
|
-
"@types/reactour": "^1.18.5",
|
|
42
40
|
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
43
41
|
"@typescript-eslint/parser": "^6.10.0",
|
|
44
42
|
"agadoo": "^3.0.0",
|
|
@@ -63,7 +61,6 @@
|
|
|
63
61
|
"react-infinite-scroll-component": "^6.1.0",
|
|
64
62
|
"react-markdown": "^9.0.1",
|
|
65
63
|
"react-syntax-highlighter": "^15.5.0",
|
|
66
|
-
"reactour": "^1.19.3",
|
|
67
64
|
"rehype-raw": "^7.0.0",
|
|
68
65
|
"remark-gfm": "^4.0.0"
|
|
69
66
|
}
|
package/readme.md
CHANGED
|
@@ -11,8 +11,6 @@ Exceptions: translations are the only exception here. These components can acces
|
|
|
11
11
|
parameter.
|
|
12
12
|
|
|
13
13
|
- `BreadcrumbList`: renders a list of breadcrumb navigation items. Must be imported from `@stack-spot/portal-components/Breadcrumb`.
|
|
14
|
-
- `StepContainer`, `TourProvider`, `TourStep`: components related to React Tour, i.e. the tutorial engine used by Stackspot. Must be imported
|
|
15
|
-
from `@stack-spot/portal-components/Tour`.
|
|
16
14
|
- `BannerWarning`: a yellow alert box with an exclamation icon and the content passed as parameter. Used for warning messages.
|
|
17
15
|
- `ChatBot`: an orange circular button that can toggle the chat window from Service Now. The button has a chat icon when the window is
|
|
18
16
|
closed and a close icon when it's open.
|
|
@@ -36,8 +34,6 @@ component that renders the HTML `<a>` tag directly. This is useful for integrati
|
|
|
36
34
|
`@stack-spot/portal-components/anchor`.
|
|
37
35
|
- `useKeyboardControls(options)`: creates listeners for controlling a Menu UI through the keyboard (up, down, tab, esc, enter).
|
|
38
36
|
- `useServiceNowEffect(options)`, `useServiceNowChatButtonVisibility()`: Service Now hooks (chat capabilities).
|
|
39
|
-
- `useTour()`: retrieves data related to the current step of React Tour (tutorial). Must be imported from
|
|
40
|
-
`@stack-spot/portal-components/Tour`.
|
|
41
37
|
|
|
42
38
|
## SVG images
|
|
43
39
|
Some SVG images are exported as React components at `@stack-spot/portal-components/svg`.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Button, Flex, IconBox, Styles } from '@citric/core'
|
|
2
2
|
import { QuestionAnswer, Times } from '@citric/icons'
|
|
3
|
-
import { getServiceNowLauncher, hideChatWindow, showChatWindow } from '../hooks/service-now'
|
|
4
|
-
|
|
5
|
-
export const CHAT_BUTTON_ID = 'service-now-button'
|
|
6
|
-
export const CHAT_BUTTON_WRAPPER_ID = 'service-now-content'
|
|
3
|
+
import { CHAT_BUTTON_ID, CHAT_BUTTON_WRAPPER_ID, getServiceNowLauncher, hideChatWindow, showChatWindow } from '../hooks/service-now'
|
|
7
4
|
|
|
8
5
|
const styles: Styles = {
|
|
9
6
|
content: {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Box, Flex, Text } from '@citric/core'
|
|
2
|
+
import { SxProperties } from '@citric/core/dist/sx'
|
|
3
|
+
import { Card, CardContent } from '@citric/ui'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string,
|
|
7
|
+
description?: string,
|
|
8
|
+
img: React.ReactElement,
|
|
9
|
+
button?: React.ReactElement | null,
|
|
10
|
+
show?: boolean,
|
|
11
|
+
fullWidth?: boolean,
|
|
12
|
+
sx?: SxProperties,
|
|
13
|
+
sxCard?: SxProperties,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface PropsCallToACtion extends Props {
|
|
17
|
+
subDescription?: string,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Placeholder = ({ title, description, button, img, fullWidth, show = true, sx }: Props) => {
|
|
21
|
+
if (!show) {
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Card sx={{ ...(fullWidth ? { w: '100%' } : {}) }}>
|
|
27
|
+
<CardContent as={Flex} py={27} justifyContent="center" flexDirection="column" alignItems="center" sx={sx}>
|
|
28
|
+
{img}
|
|
29
|
+
|
|
30
|
+
{title && <Text as="label" appearance="h4" mb="3" pt={5}>
|
|
31
|
+
{title}
|
|
32
|
+
</Text>}
|
|
33
|
+
|
|
34
|
+
<Text mb="3" appearance="body2" colorScheme="light.700">
|
|
35
|
+
{description}
|
|
36
|
+
</Text>
|
|
37
|
+
|
|
38
|
+
{button}
|
|
39
|
+
</CardContent>
|
|
40
|
+
</Card>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const PlaceholderCallToAction = ({
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
subDescription,
|
|
48
|
+
img,
|
|
49
|
+
button,
|
|
50
|
+
fullWidth,
|
|
51
|
+
show = true,
|
|
52
|
+
sx,
|
|
53
|
+
sxCard,
|
|
54
|
+
}: PropsCallToACtion) => {
|
|
55
|
+
if (!show) {
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Card sx={{ w: fullWidth ? '100%' : 'auto', bg: 'transparent', ...sxCard }}>
|
|
61
|
+
<CardContent as={Flex} alignItems="center" justifyContent="center" py={15} sx={{ gap: '92px', ...sx }}>
|
|
62
|
+
{img}
|
|
63
|
+
|
|
64
|
+
<Box>
|
|
65
|
+
{title && <Text appearance="h4" mb="3" aria-live="assertive">
|
|
66
|
+
{title}
|
|
67
|
+
</Text>}
|
|
68
|
+
|
|
69
|
+
<Text mb="3" appearance="body2" colorScheme="light.700">
|
|
70
|
+
{description}
|
|
71
|
+
</Text>
|
|
72
|
+
|
|
73
|
+
<Text mb="3" appearance="body2" colorScheme="light.700">
|
|
74
|
+
{subDescription}
|
|
75
|
+
</Text>
|
|
76
|
+
|
|
77
|
+
{button}
|
|
78
|
+
</Box>
|
|
79
|
+
</CardContent>
|
|
80
|
+
</Card>
|
|
81
|
+
)
|
|
82
|
+
}
|
package/src/hooks/date.ts
CHANGED
|
@@ -9,26 +9,6 @@ function formatDate(date: string, locale: Language, includeTime: boolean) {
|
|
|
9
9
|
: format(new Date(date), `MMMM dd yyyy${time}`)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
14
|
-
* @param date
|
|
15
|
-
* @returns the formatted date
|
|
16
|
-
*/
|
|
17
|
-
export function useFormatDate(date?: string) {
|
|
18
|
-
const locale = useLanguage()
|
|
19
|
-
return date ? formatDate(date, locale, false) : undefined
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
|
|
24
|
-
* @param date
|
|
25
|
-
* @returns the formatted date with its time
|
|
26
|
-
*/
|
|
27
|
-
export function useFormatDateWithTime(date?: string) {
|
|
28
|
-
const locale = useLanguage()
|
|
29
|
-
return date ? formatDate(date, locale, true) : undefined
|
|
30
|
-
}
|
|
31
|
-
|
|
32
12
|
/**
|
|
33
13
|
* A utility for formatting dates.
|
|
34
14
|
* @param date
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { Dictionary, getLanguage, translate } from '@stack-spot/portal-translate'
|
|
3
3
|
import { pull } from 'lodash'
|
|
4
4
|
import { useState } from 'react'
|
|
5
|
-
import { CHAT_BUTTON_ID, CHAT_BUTTON_WRAPPER_ID } from '../components/ChatBot'
|
|
6
5
|
import { useEffectOnce } from './use-effect-once'
|
|
7
6
|
|
|
8
7
|
const CHAT_IFRAME_ID = 'sn_va_web_client'
|
|
8
|
+
export const CHAT_BUTTON_ID = 'service-now-button'
|
|
9
|
+
export const CHAT_BUTTON_WRAPPER_ID = 'service-now-content'
|
|
9
10
|
|
|
10
11
|
const closeButtonStyle = `
|
|
11
12
|
position: absolute;
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
export { AsyncContent } from './components/AsyncContent'
|
|
1
2
|
export { BannerWarning } from './components/BannerWarning'
|
|
2
3
|
export { ChatBot } from './components/ChatBot'
|
|
3
|
-
export {
|
|
4
|
+
export { useDateFormatter } from './hooks/date'
|
|
4
5
|
export { useKeyboardControls } from './hooks/keyboard'
|
|
5
6
|
export { openServiceNowChat, dictionary as serviceNowDictionary, useServiceNowChatButtonVisibility, useServiceNowEffect } from './hooks/service-now'
|
|
6
7
|
export { useCheckTextOverflow } from './hooks/text'
|
|
7
8
|
export { titleEffect, useTitleEffect } from './hooks/title'
|
|
8
9
|
export { useEffectOnce } from './hooks/use-effect-once'
|
|
9
|
-
export { useDateFormatter } from './hooks/date'
|
|
10
10
|
export * from './utils/accessibility'
|
|
11
11
|
export * from './utils/cookie'
|
|
12
|
+
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { NavigationProps } from './StepNavigation.js';
|
|
3
|
-
interface StepContainerProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
/**
|
|
6
|
-
* The unique identifier for the step.
|
|
7
|
-
*/
|
|
8
|
-
stepKey: string;
|
|
9
|
-
/**
|
|
10
|
-
* The title for the step.
|
|
11
|
-
*/
|
|
12
|
-
title: string;
|
|
13
|
-
/**
|
|
14
|
-
* The position of the tour overlay related to the content being explained.
|
|
15
|
-
*/
|
|
16
|
-
position: PointingArrowPosition;
|
|
17
|
-
/**
|
|
18
|
-
* A customizable set of buttons for navigating the tour steps.
|
|
19
|
-
*/
|
|
20
|
-
customNavigation?: Omit<NavigationProps, 'stepKey'>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Tutorial: the overlay component for showing a step on React Tour.
|
|
24
|
-
* @param props the react props for the component {@link StepContainerProps}.
|
|
25
|
-
*/
|
|
26
|
-
export declare const StepContainer: ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom';
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=StepContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/StepContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAkB,MAAM,kBAAkB,CAAA;AAIlE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAChC;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,6DAA8D,kBAAkB,4CAOzG,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { theme } from '@stack-spot/portal-theme';
|
|
3
|
-
import { styled } from 'styled-components';
|
|
4
|
-
import { StepNavigation } from './StepNavigation.js';
|
|
5
|
-
import { StepTitle } from './StepTitle.js';
|
|
6
|
-
import { useTour } from './context.js';
|
|
7
|
-
/**
|
|
8
|
-
* Tutorial: the overlay component for showing a step on React Tour.
|
|
9
|
-
* @param props the react props for the component {@link StepContainerProps}.
|
|
10
|
-
*/
|
|
11
|
-
export const StepContainer = ({ title, stepKey, customNavigation, position, children }) => {
|
|
12
|
-
const { finishStep } = useTour();
|
|
13
|
-
return _jsxs(BoxWithPointingArrow, { "$position": position, children: [_jsx(StepTitle, { title: title, onClose: () => finishStep(stepKey) }), children, _jsx(StepNavigation, { stepKey: stepKey, ...(customNavigation || {}) })] });
|
|
14
|
-
};
|
|
15
|
-
const BoxWithPointingArrow = styled.div `
|
|
16
|
-
position: relative;
|
|
17
|
-
width: 100%;
|
|
18
|
-
background-color: ${theme.color.inverse[500]};
|
|
19
|
-
&::after {
|
|
20
|
-
content: '';
|
|
21
|
-
position: absolute;
|
|
22
|
-
border-width: 10px;
|
|
23
|
-
border-style: solid;
|
|
24
|
-
border-color: transparent;
|
|
25
|
-
margin-top: -5px;
|
|
26
|
-
border-right-color: ${theme.color.inverse[500]};
|
|
27
|
-
${({ $position, $top }) => $position === 'right' ?
|
|
28
|
-
`
|
|
29
|
-
top: ${$top || '16px'};
|
|
30
|
-
left: -18px;
|
|
31
|
-
` : ''}
|
|
32
|
-
${({ $position, $right }) => $position === 'top' ?
|
|
33
|
-
`
|
|
34
|
-
bottom: 96%;
|
|
35
|
-
right: ${$right || '16px'};
|
|
36
|
-
transform: rotate(90deg);
|
|
37
|
-
` : ''}
|
|
38
|
-
${({ $position, $top }) => $position === 'left' ?
|
|
39
|
-
`
|
|
40
|
-
top: ${$top || '16px'};
|
|
41
|
-
right: -18px;
|
|
42
|
-
transform: rotate(180deg);
|
|
43
|
-
` : ''}
|
|
44
|
-
${({ $position, $right }) => $position === 'bottom' ?
|
|
45
|
-
`
|
|
46
|
-
top: -13px;
|
|
47
|
-
right: ${$right || '16px'};
|
|
48
|
-
transform: rotate(90deg);
|
|
49
|
-
` : ''}
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
//# sourceMappingURL=StepContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepContainer.js","sourceRoot":"","sources":["../../../src/components/Tour/StepContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsBnC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QA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
|
-
interface CustomNavigationButton {
|
|
3
|
-
/**
|
|
4
|
-
* The text content to render.
|
|
5
|
-
*/
|
|
6
|
-
text: string;
|
|
7
|
-
onClick?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export interface NavigationProps {
|
|
10
|
-
/**
|
|
11
|
-
* The unique identifier of the step.
|
|
12
|
-
*/
|
|
13
|
-
stepKey: string;
|
|
14
|
-
/**
|
|
15
|
-
* The text and click handler for the button "next".
|
|
16
|
-
*/
|
|
17
|
-
nextButton?: CustomNavigationButton;
|
|
18
|
-
/**
|
|
19
|
-
* The text and click handler for the button "previous".
|
|
20
|
-
*/
|
|
21
|
-
prevButton?: CustomNavigationButton;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
|
|
25
|
-
* @param props the react props for the component {@link NavigationProps}.
|
|
26
|
-
*/
|
|
27
|
-
export declare const StepNavigation: ({ stepKey, nextButton, prevButton }: NavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=StepNavigation.d.ts.map
|