@xwadex/fesd-next 0.3.26 → 0.3.28

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.
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../shadcns/lib/utils";
5
+ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_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 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
9
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10
+ 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",
11
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
12
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
13
+ link: "text-primary underline-offset-4 hover:underline",
14
+ },
15
+ size: {
16
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
17
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
18
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
19
+ icon: "size-9",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "default",
25
+ },
26
+ });
27
+ function Button({ className, variant, size, asChild = false, ...props }) {
28
+ const Comp = asChild ? Slot : "button";
29
+ return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
30
+ }
31
+ export { Button, buttonVariants };
@@ -1,3 +1,3 @@
1
- export * from "./accordions";
1
+ export * from "./button";
2
2
  export * from "./dragResize";
3
3
  export * from "./dragSortable";
@@ -1,3 +1,3 @@
1
- export * from "./accordions";
1
+ export * from "./button";
2
2
  export * from "./dragResize";
3
3
  export * from "./dragSortable";
@@ -3,14 +3,13 @@ export interface CollapseTypes {
3
3
  transDuration?: number;
4
4
  transTiming?: string;
5
5
  transMode?: "fade" | "normal";
6
+ transMounted?: boolean;
6
7
  transDelay?: number;
7
- onInit?: (isInit: boolean) => void;
8
- onChange?: (isOpen: boolean) => void;
9
- onExpand?: (isOpen: boolean) => void;
10
- onClose?: (isOpen: boolean) => void;
8
+ active?: boolean;
9
+ onChange?: (state: boolean) => void;
11
10
  }
