@jamsrui/collapsible 0.0.12 → 0.0.13
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/chunk-AA2GL6IQ.mjs +1 -0
- package/dist/chunk-KFKEAGEV.mjs +1 -0
- package/dist/chunk-VT67FJWO.mjs +1 -0
- package/dist/chunk-ZEA6EOPI.mjs +1 -0
- package/dist/collapsible-config.d.mts +3 -4
- package/dist/collapsible-config.mjs +1 -1
- package/dist/collapsible-content.d.mts +2 -2
- package/dist/collapsible-content.mjs +1 -1
- package/dist/collapsible-context.d.mts +1 -1
- package/dist/collapsible-context.mjs +1 -1
- package/dist/collapsible-trigger.d.mts +2 -2
- package/dist/collapsible-trigger.mjs +1 -1
- package/dist/collapsible.d.mts +1 -2
- package/dist/collapsible.mjs +1 -1
- package/dist/index.d.mts +14 -5
- package/dist/index.mjs +1 -1
- package/dist/use-collapsible.d.mts +4 -9
- package/dist/use-collapsible.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-2INMQSUC.mjs +0 -1
- package/dist/chunk-RHHW2XJT.mjs +0 -1
- package/dist/chunk-W2XEFJVU.mjs +0 -1
- package/dist/chunk-WXGPFQ7O.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-N576RNB6.mjs";import{a as t}from"./chunk-KFKEAGEV.mjs";import{cloneElement as r}from"react";import{jsx as p}from"react/jsx-runtime";var m=e=>{let{children:n}=e,l=t(e),s=r(n,l.getRootProps());return p(o,{value:l,children:s})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as a,useId as c,useMemo as P}from"react";import{useControlledState as f}from"@jamsrui/hooks";import{dataAttrDev as r,mergeProps as O}from"@jamsrui/utils";var y=g=>{let{defaultOpen:m,disabled:n=!1,isOpen:u,onOpenChange:C}=g,[e,l]=f({defaultProp:m,onChange:C,prop:u}),o=c(),t=c(),p=a(()=>{l(s=>!s)},[l]),i=a(()=>({"aria-expanded":e,"data-expanded":e,"data-slot":r("root")}),[e]),d=a(s=>({...s,"data-slot":r("content"),id:t,role:"region","aria-labelledby":o,hidden:!e}),[t,e,o]),b=a(()=>({...O({},{onClick:p}),id:o,"data-slot":r("trigger"),"aria-controls":t,"aria-expanded":e,"data-expanded":e,disabled:n,"aria-disabled":n}),[t,p,n,e,o]);return P(()=>({isOpen:e,getTriggerProps:b,getContentProps:d,getRootProps:i}),[d,i,b,e])};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-N576RNB6.mjs";import{cloneElement as o}from"react";var p=r=>{let{children:t}=r,{getTriggerProps:l}=e();return o(t,l())};export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-N576RNB6.mjs";import{AnimatePresence as p,motion as l}from"motion/react";import{jsx as t}from"react/jsx-runtime";var C=o=>{let{children:n,...i}=o,{isOpen:r,getContentProps:s}=e();return t(p,{initial:!1,children:!!r&&t(l.div,{animate:{height:"auto"},exit:{height:0},initial:{height:0},role:"region",transition:{type:"spring",bounce:0,duration:.4},...s(i),children:n})})};export{C as a};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Collapsible } from './collapsible.mjs';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
2
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
4
|
-
import './collapsible
|
|
5
|
-
import './collapsible-trigger.mjs';
|
|
3
|
+
import { Collapsible } from './collapsible.mjs';
|
|
6
4
|
import './use-collapsible.mjs';
|
|
7
5
|
import '@jamsrui/utils';
|
|
8
|
-
import '
|
|
6
|
+
import './collapsible-content.mjs';
|
|
7
|
+
import 'motion/react';
|
|
9
8
|
|
|
10
9
|
declare const useCollapsibleConfig: () => CollapsibleConfig.Props;
|
|
11
10
|
declare const CollapsibleConfig: (props: Omit<Partial<CollapsibleConfig.Props>, "children"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-324DBYK6.mjs";export{a as CollapsibleConfig,b as useCollapsibleConfig};
|
|
1
|
+
"use client";import{a,b}from"./chunk-324DBYK6.mjs";export{a as CollapsibleConfig,b as useCollapsibleConfig};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
3
|
|
|
4
4
|
declare const CollapsibleContent: (props: CollapsibleContent.Props) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare namespace CollapsibleContent {
|
|
6
|
-
interface Props extends
|
|
6
|
+
interface Props extends HTMLMotionProps<"div"> {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-ZEA6EOPI.mjs";import"./chunk-N576RNB6.mjs";export{a as CollapsibleContent};
|
|
@@ -3,7 +3,7 @@ import { useCollapsible } from './use-collapsible.mjs';
|
|
|
3
3
|
import '@jamsrui/utils';
|
|
4
4
|
import './collapsible-content.mjs';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
|
-
import '
|
|
6
|
+
import 'motion/react';
|
|
7
7
|
|
|
8
8
|
declare const useCollapsibleContext: () => CollapsibleContext.Props;
|
|
9
9
|
declare const CollapsibleContext: react.Context<CollapsibleContext.Props | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-N576RNB6.mjs";export{a as CollapsibleContext,b as useCollapsibleContext};
|
|
1
|
+
"use client";import{a,b}from"./chunk-N576RNB6.mjs";export{a as CollapsibleContext,b as useCollapsibleContext};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { UIProps } from '@jamsrui/utils';
|
|
3
2
|
|
|
4
3
|
declare const CollapsibleTrigger: (props: CollapsibleTrigger.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
4
|
declare namespace CollapsibleTrigger {
|
|
6
|
-
interface Props
|
|
5
|
+
interface Props {
|
|
6
|
+
children: React.ReactElement;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-VT67FJWO.mjs";import"./chunk-N576RNB6.mjs";export{a as CollapsibleTrigger};
|
package/dist/collapsible.d.mts
CHANGED
|
@@ -2,8 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { useCollapsible } from './use-collapsible.mjs';
|
|
3
3
|
import '@jamsrui/utils';
|
|
4
4
|
import './collapsible-content.mjs';
|
|
5
|
-
import '
|
|
6
|
-
import 'react';
|
|
5
|
+
import 'motion/react';
|
|
7
6
|
|
|
8
7
|
declare const Collapsible: (props: Collapsible.Props) => react_jsx_runtime.JSX.Element;
|
|
9
8
|
declare namespace Collapsible {
|
package/dist/collapsible.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
"use client";import{a}from"./chunk-AA2GL6IQ.mjs";import"./chunk-N576RNB6.mjs";import"./chunk-KFKEAGEV.mjs";export{a as Collapsible};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { Collapsible as Collapsible$1 } from './collapsible.mjs';
|
|
4
|
+
import { CollapsibleContent } from './collapsible-content.mjs';
|
|
5
|
+
import { CollapsibleTrigger } from './collapsible-trigger.mjs';
|
|
2
6
|
export { CollapsibleConfig, useCollapsibleConfig } from './collapsible-config.mjs';
|
|
3
|
-
export { CollapsibleContent } from './collapsible-content.mjs';
|
|
4
|
-
export { CollapsibleTrigger } from './collapsible-trigger.mjs';
|
|
5
|
-
import 'react/jsx-runtime';
|
|
6
7
|
import './use-collapsible.mjs';
|
|
7
8
|
import '@jamsrui/utils';
|
|
8
|
-
import 'react';
|
|
9
|
+
import 'motion/react';
|
|
9
10
|
import '@jamsrui/core';
|
|
11
|
+
|
|
12
|
+
declare const Collapsible: ((props: Collapsible$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
Root: (props: Collapsible$1.Props) => react_jsx_runtime.JSX.Element;
|
|
14
|
+
Content: (props: CollapsibleContent.Props) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
Trigger: (props: CollapsibleTrigger.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as i,b as r}from"./chunk-324DBYK6.mjs";import{a as l}from"./chunk-ZEA6EOPI.mjs";import{a as e}from"./chunk-VT67FJWO.mjs";import{a as o}from"./chunk-AA2GL6IQ.mjs";import"./chunk-N576RNB6.mjs";import"./chunk-KFKEAGEV.mjs";var C=Object.assign(o,{Root:o,Content:l,Trigger:e});export{C as Collapsible,i as CollapsibleConfig,l as CollapsibleContent,e as CollapsibleTrigger,r as useCollapsibleConfig};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { PropGetter } from '@jamsrui/utils';
|
|
1
|
+
import { UIProps, PropGetter } from '@jamsrui/utils';
|
|
2
2
|
import { CollapsibleContent } from './collapsible-content.mjs';
|
|
3
|
-
import { CollapsibleTrigger } from './collapsible-trigger.mjs';
|
|
4
3
|
import 'react/jsx-runtime';
|
|
5
|
-
import 'react';
|
|
4
|
+
import 'motion/react';
|
|
6
5
|
|
|
7
6
|
declare const useCollapsible: (props: useCollapsible.Props) => {
|
|
8
7
|
isOpen: boolean;
|
|
9
|
-
getTriggerProps:
|
|
8
|
+
getTriggerProps: () => UIProps<"button">;
|
|
10
9
|
getContentProps: PropGetter<CollapsibleContent.Props>;
|
|
11
10
|
getRootProps: () => {
|
|
12
11
|
"aria-expanded": boolean;
|
|
@@ -19,11 +18,7 @@ declare namespace useCollapsible {
|
|
|
19
18
|
defaultOpen?: boolean;
|
|
20
19
|
isOpen?: boolean;
|
|
21
20
|
onOpenChange?: (isOpen: boolean) => void;
|
|
22
|
-
|
|
23
|
-
slotProps?: {
|
|
24
|
-
trigger?: CollapsibleTrigger.Props;
|
|
25
|
-
content?: CollapsibleContent.Props;
|
|
26
|
-
};
|
|
21
|
+
disabled?: boolean;
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
|
package/dist/use-collapsible.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-KFKEAGEV.mjs";export{a as useCollapsible};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/collapsible",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"motion": ">=12",
|
|
6
6
|
"react": ">=19"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jamsrui/hooks": "^0.0.
|
|
10
|
-
"@jamsrui/core": "^0.0.
|
|
11
|
-
"@jamsrui/utils": "^0.0.
|
|
9
|
+
"@jamsrui/hooks": "^0.0.13",
|
|
10
|
+
"@jamsrui/core": "^0.0.11",
|
|
11
|
+
"@jamsrui/utils": "^0.0.13"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
package/dist/chunk-2INMQSUC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useCallback as n,useId as c,useMemo as O}from"react";import{useControlledState as x}from"@jamsrui/hooks";import{dataAttrDev as a,mergeProps as C}from"@jamsrui/utils";var I=P=>{let{defaultOpen:m,isDisabled:s,isOpen:u,onOpenChange:f,slotProps:t}=P,[e,p]=x({defaultProp:m,onChange:f,prop:u}),r=c(),l=c(),i=n(()=>{p(o=>!o)},[p]),d=n(()=>({"aria-expanded":e,"data-expanded":e,"data-slot":a("root")}),[e]),g=n(o=>({...C(t?.content??{},o),"data-slot":a("content"),id:l,role:"region","aria-labelledby":r,hidden:!e}),[l,e,t?.content,r]),b=n(o=>({...C(t?.trigger??{},o,{onClick:i}),id:r,"data-slot":a("trigger"),"aria-controls":l,"aria-expanded":e,"data-expanded":e,disabled:s,"aria-disabled":s}),[l,i,s,e,t?.trigger,r]);return O(()=>({isOpen:e,getTriggerProps:b,getContentProps:g,getRootProps:d}),[g,d,b,e])};export{I as a};
|
package/dist/chunk-RHHW2XJT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-N576RNB6.mjs";import{AnimatePresence as r,motion as s}from"motion/react";import{jsx as o}from"react/jsx-runtime";var p=t=>{let{children:i}=t,{isOpen:n}=e();return o(r,{initial:!1,children:!!n&&o(s.div,{animate:{height:"auto"},className:"overflow-hidden",exit:{height:0},initial:{height:0},role:"region",transition:{type:"spring",bounce:0,duration:.4},children:i})})};export{p as a};
|
package/dist/chunk-W2XEFJVU.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-N576RNB6.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var n=r=>{let{getTriggerProps:o}=e();return t("button",{props:o(r)})};export{n as a};
|
package/dist/chunk-WXGPFQ7O.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-N576RNB6.mjs";import{a as t}from"./chunk-2INMQSUC.mjs";import{cloneElement as s}from"react";import{jsx as p}from"react/jsx-runtime";var m=e=>{let{children:n}=e,o=t(e),r=s(n,o.getRootProps());return p(l,{value:o,children:r})};export{m as a};
|