@lotte-innovate/ui-component-test 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +154 -0
- package/dist/components/Accordion/index.d.ts +16 -0
- package/dist/components/Accordion/index.jsx +70 -0
- package/dist/components/AlertDialog/AlertDialogAction.d.ts +14 -0
- package/dist/components/AlertDialog/AlertDialogAction.jsx +60 -0
- package/dist/components/AlertDialog/AlertDialogCancel.d.ts +13 -0
- package/dist/components/AlertDialog/AlertDialogCancel.jsx +57 -0
- package/dist/components/AlertDialog/AlertDialogContent.d.ts +11 -0
- package/dist/components/AlertDialog/AlertDialogContent.jsx +53 -0
- package/dist/components/AlertDialog/AlertDialogDescription.d.ts +10 -0
- package/dist/components/AlertDialog/AlertDialogDescription.jsx +35 -0
- package/dist/components/AlertDialog/AlertDialogTitle.d.ts +10 -0
- package/dist/components/AlertDialog/AlertDialogTitle.jsx +35 -0
- package/dist/components/AlertDialog/AlertDialogTrigger.d.ts +17 -0
- package/dist/components/AlertDialog/AlertDialogTrigger.jsx +56 -0
- package/dist/components/AlertDialog/index.d.ts +20 -0
- package/dist/components/AlertDialog/index.jsx +25 -0
- package/dist/components/AspectRatio/index.d.ts +10 -0
- package/dist/components/AspectRatio/index.jsx +43 -0
- package/dist/components/Avatar/index.d.ts +17 -0
- package/dist/components/Avatar/index.jsx +61 -0
- package/dist/components/Badge/index.d.ts +18 -0
- package/dist/components/Badge/index.jsx +55 -0
- package/dist/components/BubbleChart/index.d.ts +32 -0
- package/dist/components/BubbleChart/index.jsx +42 -0
- package/dist/components/Button/index.d.ts +16 -0
- package/dist/components/Button/index.jsx +57 -0
- package/dist/components/Callout/CalloutIcon.d.ts +12 -0
- package/dist/components/Callout/CalloutIcon.jsx +62 -0
- package/dist/components/Callout/CalloutText.d.ts +10 -0
- package/dist/components/Callout/CalloutText.jsx +42 -0
- package/dist/components/Callout/index.d.ts +20 -0
- package/dist/components/Callout/index.jsx +78 -0
- package/dist/components/Card/index.d.ts +14 -0
- package/dist/components/Card/index.jsx +65 -0
- package/dist/components/Checkbox/index.d.ts +17 -0
- package/dist/components/Checkbox/index.jsx +97 -0
- package/dist/components/CheckboxCard/index.d.ts +20 -0
- package/dist/components/CheckboxCard/index.jsx +60 -0
- package/dist/components/CheckboxGroup/CheckboxGroupItem.d.ts +5 -0
- package/dist/components/CheckboxGroup/CheckboxGroupItem.jsx +25 -0
- package/dist/components/CheckboxGroup/index.d.ts +17 -0
- package/dist/components/CheckboxGroup/index.jsx +38 -0
- package/dist/components/ContextMenu/ContextMenuCheckboxItem.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuCheckboxItem.jsx +33 -0
- package/dist/components/ContextMenu/ContextMenuContent.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenuContent.jsx +59 -0
- package/dist/components/ContextMenu/ContextMenuGroup.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuGroup.jsx +20 -0
- package/dist/components/ContextMenu/ContextMenuItem.d.ts +13 -0
- package/dist/components/ContextMenu/ContextMenuItem.jsx +61 -0
- package/dist/components/ContextMenu/ContextMenuItemIndicator.d.ts +10 -0
- package/dist/components/ContextMenu/ContextMenuItemIndicator.jsx +51 -0
- package/dist/components/ContextMenu/ContextMenuLabel.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenuLabel.jsx +49 -0
- package/dist/components/ContextMenu/ContextMenuRadioGroup.d.ts +8 -0
- package/dist/components/ContextMenu/ContextMenuRadioGroup.jsx +23 -0
- package/dist/components/ContextMenu/ContextMenuRadioItem.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuRadioItem.jsx +34 -0
- package/dist/components/ContextMenu/ContextMenuSeparator.d.ts +3 -0
- package/dist/components/ContextMenu/ContextMenuSeparator.jsx +21 -0
- package/dist/components/ContextMenu/ContextMenuSubContent.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenuSubContent.jsx +56 -0
- package/dist/components/ContextMenu/ContextMenuSubTrigger.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuSubTrigger.jsx +35 -0
- package/dist/components/ContextMenu/ContextMenuTrigger.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenuTrigger.jsx +21 -0
- package/dist/components/ContextMenu/index.d.ts +25 -0
- package/dist/components/ContextMenu/index.jsx +44 -0
- package/dist/components/DataList/DataListItem.d.ts +9 -0
- package/dist/components/DataList/DataListItem.jsx +44 -0
- package/dist/components/DataList/DataListLabel.d.ts +10 -0
- package/dist/components/DataList/DataListLabel.jsx +50 -0
- package/dist/components/DataList/DataListValue.d.ts +11 -0
- package/dist/components/DataList/DataListValue.jsx +52 -0
- package/dist/components/DataList/index.d.ts +17 -0
- package/dist/components/DataList/index.jsx +49 -0
- package/dist/components/Dialog/DialogAction.d.ts +15 -0
- package/dist/components/Dialog/DialogAction.jsx +47 -0
- package/dist/components/Dialog/DialogCancel.d.ts +11 -0
- package/dist/components/Dialog/DialogCancel.jsx +43 -0
- package/dist/components/Dialog/DialogContent.d.ts +11 -0
- package/dist/components/Dialog/DialogContent.jsx +56 -0
- package/dist/components/Dialog/DialogDescription.d.ts +9 -0
- package/dist/components/Dialog/DialogDescription.jsx +35 -0
- package/dist/components/Dialog/DialogSlot.d.ts +9 -0
- package/dist/components/Dialog/DialogSlot.jsx +34 -0
- package/dist/components/Dialog/DialogTitle.d.ts +11 -0
- package/dist/components/Dialog/DialogTitle.jsx +35 -0
- package/dist/components/Dialog/DialogTrigger.d.ts +3 -0
- package/dist/components/Dialog/DialogTrigger.jsx +20 -0
- package/dist/components/Dialog/index.d.ts +18 -0
- package/dist/components/Dialog/index.jsx +28 -0
- package/dist/components/DoughnutChart/index.d.ts +24 -0
- package/dist/components/DoughnutChart/index.jsx +46 -0
- package/dist/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +8 -0
- package/dist/components/DropdownMenu/DropdonMenuRadioGroup.jsx +23 -0
- package/dist/components/DropdownMenu/DropdonMenuSubContent.d.ts +11 -0
- package/dist/components/DropdownMenu/DropdonMenuSubContent.jsx +61 -0
- package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.jsx +31 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.d.ts +11 -0
- package/dist/components/DropdownMenu/DropdownMenuContent.jsx +57 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.d.ts +13 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.jsx +58 -0
- package/dist/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +10 -0
- package/dist/components/DropdownMenu/DropdownMenuItemIndicator.jsx +47 -0
- package/dist/components/DropdownMenu/DropdownMenuLable.d.ts +11 -0
- package/dist/components/DropdownMenu/DropdownMenuLable.jsx +47 -0
- package/dist/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -0
- package/dist/components/DropdownMenu/DropdownMenuRadioItem.jsx +32 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.d.ts +3 -0
- package/dist/components/DropdownMenu/DropdownMenuSeparator.jsx +19 -0
- package/dist/components/DropdownMenu/DropdownMenuSub.d.ts +3 -0
- package/dist/components/DropdownMenu/DropdownMenuSub.jsx +18 -0
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +4 -0
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.jsx +31 -0
- package/dist/components/DropdownMenu/DropdownMenuTrigger.d.ts +13 -0
- package/dist/components/DropdownMenu/DropdownMenuTrigger.jsx +41 -0
- package/dist/components/DropdownMenu/index.d.ts +23 -0
- package/dist/components/DropdownMenu/index.jsx +31 -0
- package/dist/components/HoverCard/HoverCardContent.d.ts +14 -0
- package/dist/components/HoverCard/HoverCardContent.jsx +61 -0
- package/dist/components/HoverCard/HoverCardTrigger.d.ts +3 -0
- package/dist/components/HoverCard/HoverCardTrigger.jsx +20 -0
- package/dist/components/HoverCard/index.d.ts +10 -0
- package/dist/components/HoverCard/index.jsx +23 -0
- package/dist/components/IconButton/index.d.ts +15 -0
- package/dist/components/IconButton/index.jsx +64 -0
- package/dist/components/Input/Input.stories.d.ts +77 -0
- package/dist/components/Input/Input.stories.jsx +68 -0
- package/dist/components/Input/index.d.ts +14 -0
- package/dist/components/Input/index.jsx +53 -0
- package/dist/components/Inset/index.d.ts +10 -0
- package/dist/components/Inset/index.jsx +53 -0
- package/dist/components/Label/index.d.ts +17 -0
- package/dist/components/Label/index.jsx +54 -0
- package/dist/components/Menubar/MenubarCheckboxItem.d.ts +4 -0
- package/dist/components/Menubar/MenubarCheckboxItem.jsx +31 -0
- package/dist/components/Menubar/MenubarContent.d.ts +11 -0
- package/dist/components/Menubar/MenubarContent.jsx +63 -0
- package/dist/components/Menubar/MenubarItem.d.ts +13 -0
- package/dist/components/Menubar/MenubarItem.jsx +56 -0
- package/dist/components/Menubar/MenubarItemIndicator.d.ts +10 -0
- package/dist/components/Menubar/MenubarItemIndicator.jsx +50 -0
- package/dist/components/Menubar/MenubarMenu.d.ts +2 -0
- package/dist/components/Menubar/MenubarMenu.jsx +18 -0
- package/dist/components/Menubar/MenubarRadioGroup.d.ts +8 -0
- package/dist/components/Menubar/MenubarRadioGroup.jsx +23 -0
- package/dist/components/Menubar/MenubarRadioItem.d.ts +4 -0
- package/dist/components/Menubar/MenubarRadioItem.jsx +33 -0
- package/dist/components/Menubar/MenubarSeparator.d.ts +3 -0
- package/dist/components/Menubar/MenubarSeparator.jsx +21 -0
- package/dist/components/Menubar/MenubarSub.d.ts +3 -0
- package/dist/components/Menubar/MenubarSub.jsx +18 -0
- package/dist/components/Menubar/MenubarSubContent.d.ts +10 -0
- package/dist/components/Menubar/MenubarSubContent.jsx +52 -0
- package/dist/components/Menubar/MenubarSubTrigger.d.ts +4 -0
- package/dist/components/Menubar/MenubarSubTrigger.jsx +34 -0
- package/dist/components/Menubar/MenubarTrigger.d.ts +12 -0
- package/dist/components/Menubar/MenubarTrigger.jsx +58 -0
- package/dist/components/Menubar/index.d.ts +31 -0
- package/dist/components/Menubar/index.jsx +76 -0
- package/dist/components/NavigationMenu/NavigationMenuContent.d.ts +11 -0
- package/dist/components/NavigationMenu/NavigationMenuContent.jsx +49 -0
- package/dist/components/NavigationMenu/NavigationMenuIndicator.d.ts +3 -0
- package/dist/components/NavigationMenu/NavigationMenuIndicator.jsx +22 -0
- package/dist/components/NavigationMenu/NavigationMenuItem.d.ts +3 -0
- package/dist/components/NavigationMenu/NavigationMenuItem.jsx +20 -0
- package/dist/components/NavigationMenu/NavigationMenuLink.d.ts +13 -0
- package/dist/components/NavigationMenu/NavigationMenuLink.jsx +52 -0
- package/dist/components/NavigationMenu/NavigationMenuList.d.ts +12 -0
- package/dist/components/NavigationMenu/NavigationMenuList.jsx +49 -0
- package/dist/components/NavigationMenu/NavigationMenuTrigger.d.ts +13 -0
- package/dist/components/NavigationMenu/NavigationMenuTrigger.jsx +60 -0
- package/dist/components/NavigationMenu/NavigationMenuViewport.d.ts +12 -0
- package/dist/components/NavigationMenu/NavigationMenuViewport.jsx +54 -0
- package/dist/components/NavigationMenu/index.d.ts +21 -0
- package/dist/components/NavigationMenu/index.jsx +42 -0
- package/dist/components/PieChart/index.d.ts +24 -0
- package/dist/components/PieChart/index.jsx +46 -0
- package/dist/components/Popover/PopoverClose.d.ts +9 -0
- package/dist/components/Popover/PopoverClose.jsx +36 -0
- package/dist/components/Popover/PopoverContent.d.ts +11 -0
- package/dist/components/Popover/PopoverContent.jsx +64 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +3 -0
- package/dist/components/Popover/PopoverTrigger.jsx +20 -0
- package/dist/components/Popover/index.d.ts +11 -0
- package/dist/components/Popover/index.jsx +23 -0
- package/dist/components/Progress/index.d.ts +16 -0
- package/dist/components/Progress/index.jsx +57 -0
- package/dist/components/RadarChart/index.d.ts +35 -0
- package/dist/components/RadarChart/index.jsx +42 -0
- package/dist/components/Radio/index.d.ts +14 -0
- package/dist/components/Radio/index.jsx +45 -0
- package/dist/components/RadioCards/RadioCardsItem.d.ts +10 -0
- package/dist/components/RadioCards/RadioCardsItem.jsx +42 -0
- package/dist/components/RadioCards/index.d.ts +13 -0
- package/dist/components/RadioCards/index.jsx +45 -0
- package/dist/components/RadioGroup/RadioGroupItem.d.ts +13 -0
- package/dist/components/RadioGroup/RadioGroupItem.jsx +34 -0
- package/dist/components/RadioGroup/index.d.ts +15 -0
- package/dist/components/RadioGroup/index.jsx +42 -0
- package/dist/components/ScrollArea/index.d.ts +8 -0
- package/dist/components/ScrollArea/index.jsx +27 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.d.ts +6 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.jsx +25 -0
- package/dist/components/SegmentedControl/index.d.ts +14 -0
- package/dist/components/SegmentedControl/index.jsx +50 -0
- package/dist/components/Select/index.d.ts +25 -0
- package/dist/components/Select/index.jsx +97 -0
- package/dist/components/Separator/index.d.ts +11 -0
- package/dist/components/Separator/index.jsx +49 -0
- package/dist/components/Skeleton/index.d.ts +15 -0
- package/dist/components/Skeleton/index.jsx +45 -0
- package/dist/components/Slider/index.d.ts +15 -0
- package/dist/components/Slider/index.jsx +50 -0
- package/dist/components/Spinner/index.d.ts +15 -0
- package/dist/components/Spinner/index.jsx +49 -0
- package/dist/components/TabNav/index.d.ts +11 -0
- package/dist/components/TabNav/index.jsx +39 -0
- package/dist/components/Table/index.d.ts +20 -0
- package/dist/components/Table/index.jsx +103 -0
- package/dist/components/Tabs/index.d.ts +16 -0
- package/dist/components/Tabs/index.jsx +67 -0
- package/dist/components/TextArea/index.d.ts +16 -0
- package/dist/components/TextArea/index.jsx +58 -0
- package/dist/components/TextField/index.d.ts +18 -0
- package/dist/components/TextField/index.jsx +57 -0
- package/dist/components/Toast/ToastActionButton.d.ts +14 -0
- package/dist/components/Toast/ToastActionButton.jsx +68 -0
- package/dist/components/Toast/ToastDescription.d.ts +13 -0
- package/dist/components/Toast/ToastDescription.jsx +45 -0
- package/dist/components/Toast/ToastTitle.d.ts +13 -0
- package/dist/components/Toast/ToastTitle.jsx +43 -0
- package/dist/components/Toast/index.d.ts +29 -0
- package/dist/components/Toast/index.jsx +99 -0
- package/dist/components/Toggle/ToggleWithText.d.ts +21 -0
- package/dist/components/Toggle/ToggleWithText.jsx +59 -0
- package/dist/components/Toggle/index.d.ts +20 -0
- package/dist/components/Toggle/index.jsx +58 -0
- package/dist/components/ToggleGroup/index.d.ts +19 -0
- package/dist/components/ToggleGroup/index.jsx +45 -0
- package/dist/components/ToggleGroup/toggleGroupItem.d.ts +17 -0
- package/dist/components/ToggleGroup/toggleGroupItem.jsx +42 -0
- package/dist/components/ToggleSwitch/index.d.ts +13 -0
- package/dist/components/ToggleSwitch/index.jsx +74 -0
- package/dist/components/Tooltip/index.d.ts +20 -0
- package/dist/components/Tooltip/index.jsx +58 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +22 -0
- package/package.json +119 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
3
|
+
import { IAppearance } from 'types';
|
4
|
+
export interface IconButtonProps extends VariantProps<typeof iconButtonVariants> {
|
5
|
+
appearance?: IAppearance;
|
6
|
+
size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
|
7
|
+
}
|
8
|
+
declare const iconButtonVariants: (props?: ({
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
11
|
+
size?: "small" | "medium" | "large" | "x-small" | "x-large" | null | undefined;
|
12
|
+
color?: string | null | undefined;
|
13
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
14
|
+
export declare const IconButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
15
|
+
export default IconButton;
|
@@ -0,0 +1,64 @@
|
|
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 React, { Children, forwardRef } from 'react';
|
24
|
+
import { cva } from 'class-variance-authority';
|
25
|
+
import { scalingVariants, radiusVariants, primaryColorStyle, appearanceStyle, } from '../../constants';
|
26
|
+
import { cn } from '../../utils/utils';
|
27
|
+
var iconButtonVariants = cva("grid place-content-center transition-colors focus:outline-none hover:cursor-pointer\n disabled:cursor-not-allowed disabled:bg-slate-3 disabled:text-slate-8", {
|
28
|
+
variants: {
|
29
|
+
radius: __assign({}, radiusVariants['base']),
|
30
|
+
scaling: __assign({}, scalingVariants),
|
31
|
+
size: {
|
32
|
+
'x-small': 'p-1 w-5 h-5',
|
33
|
+
small: 'p-[6px] w-6 h-6',
|
34
|
+
medium: 'p-2 w-8 h-8',
|
35
|
+
large: 'p-[11px] w-10 h-10',
|
36
|
+
'x-large': 'p-[14px] w-12 h-12',
|
37
|
+
},
|
38
|
+
color: primaryColorStyle(),
|
39
|
+
},
|
40
|
+
defaultVariants: {
|
41
|
+
radius: 'medium',
|
42
|
+
scaling: '100%',
|
43
|
+
size: 'medium',
|
44
|
+
color: 'red',
|
45
|
+
},
|
46
|
+
});
|
47
|
+
var iconSize = {
|
48
|
+
'x-small': 12,
|
49
|
+
small: 14,
|
50
|
+
medium: 16,
|
51
|
+
large: 18,
|
52
|
+
'x-large': 20,
|
53
|
+
};
|
54
|
+
export var IconButton = forwardRef(function (_a, ref) {
|
55
|
+
var children = _a.children, className = _a.className, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'solid' : _d, props = __rest(_a, ["children", "className", "radius", "size", "scaling", "color", "appearance"]);
|
56
|
+
var width = iconSize[size];
|
57
|
+
var height = iconSize[size];
|
58
|
+
var buttonClassName = cn(iconButtonVariants({ radius: radius, scaling: scaling, size: size, color: color }), appearanceStyle(appearance, color, true), className);
|
59
|
+
return (<button ref={ref} className={buttonClassName} {...props}>
|
60
|
+
{Children.map(children, function (child) { return React.cloneElement(child, { width: width, height: height }); })}
|
61
|
+
</button>);
|
62
|
+
});
|
63
|
+
IconButton.displayName = 'IconButton';
|
64
|
+
export default IconButton;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
3
|
+
import { InputProps } from './index';
|
4
|
+
import { IRadius, IScaling, IWeight } from '../../types';
|
5
|
+
declare const meta: {
|
6
|
+
title: string;
|
7
|
+
component: ({ radius, scaling, weight, color, ...props }: InputProps) => import("react").JSX.Element;
|
8
|
+
parameters: {
|
9
|
+
layout: string;
|
10
|
+
themes: {
|
11
|
+
themeOverride: string;
|
12
|
+
};
|
13
|
+
docs: {
|
14
|
+
page: null;
|
15
|
+
description: {
|
16
|
+
component: string;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
};
|
20
|
+
tags: string[];
|
21
|
+
argTypes: {
|
22
|
+
radius: {
|
23
|
+
options: IRadius[];
|
24
|
+
control: {
|
25
|
+
type: string;
|
26
|
+
};
|
27
|
+
description: string;
|
28
|
+
defaultValue: {
|
29
|
+
summary: string;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
scaling: {
|
33
|
+
options: IScaling[];
|
34
|
+
control: {
|
35
|
+
type: string;
|
36
|
+
};
|
37
|
+
description: string;
|
38
|
+
defaultValue: {
|
39
|
+
summary: string;
|
40
|
+
};
|
41
|
+
};
|
42
|
+
weight: {
|
43
|
+
options: IWeight[];
|
44
|
+
control: {
|
45
|
+
type: string;
|
46
|
+
};
|
47
|
+
description: string;
|
48
|
+
defaultValue: {
|
49
|
+
summary: string;
|
50
|
+
};
|
51
|
+
};
|
52
|
+
onChange: {
|
53
|
+
table: {
|
54
|
+
category: string;
|
55
|
+
};
|
56
|
+
};
|
57
|
+
color: {
|
58
|
+
options: import("../../types").IColor[];
|
59
|
+
description: string;
|
60
|
+
defaultValue: {
|
61
|
+
summary: string;
|
62
|
+
};
|
63
|
+
control: {
|
64
|
+
type: string;
|
65
|
+
};
|
66
|
+
};
|
67
|
+
};
|
68
|
+
args: {
|
69
|
+
onClick: import("@vitest/spy").Mock<[event: import("react").MouseEvent<HTMLInputElement, MouseEvent>], void>;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
export default meta;
|
73
|
+
type Story = StoryObj<typeof meta>;
|
74
|
+
export declare const Default: Story;
|
75
|
+
export declare const Radius: (args: InputProps) => import("react").JSX.Element;
|
76
|
+
export declare const Scaling: (args: InputProps) => import("react").JSX.Element;
|
77
|
+
export declare const Weight: (args: InputProps) => import("react").JSX.Element;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { fn } from '@storybook/test';
|
2
|
+
import { Input } from './index';
|
3
|
+
import { radiusOptions, scalingOptions, weightOptions } from '../../../src/constants';
|
4
|
+
import { colorOptions } from 'color/constants';
|
5
|
+
var meta = {
|
6
|
+
title: '작업중/Input',
|
7
|
+
component: Input,
|
8
|
+
parameters: {
|
9
|
+
layout: 'centered',
|
10
|
+
themes: {
|
11
|
+
themeOverride: 'dark',
|
12
|
+
},
|
13
|
+
docs: {
|
14
|
+
page: null,
|
15
|
+
description: {
|
16
|
+
component: '',
|
17
|
+
},
|
18
|
+
},
|
19
|
+
},
|
20
|
+
tags: ['autodocs'],
|
21
|
+
argTypes: {
|
22
|
+
radius: {
|
23
|
+
options: radiusOptions,
|
24
|
+
control: { type: 'select' },
|
25
|
+
description: '둥글기',
|
26
|
+
defaultValue: { summary: 'small' },
|
27
|
+
},
|
28
|
+
scaling: {
|
29
|
+
options: scalingOptions,
|
30
|
+
control: { type: 'select' },
|
31
|
+
description: '크기',
|
32
|
+
defaultValue: { summary: '100%' },
|
33
|
+
},
|
34
|
+
weight: {
|
35
|
+
options: weightOptions,
|
36
|
+
control: { type: 'select' },
|
37
|
+
description: '폰트 두께',
|
38
|
+
defaultValue: { summary: 'normal' },
|
39
|
+
},
|
40
|
+
onChange: {
|
41
|
+
table: {
|
42
|
+
category: 'EVENT HANDLER',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
color: {
|
46
|
+
options: colorOptions,
|
47
|
+
description: 'background color',
|
48
|
+
defaultValue: { summary: 'blue' },
|
49
|
+
control: { type: 'select' },
|
50
|
+
},
|
51
|
+
},
|
52
|
+
args: {
|
53
|
+
onClick: fn(),
|
54
|
+
},
|
55
|
+
};
|
56
|
+
export default meta;
|
57
|
+
export var Default = {
|
58
|
+
args: {},
|
59
|
+
};
|
60
|
+
export var Radius = function (args) { return (<div className="flex space-x-2">
|
61
|
+
{radiusOptions.map(function (radius) { return (<Input key={radius} {...args} radius={radius}/>); })}
|
62
|
+
</div>); };
|
63
|
+
export var Scaling = function (args) { return (<div className="flex items-center space-x-2">
|
64
|
+
{scalingOptions.map(function (scaling) { return (<Input key={scaling} {...args} scaling={scaling}></Input>); })}
|
65
|
+
</div>); };
|
66
|
+
export var Weight = function (args) { return (<div className="flex items-center space-x-2">
|
67
|
+
{weightOptions.map(function (weight) { return (<Input key={weight} {...args} weight={weight}></Input>); })}
|
68
|
+
</div>); };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
3
|
+
import { IColor } from '../../types';
|
4
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
5
|
+
color?: IColor;
|
6
|
+
}
|
7
|
+
declare const inputVariants: (props?: ({
|
8
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
9
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
10
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
11
|
+
color?: string | null | undefined;
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
13
|
+
export declare const Input: ({ radius, scaling, weight, color, ...props }: InputProps) => React.JSX.Element;
|
14
|
+
export default Input;
|
@@ -0,0 +1,53 @@
|
|
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 React from 'react';
|
24
|
+
import { cva } from 'class-variance-authority';
|
25
|
+
import { cn } from '../../utils/utils';
|
26
|
+
import { bgColorStyle, radiusVariants, weightVariants } from '../../constants';
|
27
|
+
var inputVariants = cva('inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
|
28
|
+
variants: {
|
29
|
+
radius: __assign({}, radiusVariants['base']),
|
30
|
+
scaling: {
|
31
|
+
'90%': 'text-xs py-1 px-2',
|
32
|
+
'95%': 'text-sm py-1 px-2',
|
33
|
+
'100%': 'text-base py-2 px-6',
|
34
|
+
'105%': 'text-lg py-3 px-6',
|
35
|
+
'110%': 'text-xl py-3 px-6',
|
36
|
+
},
|
37
|
+
weight: __assign({}, weightVariants),
|
38
|
+
color: bgColorStyle(),
|
39
|
+
},
|
40
|
+
defaultVariants: {
|
41
|
+
radius: 'small',
|
42
|
+
},
|
43
|
+
});
|
44
|
+
export var Input = function (_a) {
|
45
|
+
var radius = _a.radius, scaling = _a.scaling, weight = _a.weight, color = _a.color, props = __rest(_a, ["radius", "scaling", "weight", "color"]);
|
46
|
+
return (<input className={cn(inputVariants({
|
47
|
+
radius: radius,
|
48
|
+
scaling: scaling,
|
49
|
+
weight: weight,
|
50
|
+
color: color,
|
51
|
+
}))} {...props}/>);
|
52
|
+
};
|
53
|
+
export default Input;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
3
|
+
export interface InsetProps extends VariantProps<typeof insetVariants> {
|
4
|
+
}
|
5
|
+
declare const insetVariants: (props?: ({
|
6
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
7
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
9
|
+
export declare const Inset: React.ForwardRefExoticComponent<Omit<import("@radix-ui/themes").InsetProps & React.RefAttributes<HTMLDivElement>, "ref"> & InsetProps & React.RefAttributes<HTMLDivElement>>;
|
10
|
+
export default Inset;
|
@@ -0,0 +1,53 @@
|
|
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 React, { forwardRef } from 'react';
|
24
|
+
import { cva } from 'class-variance-authority';
|
25
|
+
import { Inset as InsetTheme, Theme } from '@radix-ui/themes';
|
26
|
+
import { scalingVariants } from '../../constants';
|
27
|
+
import { cn } from '../../utils/utils';
|
28
|
+
var insetVariants = cva('border-[1px] border-slate-6 dark:border-slateDark-6 text-slate-12 dark:text-slateDark-12', {
|
29
|
+
variants: {
|
30
|
+
radius: {
|
31
|
+
none: 'rounded-none after:rounded-none',
|
32
|
+
small: 'rounded-[3px] after:rounded-[3px]',
|
33
|
+
medium: 'rounded after:rounded',
|
34
|
+
large: 'rounded-md after:rounded-md',
|
35
|
+
full: 'rounded-md after:rounded-md',
|
36
|
+
},
|
37
|
+
scaling: __assign({}, scalingVariants),
|
38
|
+
},
|
39
|
+
defaultVariants: {
|
40
|
+
radius: 'medium',
|
41
|
+
scaling: '100%',
|
42
|
+
},
|
43
|
+
});
|
44
|
+
export var Inset = forwardRef(function (_a, ref) {
|
45
|
+
var children = _a.children, className = _a.className, radius = _a.radius, scaling = _a.scaling, props = __rest(_a, ["children", "className", "radius", "scaling"]);
|
46
|
+
return (<Theme>
|
47
|
+
<InsetTheme ref={ref} className={cn(insetVariants({ radius: radius, scaling: scaling }), className)} {...props}>
|
48
|
+
{children}
|
49
|
+
</InsetTheme>
|
50
|
+
</Theme>);
|
51
|
+
});
|
52
|
+
Inset.displayName = 'Inset';
|
53
|
+
export default Inset;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
2
|
+
import React from 'react';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import { IColor } from 'types';
|
5
|
+
export interface LabelProps extends VariantProps<typeof labeVariants> {
|
6
|
+
defaultValue?: string;
|
7
|
+
color?: IColor;
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
9
|
+
}
|
10
|
+
declare const labeVariants: (props?: ({
|
11
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
12
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
13
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
14
|
+
color?: string | null | undefined;
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
16
|
+
export declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
17
|
+
export default Label;
|
@@ -0,0 +1,54 @@
|
|
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 * as LabelPrimitive from '@radix-ui/react-label';
|
24
|
+
import React from 'react';
|
25
|
+
import { cn } from '../../utils/utils';
|
26
|
+
import { cva } from 'class-variance-authority';
|
27
|
+
import { scalingVariants, textColorStyle, weightVariants } from '../../constants';
|
28
|
+
var labeVariants = cva('text-slate-12', {
|
29
|
+
variants: {
|
30
|
+
scaling: __assign({}, scalingVariants),
|
31
|
+
weight: __assign({}, weightVariants),
|
32
|
+
size: {
|
33
|
+
small: 'text-xs',
|
34
|
+
medium: 'text-sm',
|
35
|
+
large: 'text-base',
|
36
|
+
},
|
37
|
+
color: textColorStyle(),
|
38
|
+
},
|
39
|
+
defaultVariants: {
|
40
|
+
scaling: '100%',
|
41
|
+
size: 'medium',
|
42
|
+
color: 'black',
|
43
|
+
},
|
44
|
+
});
|
45
|
+
export var Label = React.forwardRef(function (_a, forwardedRef) {
|
46
|
+
var className = _a.className, scaling = _a.scaling, weight = _a.weight, size = _a.size, color = _a.color, children = _a.children, rootProps = __rest(_a, ["className", "scaling", "weight", "size", "color", "children"]);
|
47
|
+
if (weight === 'medium' || weight === 'semibold')
|
48
|
+
weight = 'bold';
|
49
|
+
return (<LabelPrimitive.Root {...rootProps} ref={forwardedRef} className={cn('', labeVariants({ scaling: scaling, size: size, weight: weight, color: color }), className)}>
|
50
|
+
{children}
|
51
|
+
</LabelPrimitive.Root>);
|
52
|
+
});
|
53
|
+
Label.displayName = 'Label';
|
54
|
+
export default Label;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
|
+
import { MenubarItemProps } from './MenubarItem';
|
4
|
+
export declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & MenubarItemProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
12
|
+
import React, { forwardRef } from 'react';
|
13
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
14
|
+
import { CheckIcon } from '@radix-ui/react-icons';
|
15
|
+
import { cn } from 'utils/utils';
|
16
|
+
import { menubarItemVariants } from './MenubarItem';
|
17
|
+
import { MenubarItemIndicator } from './MenubarItemIndicator';
|
18
|
+
import { menuItemAppearanceStyle } from '../../constants';
|
19
|
+
import { useMenubarContext } from '.';
|
20
|
+
export var MenubarCheckboxItem = forwardRef(function (_a, ref) {
|
21
|
+
var children = _a.children, className = _a.className, checked = _a.checked, props = __rest(_a, ["children", "className", "checked"]);
|
22
|
+
var _b = useMenubarContext(), radius = _b.radius, scaling = _b.scaling, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.itemAppearance, itemAppearance = _d === void 0 ? 'solid' : _d;
|
23
|
+
var itemClassName = cn(menubarItemVariants({ radius: radius, scaling: scaling, size: size }), 'pl-7', menuItemAppearanceStyle(itemAppearance, color), className);
|
24
|
+
return (<MenubarPrimitive.CheckboxItem ref={ref} className={itemClassName} {...props}>
|
25
|
+
<MenubarItemIndicator forceMount radius={'medium'} size={size}>
|
26
|
+
{checked && <CheckIcon />}
|
27
|
+
</MenubarItemIndicator>
|
28
|
+
{children}
|
29
|
+
</MenubarPrimitive.CheckboxItem>);
|
30
|
+
});
|
31
|
+
MenubarCheckboxItem.displayName = 'MenubarCheckboxItem';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
export interface MenubarContentProps extends VariantProps<typeof menubarContentVariants> {
|
5
|
+
}
|
6
|
+
export declare const menubarContentVariants: (props?: ({
|
7
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
8
|
+
size?: "small" | "medium" | null | undefined;
|
9
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
|
+
export declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & MenubarContentProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,63 @@
|
|
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 React, { forwardRef } from 'react';
|
24
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
25
|
+
import { cva } from 'class-variance-authority';
|
26
|
+
import { cn } from 'utils/utils';
|
27
|
+
import { scalingVariants } from '../../constants';
|
28
|
+
import { useMenubarContext } from '.';
|
29
|
+
export var menubarContentVariants = cva("p-[5px] bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
|
30
|
+
variants: {
|
31
|
+
radius: {
|
32
|
+
none: 'rounded-none',
|
33
|
+
small: 'rounded-[3px]',
|
34
|
+
medium: 'rounded',
|
35
|
+
large: 'rounded-md',
|
36
|
+
full: 'rounded-md',
|
37
|
+
},
|
38
|
+
size: {
|
39
|
+
small: 'p-1 min-w-[120px] max-w-[300px]',
|
40
|
+
medium: 'p-2 min-w-[136px] max-w-[300px]',
|
41
|
+
},
|
42
|
+
scaling: __assign({}, scalingVariants),
|
43
|
+
},
|
44
|
+
defaultVariants: {
|
45
|
+
radius: 'medium',
|
46
|
+
size: 'medium',
|
47
|
+
scaling: '100%',
|
48
|
+
},
|
49
|
+
});
|
50
|
+
export var MenubarContent = forwardRef(function (_a, ref) {
|
51
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
52
|
+
var _b = useMenubarContext(), radius = _b.radius, size = _b.size, scaling = _b.scaling;
|
53
|
+
return (<MenubarPrimitive.Portal>
|
54
|
+
<MenubarPrimitive.Content ref={ref} className={cn(menubarContentVariants({
|
55
|
+
radius: radius,
|
56
|
+
size: size,
|
57
|
+
scaling: scaling,
|
58
|
+
}), className)} align="start" sideOffset={5} alignOffset={-3} {...props}>
|
59
|
+
{children}
|
60
|
+
</MenubarPrimitive.Content>
|
61
|
+
</MenubarPrimitive.Portal>);
|
62
|
+
});
|
63
|
+
MenubarContent.displayName = 'MenubarContent';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
export interface MenubarItemProps extends VariantProps<typeof menubarItemVariants> {
|
5
|
+
appearance?: 'solid' | 'ghost';
|
6
|
+
shortcut?: string;
|
7
|
+
}
|
8
|
+
export declare const menubarItemVariants: (props?: ({
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
|
+
size?: "small" | "medium" | null | undefined;
|
11
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
13
|
+
export declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & MenubarItemProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,56 @@
|
|
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 React, { forwardRef } from 'react';
|
24
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
25
|
+
import { cva } from 'class-variance-authority';
|
26
|
+
import { cn } from 'utils/utils';
|
27
|
+
import { blackText, menuItemAppearanceStyle, radiusVariants, scalingVariants, } from '../../constants';
|
28
|
+
import { useMenubarContext } from '.';
|
29
|
+
export var menubarItemVariants = cva("flex group relative leading-none select-none outline-none items-center justify-between font-normal\n data-[disabled]:text-slate-8 data-[disabled]:cursor-not-allowed text-slate-12 dark:text-slateDark-12\n data-[disabled]:hover:bg-transparent dark:data-[disabled]:text-slateDark-8 data-[disabled]:dark:hover:bg-transparent", {
|
30
|
+
variants: {
|
31
|
+
radius: __assign({}, radiusVariants['menu-item']),
|
32
|
+
size: {
|
33
|
+
small: 'text-xs h-[24px] px-2',
|
34
|
+
medium: 'text-sm h-[32px] px-3',
|
35
|
+
},
|
36
|
+
scaling: __assign({}, scalingVariants),
|
37
|
+
},
|
38
|
+
defaultVariants: {
|
39
|
+
radius: 'medium',
|
40
|
+
scaling: '100%',
|
41
|
+
size: 'medium',
|
42
|
+
},
|
43
|
+
});
|
44
|
+
export var MenubarItem = forwardRef(function (_a, ref) {
|
45
|
+
var children = _a.children, className = _a.className, shortcut = _a.shortcut, props = __rest(_a, ["children", "className", "shortcut"]);
|
46
|
+
var _b = useMenubarContext(), radius = _b.radius, scaling = _b.scaling, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.itemAppearance, itemAppearance = _d === void 0 ? 'solid' : _d;
|
47
|
+
var itemClassName = cn(menubarItemVariants({ radius: radius, scaling: scaling, size: size }), menuItemAppearanceStyle(itemAppearance, color), className);
|
48
|
+
var shortcutClassName = "text-slateA-11 dark:text-slateDarkA-11 ".concat(itemAppearance === 'solid' && !blackText.includes(color)
|
49
|
+
? 'group-hover:text-white dark:group-hover:text-slateDark-1'
|
50
|
+
: '');
|
51
|
+
return (<MenubarPrimitive.Item ref={ref} className={itemClassName} {...props}>
|
52
|
+
{children}
|
53
|
+
{shortcut && <span className={shortcutClassName}>{shortcut}</span>}
|
54
|
+
</MenubarPrimitive.Item>);
|
55
|
+
});
|
56
|
+
MenubarItem.displayName = 'MenubarItem';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
export interface MenubarItemIndicatorProps extends VariantProps<typeof menubarItemIndicatorVariants> {
|
5
|
+
}
|
6
|
+
export declare const menubarItemIndicatorVariants: (props?: ({
|
7
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
8
|
+
size?: "small" | "medium" | null | undefined;
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
10
|
+
export declare const MenubarItemIndicator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemIndicatorProps & React.RefAttributes<HTMLSpanElement>, "ref"> & MenubarItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|