@brightlocal/ui-components 2.9.0 → 2.9.2
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/component-meta.json
CHANGED
package/dist/global-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),d=require("@brightlocal/ui-components/lib/utils"),h=require("./header.cjs"),k=require("./scroll-area.cjs");function w(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=w(g),i=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:t,trackingEl:o,trackingLabel:l,children:n,...r},x)=>{const p=typeof a=="number"?`${a}px`:a;return s.jsx(k.ScrollArea,{className:d.cn("h-dvh w-full",e),dataHook:`${t}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:x,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":t,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":l,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:p},children:n})})})});i.displayName="GlobalLayout";const G="224px",u=c.forwardRef(({className:e,width:a=G,dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:d.cn("sticky hidden shrink-0 self-start outline-none lg:block",e),"data-hook":t,"data-slot":"sidebar-container",style:{width:r,top:"var(--ds-section-padding-y-sm)"},...l,children:o})});u.displayName="GlobalLayoutSidebar";const b=c.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:t,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:d.cn("px-section-xs flex min-w-0 flex-1 flex-col",e),"data-hook":t,"data-slot":"content-wrapper",style:{"--content-max-width":r},...l,children:o})});b.displayName="GlobalLayoutContent";const y=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx(h.Header,{ref:r,className:d.cn("mx-auto w-full justify-between",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:o,...n,children:l}));y.displayName="GlobalLayoutContentHeader";const f=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,className:d.cn("mx-auto mt-6 flex w-full flex-1 flex-col gap-6",e),"data-hook":a,"data-slot":"content-body","data-tracking-el":t,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...n,children:l}));f.displayName="GlobalLayoutContentBody";const m=c.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,"aria-label":"Mobile navigation",className:d.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":t,"data-tracking-label":o,role:"toolbar",...n,children:l}));m.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=i;exports.GlobalLayoutContent=b;exports.GlobalLayoutContentBody=f;exports.GlobalLayoutContentHeader=y;exports.GlobalLayoutMobileHeader=m;exports.GlobalLayoutSidebar=u;
|
package/dist/global-layout.d.ts
CHANGED
|
@@ -40,10 +40,6 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
|
40
40
|
* @default breakpoint.lg
|
|
41
41
|
*/
|
|
42
42
|
maxWidth?: string | number;
|
|
43
|
-
/**
|
|
44
|
-
* Custom padding for the content wrapper
|
|
45
|
-
*/
|
|
46
|
-
padding?: string;
|
|
47
43
|
}
|
|
48
44
|
declare const GlobalLayoutContent: React.ForwardRefExoticComponent<Omit<GlobalLayoutContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
49
45
|
interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header"> {
|
|
@@ -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;AAM/B,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC7D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,YAAY,uGA0CjB,CAAC;AAMF,UAAU,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IACtE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,mBAAmB,2GAwBvB,CAAC;AAIH,UAAU,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC7D;;OAEG;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,CAAC,KAAK,CAAC;IACzE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,wBAAwB,mHA2B7B,CAAC;AAIF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GACzB,CAAC;AAEF,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,GAC9B,CAAC"}
|
package/dist/global-layout.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as d from "react";
|
|
|
3
3
|
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
4
4
|
import { Header as m } from "./header.js";
|
|
5
5
|
import { ScrollArea as b } from "./scroll-area.js";
|
|
6
|
-
const
|
|
6
|
+
const y = d.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
className: o,
|
|
9
9
|
maxWidth: a = "var(--ds-breakpoint-xl)",
|
|
@@ -24,7 +24,7 @@ const p = d.forwardRef(
|
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
26
|
ref: c,
|
|
27
|
-
className: "
|
|
27
|
+
className: "p-section-sm flex min-h-dvh w-full flex-col",
|
|
28
28
|
"data-hook": t,
|
|
29
29
|
"data-slot": "global-layout",
|
|
30
30
|
"data-tracking-el": e,
|
|
@@ -45,8 +45,8 @@ const p = d.forwardRef(
|
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
|
|
49
|
-
const
|
|
48
|
+
y.displayName = "GlobalLayout";
|
|
49
|
+
const u = "224px", p = d.forwardRef(({ className: o, width: a = u, dataHook: t, children: e, ...l }, r) => {
|
|
50
50
|
const n = typeof a == "number" ? `${a}px` : a;
|
|
51
51
|
return /* @__PURE__ */ s(
|
|
52
52
|
"aside",
|
|
@@ -67,30 +67,26 @@ const y = "224px", u = d.forwardRef(({ className: o, width: a = y, dataHook: t,
|
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
p.displayName = "GlobalLayoutSidebar";
|
|
71
71
|
const x = d.forwardRef(
|
|
72
72
|
({
|
|
73
73
|
className: o,
|
|
74
74
|
maxWidth: a = "var(--ds-breakpoint-lg)",
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const c = typeof a == "number" ? `${a}px` : a;
|
|
75
|
+
dataHook: t,
|
|
76
|
+
children: e,
|
|
77
|
+
...l
|
|
78
|
+
}, r) => {
|
|
79
|
+
const n = typeof a == "number" ? `${a}px` : a;
|
|
81
80
|
return /* @__PURE__ */ s(
|
|
82
81
|
"div",
|
|
83
82
|
{
|
|
84
|
-
ref:
|
|
85
|
-
className: i("
|
|
86
|
-
"data-hook":
|
|
83
|
+
ref: r,
|
|
84
|
+
className: i("px-section-xs flex min-w-0 flex-1 flex-col", o),
|
|
85
|
+
"data-hook": t,
|
|
87
86
|
"data-slot": "content-wrapper",
|
|
88
|
-
style: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
...r,
|
|
93
|
-
children: l
|
|
87
|
+
style: { "--content-max-width": n },
|
|
88
|
+
...l,
|
|
89
|
+
children: e
|
|
94
90
|
}
|
|
95
91
|
);
|
|
96
92
|
}
|
|
@@ -101,9 +97,10 @@ const h = d.forwardRef(
|
|
|
101
97
|
m,
|
|
102
98
|
{
|
|
103
99
|
ref: n,
|
|
104
|
-
className: i("
|
|
100
|
+
className: i("mx-auto w-full justify-between", o),
|
|
105
101
|
"data-slot": "content-header",
|
|
106
102
|
dataHook: a,
|
|
103
|
+
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
107
104
|
trackingEl: t,
|
|
108
105
|
trackingLabel: e,
|
|
109
106
|
...r,
|
|
@@ -112,13 +109,13 @@ const h = d.forwardRef(
|
|
|
112
109
|
)
|
|
113
110
|
);
|
|
114
111
|
h.displayName = "GlobalLayoutContentHeader";
|
|
115
|
-
const
|
|
112
|
+
const k = d.forwardRef(
|
|
116
113
|
({ className: o, dataHook: a, trackingEl: t, trackingLabel: e, children: l, ...r }, n) => /* @__PURE__ */ s(
|
|
117
114
|
"div",
|
|
118
115
|
{
|
|
119
116
|
ref: n,
|
|
120
117
|
className: i(
|
|
121
|
-
"
|
|
118
|
+
"mx-auto mt-6 flex w-full flex-1 flex-col gap-6",
|
|
122
119
|
o
|
|
123
120
|
),
|
|
124
121
|
"data-hook": a,
|
|
@@ -131,15 +128,15 @@ const g = d.forwardRef(
|
|
|
131
128
|
}
|
|
132
129
|
)
|
|
133
130
|
);
|
|
134
|
-
|
|
135
|
-
const
|
|
131
|
+
k.displayName = "GlobalLayoutContentBody";
|
|
132
|
+
const w = d.forwardRef(
|
|
136
133
|
({ className: o, dataHook: a, trackingEl: t, trackingLabel: e, children: l, ...r }, n) => /* @__PURE__ */ s(
|
|
137
134
|
"div",
|
|
138
135
|
{
|
|
139
136
|
ref: n,
|
|
140
137
|
"aria-label": "Mobile navigation",
|
|
141
138
|
className: i(
|
|
142
|
-
"
|
|
139
|
+
"flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
|
|
143
140
|
o
|
|
144
141
|
),
|
|
145
142
|
"data-hook": a,
|
|
@@ -152,12 +149,12 @@ const k = d.forwardRef(
|
|
|
152
149
|
}
|
|
153
150
|
)
|
|
154
151
|
);
|
|
155
|
-
|
|
152
|
+
w.displayName = "GlobalLayoutMobileHeader";
|
|
156
153
|
export {
|
|
157
|
-
|
|
154
|
+
y as GlobalLayout,
|
|
158
155
|
x as GlobalLayoutContent,
|
|
159
|
-
|
|
156
|
+
k as GlobalLayoutContentBody,
|
|
160
157
|
h as GlobalLayoutContentHeader,
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
w as GlobalLayoutMobileHeader,
|
|
159
|
+
p as GlobalLayoutSidebar
|
|
163
160
|
};
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ const GlobalLayout = React.forwardRef<HTMLDivElement, GlobalLayoutProps>(
|
|
|
48
48
|
>
|
|
49
49
|
<div
|
|
50
50
|
ref={ref}
|
|
51
|
-
className="
|
|
51
|
+
className="p-section-sm flex min-h-dvh w-full flex-col"
|
|
52
52
|
data-hook={dataHook}
|
|
53
53
|
data-slot="global-layout"
|
|
54
54
|
data-tracking-el={trackingEl}
|
|
@@ -121,10 +121,6 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
|
121
121
|
* @default breakpoint.lg
|
|
122
122
|
*/
|
|
123
123
|
maxWidth?: string | number;
|
|
124
|
-
/**
|
|
125
|
-
* Custom padding for the content wrapper
|
|
126
|
-
*/
|
|
127
|
-
padding?: string;
|
|
128
124
|
}
|
|
129
125
|
|
|
130
126
|
const GlobalLayoutContent = React.forwardRef<
|
|
@@ -135,7 +131,6 @@ const GlobalLayoutContent = React.forwardRef<
|
|
|
135
131
|
{
|
|
136
132
|
className,
|
|
137
133
|
maxWidth = "var(--ds-breakpoint-lg)",
|
|
138
|
-
padding,
|
|
139
134
|
dataHook,
|
|
140
135
|
children,
|
|
141
136
|
...props
|
|
@@ -148,14 +143,11 @@ const GlobalLayoutContent = React.forwardRef<
|
|
|
148
143
|
return (
|
|
149
144
|
<div
|
|
150
145
|
ref={ref}
|
|
151
|
-
className={cn("
|
|
146
|
+
className={cn("px-section-xs flex min-w-0 flex-1 flex-col", className)}
|
|
152
147
|
data-hook={dataHook}
|
|
153
148
|
data-slot="content-wrapper"
|
|
154
149
|
style={
|
|
155
|
-
{
|
|
156
|
-
"--content-max-width": resolvedMaxWidth,
|
|
157
|
-
padding,
|
|
158
|
-
} as React.CSSProperties
|
|
150
|
+
{ "--content-max-width": resolvedMaxWidth } as React.CSSProperties
|
|
159
151
|
}
|
|
160
152
|
{...props}
|
|
161
153
|
>
|
|
@@ -193,9 +185,10 @@ const GlobalLayoutContentHeader = React.forwardRef<
|
|
|
193
185
|
return (
|
|
194
186
|
<Header
|
|
195
187
|
ref={ref}
|
|
196
|
-
className={cn("
|
|
188
|
+
className={cn("mx-auto w-full justify-between", className)}
|
|
197
189
|
data-slot="content-header"
|
|
198
190
|
dataHook={dataHook}
|
|
191
|
+
style={{ maxWidth: "var(--ds-breakpoint-lg)" }}
|
|
199
192
|
trackingEl={trackingEl}
|
|
200
193
|
trackingLabel={trackingLabel}
|
|
201
194
|
{...props}
|
|
@@ -235,7 +228,7 @@ const GlobalLayoutContentBody = React.forwardRef<
|
|
|
235
228
|
<div
|
|
236
229
|
ref={ref}
|
|
237
230
|
className={cn(
|
|
238
|
-
"
|
|
231
|
+
"mx-auto mt-6 flex w-full flex-1 flex-col gap-6",
|
|
239
232
|
className
|
|
240
233
|
)}
|
|
241
234
|
data-hook={dataHook}
|
|
@@ -281,7 +274,7 @@ const GlobalLayoutMobileHeader = React.forwardRef<
|
|
|
281
274
|
ref={ref}
|
|
282
275
|
aria-label="Mobile navigation"
|
|
283
276
|
className={cn(
|
|
284
|
-
"
|
|
277
|
+
"flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
|
|
285
278
|
className
|
|
286
279
|
)}
|
|
287
280
|
data-hook={dataHook}
|