12
- export declare function useCollapse({ defaultOpen, transDuration, transTiming, transMode, transDelay, onInit, onChange, onExpand, onClose, }: CollapseTypes): {
11
+ export declare function useCollapse({ defaultOpen, transMounted, transDuration, transTiming, transMode, transDelay, active, }: CollapseTypes): {
13
12
  setOpen: (state: boolean) => void;
14
- contentRef: import("react").RefObject<HTMLDivElement | null>;
15
13
  open: boolean;
14
+ contentRef: import("react").RefObject<HTMLDivElement | null>;
16
15
  };
@@ -1,74 +1,52 @@
1
1
  "use client";
2
- import { useCallback, useState, useRef, useEffect, startTransition } from "react";
3
- import { getDomTransTime, sleep } from "../utils/index.js";
4
- export function useCollapse({ defaultOpen = false, transDuration = 0.3, transTiming = "cubic-bezier(.24,0,0,.99)", transMode = "normal", transDelay = 0, onInit, onChange, onExpand, onClose, }) {
2
+ import { useState, useRef, useEffect } from "react";
3
+ export function useCollapse({ defaultOpen = false, transMounted, transDuration = 300, transTiming = "cubic-bezier(.24,0,0,.99)", transMode = "normal", transDelay = 0, active, }) {
4
+ const [open, setOpen] = useState(defaultOpen);
5
+ const isActive = typeof active === "boolean";
6
+ const readyOpen = isActive ? active : open;
5
7
  const contentRef = useRef(null);
6
- const isMountedRef = useRef(false);
7
8
  const isAnimatingRef = useRef(false);
8
- const nextOpenRef = useRef(null);
9
- const [open, setOpen] = useState(defaultOpen);
10
- const setOpenState = useCallback((state) => {
11
- if (!isAnimatingRef.current)
12
- return setOpen(state);
13
- nextOpenRef.current = state;
14
- }, [open]);
15
- const setExpandTransition = useCallback((events) => {
16
- const target = contentRef.current;
17
- if (!target)
9
+ const setOpenHandler = (state) => {
10
+ if (isAnimatingRef.current)
18
11
  return;
19
- if (events === "start") {
20
- target.style.maxHeight = target.scrollHeight + "px";
21
- target.style.opacity = transMode == "fade" ? "1" : "";
22
- }
23
- if (events === "open") {
24
- target.style.maxHeight = "none";
25
- target.style.opacity = transMode == "fade" ? "1" : "";
26
- }
27
- if (events === "close") {
28
- target.style.maxHeight = "0";
29
- target.style.opacity = transMode == "fade" ? "0" : "";
30
- }
31
- target.offsetHeight; // hack to force reflow
32
- }, [transMode]);
33
- const expandAnimate = useCallback(async (state) => {
34
- if (!contentRef?.current)
12
+ if (state === readyOpen)
35
13
  return;
36
14
  isAnimatingRef.current = true;
37
- onChange?.(state);
38
- setExpandTransition("start");
39
- const target = contentRef.current;
40
- await sleep(state ? getDomTransTime(target) : 0);
41
- setExpandTransition(state ? "open" : "close");
42
- state ? onExpand?.(state) : onClose?.(state);
43
- isAnimatingRef.current = false;
44
- const nextState = nextOpenRef.current;
45
- if (nextState == null || nextState == state)
46
- return;
47
- nextOpenRef.current = null;
48
- setOpen(nextState);
49
- }, [setExpandTransition, onChange, onExpand, onClose]);
15
+ requestAnimationFrame(() => {
16
+ setOpen(state);
17
+ });
18
+ };
50
19
  useEffect(() => {
51
20
  const target = contentRef.current;
52
21
  if (!target)
53
22
  return;
54
23
  target.style.overflow = "hidden";
55
- target.style.transition = transDuration + "s";
56
- target.style.transitionDelay = transDelay + "s";
24
+ target.style.transition = transDuration + "ms";
25
+ target.style.transitionDelay = transDelay + "ms";
57
26
  target.style.transitionTimingFunction = transTiming;
58
- if (defaultOpen)
59
- startTransition(() => setExpandTransition("start"));
60
27
  }, []);
61
28
  useEffect(() => {
62
- if (!isMountedRef.current) {
63
- isMountedRef.current = true;
64
- onInit?.(true);
29
+ const target = contentRef.current;
30
+ if (!target)
65
31
  return;
66
- }
67
- startTransition(() => expandAnimate(open));
68
- }, [open]);
32
+ isAnimatingRef.current = true;
33
+ if (transMode === "fade")
34
+ target.style.opacity = readyOpen ? "0" : "1";
35
+ target.style.maxHeight = readyOpen ? "0px" : target.scrollHeight + "px";
36
+ requestAnimationFrame(() => {
37
+ if (transMode === "fade")
38
+ target.style.opacity = readyOpen ? "1" : "0";
39
+ target.style.maxHeight = readyOpen ? target.scrollHeight + "px" : "0px";
40
+ });
41
+ const timer = setTimeout(() => {
42
+ target.style.maxHeight = readyOpen ? "none" : "0px";
43
+ isAnimatingRef.current = false;
44
+ }, transDuration);
45
+ return () => clearTimeout(timer);
46
+ }, [readyOpen, transDuration]);
69
47
  return {
70
- setOpen: setOpenState,
48
+ setOpen: setOpenHandler,
49
+ open: readyOpen,
71
50
  contentRef,
72
- open
73
51
  };
74
52
  }
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(...inputs));
5
+ }
@@ -0,0 +1,148 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ html,
7
+ body {
8
+ max-width: 100vw;
9
+ overflow-x: hidden;
10
+ }
11
+
12
+ body {
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ }
16
+
17
+ * {
18
+ box-sizing: border-box;
19
+ padding: 0;
20
+ margin: 0;
21
+ }
22
+
23
+ a {
24
+ color: inherit;
25
+ text-decoration: none;
26
+ }
27
+
28
+ @media (prefers-color-scheme: dark) {
29
+ html {
30
+ color-scheme: dark;
31
+ }
32
+ }
33
+
34
+ @theme inline {
35
+ --radius-sm: calc(var(--radius) - 4px);
36
+ --radius-md: calc(var(--radius) - 2px);
37
+ --radius-lg: var(--radius);
38
+ --radius-xl: calc(var(--radius) + 4px);
39
+ --color-background: var(--background);
40
+ --color-foreground: var(--foreground);
41
+ --color-card: var(--card);
42
+ --color-card-foreground: var(--card-foreground);
43
+ --color-popover: var(--popover);
44
+ --color-popover-foreground: var(--popover-foreground);
45
+ --color-primary: var(--primary);
46
+ --color-primary-foreground: var(--primary-foreground);
47
+ --color-secondary: var(--secondary);
48
+ --color-secondary-foreground: var(--secondary-foreground);
49
+ --color-muted: var(--muted);
50
+ --color-muted-foreground: var(--muted-foreground);
51
+ --color-accent: var(--accent);
52
+ --color-accent-foreground: var(--accent-foreground);
53
+ --color-destructive: var(--destructive);
54
+ --color-border: var(--border);
55
+ --color-input: var(--input);
56
+ --color-ring: var(--ring);
57
+ --color-chart-1: var(--chart-1);
58
+ --color-chart-2: var(--chart-2);
59
+ --color-chart-3: var(--chart-3);
60
+ --color-chart-4: var(--chart-4);
61
+ --color-chart-5: var(--chart-5);
62
+ --color-sidebar: var(--sidebar);
63
+ --color-sidebar-foreground: var(--sidebar-foreground);
64
+ --color-sidebar-primary: var(--sidebar-primary);
65
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
66
+ --color-sidebar-accent: var(--sidebar-accent);
67
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
68
+ --color-sidebar-border: var(--sidebar-border);
69
+ --color-sidebar-ring: var(--sidebar-ring);
70
+ }
71
+
72
+ :root {
73
+ --radius: 0.625rem;
74
+ --card: oklch(1 0 0);
75
+ --card-foreground: oklch(0.145 0 0);
76
+ --popover: oklch(1 0 0);
77
+ --popover-foreground: oklch(0.145 0 0);
78
+ --primary: oklch(0.205 0 0);
79
+ --primary-foreground: oklch(0.985 0 0);
80
+ --secondary: oklch(0.97 0 0);
81
+ --secondary-foreground: oklch(0.205 0 0);
82
+ --muted: oklch(0.97 0 0);
83
+ --muted-foreground: oklch(0.556 0 0);
84
+ --accent: oklch(0.97 0 0);
85
+ --accent-foreground: oklch(0.205 0 0);
86
+ --destructive: oklch(0.577 0.245 27.325);
87
+ --border: oklch(0.922 0 0);
88
+ --input: oklch(0.922 0 0);
89
+ --ring: oklch(0.708 0 0);
90
+ --chart-1: oklch(0.646 0.222 41.116);
91
+ --chart-2: oklch(0.6 0.118 184.704);
92
+ --chart-3: oklch(0.398 0.07 227.392);
93
+ --chart-4: oklch(0.828 0.189 84.429);
94
+ --chart-5: oklch(0.769 0.188 70.08);
95
+ --sidebar: oklch(0.985 0 0);
96
+ --sidebar-foreground: oklch(0.145 0 0);
97
+ --sidebar-primary: oklch(0.205 0 0);
98
+ --sidebar-primary-foreground: oklch(0.985 0 0);
99
+ --sidebar-accent: oklch(0.97 0 0);
100
+ --sidebar-accent-foreground: oklch(0.205 0 0);
101
+ --sidebar-border: oklch(0.922 0 0);
102
+ --sidebar-ring: oklch(0.708 0 0);
103
+ --background: oklch(1 0 0);
104
+ --foreground: oklch(0.145 0 0);
105
+ }
106
+
107
+ .dark {
108
+ --background: oklch(0.145 0 0);
109
+ --foreground: oklch(0.985 0 0);
110
+ --card: oklch(0.205 0 0);
111
+ --card-foreground: oklch(0.985 0 0);
112
+ --popover: oklch(0.205 0 0);
113
+ --popover-foreground: oklch(0.985 0 0);
114
+ --primary: oklch(0.922 0 0);
115
+ --primary-foreground: oklch(0.205 0 0);
116
+ --secondary: oklch(0.269 0 0);
117
+ --secondary-foreground: oklch(0.985 0 0);
118
+ --muted: oklch(0.269 0 0);
119
+ --muted-foreground: oklch(0.708 0 0);
120
+ --accent: oklch(0.269 0 0);
121
+ --accent-foreground: oklch(0.985 0 0);
122
+ --destructive: oklch(0.704 0.191 22.216);
123
+ --border: oklch(1 0 0 / 10%);
124
+ --input: oklch(1 0 0 / 15%);
125
+ --ring: oklch(0.556 0 0);
126
+ --chart-1: oklch(0.488 0.243 264.376);
127
+ --chart-2: oklch(0.696 0.17 162.48);
128
+ --chart-3: oklch(0.769 0.188 70.08);
129
+ --chart-4: oklch(0.627 0.265 303.9);
130
+ --chart-5: oklch(0.645 0.246 16.439);
131
+ --sidebar: oklch(0.205 0 0);
132
+ --sidebar-foreground: oklch(0.985 0 0);
133
+ --sidebar-primary: oklch(0.488 0.243 264.376);
134
+ --sidebar-primary-foreground: oklch(0.985 0 0);
135
+ --sidebar-accent: oklch(0.269 0 0);
136
+ --sidebar-accent-foreground: oklch(0.985 0 0);
137
+ --sidebar-border: oklch(1 0 0 / 10%);
138
+ --sidebar-ring: oklch(0.556 0 0);
139
+ }
140
+
141
+ @layer base {
142
+ * {
143
+ @apply border-border outline-ring/50;
144
+ }
145
+ body {
146
+ @apply bg-background text-foreground;
147
+ }
148
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwadex/fesd-next",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,6 +24,12 @@
24
24
  "./types": {
25
25
  "import": "./dist/types/index.js",
26
26
  "types": "./dist/types/index.d.ts"
27
+ },
28
+ "./styles": {
29
+ "default": "./dist/styles/defaults.css"
30
+ },
31
+ "./styles/*": {
32
+ "default": "./dist/styles/*"
27
33
  }
28
34
  },
