@popgrids/ui 0.0.31 → 0.0.32

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/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,153 @@ 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/banner-notification/banner-notification.tsx
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
+ default: "size-8",
77
+ sm: "size-6",
78
+ lg: "size-10"
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ size: "default"
83
+ }
84
+ }
85
+ );
86
+ function Avatar({ className = "", size = "default", ...props }) {
87
+ return /* @__PURE__ */ jsxRuntime.jsx(
88
+ avatar.Avatar.Root,
89
+ {
90
+ "data-slot": "avatar",
91
+ "data-size": size,
92
+ className: cn(avatarVariants({ size }), className),
93
+ ...props
94
+ }
95
+ );
96
+ }
97
+ function AvatarImage({ className = "", ...props }) {
98
+ return /* @__PURE__ */ jsxRuntime.jsx(
99
+ avatar.Avatar.Image,
100
+ {
101
+ "data-slot": "avatar-image",
102
+ className: cn("aspect-square size-full mask mask-squircle object-cover", className),
103
+ ...props
104
+ }
105
+ );
106
+ }
107
+ function AvatarFallback({ className = "", ...props }) {
108
+ return /* @__PURE__ */ jsxRuntime.jsx(
109
+ avatar.Avatar.Fallback,
110
+ {
111
+ "data-slot": "avatar-fallback",
112
+ className: cn(
113
+ "mask mask-squircle flex size-full items-center justify-center bg-muted text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs",
114
+ className
115
+ ),
116
+ ...props
117
+ }
118
+ );
119
+ }
120
+ function AvatarBadge({ className = "", ...props }) {
121
+ return /* @__PURE__ */ jsxRuntime.jsx(
122
+ NotificationBadge,
123
+ {
124
+ "data-slot": "avatar-badge",
125
+ className: cn(
126
+ "absolute h-[18px] min-w-[18px] z-10 select-none",
127
+ "leading-none",
128
+ "group-data-[size=sm]/avatar:right-[-4px] group-data-[size=sm]/avatar:bottom-[-4px]",
129
+ "group-data-[size=default]/avatar:right-[-4px] group-data-[size=default]/avatar:bottom-[-4px]",
130
+ "group-data-[size=lg]/avatar:right-[-4px] group-data-[size=lg]/avatar:bottom-[-4px]",
131
+ className
132
+ ),
133
+ ...props
134
+ }
135
+ );
136
+ }
137
+ function AvatarGroup({ className = "", ...props }) {
138
+ return /* @__PURE__ */ jsxRuntime.jsx(
139
+ "div",
140
+ {
141
+ "data-slot": "avatar-group",
142
+ className: cn(
143
+ "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
144
+ className
145
+ ),
146
+ ...props
147
+ }
148
+ );
149
+ }
150
+ function AvatarGroupCount({ className = "", ...props }) {
151
+ return /* @__PURE__ */ jsxRuntime.jsx(
152
+ "div",
153
+ {
154
+ "data-slot": "avatar-group-count",
155
+ className: cn(
156
+ "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",
157
+ className
158
+ ),
159
+ ...props
160
+ }
161
+ );
162
+ }
21
163
  var bannerNotificationVariants = classVarianceAuthority.cva(
22
164
  "flex items-start gap-3 rounded-[6px] px-4 py-3 w-full w-[360px] border-border border",
23
165
  {
@@ -1560,55 +1702,6 @@ function Logo({
1560
1702
  }
1561
1703
  );
1562
1704
  }
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
1705
  var SectionFlourish = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center self-stretch py-8 text-xl", children: "\u2726" });
1613
1706
  function TooltipProvider({ delay = 0, ...props }) {
1614
1707
  return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Provider, { "data-slot": "tooltip-provider", delay, ...props });
@@ -1875,6 +1968,12 @@ function TemplateHeader({ className, image }) {
1875
1968
  );
1876
1969
  }
1877
1970
 
1971
+ exports.Avatar = Avatar;
1972
+ exports.AvatarBadge = AvatarBadge;
1973
+ exports.AvatarFallback = AvatarFallback;
1974
+ exports.AvatarGroup = AvatarGroup;
1975
+ exports.AvatarGroupCount = AvatarGroupCount;
1976
+ exports.AvatarImage = AvatarImage;
1878
1977
  exports.BannerNotification = BannerNotification;
1879
1978
  exports.Button = Button;
1880
1979
  exports.ButtonLink = ButtonLink;