lecom-ui 5.3.94 → 5.3.96

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/README.md CHANGED
@@ -1 +1 @@
1
- lecom-ui
1
+ lecom-ui
@@ -0,0 +1,94 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
4
+ import { cva } from 'class-variance-authority';
5
+ import { ChevronRight } from 'lucide-react';
6
+
7
+ const collapseTriggerVariants = cva(
8
+ "flex items-center justify-between w-full transition-all text-left outline-none data-[state=open]:font-semibold",
9
+ {
10
+ variants: {
11
+ size: {
12
+ small: "text-sm py-1.5 px-4 min-h-8",
13
+ medium: "text-base py-2.5 px-4 min-h-10",
14
+ large: "text-lg py-3 px-4 min-h-12"
15
+ },
16
+ ghost: {
17
+ true: "bg-transparent border-none",
18
+ false: "border-t-none border-grey-400"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ size: "large",
23
+ ghost: false
24
+ }
25
+ }
26
+ );
27
+ const CollapseRoot = AccordionPrimitive.Root;
28
+ const CollapseItem = AccordionPrimitive.Item;
29
+ const CollapsePanel = React.forwardRef(
30
+ ({
31
+ header,
32
+ children,
33
+ extra,
34
+ expandIconPosition = "start",
35
+ size = "large",
36
+ ghost = false,
37
+ disabled = false,
38
+ className,
39
+ ...props
40
+ }, ref) => /* @__PURE__ */ React.createElement(
41
+ CollapseItem,
42
+ {
43
+ ref,
44
+ ...props,
45
+ className: cn(
46
+ "group w-full",
47
+ disabled && "pointer-events-none opacity-50",
48
+ className
49
+ )
50
+ },
51
+ /* @__PURE__ */ React.createElement(AccordionPrimitive.Header, { asChild: true }, /* @__PURE__ */ React.createElement(
52
+ AccordionPrimitive.Trigger,
53
+ {
54
+ disabled,
55
+ className: cn(
56
+ collapseTriggerVariants({ size, ghost }),
57
+ "flex gap-2 items-center text-left font-normal"
58
+ )
59
+ },
60
+ /* @__PURE__ */ React.createElement(
61
+ "div",
62
+ {
63
+ className: cn(
64
+ "flex flex-1 items-center justify-between gap-4 w-full",
65
+ expandIconPosition === "end" ? "flex-row-reverse" : ""
66
+ )
67
+ },
68
+ /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 truncate" }, /* @__PURE__ */ React.createElement(
69
+ "span",
70
+ {
71
+ className: "flex items-center justify-center flex-shrink-0 min-w-4 min-h-4 transition-transform duration-300 group-data-[state=open]:rotate-90 text-grey-700 text-lg select-none font-normal"
72
+ },
73
+ /* @__PURE__ */ React.createElement(ChevronRight, { className: "size-4" })
74
+ ), /* @__PURE__ */ React.createElement("span", { className: "font-normal" }, header)),
75
+ extra && /* @__PURE__ */ React.createElement("div", { className: "text-sm text-grey-500" }, extra)
76
+ )
77
+ )),
78
+ /* @__PURE__ */ React.createElement(
79
+ AccordionPrimitive.Content,
80
+ {
81
+ className: cn(
82
+ "overflow-hidden data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up"
83
+ )
84
+ },
85
+ /* @__PURE__ */ React.createElement("div", { className: "text-sm text-grey-800 pt-2 pb-4 px-4" }, children)
86
+ )
87
+ )
88
+ );
89
+ CollapsePanel.displayName = "CollapsePanel";
90
+ const Collapse = Object.assign(CollapseRoot, {
91
+ Panel: CollapsePanel
92
+ });
93
+
94
+ export { Collapse, collapseTriggerVariants };
@@ -1,15 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { Button } from '../Button/Button.js';
3
+ import { Input } from '../Input/Input.js';
3
4
  import { Popover, PopoverTrigger, PopoverContent } from '../Popover/Popover.js';
4
5
  import { cn } from '../../lib/utils.js';
