@lobehub/ui 4.1.0 → 4.1.2

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 (171) hide show
  1. package/README.md +1 -1
  2. package/es/Accordion/Accordion.d.mts +2 -2
  3. package/es/Accordion/AccordionItem.d.mts +2 -2
  4. package/es/Accordion/AccordionItem.mjs +4 -4
  5. package/es/Accordion/AccordionItem.mjs.map +1 -1
  6. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  7. package/es/ActionIcon/components/utils.mjs +1 -1
  8. package/es/ActionIcon/components/utils.mjs.map +1 -1
  9. package/es/Alert/Alert.d.mts +2 -2
  10. package/es/Alert/Alert.mjs +1 -1
  11. package/es/Alert/Alert.mjs.map +1 -1
  12. package/es/AutoComplete/Select.d.mts +2 -2
  13. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  14. package/es/Burger/Burger.d.mts +2 -2
  15. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  16. package/es/Collapse/Collapse.d.mts +2 -2
  17. package/es/ConfigProvider/index.d.mts +2 -2
  18. package/es/CopyButton/CopyButton.d.mts +2 -2
  19. package/es/DatePicker/DatePicker.d.mts +2 -2
  20. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  21. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  22. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  23. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  24. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  25. package/es/Drawer/Drawer.d.mts +2 -2
  26. package/es/Dropdown/Dropdown.d.mts +2 -2
  27. package/es/EditableText/EditableText.d.mts +2 -2
  28. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  29. package/es/Flex/FlexBasic.d.mts +2 -2
  30. package/es/FontLoader/index.d.mts +2 -2
  31. package/es/Footer/Footer.d.mts +2 -2
  32. package/es/Form/Form.mjs +1 -1
  33. package/es/Form/Form.mjs.map +1 -1
  34. package/es/Form/components/FormGroup.d.mts +2 -2
  35. package/es/Form/components/FormGroup.mjs +1 -1
  36. package/es/Form/components/FormGroup.mjs.map +1 -1
  37. package/es/Form/components/FormItem.d.mts +2 -2
  38. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  39. package/es/Form/components/FormSubmitFooter.mjs +3 -3
  40. package/es/Form/components/FormSubmitFooter.mjs.map +1 -1
  41. package/es/Form/components/merge.mjs +1 -1
  42. package/es/Form/components/merge.mjs.map +1 -1
  43. package/es/Form/style.mjs +6 -6
  44. package/es/Form/style.mjs.map +1 -1
  45. package/es/FormModal/FormModal.d.mts +2 -2
  46. package/es/Grid/style.mjs +1 -1
  47. package/es/Grid/style.mjs.map +1 -1
  48. package/es/GuideCard/GuideCard.d.mts +2 -2
  49. package/es/Header/Header.d.mts +2 -2
  50. package/es/Highlighter/Highlighter.d.mts +2 -2
  51. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  52. package/es/Hotkey/Hotkey.d.mts +2 -2
  53. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  54. package/es/HotkeyInput/HotkeyInput.mjs +1 -1
  55. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  56. package/es/Icon/Icon.d.mts +2 -2
  57. package/es/Icon/components/IconProvider.d.mts +3 -3
  58. package/es/Icon/components/utils.mjs +1 -1
  59. package/es/Icon/components/utils.mjs.map +1 -1
  60. package/es/Image/PreviewGroup.d.mts +2 -2
  61. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  62. package/es/Input/Input.d.mts +2 -2
  63. package/es/Input/InputOPT.d.mts +2 -2
  64. package/es/Input/InputPassword.d.mts +2 -2
  65. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  66. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  67. package/es/Layout/components/LayoutMain.d.mts +2 -2
  68. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  69. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  70. package/es/Layout/components/LayoutToc.d.mts +2 -2
  71. package/es/List/ListItem/index.d.mts +2 -2
  72. package/es/Markdown/Markdown.d.mts +2 -2
  73. package/es/Markdown/Typography.d.mts +2 -2
  74. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  75. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  76. package/es/Menu/Menu.d.mts +2 -2
  77. package/es/Mermaid/Mermaid.d.mts +2 -2
  78. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  79. package/es/Mermaid/SyntaxMermaid/index.mjs +1 -1
  80. package/es/Mermaid/SyntaxMermaid/index.mjs.map +1 -1
  81. package/es/Modal/Modal.d.mts +2 -2
  82. package/es/MotionProvider/index.d.mts +4 -3
  83. package/es/MotionProvider/index.mjs +2 -2
  84. package/es/MotionProvider/index.mjs.map +1 -1
  85. package/es/SearchBar/SearchBar.d.mts +2 -2
  86. package/es/Segmented/Segmented.d.mts +2 -2
  87. package/es/Select/Select.d.mts +2 -2
  88. package/es/SideNav/SideNav.d.mts +2 -2
  89. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  90. package/es/SliderWithInput/SliderWithInput.mjs +1 -1
  91. package/es/SliderWithInput/SliderWithInput.mjs.map +1 -1
  92. package/es/SortableList/components/DragHandle.d.mts +2 -2
  93. package/es/SortableList/components/SortableItem.d.mts +2 -2
  94. package/es/Tag/utils.mjs +1 -1
  95. package/es/Tag/utils.mjs.map +1 -1
  96. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  97. package/es/ThemeProvider/ThemeProvider.mjs +5 -12
  98. package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
  99. package/es/ThemeProvider/type.d.mts +0 -4
  100. package/es/Toc/Toc.d.mts +2 -2
  101. package/es/Tooltip/TooltipFloating.mjs +6 -5
  102. package/es/Tooltip/TooltipFloating.mjs.map +1 -1
  103. package/es/Video/index.d.mts +2 -2
  104. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  105. package/es/awesome/Features/Features.d.mts +2 -2
  106. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  107. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  108. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  109. package/es/awesome/GridBackground/GridBackground.mjs +1 -1
  110. package/es/awesome/GridBackground/GridBackground.mjs.map +1 -1
  111. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  112. package/es/awesome/GridBackground/components/Grid.mjs +1 -1
  113. package/es/awesome/GridBackground/components/Grid.mjs.map +1 -1
  114. package/es/awesome/Hero/Hero.d.mts +2 -2
  115. package/es/awesome/Spline/ParentSize.mjs +1 -1
  116. package/es/awesome/Spline/ParentSize.mjs.map +1 -1
  117. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  118. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  119. package/es/awesome/TypewriterEffect/TypewriterEffect.mjs +3 -3
  120. package/es/awesome/TypewriterEffect/TypewriterEffect.mjs.map +1 -1
  121. package/es/brand/BrandLoading/{style-Cof4dJBw.css → style-BpgFy1wc.css} +1 -1
  122. package/es/brand/BrandLoading/{style-Cof4dJBw.css.map → style-BpgFy1wc.css.map} +1 -1
  123. package/es/brand/LobeChat/index.d.mts +2 -2
  124. package/es/brand/LobeHub/index.d.mts +2 -2
  125. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  126. package/es/brand/LogoThree/index.d.mts +2 -2
  127. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  128. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  129. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  130. package/es/chat/ChatList/ChatList.d.mts +2 -2
  131. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  132. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  133. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  134. package/es/color/ColorScales/index.d.mts +2 -2
  135. package/es/i18n/context.d.mts +2 -2
  136. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  137. package/es/icons/lucideExtra/CreateBotIcon.d.mts +2 -2
  138. package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
  139. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
  140. package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
  141. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  142. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  143. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  144. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  145. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  146. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  147. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +2 -2
  148. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
  149. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  150. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  151. package/es/mdx/Mdx/index.d.mts +2 -2
  152. package/es/mdx/mdxComponents/Citation/index.mjs +1 -1
  153. package/es/mdx/mdxComponents/Citation/index.mjs.map +1 -1
  154. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  155. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  156. package/es/storybook/StoryBook/index.d.mts +2 -2
  157. package/es/styles/theme/customToken.mjs +1 -1
  158. package/es/styles/theme/customToken.mjs.map +1 -1
  159. package/es/styles/theme/generateColorPalette.mjs +1 -1
  160. package/es/styles/theme/generateColorPalette.mjs.map +1 -1
  161. package/package.json +2 -2
  162. package/es/motion/LazyMotion.d.mts +0 -20
  163. package/es/motion/LazyMotion.mjs +0 -20
  164. package/es/motion/LazyMotion.mjs.map +0 -1
  165. package/es/motion/index.d.mts +0 -4
  166. package/es/motion/index.d.ts +0 -1
  167. package/es/motion/index.js +0 -1
  168. package/es/motion/index.mjs +0 -5
  169. package/es/motion/loadFeatures.d.mts +0 -14
  170. package/es/motion/loadFeatures.mjs +0 -6
  171. package/es/motion/loadFeatures.mjs.map +0 -1
package/README.md CHANGED
@@ -119,7 +119,7 @@ import hotkeyMessages from '@lobehub/ui/i18n/resources/hotkey';
119
119
 
120
120
  ### ConfigProvider (Motion)
121
121
 
122
- You must pass a motion component via `ConfigProvider` (or `ThemeProvider`).
122
+ You must pass a motion component via `ConfigProvider`.
123
123
  If your app uses `LazyMotion`, pass `m`:
124
124
 
