@spaced-out/ui-design-system 0.5.37 → 0.5.39
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 +20 -0
- package/design-tokens/size/base-size.json +12 -0
- package/lib/components/PastChatCard/PastChatCard.d.ts +22 -0
- package/lib/components/PastChatCard/PastChatCard.d.ts.map +1 -0
- package/lib/components/PastChatCard/PastChatCard.js +91 -0
- package/lib/components/PastChatCard/PastChatCard.module.css +83 -0
- package/lib/components/PastChatCard/index.d.ts +2 -0
- package/lib/components/PastChatCard/index.d.ts.map +1 -0
- package/lib/components/PastChatCard/index.js +16 -0
- package/lib/components/PreviewCard/PreviewCard.d.ts +30 -0
- package/lib/components/PreviewCard/PreviewCard.d.ts.map +1 -0
- package/lib/components/PreviewCard/PreviewCard.js +154 -0
- package/lib/components/PreviewCard/PreviewCard.module.css +216 -0
- package/lib/components/PreviewCard/index.d.ts +2 -0
- package/lib/components/PreviewCard/index.d.ts.map +1 -0
- package/lib/components/PreviewCard/index.js +16 -0
- package/lib/components/ScrollingLoader/ScrollingLoader.d.ts +35 -0
- package/lib/components/ScrollingLoader/ScrollingLoader.d.ts.map +1 -0
- package/lib/components/ScrollingLoader/ScrollingLoader.js +205 -0
- package/lib/components/ScrollingLoader/ScrollingLoader.module.css +283 -0
- package/lib/components/ScrollingLoader/index.d.ts +2 -0
- package/lib/components/ScrollingLoader/index.d.ts.map +1 -0
- package/lib/components/ScrollingLoader/index.js +16 -0
- package/lib/components/TokenListInput/TokenListInput.module.css +20 -12
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +33 -0
- package/lib/styles/index.css +8 -0
- package/lib/styles/index.d.ts +4 -0
- package/lib/styles/index.d.ts.map +1 -1
- package/lib/styles/index.js +5 -1
- package/lib/styles/variables/_size.css +8 -0
- package/lib/styles/variables/_size.d.ts +4 -0
- package/lib/styles/variables/_size.d.ts.map +1 -1
- package/lib/styles/variables/_size.js +5 -1
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.39](https://github.com/spaced-out/ui-design-system/compare/v0.5.38...v0.5.39) (2026-01-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* past chat card component ([#438](https://github.com/spaced-out/ui-design-system/issues/438)) ([6a82638](https://github.com/spaced-out/ui-design-system/commit/6a82638a863dbc9f2950a30414bdf9f784f8a515)), closes [#419](https://github.com/spaced-out/ui-design-system/issues/419) [#440](https://github.com/spaced-out/ui-design-system/issues/440) [#441](https://github.com/spaced-out/ui-design-system/issues/441)
|
|
11
|
+
* preview card component ([#436](https://github.com/spaced-out/ui-design-system/issues/436)) ([447fecd](https://github.com/spaced-out/ui-design-system/commit/447fecd433b200e04c23325f901956aaf037976d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* box shadow and background color for msg ([#454](https://github.com/spaced-out/ui-design-system/issues/454)) ([0acff77](https://github.com/spaced-out/ui-design-system/commit/0acff7762220f9dad7aa7bcc1e145bf12d51a212))
|
|
17
|
+
|
|
18
|
+
### [0.5.38](https://github.com/spaced-out/ui-design-system/compare/v0.5.37...v0.5.38) (2025-12-19)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **ScrollingLoader:** Add animated loading component with skeleton rows and cycling text ([#453](https://github.com/spaced-out/ui-design-system/issues/453)) ([6b489cc](https://github.com/spaced-out/ui-design-system/commit/6b489ccc9195c36908779be8e2d64589cbe2aae0))
|
|
24
|
+
|
|
5
25
|
### [0.5.37](https://github.com/spaced-out/ui-design-system/compare/v0.5.36...v0.5.37) (2025-12-18)
|
|
6
26
|
|
|
7
27
|
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"12":{
|
|
19
19
|
"value": "12px"
|
|
20
20
|
},
|
|
21
|
+
"16":{
|
|
22
|
+
"value": "16px"
|
|
23
|
+
},
|
|
21
24
|
"18": {
|
|
22
25
|
"value": "18px"
|
|
23
26
|
},
|
|
@@ -96,6 +99,9 @@
|
|
|
96
99
|
"140": {
|
|
97
100
|
"value": "140px"
|
|
98
101
|
},
|
|
102
|
+
"150": {
|
|
103
|
+
"value": "150px"
|
|
104
|
+
},
|
|
99
105
|
"160": {
|
|
100
106
|
"value": "160px"
|
|
101
107
|
},
|
|
@@ -120,6 +126,9 @@
|
|
|
120
126
|
"276": {
|
|
121
127
|
"value": "276px"
|
|
122
128
|
},
|
|
129
|
+
"284": {
|
|
130
|
+
"value": "284px"
|
|
131
|
+
},
|
|
123
132
|
"300": {
|
|
124
133
|
"value": "300px"
|
|
125
134
|
},
|
|
@@ -132,6 +141,9 @@
|
|
|
132
141
|
"400": {
|
|
133
142
|
"value": "400px"
|
|
134
143
|
},
|
|
144
|
+
"426": {
|
|
145
|
+
"value": "426px"
|
|
146
|
+
},
|
|
135
147
|
"480": {
|
|
136
148
|
"value": "480px"
|
|
137
149
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Flow } from 'flow-to-typescript-codemod';
|
|
3
|
+
import { type AlertSemanticType } from '../../types/common';
|
|
4
|
+
import type { IconSize, IconType } from '../../components/Icon';
|
|
5
|
+
type ClassNames = Readonly<{
|
|
6
|
+
wrapper?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export interface PastChatCardProps {
|
|
9
|
+
title: string;
|
|
10
|
+
subTitle: string;
|
|
11
|
+
iconName?: string;
|
|
12
|
+
iconType?: IconType;
|
|
13
|
+
iconSize?: IconSize;
|
|
14
|
+
semantic?: AlertSemanticType;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
classNames?: ClassNames;
|
|
17
|
+
onClick?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
|
|
18
|
+
testId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const PastChatCard: Flow.AbstractComponent<PastChatCardProps, HTMLDivElement>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=PastChatCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PastChatCard.d.ts","sourceRoot":"","sources":["../../../src/components/PastChatCard/PastChatCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,EAAiB,KAAK,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAKxE,OAAO,KAAK,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAO5D,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAC/C,iBAAiB,EACjB,cAAc,CAyEf,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PastChatCard = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _common = require("../../types/common");
|
|
9
|
+
var _typography = require("../../types/typography");
|
|
10
|
+
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
11
|
+
var _qa = require("../../utils/qa");
|
|
12
|
+
var _Icon = require("../Icon");
|
|
13
|
+
var _Text = require("../Text");
|
|
14
|
+
var _PastChatCardModule = _interopRequireDefault(require("./PastChatCard.module.css"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
+
const PastChatCard = exports.PastChatCard = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
title,
|
|
21
|
+
subTitle,
|
|
22
|
+
iconName,
|
|
23
|
+
iconType = _Icon.ICON_TYPE.solid,
|
|
24
|
+
iconSize = _Icon.ICON_SIZE.small,
|
|
25
|
+
semantic = _common.ALERT_SEMANTIC.neutral,
|
|
26
|
+
disabled = false,
|
|
27
|
+
classNames,
|
|
28
|
+
onClick,
|
|
29
|
+
testId
|
|
30
|
+
} = _ref;
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
32
|
+
ref: ref,
|
|
33
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
34
|
+
base: testId,
|
|
35
|
+
slot: 'root'
|
|
36
|
+
}),
|
|
37
|
+
className: (0, _classify.default)(_PastChatCardModule.default.card, {
|
|
38
|
+
[_PastChatCardModule.default.disabled]: disabled
|
|
39
|
+
}, classNames?.wrapper),
|
|
40
|
+
onClick: onClick,
|
|
41
|
+
tabIndex: disabled ? -1 : 0,
|
|
42
|
+
onKeyDown: e => e.key === 'Enter' && onClick?.(e),
|
|
43
|
+
"aria-disabled": disabled,
|
|
44
|
+
children: [iconName && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.SemanticIcon, {
|
|
45
|
+
name: iconName,
|
|
46
|
+
type: iconType,
|
|
47
|
+
size: iconSize,
|
|
48
|
+
semantic: disabled ? _common.ALERT_SEMANTIC.neutral : semantic,
|
|
49
|
+
testId: (0, _qa.generateTestId)({
|
|
50
|
+
base: testId,
|
|
51
|
+
slot: 'icon-element'
|
|
52
|
+
}),
|
|
53
|
+
classNames: {
|
|
54
|
+
wrapper: _PastChatCardModule.default.semanticIcon
|
|
55
|
+
}
|
|
56
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
57
|
+
className: _PastChatCardModule.default.textContent,
|
|
58
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
59
|
+
base: testId,
|
|
60
|
+
slot: 'content'
|
|
61
|
+
}),
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodyMediumBold, {
|
|
63
|
+
className: _PastChatCardModule.default.title,
|
|
64
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.primary,
|
|
65
|
+
testId: (0, _qa.generateTestId)({
|
|
66
|
+
base: testId,
|
|
67
|
+
slot: 'title'
|
|
68
|
+
}),
|
|
69
|
+
children: title
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
71
|
+
className: _PastChatCardModule.default.subTitle,
|
|
72
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.secondary,
|
|
73
|
+
testId: (0, _qa.generateTestId)({
|
|
74
|
+
base: testId,
|
|
75
|
+
slot: 'subtitle'
|
|
76
|
+
}),
|
|
77
|
+
children: subTitle
|
|
78
|
+
})]
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
80
|
+
name: "chevron-right",
|
|
81
|
+
size: _Icon.ICON_SIZE.small,
|
|
82
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.tertiary,
|
|
83
|
+
className: _PastChatCardModule.default.chevronIcon,
|
|
84
|
+
testId: (0, _qa.generateTestId)({
|
|
85
|
+
base: testId,
|
|
86
|
+
slot: 'chevron-icon'
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
PastChatCard.displayName = 'PastChatCard';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@value (
|
|
2
|
+
spaceSmall,
|
|
3
|
+
spaceXSmall,
|
|
4
|
+
spaceXXSmall
|
|
5
|
+
) from '../../styles/variables/_space.css';
|
|
6
|
+
|
|
7
|
+
@value (
|
|
8
|
+
colorBorderPrimary,
|
|
9
|
+
colorBorderTertiary,
|
|
10
|
+
colorBackgroundTertiary,
|
|
11
|
+
colorBackgroundPrimary,
|
|
12
|
+
colorFocusPrimary,
|
|
13
|
+
colorTextClickable
|
|
14
|
+
) from '../../styles/variables/_color.css';
|
|
15
|
+
|
|
16
|
+
@value (
|
|
17
|
+
borderWidthPrimary,
|
|
18
|
+
borderWidthTertiary,
|
|
19
|
+
borderWidthNone,
|
|
20
|
+
borderRadiusSmall
|
|
21
|
+
) from '../../styles/variables/_border.css';
|
|
22
|
+
|
|
23
|
+
@value (
|
|
24
|
+
sizeFluid
|
|
25
|
+
) from '../../styles/variables/_size.css';
|
|
26
|
+
|
|
27
|
+
.card {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: spaceXSmall;
|
|
31
|
+
padding: spaceSmall;
|
|
32
|
+
background-color: colorBackgroundTertiary;
|
|
33
|
+
composes: borderPrimary from '../../styles/border.module.css';
|
|
34
|
+
border-radius: borderRadiusSmall;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
width: sizeFluid;
|
|
37
|
+
min-width: fit-content;
|
|
38
|
+
|
|
39
|
+
&:focus {
|
|
40
|
+
border-color: colorTextClickable;
|
|
41
|
+
box-shadow: borderWidthNone borderWidthNone borderWidthNone
|
|
42
|
+
borderWidthTertiary colorFocusPrimary;
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: colorBackgroundPrimary;
|
|
48
|
+
|
|
49
|
+
&:not(:focus) {
|
|
50
|
+
border-color: colorBorderTertiary;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.disabled {
|
|
55
|
+
cursor: not-allowed;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.textContent {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: spaceXXSmall;
|
|
64
|
+
flex: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.title,
|
|
68
|
+
.subTitle {
|
|
69
|
+
width: sizeFluid;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.chevronIcon {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.semanticIcon {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
border-radius: borderRadiusSmall;
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PastChatCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _PastChatCard = require("./PastChatCard");
|
|
7
|
+
Object.keys(_PastChatCard).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _PastChatCard[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _PastChatCard[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Flow } from 'flow-to-typescript-codemod';
|
|
3
|
+
import type { ColorTypes } from '../../types/typography';
|
|
4
|
+
import type { IconSize, IconType } from '../../components/Icon';
|
|
5
|
+
type ClassNames = Readonly<{
|
|
6
|
+
wrapper?: string;
|
|
7
|
+
card?: string;
|
|
8
|
+
titleText?: string;
|
|
9
|
+
previewText?: string;
|
|
10
|
+
cardIconSection?: string;
|
|
11
|
+
helperText?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export interface PreviewCardProps {
|
|
14
|
+
title: string;
|
|
15
|
+
previewText: string;
|
|
16
|
+
cardImgIconName?: string;
|
|
17
|
+
isSelected: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onClick?: (e: React.SyntheticEvent<HTMLElement>) => unknown;
|
|
20
|
+
helperTextIconName?: string;
|
|
21
|
+
helperTextIconColor?: ColorTypes;
|
|
22
|
+
helperTextIconType?: IconType;
|
|
23
|
+
helperTextIconSize?: IconSize;
|
|
24
|
+
helperText?: string;
|
|
25
|
+
classNames?: ClassNames;
|
|
26
|
+
testId?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const PreviewCard: Flow.AbstractComponent<PreviewCardProps, HTMLDivElement>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=PreviewCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewCard.d.ts","sourceRoot":"","sources":["../../../src/components/PreviewCard/PreviewCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAKrD,OAAO,KAAK,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAQ5D,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAC9B,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAC9C,gBAAgB,EAChB,cAAc,CAiJf,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PreviewCard = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _typography = require("../../types/typography");
|
|
9
|
+
var _classify = require("../../utils/classify");
|
|
10
|
+
var _qa = require("../../utils/qa");
|
|
11
|
+
var _Icon = require("../Icon");
|
|
12
|
+
var _Text = require("../Text");
|
|
13
|
+
var _TruncatedTextWithTooltip = require("../TruncatedTextWithTooltip");
|
|
14
|
+
var _PreviewCardModule = _interopRequireDefault(require("./PreviewCard.module.css"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
+
const PreviewCard = exports.PreviewCard = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
title,
|
|
21
|
+
previewText,
|
|
22
|
+
cardImgIconName = 'sparkles',
|
|
23
|
+
isSelected,
|
|
24
|
+
disabled = false,
|
|
25
|
+
onClick,
|
|
26
|
+
helperTextIconName = '',
|
|
27
|
+
helperTextIconColor = _typography.TEXT_COLORS.primary,
|
|
28
|
+
helperTextIconType = _Icon.ICON_TYPE.regular,
|
|
29
|
+
helperTextIconSize = _Icon.ICON_SIZE.small,
|
|
30
|
+
helperText,
|
|
31
|
+
classNames,
|
|
32
|
+
testId
|
|
33
|
+
} = _ref;
|
|
34
|
+
const handleClick = e => {
|
|
35
|
+
onClick?.(e);
|
|
36
|
+
};
|
|
37
|
+
const handleKeyDown = e => {
|
|
38
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
onClick?.(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
|
+
ref: ref,
|
|
45
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
46
|
+
base: testId,
|
|
47
|
+
slot: 'root'
|
|
48
|
+
}),
|
|
49
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.wrapper, classNames?.wrapper),
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.card, {
|
|
52
|
+
[_PreviewCardModule.default.selected]: isSelected,
|
|
53
|
+
[_PreviewCardModule.default.disabled]: disabled
|
|
54
|
+
}, classNames?.card),
|
|
55
|
+
onClick: handleClick,
|
|
56
|
+
onKeyDown: handleKeyDown,
|
|
57
|
+
tabIndex: disabled ? -1 : 0,
|
|
58
|
+
role: "button",
|
|
59
|
+
"aria-pressed": isSelected,
|
|
60
|
+
"aria-disabled": disabled,
|
|
61
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
62
|
+
base: testId,
|
|
63
|
+
slot: 'card'
|
|
64
|
+
}),
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
66
|
+
className: _PreviewCardModule.default.cardContent,
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
68
|
+
className: _PreviewCardModule.default.mainContent,
|
|
69
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.BodySmall, {
|
|
70
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.primary,
|
|
71
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.titleText, classNames?.titleText),
|
|
72
|
+
testId: (0, _qa.generateTestId)({
|
|
73
|
+
base: testId,
|
|
74
|
+
slot: 'title-link'
|
|
75
|
+
}),
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TruncatedTextWithTooltip.TruncatedTextWithTooltip, {
|
|
77
|
+
line: 1,
|
|
78
|
+
tooltip: {
|
|
79
|
+
delayMotionDuration: 'normal'
|
|
80
|
+
},
|
|
81
|
+
classNames: {
|
|
82
|
+
wrapper: _PreviewCardModule.default.titleTruncateWrapper
|
|
83
|
+
},
|
|
84
|
+
testId: (0, _qa.generateTestId)({
|
|
85
|
+
base: testId,
|
|
86
|
+
slot: 'title-tooltip'
|
|
87
|
+
}),
|
|
88
|
+
children: title
|
|
89
|
+
})
|
|
90
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
91
|
+
className: _PreviewCardModule.default.previewTextContainer,
|
|
92
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.ButtonTextExtraSmall, {
|
|
93
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.tertiary,
|
|
94
|
+
testId: (0, _qa.generateTestId)({
|
|
95
|
+
base: testId,
|
|
96
|
+
slot: 'preview-link-text'
|
|
97
|
+
}),
|
|
98
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.previewText, classNames?.previewText),
|
|
99
|
+
children: previewText
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
101
|
+
name: "chevron-right",
|
|
102
|
+
size: _Icon.ICON_SIZE.small,
|
|
103
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : _typography.TEXT_COLORS.tertiary,
|
|
104
|
+
testId: (0, _qa.generateTestId)({
|
|
105
|
+
base: testId,
|
|
106
|
+
slot: 'preview-chevron'
|
|
107
|
+
})
|
|
108
|
+
})]
|
|
109
|
+
})]
|
|
110
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
111
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.cardIconSection, classNames?.cardIconSection),
|
|
112
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
113
|
+
base: testId,
|
|
114
|
+
slot: 'card-icon'
|
|
115
|
+
}),
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
117
|
+
name: cardImgIconName,
|
|
118
|
+
type: _Icon.ICON_TYPE.solid,
|
|
119
|
+
size: _Icon.ICON_SIZE.small,
|
|
120
|
+
color: disabled ? _typography.TEXT_COLORS.disabled : isSelected ? _typography.TEXT_COLORS.clickable : _typography.TEXT_COLORS.inverseSecondary,
|
|
121
|
+
testId: (0, _qa.generateTestId)({
|
|
122
|
+
base: testId,
|
|
123
|
+
slot: 'card-icon-image'
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
}), !!helperText && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
129
|
+
className: (0, _classify.classify)(_PreviewCardModule.default.helperText, classNames?.helperText),
|
|
130
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
131
|
+
base: testId,
|
|
132
|
+
slot: 'helper-text'
|
|
133
|
+
}),
|
|
134
|
+
children: [helperTextIconName && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
135
|
+
name: helperTextIconName,
|
|
136
|
+
type: helperTextIconType,
|
|
137
|
+
size: helperTextIconSize,
|
|
138
|
+
color: helperTextIconColor,
|
|
139
|
+
testId: (0, _qa.generateTestId)({
|
|
140
|
+
base: testId,
|
|
141
|
+
slot: 'helper-text-icon'
|
|
142
|
+
})
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.ButtonTextExtraSmall, {
|
|
144
|
+
color: _typography.TEXT_COLORS.tertiary,
|
|
145
|
+
testId: (0, _qa.generateTestId)({
|
|
146
|
+
base: testId,
|
|
147
|
+
slot: 'helper-text-label'
|
|
148
|
+
}),
|
|
149
|
+
children: helperText
|
|
150
|
+
})]
|
|
151
|
+
})]
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
PreviewCard.displayName = 'PreviewCard';
|