@parto-system-design/ui 1.1.16 → 1.1.17

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.
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const badgeVariants: (props?: ({
6
6
  variant?: "warning" | "success" | "default" | "outline" | "destructive" | "secondary" | "brand" | null | undefined;
7
- size?: "small" | "xs" | "sm" | "md" | "lg" | "large" | "tiny" | null | undefined;
7
+ size?: "xs" | "sm" | "md" | "lg" | "small" | "large" | "tiny" | null | undefined;
8
8
  dot?: boolean | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const badgeVariants: (props?: ({
6
6
  variant?: "warning" | "success" | "default" | "outline" | "destructive" | "secondary" | "brand" | null | undefined;
7
- size?: "small" | "xs" | "sm" | "md" | "lg" | "large" | "tiny" | null | undefined;
7
+ size?: "xs" | "sm" | "md" | "lg" | "small" | "large" | "tiny" | null | undefined;
8
8
  dot?: boolean | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
7
+ variant?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
@@ -12,7 +12,7 @@ declare const buttonVariants: (props?: ({
12
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
13
  type LoadingVariantProps = VariantProps<typeof loadingVariants>;
14
14
  declare const loadingVariants: (props?: ({
15
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
15
+ variant?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
16
16
  loading?: boolean | "default" | null | undefined;
17
17
  } & class_variance_authority_types.ClassProp) | undefined) => string;
18
18
  interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, Omit<ButtonVariantProps, 'disabled'>, Omit<LoadingVariantProps, 'variant'> {
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
7
+ variant?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
8
8
  block?: boolean | null | undefined;
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  disabled?: boolean | null | undefined;
@@ -12,7 +12,7 @@ declare const buttonVariants: (props?: ({
12
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
13
13
  type LoadingVariantProps = VariantProps<typeof loadingVariants>;
14
14
  declare const loadingVariants: (props?: ({
15
- variant?: "link" | "warning" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
15
+ variant?: "warning" | "link" | "text" | "default" | "outline" | "dashed" | "destructive" | "primary" | "secondary" | "danger" | "ghost" | null | undefined;
16
16
  loading?: boolean | "default" | null | undefined;
17
17
  } & class_variance_authority_types.ClassProp) | undefined) => string;
18
18
  interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, Omit<ButtonVariantProps, 'disabled'>, Omit<LoadingVariantProps, 'variant'> {
@@ -4,7 +4,7 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const switchRootVariants: (props?: ({
7
- size?: "small" | "medium" | "sm" | "md" | "lg" | "large" | null | undefined;
7
+ size?: "medium" | "sm" | "md" | "lg" | "small" | "large" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, VariantProps<typeof switchRootVariants> {
10
10
  }
@@ -4,7 +4,7 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const switchRootVariants: (props?: ({
7
- size?: "small" | "medium" | "sm" | "md" | "lg" | "large" | null | undefined;
7
+ size?: "medium" | "sm" | "md" | "lg" | "small" | "large" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, VariantProps<typeof switchRootVariants> {
10
10
  }
package/dist/index.cjs CHANGED
@@ -20056,6 +20056,7 @@ var NAV_RAIL_WIDTH = "3.5rem";
20056
20056
  var NAV_PANEL_WIDTH = "16rem";
20057
20057
  var NAV_PANEL_WIDTH_MOBILE = "18rem";
20058
20058
  var NAV_RAIL_KEYBOARD_SHORTCUT = "\\";
20059
+ var APP_SECONDARY_WIDTH = "16rem";
20059
20060
  var NavRailContext = React126__namespace.createContext(null);
20060
20061
  function useNavRail() {
20061
20062
  const context = React126__namespace.useContext(NavRailContext);
@@ -20380,7 +20381,15 @@ var AppLayoutContent = React126__namespace.forwardRef(
20380
20381
  "data-panel-open": panelOpen,
20381
20382
  className: cn(
20382
20383
  "relative flex w-full flex-1 flex-col transition-[padding] duration-200 ease-linear",
20383
- !isMobile && "ps-(--nav-rail-width)",
20384
+ // Always reserve space for the NavRail plus the optional persistent
20385
+ // AppSecondary side panel. `--app-secondary-width` is set by an
20386
+ // `<AppSecondary>` instance when mounted, and falls back to 0px when
20387
+ // there is no AppSecondary on the current page.
20388
+ !isMobile && "ps-[calc(var(--nav-rail-width)+var(--app-secondary-width,0px))]",
20389
+ // When the hover NavPanel opens, push content over by the panel
20390
+ // width — but only when no AppSecondary is mounted (otherwise the
20391
+ // panel overlays the secondary visually and content stays put to
20392
+ // avoid layout jumpiness on hover).
20384
20393
  !isMobile && panelOpen && "ps-[calc(var(--nav-rail-width)+var(--nav-panel-width))]",
20385
20394
  className
20386
20395
  ),
@@ -20391,6 +20400,76 @@ var AppLayoutContent = React126__namespace.forwardRef(
20391
20400
  }
20392
20401
  );
20393
20402
  AppLayoutContent.displayName = "AppLayoutContent";
20403
+ var AppSecondary = React126__namespace.forwardRef(({ className, style, side = "start", widthVar = APP_SECONDARY_WIDTH, children, ...props }, ref) => {
20404
+ const { isMobile } = useNavRail();
20405
+ React126__namespace.useLayoutEffect(() => {
20406
+ if (typeof document === "undefined") return;
20407
+ document.documentElement.style.setProperty("--app-secondary-width", widthVar);
20408
+ return () => {
20409
+ document.documentElement.style.removeProperty("--app-secondary-width");
20410
+ };
20411
+ }, [widthVar]);
20412
+ if (isMobile) return null;
20413
+ return /* @__PURE__ */ jsxRuntime.jsx(
20414
+ "aside",
20415
+ {
20416
+ ref,
20417
+ "data-slot": "app-secondary",
20418
+ "data-side": side,
20419
+ "aria-label": "\u0646\u0648\u0627\u0631 \u062C\u0627\u0646\u0628\u06CC",
20420
+ className: cn(
20421
+ "bg-background-surface-100 text-foreground fixed inset-y-0 z-10 hidden flex-col border-e md:flex",
20422
+ // Position: just inside the rail on the matching side
20423
+ side === "start" && "start-(--nav-rail-width) border-s-0",
20424
+ side === "end" && "end-(--nav-rail-width) border-e-0 border-s",
20425
+ className
20426
+ ),
20427
+ style: {
20428
+ width: widthVar,
20429
+ ...style
20430
+ },
20431
+ ...props,
20432
+ children
20433
+ }
20434
+ );
20435
+ });
20436
+ AppSecondary.displayName = "AppSecondary";
20437
+ var AppSecondaryHeader = React126__namespace.forwardRef(
20438
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
20439
+ "div",
20440
+ {
20441
+ ref,
20442
+ "data-slot": "app-secondary-header",
20443
+ className: cn("flex h-12 shrink-0 items-center gap-2 border-b px-4", className),
20444
+ ...props
20445
+ }
20446
+ )
20447
+ );
20448
+ AppSecondaryHeader.displayName = "AppSecondaryHeader";
20449
+ var AppSecondaryContent = React126__namespace.forwardRef(
20450
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
20451
+ "div",
20452
+ {
20453
+ ref,
20454
+ "data-slot": "app-secondary-content",
20455
+ className: cn("flex flex-1 flex-col overflow-y-auto", className),
20456
+ ...props
20457
+ }
20458
+ )
20459
+ );
20460
+ AppSecondaryContent.displayName = "AppSecondaryContent";
20461
+ var AppSecondaryFooter = React126__namespace.forwardRef(
20462
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
20463
+ "div",
20464
+ {
20465
+ ref,
20466
+ "data-slot": "app-secondary-footer",
20467
+ className: cn("flex shrink-0 items-center gap-2 border-t px-4 py-3", className),
20468
+ ...props
20469
+ }
20470
+ )
20471
+ );
20472
+ AppSecondaryFooter.displayName = "AppSecondaryFooter";
20394
20473
  var NavRailTrigger = React126__namespace.forwardRef(
20395
20474
  ({ className, onClick, ...props }, ref) => {
20396
20475
  const { setOpenMobile } = useNavRail();
@@ -25913,6 +25992,10 @@ exports.AnimatedNumber = AnimatedNumber;
25913
25992
  exports.AppBar = AppBar;
25914
25993
  exports.AppLayout = AppLayout;
25915
25994
  exports.AppLayoutContent = AppLayoutContent;
25995
+ exports.AppSecondary = AppSecondary;
25996
+ exports.AppSecondaryContent = AppSecondaryContent;
25997
+ exports.AppSecondaryFooter = AppSecondaryFooter;
25998
+ exports.AppSecondaryHeader = AppSecondaryHeader;
25916
25999
  exports.AspectRatio = AspectRatio;
25917
26000
  exports.Autocomplete = Autocomplete;
25918
26001
  exports.Avatar = Avatar;