@lobehub/ui 4.27.4 → 4.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/es/Accordion/Accordion.d.mts +2 -2
  2. package/es/Accordion/Accordion.mjs +2 -2
  3. package/es/Accordion/Accordion.mjs.map +1 -1
  4. package/es/Accordion/AccordionItem.d.mts +2 -2
  5. package/es/Accordion/AccordionItem.mjs +2 -2
  6. package/es/Accordion/AccordionItem.mjs.map +1 -1
  7. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  8. package/es/Alert/Alert.d.mts +2 -2
  9. package/es/AutoComplete/Select.d.mts +2 -2
  10. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  11. package/es/Burger/Burger.d.mts +2 -2
  12. package/es/Checkbox/Checkbox.mjs +2 -2
  13. package/es/Checkbox/Checkbox.mjs.map +1 -1
  14. package/es/Checkbox/CheckboxGroup.mjs +2 -2
  15. package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
  16. package/es/CodeDiff/CodeDiff.d.mts +2 -2
  17. package/es/CodeDiff/PatchDiff.d.mts +2 -2
  18. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  19. package/es/CodeEditor/CodeEditor.mjs +2 -2
  20. package/es/CodeEditor/CodeEditor.mjs.map +1 -1
  21. package/es/Collapse/Collapse.d.mts +2 -2
  22. package/es/ColorSwatches/ColorSwatches.mjs +2 -2
  23. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  24. package/es/ConfigProvider/index.d.mts +2 -2
  25. package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
  26. package/es/CopyButton/CopyButton.d.mts +2 -2
  27. package/es/DatePicker/DatePicker.d.mts +2 -2
  28. package/es/DraggablePanel/DraggablePanel.mjs +2 -2
  29. package/es/DraggablePanel/DraggablePanel.mjs.map +1 -1
  30. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  31. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  32. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  33. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  34. package/es/DraggablePanel/components/DraggablePanelHeader.mjs +2 -2
  35. package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
  36. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  37. package/es/DraggableSideNav/DraggableSideNav.mjs +2 -2
  38. package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
  39. package/es/Drawer/Drawer.d.mts +2 -2
  40. package/es/Dropdown/Dropdown.d.mts +2 -2
  41. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  42. package/es/DropdownMenu/atoms.d.mts +17 -16
  43. package/es/DropdownMenu/atoms.mjs +9 -2
  44. package/es/DropdownMenu/atoms.mjs.map +1 -1
  45. package/es/EditableText/EditableText.d.mts +2 -2
  46. package/es/EditableText/EditableText.mjs +2 -2
  47. package/es/EditableText/EditableText.mjs.map +1 -1
  48. package/es/EditorSlashMenu/atoms.d.mts +12 -12
  49. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  50. package/es/EmojiPicker/EmojiPicker.mjs +3 -3
  51. package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
  52. package/es/Flex/FlexBasic.d.mts +2 -2
  53. package/es/FontLoader/index.d.mts +2 -2
  54. package/es/Footer/Footer.d.mts +2 -2
  55. package/es/Form/components/FormGroup.d.mts +2 -2
  56. package/es/Form/components/FormItem.d.mts +2 -2
  57. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  58. package/es/FormModal/FormModal.d.mts +2 -2
  59. package/es/GuideCard/GuideCard.d.mts +2 -2
  60. package/es/Header/Header.d.mts +2 -2
  61. package/es/Highlighter/Highlighter.d.mts +2 -2
  62. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  63. package/es/Hotkey/Hotkey.d.mts +2 -2
  64. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  65. package/es/HotkeyInput/HotkeyInput.mjs +2 -2
  66. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  67. package/es/Icon/Icon.d.mts +2 -2
  68. package/es/Icon/components/IconProvider.d.mts +3 -3
  69. package/es/Image/PreviewGroup.d.mts +2 -2
  70. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  71. package/es/ImageSelect/ImageSelect.mjs +2 -2
  72. package/es/ImageSelect/ImageSelect.mjs.map +1 -1
  73. package/es/Input/Input.d.mts +2 -2
  74. package/es/Input/InputNumber.d.mts +2 -2
  75. package/es/Input/InputOPT.d.mts +2 -2
  76. package/es/Input/InputPassword.d.mts +2 -2
  77. package/es/Input/TextArea.d.mts +2 -2
  78. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  79. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  80. package/es/Layout/components/LayoutMain.d.mts +2 -2
  81. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  82. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  83. package/es/Layout/components/LayoutToc.d.mts +2 -2
  84. package/es/List/ListItem/index.d.mts +2 -2
  85. package/es/LobeSelect/LobeSelect.d.mts +2 -2
  86. package/es/LobeSelect/atoms.d.mts +3 -3
  87. package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
  88. package/es/LobeSwitch/atoms.d.mts +4 -4
  89. package/es/LobeSwitch/atoms.mjs +2 -2
  90. package/es/LobeSwitch/atoms.mjs.map +1 -1
  91. package/es/Markdown/Markdown.d.mts +2 -2
  92. package/es/Markdown/Typography.d.mts +2 -2
  93. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  94. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  95. package/es/Menu/Menu.d.mts +2 -2
  96. package/es/Menu/sharedStyle.mjs +1 -1
  97. package/es/Menu/sharedStyle.mjs.map +1 -1
  98. package/es/Mermaid/Mermaid.d.mts +2 -2
  99. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  100. package/es/Modal/Modal.d.mts +2 -2
  101. package/es/Modal/ModalProvider.d.mts +2 -2
  102. package/es/Modal/imperative.d.mts +2 -2
  103. package/es/MotionProvider/index.d.mts +2 -2
  104. package/es/Popover/ArrowIcon.d.mts +2 -2
  105. package/es/Popover/atoms.d.mts +9 -9
  106. package/es/Popover/context.d.mts +2 -2
  107. package/es/SearchBar/SearchBar.d.mts +2 -2
  108. package/es/SearchBar/SearchBar.mjs +2 -2
  109. package/es/SearchBar/SearchBar.mjs.map +1 -1
  110. package/es/Segmented/Segmented.d.mts +2 -2
  111. package/es/Select/Select.d.mts +2 -2
  112. package/es/SideNav/SideNav.d.mts +2 -2
  113. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  114. package/es/SortableList/components/DragHandle.d.mts +2 -2
  115. package/es/SortableList/components/SortableItem.d.mts +2 -2
  116. package/es/Text/Text.mjs +7 -0
  117. package/es/Text/Text.mjs.map +1 -1
  118. package/es/Text/type.d.mts +1 -0
  119. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  120. package/es/Toast/imperative.d.mts +3 -3
  121. package/es/Toc/Toc.d.mts +2 -2
  122. package/es/Toc/TocMobile.mjs +2 -2
  123. package/es/Toc/TocMobile.mjs.map +1 -1
  124. package/es/Tooltip/style.mjs +0 -1
  125. package/es/Tooltip/style.mjs.map +1 -1
  126. package/es/Video/index.d.mts +2 -2
  127. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  128. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  129. package/es/awesome/Features/Features.d.mts +2 -2
  130. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  131. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  132. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  133. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  134. package/es/awesome/Hero/Hero.d.mts +2 -2
  135. package/es/awesome/Spline/Spine.d.mts +2 -2
  136. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  137. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  138. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  139. package/es/brand/LobeChat/index.d.mts +2 -2
  140. package/es/brand/LobeHub/index.d.mts +2 -2
  141. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  142. package/es/brand/LogoThree/index.d.mts +2 -2
  143. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  144. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  145. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  146. package/es/chat/ChatList/ChatList.d.mts +2 -2
  147. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  148. package/es/chat/EditableMessage/EditableMessage.mjs +3 -3
  149. package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
  150. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  151. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  152. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  153. package/es/chat/MessageModal/MessageModal.mjs +3 -3
  154. package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
  155. package/es/color/ColorScales/index.d.mts +2 -2
  156. package/es/color/CssVar/index.d.mts +2 -2
  157. package/es/hooks/useTextOverflow.mjs +31 -0
  158. package/es/hooks/useTextOverflow.mjs.map +1 -0
  159. package/es/i18n/context.d.mts +2 -2
  160. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  161. package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
  162. package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
  163. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
  164. package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
  165. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  166. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  167. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  168. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  169. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  170. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  171. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  172. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
  173. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  174. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  175. package/es/mdx/Mdx/index.d.mts +2 -2
  176. package/es/mobile/TabBar/TabBar.mjs +2 -2
  177. package/es/mobile/TabBar/TabBar.mjs.map +1 -1
  178. package/es/node_modules/unist-util-visit/lib/index.mjs +4 -5
  179. package/es/node_modules/unist-util-visit/lib/index.mjs.map +1 -1
  180. package/es/storybook/StoryBook/index.d.mts +2 -2
  181. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { TextAreaProps } from "./type.mjs";
