@lotte-innovate/ui-component-test 0.1.66 → 0.1.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/README.md +133 -133
  2. package/dist/globals.css +4 -4
  3. package/dist/lib/Typography/Header/index.d.ts +1 -1
  4. package/dist/lib/Typography/Text/index.d.ts +1 -1
  5. package/dist/lib/components/Accordion/index.d.ts +1 -0
  6. package/dist/lib/components/Accordion/index.js +18 -4
  7. package/dist/lib/components/Accordion/index.mjs +1 -1
  8. package/dist/lib/components/Accordion/index.mjs.map +1 -1
  9. package/dist/lib/components/AlertDialog/AlertDialogAction.d.ts +2 -2
  10. package/dist/lib/components/AlertDialog/AlertDialogCancel.d.ts +2 -2
  11. package/dist/lib/components/AlertDialog/AlertDialogContent.d.ts +1 -1
  12. package/dist/lib/components/AlertDialog/AlertDialogRoot.js +9 -6
  13. package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs +2 -1
  14. package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs.map +1 -1
  15. package/dist/lib/components/AlertDialog/AlertDialogTrigger.d.ts +2 -2
  16. package/dist/lib/components/AspectRatio/index.js +3 -1
  17. package/dist/lib/components/AspectRatio/index.mjs +1 -1
  18. package/dist/lib/components/AspectRatio/index.mjs.map +1 -1
  19. package/dist/lib/components/Avatar/index.d.ts +1 -1
  20. package/dist/lib/components/Avatar/index.js +9 -1
  21. package/dist/lib/components/Avatar/index.mjs +2 -1
  22. package/dist/lib/components/Avatar/index.mjs.map +1 -1
  23. package/dist/lib/components/Badge/index.d.ts +2 -2
  24. package/dist/lib/components/Badge/index.js +10 -1
  25. package/dist/lib/components/Badge/index.mjs +1 -1
  26. package/dist/lib/components/Badge/index.mjs.map +1 -1
  27. package/dist/lib/components/Button/index.d.ts +2 -2
  28. package/dist/lib/components/Button/index.js +10 -1
  29. package/dist/lib/components/Button/index.mjs +1 -1
  30. package/dist/lib/components/Button/index.mjs.map +1 -1
  31. package/dist/lib/components/Callout/CalloutRoot.d.ts +1 -1
  32. package/dist/lib/components/Callout/CalloutRoot.js +11 -3
  33. package/dist/lib/components/Callout/CalloutRoot.mjs +2 -1
  34. package/dist/lib/components/Callout/CalloutRoot.mjs.map +1 -1
  35. package/dist/lib/components/Card/index.d.ts +2 -2
  36. package/dist/lib/components/Card/index.js +8 -1
  37. package/dist/lib/components/Card/index.mjs +1 -1
  38. package/dist/lib/components/Card/index.mjs.map +1 -1
  39. package/dist/lib/components/Checkbox/index.d.ts +1 -1
  40. package/dist/lib/components/Checkbox/index.js +10 -2
  41. package/dist/lib/components/Checkbox/index.mjs +1 -1
  42. package/dist/lib/components/Checkbox/index.mjs.map +1 -1
  43. package/dist/lib/components/CheckboxCard/index.d.ts +1 -1
  44. package/dist/lib/components/CheckboxCard/index.js +8 -1
  45. package/dist/lib/components/CheckboxCard/index.mjs +1 -1
  46. package/dist/lib/components/CheckboxCard/index.mjs.map +1 -1
  47. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +11 -2
  48. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs +2 -1
  49. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs.map +1 -1
  50. package/dist/lib/components/ContextMenu/ContextMenuContent.d.ts +1 -1
  51. package/dist/lib/components/ContextMenu/ContextMenuItem.d.ts +1 -1
  52. package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.d.ts +1 -1
  53. package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -0
  54. package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs +1 -0
  55. package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs.map +1 -1
  56. package/dist/lib/components/ContextMenu/ContextMenuRoot.js +11 -2
  57. package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs +2 -1
  58. package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs.map +1 -1
  59. package/dist/lib/components/ContextMenu/ContextMenuSubContent.d.ts +1 -1
  60. package/dist/lib/components/DataList/DataListLabel.d.ts +1 -1
  61. package/dist/lib/components/DataList/DataListRoot.js +9 -2
  62. package/dist/lib/components/DataList/DataListRoot.mjs +2 -1
  63. package/dist/lib/components/DataList/DataListRoot.mjs.map +1 -1
  64. package/dist/lib/components/DataList/DataListValue.d.ts +1 -1
  65. package/dist/lib/components/Dialog/DialogAction.d.ts +1 -1
  66. package/dist/lib/components/Dialog/DialogCancel.d.ts +1 -1
  67. package/dist/lib/components/Dialog/DialogContent.d.ts +1 -1
  68. package/dist/lib/components/Dialog/DialogRoot.js +9 -1
  69. package/dist/lib/components/Dialog/DialogRoot.mjs +2 -1
  70. package/dist/lib/components/Dialog/DialogRoot.mjs.map +1 -1
  71. package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.d.ts +1 -1
  72. package/dist/lib/components/DropdownMenu/DropdownMenuContent.d.ts +1 -1
  73. package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +1 -1
  74. package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +1 -1
  75. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +10 -1
  76. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs +2 -1
  77. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
  78. package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +1 -1
  79. package/dist/lib/components/HoverCard/HoverCardContent.d.ts +2 -2
  80. package/dist/lib/components/HoverCard/HoverCardRoot.js +10 -1
  81. package/dist/lib/components/HoverCard/HoverCardRoot.mjs +2 -1
  82. package/dist/lib/components/HoverCard/HoverCardRoot.mjs.map +1 -1
  83. package/dist/lib/components/IconButton/index.d.ts +1 -1
  84. package/dist/lib/components/IconButton/index.js +9 -1
  85. package/dist/lib/components/IconButton/index.mjs +1 -1
  86. package/dist/lib/components/IconButton/index.mjs.map +1 -1
  87. package/dist/lib/components/Inset/index.d.ts +1 -1
  88. package/dist/lib/components/Inset/index.js +7 -1
  89. package/dist/lib/components/Inset/index.mjs +1 -1
  90. package/dist/lib/components/Inset/index.mjs.map +1 -1
  91. package/dist/lib/components/Label/index.d.ts +1 -1
  92. package/dist/lib/components/Label/index.js +11 -3
  93. package/dist/lib/components/Label/index.mjs +1 -1
  94. package/dist/lib/components/Label/index.mjs.map +1 -1
  95. package/dist/lib/components/Menubar/MenubarContent.d.ts +1 -1
  96. package/dist/lib/components/Menubar/MenubarItem.d.ts +1 -1
  97. package/dist/lib/components/Menubar/MenubarItemIndicator.d.ts +1 -1
  98. package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -0
  99. package/dist/lib/components/Menubar/MenubarRadioGroup.mjs +1 -0
  100. package/dist/lib/components/Menubar/MenubarRadioGroup.mjs.map +1 -1
  101. package/dist/lib/components/Menubar/MenubarRoot.d.ts +1 -1
  102. package/dist/lib/components/Menubar/MenubarRoot.js +13 -3
  103. package/dist/lib/components/Menubar/MenubarRoot.mjs +2 -1
  104. package/dist/lib/components/Menubar/MenubarRoot.mjs.map +1 -1
  105. package/dist/lib/components/Menubar/MenubarSubContent.d.ts +1 -1
  106. package/dist/lib/components/Menubar/MenubarTrigger.d.ts +1 -1
  107. package/dist/lib/components/NavigationMenu/NavigationMenuContent.d.ts +1 -1
  108. package/dist/lib/components/NavigationMenu/NavigationMenuLink.d.ts +1 -1
  109. package/dist/lib/components/NavigationMenu/NavigationMenuList.d.ts +1 -1
  110. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +11 -2
  111. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs +2 -1
  112. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs.map +1 -1
  113. package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.d.ts +1 -1
  114. package/dist/lib/components/NavigationMenu/NavigationMenuViewport.d.ts +2 -2
  115. package/dist/lib/components/Popover/PopoverClose.d.ts +1 -1
  116. package/dist/lib/components/Popover/PopoverContent.d.ts +1 -1
  117. package/dist/lib/components/Popover/PopoverRoot.js +8 -1
  118. package/dist/lib/components/Popover/PopoverRoot.mjs +2 -1
  119. package/dist/lib/components/Popover/PopoverRoot.mjs.map +1 -1
  120. package/dist/lib/components/Progress/index.d.ts +1 -1
  121. package/dist/lib/components/Progress/index.js +11 -1
  122. package/dist/lib/components/Progress/index.mjs +1 -1
  123. package/dist/lib/components/Progress/index.mjs.map +1 -1
  124. package/dist/lib/components/Radio/index.js +10 -4
  125. package/dist/lib/components/Radio/index.mjs +1 -1
  126. package/dist/lib/components/Radio/index.mjs.map +1 -1
  127. package/dist/lib/components/RadioCards/RadioCardsItem.d.ts +1 -1
  128. package/dist/lib/components/RadioCards/RadioCardsRoot.js +12 -2
  129. package/dist/lib/components/RadioCards/RadioCardsRoot.mjs +2 -1
  130. package/dist/lib/components/RadioCards/RadioCardsRoot.mjs.map +1 -1
  131. package/dist/lib/components/RadioGroup/RadioGroupRoot.js +11 -2
  132. package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs +2 -1
  133. package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs.map +1 -1
  134. package/dist/lib/components/ScrollArea/index.js +3 -1
  135. package/dist/lib/components/ScrollArea/index.mjs +1 -1
  136. package/dist/lib/components/ScrollArea/index.mjs.map +1 -1
  137. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +7 -1
  138. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs +1 -1
  139. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs.map +1 -1
  140. package/dist/lib/components/Select/index.d.ts +4 -2
  141. package/dist/lib/components/Select/index.js +30 -13
  142. package/dist/lib/components/Select/index.mjs +1 -1
  143. package/dist/lib/components/Select/index.mjs.map +1 -1
  144. package/dist/lib/components/Separator/index.js +7 -1
  145. package/dist/lib/components/Separator/index.mjs +1 -1
  146. package/dist/lib/components/Separator/index.mjs.map +1 -1
  147. package/dist/lib/components/Skeleton/index.d.ts +1 -1
  148. package/dist/lib/components/Skeleton/index.js +4 -1
  149. package/dist/lib/components/Skeleton/index.mjs +1 -1
  150. package/dist/lib/components/Skeleton/index.mjs.map +1 -1
  151. package/dist/lib/components/Slider/index.d.ts +1 -1
  152. package/dist/lib/components/Slider/index.js +13 -5
  153. package/dist/lib/components/Slider/index.mjs +1 -1
  154. package/dist/lib/components/Slider/index.mjs.map +1 -1
  155. package/dist/lib/components/Spinner/index.js +3 -1
  156. package/dist/lib/components/Spinner/index.mjs +1 -1
  157. package/dist/lib/components/Spinner/index.mjs.map +1 -1
  158. package/dist/lib/components/TabNav/index.js +6 -4
  159. package/dist/lib/components/TabNav/index.mjs +1 -1
  160. package/dist/lib/components/TabNav/index.mjs.map +1 -1
  161. package/dist/lib/components/Table/index.d.ts +1 -1
  162. package/dist/lib/components/Table/index.js +7 -1
  163. package/dist/lib/components/Table/index.mjs +1 -1
  164. package/dist/lib/components/Table/index.mjs.map +1 -1
  165. package/dist/lib/components/Tabs/index.d.ts +1 -1
  166. package/dist/lib/components/Tabs/index.js +4 -4
  167. package/dist/lib/components/Tabs/index.mjs +1 -1
  168. package/dist/lib/components/Tabs/index.mjs.map +1 -1
  169. package/dist/lib/components/TextArea/index.d.ts +1 -1
  170. package/dist/lib/components/TextArea/index.js +11 -4
  171. package/dist/lib/components/TextArea/index.mjs +1 -1
  172. package/dist/lib/components/TextArea/index.mjs.map +1 -1
  173. package/dist/lib/components/TextField/index.d.ts +1 -1
  174. package/dist/lib/components/TextField/index.js +11 -4
  175. package/dist/lib/components/TextField/index.mjs +1 -1
  176. package/dist/lib/components/TextField/index.mjs.map +1 -1
  177. package/dist/lib/components/Toast/ToastActionButton.d.ts +1 -1
  178. package/dist/lib/components/Toast/ToastActionButton.js +2 -2
  179. package/dist/lib/components/Toast/ToastActionButton.mjs +1 -1
  180. package/dist/lib/components/Toast/ToastActionButton.mjs.map +1 -1
  181. package/dist/lib/components/Toast/ToastRoot.d.ts +1 -1
  182. package/dist/lib/components/Toast/ToastRoot.js +11 -3
  183. package/dist/lib/components/Toast/ToastRoot.mjs +2 -1
  184. package/dist/lib/components/Toast/ToastRoot.mjs.map +1 -1
  185. package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
  186. package/dist/lib/components/Toggle/ToggleWithText.js +9 -1
  187. package/dist/lib/components/Toggle/ToggleWithText.mjs +1 -1
  188. package/dist/lib/components/Toggle/ToggleWithText.mjs.map +1 -1
  189. package/dist/lib/components/Toggle/index.d.ts +1 -1
  190. package/dist/lib/components/Toggle/index.js +9 -1
  191. package/dist/lib/components/Toggle/index.mjs +1 -1
  192. package/dist/lib/components/Toggle/index.mjs.map +1 -1
  193. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +10 -2
  194. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs +2 -1
  195. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs.map +1 -1
  196. package/dist/lib/components/ToggleSwitch/index.d.ts +1 -1
  197. package/dist/lib/components/ToggleSwitch/index.js +13 -1
  198. package/dist/lib/components/ToggleSwitch/index.mjs +1 -1
  199. package/dist/lib/components/ToggleSwitch/index.mjs.map +1 -1
  200. package/dist/lib/components/Tooltip/index.d.ts +2 -2
  201. package/dist/lib/components/Tooltip/index.js +13 -8
  202. package/dist/lib/components/Tooltip/index.mjs +1 -1
  203. package/dist/lib/components/Tooltip/index.mjs.map +1 -1
  204. package/dist/lib/index.d.ts +1 -0
  205. package/dist/lib/index.js +1 -0
  206. package/dist/lib/index.mjs +1 -1
  207. package/dist/lib/theme/ThemeProvider.d.ts +16 -0
  208. package/dist/lib/theme/ThemeProvider.js +29 -0
  209. package/dist/lib/theme/ThemeProvider.mjs +3 -0
  210. package/dist/lib/theme/ThemeProvider.mjs.map +1 -0
  211. package/dist/lib/theme/index.d.ts +2 -0
  212. package/dist/lib/theme/index.js +2 -0
  213. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  214. package/dist/lib/utils/useDarkMode.js +1 -0
  215. package/dist/lib/utils/useDarkMode.mjs +1 -0
  216. package/dist/lib/utils/useDarkMode.mjs.map +1 -1
  217. package/dist/tsconfig.tsbuildinfo +1 -1
  218. package/package.json +141 -141
  219. package/dist/.storybook/main.d.ts +0 -3
  220. package/dist/.storybook/main.js +0 -22
  221. package/dist/.storybook/manager.d.ts +0 -1
  222. package/dist/.storybook/manager.js +0 -12
  223. package/dist/.storybook/preview.d.ts +0 -8
  224. package/dist/.storybook/preview.js +0 -81
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
26
26
  import { cn } from '../../../lib/utils/utils';
