@papernote/ui 1.9.2 → 1.10.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/dist/components/NotificationBell.d.ts +7 -1
- package/dist/components/NotificationBell.d.ts.map +1 -1
- package/dist/components/Tabs.d.ts +112 -1
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +120 -4
- package/dist/index.esm.js +437 -125
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +439 -123
- package/dist/index.js.map +1 -1
- package/dist/styles.css +23 -0
- package/package.json +1 -1
- package/src/components/NotificationBell.stories.tsx +71 -0
- package/src/components/NotificationBell.tsx +12 -4
- package/src/components/Tabs.stories.tsx +649 -6
- package/src/components/Tabs.tsx +613 -19
- package/src/components/index.ts +2 -2
package/dist/styles.css
CHANGED
|
@@ -5579,6 +5579,21 @@ input:checked + .slider:before{
|
|
|
5579
5579
|
--tw-ring-offset-width: 2px;
|
|
5580
5580
|
}
|
|
5581
5581
|
|
|
5582
|
+
.focus-visible\:ring-2:focus-visible{
|
|
5583
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
5584
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
5585
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
5586
|
+
}
|
|
5587
|
+
|
|
5588
|
+
.focus-visible\:ring-accent-500:focus-visible{
|
|
5589
|
+
--tw-ring-opacity: 1;
|
|
5590
|
+
--tw-ring-color: rgb(139 136 120 / var(--tw-ring-opacity, 1));
|
|
5591
|
+
}
|
|
5592
|
+
|
|
5593
|
+
.focus-visible\:ring-offset-1:focus-visible{
|
|
5594
|
+
--tw-ring-offset-width: 1px;
|
|
5595
|
+
}
|
|
5596
|
+
|
|
5582
5597
|
.active\:scale-95:active{
|
|
5583
5598
|
--tw-scale-x: .95;
|
|
5584
5599
|
--tw-scale-y: .95;
|
|
@@ -5661,12 +5676,20 @@ input:checked + .slider:before{
|
|
|
5661
5676
|
color: rgb(68 64 60 / var(--tw-text-opacity, 1));
|
|
5662
5677
|
}
|
|
5663
5678
|
|
|
5679
|
+
.group:hover .group-hover\:opacity-100{
|
|
5680
|
+
opacity: 1;
|
|
5681
|
+
}
|
|
5682
|
+
|
|
5664
5683
|
.group:hover .group-hover\:shadow-md{
|
|
5665
5684
|
--tw-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.06);
|
|
5666
5685
|
--tw-shadow-colored: 0 2px 4px 0 var(--tw-shadow-color);
|
|
5667
5686
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
5668
5687
|
}
|
|
5669
5688
|
|
|
5689
|
+
.group:focus-visible .group-focus-visible\:opacity-100{
|
|
5690
|
+
opacity: 1;
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5670
5693
|
@media (min-width: 640px){
|
|
5671
5694
|
|
|
5672
5695
|
.sm\:mb-6{
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import NotificationBell, { NotificationItem } from './NotificationBell';
|
|
|
4
4
|
import Stack from './Stack';
|
|
5
5
|
import Text from './Text';
|
|
6
6
|
import Box from './Box';
|
|
7
|
+
import { MessageCircle, Inbox, BellRing, Mail } from 'lucide-react';
|
|
7
8
|
|
|
8
9
|
const meta = {
|
|
9
10
|
title: 'Components/NotificationBell',
|
|
@@ -757,3 +758,73 @@ export const OutlinedInHeader: Story = {
|
|
|
757
758
|
);
|
|
758
759
|
},
|
|
759
760
|
};
|
|
761
|
+
|
|
762
|
+
export const CustomIcon: Story = {
|
|
763
|
+
render: () => (
|
|
764
|
+
<Stack direction="horizontal" spacing="xl" align="center">
|
|
765
|
+
<Stack align="center" spacing="sm">
|
|
766
|
+
<NotificationBell
|
|
767
|
+
notifications={sampleNotifications}
|
|
768
|
+
unreadCount={3}
|
|
769
|
+
icon={<MessageCircle className="h-5 w-5 text-ink-600" />}
|
|
770
|
+
onViewAll={() => {}}
|
|
771
|
+
/>
|
|
772
|
+
<Text size="xs" color="muted">Message icon</Text>
|
|
773
|
+
</Stack>
|
|
774
|
+
<Stack align="center" spacing="sm">
|
|
775
|
+
<NotificationBell
|
|
776
|
+
notifications={sampleNotifications}
|
|
777
|
+
unreadCount={5}
|
|
778
|
+
icon={<Inbox className="h-5 w-5 text-ink-600" />}
|
|
779
|
+
onViewAll={() => {}}
|
|
780
|
+
/>
|
|
781
|
+
<Text size="xs" color="muted">Inbox icon</Text>
|
|
782
|
+
</Stack>
|
|
783
|
+
<Stack align="center" spacing="sm">
|
|
784
|
+
<NotificationBell
|
|
785
|
+
notifications={sampleNotifications}
|
|
786
|
+
unreadCount={2}
|
|
787
|
+
icon={<BellRing className="h-5 w-5 text-ink-600" />}
|
|
788
|
+
onViewAll={() => {}}
|
|
789
|
+
/>
|
|
790
|
+
<Text size="xs" color="muted">Bell ring icon</Text>
|
|
791
|
+
</Stack>
|
|
792
|
+
<Stack align="center" spacing="sm">
|
|
793
|
+
<NotificationBell
|
|
794
|
+
notifications={sampleNotifications}
|
|
795
|
+
unreadCount={8}
|
|
796
|
+
icon={<Mail className="h-5 w-5 text-ink-600" />}
|
|
797
|
+
onViewAll={() => {}}
|
|
798
|
+
/>
|
|
799
|
+
<Text size="xs" color="muted">Mail icon</Text>
|
|
800
|
+
</Stack>
|
|
801
|
+
</Stack>
|
|
802
|
+
),
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
export const CustomIconOutlined: Story = {
|
|
806
|
+
render: () => (
|
|
807
|
+
<Stack direction="horizontal" spacing="xl" align="center">
|
|
808
|
+
<Stack align="center" spacing="sm">
|
|
809
|
+
<NotificationBell
|
|
810
|
+
notifications={sampleNotifications}
|
|
811
|
+
unreadCount={3}
|
|
812
|
+
bellStyle="outlined"
|
|
813
|
+
icon={<MessageCircle className="h-5 w-5 text-ink-600" />}
|
|
814
|
+
onViewAll={() => {}}
|
|
815
|
+
/>
|
|
816
|
+
<Text size="xs" color="muted">Outlined message</Text>
|
|
817
|
+
</Stack>
|
|
818
|
+
<Stack align="center" spacing="sm">
|
|
819
|
+
<NotificationBell
|
|
820
|
+
notifications={sampleNotifications}
|
|
821
|
+
unreadCount={5}
|
|
822
|
+
bellStyle="outlined"
|
|
823
|
+
icon={<Mail className="h-5 w-5 text-ink-600" />}
|
|
824
|
+
onViewAll={() => {}}
|
|
825
|
+
/>
|
|
826
|
+
<Text size="xs" color="muted">Outlined mail</Text>
|
|
827
|
+
</Stack>
|
|
828
|
+
</Stack>
|
|
829
|
+
),
|
|
830
|
+
};
|
|
@@ -89,6 +89,11 @@ export interface NotificationBellProps {
|
|
|
89
89
|
* - 'outlined': Visible border/container with subtle background
|
|
90
90
|
*/
|
|
91
91
|
bellStyle?: NotificationBellStyle;
|
|
92
|
+
/**
|
|
93
|
+
* Custom icon to use instead of the default bell
|
|
94
|
+
* Use this to provide your own notification icon
|
|
95
|
+
*/
|
|
96
|
+
icon?: React.ReactNode;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
/**
|
|
@@ -206,6 +211,7 @@ export default function NotificationBell({
|
|
|
206
211
|
variant = 'compact',
|
|
207
212
|
showUnreadInHeader = false,
|
|
208
213
|
bellStyle = 'ghost',
|
|
214
|
+
icon: customIcon,
|
|
209
215
|
}: NotificationBellProps) {
|
|
210
216
|
const [isOpen, setIsOpen] = useState(false);
|
|
211
217
|
|
|
@@ -266,6 +272,9 @@ export default function NotificationBell({
|
|
|
266
272
|
lg: 'p-4',
|
|
267
273
|
};
|
|
268
274
|
|
|
275
|
+
// Default bell icon or custom icon
|
|
276
|
+
const bellIcon = customIcon || <Bell className={`${iconSizes[size]} text-ink-600`} />;
|
|
277
|
+
|
|
269
278
|
// Trigger button
|
|
270
279
|
const triggerButton = bellStyle === 'outlined' ? (
|
|
271
280
|
<div className="relative inline-block">
|
|
@@ -286,7 +295,7 @@ export default function NotificationBell({
|
|
|
286
295
|
: 'Notifications'
|
|
287
296
|
}
|
|
288
297
|
>
|
|
289
|
-
|
|
298
|
+
{bellIcon}
|
|
290
299
|
</button>
|
|
291
300
|
{unreadCount > 0 && (
|
|
292
301
|
<span
|
|
@@ -310,6 +319,7 @@ export default function NotificationBell({
|
|
|
310
319
|
iconOnly
|
|
311
320
|
size={size}
|
|
312
321
|
disabled={disabled}
|
|
322
|
+
icon={bellIcon}
|
|
313
323
|
badge={unreadCount > 0 ? unreadCount : undefined}
|
|
314
324
|
badgeVariant="error"
|
|
315
325
|
aria-label={
|
|
@@ -318,9 +328,7 @@ export default function NotificationBell({
|
|
|
318
328
|
: 'Notifications'
|
|
319
329
|
}
|
|
320
330
|
className={className}
|
|
321
|
-
|
|
322
|
-
<Bell className={iconSizes[size]} />
|
|
323
|
-
</Button>
|
|
331
|
+
/>
|
|
324
332
|
);
|
|
325
333
|
|
|
326
334
|
// Header title with optional unread count
|