@lotte-innovate/ui-component-test 0.1.66 → 0.1.68
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +133 -133
- package/dist/globals.css +4 -4
- package/dist/lib/Typography/Header/index.d.ts +1 -1
- package/dist/lib/Typography/Text/index.d.ts +1 -1
- package/dist/lib/components/Accordion/index.d.ts +1 -0
- package/dist/lib/components/Accordion/index.js +18 -4
- package/dist/lib/components/Accordion/index.mjs +1 -1
- package/dist/lib/components/Accordion/index.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogAction.d.ts +2 -2
- package/dist/lib/components/AlertDialog/AlertDialogCancel.d.ts +2 -2
- package/dist/lib/components/AlertDialog/AlertDialogContent.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js +9 -6
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs +2 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.d.ts +2 -2
- package/dist/lib/components/AspectRatio/index.js +3 -1
- package/dist/lib/components/AspectRatio/index.mjs +1 -1
- package/dist/lib/components/AspectRatio/index.mjs.map +1 -1
- package/dist/lib/components/Avatar/index.d.ts +1 -1
- package/dist/lib/components/Avatar/index.js +9 -1
- package/dist/lib/components/Avatar/index.mjs +2 -1
- package/dist/lib/components/Avatar/index.mjs.map +1 -1
- package/dist/lib/components/Badge/index.d.ts +2 -2
- package/dist/lib/components/Badge/index.js +10 -1
- package/dist/lib/components/Badge/index.mjs +1 -1
- package/dist/lib/components/Badge/index.mjs.map +1 -1
- package/dist/lib/components/Button/index.d.ts +2 -2
- package/dist/lib/components/Button/index.js +10 -1
- package/dist/lib/components/Button/index.mjs +1 -1
- package/dist/lib/components/Button/index.mjs.map +1 -1
- package/dist/lib/components/Callout/CalloutRoot.d.ts +1 -1
- package/dist/lib/components/Callout/CalloutRoot.js +11 -3
- package/dist/lib/components/Callout/CalloutRoot.mjs +2 -1
- package/dist/lib/components/Callout/CalloutRoot.mjs.map +1 -1
- package/dist/lib/components/Card/index.d.ts +2 -2
- package/dist/lib/components/Card/index.js +8 -1
- package/dist/lib/components/Card/index.mjs +1 -1
- package/dist/lib/components/Card/index.mjs.map +1 -1
- package/dist/lib/components/Checkbox/index.d.ts +1 -1
- package/dist/lib/components/Checkbox/index.js +10 -2
- package/dist/lib/components/Checkbox/index.mjs +1 -1
- package/dist/lib/components/Checkbox/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxCard/index.d.ts +1 -1
- package/dist/lib/components/CheckboxCard/index.js +8 -1
- package/dist/lib/components/CheckboxCard/index.mjs +1 -1
- package/dist/lib/components/CheckboxCard/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +11 -2
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs +2 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuContent.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs +1 -0
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js +11 -2
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs +2 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.d.ts +1 -1
- package/dist/lib/components/DataList/DataListLabel.d.ts +1 -1
- package/dist/lib/components/DataList/DataListRoot.js +9 -2
- package/dist/lib/components/DataList/DataListRoot.mjs +2 -1
- package/dist/lib/components/DataList/DataListRoot.mjs.map +1 -1
- package/dist/lib/components/DataList/DataListValue.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogAction.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogCancel.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogContent.d.ts +1 -1
- package/dist/lib/components/Dialog/DialogRoot.js +9 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs +2 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +10 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs +2 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +1 -1
- package/dist/lib/components/HoverCard/HoverCardContent.d.ts +2 -2
- package/dist/lib/components/HoverCard/HoverCardRoot.js +10 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs +2 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs.map +1 -1
- package/dist/lib/components/IconButton/index.d.ts +1 -1
- package/dist/lib/components/IconButton/index.js +9 -1
- package/dist/lib/components/IconButton/index.mjs +1 -1
- package/dist/lib/components/IconButton/index.mjs.map +1 -1
- package/dist/lib/components/Inset/index.d.ts +1 -1
- package/dist/lib/components/Inset/index.js +7 -1
- package/dist/lib/components/Inset/index.mjs +1 -1
- package/dist/lib/components/Inset/index.mjs.map +1 -1
- package/dist/lib/components/Label/index.d.ts +1 -1
- package/dist/lib/components/Label/index.js +11 -3
- package/dist/lib/components/Label/index.mjs +1 -1
- package/dist/lib/components/Label/index.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarContent.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarItem.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarItemIndicator.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -0
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs +1 -0
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.js +13 -3
- package/dist/lib/components/Menubar/MenubarRoot.mjs +2 -1
- package/dist/lib/components/Menubar/MenubarRoot.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.d.ts +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +11 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs +2 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.d.ts +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.d.ts +2 -2
- package/dist/lib/components/Popover/PopoverClose.d.ts +1 -1
- package/dist/lib/components/Popover/PopoverContent.d.ts +1 -1
- package/dist/lib/components/Popover/PopoverRoot.js +8 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs +2 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs.map +1 -1
- package/dist/lib/components/Progress/index.d.ts +1 -1
- package/dist/lib/components/Progress/index.js +11 -1
- package/dist/lib/components/Progress/index.mjs +1 -1
- package/dist/lib/components/Progress/index.mjs.map +1 -1
- package/dist/lib/components/Radio/index.js +10 -4
- package/dist/lib/components/Radio/index.mjs +1 -1
- package/dist/lib/components/Radio/index.mjs.map +1 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.d.ts +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.js +12 -2
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs +2 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs.map +1 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js +11 -2
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs +2 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ScrollArea/index.js +3 -1
- package/dist/lib/components/ScrollArea/index.mjs +1 -1
- package/dist/lib/components/ScrollArea/index.mjs.map +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +7 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs.map +1 -1
- package/dist/lib/components/Select/index.d.ts +4 -2
- package/dist/lib/components/Select/index.js +30 -13
- package/dist/lib/components/Select/index.mjs +1 -1
- package/dist/lib/components/Select/index.mjs.map +1 -1
- package/dist/lib/components/Separator/index.js +7 -1
- package/dist/lib/components/Separator/index.mjs +1 -1
- package/dist/lib/components/Separator/index.mjs.map +1 -1
- package/dist/lib/components/Skeleton/index.d.ts +1 -1
- package/dist/lib/components/Skeleton/index.js +4 -1
- package/dist/lib/components/Skeleton/index.mjs +1 -1
- package/dist/lib/components/Skeleton/index.mjs.map +1 -1
- package/dist/lib/components/Slider/index.d.ts +1 -1
- package/dist/lib/components/Slider/index.js +13 -5
- package/dist/lib/components/Slider/index.mjs +1 -1
- package/dist/lib/components/Slider/index.mjs.map +1 -1
- package/dist/lib/components/Spinner/index.js +3 -1
- package/dist/lib/components/Spinner/index.mjs +1 -1
- package/dist/lib/components/Spinner/index.mjs.map +1 -1
- package/dist/lib/components/TabNav/index.js +6 -4
- package/dist/lib/components/TabNav/index.mjs +1 -1
- package/dist/lib/components/TabNav/index.mjs.map +1 -1
- package/dist/lib/components/Table/index.d.ts +1 -1
- package/dist/lib/components/Table/index.js +7 -1
- package/dist/lib/components/Table/index.mjs +1 -1
- package/dist/lib/components/Table/index.mjs.map +1 -1
- package/dist/lib/components/Tabs/index.d.ts +1 -1
- package/dist/lib/components/Tabs/index.js +4 -4
- package/dist/lib/components/Tabs/index.mjs +1 -1
- package/dist/lib/components/Tabs/index.mjs.map +1 -1
- package/dist/lib/components/TextArea/index.d.ts +1 -1
- package/dist/lib/components/TextArea/index.js +11 -4
- package/dist/lib/components/TextArea/index.mjs +1 -1
- package/dist/lib/components/TextArea/index.mjs.map +1 -1
- package/dist/lib/components/TextField/index.d.ts +1 -1
- package/dist/lib/components/TextField/index.js +11 -4
- package/dist/lib/components/TextField/index.mjs +1 -1
- package/dist/lib/components/TextField/index.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastActionButton.d.ts +1 -1
- package/dist/lib/components/Toast/ToastActionButton.js +2 -2
- package/dist/lib/components/Toast/ToastActionButton.mjs +1 -1
- package/dist/lib/components/Toast/ToastActionButton.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastRoot.d.ts +1 -1
- package/dist/lib/components/Toast/ToastRoot.js +11 -3
- package/dist/lib/components/Toast/ToastRoot.mjs +2 -1
- package/dist/lib/components/Toast/ToastRoot.mjs.map +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.js +9 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs.map +1 -1
- package/dist/lib/components/Toggle/index.d.ts +1 -1
- package/dist/lib/components/Toggle/index.js +9 -1
- package/dist/lib/components/Toggle/index.mjs +1 -1
- package/dist/lib/components/Toggle/index.mjs.map +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +10 -2
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs +2 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ToggleSwitch/index.d.ts +1 -1
- package/dist/lib/components/ToggleSwitch/index.js +13 -1
- package/dist/lib/components/ToggleSwitch/index.mjs +1 -1
- package/dist/lib/components/ToggleSwitch/index.mjs.map +1 -1
- package/dist/lib/components/Tooltip/index.d.ts +2 -2
- package/dist/lib/components/Tooltip/index.js +13 -8
- package/dist/lib/components/Tooltip/index.mjs +1 -1
- package/dist/lib/components/Tooltip/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/theme/ThemeProvider.d.ts +16 -0
- package/dist/lib/theme/ThemeProvider.js +29 -0
- package/dist/lib/theme/ThemeProvider.mjs +3 -0
- package/dist/lib/theme/ThemeProvider.mjs.map +1 -0
- package/dist/lib/theme/index.d.ts +2 -0
- package/dist/lib/theme/index.js +2 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/utils/useDarkMode.js +1 -0
- package/dist/lib/utils/useDarkMode.mjs +1 -0
- package/dist/lib/utils/useDarkMode.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +141 -141
- package/dist/.storybook/main.d.ts +0 -3
- package/dist/.storybook/main.js +0 -22
- package/dist/.storybook/manager.d.ts +0 -1
- package/dist/.storybook/manager.js +0 -12
- package/dist/.storybook/preview.d.ts +0 -8
- package/dist/.storybook/preview.js +0 -81
@@ -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","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YC,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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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
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Select/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, Select as SelectTheme } from '@radix-ui/themes';\nimport React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants, selectAppearanceStyle } from '../../../lib/constants';\nvar selectVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n },\n defaultVariants: {\n radius: 'medium',\n },\n});\nexport var Root = React.forwardRef(function (_a, ref) {\n var scaling = _a.scaling, size = _a.size, color = _a.color, children = _a.children, props = __rest(_a, [\"scaling\", \"size\", \"color\", \"children\"]);\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n if (size === 'large')\n sizeTheme = '3';\n return (_jsx(Theme, { scaling: scaling, accentColor: color, hasBackground: false, children: _jsx(\"div\", { ref: ref, children: _jsx(SelectTheme.Root, __assign({ size: sizeTheme }, props, { children: children })) }) }));\n});\nRoot.displayName = 'Select.Root';\nexport var Trigger = React.forwardRef(function (_a, forwardedRef) {\n var _b = _a.appearance, appearance = _b === void 0 ? 'classic' : _b, color = _a.color, size = _a.size, radius = _a.radius, children = _a.children, className = _a.className, props = __rest(_a, [\"appearance\", \"color\", \"size\", \"radius\", \"children\", \"className\"]);\n if (!color)\n color = 'red';\n return (_jsx(SelectTheme.Trigger, __assign({ ref: forwardedRef, variant: appearance, radius: radius, className: cn(selectVariants({ radius: radius }), selectAppearanceStyle(appearance, color), className) }, props, { children: children })));\n});\nTrigger.displayName = 'Select.Trigger';\nexport var Content = React.forwardRef(function (_a, forwardedRef) {\n var appearance = _a.appearance, color = _a.color, size = _a.size, radius = _a.radius, children = _a.children, className = _a.className, props = __rest(_a, [\"appearance\", \"color\", \"size\", \"radius\", \"children\", \"className\"]);\n if (!color)\n color = 'red';\n if (radius === 'full')\n radius = 'large';\n return (_jsx(SelectTheme.Content, __assign({ ref: forwardedRef, color: color }, props, { className: cn(selectVariants({ radius: radius }), className), children: children })));\n});\nContent.displayName = 'Select.Content';\nexport var Item = React.forwardRef(function (_a, forwardedRef) {\n var value = _a.value, children = _a.children, className = _a.className, radius = _a.radius, props = __rest(_a, [\"value\", \"children\", \"className\", \"radius\"]);\n return (_jsx(SelectTheme.Item, __assign({ ref: forwardedRef, value: value }, props, { className: cn(selectVariants({ radius: radius }), className), children: children })));\n});\nItem.displayName = 'Select.Item';\nexport var Group = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Group, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nGroup.displayName = 'Select.Group';\nexport var Label = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Label, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nLabel.displayName = 'Select.Label';\nexport var Separator = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Separator, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nSeparator.displayName = 'Select.Separator';\nvar Select = {\n Root: Root,\n Trigger: Trigger,\n Content: Content,\n Item: Item,\n Group: Group,\n Label: Label,\n Separator: Separator,\n};\nexport default Select;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","selectVariants","cva","variants","radius","radiusVariants","defaultVariants","Root","React","forwardRef","_a","ref","scaling","size","color","children","props","sizeTheme","_jsx","Theme","accentColor","hasBackground","SelectTheme","displayName","Trigger","forwardedRef","_b","appearance","className","variant","cn","selectAppearanceStyle","Content","Item","value","Group","Label","Separator","Select"],"mappings":"4RAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOIiB,EAAiBC,EAAI,GAAI,CACzBC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,OAE9CC,gBAAiB,CACbF,OAAQ,YAGLG,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAUF,EAAGE,QAASC,EAAOH,EAAGG,KAAMC,EAAQJ,EAAGI,MAAOC,EAAWL,EAAGK,SAAUC,EAAQpB,EAAOc,EAAI,CAAC,UAAW,OAAQ,QAAS,aAChIO,EAAY,IAKhB,MAJa,UAATJ,IACAI,EAAY,KACH,UAATJ,IACAI,EAAY,KACRC,EA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EACTC,KAAMA,EACNE,MAAOA,EACPC,MAAOA,EACPC,UAAWA"}
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Select/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, Select as SelectTheme } from '@radix-ui/themes';\nimport React, { createContext, useContext } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants, selectAppearanceStyle } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar selectVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n },\n defaultVariants: {\n radius: 'medium',\n },\n});\nvar SelectContext = createContext({\n size: 'medium',\n scaling: '100%',\n color: 'red',\n radius: 'medium',\n appearance: 'classic',\n});\nexport var useSelectContext = function () {\n return useContext(SelectContext);\n};\nexport var Root = React.forwardRef(function (_a, ref) {\n 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\"]);\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 color: theme.themeColor || color,\n radius: theme.themeRadius || radius,\n size: size,\n sizeTheme: sizeTheme,\n appearance: appearance,\n };\n 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 })) }) }) }));\n});\nRoot.displayName = 'Select.Root';\nexport var Trigger = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n var _b = useSelectContext(), _c = _b.radius, radius = _c === void 0 ? 'medium' : _c, color = _b.color, _d = _b.appearance, appearance = _d === void 0 ? 'classic' : _d;\n return (_jsx(SelectTheme.Trigger, __assign({ ref: forwardedRef, variant: appearance, radius: radius, className: cn(selectVariants({ radius: radius }), selectAppearanceStyle(appearance, color), className) }, props, { children: children })));\n});\nTrigger.displayName = 'Select.Trigger';\nexport var Content = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n var _b = useSelectContext(), radius = _b.radius, color = _b.color;\n return (_jsx(SelectTheme.Content, __assign({ ref: forwardedRef, color: color }, props, { className: cn(selectVariants({ radius: radius == 'full' ? 'large' : radius }), className), children: children })));\n});\nContent.displayName = 'Select.Content';\nexport var Item = React.forwardRef(function (_a, forwardedRef) {\n var value = _a.value, children = _a.children, className = _a.className, props = __rest(_a, [\"value\", \"children\", \"className\"]);\n var radius = useSelectContext().radius;\n return (_jsx(SelectTheme.Item, __assign({ ref: forwardedRef, value: value }, props, { className: cn(selectVariants({ radius: radius }), className), children: children })));\n});\nItem.displayName = 'Select.Item';\nexport var Group = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Group, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nGroup.displayName = 'Select.Group';\nexport var Label = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Label, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nLabel.displayName = 'Select.Label';\nexport var Separator = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, props = __rest(_a, [\"children\", \"className\"]);\n return (_jsx(SelectTheme.Separator, __assign({ ref: forwardedRef }, props, { className: className, children: children })));\n});\nSeparator.displayName = 'Select.Separator';\nvar Select = {\n Root: Root,\n Trigger: Trigger,\n Content: Content,\n Item: Item,\n Group: Group,\n Label: Label,\n Separator: Separator,\n};\nexport default Select;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","selectVariants","cva","variants","radius","radiusVariants","defaultVariants","SelectContext","createContext","size","scaling","color","appearance","useSelectContext","useContext","Root","React","forwardRef","_a","ref","_b","children","props","theme","useTheme","sizeTheme","contextValue","themeScaling","themeColor","themeRadius","_jsx","Provider","value","Theme","accentColor","hasBackground","SelectTheme","displayName","Trigger","forwardedRef","className","_c","_d","variant","cn","selectAppearanceStyle","Content","Item","Group","Label","Separator","Select"],"mappings":"yXAAA,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,E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,EACNC,MAAOA,EACPC,MAAOA,EACPC,UAAWA"}
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { bgColorStyle, scalingVariants } from '../../../lib/constants';
|
28
28
|
import { Separator as SeparatorTheme, Theme } from '@radix-ui/themes';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var separatorVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
scaling: __assign({}, scalingVariants),
|
@@ -34,6 +35,11 @@ var separatorVariants = cva('', {
|
|
34
35
|
});
|
35
36
|
export var Separator = React.forwardRef(function (_a, forwardedRef) {
|
36
37
|
var orientation = _a.orientation, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'slate' : _b, className = _a.className, children = _a.children, props = __rest(_a, ["orientation", "scaling", "size", "color", "className", "children"]);
|
38
|
+
var theme = useTheme().theme;
|
39
|
+
var separatorStyle = {
|
40
|
+
scaling: theme.themeScaling || scaling,
|
41
|
+
color: theme.themeColor || color,
|
42
|
+
};
|
37
43
|
var sizeTheme = '1';
|
38
44
|
if (size === 'medium')
|
39
45
|
sizeTheme = '2';
|
@@ -41,7 +47,7 @@ export var Separator = React.forwardRef(function (_a, forwardedRef) {
|
|
41
47
|
sizeTheme = '3';
|
42
48
|
if (size === 'fill-large')
|
43
49
|
sizeTheme = '4';
|
44
|
-
return (_jsx(Theme, { hasBackground: false, className: "flex items-center justify-center", children: _jsx(SeparatorTheme, __assign({ orientation: orientation, size: sizeTheme, className: cn("bg-".concat(color, "A-6 dark:bg-").concat(color, "DarkA-6"), separatorVariants({ scaling: scaling }), className) }, props, { children: children })) }));
|
50
|
+
return (_jsx(Theme, { hasBackground: false, className: "flex items-center justify-center", children: _jsx(SeparatorTheme, __assign({ orientation: orientation, size: sizeTheme, className: cn("bg-".concat(separatorStyle.color, "A-6 dark:bg-").concat(separatorStyle.color, "DarkA-6"), separatorVariants({ scaling: separatorStyle.scaling }), className) }, props, { children: children })) }));
|
45
51
|
});
|
46
52
|
Separator.displayName = 'Separator';
|
47
53
|
export default Separator;
|
@@ -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 t}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{scalingVariants as a,bgColorStyle as i}from"../../constants.mjs";import{Theme as n,Separator as c}from"@radix-ui/themes";import{useTheme as l}from"../../theme/ThemeProvider.mjs";var s=function(){return s=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var a in e=arguments[t])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},s.apply(this,arguments)},m=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(r);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(t[o[a]]=r[o[a]])}return t},f=t("",{variants:{scaling:s({},a),color:i()}}),p=e.forwardRef((function(e,t){var a=e.orientation,i=e.scaling,p=e.size,u=e.color,g=void 0===u?"slate":u,h=e.className,d=e.children,y=m(e,["orientation","scaling","size","color","className","children"]),O=l().theme,b={scaling:O.themeScaling||i,color:O.themeColor||g},j="1";return"medium"===p&&(j="2"),"large"===p&&(j="3"),"fill-large"===p&&(j="4"),r(n,{hasBackground:!1,className:"flex items-center justify-center",children:r(c,s({orientation:a,size:j,className:o("bg-".concat(b.color,"A-6 dark:bg-").concat(b.color,"DarkA-6"),f({scaling:b.scaling}),h)},y,{children:d}))})}));p.displayName="Separator";export{p as Separator,p as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Separator/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, scalingVariants } from '../../../lib/constants';\nimport { Separator as SeparatorTheme, Theme } from '@radix-ui/themes';\nvar separatorVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n color: bgColorStyle(),\n },\n});\nexport var Separator = React.forwardRef(function (_a, forwardedRef) {\n var orientation = _a.orientation, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'slate' : _b, className = _a.className, children = _a.children, props = __rest(_a, [\"orientation\", \"scaling\", \"size\", \"color\", \"className\", \"children\"]);\n var sizeTheme = '1';\n if (size === 'medium')\n sizeTheme = '2';\n if (size === 'large')\n sizeTheme = '3';\n if (size === 'fill-large')\n sizeTheme = '4';\n return (_jsx(Theme, { hasBackground: false, className: \"flex items-center justify-center\", children: _jsx(SeparatorTheme, __assign({ orientation: orientation, size: sizeTheme, className: cn(\"bg-\".concat(color, \"A-6 dark:bg-\").concat(color, \"DarkA-6\"), separatorVariants({ scaling: scaling }), className) }, props, { children: children })) }));\n});\nSeparator.displayName = 'Separator';\nexport default Separator;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","separatorVariants","cva","variants","scaling","scalingVariants","color","bgColorStyle","Separator","React","forwardRef","_a","forwardedRef","orientation","size","_b","className","children","props","sizeTheme","_jsx","Theme","hasBackground","SeparatorTheme","cn","concat","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Separator/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, scalingVariants } from '../../../lib/constants';\nimport { Separator as SeparatorTheme, Theme } from '@radix-ui/themes';\nimport { useTheme } from '../../../lib/theme';\nvar separatorVariants = cva('', {\n variants: {\n scaling: __assign({}, scalingVariants),\n color: bgColorStyle(),\n },\n});\nexport var Separator = React.forwardRef(function (_a, forwardedRef) {\n var orientation = _a.orientation, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'slate' : _b, className = _a.className, children = _a.children, props = __rest(_a, [\"orientation\", \"scaling\", \"size\", \"color\", \"className\", \"children\"]);\n var theme = useTheme().theme;\n var separatorStyle = {\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n };\n var sizeTheme = '1';\n if (size === 'medium')\n sizeTheme = '2';\n if (size === 'large')\n sizeTheme = '3';\n if (size === 'fill-large')\n sizeTheme = '4';\n return (_jsx(Theme, { hasBackground: false, className: \"flex items-center justify-center\", children: _jsx(SeparatorTheme, __assign({ orientation: orientation, size: sizeTheme, className: cn(\"bg-\".concat(separatorStyle.color, \"A-6 dark:bg-\").concat(separatorStyle.color, \"DarkA-6\"), separatorVariants({ scaling: separatorStyle.scaling }), className) }, props, { children: children })) }));\n});\nSeparator.displayName = 'Separator';\nexport default Separator;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","separatorVariants","cva","variants","scaling","scalingVariants","color","bgColorStyle","Separator","React","forwardRef","_a","forwardedRef","orientation","size","_b","className","children","props","theme","useTheme","separatorStyle","themeScaling","themeColor","sizeTheme","_jsx","Theme","hasBackground","SeparatorTheme","cn","concat","displayName"],"mappings":"gVAAA,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,QAASvB,EAAS,CAAE,EAAEwB,GACtBC,MAAOC,OAGJC,EAAYC,EAAMC,YAAW,SAAUC,EAAIC,GAClD,IAAIC,EAAcF,EAAGE,YAAaT,EAAUO,EAAGP,QAASU,EAAOH,EAAGG,KAAMC,EAAKJ,EAAGL,MAAOA,OAAe,IAAPS,EAAgB,QAAUA,EAAIC,EAAYL,EAAGK,UAAWC,EAAWN,EAAGM,SAAUC,EAAQtB,EAAOe,EAAI,CAAC,cAAe,UAAW,OAAQ,QAAS,YAAa,aACvPQ,EAAQC,IAAWD,MACnBE,EAAiB,CACjBjB,QAASe,EAAMG,cAAgBlB,EAC/BE,MAAOa,EAAMI,YAAcjB,GAE3BkB,EAAY,IAOhB,MANa,WAATV,IACAU,EAAY,KACH,UAATV,IACAU,EAAY,KACH,eAATV,IACAU,EAAY,KACRC,EAAKC,EAAO,CAAEC,eAAe,EAAOX,UAAW,mCAAoCC,SAAUQ,EAAKG,EAAgB/C,EAAS,CAAEgC,YAAaA,EAAaC,KAAMU,EAAWR,UAAWa,EAAG,MAAMC,OAAOT,EAAef,MAAO,gBAAgBwB,OAAOT,EAAef,MAAO,WAAYL,EAAkB,CAAEG,QAASiB,EAAejB,UAAYY,IAAcE,EAAO,CAAED,SAAUA,MACvX,IACAT,EAAUuB,YAAc"}
|
@@ -8,7 +8,7 @@ export interface SkeletonProps extends VariantProps<typeof separatorVariants> {
|
|
8
8
|
height?: string;
|
9
9
|
}
|
10
10
|
declare const separatorVariants: (props?: ({
|
11
|
-
radius?: "
|
11
|
+
radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
12
12
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
13
13
|
export declare const Skeleton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
14
14
|
export default Skeleton;
|
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { Theme, Skeleton as SkeletonTheme } from '@radix-ui/themes';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { radiusVariants } from '../../../lib/constants';
|
29
|
+
import { useTheme } from '../../../lib/theme';
|
29
30
|
var separatorVariants = cva('', {
|
30
31
|
variants: {
|
31
32
|
radius: __assign({}, radiusVariants['base']),
|
@@ -36,7 +37,9 @@ var separatorVariants = cva('', {
|
|
36
37
|
});
|
37
38
|
export var Skeleton = React.forwardRef(function (_a, forwardedRef) {
|
38
39
|
var children = _a.children, className = _a.className, radius = _a.radius, loading = _a.loading, width = _a.width, height = _a.height, skeletonProps = __rest(_a, ["children", "className", "radius", "loading", "width", "height"]);
|
39
|
-
|
40
|
+
var theme = useTheme().theme;
|
41
|
+
var radiusStyle = theme.themeRadius || radius;
|
42
|
+
return (_jsx(Theme, { children: _jsx(SkeletonTheme, __assign({ ref: forwardedRef, loading: loading, width: width, height: height, className: cn('', cn(separatorVariants({ radius: radiusStyle }), className)) }, skeletonProps, { children: children })) }));
|
40
43
|
});
|
41
44
|
Skeleton.displayName = 'Skeleton';
|
42
45
|
export default Skeleton;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import t from"react";import{cva as e}from"class-variance-authority";import{Theme as a,Skeleton as i}from"@radix-ui/themes";import{cn as o}from"../../utils/utils.mjs";import{radiusVariants as n}from"../../constants.mjs";var
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import t from"react";import{cva as e}from"class-variance-authority";import{Theme as a,Skeleton as i}from"@radix-ui/themes";import{cn as o}from"../../utils/utils.mjs";import{radiusVariants as n}from"../../constants.mjs";import{useTheme as s}from"../../theme/ThemeProvider.mjs";var l=function(){return l=Object.assign||function(r){for(var t,e=1,a=arguments.length;e<a;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i]);return r},l.apply(this,arguments)},m=function(r,t){var e={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&t.indexOf(a)<0&&(e[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(r);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(r,a[i])&&(e[a[i]]=r[a[i]])}return e},c=e("",{variants:{radius:l({},n.base)},defaultVariants:{radius:"medium"}}),d=t.forwardRef((function(t,e){var n=t.children,d=t.className,f=t.radius,u=t.loading,h=t.width,p=t.height,y=m(t,["children","className","radius","loading","width","height"]),O=s().theme.themeRadius||f;return r(a,{children:r(i,l({ref:e,loading:u,width:h,height:p,className:o("",o(c({radius:O}),d))},y,{children:n}))})}));d.displayName="Skeleton";export{d as Skeleton,d as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Skeleton/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 { Theme, Skeleton as SkeletonTheme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants } from '../../../lib/constants';\nvar separatorVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n },\n defaultVariants: {\n radius: 'medium',\n },\n});\nexport var Skeleton = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, radius = _a.radius, loading = _a.loading, width = _a.width, height = _a.height, skeletonProps = __rest(_a, [\"children\", \"className\", \"radius\", \"loading\", \"width\", \"height\"]);\n return (_jsx(Theme, { children: _jsx(SkeletonTheme, __assign({ ref: forwardedRef, loading: loading, width: width, height: height, className: cn('',
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Skeleton/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 { Theme, Skeleton as SkeletonTheme } from '@radix-ui/themes';\nimport { cn } from '../../../lib/utils/utils';\nimport { radiusVariants } from '../../../lib/constants';\nimport { useTheme } from '../../../lib/theme';\nvar separatorVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n },\n defaultVariants: {\n radius: 'medium',\n },\n});\nexport var Skeleton = React.forwardRef(function (_a, forwardedRef) {\n var children = _a.children, className = _a.className, radius = _a.radius, loading = _a.loading, width = _a.width, height = _a.height, skeletonProps = __rest(_a, [\"children\", \"className\", \"radius\", \"loading\", \"width\", \"height\"]);\n var theme = useTheme().theme;\n var radiusStyle = theme.themeRadius || radius;\n return (_jsx(Theme, { children: _jsx(SkeletonTheme, __assign({ ref: forwardedRef, loading: loading, width: width, height: height, className: cn('', cn(separatorVariants({ radius: radiusStyle }), className)) }, skeletonProps, { children: children })) }));\n});\nSkeleton.displayName = 'Skeleton';\nexport default Skeleton;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","separatorVariants","cva","variants","radius","radiusVariants","defaultVariants","Skeleton","React","forwardRef","_a","forwardedRef","children","className","loading","width","height","skeletonProps","radiusStyle","useTheme","theme","themeRadius","_jsx","Theme","SkeletonTheme","ref","cn","displayName"],"mappings":"4TAAA,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,EA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