27
27
  import { bgColorStyle, radiusVariants } from '../../../lib/constants';
28
28
  import { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';
29
+ import { useTheme } from '../../../lib/theme';
29
30
  var textFieldVariants = cva('', {
30
31
  variants: {
31
32
  radius: __assign({}, radiusVariants['base']),
@@ -33,15 +34,21 @@ var textFieldVariants = cva('', {
33
34
  },
34
35
  });
35
36
  export var Root = React.forwardRef(function (_a, forwardedRef) {
36
- var className = _a.className, color = _a.color, size = _a.size, appearance = _a.appearance, _b = _a.scaling, scaling = _b === void 0 ? '100%' : _b, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, ["className", "color", "size", "appearance", "scaling", "radius", "children"]);
37
- if (!color)
38
- color = 'red';
37
+ var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, size = _a.size, appearance = _a.appearance, _c = _a.scaling, scaling = _c === void 0 ? '100%' : _c, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, ["className", "color", "size", "appearance", "scaling", "radius", "children"]);
38
+ var theme = useTheme().theme;
39
39
  var sizeTheme = '2';
40
40
  if (size === 'small')
41
41
  sizeTheme = '1';
42
42
  if (size === 'large')
43
43
  sizeTheme = '3';
44
- return (_jsx(Theme, { scaling: scaling, accentColor: color, hasBackground: false, children: _jsx(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: radius, color: color, className: cn(textFieldVariants({ radius: radius }), className) }, sliderProps, { children: children })) }));
44
+ var contextValue = {
45
+ scaling: theme.themeScaling || scaling,
46
+ radius: theme.themeRadius || radius,
47
+ color: theme.themeColor || color,
48
+ };
49
+ return (_jsx(Theme, { scaling: contextValue.scaling, accentColor: color, hasBackground: false, children: _jsx(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: contextValue.radius,
50
+ // @ts-ignore
51
+ color: contextValue.color, className: cn(textFieldVariants({ radius: contextValue.radius }), className) }, sliderProps, { children: children })) }));
45
52
  });
46
53
  Root.displayName = 'TextField.Root';
