@radui/ui 0.1.6 → 0.1.9
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/README.md +87 -47
- package/dist/components/Accordion.d.ts +67 -0
- package/dist/components/Accordion.js +1 -0
- package/dist/components/AlertDialog.d.ts +116 -0
- package/dist/components/AlertDialog.js +1 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/AspectRatio.js +1 -0
- package/dist/components/Avatar.d.ts +31 -0
- package/dist/components/Avatar.js +1 -0
- package/dist/components/AvatarGroup.d.ts +45 -0
- package/dist/components/AvatarGroup.js +1 -0
- package/dist/components/AvatarPrimitiveFallback-SECStDbi.js +1 -0
- package/dist/components/Badge.d.ts +17 -0
- package/dist/components/Badge.js +1 -0
- package/dist/components/BlockQuote.d.ts +17 -0
- package/dist/components/BlockQuote.js +1 -0
- package/dist/components/Button.d.ts +24 -0
- package/dist/components/Button.js +1 -0
- package/dist/components/Callout.d.ts +31 -0
- package/dist/components/Callout.js +1 -0
- package/dist/components/Card.d.ts +20 -0
- package/dist/components/Card.js +1 -0
- package/dist/components/Checkbox.d.ts +33 -0
- package/dist/components/Checkbox.js +1 -0
- package/dist/components/CheckboxCards.d.ts +34 -0
- package/dist/components/CheckboxCards.js +1 -0
- package/dist/components/CheckboxGroup.d.ts +38 -0
- package/dist/components/CheckboxGroup.js +1 -0
- package/dist/components/CheckboxGroupPrimitive-CEeFUCQV.js +1 -0
- package/dist/components/Code.d.ts +17 -0
- package/dist/components/Code.js +1 -0
- package/dist/components/Collapsible.d.ts +24 -0
- package/dist/components/Collapsible.js +1 -0
- package/dist/components/ContextMenu.d.ts +122 -0
- package/dist/components/ContextMenu.js +1 -0
- package/dist/components/DataList.d.ts +16 -0
- package/dist/components/DataList.js +1 -0
- package/dist/components/Dialog.d.ts +97 -0
- package/dist/components/Dialog.js +1 -0
- package/dist/components/Disclosure.d.ts +35 -0
- package/dist/components/Disclosure.js +1 -0
- package/dist/components/DropdownMenu.d.ts +122 -0
- package/dist/components/DropdownMenu.js +1 -0
- package/dist/components/Em.d.ts +11 -0
- package/dist/components/Em.js +1 -0
- package/dist/components/Heading.d.ts +25 -0
- package/dist/components/Heading.js +1 -0
- package/dist/components/HoverCard.d.ts +38 -0
- package/dist/components/HoverCard.js +1 -0
- package/dist/components/Kbd.d.ts +11 -0
- package/dist/components/Kbd.js +1 -0
- package/dist/components/Link.d.ts +11 -0
- package/dist/components/Link.js +1 -0
- package/dist/components/MenuPrimitive-CBMvjJyH.js +1 -0
- package/dist/components/Menubar.d.ts +109 -0
- package/dist/components/Menubar.js +1 -0
- package/dist/components/Minimap.d.ts +48 -0
- package/dist/components/Minimap.js +1 -0
- package/dist/components/NavigationMenu.d.ts +35 -0
- package/dist/components/NavigationMenu.js +1 -0
- package/dist/components/NumberField.d.ts +23 -0
- package/dist/components/NumberField.js +1 -0
- package/dist/components/Progress.d.ts +27 -0
- package/dist/components/Progress.js +1 -0
- package/dist/components/Quote.d.ts +11 -0
- package/dist/components/Quote.js +1 -0
- package/dist/components/Radio.d.ts +21 -0
- package/dist/components/Radio.js +1 -0
- package/dist/components/RadioCards.d.ts +38 -0
- package/dist/components/RadioCards.js +1 -0
- package/dist/components/RadioGroup.d.ts +51 -0
- package/dist/components/RadioGroup.js +1 -0
- package/dist/components/RadioGroupPrimitive-CbRZK8wB.js +1 -0
- package/dist/components/ScrollArea.d.ts +26 -0
- package/dist/components/ScrollArea.js +1 -0
- package/dist/components/Select.d.ts +90 -0
- package/dist/components/Select.js +1 -0
- package/dist/components/Separator.d.ts +14 -0
- package/dist/components/Separator.js +1 -0
- package/dist/components/Skeleton.d.ts +19 -0
- package/dist/components/Skeleton.js +1 -0
- package/dist/components/Slider.d.ts +81 -0
- package/dist/components/Slider.js +1 -0
- package/dist/components/Splitter.d.ts +57 -0
- package/dist/components/Splitter.js +1 -0
- package/dist/components/Steps.d.ts +38 -0
- package/dist/components/Steps.js +1 -0
- package/dist/components/Strong.d.ts +13 -0
- package/dist/components/Strong.js +1 -0
- package/dist/components/Switch.d.ts +57 -0
- package/dist/components/Switch.js +1 -0
- package/dist/components/TabNav.d.ts +21 -0
- package/dist/components/TabNav.js +1 -0
- package/dist/components/Table.d.ts +31 -0
- package/dist/components/Table.js +1 -0
- package/dist/components/Tabs.d.ts +43 -0
- package/dist/components/Tabs.js +1 -0
- package/dist/components/Text.d.ts +17 -0
- package/dist/components/Text.js +1 -0
- package/dist/components/TextArea.d.ts +22 -0
- package/dist/components/TextArea.js +1 -0
- package/dist/components/Theme.d.ts +17 -0
- package/dist/components/Theme.js +1 -0
- package/dist/components/Toggle.d.ts +34 -0
- package/dist/components/Toggle.js +1 -0
- package/dist/components/ToggleGroup.d.ts +63 -0
- package/dist/components/ToggleGroup.js +1 -0
- package/dist/components/Tooltip.d.ts +35 -0
- package/dist/components/Tooltip.js +1 -0
- package/dist/components/Tree.d.ts +37 -0
- package/dist/components/Tree.js +1 -0
- package/dist/components/VisuallyHidden.d.ts +12 -0
- package/dist/components/VisuallyHidden.js +1 -0
- package/dist/components/clsx-BaVHROc5.js +1 -0
- package/dist/components/floating-ui.react-CLbXmKZY.js +5 -0
- package/dist/components/index-BVxS3Ixi.js +1 -0
- package/dist/components/index-BgvB1-RV.js +1 -0
- package/dist/components/index-Br4Ygpsh.js +1 -0
- package/dist/components/index-BuGKU1-S.js +1 -0
- package/dist/components/index-BxNZdFaZ.js +1 -0
- package/dist/components/index-CD1lNchI.js +1 -0
- package/dist/components/index-DBZNt4Em.js +1 -0
- package/dist/components/index-DR_GC01Z.js +1 -0
- package/dist/components/index-Di6TooPD.js +1 -0
- package/dist/components/index-DzAecJCk.js +1 -0
- package/dist/components/index-fkj4Fdgt.js +1 -0
- package/dist/components/tslib.es6-B3RR16LH.js +1 -0
- package/dist/themes/default.css +1 -0
- package/dist/themes/tailwind-presets/default.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{forwardRef as r}from"react";import{_ as o,b as n}from"./tslib.es6-B3RR16LH.js";import{M as a}from"./MenuPrimitive-CBMvjJyH.js";import{c as t}from"./index-BVxS3Ixi.js";import{c as s}from"./clsx-BaVHROc5.js";import l from"./Separator.js";import"./index-Di6TooPD.js";import"./floating-ui.react-CLbXmKZY.js";import"react/jsx-runtime";import"react-dom";import"./index-fkj4Fdgt.js";import"./index-DR_GC01Z.js";import"./index-BxNZdFaZ.js";var u=e.createContext(null),c="DropdownMenu",i=r((function(r,l){var i=r.children,d=r.customRootClass,m=r.className,p=o(r,["children","customRootClass","className"]),w=t(d,c);return e.createElement(u.Provider,{value:{rootClass:w}},e.createElement(a.Root,n({ref:l,className:s("".concat(w,"-root"),m)},p),i))}));i.displayName=c;var d=r((function(r,t){var l=r.children,c=r.className,i=o(r,["children","className"]),d=e.useContext(u);if(!d)return console.warn("DropdownMenuTrigger should be used in the DropdownMenuRoot"),null;var m=d.rootClass;return e.createElement(a.Trigger,n({ref:t,className:s("".concat(m,"-trigger"),c)},i),l)}));d.displayName="DropdownMenuTrigger";var m=r((function(r,t){var l=r.children,c=r.className,i=o(r,["children","className"]),d=e.useContext(u);if(!d)return console.warn("DropdownMenuContent should be used in the DropdownMenuRoot"),null;var m=d.rootClass;return e.createElement(a.Content,n({ref:t,className:s("".concat(m,"-content"),c)},i),l)}));m.displayName="DropdownMenuContent";var p=r((function(r,t){var s=r.children,l=o(r,["children"]),c=e.useContext(u);return c?(c.rootClass,e.createElement(a.Portal,n({ref:t},l),s)):(console.warn("DropdownMenuPortal should be used in the DropdownMenuRoot"),null)}));p.displayName="DropdownMenuPortal";var w=r((function(r,t){var l=r.children,c=r.className,i=r.label,d=o(r,["children","className","label"]),m=e.useContext(u);if(!m)return console.warn("DropdownMenuItem should be used in the DropdownMenuRoot"),null;var p=m.rootClass;return e.createElement(a.Item,n({ref:t,className:s("".concat(p,"-item"),c),label:i},d),l)}));w.displayName="DropdownMenuItem";var f=r((function(r,t){var l=r.children,c=r.className,i=o(r,["children","className"]),d=e.useContext(u);if(!d)return console.warn("DropdownMenuSub should be used in the DropdownMenuRoot"),null;var m=d.rootClass;return e.createElement(a.Sub,n({ref:t,className:s("".concat(m,"-sub"),c)},i),l)}));f.displayName="DropdownMenuSub";var N=r((function(r,t){var l=r.children,c=r.className,i=o(r,["children","className"]),d=e.useContext(u);if(!d)return console.warn("DropdownMenuSubTrigger should be used in the DropdownMenuRoot"),null;var m=d.rootClass;return e.createElement(a.Trigger,n({ref:t,className:s("".concat(m,"-sub-trigger"),c)},i),l)}));N.displayName="DropdownMenuSubTrigger";var h=r((function(r,a){var t=r.className,s=o(r,["className"]),c=e.useContext(u);if(!c)return console.warn("DropdownMenuSeparator should be used within DropdownMenuRoot"),null;var i=c.rootClass;return e.createElement(l,n({ref:a,customRootClass:i,className:t},s))}));h.displayName="DropdownMenuSeparator";var M=r((function(e,r){return console.warn("Direct usage of DropdownMenu is not supported. Please use DropdownMenu.Root, DropdownMenu.Item instead."),null}));M.displayName="DropdownMenu",M.Root=i,M.Trigger=d,M.Content=m,M.Portal=p,M.Item=w,M.Sub=f,M.SubTrigger=N,M.Separator=h;export{M as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
type EmProps = ComponentPropsWithoutRef<'em'> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const Em: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
|
|
10
|
+
export { Em as default };
|
|
11
|
+
export type { EmProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,b as a}from"./tslib.es6-B3RR16LH.js";import r from"react";import{c as e}from"./index-BVxS3Ixi.js";import{c as m}from"./clsx-BaVHROc5.js";var o=r.forwardRef((function(o,t){var c=o.children,l=o.customRootClass,i=o.className,f=s(o,["children","customRootClass","className"]),n=e(l,"Em");return r.createElement("em",a({ref:t,className:m(n,i)},f),c)}));o.displayName="Em";export{o as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
|
+
/**
|
|
5
|
+
* Heading component that renders HTML heading elements (h1-h6)
|
|
6
|
+
* with customizable styling.
|
|
7
|
+
*/
|
|
8
|
+
type HeadingProps = {
|
|
9
|
+
/** HTML heading tag to render */
|
|
10
|
+
as?: HeadingTag;
|
|
11
|
+
/** Custom root class for specialized styling */
|
|
12
|
+
customRootClass?: string;
|
|
13
|
+
} & React.ComponentPropsWithoutRef<'h1'>;
|
|
14
|
+
/**
|
|
15
|
+
* Renders a heading element with customizable tag and styling
|
|
16
|
+
*/
|
|
17
|
+
declare const Heading: React.ForwardRefExoticComponent<{
|
|
18
|
+
/** HTML heading tag to render */
|
|
19
|
+
as?: HeadingTag;
|
|
20
|
+
/** Custom root class for specialized styling */
|
|
21
|
+
customRootClass?: string;
|
|
22
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
23
|
+
|
|
24
|
+
export { Heading as default };
|
|
25
|
+
export type { HeadingProps, HeadingTag };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,b as a}from"./tslib.es6-B3RR16LH.js";import e from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";var t=e.forwardRef((function(t,i){var m=t.children,c=t.as,l=void 0===c?"h1":c,d=t.customRootClass,h=void 0===d?"":d,f=t.className,n=void 0===f?"":f,p=s(t,["children","as","customRootClass","className"]),u=r(h,l),v=["h1","h2","h3","h4","h5","h6"].includes(l)?l:"h1";return e.createElement(v,a({className:o(u,n),ref:i},p),m)}));t.displayName="Heading";export{t as default};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
3
|
+
import * as _floating_ui_react from '@floating-ui/react';
|
|
4
|
+
import Floater from '~/core/primitives/Floater';
|
|
5
|
+
|
|
6
|
+
declare const HoverCardRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
customRootClass?: string;
|
|
10
|
+
openDelay?: number;
|
|
11
|
+
closeDelay?: number;
|
|
12
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
|
|
14
|
+
type HoverCardTriggerProps = ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
15
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
|
|
17
|
+
declare const HoverCardPortal: React.ForwardRefExoticComponent<_floating_ui_react.FloatingPortalProps & {
|
|
18
|
+
rootElement?: HTMLElement | React.MutableRefObject<HTMLElement | null>;
|
|
19
|
+
} & React.RefAttributes<never>>;
|
|
20
|
+
|
|
21
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
|
|
23
|
+
type HoverCardArrowProps = Omit<ComponentPropsWithoutRef<typeof Floater.Arrow>, 'context'>;
|
|
24
|
+
declare const HoverCardArrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
25
|
+
|
|
26
|
+
type HoverCardElement = ElementRef<'div'>;
|
|
27
|
+
type HoverCardProps = ComponentPropsWithoutRef<'div'>;
|
|
28
|
+
type HoverCardComponent = React.ForwardRefExoticComponent<HoverCardProps & React.RefAttributes<HoverCardElement>> & {
|
|
29
|
+
Root: typeof HoverCardRoot;
|
|
30
|
+
Trigger: typeof HoverCardTrigger;
|
|
31
|
+
Portal: typeof HoverCardPortal;
|
|
32
|
+
Content: typeof HoverCardContent;
|
|
33
|
+
Arrow: typeof HoverCardArrow;
|
|
34
|
+
};
|
|
35
|
+
declare const HoverCard: HoverCardComponent;
|
|
36
|
+
|
|
37
|
+
export { HoverCard as default };
|
|
38
|
+
export type { HoverCardElement, HoverCardProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{createContext as r,forwardRef as t,useRef as o,useState as n,useEffect as a,useContext as s}from"react";import{_ as i,b as l}from"./tslib.es6-B3RR16LH.js";import{F as c}from"./index-Di6TooPD.js";import{c as u}from"./index-BVxS3Ixi.js";import{u as m}from"./index-fkj4Fdgt.js";import{c as f}from"./clsx-BaVHROc5.js";import{P as d}from"./index-DR_GC01Z.js";import"./floating-ui.react-CLbXmKZY.js";import"react/jsx-runtime";import"react-dom";var g=r({}),v="HoverCard",p=t((function(r,t){var s=r.children,d=r.open,p=void 0===d?void 0:d,C=r.onOpenChange,y=r.customRootClass,h=void 0===y?"":y,R=r.openDelay,N=void 0===R?100:R,D=r.closeDelay,w=void 0===D?200:D,x=i(r,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),E=u(h,v),P=u(h,"".concat(v,"-trigger")),T=o(null),H=c.useFloating({placement:"bottom",strategy:"fixed",middleware:[c.arrow({element:T}),c.offset(10),c.flip({mainAxis:!0})]}),j=H.refs,W=H.floatingStyles,F=H.context,M=m(p,!1,C),O=M[0],b=M[1],A=n(!1);A[0];var L=A[1],S=o(null),k=o(null),B=function(e){b(e)},I=c.useRole(F),_=c.useDismiss(F),q=c.useHover(F,{delay:100}),z=c.useInteractions([q,I,_]),G=z.getReferenceProps,J=z.getFloatingProps;a((function(){return function(){S.current&&clearTimeout(S.current),k.current&&clearTimeout(k.current)}}),[]);var K={isOpen:O,handleOpenChange:B,floatingRefs:j,floatingStyles:W,floatingContext:F,arrowRef:T,getReferenceProps:G,getFloatingProps:J,rootClass:E,rootTriggerClass:P,closeWithDelay:function(){L(!0),k.current&&clearTimeout(k.current),k.current=setTimeout((function(){L((function(e){return e&&B(!1),e}))}),w)},closeWithoutDelay:function(){B(!1)},openWithDelay:function(){L(!1),S.current&&clearTimeout(S.current),S.current=setTimeout((function(){B(!0)}),N)}};return e.createElement(g.Provider,{value:K},e.createElement("div",l({ref:t,className:f(E)},x),s))}));p.displayName=v;var C=t((function(r,t){var o=r.children,n=r.className,a=void 0===n?"":n,u=i(r,["children","className"]),m=s(g),v=m.floatingRefs,p=m.closeWithDelay,C=m.openWithDelay,y=m.rootTriggerClass,h=c.useMergeRefs([v.setReference,t]);return e.createElement(d.span,l({className:f(y,a),onClick:function(){},onMouseEnter:C,onMouseLeave:p,ref:h},u),o)}));C.displayName="HoverCardTrigger";var y=t((function(r,t){var o=r.children,n=r.rootElement,a=i(r,["children","rootElement"]),u=s(g).rootTriggerClass,m=n||document.getElementsByClassName(u)[0];return e.createElement(c.Portal,l({root:m},a),o)}));y.displayName="HoverCardPortal";var h=t((function(r,t){var o=r.children,n=r.className,u=i(r,["children","className"]),m=s(g),d=m.isOpen,v=m.floatingRefs,p=m.floatingStyles,C=m.getFloatingProps,y=m.rootClass,h=m.closeWithDelay,R=m.closeWithoutDelay,N=m.openWithDelay;a((function(){var e=function(){return R()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[R]);var D=c.useMergeRefs([v.setFloating,t]);return d?e.createElement("div",l({onPointerEnter:N,onPointerLeave:h,className:f(y,n),ref:D,style:p},u,C()),o):null}));h.displayName="HoverCardContent";var R=t((function(r,t){var o=s(g),n=o.floatingContext,a=o.arrowRef,i=o.rootClass,u=c.useMergeRefs([a,t]);return e.createElement(c.Arrow,l({className:f("".concat(i,"-arrow"))},r,{context:n,ref:u}))}));R.displayName="HoverCardArrow";var N=t((function(e,r){return console.warn("Direct usage of HoverCard is not supported. Please use HoverCard.Root, HoverCard.Trigger, etc. instead."),null}));N.displayName="HoverCard",N.Root=p,N.Trigger=C,N.Portal=y,N.Content=h,N.Arrow=R;export{N as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
|
|
3
|
+
type KbdElement = ElementRef<'kbd'>;
|
|
4
|
+
interface KbdProps extends ComponentPropsWithoutRef<'kbd'> {
|
|
5
|
+
customRootClass?: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
|
|
10
|
+
export { Kbd as default };
|
|
11
|
+
export type { KbdElement, KbdProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,b as a}from"./tslib.es6-B3RR16LH.js";import e,{forwardRef as r}from"react";import{c as o}from"./index-BVxS3Ixi.js";import{c as m}from"./clsx-BaVHROc5.js";import{u as t}from"./index-CD1lNchI.js";var i=r((function(r,i){var c=r.children,d=r.customRootClass,l=r.className,f=r.size,n=void 0===f?"":f,p=s(r,["children","customRootClass","className","size"]),b=o(d,"Kbd"),u=t("kbd",{size:n});return e.createElement("kbd",a({ref:i,className:m(b,l)},u(),p),c)}));i.displayName="Kbd";export{i as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
|
|
3
|
+
interface LinkProps extends ComponentPropsWithoutRef<'a'> {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
size?: string;
|
|
6
|
+
}
|
|
7
|
+
type LinkElement = ElementRef<'a'>;
|
|
8
|
+
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
|
+
|
|
10
|
+
export { Link as default };
|
|
11
|
+
export type { LinkElement, LinkProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,b as r}from"./tslib.es6-B3RR16LH.js";import e from"react";import{c as a}from"./clsx-BaVHROc5.js";import{c as o}from"./index-BVxS3Ixi.js";import{u as i}from"./index-CD1lNchI.js";import{P as m}from"./index-DR_GC01Z.js";var t="Link",f=e.forwardRef((function(f,c){var l=f.children,d=f.href,n=void 0===d?"#":d,p=f.customRootClass,u=f.className,h=f.size,j=void 0===h?"":h,x=s(f,["children","href","customRootClass","className","size"]),v=o(p,t),N=i("link",{size:j}),z=m.a;return e.createElement(z,r({ref:c,href:n,className:a(v,u)},N(),x),l)}));f.displayName=t;export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as n}from"./tslib.es6-B3RR16LH.js";import t,{forwardRef as i,useState as a,useRef as s,useContext as l,useEffect as o}from"react";import{F as r}from"./index-Di6TooPD.js";import{u as c}from"./index-fkj4Fdgt.js";import{P as d}from"./index-DR_GC01Z.js";import{B as u}from"./index-BxNZdFaZ.js";var f=t.createContext(null),m=i((function(i,l){var o=i.children,d=i.className,u=i.open,m=i.onOpenChange,p=i.defaultOpen,v=void 0!==p&&p,g=i.crossAxisOffset,h=void 0===g?0:g,x=i.mainAxisOffset,N=void 0===x?0:x,O=i.loop,C=void 0===O||O,P=i.placement,b=void 0===P?"bottom-start":P,I=i.avoidCollision,R=void 0===I||I,y=i.rtl,E=void 0!==y&&y,F=e(i,["children","className","open","onOpenChange","defaultOpen","crossAxisOffset","mainAxisOffset","loop","placement","avoidCollision","rtl"]),M=c(u,v,m),A=M[0],S=M[1],k=a(null),T=k[0],j=k[1],L=s([]),w=s([]),D=s([]),q=s(null),B=r.useFloatingNodeId(),H=r.useFloatingParentNodeId(),U=null!=H,_=r.useFloating({open:A,nodeId:B,onOpenChange:S,placement:U?"right-start":b,middleware:[r.flip({mainAxis:R}),r.offset({mainAxis:N,crossAxis:h})],whileElementsMounted:r.autoUpdate}),z=_.refs,G=_.floatingStyles,J=_.context,K=r.useListNavigation(J,{listRef:w,activeIndex:T,nested:U,rtl:E,loop:C,onNavigate:j}),Q=r.useClick(J,{}),V=r.useHover(J,{enabled:U,delay:{open:75},handleClose:r.safePolygon({blockPointerEvents:!0})}),W=r.useDismiss(J,{bubbles:!0}),X=r.useTypeahead(J,{listRef:D,onMatch:A?j:void 0,activeIndex:T}),Y=r.useInteractions([W,Q,K,V,X]),Z=Y.getReferenceProps,$=Y.getFloatingProps,ee=Y.getItemProps,ne={isOpen:A,setIsOpen:S,refs:z,floatingStyles:G,getReferenceProps:Z,getFloatingProps:$,getItemProps:ee,activeIndex:T,setActiveIndex:j,listRef:L,elementsRef:w,labelsRef:D,virtualItemRef:q,nodeId:B,isNested:U,floatingContext:J,rtl:E},te=r.useFloatingTree();return t.useEffect((function(){if(te)return te.events.on("click",e),function(){te.events.off("click",e)};function e(){S(!1)}}),[te,B,H]),t.createElement("div",n({ref:l,className:d,"data-tree":"true"},F),t.createElement(f.Provider,{value:ne},t.createElement(r.FloatingNode,{id:B},o)))}));m.displayName="MenuComponentRoot";var p=i((function(i,a){var s=i.children,l=i.className,o=i.open,c=i.onOpenChange,d=i.defaultOpen,u=void 0!==d&&d,f=i.crossAxisOffset,p=i.mainAxisOffset,v=e(i,["children","className","open","onOpenChange","defaultOpen","crossAxisOffset","mainAxisOffset"]);return t.createElement(r.FloatingTree,null,t.createElement(m,n({ref:a,className:l,open:o,onOpenChange:c,defaultOpen:u,crossAxisOffset:f,mainAxisOffset:p},v),s))}));p.displayName="MenuPrimitiveRoot";var v=i((function(i,a){var s=i.children,l=i.className,o=i.label,c=i.disabled,u=i.asChild,m=void 0!==u&&u,p=i.onSelect,v=e(i,["children","className","label","disabled","asChild","onSelect"]),g=t.useContext(f),h=c?null:o,x=r.useListItem({label:h}),N=x.ref,O=x.index,C=r.useFloatingTree(),P=t.useCallback((function(e){"function"==typeof N?N(e):N&&(N.current=e),"function"==typeof a?a(e):a&&(a.current=e)}),[N,a]);if(!g)return null;var b=g.activeIndex,I=g.getItemProps,R=b===O;return t.createElement(d.button,n({ref:P,tabIndex:R?0:-1,className:l},I({onClick:function(e){c||(p?p(e):null==C||C.events.emit("click"))}}),{disabled:c,asChild:m},v),s)}));v.displayName="MenuPrimitiveItem";var g=i((function(i,a){var s=i.children,o=i.className,c=i.asChild,d=e(i,["children","className","asChild"]),m=l(f),p=r.useListItem(),v=p.ref,g=p.index,h=r.useMergeRefs([null==m?void 0:m.refs.setReference,v,a]);if(!m)return null;var x=m.activeIndex,N=m.getReferenceProps,O=m.isNested;return t.createElement(u,n({className:o,tabIndex:O?x===g?0:-1:void 0,ref:h},N(),{asChild:c},d),s)}));g.displayName="MenuPrimitiveTrigger";var h=i((function(i,a){var s=i.children,o=i.className,c=e(i,["children","className"]),d=l(f),u=r.useMergeRefs([null==d?void 0:d.refs.setFloating,a]);if(!d||!d.isOpen)return null;var m=d.floatingStyles,p=d.getFloatingProps,v=d.elementsRef,g=d.labelsRef,h=d.isNested,x=d.floatingContext;return t.createElement(r.FloatingList,{elementsRef:v,labelsRef:g},t.createElement(r.FocusManager,{context:x,modal:!1,initialFocus:h?-1:0,returnFocus:!h},t.createElement("div",n({ref:u,style:m},p(),{className:o},c),s)))}));h.displayName="MenuPrimitiveContent";var x=i((function(i,a){var s=i.children,o=i.className,r=i.open,c=i.onOpenChange,d=i.defaultOpen,u=void 0!==d&&d,p=e(i,["children","className","open","onOpenChange","defaultOpen"]),v=l(f);return t.createElement(m,n({ref:a,className:o,open:r,onOpenChange:c,defaultOpen:u,rtl:v&&v.rtl||!1},p),s)}));x.displayName="MenuPrimitiveSub";var N=i((function(i,s){var c=i.children,d=e(i,["children"]),u=l(f),m=a(!1),p=m[0],v=m[1],g=document.querySelector("#rad-ui-theme-container")||document.body;return o((function(){g&&v(!0)}),[g]),u&&u.isOpen&&p?t.createElement(r.Portal,n({root:g},d),t.createElement("div",{ref:s},c)):null}));N.displayName="MenuPrimitivePortal";var O=function(){return console.warn("Direct usage of MenuPrimitive is not supported. Please use MenuPrimitive.Root, MenuPrimitive.Item instead."),null};O.Root=p,O.Item=v,O.Trigger=g,O.Content=h,O.Sub=x,O.Portal=N;export{O as M};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
4
|
+
import * as _floating_ui_react from '@floating-ui/react';
|
|
5
|
+
|
|
6
|
+
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
7
|
+
type SeparatorProps = {
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
customRootClass?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
decorative?: boolean;
|
|
12
|
+
} & PrimitiveDivProps;
|
|
13
|
+
declare const Separator: react__default.ForwardRefExoticComponent<SeparatorProps & react__default.RefAttributes<HTMLElement>>;
|
|
14
|
+
|
|
15
|
+
type MenubarSeparatorProps = {
|
|
16
|
+
className?: string;
|
|
17
|
+
} & ComponentPropsWithoutRef<typeof Separator>;
|
|
18
|
+
|
|
19
|
+
type MenuPrimitiveItemProps = {
|
|
20
|
+
children: react__default.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
asChild?: boolean;
|
|
25
|
+
onSelect?: (event: react__default.MouseEvent<HTMLButtonElement>) => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type MenuPrimitiveContentProps = {
|
|
29
|
+
children: react__default.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type MenuPrimitiveTriggerProps = {
|
|
34
|
+
children: react__default.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare const Menubar: {
|
|
40
|
+
(): null;
|
|
41
|
+
Root: react.ForwardRefExoticComponent<{
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
customRootClass?: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
} & Omit<Omit<react.HTMLProps<HTMLElement> & _floating_ui_react.CompositeProps, "ref"> & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
46
|
+
Menu: react.ForwardRefExoticComponent<{
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
className?: string;
|
|
49
|
+
} & Omit<{
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
className?: string;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
onOpenChange?: (open: boolean) => void;
|
|
54
|
+
defaultOpen?: boolean;
|
|
55
|
+
crossAxisOffset?: number;
|
|
56
|
+
mainAxisOffset?: number;
|
|
57
|
+
loop?: boolean;
|
|
58
|
+
placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
|
|
59
|
+
avoidCollision?: boolean;
|
|
60
|
+
rtl?: boolean;
|
|
61
|
+
} & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
Trigger: react.ForwardRefExoticComponent<{
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
className?: string;
|
|
65
|
+
} & Omit<MenuPrimitiveTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
Content: react.ForwardRefExoticComponent<{
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
} & Omit<MenuPrimitiveContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
Portal: react.ForwardRefExoticComponent<{
|
|
71
|
+
children: React.ReactNode;
|
|
72
|
+
} & Omit<{
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
} & _floating_ui_react.FloatingPortalProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
Item: react.ForwardRefExoticComponent<{
|
|
76
|
+
children: React.ReactNode;
|
|
77
|
+
className?: string;
|
|
78
|
+
label?: string;
|
|
79
|
+
} & Omit<MenuPrimitiveItemProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
80
|
+
Sub: react.ForwardRefExoticComponent<{
|
|
81
|
+
children: React.ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
} & Omit<{
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
className?: string;
|
|
86
|
+
open?: boolean;
|
|
87
|
+
onOpenChange?: (open: boolean) => void;
|
|
88
|
+
defaultOpen?: boolean;
|
|
89
|
+
} & {
|
|
90
|
+
children: React.ReactNode;
|
|
91
|
+
className?: string;
|
|
92
|
+
open?: boolean;
|
|
93
|
+
onOpenChange?: (open: boolean) => void;
|
|
94
|
+
defaultOpen?: boolean;
|
|
95
|
+
crossAxisOffset?: number;
|
|
96
|
+
mainAxisOffset?: number;
|
|
97
|
+
loop?: boolean;
|
|
98
|
+
placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
|
|
99
|
+
avoidCollision?: boolean;
|
|
100
|
+
rtl?: boolean;
|
|
101
|
+
} & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
102
|
+
SubTrigger: react.ForwardRefExoticComponent<{
|
|
103
|
+
children: React.ReactNode;
|
|
104
|
+
className?: string;
|
|
105
|
+
} & Omit<MenuPrimitiveTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
106
|
+
Separator: react.ForwardRefExoticComponent<MenubarSeparatorProps & react.RefAttributes<HTMLElement>>;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export { Menubar as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as r,a as t}from"./tslib.es6-B3RR16LH.js";import a,{forwardRef as n}from"react";import{c as o}from"./index-BVxS3Ixi.js";import{c as s}from"./clsx-BaVHROc5.js";import{F as u}from"./index-Di6TooPD.js";import{M as l}from"./MenuPrimitive-CBMvjJyH.js";import i from"./Separator.js";import"./floating-ui.react-CLbXmKZY.js";import"react/jsx-runtime";import"react-dom";import"./index-fkj4Fdgt.js";import"./index-DR_GC01Z.js";import"./index-BxNZdFaZ.js";var c=a.createContext(null),m=n((function(n,l){var i=n.children,m=n.customRootClass,d=n.className,b=n.dir,f=n.loop,p=e(n,["children","customRootClass","className","dir","loop"]),v=o(m,"Menubar"),M=a.useState([]),h=M[0],N=M[1],C=a.useState(0),g=C[0],x=C[1],R=function(e,t){N((function(a){return a.map((function(a){return a.id===e?r(r({},a),{state:t}):a}))}))};return a.createElement(c.Provider,{value:{rootClass:v,registerItem:function(e,a){void 0===a&&(a="closed"),N((function(n){return n.find((function(r){return r.id===e}))?n.map((function(t){return t.id===e?r(r({},t),{state:a}):t})):t(t([],n,!0),[{id:e,state:a}],!1)}))},items:h,updateItemState:R}},a.createElement(u.Composite,r({ref:l,className:s("".concat(v,"-root"),d),dir:b,loop:f},p,{activeIndex:g,onNavigate:function(e){var r=h[g],t=h[e];if(r&&R(r.id,"closed"),t){var a="open"===(null==r?void 0:r.state);R(t.id,a?"open":"closed")}x(e)}}),i))}));m.displayName="MenubarRoot";var d=a.createContext(null),b=n((function(t,n){var o=t.children,i=t.className,m=e(t,["children","className"]),b=a.useContext(c),f=a.useContext(d);if(!b)return console.warn("MenubarTrigger should be used in the MenubarRoot"),null;var p=b.rootClass;if(!f)return console.warn("MenubarTrigger should be used in the MenubarMenu"),null;var v=f.isOpen;return a.createElement(u.CompositeItem,{render:function(){return a.createElement(l.Trigger,r({ref:n,className:s("".concat(p,"-trigger"),i),"data-active":v},m),o)}})}));b.displayName="MenubarTrigger";var f=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarContent should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Content,r({ref:n,className:s("".concat(d,"-content"),u)},i),o)}));f.displayName="MenubarContent";var p=n((function(t,n){var o=t.children,s=e(t,["children"]);return a.useContext(c)?a.createElement(l.Portal,r({ref:n},s),o):(console.warn("MenubarPortal should be used in the MenubarRoot"),null)}));p.displayName="MenubarPortal";var v=n((function(t,n){var o=t.children,u=t.className,i=t.label,m=e(t,["children","className","label"]),d=a.useContext(c);if(!d)return console.warn("MenubarItem should be used in the MenubarRoot"),null;var b=d.rootClass;return a.createElement(l.Item,r({ref:n,className:s("".concat(b,"-item"),u),label:i},m),o)}));v.displayName="MenubarItem";var M=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarSub should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Sub,r({ref:n,className:s("".concat(d,"-sub"),u)},i),o)}));M.displayName="MenubarSub";var h=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarSubTrigger should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Trigger,r({ref:n,className:s("".concat(d,"-sub-trigger"),u)},i),o)}));h.displayName="MenubarSubTrigger";var N=n((function(t,n){var o,i=t.children,m=t.className,b=e(t,["children","className"]),f=a.useContext(c),p=u.useId();if(!f)return console.warn("MenubarMenu should be used in the MenubarRoot"),null;var v=f.rootClass,M=f.registerItem,h=f.items,N=f.updateItemState;a.useEffect((function(){p&&M(p)}),[p]);var C="open"===(null===(o=h.find((function(e){return e.id===p})))||void 0===o?void 0:o.state);return a.createElement(l.Root,r({ref:n,className:s("".concat(v,"-menu"),m),"data-id":p,"data-active":C,open:C,onOpenChange:function(e){return p&&N(p,e?"open":"closed")}},b),a.createElement(d.Provider,{value:{isOpen:C}},i))}));N.displayName="MenubarMenu";var C=n((function(t,n){var o=t.className,s=e(t,["className"]),u=a.useContext(c);if(!u)return console.warn("MenubarSeparator should be used within MenubarRoot"),null;var l=u.rootClass;return a.createElement(i,r({ref:n,customRootClass:l,className:o},s))}));C.displayName="MenubarSeparator";var g=function(){return console.warn("Direct usage of Menubar is not supported. Please use Menubar.Root, Menubar.Item instead."),null};g.Root=m,g.Menu=N,g.Trigger=b,g.Content=f,g.Portal=p,g.Item=v,g.Sub=M,g.SubTrigger=h,g.Separator=C;export{g as default};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type MinimapRootProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const MinimapRoot: ({ children, className, customRootClass, ...props }: MinimapRootProps) => React.JSX.Element;
|
|
7
|
+
|
|
8
|
+
type MinimapItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
declare const MinimapItem: ({ children, className, value, ...props }: MinimapItemProps) => React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const MinimapTrack: ({ children, className, ...props }: MinimapTrackProps) => React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
type MinimapLineProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
declare const MinimapLine: ({ children, className, ...props }: MinimapLineProps) => React.JSX.Element;
|
|
17
|
+
|
|
18
|
+
type MinimapContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
declare const MinimapContent: ({ children, className, ...props }: MinimapContentProps) => React.JSX.Element;
|
|
20
|
+
|
|
21
|
+
type MinimapBubbleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
declare const MinimapBubble: ({ children, className, ...props }: MinimapBubbleProps) => React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
type MinimapProviderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
scrollable?: boolean;
|
|
27
|
+
};
|
|
28
|
+
declare const MinimapProvider: ({ children, className, scrollable, ...props }: MinimapProviderProps) => React.JSX.Element;
|
|
29
|
+
|
|
30
|
+
type MinimapWaypointProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
value?: string | null;
|
|
32
|
+
};
|
|
33
|
+
declare const MinimapWaypoint: ({ children, className, value, ...props }: MinimapWaypointProps) => React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
declare const MinimapComponent: () => null;
|
|
36
|
+
type MinimapComponentType = typeof MinimapComponent & {
|
|
37
|
+
Root: typeof MinimapRoot;
|
|
38
|
+
Item: typeof MinimapItem;
|
|
39
|
+
Track: typeof MinimapTrack;
|
|
40
|
+
Line: typeof MinimapLine;
|
|
41
|
+
Content: typeof MinimapContent;
|
|
42
|
+
Bubble: typeof MinimapBubble;
|
|
43
|
+
Provider: typeof MinimapProvider;
|
|
44
|
+
Waypoint: typeof MinimapWaypoint;
|
|
45
|
+
};
|
|
46
|
+
declare const Minimap: MinimapComponentType;
|
|
47
|
+
|
|
48
|
+
export { Minimap as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as t,a as n}from"./tslib.es6-B3RR16LH.js";import o,{createContext as r,useRef as l,useEffect as a}from"react";import{c as i}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";import{P as c}from"./index-DR_GC01Z.js";import{R as u}from"./index-Br4Ygpsh.js";import"./index-BxNZdFaZ.js";var m=r({rootClass:"",rootRef:null}),d=r({value:"",isVisible:!1}),f=r({visibleItems:[],handleInView:function(){},handleOutView:function(){},scrollToItem:function(){},registerRef:function(){}});function v(e){if(!e)return null;var t=window.getComputedStyle(e).overflowY;return"auto"===t||"scroll"===t?e:v(e.parentElement)}function h(e){var t=e.onEnter,n=e.onLeave,o=e.threshold,r=void 0===o?0:o,i=e.rootMargin,s=void 0===i?"0px":i,c=e.root,u=l(null);return a((function(){if("undefined"!=typeof window&&"IntersectionObserver"in window&&u.current){var e=null!=c?c:v(u.current),o=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting?null==t||t():null==n||n()}))}),{threshold:r,rootMargin:s,root:e});return o.observe(u.current),function(){u.current&&o.unobserve(u.current),o.disconnect()}}}),[t,n,r,s,c]),u}var C=Object.assign((function(){return console.warn("Direct usage of Minimap is not supported. Please use Minimap.Root, Minimap.Item instead."),null}),{Root:function(n){var r=n.children,l=n.className,a=n.customRootClass,d=void 0===a?"":a,f=e(n,["children","className","customRootClass"]),v=s(d,"Minimap"),h=o.useRef(null);return o.createElement(m.Provider,{value:{rootClass:v,rootRef:h}},o.createElement(u.Root,{loop:!0,orientation:"both"},o.createElement(u.Group,null,o.createElement(c.div,t({ref:h,className:i(v,l)},f),r))))},Item:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=n.value,v=e(n,["children","className","value"]),h=(o.useContext(m)||{rootClass:""}).rootClass,C=o.useContext(f),b=C.visibleItems,p=C.scrollToItem,w=b.includes(s),N=o.useMemo((function(){return{value:s,isVisible:w}}),[s,w]),g=o.useCallback((function(){p(s)}),[s,p]);return o.createElement(d.Provider,{value:N},o.createElement(u.Item,{value:s},o.createElement(c.button,t({onClick:g,className:i("".concat(h,"-item"),a),"data-in-view":w?"true":"false"},v),r)))},Track:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=o.useContext(m).rootClass;return o.createElement("div",t({className:i("".concat(c,"-track"),a)},s),r)},Line:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=(o.useContext(m)||{rootClass:""}).rootClass,u=(o.useContext(d)||{value:""}).value,v=o.useContext(f).visibleItems,h=v.indexOf(u),C=-1!==h,b=-1!==h&&h<v.length-1,p=C&&b;return o.createElement("div",t({className:i("".concat(c,"-line"),a),"data-in-view":p?"true":"false"},s),r)},Content:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=o.useContext(m).rootClass;return o.createElement("div",t({className:i("".concat(c,"-content"),a)},s),r)},Bubble:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=(o.useContext(m)||{rootClass:""}).rootClass,u=(o.useContext(d)||{isVisible:!1}).isVisible;return o.createElement("div",t({className:i("".concat(c,"-bubble"),a),"data-in-view":u?"true":"false"},s),r)},Provider:function(r){var l=r.children,a=r.className,i=void 0===a?"":a,s=r.scrollable,c=e(r,["children","className","scrollable"]),u=o.useState([]),m=u[0],d=u[1],v=o.useRef(new Map),h=o.useRef(null),C=o.useCallback((function(e,t){t?v.current.set(e,t):v.current.delete(e)}),[]),b=o.useCallback((function(e){d((function(t){return null===e||t.includes(e)?t:n(n([],t,!0),[e],!1).sort((function(e,t){var n=v.current.get(e),o=v.current.get(t);return n&&o?n.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1:0}))}))}),[]),p=o.useCallback((function(e){d((function(t){return null!==e&&t.includes(e)?t.filter((function(t){return t!==e})):t}))}),[]),w=o.useCallback((function(e){var t=v.current.get(e);if(t){var n=null;if(s&&h.current)n=h.current;else{var o=function(e){if(!e||e===document.body)return null;var t=window.getComputedStyle(e);return("auto"===t.overflow||"scroll"===t.overflow||"auto"===t.overflowY||"scroll"===t.overflowY)&&e.scrollHeight>e.clientHeight?e:o(e.parentElement)};n=o(t.parentElement)}if(n){var r=t.getBoundingClientRect(),l=n.getBoundingClientRect(),a=r.top-l.top+n.scrollTop,i=n.scrollHeight-n.clientHeight,c=Math.max(0,Math.min(a,i));Math.abs(c-n.scrollTop)>1&&n.scrollTo({top:c,behavior:"smooth"})}}}),[]),N=o.useMemo((function(){return{visibleItems:m,handleInView:b,handleOutView:p,scrollToItem:w,registerRef:C}}),[m,b,p,w,C]);return o.createElement(f.Provider,{value:N},o.createElement("div",t({ref:h,className:"".concat(i)},c),l))},Waypoint:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=n.value,c=void 0===s?"":s,u=e(n,["children","className","value"]),m=o.useContext(f),d=m.handleInView,v=m.handleOutView,C=m.registerRef,b=h({onEnter:o.useCallback((function(){console.log("waypoint",c,"in view"),d(c)}),[c,d]),onLeave:o.useCallback((function(){console.log("waypoint",c,"out of view"),v(c)}),[c,v]),threshold:.1}),p=o.useCallback((function(e){"function"==typeof b?b(e):b&&(b.current=e),c&&C(c,e)}),[b,c,C]);return o.createElement("div",t({ref:p,className:i(a)},u),r)}});export{C as default};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface NavigationMenuLinkProps extends React__default.ComponentPropsWithoutRef<'a'> {
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface NavigationMenuContentProps extends React__default.ComponentPropsWithoutRef<'div'> {
|
|
9
|
+
children: React__default.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface NavigationMenuTriggerProps extends React__default.ComponentPropsWithoutRef<'button'> {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface NavigationMenuItemProps extends React__default.ComponentPropsWithoutRef<'div'> {
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface NavigationMenuRootProps extends React__default.ComponentPropsWithoutRef<'div'> {
|
|
20
|
+
children: React__default.ReactNode;
|
|
21
|
+
value?: string;
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
onValueChange?: (value: string) => void;
|
|
24
|
+
customRootClass?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const NavigationMenu: {
|
|
28
|
+
Root: React.ForwardRefExoticComponent<NavigationMenuRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
Item: React.ForwardRefExoticComponent<NavigationMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Trigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
Content: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
Link: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { NavigationMenu as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as n}from"./tslib.es6-B3RR16LH.js";import a,{useEffect as t}from"react";import{R as r}from"./index-Br4Ygpsh.js";import{u as o}from"./index-fkj4Fdgt.js";import{c as s}from"./index-BVxS3Ixi.js";import{c as l}from"./clsx-BaVHROc5.js";import{c as i}from"./index-DBZNt4Em.js";import"./index-DR_GC01Z.js";import"./index-BxNZdFaZ.js";var c=a.createContext({isOpen:"",setIsOpen:function(){},rootClass:""}),u="NavigationMenuRoot",m=a.forwardRef((function(t,i){var m=t.children,d=t.value,f=t.defaultValue,v=void 0===f?"":f,p=t.onValueChange,N=t.customRootClass,C=t.className,g=e(t,["children","value","defaultValue","onValueChange","customRootClass","className"]),h=s(N,u),E=o(d,v,p),x=E[0],R=E[1];return a.createElement("div",n({ref:i},g),a.createElement(c.Provider,{value:{isOpen:x,setIsOpen:R,rootClass:h}},a.createElement(r.Root,null,a.createElement(r.Group,{className:l("".concat(h,"-root"),C)},m))))}));m.displayName=u;var d=a.createContext({itemOpen:!1,handleTrigger:function(){}}),f=a.forwardRef((function(t,r){var o=t.value,s=t.children,u=t.className,m=t.onMouseEnter,f=t.onMouseLeave,v=t.onKeyDown,p=e(t,["value","children","className","onMouseEnter","onMouseLeave","onKeyDown"]),N=a.useContext(c),C=N.isOpen,g=N.setIsOpen,h=N.rootClass,E=C===o,x=function(){g(E?"":o)};return a.createElement(d.Provider,{value:{itemOpen:E,handleTrigger:x}},a.createElement("div",n({ref:r,onMouseEnter:i(m,x),onMouseLeave:i(f,x),className:l("".concat(h,"-item"),u),onKeyDown:i(v,(function(e){"Escape"===e.key&&g("")}))},p),s))}));f.displayName="NavigationMenuItem";var v=a.forwardRef((function(t,o){var s=t.children,u=t.className,m=t.onClick,f=e(t,["children","className","onClick"]),v=a.useContext(d).handleTrigger,p=a.useContext(c).rootClass;return a.createElement(r.Item,null,a.createElement("button",n({ref:o,onClick:i(m,v),className:l("".concat(p,"-trigger"),u)},f),s))}));v.displayName="NavigationMenuTrigger";var p=a.forwardRef((function(o,s){var i=o.children,u=o.className,m=e(o,["children","className"]),f=a.useContext(d).itemOpen,v=a.useContext(c).rootClass,p=a.useRef(null);return a.useImperativeHandle(s,(function(){return p.current})),t((function(){var e,n=null===(e=p.current)||void 0===e?void 0:e.querySelector("*");null==n||n.focus()}),[f]),f?a.createElement("div",n({ref:p,className:l("".concat(v,"-content"),u),"data-state":f?"open":"closed"},m),a.createElement(r.Root,null,a.createElement(r.Group,null,i))):null}));p.displayName="NavigationMenuContent";var N=a.forwardRef((function(t,o){var s=t.children,i=t.href,u=t.className,m=e(t,["children","href","className"]),d=a.useContext(c).rootClass;return a.createElement(r.Item,null,a.createElement("a",n({ref:o,href:i,className:l("".concat(d,"-link"),u)},m),s))}));N.displayName="NavigationMenuLink";var C={Root:m,Item:f,Trigger:v,Content:p,Link:N};export{C as default};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const NumberField: {
|
|
4
|
+
(): null;
|
|
5
|
+
Root: react.ForwardRefExoticComponent<{
|
|
6
|
+
name?: string;
|
|
7
|
+
defaultValue?: number | "";
|
|
8
|
+
value?: number | "";
|
|
9
|
+
onValueChange?: (value: number | "") => void;
|
|
10
|
+
step?: number;
|
|
11
|
+
largeStep?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
} & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
Increment: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
Decrement: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { NumberField as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as r}from"./tslib.es6-B3RR16LH.js";import n,{forwardRef as a,useContext as t}from"react";import{u as l}from"./index-fkj4Fdgt.js";import{c as i}from"./index-BVxS3Ixi.js";import{c as d}from"./clsx-BaVHROc5.js";var u=n.createContext(null),o="NumberField",s=a((function(a,t){var s=a.children,c=a.name,m=a.defaultValue,p=void 0===m?"":m,f=a.value,b=a.onValueChange,v=a.largeStep,y=a.step,N=a.min,h=a.max,F=a.disabled,g=a.readOnly,w=a.required,C=a.id,D=a.className,O=e(a,["children","name","defaultValue","value","onValueChange","largeStep","step","min","max","disabled","readOnly","required","id","className"]),k=i(D,o),x=l(f,p,b),I=x[0],S=x[1],V={inputValue:I,handleOnChange:function(e){S(""!==e?void 0!==h&&e>h?h:void 0!==N&&e<N?N:e:"")},handleStep:function(e){var r=e.type,n=e.direction,a=0;switch(r){case"small":if(!y)return;a=y;break;case"large":if(!v)return;a=v}"decrement"===n&&(a*=-1),function(e){S((function(r){var n=r;""===n&&(n=void 0!==N?N:-1);var a=n+e;return void 0!==h&&a>h?h:void 0!==N&&a<N?N:a}))}(a)},id:C,name:c,disabled:F,readOnly:g,required:w,rootClass:k};return n.createElement("div",r({ref:t,className:d("".concat(k,"-root"),D)},O),n.createElement(u.Provider,{value:V},s))}));s.displayName=o;var c=a((function(a,l){var i=a.className,o=e(a,["className"]),s=t(u);if(!s)return console.error("NumberFieldInput must be used within a NumberField"),null;var c=s.inputValue,m=s.handleOnChange,p=s.handleStep,f=s.id,b=s.name,v=s.disabled,y=s.readOnly,N=s.required,h=s.rootClass;return n.createElement("input",r({ref:l,type:"number",onKeyDown:function(e){"ArrowUp"!==e.key||e.shiftKey||(e.preventDefault(),p({direction:"increment",type:"small"})),"ArrowDown"!==e.key||e.shiftKey||(e.preventDefault(),p({direction:"decrement",type:"small"})),"ArrowUp"===e.key&&e.shiftKey&&(e.preventDefault(),p({direction:"increment",type:"large"})),"ArrowDown"===e.key&&e.shiftKey&&(e.preventDefault(),p({direction:"decrement",type:"large"}))},value:""===c?"":c,onChange:function(e){var r=e.target.value;m(""===r?"":Number(r))},id:f,name:b,disabled:v,readOnly:y,required:N,className:d("".concat(h,"-input"),i)},o))}));c.displayName="NumberFieldInput";var m=a((function(a,l){var i=a.children,o=a.className,s=e(a,["children","className"]),c=t(u);if(!c)return console.error("NumberFieldIncrement must be used within a NumberField"),null;var m=c.handleStep,p=c.rootClass,f=c.disabled,b=c.readOnly;return n.createElement("button",r({ref:l,onClick:function(){return m({direction:"increment",type:"small"})},className:d("".concat(p,"-increment"),o),disabled:f||b,type:"button"},s),i)}));m.displayName="NumberFieldIncrement";var p=a((function(a,l){var i=a.children,o=a.className,s=e(a,["children","className"]),c=t(u);if(!c)return console.error("NumberFieldDecrement must be used within a NumberField"),null;var m=c.handleStep,p=c.rootClass,f=c.disabled,b=c.readOnly;return n.createElement("button",r({ref:l,onClick:function(){return m({direction:"decrement",type:"small"})},className:d("".concat(p,"-decrement"),o),disabled:f||b,type:"button"},s),i)}));p.displayName="NumberFieldDecrement";var f=function(){return console.warn("Direct usage of NumberField is not supported. Please use NumberField.Root, NumberField.Item instead."),null};f.Root=s,f.Input=c,f.Increment=m,f.Decrement=p;export{f as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
3
|
+
|
|
4
|
+
type ProgressRootElement = ElementRef<typeof Primitive.div>;
|
|
5
|
+
type ProgressRootProps = {
|
|
6
|
+
value: number | null;
|
|
7
|
+
minValue: number;
|
|
8
|
+
maxValue: number;
|
|
9
|
+
getValueLabel?: (value: number, minValue: number, maxValue: number) => string;
|
|
10
|
+
customRootClass?: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
} & ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
13
|
+
declare const ProgressRoot: React.ForwardRefExoticComponent<ProgressRootProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
|
|
15
|
+
type ProgressIndicatorProps = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
16
|
+
declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
|
|
18
|
+
declare const COMPONENT_NAME = "Progress";
|
|
19
|
+
type ProgressProps = ProgressRootProps;
|
|
20
|
+
type ProgressComponent = React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<ProgressRootElement>> & {
|
|
21
|
+
Root: typeof ProgressRoot;
|
|
22
|
+
Indicator: typeof ProgressIndicator;
|
|
23
|
+
};
|
|
24
|
+
declare const Progress: ProgressComponent;
|
|
25
|
+
|
|
26
|
+
export { COMPONENT_NAME, Progress as default };
|
|
27
|
+
export type { ProgressProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as a,b as e}from"./tslib.es6-B3RR16LH.js";import l,{createContext as r,forwardRef as s,useState as t,useEffect as o,useContext as i}from"react";import{c as n}from"./clsx-BaVHROc5.js";import{c as m}from"./index-BVxS3Ixi.js";import{P as u}from"./index-DR_GC01Z.js";var d=r({value:0,minValue:0,maxValue:100,rootClass:"",ariaLabel:"",state:"loading"}),c="Progress",v="loading",f="complete",x="indeterminate",g=s((function(r,s){var i,g=r.value,p=void 0===g?0:g,V=r.minValue,C=void 0===V?0:V,b=r.maxValue,h=void 0===b?100:b,N=r.children,P=r.customRootClass,y=r.getValueLabel,L=r.className,j=a(r,["value","minValue","maxValue","children","customRootClass","getValueLabel","className"]),E=t(v),R=E[0],w=E[1],I=m(P,c),M=null!==(i=null==y?void 0:y(null!=p?p:0,C,h))&&void 0!==i?i:"";o((function(){w(null===p?x:p===h?f:v)}),[p,h]);var D={value:p,minValue:C,maxValue:h,rootClass:I,getValueLabel:y,ariaLabel:M,state:R},X=j.asChild,_=a(j,["asChild"]);return l.createElement(d.Provider,{value:D},l.createElement(u.div,e({role:"progressbar","aria-label":M,"aria-valuetext":M,"aria-valuenow":null!=p?p:0,"aria-valuemin":C,"aria-valuemax":h,"data-state":R,"data-value":null!=p?p:0,"data-max":h,"data-min":C,className:n(I,L),asChild:X,ref:s},_),N))}));g.displayName=c;var p=s((function(r,s){var t=r.className,o=r.style,m=a(r,["className","style"]),c=i(d),v=c.value,f=c.minValue,x=c.maxValue,g=c.rootClass,p=c.state,V=Math.min(Math.max(null!=v?v:0,f),x),C=(V-f)/(x-f)*100,b=m.asChild,h=a(m,["asChild"]);return l.createElement(u.div,e({role:"progressbar",className:n("".concat(g,"-indicator"),t),style:e({transform:"translateX(-".concat(100-C,"%)")},o),"aria-valuenow":V,"aria-valuemax":x,"aria-valuemin":f,"data-state":p,"data-value":V,"data-max":x,"data-min":f,asChild:b,ref:s},h))}));p.displayName="ProgressIndicator";var V="Progress",C=s((function(a,r){return console.warn("Direct usage of Progress is not supported. Please use Progress.Root, Progress.Indicator, etc. instead."),l.createElement(g,e({ref:r},a))}));C.displayName=V,C.Root=g,C.Indicator=p;export{V as COMPONENT_NAME,C as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type QuoteProps = React.ComponentPropsWithoutRef<'q'> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const Quote: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & {
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLQuoteElement>>;
|
|
9
|
+
|
|
10
|
+
export { Quote as default };
|
|
11
|
+
export type { QuoteProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,b as a}from"./tslib.es6-B3RR16LH.js";import r from"react";import{c as e}from"./index-BVxS3Ixi.js";import{c as o}from"./clsx-BaVHROc5.js";var t="Quote",m=r.forwardRef((function(m,c){var l=m.children,i=m.customRootClass,f=m.className,n=s(m,["children","customRootClass","className"]),d=e(i,t);return r.createElement("q",a({ref:c,className:o(d,f)},n),l)}));m.displayName=t;export{m as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import RadioPrimitive, { RadioPrimitiveProps } from '~/core/primitives/Radio';
|
|
3
|
+
|
|
4
|
+
type RadioElement = React.ElementRef<typeof RadioPrimitive>;
|
|
5
|
+
type RadioProps = Omit<RadioPrimitiveProps, 'size'> & {
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
variant?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Radio: React.ForwardRefExoticComponent<Omit<RadioPrimitiveProps, "size"> & {
|
|
13
|
+
customRootClass?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
size?: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
variant?: string;
|
|
18
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
|
|
20
|
+
export { Radio as default };
|
|
21
|
+
export type { RadioElement, RadioProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as a}from"./tslib.es6-B3RR16LH.js";import i from"react";import{P as d}from"./index-DR_GC01Z.js";import{c as s}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";import{u as o,a as n,b as l}from"./index-CD1lNchI.js";var t=i.forwardRef((function(s,r){var o=s.name,n=s.value,l=s.id,t=s.checked,c=s.required,m=s.onChange,u=s.disabled,h=s.asChild,v=s.className,f=e(s,["name","value","id","checked","required","onChange","disabled","asChild","className"]);return i.createElement(d.input,a({ref:r,type:"radio",checked:t,name:o,tabIndex:-1,value:n,onChange:m,id:l,"aria-disabled":u,disabled:u,required:c,"aria-required":c,asChild:h,className:v},f))}));t.displayName="RadioPrimitive";var c="Radio",m=i.forwardRef((function(d,m){var u=d.name,h=d.value,v=d.id,f=d.checked,C=void 0!==f&&f,b=d.required,p=d.onChange,N=d.disabled,k=d.asChild,q=d.className,g=d.customRootClass,x=d.variant,R=void 0===x?"":x,j=d.size,y=void 0===j?"":j,z=d.color,w=void 0===z?"":z,E=e(d,["name","value","id","checked","required","onChange","disabled","asChild","className","customRootClass","variant","size","color"]),P=r(g,c),I=i.useState(C),S=I[0],_=I[1],A=o("button",{variant:R,size:y}),B=n(w),D=l(A(),B());return i.createElement(t,a({ref:m,name:u,id:v,value:h,checked:S,required:b,onChange:function(){p&&p(),_(!S)},disabled:N,asChild:k,className:s(P,q),"data-checked":S},D(),E))}));m.displayName=c;export{m as default};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { ForwardRefExoticComponent, ComponentPropsWithoutRef, RefAttributes, ElementRef } from 'react';
|
|
2
|
+
import { RadioGroupPrimitiveRootProps } from '~/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot';
|
|
3
|
+
|
|
4
|
+
type RadioCardsRootProps = RadioGroupPrimitiveRootProps & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
variant?: string;
|
|
9
|
+
size?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const RadioCardsRoot: React.ForwardRefExoticComponent<RadioCardsRootProps & React.RefAttributes<HTMLElement>>;
|
|
15
|
+
|
|
16
|
+
declare const RadioCardsItem: React.ForwardRefExoticComponent<Omit<{
|
|
17
|
+
label?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
onChange?: any;
|
|
22
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
23
|
+
value: string;
|
|
24
|
+
} & {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
|
|
29
|
+
type RadioCardsElement = ElementRef<'div'>;
|
|
30
|
+
type RadioCardsProps = ComponentPropsWithoutRef<'div'>;
|
|
31
|
+
interface RadioCardsComponent extends ForwardRefExoticComponent<RadioCardsProps & RefAttributes<RadioCardsElement>> {
|
|
32
|
+
Root: typeof RadioCardsRoot;
|
|
33
|
+
Item: typeof RadioCardsItem;
|
|
34
|
+
}
|
|
35
|
+
declare const RadioCards: RadioCardsComponent;
|
|
36
|
+
|
|
37
|
+
export { RadioCards as default };
|
|
38
|
+
export type { RadioCardsElement, RadioCardsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import a,{createContext as o,forwardRef as s,useContext as e}from"react";import{_ as r,b as i}from"./tslib.es6-B3RR16LH.js";import{R as t}from"./RadioGroupPrimitive-CbRZK8wB.js";import{c as d}from"./clsx-BaVHROc5.js";import{c as m}from"./index-BVxS3Ixi.js";import{u as l,a as n,b as c}from"./index-CD1lNchI.js";import"./index-DR_GC01Z.js";import"./index-Br4Ygpsh.js";import"./index-BxNZdFaZ.js";import"./index-fkj4Fdgt.js";var v=o({rootClass:""}),u=s((function(o,s){var e=o.children,u=o.className,p=void 0===u?"":u,R=o.customRootClass,f=void 0===R?"":R,C=o.variant,j=void 0===C?"":C,N=o.size,x=void 0===N?"":N,h=o.color,I=void 0===h?"":h,b=r(o,["children","className","customRootClass","variant","size","color"]),y=m(f,"RadioCards"),z=l("radio-cards",{variant:j,size:x}),E=n(I),P=c(z(),E());return a.createElement(v.Provider,{value:{rootClass:y}},a.createElement(t.Root,i({ref:s,className:d(y,p)},P(),b),e))}));u.displayName="RadioCardsRoot";var p=s((function(o,s){var m=o.children,l=o.className,n=void 0===l?"":l,c=o.value,u=r(o,["children","className","value"]),p=e(v).rootClass;return a.createElement(t.Item,i({ref:s,className:d("".concat(p,"-item"),n)},u,{value:c}),m)}));p.displayName="RadioCardsItem";var R=s((function(a,o){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null}));R.displayName="RadioCards",R.Root=u,R.Item=p;export{R as default};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioGroupPrimitiveProps } from '~/core/primitives/RadioGroup/RadioGroupPrimitive';
|
|
3
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
4
|
+
|
|
5
|
+
type RadioGroupRootProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
customRootClass?: string;
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
} & RadioGroupPrimitiveProps.Root;
|
|
13
|
+
declare const RadioGroupRoot: React.ForwardRefExoticComponent<RadioGroupRootProps & React.RefAttributes<HTMLElement>>;
|
|
14
|
+
|
|
15
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<{
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
value: string;
|
|
19
|
+
} & Omit<{
|
|
20
|
+
label?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
onChange?: any;
|
|
25
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
26
|
+
value: string;
|
|
27
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
|
|
29
|
+
type RadioGroupIndicatorProps = {
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
} & RadioGroupPrimitiveProps.Indicator;
|
|
33
|
+
declare const RadioGroupIndicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLElement>>;
|
|
34
|
+
|
|
35
|
+
type RadioGroupLabelProps = React.ComponentPropsWithoutRef<typeof Primitive.label>;
|
|
36
|
+
declare const RadioGroupLabel: React.ForwardRefExoticComponent<RadioGroupLabelProps & React.RefAttributes<HTMLElement>>;
|
|
37
|
+
|
|
38
|
+
type RadioGroupElement = React.ElementRef<'div'>;
|
|
39
|
+
type RadioGroupProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
};
|
|
42
|
+
type RadioGroupComponent = React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<RadioGroupElement>> & {
|
|
43
|
+
Root: typeof RadioGroupRoot;
|
|
44
|
+
Item: typeof RadioGroupItem;
|
|
45
|
+
Indicator: typeof RadioGroupIndicator;
|
|
46
|
+
Label: typeof RadioGroupLabel;
|
|
47
|
+
};
|
|
48
|
+
declare const RadioGroup: RadioGroupComponent;
|
|
49
|
+
|
|
50
|
+
export { RadioGroup as default };
|
|
51
|
+
export type { RadioGroupElement, RadioGroupProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import a,{createContext as o,useContext as e}from"react";import{_ as r,b as s}from"./tslib.es6-B3RR16LH.js";import{R as i}from"./RadioGroupPrimitive-CbRZK8wB.js";import{c as t}from"./clsx-BaVHROc5.js";import{c as l}from"./index-BVxS3Ixi.js";import{u as d,a as n,b as c}from"./index-CD1lNchI.js";import{P as m}from"./index-DR_GC01Z.js";import"./index-Br4Ygpsh.js";import"./index-BxNZdFaZ.js";import"./index-fkj4Fdgt.js";var u=o({rootClass:""}),p=a.forwardRef((function(o,e){var m=o.children,p=o.className,f=void 0===p?"":p,v=o.customRootClass,R=void 0===v?"":v,N=o.variant,h=void 0===N?"":N,C=o.size,x=void 0===C?"":C,G=o.color,j=void 0===G?"":G,b=r(o,["children","className","customRootClass","variant","size","color"]),I=l(R,"RadioGroup"),w=d("radio-group",{variant:h,size:x}),y=n(j),E=c(w(),y());return a.createElement(u.Provider,{value:{rootClass:I}},a.createElement(i.Root,s({ref:e,className:t("".concat(I,"-root"),f)},E(),b)," ",m," "))}));p.displayName="RadioGroupRoot";var f=a.forwardRef((function(o,l){var d=o.children,n=o.className,c=void 0===n?"":n,m=o.value,p=r(o,["children","className","value"]),f=e(u).rootClass;return a.createElement(i.Item,s({ref:l,className:t("".concat(f,"-item"),c),value:m},p),d)}));f.displayName="RadioGroupItem";var v=a.forwardRef((function(o,e){var l=o.className,d=void 0===l?"":l,n=o.children,c=r(o,["className","children"]),m=a.useContext(u).rootClass;return a.createElement(i.Indicator,s({ref:e,className:t("".concat(m,"-indicator"),d)},c),n)}));v.displayName="RadioGroupIndicator";var R=a.forwardRef((function(o,e){var i=o.className,l=void 0===i?"":i,d=o.asChild,n=void 0!==d&&d,c=o.children,p=r(o,["className","asChild","children"]),f=a.useContext(u).rootClass;return a.createElement(m.label,s({ref:e},p,{className:t("".concat(f,"-label"),l),asChild:n})," ",c," ")}));R.displayName="RadioGroupLabel";var N=a.forwardRef((function(a,o){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null}));N.displayName="RadioGroup",N.Root=p,N.Item=f,N.Indicator=v,N.Label=R;export{N as default};
|