@stackshift-ui/accordion 1.0.0-beta.1 → 1.0.0-beta.4
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/accordion.js +1 -1
- package/dist/accordion.mjs +1 -1
- package/dist/chunk-6DZX6EAA.mjs +37 -0
- package/dist/chunk-LGYH3GBF.mjs +1 -0
- package/dist/chunk-VVHNH4YB.mjs +79 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/setupTests.js +36 -40
- package/dist/setupTests.mjs +34 -38
- package/package.json +4 -4
- package/src/accordion.tsx +2 -5
- package/dist/chunk-Y5BC66KM.mjs +0 -1
package/dist/accordion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var y=Object.create;var s=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var
|
|
2
|
+
"use strict";var y=Object.create;var s=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},d=(o,e,t,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P(e))!x.call(o,a)&&a!==t&&s(o,a,{get:()=>e[a],enumerable:!(c=N(e,a))||c.enumerable});return o};var R=(o,e,t)=>(t=o!=null?y(b(o)):{},d(e||!o||!o.__esModule?s(t,"default",{value:o,enumerable:!0}):t,o)),h=o=>d(s({},"__esModule",{value:!0}),o);var T={};I(T,{Accordion:()=>u,AccordionContent:()=>C,AccordionItem:()=>v,AccordionTrigger:()=>g});module.exports=h(T);var i=R(require("@radix-ui/react-accordion")),m=require("lucide-react"),n=require("@stackshift-ui/system"),r=require("react/jsx-runtime"),p="Accordion",l="AccordionItem";var f="AccordionTrigger",A="AccordionContent";function u({...o}){let{[p]:e=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(e,{as:i.Root,"data-slot":"accordion",...o})}u.displayName=p;function v({className:o,...e}){let{[l]:t=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(t,{as:i.Item,"data-slot":"accordion-item",className:(0,n.cn)("border-b last:border-b-0",o),...e})}v.displayName=l;function g({className:o,children:e,...t}){let{[f]:c=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(i.Header,{className:"flex",children:(0,r.jsxs)(c,{as:i.Trigger,"data-slot":"accordion-trigger",className:(0,n.cn)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",o),...t,children:[e,(0,r.jsx)(m.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}g.displayName=f;function C({className:o,children:e,...t}){let{[A]:c=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(c,{as:i.Content,"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t,children:(0,r.jsx)("div",{className:(0,n.cn)("pt-0 pb-4",o),children:e})})}C.displayName=A;0&&(module.exports={Accordion,AccordionContent,AccordionItem,AccordionTrigger});
|
package/dist/accordion.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a,b,c,d}from"./chunk-
|
|
2
|
+
"use strict";import{a,b,c,d}from"./chunk-LGYH3GBF.mjs";import"./chunk-3EYN2AKU.mjs";export{a as Accordion,d as AccordionContent,b as AccordionItem,c as AccordionTrigger};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as o from"@radix-ui/react-accordion";import{ChevronDownIcon as f}from"lucide-react";import{cn as s,DefaultComponent as r,useStackShiftUIComponents as c}from"@stackshift-ui/system";import{jsx as n,jsxs as C}from"react/jsx-runtime";var d="Accordion",m="AccordionItem";var p="AccordionTrigger",l="AccordionContent";function A({...e}){let{[d]:t=r}=c();return n(t,{as:o.Root,"data-slot":"accordion",...e})}A.displayName=d;function u({className:e,...t}){let{[m]:i=r}=c();return n(i,{as:o.Item,"data-slot":"accordion-item",className:s("border-b last:border-b-0",e),...t})}u.displayName=m;function v({className:e,children:t,...i}){let{[p]:a=r}=c();return n(o.Header,{className:"flex",children:C(a,{as:o.Trigger,"data-slot":"accordion-trigger",className:s("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...i,children:[t,n(f,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}v.displayName=p;function g({className:e,children:t,...i}){let{[l]:a=r}=c();return n(a,{as:o.Content,"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...i,children:n("div",{className:s("pt-0 pb-4",e),children:t})})}g.displayName=l;export{A as a,u as b,v as c,g as d};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// src/accordion.tsx
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { cn, DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var displayNameAccordion = "Accordion";
|
|
7
|
+
var displayNameAccordionItem = "AccordionItem";
|
|
8
|
+
var displayNameAccordionTrigger = "AccordionTrigger";
|
|
9
|
+
var displayNameAccordionContent = "AccordionContent";
|
|
10
|
+
function Accordion({ ...props }) {
|
|
11
|
+
const { [displayNameAccordion]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
12
|
+
return /* @__PURE__ */ jsx(Component, { as: AccordionPrimitive.Root, "data-slot": "accordion", ...props });
|
|
13
|
+
}
|
|
14
|
+
Accordion.displayName = displayNameAccordion;
|
|
15
|
+
function AccordionItem({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const { [displayNameAccordionItem]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
Component,
|
|
22
|
+
{
|
|
23
|
+
as: AccordionPrimitive.Item,
|
|
24
|
+
"data-slot": "accordion-item",
|
|
25
|
+
className: cn("border-b last:border-b-0", className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
AccordionItem.displayName = displayNameAccordionItem;
|
|
31
|
+
function AccordionTrigger({
|
|
32
|
+
className,
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
const { [displayNameAccordionTrigger]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
37
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
38
|
+
Component,
|
|
39
|
+
{
|
|
40
|
+
as: AccordionPrimitive.Trigger,
|
|
41
|
+
"data-slot": "accordion-trigger",
|
|
42
|
+
className: cn(
|
|
43
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
...props,
|
|
47
|
+
children: [
|
|
48
|
+
children,
|
|
49
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
}
|
|
54
|
+
AccordionTrigger.displayName = displayNameAccordionTrigger;
|
|
55
|
+
function AccordionContent({
|
|
56
|
+
className,
|
|
57
|
+
children,
|
|
58
|
+
...props
|
|
59
|
+
}) {
|
|
60
|
+
const { [displayNameAccordionContent]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
Component,
|
|
63
|
+
{
|
|
64
|
+
as: AccordionPrimitive.Content,
|
|
65
|
+
"data-slot": "accordion-content",
|
|
66
|
+
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
67
|
+
...props,
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
AccordionContent.displayName = displayNameAccordionContent;
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
Accordion,
|
|
76
|
+
AccordionItem,
|
|
77
|
+
AccordionTrigger,
|
|
78
|
+
AccordionContent
|
|
79
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var y=Object.create;var s=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var
|
|
2
|
+
"use strict";var y=Object.create;var s=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},d=(o,e,t,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P(e))!x.call(o,a)&&a!==t&&s(o,a,{get:()=>e[a],enumerable:!(c=N(e,a))||c.enumerable});return o};var R=(o,e,t)=>(t=o!=null?y(b(o)):{},d(e||!o||!o.__esModule?s(t,"default",{value:o,enumerable:!0}):t,o)),h=o=>d(s({},"__esModule",{value:!0}),o);var T={};I(T,{Accordion:()=>u,AccordionContent:()=>C,AccordionItem:()=>v,AccordionTrigger:()=>g});module.exports=h(T);var i=R(require("@radix-ui/react-accordion")),m=require("lucide-react"),n=require("@stackshift-ui/system"),r=require("react/jsx-runtime"),p="Accordion",l="AccordionItem";var f="AccordionTrigger",A="AccordionContent";function u({...o}){let{[p]:e=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(e,{as:i.Root,"data-slot":"accordion",...o})}u.displayName=p;function v({className:o,...e}){let{[l]:t=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(t,{as:i.Item,"data-slot":"accordion-item",className:(0,n.cn)("border-b last:border-b-0",o),...e})}v.displayName=l;function g({className:o,children:e,...t}){let{[f]:c=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(i.Header,{className:"flex",children:(0,r.jsxs)(c,{as:i.Trigger,"data-slot":"accordion-trigger",className:(0,n.cn)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",o),...t,children:[e,(0,r.jsx)(m.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}g.displayName=f;function C({className:o,children:e,...t}){let{[A]:c=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,r.jsx)(c,{as:i.Content,"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...t,children:(0,r.jsx)("div",{className:(0,n.cn)("pt-0 pb-4",o),children:e})})}C.displayName=A;0&&(module.exports={Accordion,AccordionContent,AccordionItem,AccordionTrigger});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e,b as o,c as r,d as t}from"./chunk-
|
|
2
|
+
"use strict";import{a as e,b as o,c as r,d as t}from"./chunk-LGYH3GBF.mjs";import"./chunk-3EYN2AKU.mjs";export{e as Accordion,t as AccordionContent,o as AccordionItem,r as AccordionTrigger};
|