47
54
  export var Slot = React.forwardRef(function (_a, forwardedRef) {
@@ -1,2 +1,2 @@
1
- import{jsx as r}from"react/jsx-runtime";import a from"react";import{cva as e}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{radiusVariants as t,bgColorStyle as i}from"../../constants.mjs";import{Theme as s,TextField as l}from"@radix-ui/themes";var n=function(){return n=Object.assign||function(r){for(var a,e=1,o=arguments.length;e<o;e++)for(var t in a=arguments[e])Object.prototype.hasOwnProperty.call(a,t)&&(r[t]=a[t]);return r},n.apply(this,arguments)},c=function(r,a){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&a.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(r);t<o.length;t++)a.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(r,o[t])&&(e[o[t]]=r[o[t]])}return e},d=e("",{variants:{radius:n({},t.base),color:i()}}),m=a.forwardRef((function(a,e){var t=a.className,i=a.color,m=a.size,p=a.appearance,u=a.scaling,f=void 0===u?"100%":u,h=a.radius,v=a.children,y=c(a,["className","color","size","appearance","scaling","radius","children"]);i||(i="red");var O="2";return"small"===m&&(O="1"),"large"===m&&(O="3"),r(s,{scaling:f,accentColor:i,hasBackground:!1,children:r(l.Root,n({ref:e,variant:p,size:O,radius:h,color:i,className:o(d({radius:h}),t)},y,{children:v}))})}));m.displayName="TextField.Root";var p=a.forwardRef((function(a,e){var t=a.className,i=a.color,s=a.side,m=a.radius,p=a.children,u=c(a,["className","color","side","radius","children"]);return r(l.Slot,n({ref:e,color:i,side:s,className:o(d({radius:m}),t)},u,{children:p}))}));p.displayName="TextField.Slot";var u={Root:m,Slot:p};export{m as Root,p as Slot,u as default};
1
+ import{jsx as r}from"react/jsx-runtime";import e from"react";import{cva as a}from"class-variance-authority";import{cn as o}from"../../utils/utils.mjs";import{radiusVariants as t,bgColorStyle as i}from"../../constants.mjs";import{Theme as s,TextField as l}from"@radix-ui/themes";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var n=function(){return n=Object.assign||function(r){for(var e,a=1,o=arguments.length;a<o;a++)for(var t in e=arguments[a])Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r},n.apply(this,arguments)},d=function(r,e){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(a[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(r);t<o.length;t++)e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(r,o[t])&&(a[o[t]]=r[o[t]])}return a},m=a("",{variants:{radius:n({},t.base),color:i()}}),u=e.forwardRef((function(e,a){var t=e.className,i=e.color,u=void 0===i?"red":i,p=e.size,f=e.appearance,h=e.scaling,v=void 0===h?"100%":h,y=e.radius,g=e.children,O=d(e,["className","color","size","appearance","scaling","radius","children"]),b=c().theme,j="2";"small"===p&&(j="1"),"large"===p&&(j="3");var x={scaling:b.themeScaling||v,radius:b.themeRadius||y,color:b.themeColor||u};return r(s,{scaling:x.scaling,accentColor:u,hasBackground:!1,children:r(l.Root,n({ref:a,variant:f,size:j,radius:x.radius,color:x.color,className:o(m({radius:x.radius}),t)},O,{children:g}))})}));u.displayName="TextField.Root";var p=e.forwardRef((function(e,a){var t=e.className,i=e.color,s=e.side,c=e.radius,u=e.children,p=d(e,["className","color","side","radius","children"]);return r(l.Slot,n({ref:a,color:i,side:s,className:o(m({radius:c}),t)},p,{children:u}))}));p.displayName="TextField.Slot";var f={Root:u,Slot:p};export{u as Root,p as Slot,f as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../lib/components/TextField/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { bgColorStyle, radiusVariants } from '../../../lib/constants';\nimport { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';\nvar textFieldVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n color: bgColorStyle(),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, color = _a.color, size = _a.size, appearance = _a.appearance, _b = _a.scaling, scaling = _b === void 0 ? '100%' : _b, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"size\", \"appearance\", \"scaling\", \"radius\", \"children\"]);\n if (!color)\n color = 'red';\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(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: radius, color: color, className: cn(textFieldVariants({ radius: radius }), className) }, sliderProps, { children: children })) }));\n});\nRoot.displayName = 'TextField.Root';\nexport var Slot = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, color = _a.color, side = _a.side, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"side\", \"radius\", \"children\"]);\n return (_jsx(TextFieldTheme.Slot, __assign({ ref: forwardedRef, color: color, side: side, className: cn(textFieldVariants({ radius: radius }), className) }, sliderProps, { children: children })));\n});\nSlot.displayName = 'TextField.Slot';\nvar TextField = {\n Root: Root,\n Slot: Slot,\n};\nexport default TextField;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","textFieldVariants","cva","variants","radius","radiusVariants","color","bgColorStyle","Root","React","forwardRef","_a","forwardedRef","className","size","appearance","_b","scaling","children","sliderProps","sizeTheme","_jsx","Theme","accentColor","hasBackground","TextFieldTheme","ref","variant","cn","displayName","Slot","side","TextField"],"mappings":"sRAAA,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,EAAoBC,EAAI,GAAI,CAC5BC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,MAAOC,OAGJC,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWP,EAAQK,EAAGL,MAAOQ,EAAOH,EAAGG,KAAMC,EAAaJ,EAAGI,WAAYC,EAAKL,EAAGM,QAASA,OAAiB,IAAPD,EAAgB,OAASA,EAAIZ,EAASO,EAAGP,OAAQc,EAAWP,EAAGO,SAAUC,EAAcvB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,aAAc,UAAW,SAAU,aACtRL,IACDA,EAAQ,OACZ,IAAIc,EAAY,IAKhB,MAJa,UAATN,IACAM,EAAY,KACH,UAATN,IACAM,EAAY,KACRC,EAAKC,EAAO,CAAEL,QAASA,EAASM,YAAajB,EAAOkB,eAAe,EAAON,SAAUG,EAAKI,EAAejB,KAAM3B,EAAS,CAAE6C,IAAKd,EAAce,QAASZ,EAAYD,KAAMM,EAAWhB,OAAQA,EAAQE,MAAOA,EAAOO,UAAWe,EAAG3B,EAAkB,CAAEG,OAAQA,IAAWS,IAAcM,EAAa,CAAED,SAAUA,MACxT,IACAV,EAAKqB,YAAc,iBACT,IAACC,EAAOrB,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWP,EAAQK,EAAGL,MAAOyB,EAAOpB,EAAGoB,KAAM3B,EAASO,EAAGP,OAAQc,EAAWP,EAAGO,SAAUC,EAAcvB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,SAAU,aAC9K,OAAQU,EAAKI,EAAeK,KAAMjD,EAAS,CAAE6C,IAAKd,EAAcN,MAAOA,EAAOyB,KAAMA,EAAMlB,UAAWe,EAAG3B,EAAkB,CAAEG,OAAQA,IAAWS,IAAcM,EAAa,CAAED,SAAUA,IAC1L,IACAY,EAAKD,YAAc,iBAChB,IAACG,EAAY,CACZxB,KAAMA,EACNsB,KAAMA"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../lib/components/TextField/index.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { bgColorStyle, radiusVariants } from '../../../lib/constants';\nimport { Theme, TextField as TextFieldTheme } from '@radix-ui/themes';\nimport { useTheme } from '../../../lib/theme';\nvar textFieldVariants = cva('', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n color: bgColorStyle(),\n },\n});\nexport var Root = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, size = _a.size, appearance = _a.appearance, _c = _a.scaling, scaling = _c === void 0 ? '100%' : _c, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"size\", \"appearance\", \"scaling\", \"radius\", \"children\"]);\n var theme = useTheme().theme;\n var sizeTheme = '2';\n if (size === 'small')\n sizeTheme = '1';\n if (size === 'large')\n sizeTheme = '3';\n var contextValue = {\n scaling: theme.themeScaling || scaling,\n radius: theme.themeRadius || radius,\n color: theme.themeColor || color,\n };\n return (_jsx(Theme, { scaling: contextValue.scaling, accentColor: color, hasBackground: false, children: _jsx(TextFieldTheme.Root, __assign({ ref: forwardedRef, variant: appearance, size: sizeTheme, radius: contextValue.radius, \n // @ts-ignore\n color: contextValue.color, className: cn(textFieldVariants({ radius: contextValue.radius }), className) }, sliderProps, { children: children })) }));\n});\nRoot.displayName = 'TextField.Root';\nexport var Slot = React.forwardRef(function (_a, forwardedRef) {\n var className = _a.className, color = _a.color, side = _a.side, radius = _a.radius, children = _a.children, sliderProps = __rest(_a, [\"className\", \"color\", \"side\", \"radius\", \"children\"]);\n return (_jsx(TextFieldTheme.Slot, __assign({ ref: forwardedRef, color: color, side: side, className: cn(textFieldVariants({ radius: radius }), className) }, sliderProps, { children: children })));\n});\nSlot.displayName = 'TextField.Slot';\nvar TextField = {\n Root: Root,\n Slot: Slot,\n};\nexport default TextField;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","textFieldVariants","cva","variants","radius","radiusVariants","color","bgColorStyle","Root","React","forwardRef","_a","forwardedRef","className","_b","size","appearance","_c","scaling","children","sliderProps","theme","useTheme","sizeTheme","contextValue","themeScaling","themeRadius","themeColor","_jsx","Theme","accentColor","hasBackground","TextFieldTheme","ref","variant","cn","displayName","Slot","side","TextField"],"mappings":"+UAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAQIiB,EAAoBC,EAAI,GAAI,CAC5BC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,MAAOC,OAGJC,EAAOC,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWC,EAAKH,EAAGL,MAAOA,OAAe,IAAPQ,EAAgB,MAAQA,EAAIC,EAAOJ,EAAGI,KAAMC,EAAaL,EAAGK,WAAYC,EAAKN,EAAGO,QAASA,OAAiB,IAAPD,EAAgB,OAASA,EAAIb,EAASO,EAAGP,OAAQe,EAAWR,EAAGQ,SAAUC,EAAcxB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,aAAc,UAAW,SAAU,aACxTU,EAAQC,IAAWD,MACnBE,EAAY,IACH,UAATR,IACAQ,EAAY,KACH,UAATR,IACAQ,EAAY,KAChB,IAAIC,EAAe,CACfN,QAASG,EAAMI,cAAgBP,EAC/Bd,OAAQiB,EAAMK,aAAetB,EAC7BE,MAAOe,EAAMM,YAAcrB,GAE/B,OAAQsB,EAAKC,EAAO,CAAEX,QAASM,EAAaN,QAASY,YAAaxB,EAAOyB,eAAe,EAAOZ,SAAUS,EAAKI,EAAexB,KAAM3B,EAAS,CAAEoD,IAAKrB,EAAcsB,QAASlB,EAAYD,KAAMQ,EAAWnB,OAAQoB,EAAapB,OAEpNE,MAAOkB,EAAalB,MAAOO,UAAWsB,EAAGlC,EAAkB,CAAEG,OAAQoB,EAAapB,SAAWS,IAAcO,EAAa,CAAED,SAAUA,MAChJ,IACAX,EAAK4B,YAAc,iBACT,IAACC,EAAO5B,EAAMC,YAAW,SAAUC,EAAIC,GAC7C,IAAIC,EAAYF,EAAGE,UAAWP,EAAQK,EAAGL,MAAOgC,EAAO3B,EAAG2B,KAAMlC,EAASO,EAAGP,OAAQe,EAAWR,EAAGQ,SAAUC,EAAcxB,EAAOe,EAAI,CAAC,YAAa,QAAS,OAAQ,SAAU,aAC9K,OAAQiB,EAAKI,EAAeK,KAAMxD,EAAS,CAAEoD,IAAKrB,EAAcN,MAAOA,EAAOgC,KAAMA,EAAMzB,UAAWsB,EAAGlC,EAAkB,CAAEG,OAAQA,IAAWS,IAAcO,EAAa,CAAED,SAAUA,IAC1L,IACAkB,EAAKD,YAAc,iBAChB,IAACG,EAAY,CACZ/B,KAAMA,EACN6B,KAAMA"}
@@ -7,7 +7,7 @@ export interface ToastActionButtonProps extends VariantProps<typeof toastActionB
7
7
  appearance?: IAppearance;
8
8
  }
9
9
  export declare const toastActionButtonVariants: (props?: ({
10
- radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
10
+ radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
11
11
  size?: "small" | "medium" | "large" | "x-large" | null | undefined;
12
12
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
13
13
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -46,8 +46,8 @@ export var toastActionButtonVariants = cva("absolute items-center justify-center
46
46
  },
47
47
  });
48
48
  export var ToastActionButton = forwardRef(function (_a, ref) {
49
- var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, ["className", "children", "radius", "appearance", "altText"]);
50
- var _d = useToastContext(), scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;
49
+ var className = _a.className, children = _a.children, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, ["className", "children", "appearance", "altText"]);
50
+ var _d = useToastContext(), radius = _d.radius, scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;
51
51
  var semantics = ['danger', 'warning', 'success', 'information'];
52
52
  var colorMap = {
53
53
  danger: 'red',
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import*as e from"@radix-ui/react-toast";import{cva as i}from"class-variance-authority";import{cn as a}from"../../utils/utils.mjs";import{Button as n}from"../Button/index.mjs";import{radiusVariants as o,scalingVariants as s,appearanceStyle as m}from"../../constants.mjs";import{useToastContext as l}from"./ToastRoot.mjs";var c=function(){return c=Object.assign||function(t){for(var r,e=1,i=arguments.length;e<i;e++)for(var a in r=arguments[e])Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t},c.apply(this,arguments)},p=function(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(e[i[a]]=t[i[a]])}return e},u=i("absolute items-center justify-center",{variants:{radius:c({},o.base),size:{small:"text-xs min-w-[56px] h-[25px] font-normal right-3",medium:"text-xs min-w-[56px] h-[25px] font-normal right-3",large:"text-[15px] min-w-[76px] h-[35px] font-medium right-4","x-large":"text-[15px] min-w-[76px] h-[35px] font-medium right-4"},scaling:c({},s)},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),f=r((function(r,i){var o=r.className,s=r.children,f=r.radius,d=r.appearance,x=void 0===d?"surface":d,g=r.altText,h=void 0===g?"altText":g,y=p(r,["className","children","radius","appearance","altText"]),v=l(),b=v.scaling,j=v.size,O=v.color,w=void 0===O?"danger":O,T={danger:"red",information:"sky",success:"green",warning:"amber"},z=a(u({size:j,radius:f,scaling:b}),w&&["danger","warning","success","information"].includes(w)?function(t){var r=T[t];return r?m("outline",r):void 0}(w):m(x,null!=w?w:"red"),o);return t(e.Action,c({ref:i,altText:h},y,{className:z,asChild:!0,children:t(n,{children:s})}))}));f.displayName="Toast.ActionButton";export{f as ToastActionButton,u as toastActionButtonVariants};
1
+ import{jsx as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import*as e from"@radix-ui/react-toast";import{cva as i}from"class-variance-authority";import{cn as n}from"../../utils/utils.mjs";import{Button as a}from"../Button/index.mjs";import{radiusVariants as o,scalingVariants as s,appearanceStyle as m}from"../../constants.mjs";import{useToastContext as l}from"./ToastRoot.mjs";var c=function(){return c=Object.assign||function(t){for(var r,e=1,i=arguments.length;e<i;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},c.apply(this,arguments)},p=function(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]])}return e},u=i("absolute items-center justify-center",{variants:{radius:c({},o.base),size:{small:"text-xs min-w-[56px] h-[25px] font-normal right-3",medium:"text-xs min-w-[56px] h-[25px] font-normal right-3",large:"text-[15px] min-w-[76px] h-[35px] font-medium right-4","x-large":"text-[15px] min-w-[76px] h-[35px] font-medium right-4"},scaling:c({},s)},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),f=r((function(r,i){var o=r.className,s=r.children,f=r.appearance,d=void 0===f?"surface":f,x=r.altText,g=void 0===x?"altText":x,h=p(r,["className","children","appearance","altText"]),y=l(),v=y.radius,b=y.scaling,j=y.size,O=y.color,w=void 0===O?"danger":O,T={danger:"red",information:"sky",success:"green",warning:"amber"},z=n(u({size:j,radius:v,scaling:b}),w&&["danger","warning","success","information"].includes(w)?function(t){var r=T[t];return r?m("outline",r):void 0}(w):m(d,null!=w?w:"red"),o);return t(e.Action,c({ref:i,altText:g},h,{className:z,asChild:!0,children:t(a,{children:s})}))}));f.displayName="Toast.ActionButton";export{f as ToastActionButton,u as toastActionButtonVariants};
2
2
  //# sourceMappingURL=ToastActionButton.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToastActionButton.mjs","sources":["../../../lib/components/Toast/ToastActionButton.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport Button from '../../../lib/components/Button';\nimport { appearanceStyle, radiusVariants, scalingVariants } from '../../../lib/constants';\nimport { useToastContext } from './ToastRoot';\nexport var toastActionButtonVariants = cva(\"absolute items-center justify-center\", {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n medium: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n large: 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n 'x-large': 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var ToastActionButton = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, [\"className\", \"children\", \"radius\", \"appearance\", \"altText\"]);\n var _d = useToastContext(), scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;\n var semantics = ['danger', 'warning', 'success', 'information'];\n var colorMap = {\n danger: 'red',\n information: 'sky',\n success: 'green',\n warning: 'amber',\n };\n var getSemanticsStyle = function (color) {\n var mappedColor = colorMap[color];\n return mappedColor ? appearanceStyle('outline', mappedColor) : undefined;\n };\n var buttonClassName = cn(toastActionButtonVariants({ size: size, radius: radius, scaling: scaling }), color && semantics.includes(color)\n ? getSemanticsStyle(color)\n : appearanceStyle(appearance, color !== null && color !== void 0 ? color : 'red'), className);\n return (_jsx(ToastPrimitive.Action, __assign({ ref: ref, altText: altText }, props, { className: buttonClassName, asChild: true, children: _jsx(Button, { children: children }) })));\n});\nToastActionButton.displayName = 'Toast.ActionButton';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastActionButtonVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","ToastActionButton","forwardRef","_a","ref","className","children","_b","appearance","_c","altText","props","_d","useToastContext","_e","color","colorMap","danger","information","success","warning","buttonClassName","cn","includes","mappedColor","appearanceStyle","undefined","getSemanticsStyle","_jsx","ToastPrimitive","Action","asChild","Button","displayName"],"mappings":"2YAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EASWiB,EAA4BC,EAAI,uCAAwC,CAC/EC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,oDACPC,OAAQ,oDACRC,MAAO,wDACP,UAAW,yDAEfC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRM,QAAS,OACTJ,KAAM,YAGHO,EAAoBC,GAAW,SAAUC,EAAIC,GACpD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUd,EAASW,EAAGX,OAAQe,EAAKJ,EAAGK,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAKN,EAAGO,QAASA,OAAiB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ3B,EAAOmB,EAAI,CAAC,YAAa,WAAY,SAAU,aAAc,YACvQS,EAAKC,IAAmBf,EAAUc,EAAGd,QAASJ,EAAOkB,EAAGlB,KAAMoB,EAAKF,EAAGG,MAAOA,OAAe,IAAPD,EAAgB,SAAWA,EAEhHE,EAAW,CACXC,OAAQ,MACRC,YAAa,MACbC,QAAS,QACTC,QAAS,SAMTC,EAAkBC,EAAGjC,EAA0B,CAAEK,KAAMA,EAAMF,OAAQA,EAAQM,QAASA,IAAYiB,GAXtF,CAAC,SAAU,UAAW,UAAW,eAWwEQ,SAASR,GAJ1G,SAAUA,GAC9B,IAAIS,EAAcR,EAASD,GAC3B,OAAOS,EAAcC,EAAgB,UAAWD,QAAeE,CACvE,CAEUC,CAAkBZ,GAClBU,EAAgBjB,EAAYO,QAAqCA,EAAQ,OAAQV,GACvF,OAAQuB,EAAKC,EAAeC,OAAQ7D,EAAS,CAAEmC,IAAKA,EAAKM,QAASA,GAAWC,EAAO,CAAEN,UAAWgB,EAAiBU,SAAS,EAAMzB,SAAUsB,EAAKI,EAAQ,CAAE1B,SAAUA,MACxK,IACAL,EAAkBgC,YAAc"}
1
+ {"version":3,"file":"ToastActionButton.mjs","sources":["../../../lib/components/Toast/ToastActionButton.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport Button from '../../../lib/components/Button';\nimport { appearanceStyle, radiusVariants, scalingVariants } from '../../../lib/constants';\nimport { useToastContext } from './ToastRoot';\nexport var toastActionButtonVariants = cva(\"absolute items-center justify-center\", {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n medium: 'text-xs min-w-[56px] h-[25px] font-normal right-3',\n large: 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n 'x-large': 'text-[15px] min-w-[76px] h-[35px] font-medium right-4',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var ToastActionButton = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.altText, altText = _c === void 0 ? 'altText' : _c, props = __rest(_a, [\"className\", \"children\", \"appearance\", \"altText\"]);\n var _d = useToastContext(), radius = _d.radius, scaling = _d.scaling, size = _d.size, _e = _d.color, color = _e === void 0 ? 'danger' : _e;\n var semantics = ['danger', 'warning', 'success', 'information'];\n var colorMap = {\n danger: 'red',\n information: 'sky',\n success: 'green',\n warning: 'amber',\n };\n var getSemanticsStyle = function (color) {\n var mappedColor = colorMap[color];\n return mappedColor ? appearanceStyle('outline', mappedColor) : undefined;\n };\n var buttonClassName = cn(toastActionButtonVariants({ size: size, radius: radius, scaling: scaling }), color && semantics.includes(color)\n ? getSemanticsStyle(color)\n : appearanceStyle(appearance, color !== null && color !== void 0 ? color : 'red'), className);\n return (_jsx(ToastPrimitive.Action, __assign({ ref: ref, altText: altText }, props, { className: buttonClassName, asChild: true, children: _jsx(Button, { children: children }) })));\n});\nToastActionButton.displayName = 'Toast.ActionButton';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastActionButtonVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","ToastActionButton","forwardRef","_a","ref","className","children","_b","appearance","_c","altText","props","_d","useToastContext","_e","color","colorMap","danger","information","success","warning","buttonClassName","cn","includes","mappedColor","appearanceStyle","undefined","getSemanticsStyle","_jsx","ToastPrimitive","Action","asChild","Button","displayName"],"mappings":"2YAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EASWiB,EAA4BC,EAAI,uCAAwC,CAC/EC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,oDACPC,OAAQ,oDACRC,MAAO,wDACP,UAAW,yDAEfC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRM,QAAS,OACTJ,KAAM,YAGHO,EAAoBC,GAAW,SAAUC,EAAIC,GACpD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAKJ,EAAGK,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAKN,EAAGO,QAASA,OAAiB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ3B,EAAOmB,EAAI,CAAC,YAAa,WAAY,aAAc,YACzOS,EAAKC,IAAmBrB,EAASoB,EAAGpB,OAAQM,EAAUc,EAAGd,QAASJ,EAAOkB,EAAGlB,KAAMoB,EAAKF,EAAGG,MAAOA,OAAe,IAAPD,EAAgB,SAAWA,EAEpIE,EAAW,CACXC,OAAQ,MACRC,YAAa,MACbC,QAAS,QACTC,QAAS,SAMTC,EAAkBC,EAAGjC,EAA0B,CAAEK,KAAMA,EAAMF,OAAQA,EAAQM,QAASA,IAAYiB,GAXtF,CAAC,SAAU,UAAW,UAAW,eAWwEQ,SAASR,GAJ1G,SAAUA,GAC9B,IAAIS,EAAcR,EAASD,GAC3B,OAAOS,EAAcC,EAAgB,UAAWD,QAAeE,CACvE,CAEUC,CAAkBZ,GAClBU,EAAgBjB,EAAYO,QAAqCA,EAAQ,OAAQV,GACvF,OAAQuB,EAAKC,EAAeC,OAAQ7D,EAAS,CAAEmC,IAAKA,EAAKM,QAASA,GAAWC,EAAO,CAAEN,UAAWgB,EAAiBU,SAAS,EAAMzB,SAAUsB,EAAKI,EAAQ,CAAE1B,SAAUA,MACxK,IACAL,EAAkBgC,YAAc"}
@@ -14,7 +14,7 @@ export interface ToastProps extends VariantProps<typeof toastVariants>, VariantP
14
14
  setOpenToast?: Dispatch<SetStateAction<boolean>>;
15
15
  }
16
16
  export declare const toastVariants: (props?: ({
17
- radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
17
+ radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
18
18
  size?: "small" | "medium" | "large" | "x-large" | null | undefined;
19
19
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
20
20
  color?: "danger" | "warning" | "success" | "information" | null | undefined;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -21,11 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
21
22
  return t;
22
23
  };
23
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef, createContext, useContext, useMemo, } from 'react';
25
+ import { forwardRef, createContext, useContext, } from 'react';
25
26
  import { cva } from 'class-variance-authority';
26
27
  import { cn } from '../../../lib/utils/utils';
27
28
  import { scalingVariants } from '../../../lib/constants';
28
29
  import * as ToastPrimitive from '@radix-ui/react-toast';
30
+ import { useTheme } from '../../../lib/theme';
29
31
  export var toastVariants = cva('flex bg-white dark:bg-slateDark-1', {
30
32
  variants: {
31
33
  radius: {
@@ -81,9 +83,15 @@ export var useToastContext = function () {
81
83
  };
82
84
  export var ToastRoot = forwardRef(function (_a, ref) {
83
85
  var className = _a.className, children = _a.children, openToast = _a.openToast, radius = _a.radius, scaling = _a.scaling, size = _a.size, color = _a.color, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.toastPosition, toastPosition = _c === void 0 ? 'top_right' : _c, setOpenToast = _a.setOpenToast, props = __rest(_a, ["className", "children", "openToast", "radius", "scaling", "size", "color", "duration", "toastPosition", "setOpenToast"]);
84
- var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color }); }, [radius, size, scaling, color]);
86
+ var theme = useTheme().theme;
87
+ var contextValue = {
88
+ radius: theme.themeRadius || radius,
89
+ scaling: theme.themeScaling || scaling,
90
+ color: color,
91
+ size: size,
92
+ };
85
93
  var toastRootStyle = "\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ";
86
- var toastClassName = cn(toastVariants({ radius: radius, scaling: scaling, size: size, color: color }), toastRootStyle, className);
94
+ var toastClassName = cn(toastVariants(contextValue), toastRootStyle, className);
87
95
  return (_jsx(ToastContext.Provider, { value: contextValue, children: _jsxs(ToastPrimitive.Provider, { swipeDirection: "right", duration: duration, children: [_jsx(ToastPrimitive.Root, __assign({ ref: ref, className: toastClassName, open: openToast, onOpenChange: setOpenToast }, props, { children: children })), _jsx(ToastPrimitive.Viewport, { className: cn(toastViewportVariants({ toastPosition: toastPosition })) })] }) }));
88
96
  });
89
97
  ToastRoot.displayName = 'Toast.Root';
@@ -1,2 +1,3 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as r,forwardRef as a,useMemo as o,useContext as n}from"react";import{cva as i}from"class-variance-authority";import{cn as s}from"../../utils/utils.mjs";import{scalingVariants as l}from"../../constants.mjs";import*as p from"@radix-ui/react-toast";var d=function(){return d=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)},m=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(t);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(r[a[o]]=t[a[o]])}return r},c=i("flex bg-white dark:bg-slateDark-1",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"w-[300px] min-h-[55px] p-3",medium:"w-[400px] min-h-[63px] p-3",large:"w-[400px] min-h-[84px] p-4","x-large":"w-[400px] min-h-[88px] p-4"},scaling:d({},l),color:{danger:"bg-red-3 dark:bg-redDark-3",warning:"bg-amber-3 dark:bg-amberDark-3",success:"bg-green-3 dark:bg-greenDark-3",information:"bg-sky-3 dark:bg-skyDark-3"}},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),u=i("[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]",{variants:{toastPosition:{top_center:"top-0 left-1/2 transform -translate-x-1/2",top_left:"top-0 left-0",top_right:"top-0 right-0",bottom_center:"bottom-0 left-1/2 transform -translate-x-1/2",bottom_left:"bottom-0 left-0",bottom_right:"bottom-0 right-0"}},defaultVariants:{toastPosition:"top_right"}}),f=r({radius:"medium",scaling:"100%",size:"medium",color:null}),g=function(){return n(f)},x=a((function(r,a){var n=r.className,i=r.children,l=r.openToast,g=r.radius,x=r.scaling,h=r.size,_=r.color,b=r.duration,v=void 0===b?3e3:b,w=r.toastPosition,y=void 0===w?"top_right":w,O=r.setOpenToast,k=m(r,["className","children","openToast","radius","scaling","size","color","duration","toastPosition","setOpenToast"]),P=o((function(){return{radius:g,size:h,scaling:x,color:_}}),[g,h,x,_]),j=s(c({radius:g,scaling:x,size:h,color:_}),"\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ",n);return t(f.Provider,{value:P,children:e(p.Provider,{swipeDirection:"right",duration:v,children:[t(p.Root,d({ref:a,className:j,open:l,onOpenChange:O},k,{children:i})),t(p.Viewport,{className:s(u({toastPosition:y}))})]})})}));x.displayName="Toast.Root";export{x as ToastRoot,x as default,c as toastVariants,u as toastViewportVariants,g as useToastContext};
1
+ "use client";
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as r,forwardRef as a,useContext as o}from"react";import{cva as n}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{scalingVariants as s}from"../../constants.mjs";import*as l from"@radix-ui/react-toast";import{useTheme as p}from"../../theme/ThemeProvider.mjs";var d=function(){return d=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)},m=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(t);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(r[a[o]]=t[a[o]])}return r},c=n("flex bg-white dark:bg-slateDark-1",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"w-[300px] min-h-[55px] p-3",medium:"w-[400px] min-h-[63px] p-3",large:"w-[400px] min-h-[84px] p-4","x-large":"w-[400px] min-h-[88px] p-4"},scaling:d({},s),color:{danger:"bg-red-3 dark:bg-redDark-3",warning:"bg-amber-3 dark:bg-amberDark-3",success:"bg-green-3 dark:bg-greenDark-3",information:"bg-sky-3 dark:bg-skyDark-3"}},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),u=n("[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]",{variants:{toastPosition:{top_center:"top-0 left-1/2 transform -translate-x-1/2",top_left:"top-0 left-0",top_right:"top-0 right-0",bottom_center:"bottom-0 left-1/2 transform -translate-x-1/2",bottom_left:"bottom-0 left-0",bottom_right:"bottom-0 right-0"}},defaultVariants:{toastPosition:"top_right"}}),f=r({radius:"medium",scaling:"100%",size:"medium",color:null}),g=function(){return o(f)},x=a((function(r,a){var o=r.className,n=r.children,s=r.openToast,g=r.radius,x=r.scaling,h=r.size,_=r.color,b=r.duration,v=void 0===b?3e3:b,w=r.toastPosition,y=void 0===w?"top_right":w,O=r.setOpenToast,k=m(r,["className","children","openToast","radius","scaling","size","color","duration","toastPosition","setOpenToast"]),P=p().theme,j={radius:P.themeRadius||g,scaling:P.themeScaling||x,color:_,size:h},z=i(c(j),"\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \n flex flex-col px-[15px] relative justify-center\n data-[state=open]:animate-slideIn \n data-[state=closed]:animate-hide \n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \n data-[swipe=cancel]:translate-x-0 \n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \n data-[swipe=end]:animate-swipeOut\n ",o);return t(f.Provider,{value:j,children:e(l.Provider,{swipeDirection:"right",duration:v,children:[t(l.Root,d({ref:a,className:z,open:s,onOpenChange:O},k,{children:n})),t(l.Viewport,{className:i(u({toastPosition:y}))})]})})}));x.displayName="Toast.Root";export{x as ToastRoot,x as default,c as toastVariants,u as toastViewportVariants,g as useToastContext};
2
3
  //# sourceMappingURL=ToastRoot.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToastRoot.mjs","sources":["../../../lib/components/Toast/ToastRoot.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, createContext, useContext, useMemo, } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../../lib/utils/utils';\nimport { scalingVariants } from '../../../lib/constants';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nexport var toastVariants = cva('flex bg-white dark:bg-slateDark-1', {\n variants: {\n radius: {\n none: 'rounded-none',\n small: 'rounded-[3px]',\n medium: 'rounded',\n large: 'rounded-md',\n full: 'rounded-md',\n },\n size: {\n small: 'w-[300px] min-h-[55px] p-3',\n medium: 'w-[400px] min-h-[63px] p-3',\n large: 'w-[400px] min-h-[84px] p-4',\n 'x-large': 'w-[400px] min-h-[88px] p-4',\n },\n scaling: __assign({}, scalingVariants),\n color: {\n danger: 'bg-red-3 dark:bg-redDark-3',\n warning: 'bg-amber-3 dark:bg-amberDark-3',\n success: 'bg-green-3 dark:bg-greenDark-3',\n information: 'bg-sky-3 dark:bg-skyDark-3',\n },\n },\n defaultVariants: {\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n },\n});\nexport var toastViewportVariants = cva(\"[--viewport-padding:_25px] fixed flex flex-col outline-none gap-[10px]\\n p-[var(--viewport-padding)] m-0 list-none z-[987654321]\", {\n variants: {\n toastPosition: {\n top_center: 'top-0 left-1/2 transform -translate-x-1/2',\n top_left: 'top-0 left-0',\n top_right: 'top-0 right-0',\n bottom_center: 'bottom-0 left-1/2 transform -translate-x-1/2',\n bottom_left: 'bottom-0 left-0',\n bottom_right: 'bottom-0 right-0',\n },\n },\n defaultVariants: {\n toastPosition: 'top_right',\n },\n});\nvar ToastContext = createContext({\n radius: 'medium',\n scaling: '100%',\n size: 'medium',\n color: null,\n});\nexport var useToastContext = function () {\n return useContext(ToastContext);\n};\nexport var ToastRoot = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, openToast = _a.openToast, radius = _a.radius, scaling = _a.scaling, size = _a.size, color = _a.color, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.toastPosition, toastPosition = _c === void 0 ? 'top_right' : _c, setOpenToast = _a.setOpenToast, props = __rest(_a, [\"className\", \"children\", \"openToast\", \"radius\", \"scaling\", \"size\", \"color\", \"duration\", \"toastPosition\", \"setOpenToast\"]);\n var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color }); }, [radius, size, scaling, color]);\n var toastRootStyle = \"\\n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] \\n flex flex-col px-[15px] relative justify-center\\n data-[state=open]:animate-slideIn \\n data-[state=closed]:animate-hide \\n data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] \\n data-[swipe=cancel]:translate-x-0 \\n data-[swipe=cancel]:transition-[transform_200ms_ease-out] \\n data-[swipe=end]:animate-swipeOut\\n \";\n var toastClassName = cn(toastVariants({ radius: radius, scaling: scaling, size: size, color: color }), toastRootStyle, className);\n return (_jsx(ToastContext.Provider, { value: contextValue, children: _jsxs(ToastPrimitive.Provider, { swipeDirection: \"right\", duration: duration, children: [_jsx(ToastPrimitive.Root, __assign({ ref: ref, className: toastClassName, open: openToast, onOpenChange: setOpenToast }, props, { children: children })), _jsx(ToastPrimitive.Viewport, { className: cn(toastViewportVariants({ toastPosition: toastPosition })) })] }) }));\n});\nToastRoot.displayName = 'Toast.Root';\nexport default ToastRoot;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toastVariants","cva","variants","radius","none","small","medium","large","full","size","scaling","scalingVariants","color","danger","warning","success","information","defaultVariants","toastViewportVariants","toastPosition","top_center","top_left","top_right","bottom_center","bottom_left","bottom_right","ToastContext","createContext","useToastContext","useContext","ToastRoot","forwardRef","_a","ref","className","children","openToast","_b","duration","_c","setOpenToast","props","contextValue","useMemo","toastClassName","cn","_jsx","Provider","value","_jsxs","ToastPrimitive","swipeDirection","Root","open","onOpenChange","Viewport","displayName"],"mappings":"6TAAA,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,EAOWiB,EAAgBC,EAAI,oCAAqC,CAChEC,SAAU,CACNC,OAAQ,CACJC,KAAM,eACNC,MAAO,gBACPC,OAAQ,UACRC,MAAO,aACPC,KAAM,cAEVC,KAAM,CACFJ,MAAO,6BACPC,OAAQ,6BACRC,MAAO,6BACP,UAAW,8BAEfG,QAAS9B,EAAS,CAAE,EAAE+B,GACtBC,MAAO,CACHC,OAAQ,6BACRC,QAAS,iCACTC,QAAS,iCACTC,YAAa,+BAGrBC,gBAAiB,CACbd,OAAQ,SACRO,QAAS,OACTD,KAAM,YAGHS,EAAwBjB,EAAI,sIAAuI,CAC1KC,SAAU,CACNiB,cAAe,CACXC,WAAY,4CACZC,SAAU,eACVC,UAAW,gBACXC,cAAe,+CACfC,YAAa,kBACbC,aAAc,qBAGtBR,gBAAiB,CACbE,cAAe,eAGnBO,EAAeC,EAAc,CAC7BxB,OAAQ,SACRO,QAAS,OACTD,KAAM,SACNG,MAAO,OAEAgB,EAAkB,WACzB,OAAOC,EAAWH,EACtB,EACWI,EAAYC,GAAW,SAAUC,EAAIC,GAC5C,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUC,EAAYJ,EAAGI,UAAWjC,EAAS6B,EAAG7B,OAAQO,EAAUsB,EAAGtB,QAASD,EAAOuB,EAAGvB,KAAMG,EAAQoB,EAAGpB,MAAOyB,EAAKL,EAAGM,SAAUA,OAAkB,IAAPD,EAAgB,IAAOA,EAAIE,EAAKP,EAAGb,cAAeA,OAAuB,IAAPoB,EAAgB,YAAcA,EAAIC,EAAeR,EAAGQ,aAAcC,EAAQ9C,EAAOqC,EAAI,CAAC,YAAa,WAAY,YAAa,SAAU,UAAW,OAAQ,QAAS,WAAY,gBAAiB,iBACtbU,EAAeC,GAAQ,WAAc,MAAA,CAAUxC,OAAQA,EAAQM,KAAMA,EAAMC,QAASA,EAASE,MAAOA,KAAa,CAACT,EAAQM,EAAMC,EAASE,IAEzIgC,EAAiBC,EAAG7C,EAAc,CAAEG,OAAQA,EAAQO,QAASA,EAASD,KAAMA,EAAMG,MAAOA,IADxE,sdACkGsB,GACvH,OAAQY,EAAKpB,EAAaqB,SAAU,CAAEC,MAAON,EAAcP,SAAUc,EAAMC,EAAeH,SAAU,CAAEI,eAAgB,QAASb,SAAUA,EAAUH,SAAU,CAACW,EAAKI,EAAeE,KAAMxE,EAAS,CAAEqD,IAAKA,EAAKC,UAAWU,EAAgBS,KAAMjB,EAAWkB,aAAcd,GAAgBC,EAAO,CAAEN,SAAUA,KAAcW,EAAKI,EAAeK,SAAU,CAAErB,UAAWW,EAAG3B,EAAsB,CAAEC,cAAeA,WACjZ,IACAW,EAAU0B,YAAc"}
