@radui/ui 0.0.46 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/components/Accordion.d.ts +23 -40
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.d.ts +79 -25
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AspectRatio.d.ts +6 -9
- package/dist/components/AspectRatio.js +1 -1
- package/dist/components/Avatar.d.ts +9 -17
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.d.ts +21 -17
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +1 -0
- package/dist/components/Badge.d.ts +7 -5
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.d.ts +7 -8
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.d.ts +15 -6
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.d.ts +24 -29
- package/dist/components/Callout.js +1 -1
- package/dist/components/Card.d.ts +7 -15
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.d.ts +27 -17
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CheckboxCards.d.ts +28 -31
- package/dist/components/CheckboxCards.js +1 -1
- package/dist/components/CheckboxGroup.d.ts +31 -31
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +1 -0
- package/dist/components/Code.d.ts +7 -3
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.d.ts +16 -22
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/ContextMenu.d.ts +78 -35
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/DataList.d.ts +9 -17
- package/dist/components/DataList.js +1 -1
- package/dist/components/Dialog.d.ts +78 -32
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Disclosure.d.ts +20 -26
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/DropdownMenu.d.ts +78 -35
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Em.d.ts +5 -9
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.d.ts +7 -275
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.d.ts +34 -33
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Kbd.d.ts +6 -8
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.d.ts +6 -12
- package/dist/components/Link.js +1 -1
- package/dist/components/MenuPrimitive-DuUPySFO.js +1 -0
- package/dist/components/Menubar.d.ts +68 -45
- package/dist/components/Menubar.js +1 -1
- 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 +17 -37
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Progress.d.ts +22 -19
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.d.ts +4 -8
- package/dist/components/Quote.js +1 -1
- package/dist/components/Radio.d.ts +11 -4
- package/dist/components/Radio.js +1 -1
- package/dist/components/RadioCards.d.ts +32 -35
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.d.ts +34 -37
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/RadioGroupPrimitive-D9grAL7G.js +1 -0
- package/dist/components/ScrollArea.d.ts +22 -14
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.d.ts +69 -16
- package/dist/components/Select.js +1 -1
- package/dist/components/Separator.d.ts +5 -9
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.d.ts +8 -7
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Slider.d.ts +78 -26
- package/dist/components/Slider.js +1 -1
- 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 +6 -7
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.d.ts +28 -6
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.d.ts +15 -25
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Table.d.ts +23 -27
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.d.ts +23 -44
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.d.ts +8 -274
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.d.ts +9 -14
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Theme.d.ts +9 -5
- package/dist/components/Theme.js +1 -1
- package/dist/components/Toggle.d.ts +8 -19
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.d.ts +55 -34
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Tooltip.d.ts +31 -18
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.d.ts +31 -14
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.d.ts +6 -10
- package/dist/components/VisuallyHidden.js +1 -1
- 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 -1
- package/package.json +21 -3
- package/dist/components/setupTests.d.ts +0 -3
|
@@ -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};
|
|
@@ -1,43 +1,23 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
|
|
4
|
-
type NumberFieldDecrementProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
children?: React__default.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type NumberFieldIncrementProps = {
|
|
10
|
-
className?: string;
|
|
11
|
-
children?: React__default.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
type NumberFieldInputProps = {
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
type NumberFieldRootProps = {
|
|
19
|
-
name?: string;
|
|
20
|
-
defaultValue?: number | '';
|
|
21
|
-
value?: number | '';
|
|
22
|
-
onValueChange?: (value: number | '') => void;
|
|
23
|
-
step?: number;
|
|
24
|
-
largeStep?: number;
|
|
25
|
-
min?: number;
|
|
26
|
-
max?: number;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
readOnly?: boolean;
|
|
29
|
-
required?: boolean;
|
|
30
|
-
id?: string;
|
|
31
|
-
className?: string;
|
|
32
|
-
children?: React__default.ReactNode;
|
|
33
|
-
};
|
|
1
|
+
import * as react from 'react';
|
|
34
2
|
|
|
35
3
|
declare const NumberField: {
|
|
36
4
|
(): null;
|
|
37
|
-
Root:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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>>;
|
|
41
21
|
};
|
|
42
22
|
|
|
43
23
|
export { NumberField as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e from"./
|
|
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};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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>>;
|
|
8
17
|
|
|
9
18
|
declare const COMPONENT_NAME = "Progress";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
maxValue: number;
|
|
17
|
-
getValueLabel?: (value: number, minValue: number, maxValue: number) => string;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
customRootClass?: string;
|
|
20
|
-
}) => React$1.JSX.Element;
|
|
21
|
-
var Indicator: typeof ProgressIndicator;
|
|
22
|
-
}
|
|
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;
|
|
23
25
|
|
|
24
26
|
export { COMPONENT_NAME, Progress as default };
|
|
27
|
+
export type { ProgressProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import
|
|
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};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type QuoteProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
3
|
+
type QuoteProps = React.ComponentPropsWithoutRef<'q'> & {
|
|
5
4
|
customRootClass?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
props?: Record<string, any>[];
|
|
8
|
-
};
|
|
9
|
-
declare const Quote: {
|
|
10
|
-
({ children, customRootClass, className, ...props }: QuoteProps): React.JSX.Element;
|
|
11
|
-
displayName: string;
|
|
12
5
|
};
|
|
6
|
+
declare const Quote: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.QuoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & {
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLQuoteElement>>;
|
|
13
9
|
|
|
14
10
|
export { Quote as default };
|
|
15
11
|
export type { QuoteProps };
|
package/dist/components/Quote.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
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};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RadioPrimitiveProps } from '~/core/primitives/Radio';
|
|
2
|
+
import RadioPrimitive, { RadioPrimitiveProps } from '~/core/primitives/Radio';
|
|
3
3
|
|
|
4
|
-
type
|
|
4
|
+
type RadioElement = React.ElementRef<typeof RadioPrimitive>;
|
|
5
|
+
type RadioProps = Omit<RadioPrimitiveProps, 'size'> & {
|
|
5
6
|
customRootClass?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
size?: string;
|
|
8
9
|
color?: string;
|
|
9
10
|
variant?: string;
|
|
10
11
|
};
|
|
11
|
-
declare
|
|
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>>;
|
|
12
19
|
|
|
13
20
|
export { Radio as default };
|
|
14
|
-
export type { RadioProps };
|
|
21
|
+
export type { RadioElement, RadioProps };
|
package/dist/components/Radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
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};
|
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { ForwardRefExoticComponent, ComponentPropsWithoutRef, RefAttributes, ElementRef } from 'react';
|
|
2
|
+
import { RadioGroupPrimitiveRootProps } from '~/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
children
|
|
4
|
+
type RadioCardsRootProps = RadioGroupPrimitiveRootProps & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
-
|
|
8
|
-
|
|
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>>;
|
|
9
15
|
|
|
10
|
-
|
|
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
|
+
} & {
|
|
11
25
|
children?: React.ReactNode;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} & {
|
|
23
|
-
className?: string;
|
|
24
|
-
customRootClass?: string;
|
|
25
|
-
value?: string;
|
|
26
|
-
defaultValue?: string;
|
|
27
|
-
onValueChange?: (value: string) => void;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
required?: boolean;
|
|
30
|
-
name?: string;
|
|
31
|
-
orientation?: "horizontal" | "vertical" | "both";
|
|
32
|
-
loop?: boolean;
|
|
33
|
-
dir?: "ltr" | "rtl";
|
|
34
|
-
} & {
|
|
35
|
-
children?: React.ReactNode | undefined;
|
|
36
|
-
}) => React.JSX.Element;
|
|
37
|
-
Item: ({ children, className, value, ...props }: RadioCardsItemProps) => React.JSX.Element;
|
|
38
|
-
};
|
|
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;
|
|
39
36
|
|
|
40
37
|
export { RadioCards as default };
|
|
41
|
-
export type { RadioCardsProps };
|
|
38
|
+
export type { RadioCardsElement, RadioCardsProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import a from"./
|
|
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};
|
|
@@ -1,54 +1,51 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RadioGroupPrimitiveProps } from '~/core/primitives/RadioGroup/RadioGroupPrimitive';
|
|
3
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
3
4
|
|
|
4
|
-
type
|
|
5
|
-
children
|
|
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;
|
|
6
17
|
className?: string;
|
|
18
|
+
value: string;
|
|
19
|
+
} & Omit<{
|
|
20
|
+
label?: string;
|
|
21
|
+
description?: string;
|
|
7
22
|
asChild?: boolean;
|
|
8
|
-
|
|
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>>;
|
|
9
28
|
|
|
10
29
|
type RadioGroupIndicatorProps = {
|
|
11
30
|
children?: React.ReactNode;
|
|
12
31
|
className?: string;
|
|
13
32
|
} & RadioGroupPrimitiveProps.Indicator;
|
|
33
|
+
declare const RadioGroupIndicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLElement>>;
|
|
14
34
|
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
className?: string;
|
|
18
|
-
value: string;
|
|
19
|
-
} & RadioGroupPrimitiveProps.Item;
|
|
35
|
+
type RadioGroupLabelProps = React.ComponentPropsWithoutRef<typeof Primitive.label>;
|
|
36
|
+
declare const RadioGroupLabel: React.ForwardRefExoticComponent<RadioGroupLabelProps & React.RefAttributes<HTMLElement>>;
|
|
20
37
|
|
|
21
|
-
type
|
|
38
|
+
type RadioGroupElement = React.ElementRef<'div'>;
|
|
39
|
+
type RadioGroupProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
22
40
|
children?: React.ReactNode;
|
|
23
41
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
customRootClass?: string;
|
|
30
|
-
variant?: string;
|
|
31
|
-
size?: string;
|
|
32
|
-
color?: string;
|
|
33
|
-
} & {
|
|
34
|
-
className?: string;
|
|
35
|
-
customRootClass?: string;
|
|
36
|
-
value?: string;
|
|
37
|
-
defaultValue?: string;
|
|
38
|
-
onValueChange?: (value: string) => void;
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
required?: boolean;
|
|
41
|
-
name?: string;
|
|
42
|
-
orientation?: "horizontal" | "vertical" | "both";
|
|
43
|
-
loop?: boolean;
|
|
44
|
-
dir?: "ltr" | "rtl";
|
|
45
|
-
} & {
|
|
46
|
-
children?: React.ReactNode | undefined;
|
|
47
|
-
}) => React.JSX.Element;
|
|
48
|
-
Item: ({ children, className, value, ...props }: RadioGroupItemProps) => React.JSX.Element;
|
|
49
|
-
Indicator: ({ className, children, ...props }: RadioGroupIndicatorProps) => React.JSX.Element;
|
|
50
|
-
Label: ({ className, asChild, children, ...props }: RadioGroupLabelProps) => React.JSX.Element;
|
|
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;
|
|
51
47
|
};
|
|
48
|
+
declare const RadioGroup: RadioGroupComponent;
|
|
52
49
|
|
|
53
50
|
export { RadioGroup as default };
|
|
54
|
-
export type { RadioGroupProps };
|
|
51
|
+
export type { RadioGroupElement, RadioGroupProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import o from"./
|
|
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};
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
16
24
|
};
|
|
17
25
|
|
|
18
26
|
export { ScrollArea as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"./
|
|
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};
|