@lobehub/ui 5.55.0 → 5.57.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.
- package/es/EditableText/ControlInput.mjs +2 -2
- package/es/EditableText/ControlInput.mjs.map +1 -1
- package/es/SearchBar/SearchBar.mjs +2 -2
- package/es/SearchBar/SearchBar.mjs.map +1 -1
- package/es/base-ui/Checkbox/Checkbox.d.mts +6 -2
- package/es/base-ui/Checkbox/Checkbox.mjs +2 -1
- package/es/base-ui/Checkbox/Checkbox.mjs.map +1 -1
- package/es/base-ui/Checkbox/CheckboxGroup.mjs +2 -2
- package/es/base-ui/Checkbox/CheckboxGroup.mjs.map +1 -1
- package/es/base-ui/Checkbox/index.d.mts +2 -2
- package/es/base-ui/ColorPicker/ColorPicker.mjs +4 -4
- package/es/base-ui/ColorPicker/ColorPicker.mjs.map +1 -1
- package/es/base-ui/DatePicker/style.mjs +1 -0
- package/es/base-ui/DatePicker/style.mjs.map +1 -1
- package/es/base-ui/Form/components/FormGroup.mjs +13 -5
- package/es/base-ui/Form/components/FormGroup.mjs.map +1 -1
- package/es/base-ui/Form/index.d.mts +3 -0
- package/es/base-ui/Form/index.mjs +3 -0
- package/es/base-ui/Form/index.mjs.map +1 -1
- package/es/base-ui/Form/style.mjs +32 -6
- package/es/base-ui/Form/style.mjs.map +1 -1
- package/es/base-ui/FormKit/Field.d.mts +9 -0
- package/es/base-ui/FormKit/Field.mjs +167 -0
- package/es/base-ui/FormKit/Field.mjs.map +1 -0
- package/es/base-ui/FormKit/Form.mjs +96 -0
- package/es/base-ui/FormKit/Form.mjs.map +1 -0
- package/es/base-ui/FormKit/List.d.mts +34 -0
- package/es/base-ui/FormKit/List.mjs +102 -0
- package/es/base-ui/FormKit/List.mjs.map +1 -0
- package/es/base-ui/FormKit/SubmitFooter.d.mts +6 -0
- package/es/base-ui/FormKit/SubmitFooter.mjs +36 -0
- package/es/base-ui/FormKit/SubmitFooter.mjs.map +1 -0
- package/es/base-ui/FormKit/binding.mjs +23 -0
- package/es/base-ui/FormKit/binding.mjs.map +1 -0
- package/es/base-ui/FormKit/context.d.mts +7 -0
- package/es/base-ui/FormKit/context.mjs +14 -0
- package/es/base-ui/FormKit/context.mjs.map +1 -0
- package/es/base-ui/FormKit/engine/tanstack.mjs +293 -0
- package/es/base-ui/FormKit/engine/tanstack.mjs.map +1 -0
- package/es/base-ui/FormKit/engine/types.d.mts +6 -0
- package/es/base-ui/FormKit/index.d.mts +31 -0
- package/es/base-ui/FormKit/index.mjs +28 -0
- package/es/base-ui/FormKit/index.mjs.map +1 -0
- package/es/base-ui/FormKit/instance.mjs +67 -0
- package/es/base-ui/FormKit/instance.mjs.map +1 -0
- package/es/base-ui/FormKit/schema.d.mts +33 -0
- package/es/base-ui/FormKit/schema.mjs +23 -0
- package/es/base-ui/FormKit/schema.mjs.map +1 -0
- package/es/base-ui/FormKit/style.mjs +119 -0
- package/es/base-ui/FormKit/style.mjs.map +1 -0
- package/es/base-ui/FormKit/type.d.mts +122 -0
- package/es/base-ui/FormKit/useForm.d.mts +10 -0
- package/es/base-ui/FormKit/useForm.mjs +54 -0
- package/es/base-ui/FormKit/useForm.mjs.map +1 -0
- package/es/base-ui/FormKit/useStoreSelector.mjs +25 -0
- package/es/base-ui/FormKit/useStoreSelector.mjs.map +1 -0
- package/es/base-ui/FormKit/useWatch.d.mts +7 -0
- package/es/base-ui/FormKit/useWatch.mjs +12 -0
- package/es/base-ui/FormKit/useWatch.mjs.map +1 -0
- package/es/base-ui/Input/Input.d.mts +6 -2
- package/es/base-ui/Input/Input.mjs +2 -1
- package/es/base-ui/Input/Input.mjs.map +1 -1
- package/es/base-ui/Input/InputNumber.d.mts +6 -2
- package/es/base-ui/Input/InputNumber.mjs +13 -6
- package/es/base-ui/Input/InputNumber.mjs.map +1 -1
- package/es/base-ui/Input/InputPassword.d.mts +6 -2
- package/es/base-ui/Input/InputPassword.mjs +4 -3
- package/es/base-ui/Input/InputPassword.mjs.map +1 -1
- package/es/base-ui/Input/TextArea.d.mts +6 -2
- package/es/base-ui/Input/TextArea.mjs +2 -1
- package/es/base-ui/Input/TextArea.mjs.map +1 -1
- package/es/base-ui/Input/index.d.mts +5 -5
- package/es/base-ui/Input/style.d.mts +4 -1
- package/es/base-ui/Input/style.mjs +21 -8
- package/es/base-ui/Input/style.mjs.map +1 -1
- package/es/base-ui/Modal/Modal.mjs +4 -8
- package/es/base-ui/Modal/Modal.mjs.map +1 -1
- package/es/base-ui/Slider/SliderWithInput.mjs +2 -2
- package/es/base-ui/Slider/SliderWithInput.mjs.map +1 -1
- package/es/base-ui/Switch/Switch.mjs +2 -2
- package/es/base-ui/Switch/Switch.mjs.map +1 -1
- package/es/base-ui/Text/style.d.mts +1 -1
- package/es/base-ui/Tree/TreeNode.mjs +2 -2
- package/es/base-ui/Tree/TreeNode.mjs.map +1 -1
- package/es/base-ui/index.d.mts +8 -8
- package/es/base-ui/index.mjs +6 -6
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs +2 -2
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs.map +1 -1
- package/es/chat/MessageInput/MessageInput.mjs +2 -2
- package/es/chat/MessageInput/MessageInput.mjs.map +1 -1
- package/es/chat/MessageModal/MessageModal.mjs +2 -2
- package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
- package/es/eslint/index.d.mts +27 -3
- package/es/eslint/index.mjs +40 -2
- package/es/eslint/index.mjs.map +1 -1
- package/es/eslint/noInlineFormSchema.mjs +44 -0
- package/es/eslint/noInlineFormSchema.mjs.map +1 -0
- package/es/i18n/resources/en/form.d.mts +4 -0
- package/es/i18n/resources/en/form.mjs +4 -0
- package/es/i18n/resources/en/form.mjs.map +1 -1
- package/es/i18n/resources/zhCn/form.d.mts +4 -0
- package/es/i18n/resources/zhCn/form.mjs +4 -0
- package/es/i18n/resources/zhCn/form.mjs.map +1 -1
- package/es/node_modules/.pnpm/@eslint_core@0.17.0/node_modules/@eslint/core/dist/esm/types.d.mts +1139 -0
- package/es/node_modules/.pnpm/@types_estree@1.0.9/node_modules/@types/estree/index.d.mts +528 -0
- package/es/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.mts +201 -0
- package/es/node_modules/.pnpm/eslint@9.39.5_jiti@2.6.1_supports-color@10.2.2/node_modules/eslint/lib/types/index.d.mts +962 -0
- package/package.json +6 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps } from "./type.mjs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import _default from "./Input.mjs";
|
|
3
|
+
import _default$1 from "./InputNumber.mjs";
|
|
4
4
|
import InputOTP from "./InputOTP.mjs";
|
|
5
|
-
import
|
|
5
|
+
import _default$2 from "./InputPassword.mjs";
|
|
6
6
|
import { rootVariants, styles } from "./style.mjs";
|
|
7
|
-
import
|
|
8
|
-
export { Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, TextArea, type TextAreaAutoSize, type TextAreaProps, styles as inputStyles, rootVariants as inputVariants };
|
|
7
|
+
import _default$3 from "./TextArea.mjs";
|
|
8
|
+
export { _default as Input, type InputClassNames, _default$1 as InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, _default$2 as InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, _default$3 as TextArea, type TextAreaAutoSize, type TextAreaProps, styles as inputStyles, rootVariants as inputVariants };
|
|
@@ -15,7 +15,10 @@ declare const styles: {
|
|
|
15
15
|
sizeMiddle: string;
|
|
16
16
|
sizeSmall: string;
|
|
17
17
|
numberControl: string;
|
|
18
|
+
numberControlLarge: string;
|
|
19
|
+
numberControlSmall: string;
|
|
18
20
|
numberControls: string;
|
|
21
|
+
numberControlsSmall: string;
|
|
19
22
|
numberInput: string;
|
|
20
23
|
otpCell: string;
|
|
21
24
|
otpRoot: string;
|
|
@@ -28,7 +31,7 @@ declare const styles: {
|
|
|
28
31
|
declare const rootVariants: (props?: ({
|
|
29
32
|
shadow?: boolean | null | undefined;
|
|
30
33
|
size?: "large" | "middle" | "small" | null | undefined;
|
|
31
|
-
variant?: "filled" | "
|
|
34
|
+
variant?: "filled" | "outlined" | "borderless" | null | undefined;
|
|
32
35
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
33
36
|
//#endregion
|
|
34
37
|
export { rootVariants, styles };
|
|
@@ -170,39 +170,52 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
170
170
|
cursor: pointer;
|
|
171
171
|
|
|
172
172
|
display: flex;
|
|
173
|
-
flex: 1;
|
|
174
173
|
align-items: center;
|
|
175
174
|
justify-content: center;
|
|
176
175
|
|
|
176
|
+
width: 20px;
|
|
177
|
+
height: 13px;
|
|
177
178
|
margin: 0;
|
|
178
179
|
padding: 0;
|
|
179
180
|
border: none;
|
|
181
|
+
border-radius: 4px;
|
|
180
182
|
|
|
181
183
|
color: ${cssVar.colorTextTertiary};
|
|
182
184
|
|
|
183
185
|
background: none;
|
|
184
186
|
outline: none;
|
|
185
187
|
|
|
186
|
-
transition:
|
|
188
|
+
transition:
|
|
189
|
+
color 150ms ${cssVar.motionEaseOut},
|
|
190
|
+
background 150ms ${cssVar.motionEaseOut};
|
|
187
191
|
|
|
188
192
|
&:hover:not(:disabled) {
|
|
189
193
|
color: ${cssVar.colorText};
|
|
194
|
+
background: ${cssVar.colorFillSecondary};
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
&:disabled {
|
|
193
198
|
cursor: not-allowed;
|
|
194
|
-
opacity: 0.
|
|
199
|
+
opacity: 0.3;
|
|
195
200
|
}
|
|
201
|
+
`,
|
|
202
|
+
numberControlLarge: css`
|
|
203
|
+
width: 22px;
|
|
204
|
+
height: 15px;
|
|
205
|
+
`,
|
|
206
|
+
numberControlSmall: css`
|
|
207
|
+
width: 16px;
|
|
208
|
+
height: 10px;
|
|
209
|
+
border-radius: 3px;
|
|
196
210
|
`,
|
|
197
211
|
numberControls: css`
|
|
198
212
|
display: flex;
|
|
199
213
|
flex: none;
|
|
200
214
|
flex-direction: column;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
margin-inline-end: -
|
|
205
|
-
border-inline-start: 1px solid ${cssVar.colorBorderSecondary};
|
|
215
|
+
margin-inline-end: -6px;
|
|
216
|
+
`,
|
|
217
|
+
numberControlsSmall: css`
|
|
218
|
+
margin-inline-end: -4px;
|
|
206
219
|
`,
|
|
207
220
|
numberInput: css`
|
|
208
221
|
font-variant-numeric: tabular-nums;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Input/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { controlHeight } from '@/base-ui/controlSize';\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n clear: css`\n cursor: pointer;\n\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n\n color: ${cssVar.colorBgContainer};\n\n visibility: hidden;\n background: ${cssVar.colorTextQuaternary};\n\n &:hover {\n background: ${cssVar.colorTextTertiary};\n }\n `,\n count: css`\n pointer-events: none;\n\n position: absolute;\n inset-block-end: 6px;\n inset-inline-end: 8px;\n\n display: inline-flex;\n align-items: center;\n\n height: 20px;\n padding-inline: 8px;\n border-radius: 999px;\n\n font-size: 11px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n color: ${cssVar.colorTextSecondary};\n\n background: ${cssVar.colorFillTertiary};\n\n &[data-over] {\n color: ${cssVar.colorWhite};\n background: ${cssVar.colorError};\n }\n `,\n textareaClear: css`\n position: absolute;\n inset-block-start: 10px;\n inset-inline-end: 10px;\n `,\n textareaWithCount: css`\n padding-block-end: 30px;\n `,\n borderless: css`\n border: 1px solid transparent;\n background: none;\n `,\n filled: css`\n border: 1px solid transparent;\n background: ${cssVar.colorFillTertiary};\n\n &:hover:not(:focus-within, [data-disabled]) {\n background: ${cssVar.colorFillSecondary};\n }\n `,\n input: css`\n flex: 1;\n\n min-width: 0;\n padding: 0;\n border: none;\n\n font: inherit;\n color: inherit;\n\n appearance: none;\n background: transparent;\n outline: none;\n\n &::placeholder {\n color: ${cssVar.colorTextPlaceholder};\n }\n\n /* the root shows focus via its border; outrank global :focus-visible rings */\n &:focus-visible {\n outline: none;\n }\n `,\n invalid: css`\n &:has([data-invalid], [aria-invalid='true']) {\n border-color: ${cssVar.colorError};\n\n &:focus-within {\n border-color: ${cssVar.colorError};\n box-shadow: 0 0 0 2px ${cssVar.colorErrorBg};\n }\n }\n `,\n outlined: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: ${cssVar.colorBgContainer};\n\n &:hover:not(:focus-within, [data-disabled]) {\n border-color: ${cssVar.colorBorder};\n }\n\n &:focus-within {\n border-color: ${cssVar.colorPrimary};\n box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};\n }\n `,\n root: css`\n cursor: text;\n\n display: inline-flex;\n gap: 8px;\n align-items: center;\n\n box-sizing: border-box;\n width: 100%;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadius};\n\n font-size: 14px;\n color: ${cssVar.colorText};\n\n transition:\n background 150ms ${cssVar.motionEaseOut},\n border-color 150ms ${cssVar.motionEaseOut},\n box-shadow 150ms ${cssVar.motionEaseOut};\n\n &[data-disabled],\n &:has(:disabled) {\n cursor: not-allowed;\n color: ${cssVar.colorTextQuaternary};\n opacity: 0.66;\n }\n\n &:hover [data-lobe-input-clear],\n &:focus-within [data-lobe-input-clear] {\n visibility: visible;\n }\n `,\n shadow: lobeStaticStylish.shadow,\n sizeLarge: css`\n min-height: ${controlHeight.large}px;\n border-radius: ${cssVar.borderRadiusLG};\n font-size: 16px;\n `,\n sizeMiddle: css`\n min-height: ${controlHeight.middle}px;\n `,\n sizeSmall: css`\n min-height: ${controlHeight.small}px;\n padding-inline: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n font-size: 12px;\n `,\n numberControl: css`\n cursor: pointer;\n\n display: flex;\n
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Input/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { controlHeight } from '@/base-ui/controlSize';\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n clear: css`\n cursor: pointer;\n\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n padding: 0;\n border: 0;\n border-radius: 50%;\n\n color: ${cssVar.colorBgContainer};\n\n visibility: hidden;\n background: ${cssVar.colorTextQuaternary};\n\n &:hover {\n background: ${cssVar.colorTextTertiary};\n }\n `,\n count: css`\n pointer-events: none;\n\n position: absolute;\n inset-block-end: 6px;\n inset-inline-end: 8px;\n\n display: inline-flex;\n align-items: center;\n\n height: 20px;\n padding-inline: 8px;\n border-radius: 999px;\n\n font-size: 11px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n color: ${cssVar.colorTextSecondary};\n\n background: ${cssVar.colorFillTertiary};\n\n &[data-over] {\n color: ${cssVar.colorWhite};\n background: ${cssVar.colorError};\n }\n `,\n textareaClear: css`\n position: absolute;\n inset-block-start: 10px;\n inset-inline-end: 10px;\n `,\n textareaWithCount: css`\n padding-block-end: 30px;\n `,\n borderless: css`\n border: 1px solid transparent;\n background: none;\n `,\n filled: css`\n border: 1px solid transparent;\n background: ${cssVar.colorFillTertiary};\n\n &:hover:not(:focus-within, [data-disabled]) {\n background: ${cssVar.colorFillSecondary};\n }\n `,\n input: css`\n flex: 1;\n\n min-width: 0;\n padding: 0;\n border: none;\n\n font: inherit;\n color: inherit;\n\n appearance: none;\n background: transparent;\n outline: none;\n\n &::placeholder {\n color: ${cssVar.colorTextPlaceholder};\n }\n\n /* the root shows focus via its border; outrank global :focus-visible rings */\n &:focus-visible {\n outline: none;\n }\n `,\n invalid: css`\n &:has([data-invalid], [aria-invalid='true']) {\n border-color: ${cssVar.colorError};\n\n &:focus-within {\n border-color: ${cssVar.colorError};\n box-shadow: 0 0 0 2px ${cssVar.colorErrorBg};\n }\n }\n `,\n outlined: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: ${cssVar.colorBgContainer};\n\n &:hover:not(:focus-within, [data-disabled]) {\n border-color: ${cssVar.colorBorder};\n }\n\n &:focus-within {\n border-color: ${cssVar.colorPrimary};\n box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};\n }\n `,\n root: css`\n cursor: text;\n\n display: inline-flex;\n gap: 8px;\n align-items: center;\n\n box-sizing: border-box;\n width: 100%;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadius};\n\n font-size: 14px;\n color: ${cssVar.colorText};\n\n transition:\n background 150ms ${cssVar.motionEaseOut},\n border-color 150ms ${cssVar.motionEaseOut},\n box-shadow 150ms ${cssVar.motionEaseOut};\n\n &[data-disabled],\n &:has(:disabled) {\n cursor: not-allowed;\n color: ${cssVar.colorTextQuaternary};\n opacity: 0.66;\n }\n\n &:hover [data-lobe-input-clear],\n &:focus-within [data-lobe-input-clear] {\n visibility: visible;\n }\n `,\n shadow: lobeStaticStylish.shadow,\n sizeLarge: css`\n min-height: ${controlHeight.large}px;\n border-radius: ${cssVar.borderRadiusLG};\n font-size: 16px;\n `,\n sizeMiddle: css`\n min-height: ${controlHeight.middle}px;\n `,\n sizeSmall: css`\n min-height: ${controlHeight.small}px;\n padding-inline: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n font-size: 12px;\n `,\n numberControl: css`\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 20px;\n height: 13px;\n margin: 0;\n padding: 0;\n border: none;\n border-radius: 4px;\n\n color: ${cssVar.colorTextTertiary};\n\n background: none;\n outline: none;\n\n transition:\n color 150ms ${cssVar.motionEaseOut},\n background 150ms ${cssVar.motionEaseOut};\n\n &:hover:not(:disabled) {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillSecondary};\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.3;\n }\n `,\n numberControlLarge: css`\n width: 22px;\n height: 15px;\n `,\n numberControlSmall: css`\n width: 16px;\n height: 10px;\n border-radius: 3px;\n `,\n numberControls: css`\n display: flex;\n flex: none;\n flex-direction: column;\n margin-inline-end: -6px;\n `,\n numberControlsSmall: css`\n margin-inline-end: -4px;\n `,\n numberInput: css`\n font-variant-numeric: tabular-nums;\n `,\n otpCell: css`\n flex: none;\n width: ${controlHeight.middle}px;\n padding-inline: 0;\n text-align: center;\n `,\n otpRoot: css`\n display: inline-flex;\n gap: 8px;\n align-items: center;\n `,\n passwordToggle: css`\n cursor: pointer;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: 0;\n border: none;\n\n color: ${cssVar.colorTextTertiary};\n\n background: none;\n outline: none;\n\n transition: color 150ms ${cssVar.motionEaseOut};\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n slot: css`\n display: inline-flex;\n flex: none;\n align-items: center;\n color: ${cssVar.colorTextTertiary};\n `,\n textarea: css`\n position: relative;\n height: auto;\n padding-block: 8px;\n\n textarea {\n resize: none;\n min-height: calc(1.5em * var(--textarea-min-rows, 2));\n max-height: var(--textarea-max-height, none);\n line-height: 1.5;\n }\n `,\n textareaAutoSize: css`\n textarea {\n field-sizing: content;\n }\n `,\n textareaResize: css`\n textarea {\n resize: vertical;\n }\n `,\n}));\n\nexport const rootVariants = cva([styles.root, styles.invalid], {\n defaultVariants: {\n shadow: false,\n size: 'middle',\n variant: 'outlined',\n },\n variants: {\n shadow: {\n false: null,\n true: styles.shadow,\n },\n size: {\n large: styles.sizeLarge,\n middle: styles.sizeMiddle,\n small: styles.sizeSmall,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n },\n },\n});\n"],"mappings":";;;;;AAMA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,OAAO,GAAG;;;;;;;;;;;;;;aAcC,OAAO,iBAAiB;;;kBAGnB,OAAO,oBAAoB;;;oBAGzB,OAAO,kBAAkB;;;CAG3C,OAAO,GAAG;;;;;;;;;;;;;;;;;aAiBC,OAAO,mBAAmB;;kBAErB,OAAO,kBAAkB;;;eAG5B,OAAO,WAAW;oBACb,OAAO,WAAW;;;CAGpC,eAAe,GAAG;;;;;CAKlB,mBAAmB,GAAG;;;CAGtB,YAAY,GAAG;;;;CAIf,QAAQ,GAAG;;kBAEK,OAAO,kBAAkB;;;oBAGvB,OAAO,mBAAmB;;;CAG5C,OAAO,GAAG;;;;;;;;;;;;;;;eAeG,OAAO,qBAAqB;;;;;;;;CAQzC,SAAS,GAAG;;sBAEQ,OAAO,WAAW;;;wBAGhB,OAAO,WAAW;gCACV,OAAO,aAAa;;;;CAIlD,UAAU,GAAG;wBACS,OAAO,qBAAqB;kBAClC,OAAO,iBAAiB;;;sBAGpB,OAAO,YAAY;;;;sBAInB,OAAO,aAAa;8BACZ,OAAO,eAAe;;;CAGlD,MAAM,GAAG;;;;;;;;;;qBAUU,OAAO,aAAa;;;aAG5B,OAAO,UAAU;;;yBAGL,OAAO,cAAc;2BACnB,OAAO,cAAc;yBACvB,OAAO,cAAc;;;;;eAK/B,OAAO,oBAAoB;;;;;;;;;CASxC,QAAQA,cAAkB;CAC1B,WAAW,GAAG;kBACE,cAAc,MAAM;qBACjB,OAAO,eAAe;;;CAGzC,YAAY,GAAG;kBACC,cAAc,OAAO;;CAErC,WAAW,GAAG;kBACE,cAAc,MAAM;;qBAEjB,OAAO,eAAe;;;CAGzC,eAAe,GAAG;;;;;;;;;;;;;;aAcP,OAAO,kBAAkB;;;;;;oBAMlB,OAAO,cAAc;yBAChB,OAAO,cAAc;;;eAG/B,OAAO,UAAU;oBACZ,OAAO,mBAAmB;;;;;;;;CAQ5C,oBAAoB,GAAG;;;;CAIvB,oBAAoB,GAAG;;;;;CAKvB,gBAAgB,GAAG;;;;;;CAMnB,qBAAqB,GAAG;;;CAGxB,aAAa,GAAG;;;CAGhB,SAAS,GAAG;;aAED,cAAc,OAAO;;;;CAIhC,SAAS,GAAG;;;;;CAKZ,gBAAgB,GAAG;;;;;;;;;;;aAWR,OAAO,kBAAkB;;;;;8BAKR,OAAO,cAAc;;;eAGpC,OAAO,UAAU;;;CAG9B,MAAM,GAAG;;;;aAIE,OAAO,kBAAkB;;CAEpC,UAAU,GAAG;;;;;;;;;;;;CAYb,kBAAkB,GAAG;;;;;CAKrB,gBAAgB,GAAG;;;;;AAKrB,EAAE;AAEF,MAAa,eAAe,IAAI,CAAC,OAAO,MAAM,OAAO,OAAO,GAAG;CAC7D,iBAAiB;EACf,QAAQ;EACR,MAAM;EACN,SAAS;CACX;CACA,UAAU;EACR,QAAQ;GACN,OAAO;GACP,MAAM,OAAO;EACf;EACA,MAAM;GACJ,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,OAAO,OAAO;EAChB;EACA,SAAS;GACP,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,UAAU,OAAO;EACnB;CACF;AACF,CAAC"}
|
|
@@ -102,14 +102,10 @@ const Modal = memo(({ open, title, children, onOk, onCancel, okText = "OK", canc
|
|
|
102
102
|
onOk: handleOk
|
|
103
103
|
});
|
|
104
104
|
const defaultFooter = /* @__PURE__ */ jsxs(Fragment$1, { children: [cancelBtnNode, okBtnNode] });
|
|
105
|
-
if (typeof footer === "function") {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
CancelBtn: BoundCancelBtn,
|
|
110
|
-
OkBtn: BoundOkBtn
|
|
111
|
-
});
|
|
112
|
-
}
|
|
105
|
+
if (typeof footer === "function") return footer(defaultFooter, {
|
|
106
|
+
CancelBtn: () => cancelBtnNode,
|
|
107
|
+
OkBtn: () => okBtnNode
|
|
108
|
+
});
|
|
113
109
|
return footer ?? defaultFooter;
|
|
114
110
|
}, [
|
|
115
111
|
footer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","names":[],"sources":["../../../src/base-ui/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Maximize2, Minimize2, X } from 'lucide-react';\nimport { useDragControls } from 'motion/react';\nimport type { MouseEvent, PointerEvent } from 'react';\nimport type React from 'react';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { stopPropagation } from '@/utils/dom';\n\nimport { Button } from '../Button';\nimport {\n ModalBackdrop,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalPopup,\n ModalPortal,\n ModalRoot,\n ModalTitle,\n} from './atoms';\nimport { styles } from './style';\nimport type { ModalComponentProps } from './type';\n\ninterface OkBtnProps {\n confirmLoading?: boolean;\n okButtonProps?: ModalComponentProps['okButtonProps'];\n okText?: React.ReactNode;\n onOk: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst OkBtn: React.FC<OkBtnProps> = ({ confirmLoading, okButtonProps, okText, onOk }) => {\n const { onClick: userOnClick, ...restOk } = okButtonProps ?? {};\n return (\n <Button\n loading={confirmLoading}\n type=\"primary\"\n {...restOk}\n onClick={(e) => {\n onOk(e as MouseEvent<HTMLButtonElement>);\n userOnClick?.(e as never);\n }}\n >\n {okText}\n </Button>\n );\n};\ninterface CancelBtnProps {\n cancelButtonProps?: ModalComponentProps['cancelButtonProps'];\n cancelText?: React.ReactNode;\n onCancel: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst CancelBtn: React.FC<CancelBtnProps> = ({ cancelButtonProps, cancelText, onCancel }) => {\n const { onClick: userOnClick, ...restCancel } = cancelButtonProps ?? {};\n return (\n <Button\n {...restCancel}\n onClick={(e) => {\n onCancel(e as MouseEvent<HTMLButtonElement>);\n userOnClick?.(e as never);\n }}\n >\n {cancelText}\n </Button>\n );\n};\n\nconst Modal = memo<ModalComponentProps>(\n ({\n open,\n title,\n children,\n onOk,\n onCancel,\n okText = 'OK',\n cancelText = 'Cancel',\n okButtonProps,\n cancelButtonProps,\n confirmLoading,\n footer,\n width,\n height,\n maskClosable = true,\n closable = true,\n closeIcon,\n className,\n style,\n classNames,\n styles: semanticStyles,\n zIndex,\n afterClose,\n afterOpenChange,\n loading,\n getContainer,\n mask = true,\n keyboard,\n draggable = true,\n allowFullscreen = false,\n }) => {\n const dragControls = useDragControls();\n const constraintsRef = useRef<HTMLDivElement>(null);\n const [isFullscreen, setIsFullscreen] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [isDenying, setIsDenying] = useState(false);\n const denyTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(denyTimerRef.current), []);\n\n const triggerDeny = useCallback(() => {\n clearTimeout(denyTimerRef.current);\n setIsDenying(true);\n denyTimerRef.current = setTimeout(() => setIsDenying(false), 300);\n }, []);\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean, eventDetails: { reason: string }) => {\n if (!open) return;\n if (!nextOpen && keyboard === false && eventDetails.reason === 'escape-key') return;\n if (!nextOpen && !maskClosable && eventDetails.reason === 'outside-press') {\n triggerDeny();\n return;\n }\n if (!nextOpen) {\n onCancel?.(new MouseEvent('click') as unknown as MouseEvent<HTMLButtonElement>);\n }\n },\n [onCancel, keyboard, maskClosable, open, triggerDeny],\n );\n\n const handleExitComplete = useCallback(() => {\n setIsFullscreen(false);\n afterClose?.();\n afterOpenChange?.(false);\n }, [afterClose, afterOpenChange]);\n\n const handleAnimationComplete = useCallback(() => {\n if (open) afterOpenChange?.(true);\n }, [open, afterOpenChange]);\n\n const handleDragStart = useCallback(\n (e: PointerEvent) => {\n if (draggable && !isFullscreen) {\n dragControls.start(e);\n setIsDragging(true);\n }\n },\n [draggable, dragControls, isFullscreen],\n );\n\n const handleDragEnd = useCallback(() => {\n setIsDragging(false);\n }, []);\n\n const handleOk = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onOk?.(e);\n },\n [onOk],\n );\n\n const handleCancel = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onCancel?.(e);\n },\n [onCancel],\n );\n\n const footerNode = useMemo(() => {\n if (footer === false || footer === null) return null;\n const cancelBtnNode = (\n <CancelBtn\n cancelButtonProps={cancelButtonProps}\n cancelText={cancelText}\n onCancel={handleCancel}\n />\n );\n const okBtnNode = (\n <OkBtn\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n okText={okText}\n onOk={handleOk}\n />\n );\n const defaultFooter = (\n <>\n {cancelBtnNode}\n {okBtnNode}\n </>\n );\n\n if (typeof footer === 'function') {\n const BoundCancelBtn: React.FC = () => cancelBtnNode;\n const BoundOkBtn: React.FC = () => okBtnNode;\n return footer(defaultFooter, { CancelBtn: BoundCancelBtn, OkBtn: BoundOkBtn });\n }\n\n return footer ?? defaultFooter;\n }, [\n footer,\n cancelButtonProps,\n cancelText,\n handleCancel,\n confirmLoading,\n okButtonProps,\n okText,\n handleOk,\n ]);\n\n const container = getContainer === false ? undefined : (getContainer ?? undefined);\n\n const shouldDrag = draggable && !isFullscreen;\n const dragProps = shouldDrag\n ? {\n drag: true as const,\n dragConstraints: constraintsRef,\n dragControls,\n dragElastic: 0,\n dragListener: false,\n dragMomentum: false,\n whileDrag: { cursor: 'grabbing' as const },\n }\n : {};\n\n const showTitle = title !== undefined && title !== false && title !== null;\n const showHeader = showTitle || closable || allowFullscreen;\n\n const hasHeight = height !== undefined;\n const panelStyle: React.CSSProperties = {\n ...(hasHeight && !isFullscreen ? { height } : {}),\n ...style,\n };\n\n return (\n <ModalRoot\n open={open ?? false}\n zIndex={zIndex}\n onExitComplete={handleExitComplete}\n onOpenChange={handleOpenChange}\n >\n <ModalPortal container={container}>\n {mask && <ModalBackdrop className={classNames?.mask} style={semanticStyles?.mask} />}\n <ModalPopup\n className={classNames?.wrapper}\n popupStyle={semanticStyles?.wrapper}\n ref={constraintsRef}\n style={panelStyle}\n width={isFullscreen ? undefined : width}\n motionProps={{\n ...dragProps,\n onAnimationComplete: handleAnimationComplete,\n }}\n panelClassName={cx(\n className,\n isFullscreen && styles.fullscreenPopupInner,\n isDenying && styles.denyAnimation,\n )}\n >\n {showHeader && (\n <ModalHeader\n className={cx(classNames?.header, shouldDrag && styles.headerDraggable)}\n style={{\n ...(isDragging ? { cursor: 'grabbing' } : {}),\n ...semanticStyles?.header,\n }}\n onPointerCancel={handleDragEnd}\n onPointerDown={handleDragStart}\n onPointerUp={handleDragEnd}\n >\n {showTitle ? (\n <ModalTitle className={classNames?.title} style={semanticStyles?.title}>\n {title}\n </ModalTitle>\n ) : (\n <span />\n )}\n <div className={styles.headerActions} onPointerDown={stopPropagation}>\n {allowFullscreen && (\n <button\n aria-label={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n className={styles.fullscreenToggle}\n type=\"button\"\n onClick={() => setIsFullscreen((prev) => !prev)}\n >\n {isFullscreen ? <Minimize2 size={14} /> : <Maximize2 size={14} />}\n </button>\n )}\n {closable && (\n <button\n aria-label=\"Close\"\n className={styles.closeInline}\n type=\"button\"\n onClick={handleCancel}\n >\n {closeIcon ?? <X size={16} />}\n </button>\n )}\n </div>\n </ModalHeader>\n )}\n <ModalContent\n className={cx(!showHeader && styles.contentNoHeader, classNames?.body)}\n style={{\n ...(hasHeight || isFullscreen ? { flex: 1 } : {}),\n ...semanticStyles?.body,\n }}\n >\n {loading ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n padding: '32px 0',\n }}\n >\n <span className={styles.loadingSpinner} style={{ height: 24, width: 24 }} />\n </div>\n ) : (\n children\n )}\n </ModalContent>\n {footerNode !== null && (\n <ModalFooter className={classNames?.footer} style={semanticStyles?.footer}>\n {footerNode}\n </ModalFooter>\n )}\n </ModalPopup>\n </ModalPortal>\n </ModalRoot>\n );\n },\n);\n\nModal.displayName = 'Modal';\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;AAgCA,MAAM,SAA+B,EAAE,gBAAgB,eAAe,QAAQ,WAAW;CACvF,MAAM,EAAE,SAAS,aAAa,GAAG,WAAW,iBAAiB,CAAC;CAC9D,OACE,oBAAC,QAAD;EACE,SAAS;EACT,MAAK;EACL,GAAI;EACJ,UAAU,MAAM;GACd,KAAK,CAAkC;GACvC,cAAc,CAAU;EAC1B;EAEC,UAAA;CACK,CAAA;AAEZ;AAOA,MAAM,aAAuC,EAAE,mBAAmB,YAAY,eAAe;CAC3F,MAAM,EAAE,SAAS,aAAa,GAAG,eAAe,qBAAqB,CAAC;CACtE,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,UAAU,MAAM;GACd,SAAS,CAAkC;GAC3C,cAAc,CAAU;EAC1B;EAEC,UAAA;CACK,CAAA;AAEZ;AAEA,MAAM,QAAQ,MACX,EACC,MACA,OACA,UACA,MACA,UACA,SAAS,MACT,aAAa,UACb,eACA,mBACA,gBACA,QACA,OACA,QACA,eAAe,MACf,WAAW,MACX,WACA,WACA,OACA,YACA,QAAQ,gBACR,QACA,YACA,iBACA,SACA,cACA,OAAO,MACP,UACA,YAAY,MACZ,kBAAkB,YACd;CACJ,MAAM,eAAe,gBAAgB;CACrC,MAAM,iBAAiB,OAAuB,IAAI;CAClD,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CACtD,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,eAAe,OAAkD,KAAA,CAAS;CAEhF,sBAAsB,aAAa,aAAa,OAAO,GAAG,CAAC,CAAC;CAE5D,MAAM,cAAc,kBAAkB;EACpC,aAAa,aAAa,OAAO;EACjC,aAAa,IAAI;EACjB,aAAa,UAAU,iBAAiB,aAAa,KAAK,GAAG,GAAG;CAClE,GAAG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AA,CAUG,YACC,oBAAC,YAAD;OAAY,WAAW,YAAY;OAAO,OAAO,gBAAgB;OAC9D,UAAA;MACS,CAAA,IAEZ,oBAAC,QAAD,CAAO,CAAA,GAET,qBAAC,OAAD;OAAK,WAAW,OAAO;OAAe,eAAe;OAArD,UAAA,CACG,mBACC,oBAAC,UAAD;QACE,cAAY,eAAe,oBAAoB;QAC/C,WAAW,OAAO;QAClB,MAAK;QACL,eAAe,iBAAiB,SAAS,CAAC,IAAI;QAE7C,UAAA,eAAe,oBAAC,WAAD,EAAW,MAAM,GAAK,CAAA,IAAI,oBAAC,WAAD,EAAW,MAAM,GAAK,CAAA;OAC1D,CAAA,GAET,YACC,oBAAC,UAAD;QACE,cAAW;QACX,WAAW,OAAO;QAClB,MAAK;QACL,SAAS;QAER,UAAA,aAAa,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;OACtB,CAAA,CAEP;MACM,CAAA,CAAA;;KAEf,oBAAC,cAAD;MACE,WAAW,GAAG,CAAC,cAAc,OAAO,iBAAiB,YAAY,IAAI;MACrE,OAAO;OACL,GAAI,aAAa,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC;OAC/C,GAAG,gBAAgB;MACrB;MAEC,UAAA,UACC,oBAAC,OAAD;OACE,OAAO;QACL,SAAS;QACT,gBAAgB;QAChB,SAAS;OACX;OAEA,UAAA,oBAAC,QAAD;QAAM,WAAW,OAAO;QAAgB,OAAO;SAAE,QAAQ;SAAI,OAAO;QAAG;OAAI,CAAA;MACxE,CAAA,IAEL;KAEU,CAAA;KACb,eAAe,QACd,oBAAC,aAAD;MAAa,WAAW,YAAY;MAAQ,OAAO,gBAAgB;MAChE,UAAA;KACU,CAAA;IAEL;GACD,CAAA,CAAA;;CACJ,CAAA;AAEf,CACF;AAEA,MAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"Modal.mjs","names":[],"sources":["../../../src/base-ui/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Maximize2, Minimize2, X } from 'lucide-react';\nimport { useDragControls } from 'motion/react';\nimport type { MouseEvent, PointerEvent } from 'react';\nimport type React from 'react';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { stopPropagation } from '@/utils/dom';\n\nimport { Button } from '../Button';\nimport {\n ModalBackdrop,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalPopup,\n ModalPortal,\n ModalRoot,\n ModalTitle,\n} from './atoms';\nimport { styles } from './style';\nimport type { ModalComponentProps } from './type';\n\ninterface OkBtnProps {\n confirmLoading?: boolean;\n okButtonProps?: ModalComponentProps['okButtonProps'];\n okText?: React.ReactNode;\n onOk: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst OkBtn: React.FC<OkBtnProps> = ({ confirmLoading, okButtonProps, okText, onOk }) => {\n const { onClick: userOnClick, ...restOk } = okButtonProps ?? {};\n return (\n <Button\n loading={confirmLoading}\n type=\"primary\"\n {...restOk}\n onClick={(e) => {\n onOk(e as MouseEvent<HTMLButtonElement>);\n userOnClick?.(e as never);\n }}\n >\n {okText}\n </Button>\n );\n};\ninterface CancelBtnProps {\n cancelButtonProps?: ModalComponentProps['cancelButtonProps'];\n cancelText?: React.ReactNode;\n onCancel: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst CancelBtn: React.FC<CancelBtnProps> = ({ cancelButtonProps, cancelText, onCancel }) => {\n const { onClick: userOnClick, ...restCancel } = cancelButtonProps ?? {};\n return (\n <Button\n {...restCancel}\n onClick={(e) => {\n onCancel(e as MouseEvent<HTMLButtonElement>);\n userOnClick?.(e as never);\n }}\n >\n {cancelText}\n </Button>\n );\n};\n\nconst Modal = memo<ModalComponentProps>(\n ({\n open,\n title,\n children,\n onOk,\n onCancel,\n okText = 'OK',\n cancelText = 'Cancel',\n okButtonProps,\n cancelButtonProps,\n confirmLoading,\n footer,\n width,\n height,\n maskClosable = true,\n closable = true,\n closeIcon,\n className,\n style,\n classNames,\n styles: semanticStyles,\n zIndex,\n afterClose,\n afterOpenChange,\n loading,\n getContainer,\n mask = true,\n keyboard,\n draggable = true,\n allowFullscreen = false,\n }) => {\n const dragControls = useDragControls();\n const constraintsRef = useRef<HTMLDivElement>(null);\n const [isFullscreen, setIsFullscreen] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [isDenying, setIsDenying] = useState(false);\n const denyTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(denyTimerRef.current), []);\n\n const triggerDeny = useCallback(() => {\n clearTimeout(denyTimerRef.current);\n setIsDenying(true);\n denyTimerRef.current = setTimeout(() => setIsDenying(false), 300);\n }, []);\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean, eventDetails: { reason: string }) => {\n if (!open) return;\n if (!nextOpen && keyboard === false && eventDetails.reason === 'escape-key') return;\n if (!nextOpen && !maskClosable && eventDetails.reason === 'outside-press') {\n triggerDeny();\n return;\n }\n if (!nextOpen) {\n onCancel?.(new MouseEvent('click') as unknown as MouseEvent<HTMLButtonElement>);\n }\n },\n [onCancel, keyboard, maskClosable, open, triggerDeny],\n );\n\n const handleExitComplete = useCallback(() => {\n setIsFullscreen(false);\n afterClose?.();\n afterOpenChange?.(false);\n }, [afterClose, afterOpenChange]);\n\n const handleAnimationComplete = useCallback(() => {\n if (open) afterOpenChange?.(true);\n }, [open, afterOpenChange]);\n\n const handleDragStart = useCallback(\n (e: PointerEvent) => {\n if (draggable && !isFullscreen) {\n dragControls.start(e);\n setIsDragging(true);\n }\n },\n [draggable, dragControls, isFullscreen],\n );\n\n const handleDragEnd = useCallback(() => {\n setIsDragging(false);\n }, []);\n\n const handleOk = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onOk?.(e);\n },\n [onOk],\n );\n\n const handleCancel = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n onCancel?.(e);\n },\n [onCancel],\n );\n\n const footerNode = useMemo(() => {\n if (footer === false || footer === null) return null;\n const cancelBtnNode = (\n <CancelBtn\n cancelButtonProps={cancelButtonProps}\n cancelText={cancelText}\n onCancel={handleCancel}\n />\n );\n const okBtnNode = (\n <OkBtn\n confirmLoading={confirmLoading}\n okButtonProps={okButtonProps}\n okText={okText}\n onOk={handleOk}\n />\n );\n const defaultFooter = (\n <>\n {cancelBtnNode}\n {okBtnNode}\n </>\n );\n\n if (typeof footer === 'function') {\n return footer(defaultFooter, { CancelBtn: () => cancelBtnNode, OkBtn: () => okBtnNode });\n }\n\n return footer ?? defaultFooter;\n }, [\n footer,\n cancelButtonProps,\n cancelText,\n handleCancel,\n confirmLoading,\n okButtonProps,\n okText,\n handleOk,\n ]);\n\n const container = getContainer === false ? undefined : (getContainer ?? undefined);\n\n const shouldDrag = draggable && !isFullscreen;\n const dragProps = shouldDrag\n ? {\n drag: true as const,\n dragConstraints: constraintsRef,\n dragControls,\n dragElastic: 0,\n dragListener: false,\n dragMomentum: false,\n whileDrag: { cursor: 'grabbing' as const },\n }\n : {};\n\n const showTitle = title !== undefined && title !== false && title !== null;\n const showHeader = showTitle || closable || allowFullscreen;\n\n const hasHeight = height !== undefined;\n const panelStyle: React.CSSProperties = {\n ...(hasHeight && !isFullscreen ? { height } : {}),\n ...style,\n };\n\n return (\n <ModalRoot\n open={open ?? false}\n zIndex={zIndex}\n onExitComplete={handleExitComplete}\n onOpenChange={handleOpenChange}\n >\n <ModalPortal container={container}>\n {mask && <ModalBackdrop className={classNames?.mask} style={semanticStyles?.mask} />}\n <ModalPopup\n className={classNames?.wrapper}\n popupStyle={semanticStyles?.wrapper}\n ref={constraintsRef}\n style={panelStyle}\n width={isFullscreen ? undefined : width}\n motionProps={{\n ...dragProps,\n onAnimationComplete: handleAnimationComplete,\n }}\n panelClassName={cx(\n className,\n isFullscreen && styles.fullscreenPopupInner,\n isDenying && styles.denyAnimation,\n )}\n >\n {showHeader && (\n <ModalHeader\n className={cx(classNames?.header, shouldDrag && styles.headerDraggable)}\n style={{\n ...(isDragging ? { cursor: 'grabbing' } : {}),\n ...semanticStyles?.header,\n }}\n onPointerCancel={handleDragEnd}\n onPointerDown={handleDragStart}\n onPointerUp={handleDragEnd}\n >\n {showTitle ? (\n <ModalTitle className={classNames?.title} style={semanticStyles?.title}>\n {title}\n </ModalTitle>\n ) : (\n <span />\n )}\n <div className={styles.headerActions} onPointerDown={stopPropagation}>\n {allowFullscreen && (\n <button\n aria-label={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}\n className={styles.fullscreenToggle}\n type=\"button\"\n onClick={() => setIsFullscreen((prev) => !prev)}\n >\n {isFullscreen ? <Minimize2 size={14} /> : <Maximize2 size={14} />}\n </button>\n )}\n {closable && (\n <button\n aria-label=\"Close\"\n className={styles.closeInline}\n type=\"button\"\n onClick={handleCancel}\n >\n {closeIcon ?? <X size={16} />}\n </button>\n )}\n </div>\n </ModalHeader>\n )}\n <ModalContent\n className={cx(!showHeader && styles.contentNoHeader, classNames?.body)}\n style={{\n ...(hasHeight || isFullscreen ? { flex: 1 } : {}),\n ...semanticStyles?.body,\n }}\n >\n {loading ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n padding: '32px 0',\n }}\n >\n <span className={styles.loadingSpinner} style={{ height: 24, width: 24 }} />\n </div>\n ) : (\n children\n )}\n </ModalContent>\n {footerNode !== null && (\n <ModalFooter className={classNames?.footer} style={semanticStyles?.footer}>\n {footerNode}\n </ModalFooter>\n )}\n </ModalPopup>\n </ModalPortal>\n </ModalRoot>\n );\n },\n);\n\nModal.displayName = 'Modal';\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;AAgCA,MAAM,SAA+B,EAAE,gBAAgB,eAAe,QAAQ,WAAW;CACvF,MAAM,EAAE,SAAS,aAAa,GAAG,WAAW,iBAAiB,CAAC;CAC9D,OACE,oBAAC,QAAD;EACE,SAAS;EACT,MAAK;EACL,GAAI;EACJ,UAAU,MAAM;GACd,KAAK,CAAkC;GACvC,cAAc,CAAU;EAC1B;EAEC,UAAA;CACK,CAAA;AAEZ;AAOA,M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ACC,oBAAC,UAAD;QACE,cAAW;QACX,WAAW,OAAO;QAClB,MAAK;QACL,SAAS;QAER,UAAA,aAAa,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;OACtB,CAAA,CAEP;MACM,CAAA,CAAA;;KAEf,oBAAC,cAAD;MACE,WAAW,GAAG,CAAC,cAAc,OAAO,iBAAiB,YAAY,IAAI;MACrE,OAAO;OACL,GAAI,aAAa,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC;OAC/C,GAAG,gBAAgB;MACrB;MAEC,UAAA,UACC,oBAAC,OAAD;OACE,OAAO;QACL,SAAS;QACT,gBAAgB;QAChB,SAAS;OACX;OAEA,UAAA,oBAAC,QAAD;QAAM,WAAW,OAAO;QAAgB,OAAO;SAAE,QAAQ;SAAI,OAAO;QAAG;OAAI,CAAA;MACxE,CAAA,IAEL;KAEU,CAAA;KACb,eAAe,QACd,oBAAC,aAAD;MAAa,WAAW,YAAY;MAAQ,OAAO,gBAAgB;MAChE,UAAA;KACU,CAAA;IAEL;GACD,CAAA,CAAA;;CACJ,CAAA;AAEf,CACF;AAEA,MAAM,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
-
import
|
|
3
|
+
import InputNumber_default from "../Input/InputNumber.mjs";
|
|
4
4
|
import Slider from "./Slider.mjs";
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -35,7 +35,7 @@ const SliderWithInput = memo(({ step, value, onChange, max, min, defaultValue, s
|
|
|
35
35
|
value,
|
|
36
36
|
onChange: handleChange,
|
|
37
37
|
...rest
|
|
38
|
-
}), /* @__PURE__ */ jsx(
|
|
38
|
+
}), /* @__PURE__ */ jsx(InputNumber_default, {
|
|
39
39
|
changeOnWheel,
|
|
40
40
|
className: inputClassName,
|
|
41
41
|
controls: size !== "small" && controls !== false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderWithInput.mjs","names":["Flexbox"],"sources":["../../../src/base-ui/Slider/SliderWithInput.tsx"],"sourcesContent":["'use client';\n\nimport { isNull } from 'es-toolkit/compat';\nimport { memo } from 'react';\n\nimport { InputNumber } from '@/base-ui/Input';\nimport { Flexbox } from '@/Flex';\n\nimport Slider from './Slider';\nimport type { SliderWithInputProps } from './type';\n\nconst SliderWithInput = memo<SliderWithInputProps>(\n ({\n step,\n value,\n onChange,\n max,\n min,\n defaultValue,\n size,\n controls,\n gap = 16,\n style,\n className,\n classNames,\n styles: customStyles,\n disabled,\n unlimitedInput = false,\n changeOnWheel,\n shadow,\n variant,\n ...rest\n }) => {\n const handleChange = (next: number | null) => {\n if (isNull(next) || Number.isNaN(next)) return;\n onChange?.(next);\n };\n\n const {\n slider: sliderClassName,\n input: inputClassName,\n ...sliderPartClassNames\n } = classNames || {};\n const { slider: sliderStyle, input: inputStyle, ...sliderPartStyles } = customStyles || {};\n\n return (\n <Flexbox horizontal align={'center'} className={className} gap={gap} style={style}>\n <Slider\n className={sliderClassName}\n classNames={sliderPartClassNames}\n defaultValue={defaultValue}\n disabled={disabled}\n max={max}\n min={min}\n step={step}\n style={{ flex: 1, ...sliderStyle }}\n styles={sliderPartStyles}\n value={value}\n onChange={handleChange}\n {...rest}\n />\n <InputNumber\n changeOnWheel={changeOnWheel}\n className={inputClassName}\n controls={size !== 'small' && controls !== false}\n defaultValue={defaultValue}\n disabled={disabled}\n max={unlimitedInput ? undefined : max}\n min={min}\n shadow={shadow}\n size={size}\n step={step === undefined || Number.isNaN(step) ? undefined : step}\n value={value}\n variant={variant}\n style={{\n flex: 'none',\n width: size === 'small' ? 48 : 88,\n ...inputStyle,\n }}\n onChange={handleChange}\n />\n </Flexbox>\n );\n },\n);\n\nSliderWithInput.displayName = 'SliderWithInput';\n\nexport default SliderWithInput;\n"],"mappings":";;;;;;;;AAWA,MAAM,kBAAkB,MACrB,EACC,MACA,OACA,UACA,KACA,KACA,cACA,MACA,UACA,MAAM,IACN,OACA,WACA,YACA,QAAQ,cACR,UACA,iBAAiB,OACjB,eACA,QACA,SACA,GAAG,WACC;CACJ,MAAM,gBAAgB,SAAwB;EAC5C,IAAI,OAAO,IAAI,KAAK,OAAO,MAAM,IAAI,GAAG;EACxC,WAAW,IAAI;CACjB;CAEA,MAAM,EACJ,QAAQ,iBACR,OAAO,gBACP,GAAG,yBACD,cAAc,CAAC;CACnB,MAAM,EAAE,QAAQ,aAAa,OAAO,YAAY,GAAG,qBAAqB,gBAAgB,CAAC;CAEzF,OACE,qBAACA,mBAAD;EAAS,YAAA;EAAW,OAAO;EAAqB;EAAgB;EAAY;EAA5E,UAAA,CACE,oBAAC,QAAD;GACE,WAAW;GACX,YAAY;GACE;GACJ;GACL;GACA;GACC;GACN,OAAO;IAAE,MAAM;IAAG,GAAG;GAAY;GACjC,QAAQ;GACD;GACP,UAAU;GACV,GAAI;EACL,CAAA,GACD,
|
|
1
|
+
{"version":3,"file":"SliderWithInput.mjs","names":["Flexbox","InputNumber"],"sources":["../../../src/base-ui/Slider/SliderWithInput.tsx"],"sourcesContent":["'use client';\n\nimport { isNull } from 'es-toolkit/compat';\nimport { memo } from 'react';\n\nimport { InputNumber } from '@/base-ui/Input';\nimport { Flexbox } from '@/Flex';\n\nimport Slider from './Slider';\nimport type { SliderWithInputProps } from './type';\n\nconst SliderWithInput = memo<SliderWithInputProps>(\n ({\n step,\n value,\n onChange,\n max,\n min,\n defaultValue,\n size,\n controls,\n gap = 16,\n style,\n className,\n classNames,\n styles: customStyles,\n disabled,\n unlimitedInput = false,\n changeOnWheel,\n shadow,\n variant,\n ...rest\n }) => {\n const handleChange = (next: number | null) => {\n if (isNull(next) || Number.isNaN(next)) return;\n onChange?.(next);\n };\n\n const {\n slider: sliderClassName,\n input: inputClassName,\n ...sliderPartClassNames\n } = classNames || {};\n const { slider: sliderStyle, input: inputStyle, ...sliderPartStyles } = customStyles || {};\n\n return (\n <Flexbox horizontal align={'center'} className={className} gap={gap} style={style}>\n <Slider\n className={sliderClassName}\n classNames={sliderPartClassNames}\n defaultValue={defaultValue}\n disabled={disabled}\n max={max}\n min={min}\n step={step}\n style={{ flex: 1, ...sliderStyle }}\n styles={sliderPartStyles}\n value={value}\n onChange={handleChange}\n {...rest}\n />\n <InputNumber\n changeOnWheel={changeOnWheel}\n className={inputClassName}\n controls={size !== 'small' && controls !== false}\n defaultValue={defaultValue}\n disabled={disabled}\n max={unlimitedInput ? undefined : max}\n min={min}\n shadow={shadow}\n size={size}\n step={step === undefined || Number.isNaN(step) ? undefined : step}\n value={value}\n variant={variant}\n style={{\n flex: 'none',\n width: size === 'small' ? 48 : 88,\n ...inputStyle,\n }}\n onChange={handleChange}\n />\n </Flexbox>\n );\n },\n);\n\nSliderWithInput.displayName = 'SliderWithInput';\n\nexport default SliderWithInput;\n"],"mappings":";;;;;;;;AAWA,MAAM,kBAAkB,MACrB,EACC,MACA,OACA,UACA,KACA,KACA,cACA,MACA,UACA,MAAM,IACN,OACA,WACA,YACA,QAAQ,cACR,UACA,iBAAiB,OACjB,eACA,QACA,SACA,GAAG,WACC;CACJ,MAAM,gBAAgB,SAAwB;EAC5C,IAAI,OAAO,IAAI,KAAK,OAAO,MAAM,IAAI,GAAG;EACxC,WAAW,IAAI;CACjB;CAEA,MAAM,EACJ,QAAQ,iBACR,OAAO,gBACP,GAAG,yBACD,cAAc,CAAC;CACnB,MAAM,EAAE,QAAQ,aAAa,OAAO,YAAY,GAAG,qBAAqB,gBAAgB,CAAC;CAEzF,OACE,qBAACA,mBAAD;EAAS,YAAA;EAAW,OAAO;EAAqB;EAAgB;EAAY;EAA5E,UAAA,CACE,oBAAC,QAAD;GACE,WAAW;GACX,YAAY;GACE;GACJ;GACL;GACA;GACC;GACN,OAAO;IAAE,MAAM;IAAG,GAAG;GAAY;GACjC,QAAQ;GACD;GACP,UAAU;GACV,GAAI;EACL,CAAA,GACD,oBAACC,qBAAD;GACiB;GACf,WAAW;GACX,UAAU,SAAS,WAAW,aAAa;GAC7B;GACJ;GACV,KAAK,iBAAiB,KAAA,IAAY;GAC7B;GACG;GACF;GACN,MAAM,SAAS,KAAA,KAAa,OAAO,MAAM,IAAI,IAAI,KAAA,IAAY;GACtD;GACE;GACT,OAAO;IACL,MAAM;IACN,OAAO,SAAS,UAAU,KAAK;IAC/B,GAAG;GACL;GACA,UAAU;EACX,CAAA,CACM;;AAEb,CACF;AAEA,gBAAgB,cAAc"}
|
|
@@ -4,7 +4,7 @@ import { styles } from "./style.mjs";
|
|
|
4
4
|
import { SwitchIcon, SwitchRoot, SwitchThumb } from "./atoms.mjs";
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { cx } from "antd-style";
|
|
7
|
+
import { cssVar, cx } from "antd-style";
|
|
8
8
|
import { Loader2 } from "lucide-react";
|
|
9
9
|
//#region src/base-ui/Switch/Switch.tsx
|
|
10
10
|
const Switch = memo(({ autoFocus, checked, checkedChildren, className, classNames, defaultChecked, defaultValue, disabled, id, loading, name, onChange, onClick, ref, rootClassName, size = "default", style, styles: customStyles, tabIndex, title, unCheckedChildren, value }) => {
|
|
@@ -52,7 +52,7 @@ const Switch = memo(({ autoFocus, checked, checkedChildren, className, className
|
|
|
52
52
|
className: styles.loading,
|
|
53
53
|
icon: Loader2,
|
|
54
54
|
size: size === "small" ? 8 : 12,
|
|
55
|
-
style: { color:
|
|
55
|
+
style: { color: cssVar.colorPrimary }
|
|
56
56
|
})
|
|
57
57
|
})
|
|
58
58
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","names":[],"sources":["../../../src/base-ui/Switch/Switch.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Loader2 } from 'lucide-react';\nimport { memo } from 'react';\n\nimport Icon from '@/Icon';\n\nimport { SwitchIcon, SwitchRoot, SwitchThumb } from './atoms';\nimport { styles } from './style';\nimport type { SwitchProps } from './type';\n\nconst Switch = memo<SwitchProps>(\n ({\n autoFocus,\n checked,\n checkedChildren,\n className,\n classNames,\n defaultChecked,\n defaultValue,\n disabled,\n id,\n loading,\n name,\n onChange,\n onClick,\n ref,\n rootClassName,\n size = 'default',\n style,\n styles: customStyles,\n tabIndex,\n title,\n unCheckedChildren,\n value,\n }) => {\n const isDisabled = disabled || loading;\n const resolvedChecked = value ?? checked;\n const resolvedDefaultChecked = defaultValue ?? defaultChecked;\n\n return (\n <SwitchRoot\n autoFocus={autoFocus}\n checked={resolvedChecked}\n className={cx(className, rootClassName, classNames?.root)}\n defaultChecked={resolvedDefaultChecked}\n disabled={isDisabled}\n id={id}\n name={name}\n ref={ref}\n size={size}\n style={{ ...style, ...customStyles?.root }}\n tabIndex={tabIndex}\n title={title}\n onCheckedChange={onChange}\n onClick={onClick}\n >\n {checkedChildren && (\n <SwitchIcon\n className={classNames?.content}\n position=\"left\"\n size={size}\n style={customStyles?.content}\n >\n {checkedChildren}\n </SwitchIcon>\n )}\n {unCheckedChildren && (\n <SwitchIcon\n className={classNames?.content}\n position=\"right\"\n size={size}\n style={customStyles?.content}\n >\n {unCheckedChildren}\n </SwitchIcon>\n )}\n <SwitchThumb className={classNames?.thumb} size={size} style={customStyles?.thumb}>\n {loading && (\n <Icon\n className={styles.loading}\n icon={Loader2}\n size={size === 'small' ? 8 : 12}\n style={{ color:
|
|
1
|
+
{"version":3,"file":"Switch.mjs","names":[],"sources":["../../../src/base-ui/Switch/Switch.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar, cx } from 'antd-style';\nimport { Loader2 } from 'lucide-react';\nimport { memo } from 'react';\n\nimport Icon from '@/Icon';\n\nimport { SwitchIcon, SwitchRoot, SwitchThumb } from './atoms';\nimport { styles } from './style';\nimport type { SwitchProps } from './type';\n\nconst Switch = memo<SwitchProps>(\n ({\n autoFocus,\n checked,\n checkedChildren,\n className,\n classNames,\n defaultChecked,\n defaultValue,\n disabled,\n id,\n loading,\n name,\n onChange,\n onClick,\n ref,\n rootClassName,\n size = 'default',\n style,\n styles: customStyles,\n tabIndex,\n title,\n unCheckedChildren,\n value,\n }) => {\n const isDisabled = disabled || loading;\n const resolvedChecked = value ?? checked;\n const resolvedDefaultChecked = defaultValue ?? defaultChecked;\n\n return (\n <SwitchRoot\n autoFocus={autoFocus}\n checked={resolvedChecked}\n className={cx(className, rootClassName, classNames?.root)}\n defaultChecked={resolvedDefaultChecked}\n disabled={isDisabled}\n id={id}\n name={name}\n ref={ref}\n size={size}\n style={{ ...style, ...customStyles?.root }}\n tabIndex={tabIndex}\n title={title}\n onCheckedChange={onChange}\n onClick={onClick}\n >\n {checkedChildren && (\n <SwitchIcon\n className={classNames?.content}\n position=\"left\"\n size={size}\n style={customStyles?.content}\n >\n {checkedChildren}\n </SwitchIcon>\n )}\n {unCheckedChildren && (\n <SwitchIcon\n className={classNames?.content}\n position=\"right\"\n size={size}\n style={customStyles?.content}\n >\n {unCheckedChildren}\n </SwitchIcon>\n )}\n <SwitchThumb className={classNames?.thumb} size={size} style={customStyles?.thumb}>\n {loading && (\n <Icon\n className={styles.loading}\n icon={Loader2}\n size={size === 'small' ? 8 : 12}\n style={{ color: cssVar.colorPrimary }}\n />\n )}\n </SwitchThumb>\n </SwitchRoot>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n\nexport default Switch;\n"],"mappings":";;;;;;;;;AAYA,MAAM,SAAS,MACZ,EACC,WACA,SACA,iBACA,WACA,YACA,gBACA,cACA,UACA,IACA,SACA,MACA,UACA,SACA,KACA,eACA,OAAO,WACP,OACA,QAAQ,cACR,UACA,OACA,mBACA,YACI;CACJ,MAAM,aAAa,YAAY;CAC/B,MAAM,kBAAkB,SAAS;CACjC,MAAM,yBAAyB,gBAAgB;CAE/C,OACE,qBAAC,YAAD;EACa;EACX,SAAS;EACT,WAAW,GAAG,WAAW,eAAe,YAAY,IAAI;EACxD,gBAAgB;EAChB,UAAU;EACN;EACE;EACD;EACC;EACN,OAAO;GAAE,GAAG;GAAO,GAAG,cAAc;EAAK;EAC/B;EACH;EACP,iBAAiB;EACR;EAdX,UAAA;GAgBG,mBACC,oBAAC,YAAD;IACE,WAAW,YAAY;IACvB,UAAS;IACH;IACN,OAAO,cAAc;IAEpB,UAAA;GACS,CAAA;GAEb,qBACC,oBAAC,YAAD;IACE,WAAW,YAAY;IACvB,UAAS;IACH;IACN,OAAO,cAAc;IAEpB,UAAA;GACS,CAAA;GAEd,oBAAC,aAAD;IAAa,WAAW,YAAY;IAAa;IAAM,OAAO,cAAc;IACzE,UAAA,WACC,oBAAC,MAAD;KACE,WAAW,OAAO;KAClB,MAAM;KACN,MAAM,SAAS,UAAU,IAAI;KAC7B,OAAO,EAAE,OAAO,OAAO,aAAa;IACrC,CAAA;GAEQ,CAAA;EACH;;AAEhB,CACF;AAEA,OAAO,cAAc"}
|
|
@@ -42,7 +42,7 @@ declare const variants: (props?: ({
|
|
|
42
42
|
mark?: boolean | null | undefined;
|
|
43
43
|
shiny?: boolean | null | undefined;
|
|
44
44
|
strong?: boolean | null | undefined;
|
|
45
|
-
type?: "danger" | "
|
|
45
|
+
type?: "danger" | "success" | "info" | "warning" | "secondary" | null | undefined;
|
|
46
46
|
underline?: boolean | null | undefined;
|
|
47
47
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
48
48
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import Icon from "../../Icon/Icon.mjs";
|
|
3
3
|
import { controlHeight } from "../controlSize.mjs";
|
|
4
|
-
import
|
|
4
|
+
import Checkbox_default from "../Checkbox/Checkbox.mjs";
|
|
5
5
|
import { styles } from "./style.mjs";
|
|
6
6
|
import { useTreeContext } from "./context.mjs";
|
|
7
7
|
import { hasChildren } from "./utils.mjs";
|
|
@@ -82,7 +82,7 @@ const TreeNode = memo(({ node, depth, isLast, trail }) => {
|
|
|
82
82
|
},
|
|
83
83
|
children: switcherIcon
|
|
84
84
|
}),
|
|
85
|
-
checkable && /* @__PURE__ */ jsx(
|
|
85
|
+
checkable && /* @__PURE__ */ jsx(Checkbox_default, {
|
|
86
86
|
checked: checkState === "checked",
|
|
87
87
|
className: styles.checkbox,
|
|
88
88
|
disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNode.mjs","names":["isExpandable"],"sources":["../../../src/base-ui/Tree/TreeNode.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible } from '@base-ui/react/collapsible';\nimport { cx } from 'antd-style';\nimport { ChevronRight, File, Folder } from 'lucide-react';\nimport { type CSSProperties, memo, type MouseEvent } from 'react';\n\nimport { Checkbox } from '@/base-ui/Checkbox';\nimport { controlHeight } from '@/base-ui/controlSize';\nimport Icon from '@/Icon';\n\nimport { useTreeContext } from './context';\nimport { styles } from './style';\nimport type { TreeDataNode } from './type';\nimport { hasChildren as isExpandable } from './utils';\n\ninterface TreeNodeProps {\n depth: number;\n isLast: boolean;\n node: TreeDataNode;\n trail: boolean[];\n}\n\nconst ARC = 6;\nconst SWITCHER_CENTER = 11.5;\n\nconst guidePath = (\n depth: number,\n isLast: boolean,\n trail: boolean[],\n indent: number,\n height: number,\n) => {\n const cx = (i: number) => i * indent + SWITCHER_CENTER;\n let d = '';\n trail.forEach((more, i) => {\n if (more && i > 0) d += `M${cx(i)} 0V${height}`;\n });\n const x = cx(depth - 1);\n const y = height / 2;\n const elbow = `M${x} ${y - ARC}A${ARC} ${ARC} 0 0 0 ${x + ARC} ${y}H${x + indent - 2}`;\n d += isLast\n ? `M${x} 0V${y - ARC}${elbow.slice(elbow.indexOf('A'))}`\n : `M${x} 0V${height}${elbow}`;\n return d;\n};\n\nconst TreeNode = memo<TreeNodeProps>(({ node, depth, isLast, trail }) => {\n const ctx = useTreeContext();\n const expandable = isExpandable(node);\n const expanded = expandable && ctx.expanded.has(node.key);\n const disabled = ctx.disabled || !!node.disabled;\n const checkable = ctx.checkable && node.checkable !== false;\n const checkState = ctx.checked.has(node.key)\n ? 'checked'\n : ctx.halfChecked.has(node.key)\n ? 'mixed'\n : 'unchecked';\n const rowHeight =\n typeof ctx.styles.node?.height === 'number' ? ctx.styles.node.height : controlHeight[ctx.size];\n\n const switcherIcon =\n typeof ctx.switcherIcon === 'function'\n ? ctx.switcherIcon({ expanded, node })\n : (ctx.switcherIcon ?? <Icon icon={ChevronRight} size={14} />);\n\n const rowStyle: CSSProperties = {\n height: rowHeight,\n paddingInlineStart: depth * ctx.indent,\n ...ctx.styles.node,\n };\n\n const select = (event: MouseEvent) => ctx.toggleSelect(node, event);\n\n return (\n <>\n <div\n data-scope-item\n aria-disabled={disabled || undefined}\n aria-expanded={expandable ? expanded : undefined}\n aria-level={depth + 1}\n aria-selected={ctx.selected.has(node.key)}\n data-id={node.key}\n role=\"treeitem\"\n style={rowStyle}\n tabIndex={ctx.activeKey === node.key ? 0 : -1}\n aria-checked={\n checkable ? (checkState === 'mixed' ? 'mixed' : checkState === 'checked') : undefined\n }\n className={cx(\n styles.node,\n ctx.blockNode && styles.nodeBlock,\n disabled && styles.nodeDisabled,\n ctx.classNames.node,\n )}\n onClick={ctx.blockNode ? select : undefined}\n onContextMenu={(event) => ctx.onRightClick(event, node)}\n onFocus={() => ctx.setActiveKey(node.key)}\n >\n {ctx.showLine && depth > 0 && (\n <svg\n aria-hidden\n className={cx(styles.guide, ctx.classNames.guide)}\n height={rowHeight}\n style={ctx.styles.guide}\n width={depth * ctx.indent}\n >\n <path d={guidePath(depth, isLast, trail, ctx.indent, rowHeight)} />\n </svg>\n )}\n <button\n aria-hidden\n style={ctx.styles.switcher}\n tabIndex={-1}\n type=\"button\"\n className={cx(\n styles.switcher,\n !expandable && styles.switcherLeaf,\n ctx.classNames.switcher,\n )}\n onClick={(event) => {\n event.stopPropagation();\n ctx.toggleExpand(node);\n }}\n >\n {switcherIcon}\n </button>\n {checkable && (\n <Checkbox\n checked={checkState === 'checked'}\n className={styles.checkbox}\n disabled={disabled}\n indeterminate={checkState === 'mixed'}\n onChange={() => ctx.toggleCheck(node)}\n onClick={(event) => event.stopPropagation()}\n />\n )}\n {ctx.showIcon && (\n <span className={styles.icon}>\n {node.icon ?? <Icon icon={expandable ? Folder : File} size={16} />}\n </span>\n )}\n <span\n style={ctx.styles.title}\n className={cx(\n styles.title,\n ctx.blockNode ? styles.titleBlock : styles.titleInline,\n ctx.classNames.title,\n )}\n onClick={ctx.blockNode ? undefined : select}\n >\n {ctx.titleRender ? ctx.titleRender(node) : node.title}\n </span>\n </div>\n {expandable && (\n <Collapsible.Root open={expanded}>\n <Collapsible.Panel className={styles.panel}>\n {node.children!.map((child, i) => (\n <TreeNode\n depth={depth + 1}\n isLast={i === node.children!.length - 1}\n key={child.key}\n node={child}\n trail={[...trail, !isLast]}\n />\n ))}\n </Collapsible.Panel>\n </Collapsible.Root>\n )}\n </>\n );\n});\n\nTreeNode.displayName = 'TreeNode';\n\nexport default TreeNode;\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAM,MAAM;AACZ,MAAM,kBAAkB;AAExB,MAAM,aACJ,OACA,QACA,OACA,QACA,WACG;CACH,MAAM,MAAM,MAAc,IAAI,SAAS;CACvC,IAAI,IAAI;CACR,MAAM,SAAS,MAAM,MAAM;EACzB,IAAI,QAAQ,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,EAAE,KAAK;CACzC,CAAC;CACD,MAAM,IAAI,GAAG,QAAQ,CAAC;CACtB,MAAM,IAAI,SAAS;CACnB,MAAM,QAAQ,IAAI,EAAE,GAAG,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,SAAS,IAAI,IAAI,GAAG,EAAE,GAAG,IAAI,SAAS;CACnF,KAAK,SACD,IAAI,EAAE,KAAK,IAAI,MAAM,MAAM,MAAM,MAAM,QAAQ,GAAG,CAAC,MACnD,IAAI,EAAE,KAAK,SAAS;CACxB,OAAO;AACT;AAEA,MAAM,WAAW,MAAqB,EAAE,MAAM,OAAO,QAAQ,YAAY;CACvE,MAAM,MAAM,eAAe;CAC3B,MAAM,a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ACE,eAAA;IACA,WAAW,GAAG,OAAO,OAAO,IAAI,WAAW,KAAK;IAChD,QAAQ;IACR,OAAO,IAAI,OAAO;IAClB,OAAO,QAAQ,IAAI;IAEnB,UAAA,oBAAC,QAAD,EAAM,GAAG,UAAU,OAAO,QAAQ,OAAO,IAAI,QAAQ,SAAS,EAAI,CAAA;GAC/D,CAAA;GAEP,oBAAC,UAAD;IACE,eAAA;IACA,OAAO,IAAI,OAAO;IAClB,UAAU;IACV,MAAK;IACL,WAAW,GACT,OAAO,UACP,CAAC,cAAc,OAAO,cACtB,IAAI,WAAW,QACjB;IACA,UAAU,UAAU;KAClB,MAAM,gBAAgB;KACtB,IAAI,aAAa,IAAI;IACvB;IAEC,UAAA;GACK,CAAA;GACP,aACC,
|
|
1
|
+
{"version":3,"file":"TreeNode.mjs","names":["isExpandable","Checkbox"],"sources":["../../../src/base-ui/Tree/TreeNode.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible } from '@base-ui/react/collapsible';\nimport { cx } from 'antd-style';\nimport { ChevronRight, File, Folder } from 'lucide-react';\nimport { type CSSProperties, memo, type MouseEvent } from 'react';\n\nimport { Checkbox } from '@/base-ui/Checkbox';\nimport { controlHeight } from '@/base-ui/controlSize';\nimport Icon from '@/Icon';\n\nimport { useTreeContext } from './context';\nimport { styles } from './style';\nimport type { TreeDataNode } from './type';\nimport { hasChildren as isExpandable } from './utils';\n\ninterface TreeNodeProps {\n depth: number;\n isLast: boolean;\n node: TreeDataNode;\n trail: boolean[];\n}\n\nconst ARC = 6;\nconst SWITCHER_CENTER = 11.5;\n\nconst guidePath = (\n depth: number,\n isLast: boolean,\n trail: boolean[],\n indent: number,\n height: number,\n) => {\n const cx = (i: number) => i * indent + SWITCHER_CENTER;\n let d = '';\n trail.forEach((more, i) => {\n if (more && i > 0) d += `M${cx(i)} 0V${height}`;\n });\n const x = cx(depth - 1);\n const y = height / 2;\n const elbow = `M${x} ${y - ARC}A${ARC} ${ARC} 0 0 0 ${x + ARC} ${y}H${x + indent - 2}`;\n d += isLast\n ? `M${x} 0V${y - ARC}${elbow.slice(elbow.indexOf('A'))}`\n : `M${x} 0V${height}${elbow}`;\n return d;\n};\n\nconst TreeNode = memo<TreeNodeProps>(({ node, depth, isLast, trail }) => {\n const ctx = useTreeContext();\n const expandable = isExpandable(node);\n const expanded = expandable && ctx.expanded.has(node.key);\n const disabled = ctx.disabled || !!node.disabled;\n const checkable = ctx.checkable && node.checkable !== false;\n const checkState = ctx.checked.has(node.key)\n ? 'checked'\n : ctx.halfChecked.has(node.key)\n ? 'mixed'\n : 'unchecked';\n const rowHeight =\n typeof ctx.styles.node?.height === 'number' ? ctx.styles.node.height : controlHeight[ctx.size];\n\n const switcherIcon =\n typeof ctx.switcherIcon === 'function'\n ? ctx.switcherIcon({ expanded, node })\n : (ctx.switcherIcon ?? <Icon icon={ChevronRight} size={14} />);\n\n const rowStyle: CSSProperties = {\n height: rowHeight,\n paddingInlineStart: depth * ctx.indent,\n ...ctx.styles.node,\n };\n\n const select = (event: MouseEvent) => ctx.toggleSelect(node, event);\n\n return (\n <>\n <div\n data-scope-item\n aria-disabled={disabled || undefined}\n aria-expanded={expandable ? expanded : undefined}\n aria-level={depth + 1}\n aria-selected={ctx.selected.has(node.key)}\n data-id={node.key}\n role=\"treeitem\"\n style={rowStyle}\n tabIndex={ctx.activeKey === node.key ? 0 : -1}\n aria-checked={\n checkable ? (checkState === 'mixed' ? 'mixed' : checkState === 'checked') : undefined\n }\n className={cx(\n styles.node,\n ctx.blockNode && styles.nodeBlock,\n disabled && styles.nodeDisabled,\n ctx.classNames.node,\n )}\n onClick={ctx.blockNode ? select : undefined}\n onContextMenu={(event) => ctx.onRightClick(event, node)}\n onFocus={() => ctx.setActiveKey(node.key)}\n >\n {ctx.showLine && depth > 0 && (\n <svg\n aria-hidden\n className={cx(styles.guide, ctx.classNames.guide)}\n height={rowHeight}\n style={ctx.styles.guide}\n width={depth * ctx.indent}\n >\n <path d={guidePath(depth, isLast, trail, ctx.indent, rowHeight)} />\n </svg>\n )}\n <button\n aria-hidden\n style={ctx.styles.switcher}\n tabIndex={-1}\n type=\"button\"\n className={cx(\n styles.switcher,\n !expandable && styles.switcherLeaf,\n ctx.classNames.switcher,\n )}\n onClick={(event) => {\n event.stopPropagation();\n ctx.toggleExpand(node);\n }}\n >\n {switcherIcon}\n </button>\n {checkable && (\n <Checkbox\n checked={checkState === 'checked'}\n className={styles.checkbox}\n disabled={disabled}\n indeterminate={checkState === 'mixed'}\n onChange={() => ctx.toggleCheck(node)}\n onClick={(event) => event.stopPropagation()}\n />\n )}\n {ctx.showIcon && (\n <span className={styles.icon}>\n {node.icon ?? <Icon icon={expandable ? Folder : File} size={16} />}\n </span>\n )}\n <span\n style={ctx.styles.title}\n className={cx(\n styles.title,\n ctx.blockNode ? styles.titleBlock : styles.titleInline,\n ctx.classNames.title,\n )}\n onClick={ctx.blockNode ? undefined : select}\n >\n {ctx.titleRender ? ctx.titleRender(node) : node.title}\n </span>\n </div>\n {expandable && (\n <Collapsible.Root open={expanded}>\n <Collapsible.Panel className={styles.panel}>\n {node.children!.map((child, i) => (\n <TreeNode\n depth={depth + 1}\n isLast={i === node.children!.length - 1}\n key={child.key}\n node={child}\n trail={[...trail, !isLast]}\n />\n ))}\n </Collapsible.Panel>\n </Collapsible.Root>\n )}\n </>\n );\n});\n\nTreeNode.displayName = 'TreeNode';\n\nexport default TreeNode;\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAM,MAAM;AACZ,MAAM,kBAAkB;AAExB,MAAM,aACJ,OACA,QACA,OACA,QACA,WACG;CACH,MAAM,MAAM,MAAc,IAAI,SAAS;CACvC,IAAI,IAAI;CACR,MAAM,SAAS,MAAM,MAAM;EACzB,IAAI,QAAQ,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,EAAE,KAAK;CACzC,CAAC;CACD,MAAM,IAAI,GAAG,QAAQ,CAAC;CACtB,MAAM,IAAI,SAAS;CACnB,MAAM,QAAQ,IAAI,EAAE,GA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AA,IAAY;IAEpC,UAAA,IAAI,cAAc,IAAI,YAAY,IAAI,IAAI,KAAK;GAC5C,CAAA;EACH;CACJ,CAAA,GAAA,cACC,oBAAC,YAAY,MAAb;EAAkB,MAAM;EACtB,UAAA,oBAAC,YAAY,OAAb;GAAmB,WAAW,OAAO;GAClC,UAAA,KAAK,SAAU,KAAK,OAAO,MAC1B,oBAAC,UAAD;IACE,OAAO,QAAQ;IACf,QAAQ,MAAM,KAAK,SAAU,SAAS;IAEtC,MAAM;IACN,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM;GAC1B,GAHM,MAAM,GAGZ,CACF;EACgB,CAAA;CACH,CAAA,CAEpB,EAAA,CAAA;AAEN,CAAC;AAED,SAAS,cAAc"}
|
package/es/base-ui/index.d.mts
CHANGED
|
@@ -21,12 +21,12 @@ import { ContextMenuHost } from "./ContextMenu/ContextMenuHost.mjs";
|
|
|
21
21
|
import { ContextMenuInterceptor, closeContextMenu, setContextMenuInterceptor, showContextMenu, updateContextMenuItems } from "./ContextMenu/store.mjs";
|
|
22
22
|
import "./ContextMenu/index.mjs";
|
|
23
23
|
import { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps } from "./Input/type.mjs";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
24
|
+
import _default$1 from "./Input/Input.mjs";
|
|
25
|
+
import _default$2 from "./Input/InputNumber.mjs";
|
|
26
26
|
import InputOTP from "./Input/InputOTP.mjs";
|
|
27
|
-
import
|
|
27
|
+
import _default$3 from "./Input/InputPassword.mjs";
|
|
28
28
|
import { rootVariants, styles as styles$7 } from "./Input/style.mjs";
|
|
29
|
-
import
|
|
29
|
+
import _default$5 from "./Input/TextArea.mjs";
|
|
30
30
|
import "./Input/index.mjs";
|
|
31
31
|
import { AvatarClassNames, AvatarGroupItemType, AvatarGroupProps, AvatarProps, AvatarStyles } from "./Avatar/type.mjs";
|
|
32
32
|
import AvatarGroup from "./Avatar/AvatarGroup/index.mjs";
|
|
@@ -77,9 +77,10 @@ import { ToastHost, ToastHostProps, toast, useToast } from "./Toast/imperative.m
|
|
|
77
77
|
import "./Toast/index.mjs";
|
|
78
78
|
import { ButtonIconPosition, ButtonOutdent, ButtonProps, ButtonShape, ButtonSize, ButtonType } from "./Button/type.mjs";
|
|
79
79
|
import Button from "./Button/Button.mjs";
|
|
80
|
-
import _default, { SplitButtonMenuProps, SplitButtonProps } from "./Button/SplitButton.mjs";
|
|
80
|
+
import _default$4, { SplitButtonMenuProps, SplitButtonProps } from "./Button/SplitButton.mjs";
|
|
81
81
|
import { buttonPaddingInline, styles as styles$4 } from "./Button/style.mjs";
|
|
82
82
|
import "./Button/index.mjs";
|
|
83
|
+
import { FormContextValue, FormDividerProps, FormFieldProps, FormFlatGroupProps, FormFooterProps, FormGroupItemType, FormGroupProps, FormLayout, FormProps, FormSubmitFooterProps, FormTitleProps, FormValues, FormVariant, ItemsType } from "./Form/type.mjs";
|
|
83
84
|
import { AccordionClassNames, AccordionHeaderProps, AccordionIndicatorPlacement, AccordionItemProps, AccordionItemType, AccordionPanelProps, AccordionProps, AccordionRootProps, AccordionStyles, AccordionTriggerProps, AccordionVariant } from "./Accordion/type.mjs";
|
|
84
85
|
import Accordion from "./Accordion/Accordion.mjs";
|
|
85
86
|
import { styles } from "./Accordion/style.mjs";
|
|
@@ -109,7 +110,7 @@ import { CarouselProps, CarouselRef } from "./Carousel/type.mjs";
|
|
|
109
110
|
import Carousel from "./Carousel/Carousel.mjs";
|
|
110
111
|
import "./Carousel/index.mjs";
|
|
111
112
|
import { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxShape } from "./Checkbox/type.mjs";
|
|
112
|
-
import
|
|
113
|
+
import _default from "./Checkbox/Checkbox.mjs";
|
|
113
114
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
114
115
|
import { styles as styles$5 } from "./Checkbox/style.mjs";
|
|
115
116
|
import "./Checkbox/index.mjs";
|
|
@@ -161,7 +162,6 @@ import { styles as styles$6 } from "./FocusScope/style.mjs";
|
|
|
161
162
|
import { UseScopeArrowNavOptions, focusScopeItem, notifyScopeItemFocus, useScopeArrowNav } from "./FocusScope/useScopeArrowNav.mjs";
|
|
162
163
|
import { UseScopeSwitcherOptions, useScopeSwitcher } from "./FocusScope/useScopeSwitcher.mjs";
|
|
163
164
|
import "./FocusScope/index.mjs";
|
|
164
|
-
import { FormContextValue, FormDividerProps, FormFieldProps, FormFlatGroupProps, FormFooterProps, FormGroupItemType, FormGroupProps, FormLayout, FormProps, FormSubmitFooterProps, FormTitleProps, FormValues, FormVariant, ItemsType } from "./Form/type.mjs";
|
|
165
165
|
import FormDivider from "./Form/components/FormDivider.mjs";
|
|
166
166
|
import FormField from "./Form/components/FormField.mjs";
|
|
167
167
|
import FormFlatGroup from "./Form/components/FormFlatGroup.mjs";
|
|
@@ -228,4 +228,4 @@ import { TreeClassNames, TreeDataNode, TreeFlatRow, TreeProps, TreeStyles } from
|
|
|
228
228
|
import Tree from "./Tree/Tree.mjs";
|
|
229
229
|
import { conductCheck, flattenVisible, getAllKeys } from "./Tree/utils.mjs";
|
|
230
230
|
import "./Tree/index.mjs";
|
|
231
|
-
export { Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, Anchor, type AnchorItem, type AnchorProps, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseModalProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Burger, type BurgerProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, type CalendarMode, Carousel, type CarouselProps, type CarouselRef, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, Collapsible, type CollapsibleProps, ColorPicker, type ColorPickerProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DateRangeValue, Descriptions, type DescriptionsItem, type DescriptionsProps, Divider, type DividerOrientation, type DividerProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type FilterValue, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FocusScope, type FocusScopeProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, List, type ListClickInfo, type ListDividerType, type ListItem, type ListItemType, type ListProps, type ListSemanticName, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Pagination, type PaginationProps, type PaginationSize, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, QRCode, type QRCodeErrorLevel, type QRCodeProps, type QRCodeStatus, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, Rate, type RateProps, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, type SortOrder, Spin, type SpinProps, type SpinSize, type SpinVariant, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Table, type TableColumn, type TableFilters, type TablePaginationConfig, type TableProps, type TableSemanticName, type TableSorterResult, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, type VirtualListProps, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
|
231
|
+
export { Accordion, type AccordionClassNames, AccordionHeader, type AccordionHeaderProps, type AccordionIndicatorPlacement, AccordionItem, type AccordionItemProps, type AccordionItemType, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionRoot, type AccordionRootProps, type AccordionStyles, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, ActionIcon, type ActionIconClassNames, type ActionIconOutdent, type ActionIconProps, type ActionIconSize, type ActionIconStyles, type ActionIconVariant, Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, Anchor, type AnchorItem, type AnchorProps, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, type AvatarClassNames, AvatarGroup, type AvatarGroupItemType, type AvatarGroupProps, type AvatarProps, type AvatarStyles, Badge, type BadgeProps, type BadgeSize, type BadgeStatus, type BaseModalProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Burger, type BurgerProps, Button, type ButtonIconPosition, type ButtonOutdent, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, type CalendarMode, Carousel, type CarouselProps, type CarouselRef, _default as Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, Collapsible, type CollapsibleProps, ColorPicker, type ColorPickerProps, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DateRangeValue, Descriptions, type DescriptionsItem, type DescriptionsProps, Divider, type DividerOrientation, type DividerProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelContent, type DraggablePanelContentProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHandle, type DraggablePanelHandleProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelPlacement, type DraggablePanelProps, DraggablePanelRoot, type DraggablePanelRootProps, type DraggablePanelSize, DraggablePanelToggle, type DraggablePanelToggleProps, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type FilterValue, type FloatingCollisionPadding, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, FocusScope, type FocusScopeProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, _default$1 as Input, type InputClassNames, _default$2 as InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, _default$3 as InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, List, type ListClickInfo, type ListDividerType, type ListItem, type ListItemType, type ListProps, type ListSemanticName, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Pagination, type PaginationProps, type PaginationSize, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverGroupHandle, type PopoverGroupItem, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Progress, type ProgressProps, type ProgressSize, type ProgressStatus, type ProgressType, type ProgressVariant, QRCode, type QRCodeErrorLevel, type QRCodeProps, type QRCodeStatus, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, Rate, type RateProps, Result, type ResultProps, type ResultStatus, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Skeleton, type SkeletonAnimation, SkeletonAvatar, type SkeletonAvatarProps, type SkeletonProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, type SortOrder, Spin, type SpinProps, type SpinSize, type SpinVariant, _default$4 as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Statistic, type StatisticProps, type StepItem, type StepStatus, Steps, type StepsProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Table, type TableColumn, type TableFilters, type TablePaginationConfig, type TableProps, type TableSemanticName, type TableSorterResult, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagClassNames, type TagProps, type TagShape, type TagSize, type TagStyles, type TagVariant, Text, _default$5 as TextArea, type TextAreaAutoSize, type TextAreaProps, type TextClassNames, type TextProps, type TextStyles, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, ToggleGroup, type ToggleGroupClassNames, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, type ToggleGroupItemProps, type ToggleGroupOption, type ToggleGroupProps, ToggleGroupRoot, type ToggleGroupRootProps, type ToggleGroupSize, type ToggleGroupStyles, type ToggleGroupVariant, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, Tree, type TreeClassNames, type TreeDataNode, type TreeFlatRow, type TreeProps, type TreeStyles, Upload, type UploadChangeInfo, UploadDragger, type UploadProps, type UseScopeArrowNavOptions, type UseScopeSwitcherOptions, type VirtualListProps, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
package/es/base-ui/index.mjs
CHANGED
|
@@ -28,11 +28,11 @@ import UploadDragger from "./Upload/UploadDragger.mjs";
|
|
|
28
28
|
import { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from "./Tag/utils.mjs";
|
|
29
29
|
import Tag from "./Tag/Tag.mjs";
|
|
30
30
|
import { rootVariants, styles as styles$7 } from "./Input/style.mjs";
|
|
31
|
-
import
|
|
32
|
-
import
|
|
31
|
+
import Input_default from "./Input/Input.mjs";
|
|
32
|
+
import InputNumber_default from "./Input/InputNumber.mjs";
|
|
33
33
|
import InputOTP from "./Input/InputOTP.mjs";
|
|
34
|
-
import
|
|
35
|
-
import
|
|
34
|
+
import InputPassword_default from "./Input/InputPassword.mjs";
|
|
35
|
+
import TextArea_default from "./Input/TextArea.mjs";
|
|
36
36
|
import { PopoverArrowIcon } from "./Popover/ArrowIcon.mjs";
|
|
37
37
|
import { usePopoverPortalContainer } from "./Popover/PopoverPortal.mjs";
|
|
38
38
|
import { PopoverArrow, PopoverBackdrop, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverRoot, PopoverTriggerElement, PopoverViewport } from "./Popover/atoms.mjs";
|
|
@@ -75,7 +75,7 @@ import List from "./List/List.mjs";
|
|
|
75
75
|
import Burger from "./Burger/Burger.mjs";
|
|
76
76
|
import Carousel from "./Carousel/Carousel.mjs";
|
|
77
77
|
import { styles as styles$5 } from "./Checkbox/style.mjs";
|
|
78
|
-
import
|
|
78
|
+
import Checkbox_default from "./Checkbox/Checkbox.mjs";
|
|
79
79
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
80
80
|
import Collapsible from "./Collapsible/Collapsible.mjs";
|
|
81
81
|
import DatePicker from "./DatePicker/DatePicker.mjs";
|
|
@@ -122,4 +122,4 @@ import ToggleGroup from "./ToggleGroup/ToggleGroup.mjs";
|
|
|
122
122
|
import { styles as styles$14 } from "./Tree/style.mjs";
|
|
123
123
|
import { conductCheck, flattenVisible, getAllKeys } from "./Tree/utils.mjs";
|
|
124
124
|
import Tree from "./Tree/Tree.mjs";
|
|
125
|
-
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, Alert, Anchor, AutoComplete, Avatar, AvatarGroup, Badge, Breadcrumb, Burger, Button, Carousel, Checkbox, CheckboxGroup, Collapsible, ColorPicker, ContextMenuHost, ContextMenuTrigger, DatePicker, DateRangePicker, Descriptions, Divider, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, FocusScope, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, List, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Pagination, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Progress, QRCode, Radio, RadioGroup, Rate, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Spin, SplitButton, Statistic, Steps, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Table, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Upload, UploadDragger, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
|
125
|
+
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, ActionIcon, Alert, Anchor, AutoComplete, Avatar, AvatarGroup, Badge, Breadcrumb, Burger, Button, Carousel, Checkbox_default as Checkbox, CheckboxGroup, Collapsible, ColorPicker, ContextMenuHost, ContextMenuTrigger, DatePicker, DateRangePicker, Descriptions, Divider, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelContent, DraggablePanelFooter, DraggablePanelHandle, DraggablePanelHeader, DraggablePanelRoot, DraggablePanelToggle, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, FocusScope, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input_default as Input, InputNumber_default as InputNumber, InputOTP, InputPassword_default as InputPassword, List, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Pagination, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Progress, QRCode, Radio, RadioGroup, Rate, Result, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Skeleton, SkeletonAvatar, SkeletonText, Slider, SliderWithInput, Spin, SplitButton, Statistic, Steps, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Table, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, Tag, Text, TextArea_default as TextArea, ToastHost, ToggleGroup, ToggleGroupItem, ToggleGroupItemIcon, ToggleGroupItemLabel, ToggleGroupRoot, Tooltip, TooltipGroup, Tree, Upload, UploadDragger, styles as accordionStyles, styles$1 as actionIconStyles, styles$2 as alertStyles, styles$3 as autoCompleteStyles, backdropTransition, buttonPaddingInline, styles$4 as buttonStyles, styles$5 as checkboxStyles, closeContextMenu, colorsPreset, colorsPresetSystem, conductCheck, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, flattenVisible, focusScopeItem, styles$6 as focusScopeStyles, formatStatisticValue, getActiveScopeId, getAllKeys, getDrawerMotionConfig, getFloatingCollisionPadding, getLastFocusedItem, styles$7 as inputStyles, rootVariants as inputVariants, modalMotionConfig, notifyScopeItemFocus, parseTrigger, presetColors, presetSystemColors, styles$8 as radioStyles, registerScope, renderDropdownMenuItems, setActiveScope, setContextMenuInterceptor, setFloatingCollisionPadding, setLastFocusedItem, showContextMenu, styles$9 as sliderStyles, styles$10 as switchStyles, styles$11 as tabsStyles, groupStyles as textGroupStyles, styles$12 as textStyles, variants as textVariants, toast, styles$13 as toggleGroupStyles, styles$14 as treeStyles, updateContextMenuItems, useAccordionContext, useActiveScopeId, useDraggablePanelContext, useDrawerActions, useDrawerOpen, useFocusScopeActive, useFocusScopeId, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverGroupHandle, usePopoverPortalContainer, useScopeArrowNav, useScopeSwitcher, useSwitchContext, useTabsContext, useToast };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import TextArea_default from "../../../base-ui/Input/TextArea.mjs";
|
|
3
3
|
import { memo, useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/chat/ChatInputArea/components/ChatInputAreaInner.tsx
|
|
6
6
|
const ChatInputAreaInner = memo(({ ref, resize = false, onCompositionEnd, onPressEnter, onCompositionStart, className, onInput, loading, onSend, onBlur, onChange, ...rest }) => {
|
|
7
7
|
const isChineseInput = useRef(false);
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
+
return /* @__PURE__ */ jsx(TextArea_default, {
|
|
9
9
|
className,
|
|
10
10
|
ref,
|
|
11
11
|
resize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInputAreaInner.mjs","names":[],"sources":["../../../../src/chat/ChatInputArea/components/ChatInputAreaInner.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useRef } from 'react';\n\nimport { TextArea } from '@/base-ui/Input';\n\nimport type { ChatInputAreaInnerProps } from '../type';\n\nconst ChatInputAreaInner = memo<ChatInputAreaInnerProps>(\n ({\n ref,\n resize = false,\n onCompositionEnd,\n onPressEnter,\n onCompositionStart,\n className,\n onInput,\n loading,\n onSend,\n onBlur,\n onChange,\n ...rest\n }) => {\n const isChineseInput = useRef(false);\n\n return (\n <TextArea\n className={className}\n ref={ref}\n resize={resize}\n variant={'borderless'}\n onBlur={(e) => {\n onInput?.(e.target.value);\n onBlur?.(e);\n }}\n onChange={(e) => {\n onInput?.(e.target.value);\n onChange?.(e);\n }}\n onCompositionEnd={(e) => {\n isChineseInput.current = false;\n onCompositionEnd?.(e);\n }}\n onCompositionStart={(e) => {\n isChineseInput.current = true;\n onCompositionStart?.(e);\n }}\n onPressEnter={(e) => {\n onPressEnter?.(e);\n const isMobile = /mobi|android|iphone/i.test(navigator.userAgent);\n if (\n !loading &&\n !isChineseInput.current &&\n ((!isMobile && !e.shiftKey) || (isMobile && e.shiftKey))\n ) {\n e.preventDefault();\n onSend?.();\n }\n }}\n {...rest}\n />\n );\n },\n);\n\nexport default ChatInputAreaInner;\n"],"mappings":";;;;;AAQA,MAAM,qBAAqB,MACxB,EACC,KACA,SAAS,OACT,kBACA,cACA,oBACA,WACA,SACA,SACA,QACA,QACA,UACA,GAAG,WACC;CACJ,MAAM,iBAAiB,OAAO,KAAK;CAEnC,OACE,
|
|
1
|
+
{"version":3,"file":"ChatInputAreaInner.mjs","names":["TextArea"],"sources":["../../../../src/chat/ChatInputArea/components/ChatInputAreaInner.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useRef } from 'react';\n\nimport { TextArea } from '@/base-ui/Input';\n\nimport type { ChatInputAreaInnerProps } from '../type';\n\nconst ChatInputAreaInner = memo<ChatInputAreaInnerProps>(\n ({\n ref,\n resize = false,\n onCompositionEnd,\n onPressEnter,\n onCompositionStart,\n className,\n onInput,\n loading,\n onSend,\n onBlur,\n onChange,\n ...rest\n }) => {\n const isChineseInput = useRef(false);\n\n return (\n <TextArea\n className={className}\n ref={ref}\n resize={resize}\n variant={'borderless'}\n onBlur={(e) => {\n onInput?.(e.target.value);\n onBlur?.(e);\n }}\n onChange={(e) => {\n onInput?.(e.target.value);\n onChange?.(e);\n }}\n onCompositionEnd={(e) => {\n isChineseInput.current = false;\n onCompositionEnd?.(e);\n }}\n onCompositionStart={(e) => {\n isChineseInput.current = true;\n onCompositionStart?.(e);\n }}\n onPressEnter={(e) => {\n onPressEnter?.(e);\n const isMobile = /mobi|android|iphone/i.test(navigator.userAgent);\n if (\n !loading &&\n !isChineseInput.current &&\n ((!isMobile && !e.shiftKey) || (isMobile && e.shiftKey))\n ) {\n e.preventDefault();\n onSend?.();\n }\n }}\n {...rest}\n />\n );\n },\n);\n\nexport default ChatInputAreaInner;\n"],"mappings":";;;;;AAQA,MAAM,qBAAqB,MACxB,EACC,KACA,SAAS,OACT,kBACA,cACA,oBACA,WACA,SACA,SACA,QACA,QACA,UACA,GAAG,WACC;CACJ,MAAM,iBAAiB,OAAO,KAAK;CAEnC,OACE,oBAACA,kBAAD;EACa;EACN;EACG;EACR,SAAS;EACT,SAAS,MAAM;GACb,UAAU,EAAE,OAAO,KAAK;GACxB,SAAS,CAAC;EACZ;EACA,WAAW,MAAM;GACf,UAAU,EAAE,OAAO,KAAK;GACxB,WAAW,CAAC;EACd;EACA,mBAAmB,MAAM;GACvB,eAAe,UAAU;GACzB,mBAAmB,CAAC;EACtB;EACA,qBAAqB,MAAM;GACzB,eAAe,UAAU;GACzB,qBAAqB,CAAC;EACxB;EACA,eAAe,MAAM;GACnB,eAAe,CAAC;GAChB,MAAM,WAAW,uBAAuB,KAAK,UAAU,SAAS;GAChE,IACE,CAAC,WACD,CAAC,eAAe,YACd,CAAC,YAAY,CAAC,EAAE,YAAc,YAAY,EAAE,WAC9C;IACA,EAAE,eAAe;IACjB,SAAS;GACX;EACF;EACA,GAAI;CACL,CAAA;AAEL,CACF"}
|
|
@@ -5,7 +5,7 @@ import { combineKeys } from "../../Hotkey/utils.mjs";
|
|
|
5
5
|
import { Tooltip } from "../../base-ui/Tooltip/Tooltip.mjs";
|
|
6
6
|
import Button from "../../base-ui/Button/Button.mjs";
|
|
7
7
|
import CodeEditor from "../../CodeEditor/CodeEditor.mjs";
|
|
8
|
-
import
|
|
8
|
+
import TextArea_default from "../../base-ui/Input/TextArea.mjs";
|
|
9
9
|
import { styles } from "./style.mjs";
|
|
10
10
|
import { memo, useState } from "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -46,7 +46,7 @@ const MessageInput = memo(({ text, variant = "borderless", onCancel, defaultValu
|
|
|
46
46
|
...style
|
|
47
47
|
},
|
|
48
48
|
...rest,
|
|
49
|
-
children: [mobile ? /* @__PURE__ */ jsx(
|
|
49
|
+
children: [mobile ? /* @__PURE__ */ jsx(TextArea_default, {
|
|
50
50
|
autoSize: true,
|
|
51
51
|
className: cx(styles, classNames?.editor),
|
|
52
52
|
placeholder,
|