1
+ {"version":3,"file":"ToastRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -8,7 +8,7 @@ export interface ToggleWithTextProps extends VariantProps<typeof toggleWithTextV
8
8
  size?: 'small' | 'medium' | 'large';
9
9
  }
10
10
  declare const toggleWithTextVariants: (props?: ({
11
- radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
11
+ radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
12
12
  size?: "small" | "medium" | "large" | null | undefined;
13
13
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
14
14
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -27,6 +27,7 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
27
27
  import { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';
28
28
  import { scalingVariants } from '../../../lib/constants';
29
29
  import { cn } from '../../../lib/utils/utils';
30
+ import { useTheme } from '../../../lib/theme';
30
31
  var toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {
31
32
  variants: {
32
33
  radius: __assign({}, radiusVariants['base']),
@@ -50,7 +51,14 @@ export var IconScaling = {
50
51
  };
51
52
  export var ToggleWithText = forwardRef(function (_a, ref) {
52
53
  var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, text = _a.text, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance", "text"]);
53
- return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {
54
+ var theme = useTheme().theme;
55
+ var contextValue = {
56
+ radius: theme.themeRadius || radius,
57
+ scaling: theme.themeScaling || scaling,
58
+ color: theme.themeColor || color,
59
+ size: size,
60
+ };
61
+ return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {
54
62
  return React.cloneElement(child, { className: IconScaling[size] });
55
63
  }), text] })));
56
64
  });
@@ -1,2 +1,2 @@
1
- import{jsxs as e}from"react/jsx-runtime";import t,{forwardRef as r,Children as a}from"react";import{cva as i}from"class-variance-authority";import*as o from"@radix-ui/react-toggle";import{radiusVariants as s,scalingVariants as n,toggleAppearanceStyle as l}from"../../constants.mjs";import{cn as c}from"../../utils/utils.mjs";var m=function(){return m=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},m.apply(this,arguments)},p=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]])}return r},u=i("flex items-center justify-center box-border font-medium w-fit",{variants:{radius:m({},s.base),size:{small:"h-6 px-2 text-xs gap-1",medium:"h-8 px-3 text-sm gap-2",large:"h-10 px-4 text-base gap-3"},scaling:m({},n)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),f={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},d=r((function(r,i){var s=r.className,n=r.children,d=r.radius,g=r.size,x=void 0===g?"medium":g,y=r.scaling,b=r.color,h=void 0===b?"red":b,v=r.appearance,O=void 0===v?"surface":v,j=r.text,w=p(r,["className","children","radius","size","scaling","color","appearance","text"]);return e(o.Root,m({ref:i,className:c(u({radius:d,size:x,scaling:y}),l(O,h,!0,"data-[state=on]:"),s)},w,{children:[a.map(n,(function(e){return t.cloneElement(e,{className:f[x]})})),j]}))}));d.displayName="ToggleWithText";export{f as IconScaling,d as ToggleWithText,d as default};
1
+ import{jsxs as e}from"react/jsx-runtime";import r,{forwardRef as t,Children as a}from"react";import{cva as i}from"class-variance-authority";import*as o from"@radix-ui/react-toggle";import{radiusVariants as s,scalingVariants as n,toggleAppearanceStyle as m}from"../../constants.mjs";import{cn as l}from"../../utils/utils.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var p=function(){return p=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},p.apply(this,arguments)},u=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)r.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(t[a[i]]=e[a[i]])}return t},f=i("flex items-center justify-center box-border font-medium w-fit",{variants:{radius:p({},s.base),size:{small:"h-6 px-2 text-xs gap-1",medium:"h-8 px-3 text-sm gap-2",large:"h-10 px-4 text-base gap-3"},scaling:p({},n)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},g=t((function(t,i){var s=t.className,n=t.children,g=t.radius,h=t.size,x=void 0===h?"medium":h,y=t.scaling,b=t.color,v=void 0===b?"red":b,O=t.appearance,j=void 0===O?"surface":O,w=t.text,z=u(t,["className","children","radius","size","scaling","color","appearance","text"]),N=c().theme,P={radius:N.themeRadius||g,scaling:N.themeScaling||y,color:N.themeColor||v,size:x};return e(o.Root,p({ref:i,className:l(f(P),m(j,P.color,!0,"data-[state=on]:"),s)},z,{children:[a.map(n,(function(e){return r.cloneElement(e,{className:d[x]})})),w]}))}));g.displayName="ToggleWithText";export{d as IconScaling,g as ToggleWithText,g as default};
2
2
  //# sourceMappingURL=ToggleWithText.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleWithText.mjs","sources":["../../../lib/components/Toggle/ToggleWithText.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nvar toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'h-6 px-2 text-xs gap-1',\n medium: 'h-8 px-3 text-sm gap-2',\n large: 'h-10 px-4 text-base gap-3',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleWithText = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, text = _a.text, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\", \"text\"]);\n return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }), text] })));\n});\nToggleWithText.displayName = 'ToggleWithText';\nexport default ToggleWithText;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleWithTextVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","ToggleWithText","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","text","props","_jsxs","TogglePrimitive","Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"qUAAA,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,EAAyBC,EAAI,gEAAiE,CAC9FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,yBACPC,OAAQ,yBACRC,MAAO,6BAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAAiBC,GAAW,SAAUC,EAAIC,GACjD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAOT,EAAGS,KAAMC,EAAQ9B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,aAAc,SACzX,OAAQW,EAAMC,EAAgBC,KAAMhD,EAAS,CAAEoC,IAAKA,EAAKC,UAAWY,EAAG7B,EAAuB,CAAEG,OAAQA,EAAQE,KAAMA,EAAMI,QAASA,IAAYqB,EAAsBP,EAAYF,GAAO,EAAM,oBAAqBJ,IAAcQ,EAAO,CAAEP,SAAU,CAACa,EAASC,IAAId,GAAU,SAAUe,GAC5Q,OAAOC,EAAMC,aAAaF,EAAO,CAAEhB,UAAWL,EAAYP,IAC1E,IAAgBmB,KAChB,IACAX,EAAeuB,YAAc"}
1
+ {"version":3,"file":"ToggleWithText.mjs","sources":["../../../lib/components/Toggle/ToggleWithText.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nvar toggleWithTextVariants = cva('flex items-center justify-center box-border font-medium w-fit', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'h-6 px-2 text-xs gap-1',\n medium: 'h-8 px-3 text-sm gap-2',\n large: 'h-10 px-4 text-base gap-3',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var ToggleWithText = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, text = _a.text, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\", \"text\"]);\n var theme = useTheme().theme;\n var contextValue = {\n radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n size: size,\n };\n return (_jsxs(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleWithTextVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: [Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }), text] })));\n});\nToggleWithText.displayName = 'ToggleWithText';\nexport default ToggleWithText;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleWithTextVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","ToggleWithText","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","text","props","theme","useTheme","contextValue","themeRadius","themeScaling","themeColor","_jsxs","TogglePrimitive","Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"8XAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EASIiB,EAAyBC,EAAI,gEAAiE,CAC9FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,yBACPC,OAAQ,yBACRC,MAAO,6BAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAAiBC,GAAW,SAAUC,EAAIC,GACjD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAOT,EAAGS,KAAMC,EAAQ9B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,aAAc,SACrXW,EAAQC,IAAWD,MACnBE,EAAe,CACfzB,OAAQuB,EAAMG,aAAe1B,EAC7BM,QAASiB,EAAMI,cAAgBrB,EAC/BY,MAAOK,EAAMK,YAAcV,EAC3BhB,KAAMA,GAEV,OAAQ2B,EAAMC,EAAgBC,KAAMtD,EAAS,CAAEoC,IAAKA,EAAKC,UAAWkB,EAAGnC,EAAuB4B,GAAeQ,EAAsBb,EAAYK,EAAaP,OAAO,EAAM,oBAAqBJ,IAAcQ,EAAO,CAAEP,SAAU,CAACmB,EAASC,IAAIpB,GAAU,SAAUqB,GACrP,OAAOC,EAAMC,aAAaF,EAAO,CAAEtB,UAAWL,EAAYP,IAC1E,IAAgBmB,KAChB,IACAX,EAAe6B,YAAc"}
@@ -8,7 +8,7 @@ export interface ToggleProps extends VariantProps<typeof toggleVariants> {
8
8
  appearance?: IAppearance;
9
9
  }
10
10
  declare const toggleVariants: (props?: ({
11
- radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
11
+ radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
12
12
  size?: "small" | "medium" | "large" | null | undefined;
13
13
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
14
14
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -26,6 +26,7 @@ import { cva } from 'class-variance-authority';
26
26
  import * as TogglePrimitive from '@radix-ui/react-toggle';
27
27
  import { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';
28
28
  import { cn } from '../../../lib/utils/utils';
29
+ import { useTheme } from '../../../lib/theme';
29
30
  export * from './ToggleWithText';
30
31
  var toggleVariants = cva('grid place-content-center items-center justify-center box-border"', {
31
32
  variants: {
@@ -50,7 +51,14 @@ export var IconScaling = {
50
51
  };
51
52
  export var Toggle = forwardRef(function (_a, ref) {
52
53
  var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
53
- return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {
54
+ var theme = useTheme().theme;
55
+ var contextValue = {
56
+ radius: theme.themeRadius || radius,
57
+ scaling: theme.themeScaling || scaling,
58
+ color: theme.themeColor || color,
59
+ size: size,
60
+ };
61
+ return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {
54
62
  return React.cloneElement(child, { className: IconScaling[size] });
55
63
  }) })));
56
64
  });
@@ -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 i}from"class-variance-authority";import*as o from"@radix-ui/react-toggle";import{radiusVariants as n,scalingVariants as s,toggleAppearanceStyle as l}from"../../constants.mjs";import{cn as c}from"../../utils/utils.mjs";export{ToggleWithText}from"./ToggleWithText.mjs";var m=function(){return m=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},m.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 i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)r.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(t[a[i]]=e[a[i]])}return t},u=i('grid place-content-center items-center justify-center box-border"',{variants:{radius:m({},n.base),size:{small:"w-6 h-6 p-[6px]",medium:"w-8 h-8 p-2",large:"w-10 h-10 p-[11px]"},scaling:m({},s)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),d={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},f=t((function(t,i){var n=t.className,s=t.children,f=t.radius,g=t.size,y=void 0===g?"medium":g,h=t.scaling,x=t.color,b=void 0===x?"red":x,v=t.appearance,O=void 0===v?"surface":v,j=p(t,["className","children","radius","size","scaling","color","appearance"]);return e(o.Root,m({ref:i,className:c(u({radius:f,size:y,scaling:h}),l(O,b,!0,"data-[state=on]:"),n)},j,{children:a.map(s,(function(e){return r.cloneElement(e,{className:d[y]})}))}))}));f.displayName="Toggle";export{d as IconScaling,f as Toggle,f as default};
1
+ import{jsx as e}from"react/jsx-runtime";import r,{forwardRef as t,Children as a}from"react";import{cva as o}from"class-variance-authority";import*as i from"@radix-ui/react-toggle";import{radiusVariants as n,scalingVariants as s,toggleAppearanceStyle as l}from"../../constants.mjs";import{cn as m}from"../../utils/utils.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";export{ToggleWithText}from"./ToggleWithText.mjs";var p=function(){return p=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},p.apply(this,arguments)},u=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)r.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t},d=o('grid place-content-center items-center justify-center box-border"',{variants:{radius:p({},n.base),size:{small:"w-6 h-6 p-[6px]",medium:"w-8 h-8 p-2",large:"w-10 h-10 p-[11px]"},scaling:p({},s)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),f={small:"w-[14px]",medium:"w-4",large:"w-[18px]"},g=t((function(t,o){var n=t.className,s=t.children,g=t.radius,h=t.size,y=void 0===h?"medium":h,v=t.scaling,x=t.color,b=void 0===x?"red":x,j=t.appearance,O=void 0===j?"surface":j,w=u(t,["className","children","radius","size","scaling","color","appearance"]),T=c().theme,z={radius:T.themeRadius||g,scaling:T.themeScaling||v,color:T.themeColor||b,size:y};return e(i.Root,p({ref:o,className:m(d(z),l(O,z.color,!0,"data-[state=on]:"),n)},w,{children:a.map(s,(function(e){return r.cloneElement(e,{className:f[y]})}))}))}));g.displayName="Toggle";export{f as IconScaling,g as Toggle,g as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../lib/components/Toggle/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, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nexport * from './ToggleWithText';\nvar toggleVariants = cva('grid place-content-center items-center justify-center box-border\"', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'w-6 h-6 p-[6px]',\n medium: 'w-8 h-8 p-2',\n large: 'w-10 h-10 p-[11px]',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var Toggle = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\"]);\n return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants({ radius: radius, size: size, scaling: scaling }), toggleAppearanceStyle(appearance, color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }) })));\n});\nToggle.displayName = 'Toggle';\nexport default Toggle;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","Toggle","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","props","_jsx","TogglePrimitive","Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"qXAAA,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,EAAiBC,EAAI,oEAAqE,CAC1FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,kBACPC,OAAQ,cACRC,MAAO,sBAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAASC,GAAW,SAAUC,EAAIC,GACzC,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ7B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,eAC3V,OAAQU,EAAKC,EAAgBC,KAAM/C,EAAS,CAAEoC,IAAKA,EAAKC,UAAWW,EAAG5B,EAAe,CAAEG,OAAQA,EAAQE,KAAMA,EAAMI,QAASA,IAAYoB,EAAsBN,EAAYF,GAAO,EAAM,oBAAqBJ,IAAcO,EAAO,CAAEN,SAAUY,EAASC,IAAIb,GAAU,SAAUc,GACtQ,OAAOC,EAAMC,aAAaF,EAAO,CAAEf,UAAWL,EAAYP,IACtE,MACA,IACAQ,EAAOsB,YAAc"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../lib/components/Toggle/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, { Children, forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { radiusVariants, scalingVariants, toggleAppearanceStyle } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nimport { useTheme } from '../../../lib/theme';\nexport * from './ToggleWithText';\nvar toggleVariants = cva('grid place-content-center items-center justify-center box-border\"', {\n variants: {\n radius: __assign({}, radiusVariants['base']),\n size: {\n small: 'w-6 h-6 p-[6px]',\n medium: 'w-8 h-8 p-2',\n large: 'w-10 h-10 p-[11px]',\n },\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n radius: 'medium',\n size: 'medium',\n scaling: '100%',\n },\n});\nexport var IconScaling = {\n small: 'w-[14px]',\n medium: 'w-4',\n large: 'w-[18px]',\n};\nexport var Toggle = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, _c = _a.color, color = _c === void 0 ? 'red' : _c, _d = _a.appearance, appearance = _d === void 0 ? 'surface' : _d, props = __rest(_a, [\"className\", \"children\", \"radius\", \"size\", \"scaling\", \"color\", \"appearance\"]);\n var theme = useTheme().theme;\n var contextValue = {\n radius: theme.themeRadius || radius,\n scaling: theme.themeScaling || scaling,\n color: theme.themeColor || color,\n size: size,\n };\n return (_jsx(TogglePrimitive.Root, __assign({ ref: ref, className: cn(toggleVariants(contextValue), toggleAppearanceStyle(appearance, contextValue.color, true, 'data-[state=on]:'), className) }, props, { children: Children.map(children, function (child) {\n return React.cloneElement(child, { className: IconScaling[size] });\n }) })));\n});\nToggle.displayName = 'Toggle';\nexport default Toggle;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleVariants","cva","variants","radius","radiusVariants","size","small","medium","large","scaling","scalingVariants","defaultVariants","IconScaling","Toggle","forwardRef","_a","ref","className","children","_b","_c","color","_d","appearance","props","theme","useTheme","contextValue","themeRadius","themeScaling","themeColor","_jsx","TogglePrimitive","Root","cn","toggleAppearanceStyle","Children","map","child","React","cloneElement","displayName"],"mappings":"8aAAA,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,EAAiBC,EAAI,oEAAqE,CAC1FC,SAAU,CACNC,OAAQvB,EAAS,CAAA,EAAIwB,EAAqB,MAC1CC,KAAM,CACFC,MAAO,kBACPC,OAAQ,cACRC,MAAO,sBAEXC,QAAS7B,EAAS,CAAE,EAAE8B,IAE1BC,gBAAiB,CACbR,OAAQ,SACRE,KAAM,SACNI,QAAS,UAGNG,EAAc,CACrBN,MAAO,WACPC,OAAQ,MACRC,MAAO,YAEAK,EAASC,GAAW,SAAUC,EAAIC,GACzC,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUf,EAASY,EAAGZ,OAAQgB,EAAKJ,EAAGV,KAAMA,OAAc,IAAPc,EAAgB,SAAWA,EAAIV,EAAUM,EAAGN,QAASW,EAAKL,EAAGM,MAAOA,OAAe,IAAPD,EAAgB,MAAQA,EAAIE,EAAKP,EAAGQ,WAAYA,OAAoB,IAAPD,EAAgB,UAAYA,EAAIE,EAAQ7B,EAAOoB,EAAI,CAAC,YAAa,WAAY,SAAU,OAAQ,UAAW,QAAS,eACvVU,EAAQC,IAAWD,MACnBE,EAAe,CACfxB,OAAQsB,EAAMG,aAAezB,EAC7BM,QAASgB,EAAMI,cAAgBpB,EAC/BY,MAAOI,EAAMK,YAAcT,EAC3BhB,KAAMA,GAEV,OAAQ0B,EAAKC,EAAgBC,KAAMrD,EAAS,CAAEoC,IAAKA,EAAKC,UAAWiB,EAAGlC,EAAe2B,GAAeQ,EAAsBZ,EAAYI,EAAaN,OAAO,EAAM,oBAAqBJ,IAAcO,EAAO,CAAEN,SAAUkB,EAASC,IAAInB,GAAU,SAAUoB,GAC/O,OAAOC,EAAMC,aAAaF,EAAO,CAAErB,UAAWL,EAAYP,IACtE,MACA,IACAQ,EAAO4B,YAAc"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -26,6 +27,7 @@ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
26
27
  import { cva } from 'class-variance-authority';
27
28
  import { scalingVariants } from '../../../lib/constants';
28
29
  import { cn } from '../../../lib/utils/utils';
30
+ import { useTheme } from '../../../lib/theme';
29
31
  var toggleVariants = cva('inline-flex', {
30
32
  variants: {
31
33
  scaling: __assign({}, scalingVariants),
@@ -41,8 +43,14 @@ export var ToggleGroupContext = createContext({
41
43
  });
42
44
  export var ToggleGroupRoot = forwardRef(function (_a, ref) {
43
45
  var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["className", "children", "scaling", "size", "color", "appearance"]);
46
+ var theme = useTheme().theme;
44
47
  var type = __assign({}, props).type;
45
- var contextValue = { size: size, color: color, appearance: appearance };
46
- return (_jsx(ToggleGroupContext.Provider, { value: contextValue, children: type === 'single' ? (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) : (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) }));
48
+ var contextValue = {
49
+ scaling: theme.themeScaling || scaling,
50
+ color: theme.themeColor || color,
51
+ size: size,
52
+ appearance: appearance,
53
+ };
54
+ return (_jsx(ToggleGroupContext.Provider, { value: contextValue, children: type === 'single' ? (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants(contextValue), className) }, props, { ref: ref, children: children }))) : (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants(contextValue), className) }, props, { ref: ref, children: children }))) }));
47
55
  });
