@gv-tech/ui-web 2.15.2 → 2.16.0
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.cjs +1 -1
- package/dist/accordion.mjs +3 -3
- package/dist/alert-dialog.cjs +2 -2
- package/dist/alert-dialog.mjs +16 -16
- package/dist/alert.cjs +1 -1
- package/dist/alert.mjs +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.mjs +34 -34
- package/dist/badge.cjs +1 -1
- package/dist/badge.mjs +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.mjs +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.mjs +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.mjs +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.mjs +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.mjs +1 -1
- package/dist/chart.cjs +1 -1
- package/dist/chart.mjs +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.mjs +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.mjs +114 -114
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.mjs +68 -68
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.mjs +21 -21
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.mjs +16 -16
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.mjs +43 -43
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +1 -1
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +28 -0
- package/dist/index.mjs +22 -20
- package/dist/input.cjs +1 -1
- package/dist/input.mjs +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.mjs +2 -2
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.mjs +77 -77
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.mjs +57 -57
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.mjs +1 -1
- package/dist/popover.cjs +1 -1
- package/dist/popover.mjs +62 -62
- package/dist/progress.cjs +2 -2
- package/dist/progress.mjs +2 -2
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.mjs +36 -36
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.mjs +1 -1
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.mjs +88 -88
- package/dist/search.cjs +1 -1
- package/dist/search.mjs +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.mjs +74 -74
- package/dist/separator.cjs +1 -1
- package/dist/separator.mjs +9 -9
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.mjs +12 -12
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.mjs +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.mjs +2 -2
- package/dist/switch.cjs +1 -1
- package/dist/switch.mjs +12 -12
- package/dist/table-of-contents.cjs +1 -0
- package/dist/table-of-contents.d.ts +35 -0
- package/dist/table-of-contents.mjs +160 -0
- package/dist/table.cjs +1 -1
- package/dist/table.mjs +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.mjs +41 -41
- package/dist/text.cjs +1 -1
- package/dist/text.mjs +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.mjs +1 -1
- package/dist/{theme-toggle-B4VZTDpe.js → theme-toggle-DXQGNfCe.js} +1 -1
- package/dist/{theme-toggle-WtPW9UZi.mjs → theme-toggle-tHXIbr8W.mjs} +1 -1
- package/dist/theme-toggle.cjs +1 -1
- package/dist/theme-toggle.mjs +2 -2
- package/dist/toast.cjs +1 -1
- package/dist/toast.mjs +35 -35
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.mjs +15 -15
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.mjs +4 -4
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.mjs +3 -3
- package/dist/utils-DY6fhrgS.mjs +12 -0
- package/dist/utils-cdbZV8DZ.js +1 -0
- package/package.json +1 -1
- package/src/accordion.tsx +2 -2
- package/src/alert-dialog.tsx +6 -6
- package/src/avatar.tsx +3 -3
- package/src/checkbox.tsx +1 -1
- package/src/command.tsx +7 -7
- package/src/context-menu.tsx +8 -8
- package/src/dialog.tsx +4 -4
- package/src/drawer.tsx +3 -3
- package/src/dropdown-menu.tsx +8 -8
- package/src/hover-card.tsx +1 -1
- package/src/index.ts +4 -1
- package/src/label.tsx +1 -1
- package/src/lib/utils.ts +10 -0
- package/src/menubar.tsx +10 -10
- package/src/navigation-menu.tsx +6 -6
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +1 -1
- package/src/radio-group.tsx +2 -2
- package/src/scroll-area.tsx +2 -2
- package/src/select.tsx +7 -7
- package/src/separator.tsx +1 -1
- package/src/sheet.tsx +4 -4
- package/src/slider.tsx +1 -1
- package/src/switch.tsx +1 -1
- package/src/table-of-contents.tsx +285 -0
- package/src/tabs.tsx +3 -3
- package/src/toast.tsx +6 -6
- package/src/toggle-group.tsx +2 -2
- package/src/toggle.tsx +1 -1
- package/src/tooltip.tsx +2 -2
- package/dist/utils-B6yFEsav.mjs +0 -8
- package/dist/utils-IjLH3w2e.js +0 -1
package/dist/switch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-nZSsnGb7.js"),B=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-nZSsnGb7.js"),B=require("react"),g=require("./index-BtZvtDmp.js"),j=require("./index-_XxjJPRD.js"),M=require("./index-D2HnlO3y.js"),I=require("./index-Ce5TOFAK.js"),$=require("./index-DYxWvftI.js"),H=require("./index-Cjj_rUPu.js"),R=require("./utils-cdbZV8DZ.js");function z(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const n=z(B);var b="Switch",[A]=M.createContextScope(b),[D,U]=A(b),y=n.forwardRef((t,r)=>{const{__scopeSwitch:e,name:o,checked:s,defaultChecked:m,required:u,disabled:c,value:d="on",onCheckedChange:x,form:a,...w}=t,[l,p]=n.useState(null),v=j.useComposedRefs(r,h=>p(h)),S=n.useRef(!1),k=l?a||!!l.closest("form"):!0,[f,T]=I.useControllableState({prop:s,defaultProp:m??!1,onChange:x,caller:b});return i.jsxRuntimeExports.jsxs(D,{scope:e,checked:f,disabled:c,children:[i.jsxRuntimeExports.jsx(g.Primitive.button,{type:"button",role:"switch","aria-checked":f,"aria-required":u,"data-state":_(f),"data-disabled":c?"":void 0,disabled:c,value:d,...w,ref:v,onClick:g.composeEventHandlers(t.onClick,h=>{T(O=>!O),k&&(S.current=h.isPropagationStopped(),S.current||h.stopPropagation())})}),k&&i.jsxRuntimeExports.jsx(P,{control:l,bubbles:!S.current,name:o,value:d,checked:f,required:u,disabled:c,form:a,style:{transform:"translateX(-100%)"}})]})});y.displayName=b;var C="SwitchThumb",E=n.forwardRef((t,r)=>{const{__scopeSwitch:e,...o}=t,s=U(C,e);return i.jsxRuntimeExports.jsx(g.Primitive.span,{"data-state":_(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})});E.displayName=C;var L="SwitchBubbleInput",P=n.forwardRef(({__scopeSwitch:t,control:r,checked:e,bubbles:o=!0,...s},m)=>{const u=n.useRef(null),c=j.useComposedRefs(u,m),d=$.usePrevious(e),x=H.useSize(r);return n.useEffect(()=>{const a=u.current;if(!a)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(d!==e&&p){const v=new Event("click",{bubbles:o});p.call(a,e),a.dispatchEvent(v)}},[d,e,o]),i.jsxRuntimeExports.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...s,tabIndex:-1,ref:c,style:{...s.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P.displayName=L;function _(t){return t?"checked":"unchecked"}var N=y,F=E;const q=n.forwardRef(({className:t,...r},e)=>i.jsxRuntimeExports.jsx(N,{className:R.cn("peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",t),...r,ref:e,children:i.jsxRuntimeExports.jsx(F,{className:R.cn("bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));q.displayName=N?.displayName||"Switch";exports.Switch=q;
|
package/dist/switch.mjs
CHANGED
|
@@ -7,8 +7,8 @@ import { c as M } from "./index-IZ2gq03c.mjs";
|
|
|
7
7
|
import { u as H } from "./index-p6xVFRb4.mjs";
|
|
8
8
|
import { u as A } from "./index-BZPx6jYI.mjs";
|
|
9
9
|
import { u as U } from "./index-C1qb0595.mjs";
|
|
10
|
-
import { c as x } from "./utils-
|
|
11
|
-
var
|
|
10
|
+
import { c as x } from "./utils-DY6fhrgS.mjs";
|
|
11
|
+
var m = "Switch", [q] = M(m), [z, L] = q(m), P = o.forwardRef(
|
|
12
12
|
(t, r) => {
|
|
13
13
|
const {
|
|
14
14
|
__scopeSwitch: e,
|
|
@@ -21,11 +21,11 @@ var h = "Switch", [q] = M(h), [z, L] = q(h), P = o.forwardRef(
|
|
|
21
21
|
onCheckedChange: w,
|
|
22
22
|
form: i,
|
|
23
23
|
...v
|
|
24
|
-
} = t, [l, p] = o.useState(null),
|
|
24
|
+
} = t, [l, p] = o.useState(null), S = y(r, (h) => p(h)), k = o.useRef(!1), g = l ? i || !!l.closest("form") : !0, [f, B] = H({
|
|
25
25
|
prop: s,
|
|
26
26
|
defaultProp: b ?? !1,
|
|
27
27
|
onChange: w,
|
|
28
|
-
caller:
|
|
28
|
+
caller: m
|
|
29
29
|
});
|
|
30
30
|
return /* @__PURE__ */ a.jsxs(z, { scope: e, checked: f, disabled: c, children: [
|
|
31
31
|
/* @__PURE__ */ a.jsx(
|
|
@@ -40,9 +40,9 @@ var h = "Switch", [q] = M(h), [z, L] = q(h), P = o.forwardRef(
|
|
|
40
40
|
disabled: c,
|
|
41
41
|
value: u,
|
|
42
42
|
...v,
|
|
43
|
-
ref:
|
|
44
|
-
onClick: I(t.onClick, (
|
|
45
|
-
B((T) => !T), g && (
|
|
43
|
+
ref: S,
|
|
44
|
+
onClick: I(t.onClick, (h) => {
|
|
45
|
+
B((T) => !T), g && (k.current = h.isPropagationStopped(), k.current || h.stopPropagation());
|
|
46
46
|
})
|
|
47
47
|
}
|
|
48
48
|
),
|
|
@@ -50,7 +50,7 @@ var h = "Switch", [q] = M(h), [z, L] = q(h), P = o.forwardRef(
|
|
|
50
50
|
N,
|
|
51
51
|
{
|
|
52
52
|
control: l,
|
|
53
|
-
bubbles: !
|
|
53
|
+
bubbles: !k.current,
|
|
54
54
|
name: n,
|
|
55
55
|
value: u,
|
|
56
56
|
checked: f,
|
|
@@ -63,7 +63,7 @@ var h = "Switch", [q] = M(h), [z, L] = q(h), P = o.forwardRef(
|
|
|
63
63
|
] });
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
|
-
P.displayName =
|
|
66
|
+
P.displayName = m;
|
|
67
67
|
var R = "SwitchThumb", E = o.forwardRef(
|
|
68
68
|
(t, r) => {
|
|
69
69
|
const { __scopeSwitch: e, ...n } = t, s = L(R, e);
|
|
@@ -96,8 +96,8 @@ var O = "SwitchBubbleInput", N = o.forwardRef(
|
|
|
96
96
|
"checked"
|
|
97
97
|
).set;
|
|
98
98
|
if (u !== e && p) {
|
|
99
|
-
const
|
|
100
|
-
p.call(i, e), i.dispatchEvent(
|
|
99
|
+
const S = new Event("click", { bubbles: n });
|
|
100
|
+
p.call(i, e), i.dispatchEvent(S);
|
|
101
101
|
}
|
|
102
102
|
}, [u, e, n]), /* @__PURE__ */ a.jsx(
|
|
103
103
|
"input",
|
|
@@ -144,7 +144,7 @@ const F = o.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a.jsx(
|
|
|
144
144
|
)
|
|
145
145
|
}
|
|
146
146
|
));
|
|
147
|
-
F.displayName = _
|
|
147
|
+
F.displayName = _?.displayName || "Switch";
|
|
148
148
|
export {
|
|
149
149
|
F as Switch
|
|
150
150
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.js"),O=require("react"),h=require("./utils-cdbZV8DZ.js");function C(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}return r.default=n,Object.freeze(r)}const l=C(O),E=l.createContext(null);function R(){const n=l.useContext(E);if(!n)throw new Error("TOC components must be used within a TableOfContents provider");return n}function b({children:n,className:r,activeId:i,minLevel:a=1,maxLevel:s=4,selector:x="h1, h2, h3, h4, h5, h6"}){const[u,f]=l.useState([]),[t,d]=l.useState(null),p=l.useMemo(()=>u.find(o=>o.id===t)?.text||null,[u,t]),c=l.useCallback(o=>{f(j=>JSON.stringify(j)===JSON.stringify(o)?j:o)},[]),m=l.useMemo(()=>({headings:u,activeId:i||t,activeHeadingText:p,registerHeadings:c,setActiveId:d,config:{minLevel:a,maxLevel:s,selector:x,className:r}}),[u,t,i,p,c,a,s,x,r]);return e.jsxRuntimeExports.jsx(E.Provider,{value:m,children:e.jsxRuntimeExports.jsx("div",{className:h.cn("relative",r),children:n||e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxRuntimeExports.jsx(v,{}),e.jsxRuntimeExports.jsx(g,{children:null})]})})})}function v({className:n}){const{headings:r,activeId:i,activeHeadingText:a}=R(),[s,x]=l.useState(!1);if(l.useEffect(()=>{if(!s)return;const t=()=>{x(!1)};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[s]),r.length===0)return null;const u=Math.min(...r.map(t=>t.level)),f=e.jsxRuntimeExports.jsx("ul",{className:"m-0 list-none text-sm",children:r.map(t=>{const d=i===t.id,p=`${(t.level-u)*1}rem`;return e.jsxRuntimeExports.jsx("li",{className:"mt-0 pt-2",children:e.jsxRuntimeExports.jsx("a",{href:`#${t.id}`,onClick:()=>x(!1),className:h.cn("hover:text-foreground inline-block no-underline transition-colors",d?"text-primary font-medium":"text-muted-foreground"),style:{paddingLeft:p},children:t.text})},t.id)})});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:h.cn("bg-background/95 sticky top-0 z-40 border-b backdrop-blur xl:hidden",n),children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>x(!s),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[e.jsxRuntimeExports.jsx("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider uppercase",children:"On this page:"}),e.jsxRuntimeExports.jsx("span",{className:"truncate text-sm font-medium",children:a||"Overview"})]}),e.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:h.cn("shrink-0 transition-transform duration-200",s&&"rotate-180"),children:e.jsxRuntimeExports.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&e.jsxRuntimeExports.jsx("div",{className:"bg-background border-t px-4 pt-2 pb-6",children:e.jsxRuntimeExports.jsx("nav",{"aria-label":"Table of contents mobile",children:f})})]}),e.jsxRuntimeExports.jsx("nav",{className:h.cn("hidden xl:block",n),"aria-label":"Table of contents",children:f})]})}function g({children:n,className:r}){const{registerHeadings:i,setActiveId:a,config:s}=R(),x=l.useRef(null);return l.useEffect(()=>{const u=x.current;if(!u)return;const f=()=>{const c=Array.from(u.querySelectorAll(s.selector||"h1, h2, h3, h4, h5, h6")).filter(o=>{const j=parseInt(o.tagName.charAt(1),10);return j>=(s.minLevel??1)&&j<=(s.maxLevel??4)}),m=c.map(o=>(o.id||(o.id=h.slugify(o.textContent||"heading")),{id:o.id,text:o.textContent||"",level:parseInt(o.tagName.charAt(1),10)}));return i(m),c},t=f(),d=new IntersectionObserver(c=>{c.forEach(m=>{m.isIntersecting&&a(m.target.id)})},{rootMargin:"0px 0px -80% 0px",threshold:.1});t.forEach(c=>d.observe(c));const p=new MutationObserver(()=>{const c=f();d.disconnect(),c.forEach(m=>d.observe(m))});return p.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{d.disconnect(),p.disconnect()}},[s.selector,s.minLevel,s.maxLevel,i,a]),e.jsxRuntimeExports.jsx("div",{ref:x,className:r,children:n})}b.List=v;b.Content=g;exports.TableOfContents=b;exports.TableOfContentsContent=g;exports.TableOfContentsList=v;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { TableOfContentsContentBaseProps as TableOfContentsContentProps } from '../../ui-core/src';
|
|
3
|
+
import { TableOfContentsListBaseProps as TableOfContentsListProps } from '../../ui-core/src';
|
|
4
|
+
import { TableOfContentsRootBaseProps } from '../../ui-core/src';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Root component that provides the Table of Contents context.
|
|
8
|
+
* Can be used as a wrapper OR standalone.
|
|
9
|
+
* If used as a wrapper: <TableOfContents><List /><Content>{children}</Content></TableOfContents>
|
|
10
|
+
* If used standalone: <TableOfContents /> (requires container ref or defaults to document)
|
|
11
|
+
*/
|
|
12
|
+
export declare function TableOfContents({ children, className, activeId: activeIdOverride, minLevel, maxLevel, selector, }: TableOfContentsProps): JSX.Element;
|
|
13
|
+
|
|
14
|
+
export declare namespace TableOfContents {
|
|
15
|
+
var List: typeof TableOfContentsList;
|
|
16
|
+
var Content: typeof TableOfContentsContent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Wraps the content area and automatically detects headings within it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TableOfContentsContent({ children, className }: TableOfContentsContentProps): JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { TableOfContentsContentProps }
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Renders the actual list of links.
|
|
28
|
+
*/
|
|
29
|
+
export declare function TableOfContentsList({ className }: TableOfContentsListProps): JSX.Element | null;
|
|
30
|
+
|
|
31
|
+
export { TableOfContentsListProps }
|
|
32
|
+
|
|
33
|
+
export declare type TableOfContentsProps = TableOfContentsRootBaseProps;
|
|
34
|
+
|
|
35
|
+
export { }
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as e } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
|
+
import * as i from "react";
|
|
4
|
+
import { c as p, s as k } from "./utils-DY6fhrgS.mjs";
|
|
5
|
+
const g = i.createContext(null);
|
|
6
|
+
function b() {
|
|
7
|
+
const c = i.useContext(g);
|
|
8
|
+
if (!c)
|
|
9
|
+
throw new Error("TOC components must be used within a TableOfContents provider");
|
|
10
|
+
return c;
|
|
11
|
+
}
|
|
12
|
+
function j({
|
|
13
|
+
children: c,
|
|
14
|
+
className: l,
|
|
15
|
+
activeId: f,
|
|
16
|
+
minLevel: x = 1,
|
|
17
|
+
maxLevel: n = 4,
|
|
18
|
+
selector: a = "h1, h2, h3, h4, h5, h6"
|
|
19
|
+
}) {
|
|
20
|
+
const [o, h] = i.useState([]), [t, d] = i.useState(null), m = i.useMemo(() => o.find((s) => s.id === t)?.text || null, [o, t]), r = i.useCallback((s) => {
|
|
21
|
+
h((v) => JSON.stringify(v) === JSON.stringify(s) ? v : s);
|
|
22
|
+
}, []), u = i.useMemo(
|
|
23
|
+
() => ({
|
|
24
|
+
headings: o,
|
|
25
|
+
activeId: f || t,
|
|
26
|
+
activeHeadingText: m,
|
|
27
|
+
registerHeadings: r,
|
|
28
|
+
setActiveId: d,
|
|
29
|
+
config: { minLevel: x, maxLevel: n, selector: a, className: l }
|
|
30
|
+
}),
|
|
31
|
+
[
|
|
32
|
+
o,
|
|
33
|
+
t,
|
|
34
|
+
f,
|
|
35
|
+
m,
|
|
36
|
+
r,
|
|
37
|
+
x,
|
|
38
|
+
n,
|
|
39
|
+
a,
|
|
40
|
+
l
|
|
41
|
+
]
|
|
42
|
+
);
|
|
43
|
+
return /* @__PURE__ */ e.jsx(g.Provider, { value: u, children: /* @__PURE__ */ e.jsx("div", { className: p("relative", l), children: c || /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
44
|
+
/* @__PURE__ */ e.jsx(w, {}),
|
|
45
|
+
/* @__PURE__ */ e.jsx(C, { children: null })
|
|
46
|
+
] }) }) });
|
|
47
|
+
}
|
|
48
|
+
function w({ className: c }) {
|
|
49
|
+
const { headings: l, activeId: f, activeHeadingText: x } = b(), [n, a] = i.useState(!1);
|
|
50
|
+
if (i.useEffect(() => {
|
|
51
|
+
if (!n)
|
|
52
|
+
return;
|
|
53
|
+
const t = () => {
|
|
54
|
+
a(!1);
|
|
55
|
+
};
|
|
56
|
+
return window.addEventListener("scroll", t, { passive: !0 }), () => window.removeEventListener("scroll", t);
|
|
57
|
+
}, [n]), l.length === 0)
|
|
58
|
+
return null;
|
|
59
|
+
const o = Math.min(...l.map((t) => t.level)), h = /* @__PURE__ */ e.jsx("ul", { className: "m-0 list-none text-sm", children: l.map((t) => {
|
|
60
|
+
const d = f === t.id, m = `${(t.level - o) * 1}rem`;
|
|
61
|
+
return /* @__PURE__ */ e.jsx("li", { className: "mt-0 pt-2", children: /* @__PURE__ */ e.jsx(
|
|
62
|
+
"a",
|
|
63
|
+
{
|
|
64
|
+
href: `#${t.id}`,
|
|
65
|
+
onClick: () => a(!1),
|
|
66
|
+
className: p(
|
|
67
|
+
"hover:text-foreground inline-block no-underline transition-colors",
|
|
68
|
+
d ? "text-primary font-medium" : "text-muted-foreground"
|
|
69
|
+
),
|
|
70
|
+
style: { paddingLeft: m },
|
|
71
|
+
children: t.text
|
|
72
|
+
}
|
|
73
|
+
) }, t.id);
|
|
74
|
+
}) });
|
|
75
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
76
|
+
/* @__PURE__ */ e.jsxs("div", { className: p("bg-background/95 sticky top-0 z-40 border-b backdrop-blur xl:hidden", c), children: [
|
|
77
|
+
/* @__PURE__ */ e.jsxs(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
onClick: () => a(!n),
|
|
81
|
+
className: "flex w-full items-center justify-between px-4 py-3 text-left",
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
84
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs font-semibold tracking-wider uppercase", children: "On this page:" }),
|
|
85
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate text-sm font-medium", children: x || "Overview" })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ e.jsx(
|
|
88
|
+
"svg",
|
|
89
|
+
{
|
|
90
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
91
|
+
width: "16",
|
|
92
|
+
height: "16",
|
|
93
|
+
viewBox: "0 0 24 24",
|
|
94
|
+
fill: "none",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
strokeWidth: "2",
|
|
97
|
+
strokeLinecap: "round",
|
|
98
|
+
strokeLinejoin: "round",
|
|
99
|
+
className: p("shrink-0 transition-transform duration-200", n && "rotate-180"),
|
|
100
|
+
children: /* @__PURE__ */ e.jsx("path", { d: "m6 9 6 6 6-6" })
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "bg-background border-t px-4 pt-2 pb-6", children: /* @__PURE__ */ e.jsx("nav", { "aria-label": "Table of contents mobile", children: h }) })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ e.jsx("nav", { className: p("hidden xl:block", c), "aria-label": "Table of contents", children: h })
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
function C({ children: c, className: l }) {
|
|
112
|
+
const { registerHeadings: f, setActiveId: x, config: n } = b(), a = i.useRef(null);
|
|
113
|
+
return i.useEffect(() => {
|
|
114
|
+
const o = a.current;
|
|
115
|
+
if (!o)
|
|
116
|
+
return;
|
|
117
|
+
const h = () => {
|
|
118
|
+
const r = Array.from(o.querySelectorAll(n.selector || "h1, h2, h3, h4, h5, h6")).filter(
|
|
119
|
+
(s) => {
|
|
120
|
+
const v = parseInt(s.tagName.charAt(1), 10);
|
|
121
|
+
return v >= (n.minLevel ?? 1) && v <= (n.maxLevel ?? 4);
|
|
122
|
+
}
|
|
123
|
+
), u = r.map((s) => (s.id || (s.id = k(s.textContent || "heading")), {
|
|
124
|
+
id: s.id,
|
|
125
|
+
text: s.textContent || "",
|
|
126
|
+
level: parseInt(s.tagName.charAt(1), 10)
|
|
127
|
+
}));
|
|
128
|
+
return f(u), r;
|
|
129
|
+
}, t = h(), d = new IntersectionObserver(
|
|
130
|
+
(r) => {
|
|
131
|
+
r.forEach((u) => {
|
|
132
|
+
u.isIntersecting && x(u.target.id);
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
rootMargin: "0px 0px -80% 0px",
|
|
137
|
+
threshold: 0.1
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
t.forEach((r) => d.observe(r));
|
|
141
|
+
const m = new MutationObserver(() => {
|
|
142
|
+
const r = h();
|
|
143
|
+
d.disconnect(), r.forEach((u) => d.observe(u));
|
|
144
|
+
});
|
|
145
|
+
return m.observe(o, {
|
|
146
|
+
childList: !0,
|
|
147
|
+
subtree: !0,
|
|
148
|
+
characterData: !0
|
|
149
|
+
}), () => {
|
|
150
|
+
d.disconnect(), m.disconnect();
|
|
151
|
+
};
|
|
152
|
+
}, [n.selector, n.minLevel, n.maxLevel, f, x]), /* @__PURE__ */ e.jsx("div", { ref: a, className: l, children: c });
|
|
153
|
+
}
|
|
154
|
+
j.List = w;
|
|
155
|
+
j.Content = C;
|
|
156
|
+
export {
|
|
157
|
+
j as TableOfContents,
|
|
158
|
+
C as TableOfContentsContent,
|
|
159
|
+
w as TableOfContentsList
|
|
160
|
+
};
|
package/dist/table.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-nZSsnGb7.js"),f=require("react"),r=require("./utils-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-nZSsnGb7.js"),f=require("react"),r=require("./utils-cdbZV8DZ.js");function p(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const s=p(f),n=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("div",{className:"relative w-full overflow-auto",children:o.jsxRuntimeExports.jsx("table",{ref:t,className:r.cn("w-full caption-bottom text-sm",e),...a})}));n.displayName="Table";const c=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("thead",{ref:t,className:r.cn("[&_tr]:border-b",e),...a}));c.displayName="TableHeader";const d=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("tbody",{ref:t,className:r.cn("[&_tr:last-child]:border-0",e),...a}));d.displayName="TableBody";const i=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("tfoot",{ref:t,className:r.cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...a}));i.displayName="TableFooter";const b=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("tr",{ref:t,className:r.cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...a}));b.displayName="TableRow";const m=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("th",{ref:t,className:r.cn("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));m.displayName="TableHead";const u=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("td",{ref:t,className:r.cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));u.displayName="TableCell";const x=s.forwardRef(({className:e,...a},t)=>o.jsxRuntimeExports.jsx("caption",{ref:t,className:r.cn("text-muted-foreground mt-4 text-sm",e),...a}));x.displayName="TableCaption";exports.Table=n;exports.TableBody=d;exports.TableCaption=x;exports.TableCell=u;exports.TableFooter=i;exports.TableHead=m;exports.TableHeader=c;exports.TableRow=b;
|
package/dist/table.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as o } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { c as s } from "./utils-
|
|
4
|
+
import { c as s } from "./utils-DY6fhrgS.mjs";
|
|
5
5
|
const r = l.forwardRef(
|
|
6
6
|
({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ o.jsx("table", { ref: t, className: s("w-full caption-bottom text-sm", e), ...a }) })
|
|
7
7
|
);
|
package/dist/tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),F=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),F=require("react"),b=require("./index-BtZvtDmp.js"),D=require("./index-D2HnlO3y.js"),m=require("./index-DIsg7zU7.js"),k=require("./index-B2XtpfGY.js"),G=require("./index-Dko2XdTk.js"),L=require("./index-Ce5TOFAK.js"),O=require("./index-CefEQe_4.js"),x=require("./utils-cdbZV8DZ.js");function V(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=V(F);var p="Tabs",[H]=D.createContextScope(p,[m.createRovingFocusGroupScope]),j=m.createRovingFocusGroupScope(),[K,T]=H(p),R=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:i,defaultValue:u,orientation:a="horizontal",dir:l,activationMode:v="automatic",...g}=e,r=G.useDirection(l),[s,f]=L.useControllableState({prop:o,onChange:i,defaultProp:u??"",caller:p});return c.jsxRuntimeExports.jsx(K,{scope:n,baseId:O.useId(),value:s,onValueChange:f,orientation:a,dir:r,activationMode:v,children:c.jsxRuntimeExports.jsx(b.Primitive.div,{dir:r,"data-orientation":a,...g,ref:t})})});R.displayName=p;var y="TabsList",E=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...i}=e,u=T(y,n),a=j(n);return c.jsxRuntimeExports.jsx(m.Root,{asChild:!0,...a,orientation:u.orientation,dir:u.dir,loop:o,children:c.jsxRuntimeExports.jsx(b.Primitive.div,{role:"tablist","aria-orientation":u.orientation,...i,ref:t})})});E.displayName=y;var C="TabsTrigger",N=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:i=!1,...u}=e,a=T(C,n),l=j(n),v=P(a.baseId,o),g=_(a.baseId,o),r=o===a.value;return c.jsxRuntimeExports.jsx(m.Item,{asChild:!0,...l,focusable:!i,active:r,children:c.jsxRuntimeExports.jsx(b.Primitive.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":g,"data-state":r?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:v,...u,ref:t,onMouseDown:b.composeEventHandlers(e.onMouseDown,s=>{!i&&s.button===0&&s.ctrlKey===!1?a.onValueChange(o):s.preventDefault()}),onKeyDown:b.composeEventHandlers(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&a.onValueChange(o)}),onFocus:b.composeEventHandlers(e.onFocus,()=>{const s=a.activationMode!=="manual";!r&&!i&&s&&a.onValueChange(o)})})})});N.displayName=C;var h="TabsContent",I=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:i,children:u,...a}=e,l=T(h,n),v=P(l.baseId,o),g=_(l.baseId,o),r=o===l.value,s=d.useRef(r);return d.useEffect(()=>{const f=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(f)},[]),c.jsxRuntimeExports.jsx(k.Presence,{present:i||r,children:({present:f})=>c.jsxRuntimeExports.jsx(b.Primitive.div,{"data-state":r?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:g,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:s.current?"0s":void 0},children:f&&u})})});I.displayName=h;function P(e,t){return`${e}-trigger-${t}`}function _(e,t){return`${e}-content-${t}`}var z=R,w=E,S=N,$=I;const B=z,A=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx(w,{ref:n,className:x.cn("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...t}));A.displayName=w?.displayName||"TabsList";const M=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx(S,{ref:n,className:x.cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...t}));M.displayName=S?.displayName||"TabsTrigger";const q=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx($,{ref:n,className:x.cn("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));q.displayName=$?.displayName||"TabsContent";exports.Tabs=B;exports.TabsContent=q;exports.TabsList=A;exports.TabsTrigger=M;
|
package/dist/tabs.mjs
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as c } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { P as
|
|
4
|
+
import { P as v, c as p } from "./index-K9FzbxYw.mjs";
|
|
5
5
|
import { c as F } from "./index-IZ2gq03c.mjs";
|
|
6
6
|
import { R as $, I as D, c as y } from "./index-Bv7qrYW6.mjs";
|
|
7
7
|
import { P as V } from "./index-vuPgkS0V.mjs";
|
|
8
8
|
import { u as k } from "./index-CD6_IrA-.mjs";
|
|
9
9
|
import { u as G } from "./index-p6xVFRb4.mjs";
|
|
10
10
|
import { u as L } from "./index-DnFcfnA9.mjs";
|
|
11
|
-
import { c as T } from "./utils-
|
|
12
|
-
var
|
|
11
|
+
import { c as T } from "./utils-DY6fhrgS.mjs";
|
|
12
|
+
var g = "Tabs", [K] = F(g, [
|
|
13
13
|
y
|
|
14
|
-
]), h = y(), [B, x] = K(
|
|
14
|
+
]), h = y(), [B, x] = K(g), C = l.forwardRef(
|
|
15
15
|
(e, t) => {
|
|
16
16
|
const {
|
|
17
17
|
__scopeTabs: a,
|
|
18
18
|
value: o,
|
|
19
|
-
onValueChange:
|
|
19
|
+
onValueChange: r,
|
|
20
20
|
defaultValue: d,
|
|
21
21
|
orientation: n = "horizontal",
|
|
22
22
|
dir: u,
|
|
23
23
|
activationMode: m = "automatic",
|
|
24
|
-
...
|
|
25
|
-
} = e, i = k(u), [
|
|
24
|
+
...b
|
|
25
|
+
} = e, i = k(u), [s, f] = G({
|
|
26
26
|
prop: o,
|
|
27
|
-
onChange:
|
|
27
|
+
onChange: r,
|
|
28
28
|
defaultProp: d ?? "",
|
|
29
|
-
caller:
|
|
29
|
+
caller: g
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ c.jsx(
|
|
32
32
|
B,
|
|
33
33
|
{
|
|
34
34
|
scope: a,
|
|
35
35
|
baseId: L(),
|
|
36
|
-
value:
|
|
36
|
+
value: s,
|
|
37
37
|
onValueChange: f,
|
|
38
38
|
orientation: n,
|
|
39
39
|
dir: i,
|
|
40
40
|
activationMode: m,
|
|
41
41
|
children: /* @__PURE__ */ c.jsx(
|
|
42
|
-
|
|
42
|
+
v.div,
|
|
43
43
|
{
|
|
44
44
|
dir: i,
|
|
45
45
|
"data-orientation": n,
|
|
46
|
-
...
|
|
46
|
+
...b,
|
|
47
47
|
ref: t
|
|
48
48
|
}
|
|
49
49
|
)
|
|
@@ -51,10 +51,10 @@ var p = "Tabs", [K] = F(p, [
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
var
|
|
54
|
+
C.displayName = g;
|
|
55
|
+
var N = "TabsList", R = l.forwardRef(
|
|
56
56
|
(e, t) => {
|
|
57
|
-
const { __scopeTabs: a, loop: o = !0, ...
|
|
57
|
+
const { __scopeTabs: a, loop: o = !0, ...r } = e, d = x(N, a), n = h(a);
|
|
58
58
|
return /* @__PURE__ */ c.jsx(
|
|
59
59
|
$,
|
|
60
60
|
{
|
|
@@ -64,11 +64,11 @@ var C = "TabsList", R = l.forwardRef(
|
|
|
64
64
|
dir: d.dir,
|
|
65
65
|
loop: o,
|
|
66
66
|
children: /* @__PURE__ */ c.jsx(
|
|
67
|
-
|
|
67
|
+
v.div,
|
|
68
68
|
{
|
|
69
69
|
role: "tablist",
|
|
70
70
|
"aria-orientation": d.orientation,
|
|
71
|
-
...
|
|
71
|
+
...r,
|
|
72
72
|
ref: t
|
|
73
73
|
}
|
|
74
74
|
)
|
|
@@ -76,39 +76,39 @@ var C = "TabsList", R = l.forwardRef(
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
R.displayName =
|
|
79
|
+
R.displayName = N;
|
|
80
80
|
var I = "TabsTrigger", j = l.forwardRef(
|
|
81
81
|
(e, t) => {
|
|
82
|
-
const { __scopeTabs: a, value: o, disabled:
|
|
82
|
+
const { __scopeTabs: a, value: o, disabled: r = !1, ...d } = e, n = x(I, a), u = h(a), m = A(n.baseId, o), b = P(n.baseId, o), i = o === n.value;
|
|
83
83
|
return /* @__PURE__ */ c.jsx(
|
|
84
84
|
D,
|
|
85
85
|
{
|
|
86
86
|
asChild: !0,
|
|
87
87
|
...u,
|
|
88
|
-
focusable: !
|
|
88
|
+
focusable: !r,
|
|
89
89
|
active: i,
|
|
90
90
|
children: /* @__PURE__ */ c.jsx(
|
|
91
|
-
|
|
91
|
+
v.button,
|
|
92
92
|
{
|
|
93
93
|
type: "button",
|
|
94
94
|
role: "tab",
|
|
95
95
|
"aria-selected": i,
|
|
96
|
-
"aria-controls":
|
|
96
|
+
"aria-controls": b,
|
|
97
97
|
"data-state": i ? "active" : "inactive",
|
|
98
|
-
"data-disabled":
|
|
99
|
-
disabled:
|
|
98
|
+
"data-disabled": r ? "" : void 0,
|
|
99
|
+
disabled: r,
|
|
100
100
|
id: m,
|
|
101
101
|
...d,
|
|
102
102
|
ref: t,
|
|
103
|
-
onMouseDown:
|
|
104
|
-
!
|
|
103
|
+
onMouseDown: p(e.onMouseDown, (s) => {
|
|
104
|
+
!r && s.button === 0 && s.ctrlKey === !1 ? n.onValueChange(o) : s.preventDefault();
|
|
105
105
|
}),
|
|
106
|
-
onKeyDown:
|
|
107
|
-
[" ", "Enter"].includes(
|
|
106
|
+
onKeyDown: p(e.onKeyDown, (s) => {
|
|
107
|
+
[" ", "Enter"].includes(s.key) && n.onValueChange(o);
|
|
108
108
|
}),
|
|
109
|
-
onFocus:
|
|
110
|
-
const
|
|
111
|
-
!i && !
|
|
109
|
+
onFocus: p(e.onFocus, () => {
|
|
110
|
+
const s = n.activationMode !== "manual";
|
|
111
|
+
!i && !r && s && n.onValueChange(o);
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
)
|
|
@@ -119,25 +119,25 @@ var I = "TabsTrigger", j = l.forwardRef(
|
|
|
119
119
|
j.displayName = I;
|
|
120
120
|
var w = "TabsContent", _ = l.forwardRef(
|
|
121
121
|
(e, t) => {
|
|
122
|
-
const { __scopeTabs: a, value: o, forceMount:
|
|
122
|
+
const { __scopeTabs: a, value: o, forceMount: r, children: d, ...n } = e, u = x(w, a), m = A(u.baseId, o), b = P(u.baseId, o), i = o === u.value, s = l.useRef(i);
|
|
123
123
|
return l.useEffect(() => {
|
|
124
|
-
const f = requestAnimationFrame(() =>
|
|
124
|
+
const f = requestAnimationFrame(() => s.current = !1);
|
|
125
125
|
return () => cancelAnimationFrame(f);
|
|
126
|
-
}, []), /* @__PURE__ */ c.jsx(V, { present:
|
|
127
|
-
|
|
126
|
+
}, []), /* @__PURE__ */ c.jsx(V, { present: r || i, children: ({ present: f }) => /* @__PURE__ */ c.jsx(
|
|
127
|
+
v.div,
|
|
128
128
|
{
|
|
129
129
|
"data-state": i ? "active" : "inactive",
|
|
130
130
|
"data-orientation": u.orientation,
|
|
131
131
|
role: "tabpanel",
|
|
132
132
|
"aria-labelledby": m,
|
|
133
133
|
hidden: !f,
|
|
134
|
-
id:
|
|
134
|
+
id: b,
|
|
135
135
|
tabIndex: 0,
|
|
136
136
|
...n,
|
|
137
137
|
ref: t,
|
|
138
138
|
style: {
|
|
139
139
|
...e.style,
|
|
140
|
-
animationDuration:
|
|
140
|
+
animationDuration: s.current ? "0s" : void 0
|
|
141
141
|
},
|
|
142
142
|
children: f && d
|
|
143
143
|
}
|
|
@@ -151,7 +151,7 @@ function A(e, t) {
|
|
|
151
151
|
function P(e, t) {
|
|
152
152
|
return `${e}-content-${t}`;
|
|
153
153
|
}
|
|
154
|
-
var q =
|
|
154
|
+
var q = C, E = R, M = j, S = _;
|
|
155
155
|
const ae = q, z = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
156
156
|
E,
|
|
157
157
|
{
|
|
@@ -163,7 +163,7 @@ const ae = q, z = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.
|
|
|
163
163
|
...t
|
|
164
164
|
}
|
|
165
165
|
));
|
|
166
|
-
z.displayName = E
|
|
166
|
+
z.displayName = E?.displayName || "TabsList";
|
|
167
167
|
const H = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
168
168
|
M,
|
|
169
169
|
{
|
|
@@ -175,7 +175,7 @@ const H = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
|
175
175
|
...t
|
|
176
176
|
}
|
|
177
177
|
));
|
|
178
|
-
H.displayName = M
|
|
178
|
+
H.displayName = M?.displayName || "TabsTrigger";
|
|
179
179
|
const O = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
180
180
|
S,
|
|
181
181
|
{
|
|
@@ -187,7 +187,7 @@ const O = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
|
187
187
|
...t
|
|
188
188
|
}
|
|
189
189
|
));
|
|
190
|
-
O.displayName = S
|
|
190
|
+
O.displayName = S?.displayName || "TabsContent";
|
|
191
191
|
export {
|
|
192
192
|
ae as Tabs,
|
|
193
193
|
O as TabsContent,
|
package/dist/text.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),d=require("class-variance-authority"),u=require("react"),x=require("./utils-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),d=require("class-variance-authority"),u=require("react"),x=require("./utils-cdbZV8DZ.js");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const b=m(u),a=d.cva("",{variants:{variant:{h1:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-semibold tracking-tight",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold tracking-tight",body:"leading-7",bodySmall:"text-sm leading-6",caption:"text-xs text-muted-foreground",label:"text-sm font-medium leading-none",overline:"text-xs font-semibold uppercase tracking-widest text-muted-foreground"}},defaultVariants:{variant:"body"}}),g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",body:"p",bodySmall:"p",caption:"span",label:"label",overline:"span"},r=b.forwardRef(({className:t,variant:e="body",as:n,children:o,...l},i)=>{const s=n||g[e??"body"]||"p";return c.jsxRuntimeExports.jsx(s,{ref:i,className:x.cn(a({variant:e,className:t})),...l,children:o})});r.displayName="Text";exports.Text=r;exports.textVariants=a;
|
package/dist/text.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { j as i } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import { cva as s } from "class-variance-authority";
|
|
4
4
|
import * as m from "react";
|
|
5
|
-
import { c as x } from "./utils-
|
|
5
|
+
import { c as x } from "./utils-DY6fhrgS.mjs";
|
|
6
6
|
const d = s("", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
package/dist/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-nZSsnGb7.js"),s=require("react"),i=require("./utils-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-nZSsnGb7.js"),s=require("react"),i=require("./utils-cdbZV8DZ.js");function u(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=u(s),o=c.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("textarea",{className:i.cn("border-input placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...r}));o.displayName="Textarea";exports.Textarea=o;
|
package/dist/textarea.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as o } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { c as a } from "./utils-
|
|
4
|
+
import { c as a } from "./utils-DY6fhrgS.mjs";
|
|
5
5
|
const i = s.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o.jsx(
|
|
6
6
|
"textarea",
|
|
7
7
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-nZSsnGb7.js"),s=require("lucide-react"),j=require("./button.cjs"),t=require("./dropdown-menu.cjs"),d=require("@gv-tech/design-tokens"),T=require("next-themes"),r=require("./utils-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-nZSsnGb7.js"),s=require("lucide-react"),j=require("./button.cjs"),t=require("./dropdown-menu.cjs"),d=require("@gv-tech/design-tokens"),T=require("next-themes"),r=require("./utils-cdbZV8DZ.js");function p(){const o=T.useTheme(),{resolvedTheme:i}=o,n=i==="dark"?d.theme.dark:d.theme.light;return{...o,tokens:n}}function k({variant:o="binary",onThemeChange:i,customTheme:n,className:c}){const{theme:R,setTheme:E,resolvedTheme:g}=p(),m=n??R,l=(n||g)==="dark",a=m==="system",x=h=>{i?i(h):E(h)},u=()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(s.Sun,{className:r.cn("h-[1.2rem] w-[1.2rem] transition-all",!a&&!l?"scale-100 rotate-0":"scale-0 -rotate-90")}),e.jsxRuntimeExports.jsx(s.Moon,{className:r.cn("absolute h-[1.2rem] w-[1.2rem] transition-all",!a&&l?"scale-100 rotate-0":"scale-0 rotate-90")}),e.jsxRuntimeExports.jsx(s.SunMoon,{className:r.cn("absolute h-[1.2rem] w-[1.2rem] transition-all",a?"scale-100 rotate-0":"scale-0 rotate-90")}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle theme"})]});return o==="ternary"?e.jsxRuntimeExports.jsxs(t.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(t.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(j.Button,{variant:"ghost",size:"icon",className:r.cn("relative h-9 w-9",c),children:e.jsxRuntimeExports.jsx(u,{})})}),e.jsxRuntimeExports.jsxs(t.DropdownMenuContent,{align:"end",children:[e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("light"),children:[e.jsxRuntimeExports.jsx(s.Sun,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Light"})]}),e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("dark"),children:[e.jsxRuntimeExports.jsx(s.Moon,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Dark"})]}),e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("system"),children:[e.jsxRuntimeExports.jsx(s.SunMoon,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"System"})]})]})]}):e.jsxRuntimeExports.jsx(j.Button,{variant:"ghost",size:"icon",className:r.cn("relative h-9 w-9",c),onClick:()=>x(m==="dark"?"light":"dark"),"aria-label":"Toggle theme",children:e.jsxRuntimeExports.jsx(u,{})})}exports.ThemeToggle=k;exports.useTheme=p;
|
|
@@ -4,7 +4,7 @@ import { Button as g } from "./button.mjs";
|
|
|
4
4
|
import { DropdownMenu as w, DropdownMenuTrigger as v, DropdownMenuContent as N, DropdownMenuItem as i } from "./dropdown-menu.mjs";
|
|
5
5
|
import { theme as p } from "@gv-tech/design-tokens";
|
|
6
6
|
import { useTheme as y } from "next-themes";
|
|
7
|
-
import { c as r } from "./utils-
|
|
7
|
+
import { c as r } from "./utils-DY6fhrgS.mjs";
|
|
8
8
|
function C() {
|
|
9
9
|
const t = y(), { resolvedTheme: n } = t, s = n === "dark" ? p.dark : p.light;
|
|
10
10
|
return {
|
package/dist/theme-toggle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-nZSsnGb7.js");require("lucide-react");require("./button.cjs");require("./dropdown-menu.cjs");const e=require("./theme-toggle-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-nZSsnGb7.js");require("lucide-react");require("./button.cjs");require("./dropdown-menu.cjs");const e=require("./theme-toggle-DXQGNfCe.js");require("./utils-cdbZV8DZ.js");exports.ThemeToggle=e.ThemeToggle;
|