29
35
  "files": [
@@ -37,9 +43,16 @@
37
43
  "peerDependencies": {
38
44
  "react": ">=18",
39
45
  "react-dom": ">=18",
40
- "next": ">=15.3.3",
41
- "tua-body-scroll-lock": ">=1.5.3",
42
- "react-sortablejs": ">=6.1.4",
43
- "motion": ">12.18.1"
46
+ "next": ">=13",
47
+ "@radix-ui/react-accordion": "^1.2.11",
48
+ "@radix-ui/react-slot": "^1.2.3",
49
+ "tailwindcss": ">=3",
50
+ "postcss": ">=8",
51
+ "class-variance-authority": "^0.7.1",
52
+ "clsx": "^2.1.1",
53
+ "tailwind-merge": "^3.3.1",
54
+ "tua-body-scroll-lock": "^1.5.3",
55
+ "react-sortablejs": "^6.1.4",
56
+ "motion": "^12.18.1"
44
57
  }
45
58
  }
@@ -1,11 +0,0 @@
1
- import { CollapseTypes } from "../../hooks/index.js";
2
- import type { AsPropsTypes } from "../../types/index.js";
3
- type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
4
- as?: React.ElementType;
5
- children?: React.ReactNode;
6
- defaultActive?: boolean;
7
- active?: boolean;
8
- } & CollapseTypes>;
9
- declare const AccordionsBase: <T extends React.ElementType = "div">(props: PropsTypes<T>) => import("react/jsx-runtime").JSX.Element;
10
- declare const Accordions: React.MemoExoticComponent<typeof AccordionsBase>;
11
- export default Accordions;
@@ -1,46 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useCallback, useMemo, memo, useEffect, startTransition } from "react";
4
- import { AccordionsContext } from "./accordionsContext";
5
- import { useCollapse } from "../../hooks/index.js";
6
- const AccordionsBase = (props) => {
7
- const { as, children, defaultActive = false, active, transDuration, transTiming, transMode, transDelay, onInit, onChange, onExpand, onClose, ...othersProps } = props;
8
- const RootComponent = as || "div";
9
- const isActive = typeof active == "boolean";
10
- const defaultOpen = isActive ? active : defaultActive;
11
- const { setOpen, open, contentRef, } = useCollapse({
12
- defaultOpen,
13
- transDuration,
14
- transTiming,
15
- transMode,
16
- transDelay,
17
- onInit,
18
- onChange,
19
- onExpand,
20
- onClose
21
- });
22
- const isOpen = isActive ? active : open;
23
- const setExpand = useCallback((state) => {
24
- const nextOpen = typeof state === "boolean" ? state : !isOpen;
25
- if (nextOpen === isOpen)
26
- return;
27
- if (!isActive)
28
- return setOpen(nextOpen);
29
- startTransition(() => setOpen(nextOpen));
30
- }, [isOpen, isActive, setOpen]);
31
- useEffect(() => {
32
- if ((isActive && active) || defaultActive)
33
- setOpen(true);
34
- }, []);
35
- useEffect(() => {
36
- setOpen(isOpen);
37
- }, [isOpen]);
38
- const contextValue = useMemo(() => ({
39
- contentRef,
40
- setExpand
41
- }), [setExpand]);
42
- return (_jsx(AccordionsContext, { value: contextValue, children: _jsx(RootComponent, { ...othersProps, children: children }) }));
43
- };
44
- const Accordions = memo(AccordionsBase);
45
- Accordions.displayName = "Accordions";
46
- export default Accordions;
@@ -1,9 +0,0 @@
1
- import type { AsPropsTypes } from "../../types/index.js";
2
- type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
3
- as?: React.ElementType;
4
- clickActive?: boolean;
5
- children?: React.ReactNode;
6
- }>;
7
- declare const AccordionsButtonBase: <T extends React.ElementType = "div">(props: PropsTypes<T>) => import("react/jsx-runtime").JSX.Element;
8
- declare const AccordionsButton: React.MemoExoticComponent<typeof AccordionsButtonBase>;
9
- export default AccordionsButton;
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { memo } from "react";
4
- import { useAccordionsContext } from "./accordionsContext";
5
- const AccordionsButtonBase = (props) => {
6
- const { as, clickActive, children, ...othersProps } = props;
7
- const RootComponent = as || "div";
8
- const { setExpand } = useAccordionsContext();
9
- return (_jsx(RootComponent, { ...othersProps, onClick: () => setExpand(clickActive), children: children }));
10
- };
11
- const AccordionsButton = memo(AccordionsButtonBase);
12
- AccordionsButton.displayName = "AccordionsButton";
13
- export default AccordionsButton;
@@ -1,8 +0,0 @@
1
- import type { AsPropsTypes } from "../../types/index.js";
2
- type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
3
- as?: React.ElementType;
4
- children?: React.ReactNode;
5
- }>;
6
- declare const AccordionsContentBase: <T extends React.ElementType = "div">(props: PropsTypes<T>) => import("react/jsx-runtime").JSX.Element;
7
- declare const AccordionsContent: React.MemoExoticComponent<typeof AccordionsContentBase>;
8
- export default AccordionsContent;
@@ -1,18 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { memo } from "react";
4
- import { useAccordionsContext } from "./accordionsContext";
5
- const AccordionsContentBase = (props) => {
6
- const { as, children, className, style, ...othersProps } = props;
7
- const RootComponent = as || "div";
8
- const { contentRef } = useAccordionsContext();
9
- return (_jsx(RootComponent, { ...othersProps, ref: contentRef, style: {
10
- ...style,
11
- overflow: "hidden",
12
- maxWith: "100%",
13
- maxHeight: "0"
14
- }, children: children }));
15
- };
16
- const AccordionsContent = memo(AccordionsContentBase);
17
- AccordionsContent.displayName = "AccordionsContent";
18
- export default AccordionsContent;
@@ -1,15 +0,0 @@
1
- export interface AccordionsContextType {
2
- time?: number;
3
- timingFunction?: string;
4
- contentRef: React.RefObject<HTMLDivElement | null>;
5
- defaultActive?: boolean;
6
- isActive?: boolean;
7
- setExpand: (state?: boolean) => void;
8
- }
9
- export declare const AccordionsContext: import("react").Context<AccordionsContextType | undefined> & {
10
- displayName: string;
11
- };
12
- export declare const useAccordionsContext: () => AccordionsContextType;
13
- export declare const useAccordionsExpand: () => {
14
- setAccordionsExpand: (state?: boolean) => void;
15
- };
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { use, createContext } from "react";
3
- export const AccordionsContext = Object.assign(createContext(undefined), { displayName: "AccordionsContext" });
4
- export const useAccordionsContext = () => {
5
- const context = use(AccordionsContext);
6
- if (context)
7
- return context;
8
- throw new Error("AccordionsContext is not defined!!");
9
- };
10
- export const useAccordionsExpand = () => {
11
- const { setExpand } = useAccordionsContext();
12
- return { setAccordionsExpand: setExpand };
13
- };
@@ -1,8 +0,0 @@
1
- import type { AsPropsTypes } from "../../types/index.js";
2
- type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
3
- as?: React.ElementType;
4
- children?: React.ReactNode;
5
- }>;
6
- declare const AccordionsHeaderBase: <T extends React.ElementType = "div">(props: PropsTypes<T>) => import("react/jsx-runtime").JSX.Element;
7
- declare const AccordionsHeader: React.MemoExoticComponent<typeof AccordionsHeaderBase>;
8
- export default AccordionsHeader;
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { memo } from "react";
4
- import { useAccordionsContext } from "./accordionsContext";
5
- const AccordionsHeaderBase = (props) => {
6
- const { as, children, ...othersProps } = props;
7
- const RootComponent = as || "div";
8
- const { setExpand } = useAccordionsContext();
9
- return (_jsx(RootComponent, { ...othersProps, onClick: setExpand, children: children }));
10
- };
11
- const AccordionsHeader = memo(AccordionsHeaderBase);
12
- AccordionsHeader.displayName = "AccordionsHeader";
13
- export default AccordionsHeader;
@@ -1,5 +0,0 @@
1
- export { default as Accordions } from "./accordions";
2
- export { default as AccordionsContent } from "./accordionsContent";
3
- export { default as AccordionsHeader } from "./accordionsHeader";
4
- export { default as AccordionsButton } from "./accordionsButton";
5
- export * from "./accordionsContext";
@@ -1,6 +0,0 @@
1
- export { default as Accordions } from "./accordions";
2
- export { default as AccordionsContent } from "./accordionsContent";
3
- export { default as AccordionsHeader } from "./accordionsHeader";
4
- export { default as AccordionsButton } from "./accordionsButton";
5
- export * from "./accordionsContext";
6
- // export { default as Accordions } from "./accordions";