2
- import * as react151 from "react";
2
+ import * as react132 from "react";
3
3
 
4
4
  //#region src/Input/TextArea.d.ts
5
- declare const TextArea: react151.NamedExoticComponent<TextAreaProps>;
5
+ declare const TextArea: react132.NamedExoticComponent<TextAreaProps>;
6
6
  //#endregion
7
7
  export { TextArea };
8
8
  //# sourceMappingURL=TextArea.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
2
  import "../../index.mjs";
3
- import * as react2 from "react";
3
+ import * as react26 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutFooter.d.ts
6
- declare const LayoutFooter: react2.NamedExoticComponent<DivProps>;
6
+ declare const LayoutFooter: react26.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { LayoutFooter };
9
9
  //# sourceMappingURL=LayoutFooter.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutHeaderProps } from "../type.mjs";
2
- import * as react3 from "react";
2
+ import * as react27 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutHeader.d.ts
5
- declare const LayoutHeader: react3.NamedExoticComponent<LayoutHeaderProps>;
5
+ declare const LayoutHeader: react27.NamedExoticComponent<LayoutHeaderProps>;
6
6
  //#endregion
7
7
  export { LayoutHeader };
8
8
  //# sourceMappingURL=LayoutHeader.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
2
  import "../../index.mjs";
3
- import * as react7 from "react";
3
+ import * as react28 from "react";
4
4
 
5
5
  //#region src/Layout/components/LayoutMain.d.ts
6
- declare const LayoutMain: react7.NamedExoticComponent<DivProps>;
6
+ declare const LayoutMain: react28.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { LayoutMain };
9
9
  //# sourceMappingURL=LayoutMain.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutSidebarProps } from "../type.mjs";
2
- import * as react5 from "react";
2
+ import * as react29 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebar.d.ts
5
- declare const LayoutSidebar: react5.NamedExoticComponent<LayoutSidebarProps>;
5
+ declare const LayoutSidebar: react29.NamedExoticComponent<LayoutSidebarProps>;
6
6
  //#endregion
7
7
  export { LayoutSidebar };
8
8
  //# sourceMappingURL=LayoutSidebar.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutSidebarInnerProps } from "../type.mjs";
2
- import * as react4 from "react";
2
+ import * as react30 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutSidebarInner.d.ts
5
- declare const LayoutSidebarInner: react4.NamedExoticComponent<LayoutSidebarInnerProps>;
5
+ declare const LayoutSidebarInner: react30.NamedExoticComponent<LayoutSidebarInnerProps>;
6
6
  //#endregion
7
7
  export { LayoutSidebarInner };
8
8
  //# sourceMappingURL=LayoutSidebarInner.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LayoutTocProps } from "../type.mjs";
2
- import * as react6 from "react";
2
+ import * as react31 from "react";
3
3
 
4
4
  //#region src/Layout/components/LayoutToc.d.ts
5
- declare const LayoutToc: react6.NamedExoticComponent<LayoutTocProps>;
5
+ declare const LayoutToc: react31.NamedExoticComponent<LayoutTocProps>;
6
6
  //#endregion
7
7
  export { LayoutToc };
8
8
  //# sourceMappingURL=LayoutToc.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ListItemProps } from "../type.mjs";
2
- import * as react80 from "react";
2
+ import * as react25 from "react";
3
3
 
4
4
  //#region src/List/ListItem/index.d.ts
5
- declare const ListItem: react80.NamedExoticComponent<ListItemProps>;
5
+ declare const ListItem: react25.NamedExoticComponent<ListItemProps>;
6
6
  //#endregion
7
7
  export { ListItem };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { LobeSelectProps } from "./type.mjs";
2
- import * as react79 from "react";
2
+ import * as react86 from "react";
3
3
 
4
4
  //#region src/LobeSelect/LobeSelect.d.ts
5
- declare const LobeSelect: react79.NamedExoticComponent<LobeSelectProps<any>>;
5
+ declare const LobeSelect: react86.NamedExoticComponent<LobeSelectProps<any>>;
6
6
  //#endregion
7
7
  export { LobeSelect };
8
8
  //# sourceMappingURL=LobeSelect.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { LobeSelectSize, LobeSelectVariant } from "./type.mjs";
2
2
  import { LOBE_SELECT_CONTAINER_ATTR } from "./constants.mjs";
3
- import * as react75 from "react";
3
+ import * as react82 from "react";
4
4
  import { ComponentProps, ComponentPropsWithRef } from "react";
5
5
  import * as react_jsx_runtime36 from "react/jsx-runtime";
6
6
  import * as _base_ui_react_select0 from "@base-ui/react/select";
@@ -9,8 +9,8 @@ import * as node_modules__base_ui_react_esm_separator_Separator0 from "node_modu
9
9
 
10
10
  //#region src/LobeSelect/atoms.d.ts
11
11
  declare const LobeSelectRoot: typeof Select.Root;
12
- declare const LobeSelectBackdrop: react75.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react75.RefAttributes<HTMLDivElement>>;
13
- declare const LobeSelectSeparator: react75.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react75.RefAttributes<HTMLDivElement>>;
12
+ declare const LobeSelectBackdrop: react82.ForwardRefExoticComponent<_base_ui_react_select0.SelectBackdropProps & react82.RefAttributes<HTMLDivElement>>;
13
+ declare const LobeSelectSeparator: react82.ForwardRefExoticComponent<node_modules__base_ui_react_esm_separator_Separator0.SeparatorProps & react82.RefAttributes<HTMLDivElement>>;
14
14
  type LobeSelectTriggerProps = Omit<ComponentPropsWithRef<typeof Select.Trigger>, 'children' | 'render'> & {
15
15
  children: ComponentProps<typeof Select.Trigger>['children'];
16
16
  shadow?: boolean;
@@ -1,8 +1,8 @@
1
1
  import { LobeSwitchProps } from "./type.mjs";
2
- import * as react11 from "react";
2
+ import * as react24 from "react";
3
3
 
4
4
  //#region src/LobeSwitch/LobeSwitch.d.ts
5
- declare const LobeSwitch: react11.NamedExoticComponent<LobeSwitchProps>;
5
+ declare const LobeSwitch: react24.NamedExoticComponent<LobeSwitchProps>;
6
6
  //#endregion
7
7
  export { LobeSwitch };
8
8
  //# sourceMappingURL=LobeSwitch.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { LobeSwitchChangeEventHandler, LobeSwitchContextType, LobeSwitchIconProps, LobeSwitchRootProps, LobeSwitchThumbProps } from "./type.mjs";
2
2
  import { styles } from "./style.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/LobeSwitch/atoms.d.ts
6
6
  declare const useLobeSwitchContext: () => LobeSwitchContextType;
@@ -24,7 +24,7 @@ declare const LobeSwitchRoot: {
24
24
  id,
25
25
  name,
26
26
  ...rest
27
- }: LobeSwitchRootInternalProps): react_jsx_runtime0.JSX.Element;
27
+ }: LobeSwitchRootInternalProps): react_jsx_runtime7.JSX.Element;
28
28
  displayName: string;
29
29
  };
30
30
  declare const LobeSwitchThumb: {
@@ -35,7 +35,7 @@ declare const LobeSwitchThumb: {
35
35
  transition,
36
36
  children,
37
37
  ...rest
38
- }: LobeSwitchThumbProps): react_jsx_runtime0.JSX.Element;
38
+ }: LobeSwitchThumbProps): react_jsx_runtime7.JSX.Element;
39
39
  displayName: string;
40
40
  };
41
41
  declare const LobeSwitchIcon: {
@@ -48,7 +48,7 @@ declare const LobeSwitchIcon: {
48
48
  }: LobeSwitchIconProps & {
49
49
  children?: React.ReactNode;
50
50
  size?: "default" | "small";
51
- }): react_jsx_runtime0.JSX.Element;
51
+ }): react_jsx_runtime7.JSX.Element;
52
52
  displayName: string;
53
53
  };
54
54
  //#endregion
@@ -5,7 +5,7 @@ import { rootVariants, styles, thumbVariants } from "./style.mjs";
5
5
  import { createContext, useContext, useMemo, useRef, useState } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { cx } from "antd-style";
