@moving-walls/design-system 1.0.11 → 1.0.12
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/dist/components/ui/PageHeader.d.ts +11 -1
- package/dist/index.esm.js +40 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -16
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface PageHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
title: string;
|
|
4
|
+
/** Description shown below the title */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Alias for description (backward compat) */
|
|
4
7
|
subtitle?: string;
|
|
8
|
+
/** i18n key for the title (consumer passes pre-translated string as title) */
|
|
9
|
+
titleKey?: string;
|
|
10
|
+
/** i18n key for the description */
|
|
11
|
+
descriptionKey?: string;
|
|
12
|
+
/** Element rendered to the left of the title (e.g. a back button) */
|
|
13
|
+
leftAction?: React.ReactNode;
|
|
14
|
+
/** Action buttons rendered on the right side */
|
|
5
15
|
actions?: React.ReactNode;
|
|
6
16
|
}
|
|
7
|
-
export declare function PageHeader({ title, subtitle, actions, className, ...props }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function PageHeader({ title, description, subtitle, titleKey: _titleKey, descriptionKey: _descriptionKey, leftAction, actions, className, ...props }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
18
|
export declare namespace PageHeader {
|
|
9
19
|
var displayName: string;
|
|
10
20
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -49183,28 +49183,52 @@ var AgGridTable = AgGridTableInner;
|
|
|
49183
49183
|
|
|
49184
49184
|
function PageHeader(_a) {
|
|
49185
49185
|
var title = _a.title,
|
|
49186
|
-
|
|
49186
|
+
description = _a.description,
|
|
49187
|
+
subtitle = _a.subtitle;
|
|
49188
|
+
_a.titleKey;
|
|
49189
|
+
_a.descriptionKey;
|
|
49190
|
+
var leftAction = _a.leftAction,
|
|
49187
49191
|
actions = _a.actions,
|
|
49188
49192
|
className = _a.className,
|
|
49189
|
-
props = __rest$1(_a, ["title", "subtitle", "actions", "className"]);
|
|
49193
|
+
props = __rest$1(_a, ["title", "description", "subtitle", "titleKey", "descriptionKey", "leftAction", "actions", "className"]);
|
|
49194
|
+
var desc = description !== null && description !== void 0 ? description : subtitle;
|
|
49195
|
+
var headerId = "page-header-".concat(title.toLowerCase().trim().split(/\s+/).join('-'));
|
|
49196
|
+
var baseClass = 'bg-white flex flex-col justify-start items-start gap-4 border-b border-container-border pt-4 pb-3 dark:bg-mw-neutral-900 dark:border-mw-neutral-800';
|
|
49197
|
+
var combinedClass = className ? "".concat(baseClass, " ").concat(className) : baseClass;
|
|
49190
49198
|
return jsx("div", Object.assign({
|
|
49191
|
-
|
|
49199
|
+
id: headerId,
|
|
49200
|
+
className: combinedClass
|
|
49192
49201
|
}, props, {
|
|
49193
49202
|
children: jsxs("div", {
|
|
49194
|
-
className: "
|
|
49203
|
+
className: "self-stretch px-4 inline-flex justify-start items-start",
|
|
49195
49204
|
children: [jsxs("div", {
|
|
49196
|
-
className: "
|
|
49197
|
-
children: [jsx("
|
|
49198
|
-
|
|
49199
|
-
|
|
49200
|
-
|
|
49201
|
-
|
|
49202
|
-
|
|
49203
|
-
|
|
49204
|
-
})
|
|
49205
|
-
|
|
49206
|
-
|
|
49207
|
-
|
|
49205
|
+
className: "pt-2 flex justify-start items-start gap-2",
|
|
49206
|
+
children: [leftAction && jsx("div", {
|
|
49207
|
+
id: "".concat(headerId, "-left-action"),
|
|
49208
|
+
className: "p-2 flex justify-center items-center gap-1",
|
|
49209
|
+
children: jsx("div", {
|
|
49210
|
+
className: "relative overflow-hidden",
|
|
49211
|
+
children: leftAction
|
|
49212
|
+
})
|
|
49213
|
+
}), jsxs("div", {
|
|
49214
|
+
className: "self-stretch inline-flex flex-col justify-start items-start gap-1",
|
|
49215
|
+
children: [jsx("div", {
|
|
49216
|
+
id: "".concat(headerId, "-title"),
|
|
49217
|
+
className: "self-stretch justify-start text-xl font-semibold leading-loose text-mw-neutral-900 dark:text-white",
|
|
49218
|
+
children: title
|
|
49219
|
+
}), desc && jsx("div", {
|
|
49220
|
+
id: "".concat(headerId, "-description"),
|
|
49221
|
+
className: "self-stretch justify-start text-neutral-500 text-sm font-normal leading-none dark:text-mw-neutral-400",
|
|
49222
|
+
children: desc
|
|
49223
|
+
})]
|
|
49224
|
+
})]
|
|
49225
|
+
}), jsx("div", {
|
|
49226
|
+
id: "".concat(headerId, "-actions"),
|
|
49227
|
+
className: "flex-1 self-stretch flex justify-end items-end gap-2",
|
|
49228
|
+
children: actions && jsx("div", {
|
|
49229
|
+
className: "flex items-center gap-4",
|
|
49230
|
+
children: actions
|
|
49231
|
+
})
|
|
49208
49232
|
})]
|
|
49209
49233
|
})
|
|
49210
49234
|
}));
|