@lotte-innovate/ui-component-test 0.1.17 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +71 -71
- package/dist/globals.css +4 -4
- package/dist/lib/components/Accordion/index.d.ts +10 -4
- package/dist/lib/components/Accordion/index.js +17 -11
- package/dist/lib/components/AlertDialog/AlertDialogAction.js +4 -2
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js +9 -5
- package/dist/lib/components/AlertDialog/AlertDialogContent.js +4 -2
- package/dist/lib/components/AlertDialog/AlertDialogDescription.js +4 -2
- package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +16 -0
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js +46 -0
- package/dist/lib/components/AlertDialog/AlertDialogTitle.js +4 -2
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +2 -2
- package/dist/lib/components/AlertDialog/index.d.ts +10 -19
- package/dist/lib/components/AlertDialog/index.js +15 -35
- package/dist/lib/components/Avatar/index.d.ts +3 -0
- package/dist/lib/components/Avatar/index.js +3 -2
- package/dist/lib/components/BarChart/index.d.ts +5 -3
- package/dist/lib/components/BarChart/index.js +12 -1
- package/dist/lib/components/BubbleChart/index.d.ts +3 -0
- package/dist/lib/components/Callout/CalloutIcon.js +3 -3
- package/dist/lib/components/Callout/CalloutRoot.d.ts +18 -0
- package/dist/lib/components/Callout/CalloutRoot.js +72 -0
- package/dist/lib/components/Callout/CalloutText.js +2 -2
- package/dist/lib/components/Callout/index.d.ts +6 -19
- package/dist/lib/components/Callout/index.js +7 -73
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js +2 -2
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +16 -0
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +34 -0
- package/dist/lib/components/CheckboxGroup/index.d.ts +5 -16
- package/dist/lib/components/CheckboxGroup/index.js +3 -34
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js +4 -2
- package/dist/lib/components/ContextMenu/ContextMenuContent.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuGroup.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuLabel.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js +5 -2
- package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +13 -0
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js +42 -0
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.js +4 -3
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +2 -2
- package/dist/lib/components/ContextMenu/index.d.ts +16 -24
- package/dist/lib/components/ContextMenu/index.js +27 -52
- package/dist/lib/components/DataList/DataListItem.js +2 -2
- package/dist/lib/components/DataList/DataListLabel.js +2 -2
- package/dist/lib/components/DataList/DataListRoot.d.ts +14 -0
- package/dist/lib/components/DataList/DataListRoot.js +54 -0
- package/dist/lib/components/DataList/DataListValue.js +2 -2
- package/dist/lib/components/DataList/index.d.ts +7 -16
- package/dist/lib/components/DataList/index.js +5 -56
- package/dist/lib/components/Dialog/DialogAction.d.ts +0 -2
- package/dist/lib/components/Dialog/DialogAction.js +7 -5
- package/dist/lib/components/Dialog/DialogCancel.js +5 -3
- package/dist/lib/components/Dialog/DialogContent.js +5 -3
- package/dist/lib/components/Dialog/DialogDescription.js +5 -3
- package/dist/lib/components/Dialog/DialogRoot.d.ts +12 -0
- package/dist/lib/components/Dialog/DialogRoot.js +37 -0
- package/dist/lib/components/Dialog/DialogSlot.js +5 -3
- package/dist/lib/components/Dialog/DialogTitle.js +5 -3
- package/dist/lib/components/Dialog/DialogTrigger.js +1 -1
- package/dist/lib/components/Dialog/index.d.ts +11 -17
- package/dist/lib/components/Dialog/index.js +17 -36
- package/dist/lib/components/DoughnutChart/index.js +9 -18
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -5
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js +3 -4
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js +7 -4
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +2 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.js +5 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -2
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js +8 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +12 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +38 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.js +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +2 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +5 -3
- package/dist/lib/components/DropdownMenu/index.d.ts +16 -22
- package/dist/lib/components/DropdownMenu/index.js +27 -41
- package/dist/lib/components/HoverCard/HoverCardContent.js +5 -3
- package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +8 -0
- package/dist/lib/components/HoverCard/HoverCardRoot.js +38 -0
- package/dist/lib/components/HoverCard/HoverCardTrigger.js +1 -1
- package/dist/lib/components/HoverCard/index.d.ts +6 -9
- package/dist/lib/components/HoverCard/index.js +7 -31
- package/dist/lib/components/LineChart/index.d.ts +87 -0
- package/dist/lib/components/LineChart/index.js +58 -0
- package/dist/lib/components/Menubar/MenubarCheckboxItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarContent.js +2 -2
- package/dist/lib/components/Menubar/MenubarItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarItemIndicator.js +2 -2
- package/dist/lib/components/Menubar/MenubarMenu.js +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -1
- package/dist/lib/components/Menubar/MenubarRadioItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +19 -0
- package/dist/lib/components/Menubar/MenubarRoot.js +61 -0
- package/dist/lib/components/Menubar/MenubarSeparator.js +1 -1
- package/dist/lib/components/Menubar/MenubarSub.js +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.js +2 -2
- package/dist/lib/components/Menubar/MenubarSubTrigger.js +2 -2
- package/dist/lib/components/Menubar/MenubarTrigger.js +2 -2
- package/dist/lib/components/Menubar/index.d.ts +16 -30
- package/dist/lib/components/Menubar/index.js +27 -71
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +14 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +43 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +2 -2
- package/dist/lib/components/NavigationMenu/index.d.ts +11 -20
- package/dist/lib/components/NavigationMenu/index.js +9 -49
- package/dist/lib/components/PieChart/index.js +9 -18
- package/dist/lib/components/Popover/PopoverClose.js +5 -3
- package/dist/lib/components/Popover/PopoverContent.js +5 -3
- package/dist/lib/components/Popover/PopoverRoot.d.ts +9 -0
- package/dist/lib/components/Popover/PopoverRoot.js +36 -0
- package/dist/lib/components/Popover/PopoverTrigger.js +1 -1
- package/dist/lib/components/Popover/index.d.ts +7 -11
- package/dist/lib/components/Popover/index.js +9 -32
- package/dist/lib/components/RadioCards/RadioCardsItem.js +5 -3
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +14 -0
- package/dist/lib/components/RadioCards/RadioCardsRoot.js +46 -0
- package/dist/lib/components/RadioCards/index.d.ts +5 -13
- package/dist/lib/components/RadioCards/index.js +5 -41
- package/dist/lib/components/RadioGroup/RadioGroupItem.js +5 -3
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +16 -0
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js +53 -0
- package/dist/lib/components/RadioGroup/index.d.ts +5 -15
- package/dist/lib/components/RadioGroup/index.js +5 -49
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.js +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +14 -0
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +47 -0
- package/dist/lib/components/SegmentedControl/index.d.ts +5 -14
- package/dist/lib/components/SegmentedControl/index.js +5 -46
- package/dist/lib/components/Select/index.d.ts +16 -7
- package/dist/lib/components/Select/index.js +23 -14
- package/dist/lib/components/TabNav/index.d.ts +6 -2
- package/dist/lib/components/TabNav/index.js +9 -5
- package/dist/lib/components/Table/index.d.ts +16 -7
- package/dist/lib/components/Table/index.js +23 -14
- package/dist/lib/components/Tabs/index.d.ts +10 -4
- package/dist/lib/components/Tabs/index.js +15 -9
- package/dist/lib/components/TextField/index.d.ts +6 -2
- package/dist/lib/components/TextField/index.js +8 -4
- package/dist/lib/components/Toast/ToastActionButton.js +2 -2
- package/dist/lib/components/Toast/ToastDescription.js +2 -2
- package/dist/lib/components/Toast/ToastRoot.d.ts +27 -0
- package/dist/lib/components/Toast/ToastRoot.js +90 -0
- package/dist/lib/components/Toast/ToastTitle.js +2 -2
- package/dist/lib/components/Toast/index.d.ts +7 -29
- package/dist/lib/components/Toast/index.js +9 -92
- package/dist/lib/components/ToggleGroup/{toggleGroupItem.js → ToggleGroupItem.js} +6 -4
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +18 -0
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +47 -0
- package/dist/lib/components/ToggleGroup/index.d.ts +5 -19
- package/dist/lib/components/ToggleGroup/index.js +5 -41
- package/dist/lib/components/Tooltip/index.d.ts +3 -3
- package/dist/lib/components/Tooltip/index.js +3 -2
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +1 -0
- package/dist/lib/constants.d.ts +0 -9
- package/dist/lib/constants.js +0 -7
- package/package.json +131 -132
- /package/dist/lib/components/ToggleGroup/{toggleGroupItem.d.ts → ToggleGroupItem.d.ts} +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { forwardRef, createContext, useContext, useMemo, } from 'react';
|
25
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
26
|
+
import { cn } from '../../../lib/utils/utils';
|
27
|
+
var NavigationMenuContext = createContext({
|
28
|
+
radius: 'medium',
|
29
|
+
scaling: '100%',
|
30
|
+
size: 'medium',
|
31
|
+
color: 'red',
|
32
|
+
appearance: 'ghost',
|
33
|
+
});
|
34
|
+
export var useNavigationMenuContext = function () {
|
35
|
+
return useContext(NavigationMenuContext);
|
36
|
+
};
|
37
|
+
export var NavigationMenuRoot = forwardRef(function (_a, ref) {
|
38
|
+
var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
|
39
|
+
var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color, appearance: appearance }); }, [radius, size, scaling, color, appearance]);
|
40
|
+
return (_jsx(NavigationMenuContext.Provider, { value: contextValue, children: _jsx(NavigationMenuPrimitive.Root, __assign({ ref: ref, className: cn('flex relative z-[1] w-screen justify-center', className) }, props, { children: children })) }));
|
41
|
+
});
|
42
|
+
NavigationMenuRoot.displayName = 'NavigationMenu.Root';
|
43
|
+
export default NavigationMenuRoot;
|
@@ -27,7 +27,7 @@ import { cn } from '../../../lib/utils/utils';
|
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { appearanceStyle, scalingVariants } from '../../../lib/constants';
|
29
29
|
import { CaretDownIcon } from '@radix-ui/react-icons';
|
30
|
-
import { useNavigationMenuContext } from '
|
30
|
+
import { useNavigationMenuContext } from './NavigationMenuRoot';
|
31
31
|
export var navigationMenuTriggerVariants = cva("flex items-center justify-between outline-none select-none leading-none py-1 px-3 font-medium", {
|
32
32
|
variants: {
|
33
33
|
size: {
|
@@ -55,4 +55,4 @@ export var NavigationMenuTrigger = forwardRef(function (_a, ref) {
|
|
55
55
|
var triggerClassName = cn(navigationMenuTriggerVariants({ scaling: scaling, size: size, radius: radius }), appearanceStyle(appearance, color), className);
|
56
56
|
return (_jsxs(NavigationMenuPrimitive.Trigger, __assign({ ref: ref, className: triggerClassName }, props, { children: [children, isShowIcon && (_jsx(CaretDownIcon, { className: cn("relative top-[1px] transition-transform duration-[250] ease-in group-data-[state=open]:-rotate-180"), "aria-hidden": true }))] })));
|
57
57
|
});
|
58
|
-
NavigationMenuTrigger.displayName = '
|
58
|
+
NavigationMenuTrigger.displayName = 'NavigationMenu.Trigger';
|
@@ -26,7 +26,7 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { radiusVariants, scalingVariants, weightVariants } from '../../../lib/constants';
|
29
|
-
import { useNavigationMenuContext } from '
|
29
|
+
import { useNavigationMenuContext } from './NavigationMenuRoot';
|
30
30
|
export var navigationViewportVariants = cva("data-[state=open]:animate-scaleIn data-[state=closed]:animate-scaleOut relative mt-[10px] \n h-[var(--radix-navigation-menu-viewport-height)] w-full origin-[top_center] overflow-hidden \n transition-[width,_height] duration-300 shadow-slate-4 shadow dark:shadow-slateDark-4\n sm:w-[var(--radix-navigation-menu-viewport-width)]", {
|
31
31
|
variants: {
|
32
32
|
radius: __assign({}, radiusVariants['extra-large']),
|
@@ -50,4 +50,4 @@ export var NavigationMenuViewport = forwardRef(function (_a, ref) {
|
|
50
50
|
var viewportClassName = cn(navigationViewportVariants({ size: size, scaling: scaling, radius: radius }), className);
|
51
51
|
return (_jsx("div", { className: "perspective-[2000px] absolute top-full left-0 flex w-full justify-center ", children: _jsx(NavigationMenuPrimitive.Viewport, __assign({ ref: ref, className: viewportClassName }, props)) }));
|
52
52
|
});
|
53
|
-
NavigationMenuViewport.displayName = '
|
53
|
+
NavigationMenuViewport.displayName = 'NavigationMenu.Viewport';
|
@@ -1,21 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
export * from './NavigationMenuViewport';
|
13
|
-
export * from './NavigationMenuIndicator';
|
14
|
-
export * from './NavigationMenuLink';
|
15
|
-
export interface NavigationMenuProps extends VariantProps<typeof navigationMenuListVariants>, VariantProps<typeof navigationMenuTriggerVariants>, VariantProps<typeof navigationMenuLinkVariants> {
|
16
|
-
appearance?: 'ghost' | 'solid';
|
17
|
-
color?: IColor;
|
18
|
-
}
|
19
|
-
export declare const useNavigationMenuContext: () => NavigationMenuProps;
|
20
|
-
export declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & NavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const NavigationMenu: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("./NavigationMenuRoot").NavigationMenuProps & import("react").RefAttributes<HTMLElement>>;
|
4
|
+
List: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>, "ref"> & import("./NavigationMenuList").NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>>;
|
5
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
6
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./NavigationMenuTrigger").NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
7
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./NavigationMenuContent").NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
8
|
+
Viewport: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuViewportProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./NavigationMenuViewport").NavigationViewportProps & import("react").RefAttributes<HTMLDivElement>>;
|
9
|
+
Indicator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuIndicatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
10
|
+
Link: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("./NavigationMenuLink").NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
11
|
+
};
|
21
12
|
export default NavigationMenu;
|
@@ -1,50 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef, createContext, useContext, } from 'react';
|
25
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
26
|
-
import { cn } from '../../../lib/utils/utils';
|
27
|
-
export * from './NavigationMenuList';
|
28
|
-
export * from './NavigationMenuItem';
|
29
|
-
export * from './NavigationMenuTrigger';
|
30
|
-
export * from './NavigationMenuContent';
|
31
|
-
export * from './NavigationMenuViewport';
|
32
|
-
export * from './NavigationMenuIndicator';
|
33
|
-
export * from './NavigationMenuLink';
|
34
|
-
var NavigationMenuContext = createContext({
|
35
|
-
radius: 'medium',
|
36
|
-
scaling: '100%',
|
37
|
-
size: 'medium',
|
38
|
-
color: 'red',
|
39
|
-
appearance: 'ghost',
|
40
|
-
});
|
41
|
-
export var useNavigationMenuContext = function () {
|
42
|
-
return useContext(NavigationMenuContext);
|
43
|
-
};
|
44
|
-
export var NavigationMenu = forwardRef(function (_a, ref) {
|
45
|
-
var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
|
46
|
-
var contextValue = { radius: radius, size: size, scaling: scaling, color: color, appearance: appearance };
|
47
|
-
return (_jsx(NavigationMenuContext.Provider, { value: contextValue, children: _jsx(NavigationMenuPrimitive.Root, __assign({ ref: ref, className: cn('flex relative z-[1] w-screen justify-center', className) }, props, { children: children })) }));
|
48
|
-
});
|
49
|
-
NavigationMenu.displayName = 'NavigationMenu';
|
1
|
+
import { NavigationMenuRoot as Root } from './NavigationMenuRoot';
|
2
|
+
import { NavigationMenuList as List } from './NavigationMenuList';
|
3
|
+
import { NavigationMenuItem as Item } from './NavigationMenuItem';
|
4
|
+
import { NavigationMenuTrigger as Trigger } from './NavigationMenuTrigger';
|
5
|
+
import { NavigationMenuContent as Content } from './NavigationMenuContent';
|
6
|
+
import { NavigationMenuViewport as Viewport } from './NavigationMenuViewport';
|
7
|
+
import { NavigationMenuIndicator as Indicator } from './NavigationMenuIndicator';
|
8
|
+
import { NavigationMenuLink as Link } from './NavigationMenuLink';
|
9
|
+
var NavigationMenu = { Root: Root, List: List, Item: Item, Trigger: Trigger, Content: Content, Viewport: Viewport, Indicator: Indicator, Link: Link };
|
50
10
|
export default NavigationMenu;
|
@@ -42,26 +42,17 @@ var PieVariants = cva('', {
|
|
42
42
|
});
|
43
43
|
var PieChart = function (_a) {
|
44
44
|
var labels = _a.labels, datasets = _a.datasets, scaling = _a.scaling, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, rest = __rest(_a, ["labels", "datasets", "scaling", "className", "appearance", "isColorMixed"]);
|
45
|
-
|
46
|
-
if (
|
47
|
-
|
48
|
-
datasets[0].borderColor = chartColorList.mixed;
|
45
|
+
var getChartColor = function (isColorMixed, appearance) {
|
46
|
+
if (appearance === 'solid') {
|
47
|
+
return isColorMixed ? chartColorList.mixed : chartColorList.sorting;
|
49
48
|
}
|
50
|
-
|
51
|
-
|
52
|
-
datasets[0].borderColor = chartColorList.sorting;
|
49
|
+
if (appearance === 'soft') {
|
50
|
+
return isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;
|
53
51
|
}
|
54
|
-
}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
datasets[0].borderColor = chartColorList.mixed;
|
59
|
-
}
|
60
|
-
else {
|
61
|
-
datasets[0].backgroundColor = chartAlphaColorList.sorting;
|
62
|
-
datasets[0].borderColor = chartColorList.sorting;
|
63
|
-
}
|
64
|
-
}
|
52
|
+
};
|
53
|
+
datasets.forEach(function (dataset, index) {
|
54
|
+
datasets[index] = __assign(__assign({}, dataset), { backgroundColor: getChartColor(isColorMixed, appearance), borderColor: getChartColor(isColorMixed, 'solid') });
|
55
|
+
});
|
65
56
|
return (_jsx(Pie, __assign({ data: { labels: labels, datasets: datasets }, className: cn(PieVariants({ scaling: scaling }), className) }, rest)));
|
66
57
|
};
|
67
58
|
export default PieChart;
|
@@ -21,9 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import { Popover as PopoverTheme } from '@radix-ui/themes';
|
27
|
+
import { PopoverContext } from './PopoverRoot';
|
27
28
|
import { cn } from '../../../lib/utils/utils';
|
28
29
|
export var popoverCloseVariants = cva('', {
|
29
30
|
variants: {
|
@@ -40,7 +41,8 @@ export var popoverCloseVariants = cva('', {
|
|
40
41
|
},
|
41
42
|
});
|
42
43
|
export var PopoverClose = forwardRef(function (_a, ref) {
|
43
|
-
var className = _a.className, children = _a.children,
|
44
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
45
|
+
var radius = useContext(PopoverContext).radius;
|
44
46
|
return (_jsx(PopoverTheme.Close, __assign({ ref: ref, className: cn(popoverCloseVariants({ radius: radius }), className) }, props, { children: children })));
|
45
47
|
});
|
46
|
-
PopoverClose.displayName = '
|
48
|
+
PopoverClose.displayName = 'Popover.Close';
|
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { scalingVariants } from '../../../lib/constants';
|
26
26
|
import { Popover as PopoverTheme } from '@radix-ui/themes';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
|
+
import { PopoverContext } from './PopoverRoot';
|
28
29
|
import { cn } from '../../../lib/utils/utils';
|
29
30
|
export var popoverContentVariants = cva('flex gap-2 bg-white dark:bg-slateDark-1 border-slateA-6 dark:border-slateDarkA-6', {
|
30
31
|
variants: {
|
@@ -50,7 +51,8 @@ export var popoverContentVariants = cva('flex gap-2 bg-white dark:bg-slateDark-1
|
|
50
51
|
},
|
51
52
|
});
|
52
53
|
export var PopoverContent = forwardRef(function (_a, ref) {
|
53
|
-
var className = _a.className, children = _a.children,
|
54
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
55
|
+
var _b = useContext(PopoverContext), radius = _b.radius, size = _b.size, scaling = _b.scaling;
|
54
56
|
var sizeTheme = '2';
|
55
57
|
if (size === 'small')
|
56
58
|
sizeTheme = '1';
|
@@ -60,4 +62,4 @@ export var PopoverContent = forwardRef(function (_a, ref) {
|
|
60
62
|
sizeTheme = '4';
|
61
63
|
return (_jsx(PopoverTheme.Content, __assign({ ref: ref, size: sizeTheme, className: cn(popoverContentVariants({ size: size, radius: radius, scaling: scaling }), className) }, props, { children: children })));
|
62
64
|
});
|
63
|
-
PopoverContent.displayName = '
|
65
|
+
PopoverContent.displayName = 'Popover.Content';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Popover as PopoverTheme } from '@radix-ui/themes';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import { popoverContentVariants } from './PopoverContent';
|
5
|
+
import { popoverCloseVariants } from './PopoverClose';
|
6
|
+
export interface PopoverProps extends VariantProps<typeof popoverContentVariants>, VariantProps<typeof popoverCloseVariants> {
|
7
|
+
}
|
8
|
+
export declare const PopoverContext: React.Context<PopoverProps>;
|
9
|
+
export declare const PopoverRoot: React.ForwardRefExoticComponent<PopoverTheme.RootProps & PopoverProps & React.RefAttributes<never>>;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { forwardRef, createContext } from 'react';
|
25
|
+
import { Theme, Popover as PopoverTheme } from '@radix-ui/themes';
|
26
|
+
export var PopoverContext = createContext({
|
27
|
+
radius: 'medium',
|
28
|
+
size: 'medium',
|
29
|
+
scaling: '100%',
|
30
|
+
});
|
31
|
+
export var PopoverRoot = forwardRef(function (_a, ref) {
|
32
|
+
var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, props = __rest(_a, ["children", "radius", "size", "scaling"]);
|
33
|
+
var contextValue = { radius: radius, size: size, scaling: scaling };
|
34
|
+
return (_jsx(Theme, { children: _jsx(PopoverContext.Provider, { value: contextValue, children: _jsx(PopoverTheme.Root, __assign({}, props, { children: children })) }) }));
|
35
|
+
});
|
36
|
+
PopoverRoot.displayName = 'Popover.Root';
|
@@ -27,4 +27,4 @@ export var PopoverTrigger = forwardRef(function (_a, ref) {
|
|
27
27
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
28
28
|
return (_jsx(PopoverTheme.Trigger, __assign({ ref: ref }, props, { className: className, children: children })));
|
29
29
|
});
|
30
|
-
PopoverTrigger.displayName = '
|
30
|
+
PopoverTrigger.displayName = 'Popover.Trigger';
|
@@ -1,12 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
export * from './PopoverClose';
|
9
|
-
export interface PopoverProps extends VariantProps<typeof popoverContentVariants>, VariantProps<typeof popoverCloseVariants> {
|
10
|
-
}
|
11
|
-
export declare const Popover: React.ForwardRefExoticComponent<PopoverTheme.RootProps & PopoverProps & React.RefAttributes<never>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const Popover: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<import("@radix-ui/themes/dist/cjs/components/popover").RootProps & import("./PopoverRoot").PopoverProps & import("react").RefAttributes<never>>;
|
4
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/popover").TriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
5
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/popover").ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./PopoverContent").PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
6
|
+
Close: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/popover").CloseProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./PopoverClose").PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
7
|
+
};
|
12
8
|
export default Popover;
|
@@ -1,34 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
return __assign.apply(this, arguments);
|
1
|
+
import { PopoverRoot } from './PopoverRoot';
|
2
|
+
import { PopoverTrigger } from './PopoverTrigger';
|
3
|
+
import { PopoverContent } from './PopoverContent';
|
4
|
+
import { PopoverClose } from './PopoverClose';
|
5
|
+
var Popover = {
|
6
|
+
Root: PopoverRoot,
|
7
|
+
Trigger: PopoverTrigger,
|
8
|
+
Content: PopoverContent,
|
9
|
+
Close: PopoverClose,
|
11
10
|
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
25
|
-
import { Theme, Popover as PopoverTheme } from '@radix-ui/themes';
|
26
|
-
export * from './PopoverTrigger';
|
27
|
-
export * from './PopoverContent';
|
28
|
-
export * from './PopoverClose';
|
29
|
-
export var Popover = forwardRef(function (_a, ref) {
|
30
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
31
|
-
return (_jsx(Theme, { children: _jsx(PopoverTheme.Root, __assign({}, props, { children: children })) }));
|
32
|
-
});
|
33
|
-
Popover.displayName = 'Popover';
|
34
11
|
export default Popover;
|
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import { RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
|
+
import { RadioCardsContext } from './RadioCardsRoot';
|
28
29
|
export var radioCardsItemVariants = cva('bg-white dark:bg-slateDark-1 text-slateA-12 dark:text-slateDarkA-12 border-slateA-6 dark:border-slateDarkA-6 font-normal disabled:text-slateA-9 dark:disabled:text-slateDarkA-9', {
|
29
30
|
variants: {
|
30
31
|
radius: {
|
@@ -46,7 +47,8 @@ export var radioCardsItemVariants = cva('bg-white dark:bg-slateDark-1 text-slate
|
|
46
47
|
},
|
47
48
|
});
|
48
49
|
export var RadioCardsItem = forwardRef(function (_a, ref) {
|
49
|
-
var children = _a.children, className = _a.className,
|
50
|
+
var children = _a.children, className = _a.className, value = _a.value, props = __rest(_a, ["children", "className", "value"]);
|
51
|
+
var _b = useContext(RadioCardsContext), radius = _b.radius, size = _b.size;
|
50
52
|
return (_jsx(RadioCardsTheme.Item, __assign({ ref: ref, value: value, className: cn(radioCardsItemVariants({ radius: radius, size: size }), className) }, props, { children: children })));
|
51
53
|
});
|
52
|
-
RadioCardsItem.displayName = '
|
54
|
+
RadioCardsItem.displayName = 'RadioCards.Item';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
3
|
+
import { RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
4
|
+
import { radioCardsItemVariants } from './RadioCardsItem';
|
5
|
+
export interface RadioCardsProps extends VariantProps<typeof radioCardsVariants>, VariantProps<typeof radioCardsItemVariants> {
|
6
|
+
color?: any;
|
7
|
+
appearance?: 'classic' | 'surface';
|
8
|
+
}
|
9
|
+
declare const radioCardsVariants: (props?: ({
|
10
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
12
|
+
export declare const RadioCardsContext: React.Context<RadioCardsProps>;
|
13
|
+
export declare const RadioCardsRoot: React.ForwardRefExoticComponent<Omit<RadioCardsTheme.RootProps & React.RefAttributes<HTMLDivElement>, "ref"> & RadioCardsProps & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
export {};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { createContext, forwardRef } from 'react';
|
25
|
+
import { cva } from 'class-variance-authority';
|
26
|
+
import { scalingVariants } from '../../../lib/constants';
|
27
|
+
import { Theme, RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
28
|
+
import { cn } from '../../../lib/utils/utils';
|
29
|
+
var radioCardsVariants = cva('flex items-center gap-2', {
|
30
|
+
variants: {
|
31
|
+
scaling: __assign({}, scalingVariants),
|
32
|
+
},
|
33
|
+
defaultVariants: {
|
34
|
+
scaling: '100%',
|
35
|
+
},
|
36
|
+
});
|
37
|
+
export var RadioCardsContext = createContext({
|
38
|
+
radius: 'medium',
|
39
|
+
size: 'medium',
|
40
|
+
});
|
41
|
+
export var RadioCardsRoot = forwardRef(function (_a, ref) {
|
42
|
+
var children = _a.children, className = _a.className, radius = _a.radius, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, props = __rest(_a, ["children", "className", "radius", "scaling", "size", "color", "appearance"]);
|
43
|
+
var contextValue = { radius: radius, size: size };
|
44
|
+
return (_jsx(Theme, { accentColor: color, children: _jsx(RadioCardsContext.Provider, { value: contextValue, children: _jsx(RadioCardsTheme.Root, __assign({ ref: ref, variant: appearance, className: cn(radioCardsVariants({ scaling: scaling }), className) }, props, { children: children })) }) }));
|
45
|
+
});
|
46
|
+
RadioCardsRoot.displayName = 'RadioCards.Root';
|
@@ -1,14 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
export interface RadioCardsProps extends VariantProps<typeof radioCardsVariants>, VariantProps<typeof radioCardsItemVariants> {
|
7
|
-
color?: any;
|
8
|
-
appearance?: 'classic' | 'surface';
|
9
|
-
}
|
10
|
-
declare const radioCardsVariants: (props?: ({
|
11
|
-
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
12
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
13
|
-
export declare const RadioCards: React.ForwardRefExoticComponent<Omit<RadioCardsTheme.RootProps & React.RefAttributes<HTMLDivElement>, "ref"> & RadioCardsProps & React.RefAttributes<HTMLDivElement>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const RadioCards: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/radio-cards").RootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./RadioCardsRoot").RadioCardsProps & import("react").RefAttributes<HTMLDivElement>>;
|
4
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/radio-cards").ItemProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./RadioCardsItem").RadioCardsItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
5
|
+
};
|
14
6
|
export default RadioCards;
|
@@ -1,43 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
1
|
+
import { RadioCardsRoot } from './RadioCardsRoot';
|
2
|
+
import { RadioCardsItem } from './RadioCardsItem';
|
3
|
+
var RadioCards = {
|
4
|
+
Root: RadioCardsRoot,
|
5
|
+
Item: RadioCardsItem,
|
11
6
|
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
25
|
-
import { cva } from 'class-variance-authority';
|
26
|
-
import { scalingVariants } from '../../../lib/constants';
|
27
|
-
import { Theme, RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
28
|
-
import { cn } from '../../../lib/utils/utils';
|
29
|
-
export * from './RadioCardsItem';
|
30
|
-
var radioCardsVariants = cva('flex items-center gap-2', {
|
31
|
-
variants: {
|
32
|
-
scaling: __assign({}, scalingVariants),
|
33
|
-
},
|
34
|
-
defaultVariants: {
|
35
|
-
scaling: '100%',
|
36
|
-
},
|
37
|
-
});
|
38
|
-
export var RadioCards = forwardRef(function (_a, ref) {
|
39
|
-
var children = _a.children, className = _a.className, scaling = _a.scaling, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, props = __rest(_a, ["children", "className", "scaling", "appearance", "color"]);
|
40
|
-
return (_jsx(Theme, { accentColor: color, children: _jsx(RadioCardsTheme.Root, __assign({ ref: ref, variant: appearance, className: cn(radioCardsVariants({ scaling: scaling }), className) }, props, { children: children })) }));
|
41
|
-
});
|
42
|
-
RadioCards.displayName = 'RadioCards';
|
43
7
|
export default RadioCards;
|
@@ -21,9 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import { RadioGroup as RadioGroupTheme } from '@radix-ui/themes';
|
27
|
+
import { RadioGroupContext } from './RadioGroupRoot';
|
27
28
|
import { cn } from '../../../lib/utils/utils';
|
28
29
|
var radioGroupItemVariants = cva('font-normal text-slate-12 dark:text-slateDark-12', {
|
29
30
|
variants: {
|
@@ -38,7 +39,8 @@ var radioGroupItemVariants = cva('font-normal text-slate-12 dark:text-slateDark-
|
|
38
39
|
},
|
39
40
|
});
|
40
41
|
export var RadioGroupItem = forwardRef(function (_a, ref) {
|
41
|
-
var className = _a.className, children = _a.children, value = _a.value,
|
42
|
+
var className = _a.className, children = _a.children, value = _a.value, props = __rest(_a, ["className", "children", "value"]);
|
43
|
+
var size = useContext(RadioGroupContext).size;
|
42
44
|
return (_jsx(RadioGroupTheme.Item, __assign({ ref: ref, value: value, className: cn(radioGroupItemVariants({ size: size }), className) }, props, { children: children })));
|
43
45
|
});
|
44
|
-
RadioGroupItem.displayName = '
|
46
|
+
RadioGroupItem.displayName = 'RadioGroup.Item';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RadioGroup as RadioGroupTheme } from '@radix-ui/themes';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import { IScaling } from '../../../lib/types';
|
5
|
+
export interface RadioGroupProps extends VariantProps<typeof radioGroupVariants> {
|
6
|
+
color?: any;
|
7
|
+
scaling?: IScaling;
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
9
|
+
appearance?: 'classic' | 'surface' | 'soft';
|
10
|
+
}
|
11
|
+
declare const radioGroupVariants: (props?: ({
|
12
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
13
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
14
|
+
export declare const RadioGroupContext: React.Context<RadioGroupProps>;
|
15
|
+
export declare const RadioGroupRoot: React.ForwardRefExoticComponent<Omit<RadioGroupTheme.RootProps & React.RefAttributes<HTMLDivElement>, "ref"> & RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
16
|
+
export {};
|