@spaced-out/ui-design-system 0.1.104 → 0.1.105
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
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.1.105](https://github.com/spaced-out/ui-design-system/compare/v0.1.104...v0.1.105) (2024-07-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 🔘 added optional props for KPI Shimmer ([#235](https://github.com/spaced-out/ui-design-system/issues/235)) ([5cbdba8](https://github.com/spaced-out/ui-design-system/commit/5cbdba80a2e80985c8f68360b293d1a1e73159d4))
|
|
11
|
+
|
|
5
12
|
### [0.1.104](https://github.com/spaced-out/ui-design-system/compare/v0.1.103...v0.1.104) (2024-07-04)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -72,11 +72,16 @@ const Shimmer = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
72
72
|
exports.Shimmer = Shimmer;
|
|
73
73
|
const KPIShimmer = _ref3 => {
|
|
74
74
|
let {
|
|
75
|
-
textWidth = 150
|
|
75
|
+
textWidth = 150,
|
|
76
|
+
hasBottomContent = true,
|
|
77
|
+
hasIcon = true,
|
|
78
|
+
hasTopContent = true,
|
|
79
|
+
hasMiddleContent = true,
|
|
80
|
+
classNames
|
|
76
81
|
} = _ref3;
|
|
77
82
|
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: _ShimmerModule.default.kpiBox
|
|
79
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: (0, _classify.default)(_ShimmerModule.default.kpiBox, classNames?.wrapper)
|
|
84
|
+
}, hasIcon && /*#__PURE__*/React.createElement("div", {
|
|
80
85
|
className: _ShimmerModule.default.section
|
|
81
86
|
}, /*#__PURE__*/React.createElement(Shimmer, {
|
|
82
87
|
type: "rounded",
|
|
@@ -84,15 +89,15 @@ const KPIShimmer = _ref3 => {
|
|
|
84
89
|
height: 60
|
|
85
90
|
})), /*#__PURE__*/React.createElement("div", {
|
|
86
91
|
className: _ShimmerModule.default.section
|
|
87
|
-
}, /*#__PURE__*/React.createElement(Shimmer, {
|
|
92
|
+
}, hasTopContent && /*#__PURE__*/React.createElement(Shimmer, {
|
|
88
93
|
type: "text",
|
|
89
94
|
width: textWidth,
|
|
90
95
|
height: 15
|
|
91
|
-
}), /*#__PURE__*/React.createElement(Shimmer, {
|
|
96
|
+
}), hasMiddleContent && /*#__PURE__*/React.createElement(Shimmer, {
|
|
92
97
|
type: "text",
|
|
93
98
|
width: textWidth,
|
|
94
99
|
height: 25
|
|
95
|
-
}), /*#__PURE__*/React.createElement(Shimmer, {
|
|
100
|
+
}), hasBottomContent && /*#__PURE__*/React.createElement(Shimmer, {
|
|
96
101
|
type: "text",
|
|
97
102
|
width: textWidth,
|
|
98
103
|
height: 15
|
|
@@ -96,19 +96,42 @@ export const Shimmer: React$AbstractComponent<ShimmerProps, HTMLSpanElement> =
|
|
|
96
96
|
},
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
+
type KPIShimmerClassNames = $ReadOnly<{wrapper?: string}>;
|
|
100
|
+
|
|
99
101
|
export type KPIShimmerProps = {
|
|
100
102
|
textWidth?: number | string,
|
|
103
|
+
hasTopContent?: boolean,
|
|
104
|
+
hasMiddleContent?: boolean,
|
|
105
|
+
hasBottomContent?: boolean,
|
|
106
|
+
hasIcon?: boolean,
|
|
107
|
+
classNames?: KPIShimmerClassNames,
|
|
101
108
|
};
|
|
102
109
|
|
|
103
|
-
export const KPIShimmer = ({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
export const KPIShimmer = ({
|
|
111
|
+
textWidth = 150,
|
|
112
|
+
hasBottomContent = true,
|
|
113
|
+
hasIcon = true,
|
|
114
|
+
hasTopContent = true,
|
|
115
|
+
hasMiddleContent = true,
|
|
116
|
+
classNames,
|
|
117
|
+
}: KPIShimmerProps): React.Node => (
|
|
118
|
+
<div className={classify(css.kpiBox, classNames?.wrapper)}>
|
|
119
|
+
{hasIcon && (
|
|
120
|
+
<div className={css.section}>
|
|
121
|
+
<Shimmer type="rounded" width={60} height={60}></Shimmer>
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
|
|
108
125
|
<div className={css.section}>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
{hasTopContent && (
|
|
127
|
+
<Shimmer type="text" width={textWidth} height={15}></Shimmer>
|
|
128
|
+
)}
|
|
129
|
+
{hasMiddleContent && (
|
|
130
|
+
<Shimmer type="text" width={textWidth} height={25}></Shimmer>
|
|
131
|
+
)}
|
|
132
|
+
{hasBottomContent && (
|
|
133
|
+
<Shimmer type="text" width={textWidth} height={15}></Shimmer>
|
|
134
|
+
)}
|
|
112
135
|
</div>
|
|
113
136
|
</div>
|
|
114
137
|
);
|