@xfers/design-system 4.4.2-dev.307e731f7e → 4.4.2-dev.55f1107958
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/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +2 -7
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Coachmark/getJoyrideConfig.js +0 -37
- package/dist/components/Coachmark/getJoyrideConfig.js.map +0 -1
- package/dist/components/Coachmark/index.js +0 -53
- package/dist/components/Coachmark/index.js.map +0 -1
- package/dist/types/components/Coachmark/getJoyrideConfig.d.ts +0 -33
- package/dist/types/components/Coachmark/index.d.ts +0 -29
package/package.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCoachmarkJoyrideConfig = getCoachmarkJoyrideConfig;
|
|
4
|
-
var theme_1 = require("src/theme/theme");
|
|
5
|
-
/**
|
|
6
|
-
* Get the default Joyride configuration for Coachmark component.
|
|
7
|
-
* This includes the arrow styling that matches the Coachmark design.
|
|
8
|
-
*
|
|
9
|
-
* @param options - Optional configuration overrides
|
|
10
|
-
* @returns Joyride configuration object with floaterProps and styles
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { Coachmark, getCoachmarkJoyrideConfig } from '@xfers/design-system'
|
|
15
|
-
* import Joyride from 'react-joyride'
|
|
16
|
-
*
|
|
17
|
-
* <Joyride
|
|
18
|
-
* tooltipComponent={Coachmark}
|
|
19
|
-
* {...getCoachmarkJoyrideConfig()}
|
|
20
|
-
* />
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
function getCoachmarkJoyrideConfig(options) {
|
|
24
|
-
var _a = options || {}, _b = _a.arrowColor, arrowColor = _b === void 0 ? theme_1.straitsXTheme.color.surface.secondaryNeutral : _b, _c = _a.arrowLength, arrowLength = _c === void 0 ? 8 : _c, _d = _a.arrowSpread, arrowSpread = _d === void 0 ? 16 : _d;
|
|
25
|
-
return {
|
|
26
|
-
floaterProps: {
|
|
27
|
-
styles: {
|
|
28
|
-
arrow: {
|
|
29
|
-
length: arrowLength,
|
|
30
|
-
spread: arrowSpread,
|
|
31
|
-
color: arrowColor,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=getJoyrideConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getJoyrideConfig.js","sourceRoot":"","sources":["../../../src/components/Coachmark/getJoyrideConfig.ts"],"names":[],"mappings":";;AAoBA,8DAsBC;AA1CD,yCAA+C;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,yBAAyB,CAAC,OAIzC;IACO,IAAA,KAIF,OAAO,IAAI,EAAE,EAHf,kBAAyD,EAAzD,UAAU,mBAAG,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,KAAA,EACzD,mBAAe,EAAf,WAAW,mBAAG,CAAC,KAAA,EACf,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KACD,CAAA;IAEjB,OAAO;QACL,YAAY,EAAE;YACZ,MAAM,EAAE;gBACN,KAAK,EAAE;oBACL,MAAM,EAAE,WAAW;oBACnB,MAAM,EAAE,WAAW;oBACnB,KAAK,EAAE,UAAU;iBAClB;aACF;SACF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.default = Coachmark;
|
|
8
|
-
var styled_1 = require("@emotion/styled");
|
|
9
|
-
var react_1 = require("react");
|
|
10
|
-
var Typography_1 = require("src/constants/Typography/Typography");
|
|
11
|
-
var MaterialSymbols_1 = require("src/icons/MaterialSymbols");
|
|
12
|
-
var theme_1 = require("src/theme/theme");
|
|
13
|
-
var Link_1 = require("../Link");
|
|
14
|
-
function Coachmark(_a) {
|
|
15
|
-
var index = _a.index, primaryProps = _a.primaryProps, size = _a.size, skipProps = _a.skipProps, step = _a.step, tooltipProps = _a.tooltipProps, backProps = _a.backProps;
|
|
16
|
-
var title = step.title, content = step.content, data = step.data;
|
|
17
|
-
return (react_1.default.createElement(Container, { role: tooltipProps.role },
|
|
18
|
-
react_1.default.createElement(TextContainer, null,
|
|
19
|
-
react_1.default.createElement(Header, null,
|
|
20
|
-
react_1.default.createElement(Typography_1.Typography.Label, { size: "md" }, title),
|
|
21
|
-
react_1.default.createElement(SkipAction, { role: skipProps.role, onClick: skipProps.onClick },
|
|
22
|
-
react_1.default.createElement(MaterialSymbols_1.MaterialSymbols, { icon: "close", size: "m" }))),
|
|
23
|
-
react_1.default.createElement(Typography_1.Typography.Body, { size: "md" }, content)),
|
|
24
|
-
react_1.default.createElement(Footer, null,
|
|
25
|
-
react_1.default.createElement(Dots, null, Array.from({ length: size }, function (_, i) {
|
|
26
|
-
if (index === 0 && (data === null || data === void 0 ? void 0 : data.skipZeroIndex) === true) {
|
|
27
|
-
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
28
|
-
}
|
|
29
|
-
return react_1.default.createElement(Dot, { key: i, isActive: i === index });
|
|
30
|
-
})),
|
|
31
|
-
react_1.default.createElement(ButtonContainer, null,
|
|
32
|
-
backProps && (react_1.default.createElement(BackButton, { typographyType: "label", size: "md", role: backProps === null || backProps === void 0 ? void 0 : backProps.role, isDisabled: index === 0, onClick: backProps.onClick, isUnderlined: false }, "Back")),
|
|
33
|
-
react_1.default.createElement(Link_1.default, { typographyType: "label", size: "md", role: primaryProps.role, onClick: primaryProps.onClick, isUnderlined: false }, "Next")))));
|
|
34
|
-
}
|
|
35
|
-
var Container = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 12px;\n min-width: 200px;\n max-width: 260px;\n"], ["\n background-color: ", ";\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 12px;\n min-width: 200px;\n max-width: 260px;\n"])), theme_1.straitsXTheme.color.surface.secondaryNeutral);
|
|
36
|
-
var TextContainer = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n color: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n gap: 12px;\n color: ", ";\n"])), theme_1.straitsXTheme.color.base.onNeutral);
|
|
37
|
-
var Header = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
38
|
-
var SkipAction = (0, styled_1.default)(Link_1.default)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-decoration: none !important;\n"], ["\n text-decoration: none !important;\n"])));
|
|
39
|
-
var Footer = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
40
|
-
var Dots = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n"])));
|
|
41
|
-
var Dot = styled_1.default.span(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ", ";\n"], ["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ", ";\n"])), function (props) {
|
|
42
|
-
return props.isActive
|
|
43
|
-
? "".concat(theme_1.straitsXTheme.color.base.primary3)
|
|
44
|
-
: "".concat(theme_1.straitsXTheme.color.surface.disabledOnSurface);
|
|
45
|
-
});
|
|
46
|
-
var BackButton = (0, styled_1.default)(Link_1.default)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n h5 {\n color: ", ";\n }\n pointer-events: ", ";\n"], ["\n h5 {\n color: ", ";\n }\n pointer-events: ", ";\n"])), function (props) {
|
|
47
|
-
return props.isDisabled
|
|
48
|
-
? "".concat(theme_1.straitsXTheme.color.surface.disabledOnSurface)
|
|
49
|
-
: "".concat(theme_1.straitsXTheme.color.base.link);
|
|
50
|
-
}, function (props) { return (props.isDisabled ? 'none' : 'auto'); });
|
|
51
|
-
var ButtonContainer = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n gap: 8px;\n"], ["\n display: flex;\n gap: 8px;\n"])));
|
|
52
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Coachmark/index.tsx"],"names":[],"mappings":";;;;;;AAgCA,4BA8DC;AA9FD,0CAAoC;AACpC,+BAAwC;AACxC,kEAAgE;AAChE,6DAA2D;AAC3D,yCAA+C;AAC/C,gCAA0B;AA2B1B,SAAwB,SAAS,CAAC,EAQjB;QAPf,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,IAAI,UAAA,EACJ,SAAS,eAAA,EACT,IAAI,UAAA,EACJ,YAAY,kBAAA,EACZ,SAAS,eAAA;IAED,IAAA,KAAK,GAAoB,IAAI,MAAxB,EAAE,OAAO,GAAW,IA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,UAAG,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAE;AAFtC,CAEsC,EAExB,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAApC,CAAoC,CAClE,CAAA;AACD,IAAM,eAAe,GAAG,gBAAM,CAAC,GAAG,sGAAA,mCAGjC,IAAA,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the default Joyride configuration for Coachmark component.
|
|
3
|
-
* This includes the arrow styling that matches the Coachmark design.
|
|
4
|
-
*
|
|
5
|
-
* @param options - Optional configuration overrides
|
|
6
|
-
* @returns Joyride configuration object with floaterProps and styles
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* import { Coachmark, getCoachmarkJoyrideConfig } from '@xfers/design-system'
|
|
11
|
-
* import Joyride from 'react-joyride'
|
|
12
|
-
*
|
|
13
|
-
* <Joyride
|
|
14
|
-
* tooltipComponent={Coachmark}
|
|
15
|
-
* {...getCoachmarkJoyrideConfig()}
|
|
16
|
-
* />
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function getCoachmarkJoyrideConfig(options?: {
|
|
20
|
-
arrowColor?: string;
|
|
21
|
-
arrowLength?: number;
|
|
22
|
-
arrowSpread?: number;
|
|
23
|
-
}): {
|
|
24
|
-
floaterProps: {
|
|
25
|
-
styles: {
|
|
26
|
-
arrow: {
|
|
27
|
-
length: number;
|
|
28
|
-
spread: number;
|
|
29
|
-
color: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
type CoachmarkProps = {
|
|
3
|
-
index: number;
|
|
4
|
-
size: number;
|
|
5
|
-
step: {
|
|
6
|
-
title: ReactNode;
|
|
7
|
-
content: ReactNode;
|
|
8
|
-
data?: {
|
|
9
|
-
skipZeroIndex?: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
tooltipProps: {
|
|
13
|
-
role: string;
|
|
14
|
-
};
|
|
15
|
-
skipProps: {
|
|
16
|
-
role: string;
|
|
17
|
-
onClick: () => void;
|
|
18
|
-
};
|
|
19
|
-
primaryProps: {
|
|
20
|
-
role: string;
|
|
21
|
-
onClick: () => void;
|
|
22
|
-
};
|
|
23
|
-
backProps?: {
|
|
24
|
-
role: string;
|
|
25
|
-
onClick: () => void;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export default function Coachmark({ index, primaryProps, size, skipProps, step, tooltipProps, backProps, }: CoachmarkProps): React.JSX.Element;
|
|
29
|
-
export {};
|