@bearmenu/ui 0.5.0 → 0.5.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/dist/components/alert.d.ts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/command.d.ts +13 -13
- package/dist/components/sliding-panels.js +6 -7
- package/dist/components/sticky-container.js +1 -0
- package/dist/components/text.d.ts +3 -3
- package/package.json +1 -1
- package/src/components/sliding-panels.tsx +6 -7
- package/src/components/sticky-container.tsx +1 -0
- package/src/globals.css +23 -0
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
6
|
-
variant?: "default" | "destructive" | "
|
|
6
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
7
7
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
9
|
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "destructive" | "
|
|
7
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "glass" | "success" | "warning" | "overlay" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "glass" | "brown" | "antagonist" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -4,11 +4,11 @@ import { DialogProps } from '@radix-ui/react-dialog';
|
|
|
4
4
|
|
|
5
5
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
7
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: React.Ref<HTMLDivElement>;
|
|
9
9
|
} & {
|
|
10
10
|
asChild?: boolean;
|
|
11
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
11
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
12
12
|
label?: string;
|
|
13
13
|
shouldFilter?: boolean;
|
|
14
14
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -25,51 +25,51 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
|
|
|
25
25
|
ref?: React.Ref<HTMLInputElement>;
|
|
26
26
|
} & {
|
|
27
27
|
asChild?: boolean;
|
|
28
|
-
}, "
|
|
28
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
29
29
|
value?: string;
|
|
30
30
|
onValueChange?: (search: string) => void;
|
|
31
31
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
32
32
|
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
33
33
|
children?: React.ReactNode;
|
|
34
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
34
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
35
35
|
ref?: React.Ref<HTMLDivElement>;
|
|
36
36
|
} & {
|
|
37
37
|
asChild?: boolean;
|
|
38
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
38
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
39
39
|
label?: string;
|
|
40
40
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
41
|
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
42
42
|
children?: React.ReactNode;
|
|
43
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
43
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
44
44
|
ref?: React.Ref<HTMLDivElement>;
|
|
45
45
|
} & {
|
|
46
46
|
asChild?: boolean;
|
|
47
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
47
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
48
48
|
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
49
49
|
children?: React.ReactNode;
|
|
50
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
50
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
51
51
|
ref?: React.Ref<HTMLDivElement>;
|
|
52
52
|
} & {
|
|
53
53
|
asChild?: boolean;
|
|
54
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
54
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
|
|
55
55
|
heading?: React.ReactNode;
|
|
56
56
|
value?: string;
|
|
57
57
|
forceMount?: boolean;
|
|
58
58
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
-
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
59
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
60
60
|
ref?: React.Ref<HTMLDivElement>;
|
|
61
61
|
} & {
|
|
62
62
|
asChild?: boolean;
|
|
63
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
63
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
64
64
|
alwaysRender?: boolean;
|
|
65
65
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
66
66
|
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
67
67
|
children?: React.ReactNode;
|
|
68
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement
|
|
68
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
69
69
|
ref?: React.Ref<HTMLDivElement>;
|
|
70
70
|
} & {
|
|
71
71
|
asChild?: boolean;
|
|
72
|
-
}, keyof React.HTMLAttributes<HTMLDivElement> | "asChild"
|
|
72
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
|
|
73
73
|
disabled?: boolean;
|
|
74
74
|
onSelect?: (value: string) => void;
|
|
75
75
|
value?: string;
|
|
@@ -26,13 +26,12 @@ var SlidingPanels = ({
|
|
|
26
26
|
return () => ro.disconnect();
|
|
27
27
|
}, [currentIndex]);
|
|
28
28
|
const handleBack = () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
29
|
+
const previousPanel = panels[currentIndex - 1];
|
|
30
|
+
if (!previousPanel) return;
|
|
31
|
+
if (currentPanelData == null ? void 0 : currentPanelData.onBack) {
|
|
32
|
+
currentPanelData.onBack();
|
|
33
|
+
} else {
|
|
34
|
+
onPanelChange(previousPanel.id);
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
return /* @__PURE__ */ jsx(
|
|
@@ -22,6 +22,7 @@ var StickyContainer = ({
|
|
|
22
22
|
{
|
|
23
23
|
ref,
|
|
24
24
|
id,
|
|
25
|
+
"data-stuck": isSticky ? "true" : void 0,
|
|
25
26
|
className: cn(
|
|
26
27
|
"sticky px-4 transition-all duration-200",
|
|
27
28
|
hideUntilSticky ? isSticky ? "py-4 opacity-100 translate-y-0" : "py-0 opacity-0 -translate-y-2 pointer-events-none" : "py-4",
|
|
@@ -4,9 +4,9 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const textVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
8
|
-
color?: "
|
|
9
|
-
weight?: "bold" | "
|
|
7
|
+
variant?: "h2" | "h3" | "label" | "body" | "caption" | "h1" | "h4" | "display" | "body-lg" | "body-sm" | "overline" | null | undefined;
|
|
8
|
+
color?: "inherit" | "default" | "destructive" | "muted" | "primary" | "primary-foreground" | null | undefined;
|
|
9
|
+
weight?: "bold" | "medium" | "normal" | "semibold" | null | undefined;
|
|
10
10
|
leading?: "none" | "normal" | "tight" | "snug" | "relaxed" | "loose" | null | undefined;
|
|
11
11
|
tracking?: "normal" | "tight" | "wide" | "wider" | null | undefined;
|
|
12
12
|
wrap?: "balance" | "pretty" | "nowrap" | null | undefined;
|
package/package.json
CHANGED
|
@@ -46,13 +46,12 @@ export const SlidingPanels = ({
|
|
|
46
46
|
}, [currentIndex]);
|
|
47
47
|
|
|
48
48
|
const handleBack = () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
49
|
+
const previousPanel = panels[currentIndex - 1];
|
|
50
|
+
if (!previousPanel) return;
|
|
51
|
+
if (currentPanelData?.onBack) {
|
|
52
|
+
currentPanelData.onBack();
|
|
53
|
+
} else {
|
|
54
|
+
onPanelChange(previousPanel.id);
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
57
|
|
package/src/globals.css
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
2
|
@import "tw-animate-css";
|
|
3
3
|
|
|
4
|
+
/* Register this package's components so consumers' Tailwind v4 build
|
|
5
|
+
picks up class strings used inside the package (positioning, animations,
|
|
6
|
+
data-[state] variants, etc.). Without this, classes referenced only
|
|
7
|
+
here — e.g. Dialog's translate-x-[-50%] / zoom-in-95 — never get
|
|
8
|
+
generated in the consumer's CSS. */
|
|
9
|
+
@source "./components";
|
|
10
|
+
|
|
4
11
|
@custom-variant dark (&:is(.dark *));
|
|
5
12
|
|
|
6
13
|
/* Improve text rendering for headings */
|
|
@@ -415,6 +422,22 @@ h6 {
|
|
|
415
422
|
top: env(safe-area-inset-top, 0);
|
|
416
423
|
}
|
|
417
424
|
|
|
425
|
+
/* In PWA standalone mode the sticky bar pins below the safe-area inset, leaving
|
|
426
|
+
the strip under the notch transparent. When the bar is actually stuck
|
|
427
|
+
(data-stuck="true"), extend its current background up into that strip so the
|
|
428
|
+
status bar sits over the bar's color instead of empty space.
|
|
429
|
+
Browser mode never matches `display-mode: standalone`, so this is a no-op. */
|
|
430
|
+
@media (display-mode: standalone) {
|
|
431
|
+
.sticky-header-safe[data-stuck="true"]::before {
|
|
432
|
+
content: "";
|
|
433
|
+
position: absolute;
|
|
434
|
+
inset: calc(-1 * env(safe-area-inset-top, 0)) 0 auto 0;
|
|
435
|
+
height: env(safe-area-inset-top, 0);
|
|
436
|
+
background: inherit;
|
|
437
|
+
pointer-events: none;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
418
441
|
/* For mobile bottom nav */
|
|
419
442
|
.mobile-nav-safe {
|
|
420
443
|
bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
|