@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.
@@ -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" | "warning" | "success" | null | undefined;
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" | "warning" | "success" | "outline" | "secondary" | "glass" | "overlay" | null | undefined;
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?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | "glass" | "brown" | "antagonist" | null | undefined;
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> | "key"> & {
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" | "key"> & {
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
- }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
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> | "key"> & {
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" | "key"> & {
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> | "key"> & {
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" | "key"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
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> | "key"> & {
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" | "key">, "heading" | "value"> & {
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> | "key"> & {
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" | "key"> & {
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> | "key"> & {
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" | "key">, "onSelect" | "disabled" | "value"> & {
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
- if (currentIndex > 0) {
30
- const previousPanel = panels[currentIndex - 1];
31
- if (currentPanelData == null ? void 0 : currentPanelData.onBack) {
32
- currentPanelData.onBack();
33
- } else {
34
- onPanelChange(previousPanel.id);
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?: "display" | "h1" | "h2" | "h3" | "h4" | "body-lg" | "body" | "body-sm" | "caption" | "label" | "overline" | null | undefined;
8
- color?: "default" | "destructive" | "inherit" | "muted" | "primary" | "primary-foreground" | null | undefined;
9
- weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bearmenu/ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "BearMenu design system — shared UI tokens, primitives, and components",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -46,13 +46,12 @@ export const SlidingPanels = ({
46
46
  }, [currentIndex]);
47
47
 
48
48
  const handleBack = () => {
49
- if (currentIndex > 0) {
50
- const previousPanel = panels[currentIndex - 1];
51
- if (currentPanelData?.onBack) {
52
- currentPanelData.onBack();
53
- } else {
54
- onPanelChange(previousPanel.id);
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
 
@@ -65,6 +65,7 @@ export const StickyContainer = ({
65
65
  <div
66
66
  ref={ref}
67
67
  id={id}
68
+ data-stuck={isSticky ? "true" : undefined}
68
69
  className={cn(
69
70
  "sticky px-4 transition-all duration-200",
70
71
  hideUntilSticky
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));