8
- import useMergeState from "use-merge-value";
8
+ import useControlledState from "use-merge-value";
9
9
  import { Switch } from "@base-ui/react/switch";
10
10
 
11
11
  //#region src/LobeSwitch/atoms.tsx
@@ -19,7 +19,7 @@ const LobeSwitchRoot = ({ checked, className, defaultChecked, onCheckedChange, o
19
19
  const Motion = useMotionComponent();
20
20
  const [isPressed, setIsPressed] = useState(false);
21
21
  const lastEventRef = useRef(null);
22
- const [isChecked, setIsChecked] = useMergeState(defaultChecked ?? false, {
22
+ const [isChecked, setIsChecked] = useControlledState(defaultChecked ?? false, {
23
23
  defaultValue: defaultChecked,
24
24
  onChange: (value) => {
25
25
  if (lastEventRef.current) onCheckedChange?.(value, lastEventRef.current);
@@ -1 +1 @@
1
- {"version":3,"file":"atoms.mjs","names":["useControlledState"],"sources":["../../src/LobeSwitch/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Switch } from '@base-ui/react/switch';\nimport { cx } from 'antd-style';\nimport type { KeyboardEvent, MouseEvent } from 'react';\nimport { createContext, useContext, useMemo, useRef, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport { useMotionComponent } from '@/MotionProvider';\n\nimport { rootVariants, styles, thumbVariants } from './style';\nimport type {\n LobeSwitchChangeEventHandler,\n LobeSwitchContextType,\n LobeSwitchIconPosition,\n LobeSwitchIconProps,\n LobeSwitchRootProps,\n LobeSwitchThumbProps,\n} from './type';\n\nconst LobeSwitchContext = createContext<LobeSwitchContextType | null>(null);\n\nexport const useLobeSwitchContext = () => {\n const context = useContext(LobeSwitchContext);\n if (!context) {\n throw new Error('useLobeSwitchContext must be used within a LobeSwitchRoot');\n }\n return context;\n};\n\ntype LobeSwitchRootInternalProps = Omit<LobeSwitchRootProps, 'onCheckedChange' | 'onClick'> & {\n onCheckedChange?: LobeSwitchChangeEventHandler;\n onClick?: LobeSwitchChangeEventHandler;\n};\n\nexport const LobeSwitchRoot = ({\n checked,\n className,\n defaultChecked,\n onCheckedChange,\n onClick,\n size = 'default',\n children,\n disabled,\n readOnly,\n required,\n inputRef,\n id,\n name,\n ...rest\n}: LobeSwitchRootInternalProps) => {\n const Motion = useMotionComponent();\n const [isPressed, setIsPressed] = useState(false);\n const lastEventRef = useRef<MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>>(\n null,\n );\n\n const [isChecked, setIsChecked] = useControlledState(defaultChecked ?? false, {\n defaultValue: defaultChecked,\n onChange: (value: boolean) => {\n if (lastEventRef.current) {\n onCheckedChange?.(value, lastEventRef.current);\n }\n },\n value: checked,\n });\n\n const baseClassName = rootVariants({ size });\n\n const contextValue = useMemo(\n () => ({\n isChecked: Boolean(isChecked),\n isPressed,\n setIsChecked: (value: boolean) => setIsChecked(value),\n setIsPressed,\n }),\n [isChecked, isPressed, setIsChecked],\n );\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n lastEventRef.current = event;\n onClick?.(!isChecked, event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n lastEventRef.current = event;\n }\n (rest as any).onKeyDown?.(event);\n };\n\n return (\n <LobeSwitchContext.Provider value={contextValue}>\n <Switch.Root\n checked={isChecked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n id={id}\n inputRef={inputRef}\n name={name}\n onCheckedChange={setIsChecked}\n readOnly={readOnly}\n render={\n <Motion.button\n {...rest}\n className={cx(baseClassName, className)}\n initial={false}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onTap={() => setIsPressed(false)}\n onTapCancel={() => setIsPressed(false)}\n onTapStart={() => setIsPressed(true)}\n whileTap=\"tap\"\n />\n }\n required={required}\n >\n {children}\n </Switch.Root>\n </LobeSwitchContext.Provider>\n );\n};\n\nLobeSwitchRoot.displayName = 'LobeSwitchRoot';\n\nexport const LobeSwitchThumb = ({\n className,\n pressedAnimation,\n size = 'default',\n transition = { damping: 25, stiffness: 300, type: 'spring' },\n children,\n ...rest\n}: LobeSwitchThumbProps) => {\n const Motion = useMotionComponent();\n const { isPressed } = useLobeSwitchContext();\n const baseClassName = thumbVariants({ size });\n\n const defaultPressedAnimation = {\n width: size === 'small' ? 16 : 22,\n };\n\n return (\n <Switch.Thumb\n render={\n <Motion.span\n animate={isPressed ? pressedAnimation || defaultPressedAnimation : undefined}\n className={cx(baseClassName, className)}\n layout\n transition={transition}\n {...rest}\n >\n {children}\n </Motion.span>\n }\n />\n );\n};\n\nLobeSwitchThumb.displayName = 'LobeSwitchThumb';\n\nconst getIconPositionClass = (position: LobeSwitchIconPosition, size: 'default' | 'small') => {\n if (position === 'thumb') return styles.iconThumb;\n if (position === 'left') return size === 'small' ? styles.iconLeftSmall : styles.iconLeft;\n return size === 'small' ? styles.iconRightSmall : styles.iconRight;\n};\n\nexport const LobeSwitchIcon = ({\n children,\n className,\n position,\n transition = { bounce: 0, type: 'spring' },\n ...rest\n}: LobeSwitchIconProps & { children?: React.ReactNode; size?: 'default' | 'small' }) => {\n const Motion = useMotionComponent();\n const { isChecked } = useLobeSwitchContext();\n const size = (rest as any).size || 'default';\n\n const isAnimated = useMemo(() => {\n if (position === 'right') return !isChecked;\n if (position === 'left') return isChecked;\n if (position === 'thumb') return true;\n return false;\n }, [position, isChecked]);\n\n const positionClass = getIconPositionClass(position, size);\n\n return (\n <Motion.span\n animate={isAnimated ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0 }}\n className={cx(styles.icon, positionClass, className)}\n transition={transition}\n {...rest}\n >\n {children}\n </Motion.span>\n );\n};\n\nLobeSwitchIcon.displayName = 'LobeSwitchIcon';\n\nexport { styles as lobeSwitchStyles } from './style';\n"],"mappings":"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"}
1
+ {"version":3,"file":"atoms.mjs","names":[],"sources":["../../src/LobeSwitch/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Switch } from '@base-ui/react/switch';\nimport { cx } from 'antd-style';\nimport type { KeyboardEvent, MouseEvent } from 'react';\nimport { createContext, useContext, useMemo, useRef, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport { useMotionComponent } from '@/MotionProvider';\n\nimport { rootVariants, styles, thumbVariants } from './style';\nimport type {\n LobeSwitchChangeEventHandler,\n LobeSwitchContextType,\n LobeSwitchIconPosition,\n LobeSwitchIconProps,\n LobeSwitchRootProps,\n LobeSwitchThumbProps,\n} from './type';\n\nconst LobeSwitchContext = createContext<LobeSwitchContextType | null>(null);\n\nexport const useLobeSwitchContext = () => {\n const context = useContext(LobeSwitchContext);\n if (!context) {\n throw new Error('useLobeSwitchContext must be used within a LobeSwitchRoot');\n }\n return context;\n};\n\ntype LobeSwitchRootInternalProps = Omit<LobeSwitchRootProps, 'onCheckedChange' | 'onClick'> & {\n onCheckedChange?: LobeSwitchChangeEventHandler;\n onClick?: LobeSwitchChangeEventHandler;\n};\n\nexport const LobeSwitchRoot = ({\n checked,\n className,\n defaultChecked,\n onCheckedChange,\n onClick,\n size = 'default',\n children,\n disabled,\n readOnly,\n required,\n inputRef,\n id,\n name,\n ...rest\n}: LobeSwitchRootInternalProps) => {\n const Motion = useMotionComponent();\n const [isPressed, setIsPressed] = useState(false);\n const lastEventRef = useRef<MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>>(\n null,\n );\n\n const [isChecked, setIsChecked] = useControlledState(defaultChecked ?? false, {\n defaultValue: defaultChecked,\n onChange: (value: boolean) => {\n if (lastEventRef.current) {\n onCheckedChange?.(value, lastEventRef.current);\n }\n },\n value: checked,\n });\n\n const baseClassName = rootVariants({ size });\n\n const contextValue = useMemo(\n () => ({\n isChecked: Boolean(isChecked),\n isPressed,\n setIsChecked: (value: boolean) => setIsChecked(value),\n setIsPressed,\n }),\n [isChecked, isPressed, setIsChecked],\n );\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n lastEventRef.current = event;\n onClick?.(!isChecked, event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n lastEventRef.current = event;\n }\n (rest as any).onKeyDown?.(event);\n };\n\n return (\n <LobeSwitchContext.Provider value={contextValue}>\n <Switch.Root\n checked={isChecked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n id={id}\n inputRef={inputRef}\n name={name}\n onCheckedChange={setIsChecked}\n readOnly={readOnly}\n render={\n <Motion.button\n {...rest}\n className={cx(baseClassName, className)}\n initial={false}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onTap={() => setIsPressed(false)}\n onTapCancel={() => setIsPressed(false)}\n onTapStart={() => setIsPressed(true)}\n whileTap=\"tap\"\n />\n }\n required={required}\n >\n {children}\n </Switch.Root>\n </LobeSwitchContext.Provider>\n );\n};\n\nLobeSwitchRoot.displayName = 'LobeSwitchRoot';\n\nexport const LobeSwitchThumb = ({\n className,\n pressedAnimation,\n size = 'default',\n transition = { damping: 25, stiffness: 300, type: 'spring' },\n children,\n ...rest\n}: LobeSwitchThumbProps) => {\n const Motion = useMotionComponent();\n const { isPressed } = useLobeSwitchContext();\n const baseClassName = thumbVariants({ size });\n\n const defaultPressedAnimation = {\n width: size === 'small' ? 16 : 22,\n };\n\n return (\n <Switch.Thumb\n render={\n <Motion.span\n animate={isPressed ? pressedAnimation || defaultPressedAnimation : undefined}\n className={cx(baseClassName, className)}\n layout\n transition={transition}\n {...rest}\n >\n {children}\n </Motion.span>\n }\n />\n );\n};\n\nLobeSwitchThumb.displayName = 'LobeSwitchThumb';\n\nconst getIconPositionClass = (position: LobeSwitchIconPosition, size: 'default' | 'small') => {\n if (position === 'thumb') return styles.iconThumb;\n if (position === 'left') return size === 'small' ? styles.iconLeftSmall : styles.iconLeft;\n return size === 'small' ? styles.iconRightSmall : styles.iconRight;\n};\n\nexport const LobeSwitchIcon = ({\n children,\n className,\n position,\n transition = { bounce: 0, type: 'spring' },\n ...rest\n}: LobeSwitchIconProps & { children?: React.ReactNode; size?: 'default' | 'small' }) => {\n const Motion = useMotionComponent();\n const { isChecked } = useLobeSwitchContext();\n const size = (rest as any).size || 'default';\n\n const isAnimated = useMemo(() => {\n if (position === 'right') return !isChecked;\n if (position === 'left') return isChecked;\n if (position === 'thumb') return true;\n return false;\n }, [position, isChecked]);\n\n const positionClass = getIconPositionClass(position, size);\n\n return (\n <Motion.span\n animate={isAnimated ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0 }}\n className={cx(styles.icon, positionClass, className)}\n transition={transition}\n {...rest}\n >\n {children}\n </Motion.span>\n );\n};\n\nLobeSwitchIcon.displayName = 'LobeSwitchIcon';\n\nexport { styles as lobeSwitchStyles } from './style';\n"],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import { MarkdownProps } from "./type.mjs";
2
- import * as react0 from "react";
2
+ import * as react22 from "react";
3
3
 
4
4
  //#region src/Markdown/Markdown.d.ts
5
- declare const Markdown: react0.NamedExoticComponent<MarkdownProps>;
5
+ declare const Markdown: react22.NamedExoticComponent<MarkdownProps>;
6
6
  //#endregion
7
7
  export { Markdown };
8
8
  //# sourceMappingURL=Markdown.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { TypographyProps } from "./type.mjs";
2
- import * as react1 from "react";
2
+ import * as react21 from "react";
3
3
 
4
4
  //#region src/Markdown/Typography.d.ts
5
- declare const Typography: react1.NamedExoticComponent<TypographyProps>;
5
+ declare const Typography: react21.NamedExoticComponent<TypographyProps>;
6
6
  //#endregion
7
7
  export { Typography };
8
8
  //# sourceMappingURL=Typography.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { FlexboxProps } from "../../../Flex/type.mjs";
2
2
  import "../../../Flex/index.mjs";
3
- import * as react85 from "react";
3
+ import * as react66 from "react";
4
4
  import { Ref } from "react";
5
5
 
6
6
  //#region src/Markdown/components/SearchResultCards/index.d.ts
@@ -14,7 +14,7 @@ interface SearchResultCardsProps extends FlexboxProps {
14
14
  dataSource: string[] | SearchResultItem[];
15
15
  ref?: Ref<HTMLDivElement>;
16
16
  }
17
- declare const SearchResultCards: react85.NamedExoticComponent<SearchResultCardsProps>;
17
+ declare const SearchResultCards: react66.NamedExoticComponent<SearchResultCardsProps>;
18
18
  //#endregion
19
19
  export { SearchResultCards, SearchResultCardsProps };
20
20
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MaskShadowProps } from "./type.mjs";
2
- import * as react8 from "react";
2
+ import * as react23 from "react";
3
3
 
4
4
  //#region src/MaskShadow/MaskShadow.d.ts
5
- declare const MaskShadow: react8.NamedExoticComponent<MaskShadowProps>;
5
+ declare const MaskShadow: react23.NamedExoticComponent<MaskShadowProps>;
6
6
  //#endregion
7
7
  export { MaskShadow };
8
8
  //# sourceMappingURL=MaskShadow.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MenuProps } from "./type.mjs";
2
- import * as react0 from "react";
2
+ import * as react16 from "react";
3
3
 
4
4
  //#region src/Menu/Menu.d.ts
5
- declare const Menu: react0.NamedExoticComponent<MenuProps<unknown>>;
5
+ declare const Menu: react16.NamedExoticComponent<MenuProps<unknown>>;
6
6
  //#endregion
7
7
  export { Menu };
8
8
  //# sourceMappingURL=Menu.d.mts.map
@@ -30,7 +30,7 @@ const styles = createStaticStyles(({ css: css$1, cssVar: cssVar$1 }) => ({
30
30
  font-weight: 500;
31
31
  line-height: 16px;
32
32
  color: ${cssVar$1.colorTextTertiary};
33
- text-transform: uppercase;
33
+ text-transform: capitalize;
34
34
  `,
35
35
  icon: css$1`
36
36
  display: flex;
@@ -1 +1 @@
1
- {"version":3,"file":"sharedStyle.mjs","names":["cssVar"],"sources":["../../src/Menu/sharedStyle.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n danger: css`\n color: ${cssVar.colorError} !important;\n\n &:hover {\n background: ${cssVar.colorErrorBg} !important;\n }\n `,\n\n empty: css`\n cursor: default;\n font-style: italic;\n color: ${cssVar.colorTextTertiary};\n `,\n\n extra: css`\n margin-inline-start: auto;\n padding-inline-start: 16px;\n font-size: 12px;\n color: ${cssVar.colorTextTertiary};\n `,\n\n groupLabel: css`\n user-select: none;\n\n padding-block: 8px 4px;\n padding-inline: 12px;\n\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n color: ${cssVar.colorTextTertiary};\n text-transform: uppercase;\n `,\n\n icon: css`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n margin-inline-end: 8px;\n `,\n\n item: css`\n cursor: pointer;\n user-select: none;\n\n position: relative;\n\n overflow: hidden;\n display: flex;\n align-items: center;\n\n width: 100%;\n min-height: 36px;\n padding-block: 8px;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadiusSM};\n\n font-size: 14px;\n line-height: 20px;\n color: ${cssVar.colorText};\n\n outline: none;\n\n transition: all 150ms ${cssVar.motionEaseOut};\n\n &:hover {\n background: ${cssVar.colorFillTertiary};\n }\n\n &:active {\n background: ${cssVar.colorFillSecondary};\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: ${cssVar.colorTextDisabled};\n opacity: 0.5;\n\n &:hover {\n background: transparent;\n }\n }\n\n &[data-highlighted]:not([data-disabled]) {\n background: ${cssVar.colorFillTertiary};\n }\n\n &[data-state='open']:not([data-disabled]),\n &[data-open]:not([data-disabled]),\n &[aria-expanded='true']:not([data-disabled]) {\n background: ${cssVar.colorFillTertiary};\n }\n `,\n\n itemContent: css`\n display: flex;\n flex: 1;\n gap: 0;\n align-items: center;\n `,\n\n label: css`\n overflow: hidden;\n flex: 1;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n & a,\n & a:visited,\n & a:hover,\n & a:active {\n color: inherit;\n }\n `,\n\n popup: css`\n min-width: 120px;\n padding: 4px;\n border-radius: ${cssVar.borderRadius};\n\n background: ${cssVar.colorBgElevated};\n outline: none;\n box-shadow:\n 0 0 15px 0 #00000008,\n 0 2px 30px 0 #00000014,\n 0 0 0 1px ${cssVar.colorBorder} inset;\n `,\n positioner: css`\n --lobe-dropdown-animation-duration: 140ms;\n --lobe-dropdown-animation-scale-y: 0.92;\n --lobe-dropdown-animation-ease-in: ease-in;\n --lobe-dropdown-animation-ease-out: ${cssVar.motionEaseOut};\n\n z-index: 1100;\n\n & > * {\n will-change: opacity, transform;\n transform-origin: var(--transform-origin);\n animation: none;\n }\n\n &[data-open] > * {\n transform: scaleY(1);\n opacity: 1;\n transition:\n opacity var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-out),\n transform var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-out);\n }\n\n &[data-open] > *[data-starting-style] {\n transform: scaleY(var(--lobe-dropdown-animation-scale-y));\n opacity: 0;\n }\n\n &[data-closed] > * {\n transform: scaleY(var(--lobe-dropdown-animation-scale-y));\n opacity: 0;\n transition:\n opacity var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-in),\n transform var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-in);\n }\n\n &[data-hover-trigger] {\n --lobe-dropdown-animation-duration: 140ms;\n }\n `,\n\n separator: css`\n height: 1px;\n margin-block: 4px;\n margin-inline: 0;\n background: ${cssVar.colorBorder};\n `,\n\n submenuArrow: css`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 20px;\n height: 20px;\n margin-inline-start: auto;\n padding-inline-start: 8px;\n `,\n}));\n"],"mappings":";;;AAEA,MAAa,SAAS,oBAAoB,EAAE,YAAK,wBAAc;CAC7D,QAAQ,KAAG;aACAA,SAAO,WAAW;;;oBAGXA,SAAO,aAAa;;;CAItC,OAAO,KAAG;;;aAGCA,SAAO,kBAAkB;;CAGpC,OAAO,KAAG;;;;aAICA,SAAO,kBAAkB;;CAGpC,YAAY,KAAG;;;;;;;;;aASJA,SAAO,kBAAkB;;;CAIpC,MAAM,KAAG;;;;;;;;;;CAWT,MAAM,KAAG;;;;;;;;;;;;;;qBAcUA,SAAO,eAAe;;;;aAI9BA,SAAO,UAAU;;;;4BAIFA,SAAO,cAAc;;;oBAG7BA,SAAO,kBAAkB;;;;oBAIzBA,SAAO,mBAAmB;;;;;eAK/BA,SAAO,kBAAkB;;;;;;;;;oBASpBA,SAAO,kBAAkB;;;;;;oBAMzBA,SAAO,kBAAkB;;;CAI3C,aAAa,KAAG;;;;;;CAOhB,OAAO,KAAG;;;;;;;;;;;;;CAcV,OAAO,KAAG;;;qBAGSA,SAAO,aAAa;;kBAEvBA,SAAO,gBAAgB;;;;;kBAKvBA,SAAO,YAAY;;CAEnC,YAAY,KAAG;;;;0CAIyBA,SAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC7D,WAAW,KAAG;;;;kBAIEA,SAAO,YAAY;;CAGnC,cAAc,KAAG;;;;;;;;;;;CAWlB,EAAE"}
1
+ {"version":3,"file":"sharedStyle.mjs","names":["cssVar"],"sources":["../../src/Menu/sharedStyle.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n danger: css`\n color: ${cssVar.colorError} !important;\n\n &:hover {\n background: ${cssVar.colorErrorBg} !important;\n }\n `,\n\n empty: css`\n cursor: default;\n font-style: italic;\n color: ${cssVar.colorTextTertiary};\n `,\n\n extra: css`\n margin-inline-start: auto;\n padding-inline-start: 16px;\n font-size: 12px;\n color: ${cssVar.colorTextTertiary};\n `,\n\n groupLabel: css`\n user-select: none;\n\n padding-block: 8px 4px;\n padding-inline: 12px;\n\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n color: ${cssVar.colorTextTertiary};\n text-transform: capitalize;\n `,\n\n icon: css`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n margin-inline-end: 8px;\n `,\n\n item: css`\n cursor: pointer;\n user-select: none;\n\n position: relative;\n\n overflow: hidden;\n display: flex;\n align-items: center;\n\n width: 100%;\n min-height: 36px;\n padding-block: 8px;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadiusSM};\n\n font-size: 14px;\n line-height: 20px;\n color: ${cssVar.colorText};\n\n outline: none;\n\n transition: all 150ms ${cssVar.motionEaseOut};\n\n &:hover {\n background: ${cssVar.colorFillTertiary};\n }\n\n &:active {\n background: ${cssVar.colorFillSecondary};\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: ${cssVar.colorTextDisabled};\n opacity: 0.5;\n\n &:hover {\n background: transparent;\n }\n }\n\n &[data-highlighted]:not([data-disabled]) {\n background: ${cssVar.colorFillTertiary};\n }\n\n &[data-state='open']:not([data-disabled]),\n &[data-open]:not([data-disabled]),\n &[aria-expanded='true']:not([data-disabled]) {\n background: ${cssVar.colorFillTertiary};\n }\n `,\n\n itemContent: css`\n display: flex;\n flex: 1;\n gap: 0;\n align-items: center;\n `,\n\n label: css`\n overflow: hidden;\n flex: 1;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n & a,\n & a:visited,\n & a:hover,\n & a:active {\n color: inherit;\n }\n `,\n\n popup: css`\n min-width: 120px;\n padding: 4px;\n border-radius: ${cssVar.borderRadius};\n\n background: ${cssVar.colorBgElevated};\n outline: none;\n box-shadow:\n 0 0 15px 0 #00000008,\n 0 2px 30px 0 #00000014,\n 0 0 0 1px ${cssVar.colorBorder} inset;\n `,\n positioner: css`\n --lobe-dropdown-animation-duration: 140ms;\n --lobe-dropdown-animation-scale-y: 0.92;\n --lobe-dropdown-animation-ease-in: ease-in;\n --lobe-dropdown-animation-ease-out: ${cssVar.motionEaseOut};\n\n z-index: 1100;\n\n & > * {\n will-change: opacity, transform;\n transform-origin: var(--transform-origin);\n animation: none;\n }\n\n &[data-open] > * {\n transform: scaleY(1);\n opacity: 1;\n transition:\n opacity var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-out),\n transform var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-out);\n }\n\n &[data-open] > *[data-starting-style] {\n transform: scaleY(var(--lobe-dropdown-animation-scale-y));\n opacity: 0;\n }\n\n &[data-closed] > * {\n transform: scaleY(var(--lobe-dropdown-animation-scale-y));\n opacity: 0;\n transition:\n opacity var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-in),\n transform var(--lobe-dropdown-animation-duration) var(--lobe-dropdown-animation-ease-in);\n }\n\n &[data-hover-trigger] {\n --lobe-dropdown-animation-duration: 140ms;\n }\n `,\n\n separator: css`\n height: 1px;\n margin-block: 4px;\n margin-inline: 0;\n background: ${cssVar.colorBorder};\n `,\n\n submenuArrow: css`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 20px;\n height: 20px;\n margin-inline-start: auto;\n padding-inline-start: 8px;\n `,\n}));\n"],"mappings":";;;AAEA,MAAa,SAAS,oBAAoB,EAAE,YAAK,wBAAc;CAC7D,QAAQ,KAAG;aACAA,SAAO,WAAW;;;oBAGXA,SAAO,aAAa;;;CAItC,OAAO,KAAG;;;aAGCA,SAAO,kBAAkB;;CAGpC,OAAO,KAAG;;;;aAICA,SAAO,kBAAkB;;CAGpC,YAAY,KAAG;;;;;;;;;aASJA,SAAO,kBAAkB;;;CAIpC,MAAM,KAAG;;;;;;;;;;CAWT,MAAM,KAAG;;;;;;;;;;;;;;qBAcUA,SAAO,eAAe;;;;aAI9BA,SAAO,UAAU;;;;4BAIFA,SAAO,cAAc;;;oBAG7BA,SAAO,kBAAkB;;;;oBAIzBA,SAAO,mBAAmB;;;;;eAK/BA,SAAO,kBAAkB;;;;;;;;;oBASpBA,SAAO,kBAAkB;;;;;;oBAMzBA,SAAO,kBAAkB;;;CAI3C,aAAa,KAAG;;;;;;CAOhB,OAAO,KAAG;;;;;;;;;;;;;CAcV,OAAO,KAAG;;;qBAGSA,SAAO,aAAa;;kBAEvBA,SAAO,gBAAgB;;;;;kBAKvBA,SAAO,YAAY;;CAEnC,YAAY,KAAG;;;;0CAIyBA,SAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC7D,WAAW,KAAG;;;;kBAIEA,SAAO,YAAY;;CAGnC,cAAc,KAAG;;;;;;;;;;;CAWlB,EAAE"}
@@ -1,8 +1,8 @@
1
1
  import { MermaidProps } from "./type.mjs";
2
- import * as react73 from "react";
2
+ import * as react70 from "react";
3
3
 
4
4
  //#region src/Mermaid/Mermaid.d.ts
5
- declare const Mermaid: react73.NamedExoticComponent<MermaidProps>;
5
+ declare const Mermaid: react70.NamedExoticComponent<MermaidProps>;
6
6
  //#endregion
7
7
  export { Mermaid };
8
8
  //# sourceMappingURL=Mermaid.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { SyntaxMermaidProps } from "../type.mjs";
2
- import * as react74 from "react";
2
+ import * as react71 from "react";
3
3
 
4
4
  //#region src/Mermaid/SyntaxMermaid/index.d.ts
5
- declare const SyntaxMermaid: react74.NamedExoticComponent<SyntaxMermaidProps>;
5
+ declare const SyntaxMermaid: react71.NamedExoticComponent<SyntaxMermaidProps>;
6
6
  //#endregion
7
7
  export { SyntaxMermaid };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ModalProps } from "./type.mjs";
2
- import * as react70 from "react";
2
+ import * as react8 from "react";
3
3
 
4
4
  //#region src/Modal/Modal.d.ts
5
- declare const Modal: react70.NamedExoticComponent<ModalProps>;
5
+ declare const Modal: react8.NamedExoticComponent<ModalProps>;
6
6
  //#endregion
7
7
  export { Modal };
8
8
  //# sourceMappingURL=Modal.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { ModalContextValue } from "./type.mjs";
2
- import * as react71 from "react";
2
+ import * as react9 from "react";
3
3
  import { ReactNode } from "react";
4
4
 
5
5
  //#region src/Modal/ModalProvider.d.ts
6
- declare const ModalProvider: react71.NamedExoticComponent<{
6
+ declare const ModalProvider: react9.NamedExoticComponent<{
7
7
  children: ReactNode;
8
8
  value: ModalContextValue;
9
9
  }>;
@@ -1,5 +1,5 @@
1
1
  import { ImperativeModalProps, ModalInstance, RawModalComponent, RawModalComponentProps, RawModalInstance, RawModalKeyOptions, RawModalOptions } from "./type.mjs";
2
- import * as react_jsx_runtime35 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/Modal/imperative.d.ts
5
5
  type ModalHostProps = {
@@ -7,7 +7,7 @@ type ModalHostProps = {
7
7
  };
8
8
  declare const ModalHost: ({
9
9
  root
10
- }: ModalHostProps) => react_jsx_runtime35.JSX.Element | null;
10
+ }: ModalHostProps) => react_jsx_runtime6.JSX.Element | null;
11
11
  declare const createModal: (props: ImperativeModalProps) => ModalInstance;
12
12
  declare function createRawModal<P extends RawModalComponentProps>(component: RawModalComponent<P>, props: Omit<P, 'open' | 'onClose'>, options?: RawModalOptions): RawModalInstance<P>;
13
13
  declare function createRawModal<P, OpenKey extends keyof P, CloseKey extends keyof P>(component: RawModalComponent<P>, props: Omit<P, OpenKey | CloseKey>, options: RawModalKeyOptions<OpenKey, CloseKey>): RawModalInstance<P, OpenKey, CloseKey>;
@@ -1,4 +1,4 @@
1
- import * as react86 from "react";
1
+ import * as react67 from "react";
2
2
  import { Context, ReactNode } from "react";
3
3
  import * as motion_react0 from "motion/react";
4
4
  import * as m from "motion/react-m";
@@ -6,7 +6,7 @@ import * as m from "motion/react-m";
6
6
  //#region src/MotionProvider/index.d.ts
7
7
  type MotionComponentType = typeof motion_react0.motion | typeof m;
8
8
  declare const MotionComponent: Context<MotionComponentType>;
9
- declare const MotionProvider: react86.NamedExoticComponent<{
9
+ declare const MotionProvider: react67.NamedExoticComponent<{
10
10
  children: ReactNode;
11
11
  motion: MotionComponentType;
12
12
  }>;
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime28 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/Popover/ArrowIcon.d.ts
4
- declare const PopoverArrowIcon: react_jsx_runtime28.JSX.Element;
4
+ declare const PopoverArrowIcon: react_jsx_runtime0.JSX.Element;
5
5
  //#endregion
6
6
  export { PopoverArrowIcon };
7
7
  //# sourceMappingURL=ArrowIcon.d.mts.map
@@ -1,13 +1,13 @@
1
1
  import { PopoverPlacement } from "./type.mjs";
2
- import * as react68 from "react";
2
+ import * as react4 from "react";
3
3
  import { ComponentProps, ComponentPropsWithRef } from "react";
4
- import * as react_jsx_runtime29 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import * as _base_ui_react_popover0 from "@base-ui/react/popover";
6
6
  import { Popover } from "@base-ui/react/popover";
7
7
 
8
8
  //#region src/Popover/atoms.d.ts
9
9
  declare const PopoverRoot: typeof Popover.Root;
10
- declare const PopoverBackdrop: react68.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react68.RefAttributes<HTMLDivElement>>;
10
+ declare const PopoverBackdrop: react4.ForwardRefExoticComponent<_base_ui_react_popover0.PopoverBackdropProps & react4.RefAttributes<HTMLDivElement>>;
11
11
  type PopoverTriggerElementProps = Omit<ComponentPropsWithRef<typeof Popover.Trigger>, 'children' | 'render'> & {
12
12
  children: ComponentProps<typeof Popover.Trigger>['children'];
13
13
  };
@@ -18,7 +18,7 @@ declare const PopoverTriggerElement: {
18
18
  nativeButton,
19
19
  ref: refProp,
20
20
  ...rest
21
- }: PopoverTriggerElementProps): react_jsx_runtime29.JSX.Element;
21
+ }: PopoverTriggerElementProps): react_jsx_runtime0.JSX.Element;
22
22
  displayName: string;
23
23
  };
24
24
  type PopoverPortalAtomProps = Omit<ComponentProps<typeof Popover.Portal>, 'container'> & {
@@ -37,7 +37,7 @@ declare const PopoverPortal: {
37
37
  root,
38
38
  children,
39
39
  ...rest
40
- }: PopoverPortalAtomProps): react_jsx_runtime29.JSX.Element | null;
40
+ }: PopoverPortalAtomProps): react_jsx_runtime0.JSX.Element | null;
41
41
  displayName: string;
42
42
  };
43
43
  type PopoverPositionerAtomProps = ComponentProps<typeof Popover.Positioner> & {
@@ -54,7 +54,7 @@ declare const PopoverPositioner: {
54
54
  side,
55
55
  sideOffset,
56
56
  ...rest
57
- }: PopoverPositionerAtomProps): react_jsx_runtime29.JSX.Element;
57
+ }: PopoverPositionerAtomProps): react_jsx_runtime0.JSX.Element;
58
58
  displayName: string;
59
59
  };
