@lotte-innovate/ui-component-test 0.1.65 → 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/.storybook/main.d.ts +3 -0
- package/dist/lib/.storybook/manager.d.ts +1 -0
- package/dist/lib/.storybook/preview.d.ts +9 -0
- package/dist/lib/Typography/Header/index.d.ts +1 -1
- package/dist/lib/Typography/Text/index.d.ts +1 -1
- package/dist/lib/color/constants.d.ts +0 -15
- package/dist/lib/color/constants.js +0 -32
- package/dist/lib/color/constants.mjs.map +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/BubbleChart/index.js +1 -1
- package/dist/lib/components/BubbleChart/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/RadarChart/index.js +1 -1
- package/dist/lib/components/RadarChart/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/constants.d.ts +0 -2
- package/dist/lib/constants.js +7 -31
- package/dist/lib/constants.mjs +1 -1
- package/dist/lib/constants.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/classPrefixes.js +1 -0
- 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/tailwind.config.js +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +141 -140
@@ -26,16 +26,16 @@ import React from 'react';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { weightVariants } from '../../../lib/constants';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var tabsVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
weight: __assign({}, weightVariants),
|
32
33
|
},
|
33
34
|
});
|
34
35
|
export var Root = React.forwardRef(function (_a, forwardedRef) {
|
35
|
-
var className = _a.className, children = _a.children,
|
36
|
-
|
37
|
-
|
38
|
-
return (_jsx(Theme, { accentColor: color, hasBackground: false, children: _jsx(TabsTheme.Root, __assign({}, rootProps, { ref: forwardedRef, className: cn('', className), children: children })) }));
|
36
|
+
var className = _a.className, children = _a.children, _b = _a.color, color = _b === void 0 ? 'red' : _b, rootProps = __rest(_a, ["className", "children", "color"]);
|
37
|
+
var theme = useTheme().theme;
|
38
|
+
return (_jsx(Theme, { accentColor: theme.themeColor || color, hasBackground: false, children: _jsx(TabsTheme.Root, __assign({}, rootProps, { ref: forwardedRef, className: cn('', className), children: children })) }));
|
39
39
|
});
|
40
40
|
Root.displayName = 'Tabs.Root';
|
41
41
|
export var List = React.forwardRef(function (_a, forwardedRef) {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Theme as e,Tabs as
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Theme as e,Tabs as t}from"@radix-ui/themes";import a from"react";import{cn as s}from"../../utils/utils.mjs";import{cva as i}from"class-variance-authority";import{weightVariants as o}from"../../constants.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var l=function(){return l=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var s in e=arguments[t])Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s]);return r},l.apply(this,arguments)},c=function(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(r);s<a.length;s++)e.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(t[a[s]]=r[a[s]])}return t};i("",{variants:{weight:l({},o)}});var m=a.forwardRef((function(a,i){var o=a.className,m=a.children,f=a.color,d=void 0===f?"red":f,h=c(a,["className","children","color"]),p=n().theme;return r(e,{accentColor:p.themeColor||d,hasBackground:!1,children:r(t.Root,l({},h,{ref:i,className:s("",o),children:m}))})}));m.displayName="Tabs.Root";var f=a.forwardRef((function(e,a){var i=e.className;e.weight;var o=e.children,n=e.size,m=c(e,["className","weight","children","size"]),f="2";return"small"===n&&(f="1"),r(t.List,l({ref:a,size:f},m,{className:s("",i),children:o}))}));f.displayName="Tabs.List";var d=a.forwardRef((function(e,a){var i=e.className;e.weight;var o=e.children,n=c(e,["className","weight","children"]);return r(t.Trigger,l({ref:a,className:s("text-slateA-11 data-[state=active]:text-slateA-12 dark:text-slateDarkA-11 dark:data-[state=active]:text-slateDarkA-12",i)},n,{children:o}))}));d.displayName="Tabs.Trigger";var h=a.forwardRef((function(e,a){var i=e.className;e.weight;var o=e.children,n=c(e,["className","weight","children"]);return r(t.Content,l({ref:a},n,{className:s("mt-3",i),children:o}))}));h.displayName="Tabs.Content";var p={Root:m,List:f,Trigger:d,Content:h};export{h as Content,f as List,m as Root,d as Trigger,p as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Tabs/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 { Theme, Tabs as TabsTheme } from '@radix-ui/themes';\nimport React from 'react';\nimport { cn } from '../../../lib/utils/utils';\nimport { cva } from 'class-variance-authority';\nimport { weightVariants } from '../../../lib/constants';\nvar tabsVariants = cva('', {\n variants: {\n weight: __assign({}, weightVariants),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children,
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Tabs/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 { Theme, Tabs as TabsTheme } from '@radix-ui/themes';\nimport React from 'react';\nimport { cn } from '../../../lib/utils/utils';\nimport { cva } from 'class-variance-authority';\nimport { weightVariants } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar tabsVariants = cva('', {\n variants: {\n weight: __assign({}, weightVariants),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, _b = _a.color, color = _b === void 0 ? 'red' : _b, rootProps = __rest(_a, [\"className\", \"children\", \"color\"]);\n var theme = useTheme().theme;\n return (_jsx(Theme, { accentColor: theme.themeColor || color, hasBackground: false, children: _jsx(TabsTheme.Root, __assign({}, rootProps, { ref: forwardedRef, className: cn('', className), children: children })) }));\n});\nRoot.displayName = 'Tabs.Root';\nexport var List = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, weight = _a.weight, children = _a.children, size = _a.size, listProps = __rest(_a, [\"className\", \"weight\", \"children\", \"size\"]);\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n return (_jsx(TabsTheme.List, __assign({ ref: forwardedRef, size: sizeTheme }, listProps, { className: cn('', className), children: children })));\n});\nList.displayName = 'Tabs.List';\nexport var Trigger = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, weight = _a.weight, children = _a.children, triggerProps = __rest(_a, [\"className\", \"weight\", \"children\"]);\n return (_jsx(TabsTheme.Trigger, __assign({ ref: forwardedRef, className: cn('text-slateA-11 data-[state=active]:text-slateA-12 dark:text-slateDarkA-11 dark:data-[state=active]:text-slateDarkA-12', className) }, triggerProps, { children: children })));\n});\nTrigger.displayName = 'Tabs.Trigger';\nexport var Content = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, weight = _a.weight, children = _a.children, contentProps = __rest(_a, [\"className\", \"weight\", \"children\"]);\n return (_jsx(TabsTheme.Content, __assign({ ref: forwardedRef }, contentProps, { className: cn('mt-3', className), children: children })));\n});\nContent.displayName = 'Tabs.Content';\nvar Tabs = {\n Root: Root,\n List: List,\n Trigger: Trigger,\n Content: Content,\n};\nexport default Tabs;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","cva","variants","weight","weightVariants","Root","React","forwardRef","_a","forwardedRef","className","children","_b","color","rootProps","theme","useTheme","_jsx","Theme","accentColor","themeColor","hasBackground","TabsTheme","ref","cn","displayName","List","size","listProps","sizeTheme","Trigger","triggerProps","Content","contentProps","Tabs"],"mappings":"wTAAA,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,EAQmBiB,EAAI,GAAI,CACvBC,SAAU,CACNC,OAAQtB,EAAS,CAAE,EAAEuB,MAGnB,IAACC,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAKJ,EAAGK,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAYlB,EAAOY,EAAI,CAAC,YAAa,WAAY,UACtJO,EAAQC,IAAWD,MACvB,OAAQE,EAAKC,EAAO,CAAEC,YAAaJ,EAAMK,YAAcP,EAAOQ,eAAe,EAAOV,SAAUM,EAAKK,EAAUjB,KAAMxB,EAAS,CAAE,EAAEiC,EAAW,CAAES,IAAKd,EAAcC,UAAWc,EAAG,GAAId,GAAYC,SAAUA,MAC5M,IACAN,EAAKoB,YAAc,YACT,IAACC,EAAOpB,EAAMC,YAAW,SAAUC,EAAIC,GAC1C,IAACC,EAAYF,EAAGE,UAAoBF,EAAGL,WAAQQ,EAAWH,EAAGG,SAAUgB,EAAOnB,EAAGmB,KAAMC,EAAYhC,EAAOY,EAAI,CAAC,YAAa,SAAU,WAAY,SACjJqB,EAAY,IAGhB,MAFa,UAATF,IACAE,EAAY,KACRZ,EAAKK,EAAUI,KAAM7C,EAAS,CAAE0C,IAAKd,EAAckB,KAAME,GAAaD,EAAW,CAAElB,UAAWc,EAAG,GAAId,GAAYC,SAAUA,IACvI,IACAe,EAAKD,YAAc,YACT,IAACK,EAAUxB,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAACC,EAAYF,EAAGE,UAAoBF,EAAGL,OAAO,IAACQ,EAAWH,EAAGG,SAAUoB,EAAenC,EAAOY,EAAI,CAAC,YAAa,SAAU,aAC5H,OAAQS,EAAKK,EAAUQ,QAASjD,EAAS,CAAE0C,IAAKd,EAAcC,UAAWc,EAAG,wHAAyHd,IAAcqB,EAAc,CAAEpB,SAAUA,IACjP,IACAmB,EAAQL,YAAc,eACZ,IAACO,EAAU1B,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAACC,EAAYF,EAAGE,UAAoBF,EAAGL,OAAO,IAACQ,EAAWH,EAAGG,SAAUsB,EAAerC,EAAOY,EAAI,CAAC,YAAa,SAAU,aAC5H,OAAQS,EAAKK,EAAUU,QAASnD,EAAS,CAAE0C,IAAKd,GAAgBwB,EAAc,CAAEvB,UAAWc,EAAG,OAAQd,GAAYC,SAAUA,IAChI,IACAqB,EAAQP,YAAc,eACnB,IAACS,EAAO,CACP7B,KAAMA,EACNqB,KAAMA,EACNI,QAASA,EACTE,QAASA"}
|
@@ -10,7 +10,7 @@ export interface TextAreaProps extends VariantProps<typeof textAreaNavVariants>
|
|
10
10
|
declare const textAreaNavVariants: (props?: ({
|
11
11
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
12
12
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
13
|
-
radius?: "
|
13
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
14
14
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
15
|
export declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/themes").TextAreaProps & React.RefAttributes<HTMLTextAreaElement>, "ref">, "size"> & TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
16
16
|
export default TextArea;
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { TextArea as TextAreaTheme, Theme } from '@radix-ui/themes';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { radiusVariants, scalingVariants } from '../../../lib/constants';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var textAreaNavVariants = cva('w-[250px]', {
|
30
31
|
variants: {
|
31
32
|
size: {
|
@@ -44,15 +45,21 @@ var textAreaNavVariants = cva('w-[250px]', {
|
|
44
45
|
},
|
45
46
|
});
|
46
47
|
export var TextArea = React.forwardRef(function (_a, forwardedRef) {
|
47
|
-
var className = _a.className, children = _a.children, size = _a.size, appearance = _a.appearance, scaling = _a.scaling, radius = _a.radius,
|
48
|
+
var className = _a.className, children = _a.children, size = _a.size, appearance = _a.appearance, scaling = _a.scaling, radius = _a.radius, _b = _a.color, color = _b === void 0 ? 'red' : _b, textAreaProps = __rest(_a, ["className", "children", "size", "appearance", "scaling", "radius", "color"]);
|
49
|
+
var theme = useTheme().theme;
|
48
50
|
var sizeTheme = '2';
|
49
51
|
if (size === 'small')
|
50
52
|
sizeTheme = '1';
|
51
53
|
if (size === 'large')
|
52
54
|
sizeTheme = '3';
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
var textAreaStyle = {
|
56
|
+
scaling: theme.themeScaling || scaling,
|
57
|
+
radius: theme.themeRadius || radius,
|
58
|
+
size: size
|
59
|
+
};
|
60
|
+
return (
|
61
|
+
// @ts-ignore
|
62
|
+
_jsx(Theme, { hasBackground: false, accentColor: theme.themeColor || color, children: _jsx(TextAreaTheme, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, className: cn(textAreaNavVariants(textAreaStyle), size === 'x-large' && 'rt-r-size-4', className) }, textAreaProps)) }));
|
56
63
|
});
|
57
64
|
TextArea.displayName = 'TextArea';
|
58
65
|
export default TextArea;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import e from"react";import{cva as a}from"class-variance-authority";import{Theme as t,TextArea as i}from"@radix-ui/themes";import{cn as s}from"../../utils/utils.mjs";import{scalingVariants as
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import e from"react";import{cva as a}from"class-variance-authority";import{Theme as t,TextArea as i}from"@radix-ui/themes";import{cn as s}from"../../utils/utils.mjs";import{scalingVariants as o,radiusVariants as n}from"../../constants.mjs";import{useTheme as l}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 i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},m.apply(this,arguments)},c=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 i=0;for(t=Object.getOwnPropertySymbols(r);i<t.length;i++)e.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(r,t[i])&&(a[t[i]]=r[t[i]])}return a},p=a("w-[250px]",{variants:{size:{small:"text-xs h-[48px]",medium:"text-sm h-[64px]",large:"text-base h-[80px]","x-large":"text-lg h-[96px]"},scaling:m({},o),radius:m({},n["extra-large"])},defaultVariants:{size:"medium",scaling:"100%",radius:"medium"}}),u=e.forwardRef((function(e,a){var o=e.className;e.children;var n=e.size,u=e.appearance,f=e.scaling,d=e.radius,h=e.color,x=void 0===h?"red":h,g=c(e,["className","children","size","appearance","scaling","radius","color"]),v=l().theme,y="2";"small"===n&&(y="1"),"large"===n&&(y="3");var O={scaling:v.themeScaling||f,radius:v.themeRadius||d,size:n};return r(t,{hasBackground:!1,accentColor:v.themeColor||x,children:r(i,m({ref:a,variant:u,size:y,className:s(p(O),"x-large"===n&&"rt-r-size-4",o)},g))})}));u.displayName="TextArea";export{u as TextArea,u as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/TextArea/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 React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { TextArea as TextAreaTheme, Theme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants, scalingVariants } from '../../../lib/constants';\nvar textAreaNavVariants = cva('w-[250px]', {\n variants: {\n size: {\n small: 'text-xs h-[48px]',\n medium: 'text-sm h-[64px]',\n large: 'text-base h-[80px]',\n 'x-large': 'text-lg h-[96px]',\n },\n scaling: __assign({}, scalingVariants),\n radius: __assign({}, radiusVariants['extra-large']),\n },\n defaultVariants: {\n size: 'medium',\n scaling: '100%',\n radius: 'medium',\n },\n});\nexport var TextArea = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, size = _a.size, appearance = _a.appearance, scaling = _a.scaling, radius = _a.radius,
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/TextArea/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 React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { TextArea as TextAreaTheme, Theme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants, scalingVariants } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar textAreaNavVariants = cva('w-[250px]', {\n variants: {\n size: {\n small: 'text-xs h-[48px]',\n medium: 'text-sm h-[64px]',\n large: 'text-base h-[80px]',\n 'x-large': 'text-lg h-[96px]',\n },\n scaling: __assign({}, scalingVariants),\n radius: __assign({}, radiusVariants['extra-large']),\n },\n defaultVariants: {\n size: 'medium',\n scaling: '100%',\n radius: 'medium',\n },\n});\nexport var TextArea = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, children = _a.children, size = _a.size, appearance = _a.appearance, scaling = _a.scaling, radius = _a.radius, _b = _a.color, color = _b === void 0 ? 'red' : _b, textAreaProps = __rest(_a, [\"className\", \"children\", \"size\", \"appearance\", \"scaling\", \"radius\", \"color\"]);\n var theme = useTheme().theme;\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n if (size === 'large')\n sizeTheme = '3';\n var textAreaStyle = {\n scaling: theme.themeScaling || scaling,\n radius: theme.themeRadius || radius,\n size: size\n };\n return (\n // @ts-ignore\n _jsx(Theme, { hasBackground: false, accentColor: theme.themeColor || color, children: _jsx(TextAreaTheme, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, className: cn(textAreaNavVariants(textAreaStyle), size === 'x-large' && 'rt-r-size-4', className) }, textAreaProps)) }));\n});\nTextArea.displayName = 'TextArea';\nexport default TextArea;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","textAreaNavVariants","cva","variants","size","small","medium","large","scaling","scalingVariants","radius","radiusVariants","defaultVariants","TextArea","React","forwardRef","_a","forwardedRef","className","children","appearance","_b","color","textAreaProps","theme","useTheme","sizeTheme","textAreaStyle","themeScaling","themeRadius","_jsx","Theme","hasBackground","accentColor","themeColor","TextAreaTheme","ref","variant","cn","displayName"],"mappings":"iVAAA,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,EAQIiB,EAAsBC,EAAI,YAAa,CACvCC,SAAU,CACNC,KAAM,CACFC,MAAO,mBACPC,OAAQ,mBACRC,MAAO,qBACP,UAAW,oBAEfC,QAAS3B,EAAS,CAAE,EAAE4B,GACtBC,OAAQ7B,EAAS,CAAA,EAAI8B,EAAe,iBAExCC,gBAAiB,CACbR,KAAM,SACNI,QAAS,OACTE,OAAQ,YAGLG,EAAWC,EAAMC,YAAW,SAAUC,EAAIC,GAC9C,IAACC,EAAYF,EAAGE,UAAsBF,EAAGG,SAAS,IAACf,EAAOY,EAAGZ,KAAMgB,EAAaJ,EAAGI,WAAYZ,EAAUQ,EAAGR,QAASE,EAASM,EAAGN,OAAQW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAgB3B,EAAOoB,EAAI,CAAC,YAAa,WAAY,OAAQ,aAAc,UAAW,SAAU,UAC3RQ,EAAQC,IAAWD,MACnBE,EAAY,IACH,UAATtB,IACAsB,EAAY,KACH,UAATtB,IACAsB,EAAY,KAChB,IAAIC,EAAgB,CAChBnB,QAASgB,EAAMI,cAAgBpB,EAC/BE,OAAQc,EAAMK,aAAenB,EAC7BN,KAAMA,GAEV,OAEA0B,EAAKC,EAAO,CAAEC,eAAe,EAAOC,YAAaT,EAAMU,YAAcZ,EAAOH,SAAUW,EAAKK,EAAetD,EAAS,CAAEuD,IAAKnB,EAAcoB,QAASjB,EAAYhB,KAAMsB,EAAWR,UAAWoB,EAAGrC,EAAoB0B,GAAyB,YAATvB,GAAsB,cAAec,IAAcK,KACvR,IACAV,EAAS0B,YAAc"}
|
@@ -9,7 +9,7 @@ export interface TextFieldProps extends VariantProps<typeof textFieldVariants> {
|
|
9
9
|
scaling?: IScaling;
|
10
10
|
}
|
11
11
|
declare const textFieldVariants: (props?: ({
|
12
|
-
radius?: "
|
12
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
13
13
|
color?: string | null | undefined;
|
14
14
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
15
|
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<TextFieldTheme.RootProps & React.RefAttributes<HTMLInputElement>, "ref">, "size"> & TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { bgColorStyle, radiusVariants } from '../../../lib/constants';
|
28
28
|
import { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var textFieldVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
radius: __assign({}, radiusVariants['base']),
|
@@ -33,15 +34,21 @@ var textFieldVariants = cva('', {
|
|
33
34
|
},
|
34
35
|
});
|
35
36
|
export var Root = React.forwardRef(function (_a, forwardedRef) {
|
36
|
-
var className = _a.className,
|
37
|
-
|
38
|
-
color = 'red';
|
37
|
+
var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, size = _a.size, appearance = _a.appearance, _c = _a.scaling, scaling = _c === void 0 ? '100%' : _c, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, ["className", "color", "size", "appearance", "scaling", "radius", "children"]);
|
38
|
+
var theme = useTheme().theme;
|
39
39
|
var sizeTheme = '2';
|
40
40
|
if (size === 'small')
|
41
41
|
sizeTheme = '1';
|
42
42
|
if (size === 'large')
|
43
43
|
sizeTheme = '3';
|
44
|
-
|
44
|
+
var contextValue = {
|
45
|
+
scaling: theme.themeScaling || scaling,
|
46
|
+
radius: theme.themeRadius || radius,
|
47
|
+
color: theme.themeColor || color,
|
48
|
+
};
|
49
|
+
return (_jsx(Theme, { scaling: contextValue.scaling, accentColor: color, hasBackground: false, children: _jsx(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: contextValue.radius,
|
50
|
+
// @ts-ignore
|
51
|
+
color: contextValue.color, className: cn(textFieldVariants({ radius: contextValue.radius }), className) }, sliderProps, { children: children })) }));
|
45
52
|
});
|
46
53
|
Root.displayName = 'TextField.Root';
|
47
54
|
export var Slot = React.forwardRef(function (_a, forwardedRef) {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import e from"react";import{cva as a}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{radiusVariants as t,bgColorStyle as i}from"../../constants.mjs";import{Theme as s,TextField as l}from"@radix-ui/themes";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var n=function(){return n=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var t in e=arguments[a])Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r},n.apply(this,arguments)},d=function(r,e){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(r);t<o.length;t++)e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(r,o[t])&&(a[o[t]]=r[o[t]])}return a},m=a("",{variants:{radius:n({},t.base),color:i()}}),u=e.forwardRef((function(e,a){var t=e.className,i=e.color,u=void 0===i?"red":i,p=e.size,f=e.appearance,h=e.scaling,v=void 0===h?"100%":h,y=e.radius,g=e.children,O=d(e,["className","color","size","appearance","scaling","radius","children"]),b=c().theme,j="2";"small"===p&&(j="1"),"large"===p&&(j="3");var x={scaling:b.themeScaling||v,radius:b.themeRadius||y,color:b.themeColor||u};return r(s,{scaling:x.scaling,accentColor:u,hasBackground:!1,children:r(l.Root,n({ref:a,variant:f,size:j,radius:x.radius,color:x.color,className:o(m({radius:x.radius}),t)},O,{children:g}))})}));u.displayName="TextField.Root";var p=e.forwardRef((function(e,a){var t=e.className,i=e.color,s=e.side,c=e.radius,u=e.children,p=d(e,["className","color","side","radius","children"]);return r(l.Slot,n({ref:a,color:i,side:s,className:o(m({radius:c}),t)},p,{children:u}))}));p.displayName="TextField.Slot";var f={Root:u,Slot:p};export{u as Root,p as Slot,f as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/TextField/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 React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { bgColorStyle, radiusVariants } from '../../../lib/constants';\nimport { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';\nvar textFieldVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n color: bgColorStyle(),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className,
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/TextField/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 React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { bgColorStyle, radiusVariants } from '../../../lib/constants';\nimport { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';\nimport { useTheme } from '../../../lib/theme';\nvar textFieldVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n color: bgColorStyle(),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, size = _a.size, appearance = _a.appearance, _c = _a.scaling, scaling = _c === void 0 ? '100%' : _c, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"size\", \"appearance\", \"scaling\", \"radius\", \"children\"]);\n var theme = useTheme().theme;\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n if (size === 'large')\n sizeTheme = '3';\n var contextValue = {\n scaling: theme.themeScaling || scaling,\n radius: theme.themeRadius || radius,\n color: theme.themeColor || color,\n };\n return (_jsx(Theme, { scaling: contextValue.scaling, accentColor: color, hasBackground: false, children: _jsx(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: contextValue.radius, \n // @ts-ignore\n color: contextValue.color, className: cn(textFieldVariants({ radius: contextValue.radius }), className) }, sliderProps, { children: children })) }));\n});\nRoot.displayName = 'TextField.Root';\nexport var Slot = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, color = _a.color, side = _a.side, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"side\", \"radius\", \"children\"]);\n return (_jsx(TextFieldTheme.Slot, __assign({ ref: forwardedRef, color: color, side: side, className: cn(textFieldVariants({ radius: radius }), className) }, sliderProps, { children: children })));\n});\nSlot.displayName = 'TextField.Slot';\nvar TextField = {\n Root: Root,\n Slot: Slot,\n};\nexport default TextField;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","textFieldVariants","cva","variants","radius","radiusVariants","color","bgColorStyle","Root","React","forwardRef","_a","forwardedRef","className","_b","size","appearance","_c","scaling","children","sliderProps","theme","useTheme","sizeTheme","contextValue","themeScaling","themeRadius","themeColor","_jsx","Theme","accentColor","hasBackground","TextFieldTheme","ref","variant","cn","displayName","Slot","side","TextField"],"mappings":"+UAAA,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,EAQIiB,EAAoBC,EAAI,GAAI,CAC5BC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,MAAOC,OAGJC,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAKH,EAAGL,MAAOA,OAAe,IAAPQ,EAAgB,MAAQA,EAAIC,EAAOJ,EAAGI,KAAMC,EAAaL,EAAGK,WAAYC,EAAKN,EAAGO,QAASA,OAAiB,IAAPD,EAAgB,OAASA,EAAIb,EAASO,EAAGP,OAAQe,EAAWR,EAAGQ,SAAUC,EAAcxB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,aAAc,UAAW,SAAU,aACxTU,EAAQC,IAAWD,MACnBE,EAAY,IACH,UAATR,IACAQ,EAAY,KACH,UAATR,IACAQ,EAAY,KAChB,IAAIC,EAAe,CACfN,QAASG,EAAMI,cAAgBP,EAC/Bd,OAAQiB,EAAMK,aAAetB,EAC7BE,MAAOe,EAAMM,YAAcrB,GAE/B,OAAQsB,EAAKC,EAAO,CAAEX,QAASM,EAAaN,QAASY,YAAaxB,EAAOyB,eAAe,EAAOZ,SAAUS,EAAKI,EAAexB,KAAM3B,EAAS,CAAEoD,IAAKrB,EAAcsB,QAASlB,EAAYD,KAAMQ,EAAWnB,OAAQoB,EAAapB,OAEpNE,MAAOkB,EAAalB,MAAOO,UAAWsB,EAAGlC,EAAkB,CAAEG,OAAQoB,EAAapB,SAAWS,IAAcO,EAAa,CAAED,SAAUA,MAChJ,IACAX,EAAK4B,YAAc,iBACT,IAACC,EAAO5B,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWP,EAAQK,EAAGL,MAAOgC,EAAO3B,EAAG2B,KAAMlC,EAASO,EAAGP,OAAQe,EAAWR,EAAGQ,SAAUC,EAAcxB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,SAAU,aAC9K,OAAQiB,EAAKI,EAAeK,KAAMxD,EAAS,CAAEoD,IAAKrB,EAAcN,MAAOA,EAAOgC,KAAMA,EAAMzB,UAAWsB,EAAGlC,EAAkB,CAAEG,OAAQA,IAAWS,IAAcO,EAAa,CAAED,SAAUA,IAC1L,IACAkB,EAAKD,YAAc,iBAChB,IAACG,EAAY,CACZ/B,KAAMA,EACN6B,KAAMA"}
|
@@ -7,7 +7,7 @@ export interface ToastActionButtonProps extends VariantProps<typeof toastActionB
|
|
7
7
|
appearance?: IAppearance;
|
8
8
|
}
|
9
9
|
export declare const toastActionButtonVariants: (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
13
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
@@ -46,8 +46,8 @@ export var toastActionButtonVariants = cva("absolute items-center justify-center
|
|
46
46
|
},
|
47
47
|
});
|
48
48
|
export var ToastActionButton = forwardRef(function (_a, ref) {
|
49
|
-
var className = _a.className, children = _a.children,
|
50
|
-
var _d = useToastContext(), scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;
|
49
|
+
var className = _a.className, children = _a.children, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, ["className", "children", "appearance", "altText"]);
|
50
|
+
var _d = useToastContext(), radius = _d.radius, scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;
|
51
51
|
var semantics = ['danger', 'warning', 'success', 'information'];
|
52
52
|
var colorMap = {
|
53
53
|
danger: 'red',
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import*as e from"@radix-ui/react-toast";import{cva as i}from"class-variance-authority";import{cn as
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import*as e from"@radix-ui/react-toast";import{cva as i}from"class-variance-authority";import{cn as n}from"../../utils/utils.mjs";import{Button as a}from"../Button/index.mjs";import{radiusVariants as o,scalingVariants as s,appearanceStyle as m}from"../../constants.mjs";import{useToastContext as l}from"./ToastRoot.mjs";var c=function(){return c=Object.assign||function(t){for(var r,e=1,i=arguments.length;e<i;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},c.apply(this,arguments)},p=function(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]])}return e},u=i("absolute items-center justify-center",{variants:{radius:c({},o.base),size:{small:"text-xs min-w-[56px] h-[25px] font-normal right-3",medium:"text-xs min-w-[56px] h-[25px] font-normal right-3",large:"text-[15px] min-w-[76px] h-[35px] font-medium right-4","x-large":"text-[15px] min-w-[76px] h-[35px] font-medium right-4"},scaling:c({},s)},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),f=r((function(r,i){var o=r.className,s=r.children,f=r.appearance,d=void 0===f?"surface":f,x=r.altText,g=void 0===x?"altText":x,h=p(r,["className","children","appearance","altText"]),y=l(),v=y.radius,b=y.scaling,j=y.size,O=y.color,w=void 0===O?"danger":O,T={danger:"red",information:"sky",success:"green",warning:"amber"},z=n(u({size:j,radius:v,scaling:b}),w&&["danger","warning","success","information"].includes(w)?function(t){var r=T[t];return r?m("outline",r):void 0}(w):m(d,null!=w?w:"red"),o);return t(e.Action,c({ref:i,altText:g},h,{className:z,asChild:!0,children:t(a,{children:s})}))}));f.displayName="Toast.ActionButton";export{f as ToastActionButton,u as toastActionButtonVariants};
|
2
2
|
//# sourceMappingURL=ToastActionButton.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ToastActionButton.mjs","sources":["../../../lib/components/Toast/ToastActionButton.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 ToastPrimitive from '@radix-ui/react-toast';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport Button from '../../../lib/components/Button';\nimport { appearanceStyle, radiusVariants, scalingVariants } from '../../../lib/constants';\nimport { useToastContext } from './ToastRoot';\nexport var toastActionButtonVariants = cva(\"absolute items-center justify-center\", {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n medium: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n large: 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n 'x-large': 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var ToastActionButton = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children,
|
1
|
+
{"version":3,"file":"ToastActionButton.mjs","sources":["../../../lib/components/Toast/ToastActionButton.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 ToastPrimitive from '@radix-ui/react-toast';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport Button from '../../../lib/components/Button';\nimport { appearanceStyle, radiusVariants, scalingVariants } from '../../../lib/constants';\nimport { useToastContext } from './ToastRoot';\nexport var toastActionButtonVariants = cva(\"absolute items-center justify-center\", {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n medium: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n large: 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n 'x-large': 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var ToastActionButton = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, [\"className\", \"children\", \"appearance\", \"altText\"]);\n var _d = useToastContext(), radius = _d.radius, scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;\n var semantics = ['danger', 'warning', 'success', 'information'];\n var colorMap = {\n danger: 'red',\n information: 'sky',\n success: 'green',\n warning: 'amber',\n };\n var getSemanticsStyle = function (color) {\n var mappedColor = colorMap[color];\n return mappedColor ? appearanceStyle('outline', mappedColor) : undefined;\n };\n var buttonClassName = cn(toastActionButtonVariants({ size: size, radius: radius, scaling: scaling }), color && semantics.includes(color)\n ? getSemanticsStyle(color)\n : appearanceStyle(appearance, color !== null && color !== void 0 ? color : 'red'), className);\n return (_jsx(ToastPrimitive.Action, __assign({ ref: ref, altText: altText }, props, { className: buttonClassName, asChild: true, children: _jsx(Button, { children: children }) })));\n});\nToastActionButton.displayName = 'Toast.ActionButton';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastActionButtonVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","ToastActionButton","forwardRef","_a","ref","className","children","_b","appearance","_c","altText","props","_d","useToastContext","_e","color","colorMap","danger","information","success","warning","buttonClassName","cn","includes","mappedColor","appearanceStyle","undefined","getSemanticsStyle","_jsx","ToastPrimitive","Action","asChild","Button","displayName"],"mappings":"2YAAA,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,EASWiB,EAA4BC,EAAI,uCAAwC,CAC/EC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,oDACPC,OAAQ,oDACRC,MAAO,wDACP,UAAW,yDAEfC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRM,QAAS,OACTJ,KAAM,YAGHO,EAAoBC,GAAW,SAAUC,EAAIC,GACpD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAKJ,EAAGK,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAKN,EAAGO,QAASA,OAAiB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ3B,EAAOmB,EAAI,CAAC,YAAa,WAAY,aAAc,YACzOS,EAAKC,IAAmBrB,EAASoB,EAAGpB,OAAQM,EAAUc,EAAGd,QAASJ,EAAOkB,EAAGlB,KAAMoB,EAAKF,EAAGG,MAAOA,OAAe,IAAPD,EAAgB,SAAWA,EAEpIE,EAAW,CACXC,OAAQ,MACRC,YAAa,MACbC,QAAS,QACTC,QAAS,SAMTC,EAAkBC,EAAGjC,EAA0B,CAAEK,KAAMA,EAAMF,OAAQA,EAAQM,QAASA,IAAYiB,GAXtF,CAAC,SAAU,UAAW,UAAW,eAWwEQ,SAASR,GAJ1G,SAAUA,GAC9B,IAAIS,EAAcR,EAASD,GAC3B,OAAOS,EAAcC,EAAgB,UAAWD,QAAeE,CACvE,CAEUC,CAAkBZ,GAClBU,EAAgBjB,EAAYO,QAAqCA,EAAQ,OAAQV,GACvF,OAAQuB,EAAKC,EAAeC,OAAQ7D,EAAS,CAAEmC,IAAKA,EAAKM,QAASA,GAAWC,EAAO,CAAEN,UAAWgB,EAAiBU,SAAS,EAAMzB,SAAUsB,EAAKI,EAAQ,CAAE1B,SAAUA,MACxK,IACAL,EAAkBgC,YAAc"}
|
@@ -14,7 +14,7 @@ export interface ToastProps extends VariantProps<typeof toastVariants>, VariantP
|
|
14
14
|
setOpenToast?: Dispatch<SetStateAction<boolean>>;
|
15
15
|
}
|
16
16
|
export declare const toastVariants: (props?: ({
|
17
|
-
radius?: "
|
17
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
18
18
|
size?: "small" | "medium" | "large" | "x-large" | null | undefined;
|
19
19
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
20
20
|
color?: "danger" | "warning" | "success" | "information" | 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++) {
|
@@ -21,11 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
22
|
return t;
|
22
23
|
};
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import { forwardRef, createContext, useContext,
|
25
|
+
import { forwardRef, createContext, useContext, } from 'react';
|
25
26
|
import { cva } from 'class-variance-authority';
|
26
27
|
import { cn } from '../../../lib/utils/utils';
|
27
28
|
import { scalingVariants } from '../../../lib/constants';
|
28
29
|
import * as ToastPrimitive from '@radix-ui/react-toast';
|
30
|
+
import { useTheme } from '../../../lib/theme';
|
29
31
|
export var toastVariants = cva('flex bg-white dark:bg-slateDark-1', {
|
30
32
|
variants: {
|
31
33
|
radius: {
|
@@ -81,9 +83,15 @@ export var useToastContext = function () {
|
|
81
83
|
};
|
82
84
|
export var ToastRoot = forwardRef(function (_a, ref) {
|
83
85
|
var className = _a.className, children = _a.children, openToast = _a.openToast, radius = _a.radius, scaling = _a.scaling, size = _a.size, color = _a.color, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.toastPosition, toastPosition = _c === void 0 ? 'top_right' : _c, setOpenToast = _a.setOpenToast, props = __rest(_a, ["className", "children", "openToast", "radius", "scaling", "size", "color", "duration", "toastPosition", "setOpenToast"]);
|
84
|
-
var
|
86
|
+
var theme = useTheme().theme;
|
87
|
+
var contextValue = {
|
88
|
+
radius: theme.themeRadius || radius,
|
89
|
+
scaling: theme.themeScaling || scaling,
|
90
|
+
color: color,
|
91
|
+
size: size,
|
92
|
+
};
|
85
93
|
var toastRootStyle = "\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ";
|
86
|
-
var toastClassName = cn(toastVariants(
|
94
|
+
var toastClassName = cn(toastVariants(contextValue), toastRootStyle, className);
|
87
95
|
return (_jsx(ToastContext.Provider, { value: contextValue, children: _jsxs(ToastPrimitive.Provider, { swipeDirection: "right", duration: duration, children: [_jsx(ToastPrimitive.Root, __assign({ ref: ref, className: toastClassName, open: openToast, onOpenChange: setOpenToast }, props, { children: children })), _jsx(ToastPrimitive.Viewport, { className: cn(toastViewportVariants({ toastPosition: toastPosition })) })] }) }));
|
88
96
|
});
|
89
97
|
ToastRoot.displayName = 'Toast.Root';
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
"use client";
|
2
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as r,forwardRef as a,useContext as o}from"react";import{cva as n}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{scalingVariants as s}from"../../constants.mjs";import*as l from"@radix-ui/react-toast";import{useTheme as p}from"../../theme/ThemeProvider.mjs";var d=function(){return d=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)},m=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(t);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(r[a[o]]=t[a[o]])}return r},c=n("flex bg-white dark:bg-slateDark-1",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"w-[300px] min-h-[55px] p-3",medium:"w-[400px] min-h-[63px] p-3",large:"w-[400px] min-h-[84px] p-4","x-large":"w-[400px] min-h-[88px] p-4"},scaling:d({},s),color:{danger:"bg-red-3 dark:bg-redDark-3",warning:"bg-amber-3 dark:bg-amberDark-3",success:"bg-green-3 dark:bg-greenDark-3",information:"bg-sky-3 dark:bg-skyDark-3"}},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),u=n("[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]",{variants:{toastPosition:{top_center:"top-0 left-1/2 transform -translate-x-1/2",top_left:"top-0 left-0",top_right:"top-0 right-0",bottom_center:"bottom-0 left-1/2 transform -translate-x-1/2",bottom_left:"bottom-0 left-0",bottom_right:"bottom-0 right-0"}},defaultVariants:{toastPosition:"top_right"}}),f=r({radius:"medium",scaling:"100%",size:"medium",color:null}),g=function(){return o(f)},x=a((function(r,a){var o=r.className,n=r.children,s=r.openToast,g=r.radius,x=r.scaling,h=r.size,_=r.color,b=r.duration,v=void 0===b?3e3:b,w=r.toastPosition,y=void 0===w?"top_right":w,O=r.setOpenToast,k=m(r,["className","children","openToast","radius","scaling","size","color","duration","toastPosition","setOpenToast"]),P=p().theme,j={radius:P.themeRadius||g,scaling:P.themeScaling||x,color:_,size:h},z=i(c(j),"\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ",o);return t(f.Provider,{value:j,children:e(l.Provider,{swipeDirection:"right",duration:v,children:[t(l.Root,d({ref:a,className:z,open:s,onOpenChange:O},k,{children:n})),t(l.Viewport,{className:i(u({toastPosition:y}))})]})})}));x.displayName="Toast.Root";export{x as ToastRoot,x as default,c as toastVariants,u as toastViewportVariants,g as useToastContext};
|
2
3
|
//# sourceMappingURL=ToastRoot.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ToastRoot.mjs","sources":[
|
1
|
+
{"version":3,"file":"ToastRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -8,7 +8,7 @@ export interface ToggleWithTextProps extends VariantProps<typeof toggleWithTextV
|
|
8
8
|
size?: 'small' | 'medium' | 'large';
|
9
9
|
}
|
10
10
|
declare const toggleWithTextVariants: (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
14
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
@@ -27,6 +27,7 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
27
27
|
import { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';
|
28
28
|
import { scalingVariants } from '../../../lib/constants';
|
29
29
|
import { cn } from '../../../lib/utils/utils';
|
30
|
+
import { useTheme } from '../../../lib/theme';
|
30
31
|
var toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {
|
31
32
|
variants: {
|
32
33
|
radius: __assign({}, radiusVariants['base']),
|
@@ -50,7 +51,14 @@ export var IconScaling = {
|
|
50
51
|
};
|
51
52
|
export var ToggleWithText = forwardRef(function (_a, ref) {
|
52
53
|
var className = _a.className, children = _a.children, 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 ? 'surface' : _d, text = _a.text, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance", "text"]);
|
53
|
-
|
54
|
+
var theme = useTheme().theme;
|
55
|
+
var contextValue = {
|
56
|
+
radius: theme.themeRadius || radius,
|
57
|
+
scaling: theme.themeScaling || scaling,
|
58
|
+
color: theme.themeColor || color,
|
59
|
+
size: size,
|
60
|
+
};
|
61
|
+
return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {
|
54
62
|
return React.cloneElement(child, { className: IconScaling[size] });
|
55
63
|
}), text] })));
|
56
64
|
});
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsxs as e}from"react/jsx-runtime";import
|
1
|
+
import{jsxs as e}from"react/jsx-runtime";import r,{forwardRef as t,Children as a}from"react";import{cva as i}from"class-variance-authority";import*as o from"@radix-ui/react-toggle";import{radiusVariants as s,scalingVariants as n,toggleAppearanceStyle as m}from"../../constants.mjs";import{cn as l}from"../../utils/utils.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var p=function(){return p=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},p.apply(this,arguments)},u=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)r.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(t[a[i]]=e[a[i]])}return t},f=i("flex items-center justify-center box-border font-medium w-fit",{variants:{radius:p({},s.base),size:{small:"h-6 px-2 text-xs gap-1",medium:"h-8 px-3 text-sm gap-2",large:"h-10 px-4 text-base gap-3"},scaling:p({},n)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},g=t((function(t,i){var s=t.className,n=t.children,g=t.radius,h=t.size,x=void 0===h?"medium":h,y=t.scaling,b=t.color,v=void 0===b?"red":b,O=t.appearance,j=void 0===O?"surface":O,w=t.text,z=u(t,["className","children","radius","size","scaling","color","appearance","text"]),N=c().theme,P={radius:N.themeRadius||g,scaling:N.themeScaling||y,color:N.themeColor||v,size:x};return e(o.Root,p({ref:i,className:l(f(P),m(j,P.color,!0,"data-[state=on]:"),s)},z,{children:[a.map(n,(function(e){return r.cloneElement(e,{className:d[x]})})),w]}))}));g.displayName="ToggleWithText";export{d as IconScaling,g as ToggleWithText,g as default};
|
2
2
|
//# sourceMappingURL=ToggleWithText.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ToggleWithText.mjs","sources":["../../../lib/components/Toggle/ToggleWithText.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 { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nvar toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'h-6 px-2 text-xs gap-1',\n medium: 'h-8 px-3 text-sm gap-2',\n large: 'h-10 px-4 text-base gap-3',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleWithText = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, 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 ? 'surface' : _d, text = _a.text, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\", \"text\"]);\n return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants(
|
1
|
+
{"version":3,"file":"ToggleWithText.mjs","sources":["../../../lib/components/Toggle/ToggleWithText.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 { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nvar toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'h-6 px-2 text-xs gap-1',\n medium: 'h-8 px-3 text-sm gap-2',\n large: 'h-10 px-4 text-base gap-3',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleWithText = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, 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 ? 'surface' : _d, text = _a.text, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\", \"text\"]);\n var theme = useTheme().theme;\n var contextValue = {\n radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n size: size,\n };\n return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }), text] })));\n});\nToggleWithText.displayName = 'ToggleWithText';\nexport default ToggleWithText;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleWithTextVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","ToggleWithText","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","text","props","theme","useTheme","contextValue","themeRadius","themeScaling","themeColor","_jsxs","TogglePrimitive","Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"8XAAA,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,EAAyBC,EAAI,gEAAiE,CAC9FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,yBACPC,OAAQ,yBACRC,MAAO,6BAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAAiBC,GAAW,SAAUC,EAAIC,GACjD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAOT,EAAGS,KAAMC,EAAQ9B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,aAAc,SACrXW,EAAQC,IAAWD,MACnBE,EAAe,CACfzB,OAAQuB,EAAMG,aAAe1B,EAC7BM,QAASiB,EAAMI,cAAgBrB,EAC/BY,MAAOK,EAAMK,YAAcV,EAC3BhB,KAAMA,GAEV,OAAQ2B,EAAMC,EAAgBC,KAAMtD,EAAS,CAAEoC,IAAKA,EAAKC,UAAWkB,EAAGnC,EAAuB4B,GAAeQ,EAAsBb,EAAYK,EAAaP,OAAO,EAAM,oBAAqBJ,IAAcQ,EAAO,CAAEP,SAAU,CAACmB,EAASC,IAAIpB,GAAU,SAAUqB,GACrP,OAAOC,EAAMC,aAAaF,EAAO,CAAEtB,UAAWL,EAAYP,IAC1E,IAAgBmB,KAChB,IACAX,EAAe6B,YAAc"}
|
@@ -8,7 +8,7 @@ export interface ToggleProps extends VariantProps<typeof toggleVariants> {
|
|
8
8
|
appearance?: IAppearance;
|
9
9
|
}
|
10
10
|
declare const toggleVariants: (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
14
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
27
27
|
import { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
export * from './ToggleWithText';
|
30
31
|
var toggleVariants = cva('grid place-content-center items-center justify-center box-border"', {
|
31
32
|
variants: {
|
@@ -50,7 +51,14 @@ export var IconScaling = {
|
|
50
51
|
};
|
51
52
|
export var Toggle = forwardRef(function (_a, ref) {
|
52
53
|
var className = _a.className, children = _a.children, 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 ? 'surface' : _d, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
|
53
|
-
|
54
|
+
var theme = useTheme().theme;
|
55
|
+
var contextValue = {
|
56
|
+
radius: theme.themeRadius || radius,
|
57
|
+
scaling: theme.themeScaling || scaling,
|
58
|
+
color: theme.themeColor || color,
|
59
|
+
size: size,
|
60
|
+
};
|
61
|
+
return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {
|
54
62
|
return React.cloneElement(child, { className: IconScaling[size] });
|
55
63
|
}) })));
|
56
64
|
});
|