48
56
  ToggleGroupRoot.displayName = 'ToggleGroup.Root';
@@ -1,2 +1,3 @@
1
- import{jsx as r}from"react/jsx-runtime";import{createContext as e,forwardRef as a}from"react";import*as t from"@radix-ui/react-toggle-group";import{cva as o}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import{cn as i}from"../../utils/utils.mjs";var c=function(){return c=Object.assign||function(r){for(var e,a=1,t=arguments.length;a<t;a++)for(var o in e=arguments[a])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},c.apply(this,arguments)},l=function(r,e){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(r);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(r,t[o])&&(a[t[o]]=r[t[o]])}return a},s=o("inline-flex",{variants:{scaling:c({},n)},defaultVariants:{scaling:"100%"}}),p=e({size:"medium",color:"red",appearance:"surface"}),m=a((function(e,a){var o=e.className,n=e.children,m=e.scaling,f=e.size,u=e.color,g=e.appearance,y=l(e,["className","children","scaling","size","color","appearance"]),d=(c({},y).type,{size:f,color:u,appearance:g});return r(p.Provider,{value:d,children:r(t.Root,c({className:i(s({scaling:m}),o)},y,{ref:a,children:n}))})}));m.displayName="ToggleGroup.Root";export{p as ToggleGroupContext,m as ToggleGroupRoot};
1
+ "use client";
2
+ import{jsx as r}from"react/jsx-runtime";import{createContext as e,forwardRef as t}from"react";import*as o from"@radix-ui/react-toggle-group";import{cva as a}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import{cn as i}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,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},l.apply(this,arguments)},s=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},p=a("inline-flex",{variants:{scaling:l({},n)},defaultVariants:{scaling:"100%"}}),m=e({size:"medium",color:"red",appearance:"surface"}),f=t((function(e,t){var a=e.className,n=e.children,f=e.scaling,u=e.size,g=e.color,h=e.appearance,y=s(e,["className","children","scaling","size","color","appearance"]),d=c().theme,v=(l({},y).type,{scaling:d.themeScaling||f,color:d.themeColor||g,size:u,appearance:h});return r(m.Provider,{value:v,children:r(o.Root,l({className:i(p(v),a)},y,{ref:t,children:n}))})}));f.displayName="ToggleGroup.Root";export{m as ToggleGroupContext,f as ToggleGroupRoot};
2
3
  //# sourceMappingURL=ToggleGroupRoot.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroupRoot.mjs","sources":["../../../lib/components/ToggleGroup/ToggleGroupRoot.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 { createContext, forwardRef } from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { cva } from 'class-variance-authority';\nimport { scalingVariants } from '../../../lib/constants';\nimport { cn } from '../../../lib/utils/utils';\nvar toggleVariants = cva('inline-flex', {\n variants: {\n scaling: __assign({}, scalingVariants),\n },\n defaultVariants: {\n scaling: '100%',\n },\n});\nexport var ToggleGroupContext = createContext({\n size: 'medium',\n color: 'red',\n appearance: 'surface',\n});\nexport var ToggleGroupRoot = forwardRef(function (_a, ref) {\n var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, color = _a.color, appearance = _a.appearance, props = __rest(_a, [\"className\", \"children\", \"scaling\", \"size\", \"color\", \"appearance\"]);\n var type = __assign({}, props).type;\n var contextValue = { size: size, color: color, appearance: appearance };\n return (_jsx(ToggleGroupContext.Provider, { value: contextValue, children: type === 'single' ? (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) : (_jsx(ToggleGroupPrimitive.Root, __assign({ className: cn(toggleVariants({ scaling: scaling }), className) }, props, { ref: ref, children: children }))) }));\n});\nToggleGroupRoot.displayName = 'ToggleGroup.Root';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","toggleVariants","cva","variants","scaling","scalingVariants","defaultVariants","ToggleGroupContext","createContext","size","color","appearance","ToggleGroupRoot","forwardRef","_a","ref","className","children","props","contextValue","type","_jsx","Provider","value","ToggleGroupPrimitive","Root","cn","displayName"],"mappings":"6RAAA,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,cAAe,CACpCC,SAAU,CACNC,QAASvB,EAAS,CAAE,EAAEwB,IAE1BC,gBAAiB,CACbF,QAAS,UAGNG,EAAqBC,EAAc,CAC1CC,KAAM,SACNC,MAAO,MACPC,WAAY,YAELC,EAAkBC,GAAW,SAAUC,EAAIC,GAClD,IAAIC,EAAYF,EAAGE,UAAWC,EAAWH,EAAGG,SAAUb,EAAUU,EAAGV,QAASK,EAAOK,EAAGL,KAAMC,EAAQI,EAAGJ,MAAOC,EAAaG,EAAGH,WAAYO,EAAQtB,EAAOkB,EAAI,CAAC,YAAa,WAAY,UAAW,OAAQ,QAAS,eAE/MK,GADOtC,EAAS,CAAE,EAAEqC,GAAOE,KACZ,CAAEX,KAAMA,EAAMC,MAAOA,EAAOC,WAAYA,IAC3D,OAAQU,EAAKd,EAAmBe,SAAU,CAAEC,MAAOJ,EAAcF,SAA+BI,EAAKG,EAAqBC,KAAM5C,EAAS,CAAEmC,UAAWU,EAAGzB,EAAe,CAAEG,QAASA,IAAYY,IAAcE,EAAO,CAAEH,IAAKA,EAAKE,SAAUA,MAC9O,IACAL,EAAgBe,YAAc"}