60
60
  type PopoverPopupAtomProps = ComponentProps<typeof Popover.Popup>;
@@ -62,7 +62,7 @@ declare const PopoverPopup: {
62
62
  ({
63
63
  className,
64
64
  ...rest
65
- }: PopoverPopupAtomProps): react_jsx_runtime29.JSX.Element;
65
+ }: PopoverPopupAtomProps): react_jsx_runtime0.JSX.Element;
66
66
  displayName: string;
67
67
  };
68
68
  type PopoverArrowAtomProps = ComponentProps<typeof Popover.Arrow>;
@@ -71,7 +71,7 @@ declare const PopoverArrow: {
71
71
  className,
72
72
  children,
73
73
  ...rest
74
- }: PopoverArrowAtomProps): react_jsx_runtime29.JSX.Element;
74
+ }: PopoverArrowAtomProps): react_jsx_runtime0.JSX.Element;
75
75
  displayName: string;
76
76
  };
77
77
  type PopoverViewportAtomProps = ComponentProps<typeof Popover.Viewport>;
@@ -79,7 +79,7 @@ declare const PopoverViewport: {
79
79
  ({
80
80
  className,
81
81
  ...rest
82
- }: PopoverViewportAtomProps): react_jsx_runtime29.JSX.Element;
82
+ }: PopoverViewportAtomProps): react_jsx_runtime0.JSX.Element;
83
83
  displayName: string;
