@discuss-ds/ui 0.17.0 → 0.18.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/index.d.cts CHANGED
@@ -453,11 +453,11 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
453
453
  }
454
454
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
455
455
 
456
- /** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch. */
457
- type TabNavigationVariant = 'filter' | 'toggle';
456
+ /** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch; `underline` is the page-level tab bar (give it the height of its bar, e.g. `h-16`; the active tab gets an accent underline). */
457
+ type TabNavigationVariant = 'filter' | 'toggle' | 'underline';
458
458
  declare const TabNavigationContext: React.Context<TabNavigationVariant>;
459
459
  declare const tabNavigationVariants: (props?: ({
460
- variant?: "filter" | "toggle" | null | undefined;
460
+ variant?: "filter" | "toggle" | "underline" | null | undefined;
461
461
  } & class_variance_authority_types.ClassProp) | undefined) => string;
462
462
  /** Radix `Tabs.Root` — owns the selected value; pair with `TabNavigation` + `TabItem` + `TabsContent`. */
463
463
  declare const Tabs: React.ForwardRefExoticComponent<Tabs$1.TabsProps & React.RefAttributes<HTMLDivElement>>;
@@ -906,7 +906,7 @@ interface TableCellTwoLinesProps extends React.HTMLAttributes<HTMLDivElement> {
906
906
  declare function TableCellTwoLines({ primary, secondary, avatar, className, ...props }: TableCellTwoLinesProps): React.JSX.Element;
907
907
 
908
908
  declare const statCardVariants: (props?: ({
909
- variant?: "default" | "warning" | null | undefined;
909
+ variant?: "default" | "subtle" | "warning" | null | undefined;
910
910
  } & class_variance_authority_types.ClassProp) | undefined) => string;
911
911
  interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof statCardVariants> {
912
912
  label: React.ReactNode;
package/dist/index.d.ts CHANGED
@@ -453,11 +453,11 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
453
453
  }
454
454
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
455
455
 
456
- /** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch. */
457
- type TabNavigationVariant = 'filter' | 'toggle';
456
+ /** `filter` is the pill-shaped table filter; `toggle` is the icon-only mode switch; `underline` is the page-level tab bar (give it the height of its bar, e.g. `h-16`; the active tab gets an accent underline). */
457
+ type TabNavigationVariant = 'filter' | 'toggle' | 'underline';
458
458
  declare const TabNavigationContext: React.Context<TabNavigationVariant>;
459
459
  declare const tabNavigationVariants: (props?: ({
460
- variant?: "filter" | "toggle" | null | undefined;
460
+ variant?: "filter" | "toggle" | "underline" | null | undefined;
461
461
  } & class_variance_authority_types.ClassProp) | undefined) => string;
462
462
  /** Radix `Tabs.Root` — owns the selected value; pair with `TabNavigation` + `TabItem` + `TabsContent`. */
463
463
  declare const Tabs: React.ForwardRefExoticComponent<Tabs$1.TabsProps & React.RefAttributes<HTMLDivElement>>;
@@ -906,7 +906,7 @@ interface TableCellTwoLinesProps extends React.HTMLAttributes<HTMLDivElement> {
906
906
  declare function TableCellTwoLines({ primary, secondary, avatar, className, ...props }: TableCellTwoLinesProps): React.JSX.Element;
907
907
 
908
908
  declare const statCardVariants: (props?: ({
909
- variant?: "default" | "warning" | null | undefined;
909
+ variant?: "default" | "subtle" | "warning" | null | undefined;
910
910
  } & class_variance_authority_types.ClassProp) | undefined) => string;
911
911
  interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof statCardVariants> {
912
912
  label: React.ReactNode;
package/dist/index.js CHANGED
@@ -1052,7 +1052,8 @@ var tabNavigationVariants = cva3("inline-flex items-start gap-1 p-0.5", {
1052
1052
  variants: {
1053
1053
  variant: {
1054
1054
  filter: "rounded-full border border-border bg-surface",
1055
- toggle: "rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5"
1055
+ toggle: "rounded-md bg-secondary bg-linear-to-r from-overlay-dark-5 to-overlay-dark-5",
1056
+ underline: "items-stretch p-0"
1056
1057
  }
1057
1058
  },
1058
1059
  defaultVariants: { variant: "filter" }
@@ -1069,6 +1070,7 @@ import { jsx as jsx21 } from "react/jsx-runtime";
1069
1070
  var base = "inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50";
1070
1071
  var filter = "rounded-full text-surface-foreground hover:text-accent data-[state=active]:bg-secondary data-[state=active]:bg-linear-to-r data-[state=active]:from-overlay-dark-5 data-[state=active]:to-overlay-dark-5 data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:bg-none data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
1071
1072
  var toggle = "rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground";
1073
+ var underline = "relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent";
1072
1074
  var TabItem = React20.forwardRef(
1073
1075
  ({ className, ...props }, ref) => {
1074
1076
  const variant = React20.useContext(TabNavigationContext);
@@ -1076,7 +1078,7 @@ var TabItem = React20.forwardRef(
1076
1078
  TabsPrimitive2.Trigger,
1077
1079
  {
1078
1080
  ref,
1079
- className: cn(base, variant === "toggle" ? toggle : filter, className),
1081
+ className: cn(base, variant === "toggle" ? toggle : variant === "underline" ? underline : filter, className),
1080
1082
  ...props
1081
1083
  }
1082
1084
  );
@@ -3355,6 +3357,8 @@ var statCardVariants = cva6("flex min-w-0 flex-col gap-2 rounded-md border p-3",
3355
3357
  variants: {
3356
3358
  variant: {
3357
3359
  default: "border-border bg-transparent",
3360
+ // A tinted card with no border, for stats on a white panel.
3361
+ subtle: "border-transparent bg-background",
3358
3362
  warning: "border-warning-soft-border bg-warning-soft"
3359
3363
  }
3360
3364
  },