@brightlocal/ui-components 0.1.2 → 0.1.3
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/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +177 -170
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -0
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
package/dist/field.js
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cva as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cva as i } from "class-variance-authority";
|
|
3
3
|
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { Description as r } from "./description.js";
|
|
5
|
+
import { Label as s } from "@brightlocal/ui-components/label";
|
|
6
|
+
function g({ className: e, ...a }) {
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
7
8
|
"fieldset",
|
|
8
9
|
{
|
|
9
10
|
className: l(
|
|
10
11
|
"flex flex-col gap-6",
|
|
11
12
|
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
12
|
-
|
|
13
|
+
e
|
|
13
14
|
),
|
|
14
15
|
"data-slot": "field-set",
|
|
15
|
-
...
|
|
16
|
+
...a
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const x = ["legend", "label"];
|
|
21
|
+
function h({
|
|
22
|
+
className: e,
|
|
23
|
+
variant: a = "legend",
|
|
22
24
|
...o
|
|
23
25
|
}) {
|
|
24
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ t(
|
|
25
27
|
"legend",
|
|
26
28
|
{
|
|
27
29
|
className: l(
|
|
28
30
|
"mb-3 font-medium",
|
|
29
31
|
"data-[variant=legend]:text-base",
|
|
30
32
|
"data-[variant=label]:text-sm",
|
|
31
|
-
|
|
33
|
+
e
|
|
32
34
|
),
|
|
33
35
|
"data-slot": "field-legend",
|
|
34
|
-
"data-variant":
|
|
36
|
+
"data-variant": a,
|
|
35
37
|
...o
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
40
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
function b({ className: e, ...a }) {
|
|
42
|
+
return /* @__PURE__ */ t(
|
|
41
43
|
"div",
|
|
42
44
|
{
|
|
43
45
|
className: l(
|
|
44
46
|
"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",
|
|
45
|
-
|
|
47
|
+
e
|
|
46
48
|
),
|
|
47
49
|
"data-slot": "field-group",
|
|
48
|
-
...
|
|
50
|
+
...a
|
|
49
51
|
}
|
|
50
52
|
);
|
|
51
53
|
}
|
|
52
|
-
const
|
|
54
|
+
const n = i("group/field flex w-full gap-2", {
|
|
53
55
|
variants: {
|
|
54
56
|
orientation: {
|
|
55
57
|
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
@@ -69,42 +71,40 @@ const i = d("group/field flex w-full gap-2", {
|
|
|
69
71
|
orientation: "vertical"
|
|
70
72
|
}
|
|
71
73
|
});
|
|
72
|
-
function
|
|
73
|
-
className:
|
|
74
|
-
orientation:
|
|
75
|
-
|
|
74
|
+
function v({
|
|
75
|
+
className: e,
|
|
76
|
+
orientation: a = "vertical",
|
|
77
|
+
dataHook: o,
|
|
78
|
+
...d
|
|
76
79
|
}) {
|
|
77
|
-
return /* @__PURE__ */
|
|
80
|
+
return /* @__PURE__ */ t(
|
|
78
81
|
"div",
|
|
79
82
|
{
|
|
80
|
-
className: l(
|
|
81
|
-
"data-
|
|
83
|
+
className: l(n({ orientation: a }), e),
|
|
84
|
+
"data-hook": o,
|
|
85
|
+
"data-orientation": a,
|
|
82
86
|
"data-slot": "field",
|
|
83
87
|
role: "group",
|
|
84
|
-
...
|
|
88
|
+
...d
|
|
85
89
|
}
|
|
86
90
|
);
|
|
87
91
|
}
|
|
88
|
-
function
|
|
89
|
-
return /* @__PURE__ */
|
|
92
|
+
function w({ className: e, ...a }) {
|
|
93
|
+
return /* @__PURE__ */ t(
|
|
90
94
|
"div",
|
|
91
95
|
{
|
|
92
96
|
className: l(
|
|
93
97
|
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
94
|
-
|
|
98
|
+
e
|
|
95
99
|
),
|
|
96
100
|
"data-slot": "field-content",
|
|
97
|
-
...
|
|
101
|
+
...a
|
|
98
102
|
}
|
|
99
103
|
);
|
|
100
104
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
...o
|
|
105
|
-
}) {
|
|
106
|
-
return /* @__PURE__ */ a(
|
|
107
|
-
r,
|
|
105
|
+
function k({ className: e, htmlFor: a, ...o }) {
|
|
106
|
+
return /* @__PURE__ */ t(
|
|
107
|
+
s,
|
|
108
108
|
{
|
|
109
109
|
className: l(
|
|
110
110
|
// Base label styles from primitives are inherited via Label component
|
|
@@ -113,36 +113,37 @@ function h({
|
|
|
113
113
|
"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",
|
|
114
114
|
// Checked state styles for radio/checkbox fields
|
|
115
115
|
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
116
|
-
|
|
116
|
+
e
|
|
117
117
|
),
|
|
118
118
|
"data-slot": "field-label",
|
|
119
|
-
htmlFor:
|
|
119
|
+
htmlFor: a,
|
|
120
120
|
...o
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
|
|
124
|
+
function F({ className: e, ...a }) {
|
|
125
|
+
return /* @__PURE__ */ t(
|
|
126
|
+
r,
|
|
127
127
|
{
|
|
128
128
|
className: l(
|
|
129
|
-
|
|
129
|
+
// Field-specific positioning and context styles
|
|
130
|
+
"mt-2",
|
|
130
131
|
"group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
131
132
|
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
132
|
-
|
|
133
|
-
t
|
|
133
|
+
e
|
|
134
134
|
),
|
|
135
135
|
"data-slot": "field-description",
|
|
136
|
-
...
|
|
136
|
+
...a
|
|
137
137
|
}
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
v as Field,
|
|
142
|
+
w as FieldContent,
|
|
143
|
+
F as FieldDescription,
|
|
144
|
+
b as FieldGroup,
|
|
145
|
+
k as FieldLabel,
|
|
146
|
+
h as FieldLegend,
|
|
147
|
+
g as FieldSet,
|
|
148
|
+
x as fieldLegendVariants
|
|
148
149
|
};
|
package/dist/global-layout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),y=require("react"),c=require("@brightlocal/ui-components/lib/utils");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const d=p(y),x="1280px",u=d.forwardRef(({className:e,maxWidth:t=x,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>{const m=typeof t=="number"?`${t}px`:t;return r.jsx("div",{ref:i,className:c.cn("flex min-h-screen w-full flex-col px-4 md:px-6",e),"data-hook":a,"data-slot":"global-layout","data-tracking-el":l,"data-tracking-label":o,...s,children:r.jsx("div",{className:"mx-auto flex w-full flex-1 gap-4 md:gap-6","data-slot":"global-container",style:{maxWidth:m},children:n})})});u.displayName="GlobalLayout";const g="256px",f=d.forwardRef(({className:e,width:t=g,dataHook:a,children:l,...o},n)=>{const s=typeof t=="number"?`${t}px`:t;return r.jsx("aside",{ref:n,className:c.cn("hidden shrink-0 self-stretch lg:block",e),"data-hook":a,"data-slot":"sidebar-container",style:{width:s},...o,children:l})});f.displayName="GlobalLayoutSidebar";const b=d.forwardRef(({className:e,variant:t="full",padding:a,dataHook:l,children:o,...n},s)=>{const i={full:"100%",md:"768px",sm:"374px"};return r.jsx("div",{ref:s,className:c.cn("flex min-h-0 min-w-0 flex-1 self-stretch",e),"data-hook":l,"data-slot":"content-wrapper",...n,children:r.jsx("div",{className:c.cn("mx-auto w-full"),"data-slot":"content-container",style:{maxWidth:i[t],padding:a},children:o})})});b.displayName="GlobalLayoutContent";exports.GlobalLayout=u;exports.GlobalLayoutContent=b;exports.GlobalLayoutSidebar=f;
|
package/dist/global-layout.d.ts
CHANGED
|
@@ -11,37 +11,47 @@ import * as React from "react";
|
|
|
11
11
|
* @see https://ui.shadcn.com/docs/components/sidebar for sidebar patterns
|
|
12
12
|
*/
|
|
13
13
|
interface GlobalLayoutProps extends React.ComponentProps<"div"> {
|
|
14
|
+
/**
|
|
15
|
+
* Data hook for automated testing (required)
|
|
16
|
+
*/
|
|
17
|
+
dataHook: string;
|
|
18
|
+
/**
|
|
19
|
+
* Tracking element identifier for analytics
|
|
20
|
+
*/
|
|
21
|
+
trackingEl?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Tracking label for analytics context
|
|
24
|
+
*/
|
|
25
|
+
trackingLabel?: string;
|
|
14
26
|
/**
|
|
15
27
|
* Maximum width for the global container (default: 1280px)
|
|
16
28
|
*/
|
|
17
29
|
maxWidth?: string | number;
|
|
18
30
|
}
|
|
19
|
-
declare
|
|
31
|
+
declare const GlobalLayout: React.ForwardRefExoticComponent<Omit<GlobalLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
32
|
interface GlobalLayoutSidebarProps extends React.ComponentProps<"aside"> {
|
|
33
|
+
/**
|
|
34
|
+
* Data hook for automated testing
|
|
35
|
+
*/
|
|
36
|
+
dataHook?: string;
|
|
21
37
|
/**
|
|
22
38
|
* Width of the sidebar (default: 256px)
|
|
23
39
|
*/
|
|
24
40
|
width?: string | number;
|
|
25
41
|
}
|
|
26
|
-
declare
|
|
42
|
+
declare const GlobalLayoutSidebar: React.ForwardRefExoticComponent<Omit<GlobalLayoutSidebarProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
27
43
|
/**
|
|
28
44
|
* Content width variants for GlobalLayoutContent
|
|
45
|
+
* - "full": Full width of available space
|
|
46
|
+
* - "md": Medium width (768px max-width)
|
|
47
|
+
* - "sm": Small width (374px max-width)
|
|
29
48
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* Full width of available space
|
|
33
|
-
*/
|
|
34
|
-
FULL = "full",
|
|
35
|
-
/**
|
|
36
|
-
* Medium width (768px max-width)
|
|
37
|
-
*/
|
|
38
|
-
MD = "md",
|
|
49
|
+
type ContentVariant = "full" | "md" | "sm";
|
|
50
|
+
interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
39
51
|
/**
|
|
40
|
-
*
|
|
52
|
+
* Data hook for automated testing
|
|
41
53
|
*/
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
54
|
+
dataHook?: string;
|
|
45
55
|
/**
|
|
46
56
|
* Content width variant:
|
|
47
57
|
* - "full": Full width of available space
|
|
@@ -54,7 +64,7 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
|
|
|
54
64
|
*/
|
|
55
65
|
padding?: string;
|
|
56
66
|
}
|
|
57
|
-
declare
|
|
67
|
+
declare const GlobalLayoutContent: React.ForwardRefExoticComponent<Omit<GlobalLayoutContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
58
68
|
export { GlobalLayout, GlobalLayoutSidebar, GlobalLayoutContent };
|
|
59
|
-
export type { GlobalLayoutProps };
|
|
69
|
+
export type { GlobalLayoutProps, GlobalLayoutSidebarProps, GlobalLayoutContentProps, };
|
|
60
70
|
//# 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;AAO/B;;;;;;;;;;GAUG;AAEH,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC7D;;OAEG;IACH,QAAQ,
|
|
1
|
+
{"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;;;;;;;;;GAUG;AAEH,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;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,YAAY,uGAuCjB,CAAC;AAOF,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,2GAkBvB,CAAC;AAIH;;;;;GAKG;AACH,KAAK,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,UAAU,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,mBAAmB,8GAsCxB,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAElE,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"}
|
package/dist/global-layout.js
CHANGED
|
@@ -1,87 +1,94 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
const f = "1280px", p = i.forwardRef(
|
|
5
|
+
({
|
|
6
|
+
className: t,
|
|
7
|
+
maxWidth: a = f,
|
|
8
|
+
dataHook: l,
|
|
9
|
+
trackingEl: o,
|
|
10
|
+
trackingLabel: e,
|
|
11
|
+
children: n,
|
|
12
|
+
...s
|
|
13
|
+
}, c) => {
|
|
14
|
+
const m = typeof a == "number" ? `${a}px` : a;
|
|
15
|
+
return /* @__PURE__ */ r(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: c,
|
|
19
|
+
className: d(
|
|
20
|
+
"flex min-h-screen w-full flex-col px-4 md:px-6",
|
|
21
|
+
t
|
|
22
|
+
),
|
|
23
|
+
"data-hook": l,
|
|
24
|
+
"data-slot": "global-layout",
|
|
25
|
+
"data-tracking-el": o,
|
|
26
|
+
"data-tracking-label": e,
|
|
27
|
+
...s,
|
|
28
|
+
children: /* @__PURE__ */ r(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: "mx-auto flex w-full flex-1 gap-4 md:gap-6",
|
|
32
|
+
"data-slot": "global-container",
|
|
33
|
+
style: { maxWidth: m },
|
|
34
|
+
children: n
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
p.displayName = "GlobalLayout";
|
|
42
|
+
const x = "256px", u = i.forwardRef(({ className: t, width: a = x, dataHook: l, children: o, ...e }, n) => {
|
|
43
|
+
const s = typeof a == "number" ? `${a}px` : a;
|
|
44
|
+
return /* @__PURE__ */ r(
|
|
38
45
|
"aside",
|
|
39
46
|
{
|
|
40
|
-
|
|
47
|
+
ref: n,
|
|
48
|
+
className: d("hidden shrink-0 self-stretch lg:block", t),
|
|
49
|
+
"data-hook": l,
|
|
41
50
|
"data-slot": "sidebar-container",
|
|
42
|
-
style: { width:
|
|
43
|
-
...o,
|
|
44
|
-
children: a
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
var m = /* @__PURE__ */ ((l) => (l.FULL = "full", l.MD = "md", l.SM = "sm", l))(m || {});
|
|
49
|
-
function p({
|
|
50
|
-
className: l,
|
|
51
|
-
variant: t = "full",
|
|
52
|
-
padding: a,
|
|
53
|
-
children: o,
|
|
54
|
-
...e
|
|
55
|
-
}) {
|
|
56
|
-
const r = {
|
|
57
|
-
full: "100%",
|
|
58
|
-
md: "768px",
|
|
59
|
-
sm: "374px"
|
|
60
|
-
};
|
|
61
|
-
return /* @__PURE__ */ n(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
className: s("flex h-full min-h-0 min-w-0 flex-1", l),
|
|
65
|
-
"data-slot": "content-wrapper",
|
|
51
|
+
style: { width: s },
|
|
66
52
|
...e,
|
|
67
|
-
children:
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
className: s("mx-auto w-full px-4 md:px-6"),
|
|
71
|
-
"data-slot": "content-container",
|
|
72
|
-
style: {
|
|
73
|
-
maxWidth: r[t],
|
|
74
|
-
padding: a
|
|
75
|
-
},
|
|
76
|
-
children: o
|
|
77
|
-
}
|
|
78
|
-
)
|
|
53
|
+
children: o
|
|
79
54
|
}
|
|
80
55
|
);
|
|
81
|
-
}
|
|
56
|
+
});
|
|
57
|
+
u.displayName = "GlobalLayoutSidebar";
|
|
58
|
+
const y = i.forwardRef(
|
|
59
|
+
({ className: t, variant: a = "full", padding: l, dataHook: o, children: e, ...n }, s) => {
|
|
60
|
+
const c = {
|
|
61
|
+
full: "100%",
|
|
62
|
+
md: "768px",
|
|
63
|
+
sm: "374px"
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ r(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
ref: s,
|
|
69
|
+
className: d("flex min-h-0 min-w-0 flex-1 self-stretch", t),
|
|
70
|
+
"data-hook": o,
|
|
71
|
+
"data-slot": "content-wrapper",
|
|
72
|
+
...n,
|
|
73
|
+
children: /* @__PURE__ */ r(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: d("mx-auto w-full"),
|
|
77
|
+
"data-slot": "content-container",
|
|
78
|
+
style: {
|
|
79
|
+
maxWidth: c[a],
|
|
80
|
+
padding: l
|
|
81
|
+
},
|
|
82
|
+
children: e
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
y.displayName = "GlobalLayoutContent";
|
|
82
90
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
x as GlobalLayoutSidebar
|
|
91
|
+
p as GlobalLayout,
|
|
92
|
+
y as GlobalLayoutContent,
|
|
93
|
+
u as GlobalLayoutSidebar
|
|
87
94
|
};
|
package/dist/hover-card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),b=require("@radix-ui/react-hover-card"),c=require("@brightlocal/ui-components/lib/utils");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const u=l(v),n=l(b);function m({openDelay:e=300,closeDelay:t=300,...a}){return o.jsx(n.Root,{closeDelay:t,openDelay:e,...a})}m.displayName="HoverCard";const g=u.forwardRef(({className:e,disabled:t,dataHook:a,trackingEl:r,trackingLabel:d,...i},s)=>o.jsx(n.Trigger,{ref:s,"aria-disabled":t,className:c.cn("text-link cursor-pointer text-sm leading-5 font-medium underline",t&&"pointer-events-none cursor-not-allowed opacity-50",e),"data-hook":a,"data-slot":"hover-card-trigger","data-tracking-el":r,"data-tracking-label":d,...i}));g.displayName="HoverCardTrigger";const f=u.forwardRef(({className:e,align:t="center",sideOffset:a=4,dataHook:r,trackingEl:d,trackingLabel:i,...s},p)=>o.jsx(n.Portal,{children:o.jsx(n.Content,{ref:p,align:t,className:c.cn("border-border bg-popover text-popover-foreground z-50 w-80 rounded-lg border p-4 shadow-md outline-hidden","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),"data-hook":r,"data-slot":"hover-card-content","data-tracking-el":d,"data-tracking-label":i,sideOffset:a,...s})}));f.displayName="HoverCardContent";exports.HoverCard=m;exports.HoverCardContent=f;exports.HoverCardTrigger=g;
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
+
/**
|
|
4
|
+
* HoverCard props
|
|
5
|
+
*/
|
|
6
|
+
export interface HoverCardProps extends React.ComponentProps<typeof HoverCardPrimitive.Root> {
|
|
7
|
+
/**
|
|
8
|
+
* Time in milliseconds to delay opening the hover card
|
|
9
|
+
* @default 300
|
|
10
|
+
*/
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Time in milliseconds to delay closing the hover card
|
|
14
|
+
* @default 300
|
|
15
|
+
*/
|
|
16
|
+
closeDelay?: number;
|
|
17
|
+
}
|
|
3
18
|
/**
|
|
4
19
|
* HoverCard - A component that displays content on hover
|
|
5
20
|
*
|
|
@@ -7,25 +22,40 @@ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
|
7
22
|
* @see https://www.radix-ui.com/docs/primitives/components/hover-card
|
|
8
23
|
*
|
|
9
24
|
* Default timing:
|
|
10
|
-
* - openDelay:
|
|
11
|
-
* - closeDelay: 300ms
|
|
25
|
+
* - openDelay: 300ms
|
|
26
|
+
* - closeDelay: 300ms
|
|
12
27
|
*/
|
|
13
|
-
declare function HoverCard({ openDelay, closeDelay, ...props }:
|
|
28
|
+
declare function HoverCard({ openDelay, closeDelay, ...props }: HoverCardProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare namespace HoverCard {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
14
32
|
export interface HoverCardTriggerProps extends React.ComponentProps<typeof HoverCardPrimitive.Trigger> {
|
|
33
|
+
/**
|
|
34
|
+
* Data hook for automated testing
|
|
35
|
+
*/
|
|
36
|
+
dataHook?: string;
|
|
15
37
|
/**
|
|
16
38
|
* Whether the trigger is disabled
|
|
17
39
|
*/
|
|
18
40
|
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Optional analytics element identifier
|
|
43
|
+
*/
|
|
44
|
+
trackingEl?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional analytics label context
|
|
47
|
+
*/
|
|
48
|
+
trackingLabel?: string;
|
|
19
49
|
}
|
|
20
50
|
/**
|
|
21
51
|
* HoverCardTrigger - The element that triggers the hover card
|
|
22
52
|
*/
|
|
23
|
-
declare
|
|
53
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<Omit<HoverCardTriggerProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
24
54
|
export interface HoverCardContentProps extends React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content> {
|
|
25
55
|
/**
|
|
26
|
-
*
|
|
56
|
+
* Data hook for automated testing
|
|
27
57
|
*/
|
|
28
|
-
dataHook
|
|
58
|
+
dataHook?: string;
|
|
29
59
|
/**
|
|
30
60
|
* Optional analytics element identifier
|
|
31
61
|
*/
|
package/dist/hover-card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;;GASG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAe,EACf,UAAgB,EAChB,GAAG,KAAK,EACT,EAAE,
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAGjE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAC1D,OAAO,kBAAkB,CAAC,IAAI,CAC/B;IACC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAe,EACf,UAAgB,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,2CAUhB;kBAdQ,SAAS;;;AAkBlB,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CACjE,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8GAuBrB,CAAC;AAIF,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,wBAAwB,CAC3E,OAAO,kBAAkB,CAAC,OAAO,CAClC;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,gBAAgB,8FAkCrB,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|