@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
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{cva as a}from"class-variance-authority";import{scalingVariants as o}from"../../constants.mjs";import{Theme as t,Progress as
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{cva as a}from"class-variance-authority";import{scalingVariants as o}from"../../constants.mjs";import{Theme as t,Progress as i}from"@radix-ui/themes";import{cn as l}from"../../utils/utils.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var s=function(){return s=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},s.apply(this,arguments)},m=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},u=a("w-[300px]",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded-full",large:"rounded-full",full:"rounded-full"},size:{small:"h-1",medium:"h-[6px]",large:"h-2"},scaling:s({},o)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),c=e((function(e,a){var o=e.className,c=e.radius,d=e.size,p=e.value,f=e.appearance,h=void 0===f?"surface":f,v=e.color,g=void 0===v?"red":v,y=e.scaling,O=m(e,["className","radius","size","value","appearance","color","scaling"]),j=n().theme,b={radius:j.themeRadius||c,scaling:j.themeScaling||y,color:j.themeColor||g,size:d};return r(t,{accentColor:b.color,children:r(i,s({ref:a,value:p,variant:h,className:l(u(b),o)},O))})}));c.displayName="Progress";export{c as Progress,c as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Progress/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 { scalingVariants } from '../../../lib/constants';\nimport { Theme, Progress as ProgressTheme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nvar progressVariants = cva('w-[300px]', {\n variants: {\n radius: {\n none: 'rounded-none',\n small: 'rounded-[3px]',\n medium: 'rounded-full',\n large: 'rounded-full',\n full: 'rounded-full',\n },\n size: {\n small: 'h-1',\n medium: 'h-[6px]',\n large: 'h-2',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var Progress = forwardRef(function (_a, ref) {\n var className = _a.className, radius = _a.radius, size = _a.size, value = _a.value, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, scaling = _a.scaling, props = __rest(_a, [\"className\", \"radius\", \"size\", \"value\", \"appearance\", \"color\", \"scaling\"]);\n return (_jsx(Theme, { accentColor: color, children: _jsx(ProgressTheme, __assign({ ref: ref, value: value, variant: appearance, className: cn(progressVariants(
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Progress/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 { scalingVariants } from '../../../lib/constants';\nimport { Theme, Progress as ProgressTheme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nvar progressVariants = cva('w-[300px]', {\n variants: {\n radius: {\n none: 'rounded-none',\n small: 'rounded-[3px]',\n medium: 'rounded-full',\n large: 'rounded-full',\n full: 'rounded-full',\n },\n size: {\n small: 'h-1',\n medium: 'h-[6px]',\n large: 'h-2',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var Progress = forwardRef(function (_a, ref) {\n var className = _a.className, radius = _a.radius, size = _a.size, value = _a.value, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, scaling = _a.scaling, props = __rest(_a, [\"className\", \"radius\", \"size\", \"value\", \"appearance\", \"color\", \"scaling\"]);\n var theme = useTheme().theme;\n var progressStyle = {\n radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n size: size,\n };\n return (\n // @ts-ignore\n _jsx(Theme, { accentColor: progressStyle.color, children: _jsx(ProgressTheme, __assign({ ref: ref, value: value, variant: appearance, className: cn(progressVariants(progressStyle), className) }, props)) }));\n});\nProgress.displayName = 'Progress';\nexport default Progress;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","progressVariants","cva","variants","radius","none","small","medium","large","full","size","scaling","scalingVariants","defaultVariants","Progress","forwardRef","_a","ref","className","value","_b","appearance","_c","color","props","theme","useTheme","progressStyle","themeRadius","themeScaling","themeColor","_jsx","Theme","accentColor","children","ProgressTheme","variant","cn","displayName"],"mappings":"2UAAA,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,EAAmBC,EAAI,YAAa,CACpCC,SAAU,CACNC,OAAQ,CACJC,KAAM,eACNC,MAAO,gBACPC,OAAQ,eACRC,MAAO,eACPC,KAAM,gBAEVC,KAAM,CACFJ,MAAO,MACPC,OAAQ,UACRC,MAAO,OAEXG,QAAS9B,EAAS,CAAE,EAAE+B,IAE1BC,gBAAiB,CACbT,OAAQ,SACRM,KAAM,SACNC,QAAS,UAGNG,EAAWC,GAAW,SAAUC,EAAIC,GAC3C,IAAIC,EAAYF,EAAGE,UAAWd,EAASY,EAAGZ,OAAQM,EAAOM,EAAGN,KAAMS,EAAQH,EAAGG,MAAOC,EAAKJ,EAAGK,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAKN,EAAGO,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIX,EAAUK,EAAGL,QAASa,EAAQ5B,EAAOoB,EAAI,CAAC,YAAa,SAAU,OAAQ,QAAS,aAAc,QAAS,YAC7SS,EAAQC,IAAWD,MACnBE,EAAgB,CAChBvB,OAAQqB,EAAMG,aAAexB,EAC7BO,QAASc,EAAMI,cAAgBlB,EAC/BY,MAAOE,EAAMK,YAAcP,EAC3Bb,KAAMA,GAEV,OAEAqB,EAAKC,EAAO,CAAEC,YAAaN,EAAcJ,MAAOW,SAAUH,EAAKI,EAAetD,EAAS,CAAEoC,IAAKA,EAAKE,MAAOA,EAAOiB,QAASf,EAAYH,UAAWmB,EAAGpC,EAAiB0B,GAAgBT,IAAcM,KACvM,IACAV,EAASwB,YAAc"}
|
@@ -52,7 +52,7 @@ var radarChartVariants = cva('', {
|
|
52
52
|
});
|
53
53
|
export var RadarChart = function (_a) {
|
54
54
|
var className = _a.className, title = _a.title, legend = _a.legend, datalabels = _a.datalabels, datasets = _a.datasets, labels = _a.labels, width = _a.width, height = _a.height, scaling = _a.scaling, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, ["className", "title", "legend", "datalabels", "datasets", "labels", "width", "height", "scaling", "appearance", "isColorMixed"]);
|
55
|
-
var _d = useDarkMode(true),
|
55
|
+
var _d = useDarkMode(true), defaultScales = _d[1];
|
56
56
|
var getChartColor = function (isColorMixed, appearance) {
|
57
57
|
if (appearance === 'solid') {
|
58
58
|
return isColorMixed ? chartColorList.mixed : chartColorList.sorting;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/RadarChart/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};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nimport { Radar } from 'react-chartjs-2';\nimport { cn } from '../../../lib/utils/utils';\nimport { Chart as ChartJS, registerables } from 'chart.js';\nimport { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';\nimport { useDarkMode } from '../../../lib/utils/useDarkMode';\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\nChartJS.register.apply(ChartJS, __spreadArray(__spreadArray([], registerables, false), [ChartDataLabels], false));\nChartJS.defaults.set('plugins.datalabels', {\n display: false,\n});\nvar radarChartVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var RadarChart = function (_a) {\n var className = _a.className, title = _a.title, legend = _a.legend, datalabels = _a.datalabels, datasets = _a.datasets, labels = _a.labels, width = _a.width, height = _a.height, scaling = _a.scaling, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, [\"className\", \"title\", \"legend\", \"datalabels\", \"datasets\", \"labels\", \"width\", \"height\", \"scaling\", \"appearance\", \"isColorMixed\"]);\n var _d = useDarkMode(true),
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/RadarChart/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};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nimport { Radar } from 'react-chartjs-2';\nimport { cn } from '../../../lib/utils/utils';\nimport { Chart as ChartJS, registerables } from 'chart.js';\nimport { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';\nimport { useDarkMode } from '../../../lib/utils/useDarkMode';\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\nChartJS.register.apply(ChartJS, __spreadArray(__spreadArray([], registerables, false), [ChartDataLabels], false));\nChartJS.defaults.set('plugins.datalabels', {\n display: false,\n});\nvar radarChartVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var RadarChart = function (_a) {\n var className = _a.className, title = _a.title, legend = _a.legend, datalabels = _a.datalabels, datasets = _a.datasets, labels = _a.labels, width = _a.width, height = _a.height, scaling = _a.scaling, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, [\"className\", \"title\", \"legend\", \"datalabels\", \"datasets\", \"labels\", \"width\", \"height\", \"scaling\", \"appearance\", \"isColorMixed\"]);\n var _d = useDarkMode(true), defaultScales = _d[1];\n var getChartColor = function (isColorMixed, appearance) {\n if (appearance === 'solid') {\n return isColorMixed ? chartColorList.mixed : chartColorList.sorting;\n }\n if (appearance === 'soft') {\n return isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;\n }\n };\n datasets.forEach(function (dataset, index) {\n var ChartColor = getChartColor(isColorMixed, appearance);\n var BorderColor = getChartColor(isColorMixed, 'solid');\n if (!ChartColor || !BorderColor)\n return;\n dataset.backgroundColor = ChartColor[index];\n dataset.borderColor = BorderColor[index];\n });\n return (_jsx(Radar, __assign({ data: { labels: labels, datasets: datasets }, options: {\n plugins: {\n title: title,\n legend: legend,\n datalabels: datalabels,\n },\n scales: __assign({ r: {\n suggestedMin: 50,\n suggestedMax: 100,\n } }, defaultScales.linescale),\n }, className: cn(radarChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));\n};\nRadarChart.displayName = 'RadarChart';\nexport default RadarChart;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__spreadArray","to","from","pack","ar","l","Array","slice","concat","ChartJS","register","registerables","ChartDataLabels","defaults","set","display","radarChartVariants","cva","variants","scaling","scalingVariants","defaultVariants","RadarChart","_a","className","title","legend","datalabels","datasets","labels","width","height","_b","appearance","_c","isColorMixed","props","defaultScales","useDarkMode","getChartColor","chartColorList","mixed","sorting","chartAlphaColorList","forEach","dataset","index","ChartColor","BorderColor","backgroundColor","borderColor","_jsx","Radar","data","options","plugins","scales","r","suggestedMin","suggestedMax","linescale","cn","displayName"],"mappings":"2cAAA,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,EACIiB,EAAgD,SAAUC,EAAIC,EAAMC,GACpE,GAAIA,GAA6B,IAArBhB,UAAUC,OAAc,IAAK,IAA4BgB,EAAxBnB,EAAI,EAAGoB,EAAIH,EAAKd,OAAYH,EAAIoB,EAAGpB,KACxEmB,GAAQnB,KAAKiB,IACRE,IAAIA,EAAKE,MAAMhB,UAAUiB,MAAMf,KAAKU,EAAM,EAAGjB,IAClDmB,EAAGnB,GAAKiB,EAAKjB,IAGrB,OAAOgB,EAAGO,OAAOJ,GAAME,MAAMhB,UAAUiB,MAAMf,KAAKU,GACtD,EAUAO,EAAQC,SAASjB,MAAMgB,EAAST,EAAcA,EAAc,GAAIW,GAAe,GAAQ,CAACC,IAAkB,IAC1GH,EAAQI,SAASC,IAAI,qBAAsB,CACvCC,SAAS,IAEb,IAAIC,EAAqBC,EAAI,GAAI,CAC7BC,SAAU,CACNC,QAASvC,EAAS,CAAE,EAAEwC,IAE1BC,gBAAiB,CACbF,QAAS,UAGNG,EAAa,SAAUC,GAC9B,IAAIC,EAAYD,EAAGC,UAAWC,EAAQF,EAAGE,MAAOC,EAASH,EAAGG,OAAQC,EAAaJ,EAAGI,WAAYC,EAAWL,EAAGK,SAAUC,EAASN,EAAGM,OAAQC,EAAQP,EAAGO,MAAOC,EAASR,EAAGQ,OAAQZ,EAAUI,EAAGJ,QAASa,EAAKT,EAAGU,WAAYA,OAAoB,IAAPD,EAAgB,QAAUA,EAAIE,EAAKX,EAAGY,aAAcA,OAAsB,IAAPD,GAAuBA,EAAIE,EAAQzC,EAAO4B,EAAI,CAAC,YAAa,QAAS,SAAU,aAAc,WAAY,SAAU,QAAS,SAAU,UAAW,aAAc,iBAC/ac,EAAnBC,GAAY,GAA0B,GAC3CC,EAAgB,SAAUJ,EAAcF,GACxC,MAAmB,UAAfA,EACOE,EAAeK,EAAeC,MAAQD,EAAeE,QAE7C,SAAfT,EACOE,EAAeQ,EAAoBF,MAAQE,EAAoBD,aAD1E,CAGR,EASI,OARAd,EAASgB,SAAQ,SAAUC,EAASC,GAChC,IAAIC,EAAaR,EAAcJ,EAAcF,GACzCe,EAAcT,EAAcJ,EAAc,SACzCY,GAAeC,IAEpBH,EAAQI,gBAAkBF,EAAWD,GACrCD,EAAQK,YAAcF,EAAYF,GAC1C,IACYK,EAAKC,EAAOxE,EAAS,CAAEyE,KAAM,CAAExB,OAAQA,EAAQD,SAAUA,GAAY0B,QAAS,CAC9EC,QAAS,CACL9B,MAAOA,EACPC,OAAQA,EACRC,WAAYA,GAEhB6B,OAAQ5E,EAAS,CAAE6E,EAAG,CACdC,aAAc,GACdC,aAAc,MACbtB,EAAcuB,YACxBpC,UAAWqC,EAAG7C,EAAmB,CAAEG,QAASA,IAAYK,GAAYM,MAAOA,EAAOC,OAAQA,GAAUK,GAC/G,EACAd,EAAWwC,YAAc"}
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { Theme, Radio as RadioTheme, Flex } from '@radix-ui/themes';
|
27
27
|
import { Text } from '../../../lib/Typography/Text';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var radioVariants = cva('font-normal', {
|
30
31
|
variants: {
|
31
32
|
size: {
|
@@ -39,15 +40,20 @@ var radioVariants = cva('font-normal', {
|
|
39
40
|
},
|
40
41
|
});
|
41
42
|
export var Radio = forwardRef(function (_a, ref) {
|
42
|
-
var value = _a.value, scaling = _a.scaling,
|
43
|
-
|
44
|
-
color = 'red';
|
43
|
+
var value = _a.value, scaling = _a.scaling, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, children = _a.children, className = _a.className, props = __rest(_a, ["value", "scaling", "color", "size", "appearance", "children", "className"]);
|
44
|
+
var theme = useTheme().theme;
|
45
45
|
var sizeTheme = '2';
|
46
46
|
if (size === 'small')
|
47
47
|
sizeTheme = '1';
|
48
48
|
if (size === 'large')
|
49
49
|
sizeTheme = '3';
|
50
|
-
|
50
|
+
var radioStyle = {
|
51
|
+
scaling: theme.themeScaling || scaling,
|
52
|
+
color: theme.themeColor || color,
|
53
|
+
};
|
54
|
+
return (
|
55
|
+
// @ts-ignore
|
56
|
+
_jsx(Theme, { accentColor: radioStyle.color, scaling: radioStyle.scaling, children: _jsx(Flex, { asChild: true, className: cn(radioVariants({ size: size }), className), children: _jsxs(Text, { as: "label", size: sizeTheme, children: [_jsx(RadioTheme, __assign({ ref: ref, value: value, variant: appearance, size: sizeTheme }, props)), children] }) }) }));
|
51
57
|
});
|
52
58
|
Radio.displayName = 'Radio';
|
53
59
|
export default Radio;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{forwardRef as a}from"react";import{cva as t}from"class-variance-authority";import{Theme as
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{forwardRef as a}from"react";import{cva as t}from"class-variance-authority";import{Theme as o,Flex as i,Radio as l}from"@radix-ui/themes";import{Text as n}from"../../Typography/Text/index.mjs";import{cn as s}from"../../utils/utils.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var m=function(){return m=Object.assign||function(e){for(var r,a=1,t=arguments.length;a<t;a++)for(var o in r=arguments[a])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},m.apply(this,arguments)},p=function(e,r){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(a[t[o]]=e[t[o]])}return a},f=t("font-normal",{variants:{size:{small:"text-[12px] gap-2",medium:"text-[14px] gap-2",large:"text-[16px] gap-3"}},defaultVariants:{size:"medium"}}),u=a((function(a,t){var u=a.value,d=a.scaling,h=a.color,v=void 0===h?"red":h,g=a.size,y=void 0===g?"medium":g,x=a.appearance,O=void 0===x?"surface":x,b=a.children,j=a.className,z=p(a,["value","scaling","color","size","appearance","children","className"]),P=c().theme,w="2";"small"===y&&(w="1"),"large"===y&&(w="3");var N={scaling:P.themeScaling||d,color:P.themeColor||v};return e(o,{accentColor:N.color,scaling:N.scaling,children:e(i,{asChild:!0,className:s(f({size:y}),j),children:r(n,{as:"label",size:w,children:[e(l,m({ref:t,value:u,variant:O,size:w},z)),b]})})})}));u.displayName="Radio";export{u as Radio,u as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Radio/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 { forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Theme, Radio as RadioTheme, Flex } from '@radix-ui/themes';\nimport { Text } from '../../../lib/Typography/Text';\nimport { cn } from '../../../lib/utils/utils';\nvar radioVariants = cva('font-normal', {\n variants: {\n size: {\n small: 'text-[12px] gap-2',\n medium: 'text-[14px] gap-2',\n large: 'text-[16px] gap-3',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var Radio = forwardRef(function (_a, ref) {\n var value = _a.value, scaling = _a.scaling,
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Radio/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 { forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Theme, Radio as RadioTheme, Flex } from '@radix-ui/themes';\nimport { Text } from '../../../lib/Typography/Text';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nvar radioVariants = cva('font-normal', {\n variants: {\n size: {\n small: 'text-[12px] gap-2',\n medium: 'text-[14px] gap-2',\n large: 'text-[16px] gap-3',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var Radio = forwardRef(function (_a, ref) {\n var value = _a.value, scaling = _a.scaling, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.size, size = _c === void 0 ? 'medium' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, children = _a.children, className = _a.className, props = __rest(_a, [\"value\", \"scaling\", \"color\", \"size\", \"appearance\", \"children\", \"className\"]);\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 radioStyle = {\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n };\n return (\n // @ts-ignore\n _jsx(Theme, { accentColor: radioStyle.color, scaling: radioStyle.scaling, children: _jsx(Flex, { asChild: true, className: cn(radioVariants({ size: size }), className), children: _jsxs(Text, { as: \"label\", size: sizeTheme, children: [_jsx(RadioTheme, __assign({ ref: ref, value: value, variant: appearance, size: sizeTheme }, props)), children] }) }) }));\n});\nRadio.displayName = 'Radio';\nexport default Radio;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","radioVariants","cva","variants","size","small","medium","large","defaultVariants","Radio","forwardRef","_a","ref","value","scaling","_b","color","_c","_d","appearance","children","className","props","theme","useTheme","sizeTheme","radioStyle","themeScaling","themeColor","_jsx","Theme","accentColor","Flex","asChild","cn","_jsxs","Text","as","RadioTheme","variant","displayName"],"mappings":"6VAAA,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,EAAgBC,EAAI,cAAe,CACnCC,SAAU,CACNC,KAAM,CACFC,MAAO,oBACPC,OAAQ,oBACRC,MAAO,sBAGfC,gBAAiB,CACbJ,KAAM,YAGHK,EAAQC,GAAW,SAAUC,EAAIC,GACxC,IAAIC,EAAQF,EAAGE,MAAOC,EAAUH,EAAGG,QAASC,EAAKJ,EAAGK,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKN,EAAGP,KAAMA,OAAc,IAAPa,EAAgB,SAAWA,EAAIC,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAWT,EAAGS,SAAUC,EAAYV,EAAGU,UAAWC,EAAQ1B,EAAOe,EAAI,CAAC,QAAS,UAAW,QAAS,OAAQ,aAAc,WAAY,cACrVY,EAAQC,IAAWD,MACnBE,EAAY,IACH,UAATrB,IACAqB,EAAY,KACH,UAATrB,IACAqB,EAAY,KAChB,IAAIC,EAAa,CACbZ,QAASS,EAAMI,cAAgBb,EAC/BE,MAAOO,EAAMK,YAAcZ,GAE/B,OAEAa,EAAKC,EAAO,CAAEC,YAAaL,EAAWV,MAAOF,QAASY,EAAWZ,QAASM,SAAUS,EAAKG,EAAM,CAAEC,SAAS,EAAMZ,UAAWa,EAAGjC,EAAc,CAAEG,KAAMA,IAASiB,GAAYD,SAAUe,EAAMC,EAAM,CAAEC,GAAI,QAASjC,KAAMqB,EAAWL,SAAU,CAACS,EAAKS,EAAYzD,EAAS,CAAE+B,IAAKA,EAAKC,MAAOA,EAAO0B,QAASpB,EAAYf,KAAMqB,GAAaH,IAASF,QACnV,IACAX,EAAM+B,YAAc"}
|
@@ -4,7 +4,7 @@ import { RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
|
4
4
|
export interface RadioCardsItemProps extends VariantProps<typeof radioCardsItemVariants> {
|
5
5
|
}
|
6
6
|
export declare const radioCardsItemVariants: (props?: ({
|
7
|
-
radius?: "
|
7
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
8
8
|
size?: "small" | "medium" | "large" | null | undefined;
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
10
10
|
export declare const RadioCardsItem: React.ForwardRefExoticComponent<Omit<RadioCardsTheme.ItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & RadioCardsItemProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -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 { cva } from 'class-variance-authority';
|
|
26
27
|
import { scalingVariants } from '../../../lib/constants';
|
27
28
|
import { Theme, RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
28
29
|
import { cn } from '../../../lib/utils/utils';
|
30
|
+
import { useTheme } from '../../../lib/theme';
|
29
31
|
var radioCardsVariants = cva('flex items-center gap-2', {
|
30
32
|
variants: {
|
31
33
|
scaling: __assign({}, scalingVariants),
|
@@ -40,7 +42,15 @@ export var RadioCardsContext = createContext({
|
|
40
42
|
});
|
41
43
|
export var RadioCardsRoot = forwardRef(function (_a, ref) {
|
42
44
|
var children = _a.children, className = _a.className, radius = _a.radius, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, props = __rest(_a, ["children", "className", "radius", "scaling", "size", "color", "appearance"]);
|
43
|
-
var
|
44
|
-
|
45
|
+
var theme = useTheme().theme;
|
46
|
+
var contextValue = {
|
47
|
+
radius: theme.themeRadius || radius,
|
48
|
+
color: theme.themeColor || color,
|
49
|
+
scaling: theme.themeScaling || scaling,
|
50
|
+
size: size,
|
51
|
+
};
|
52
|
+
return (
|
53
|
+
// @ts-ignore
|
54
|
+
_jsx(Theme, { accentColor: contextValue.color, children: _jsx(RadioCardsContext.Provider, { value: contextValue, children: _jsx(RadioCardsTheme.Root, __assign({ ref: ref, variant: appearance, className: cn(radioCardsVariants({ scaling: contextValue.scaling }), className) }, props, { children: children })) }) }));
|
45
55
|
});
|
46
56
|
RadioCardsRoot.displayName = 'RadioCards.Root';
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
"use client";
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as e,forwardRef as t}from"react";import{cva as a}from"class-variance-authority";import{scalingVariants as o}from"../../constants.mjs";import{Theme as i,RadioCards as n}from"@radix-ui/themes";import{cn as s}from"../../utils/utils.mjs";import{useTheme as c}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 o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},l.apply(this,arguments)},m=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 o=0;for(a=Object.getOwnPropertySymbols(r);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(t[a[o]]=r[a[o]])}return t},p=a("flex items-center gap-2",{variants:{scaling:l({},o)},defaultVariants:{scaling:"100%"}}),u=e({radius:"medium",size:"medium"}),d=t((function(e,t){var a=e.children,o=e.className,d=e.radius,f=e.scaling,h=e.size,v=e.color,g=void 0===v?"red":v,y=e.appearance,O=void 0===y?"surface":y,j=m(e,["children","className","radius","scaling","size","color","appearance"]),b=c().theme,x={radius:b.themeRadius||d,color:b.themeColor||g,scaling:b.themeScaling||f,size:h};return r(i,{accentColor:x.color,children:r(u.Provider,{value:x,children:r(n.Root,l({ref:t,variant:O,className:s(p({scaling:x.scaling}),o)},j,{children:a}))})})}));d.displayName="RadioCards.Root";export{u as RadioCardsContext,d as RadioCardsRoot};
|
2
3
|
//# sourceMappingURL=RadioCardsRoot.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RadioCardsRoot.mjs","sources":[
|
1
|
+
{"version":3,"file":"RadioCardsRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -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++) {
|
@@ -25,6 +26,7 @@ import { createContext, forwardRef } from 'react';
|
|
25
26
|
import { Theme, RadioGroup as RadioGroupTheme } from '@radix-ui/themes';
|
26
27
|
import { cva } from 'class-variance-authority';
|
27
28
|
import { cn } from '../../../lib/utils/utils';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
28
30
|
var radioGroupVariants = cva('', {
|
29
31
|
variants: {
|
30
32
|
size: {
|
@@ -42,12 +44,19 @@ export var RadioGroupContext = createContext({
|
|
42
44
|
});
|
43
45
|
export var RadioGroupRoot = forwardRef(function (_a, ref) {
|
44
46
|
var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, props = __rest(_a, ["className", "children", "scaling", "size", "color", "appearance"]);
|
45
|
-
var
|
47
|
+
var theme = useTheme().theme;
|
48
|
+
var contextValue = {
|
49
|
+
scaling: theme.themeScaling || scaling,
|
50
|
+
color: theme.themeColor || color,
|
51
|
+
size: size,
|
52
|
+
};
|
46
53
|
var sizeTheme = '2';
|
47
54
|
if (size === 'small')
|
48
55
|
sizeTheme = '1';
|
49
56
|
if (size === 'large')
|
50
57
|
sizeTheme = '3';
|
51
|
-
return (
|
58
|
+
return (
|
59
|
+
// @ts-ignore
|
60
|
+
_jsx(Theme, { accentColor: contextValue.color, scaling: contextValue.scaling, children: _jsx(RadioGroupContext.Provider, { value: contextValue, children: _jsx(RadioGroupTheme.Root, __assign({ ref: ref, size: sizeTheme, variant: appearance, className: cn(radioGroupVariants({ size: size }), className) }, props, { children: children })) }) }));
|
52
61
|
});
|
53
62
|
RadioGroupRoot.displayName = 'RadioGroup.Root';
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
"use client";
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as r,forwardRef as a}from"react";import{Theme as o,RadioGroup as t}from"@radix-ui/themes";import{cva as i}from"class-variance-authority";import{cn as l}from"../../utils/utils.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var c=function(){return c=Object.assign||function(e){for(var r,a=1,o=arguments.length;a<o;a++)for(var t in r=arguments[a])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e},c.apply(this,arguments)},s=function(e,r){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(e);t<o.length;t++)r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(a[o[t]]=e[o[t]])}return a},m=i("",{variants:{size:{small:"gap-1",medium:"gap-2",large:"gap-3"}},defaultVariants:{size:"medium"}}),p=r({size:"medium"}),u=a((function(r,a){var i=r.className,u=r.children,f=r.scaling,d=r.size,h=r.color,g=void 0===h?"red":h,v=r.appearance,y=void 0===v?"surface":v,O=s(r,["className","children","scaling","size","color","appearance"]),b=n().theme,j={scaling:b.themeScaling||f,color:b.themeColor||g,size:d},z="2";return"small"===d&&(z="1"),"large"===d&&(z="3"),e(o,{accentColor:j.color,scaling:j.scaling,children:e(p.Provider,{value:j,children:e(t.Root,c({ref:a,size:z,variant:y,className:l(m({size:d}),i)},O,{children:u}))})})}));u.displayName="RadioGroup.Root";export{p as RadioGroupContext,u as RadioGroupRoot};
|
2
3
|
//# sourceMappingURL=RadioGroupRoot.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RadioGroupRoot.mjs","sources":[
|
1
|
+
{"version":3,"file":"RadioGroupRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -23,14 +23,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
24
|
import { forwardRef } from 'react';
|
25
25
|
import { Theme, ScrollArea as ScrollAreaTheme } from '@radix-ui/themes';
|
26
|
+
import { useTheme } from '../../../lib/theme';
|
26
27
|
export var ScrollArea = forwardRef(function (_a, ref) {
|
27
28
|
var className = _a.className, children = _a.children, scrollbars = _a.scrollbars, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'small' : _b, props = __rest(_a, ["className", "children", "scrollbars", "radius", "size"]);
|
29
|
+
var theme = useTheme().theme;
|
28
30
|
var sizeTheme = '1';
|
29
31
|
if (size === 'medium')
|
30
32
|
sizeTheme = '2';
|
31
33
|
if (size === 'large')
|
32
34
|
sizeTheme = '3';
|
33
|
-
return (_jsx(Theme, { children: _jsx(ScrollAreaTheme, __assign({ ref: ref, scrollbars: scrollbars, radius: radius, size: sizeTheme, className: className }, props, { children: children })) }));
|
35
|
+
return (_jsx(Theme, { children: _jsx(ScrollAreaTheme, __assign({ ref: ref, scrollbars: scrollbars, radius: theme.themeRadius || radius, size: sizeTheme, className: className }, props, { children: children })) }));
|
34
36
|
});
|
35
37
|
ScrollArea.displayName = 'ScrollArea';
|
36
38
|
export default ScrollArea;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Theme as t,ScrollArea as a}from"@radix-ui/themes";var l=function(){return l=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Theme as t,ScrollArea as a}from"@radix-ui/themes";import{useTheme as o}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 o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},l.apply(this,arguments)},i=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 o=0;for(a=Object.getOwnPropertySymbols(r);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(t[a[o]]=r[a[o]])}return t},s=e((function(e,s){var n=e.className,c=e.children,m=e.scrollbars,p=e.radius,f=e.size,u=void 0===f?"small":f,d=i(e,["className","children","scrollbars","radius","size"]),h=o().theme,y="1";return"medium"===u&&(y="2"),"large"===u&&(y="3"),r(t,{children:r(a,l({ref:s,scrollbars:m,radius:h.themeRadius||p,size:y,className:n},d,{children:c}))})}));s.displayName="ScrollArea";export{s as ScrollArea,s as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/ScrollArea/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 { Theme, ScrollArea as ScrollAreaTheme } from '@radix-ui/themes';\nexport var ScrollArea = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, scrollbars = _a.scrollbars, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'small' : _b, props = __rest(_a, [\"className\", \"children\", \"scrollbars\", \"radius\", \"size\"]);\n var sizeTheme = '1';\n if (size === 'medium')\n sizeTheme = '2';\n if (size === 'large')\n sizeTheme = '3';\n return (_jsx(Theme, { children: _jsx(ScrollAreaTheme, __assign({ ref: ref, scrollbars: scrollbars, radius: radius, size: sizeTheme, className: className }, props, { children: children })) }));\n});\nScrollArea.displayName = 'ScrollArea';\nexport default ScrollArea;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","ScrollArea","forwardRef","_a","ref","className","children","scrollbars","radius","_b","size","props","sizeTheme","_jsx","Theme","ScrollAreaTheme","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/ScrollArea/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 { Theme, ScrollArea as ScrollAreaTheme } from '@radix-ui/themes';\nimport { useTheme } from '../../../lib/theme';\nexport var ScrollArea = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, scrollbars = _a.scrollbars, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'small' : _b, props = __rest(_a, [\"className\", \"children\", \"scrollbars\", \"radius\", \"size\"]);\n var theme = useTheme().theme;\n var sizeTheme = '1';\n if (size === 'medium')\n sizeTheme = '2';\n if (size === 'large')\n sizeTheme = '3';\n return (_jsx(Theme, { children: _jsx(ScrollAreaTheme, __assign({ ref: ref, scrollbars: scrollbars, radius: theme.themeRadius || radius, size: sizeTheme, className: className }, props, { children: children })) }));\n});\nScrollArea.displayName = 'ScrollArea';\nexport default ScrollArea;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","ScrollArea","forwardRef","_a","ref","className","children","scrollbars","radius","_b","size","props","theme","useTheme","sizeTheme","_jsx","Theme","ScrollAreaTheme","themeRadius","displayName"],"mappings":"6LAAA,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,EAKWiB,EAAaC,GAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAaJ,EAAGI,WAAYC,EAASL,EAAGK,OAAQC,EAAKN,EAAGO,KAAMA,OAAc,IAAPD,EAAgB,QAAUA,EAAIE,EAAQf,EAAOO,EAAI,CAAC,YAAa,WAAY,aAAc,SAAU,SAC1NS,EAAQC,IAAWD,MACnBE,EAAY,IAKhB,MAJa,WAATJ,IACAI,EAAY,KACH,UAATJ,IACAI,EAAY,KACRC,EAAKC,EAAO,CAAEV,SAAUS,EAAKE,EAAiBpC,EAAS,CAAEuB,IAAKA,EAAKG,WAAYA,EAAYC,OAAQI,EAAMM,aAAeV,EAAQE,KAAMI,EAAWT,UAAWA,GAAaM,EAAO,CAAEL,SAAUA,MACxM,IACAL,EAAWkB,YAAc"}
|
@@ -27,6 +27,7 @@ import { SegmentedControl as SegmentedControlTheme, Theme } from '@radix-ui/them
|
|
27
27
|
import { scalingVariants } from '../../../lib/constants';
|
28
28
|
export * from './SegmentedControlItem';
|
29
29
|
import { cn } from '../../../lib/utils/utils';
|
30
|
+
import { useTheme } from '../../../lib/theme';
|
30
31
|
var segmentedControlVariants = cva('text-slateA-12 dark:text-slateDarkA-12', {
|
31
32
|
variants: {
|
32
33
|
scaling: __assign({}, scalingVariants),
|
@@ -37,11 +38,16 @@ var segmentedControlVariants = cva('text-slateA-12 dark:text-slateDarkA-12', {
|
|
37
38
|
});
|
38
39
|
export var SegmentedControlRoot = forwardRef(function (_a, ref) {
|
39
40
|
var children = _a.children, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.radius, radius = _c === void 0 ? 'medium' : _c, _d = _a.size, size = _d === void 0 ? 'medium' : _d, scaling = _a.scaling, props = __rest(_a, ["children", "className", "appearance", "radius", "size", "scaling"]);
|
41
|
+
var theme = useTheme().theme;
|
40
42
|
var sizeTheme = '2';
|
41
43
|
if (size === 'small')
|
42
44
|
sizeTheme = '1';
|
43
45
|
if (size === 'large')
|
44
46
|
sizeTheme = '3';
|
45
|
-
|
47
|
+
var contextValue = {
|
48
|
+
radius: theme.themeRadius || radius,
|
49
|
+
scaling: theme.themeScaling || scaling,
|
50
|
+
};
|
51
|
+
return (_jsx(Theme, { children: _jsx(SegmentedControlTheme.Root, __assign({ ref: ref, size: sizeTheme, radius: contextValue.radius, variant: appearance, className: cn(segmentedControlVariants({ scaling: contextValue.scaling }), className) }, props, { children: Children.map(children, function (child) { return React.cloneElement(child, { appearance: appearance }); }) })) }));
|
46
52
|
});
|
47
53
|
SegmentedControlRoot.displayName = 'SegmentedControl.Root';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import r,{forwardRef as t,Children as a}from"react";import{cva as n}from"class-variance-authority";import{Theme as
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r,{forwardRef as t,Children as a}from"react";import{cva as n}from"class-variance-authority";import{Theme as i,SegmentedControl as o}from"@radix-ui/themes";import{scalingVariants as s}from"../../constants.mjs";export{SegmentedControlItem}from"./SegmentedControlItem.mjs";import{cn as m}from"../../utils/utils.mjs";import{useTheme as l}from"../../theme/ThemeProvider.mjs";var c=function(){return c=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},c.apply(this,arguments)},p=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 n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]])}return t},u=n("text-slateA-12 dark:text-slateDarkA-12",{variants:{scaling:c({},s)},defaultVariants:{scaling:"100%"}}),d=t((function(t,n){var s=t.children,d=t.className,f=t.appearance,g=void 0===f?"surface":f,h=t.radius,v=void 0===h?"medium":h,y=t.size,O=void 0===y?"medium":y,j=t.scaling,b=p(t,["children","className","appearance","radius","size","scaling"]),x=l().theme,S="2";"small"===O&&(S="1"),"large"===O&&(S="3");var P={radius:x.themeRadius||v,scaling:x.themeScaling||j};return e(i,{children:e(o.Root,c({ref:n,size:S,radius:P.radius,variant:g,className:m(u({scaling:P.scaling}),d)},b,{children:a.map(s,(function(e){return r.cloneElement(e,{appearance:g})}))}))})}));d.displayName="SegmentedControl.Root";export{d as SegmentedControlRoot};
|
2
2
|
//# sourceMappingURL=SegmentedControlRoot.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SegmentedControlRoot.mjs","sources":["../../../lib/components/SegmentedControl/SegmentedControlRoot.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, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { SegmentedControl as SegmentedControlTheme, Theme } from '@radix-ui/themes';\nimport { scalingVariants } from '../../../lib/constants';\nexport * from './SegmentedControlItem';\nimport { cn } from '../../../lib/utils/utils';\nvar segmentedControlVariants = cva('text-slateA-12 dark:text-slateDarkA-12', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var SegmentedControlRoot = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.radius, radius = _c === void 0 ? 'medium' : _c, _d = _a.size, size = _d === void 0 ? 'medium' : _d, scaling = _a.scaling, props = __rest(_a, [\"children\", \"className\", \"appearance\", \"radius\", \"size\", \"scaling\"]);\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n if (size === 'large')\n sizeTheme = '3';\n return (_jsx(Theme, { children: _jsx(SegmentedControlTheme.Root, __assign({ ref: ref, size: sizeTheme, radius: radius, variant: appearance, className: cn(segmentedControlVariants({ scaling: scaling }), className) }, props, { children: Children.map(children, function (child) { return React.cloneElement(child, { appearance: appearance }); }) })) }));\n});\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","segmentedControlVariants","cva","variants","scaling","scalingVariants","defaultVariants","SegmentedControlRoot","forwardRef","_a","ref","children","className","_b","appearance","_c","radius","_d","size","props","sizeTheme","_jsx","Theme","SegmentedControlTheme","Root","variant","cn","Children","map","child","React","cloneElement","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"SegmentedControlRoot.mjs","sources":["../../../lib/components/SegmentedControl/SegmentedControlRoot.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, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { SegmentedControl as SegmentedControlTheme, Theme } from '@radix-ui/themes';\nimport { scalingVariants } from '../../../lib/constants';\nexport * from './SegmentedControlItem';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nvar segmentedControlVariants = cva('text-slateA-12 dark:text-slateDarkA-12', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var SegmentedControlRoot = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.radius, radius = _c === void 0 ? 'medium' : _c, _d = _a.size, size = _d === void 0 ? 'medium' : _d, scaling = _a.scaling, props = __rest(_a, [\"children\", \"className\", \"appearance\", \"radius\", \"size\", \"scaling\"]);\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 radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n };\n return (_jsx(Theme, { children: _jsx(SegmentedControlTheme.Root, __assign({ ref: ref, size: sizeTheme, radius: contextValue.radius, variant: appearance, className: cn(segmentedControlVariants({ scaling: contextValue.scaling }), className) }, props, { children: Children.map(children, function (child) { return React.cloneElement(child, { appearance: appearance }); }) })) }));\n});\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","segmentedControlVariants","cva","variants","scaling","scalingVariants","defaultVariants","SegmentedControlRoot","forwardRef","_a","ref","children","className","_b","appearance","_c","radius","_d","size","props","theme","useTheme","sizeTheme","contextValue","themeRadius","themeScaling","_jsx","Theme","SegmentedControlTheme","Root","variant","cn","Children","map","child","React","cloneElement","displayName"],"mappings":"iaAAA,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,EAA2BC,EAAI,yCAA0C,CACzEC,SAAU,CACNC,QAASvB,EAAS,CAAE,EAAEwB,IAE1BC,gBAAiB,CACbF,QAAS,UAGNG,EAAuBC,GAAW,SAAUC,EAAIC,GACvD,IAAIC,EAAWF,EAAGE,SAAUC,EAAYH,EAAGG,UAAWC,EAAKJ,EAAGK,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAKN,EAAGO,OAAQA,OAAgB,IAAPD,EAAgB,SAAWA,EAAIE,EAAKR,EAAGS,KAAMA,OAAc,IAAPD,EAAgB,SAAWA,EAAIb,EAAUK,EAAGL,QAASe,EAAQvB,EAAOa,EAAI,CAAC,WAAY,YAAa,aAAc,SAAU,OAAQ,YAClUW,EAAQC,IAAWD,MACnBE,EAAY,IACH,UAATJ,IACAI,EAAY,KACH,UAATJ,IACAI,EAAY,KAChB,IAAIC,EAAe,CACfP,OAAQI,EAAMI,aAAeR,EAC7BZ,QAASgB,EAAMK,cAAgBrB,GAEnC,OAAQsB,EAAKC,EAAO,CAAEhB,SAAUe,EAAKE,EAAsBC,KAAMhD,EAAS,CAAE6B,IAAKA,EAAKQ,KAAMI,EAAWN,OAAQO,EAAaP,OAAQc,QAAShB,EAAYF,UAAWmB,EAAG9B,EAAyB,CAAEG,QAASmB,EAAanB,UAAYQ,IAAcO,EAAO,CAAER,SAAUqB,EAASC,IAAItB,GAAU,SAAUuB,GAAS,OAAOC,EAAMC,aAAaF,EAAO,CAAEpB,WAAYA,WAClW,IACAP,EAAqB8B,YAAc"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Select as SelectTheme } from '@radix-ui/themes';
|
2
2
|
import React from 'react';
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
4
|
-
import { IScaling } from '../../../lib/types';
|
4
|
+
import { IRadius, IScaling } from '../../../lib/types';
|
5
5
|
export interface SelectProps extends VariantProps<typeof selectVariants> {
|
6
6
|
label?: string;
|
7
7
|
defaultValue?: string;
|
@@ -11,10 +11,12 @@ export interface SelectProps extends VariantProps<typeof selectVariants> {
|
|
11
11
|
scaling?: IScaling;
|
12
12
|
appearance?: 'classic' | 'surface' | 'soft' | 'ghost';
|
13
13
|
size?: 'small' | 'medium' | 'large';
|
14
|
+
radius?: IRadius;
|
14
15
|
}
|
15
16
|
declare const selectVariants: (props?: ({
|
16
|
-
radius?: "
|
17
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
17
18
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
19
|
+
export declare const useSelectContext: () => SelectProps;
|
18
20
|
export declare const Root: React.ForwardRefExoticComponent<SelectTheme.RootProps & SelectProps & React.RefAttributes<never>>;
|
19
21
|
export declare const Trigger: React.ForwardRefExoticComponent<Omit<SelectTheme.TriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
20
22
|
export declare const Content: React.ForwardRefExoticComponent<Omit<SelectTheme.ContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & SelectProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -22,10 +22,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
24
|
import { Theme, Select as SelectTheme } from '@radix-ui/themes';
|
25
|
-
import React from 'react';
|
25
|
+
import React, { createContext, useContext } from 'react';
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { radiusVariants, selectAppearanceStyle } from '../../../lib/constants';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var selectVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
radius: __assign({}, radiusVariants['base']),
|
@@ -34,34 +35,50 @@ var selectVariants = cva('', {
|
|
34
35
|
radius: 'medium',
|
35
36
|
},
|
36
37
|
});
|
38
|
+
var SelectContext = createContext({
|
39
|
+
size: 'medium',
|
40
|
+
scaling: '100%',
|
41
|
+
color: 'red',
|
42
|
+
radius: 'medium',
|
43
|
+
appearance: 'classic',
|
44
|
+
});
|
45
|
+
export var useSelectContext = function () {
|
46
|
+
return useContext(SelectContext);
|
47
|
+
};
|
37
48
|
export var Root = React.forwardRef(function (_a, ref) {
|
38
|
-
var scaling = _a.scaling, size = _a.size,
|
49
|
+
var scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, radius = _a.radius, appearance = _a.appearance, children = _a.children, props = __rest(_a, ["scaling", "size", "color", "radius", "appearance", "children"]);
|
50
|
+
var theme = useTheme().theme;
|
39
51
|
var sizeTheme = '2';
|
40
52
|
if (size === 'small')
|
41
53
|
sizeTheme = '1';
|
42
54
|
if (size === 'large')
|
43
55
|
sizeTheme = '3';
|
44
|
-
|
56
|
+
var contextValue = {
|
57
|
+
scaling: theme.themeScaling || scaling,
|
58
|
+
color: theme.themeColor || color,
|
59
|
+
radius: theme.themeRadius || radius,
|
60
|
+
size: size,
|
61
|
+
sizeTheme: sizeTheme,
|
62
|
+
appearance: appearance,
|
63
|
+
};
|
64
|
+
return (_jsx(SelectContext.Provider, { value: contextValue, children: _jsx(Theme, { scaling: contextValue.scaling, accentColor: contextValue.color, hasBackground: false, children: _jsx("div", { ref: ref, children: _jsx(SelectTheme.Root, __assign({ size: sizeTheme }, props, { children: children })) }) }) }));
|
45
65
|
});
|
46
66
|
Root.displayName = 'Select.Root';
|
47
67
|
export var Trigger = React.forwardRef(function (_a, forwardedRef) {
|
48
|
-
var
|
49
|
-
|
50
|
-
color = 'red';
|
68
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
69
|
+
var _b = useSelectContext(), _c = _b.radius, radius = _c === void 0 ? 'medium' : _c, color = _b.color, _d = _b.appearance, appearance = _d === void 0 ? 'classic' : _d;
|
51
70
|
return (_jsx(SelectTheme.Trigger, __assign({ ref: forwardedRef, variant: appearance, radius: radius, className: cn(selectVariants({ radius: radius }), selectAppearanceStyle(appearance, color), className) }, props, { children: children })));
|
52
71
|
});
|
53
72
|
Trigger.displayName = 'Select.Trigger';
|
54
73
|
export var Content = React.forwardRef(function (_a, forwardedRef) {
|
55
|
-
var
|
56
|
-
|
57
|
-
|
58
|
-
if (radius === 'full')
|
59
|
-
radius = 'large';
|
60
|
-
return (_jsx(SelectTheme.Content, __assign({ ref: forwardedRef, color: color }, props, { className: cn(selectVariants({ radius: radius }), className), children: children })));
|
74
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
75
|
+
var _b = useSelectContext(), radius = _b.radius, color = _b.color;
|
76
|
+
return (_jsx(SelectTheme.Content, __assign({ ref: forwardedRef, color: color }, props, { className: cn(selectVariants({ radius: radius == 'full' ? 'large' : radius }), className), children: children })));
|
61
77
|
});
|
62
78
|
Content.displayName = 'Select.Content';
|
63
79
|
export var Item = React.forwardRef(function (_a, forwardedRef) {
|
64
|
-
var value = _a.value, children = _a.children, className = _a.className,
|
80
|
+
var value = _a.value, children = _a.children, className = _a.className, props = __rest(_a, ["value", "children", "className"]);
|
81
|
+
var radius = useSelectContext().radius;
|
65
82
|
return (_jsx(SelectTheme.Item, __assign({ ref: forwardedRef, value: value }, props, { className: cn(selectVariants({ radius: radius }), className), children: children })));
|
66
83
|
});
|
67
84
|
Item.displayName = 'Select.Item';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Theme as r,Select as a}from"@radix-ui/themes";import i,{createContext as l,useContext as c}from"react";import{cva as n}from"class-variance-authority";import{cn as s}from"../../utils/utils.mjs";import{radiusVariants as t,selectAppearanceStyle as o}from"../../constants.mjs";import{useTheme as d}from"../../theme/ThemeProvider.mjs";var m=function(){return m=Object.assign||function(e){for(var r,a=1,i=arguments.length;a<i;a++)for(var l in r=arguments[a])Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);return e},m.apply(this,arguments)},u=function(e,r){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(a[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)r.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(a[i[l]]=e[i[l]])}return a},f=n("",{variants:{radius:m({},t.base)},defaultVariants:{radius:"medium"}}),p=l({size:"medium",scaling:"100%",color:"red",radius:"medium",appearance:"classic"}),h=function(){return c(p)},v=i.forwardRef((function(i,l){var c=i.scaling,n=i.size,s=i.color,t=void 0===s?"red":s,o=i.radius,f=i.appearance,h=i.children,v=u(i,["scaling","size","color","radius","appearance","children"]),N=d().theme,g="2";"small"===n&&(g="1"),"large"===n&&(g="3");var y={scaling:N.themeScaling||c,color:N.themeColor||t,radius:N.themeRadius||o,size:n,sizeTheme:g,appearance:f};return e(p.Provider,{value:y,children:e(r,{scaling:y.scaling,accentColor:y.color,hasBackground:!1,children:e("div",{ref:l,children:e(a.Root,m({size:g},v,{children:h}))})})})}));v.displayName="Select.Root";var N=i.forwardRef((function(r,i){var l=r.children,c=r.className,n=u(r,["children","className"]),t=h(),d=t.radius,p=void 0===d?"medium":d,v=t.color,N=t.appearance,g=void 0===N?"classic":N;return e(a.Trigger,m({ref:i,variant:g,radius:p,className:s(f({radius:p}),o(g,v),c)},n,{children:l}))}));N.displayName="Select.Trigger";var g=i.forwardRef((function(r,i){var l=r.children,c=r.className,n=u(r,["children","className"]),t=h(),o=t.radius,d=t.color;return e(a.Content,m({ref:i,color:d},n,{className:s(f({radius:"full"==o?"large":o}),c),children:l}))}));g.displayName="Select.Content";var y=i.forwardRef((function(r,i){var l=r.value,c=r.children,n=r.className,t=u(r,["value","children","className"]),o=h().radius;return e(a.Item,m({ref:i,value:l},t,{className:s(f({radius:o}),n),children:c}))}));y.displayName="Select.Item";var S=i.forwardRef((function(r,i){var l=r.children,c=r.className,n=u(r,["children","className"]);return e(a.Group,m({ref:i},n,{className:c,children:l}))}));S.displayName="Select.Group";var b=i.forwardRef((function(r,i){var l=r.children,c=r.className,n=u(r,["children","className"]);return e(a.Label,m({ref:i},n,{className:c,children:l}))}));b.displayName="Select.Label";var O=i.forwardRef((function(r,i){var l=r.children,c=r.className,n=u(r,["children","className"]);return e(a.Separator,m({ref:i},n,{className:c,children:l}))}));O.displayName="Select.Separator";var w={Root:v,Trigger:N,Content:g,Item:y,Group:S,Label:b,Separator:O};export{g as Content,S as Group,y as Item,b as Label,v as Root,O as Separator,N as Trigger,w as default,h as useSelectContext};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|