@radui/ui 0.1.6 → 0.1.7
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/components/Accordion.d.ts +36 -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-BV0bK5Qg.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 +30 -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-DrGqSxi3.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-CPcrK1EK.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-D9grAL7G.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 +19 -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-BRmT6kl7.js +1 -0
- package/dist/components/index-BVxS3Ixi.js +1 -0
- package/dist/components/index-Bf4LVEjJ.js +1 -0
- package/dist/components/index-BtoPzkH9.js +1 -0
- package/dist/components/index-DBZNt4Em.js +1 -0
- package/dist/components/index-Dc5Cm9z0.js +1 -0
- package/dist/components/index-Di6TooPD.js +1 -0
- package/dist/components/index-DnCiOYxZ.js +1 -0
- package/dist/components/index-XqbKa2D2.js +1 -0
- package/dist/components/index-YgKcfT__.js +1 -0
- package/dist/components/index-fkj4Fdgt.js +1 -0
- package/dist/components/tslib.es6-BtVxab8e.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,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,a as r,b as t}from"./tslib.es6-BtVxab8e.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-CPcrK1EK.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-Dc5Cm9z0.js";import"./index-DnCiOYxZ.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,a as t,b as n}from"./tslib.es6-BtVxab8e.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-Dc5Cm9z0.js";import{R as u}from"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.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,a as n}from"./tslib.es6-BtVxab8e.js";import a,{useEffect as t}from"react";import{R as r}from"./index-BRmT6kl7.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-Dc5Cm9z0.js";import"./index-DnCiOYxZ.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,a as r}from"./tslib.es6-BtVxab8e.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,a as e}from"./tslib.es6-BtVxab8e.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-Dc5Cm9z0.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,h=r.maxValue,b=void 0===h?100:h,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,b))&&void 0!==i?i:"";o((function(){w(null===p?x:p===b?f:v)}),[p,b]);var D={value:p,minValue:C,maxValue:b,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":b,"data-state":R,"data-value":null!=p?p:0,"data-max":b,"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,h=m.asChild,b=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:h,ref:s},b))}));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,a}from"./tslib.es6-BtVxab8e.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,a}from"./tslib.es6-BtVxab8e.js";import i from"react";import{P as d}from"./index-Dc5Cm9z0.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-Bf4LVEjJ.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,a as i}from"./tslib.es6-BtVxab8e.js";import{R as t}from"./RadioGroupPrimitive-D9grAL7G.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-Bf4LVEjJ.js";import"./index-Dc5Cm9z0.js";import"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.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,y=r(o,["children","className","customRootClass","variant","size","color"]),z=m(f,"RadioCards"),E=l("radio-cards",{variant:j,size:x}),P=n(I),b=c(E(),P());return a.createElement(v.Provider,{value:{rootClass:z}},a.createElement(t.Root,i({ref:s,className:d(z,p)},b(),y),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,a as s}from"./tslib.es6-BtVxab8e.js";import{R as i}from"./RadioGroupPrimitive-D9grAL7G.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-Bf4LVEjJ.js";import{P as m}from"./index-Dc5Cm9z0.js";import"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.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,I=r(o,["children","className","customRootClass","variant","size","color"]),b=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:b}},a.createElement(i.Root,s({ref:e,className:t("".concat(b,"-root"),f)},E(),I)," ",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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{useContext as a}from"react";import{_ as i,a as r}from"./tslib.es6-BtVxab8e.js";import{P as t}from"./index-Dc5Cm9z0.js";import{R as d}from"./index-BRmT6kl7.js";import{u as o}from"./index-fkj4Fdgt.js";import{B as l}from"./index-DnCiOYxZ.js";var n=e.createContext(null),s=e.forwardRef((function(a,l){var s=a.value,u=a.defaultValue,c=void 0===u?"":u,m=a.onValueChange,p=a.children,v=a.disabled,f=void 0!==v&&v,h=a.required,R=void 0!==h&&h,b=a.name,C=void 0===b?"":b,E=a.orientation,g=void 0===E?"horizontal":E,G=a.loop,N=void 0!==G&&G,w=a.dir,x=void 0===w?"ltr":w,y=i(a,["value","defaultValue","onValueChange","children","disabled","required","name","orientation","loop","dir"]),I=o(s,c,m),P=I[0],V={selectedValue:P,setSelectedValue:I[1],groupDisabled:f};return e.createElement(t.div,r({ref:l},y,{"aria-required":R,role:"radiogroup","aria-disabled":f,"data-disabled":f?"":void 0}),e.createElement(d.Root,{dir:x,orientation:g,loop:N,asChild:!0},e.createElement(n.Provider,{value:V},e.createElement(d.Group,null,p))),C&&e.createElement(e.Fragment,null,e.createElement("input",{type:"hidden",name:C,value:P,disabled:f}),R&&""!==P&&e.createElement("input",{type:"radio",name:C,value:P,checked:!0,onChange:function(){},disabled:f,required:!0,"aria-hidden":"true",tabIndex:-1,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",margin:0}})))}));s.displayName="RadioGroupPrimitiveRoot";var u=e.createContext({itemSelected:!1}),c=e.forwardRef((function(t,o){var s=t.value,c=t.children,m=t.disabled,p=t.required,v=void 0!==p&&p,f=t.className,h=void 0===f?"":f,R=t.asChild,b=void 0!==R&&R,C=i(t,["value","children","disabled","required","className","asChild"]),E=a(n);if(!E)throw new Error("RadioGroup.Item must be used within a RadioGroup.Root");var g=E.groupDisabled,G=E.selectedValue,N=E.setSelectedValue,w=s===G;return e.createElement(u.Provider,{value:{itemSelected:w}},e.createElement(d.Item,null,e.createElement(l,r({ref:o,role:"radio",type:"button",disabled:g||m,onClick:function(){return N(s)},onFocus:function(){return N(s)},"aria-disabled":g||m,"aria-checked":w,"aria-selected":void 0,"data-state":w?"checked":"unchecked","data-disabled":g||m?"":void 0,"aria-required":v,asChild:b,className:h},C),c)))}));c.displayName="RadioGroupPrimitiveItem";var m=e.forwardRef((function(a,d){var o=a.children,l=a.className,n=a.asChild,s=void 0!==n&&n,c=i(a,["children","className","asChild"]);return e.useContext(u).itemSelected?e.createElement(t.span,r({ref:d,className:l,asChild:s},c),o):null}));m.displayName="RadioGroupPrimitiveIndicator";var p=e.forwardRef((function(e,a){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root, RadioGroup.Item, etc. instead."),null}));p.displayName="RadioGroupPrimitive",p.Root=s,p.Item=c,p.Indicator=m;export{p as R};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const ScrollAreaRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const ScrollAreaViewport: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
|
|
9
|
+
declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
declare const ScrollAreaThumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
declare const ScrollAreaCorner: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
type ScrollAreaProps = React.ComponentPropsWithoutRef<'div'>;
|
|
18
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps> & {
|
|
19
|
+
Root: typeof ScrollAreaRoot;
|
|
20
|
+
Viewport: typeof ScrollAreaViewport;
|
|
21
|
+
Scrollbar: typeof ScrollAreaScrollbar;
|
|
22
|
+
Thumb: typeof ScrollAreaThumb;
|
|
23
|
+
Corner: typeof ScrollAreaCorner;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { ScrollArea as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{createContext as r,forwardRef as n,useRef as t,useEffect as o,useContext as c,useCallback as l}from"react";import{_ as u,a as i}from"./tslib.es6-BtVxab8e.js";import{c as a}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";var d=r({rootClass:""}),v="ScrollArea",f=n((function(r,n){var c=r.children,l=r.className,f=void 0===l?"":l,m=r.customRootClass,p=void 0===m?"":m,h=u(r,["children","className","customRootClass"]),E=s(p,v),g=t(null),b=t(null);o((function(){y()}),[g,b]),o((function(){var e=b.current;if(e){var r=function(){y()},n=new ResizeObserver((function(n){for(var t=0,o=n;t<o.length;t++){var c=o[t];(c.target===e||e.contains(c.target))&&r()}}));n.observe(e);var t=function(e){n.observe(e),Array.from(e.children).forEach((function(e){t(e)}))};Array.from(e.children).forEach((function(e){t(e)}));var o=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t(e)}))})),r()}));return o.observe(e,{childList:!0,subtree:!0}),window.addEventListener("resize",r),function(){n.disconnect(),o.disconnect(),window.removeEventListener("resize",r)}}}),[]);var y=function(){var e,r,n=(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.clientHeight)||0,t=n/(((null===(r=null==b?void 0:b.current)||void 0===r?void 0:r.scrollHeight)||0)/n);t<24&&(t=24),g.current&&(g.current.style.height="".concat(t,"px"))},N=function(e){if(b.current){var r=b.current.scrollTop,n=e-r,t=performance.now(),o=function(e){var c=e-t,l=Math.min(c/150,1),u=1-Math.pow(1-l,3),i=r+n*u;b.current&&(b.current.scrollTop=i),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}};return e.createElement(d.Provider,{value:{rootClass:E,scrollXThumbRef:g,scrollAreaViewportRef:b,handleScroll:function(){var e,r,n,t,o=(null===(e=b.current)||void 0===e?void 0:e.clientHeight)||0,c=(null===(r=b.current)||void 0===r?void 0:r.scrollHeight)||0,l=((null===(n=b.current)||void 0===n?void 0:n.scrollTop)||0)/(c-o)*(o-((null===(t=g.current)||void 0===t?void 0:t.clientHeight)||0));g.current&&(g.current.style.top="".concat(l,"px"))},handleScrollbarClick:function(e){!function(e){var r,n,t,o=(null===(r=null==b?void 0:b.current)||void 0===r?void 0:r.clientHeight)||0,c=((null===(n=null==b?void 0:b.current)||void 0===n?void 0:n.scrollHeight)||0)/o;if(g.current){var l=g.current.getBoundingClientRect().top,u=l+g.current.clientHeight,i=(null===(t=g.current)||void 0===t?void 0:t.clientHeight)||0;if(e>l&&e<u)return;if(e<l){var a=b.current.scrollTop-i*c;N(a)}e>u&&(a=b.current.scrollTop+i*c,N(a))}}(e.clientY)}}},e.createElement("div",i({ref:n,className:a(E,f)},h),c))}));f.displayName=v;var m=n((function(r,n){var t=r.children,o=r.className,l=void 0===o?"":o,s=u(r,["children","className"]),v=c(d),f=v.rootClass,m=v.scrollAreaViewportRef,p=v.handleScroll;return e.createElement("div",i({ref:function(e){m&&(m.current=e),"function"==typeof n?n(e):n&&(n.current=e)},className:a(f+"-viewport",l),onScroll:p},s),t)}));m.displayName="ScrollAreaViewport";var p=n((function(r,n){var o=r.children,s=r.className,v=void 0===s?"":s,f=r.orientation,m=u(r,["children","className","orientation"]),p=c(d),h=p.rootClass,E=p.handleScrollbarClick,g=p.scrollXThumbRef,b=t(null),y=t(!1),N=t(null),w=e.useState(!1),S=w[0],T=w[1],A=t(0),L=l((function(e){if(!(null==g?void 0:g.current))return!1;var r=g.current.getBoundingClientRect(),n=r.top,t=r.bottom;return!(e>=n&&e<=t)}),[g]),R=l((function(e){E&&(e.preventDefault(),A.current=e.clientY,E({clientY:e.clientY}),setTimeout((function(){y.current&&(b.current=setInterval((function(){y.current&&L(A.current)?E({clientY:A.current}):C()}),50))}),300),y.current=!0,T(!0))}),[E,L]),C=l((function(){var e;y.current=!1,null===(e=N.current)||void 0===e||e.call(N),N.current=null,b.current&&(clearInterval(b.current),b.current=null),T(!1)}),[]);return e.useEffect((function(){if(!y.current)return function(){var e;null===(e=N.current)||void 0===e||e.call(N),C()};var e=function(){return C()},r=function(){return C()};return document.addEventListener("mouseup",e),document.addEventListener("mouseleave",r),N.current=function(){document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",r)},function(){var e;null===(e=N.current)||void 0===e||e.call(N),N.current=null,C()}}),[S,C]),e.createElement("div",i({ref:n,className:a(h+"-scrollbar",v),"data-orientation":f,onMouseDown:R,onMouseUp:C,onMouseLeave:C},m),o)}));p.displayName="ScrollAreaScrollbar";var h=n((function(r,n){var o=r.children,s=r.className,v=void 0===s?"":s,f=u(r,["children","className"]),m=c(d),p=m.rootClass,h=m.scrollXThumbRef,E=m.scrollAreaViewportRef,g=t(!1),b=t({y:0,scrollTop:0}),y=l((function(e){(null==E?void 0:E.current)&&(null==h?void 0:h.current)&&(e.preventDefault(),e.stopPropagation(),g.current=!0,b.current={y:e.clientY,scrollTop:E.current.scrollTop},document.body.style.userSelect="none")}),[E,h]),N=l((function(e){var r;if(g.current&&(null==E?void 0:E.current)&&(null==h?void 0:h.current)){e.preventDefault();var n=e.clientY-b.current.y,t=null===(r=h.current.parentElement)||void 0===r?void 0:r.getBoundingClientRect();if(t){var o=E.current.clientHeight,c=E.current.scrollHeight,l=h.current.clientHeight,u=n/(t.height-l),i=c-o,a=b.current.scrollTop+u*i,s=Math.max(0,Math.min(a,i));E.current.scrollTop=s}}}),[E,h]),w=l((function(){g.current=!1,document.body.style.cursor="",document.body.style.userSelect=""}),[]);e.useEffect((function(){var e=function(e){return N(e)},r=function(){return w()};return g.current&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",r)),document.addEventListener("mousemove",e),document.addEventListener("mouseup",r),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",r),w()}}),[N,w]);return e.createElement("div",i({ref:function(e){h&&(h.current=e),"function"==typeof n?n(e):n&&(n.current=e)},className:a(p+"-thumb",v),onMouseDown:y},f),o)}));h.displayName="ScrollAreaThumb";var E=n((function(r,n){var t=r.children,o=u(r,["children"]);return e.createElement("div",i({ref:n},o),t)}));E.displayName="ScrollAreaCorner";var g=e.forwardRef((function(e,r){return console.warn("Direct usage of ScrollArea is not supported. Please use ScrollArea.Root and ScrollArea.Viewport instead."),null}));g.Root=f,g.Viewport=m,g.Scrollbar=p,g.Thumb=h,g.Corner=E,g.displayName="ScrollArea";export{g as default};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SelectPrimitive from '~/core/primitives/Select/Select';
|
|
3
|
+
import * as _floating_ui_react from '@floating-ui/react';
|
|
4
|
+
|
|
5
|
+
type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
|
|
10
|
+
interface SelectPrimitiveItemProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
value: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare const SelectItem: React.ForwardRefExoticComponent<(Omit<Omit<Omit<SelectPrimitiveItemProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
21
|
+
customRootClass?: string;
|
|
22
|
+
}, "ref"> | Omit<Omit<Omit<SelectPrimitiveItemProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
26
|
+
customRootClass?: string;
|
|
27
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
28
|
+
|
|
29
|
+
type SelectPrimitiveTriggerProps = {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<(Omit<Omit<Omit<SelectPrimitiveTriggerProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
39
|
+
customRootClass?: string;
|
|
40
|
+
placeholder?: boolean;
|
|
41
|
+
}, "ref"> | Omit<Omit<Omit<SelectPrimitiveTriggerProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
42
|
+
asChild?: boolean;
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
45
|
+
customRootClass?: string;
|
|
46
|
+
placeholder?: boolean;
|
|
47
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
48
|
+
|
|
49
|
+
type SelectRootProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> & {
|
|
50
|
+
customRootClass?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const SelectRoot: React.ForwardRefExoticComponent<SelectRootProps & React.RefAttributes<HTMLElement>>;
|
|
53
|
+
|
|
54
|
+
declare const SelectIndicator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
|
|
56
|
+
type SelectPortalProps = {
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
container?: HTMLElement | null;
|
|
59
|
+
};
|
|
60
|
+
declare const SelectPortal: React.ForwardRefExoticComponent<Omit<{
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
container?: HTMLElement | null;
|
|
63
|
+
} & _floating_ui_react.FloatingPortalProps & React.RefAttributes<never>, "ref"> & SelectPortalProps & React.RefAttributes<never>>;
|
|
64
|
+
|
|
65
|
+
type SelectPrimitiveGroupProps = {
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
className?: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type SelectGroupProps = {
|
|
71
|
+
children: React.ReactNode;
|
|
72
|
+
};
|
|
73
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectPrimitiveGroupProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
|
|
75
|
+
type SelectSearchProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Search>;
|
|
76
|
+
declare const SelectSearch: React.ForwardRefExoticComponent<SelectSearchProps & React.RefAttributes<HTMLElement>>;
|
|
77
|
+
|
|
78
|
+
interface SelectComponent extends React.ForwardRefExoticComponent<React.RefAttributes<unknown>> {
|
|
79
|
+
Root: typeof SelectRoot;
|
|
80
|
+
Content: typeof SelectContent;
|
|
81
|
+
Item: typeof SelectItem;
|
|
82
|
+
Trigger: typeof SelectTrigger;
|
|
83
|
+
Portal: typeof SelectPortal;
|
|
84
|
+
Group: typeof SelectGroup;
|
|
85
|
+
Indicator: typeof SelectIndicator;
|
|
86
|
+
Search: typeof SelectSearch;
|
|
87
|
+
}
|
|
88
|
+
declare const Select: SelectComponent;
|
|
89
|
+
|
|
90
|
+
export { Select as default };
|