lecom-ui 5.3.57 → 5.3.58

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.
@@ -1,94 +0,0 @@
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 };