@brightlocal/ui-components 2.23.0 → 2.24.0
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/AI_USAGE.md +1 -1
- package/README.md +3 -2
- package/component-meta.json +116 -25
- package/deprecations.json +22 -0
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +6 -9
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +151 -156
- package/dist/brand-illustration-motif.cjs +1 -0
- package/dist/brand-illustration-motif.d.ts +55 -0
- package/dist/brand-illustration-motif.d.ts.map +1 -0
- package/dist/brand-illustration-motif.js +67 -0
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +287 -2
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +408 -152
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -1
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +387 -376
- package/dist/data-table.cjs +1 -0
- package/dist/{blocks/data-table.d.ts → data-table.d.ts} +159 -4
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +721 -0
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +16 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +23 -7
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +32 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +179 -109
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +526 -511
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +9 -0
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +26 -22
- package/dist/lib/spring-settle.cjs +1 -0
- package/dist/lib/spring-settle.d.ts +20 -0
- package/dist/lib/spring-settle.d.ts.map +1 -0
- package/dist/lib/spring-settle.js +4 -0
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +3 -2
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +22 -11
- package/dist/loading.cjs +1 -1
- package/dist/loading.d.ts +2 -1
- package/dist/loading.d.ts.map +1 -1
- package/dist/loading.js +106 -85
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +16 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +112 -79
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +29 -0
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +2 -2
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +236 -219
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +20 -4
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js +263 -228
- package/package.json +7 -7
- package/src/blocks/sidebar.tsx +11 -23
- package/src/components/alert.tsx +1 -4
- package/src/components/brand-illustration-motif.tsx +143 -0
- package/src/components/chart.tsx +632 -1
- package/src/components/combobox.tsx +47 -0
- package/src/{blocks → components}/data-table.tsx +270 -16
- package/src/components/field.tsx +31 -0
- package/src/components/global-layout.tsx +144 -5
- package/src/components/label.tsx +13 -1
- package/src/components/link.tsx +13 -1
- package/src/components/loading.tsx +71 -38
- package/src/components/select.tsx +82 -2
- package/src/components/table.tsx +31 -2
- package/src/components/text-reveal-motion.tsx +90 -64
- package/src/components/typography.tsx +74 -18
- package/src/index.ts +2 -1
- package/src/lib/spring-settle.ts +19 -0
- package/dist/blocks/data-table.cjs +0 -1
- package/dist/blocks/data-table.d.ts.map +0 -1
- package/dist/blocks/data-table.js +0 -654
package/dist/field.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils"),h=require("./description.cjs"),b=require("@brightlocal/ui-components/label");function n({className:e,...a}){return l.jsx("fieldset",{className:r.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",e),"data-slot":"field-set",...a})}n.displayName="FieldSet";const m=["legend","label"];function v({className:e,variant:a="legend",...
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils"),h=require("./description.cjs"),b=require("@brightlocal/ui-components/label");function n({className:e,...a}){return l.jsx("fieldset",{className:r.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3","has-[>.sr-only]:relative",e),"data-slot":"field-set",...a})}n.displayName="FieldSet";const m=["legend","label"];function v({className:e,variant:a="legend",srOnly:t=!1,...d}){return l.jsx("legend",{className:r.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",t&&"sr-only",e),"data-slot":"field-legend","data-variant":a,...d})}function x({className:e,...a}){return l.jsx("div",{className:r.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),"data-slot":"field-group",...a})}const _=g.cva(["group/field flex w-full gap-2","[[data-slot=radio-group]_&]:relative [[data-slot=radio-group]_&]:cursor-pointer [[data-slot=radio-group]_&]:gap-3 [[data-slot=radio-group]_&]:has-[[data-disabled]]:cursor-not-allowed","[[data-slot=radio-group]_&_[data-slot=field-label]]:after:absolute [[data-slot=radio-group]_&_[data-slot=field-label]]:after:inset-0 [[data-slot=radio-group]_&_[data-slot=field-label]]:after:cursor-pointer [[data-slot=radio-group]_&:has([data-disabled])_[data-slot=field-label]]:after:cursor-not-allowed","has-[>[role=checkbox]]:gap-3","has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal","has-[>.sr-only]:relative"],{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center gap-x-2","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start","has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]","[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1","[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start","@md/field-group:has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]","@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1","@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"]},variant:{default:[],box:["relative cursor-pointer gap-3","rounded-lg border border-border bg-background p-3","transition-colors","[&_[data-slot=field-label]]:after:absolute [&_[data-slot=field-label]]:after:inset-0 [&_[data-slot=field-label]]:after:cursor-pointer","has-[:focus-visible]:shadow-default has-[:focus-visible]:border-ring","has-[[data-state=checked]:not([role=switch])]:border-primary has-[[data-state=checked]:not([role=switch])]:bg-primary/10","dark:has-[[data-state=checked]:not([role=switch])]:bg-alpha-10","has-[[data-disabled]]:cursor-not-allowed","[&:has([data-disabled])_[data-slot=field-label]]:after:cursor-not-allowed","[[aria-invalid=true]_&]:border-destructive-40","[[aria-invalid=true]_&]:has-[:focus-visible]:border-destructive-40 [[aria-invalid=true]_&]:has-[:focus-visible]:shadow-destructive","has-[[aria-invalid=true]]:border-destructive-40","has-[[aria-invalid=true]:focus-visible]:border-destructive-40 has-[[aria-invalid=true]:focus-visible]:shadow-destructive"]}},defaultVariants:{orientation:"vertical",variant:"default"}});function y({className:e,orientation:a="vertical",variant:t="default",align:d="start",dataHook:s,...o}){return l.jsx("div",{className:r.cn(_({orientation:a,variant:t}),d==="end"&&a==="horizontal"&&"grid-cols-[1fr_auto]",e),"data-hook":s,"data-orientation":a,"data-slot":"field","data-variant":t,role:"group",...o})}function k({className:e,...a}){return l.jsx("div",{className:r.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug","[[data-variant=boxIconVertical]_&]:items-center [[data-variant=boxIconVertical]_&]:text-center",e),"data-slot":"field-content",...a})}function w({className:e,htmlFor:a,dataHook:t,...d}){return l.jsx(b.Label,{className:r.cn("group/field-label peer/field-label w-fit","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),"data-hook":t,"data-slot":"field-label",htmlFor:a,...d})}function F({className:e,dataHook:a,...t}){return l.jsx(h.Description,{className:r.cn("mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",e),"data-hook":a,"data-slot":"field-description",...t})}function j({icon:e=p.AlertCircle,className:a,...t}){return l.jsx(e,{"aria-hidden":"true",className:r.cn("inline-block shrink-0 align-text-bottom",a),...t})}function N({className:e,dataHook:a,children:t,errors:d,...s}){const o=d?.filter(i=>!!i?.message);if(!t&&(!o||o.length===0))return null;const c=r.cn("text-destructive-foreground text-sm font-normal leading-5","mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",e),u=o&&o.length>1;return l.jsx("div",{className:c,"data-hook":a,"data-slot":"field-error",role:"alert",...s,children:u?l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:o.map((i,f)=>l.jsx("li",{children:i.message},f))}):l.jsx("p",{className:"m-0",children:t||o?.[0]?.message})})}exports.Field=y;exports.FieldContent=k;exports.FieldDescription=F;exports.FieldError=N;exports.FieldErrorIcon=j;exports.FieldGroup=x;exports.FieldLabel=w;exports.FieldLegend=v;exports.FieldSet=n;exports.fieldLegendVariants=m;
|
package/dist/field.d.ts
CHANGED
|
@@ -11,9 +11,15 @@ interface FieldLegendProps extends React.ComponentProps<"legend"> {
|
|
|
11
11
|
* @default "legend"
|
|
12
12
|
*/
|
|
13
13
|
variant?: "legend" | "label";
|
|
14
|
+
/**
|
|
15
|
+
* Visually hides the legend while keeping it in the accessibility tree,
|
|
16
|
+
* so the FieldSet group keeps its accessible name.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
srOnly?: boolean;
|
|
14
20
|
}
|
|
15
21
|
declare const fieldLegendVariants: FieldLegendProps["variant"][];
|
|
16
|
-
declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function FieldLegend({ className, variant, srOnly, ...props }: FieldLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
17
23
|
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
18
24
|
declare const fieldVariants: (props?: ({
|
|
19
25
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
@@ -45,6 +51,15 @@ interface FieldLabelProps extends LabelProps {
|
|
|
45
51
|
* Data hook for automated testing (REQUIRED)
|
|
46
52
|
*/
|
|
47
53
|
dataHook: string;
|
|
54
|
+
/**
|
|
55
|
+
* Visually hides the label while keeping it in the accessibility tree,
|
|
56
|
+
* preserving the label/input association via `htmlFor`.
|
|
57
|
+
* Use for placeholder-only or visually-compact field designs.
|
|
58
|
+
* Do not combine with `variant="box"` or RadioGroup fields — there the
|
|
59
|
+
* visible label provides the full-row click target.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
srOnly?: boolean;
|
|
48
63
|
}
|
|
49
64
|
declare function FieldLabel({ className, htmlFor, dataHook, ...props }: FieldLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
50
65
|
interface FieldDescriptionProps extends React.ComponentProps<"p"> {
|
package/dist/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGnE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE1E,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"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"}
|
package/dist/field.js
CHANGED
|
@@ -11,6 +11,9 @@ function m({ className: t, ...a }) {
|
|
|
11
11
|
className: r(
|
|
12
12
|
"flex flex-col gap-6",
|
|
13
13
|
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
14
|
+
// sr-only children (FieldLegend srOnly) are position:absolute — FieldSet
|
|
15
|
+
// must be their containing block (see components.md sr-only rule)
|
|
16
|
+
"has-[>.sr-only]:relative",
|
|
14
17
|
t
|
|
15
18
|
),
|
|
16
19
|
"data-slot": "field-set",
|
|
@@ -19,11 +22,12 @@ function m({ className: t, ...a }) {
|
|
|
19
22
|
);
|
|
20
23
|
}
|
|
21
24
|
m.displayName = "FieldSet";
|
|
22
|
-
const
|
|
25
|
+
const N = ["legend", "label"];
|
|
23
26
|
function F({
|
|
24
27
|
className: t,
|
|
25
28
|
variant: a = "legend",
|
|
26
|
-
|
|
29
|
+
srOnly: e = !1,
|
|
30
|
+
...d
|
|
27
31
|
}) {
|
|
28
32
|
return /* @__PURE__ */ l(
|
|
29
33
|
"legend",
|
|
@@ -32,11 +36,12 @@ function F({
|
|
|
32
36
|
"mb-3 font-medium",
|
|
33
37
|
"data-[variant=legend]:text-base",
|
|
34
38
|
"data-[variant=label]:text-sm",
|
|
39
|
+
e && "sr-only",
|
|
35
40
|
t
|
|
36
41
|
),
|
|
37
42
|
"data-slot": "field-legend",
|
|
38
43
|
"data-variant": a,
|
|
39
|
-
...
|
|
44
|
+
...d
|
|
40
45
|
}
|
|
41
46
|
);
|
|
42
47
|
}
|
|
@@ -63,7 +68,10 @@ const b = u(
|
|
|
63
68
|
// Checkbox context: match RadioGroup gap-3 spacing
|
|
64
69
|
"has-[>[role=checkbox]]:gap-3",
|
|
65
70
|
// Label leading overrides: use leading-normal for wrap-capable labels (checkbox)
|
|
66
|
-
"has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal"
|
|
71
|
+
"has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal",
|
|
72
|
+
// sr-only children are position:absolute — Field must be their containing
|
|
73
|
+
// block so they cannot escape scroll viewports (see components.md sr-only rule)
|
|
74
|
+
"has-[>.sr-only]:relative"
|
|
67
75
|
],
|
|
68
76
|
{
|
|
69
77
|
variants: {
|
|
@@ -72,12 +80,20 @@ const b = u(
|
|
|
72
80
|
horizontal: [
|
|
73
81
|
"grid grid-cols-[auto_1fr] items-center gap-x-2",
|
|
74
82
|
"[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",
|
|
75
|
-
"has-[>[data-slot=field-content]]:items-start"
|
|
83
|
+
"has-[>[data-slot=field-content]]:items-start",
|
|
84
|
+
// sr-only label leaves grid flow — collapse to a single column
|
|
85
|
+
"has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
|
|
86
|
+
"[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
|
|
87
|
+
"[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"
|
|
76
88
|
],
|
|
77
89
|
responsive: [
|
|
78
90
|
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
79
91
|
"@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2",
|
|
80
|
-
"@md/field-group:has-[>[data-slot=field-content]]:items-start"
|
|
92
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start",
|
|
93
|
+
// sr-only label leaves grid flow — collapse to a single column
|
|
94
|
+
"@md/field-group:has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
|
|
95
|
+
"@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
|
|
96
|
+
"@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"
|
|
81
97
|
]
|
|
82
98
|
},
|
|
83
99
|
variant: {
|
|
@@ -252,5 +268,5 @@ export {
|
|
|
252
268
|
I as FieldLabel,
|
|
253
269
|
F as FieldLegend,
|
|
254
270
|
m as FieldSet,
|
|
255
|
-
|
|
271
|
+
N as fieldLegendVariants
|
|
256
272
|
};
|
package/dist/global-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),G=require("react"),j=require("@brightlocal/icons"),c=require("@brightlocal/ui-components/lib/utils"),x=require("./header.cjs"),N=require("./link.cjs"),C=require("./scroll-area.cjs"),R=require("./typography.cjs");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=S(G),m=i.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:t,trackingEl:l,trackingLabel:o,children:n,...r},d)=>{const b=typeof a=="number"?`${a}px`:a;return s.jsx(C.ScrollArea,{className:c.cn("h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",e),dataHook:`${t}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:d,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":t,"data-slot":"global-layout","data-tracking-el":l,"data-tracking-label":o,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:b},children:n})})})});m.displayName="GlobalLayout";const H="224px",h=i.forwardRef(({className:e,width:a=H,dataHook:t,children:l,...o},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:c.cn("sticky hidden shrink-0 self-start outline-none lg:block",e),"data-hook":t,"data-slot":"sidebar-container",...o,style:{width:r,top:"var(--ds-section-padding-y-sm)",height:"calc(100dvh - 2 * var(--ds-section-padding-y-sm))",...o.style},children:l})});h.displayName="GlobalLayoutSidebar";const k=i.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:t,children:l,...o},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:c.cn("px-section-xs flex min-w-0 flex-1 flex-col gap-6",e),"data-hook":t,"data-slot":"content-wrapper",style:{"--content-max-width":r},...o,children:l})});k.displayName="GlobalLayoutContent";const y=i.forwardRef(({dataHook:e,ariaLabel:a,href:t,onClick:l,...o},n)=>{const r=d=>{t===void 0&&d.preventDefault(),l?.(d)};return s.jsx(N.Link,{ref:n,"aria-label":a||"Go back","data-slot":"content-header-back-link",dataHook:e??"content-header-back-link",href:t??"#",variant:"icon",onClick:r,...o,children:s.jsx(j.ArrowLeft,{"aria-hidden":"true"})})});y.displayName="GlobalLayoutBackLink";const f=i.forwardRef(({dataHook:e,...a},t)=>s.jsx(R.TypographyMuted,{ref:t,"data-slot":"content-header-subtitle",dataHook:e??"content-header-subtitle",...a}));f.displayName="GlobalLayoutSubtitle";const g=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>{const d=[],b=[],p=[];return i.Children.forEach(o,u=>{i.isValidElement(u)&&u.type===y?d.push(u):i.isValidElement(u)&&u.type===f?b.push(u):p.push(u)}),d.length===0&&b.length===0?s.jsx(x.Header,{ref:r,className:c.cn("mx-auto w-full flex-wrap justify-between gap-4",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:l,...n,children:o}):s.jsxs(x.Header,{ref:r,className:c.cn("mx-auto w-full items-start",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:l,...n,children:[d,s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-body",children:[s.jsx("div",{className:"flex w-full flex-wrap items-center justify-between gap-4","data-slot":"content-header-title",children:p}),b]})]})});g.displayName="GlobalLayoutContentHeader";const w=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>s.jsx("div",{ref:r,className:c.cn("mx-auto hidden w-full items-center justify-end gap-2 lg:flex",e),"data-hook":a,"data-slot":"content-actions","data-tracking-el":t,"data-tracking-label":l,style:{maxWidth:"var(--ds-breakpoint-lg)"},...n,children:o}));w.displayName="GlobalLayoutContentActions";const L=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>s.jsx("div",{ref:r,className:c.cn("mx-auto flex w-full flex-1 flex-col gap-6",e),"data-hook":a,"data-slot":"content-body","data-tracking-el":t,"data-tracking-label":l,style:{maxWidth:"var(--content-max-width)"},...n,children:o}));L.displayName="GlobalLayoutContentBody";const v=i.forwardRef(({className:e,dataHook:a,ariaLabel:t,trackingEl:l,trackingLabel:o,children:n,...r},d)=>s.jsx("div",{ref:d,"aria-label":t??"Mobile navigation",className:c.cn("flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",e),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":l,"data-tracking-label":o,role:"toolbar",...r,children:n}));v.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=m;exports.GlobalLayoutBackLink=y;exports.GlobalLayoutContent=k;exports.GlobalLayoutContentActions=w;exports.GlobalLayoutContentBody=L;exports.GlobalLayoutContentHeader=g;exports.GlobalLayoutMobileHeader=v;exports.GlobalLayoutSidebar=h;exports.GlobalLayoutSubtitle=f;
|
package/dist/global-layout.d.ts
CHANGED
|
@@ -42,6 +42,36 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
|
42
42
|
maxWidth?: string | number;
|
|
43
43
|
}
|
|
44
44
|
declare const GlobalLayoutContent: React.ForwardRefExoticComponent<Omit<GlobalLayoutContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
interface GlobalLayoutBackLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
46
|
+
/**
|
|
47
|
+
* Data hook for automated testing
|
|
48
|
+
* @default "content-header-back-link"
|
|
49
|
+
*/
|
|
50
|
+
dataHook?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible label for the icon-only back link.
|
|
53
|
+
* @default "Go back"
|
|
54
|
+
*/
|
|
55
|
+
ariaLabel?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Icon-only back link for the page header. Place it as a direct child of
|
|
59
|
+
* `GlobalLayoutContentHeader` — the header positions it before the title.
|
|
60
|
+
* Pass `href` for URL navigation or `onClick` for SPA router navigation.
|
|
61
|
+
*/
|
|
62
|
+
declare const GlobalLayoutBackLink: React.ForwardRefExoticComponent<GlobalLayoutBackLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
63
|
+
interface GlobalLayoutSubtitleProps extends React.ComponentProps<"p"> {
|
|
64
|
+
/**
|
|
65
|
+
* Data hook for automated testing
|
|
66
|
+
* @default "content-header-subtitle"
|
|
67
|
+
*/
|
|
68
|
+
dataHook?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Muted description text for the page header. Place it as a direct child of
|
|
72
|
+
* `GlobalLayoutContentHeader` — the header positions it below the title row.
|
|
73
|
+
*/
|
|
74
|
+
declare const GlobalLayoutSubtitle: React.ForwardRefExoticComponent<Omit<GlobalLayoutSubtitleProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
45
75
|
interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header"> {
|
|
46
76
|
/**
|
|
47
77
|
* Data hook for automated testing (required)
|
|
@@ -107,6 +137,6 @@ interface GlobalLayoutMobileHeaderProps extends React.ComponentProps<"div"> {
|
|
|
107
137
|
trackingLabel?: string;
|
|
108
138
|
}
|
|
109
139
|
declare const GlobalLayoutMobileHeader: React.ForwardRefExoticComponent<Omit<GlobalLayoutMobileHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
-
export { GlobalLayout, GlobalLayoutSidebar, GlobalLayoutContent, GlobalLayoutContentActions, GlobalLayoutContentHeader, GlobalLayoutContentBody, GlobalLayoutMobileHeader, };
|
|
111
|
-
export type { GlobalLayoutProps, GlobalLayoutSidebarProps, GlobalLayoutContentProps, GlobalLayoutContentActionsProps, GlobalLayoutContentHeaderProps, GlobalLayoutContentBodyProps, GlobalLayoutMobileHeaderProps, };
|
|
140
|
+
export { GlobalLayout, GlobalLayoutSidebar, GlobalLayoutContent, GlobalLayoutContentActions, GlobalLayoutContentHeader, GlobalLayoutBackLink, GlobalLayoutSubtitle, GlobalLayoutContentBody, GlobalLayoutMobileHeader, };
|
|
141
|
+
export type { GlobalLayoutProps, GlobalLayoutSidebarProps, GlobalLayoutContentProps, GlobalLayoutContentActionsProps, GlobalLayoutContentHeaderProps, GlobalLayoutBackLinkProps, GlobalLayoutSubtitleProps, GlobalLayoutContentBodyProps, GlobalLayoutMobileHeaderProps, };
|
|
112
142
|
//# sourceMappingURL=global-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"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"}
|
package/dist/global-layout.js
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { ArrowLeft as x } from "@brightlocal/icons";
|
|
4
|
+
import { cn as c } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { Header as y } from "./header.js";
|
|
6
|
+
import { Link as k } from "./link.js";
|
|
7
|
+
import { ScrollArea as w } from "./scroll-area.js";
|
|
8
|
+
import { TypographyMuted as g } from "./typography.js";
|
|
9
|
+
const v = i.forwardRef(
|
|
7
10
|
({
|
|
8
|
-
className:
|
|
11
|
+
className: e,
|
|
9
12
|
maxWidth: a = "var(--ds-breakpoint-xl)",
|
|
10
13
|
dataHook: t,
|
|
11
|
-
trackingEl:
|
|
12
|
-
trackingLabel:
|
|
13
|
-
children:
|
|
14
|
-
...
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
14
|
+
trackingEl: o,
|
|
15
|
+
trackingLabel: l,
|
|
16
|
+
children: n,
|
|
17
|
+
...r
|
|
18
|
+
}, d) => {
|
|
19
|
+
const u = typeof a == "number" ? `${a}px` : a;
|
|
20
|
+
return /* @__PURE__ */ s(
|
|
21
|
+
w,
|
|
19
22
|
{
|
|
20
|
-
className:
|
|
23
|
+
className: c(
|
|
21
24
|
"h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
|
|
22
|
-
|
|
25
|
+
e
|
|
23
26
|
),
|
|
24
27
|
dataHook: `${t}-scroll`,
|
|
25
28
|
scrollOrientation: "both",
|
|
26
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ s(
|
|
27
30
|
"div",
|
|
28
31
|
{
|
|
29
|
-
ref:
|
|
32
|
+
ref: d,
|
|
30
33
|
className: "p-section-sm flex min-h-dvh w-full flex-col",
|
|
31
34
|
"data-hook": t,
|
|
32
35
|
"data-slot": "global-layout",
|
|
33
|
-
"data-tracking-el":
|
|
34
|
-
"data-tracking-label":
|
|
35
|
-
...
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
"data-tracking-el": o,
|
|
37
|
+
"data-tracking-label": l,
|
|
38
|
+
...r,
|
|
39
|
+
children: /* @__PURE__ */ s(
|
|
37
40
|
"div",
|
|
38
41
|
{
|
|
39
42
|
className: "mx-auto flex w-full flex-1",
|
|
40
43
|
"data-slot": "global-container",
|
|
41
|
-
style: { maxWidth:
|
|
42
|
-
children:
|
|
44
|
+
style: { maxWidth: u },
|
|
45
|
+
children: n
|
|
43
46
|
}
|
|
44
47
|
)
|
|
45
48
|
}
|
|
@@ -48,150 +51,217 @@ const b = s.forwardRef(
|
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
);
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
v.displayName = "GlobalLayout";
|
|
55
|
+
const L = "224px", N = i.forwardRef(({ className: e, width: a = L, dataHook: t, children: o, ...l }, n) => {
|
|
56
|
+
const r = typeof a == "number" ? `${a}px` : a;
|
|
57
|
+
return /* @__PURE__ */ s(
|
|
55
58
|
"aside",
|
|
56
59
|
{
|
|
57
|
-
ref:
|
|
58
|
-
className:
|
|
60
|
+
ref: n,
|
|
61
|
+
className: c(
|
|
59
62
|
"sticky hidden shrink-0 self-start outline-none lg:block",
|
|
60
|
-
|
|
63
|
+
e
|
|
61
64
|
),
|
|
62
65
|
"data-hook": t,
|
|
63
66
|
"data-slot": "sidebar-container",
|
|
64
|
-
...
|
|
67
|
+
...l,
|
|
65
68
|
style: {
|
|
66
|
-
width:
|
|
69
|
+
width: r,
|
|
67
70
|
top: "var(--ds-section-padding-y-sm)",
|
|
68
71
|
height: "calc(100dvh - 2 * var(--ds-section-padding-y-sm))",
|
|
69
|
-
...
|
|
72
|
+
...l.style
|
|
70
73
|
},
|
|
71
|
-
children:
|
|
74
|
+
children: o
|
|
72
75
|
}
|
|
73
76
|
);
|
|
74
77
|
});
|
|
75
|
-
|
|
76
|
-
const
|
|
78
|
+
N.displayName = "GlobalLayoutSidebar";
|
|
79
|
+
const G = i.forwardRef(
|
|
77
80
|
({
|
|
78
|
-
className:
|
|
81
|
+
className: e,
|
|
79
82
|
maxWidth: a = "var(--ds-breakpoint-lg)",
|
|
80
83
|
dataHook: t,
|
|
81
|
-
children:
|
|
82
|
-
...
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
return /* @__PURE__ */
|
|
84
|
+
children: o,
|
|
85
|
+
...l
|
|
86
|
+
}, n) => {
|
|
87
|
+
const r = typeof a == "number" ? `${a}px` : a;
|
|
88
|
+
return /* @__PURE__ */ s(
|
|
86
89
|
"div",
|
|
87
90
|
{
|
|
88
|
-
ref:
|
|
89
|
-
className:
|
|
91
|
+
ref: n,
|
|
92
|
+
className: c(
|
|
90
93
|
"px-section-xs flex min-w-0 flex-1 flex-col gap-6",
|
|
91
|
-
|
|
94
|
+
e
|
|
92
95
|
),
|
|
93
96
|
"data-hook": t,
|
|
94
97
|
"data-slot": "content-wrapper",
|
|
95
|
-
style: { "--content-max-width":
|
|
96
|
-
...
|
|
97
|
-
children:
|
|
98
|
+
style: { "--content-max-width": r },
|
|
99
|
+
...l,
|
|
100
|
+
children: o
|
|
98
101
|
}
|
|
99
102
|
);
|
|
100
103
|
}
|
|
101
104
|
);
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
G.displayName = "GlobalLayoutContent";
|
|
106
|
+
const p = i.forwardRef(({ dataHook: e, ariaLabel: a, href: t, onClick: o, ...l }, n) => /* @__PURE__ */ s(
|
|
107
|
+
k,
|
|
108
|
+
{
|
|
109
|
+
ref: n,
|
|
110
|
+
"aria-label": a || "Go back",
|
|
111
|
+
"data-slot": "content-header-back-link",
|
|
112
|
+
dataHook: e ?? "content-header-back-link",
|
|
113
|
+
href: t ?? "#",
|
|
114
|
+
variant: "icon",
|
|
115
|
+
onClick: (d) => {
|
|
116
|
+
t === void 0 && d.preventDefault(), o?.(d);
|
|
117
|
+
},
|
|
118
|
+
...l,
|
|
119
|
+
children: /* @__PURE__ */ s(x, { "aria-hidden": "true" })
|
|
120
|
+
}
|
|
121
|
+
));
|
|
122
|
+
p.displayName = "GlobalLayoutBackLink";
|
|
123
|
+
const h = i.forwardRef(({ dataHook: e, ...a }, t) => /* @__PURE__ */ s(
|
|
124
|
+
g,
|
|
125
|
+
{
|
|
126
|
+
ref: t,
|
|
127
|
+
"data-slot": "content-header-subtitle",
|
|
128
|
+
dataHook: e ?? "content-header-subtitle",
|
|
129
|
+
...a
|
|
130
|
+
}
|
|
131
|
+
));
|
|
132
|
+
h.displayName = "GlobalLayoutSubtitle";
|
|
133
|
+
const C = i.forwardRef(
|
|
134
|
+
({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => {
|
|
135
|
+
const d = [], u = [], m = [];
|
|
136
|
+
return i.Children.forEach(l, (f) => {
|
|
137
|
+
i.isValidElement(f) && f.type === p ? d.push(f) : i.isValidElement(f) && f.type === h ? u.push(f) : m.push(f);
|
|
138
|
+
}), d.length === 0 && u.length === 0 ? /* @__PURE__ */ s(
|
|
139
|
+
y,
|
|
140
|
+
{
|
|
141
|
+
ref: r,
|
|
142
|
+
className: c(
|
|
143
|
+
"mx-auto w-full flex-wrap justify-between gap-4",
|
|
144
|
+
e
|
|
145
|
+
),
|
|
146
|
+
"data-slot": "content-header",
|
|
147
|
+
dataHook: a,
|
|
148
|
+
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
149
|
+
trackingEl: t,
|
|
150
|
+
trackingLabel: o,
|
|
151
|
+
...n,
|
|
152
|
+
children: l
|
|
153
|
+
}
|
|
154
|
+
) : /* @__PURE__ */ b(
|
|
155
|
+
y,
|
|
156
|
+
{
|
|
157
|
+
ref: r,
|
|
158
|
+
className: c("mx-auto w-full items-start", e),
|
|
159
|
+
"data-slot": "content-header",
|
|
160
|
+
dataHook: a,
|
|
161
|
+
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
162
|
+
trackingEl: t,
|
|
163
|
+
trackingLabel: o,
|
|
164
|
+
...n,
|
|
165
|
+
children: [
|
|
166
|
+
d,
|
|
167
|
+
/* @__PURE__ */ b(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
171
|
+
"data-slot": "content-header-body",
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ s(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: "flex w-full flex-wrap items-center justify-between gap-4",
|
|
177
|
+
"data-slot": "content-header-title",
|
|
178
|
+
children: m
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
u
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
121
189
|
);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
({ className:
|
|
190
|
+
C.displayName = "GlobalLayoutContentHeader";
|
|
191
|
+
const R = i.forwardRef(
|
|
192
|
+
({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => /* @__PURE__ */ s(
|
|
125
193
|
"div",
|
|
126
194
|
{
|
|
127
|
-
ref:
|
|
128
|
-
className:
|
|
195
|
+
ref: r,
|
|
196
|
+
className: c(
|
|
129
197
|
"mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
|
|
130
|
-
|
|
198
|
+
e
|
|
131
199
|
),
|
|
132
200
|
"data-hook": a,
|
|
133
201
|
"data-slot": "content-actions",
|
|
134
202
|
"data-tracking-el": t,
|
|
135
|
-
"data-tracking-label":
|
|
203
|
+
"data-tracking-label": o,
|
|
136
204
|
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
137
|
-
...
|
|
138
|
-
children:
|
|
205
|
+
...n,
|
|
206
|
+
children: l
|
|
139
207
|
}
|
|
140
208
|
)
|
|
141
209
|
);
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
({ className:
|
|
210
|
+
R.displayName = "GlobalLayoutContentActions";
|
|
211
|
+
const H = i.forwardRef(
|
|
212
|
+
({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => /* @__PURE__ */ s(
|
|
145
213
|
"div",
|
|
146
214
|
{
|
|
147
|
-
ref:
|
|
148
|
-
className:
|
|
215
|
+
ref: r,
|
|
216
|
+
className: c("mx-auto flex w-full flex-1 flex-col gap-6", e),
|
|
149
217
|
"data-hook": a,
|
|
150
218
|
"data-slot": "content-body",
|
|
151
219
|
"data-tracking-el": t,
|
|
152
|
-
"data-tracking-label":
|
|
220
|
+
"data-tracking-label": o,
|
|
153
221
|
style: { maxWidth: "var(--content-max-width)" },
|
|
154
|
-
...
|
|
155
|
-
children:
|
|
222
|
+
...n,
|
|
223
|
+
children: l
|
|
156
224
|
}
|
|
157
225
|
)
|
|
158
226
|
);
|
|
159
|
-
|
|
160
|
-
const
|
|
227
|
+
H.displayName = "GlobalLayoutContentBody";
|
|
228
|
+
const S = i.forwardRef(
|
|
161
229
|
({
|
|
162
|
-
className:
|
|
230
|
+
className: e,
|
|
163
231
|
dataHook: a,
|
|
164
232
|
ariaLabel: t,
|
|
165
|
-
trackingEl:
|
|
166
|
-
trackingLabel:
|
|
167
|
-
children:
|
|
168
|
-
...
|
|
169
|
-
},
|
|
233
|
+
trackingEl: o,
|
|
234
|
+
trackingLabel: l,
|
|
235
|
+
children: n,
|
|
236
|
+
...r
|
|
237
|
+
}, d) => /* @__PURE__ */ s(
|
|
170
238
|
"div",
|
|
171
239
|
{
|
|
172
|
-
ref:
|
|
240
|
+
ref: d,
|
|
173
241
|
"aria-label": t ?? "Mobile navigation",
|
|
174
|
-
className:
|
|
242
|
+
className: c(
|
|
175
243
|
"flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
|
|
176
|
-
|
|
244
|
+
e
|
|
177
245
|
),
|
|
178
246
|
"data-hook": a,
|
|
179
247
|
"data-slot": "mobile-header",
|
|
180
|
-
"data-tracking-el":
|
|
181
|
-
"data-tracking-label":
|
|
248
|
+
"data-tracking-el": o,
|
|
249
|
+
"data-tracking-label": l,
|
|
182
250
|
role: "toolbar",
|
|
183
|
-
...
|
|
184
|
-
children:
|
|
251
|
+
...r,
|
|
252
|
+
children: n
|
|
185
253
|
}
|
|
186
254
|
)
|
|
187
255
|
);
|
|
188
|
-
|
|
256
|
+
S.displayName = "GlobalLayoutMobileHeader";
|
|
189
257
|
export {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
258
|
+
v as GlobalLayout,
|
|
259
|
+
p as GlobalLayoutBackLink,
|
|
260
|
+
G as GlobalLayoutContent,
|
|
261
|
+
R as GlobalLayoutContentActions,
|
|
262
|
+
H as GlobalLayoutContentBody,
|
|
263
|
+
C as GlobalLayoutContentHeader,
|
|
264
|
+
S as GlobalLayoutMobileHeader,
|
|
265
|
+
N as GlobalLayoutSidebar,
|
|
266
|
+
h as GlobalLayoutSubtitle
|
|
197
267
|
};
|