5
- import { format } from 'date-fns';
6
+ import { format, parse } from 'date-fns';
6
7
  import { CalendarIcon } from 'lucide-react';
7
8
  import { Calendar } from '../Calendar/Calendar.js';
8
9
 
9
10
  function DatePicker({
10
11
  className,
11
12
  locale,
12
- placeholder = "Pick a date",
13
+ placeholder,
13
14
  value,
14
15
  onChange,
15
16
  variant = "outlined",
@@ -19,19 +20,155 @@ function DatePicker({
19
20
  calendarVariant,
20
21
  calendarColor,
21
22
  format: format$1 = "PPP",
22
- status
23
+ status,
24
+ closeOnSelect = true,
25
+ allowManualInput = false
23
26
  }) {
24
27
  const [internalDate, setInternalDate] = React.useState();
25
- const isControlled = value !== void 0 && onChange !== void 0;
28
+ const [isOpen, setIsOpen] = React.useState(false);
29
+ const [inputValue, setInputValue] = React.useState("");
30
+ const [displayMonth, setDisplayMonth] = React.useState();
31
+ const inputRef = React.useRef(null);
32
+ const isControlled = onChange !== void 0;
26
33
  const date = isControlled ? value : internalDate;
34
+ React.useEffect(() => {
35
+ if (date) {
36
+ setInputValue(format(date, "dd/MM/yyyy", { locale }));
37
+ setDisplayMonth(date);
38
+ } else {
39
+ setInputValue("");
40
+ }
41
+ }, [date, locale]);
42
+ React.useEffect(() => {
43
+ if (isOpen && inputRef.current) {
44
+ setTimeout(() => {
45
+ inputRef.current?.focus();
46
+ }, 0);
47
+ }
48
+ }, [isOpen]);
27
49
  const handleSelect = (selected) => {
28
50
  if (isControlled && onChange) {
29
51
  onChange(selected);
30
52
  } else {
31
53
  setInternalDate(selected);
32
54
  }
55
+ if (closeOnSelect && selected) {
56
+ setIsOpen(false);
57
+ }
58
+ };
59
+ const handleInputChange = (e) => {
60
+ const input = e.target;
61
+ let rawValue = input.value;
62
+ const numbers = rawValue.replace(/\D/g, "");
63
+ let maskedValue = "";
64
+ if (numbers.length === 0) {
65
+ maskedValue = "";
66
+ } else if (numbers.length <= 2) {
67
+ maskedValue = numbers;
68
+ } else if (numbers.length <= 4) {
69
+ maskedValue = `${numbers.slice(0, 2)}/${numbers.slice(2)}`;
70
+ } else {
71
+ maskedValue = `${numbers.slice(0, 2)}/${numbers.slice(
72
+ 2,
73
+ 4
74
+ )}/${numbers.slice(4, 8)}`;
75
+ }
76
+ setInputValue(maskedValue);
77
+ if (maskedValue === "") {
78
+ if (isControlled && onChange) {
79
+ onChange(void 0);
80
+ } else {
81
+ setInternalDate(void 0);
82
+ }
83
+ return;
84
+ }
85
+ if (maskedValue.length === 10) {
86
+ try {
87
+ const parsedDate = parse(maskedValue, "dd/MM/yyyy", /* @__PURE__ */ new Date(), {
88
+ locale
89
+ });
90
+ if (!isNaN(parsedDate.getTime())) {
91
+ setDisplayMonth(parsedDate);
92
+ if (isControlled && onChange) {
93
+ onChange(parsedDate);
94
+ } else {
95
+ setInternalDate(parsedDate);
96
+ }
97
+ }
98
+ } catch {
99
+ }
100
+ }
101
+ };
102
+ const handleKeyDown = (e) => {
103
+ if (e.key === "Enter" && inputValue.length === 10) {
104
+ setIsOpen(false);
105
+ inputRef.current?.blur();
106
+ }
107
+ };
108
+ const handleInputBlur = () => {
109
+ if (date) {
110
+ setInputValue(format(date, "dd/MM/yyyy", { locale }));
111
+ } else {
112
+ setInputValue("");
113
+ }
33
114
  };
34
- return /* @__PURE__ */ React.createElement(Popover, null, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
115
+ const resolvedCalendarVariant = calendarVariant === "datepicker" ? variant : calendarVariant ?? variant;
116
+ if (allowManualInput) {
117
+ const inputVariant = variant === "outlined" ? "default" : variant === "filled" ? "filled" : "default";
118
+ return /* @__PURE__ */ React.createElement(Popover, { open: isOpen, onOpenChange: setIsOpen }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
119
+ "div",
120
+ {
121
+ style: {
122
+ borderRadius: 4,
123
+ borderColor: "bg-grey-500",
124
+ borderWidth: 1
125
+ },
126
+ className: cn(
127
+ "relative cursor-text",
128
+ className?.includes("w-full") ? "w-full" : "w-fit"
129
+ )
130
+ },
131
+ /* @__PURE__ */ React.createElement("div", { className: "absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 flex items-center justify-center pointer-events-none" }, /* @__PURE__ */ React.createElement(CalendarIcon, { className: "h-4 w-4 text-grey-600" })),
132
+ /* @__PURE__ */ React.createElement(
133
+ Input,
134
+ {
135
+ ref: inputRef,
136
+ value: inputValue,
137
+ onChange: handleInputChange,
138
+ onBlur: handleInputBlur,
139
+ onKeyDown: handleKeyDown,
140
+ placeholder,
141
+ variant: inputVariant,
142
+ className: cn(
143
+ "pl-10 border-none focus:border-none focus:ring-0",
144
+ className?.includes("w-full") ? "w-full" : "w-auto",
145
+ status === "error" && "border-red-600 focus:border-red-600 focus:ring-red-600",
146
+ className
147
+ )
148
+ }
149
+ )
150
+ )), /* @__PURE__ */ React.createElement(
151
+ PopoverContent,
152
+ {
153
+ className: "w-auto p-0 animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200",
154
+ align: "start"
155
+ },
156
+ /* @__PURE__ */ React.createElement(
157
+ Calendar,
158
+ {
159
+ mode: "single",
160
+ selected: date,
161
+ onSelect: handleSelect,
162
+ locale,
163
+ variant: resolvedCalendarVariant,
164
+ color: calendarColor ?? color ?? void 0,
165
+ month: displayMonth || date,
166
+ onMonthChange: setDisplayMonth
167
+ }
168
+ )
169
+ ));
170
+ }
171
+ return /* @__PURE__ */ React.createElement(Popover, { open: isOpen, onOpenChange: setIsOpen }, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
35
172
  Button,
36
173
  {
37
174
  variant: buttonVariant || variant,
@@ -53,7 +190,7 @@ function DatePicker({
53
190
  onSelect: handleSelect,
54
191
  autoFocus: true,
55
192
  locale,
56
- variant: calendarVariant || variant,
193
+ variant: resolvedCalendarVariant,
57
194
  color: calendarColor ?? color ?? void 0
58
195
  }
59
196
  )));
@@ -17,12 +17,14 @@ const NumberControl = ({
17
17
  className = "",
18
18
  labelClassName = "",
19
19
  info = false,
20
- labelPosition = "top"
20
+ labelPosition = "top",
21
+ disabled = false
21
22
  }) => {
22
23
  const defaultPlaceholder = maxDigits ? "0".repeat(maxDigits) : "0";
23
24
  const finalPlaceholder = placeholder ?? defaultPlaceholder;
24
- value.toString();
25
+ const displayValue = value.toString();
25
26
  const handleIncrement = () => {
27
+ if (disabled) return;
26
28
  const current = typeof value === "number" ? value : parseInt(value, 10) || min;
27
29
  if (max !== void 0 && current >= max) {
28
30
  return;
@@ -31,6 +33,7 @@ const NumberControl = ({
31
33
  onChange(newValue);
32
34
  };
33
35
  const handleDecrement = () => {
36
+ if (disabled) return;
34
37
  const current = typeof value === "number" ? value : parseInt(value, 10) || min;
35
38
  if (current <= min) {
36
39
  return;
@@ -56,6 +59,12 @@ const NumberControl = ({
56
59
  onChange(max.toString());
57
60
  }
58
61
  };
62
+ const handleBlur = () => {
63
+ const current = parseInt(displayValue, 10);
64
+ if (isNaN(current) || displayValue === "") {
65
+ onChange(min.toString());
66
+ }
67
+ };
59
68
  const labelElement = /* @__PURE__ */ React__default.createElement(
60
69
  Typography,
61
70
  {
@@ -72,6 +81,8 @@ const NumberControl = ({
72
81
  {
73
82
  value,
74
83
  onChange: (e) => handleInputChange(e.target.value),
84
+ onBlur: handleBlur,
85
+ disabled,
75
86
  className: "text-center flex-1 px-10 w-full",
76
87
  containerClassName: "w-full",
77
88
  placeholder: finalPlaceholder,
@@ -79,7 +90,10 @@ const NumberControl = ({
79
90
  Minus,
80
91
  {
81
92
  size: 18,
82
- className: "cursor-pointer hover:text-grey-800 transition-colors",
93
+ className: clsx(
94
+ "transition-colors",
95
+ disabled ? "cursor-not-allowed text-grey-400" : "cursor-pointer hover:text-grey-800"
96
+ ),
83
97
  onClick: handleDecrement
84
98
  }
85
99
  ),
@@ -87,7 +101,10 @@ const NumberControl = ({
87
101
  Plus,
88
102
  {
89
103
  size: 18,
90
- className: "cursor-pointer hover:text-grey-800 transition-colors",
104
+ className: clsx(
105
+ "transition-colors",
106
+ disabled ? "cursor-not-allowed text-grey-400" : "cursor-pointer hover:text-grey-800"
107
+ ),
91
108
  onClick: handleIncrement
92
109
  }
93
110
  )
package/dist/index.d.ts CHANGED
@@ -756,9 +756,9 @@ interface HeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<
756
756
  }
757
757
 
758
758
  declare const inputVariants: (props?: ({
759
- variant?: "default" | "filled" | "borderless" | null | undefined;
760
- size?: "default" | "small" | "large" | null | undefined;
761
- radius?: "default" | "small" | "large" | "full" | null | undefined;
759
+ variant?: "filled" | "default" | "borderless" | null | undefined;
760
+ size?: "small" | "large" | "default" | null | undefined;
761
+ radius?: "small" | "large" | "default" | "full" | null | undefined;
762
762
  } & class_variance_authority_types.ClassProp) | undefined) => string;
763
763
  interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'sufix' | 'prefix'>, VariantProps<typeof inputVariants> {
764
764
  sufix?: React$1.ReactNode;
@@ -951,8 +951,9 @@ interface NumberControlProps {
951
951
  labelClassName?: string;
952
952
  info?: boolean;
953
953
  labelPosition?: 'top' | 'bottom';
954
+ disabled?: boolean;
954
955
  }
955
- declare const NumberControl: ({ label, value, onChange, placeholder, required, min, max, maxDigits, className, labelClassName, info, labelPosition, }: NumberControlProps) => React__default.JSX.Element;
956
+ declare const NumberControl: ({ label, value, onChange, placeholder, required, min, max, maxDigits, className, labelClassName, info, labelPosition, disabled, }: NumberControlProps) => React__default.JSX.Element;
956
957
 
957
958
  declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
958
959
  declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
@@ -962,7 +963,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
962
963
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
963
964
 
964
965
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
965
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLSpanElement | HTMLLabelElement | HTMLParagraphElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLHeadingElement | HTMLUListElement | HTMLInputElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
966
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLDivElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
966
967
  className?: string;
967
968
  collapsedSize?: number | undefined;
968
969
  collapsible?: boolean | undefined;
@@ -1128,9 +1129,9 @@ declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.
1128
1129
  declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1129
1130
 
1130
1131
  declare const textareaVariants: (props?: ({
1131
- variant?: "default" | "filled" | "borderless" | null | undefined;
1132
- size?: "default" | "small" | "large" | null | undefined;
1133
- radius?: "default" | "small" | "large" | "full" | null | undefined;
1132
+ variant?: "filled" | "default" | "borderless" | null | undefined;
1133
+ size?: "small" | "large" | "default" | null | undefined;
1134
+ radius?: "small" | "large" | "default" | "full" | null | undefined;
1134
1135
  resize?: "default" | "both" | "horizontal" | "vertical" | "vertical-limited" | null | undefined;
1135
1136
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1136
1137
  interface TextareaProps extends React$1.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {
@@ -1256,8 +1257,10 @@ interface DatePickerProps {
1256
1257
  onChange?: (date: Date | undefined) => void;
1257
1258
  format?: string;
1258
1259
  status?: string;
1260
+ closeOnSelect?: boolean;
1261
+ allowManualInput?: boolean;
1259
1262
  }
1260
- declare function DatePicker({ className, locale, placeholder, value, onChange, variant, color, buttonVariant, buttonColor, calendarVariant, calendarColor, format, status, }: DatePickerProps): React$1.JSX.Element;
1263
+ declare function DatePicker({ className, locale, placeholder, value, onChange, variant, color, buttonVariant, buttonColor, calendarVariant, calendarColor, format, status, closeOnSelect, allowManualInput, }: DatePickerProps): React$1.JSX.Element;
1261
1264
  declare namespace DatePicker {
1262
1265
  var displayName: string;
1263
1266
  }
@@ -1268,7 +1271,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
1268
1271
  declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
1269
1272
  declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1270
1273
  declare const sheetVariants: (props?: ({
1271
- side?: "left" | "right" | "top" | "bottom" | null | undefined;
1274
+ side?: "top" | "bottom" | "right" | "left" | null | undefined;
1272
1275
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1273
1276
  interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
1274
1277
  }
@@ -1,79 +1,79 @@
1
- const extend = {
2
- colors: {
3
- background: 'hsl(var(--background))',
4
- foreground: 'hsl(var(--foreground))',
5
- card: {
6
- DEFAULT: 'hsl(var(--card))',
7
- foreground: 'hsl(var(--card-foreground))',
8
- },
9
- popover: {
10
- DEFAULT: 'hsl(var(--popover))',
11
- foreground: 'hsl(var(--popover-foreground))',
12
- },
13
- primary: {
14
- DEFAULT: 'hsl(var(--primary))',
15
- foreground: 'hsl(var(--primary-foreground))',
16
- },
17
- secondary: {
18
- DEFAULT: 'hsl(var(--secondary))',
19
- foreground: 'hsl(var(--secondary-foreground))',
20
- },
21
- muted: {
22
- DEFAULT: 'hsl(var(--muted))',
23
- foreground: 'hsl(var(--muted-foreground))',
24
- },
25
- accent: {
26
- DEFAULT: 'hsl(var(--accent))',
27
- foreground: 'hsl(var(--accent-foreground))',
28
- },
29
- destructive: {
30
- DEFAULT: 'hsl(var(--destructive))',
31
- foreground: 'hsl(var(--destructive-foreground))',
32
- },
33
- border: 'hsl(var(--border))',
34
- input: 'hsl(var(--input))',
35
- ring: 'hsl(var(--ring))',
36
- chart: {
37
- 1: 'hsl(var(--chart-1))',
38
- 2: 'hsl(var(--chart-2))',
39
- 3: 'hsl(var(--chart-3))',
40
- 4: 'hsl(var(--chart-4))',
41
- 5: 'hsl(var(--chart-5))',
42
- 6: 'hsl(var(--chart-6))',
43
- 7: 'hsl(var(--chart-7))',
44
- 8: 'hsl(var(--chart-8))',
45
- },
46
- sidebar: {
47
- DEFAULT: 'hsl(var(--sidebar-background))',
48
- foreground: 'hsl(var(--sidebar-foreground))',
49
- primary: 'hsl(var(--sidebar-primary))',
50
- 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
51
- accent: 'hsl(var(--sidebar-accent))',
52
- 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
53
- border: 'hsl(var(--sidebar-border))',
54
- ring: 'hsl(var(--sidebar-ring))',
55
- },
56
- },
57
- borderRadius: {
58
- lg: 'var(--radius)',
59
- md: 'calc(var(--radius) - 2px)',
60
- sm: 'calc(var(--radius) - 4px)',
61
- },
62
- keyframes: {
63
- 'accordion-down': {
64
- from: { height: '0' },
65
- to: { height: 'var(--radix-accordion-content-height)' },
66
- },
67
- 'accordion-up': {
68
- from: { height: 'var(--radix-accordion-content-height)' },
69
- to: { height: '0' },
70
- },
71
- },
72
- animation: {
73
- 'accordion-down': 'accordion-down 0.2s ease-out',
74
- 'accordion-up': 'accordion-up 0.2s ease-out',
75
- 'spin-slow': 'spin 2s linear infinite',
76
- },
77
- };
78
-
79
- export { extend };
1
+ const extend = {
2
+ colors: {
3
+ background: 'hsl(var(--background))',
4
+ foreground: 'hsl(var(--foreground))',
5
+ card: {
6
+ DEFAULT: 'hsl(var(--card))',
7
+ foreground: 'hsl(var(--card-foreground))',
8
+ },
9
+ popover: {
10
+ DEFAULT: 'hsl(var(--popover))',
11
+ foreground: 'hsl(var(--popover-foreground))',
12
+ },
13
+ primary: {
14
+ DEFAULT: 'hsl(var(--primary))',
15
+ foreground: 'hsl(var(--primary-foreground))',
16
+ },
17
+ secondary: {
18
+ DEFAULT: 'hsl(var(--secondary))',
19
+ foreground: 'hsl(var(--secondary-foreground))',
20
+ },
21
+ muted: {
22
+ DEFAULT: 'hsl(var(--muted))',
23
+ foreground: 'hsl(var(--muted-foreground))',
24
+ },
25
+ accent: {
26
+ DEFAULT: 'hsl(var(--accent))',
27
+ foreground: 'hsl(var(--accent-foreground))',
28
+ },
29
+ destructive: {
30
+ DEFAULT: 'hsl(var(--destructive))',
31
+ foreground: 'hsl(var(--destructive-foreground))',
32
+ },
33
+ border: 'hsl(var(--border))',
34
+ input: 'hsl(var(--input))',
35
+ ring: 'hsl(var(--ring))',
36
+ chart: {
37
+ 1: 'hsl(var(--chart-1))',
38
+ 2: 'hsl(var(--chart-2))',
39
+ 3: 'hsl(var(--chart-3))',
40
+ 4: 'hsl(var(--chart-4))',
41
+ 5: 'hsl(var(--chart-5))',
42
+ 6: 'hsl(var(--chart-6))',
43
+ 7: 'hsl(var(--chart-7))',
44
+ 8: 'hsl(var(--chart-8))',
45
+ },
46
+ sidebar: {
47
+ DEFAULT: 'hsl(var(--sidebar-background))',
48
+ foreground: 'hsl(var(--sidebar-foreground))',
49
+ primary: 'hsl(var(--sidebar-primary))',
50
+ 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
51
+ accent: 'hsl(var(--sidebar-accent))',
52
+ 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
53
+ border: 'hsl(var(--sidebar-border))',
54
+ ring: 'hsl(var(--sidebar-ring))',
55
+ },
56
+ },
57
+ borderRadius: {
58
+ lg: 'var(--radius)',
59
+ md: 'calc(var(--radius) - 2px)',
60
+ sm: 'calc(var(--radius) - 4px)',
61
+ },
62
+ keyframes: {
63
+ 'accordion-down': {
64
+ from: { height: '0' },
65
+ to: { height: 'var(--radix-accordion-content-height)' },
66
+ },
67
+ 'accordion-up': {
68
+ from: { height: 'var(--radix-accordion-content-height)' },
69
+ to: { height: '0' },
70
+ },
71
+ },
72
+ animation: {
73
+ 'accordion-down': 'accordion-down 0.2s ease-out',
74
+ 'accordion-up': 'accordion-up 0.2s ease-out',
75
+ 'spin-slow': 'spin 2s linear infinite',
76
+ },
77
+ };
78
+
79
+ export { extend };