1
+ {"version":3,"file":"ToggleGroupRoot.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -6,7 +6,7 @@ export interface ToggleSwitchProps extends VariantProps<typeof toggleSwitchVaria
6
6
  }
7
7
  declare const toggleSwitchVariants: (props?: ({
8
8
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
9
- radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
9
+ radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
10
10
  size?: "small" | "medium" | "large" | null | undefined;
11
11
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
12
12
  export declare const ToggleSwitch: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/themes").SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref">, "size"> & ToggleSwitchProps & React.RefAttributes<HTMLButtonElement>>;
@@ -27,6 +27,7 @@ import { cn } from '../../../lib/utils/utils';
27
27
  import { radiusVariants, scalingVariants } from '../../../lib/constants';
28
28
  import { Switch as SwitchTheme, Theme } from '@radix-ui/themes';
29
29
  import { Text } from '../../../lib/Typography/Text';
30
+ import { useTheme } from '../../../lib/theme';
30
31
  var toggleSwitchVariants = cva('', {
31
32
  variants: {
32
33
  scaling: __assign({}, scalingVariants),
@@ -58,6 +59,7 @@ var SwitchLabelVariants = cva('flex items-center justify-start text-slate-12 fon
58
59
  });
59
60
  export var ToggleSwitch = React.forwardRef(function (_a, forwardedRef) {
60
61
  var className = _a.className, _b = _a.color, color = _b === void 0 ? 'red' : _b, scaling = _a.scaling, size = _a.size, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, radius = _a.radius, tabIndex = _a.tabIndex, children = _a.children, switchProps = __rest(_a, ["className", "color", "scaling", "size", "appearance", "radius", "tabIndex", "children"]);
62
+ var theme = useTheme().theme;
61
63
  if (radius === 'medium' || radius === 'large')
62
64
  radius = 'full';
63
65
  var sizeTheme = '2';
@@ -65,7 +67,17 @@ export var ToggleSwitch = React.forwardRef(function (_a, forwardedRef) {
65
67
  sizeTheme = '1';
66
68
  if (size === 'large')
67
69
  sizeTheme = '3';
68
- return (_jsx(Theme, { className: "flex", accentColor: color, hasBackground: false, children: _jsxs(Text, { as: "label", className: cn('flex items-center', SwitchLabelVariants({ size: size, scaling: scaling })), children: [_jsx(SwitchTheme, __assign({ ref: forwardedRef }, switchProps, { variant: appearance, radius: radius, size: sizeTheme, color: color, className: cn(toggleSwitchVariants({ scaling: scaling, radius: radius, size: size }), className), "aria-label": "Switch" })), children] }) }));
70
+ var contextValue = {
71
+ radius: theme.themeRadius || radius,
72
+ scaling: theme.themeScaling || scaling,
73
+ color: theme.themeColor || color,
74
+ size: size,
75
+ };
76
+ return (
77
+ // @ts-ignore
78
+ _jsx(Theme, { className: "flex", accentColor: contextValue.color, hasBackground: false, children: _jsxs(Text, { as: "label", className: cn('flex items-center', SwitchLabelVariants({ size: size, scaling: contextValue.scaling })), children: [_jsx(SwitchTheme, __assign({ ref: forwardedRef }, switchProps, { variant: appearance, radius: contextValue.radius, size: sizeTheme,
79
+ // @ts-ignore
80
+ color: contextValue.color, className: cn(toggleSwitchVariants(contextValue), className), "aria-label": "Switch" })), children] }) }));
69
81
  });
70
82
  ToggleSwitch.displayName = 'ToggleSwitch';
71
83
  export default ToggleSwitch;
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as e}from"react/jsx-runtime";import r from"react";import{cva as t}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{scalingVariants as s,radiusVariants as l}from"../../constants.mjs";import{Theme as n,Switch as o}from"@radix-ui/themes";import{Text as c}from"../../Typography/Text/index.mjs";var m=function(){return m=Object.assign||function(a){for(var e,r=1,t=arguments.length;r<t;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(a[i]=e[i]);return a},m.apply(this,arguments)},p=function(a,e){var r={};for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(a);i<t.length;i++)e.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(a,t[i])&&(r[t[i]]=a[t[i]])}return r},u=t("",{variants:{scaling:m({},s),radius:m({},l.base),size:{small:"w-[28px] h-[16px]",medium:"w-[35px] h-[20px]",large:"w-[42px] h-[24px]"}},defaultVariants:{radius:"full",size:"medium"}}),f=t("flex items-center justify-start text-slate-12 font-normal dark:text-white",{variants:{size:{small:"text-xs gap-2",medium:"text-sm gap-2",large:"text-base gap-3"},scaling:m({},s)},defaultVariants:{size:"medium",scaling:"100%"}}),d=r.forwardRef((function(r,t){var s=r.className,l=r.color,d=void 0===l?"red":l,x=r.scaling,g=r.size,h=r.appearance,y=void 0===h?"surface":h,b=r.radius;r.tabIndex;var v=r.children,O=p(r,["className","color","scaling","size","appearance","radius","tabIndex","children"]);"medium"!==b&&"large"!==b||(b="full");var j="2";return"small"===g&&(j="1"),"large"===g&&(j="3"),a(n,{className:"flex",accentColor:d,hasBackground:!1,children:e(c,{as:"label",className:i("flex items-center",f({size:g,scaling:x})),children:[a(o,m({ref:t},O,{variant:y,radius:b,size:j,color:d,className:i(u({scaling:x,radius:b,size:g}),s),"aria-label":"Switch"})),v]})})}));d.displayName="ToggleSwitch";export{d as ToggleSwitch,d as default};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import r from"react";import{cva as t}from"class-variance-authority";import{cn as i}from"../../utils/utils.mjs";import{scalingVariants as s,radiusVariants as l}from"../../constants.mjs";import{Theme as o,Switch as n}from"@radix-ui/themes";import{Text as m}from"../../Typography/Text/index.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";var p=function(){return p=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var i in a=arguments[r])Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);return e},p.apply(this,arguments)},u=function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)a.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]])}return r},f=t("",{variants:{scaling:p({},s),radius:p({},l.base),size:{small:"w-[28px] h-[16px]",medium:"w-[35px] h-[20px]",large:"w-[42px] h-[24px]"}},defaultVariants:{radius:"full",size:"medium"}}),d=t("flex items-center justify-start text-slate-12 font-normal dark:text-white",{variants:{size:{small:"text-xs gap-2",medium:"text-sm gap-2",large:"text-base gap-3"},scaling:p({},s)},defaultVariants:{size:"medium",scaling:"100%"}}),g=r.forwardRef((function(r,t){var s=r.className,l=r.color,g=void 0===l?"red":l,h=r.scaling,x=r.size,v=r.appearance,y=void 0===v?"surface":v,b=r.radius;r.tabIndex;var j=r.children,O=u(r,["className","color","scaling","size","appearance","radius","tabIndex","children"]),w=c().theme;"medium"!==b&&"large"!==b||(b="full");var z="2";"small"===x&&(z="1"),"large"===x&&(z="3");var N={radius:w.themeRadius||b,scaling:w.themeScaling||h,color:w.themeColor||g,size:x};return e(o,{className:"flex",accentColor:N.color,hasBackground:!1,children:a(m,{as:"label",className:i("flex items-center",d({size:x,scaling:N.scaling})),children:[e(n,p({ref:t},O,{variant:y,radius:N.radius,size:z,color:N.color,className:i(f(N),s),"aria-label":"Switch"})),j]})})}));g.displayName="ToggleSwitch";export{g as ToggleSwitch,g as default};
2
2
  //# sourceMappingURL=index.mjs.map