@showwhat/configurator 1.0.0 → 1.0.1

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.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import { Condition, Definition, Definitions, Variation, Presets, ConditionEvaluator, Resolution } from 'showwhat';
2
2
  import { ClassValue } from 'clsx';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import * as class_variance_authority_types from 'class-variance-authority/types';
5
4
  import * as React$1 from 'react';
6
5
  import React__default, { Component, ReactNode, ErrorInfo, ComponentType } from 'react';
7
- import { VariantProps } from 'class-variance-authority';
8
6
  import { Select as Select$1, Separator as Separator$1, ScrollArea as ScrollArea$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1, Label as Label$1, Switch as Switch$1, Popover as Popover$1, Tabs as Tabs$1 } from 'radix-ui';
9
7
 
10
8
  type DefinitionListProps = {
@@ -115,11 +113,34 @@ declare const BUILTIN_CONDITION_TYPES: ConditionTypeMeta[];
115
113
  declare const CONDITION_TYPE_MAP: Map<string, ConditionTypeMeta>;
116
114
  declare function getConditionMeta(type: string): ConditionTypeMeta | undefined;
117
115
 
118
- declare const buttonVariants: (props?: ({
119
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
120
- size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
121
- } & class_variance_authority_types.ClassProp) | undefined) => string;
122
- declare function Button({ className, variant, size, asChild, ref, ...props }: React__default.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
116
+ declare const buttonVariantStyles: {
117
+ readonly default: "bg-primary text-primary-foreground hover:bg-primary/90";
118
+ readonly destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40";
119
+ readonly outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50";
120
+ readonly secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80";
121
+ readonly ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50";
122
+ readonly link: "text-primary underline-offset-4 hover:underline";
123
+ };
124
+ declare const buttonSizeStyles: {
125
+ readonly default: "h-9 px-4 py-2 has-[>svg]:px-3";
126
+ readonly xs: "h-6 gap-1 rounded px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3";
127
+ readonly sm: "h-8 gap-1.5 rounded px-3 has-[>svg]:px-2.5";
128
+ readonly lg: "h-10 rounded px-6 has-[>svg]:px-4";
129
+ readonly icon: "size-9";
130
+ readonly "icon-xs": "size-6 rounded [&_svg:not([class*='size-'])]:size-3";
131
+ readonly "icon-sm": "size-8";
132
+ readonly "icon-lg": "size-10";
133
+ };
134
+ type ButtonVariant = keyof typeof buttonVariantStyles;
135
+ type ButtonSize = keyof typeof buttonSizeStyles;
136
+ declare function buttonVariants(opts?: {
137
+ variant?: ButtonVariant;
138
+ size?: ButtonSize;
139
+ className?: string;
140
+ }): string;
141
+ declare function Button({ className, variant, size, asChild, ref, ...props }: React__default.ComponentProps<"button"> & {
142
+ variant?: ButtonVariant;
143
+ size?: ButtonSize;
123
144
  asChild?: boolean;
124
145
  }): react_jsx_runtime.JSX.Element;
125
146
 
@@ -136,10 +157,21 @@ declare function SelectLabel({ className, ...props }: React__default.ComponentPr
136
157
  declare function SelectItem({ className, children, ...props }: React__default.ComponentProps<typeof Select$1.Item>): react_jsx_runtime.JSX.Element;
137
158
  declare function SelectSeparator({ className, ...props }: React__default.ComponentProps<typeof Select$1.Separator>): react_jsx_runtime.JSX.Element;
138
159
 
139
- declare const badgeVariants: (props?: ({
140
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
141
- } & class_variance_authority_types.ClassProp) | undefined) => string;
142
- declare function Badge({ className, variant, asChild, ...props }: React__default.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
160
+ declare const badgeVariantStyles: {
161
+ readonly default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90";
162
+ readonly secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90";
163
+ readonly destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90";
164
+ readonly outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground";
165
+ readonly ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground";
166
+ readonly link: "text-primary underline-offset-4 [a&]:hover:underline";
167
+ };
168
+ type BadgeVariant = keyof typeof badgeVariantStyles;
169
+ declare function badgeVariants(opts?: {
170
+ variant?: BadgeVariant;
171
+ className?: string;
172
+ }): string;
173
+ declare function Badge({ className, variant, asChild, ...props }: React__default.ComponentProps<"span"> & {
174
+ variant?: BadgeVariant;
143
175
  asChild?: boolean;
144
176
  }): react_jsx_runtime.JSX.Element;
145
177
 
package/dist/index.js CHANGED
@@ -275,27 +275,20 @@ function OperatorSelect({ value, onChange, options, disabled }) {
275
275
  import { useCallback, useState } from "react";
276
276
 
277
277
  // src/components/ui/badge.tsx
278
- import { cva } from "class-variance-authority";
279
278
  import { Slot } from "radix-ui";
280
279
  import { jsx as jsx6 } from "react/jsx-runtime";
281
- var badgeVariants = cva(
282
- "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
283
- {
284
- variants: {
285
- variant: {
286
- default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
287
- secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
288
- destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
289
- outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
290
- ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
291
- link: "text-primary underline-offset-4 [a&]:hover:underline"
292
- }
293
- },
294
- defaultVariants: {
295
- variant: "default"
296
- }
297
- }
298
- );
280
+ var badgeBase = "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3";
281
+ var badgeVariantStyles = {
282
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
283
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
284
+ destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
285
+ outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
286
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
287
+ link: "text-primary underline-offset-4 [a&]:hover:underline"
288
+ };
289
+ function badgeVariants(opts) {
290
+ return cn(badgeBase, badgeVariantStyles[opts?.variant ?? "default"], opts?.className);
291
+ }
299
292
  function Badge({
300
293
  className,
301
294
  variant = "default",
@@ -910,38 +903,35 @@ function getConditionMeta(type) {
910
903
  }
911
904
 
912
905
  // src/components/ui/button.tsx
913
- import { cva as cva2 } from "class-variance-authority";
914
906
  import { Slot as Slot2 } from "radix-ui";
915
907
  import { jsx as jsx17 } from "react/jsx-runtime";
916
- var buttonVariants = cva2(
917
- "inline-flex shrink-0 items-center justify-center gap-2 rounded text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:cursor-pointer",
918
- {
919
- variants: {
920
- variant: {
921
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
922
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
923
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
924
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
925
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
926
- link: "text-primary underline-offset-4 hover:underline"
927
- },
928
- size: {
929
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
930
- xs: "h-6 gap-1 rounded px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
931
- sm: "h-8 gap-1.5 rounded px-3 has-[>svg]:px-2.5",
932
- lg: "h-10 rounded px-6 has-[>svg]:px-4",
933
- icon: "size-9",
934
- "icon-xs": "size-6 rounded [&_svg:not([class*='size-'])]:size-3",
935
- "icon-sm": "size-8",
936
- "icon-lg": "size-10"
937
- }
938
- },
939
- defaultVariants: {
940
- variant: "default",
941
- size: "default"
942
- }
943
- }
944
- );
908
+ var buttonBase = "inline-flex shrink-0 items-center justify-center gap-2 rounded text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:cursor-pointer";
909
+ var buttonVariantStyles = {
910
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
911
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
912
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
913
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
914
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
915
+ link: "text-primary underline-offset-4 hover:underline"
916
+ };
917
+ var buttonSizeStyles = {
918
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
919
+ xs: "h-6 gap-1 rounded px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
920
+ sm: "h-8 gap-1.5 rounded px-3 has-[>svg]:px-2.5",
921
+ lg: "h-10 rounded px-6 has-[>svg]:px-4",
922
+ icon: "size-9",
923
+ "icon-xs": "size-6 rounded [&_svg:not([class*='size-'])]:size-3",
924
+ "icon-sm": "size-8",
925
+ "icon-lg": "size-10"
926
+ };
927
+ function buttonVariants(opts) {
928
+ return cn(
929
+ buttonBase,
930
+ buttonVariantStyles[opts?.variant ?? "default"],
931
+ buttonSizeStyles[opts?.size ?? "default"],
932
+ opts?.className
933
+ );
934
+ }
945
935
  function Button({
946
936
  className,
947
937
  variant = "default",