@popgrids/ui 0.0.31 → 0.0.33
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/avatar.cjs +173 -0
- package/dist/avatar.cjs.map +1 -0
- package/dist/avatar.d.cts +41 -0
- package/dist/avatar.d.ts +41 -0
- package/dist/avatar.js +166 -0
- package/dist/avatar.js.map +1 -0
- package/dist/index.cjs +161 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +157 -54
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/notification-badge.cjs.map +1 -1
- package/dist/notification-badge.d.cts +4 -10
- package/dist/notification-badge.d.ts +4 -10
- package/dist/notification-badge.js.map +1 -1
- package/dist/types.d-DDkXskpi.d.cts +10 -0
- package/dist/types.d-DDkXskpi.d.ts +10 -0
- package/package.json +11 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var avatar = require('@base-ui/react/avatar');
|
|
3
4
|
var classVarianceAuthority = require('class-variance-authority');
|
|
4
5
|
var clsx = require('clsx');
|
|
5
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var mergeProps = require('@base-ui/react/merge-props');
|
|
8
|
+
var useRender = require('@base-ui/react/use-render');
|
|
6
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
10
|
var button = require('@base-ui/react/button');
|
|
8
11
|
var checkbox = require('@base-ui/react/checkbox');
|
|
@@ -10,14 +13,163 @@ var icons = require('@untitledui/icons');
|
|
|
10
13
|
var dialog = require('@base-ui/react/dialog');
|
|
11
14
|
var menu = require('@base-ui/react/menu');
|
|
12
15
|
var input = require('@base-ui/react/input');
|
|
13
|
-
var mergeProps = require('@base-ui/react/merge-props');
|
|
14
|
-
var useRender = require('@base-ui/react/use-render');
|
|
15
16
|
var tooltip = require('@base-ui/react/tooltip');
|
|
16
17
|
|
|
17
|
-
// src/components/
|
|
18
|
+
// src/components/avatar/avatar.tsx
|
|
18
19
|
function cn(...inputs) {
|
|
19
20
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
20
21
|
}
|
|
22
|
+
var notificationBadgeVariants = classVarianceAuthority.cva(
|
|
23
|
+
"inline-flex items-center justify-center rounded-full box-border shrink-0 whitespace-nowrap text-xs font-medium leading-[18px] min-w-[18px] h-[18px] px-[5px] py-0 transition-[color,background-color,border-color]",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
default: "bg-primary text-primary-foreground",
|
|
28
|
+
reversed: "bg-background text-foreground",
|
|
29
|
+
disabled: "bg-tint-950-reversed border border-black-alpha-600 text-black-alpha-600 backdrop-blur-lg",
|
|
30
|
+
white: "bg-white text-black",
|
|
31
|
+
black: "bg-brand-midnight-900 text-white"
|
|
32
|
+
},
|
|
33
|
+
pulse: {
|
|
34
|
+
true: "relative",
|
|
35
|
+
false: ""
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
compoundVariants: [
|
|
39
|
+
{
|
|
40
|
+
pulse: true,
|
|
41
|
+
class: "before:content-[''] before:absolute before:inset-[-4px] before:rounded-full before:border-4 before:border-solid before:border-(--notification-badge-pulse-color,var(--color-surface-alpha-alpha-brand-light-30)) before:pointer-events-none before:animate-notification-badge-ping motion-reduce:before:animate-none"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
variant: "default",
|
|
46
|
+
pulse: false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
function NotificationBadge({
|
|
51
|
+
className,
|
|
52
|
+
variant,
|
|
53
|
+
pulse = false,
|
|
54
|
+
count,
|
|
55
|
+
children,
|
|
56
|
+
render,
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
const displayContent = count !== void 0 ? String(count) : children;
|
|
60
|
+
const defaultProps = {
|
|
61
|
+
"data-slot": "notification-badge",
|
|
62
|
+
className: cn(notificationBadgeVariants({ variant, pulse }), className),
|
|
63
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center", children: displayContent })
|
|
64
|
+
};
|
|
65
|
+
return useRender.useRender({
|
|
66
|
+
defaultTagName: "div",
|
|
67
|
+
render,
|
|
68
|
+
props: mergeProps.mergeProps(defaultProps, props)
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
var avatarVariants = classVarianceAuthority.cva(
|
|
72
|
+
"group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:mix-blend-darken dark:after:mix-blend-lighten",
|
|
73
|
+
{
|
|
74
|
+
variants: {
|
|
75
|
+
size: {
|
|
76
|
+
xs: "size-6",
|
|
77
|
+
// 24px
|
|
78
|
+
sm: "size-8",
|
|
79
|
+
// 32px
|
|
80
|
+
md: "size-14",
|
|
81
|
+
// 56px
|
|
82
|
+
lg: "size-20",
|
|
83
|
+
// 80px
|
|
84
|
+
xl: "size-[120px]",
|
|
85
|
+
xxl: "size-[140px]"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
defaultVariants: {
|
|
89
|
+
size: "md"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
function Avatar({ className = "", size = "md", ...props }) {
|
|
94
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
avatar.Avatar.Root,
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "avatar",
|
|
98
|
+
"data-size": size,
|
|
99
|
+
className: cn(avatarVariants({ size }), className),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function AvatarImage({ className = "", ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
avatar.Avatar.Image,
|
|
107
|
+
{
|
|
108
|
+
"data-slot": "avatar-image",
|
|
109
|
+
className: cn("aspect-square size-full mask mask-squircle object-cover", className),
|
|
110
|
+
...props
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function AvatarFallback({ className = "", ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
avatar.Avatar.Fallback,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "avatar-fallback",
|
|
119
|
+
className: cn(
|
|
120
|
+
"mask mask-squircle flex size-full items-center justify-center bg-muted text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function AvatarBadge({ className = "", ...props }) {
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
NotificationBadge,
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "avatar-badge",
|
|
132
|
+
className: cn(
|
|
133
|
+
"absolute h-[18px] min-w-[18px] z-10 select-none",
|
|
134
|
+
"leading-none",
|
|
135
|
+
"group-data-[size=xs]/avatar:right-[-4px] group-data-[size=xs]/avatar:bottom-[-4px]",
|
|
136
|
+
"group-data-[size=sm]/avatar:right-[-4px] group-data-[size=sm]/avatar:bottom-[-4px]",
|
|
137
|
+
"group-data-[size=md]/avatar:right-[-4px] group-data-[size=md]/avatar:bottom-[-4px]",
|
|
138
|
+
"group-data-[size=lg]/avatar:right-[-2px] group-data-[size=lg]/avatar:bottom-[-2px]",
|
|
139
|
+
"group-data-[size=xl]/avatar:right-[3px] group-data-[size=xl]/avatar:bottom-[3px]",
|
|
140
|
+
"group-data-[size=xxl]/avatar:right-[11px] group-data-[size=xxl]/avatar:bottom-px",
|
|
141
|
+
className
|
|
142
|
+
),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function AvatarGroup({ className = "", ...props }) {
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
"data-slot": "avatar-group",
|
|
152
|
+
className: cn(
|
|
153
|
+
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
154
|
+
className
|
|
155
|
+
),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
function AvatarGroupCount({ className = "", ...props }) {
|
|
161
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "avatar-group-count",
|
|
165
|
+
className: cn(
|
|
166
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground text-sm ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
167
|
+
className
|
|
168
|
+
),
|
|
169
|
+
...props
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
21
173
|
var bannerNotificationVariants = classVarianceAuthority.cva(
|
|
22
174
|
"flex items-start gap-3 rounded-[6px] px-4 py-3 w-full w-[360px] border-border border",
|
|
23
175
|
{
|
|
@@ -1560,55 +1712,6 @@ function Logo({
|
|
|
1560
1712
|
}
|
|
1561
1713
|
);
|
|
1562
1714
|
}
|
|
1563
|
-
var notificationBadgeVariants = classVarianceAuthority.cva(
|
|
1564
|
-
"inline-flex items-center justify-center rounded-full box-border shrink-0 whitespace-nowrap text-xs font-medium leading-[18px] min-w-[18px] h-[18px] px-[5px] py-0 transition-[color,background-color,border-color]",
|
|
1565
|
-
{
|
|
1566
|
-
variants: {
|
|
1567
|
-
variant: {
|
|
1568
|
-
default: "bg-primary text-primary-foreground",
|
|
1569
|
-
reversed: "bg-background text-foreground",
|
|
1570
|
-
disabled: "bg-tint-950-reversed border border-black-alpha-600 text-black-alpha-600 backdrop-blur-lg",
|
|
1571
|
-
white: "bg-white text-black",
|
|
1572
|
-
black: "bg-brand-midnight-900 text-white"
|
|
1573
|
-
},
|
|
1574
|
-
pulse: {
|
|
1575
|
-
true: "relative",
|
|
1576
|
-
false: ""
|
|
1577
|
-
}
|
|
1578
|
-
},
|
|
1579
|
-
compoundVariants: [
|
|
1580
|
-
{
|
|
1581
|
-
pulse: true,
|
|
1582
|
-
class: "before:content-[''] before:absolute before:inset-[-4px] before:rounded-full before:border-4 before:border-solid before:border-(--notification-badge-pulse-color,var(--color-surface-alpha-alpha-brand-light-30)) before:pointer-events-none before:animate-notification-badge-ping motion-reduce:before:animate-none"
|
|
1583
|
-
}
|
|
1584
|
-
],
|
|
1585
|
-
defaultVariants: {
|
|
1586
|
-
variant: "default",
|
|
1587
|
-
pulse: false
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
);
|
|
1591
|
-
function NotificationBadge({
|
|
1592
|
-
className,
|
|
1593
|
-
variant,
|
|
1594
|
-
pulse = false,
|
|
1595
|
-
count,
|
|
1596
|
-
children,
|
|
1597
|
-
render,
|
|
1598
|
-
...props
|
|
1599
|
-
}) {
|
|
1600
|
-
const displayContent = count !== void 0 ? String(count) : children;
|
|
1601
|
-
const defaultProps = {
|
|
1602
|
-
"data-slot": "notification-badge",
|
|
1603
|
-
className: cn(notificationBadgeVariants({ variant, pulse }), className),
|
|
1604
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center", children: displayContent })
|
|
1605
|
-
};
|
|
1606
|
-
return useRender.useRender({
|
|
1607
|
-
defaultTagName: "div",
|
|
1608
|
-
render,
|
|
1609
|
-
props: mergeProps.mergeProps(defaultProps, props)
|
|
1610
|
-
});
|
|
1611
|
-
}
|
|
1612
1715
|
var SectionFlourish = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center self-stretch py-8 text-xl", children: "\u2726" });
|
|
1613
1716
|
function TooltipProvider({ delay = 0, ...props }) {
|
|
1614
1717
|
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Provider, { "data-slot": "tooltip-provider", delay, ...props });
|
|
@@ -1875,6 +1978,12 @@ function TemplateHeader({ className, image }) {
|
|
|
1875
1978
|
);
|
|
1876
1979
|
}
|
|
1877
1980
|
|
|
1981
|
+
exports.Avatar = Avatar;
|
|
1982
|
+
exports.AvatarBadge = AvatarBadge;
|
|
1983
|
+
exports.AvatarFallback = AvatarFallback;
|
|
1984
|
+
exports.AvatarGroup = AvatarGroup;
|
|
1985
|
+
exports.AvatarGroupCount = AvatarGroupCount;
|
|
1986
|
+
exports.AvatarImage = AvatarImage;
|
|
1878
1987
|
exports.BannerNotification = BannerNotification;
|
|
1879
1988
|
exports.Button = Button;
|
|
1880
1989
|
exports.ButtonLink = ButtonLink;
|