@sustaina/shared-ui 1.40.0 → 1.40.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/index.d.mts CHANGED
@@ -152,7 +152,7 @@ declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
152
152
 
153
153
  declare const buttonVariants: (props?: ({
154
154
  variant?: "cancel" | "default" | "link" | "secondary" | "destructive" | "warning" | "cottonYellowDark" | "cottonGreen" | "cottonBlue" | "cottonRed" | "cottonAccent" | "cottonYellow" | "cottonBlack" | "defaultOutline" | "destructiveOutline" | "outline" | "ghost" | "defaultSelect" | null | undefined;
155
- size?: "default" | "option" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
155
+ size?: "default" | "option" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | "icon-rounded" | "icon-xs-rounded" | "icon-sm-rounded" | "icon-md-rounded" | "icon-lg-rounded" | null | undefined;
156
156
  active?: boolean | null | undefined;
157
157
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
158
158
  declare function Button({ className, variant, size, active, asChild, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -1559,11 +1559,11 @@ interface TruncatedMouseEnterDivProps {
1559
1559
  }
1560
1560
  declare const TruncatedMouseEnterDiv: ({ value, className, tooltipProps, tooltipContentProps, arrowClassName }: TruncatedMouseEnterDivProps) => react_jsx_runtime.JSX.Element;
1561
1561
 
1562
- type TabSelectItem<T extends string> = {
1562
+ type TabSelectItem<T extends string = string> = {
1563
1563
  id: T;
1564
1564
  label: string;
1565
1565
  };
1566
- interface TabSelectProps<T extends string> {
1566
+ interface TabSelectProps<T extends string = string> {
1567
1567
  items: TabSelectItem<T>[];
1568
1568
  onSelectTab: (state: T) => void;
1569
1569
  labelWrapperClassName?: string;
@@ -1571,7 +1571,7 @@ interface TabSelectProps<T extends string> {
1571
1571
  activeBorderClassName?: string;
1572
1572
  separatorClassName?: string;
1573
1573
  }
1574
- declare const TabSelect: <T extends string>({ items, onSelectTab, labelWrapperClassName, labelClassName, activeBorderClassName, separatorClassName, ...rest }: ComponentProps<"div"> & TabSelectProps<T>) => react_jsx_runtime.JSX.Element | null;
1574
+ declare const TabSelect: <T extends string = string>({ items, onSelectTab, labelWrapperClassName, labelClassName, activeBorderClassName, separatorClassName, ...rest }: ComponentProps<"div"> & TabSelectProps<T>) => react_jsx_runtime.JSX.Element | null;
1575
1575
 
1576
1576
  declare function isDefined<T>(value: T | null | undefined): value is NonNullable<T>;
1577
1577
  declare function isEmptyObject(value: any): boolean;
package/dist/index.d.ts CHANGED
@@ -152,7 +152,7 @@ declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
152
152
 
153
153
  declare const buttonVariants: (props?: ({
154
154
  variant?: "cancel" | "default" | "link" | "secondary" | "destructive" | "warning" | "cottonYellowDark" | "cottonGreen" | "cottonBlue" | "cottonRed" | "cottonAccent" | "cottonYellow" | "cottonBlack" | "defaultOutline" | "destructiveOutline" | "outline" | "ghost" | "defaultSelect" | null | undefined;
155
- size?: "default" | "option" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
155
+ size?: "default" | "option" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | "icon-rounded" | "icon-xs-rounded" | "icon-sm-rounded" | "icon-md-rounded" | "icon-lg-rounded" | null | undefined;
156
156
  active?: boolean | null | undefined;
157
157
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
158
158
  declare function Button({ className, variant, size, active, asChild, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -1559,11 +1559,11 @@ interface TruncatedMouseEnterDivProps {
1559
1559
  }
1560
1560
  declare const TruncatedMouseEnterDiv: ({ value, className, tooltipProps, tooltipContentProps, arrowClassName }: TruncatedMouseEnterDivProps) => react_jsx_runtime.JSX.Element;
1561
1561
 
1562
- type TabSelectItem<T extends string> = {
1562
+ type TabSelectItem<T extends string = string> = {
1563
1563
  id: T;
1564
1564
  label: string;
1565
1565
  };
1566
- interface TabSelectProps<T extends string> {
1566
+ interface TabSelectProps<T extends string = string> {
1567
1567
  items: TabSelectItem<T>[];
1568
1568
  onSelectTab: (state: T) => void;
1569
1569
  labelWrapperClassName?: string;
@@ -1571,7 +1571,7 @@ interface TabSelectProps<T extends string> {
1571
1571
  activeBorderClassName?: string;
1572
1572
  separatorClassName?: string;
1573
1573
  }
1574
- declare const TabSelect: <T extends string>({ items, onSelectTab, labelWrapperClassName, labelClassName, activeBorderClassName, separatorClassName, ...rest }: ComponentProps<"div"> & TabSelectProps<T>) => react_jsx_runtime.JSX.Element | null;
1574
+ declare const TabSelect: <T extends string = string>({ items, onSelectTab, labelWrapperClassName, labelClassName, activeBorderClassName, separatorClassName, ...rest }: ComponentProps<"div"> & TabSelectProps<T>) => react_jsx_runtime.JSX.Element | null;
1575
1575
 
1576
1576
  declare function isDefined<T>(value: T | null | undefined): value is NonNullable<T>;
1577
1577
  declare function isEmptyObject(value: any): boolean;
package/dist/index.js CHANGED
@@ -3013,25 +3013,65 @@ var ConditionNumberInput = ({ row, control, onClear }) => /* @__PURE__ */ jsxRun
3013
3013
  }
3014
3014
  }
3015
3015
  );
3016
- var cotton = "hover:ring-2 active:ring-0 focus-visible:ring-2 text-primary-foreground ";
3016
+ var cotton = "hover:ring-2 active:ring-0 focus-visible:ring-2 text-primary-foreground disabled:bg-sus-secondary-gray-5 disabled:text-sus-secondary-gray-8";
3017
+ var outline = "bg-none disabled:bg-none disabled:border-sus-secondary-gray-5 disabled:text-sus-secondary-gray-8";
3017
3018
  var buttonVariants = classVarianceAuthority.cva(
3018
- "disabled:bg-sus-secondary-gray-5 disabled:text-sus-secondary-gray-8 inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
3019
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
3019
3020
  {
3020
3021
  variants: {
3021
3022
  variant: {
3022
- default: cotton + "bg-sus-primary-green-9 hover:bg-sus-primary-green-8 hover:ring-sus-primary-green-8/20 focus-visible:ring-2 focus-visible:bg-sus-primary-green-8 active:bg-sus-primary-green-10 focus-visible:ring-sus-primary-green-10",
3023
- destructive: cotton + "bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3",
3024
- cancel: cotton + "bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3",
3025
- warning: cotton + "bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3",
3026
- cottonYellowDark: cotton + "bg-sus-button-yellowdark-2 hover:bg-sus-button-yellowdark-1 hover:ring-sus-button-yellowdark-1/20 focus-visible:ring-2 active:bg-sus-button-yellowdark-3 focus-visible:bg-sus-button-yellowdark-1 focus-visible:ring-sus-button-yellowdark-3",
3027
- cottonGreen: cotton + "bg-sus-button-green-2 hover:bg-sus-button-green-1 hover:ring-sus-button-green-1/20 focus-visible:ring-2 active:bg-sus-button-green-3 focus-visible:bg-sus-button-green-1 focus-visible:ring-sus-button-green-3",
3028
- cottonBlue: cotton + "bg-sus-button-blue-2 hover:bg-sus-button-blue-1 hover:ring-sus-button-blue-1/20 focus-visible:ring-2 active:bg-sus-button-blue-3 focus-visible:bg-sus-button-blue-1 focus-visible:ring-sus-button-blue-3",
3029
- cottonRed: cotton + "bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3",
3030
- cottonAccent: cotton + "bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3",
3031
- cottonYellow: cotton + "bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3",
3032
- cottonBlack: cotton + "bg-sus-button-black-2 hover:bg-sus-button-black-1 hover:ring-sus-button-black-1/20 focus-visible:ring-2 active:bg-sus-button-black-3 focus-visible:bg-sus-button-black-1 focus-visible:ring-sus-button-black-3",
3033
- defaultOutline: "border border-sus-primary-green-9 text-black hover:border-sus-primary-green-8 hover:text-sus-primary-green-8 active:border-sus-primary-green-9 active:text-black focus-visible:border-sus-primary-green-10 focus-visible:text-sus-primary-green-10",
3034
- destructiveOutline: "border border-sus-button-red-2 text-black hover:border-sus-button-red-1 hover:text-sus-button-red-1 active:border-sus-button-red-2 active:text-black focus-visible:border-sus-button-red-3 focus-visible:text-sus-button-red-3",
3023
+ default: cn(
3024
+ cotton,
3025
+ "bg-sus-primary-green-9 hover:bg-sus-primary-green-8 hover:ring-sus-primary-green-8/20 focus-visible:ring-2 focus-visible:bg-sus-primary-green-8 active:bg-sus-primary-green-10 focus-visible:ring-sus-primary-green-10"
3026
+ ),
3027
+ destructive: cn(
3028
+ cotton,
3029
+ "bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3"
3030
+ ),
3031
+ cancel: cn(
3032
+ cotton,
3033
+ "bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3"
3034
+ ),
3035
+ warning: cn(
3036
+ cotton,
3037
+ "bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3"
3038
+ ),
3039
+ cottonYellowDark: cn(
3040
+ cotton,
3041
+ "bg-sus-button-yellowdark-2 hover:bg-sus-button-yellowdark-1 hover:ring-sus-button-yellowdark-1/20 focus-visible:ring-2 active:bg-sus-button-yellowdark-3 focus-visible:bg-sus-button-yellowdark-1 focus-visible:ring-sus-button-yellowdark-3"
3042
+ ),
3043
+ cottonGreen: cn(
3044
+ cotton,
3045
+ "bg-sus-button-green-2 hover:bg-sus-button-green-1 hover:ring-sus-button-green-1/20 focus-visible:ring-2 active:bg-sus-button-green-3 focus-visible:bg-sus-button-green-1 focus-visible:ring-sus-button-green-3"
3046
+ ),
3047
+ cottonBlue: cn(
3048
+ cotton,
3049
+ "bg-sus-button-blue-2 hover:bg-sus-button-blue-1 hover:ring-sus-button-blue-1/20 focus-visible:ring-2 active:bg-sus-button-blue-3 focus-visible:bg-sus-button-blue-1 focus-visible:ring-sus-button-blue-3"
3050
+ ),
3051
+ cottonRed: cn(
3052
+ cotton,
3053
+ "bg-sus-button-red-2 hover:bg-sus-button-red-1 hover:ring-sus-button-red-1/20 focus-visible:ring-2 active:bg-sus-button-red-3 focus-visible:bg-sus-button-red-1 focus-visible:ring-sus-button-red-3"
3054
+ ),
3055
+ cottonAccent: cn(
3056
+ cotton,
3057
+ "bg-sus-button-accent-2 hover:bg-sus-button-accent-1 hover:ring-sus-button-accent-1/20 focus-visible:ring-2 active:bg-sus-button-accent-3 focus-visible:bg-sus-button-accent-1 focus-visible:ring-sus-button-accent-3"
3058
+ ),
3059
+ cottonYellow: cn(
3060
+ cotton,
3061
+ "bg-sus-button-yellow-2 hover:bg-sus-button-yellow-1 hover:ring-sus-button-yellow-1/20 focus-visible:ring-2 active:bg-sus-button-yellow-3 focus-visible:bg-sus-button-yellow-1 focus-visible:ring-sus-button-yellow-3"
3062
+ ),
3063
+ cottonBlack: cn(
3064
+ cotton,
3065
+ "bg-sus-button-black-2 hover:bg-sus-button-black-1 hover:ring-sus-button-black-1/20 focus-visible:ring-2 active:bg-sus-button-black-3 focus-visible:bg-sus-button-black-1 focus-visible:ring-sus-button-black-3"
3066
+ ),
3067
+ defaultOutline: cn(
3068
+ outline,
3069
+ "border border-sus-primary-green-9 text-black hover:border-sus-primary-green-8 hover:text-sus-primary-green-8 active:border-sus-primary-green-9 active:text-black focus-visible:border-sus-primary-green-10 focus-visible:text-sus-primary-green-10"
3070
+ ),
3071
+ destructiveOutline: cn(
3072
+ outline,
3073
+ "border border-sus-button-red-2 text-black hover:border-sus-button-red-1 hover:text-sus-button-red-1 active:border-sus-button-red-2 active:text-black focus-visible:border-sus-button-red-3 focus-visible:text-sus-button-red-3"
3074
+ ),
3035
3075
  outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
3036
3076
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
3037
3077
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
@@ -3043,11 +3083,16 @@ var buttonVariants = classVarianceAuthority.cva(
3043
3083
  option: "py-5 h-9 px-4 has-[>svg]:px-3",
3044
3084
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
3045
3085
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
3046
- icon: "size-9 rounded-full",
3047
- "icon-xs": "size-5 rounded-full",
3048
- "icon-sm": "size-[22px] rounded-full",
3049
- "icon-md": "size-9 rounded-full",
3050
- "icon-lg": "size-10 rounded-full"
3086
+ icon: "size-9",
3087
+ "icon-xs": "size-5",
3088
+ "icon-sm": "size-[22px]",
3089
+ "icon-md": "size-9",
3090
+ "icon-lg": "size-10",
3091
+ "icon-rounded": "size-9 rounded-full",
3092
+ "icon-xs-rounded": "size-5 rounded-full",
3093
+ "icon-sm-rounded": "size-[22px] rounded-full",
3094
+ "icon-md-rounded": "size-9 rounded-full",
3095
+ "icon-lg-rounded": "size-10 rounded-full"
3051
3096
  },
3052
3097
  active: {
3053
3098
  true: "",
@@ -10350,7 +10395,8 @@ var FormulaEditor = ({
10350
10395
  {
10351
10396
  type: "button",
10352
10397
  onClick: () => insertOperator(operator.value),
10353
- className: "min-w-10 rounded-sm px-3 bg-sus-blue-3",
10398
+ variant: "cottonBlue",
10399
+ className: "min-w-10 rounded-sm px-3",
10354
10400
  disabled: isEditorDisabled,
10355
10401
  children: operator.label
10356
10402
  },
@@ -12827,7 +12873,7 @@ var TabSelect = ({
12827
12873
  {
12828
12874
  hidden: index >= items.length - 1,
12829
12875
  orientation: "vertical",
12830
- className: cn("h-[70%]! mx-3.5 bg-sus-secondary-gray-3", separatorClassName)
12876
+ className: cn("h-[70%]! mx-2 bg-sus-secondary-gray-3", separatorClassName)
12831
12877
  }
12832
12878
  )
12833
12879
  ] }, `key-${index}`);