@lotte-innovate/ui-component-test 0.1.66 → 0.1.67
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +133 -133
- package/dist/globals.css +4 -4
- package/dist/lib/Typography/Header/index.d.ts +1 -1
- package/dist/lib/Typography/Text/index.d.ts +1 -1
- package/dist/lib/components/Accordion/index.d.ts +1 -0
- package/dist/lib/components/Accordion/index.js +18 -4
- package/dist/lib/components/Accordion/index.mjs +1 -1
- package/dist/lib/components/Accordion/index.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogAction.d.ts +2 -2
- package/dist/lib/components/AlertDialog/AlertDialogCancel.d.ts +2 -2
- package/dist/lib/components/AlertDialog/AlertDialogContent.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js +9 -6
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs +2 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.d.ts +2 -2
- package/dist/lib/components/AspectRatio/index.js +3 -1
- package/dist/lib/components/AspectRatio/index.mjs +1 -1
- package/dist/lib/components/AspectRatio/index.mjs.map +1 -1
- package/dist/lib/components/Avatar/index.d.ts +1 -1
- package/dist/lib/components/Avatar/index.js +9 -1
- package/dist/lib/components/Avatar/index.mjs +2 -1
- package/dist/lib/components/Avatar/index.mjs.map +1 -1
- package/dist/lib/components/Badge/index.d.ts +2 -2
- package/dist/lib/components/Badge/index.js +10 -1
- package/dist/lib/components/Badge/index.mjs +1 -1
- package/dist/lib/components/Badge/index.mjs.map +1 -1
- package/dist/lib/components/Button/index.d.ts +2 -2
- package/dist/lib/components/Button/index.js +10 -1
- package/dist/lib/components/Button/index.mjs +1 -1
- package/dist/lib/components/Button/index.mjs.map +1 -1
- package/dist/lib/components/Callout/CalloutRoot.d.ts +1 -1
- package/dist/lib/components/Callout/CalloutRoot.js +11 -3
- package/dist/lib/components/Callout/CalloutRoot.mjs +2 -1
- package/dist/lib/components/Callout/CalloutRoot.mjs.map +1 -1
- package/dist/lib/components/Card/index.d.ts +2 -2
- package/dist/lib/components/Card/index.js +8 -1
- package/dist/lib/components/Card/index.mjs +1 -1
- package/dist/lib/components/Card/index.mjs.map +1 -1
- package/dist/lib/components/Checkbox/index.d.ts +1 -1
- package/dist/lib/components/Checkbox/index.js +10 -2
- package/dist/lib/components/Checkbox/index.mjs +1 -1
- package/dist/lib/components/Checkbox/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxCard/index.d.ts +1 -1
- package/dist/lib/components/CheckboxCard/index.js +8 -1
- package/dist/lib/components/CheckboxCard/index.mjs +1 -1
- package/dist/lib/components/CheckboxCard/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +11 -2
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs +2 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuContent.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js +11 -2
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs +2 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.d.ts +1 -1
- package/dist/lib/components/DataList/DataListLabel.d.ts +1 -1
- package/dist/lib/components/DataList/DataListRoot.js +9 -2
- package/dist/lib/components/DataList/DataListRoot.mjs +2 -1
- package/dist/lib/components/DataList/DataListRoot.mjs.map +1 -1
- package/dist/lib/components/DataList/DataListValue.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogAction.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogCancel.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogContent.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogRoot.js +9 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs +2 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +10 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs +2 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +1 -1
- package/dist/lib/components/HoverCard/HoverCardContent.d.ts +2 -2
- package/dist/lib/components/HoverCard/HoverCardRoot.js +10 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs +2 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs.map +1 -1
- package/dist/lib/components/IconButton/index.d.ts +1 -1
- package/dist/lib/components/IconButton/index.js +9 -1
- package/dist/lib/components/IconButton/index.mjs +1 -1
- package/dist/lib/components/IconButton/index.mjs.map +1 -1
- package/dist/lib/components/Inset/index.d.ts +1 -1
- package/dist/lib/components/Inset/index.js +7 -1
- package/dist/lib/components/Inset/index.mjs +1 -1
- package/dist/lib/components/Inset/index.mjs.map +1 -1
- package/dist/lib/components/Label/index.d.ts +1 -1
- package/dist/lib/components/Label/index.js +11 -3
- package/dist/lib/components/Label/index.mjs +1 -1
- package/dist/lib/components/Label/index.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarContent.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarItem.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarItemIndicator.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -0
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs +1 -0
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.js +13 -3
- package/dist/lib/components/Menubar/MenubarRoot.mjs +2 -1
- package/dist/lib/components/Menubar/MenubarRoot.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +11 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs +2 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.d.ts +2 -2
- package/dist/lib/components/Popover/PopoverClose.d.ts +1 -1
- package/dist/lib/components/Popover/PopoverContent.d.ts +1 -1
- package/dist/lib/components/Popover/PopoverRoot.js +8 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs +2 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs.map +1 -1
- package/dist/lib/components/Progress/index.d.ts +1 -1
- package/dist/lib/components/Progress/index.js +11 -1
- package/dist/lib/components/Progress/index.mjs +1 -1
- package/dist/lib/components/Progress/index.mjs.map +1 -1
- package/dist/lib/components/Radio/index.js +10 -4
- package/dist/lib/components/Radio/index.mjs +1 -1
- package/dist/lib/components/Radio/index.mjs.map +1 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.d.ts +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.js +12 -2
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs +2 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs.map +1 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js +11 -2
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs +2 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ScrollArea/index.js +3 -1
- package/dist/lib/components/ScrollArea/index.mjs +1 -1
- package/dist/lib/components/ScrollArea/index.mjs.map +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +7 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs.map +1 -1
- package/dist/lib/components/Select/index.d.ts +4 -2
- package/dist/lib/components/Select/index.js +30 -13
- package/dist/lib/components/Select/index.mjs +1 -1
- package/dist/lib/components/Select/index.mjs.map +1 -1
- package/dist/lib/components/Separator/index.js +7 -1
- package/dist/lib/components/Separator/index.mjs +1 -1
- package/dist/lib/components/Separator/index.mjs.map +1 -1
- package/dist/lib/components/Skeleton/index.d.ts +1 -1
- package/dist/lib/components/Skeleton/index.js +4 -1
- package/dist/lib/components/Skeleton/index.mjs +1 -1
- package/dist/lib/components/Skeleton/index.mjs.map +1 -1
- package/dist/lib/components/Slider/index.d.ts +1 -1
- package/dist/lib/components/Slider/index.js +13 -5
- package/dist/lib/components/Slider/index.mjs +1 -1
- package/dist/lib/components/Slider/index.mjs.map +1 -1
- package/dist/lib/components/Spinner/index.js +3 -1
- package/dist/lib/components/Spinner/index.mjs +1 -1
- package/dist/lib/components/Spinner/index.mjs.map +1 -1
- package/dist/lib/components/TabNav/index.js +6 -4
- package/dist/lib/components/TabNav/index.mjs +1 -1
- package/dist/lib/components/TabNav/index.mjs.map +1 -1
- package/dist/lib/components/Table/index.d.ts +1 -1
- package/dist/lib/components/Table/index.js +7 -1
- package/dist/lib/components/Table/index.mjs +1 -1
- package/dist/lib/components/Table/index.mjs.map +1 -1
- package/dist/lib/components/Tabs/index.d.ts +1 -1
- package/dist/lib/components/Tabs/index.js +4 -4
- package/dist/lib/components/Tabs/index.mjs +1 -1
- package/dist/lib/components/Tabs/index.mjs.map +1 -1
- package/dist/lib/components/TextArea/index.d.ts +1 -1
- package/dist/lib/components/TextArea/index.js +11 -4
- package/dist/lib/components/TextArea/index.mjs +1 -1
- package/dist/lib/components/TextArea/index.mjs.map +1 -1
- package/dist/lib/components/TextField/index.d.ts +1 -1
- package/dist/lib/components/TextField/index.js +11 -4
- package/dist/lib/components/TextField/index.mjs +1 -1
- package/dist/lib/components/TextField/index.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastActionButton.d.ts +1 -1
- package/dist/lib/components/Toast/ToastActionButton.js +2 -2
- package/dist/lib/components/Toast/ToastActionButton.mjs +1 -1
- package/dist/lib/components/Toast/ToastActionButton.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastRoot.d.ts +1 -1
- package/dist/lib/components/Toast/ToastRoot.js +11 -3
- package/dist/lib/components/Toast/ToastRoot.mjs +2 -1
- package/dist/lib/components/Toast/ToastRoot.mjs.map +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.js +9 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs.map +1 -1
- package/dist/lib/components/Toggle/index.d.ts +1 -1
- package/dist/lib/components/Toggle/index.js +9 -1
- package/dist/lib/components/Toggle/index.mjs +1 -1
- package/dist/lib/components/Toggle/index.mjs.map +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +10 -2
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs +2 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ToggleSwitch/index.d.ts +1 -1
- package/dist/lib/components/ToggleSwitch/index.js +13 -1
- package/dist/lib/components/ToggleSwitch/index.mjs +1 -1
- package/dist/lib/components/ToggleSwitch/index.mjs.map +1 -1
- package/dist/lib/components/Tooltip/index.d.ts +2 -2
- package/dist/lib/components/Tooltip/index.js +13 -8
- package/dist/lib/components/Tooltip/index.mjs +1 -1
- package/dist/lib/components/Tooltip/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/theme/ThemeProvider.d.ts +16 -0
- package/dist/lib/theme/ThemeProvider.js +29 -0
- package/dist/lib/theme/ThemeProvider.mjs +3 -0
- package/dist/lib/theme/ThemeProvider.mjs.map +1 -0
- package/dist/lib/theme/index.d.ts +2 -0
- package/dist/lib/theme/index.js +2 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/utils/useDarkMode.js +1 -0
- package/dist/lib/utils/useDarkMode.mjs +1 -0
- package/dist/lib/utils/useDarkMode.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +141 -141
- package/dist/.storybook/main.d.ts +0 -3
- package/dist/.storybook/main.js +0 -22
- package/dist/.storybook/manager.d.ts +0 -1
- package/dist/.storybook/manager.js +0 -12
- package/dist/.storybook/preview.d.ts +0 -8
- package/dist/.storybook/preview.js +0 -81
@@ -5,7 +5,7 @@ export interface HeaderProps extends VariantProps<typeof headerVariants> {
|
|
5
5
|
color?: IColor;
|
6
6
|
}
|
7
7
|
declare let headerVariants: (props?: ({
|
8
|
-
weight?: "
|
8
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
9
9
|
headers?: "h2" | "h3" | "h1" | "h4" | "h5" | "h6" | null | undefined;
|
10
10
|
color?: string | null | undefined;
|
11
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
@@ -8,7 +8,7 @@ export interface TextProps extends VariantProps<typeof textVariants> {
|
|
8
8
|
align?: 'left' | 'center' | 'right';
|
9
9
|
}
|
10
10
|
declare const textVariants: (props?: ({
|
11
|
-
weight?: "
|
11
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | "light" | null | undefined;
|
12
12
|
color?: string | null | undefined;
|
13
13
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
14
14
|
export declare const Text: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & TextProps & React.RefAttributes<HTMLSpanElement>>;
|
@@ -8,6 +8,7 @@ export interface AccordionProps extends React.InputHTMLAttributes<HTMLInputEleme
|
|
8
8
|
declare const accoridanVariants: (props?: ({
|
9
9
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
10
10
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
|
+
export declare const useAccordionContext: () => AccordionProps;
|
11
12
|
export declare const Root: React.ForwardRefExoticComponent<((Omit<AccordionPrimitive.AccordionSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<AccordionPrimitive.AccordionMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & AccordionProps) & React.RefAttributes<HTMLDivElement>>;
|
12
13
|
export declare const Item: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
13
14
|
export declare const Trigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & AccordionProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -21,12 +21,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import React from 'react';
|
24
|
+
import React, { createContext, useContext } from 'react';
|
25
25
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
26
26
|
import { ChevronDownIcon } from '@radix-ui/react-icons';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { cva } from 'class-variance-authority';
|
29
29
|
import { scalingVariants } from '../../../lib/constants';
|
30
|
+
import { useTheme } from '../../../lib/theme';
|
30
31
|
var accoridanVariants = cva('', {
|
31
32
|
variants: {
|
32
33
|
scaling: __assign({}, scalingVariants),
|
@@ -35,9 +36,21 @@ var accoridanVariants = cva('', {
|
|
35
36
|
scaling: '100%',
|
36
37
|
},
|
37
38
|
});
|
39
|
+
var AccordionContext = createContext({
|
40
|
+
scaling: '100%',
|
41
|
+
color: 'red',
|
42
|
+
});
|
43
|
+
export var useAccordionContext = function () {
|
44
|
+
return useContext(AccordionContext);
|
45
|
+
};
|
38
46
|
export var Root = React.forwardRef(function (_a, forwardedRef) {
|
39
|
-
var className = _a.className, children = _a.children, scaling = _a.scaling, rootProps = __rest(_a, ["className", "children", "scaling"]);
|
40
|
-
|
47
|
+
var className = _a.className, children = _a.children, scaling = _a.scaling, _b = _a.color, color = _b === void 0 ? 'red' : _b, rootProps = __rest(_a, ["className", "children", "scaling", "color"]);
|
48
|
+
var theme = useTheme().theme;
|
49
|
+
var contextValue = {
|
50
|
+
scaling: theme.themeScaling || scaling,
|
51
|
+
color: theme.themeColor || color,
|
52
|
+
};
|
53
|
+
return (_jsx(AccordionContext.Provider, { value: contextValue, children: _jsx(AccordionPrimitive.Root, __assign({ className: cn('w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4', accoridanVariants({ scaling: contextValue.scaling }), className) }, rootProps, { ref: forwardedRef, children: children })) }));
|
41
54
|
});
|
42
55
|
Root.displayName = 'Accordion.Root';
|
43
56
|
export var Item = React.forwardRef(function (_a, forwardedRef) {
|
@@ -46,7 +59,8 @@ export var Item = React.forwardRef(function (_a, forwardedRef) {
|
|
46
59
|
});
|
47
60
|
Item.displayName = 'Accordion.Item';
|
48
61
|
export var Trigger = React.forwardRef(function (_a, forwardedRef) {
|
49
|
-
var className = _a.className, children = _a.children,
|
62
|
+
var className = _a.className, children = _a.children, rootProps = __rest(_a, ["className", "children"]);
|
63
|
+
var color = useAccordionContext().color;
|
50
64
|
return (_jsx(AccordionPrimitive.Header, __assign({}, rootProps, { className: cn('flex', className), children: _jsxs(AccordionPrimitive.Trigger, __assign({}, rootProps, { ref: forwardedRef, className: cn("group flex h-[44px] w-[278px] cursor-default items-center justify-between px-[20px] py-[10px] text-base font-normal", "dark:bg-[#111113] text-".concat(color, "A-11 dark:text-").concat(color, "Dark-11 "), "hover:bg-".concat(color, "A-4 dark:hover:bg-").concat(color, "Dark-4 hover:text-").concat(color, "A-11 dark:hover:text-").concat(color, "DarkA-11"), "data-[state=open]:bg-".concat(color, "A-5 dark:data-[state=open]:bg-").concat(color, "DarkA-5"), "disabled:bg-slateA-3 disabled:text-slateA-8 disabled:dark:bg-slateDarkA-3 disabled:dark:text-slateDarkA-8", className), children: [children, _jsx(ChevronDownIcon, { className: "transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:rotate-180", "aria-hidden": true })] })) })));
|
51
65
|
});
|
52
66
|
Trigger.displayName = 'Accordion.Trigger';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r,jsxs as
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import a,{createContext as t,useContext as o}from"react";import*as n from"@radix-ui/react-accordion";import{ChevronDownIcon as c}from"@radix-ui/react-icons";import{cn as s}from"../../utils/utils.mjs";import{cva as i}from"class-variance-authority";import{scalingVariants as l}from"../../constants.mjs";import{useTheme as d}from"../../theme/ThemeProvider.mjs";var m=function(){return m=Object.assign||function(r){for(var e,a=1,t=arguments.length;a<t;a++)for(var o in e=arguments[a])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},m.apply(this,arguments)},p=function(r,e){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(r);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(r,t[o])&&(a[t[o]]=r[t[o]])}return a},f=i("",{variants:{scaling:m({},l)},defaultVariants:{scaling:"100%"}}),u=t({scaling:"100%",color:"red"}),h=function(){return o(u)},x=a.forwardRef((function(e,a){var t=e.className,o=e.children,c=e.scaling,i=e.color,l=void 0===i?"red":i,h=p(e,["className","children","scaling","color"]),x=d().theme,b={scaling:x.themeScaling||c,color:x.themeColor||l};return r(u.Provider,{value:b,children:r(n.Root,m({className:s("w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4",f({scaling:b.scaling}),t)},h,{ref:a,children:o}))})}));x.displayName="Accordion.Root";var b=a.forwardRef((function(e,a){var t=e.className,o=e.children,c=p(e,["className","children"]);return r(n.Item,m({},c,{ref:a,className:s("mt-px w-[278px] overflow-hidden first:mt-0 first:rounded-t last:rounded-b",t),children:o}))}));b.displayName="Accordion.Item";var g=a.forwardRef((function(a,t){var o=a.className,i=a.children,l=p(a,["className","children"]),d=h().color;return r(n.Header,m({},l,{className:s("flex",o),children:e(n.Trigger,m({},l,{ref:t,className:s("group flex h-[44px] w-[278px] cursor-default items-center justify-between px-[20px] py-[10px] text-base font-normal","dark:bg-[#111113] text-".concat(d,"A-11 dark:text-").concat(d,"Dark-11 "),"hover:bg-".concat(d,"A-4 dark:hover:bg-").concat(d,"Dark-4 hover:text-").concat(d,"A-11 dark:hover:text-").concat(d,"DarkA-11"),"data-[state=open]:bg-".concat(d,"A-5 dark:data-[state=open]:bg-").concat(d,"DarkA-5"),"disabled:bg-slateA-3 disabled:text-slateA-8 disabled:dark:bg-slateDarkA-3 disabled:dark:text-slateDarkA-8",o),children:[i,r(c,{className:"transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:rotate-180","aria-hidden":!0})]}))}))}));g.displayName="Accordion.Trigger";var v=a.forwardRef((function(e,a){var t=e.className,o=e.children,c=p(e,["className","children"]);return r(n.Content,m({},c,{ref:a,className:s("max-h-[800px] w-[278px] overflow-hidden border-t border-t-slateA-4 bg-slateA-2 text-[16px] text-slateA-11 data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown dark:border-t-slateDarkA-4 dark:bg-slateDarkA-2 dark:text-slateDarkA-11",t),children:r("div",{className:"h-auto max-h-[1000px] overflow-y-auto px-[20px] py-[15px] text-base font-normal",children:o})}))}));v.displayName="Accordion.Content";var A={Root:x,Item:b,Trigger:g,Content:v};export{v as Content,b as Item,x as Root,g as Trigger,A as default,h as useAccordionContext};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Accordion/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDownIcon } from '@radix-ui/react-icons';\nimport { cn } from '../../../lib/utils/utils';\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nvar accoridanVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, scaling = _a.scaling, rootProps = __rest(_a, [\"className\", \"children\", \"scaling\"]);\n return (_jsx(AccordionPrimitive.Root, __assign({ className: cn('w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4', accoridanVariants({ scaling: scaling }), className) }, rootProps, { ref: forwardedRef, children: children })));\n});\nRoot.displayName = 'Accordion.Root';\nexport var Item = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, rootProps = __rest(_a, [\"className\", \"children\"]);\n return (_jsx(AccordionPrimitive.Item, __assign({}, rootProps, { ref: forwardedRef, className: cn('mt-px w-[278px] overflow-hidden first:mt-0 first:rounded-t last:rounded-b', className), children: children })));\n});\nItem.displayName = 'Accordion.Item';\nexport var Trigger = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children,
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Accordion/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { createContext, useContext } from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDownIcon } from '@radix-ui/react-icons';\nimport { cn } from '../../../lib/utils/utils';\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar accoridanVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nvar AccordionContext = createContext({\n scaling: '100%',\n color: 'red',\n});\nexport var useAccordionContext = function () {\n return useContext(AccordionContext);\n};\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, scaling = _a.scaling, _b = _a.color, color = _b === void 0 ? 'red' : _b, rootProps = __rest(_a, [\"className\", \"children\", \"scaling\", \"color\"]);\n var theme = useTheme().theme;\n var contextValue = {\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n };\n return (_jsx(AccordionContext.Provider, { value: contextValue, children: _jsx(AccordionPrimitive.Root, __assign({ className: cn('w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4', accoridanVariants({ scaling: contextValue.scaling }), className) }, rootProps, { ref: forwardedRef, children: children })) }));\n});\nRoot.displayName = 'Accordion.Root';\nexport var Item = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, rootProps = __rest(_a, [\"className\", \"children\"]);\n return (_jsx(AccordionPrimitive.Item, __assign({}, rootProps, { ref: forwardedRef, className: cn('mt-px w-[278px] overflow-hidden first:mt-0 first:rounded-t last:rounded-b', className), children: children })));\n});\nItem.displayName = 'Accordion.Item';\nexport var Trigger = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, rootProps = __rest(_a, [\"className\", \"children\"]);\n var color = useAccordionContext().color;\n return (_jsx(AccordionPrimitive.Header, __assign({}, rootProps, { className: cn('flex', className), children: _jsxs(AccordionPrimitive.Trigger, __assign({}, rootProps, { ref: forwardedRef, className: cn(\"group flex h-[44px] w-[278px] cursor-default items-center justify-between px-[20px] py-[10px] text-base font-normal\", \"dark:bg-[#111113] text-\".concat(color, \"A-11 dark:text-\").concat(color, \"Dark-11 \"), \"hover:bg-\".concat(color, \"A-4 dark:hover:bg-\").concat(color, \"Dark-4 hover:text-\").concat(color, \"A-11 dark:hover:text-\").concat(color, \"DarkA-11\"), \"data-[state=open]:bg-\".concat(color, \"A-5 dark:data-[state=open]:bg-\").concat(color, \"DarkA-5\"), \"disabled:bg-slateA-3 disabled:text-slateA-8 disabled:dark:bg-slateDarkA-3 disabled:dark:text-slateDarkA-8\", className), children: [children, _jsx(ChevronDownIcon, { className: \"transition-transform duration-300 ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:rotate-180\", \"aria-hidden\": true })] })) })));\n});\nTrigger.displayName = 'Accordion.Trigger';\nexport var Content = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, rootProps = __rest(_a, [\"className\", \"children\"]);\n return (_jsx(AccordionPrimitive.Content, __assign({}, rootProps, { ref: forwardedRef, className: cn('max-h-[800px] w-[278px] overflow-hidden border-t border-t-slateA-4 bg-slateA-2 text-[16px] text-slateA-11 data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown dark:border-t-slateDarkA-4 dark:bg-slateDarkA-2 dark:text-slateDarkA-11', className), children: _jsx(\"div\", { className: \"h-auto max-h-[1000px] overflow-y-auto px-[20px] py-[15px] text-base font-normal\", children: children }) })));\n});\nContent.displayName = 'Accordion.Content';\nvar Accordion = {\n Root: Root,\n Item: Item,\n Trigger: Trigger,\n Content: Content,\n};\nexport default Accordion;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","accoridanVariants","cva","variants","scaling","scalingVariants","defaultVariants","AccordionContext","createContext","color","useAccordionContext","useContext","Root","React","forwardRef","_a","forwardedRef","className","children","_b","rootProps","theme","useTheme","contextValue","themeScaling","themeColor","_jsx","Provider","value","AccordionPrimitive","cn","ref","displayName","Item","Trigger","Header","_jsxs","concat","ChevronDownIcon","Content","Accordion"],"mappings":"wZAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EASIiB,EAAoBC,EAAI,GAAI,CAC5BC,SAAU,CACNC,QAASvB,EAAS,CAAE,EAAEwB,IAE1BC,gBAAiB,CACbF,QAAS,UAGbG,EAAmBC,EAAc,CACjCJ,QAAS,OACTK,MAAO,QAEAC,EAAsB,WAC7B,OAAOC,EAAWJ,EACtB,EACWK,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUd,EAAUW,EAAGX,QAASe,EAAKJ,EAAGN,MAAOA,OAAe,IAAPU,EAAgB,MAAQA,EAAIC,EAAYxB,EAAOmB,EAAI,CAAC,YAAa,WAAY,UAAW,UACvLM,EAAQC,IAAWD,MACnBE,EAAe,CACfnB,QAASiB,EAAMG,cAAgBpB,EAC/BK,MAAOY,EAAMI,YAAchB,GAE/B,OAAQiB,EAAKnB,EAAiBoB,SAAU,CAAEC,MAAOL,EAAcL,SAAUQ,EAAKG,EAAmBjB,KAAM/B,EAAS,CAAEoC,UAAWa,EAAG,uEAAwE7B,EAAkB,CAAEG,QAASmB,EAAanB,UAAYa,IAAcG,EAAW,CAAEW,IAAKf,EAAcE,SAAUA,MAC1T,IACAN,EAAKoB,YAAc,iBACT,IAACC,EAAOpB,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUE,EAAYxB,EAAOmB,EAAI,CAAC,YAAa,aAC3F,OAAQW,EAAKG,EAAmBI,KAAMpD,EAAS,CAAE,EAAEuC,EAAW,CAAEW,IAAKf,EAAcC,UAAWa,EAAG,4EAA6Eb,GAAYC,SAAUA,IACxM,IACAe,EAAKD,YAAc,iBACT,IAACE,EAAUrB,EAAMC,YAAW,SAAUC,EAAIC,GAChD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUE,EAAYxB,EAAOmB,EAAI,CAAC,YAAa,aACvFN,EAAQC,IAAsBD,MAClC,OAAQiB,EAAKG,EAAmBM,OAAQtD,EAAS,CAAE,EAAEuC,EAAW,CAAEH,UAAWa,EAAG,OAAQb,GAAYC,SAAUkB,EAAMP,EAAmBK,QAASrD,EAAS,CAAA,EAAIuC,EAAW,CAAEW,IAAKf,EAAcC,UAAWa,EAAG,sHAAuH,0BAA0BO,OAAO5B,EAAO,mBAAmB4B,OAAO5B,EAAO,YAAa,YAAY4B,OAAO5B,EAAO,sBAAsB4B,OAAO5B,EAAO,sBAAsB4B,OAAO5B,EAAO,yBAAyB4B,OAAO5B,EAAO,YAAa,wBAAwB4B,OAAO5B,EAAO,kCAAkC4B,OAAO5B,EAAO,WAAY,4GAA6GQ,GAAYC,SAAU,CAACA,EAAUQ,EAAKY,EAAiB,CAAErB,UAAW,6GAA8G,eAAe,UACl8B,IACAiB,EAAQF,YAAc,oBACZ,IAACO,EAAU1B,EAAMC,YAAW,SAAUC,EAAIC,GAChD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUE,EAAYxB,EAAOmB,EAAI,CAAC,YAAa,aAC3F,OAAQW,EAAKG,EAAmBU,QAAS1D,EAAS,CAAA,EAAIuC,EAAW,CAAEW,IAAKf,EAAcC,UAAWa,EAAG,4PAA6Pb,GAAYC,SAAUQ,EAAK,MAAO,CAAET,UAAW,kFAAmFC,SAAUA,MACjf,IACAqB,EAAQP,YAAc,oBACnB,IAACQ,EAAY,CACZ5B,KAAMA,EACNqB,KAAMA,EACNC,QAASA,EACTK,QAASA"}
|
@@ -6,9 +6,9 @@ export interface AlertDialogActionProps extends VariantProps<typeof alertDialogA
|
|
6
6
|
appearance?: IAppearance;
|
7
7
|
}
|
8
8
|
export declare const alertDialogActionVariants: (props?: ({
|
9
|
-
radius?: "
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
10
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
11
|
-
weight?: "
|
11
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
12
12
|
color?: string | null | undefined;
|
13
13
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
14
14
|
export declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -6,8 +6,8 @@ export interface AlertDialogCancelProps extends VariantProps<typeof alertDialogC
|
|
6
6
|
appearance?: IAppearance;
|
7
7
|
}
|
8
8
|
export declare const alertDialogCancelVariants: (props?: ({
|
9
|
-
radius?: "
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
10
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
11
|
-
weight?: "
|
11
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
12
12
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
13
13
|
export declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -6,6 +6,6 @@ export interface AlertDialogContentProps extends VariantProps<typeof alertDialog
|
|
6
6
|
export declare const alertDialogContentVariants: (props?: ({
|
7
7
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
8
8
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
9
|
-
radius?: "
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
10
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
11
|
export declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
'use client';
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
2
3
|
__assign = Object.assign || function(t) {
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -21,8 +22,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
22
|
return t;
|
22
23
|
};
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef, createContext, useContext,
|
25
|
+
import { forwardRef, createContext, useContext, } from 'react';
|
25
26
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
27
|
+
import { useTheme } from '../../../lib/theme';
|
26
28
|
var AlertDialogContext = createContext({
|
27
29
|
size: 'medium',
|
28
30
|
scaling: '100%',
|
@@ -35,12 +37,13 @@ export var useAlertDialogContext = function () {
|
|
35
37
|
};
|
36
38
|
export var AlertDialogRoot = forwardRef(function (_a, ref) {
|
37
39
|
var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, props = __rest(_a, ["children", "radius", "size", "scaling", "color"]);
|
38
|
-
var
|
39
|
-
|
40
|
+
var theme = useTheme().theme;
|
41
|
+
var contextValue = {
|
42
|
+
radius: theme.themeRadius || radius,
|
43
|
+
scaling: theme.themeScaling || scaling,
|
44
|
+
color: theme.themeColor || color,
|
40
45
|
size: size,
|
41
|
-
|
42
|
-
color: color,
|
43
|
-
}); }, [radius, size, scaling, color]);
|
46
|
+
};
|
44
47
|
return (_jsx(AlertDialogContext.Provider, { value: contextValue, children: _jsx("div", { ref: ref, children: _jsx(AlertDialogPrimitive.Root, __assign({}, props, { children: children })) }) }));
|
45
48
|
});
|
46
49
|
AlertDialogRoot.displayName = 'AlertDialog.Root';
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
"use client";
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as e,forwardRef as o,useContext as t}from"react";import*as i from"@radix-ui/react-alert-dialog";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var a=function(){return a=Object.assign||function(r){for(var e,o=1,t=arguments.length;o<t;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},a.apply(this,arguments)},l=function(r,e){var o={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(o[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(r);i<t.length;i++)e.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(r,t[i])&&(o[t[i]]=r[t[i]])}return o},c=e({size:"medium",scaling:"100%",color:"red",radius:"medium",appearance:"solid"}),s=function(){return t(c)},m=o((function(e,o){var t=e.children,s=e.radius,m=e.size,p=e.scaling,u=e.color,d=l(e,["children","radius","size","scaling","color"]),f=n().theme,h={radius:f.themeRadius||s,scaling:f.themeScaling||p,color:f.themeColor||u,size:m};return r(c.Provider,{value:h,children:r("div",{ref:o,children:r(i.Root,a({},d,{children:t}))})})}));m.displayName="AlertDialog.Root";export{m as AlertDialogRoot,s as useAlertDialogContext};
|
2
3
|
//# sourceMappingURL=AlertDialogRoot.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AlertDialogRoot.mjs","sources":[
|
1
|
+
{"version":3,"file":"AlertDialogRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -7,10 +7,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
7
7
|
appearance?: IAppearance;
|
8
8
|
}
|
9
9
|
declare const buttonVariants: (props?: ({
|
10
|
-
radius?: "
|
10
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
11
11
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
12
12
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
13
|
-
weight?: "
|
13
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
14
14
|
color?: string | null | undefined;
|
15
15
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
16
16
|
export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -26,6 +26,7 @@ import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { scalingVariants } from '../../../lib/constants';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
export var aspectRatioVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
scaling: __assign({}, scalingVariants),
|
@@ -36,7 +37,8 @@ export var aspectRatioVariants = cva('', {
|
|
36
37
|
});
|
37
38
|
var AspectRatio = forwardRef(function (_a, ref) {
|
38
39
|
var children = _a.children, className = _a.className, _b = _a.ratio, ratio = _b === void 0 ? 16 / 9 : _b, scaling = _a.scaling, props = __rest(_a, ["children", "className", "ratio", "scaling"]);
|
39
|
-
|
40
|
+
var theme = useTheme().theme;
|
41
|
+
return (_jsx(AspectRatioPrimitive.Root, __assign({ ratio: ratio, ref: ref }, props, { className: cn(aspectRatioVariants({ scaling: theme.themeScaling || scaling }), className), children: children })));
|
40
42
|
});
|
41
43
|
AspectRatio.displayName = 'AspectRatio';
|
42
44
|
export default AspectRatio;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import*as
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import*as e from"@radix-ui/react-aspect-ratio";import{cva as a}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{scalingVariants as i}from"../../constants.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var s=function(){return s=Object.assign||function(r){for(var t,e=1,a=arguments.length;e<a;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},s.apply(this,arguments)},c=function(r,t){var e={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&t.indexOf(a)<0&&(e[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(r);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(e[a[o]]=r[a[o]])}return e},l=a("",{variants:{scaling:s({},i)},defaultVariants:{scaling:"100%"}}),m=t((function(t,a){var i=t.children,m=t.className,p=t.ratio,f=void 0===p?16/9:p,u=t.scaling,y=c(t,["children","className","ratio","scaling"]),h=n().theme;return r(e.Root,s({ratio:f,ref:a},y,{className:o(l({scaling:h.themeScaling||u}),m),children:i}))}));m.displayName="AspectRatio";export{l as aspectRatioVariants,m as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/AspectRatio/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { scalingVariants } from '../../../lib/constants';\nexport var aspectRatioVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nvar AspectRatio = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, _b = _a.ratio, ratio = _b === void 0 ? 16 / 9 : _b, scaling = _a.scaling, props = __rest(_a, [\"children\", \"className\", \"ratio\", \"scaling\"]);\n return (_jsx(AspectRatioPrimitive.Root, __assign({ ratio: ratio, ref: ref }, props, { className: cn(aspectRatioVariants({ scaling: scaling }), className), children: children })));\n});\nAspectRatio.displayName = 'AspectRatio';\nexport default AspectRatio;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","aspectRatioVariants","cva","variants","scaling","scalingVariants","defaultVariants","AspectRatio","forwardRef","_a","ref","children","className","_b","ratio","props","_jsx","AspectRatioPrimitive","Root","cn","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/AspectRatio/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { scalingVariants } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nexport var aspectRatioVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nvar AspectRatio = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, _b = _a.ratio, ratio = _b === void 0 ? 16 / 9 : _b, scaling = _a.scaling, props = __rest(_a, [\"children\", \"className\", \"ratio\", \"scaling\"]);\n var theme = useTheme().theme;\n return (_jsx(AspectRatioPrimitive.Root, __assign({ ratio: ratio, ref: ref }, props, { className: cn(aspectRatioVariants({ scaling: theme.themeScaling || scaling }), className), children: children })));\n});\nAspectRatio.displayName = 'AspectRatio';\nexport default AspectRatio;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","aspectRatioVariants","cva","variants","scaling","scalingVariants","defaultVariants","AspectRatio","forwardRef","_a","ref","children","className","_b","ratio","props","theme","useTheme","_jsx","AspectRatioPrimitive","Root","cn","themeScaling","displayName"],"mappings":"mUAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAQWiB,EAAsBC,EAAI,GAAI,CACrCC,SAAU,CACNC,QAASvB,EAAS,CAAE,EAAEwB,IAE1BC,gBAAiB,CACbF,QAAS,UAGbG,EAAcC,GAAW,SAAUC,EAAIC,GACvC,IAAIC,EAAWF,EAAGE,SAAUC,EAAYH,EAAGG,UAAWC,EAAKJ,EAAGK,MAAOA,OAAe,IAAPD,EAAgB,GAAK,EAAIA,EAAIT,EAAUK,EAAGL,QAASW,EAAQnB,EAAOa,EAAI,CAAC,WAAY,YAAa,QAAS,YAClLO,EAAQC,IAAWD,MACvB,OAAQE,EAAKC,EAAqBC,KAAMvC,EAAS,CAAEiC,MAAOA,EAAOJ,IAAKA,GAAOK,EAAO,CAAEH,UAAWS,EAAGpB,EAAoB,CAAEG,QAASY,EAAMM,cAAgBlB,IAAYQ,GAAYD,SAAUA,IAC/L,IACAJ,EAAYgB,YAAc"}
|
@@ -12,7 +12,7 @@ export interface AvatarProps extends VariantProps<typeof AvatarVariants> {
|
|
12
12
|
delayMs?: number;
|
13
13
|
}
|
14
14
|
declare const AvatarVariants: (props?: ({
|
15
|
-
radius?: "
|
15
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
16
16
|
size?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | null | undefined;
|
17
17
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
18
18
|
color?: string | null | undefined;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
'use client';
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
2
3
|
__assign = Object.assign || function(t) {
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -26,6 +27,7 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
26
27
|
import { cva } from 'class-variance-authority';
|
27
28
|
import { cn } from '../../../lib/utils/utils';
|
28
29
|
import { appearanceStyle, primaryColorStyle, radiusVariants, scalingVariants } from '../../../lib/constants';
|
30
|
+
import { useTheme } from '../../../lib/theme/ThemeProvider';
|
29
31
|
var AvatarVariants = cva('font-medium', {
|
30
32
|
variants: {
|
31
33
|
radius: __assign({}, radiusVariants['base']),
|
@@ -51,8 +53,14 @@ var AvatarVariants = cva('font-medium', {
|
|
51
53
|
});
|
52
54
|
var Avatar = forwardRef(function (_a, ref) {
|
53
55
|
var className = _a.className, fallbackClassName = _a.fallbackClassName, radius = _a.radius, scaling = _a.scaling, size = _a.size, fallbackText = _a.fallbackText, imagePath = _a.imagePath, alt = _a.alt, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, ariaLabel = _a.ariaLabel, ariaLabelledby = _a.ariaLabelledby, title = _a.title, _d = _a.delayMs, delayMs = _d === void 0 ? 300 : _d, props = __rest(_a, ["className", "fallbackClassName", "radius", "scaling", "size", "fallbackText", "imagePath", "alt", "appearance", "color", "ariaLabel", "ariaLabelledby", "title", "delayMs"]);
|
56
|
+
var theme = useTheme().theme;
|
57
|
+
var avatarStyle = {
|
58
|
+
radius: theme.themeRadius || radius,
|
59
|
+
scaling: theme.themeScaling || scaling,
|
60
|
+
color: theme.themeColor || color,
|
61
|
+
};
|
54
62
|
var imgAltText = alt || ariaLabel || fallbackText || 'Avatar Image';
|
55
|
-
return (_jsxs(AvatarPrimitive.Root, __assign({ className: cn("inline-flex select-none items-center justify-center overflow-hidden align-middle", AvatarVariants(
|
63
|
+
return (_jsxs(AvatarPrimitive.Root, __assign({ className: cn("inline-flex select-none items-center justify-center overflow-hidden align-middle", AvatarVariants(avatarStyle), appearanceStyle(appearance, avatarStyle.color, false), className) }, props, { ref: ref, role: "img", "aria-label": ariaLabel || imgAltText, "aria-labelledby": ariaLabelledby, title: title || imgAltText, tabIndex: 0, children: [_jsx(AvatarPrimitive.Image, { className: "h-full w-full border-none object-cover", src: imagePath, alt: imgAltText, title: title || imgAltText }), _jsx(AvatarPrimitive.Fallback, { className: cn("leading-1 flex h-full w-full items-center justify-center", className), delayMs: delayMs, "aria-hidden": "true", children: fallbackText })] })));
|
56
64
|
});
|
57
65
|
Avatar.displayName = 'Avatar';
|
58
66
|
export default Avatar;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
"use client";
|
2
|
+
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as t}from"react";import*as r from"@radix-ui/react-avatar";import{cva as l}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{radiusVariants as o,scalingVariants as s,primaryColorStyle as n,appearanceStyle as p}from"../../constants.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var x=function(){return x=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var l in a=arguments[t])Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l]);return e},x.apply(this,arguments)},m=function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(r=Object.getOwnPropertySymbols(e);l<r.length;l++)a.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(t[r[l]]=e[r[l]])}return t},f=l("font-medium",{variants:{radius:x({},o.base),size:{1:"h-[24px] w-[24px] text-[12px]",2:"h-[32px] w-[32px] text-[14px]",3:"h-[40px] w-[40px] text-[16px]",4:"h-[48px] w-[48px] text-[18px]",5:"h-[64px] w-[64px] text-[24px]",6:"h-[80px] w-[80px] text-[28px]",7:"h-[96px] w-[96px] text-[28px]",8:"h-[128px] w-[128px] text-[35px]",9:"h-[160px] w-[160px] text-[60px]"},scaling:x({},s),color:n()},defaultVariants:{radius:"full",color:"red",size:"3"}}),d=t((function(t,l){var o=t.className;t.fallbackClassName;var s=t.radius,n=t.scaling;t.size;var d=t.fallbackText,u=t.imagePath,h=t.alt,b=t.appearance,y=void 0===b?"solid":b,v=t.color,g=void 0===v?"red":v,w=t.ariaLabel,j=t.ariaLabelledby,O=t.title,N=t.delayMs,P=void 0===N?300:N,k=m(t,["className","fallbackClassName","radius","scaling","size","fallbackText","imagePath","alt","appearance","color","ariaLabel","ariaLabelledby","title","delayMs"]),z=c().theme,I={radius:z.themeRadius||s,scaling:z.themeScaling||n,color:z.themeColor||g},L=h||w||d||"Avatar Image";return e(r.Root,x({className:i("inline-flex select-none items-center justify-center overflow-hidden align-middle",f(I),p(y,I.color,!1),o)},k,{ref:l,role:"img","aria-label":w||L,"aria-labelledby":j,title:O||L,tabIndex:0,children:[a(r.Image,{className:"h-full w-full border-none object-cover",src:u,alt:L,title:O||L}),a(r.Fallback,{className:i("leading-1 flex h-full w-full items-center justify-center",o),delayMs:P,"aria-hidden":"true",children:d})]}))}));d.displayName="Avatar";export{d as default};
|
2
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -8,10 +8,10 @@ export interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps
|
|
8
8
|
weight?: IWeight;
|
9
9
|
}
|
10
10
|
declare const BadgeVariants: (props?: ({
|
11
|
-
radius?: "
|
11
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
12
12
|
size?: "small" | "medium" | "large" | null | undefined;
|
13
13
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
14
|
-
weight?: "
|
14
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
15
15
|
color?: string | null | undefined;
|
16
16
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
17
17
|
declare const Badge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & BadgeProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -25,6 +25,7 @@ import { forwardRef } from 'react';
|
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { appearanceStyle, primaryColorStyle, radiusVariants, scalingVariants, weightVariants, } from '../../../lib/constants';
|
28
|
+
import { useTheme } from '../../../lib/theme';
|
28
29
|
var BadgeVariants = cva('inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 w-fit', {
|
29
30
|
variants: {
|
30
31
|
radius: __assign({}, radiusVariants['base']),
|
@@ -47,7 +48,15 @@ var BadgeVariants = cva('inline-flex items-center transition-colors focus:outlin
|
|
47
48
|
});
|
48
49
|
var Badge = forwardRef(function (_a, ref) {
|
49
50
|
var className = _a.className, children = _a.children, radius = _a.radius, scaling = _a.scaling, weight = _a.weight, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, ["className", "children", "radius", "scaling", "weight", "size", "color", "appearance"]);
|
50
|
-
var
|
51
|
+
var theme = useTheme().theme;
|
52
|
+
var badgeStyle = {
|
53
|
+
radius: theme.themeRadius || radius,
|
54
|
+
scaling: theme.themeScaling || scaling,
|
55
|
+
weight: theme.themeWeight || weight,
|
56
|
+
color: theme.themeColor || color,
|
57
|
+
size: size,
|
58
|
+
};
|
59
|
+
var badgeClassName = cn(BadgeVariants(badgeStyle), appearanceStyle(appearance, badgeStyle.color, false), className);
|
51
60
|
return (_jsx("div", __assign({ ref: ref, className: badgeClassName }, props, { children: children })));
|
52
61
|
});
|
53
62
|
Badge.displayName = 'Badge';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{cva as t}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{radiusVariants as o,scalingVariants as a,weightVariants as s,primaryColorStyle as n,appearanceStyle as l}from"../../constants.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var m=function(){return m=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},m.apply(this,arguments)},p=function(e,r){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)r.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t},u=t("inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 w-fit",{variants:{radius:m({},o.base),size:{small:"text-xs h-[20px] px-1.5 py-0.5",medium:"text-xs h-[24px] px-2 py-1",large:"text-sm h-[28px] px-2.5 py-1"},scaling:m({},a),weight:m({},s),color:n()},defaultVariants:{radius:"medium",size:"medium",scaling:"100%",weight:"medium",color:"red"}}),f=r((function(r,t){var o=r.className,a=r.children,s=r.radius,n=r.scaling,f=r.weight,d=r.size,h=r.color,g=void 0===h?"red":h,y=r.appearance,x=void 0===y?"solid":y,v=p(r,["className","children","radius","scaling","weight","size","color","appearance"]),O=c().theme,b={radius:O.themeRadius||s,scaling:O.themeScaling||n,weight:O.themeWeight||f,color:O.themeColor||g,size:d},j=i(u(b),l(x,b.color,!1),o);return e("div",m({ref:t,className:j},v,{children:a}))}));f.displayName="Badge";export{f as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Badge/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { appearanceStyle, primaryColorStyle, radiusVariants, scalingVariants, weightVariants, } from '../../../lib/constants';\nvar BadgeVariants = cva('inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs h-[20px] px-1.5 py-0.5',\n medium: 'text-xs h-[24px] px-2 py-1',\n large: 'text-sm h-[28px] px-2.5 py-1',\n },\n scaling: __assign({}, scalingVariants),\n weight: __assign({}, weightVariants),\n color: primaryColorStyle(),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n weight: 'medium',\n color: 'red',\n },\n});\nvar Badge = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, scaling = _a.scaling, weight = _a.weight, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, [\"className\", \"children\", \"radius\", \"scaling\", \"weight\", \"size\", \"color\", \"appearance\"]);\n var
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Badge/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { appearanceStyle, primaryColorStyle, radiusVariants, scalingVariants, weightVariants, } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar BadgeVariants = cva('inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs h-[20px] px-1.5 py-0.5',\n medium: 'text-xs h-[24px] px-2 py-1',\n large: 'text-sm h-[28px] px-2.5 py-1',\n },\n scaling: __assign({}, scalingVariants),\n weight: __assign({}, weightVariants),\n color: primaryColorStyle(),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n weight: 'medium',\n color: 'red',\n },\n});\nvar Badge = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, scaling = _a.scaling, weight = _a.weight, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, [\"className\", \"children\", \"radius\", \"scaling\", \"weight\", \"size\", \"color\", \"appearance\"]);\n var theme = useTheme().theme;\n var badgeStyle = {\n radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n weight: theme.themeWeight || weight,\n color: theme.themeColor || color,\n size: size,\n };\n var badgeClassName = cn(BadgeVariants(badgeStyle), appearanceStyle(appearance, badgeStyle.color, false), className);\n return (_jsx(\"div\", __assign({ ref: ref, className: badgeClassName }, props, { children: children })));\n});\nBadge.displayName = 'Badge';\nexport default Badge;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","BadgeVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","weight","weightVariants","color","primaryColorStyle","defaultVariants","Badge","forwardRef","_a","ref","className","children","_b","_c","appearance","props","theme","useTheme","badgeStyle","themeRadius","themeScaling","themeWeight","themeColor","badgeClassName","cn","appearanceStyle","_jsx","displayName"],"mappings":"wWAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOIiB,EAAgBC,EAAI,uHAAwH,CAC5IC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,iCACPC,OAAQ,6BACRC,MAAO,gCAEXC,QAAS7B,EAAS,CAAE,EAAE8B,GACtBC,OAAQ/B,EAAS,CAAE,EAAEgC,GACrBC,MAAOC,KAEXC,gBAAiB,CACbZ,OAAQ,SACRE,KAAM,SACNI,QAAS,OACTE,OAAQ,SACRE,MAAO,SAGXG,EAAQC,GAAW,SAAUC,EAAIC,GACjC,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUlB,EAASe,EAAGf,OAAQM,EAAUS,EAAGT,QAASE,EAASO,EAAGP,OAAQN,EAAOa,EAAGb,KAAMiB,EAAKJ,EAAGL,MAAOA,OAAe,IAAPS,EAAgB,MAAQA,EAAIC,EAAKL,EAAGM,WAAYA,OAAoB,IAAPD,EAAgB,QAAUA,EAAIE,EAAQ9B,EAAOuB,EAAI,CAAC,YAAa,WAAY,SAAU,UAAW,SAAU,OAAQ,QAAS,eAC/UQ,EAAQC,IAAWD,MACnBE,EAAa,CACbzB,OAAQuB,EAAMG,aAAe1B,EAC7BM,QAASiB,EAAMI,cAAgBrB,EAC/BE,OAAQe,EAAMK,aAAepB,EAC7BE,MAAOa,EAAMM,YAAcnB,EAC3BR,KAAMA,GAEN4B,EAAiBC,EAAGlC,EAAc4B,GAAaO,EAAgBX,EAAYI,EAAWf,OAAO,GAAQO,GACzG,OAAQgB,EAAK,MAAOxD,EAAS,CAAEuC,IAAKA,EAAKC,UAAWa,GAAkBR,EAAO,CAAEJ,SAAUA,IAC7F,IACAL,EAAMqB,YAAc"}
|
@@ -6,10 +6,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
6
6
|
appearance?: IAppearance;
|
7
7
|
}
|
8
8
|
declare const buttonVariants: (props?: ({
|
9
|
-
radius?: "
|
9
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
10
10
|
size?: "small" | "medium" | "large" | "x-small" | "x-large" | null | undefined;
|
11
11
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
12
|
-
weight?: "
|
12
|
+
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
13
13
|
color?: string | null | undefined;
|
14
14
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
15
|
export declare const Button: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -25,6 +25,7 @@ import { forwardRef } from 'react';
|
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { radiusVariants, weightVariants, primaryColorStyle, appearanceStyle, scalingVariants, } from '../../../lib/constants';
|
28
|
+
import { useTheme } from '../../../lib/theme';
|
28
29
|
var buttonVariants = cva("inline-flex items-center w-fit transition-colors focus:outline-none hover:cursor-pointer\n disabled:cursor-not-allowed disabled:bg-slate-3 disabled:text-slate-8 justify-center", {
|
29
30
|
variants: {
|
30
31
|
radius: __assign({}, radiusVariants['base']),
|
@@ -49,7 +50,15 @@ var buttonVariants = cva("inline-flex items-center w-fit transition-colors focus
|
|
49
50
|
});
|
50
51
|
export var Button = forwardRef(function (_a, ref) {
|
51
52
|
var className = _a.className, children = _a.children, radius = _a.radius, scaling = _a.scaling, size = _a.size, weight = _a.weight, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, ["className", "children", "radius", "scaling", "size", "weight", "color", "appearance"]);
|
52
|
-
var
|
53
|
+
var theme = useTheme().theme;
|
54
|
+
var buttonStyle = {
|
55
|
+
radius: theme.themeRadius || radius,
|
56
|
+
scaling: theme.themeScaling || scaling,
|
57
|
+
weight: theme.themeWeight || weight,
|
58
|
+
color: theme.themeColor || color,
|
59
|
+
size: size,
|
60
|
+
};
|
61
|
+
var buttonClassName = cn(buttonVariants(buttonStyle), appearanceStyle(appearance, buttonStyle.color, true), className);
|
53
62
|
return (_jsx("button", __assign({ ref: ref, className: buttonClassName }, props, { children: children })));
|
54
63
|
});
|
55
64
|
Button.displayName = 'Button';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{cva as r}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{radiusVariants as
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{cva as r}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{radiusVariants as o,scalingVariants as a,weightVariants as s,primaryColorStyle as n,appearanceStyle as l}from"../../constants.mjs";import{useTheme as m}from"../../theme/ThemeProvider.mjs";var c=function(){return c=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)},p=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r},u=r("inline-flex items-center w-fit transition-colors focus:outline-none hover:cursor-pointer\n disabled:cursor-not-allowed disabled:bg-slate-3 disabled:text-slate-8 justify-center",{variants:{radius:c({},o.base),size:{"x-small":"text-xs min-w-[36px] h-[20px] px-1.5",small:"text-xs min-w-[40px] h-[24px] px-2",medium:"text-sm min-w-[50px] h-[32px] px-3",large:"text-base min-w-[62px] h-[40px] px-4","x-large":"text-lg min-w-[82px] h-[48px] px-6"},scaling:c({},a),weight:c({},s),color:n()},defaultVariants:{radius:"medium",scaling:"100%",weight:"medium",color:"red",size:"medium"}}),d=t((function(t,r){var o=t.className,a=t.children,s=t.radius,n=t.scaling,d=t.size,x=t.weight,h=t.color,f=void 0===h?"red":h,g=t.appearance,b=void 0===g?"solid":g,w=p(t,["className","children","radius","scaling","size","weight","color","appearance"]),y=m().theme,v={radius:y.themeRadius||s,scaling:y.themeScaling||n,weight:y.themeWeight||x,color:y.themeColor||f,size:d},O=i(u(v),l(b,v.color,!0),o);return e("button",c({ref:r,className:O},w,{children:a}))}));d.displayName="Button";export{d as Button,d as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|