84
84
  };
85
85
  //#endregion
@@ -1,11 +1,11 @@
1
- import * as react66 from "react";
1
+ import * as react6 from "react";
2
2
  import { ReactNode } from "react";
3
3
 
4
4
  //#region src/Popover/context.d.ts
5
5
  type PopoverContextValue = {
6
6
  close: () => void;
7
7
  };
8
- declare const PopoverProvider: react66.NamedExoticComponent<{
8
+ declare const PopoverProvider: react6.NamedExoticComponent<{
9
9
  children: ReactNode;
10
10
  value: PopoverContextValue;
11
11
  }>;
@@ -1,8 +1,8 @@
1
1
  import { SearchBarProps } from "./type.mjs";
2
- import * as react9 from "react";
2
+ import * as react3 from "react";
3
3
 
4
4
  //#region src/SearchBar/SearchBar.d.ts
5
- declare const SearchBar: react9.NamedExoticComponent<SearchBarProps>;
5
+ declare const SearchBar: react3.NamedExoticComponent<SearchBarProps>;
6
6
  //#endregion
7
7
  export { SearchBar };
8
8
  //# sourceMappingURL=SearchBar.d.mts.map
@@ -8,13 +8,13 @@ import { styles } from "./style.mjs";
8
8
  import { memo, useMemo, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { cx } from "antd-style";
11
- import useMergeState from "use-merge-value";
11
+ import useControlledState from "use-merge-value";
12
12
  import { LucideLoader2, Search } from "lucide-react";
13
13
  import { useHotkeys } from "react-hotkeys-hook";
14
14
 
15
15
  //#region src/SearchBar/SearchBar.tsx
16
16
  const SearchBar = memo(({ defaultValue = "", spotlight, className, value, onInputChange, placeholder, enableShortKey, shortKey = "mod+k", onSearch, loading, style, onChange, onBlur, onPressEnter, onFocus, styles: { input: inputStyle, shortKey: shortKeyStyle } = {}, classNames: { input: inputClassName, shortKey: shortKeyClassName } = {}, ...rest }) => {
17
- const [inputValue, setInputValue] = useMergeState(defaultValue, {
17
+ const [inputValue, setInputValue] = useControlledState(defaultValue, {
18
18
  defaultValue,
19
19
  onChange: onInputChange,
20
20
  value
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.mjs","names":["useControlledState","inputReference: any","Spotlight","Input","Icon","Hotkey"],"sources":["../../src/SearchBar/SearchBar.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { LucideLoader2, Search } from 'lucide-react';\nimport { memo, useMemo, useRef, useState } from 'react';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport useControlledState from 'use-merge-value';\n\nimport Hotkey from '@/Hotkey';\nimport Icon from '@/Icon';\nimport Input from '@/Input';\nimport Spotlight from '@/awesome/Spotlight';\n\nimport { styles } from './style';\nimport type { SearchBarProps } from './type';\n\nconst SearchBar = memo<SearchBarProps>(\n ({\n defaultValue = '',\n spotlight,\n className,\n value,\n onInputChange,\n placeholder,\n enableShortKey,\n shortKey = 'mod+k',\n onSearch,\n loading,\n style,\n onChange,\n onBlur,\n onPressEnter,\n onFocus,\n styles: { input: inputStyle, shortKey: shortKeyStyle } = {},\n classNames: { input: inputClassName, shortKey: shortKeyClassName } = {},\n ...rest\n }) => {\n const [inputValue, setInputValue] = useControlledState(defaultValue, {\n defaultValue,\n onChange: onInputChange,\n value,\n });\n\n const [showTag, setShowTag] = useState<boolean>(true);\n const inputReference: any = useRef<HTMLInputElement>(null);\n const hotkey = useMemo(\n () => (shortKey.includes('+') ? shortKey : `mod+${shortKey}`),\n [shortKey],\n );\n\n useHotkeys(\n hotkey,\n () => {\n if (!enableShortKey) return;\n inputReference.current?.focus();\n },\n {\n enableOnFormTags: true,\n enabled: !!enableShortKey && !!shortKey,\n preventDefault: true,\n },\n );\n\n return (\n <div className={cx(styles.search, className)} style={style}>\n {spotlight && <Spotlight />}\n <Input\n allowClear\n className={inputClassName}\n onBlur={(e) => {\n onBlur?.(e);\n setInputValue(e.target.value);\n setShowTag(true);\n }}\n onChange={(e) => {\n setInputValue(e.target.value);\n onChange?.(e);\n }}\n onFocus={(e) => {\n onFocus?.(e);\n setShowTag(false);\n }}\n onPressEnter={(e) => {\n onPressEnter?.(e);\n onSearch?.(inputValue);\n }}\n placeholder={placeholder ?? 'Type keywords...'}\n prefix={\n <Icon\n className={styles.icon}\n icon={loading ? LucideLoader2 : Search}\n size=\"small\"\n spin={loading}\n style={{ marginRight: 4 }}\n />\n }\n ref={inputReference}\n style={inputStyle}\n value={inputValue}\n {...rest}\n />\n {enableShortKey && showTag && !inputValue && (\n <Hotkey\n className={cx(styles.tag, shortKeyClassName)}\n compact\n keys={hotkey}\n style={shortKeyStyle}\n />\n )}\n </div>\n );\n },\n);\n\nSearchBar.displayName = 'SearchBar';\n\nexport default SearchBar;\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,YAAY,MACf,EACC,eAAe,IACf,WACA,WACA,OACA,eACA,aACA,gBACA,WAAW,SACX,UACA,SACA,OACA,UACA,QACA,cACA,SACA,QAAQ,EAAE,OAAO,YAAY,UAAU,kBAAkB,EAAE,EAC3D,YAAY,EAAE,OAAO,gBAAgB,UAAU,sBAAsB,EAAE,EACvE,GAAG,WACC;CACJ,MAAM,CAAC,YAAY,iBAAiBA,cAAmB,cAAc;EACnE;EACA,UAAU;EACV;EACD,CAAC;CAEF,MAAM,CAAC,SAAS,cAAc,SAAkB,KAAK;CACrD,MAAMC,iBAAsB,OAAyB,KAAK;CAC1D,MAAM,SAAS,cACN,SAAS,SAAS,IAAI,GAAG,WAAW,OAAO,YAClD,CAAC,SAAS,CACX;AAED,YACE,cACM;AACJ,MAAI,CAAC,eAAgB;AACrB,iBAAe,SAAS,OAAO;IAEjC;EACE,kBAAkB;EAClB,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;EAC/B,gBAAgB;EACjB,CACF;AAED,QACE,qBAAC;EAAI,WAAW,GAAG,OAAO,QAAQ,UAAU;EAAS;;GAClD,aAAa,oBAACC,sBAAY;GAC3B,oBAACC;IACC;IACA,WAAW;IACX,SAAS,MAAM;AACb,cAAS,EAAE;AACX,mBAAc,EAAE,OAAO,MAAM;AAC7B,gBAAW,KAAK;;IAElB,WAAW,MAAM;AACf,mBAAc,EAAE,OAAO,MAAM;AAC7B,gBAAW,EAAE;;IAEf,UAAU,MAAM;AACd,eAAU,EAAE;AACZ,gBAAW,MAAM;;IAEnB,eAAe,MAAM;AACnB,oBAAe,EAAE;AACjB,gBAAW,WAAW;;IAExB,aAAa,eAAe;IAC5B,QACE,oBAACC;KACC,WAAW,OAAO;KAClB,MAAM,UAAU,gBAAgB;KAChC,MAAK;KACL,MAAM;KACN,OAAO,EAAE,aAAa,GAAG;MACzB;IAEJ,KAAK;IACL,OAAO;IACP,OAAO;IACP,GAAI;KACJ;GACD,kBAAkB,WAAW,CAAC,cAC7B,oBAACC;IACC,WAAW,GAAG,OAAO,KAAK,kBAAkB;IAC5C;IACA,MAAM;IACN,OAAO;KACP;;GAEA;EAGX;AAED,UAAU,cAAc;AAExB,wBAAe"}
1
+ {"version":3,"file":"SearchBar.mjs","names":["inputReference: any","Spotlight","Input","Icon","Hotkey"],"sources":["../../src/SearchBar/SearchBar.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { LucideLoader2, Search } from 'lucide-react';\nimport { memo, useMemo, useRef, useState } from 'react';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport useControlledState from 'use-merge-value';\n\nimport Hotkey from '@/Hotkey';\nimport Icon from '@/Icon';\nimport Input from '@/Input';\nimport Spotlight from '@/awesome/Spotlight';\n\nimport { styles } from './style';\nimport type { SearchBarProps } from './type';\n\nconst SearchBar = memo<SearchBarProps>(\n ({\n defaultValue = '',\n spotlight,\n className,\n value,\n onInputChange,\n placeholder,\n enableShortKey,\n shortKey = 'mod+k',\n onSearch,\n loading,\n style,\n onChange,\n onBlur,\n onPressEnter,\n onFocus,\n styles: { input: inputStyle, shortKey: shortKeyStyle } = {},\n classNames: { input: inputClassName, shortKey: shortKeyClassName } = {},\n ...rest\n }) => {\n const [inputValue, setInputValue] = useControlledState(defaultValue, {\n defaultValue,\n onChange: onInputChange,\n value,\n });\n\n const [showTag, setShowTag] = useState<boolean>(true);\n const inputReference: any = useRef<HTMLInputElement>(null);\n const hotkey = useMemo(\n () => (shortKey.includes('+') ? shortKey : `mod+${shortKey}`),\n [shortKey],\n );\n\n useHotkeys(\n hotkey,\n () => {\n if (!enableShortKey) return;\n inputReference.current?.focus();\n },\n {\n enableOnFormTags: true,\n enabled: !!enableShortKey && !!shortKey,\n preventDefault: true,\n },\n );\n\n return (\n <div className={cx(styles.search, className)} style={style}>\n {spotlight && <Spotlight />}\n <Input\n allowClear\n className={inputClassName}\n onBlur={(e) => {\n onBlur?.(e);\n setInputValue(e.target.value);\n setShowTag(true);\n }}\n onChange={(e) => {\n setInputValue(e.target.value);\n onChange?.(e);\n }}\n onFocus={(e) => {\n onFocus?.(e);\n setShowTag(false);\n }}\n onPressEnter={(e) => {\n onPressEnter?.(e);\n onSearch?.(inputValue);\n }}\n placeholder={placeholder ?? 'Type keywords...'}\n prefix={\n <Icon\n className={styles.icon}\n icon={loading ? LucideLoader2 : Search}\n size=\"small\"\n spin={loading}\n style={{ marginRight: 4 }}\n />\n }\n ref={inputReference}\n style={inputStyle}\n value={inputValue}\n {...rest}\n />\n {enableShortKey && showTag && !inputValue && (\n <Hotkey\n className={cx(styles.tag, shortKeyClassName)}\n compact\n keys={hotkey}\n style={shortKeyStyle}\n />\n )}\n </div>\n );\n },\n);\n\nSearchBar.displayName = 'SearchBar';\n\nexport default SearchBar;\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,YAAY,MACf,EACC,eAAe,IACf,WACA,WACA,OACA,eACA,aACA,gBACA,WAAW,SACX,UACA,SACA,OACA,UACA,QACA,cACA,SACA,QAAQ,EAAE,OAAO,YAAY,UAAU,kBAAkB,EAAE,EAC3D,YAAY,EAAE,OAAO,gBAAgB,UAAU,sBAAsB,EAAE,EACvE,GAAG,WACC;CACJ,MAAM,CAAC,YAAY,iBAAiB,mBAAmB,cAAc;EACnE;EACA,UAAU;EACV;EACD,CAAC;CAEF,MAAM,CAAC,SAAS,cAAc,SAAkB,KAAK;CACrD,MAAMA,iBAAsB,OAAyB,KAAK;CAC1D,MAAM,SAAS,cACN,SAAS,SAAS,IAAI,GAAG,WAAW,OAAO,YAClD,CAAC,SAAS,CACX;AAED,YACE,cACM;AACJ,MAAI,CAAC,eAAgB;AACrB,iBAAe,SAAS,OAAO;IAEjC;EACE,kBAAkB;EAClB,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;EAC/B,gBAAgB;EACjB,CACF;AAED,QACE,qBAAC;EAAI,WAAW,GAAG,OAAO,QAAQ,UAAU;EAAS;;GAClD,aAAa,oBAACC,sBAAY;GAC3B,oBAACC;IACC;IACA,WAAW;IACX,SAAS,MAAM;AACb,cAAS,EAAE;AACX,mBAAc,EAAE,OAAO,MAAM;AAC7B,gBAAW,KAAK;;IAElB,WAAW,MAAM;AACf,mBAAc,EAAE,OAAO,MAAM;AAC7B,gBAAW,EAAE;;IAEf,UAAU,MAAM;AACd,eAAU,EAAE;AACZ,gBAAW,MAAM;;IAEnB,eAAe,MAAM;AACnB,oBAAe,EAAE;AACjB,gBAAW,WAAW;;IAExB,aAAa,eAAe;IAC5B,QACE,oBAACC;KACC,WAAW,OAAO;KAClB,MAAM,UAAU,gBAAgB;KAChC,MAAK;KACL,MAAM;KACN,OAAO,EAAE,aAAa,GAAG;MACzB;IAEJ,KAAK;IACL,OAAO;IACP,OAAO;IACP,GAAI;KACJ;GACD,kBAAkB,WAAW,CAAC,cAC7B,oBAACC;IACC,WAAW,GAAG,OAAO,KAAK,kBAAkB;IAC5C;IACA,MAAM;IACN,OAAO;KACP;;GAEA;EAGX;AAED,UAAU,cAAc;AAExB,wBAAe"}
@@ -1,8 +1,8 @@
1
1
  import { SegmentedProps } from "./type.mjs";
2
- import * as react19 from "react";
2
+ import * as react11 from "react";
3
3
 
4
4
  //#region src/Segmented/Segmented.d.ts
5
- declare const Segmented: react19.NamedExoticComponent<SegmentedProps>;
5
+ declare const Segmented: react11.NamedExoticComponent<SegmentedProps>;
6
6
  //#endregion
7
7
  export { Segmented };
8
8
  //# sourceMappingURL=Segmented.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { SelectProps } from "./type.mjs";
2
- import * as react17 from "react";
2
+ import * as react0 from "react";
3
3
 
4
4
  //#region src/Select/Select.d.ts
5
- declare const Input: react17.NamedExoticComponent<SelectProps>;
5
+ declare const Input: react0.NamedExoticComponent<SelectProps>;
6
6
  //#endregion
7
7
  export { Input };
8
8
  //# sourceMappingURL=Select.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { SideNavProps } from "./type.mjs";
2
- import * as react18 from "react";
2
+ import * as react75 from "react";
3
3
 
4
4
  //#region src/SideNav/SideNav.d.ts
5
- declare const SideNav: react18.NamedExoticComponent<SideNavProps>;
5
+ declare const SideNav: react75.NamedExoticComponent<SideNavProps>;
6
6
  //#endregion
7
7
  export { SideNav };
8
8
  //# sourceMappingURL=SideNav.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { SliderWithInputProps } from "./type.mjs";
2
- import * as react14 from "react";
2
+ import * as react87 from "react";
3
3
 
4
4
  //#region src/SliderWithInput/SliderWithInput.d.ts
5
- declare const SliderWithInput: react14.NamedExoticComponent<SliderWithInputProps>;
5
+ declare const SliderWithInput: react87.NamedExoticComponent<SliderWithInputProps>;
6
6
  //#endregion
7
7
  export { SliderWithInput };
8
8
  //# sourceMappingURL=SliderWithInput.d.mts.map