125
125
  ```tsx
@@ -1,8 +1,8 @@
1
1
  import { AccordionProps } from "./type.mjs";
2
- import * as react7 from "react";
2
+ import * as react63 from "react";
3
3
 
4
4
  //#region src/Accordion/Accordion.d.ts
5
- declare const Accordion: react7.NamedExoticComponent<AccordionProps & react7.RefAttributes<HTMLDivElement>>;
5
+ declare const Accordion: react63.NamedExoticComponent<AccordionProps & react63.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { Accordion };
8
8
  //# sourceMappingURL=Accordion.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { AccordionItemProps } from "./type.mjs";
2
- import * as react6 from "react";
2
+ import * as react65 from "react";
3
3
 
4
4
  //#region src/Accordion/AccordionItem.d.ts
5
- declare const AccordionItem: react6.NamedExoticComponent<AccordionItemProps>;
5
+ declare const AccordionItem: react65.NamedExoticComponent<AccordionItemProps>;
6
6
  //#endregion
7
7
  export { AccordionItem };
8
8
  //# sourceMappingURL=AccordionItem.d.mts.map
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { MotionComponent } from "../MotionProvider/index.mjs";
3
+ import { useMotionComponent } from "../MotionProvider/index.mjs";
4
4
  import { useAccordionContext } from "./context.mjs";
5
5
  import { useStyles } from "./style.mjs";
6
6
  import FlexBasic_default from "../Flex/FlexBasic.mjs";
7
7
  import Block_default from "../Block/Block.mjs";
8
8
  import Text_default from "../Text/Text.mjs";
9
9
  import ArrowIcon_default from "./ArrowIcon.mjs";
10
- import { memo, use, useCallback, useMemo } from "react";
10
+ import { memo, useCallback, useMemo } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
 
13
13
  //#region src/Accordion/AccordionItem.tsx
@@ -103,7 +103,7 @@ const AccordionItem = memo(({ itemKey, title, children, action, disabled = false
103
103
  },
104
104
  ...contextMotionProps
105
105
  }), [isOpen, contextMotionProps]);
106
- const m = use(MotionComponent);
106
+ const Motion = useMotionComponent();
107
107
  const contentElement = useMemo(() => {
108
108
  if (disableAnimation || !keepContentMounted) {
109
109
  if (keepContentMounted) return /* @__PURE__ */ jsx("div", {
@@ -128,7 +128,7 @@ const AccordionItem = memo(({ itemKey, title, children, action, disabled = false
128
128
  })
129
129
  });
130
130
  }
131
- return /* @__PURE__ */ jsx(m.div, {
131
+ return /* @__PURE__ */ jsx(Motion.div, {
132
132
  ...motionProps,
133
133
  style: { overflow: "hidden" },
134
134
  children: /* @__PURE__ */ jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.mjs","names":["ArrowIcon","Text","Flexbox","Block"],"sources":["../../src/Accordion/AccordionItem.tsx"],"sourcesContent":["'use client';\n\nimport { KeyboardEvent, memo, use, useCallback, useMemo } from 'react';\n\nimport Block from '@/Block';\nimport { Flexbox } from '@/Flex';\nimport { MotionComponent } from '@/MotionProvider';\nimport Text from '@/Text';\n\nimport ArrowIcon from './ArrowIcon';\nimport { useAccordionContext } from './context';\nimport { useStyles } from './style';\nimport type { AccordionItemProps } from './type';\n\nconst AccordionItem = memo<AccordionItemProps>(\n ({\n itemKey,\n title,\n children,\n action,\n disabled = false,\n hideIndicator: itemHideIndicator,\n indicatorPlacement: itemIndicatorPlacement,\n indicator: customIndicator,\n classNames,\n paddingInline = 16,\n paddingBlock = 8,\n padding,\n ref,\n variant: customVariant,\n styles: customStyles,\n headerWrapper,\n }) => {\n const { cx, styles } = useStyles();\n const context = useAccordionContext();\n\n const {\n isExpanded,\n onToggle,\n hideIndicator: contextHideIndicator,\n indicatorPlacement: contextIndicatorPlacement,\n keepContentMounted,\n disableAnimation,\n motionProps: contextMotionProps,\n variant = 'filled',\n } = context;\n\n const isOpen = isExpanded(itemKey);\n const hideIndicatorFinal = itemHideIndicator ?? contextHideIndicator ?? false;\n const indicatorPlacementFinal = itemIndicatorPlacement ?? contextIndicatorPlacement ?? 'start';\n\n const handleToggle = useCallback(() => {\n if (!disabled) {\n onToggle(itemKey);\n }\n }, [disabled, itemKey, onToggle]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case 'Enter':\n case ' ': {\n e.preventDefault();\n handleToggle();\n break;\n }\n }\n },\n [disabled, handleToggle],\n );\n\n // Build indicator\n const indicator = useMemo(() => {\n if (hideIndicatorFinal) return null;\n\n if (customIndicator) {\n if (typeof customIndicator === 'function') {\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n {customIndicator({ isDisabled: disabled, isOpen })}\n </span>\n );\n }\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n {customIndicator}\n </span>\n );\n }\n\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n <ArrowIcon className={cx(styles.icon, isOpen && styles.iconRotate)} />\n </span>\n );\n }, [\n hideIndicatorFinal,\n customIndicator,\n disabled,\n isOpen,\n cx,\n styles,\n classNames,\n customStyles,\n ]);\n\n // Animation variants\n const motionProps = useMemo(\n () => ({\n animate: isOpen ? 'enter' : 'exit',\n exit: 'exit',\n initial: false,\n variants: {\n enter: {\n height: 'auto',\n opacity: 1,\n transition: {\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n },\n },\n exit: {\n height: 0,\n opacity: 0,\n transition: {\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n },\n },\n },\n ...contextMotionProps,\n }),\n [isOpen, contextMotionProps],\n );\n\n const m = use(MotionComponent);\n\n // Render content\n const contentElement = useMemo(() => {\n if (disableAnimation || !keepContentMounted) {\n if (keepContentMounted) {\n return (\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={{\n display: isOpen ? 'block' : 'none',\n ...customStyles?.content,\n }}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n );\n }\n\n return (\n isOpen && (\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={customStyles?.content}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n )\n );\n }\n\n return (\n <m.div {...motionProps} style={{ overflow: 'hidden' }}>\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={customStyles?.content}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n </m.div>\n );\n }, [\n disableAnimation,\n keepContentMounted,\n isOpen,\n cx,\n styles,\n classNames,\n customStyles,\n children,\n motionProps,\n ]);\n\n const titleNode = useMemo(\n () =>\n typeof title === 'string' ? (\n <Text className={classNames?.title} ellipsis style={customStyles?.title}>\n {title}\n </Text>\n ) : (\n title\n ),\n [title, classNames?.title, customStyles?.title],\n );\n\n const actionNode = useMemo(\n () =>\n action && (\n <Flexbox\n align={'center'}\n className={cx('accordion-action', styles.action, classNames?.action)}\n flex={'none'}\n gap={4}\n horizontal\n onClick={(e) => e.stopPropagation()}\n style={customStyles?.action}\n >\n {action}\n </Flexbox>\n ),\n [action, cx, styles, classNames?.action, customStyles?.action],\n );\n\n const headerElement = useMemo(() => {\n const header = (\n <Block\n className={cx('accordion-header', styles.header, classNames?.header)}\n clickable={!disabled}\n gap={4}\n horizontal\n justify={'space-between'}\n onClick={handleToggle}\n onKeyDown={handleKeyDown}\n padding={padding}\n paddingBlock={paddingBlock}\n paddingInline={paddingInline}\n ref={ref}\n style={{\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : undefined,\n overflow: 'hidden',\n width: '100%',\n ...customStyles?.header,\n }}\n variant={customVariant || variant}\n >\n {indicatorPlacementFinal === 'start' ? (\n <>\n <Flexbox\n align={'center'}\n flex={1}\n gap={2}\n horizontal\n style={{\n overflow: 'hidden',\n }}\n >\n {titleNode}\n {indicator}\n </Flexbox>\n <Flexbox align={'center'} flex={'none'} gap={4} horizontal>\n {actionNode}\n </Flexbox>\n </>\n ) : (\n <>\n <Flexbox\n align={'center'}\n flex={1}\n gap={2}\n horizontal\n style={{\n overflow: 'hidden',\n }}\n >\n {titleNode}\n </Flexbox>\n <Flexbox align={'center'} flex={'none'} gap={4} horizontal>\n {actionNode}\n {indicator}\n </Flexbox>\n </>\n )}\n </Block>\n );\n if (headerWrapper) {\n return headerWrapper(header);\n }\n return header;\n }, [\n cx,\n styles,\n classNames,\n disabled,\n handleToggle,\n handleKeyDown,\n padding,\n paddingBlock,\n paddingInline,\n ref,\n customVariant,\n variant,\n indicatorPlacementFinal,\n titleNode,\n indicator,\n actionNode,\n headerWrapper,\n ]);\n\n return (\n <div\n className={cx('accordion-item', styles.item, classNames?.base)}\n style={customStyles?.base}\n >\n {headerElement}\n {contentElement}\n </div>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,gBAAgB,MACnB,EACC,SACA,OACA,UACA,QACA,WAAW,OACX,eAAe,mBACf,oBAAoB,wBACpB,WAAW,iBACX,YACA,gBAAgB,IAChB,eAAe,GACf,SACA,KACA,SAAS,eACT,QAAQ,cACR,oBACI;CACJ,MAAM,EAAE,IAAI,WAAW,WAAW;CAGlC,MAAM,EACJ,YACA,UACA,eAAe,sBACf,oBAAoB,2BACpB,oBACA,kBACA,aAAa,oBACb,UAAU,aAVI,qBAAqB;CAarC,MAAM,SAAS,WAAW,QAAQ;CAClC,MAAM,qBAAqB,qB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;GACpE,WAAW,CAAC;GACZ,KAAK;GACL;GACA,SAAS;GACT,SAAS;GACT,WAAW;GACF;GACK;GACC;GACV;GACL,OAAO;IACL,YAAY;IACZ,QAAQ,WAAW,gBAAgB;IACnC,SAAS,WAAW,KAAM;IAC1B,UAAU;IACV,OAAO;IACP,GAAG,cAAc;IAClB;GACD,SAAS,iBAAiB;aAEzB,4BAA4B,UAC3B,8CACE,qBAACD;IACC,OAAO;IACP,MAAM;IACN,KAAK;IACL;IACA,OAAO,EACL,UAAU,UACX;eAEA,WACA;KACO,EACV,oBAACA;IAAQ,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG;cAC7C;KACO,IACT,GAEH,8CACE,oBAACA;IACC,OAAO;IACP,MAAM;IACN,KAAK;IACL;IACA,OAAO,EACL,UAAU,UACX;cAEA;KACO,EACV,qBAACA;IAAQ,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG;eAC7C,YACA;KACO,IACT;IAEC;AAEV,MAAI,cACF,QAAO,cAAc,OAAO;AAE9B,SAAO;IACN;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC;EACC,WAAW,GAAG,kBAAkB,OAAO,MAAM,YAAY,KAAK;EAC9D,OAAO,cAAc;aAEpB,eACA;GACG;EAGX;AAED,cAAc,cAAc;AAE5B,4BAAe"}
1
+ {"version":3,"file":"AccordionItem.mjs","names":["ArrowIcon","Text","Flexbox","Block"],"sources":["../../src/Accordion/AccordionItem.tsx"],"sourcesContent":["'use client';\n\nimport { KeyboardEvent, memo, useCallback, useMemo } from 'react';\n\nimport Block from '@/Block';\nimport { Flexbox } from '@/Flex';\nimport { useMotionComponent } from '@/MotionProvider';\nimport Text from '@/Text';\n\nimport ArrowIcon from './ArrowIcon';\nimport { useAccordionContext } from './context';\nimport { useStyles } from './style';\nimport type { AccordionItemProps } from './type';\n\nconst AccordionItem = memo<AccordionItemProps>(\n ({\n itemKey,\n title,\n children,\n action,\n disabled = false,\n hideIndicator: itemHideIndicator,\n indicatorPlacement: itemIndicatorPlacement,\n indicator: customIndicator,\n classNames,\n paddingInline = 16,\n paddingBlock = 8,\n padding,\n ref,\n variant: customVariant,\n styles: customStyles,\n headerWrapper,\n }) => {\n const { cx, styles } = useStyles();\n const context = useAccordionContext();\n\n const {\n isExpanded,\n onToggle,\n hideIndicator: contextHideIndicator,\n indicatorPlacement: contextIndicatorPlacement,\n keepContentMounted,\n disableAnimation,\n motionProps: contextMotionProps,\n variant = 'filled',\n } = context;\n\n const isOpen = isExpanded(itemKey);\n const hideIndicatorFinal = itemHideIndicator ?? contextHideIndicator ?? false;\n const indicatorPlacementFinal = itemIndicatorPlacement ?? contextIndicatorPlacement ?? 'start';\n\n const handleToggle = useCallback(() => {\n if (!disabled) {\n onToggle(itemKey);\n }\n }, [disabled, itemKey, onToggle]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case 'Enter':\n case ' ': {\n e.preventDefault();\n handleToggle();\n break;\n }\n }\n },\n [disabled, handleToggle],\n );\n\n // Build indicator\n const indicator = useMemo(() => {\n if (hideIndicatorFinal) return null;\n\n if (customIndicator) {\n if (typeof customIndicator === 'function') {\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n {customIndicator({ isDisabled: disabled, isOpen })}\n </span>\n );\n }\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n {customIndicator}\n </span>\n );\n }\n\n return (\n <span\n aria-hidden=\"true\"\n className={cx(styles.indicator, classNames?.indicator)}\n style={customStyles?.indicator}\n >\n <ArrowIcon className={cx(styles.icon, isOpen && styles.iconRotate)} />\n </span>\n );\n }, [\n hideIndicatorFinal,\n customIndicator,\n disabled,\n isOpen,\n cx,\n styles,\n classNames,\n customStyles,\n ]);\n\n // Animation variants\n const motionProps = useMemo(\n () => ({\n animate: isOpen ? 'enter' : 'exit',\n exit: 'exit',\n initial: false,\n variants: {\n enter: {\n height: 'auto',\n opacity: 1,\n transition: {\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n },\n },\n exit: {\n height: 0,\n opacity: 0,\n transition: {\n duration: 0.2,\n ease: [0.4, 0, 0.2, 1],\n },\n },\n },\n ...contextMotionProps,\n }),\n [isOpen, contextMotionProps],\n );\n\n const Motion = useMotionComponent();\n\n // Render content\n const contentElement = useMemo(() => {\n if (disableAnimation || !keepContentMounted) {\n if (keepContentMounted) {\n return (\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={{\n display: isOpen ? 'block' : 'none',\n ...customStyles?.content,\n }}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n );\n }\n\n return (\n isOpen && (\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={customStyles?.content}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n )\n );\n }\n\n return (\n <Motion.div {...motionProps} style={{ overflow: 'hidden' }}>\n <div\n className={cx('accordion-content', styles.content, classNames?.content)}\n role=\"region\"\n style={customStyles?.content}\n >\n <div className={styles.contentInner}>{children}</div>\n </div>\n </Motion.div>\n );\n }, [\n disableAnimation,\n keepContentMounted,\n isOpen,\n cx,\n styles,\n classNames,\n customStyles,\n children,\n motionProps,\n ]);\n\n const titleNode = useMemo(\n () =>\n typeof title === 'string' ? (\n <Text className={classNames?.title} ellipsis style={customStyles?.title}>\n {title}\n </Text>\n ) : (\n title\n ),\n [title, classNames?.title, customStyles?.title],\n );\n\n const actionNode = useMemo(\n () =>\n action && (\n <Flexbox\n align={'center'}\n className={cx('accordion-action', styles.action, classNames?.action)}\n flex={'none'}\n gap={4}\n horizontal\n onClick={(e) => e.stopPropagation()}\n style={customStyles?.action}\n >\n {action}\n </Flexbox>\n ),\n [action, cx, styles, classNames?.action, customStyles?.action],\n );\n\n const headerElement = useMemo(() => {\n const header = (\n <Block\n className={cx('accordion-header', styles.header, classNames?.header)}\n clickable={!disabled}\n gap={4}\n horizontal\n justify={'space-between'}\n onClick={handleToggle}\n onKeyDown={handleKeyDown}\n padding={padding}\n paddingBlock={paddingBlock}\n paddingInline={paddingInline}\n ref={ref}\n style={{\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : undefined,\n overflow: 'hidden',\n width: '100%',\n ...customStyles?.header,\n }}\n variant={customVariant || variant}\n >\n {indicatorPlacementFinal === 'start' ? (\n <>\n <Flexbox\n align={'center'}\n flex={1}\n gap={2}\n horizontal\n style={{\n overflow: 'hidden',\n }}\n >\n {titleNode}\n {indicator}\n </Flexbox>\n <Flexbox align={'center'} flex={'none'} gap={4} horizontal>\n {actionNode}\n </Flexbox>\n </>\n ) : (\n <>\n <Flexbox\n align={'center'}\n flex={1}\n gap={2}\n horizontal\n style={{\n overflow: 'hidden',\n }}\n >\n {titleNode}\n </Flexbox>\n <Flexbox align={'center'} flex={'none'} gap={4} horizontal>\n {actionNode}\n {indicator}\n </Flexbox>\n </>\n )}\n </Block>\n );\n if (headerWrapper) {\n return headerWrapper(header);\n }\n return header;\n }, [\n cx,\n styles,\n classNames,\n disabled,\n handleToggle,\n handleKeyDown,\n padding,\n paddingBlock,\n paddingInline,\n ref,\n customVariant,\n variant,\n indicatorPlacementFinal,\n titleNode,\n indicator,\n actionNode,\n headerWrapper,\n ]);\n\n return (\n <div\n className={cx('accordion-item', styles.item, classNames?.base)}\n style={customStyles?.base}\n >\n {headerElement}\n {contentElement}\n </div>\n );\n },\n);\n\nAccordionItem.displayName = 'AccordionItem';\n\nexport default AccordionItem;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,gBAAgB,MACnB,EACC,SACA,OACA,UACA,QACA,WAAW,OACX,eAAe,mBACf,oBAAoB,wBACpB,WAAW,iBACX,YACA,gBAAgB,IAChB,eAAe,GACf,SACA,KACA,SA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AM,EAAE,iBAAiB;EACnC,OAAO,cAAc;YAEpB;GACO,EAEd;EAAC;EAAQ;EAAI;EAAQ,YAAY;EAAQ,cAAc;EAAO,CAC/D;CAED,MAAM,gBAAgB,cAAc;EAClC,MAAM,SACJ,oBAACC;GACC,WAAW,GAAG,oBAAoB,OAAO,QAAQ,YAAY,OAAO;GACpE,WAAW,CAAC;GACZ,KAAK;GACL;GACA,SAAS;GACT,SAAS;GACT,WAAW;GACF;GACK;GACC;GACV;GACL,OAAO;IACL,YAAY;IACZ,QAAQ,WAAW,gBAAgB;IACnC,SAAS,WAAW,KAAM;IAC1B,UAAU;IACV,OAAO;IACP,GAAG,cAAc;IAClB;GACD,SAAS,iBAAiB;aAEzB,4BAA4B,UAC3B,8CACE,qBAACD;IACC,OAAO;IACP,MAAM;IACN,KAAK;IACL;IACA,OAAO,EACL,UAAU,UACX;eAEA,WACA;KACO,EACV,oBAACA;IAAQ,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG;cAC7C;KACO,IACT,GAEH,8CACE,oBAACA;IACC,OAAO;IACP,MAAM;IACN,KAAK;IACL;IACA,OAAO,EACL,UAAU,UACX;cAEA;KACO,EACV,qBAACA;IAAQ,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG;eAC7C,YACA;KACO,IACT;IAEC;AAEV,MAAI,cACF,QAAO,cAAc,OAAO;AAE9B,SAAO;IACN;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC;EACC,WAAW,GAAG,kBAAkB,OAAO,MAAM,YAAY,KAAK;EAC9D,OAAO,cAAc;aAEpB,eACA;GACG;EAGX;AAED,cAAc,cAAc;AAE5B,4BAAe"}
@@ -1,8 +1,8 @@
1
1
  import { ActionIconProps } from "./type.mjs";
2
- import * as react5 from "react";
2
+ import * as react55 from "react";
3
3
 
4
4
  //#region src/ActionIcon/ActionIcon.d.ts
5
- declare const ActionIcon: react5.NamedExoticComponent<ActionIconProps>;
5
+ declare const ActionIcon: react55.NamedExoticComponent<ActionIconProps>;
6
6
  //#endregion
7
7
  export { ActionIcon };
8
8
  //# sourceMappingURL=ActionIcon.d.mts.map
@@ -1,4 +1,4 @@
1
- import { isNumber } from "lodash-es";
1
+ import { isNumber } from "es-toolkit/compat";
2
2
 
3
3
  //#region src/ActionIcon/components/utils.ts
4
4
  const calcSize = (iconSize) => {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":["blockSize: number | string","borderRadius: number | string","blockSize"],"sources":["../../../src/ActionIcon/components/utils.ts"],"sourcesContent":["import { isNumber } from 'lodash-es';\n\nimport type { ActionIconSize } from '@/ActionIcon';\n\nexport const calcSize = (iconSize?: ActionIconSize) => {\n let blockSize: number | string;\n let borderRadius: number | string;\n\n if (isNumber(iconSize)) {\n const blockSize = iconSize * 1.8;\n return {\n blockSize,\n borderRadius: Math.floor(blockSize / 6),\n };\n }\n\n switch (iconSize) {\n case 'large': {\n blockSize = 44;\n borderRadius = 8;\n break;\n }\n case 'middle': {\n blockSize = 36;\n borderRadius = 6;\n break;\n }\n case 'small': {\n blockSize = 24;\n borderRadius = 4;\n break;\n }\n default: {\n if (iconSize) {\n blockSize = iconSize?.blockSize || 36;\n borderRadius = iconSize?.borderRadius || 6;\n } else {\n blockSize = '1.8em';\n borderRadius = '0.3em';\n }\n\n break;\n }\n }\n\n return {\n blockSize,\n borderRadius,\n };\n};\n"],"mappings":";;;AAIA,MAAa,YAAY,aAA8B;CACrD,IAAIA;CACJ,IAAIC;AAEJ,KAAI,SAAS,SAAS,EAAE;EACtB,MAAMC,cAAY,WAAW;AAC7B,SAAO;GACL;GACA,cAAc,KAAK,MAAMA,cAAY,EAAE;GACxC;;AAGH,SAAQ,UAAR;EACE,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF;AACE,OAAI,UAAU;AACZ,gBAAY,UAAU,aAAa;AACnC,mBAAe,UAAU,gBAAgB;UACpC;AACL,gBAAY;AACZ,mBAAe;;AAGjB;;AAIJ,QAAO;EACL;EACA;EACD"}
1
+ {"version":3,"file":"utils.mjs","names":["blockSize: number | string","borderRadius: number | string","blockSize"],"sources":["../../../src/ActionIcon/components/utils.ts"],"sourcesContent":["import { isNumber } from 'es-toolkit/compat';\n\nimport type { ActionIconSize } from '@/ActionIcon';\n\nexport const calcSize = (iconSize?: ActionIconSize) => {\n let blockSize: number | string;\n let borderRadius: number | string;\n\n if (isNumber(iconSize)) {\n const blockSize = iconSize * 1.8;\n return {\n blockSize,\n borderRadius: Math.floor(blockSize / 6),\n };\n }\n\n switch (iconSize) {\n case 'large': {\n blockSize = 44;\n borderRadius = 8;\n break;\n }\n case 'middle': {\n blockSize = 36;\n borderRadius = 6;\n break;\n }\n case 'small': {\n blockSize = 24;\n borderRadius = 4;\n break;\n }\n default: {\n if (iconSize) {\n blockSize = iconSize?.blockSize || 36;\n borderRadius = iconSize?.borderRadius || 6;\n } else {\n blockSize = '1.8em';\n borderRadius = '0.3em';\n }\n\n break;\n }\n }\n\n return {\n blockSize,\n borderRadius,\n };\n};\n"],"mappings":";;;AAIA,MAAa,YAAY,aAA8B;CACrD,IAAIA;CACJ,IAAIC;AAEJ,KAAI,SAAS,SAAS,EAAE;EACtB,MAAMC,cAAY,WAAW;AAC7B,SAAO;GACL;GACA,cAAc,KAAK,MAAMA,cAAY,EAAE;GACxC;;AAGH,SAAQ,UAAR;EACE,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF,KAAK;AACH,eAAY;AACZ,kBAAe;AACf;EAEF;AACE,OAAI,UAAU;AACZ,gBAAY,UAAU,aAAa;AACnC,mBAAe,UAAU,gBAAgB;UACpC;AACL,gBAAY;AACZ,mBAAe;;AAGjB;;AAIJ,QAAO;EACL;EACA;EACD"}
@@ -1,8 +1,8 @@
1
1
  import { AlertProps } from "./type.mjs";
2
- import * as react4 from "react";
2
+ import * as react53 from "react";
3
3
 
4
4
  //#region src/Alert/Alert.d.ts
5
- declare const Alert: react4.NamedExoticComponent<AlertProps>;
5
+ declare const Alert: react53.NamedExoticComponent<AlertProps>;
6
6
  //#endregion
7
7
  export { Alert };
8
8
  //# sourceMappingURL=Alert.d.mts.map
@@ -11,7 +11,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { Alert } from "antd";
12
12
  import { cva } from "class-variance-authority";
13
13
  import { AlertTriangle, CheckCircle, Info, X, XCircle } from "lucide-react";
14
- import { camelCase } from "lodash-es";
14
+ import { camelCase } from "es-toolkit/compat";
15
15
 
16
16
  //#region src/Alert/Alert.tsx
17
17
  const typeIcons = {
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.mjs","names":["Alert","AntdAlert","ActionIcon","Icon","Flexbox","Accordion","AccordionItem"],"sources":["../../src/Alert/Alert.tsx"],"sourcesContent":["'use client';\n\nimport { Alert as AntdAlert } from 'antd';\nimport { cva } from 'class-variance-authority';\nimport { camelCase } from 'lodash-es';\nimport { AlertTriangle, CheckCircle, Info, X, XCircle } from 'lucide-react';\nimport { memo, useMemo } from 'react';\n\nimport { Accordion, AccordionItem } from '@/Accordion';\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { useStyles } from './style';\nimport type { AlertProps } from './type';\n\nconst typeIcons = {\n error: XCircle,\n info: Info,\n secondary: AlertTriangle,\n success: CheckCircle,\n warning: AlertTriangle,\n};\n\nconst colors = (theme: any, type: string = 'info', ...keys: string[]) => {\n if (type === 'secondary') return theme[camelCase(['color', ...keys].join('-'))] as string;\n return theme[camelCase(['color', type, ...keys].join('-'))] as string;\n};\n\nconst Alert = memo<AlertProps>(\n ({\n closable = false,\n description,\n showIcon = true,\n type = 'info',\n glass,\n icon,\n colorfulText = true,\n iconProps,\n style,\n extra,\n classNames,\n styles: customStyles,\n text,\n extraDefaultExpand = false,\n extraIsolate,\n banner,\n variant = 'filled',\n ref,\n ...rest\n }) => {\n const { theme, styles, cx } = useStyles({\n closable: !!closable,\n hasTitle: !!description,\n showIcon: !!showIcon,\n });\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n colorfulText: true,\n glass: false,\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n glass: {\n false: null,\n true: styles.glass,\n },\n colorfulText: {\n false: null,\n true: styles.colorfulText,\n },\n hasExtra: {\n false: null,\n true: styles.hasExtra,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const extraVariants = useMemo(\n () =>\n cva(styles.extra, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n banner: {\n false: null,\n true: styles.banner,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const extraHeaderVariants = useMemo(\n () =>\n cva(styles.extraHeader, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.borderlessExtraHeader,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const isInsideExtra = Boolean(!extraIsolate && !!extra);\n\n const alert = (\n <AntdAlert\n banner={banner}\n className={cx(\n variants({\n colorfulText,\n glass,\n hasExtra: isInsideExtra,\n variant,\n }),\n classNames?.alert,\n )}\n closable={\n typeof closable === 'boolean'\n ? closable\n : {\n closeIcon: <ActionIcon color={colors(theme, type)} icon={X} size={'small'} />,\n ...closable,\n }\n }\n description={description}\n icon={\n <Icon\n color={type === 'secondary' ? theme.colorTextSecondary : undefined}\n icon={typeIcons[type] || icon}\n size={description ? 24 : 18}\n {...iconProps}\n />\n }\n ref={ref}\n showIcon={showIcon}\n style={{\n background: colors(theme, type, 'fillTertiary'),\n borderColor: colors(theme, type, 'fillSecondary'),\n color: colorfulText ? colors(theme, type) : undefined,\n ...style,\n ...customStyles?.alert,\n }}\n type={type === 'secondary' ? 'info' : type}\n {...rest}\n />\n );\n\n if (!extra) return alert;\n\n if (extraIsolate)\n return (\n <Flexbox className={classNames?.container} gap={8}>\n {alert}\n {extra}\n </Flexbox>\n );\n\n return (\n <Flexbox className={classNames?.container} style={customStyles?.container}>\n {alert}\n <Flexbox\n className={extraVariants({ banner, variant })}\n style={{\n background: colors(theme, type, 'fillTertiary'),\n borderColor: colors(theme, type, 'fillSecondary'),\n color: colors(theme, type),\n fontSize: description ? 14 : 12,\n }}\n >\n <Accordion defaultExpandedKeys={extraDefaultExpand ? ['extra'] : []}>\n <AccordionItem\n classNames={{\n content: classNames?.extraContent,\n header: extraHeaderVariants({ variant }),\n }}\n itemKey={'extra'}\n styles={{\n content: {\n fontSize: 12,\n ...customStyles?.extraContent,\n },\n header: {\n borderColor: colors(theme, type, 'fillSecondary'),\n },\n indicator: {\n color: colors(theme, type),\n },\n title: {\n color: colors(theme, type),\n fontSize: 12,\n },\n }}\n title={text?.detail || 'Show Details'}\n >\n {extra}\n </AccordionItem>\n </Accordion>\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nAlert.displayName = 'Alert';\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,YAAY;CAChB,OAAO;CACP,MAAM;CACN,WAAW;CACX,SAAS;CACT,SAAS;CACV;AAED,MAAM,UAAU,OAAY,OAAe,QAAQ,GAAG,SAAmB;AACvE,KAAI,SAAS,YAAa,QAAO,MAAM,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC;AAC9E,QAAO,MAAM,UAAU;E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O,KAAK;OAC1B,UAAU;OACX;MACF;KACD,OAAO,MAAM,UAAU;eAEtB;MACa;KACN;IACJ;GACF;EAGf;AAED,QAAM,cAAc;AAEpB,oBAAeN"}
1
+ {"version":3,"file":"Alert.mjs","names":["Alert","AntdAlert","ActionIcon","Icon","Flexbox","Accordion","AccordionItem"],"sources":["../../src/Alert/Alert.tsx"],"sourcesContent":["'use client';\n\nimport { Alert as AntdAlert } from 'antd';\nimport { cva } from 'class-variance-authority';\nimport { camelCase } from 'es-toolkit/compat';\nimport { AlertTriangle, CheckCircle, Info, X, XCircle } from 'lucide-react';\nimport { memo, useMemo } from 'react';\n\nimport { Accordion, AccordionItem } from '@/Accordion';\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { useStyles } from './style';\nimport type { AlertProps } from './type';\n\nconst typeIcons = {\n error: XCircle,\n info: Info,\n secondary: AlertTriangle,\n success: CheckCircle,\n warning: AlertTriangle,\n};\n\nconst colors = (theme: any, type: string = 'info', ...keys: string[]) => {\n if (type === 'secondary') return theme[camelCase(['color', ...keys].join('-'))] as string;\n return theme[camelCase(['color', type, ...keys].join('-'))] as string;\n};\n\nconst Alert = memo<AlertProps>(\n ({\n closable = false,\n description,\n showIcon = true,\n type = 'info',\n glass,\n icon,\n colorfulText = true,\n iconProps,\n style,\n extra,\n classNames,\n styles: customStyles,\n text,\n extraDefaultExpand = false,\n extraIsolate,\n banner,\n variant = 'filled',\n ref,\n ...rest\n }) => {\n const { theme, styles, cx } = useStyles({\n closable: !!closable,\n hasTitle: !!description,\n showIcon: !!showIcon,\n });\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n colorfulText: true,\n glass: false,\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n glass: {\n false: null,\n true: styles.glass,\n },\n colorfulText: {\n false: null,\n true: styles.colorfulText,\n },\n hasExtra: {\n false: null,\n true: styles.hasExtra,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const extraVariants = useMemo(\n () =>\n cva(styles.extra, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n banner: {\n false: null,\n true: styles.banner,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const extraHeaderVariants = useMemo(\n () =>\n cva(styles.extraHeader, {\n defaultVariants: {\n variant: 'filled',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.borderlessExtraHeader,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const isInsideExtra = Boolean(!extraIsolate && !!extra);\n\n const alert = (\n <AntdAlert\n banner={banner}\n className={cx(\n variants({\n colorfulText,\n glass,\n hasExtra: isInsideExtra,\n variant,\n }),\n classNames?.alert,\n )}\n closable={\n typeof closable === 'boolean'\n ? closable\n : {\n closeIcon: <ActionIcon color={colors(theme, type)} icon={X} size={'small'} />,\n ...closable,\n }\n }\n description={description}\n icon={\n <Icon\n color={type === 'secondary' ? theme.colorTextSecondary : undefined}\n icon={typeIcons[type] || icon}\n size={description ? 24 : 18}\n {...iconProps}\n />\n }\n ref={ref}\n showIcon={showIcon}\n style={{\n background: colors(theme, type, 'fillTertiary'),\n borderColor: colors(theme, type, 'fillSecondary'),\n color: colorfulText ? colors(theme, type) : undefined,\n ...style,\n ...customStyles?.alert,\n }}\n type={type === 'secondary' ? 'info' : type}\n {...rest}\n />\n );\n\n if (!extra) return alert;\n\n if (extraIsolate)\n return (\n <Flexbox className={classNames?.container} gap={8}>\n {alert}\n {extra}\n </Flexbox>\n );\n\n return (\n <Flexbox className={classNames?.container} style={customStyles?.container}>\n {alert}\n <Flexbox\n className={extraVariants({ banner, variant })}\n style={{\n background: colors(theme, type, 'fillTertiary'),\n borderColor: colors(theme, type, 'fillSecondary'),\n color: colors(theme, type),\n fontSize: description ? 14 : 12,\n }}\n >\n <Accordion defaultExpandedKeys={extraDefaultExpand ? ['extra'] : []}>\n <AccordionItem\n classNames={{\n content: classNames?.extraContent,\n header: extraHeaderVariants({ variant }),\n }}\n itemKey={'extra'}\n styles={{\n content: {\n fontSize: 12,\n ...customStyles?.extraContent,\n },\n header: {\n borderColor: colors(theme, type, 'fillSecondary'),\n },\n indicator: {\n color: colors(theme, type),\n },\n title: {\n color: colors(theme, type),\n fontSize: 12,\n },\n }}\n title={text?.detail || 'Show Details'}\n >\n {extra}\n </AccordionItem>\n </Accordion>\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nAlert.displayName = 'Alert';\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,YAAY;CAChB,OAAO;CACP,MAAM;CACN,WAAW;CACX,SAAS;CACT,SAAS;CACV;AAED,MAAM,UAAU,OAAY,OAAe,QAAQ,GAAG,SAAmB;AACvE,KAAI,SAAS,YAAa,QAAO,MAAM,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC;AAC9E,QAAO,MAAM,UAAU;EAAC;EAAS;EAAM,GAAG;EAAK,CAAC,KAAK,IAAI,CAAC;;AAG5D,MAAMA,UAAQ,MACX,EACC,WAAW,OACX,aACA,WAAW,MACX,OAAO,QACP,OACA,MACA,eAAe,MACf,WACA,OACA,OACA,YACA,QAAQ,cACR,MACA,qBAAqB,OACrB,cACA,QACA,UAAU,UACV,KACA,GAAG,WACC;CACJ,MAAM,EAAE,OAAO,QAAQ,OAAO,UAAU;EACtC,UAAU,CAAC,CAAC;EACZ,UAAU,CAAC,CAAC;EACZ,UAAU,CAAC,CAAC;EACb,CAAC;CAEF,MAAM,WAAW,cAEb,IAAI,OA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OAAO,eAAe,OAAO,OAAO,KAAK,GAAG;GAC5C,GAAG;GACH,GAAG,cAAc;GAClB;EACD,MAAM,SAAS,cAAc,SAAS;EACtC,GAAI;GACJ;AAGJ,KAAI,CAAC,MAAO,QAAO;AAEnB,KAAI,aACF,QACE,qBAACC;EAAQ,WAAW,YAAY;EAAW,KAAK;aAC7C,OACA;GACO;AAGd,QACE,qBAACA;EAAQ,WAAW,YAAY;EAAW,OAAO,cAAc;aAC7D,OACD,oBAACA;GACC,WAAW,cAAc;IAAE;IAAQ;IAAS,CAAC;GAC7C,OAAO;IACL,YAAY,OAAO,OAAO,MAAM,eAAe;IAC/C,aAAa,OAAO,OAAO,MAAM,gBAAgB;IACjD,OAAO,OAAO,OAAO,KAAK;IAC1B,UAAU,cAAc,KAAK;IAC9B;aAED,oBAACC;IAAU,qBAAqB,qBAAqB,CAAC,QAAQ,GAAG,EAAE;cACjE,oBAACC;KACC,YAAY;MACV,SAAS,YAAY;MACrB,QAAQ,oBAAoB,EAAE,SAAS,CAAC;MACzC;KACD,SAAS;KACT,QAAQ;MACN,SAAS;OACP,UAAU;OACV,GAAG,cAAc;OAClB;MACD,QAAQ,EACN,aAAa,OAAO,OAAO,MAAM,gBAAgB,EAClD;MACD,WAAW,EACT,OAAO,OAAO,OAAO,KAAK,EAC3B;MACD,OAAO;OACL,OAAO,OAAO,OAAO,KAAK;OAC1B,UAAU;OACX;MACF;KACD,OAAO,MAAM,UAAU;eAEtB;MACa;KACN;IACJ;GACF;EAGf;AAED,QAAM,cAAc;AAEpB,oBAAeN"}
@@ -1,8 +1,8 @@
1
1
  import { AutoCompleteProps } from "./type.mjs";
2
- import * as react3 from "react";
2
+ import * as react2 from "react";
3
3
 
4
4
  //#region src/AutoComplete/Select.d.ts
5
- declare const AutoComplete: react3.NamedExoticComponent<AutoCompleteProps>;
5
+ declare const AutoComplete: react2.NamedExoticComponent<AutoCompleteProps>;
6
6
  //#endregion
7
7
  export { AutoComplete };
8
8
  //# sourceMappingURL=Select.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { AvatarGroupProps } from "../type.mjs";
2
- import * as react60 from "react";
2
+ import * as react0 from "react";
3
3
 
4
4
  //#region src/Avatar/AvatarGroup/index.d.ts
5
- declare const AvatarGroup: react60.NamedExoticComponent<AvatarGroupProps>;
5
+ declare const AvatarGroup: react0.NamedExoticComponent<AvatarGroupProps>;
6
6
  //#endregion
7
7
  export { AvatarGroup };
8
8
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { BurgerProps } from "./type.mjs";
2
- import * as react59 from "react";
2
+ import * as react52 from "react";
3
3
 
4
4
  //#region src/Burger/Burger.d.ts
5
- declare const Burger: react59.NamedExoticComponent<BurgerProps>;
5
+ declare const Burger: react52.NamedExoticComponent<BurgerProps>;
6
6
  //#endregion
7
7
  export { Burger };
8
8
  //# sourceMappingURL=Burger.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { CodeEditorProps } from "./type.mjs";
2
- import * as react57 from "react";
2
+ import * as react51 from "react";
3
3
 
4
4
  //#region src/CodeEditor/CodeEditor.d.ts
5
- declare const CodeEditor: react57.NamedExoticComponent<CodeEditorProps>;
5
+ declare const CodeEditor: react51.NamedExoticComponent<CodeEditorProps>;
6
6
  //#endregion
7
7
  export { CodeEditor };
8
8
  //# sourceMappingURL=CodeEditor.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { CollapseProps } from "./type.mjs";
2
- import * as react58 from "react";
2
+ import * as react50 from "react";
3
3
 
4
4
  //#region src/Collapse/Collapse.d.ts
5
- declare const Collapse: react58.NamedExoticComponent<CollapseProps>;
5
+ declare const Collapse: react50.NamedExoticComponent<CollapseProps>;
6
6
  //#endregion
7
7
  export { Collapse };
8
8
  //# sourceMappingURL=Collapse.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { MotionComponentType } from "../MotionProvider/index.mjs";
2
2
  import { TranslationResourcesInput } from "../i18n/types.mjs";
3
3
  import { CDN, CdnApi } from "../utils/genCdnUrl.mjs";
4
- import * as react66 from "react";
4
+ import * as react56 from "react";
5
5
  import { ElementType, ReactNode } from "react";
6
6
 
7
7
  //#region src/ConfigProvider/index.d.ts
@@ -19,7 +19,7 @@ interface ConfigProviderProps {
19
19
  motion: MotionComponentType;
20
20
  resources?: TranslationResourcesInput;
21
21
  }
22
- declare const ConfigProvider: react66.NamedExoticComponent<ConfigProviderProps>;
22
+ declare const ConfigProvider: react56.NamedExoticComponent<ConfigProviderProps>;
23
23
  type CdnFn = ({
24
24
  pkg,
25
25
  version,
@@ -1,8 +1,8 @@
1
1
  import { CopyButtonProps } from "./type.mjs";
2
- import * as react56 from "react";
2
+ import * as react49 from "react";
3
3
 
4
4
  //#region src/CopyButton/CopyButton.d.ts
5
- declare const CopyButton: react56.NamedExoticComponent<CopyButtonProps>;
5
+ declare const CopyButton: react49.NamedExoticComponent<CopyButtonProps>;
6
6
  //#endregion
7
7
  export { CopyButton };
8
8
  //# sourceMappingURL=CopyButton.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { DatePickerProps } from "./type.mjs";
2
- import * as react2 from "react";
2
+ import * as react48 from "react";
3
3
 
4
4
  //#region src/DatePicker/DatePicker.d.ts
5
- declare const DatePicker: react2.NamedExoticComponent<DatePickerProps>;
5
+ declare const DatePicker: react48.NamedExoticComponent<DatePickerProps>;
6
6
  //#endregion
7
7
  export { DatePicker };
8
8
  //# sourceMappingURL=DatePicker.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react61 from "react";
2
+ import * as react44 from "react";
3
3
 
4
4
  //#region src/DraggablePanel/components/DraggablePanelBody.d.ts
5
5
  type DraggablePanelBodyProps = DivProps;
6
- declare const DraggablePanelBody: react61.NamedExoticComponent<DivProps>;
6
+ declare const DraggablePanelBody: react44.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { DraggablePanelBody, DraggablePanelBodyProps };
9
9
  //# sourceMappingURL=DraggablePanelBody.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react63 from "react";
2
+ import * as react45 from "react";
3
3
 
4
4
  //#region src/DraggablePanel/components/DraggablePanelContainer.d.ts
5
5
  type DraggablePanelContainerProps = DivProps;
6
- declare const DraggablePanelContainer: react63.NamedExoticComponent<DivProps>;
6
+ declare const DraggablePanelContainer: react45.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { DraggablePanelContainer, DraggablePanelContainerProps };
9
9
  //# sourceMappingURL=DraggablePanelContainer.d.mts.map
@@ -1,9 +1,9 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react64 from "react";
2
+ import * as react46 from "react";
3
3
 
4
4
  //#region src/DraggablePanel/components/DraggablePanelFooter.d.ts
5
5
  type DraggablePanelFooterProps = DivProps;
6
- declare const DraggablePanelFooter: react64.NamedExoticComponent<DivProps>;
6
+ declare const DraggablePanelFooter: react46.NamedExoticComponent<DivProps>;
7
7
  //#endregion
8
8
  export { DraggablePanelFooter, DraggablePanelFooterProps };
9
9
  //# sourceMappingURL=DraggablePanelFooter.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { DivProps } from "../../types/index.mjs";
2
- import * as react62 from "react";
2
+ import * as react47 from "react";
3
3
 
4
4
  //#region src/DraggablePanel/components/DraggablePanelHeader.d.ts
5
5
  interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
@@ -9,7 +9,7 @@ interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
9
9
  setPin?: (pin: boolean) => void;
10
10
  title?: string;
11
11
  }
12
- declare const DraggablePanelHeader: react62.NamedExoticComponent<DraggablePanelHeaderProps>;
12
+ declare const DraggablePanelHeader: react47.NamedExoticComponent<DraggablePanelHeaderProps>;
13
13
  //#endregion
14
14
  export { DraggablePanelHeader, DraggablePanelHeaderProps };
15
15
  //# sourceMappingURL=DraggablePanelHeader.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { DraggableSideNavProps } from "./type.mjs";
2
- import * as react55 from "react";
2
+ import * as react43 from "react";
3
3
 
4
4
  //#region src/DraggableSideNav/DraggableSideNav.d.ts
5
- declare const DraggableSideNav: react55.NamedExoticComponent<DraggableSideNavProps>;
5
+ declare const DraggableSideNav: react43.NamedExoticComponent<DraggableSideNavProps>;
6
6
  //#endregion
7
7
  export { DraggableSideNav };
8
8
  //# sourceMappingURL=DraggableSideNav.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { DrawerProps } from "./type.mjs";
2
- import * as react1 from "react";
2
+ import * as react42 from "react";
3
3
 
4
4
  //#region src/Drawer/Drawer.d.ts
5
- declare const Drawer: react1.NamedExoticComponent<DrawerProps>;
5
+ declare const Drawer: react42.NamedExoticComponent<DrawerProps>;
6
6
  //#endregion
7
7
  export { Drawer };
8
8
  //# sourceMappingURL=Drawer.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { DropdownProps } from "./type.mjs";
2
- import * as react0 from "react";
2
+ import * as react41 from "react";
3
3
 
4
4
  //#region src/Dropdown/Dropdown.d.ts
5
- declare const Dropdown: react0.NamedExoticComponent<DropdownProps>;
5
+ declare const Dropdown: react41.NamedExoticComponent<DropdownProps>;
6
6
  //#endregion
7
7
  export { Dropdown };
8
8
  //# sourceMappingURL=Dropdown.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { EditableTextProps } from "./type.mjs";
2
- import * as react45 from "react";
2
+ import * as react39 from "react";
3
3
 
4
4
  //#region src/EditableText/EditableText.d.ts
5
- declare const EditableText: react45.NamedExoticComponent<EditableTextProps>;
5
+ declare const EditableText: react39.NamedExoticComponent<EditableTextProps>;
6
6
  //#endregion
7
7
  export { EditableText };
8
8
  //# sourceMappingURL=EditableText.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { EmojiPickerProps } from "./type.mjs";
2
- import * as react44 from "react";
2
+ import * as react40 from "react";
3
3
 
4
4
  //#region src/EmojiPicker/EmojiPicker.d.ts
5
- declare const EmojiPicker: react44.NamedExoticComponent<EmojiPickerProps>;
5
+ declare const EmojiPicker: react40.NamedExoticComponent<EmojiPickerProps>;
6
6
  //#endregion
7
7
  export { EmojiPicker };
8
8
  //# sourceMappingURL=EmojiPicker.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { FlexBasicProps } from "./type.mjs";
2
- import * as react41 from "react";
2
+ import * as react38 from "react";
3
3
 
4
4
  //#region src/Flex/FlexBasic.d.ts
5
- declare const _default: react41.NamedExoticComponent<FlexBasicProps>;
5
+ declare const _default: react38.NamedExoticComponent<FlexBasicProps>;
6
6
  //#endregion
7
7
  export { _default };
8
8
  //# sourceMappingURL=FlexBasic.d.mts.map
@@ -1,10 +1,10 @@
1
- import * as react65 from "react";
1
+ import * as react59 from "react";
2
2
 
3
3
  //#region src/FontLoader/index.d.ts
4
4
  interface FontLoaderProps {
5
5
  url: string;
6
6
  }
7
- declare const FontLoader: react65.NamedExoticComponent<FontLoaderProps>;
7
+ declare const FontLoader: react59.NamedExoticComponent<FontLoaderProps>;
8
8
  //#endregion
9
9
  export { FontLoader, FontLoaderProps };
10
10
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { FooterProps } from "./type.mjs";
2
- import * as react13 from "react";
2
+ import * as react37 from "react";
3
3
 
4
4
  //#region src/Footer/Footer.d.ts
5
- declare const Footer: react13.NamedExoticComponent<FooterProps>;
5
+ declare const Footer: react37.NamedExoticComponent<FooterProps>;
6
6
  //#endregion
7
7
  export { Footer };
8
8
  //# sourceMappingURL=Footer.d.mts.map
package/es/Form/Form.mjs CHANGED
@@ -10,7 +10,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Form } from "antd";
11
11
  import { useResponsive } from "antd-style";
12
12
  import { cva } from "class-variance-authority";
13
- import { isUndefined } from "lodash-es";
13
+ import { isUndefined } from "es-toolkit/compat";
14
14
 
15
15
  //#region src/Form/Form.tsx
16
16
  const Form$1 = memo(({ className, itemMinWidth, footer, form, items = [], children, itemsType = "group", itemVariant, variant = "borderless", classNames, styles: customStyles, gap, style, collapsible, defaultActiveKey, initialValues, activeKey, onCollapse, onFinish, ref, layout, ...rest }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Form.mjs","names":["Form","FormItem","FormGroup","keys: (string | number)[]","AntForm","cx","FormFlatGroup"],"sources":["../../src/Form/Form.tsx"],"sourcesContent":["'use client';\n\nimport { Form as AntForm } from 'antd';\nimport { useResponsive } from 'antd-style';\nimport { cva } from 'class-variance-authority';\nimport { isUndefined } from 'lodash-es';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport FormFlatGroup from './components/FormFlatGroup';\nimport FormGroup from './components/FormGroup';\nimport FormItem from './components/FormItem';\nimport { FormProvider } from './components/FormProvider';\nimport { useStyles } from './style';\nimport type { FormGroupItemType, FormItemProps, FormProps } from './type';\n\nconst Form = memo<FormProps>(\n ({\n className,\n itemMinWidth,\n footer,\n form,\n items = [],\n children,\n itemsType = 'group',\n itemVariant,\n variant = 'borderless',\n classNames,\n styles: customStyles,\n gap,\n style,\n collapsible,\n defaultActiveKey,\n initialValues,\n activeKey,\n onCollapse,\n onFinish,\n ref,\n layout,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const { cx, styles } = useStyles();\n const [submitLoading, setSubmitLoading] = useState(false);\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n variant: 'borderless',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.borderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const mapFlat = useCallback(\n (item: FormItemProps, itemIndex: number) => (\n <FormItem\n className={classNames?.item}\n divider={itemIndex !== 0}\n key={itemIndex}\n minWidth={itemMinWidth}\n style={customStyles?.item}\n variant={variant}\n {...item}\n />\n ),\n [itemMinWidth, variant, classNames, customStyles],\n );\n\n const mapTree = useCallback(\n (group: FormGroupItemType, groupIndex: number) => {\n const key = group?.key || groupIndex;\n return (\n <FormGroup\n active={activeKey && group?.key ? activeKey.includes(key) : undefined}\n className={classNames?.group}\n classNames={classNames}\n collapsible={isUndefined(group.collapsible) ? collapsible : group.collapsible}\n defaultActive={\n defaultActiveKey && group?.key ? defaultActiveKey.includes(key) : group?.defaultActive\n }\n extra={group?.extra}\n icon={group?.icon}\n key={key}\n keyValue={key}\n onCollapse={(active) => {\n let keys: (string | number)[] = activeKey || defaultActiveKey || [];\n keys = keys.filter((k) => k !== key);\n onCollapse?.(active ? [...keys, key] : keys);\n }}\n style={customStyles?.group}\n styles={customStyles}\n title={group.title}\n variant={group?.variant || variant}\n >\n {Array.isArray(group.children)\n ? group.children.filter((item) => !item.hidden).map((item, i) => mapFlat(item, i))\n : group.children}\n </FormGroup>\n );\n },\n [activeKey, collapsible, defaultActiveKey, onCollapse, variant, classNames, customStyles],\n );\n\n return (\n <FormProvider\n config={{\n form,\n initialValues,\n submitLoading,\n }}\n >\n <AntForm\n className={cx(variants({ variant }), className)}\n colon={false}\n form={form}\n initialValues={initialValues}\n layout={layout || (mobile ? 'vertical' : 'horizontal')}\n onFinish={async (...finishProps) => {\n if (!onFinish) return;\n setSubmitLoading(true);\n await onFinish(...finishProps);\n setSubmitLoading(false);\n }}\n ref={ref}\n style={{\n gap,\n ...style,\n }}\n variant={itemVariant}\n {...rest}\n >\n {items && items?.length > 0 ? (\n itemsType === 'group' ? (\n (items as FormGroupItemType[])?.map((item, i) => mapTree(item, i))\n ) : (\n <FormFlatGroup\n className={classNames?.group}\n style={customStyles?.group}\n variant={variant}\n >\n {(items as FormItemProps[])\n ?.filter((item) => !item.hidden)\n .map((item, i) => mapFlat(item, i))}\n </FormFlatGroup>\n )\n ) : undefined}\n {children}\n {footer}\n </AntForm>\n </FormProvider>\n );\n },\n);\n\nForm.displayName = 'Form';\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAMA,SAAO,MACV,EACC,WACA,cACA,QACA,MACA,QAAQ,EAAE,EACV,UACA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AM,QAAQ,MAAM,EAAE,CAAC,GAChF,MAAM;KAdL,IAeK;IAGhB;EAAC;EAAW;EAAa;EAAkB;EAAY;EAAS;EAAY;EAAa,CAC1F;AAED,QACE,oBAAC;EACC,QAAQ;GACN;GACA;GACA;GACD;YAED,qBAACC;GACC,WAAWC,KAAG,SAAS,EAAE,SAAS,CAAC,EAAE,UAAU;GAC/C,OAAO;GACD;GACS;GACf,QAAQ,WAAW,SAAS,aAAa;GACzC,UAAU,OAAO,GAAG,gBAAgB;AAClC,QAAI,CAAC,SAAU;AACf,qBAAiB,KAAK;AACtB,UAAM,SAAS,GAAG,YAAY;AAC9B,qBAAiB,MAAM;;GAEpB;GACL,OAAO;IACL;IACA,GAAG;IACJ;GACD,SAAS;GACT,GAAI;;IAEH,SAAS,OAAO,SAAS,IACxB,cAAc,UACX,OAA+B,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC,GAElE,oBAACC;KACC,WAAW,YAAY;KACvB,OAAO,cAAc;KACZ;eAEP,OACE,QAAQ,SAAS,CAAC,KAAK,OAAO,CAC/B,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC;MACvB,GAEhB;IACH;IACA;;IACO;GACG;EAGpB;AAED,OAAK,cAAc;AAEnB,mBAAeN"}
1
+ {"version":3,"file":"Form.mjs","names":["Form","FormItem","FormGroup","keys: (string | number)[]","AntForm","cx","FormFlatGroup"],"sources":["../../src/Form/Form.tsx"],"sourcesContent":["'use client';\n\nimport { Form as AntForm } from 'antd';\nimport { useResponsive } from 'antd-style';\nimport { cva } from 'class-variance-authority';\nimport { isUndefined } from 'es-toolkit/compat';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport FormFlatGroup from './components/FormFlatGroup';\nimport FormGroup from './components/FormGroup';\nimport FormItem from './components/FormItem';\nimport { FormProvider } from './components/FormProvider';\nimport { useStyles } from './style';\nimport type { FormGroupItemType, FormItemProps, FormProps } from './type';\n\nconst Form = memo<FormProps>(\n ({\n className,\n itemMinWidth,\n footer,\n form,\n items = [],\n children,\n itemsType = 'group',\n itemVariant,\n variant = 'borderless',\n classNames,\n styles: customStyles,\n gap,\n style,\n collapsible,\n defaultActiveKey,\n initialValues,\n activeKey,\n onCollapse,\n onFinish,\n ref,\n layout,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const { cx, styles } = useStyles();\n const [submitLoading, setSubmitLoading] = useState(false);\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n variant: 'borderless',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.borderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const mapFlat = useCallback(\n (item: FormItemProps, itemIndex: number) => (\n <FormItem\n className={classNames?.item}\n divider={itemIndex !== 0}\n key={itemIndex}\n minWidth={itemMinWidth}\n style={customStyles?.item}\n variant={variant}\n {...item}\n />\n ),\n [itemMinWidth, variant, classNames, customStyles],\n );\n\n const mapTree = useCallback(\n (group: FormGroupItemType, groupIndex: number) => {\n const key = group?.key || groupIndex;\n return (\n <FormGroup\n active={activeKey && group?.key ? activeKey.includes(key) : undefined}\n className={classNames?.group}\n classNames={classNames}\n collapsible={isUndefined(group.collapsible) ? collapsible : group.collapsible}\n defaultActive={\n defaultActiveKey && group?.key ? defaultActiveKey.includes(key) : group?.defaultActive\n }\n extra={group?.extra}\n icon={group?.icon}\n key={key}\n keyValue={key}\n onCollapse={(active) => {\n let keys: (string | number)[] = activeKey || defaultActiveKey || [];\n keys = keys.filter((k) => k !== key);\n onCollapse?.(active ? [...keys, key] : keys);\n }}\n style={customStyles?.group}\n styles={customStyles}\n title={group.title}\n variant={group?.variant || variant}\n >\n {Array.isArray(group.children)\n ? group.children.filter((item) => !item.hidden).map((item, i) => mapFlat(item, i))\n : group.children}\n </FormGroup>\n );\n },\n [activeKey, collapsible, defaultActiveKey, onCollapse, variant, classNames, customStyles],\n );\n\n return (\n <FormProvider\n config={{\n form,\n initialValues,\n submitLoading,\n }}\n >\n <AntForm\n className={cx(variants({ variant }), className)}\n colon={false}\n form={form}\n initialValues={initialValues}\n layout={layout || (mobile ? 'vertical' : 'horizontal')}\n onFinish={async (...finishProps) => {\n if (!onFinish) return;\n setSubmitLoading(true);\n await onFinish(...finishProps);\n setSubmitLoading(false);\n }}\n ref={ref}\n style={{\n gap,\n ...style,\n }}\n variant={itemVariant}\n {...rest}\n >\n {items && items?.length > 0 ? (\n itemsType === 'group' ? (\n (items as FormGroupItemType[])?.map((item, i) => mapTree(item, i))\n ) : (\n <FormFlatGroup\n className={classNames?.group}\n style={customStyles?.group}\n variant={variant}\n >\n {(items as FormItemProps[])\n ?.filter((item) => !item.hidden)\n .map((item, i) => mapFlat(item, i))}\n </FormFlatGroup>\n )\n ) : undefined}\n {children}\n {footer}\n </AntForm>\n </FormProvider>\n );\n },\n);\n\nForm.displayName = 'Form';\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAMA,SAAO,MACV,EACC,WACA,cACA,QACA,MACA,QAAQ,EAAE,EACV,UACA,YAAY,SACZ,aACA,UAAU,cACV,YACA,QAAQ,cACR,KACA,OACA,aACA,kBACA,eACA,WACA,YACA,UACA,KACA,QACA,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,UAAI,WAAW,WAAW;CAClC,MAAM,CAAC,eAAe,oBAAoB,SAAS,MAAM;CAEzD,MAAM,WAAW,cAEb,IAAI,OAAO,MAAM;EACf,iBAAiB,EACf,SAAS,cACV;EAED,UAAU,EACR,SAAS;GACP,QAAQ;GACR,UAAU;GACV,YAAY,OAAO;GACpB,EACF;EAEF,CAAC,EACJ,CAAC,OAAO,CACT;CAED,MAAM,UAAU,aACb,MAAqB,cACpB,oBAACC;EACC,WAAW,YAAY;EACvB,SAAS,cAAc;EAEvB,UAAU;EACV,OAAO,cAAc;EACZ;EACT,GAAI;IAJC,UAKL,EA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,MAAM,QAAQ,MAAM,EAAE,CAAC,GAElE,oBAACC;KACC,WAAW,YAAY;KACvB,OAAO,cAAc;KACZ;eAEP,OACE,QAAQ,SAAS,CAAC,KAAK,OAAO,CAC/B,KAAK,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC;MACvB,GAEhB;IACH;IACA;;IACO;GACG;EAGpB;AAED,OAAK,cAAc;AAEnB,mBAAeN"}
@@ -1,8 +1,8 @@
1
1
  import { FormGroupProps } from "../type.mjs";
2
- import * as react10 from "react";
2
+ import * as react34 from "react";
3
3
 
4
4
  //#region src/Form/components/FormGroup.d.ts
5
- declare const FormGroup: react10.NamedExoticComponent<FormGroupProps>;
5
+ declare const FormGroup: react34.NamedExoticComponent<FormGroupProps>;
6
6
  //#endregion
7
7
  export { FormGroup };
8
8
  //# sourceMappingURL=FormGroup.d.mts.map
@@ -8,7 +8,7 @@ import { memo, useMemo } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useResponsive } from "antd-style";
10
10
  import { cva } from "class-variance-authority";
11
- import { isUndefined } from "lodash-es";
11
+ import { isUndefined } from "es-toolkit/compat";
12
12
 
13
13
  //#region src/Form/components/FormGroup.tsx
14
14
  const FormGroup = memo(({ className, icon, title, children, extra, variant = "borderless", defaultActive = true, collapsible, active, keyValue = "group", onCollapse, desc, ...rest }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"FormGroup.mjs","names":["useStyles","Flexbox","cx","Icon","Collapse"],"sources":["../../../src/Form/components/FormGroup.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { cva } from 'class-variance-authority';\nimport { isUndefined } from 'lodash-es';\nimport { memo, useMemo } from 'react';\n\nimport Collapse from '@/Collapse';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { useGroupStyles as useStyles } from '../style';\nimport type { FormGroupProps } from '../type';\n\nconst FormGroup = memo<FormGroupProps>(\n ({\n className,\n icon,\n title,\n children,\n extra,\n variant = 'borderless',\n defaultActive = true,\n collapsible,\n active,\n keyValue = 'group',\n onCollapse,\n desc,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const { cx, styles } = useStyles(variant);\n const isBorderless = variant === 'borderless';\n\n const defaultCollapsible = isUndefined(collapsible) ? !isBorderless : collapsible;\n\n const titleVariants = useMemo(\n () =>\n cva(styles.title, {\n defaultVariants: {\n variant: 'borderless',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.titleBorderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const titleContent = (\n <Flexbox className={cx(titleVariants({ variant }), styles.titleMobile)} gap={8} horizontal>\n {icon && <Icon icon={icon} />}\n {title}\n </Flexbox>\n );\n\n if (mobile)\n return (\n <Flexbox className={className}>\n <Flexbox className={styles.mobileGroupHeader} horizontal justify={'space-between'}>\n {titleContent}\n {extra}\n </Flexbox>\n <div className={styles.mobileGroupBody}>{children}</div>\n </Flexbox>\n );\n\n return (\n <Collapse\n activeKey={isUndefined(active) ? undefined : active ? [keyValue] : []}\n className={className}\n classNames={{\n header: variant === 'borderless' ? styles.titleBorderless : undefined,\n title: variant === 'borderless' ? styles.titleBorderless : undefined,\n }}\n collapsible={defaultCollapsible}\n defaultActiveKey={defaultActive ? [keyValue] : undefined}\n items={[\n {\n children,\n desc,\n extra,\n icon,\n key: keyValue,\n label: title,\n },\n ]}\n onChange={(v) => onCollapse?.(v.length > 0)}\n variant={variant}\n {...rest}\n />\n );\n },\n);\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,YAAY,MACf,EACC,WACA,MACA,OACA,UACA,OACA,UAAU,cACV,gBAAgB,MAChB,aACA,QACA,WAAW,SACX,YACA,MACA,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,UAAI,WAAWA,eAAU,QAAQ;CACzC,MAAM,eAAe,YAAY;CAEjC,MAAM,qBAAqB,YAAY,YAAY,GAAG,CAAC,eAAe;CAqBtE,MAAM,eACJ,qBAACC;EAAQ,WAAWC,KApBA,cAElB,IAAI,OAAO,OAAO;GAChB,iBAAiB,EACf,SAAS,cACV;GAED,UAAU,EACR,SAAS;IACP,QAAQ;IACR,UAAU;IACV,YAAY,OAAO;IACpB,EACF;GAEF,CAAC,EACJ,CAAC,OAAO,CACT,CAGsC,EAAE,SAAS,CAAC,EAAE,OAAO,YAAY;EAAE,KAAK;EAAG;aAC7E,QAAQ,oBAACC,gBAAW,OAAQ,EAC5B;GACO;AAGZ,KAAI,OACF,QACE,qBAACF;EAAmB;aAClB,qBAACA;GAAQ,WAAW,OAAO;GAAmB;GAAW,SAAS;cAC/D,cACA;IACO,EACV,oBAAC;GAAI,WAAW,OAAO;GAAkB;IAAe;GAChD;AAGd,QACE,oBAACG;EACC,WAAW,YAAY,OAAO,GAAG,SAAY,SAAS,CAAC,SAAS,GAAG,EAAE;EAC1D;EACX,YAAY;GACV,QAAQ,YAAY,eAAe,OAAO,kBAAkB;GAC5D,OAAO,YAAY,eAAe,OAAO,kBAAkB;GAC5D;EACD,aAAa;EACb,kBAAkB,gBAAgB,CAAC,SAAS,GAAG;EAC/C,OAAO,CACL;GACE;GACA;GACA;GACA;GACA,KAAK;GACL,OAAO;GACR,CACF;EACD,WAAW,MAAM,aAAa,EAAE,SAAS,EAAE;EAClC;EACT,GAAI;GACJ;EAGP;AAED,UAAU,cAAc;AAExB,wBAAe"}
1
+ {"version":3,"file":"FormGroup.mjs","names":["useStyles","Flexbox","cx","Icon","Collapse"],"sources":["../../../src/Form/components/FormGroup.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { cva } from 'class-variance-authority';\nimport { isUndefined } from 'es-toolkit/compat';\nimport { memo, useMemo } from 'react';\n\nimport Collapse from '@/Collapse';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { useGroupStyles as useStyles } from '../style';\nimport type { FormGroupProps } from '../type';\n\nconst FormGroup = memo<FormGroupProps>(\n ({\n className,\n icon,\n title,\n children,\n extra,\n variant = 'borderless',\n defaultActive = true,\n collapsible,\n active,\n keyValue = 'group',\n onCollapse,\n desc,\n ...rest\n }) => {\n const { mobile } = useResponsive();\n const { cx, styles } = useStyles(variant);\n const isBorderless = variant === 'borderless';\n\n const defaultCollapsible = isUndefined(collapsible) ? !isBorderless : collapsible;\n\n const titleVariants = useMemo(\n () =>\n cva(styles.title, {\n defaultVariants: {\n variant: 'borderless',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n variant: {\n filled: null,\n outlined: null,\n borderless: styles.titleBorderless,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n const titleContent = (\n <Flexbox className={cx(titleVariants({ variant }), styles.titleMobile)} gap={8} horizontal>\n {icon && <Icon icon={icon} />}\n {title}\n </Flexbox>\n );\n\n if (mobile)\n return (\n <Flexbox className={className}>\n <Flexbox className={styles.mobileGroupHeader} horizontal justify={'space-between'}>\n {titleContent}\n {extra}\n </Flexbox>\n <div className={styles.mobileGroupBody}>{children}</div>\n </Flexbox>\n );\n\n return (\n <Collapse\n activeKey={isUndefined(active) ? undefined : active ? [keyValue] : []}\n className={className}\n classNames={{\n header: variant === 'borderless' ? styles.titleBorderless : undefined,\n title: variant === 'borderless' ? styles.titleBorderless : undefined,\n }}\n collapsible={defaultCollapsible}\n defaultActiveKey={defaultActive ? [keyValue] : undefined}\n items={[\n {\n children,\n desc,\n extra,\n icon,\n key: keyValue,\n label: title,\n },\n ]}\n onChange={(v) => onCollapse?.(v.length > 0)}\n variant={variant}\n {...rest}\n />\n );\n },\n);\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,YAAY,MACf,EACC,WACA,MACA,OACA,UACA,OACA,UAAU,cACV,gBAAgB,MAChB,aACA,QACA,WAAW,SACX,YACA,MACA,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,UAAI,WAAWA,eAAU,QAAQ;CACzC,MAAM,eAAe,YAAY;CAEjC,MAAM,qBAAqB,YAAY,YAAY,GAAG,CAAC,eAAe;CAqBtE,MAAM,eACJ,qBAACC;EAAQ,WAAWC,KApBA,cAElB,IAAI,OAAO,OAAO;GAChB,iBAAiB,EACf,SAAS,cACV;GAED,UAAU,EACR,SAAS;IACP,QAAQ;IACR,UAAU;IACV,YAAY,OAAO;IACpB,EACF;GAEF,CAAC,EACJ,CAAC,OAAO,CACT,CAGsC,EAAE,SAAS,CAAC,EAAE,OAAO,YAAY;EAAE,KAAK;EAAG;aAC7E,QAAQ,oBAACC,gBAAW,OAAQ,EAC5B;GACO;AAGZ,KAAI,OACF,QACE,qBAACF;EAAmB;aAClB,qBAACA;GAAQ,WAAW,OAAO;GAAmB;GAAW,SAAS;cAC/D,cACA;IACO,EACV,oBAAC;GAAI,WAAW,OAAO;GAAkB;IAAe;GAChD;AAGd,QACE,oBAACG;EACC,WAAW,YAAY,OAAO,GAAG,SAAY,SAAS,CAAC,SAAS,GAAG,EAAE;EAC1D;EACX,YAAY;GACV,QAAQ,YAAY,eAAe,OAAO,kBAAkB;GAC5D,OAAO,YAAY,eAAe,OAAO,kBAAkB;GAC5D;EACD,aAAa;EACb,kBAAkB,gBAAgB,CAAC,SAAS,GAAG;EAC/C,OAAO,CACL;GACE;GACA;GACA;GACA;GACA,KAAK;GACL,OAAO;GACR,CACF;EACD,WAAW,MAAM,aAAa,EAAE,SAAS,EAAE;EAClC;EACT,GAAI;GACJ;EAGP;AAED,UAAU,cAAc;AAExB,wBAAe"}
@@ -1,8 +1,8 @@
1
1
  import { FormItemProps } from "../type.mjs";
2
- import * as react11 from "react";
2
+ import * as react36 from "react";
3
3
 
4
4
  //#region src/Form/components/FormItem.d.ts
5
- declare const FormItem: react11.NamedExoticComponent<FormItemProps>;
5
+ declare const FormItem: react36.NamedExoticComponent<FormItemProps>;
6
6
  //#endregion
7
7
  export { FormItem };
8
8
  //# sourceMappingURL=FormItem.d.mts.map