@viglet/viglet-design-system 2026.2.25 → 2026.2.26
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.
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Composite sticky header for sub-pages.
|
|
4
|
+
*
|
|
5
|
+
* Replaces the former `SubPageHeader` + `StickySaveBar` duplication. The root
|
|
6
|
+
* is a sticky flex row with the SidebarTrigger; callers compose the title and
|
|
7
|
+
* any buttons as children.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <StickyPageHeader>
|
|
12
|
+
* <StickyPageHeader.Title icon={IconSettings} feature="..." description="..." />
|
|
13
|
+
* <StickyPageHeader.Actions>
|
|
14
|
+
* <StickyPageHeader.Action label="Duplicate" onClick={...} /> // → dropdown item
|
|
15
|
+
*
|
|
16
|
+
* <GradientButton variant="ghost" size="icon-sm" onClick={handleExport}>
|
|
17
|
+
* <IconDownload className="size-5!" />
|
|
18
|
+
* </GradientButton>
|
|
19
|
+
*
|
|
20
|
+
* <DialogDelete feature="..." name={name} onDelete={...} open={open} setOpen={setOpen} />
|
|
21
|
+
*
|
|
22
|
+
* <GradientButton type="submit" size="sm" loading={isLoading}>
|
|
23
|
+
* <IconDeviceFloppy className="size-4" />
|
|
24
|
+
* {t("forms.formActions.saveChanges")}
|
|
25
|
+
* </GradientButton>
|
|
26
|
+
*
|
|
27
|
+
* <GradientButton type="button" variant="outline" size="sm" onClick={...}>
|
|
28
|
+
* <IconX className="size-4" />
|
|
29
|
+
* {t("forms.formActions.cancel")}
|
|
30
|
+
* </GradientButton>
|
|
31
|
+
* </StickyPageHeader.Actions>
|
|
32
|
+
* </StickyPageHeader>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Only `Action` (dropdown item marker) has special handling — all other nodes
|
|
36
|
+
* inside `<Actions>` render inline in the order they appear.
|
|
37
|
+
*
|
|
38
|
+
* @since 2026.2.26
|
|
39
|
+
*/
|
|
40
|
+
interface TitleProps {
|
|
41
|
+
icon: React.ElementType;
|
|
42
|
+
feature: string;
|
|
43
|
+
description: string;
|
|
44
|
+
/** When set, wraps the title in a NavLink to this route (desktop only). */
|
|
45
|
+
urlBase?: string;
|
|
46
|
+
}
|
|
2
47
|
interface ActionProps {
|
|
3
48
|
label: string;
|
|
4
49
|
icon?: React.ElementType;
|
|
@@ -6,31 +51,17 @@ interface ActionProps {
|
|
|
6
51
|
onClick?: () => void;
|
|
7
52
|
disabled?: boolean;
|
|
8
53
|
}
|
|
9
|
-
interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/** Base route used as a link on the title when not on mobile. */
|
|
17
|
-
urlBase?: string;
|
|
18
|
-
/** When true, renders a Save button (type=submit) alongside Cancel. */
|
|
19
|
-
showSave?: boolean;
|
|
20
|
-
/** When provided, renders a Cancel button calling this handler. */
|
|
21
|
-
onCancel?: () => void;
|
|
22
|
-
/** Disables the Save button and shows a loading state. */
|
|
23
|
-
loading?: boolean;
|
|
24
|
-
/** Disables the Save button. */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/** Delete-dialog wiring (optional). */
|
|
27
|
-
onDelete?: () => void;
|
|
28
|
-
open?: boolean;
|
|
29
|
-
setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
30
|
-
/** StickyPageHeader.Action children to populate the "Actions" dropdown. */
|
|
31
|
-
children?: React.ReactNode;
|
|
54
|
+
interface ActionsProps {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
/** Label shown next to the dropdown trigger. Defaults to "Actions". */
|
|
57
|
+
menuLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
interface RootProps {
|
|
60
|
+
children: React.ReactNode;
|
|
32
61
|
}
|
|
33
|
-
export declare const StickyPageHeader: React.FC<
|
|
62
|
+
export declare const StickyPageHeader: React.FC<RootProps> & {
|
|
63
|
+
Title: React.FC<TitleProps>;
|
|
64
|
+
Actions: React.FC<ActionsProps>;
|
|
34
65
|
Action: React.FC<ActionProps>;
|
|
35
66
|
};
|
|
36
67
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky.page.header.d.ts","sourceRoot":"","sources":["../../../src/components/sticky.page.header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sticky.page.header.d.ts","sourceRoot":"","sources":["../../../src/components/sticky.page.header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH,UAAU,UAAU;IAClB,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyCD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAOD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0DD,UAAU,SAAS;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAcD,eAAO,MAAM,gBAAgB;;;;CAI3B,CAAC"}
|