@lobehub/ui 5.29.3 → 5.30.1
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/base-ui/Alert/Alert.d.mts +6 -0
- package/es/base-ui/Alert/Alert.mjs +148 -0
- package/es/base-ui/Alert/Alert.mjs.map +1 -0
- package/es/base-ui/Alert/index.d.mts +4 -0
- package/es/base-ui/Alert/style.d.mts +37 -0
- package/es/base-ui/Alert/style.mjs +419 -0
- package/es/base-ui/Alert/style.mjs.map +1 -0
- package/es/base-ui/Alert/type.d.mts +110 -0
- package/es/base-ui/Button/SplitButton.d.mts +1 -1
- package/es/base-ui/Button/SplitButton.mjs +54 -4
- package/es/base-ui/Button/SplitButton.mjs.map +1 -1
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/index.d.mts +13 -9
- package/es/base-ui/index.mjs +11 -9
- package/package.json +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Icon from "../../Icon/Icon.mjs";
|
|
3
|
+
import { extraHeaderVariants, extraVariants, integratedVariants, rootVariants, styles, toneVariants } from "./style.mjs";
|
|
4
|
+
import { memo, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cx } from "antd-style";
|
|
7
|
+
import { AlertTriangle, CheckCircle, ChevronRight, Info, X, XCircle } from "lucide-react";
|
|
8
|
+
//#region src/base-ui/Alert/Alert.tsx
|
|
9
|
+
const typeIcons = {
|
|
10
|
+
error: XCircle,
|
|
11
|
+
info: Info,
|
|
12
|
+
secondary: AlertTriangle,
|
|
13
|
+
success: CheckCircle,
|
|
14
|
+
warning: AlertTriangle
|
|
15
|
+
};
|
|
16
|
+
const Alert = memo(({ action, afterClose, banner = false, className, classNames, closable = false, closeIcon, closeText, colorfulText = false, description, extra, extraDefaultExpand = false, extraIsolate = false, glass = false, icon, iconProps, message, onClose, ref, role = "alert", rootClassName, showIcon = true, style, styles: customStyles, text, title, type = "info", variant = "soft", ...rest }) => {
|
|
17
|
+
const [closed, setClosed] = useState(false);
|
|
18
|
+
const [extraExpanded, setExtraExpanded] = useState(extraDefaultExpand);
|
|
19
|
+
const resolvedTitle = title ?? message;
|
|
20
|
+
const hasDescription = description !== void 0 && description !== null;
|
|
21
|
+
const integratedExtra = Boolean(extra && !extraIsolate);
|
|
22
|
+
const closeConfig = typeof closable === "object" ? closable : {};
|
|
23
|
+
const isClosable = Boolean(closable);
|
|
24
|
+
const { afterClose: configuredAfterClose, closeIcon: configuredCloseIcon, className: closeClassName, disabled: closeDisabled, onClose: configuredOnClose, style: closeStyle, ...closeButtonProps } = closeConfig;
|
|
25
|
+
const afterCloseRef = useRef(configuredAfterClose ?? afterClose);
|
|
26
|
+
afterCloseRef.current = configuredAfterClose ?? afterClose;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (closed) afterCloseRef.current?.();
|
|
29
|
+
}, [closed]);
|
|
30
|
+
if (closed) return null;
|
|
31
|
+
const handleClose = (event) => {
|
|
32
|
+
(configuredOnClose ?? onClose)?.(event);
|
|
33
|
+
setClosed(true);
|
|
34
|
+
};
|
|
35
|
+
const root = /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
...rest,
|
|
37
|
+
"data-alert-type": type,
|
|
38
|
+
"data-alert-variant": variant,
|
|
39
|
+
ref,
|
|
40
|
+
role,
|
|
41
|
+
className: cx(toneVariants({ type }), rootVariants({
|
|
42
|
+
banner,
|
|
43
|
+
colorfulText,
|
|
44
|
+
glass: integratedExtra ? false : glass,
|
|
45
|
+
hasDescription,
|
|
46
|
+
hasExtra: integratedExtra,
|
|
47
|
+
variant
|
|
48
|
+
}), classNames?.root, classNames?.alert, rootClassName, className),
|
|
49
|
+
style: {
|
|
50
|
+
...style,
|
|
51
|
+
...customStyles?.root,
|
|
52
|
+
...customStyles?.alert
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
showIcon && /* @__PURE__ */ jsx("span", {
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
className: cx(styles.icon, classNames?.icon),
|
|
58
|
+
style: customStyles?.icon,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
60
|
+
icon: icon ?? typeIcons[type],
|
|
61
|
+
size: hasDescription ? 20 : 18,
|
|
62
|
+
...iconProps
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: cx(styles.content, classNames?.section, classNames?.content),
|
|
67
|
+
style: {
|
|
68
|
+
...customStyles?.section,
|
|
69
|
+
...customStyles?.content
|
|
70
|
+
},
|
|
71
|
+
children: [resolvedTitle !== void 0 && resolvedTitle !== null && /* @__PURE__ */ jsx("div", {
|
|
72
|
+
style: customStyles?.title,
|
|
73
|
+
className: cx(styles.title, hasDescription && styles.titleDetailed, classNames?.title),
|
|
74
|
+
children: resolvedTitle
|
|
75
|
+
}), hasDescription && /* @__PURE__ */ jsx("div", {
|
|
76
|
+
className: cx(styles.description, classNames?.description),
|
|
77
|
+
style: customStyles?.description,
|
|
78
|
+
children: description
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
action && /* @__PURE__ */ jsx("div", {
|
|
82
|
+
className: cx(styles.action, styles.wrappedAction, classNames?.action),
|
|
83
|
+
style: customStyles?.action,
|
|
84
|
+
children: action
|
|
85
|
+
}),
|
|
86
|
+
isClosable && /* @__PURE__ */ jsx("button", {
|
|
87
|
+
...closeButtonProps,
|
|
88
|
+
"aria-label": closeButtonProps["aria-label"] ?? "Close alert",
|
|
89
|
+
className: cx(styles.close, classNames?.close, closeClassName),
|
|
90
|
+
disabled: closeDisabled,
|
|
91
|
+
style: {
|
|
92
|
+
...customStyles?.close,
|
|
93
|
+
...closeStyle
|
|
94
|
+
},
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: handleClose,
|
|
97
|
+
children: configuredCloseIcon ?? closeIcon ?? closeText ?? /* @__PURE__ */ jsx(X, { size: 14 })
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
if (!extra) return root;
|
|
102
|
+
if (extraIsolate) return /* @__PURE__ */ jsxs("div", {
|
|
103
|
+
className: cx(styles.container, toneVariants({ type }), classNames?.container),
|
|
104
|
+
style: {
|
|
105
|
+
gap: 8,
|
|
106
|
+
...customStyles?.container
|
|
107
|
+
},
|
|
108
|
+
children: [root, extra]
|
|
109
|
+
});
|
|
110
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
style: customStyles?.container,
|
|
112
|
+
className: cx(styles.container, toneVariants({ type }), integratedVariants({
|
|
113
|
+
banner,
|
|
114
|
+
glass,
|
|
115
|
+
variant
|
|
116
|
+
}), classNames?.container),
|
|
117
|
+
children: [root, /* @__PURE__ */ jsx("div", {
|
|
118
|
+
className: cx(extraVariants({
|
|
119
|
+
banner,
|
|
120
|
+
variant
|
|
121
|
+
}), classNames?.extra),
|
|
122
|
+
style: customStyles?.extra,
|
|
123
|
+
children: /* @__PURE__ */ jsxs("details", {
|
|
124
|
+
open: extraExpanded,
|
|
125
|
+
onToggle: (event) => setExtraExpanded(event.currentTarget.open),
|
|
126
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
127
|
+
className: cx(extraHeaderVariants({ variant }), classNames?.extraHeader),
|
|
128
|
+
style: customStyles?.extraHeader,
|
|
129
|
+
children: [/* @__PURE__ */ jsx(ChevronRight, {
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
className: cx(styles.extraIndicator, classNames?.extraIndicator),
|
|
132
|
+
size: 14,
|
|
133
|
+
style: customStyles?.extraIndicator
|
|
134
|
+
}), /* @__PURE__ */ jsx("span", { children: text?.detail ?? "Show Details" })]
|
|
135
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
136
|
+
className: cx(styles.extraContent, classNames?.extraContent),
|
|
137
|
+
style: customStyles?.extraContent,
|
|
138
|
+
children: extra
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
Alert.displayName = "BaseAlert";
|
|
145
|
+
//#endregion
|
|
146
|
+
export { Alert as default };
|
|
147
|
+
|
|
148
|
+
//# sourceMappingURL=Alert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.mjs","names":[],"sources":["../../../src/base-ui/Alert/Alert.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { AlertTriangle, CheckCircle, ChevronRight, Info, X, XCircle } from 'lucide-react';\nimport { memo, useEffect, useRef, useState } from 'react';\n\nimport Icon from '@/Icon';\n\nimport {\n extraHeaderVariants,\n extraVariants,\n integratedVariants,\n rootVariants,\n styles,\n toneVariants,\n} from './style';\nimport type { AlertCloseConfig, AlertProps, AlertType } from './type';\n\nconst typeIcons = {\n error: XCircle,\n info: Info,\n secondary: AlertTriangle,\n success: CheckCircle,\n warning: AlertTriangle,\n} satisfies Record<AlertType, typeof Info>;\n\nconst Alert = memo<AlertProps>(\n ({\n action,\n afterClose,\n banner = false,\n className,\n classNames,\n closable = false,\n closeIcon,\n closeText,\n colorfulText = false,\n description,\n extra,\n extraDefaultExpand = false,\n extraIsolate = false,\n glass = false,\n icon,\n iconProps,\n message,\n onClose,\n ref,\n role = 'alert',\n rootClassName,\n showIcon = true,\n style,\n styles: customStyles,\n text,\n title,\n type = 'info',\n variant = 'soft',\n ...rest\n }) => {\n const [closed, setClosed] = useState(false);\n const [extraExpanded, setExtraExpanded] = useState(extraDefaultExpand);\n const resolvedTitle = title ?? message;\n const hasDescription = description !== undefined && description !== null;\n const integratedExtra = Boolean(extra && !extraIsolate);\n const closeConfig: AlertCloseConfig = typeof closable === 'object' ? closable : {};\n const isClosable = Boolean(closable);\n const {\n afterClose: configuredAfterClose,\n closeIcon: configuredCloseIcon,\n className: closeClassName,\n disabled: closeDisabled,\n onClose: configuredOnClose,\n style: closeStyle,\n ...closeButtonProps\n } = closeConfig;\n const afterCloseRef = useRef(configuredAfterClose ?? afterClose);\n afterCloseRef.current = configuredAfterClose ?? afterClose;\n\n useEffect(() => {\n if (closed) afterCloseRef.current?.();\n }, [closed]);\n\n if (closed) return null;\n\n const handleClose: NonNullable<AlertCloseConfig['onClose']> = (event) => {\n (configuredOnClose ?? onClose)?.(event);\n setClosed(true);\n };\n\n const root = (\n <div\n {...rest}\n data-alert-type={type}\n data-alert-variant={variant}\n ref={ref}\n role={role}\n className={cx(\n toneVariants({ type }),\n rootVariants({\n banner,\n colorfulText,\n glass: integratedExtra ? false : glass,\n hasDescription,\n hasExtra: integratedExtra,\n variant,\n }),\n classNames?.root,\n classNames?.alert,\n rootClassName,\n className,\n )}\n style={{\n ...style,\n ...customStyles?.root,\n ...customStyles?.alert,\n }}\n >\n {showIcon && (\n <span\n aria-hidden=\"true\"\n className={cx(styles.icon, classNames?.icon)}\n style={customStyles?.icon}\n >\n <Icon icon={icon ?? typeIcons[type]} size={hasDescription ? 20 : 18} {...iconProps} />\n </span>\n )}\n <div\n className={cx(styles.content, classNames?.section, classNames?.content)}\n style={{ ...customStyles?.section, ...customStyles?.content }}\n >\n {resolvedTitle !== undefined && resolvedTitle !== null && (\n <div\n style={customStyles?.title}\n className={cx(\n styles.title,\n hasDescription && styles.titleDetailed,\n classNames?.title,\n )}\n >\n {resolvedTitle}\n </div>\n )}\n {hasDescription && (\n <div\n className={cx(styles.description, classNames?.description)}\n style={customStyles?.description}\n >\n {description}\n </div>\n )}\n </div>\n {action && (\n <div\n className={cx(styles.action, styles.wrappedAction, classNames?.action)}\n style={customStyles?.action}\n >\n {action}\n </div>\n )}\n {isClosable && (\n <button\n {...closeButtonProps}\n aria-label={closeButtonProps['aria-label'] ?? 'Close alert'}\n className={cx(styles.close, classNames?.close, closeClassName)}\n disabled={closeDisabled}\n style={{ ...customStyles?.close, ...closeStyle }}\n type=\"button\"\n onClick={handleClose}\n >\n {configuredCloseIcon ?? closeIcon ?? closeText ?? <X size={14} />}\n </button>\n )}\n </div>\n );\n\n if (!extra) return root;\n\n if (extraIsolate) {\n return (\n <div\n className={cx(styles.container, toneVariants({ type }), classNames?.container)}\n style={{ gap: 8, ...customStyles?.container }}\n >\n {root}\n {extra}\n </div>\n );\n }\n\n return (\n <div\n style={customStyles?.container}\n className={cx(\n styles.container,\n toneVariants({ type }),\n integratedVariants({ banner, glass, variant }),\n classNames?.container,\n )}\n >\n {root}\n <div\n className={cx(extraVariants({ banner, variant }), classNames?.extra)}\n style={customStyles?.extra}\n >\n <details\n open={extraExpanded}\n onToggle={(event) => setExtraExpanded(event.currentTarget.open)}\n >\n <summary\n className={cx(extraHeaderVariants({ variant }), classNames?.extraHeader)}\n style={customStyles?.extraHeader}\n >\n <ChevronRight\n aria-hidden=\"true\"\n className={cx(styles.extraIndicator, classNames?.extraIndicator)}\n size={14}\n style={customStyles?.extraIndicator}\n />\n <span>{text?.detail ?? 'Show Details'}</span>\n </summary>\n <div\n className={cx(styles.extraContent, classNames?.extraContent)}\n style={customStyles?.extraContent}\n >\n {extra}\n </div>\n </details>\n </div>\n </div>\n );\n },\n);\n\nAlert.displayName = 'BaseAlert';\n\nexport default Alert;\n"],"mappings":";;;;;;;;AAkBA,MAAM,YAAY;CAChB,OAAO;CACP,MAAM;CACN,WAAW;CACX,SAAS;CACT,SAAS;AACX;AAEA,MAAM,QAAQ,MACX,EACC,QACA,YACA,SAAS,OACT,WACA,YACA,WAAW,OACX,WACA,WACA,eAAe,OACf,aACA,OACA,qBAAqB,OACrB,eAAe,OACf,QAAQ,OACR,MACA,WACA,SACA,SACA,KACA,OAAO,SACP,eACA,WAAW,MACX,OACA,QAAQ,cACR,MACA,OACA,OAAO,QACP,UAAU,QACV,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,CAAC,eAAe,oBAAoB,SAAS,kBAAkB;CACrE,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiB,gBAAgB,KAAA,KAAa,gBAA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EAAE,QAAQ,CAAC,GAAG,YAAY,WAAW;KACvE,OAAO,cAAc;KAFvB,UAAA,CAIE,oBAAC,cAAD;MACE,eAAY;MACZ,WAAW,GAAG,OAAO,gBAAgB,YAAY,cAAc;MAC/D,MAAM;MACN,OAAO,cAAc;KACtB,CAAA,GACD,oBAAC,QAAD,EAAA,UAAO,MAAM,UAAU,eAAqB,CAAA,CACrC;IACT,CAAA,GAAA,oBAAC,OAAD;KACE,WAAW,GAAG,OAAO,cAAc,YAAY,YAAY;KAC3D,OAAO,cAAc;KAEpB,UAAA;IACE,CAAA,CACE;;EACN,CAAA,CACF;;AAET,CACF;AAEA,MAAM,cAAc"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AlertClassNames, AlertCloseConfig, AlertProps, AlertRef, AlertStyles, AlertType, AlertVariant } from "./type.mjs";
|
|
2
|
+
import Alert from "./Alert.mjs";
|
|
3
|
+
import { styles } from "./style.mjs";
|
|
4
|
+
export { Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, styles as alertStyles };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/base-ui/Alert/style.d.ts
|
|
2
|
+
declare const styles: {
|
|
3
|
+
action: string;
|
|
4
|
+
close: string;
|
|
5
|
+
colorfulText: string;
|
|
6
|
+
container: string;
|
|
7
|
+
content: string;
|
|
8
|
+
description: string;
|
|
9
|
+
detailed: string;
|
|
10
|
+
extra: string;
|
|
11
|
+
extraBanner: string;
|
|
12
|
+
extraContent: string;
|
|
13
|
+
extraHeader: string;
|
|
14
|
+
extraHeaderPlain: string;
|
|
15
|
+
extraIndicator: string;
|
|
16
|
+
extraPlain: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
integrated: string;
|
|
19
|
+
neutralText: string;
|
|
20
|
+
root: string;
|
|
21
|
+
soft: string;
|
|
22
|
+
outlined: string;
|
|
23
|
+
plain: string;
|
|
24
|
+
title: string;
|
|
25
|
+
titleDetailed: string;
|
|
26
|
+
toneError: string;
|
|
27
|
+
toneInfo: string;
|
|
28
|
+
toneSecondary: string;
|
|
29
|
+
toneSuccess: string;
|
|
30
|
+
toneWarning: string;
|
|
31
|
+
unifiedRoot: string;
|
|
32
|
+
banner: string;
|
|
33
|
+
wrappedAction: string;
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { styles };
|
|
37
|
+
//# sourceMappingURL=style.d.mts.map
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { staticStylish } from "../../styles/theme/customStylishStatic.mjs";
|
|
2
|
+
import { createStaticStyles } from "antd-style";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/base-ui/Alert/style.ts
|
|
5
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
6
|
+
action: css`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
min-height: 32px;
|
|
12
|
+
margin-inline-start: auto;
|
|
13
|
+
`,
|
|
14
|
+
close: css`
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
scale: 1;
|
|
19
|
+
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
|
|
25
|
+
width: 32px;
|
|
26
|
+
height: 32px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: none;
|
|
30
|
+
border-radius: ${cssVar.borderRadiusSM};
|
|
31
|
+
|
|
32
|
+
color: ${cssVar.colorTextTertiary};
|
|
33
|
+
|
|
34
|
+
background: transparent;
|
|
35
|
+
|
|
36
|
+
transition:
|
|
37
|
+
color 160ms ${cssVar.motionEaseOut},
|
|
38
|
+
background-color 160ms ${cssVar.motionEaseOut},
|
|
39
|
+
scale 160ms ${cssVar.motionEaseOut};
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
content: '';
|
|
43
|
+
|
|
44
|
+
position: absolute;
|
|
45
|
+
inset-block-start: 50%;
|
|
46
|
+
inset-inline-start: 50%;
|
|
47
|
+
translate: -50% -50%;
|
|
48
|
+
|
|
49
|
+
width: 40px;
|
|
50
|
+
height: 40px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:hover:not(:disabled) {
|
|
54
|
+
color: ${cssVar.colorText};
|
|
55
|
+
background: ${cssVar.colorFillTertiary};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:active:not(:disabled) {
|
|
59
|
+
scale: 0.96;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:focus-visible {
|
|
63
|
+
outline: 2px solid ${cssVar.colorPrimaryBorder};
|
|
64
|
+
outline-offset: 1px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:disabled {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
opacity: 0.45;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-reduced-motion: reduce) {
|
|
73
|
+
transition-duration: 0s;
|
|
74
|
+
}
|
|
75
|
+
`,
|
|
76
|
+
colorfulText: css`
|
|
77
|
+
color: var(--lobe-alert-accent);
|
|
78
|
+
`,
|
|
79
|
+
container: css`
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
width: 100%;
|
|
83
|
+
max-width: 100%;
|
|
84
|
+
`,
|
|
85
|
+
content: css`
|
|
86
|
+
display: flex;
|
|
87
|
+
flex: 1;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
`,
|
|
91
|
+
description: css`
|
|
92
|
+
font-size: 13px;
|
|
93
|
+
line-height: 20px;
|
|
94
|
+
color: ${cssVar.colorTextSecondary};
|
|
95
|
+
text-wrap: pretty;
|
|
96
|
+
overflow-wrap: anywhere;
|
|
97
|
+
`,
|
|
98
|
+
detailed: css`
|
|
99
|
+
padding-block: 12px;
|
|
100
|
+
padding-inline: 14px;
|
|
101
|
+
`,
|
|
102
|
+
extra: css`
|
|
103
|
+
position: relative;
|
|
104
|
+
max-width: 100%;
|
|
105
|
+
color: ${cssVar.colorText};
|
|
106
|
+
`,
|
|
107
|
+
extraBanner: css`
|
|
108
|
+
border-radius: 0;
|
|
109
|
+
`,
|
|
110
|
+
extraContent: css`
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
|
|
113
|
+
margin-block: 0 12px;
|
|
114
|
+
margin-inline: 12px;
|
|
115
|
+
padding: 8px;
|
|
116
|
+
border-radius: ${cssVar.borderRadiusSM};
|
|
117
|
+
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
color: ${cssVar.colorText};
|
|
120
|
+
|
|
121
|
+
background: ${cssVar.colorFillQuaternary};
|
|
122
|
+
`,
|
|
123
|
+
extraHeader: css`
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
user-select: none;
|
|
126
|
+
|
|
127
|
+
display: flex;
|
|
128
|
+
gap: 6px;
|
|
129
|
+
align-items: center;
|
|
130
|
+
|
|
131
|
+
min-height: 40px;
|
|
132
|
+
padding-block: 8px;
|
|
133
|
+
padding-inline: 14px;
|
|
134
|
+
border-block-start: 1px solid ${cssVar.colorBorderSecondary};
|
|
135
|
+
border-radius: 0;
|
|
136
|
+
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
font-weight: 500;
|
|
139
|
+
line-height: 20px;
|
|
140
|
+
color: ${cssVar.colorTextSecondary};
|
|
141
|
+
|
|
142
|
+
background: transparent;
|
|
143
|
+
|
|
144
|
+
transition:
|
|
145
|
+
color 160ms ${cssVar.motionEaseOut},
|
|
146
|
+
background-color 160ms ${cssVar.motionEaseOut};
|
|
147
|
+
|
|
148
|
+
&::marker,
|
|
149
|
+
&::-webkit-details-marker {
|
|
150
|
+
content: '';
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:hover {
|
|
155
|
+
color: ${cssVar.colorText};
|
|
156
|
+
background: ${cssVar.colorFillQuaternary};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:focus-visible {
|
|
160
|
+
outline: 2px solid ${cssVar.colorPrimaryBorder};
|
|
161
|
+
outline-offset: -2px;
|
|
162
|
+
}
|
|
163
|
+
`,
|
|
164
|
+
extraHeaderPlain: css`
|
|
165
|
+
margin-block-start: 6px;
|
|
166
|
+
padding-inline: 0;
|
|
167
|
+
border-block-start-color: ${cssVar.colorBorderSecondary};
|
|
168
|
+
`,
|
|
169
|
+
extraIndicator: css`
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
color: ${cssVar.colorTextTertiary};
|
|
172
|
+
transition: transform 160ms ${cssVar.motionEaseOut};
|
|
173
|
+
|
|
174
|
+
details[open] > summary > & {
|
|
175
|
+
transform: rotate(90deg);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@media (prefers-reduced-motion: reduce) {
|
|
179
|
+
transition-duration: 0s;
|
|
180
|
+
}
|
|
181
|
+
`,
|
|
182
|
+
extraPlain: css`
|
|
183
|
+
background: transparent;
|
|
184
|
+
`,
|
|
185
|
+
icon: css`
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
|
|
191
|
+
height: 20px;
|
|
192
|
+
|
|
193
|
+
color: var(--lobe-alert-accent);
|
|
194
|
+
`,
|
|
195
|
+
integrated: css`
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
border-radius: ${cssVar.borderRadius};
|
|
198
|
+
`,
|
|
199
|
+
neutralText: css`
|
|
200
|
+
color: ${cssVar.colorText};
|
|
201
|
+
`,
|
|
202
|
+
root: css`
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: row;
|
|
205
|
+
gap: 10px;
|
|
206
|
+
align-items: flex-start;
|
|
207
|
+
|
|
208
|
+
box-sizing: border-box;
|
|
209
|
+
width: 100%;
|
|
210
|
+
max-width: 100%;
|
|
211
|
+
padding-block: 10px;
|
|
212
|
+
padding-inline: 12px;
|
|
213
|
+
border: none;
|
|
214
|
+
border-radius: ${cssVar.borderRadius};
|
|
215
|
+
|
|
216
|
+
font-size: 14px;
|
|
217
|
+
color: ${cssVar.colorText};
|
|
218
|
+
|
|
219
|
+
background: var(--lobe-alert-background);
|
|
220
|
+
box-shadow: inset 0 0 0 1px var(--lobe-alert-soft-border);
|
|
221
|
+
|
|
222
|
+
@media (width <= 480px) {
|
|
223
|
+
flex-wrap: wrap;
|
|
224
|
+
}
|
|
225
|
+
`,
|
|
226
|
+
soft: css`
|
|
227
|
+
background: var(--lobe-alert-background);
|
|
228
|
+
box-shadow: inset 0 0 0 1px var(--lobe-alert-soft-border);
|
|
229
|
+
`,
|
|
230
|
+
outlined: css`
|
|
231
|
+
background: transparent;
|
|
232
|
+
box-shadow: inset 0 0 0 1px ${cssVar.colorBorderSecondary};
|
|
233
|
+
`,
|
|
234
|
+
plain: css`
|
|
235
|
+
padding-block: 2px;
|
|
236
|
+
padding-inline: 0;
|
|
237
|
+
background: transparent;
|
|
238
|
+
box-shadow: none;
|
|
239
|
+
`,
|
|
240
|
+
title: css`
|
|
241
|
+
font-size: 14px;
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
line-height: 20px;
|
|
244
|
+
color: inherit;
|
|
245
|
+
text-wrap: pretty;
|
|
246
|
+
overflow-wrap: anywhere;
|
|
247
|
+
`,
|
|
248
|
+
titleDetailed: css`
|
|
249
|
+
font-weight: 500;
|
|
250
|
+
`,
|
|
251
|
+
toneError: css`
|
|
252
|
+
--lobe-alert-accent: ${cssVar.colorError};
|
|
253
|
+
--lobe-alert-background: color-mix(
|
|
254
|
+
in srgb,
|
|
255
|
+
${cssVar.colorError} 5%,
|
|
256
|
+
${cssVar.colorBgContainer}
|
|
257
|
+
);
|
|
258
|
+
--lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorError} 14%, transparent);
|
|
259
|
+
`,
|
|
260
|
+
toneInfo: css`
|
|
261
|
+
--lobe-alert-accent: ${cssVar.colorInfo};
|
|
262
|
+
--lobe-alert-background: color-mix(in srgb, ${cssVar.colorInfo} 5%, ${cssVar.colorBgContainer});
|
|
263
|
+
--lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorInfo} 14%, transparent);
|
|
264
|
+
`,
|
|
265
|
+
toneSecondary: css`
|
|
266
|
+
--lobe-alert-accent: ${cssVar.colorTextSecondary};
|
|
267
|
+
--lobe-alert-background: color-mix(
|
|
268
|
+
in srgb,
|
|
269
|
+
${cssVar.colorTextSecondary} 4%,
|
|
270
|
+
${cssVar.colorBgContainer}
|
|
271
|
+
);
|
|
272
|
+
--lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorTextSecondary} 12%, transparent);
|
|
273
|
+
`,
|
|
274
|
+
toneSuccess: css`
|
|
275
|
+
--lobe-alert-accent: ${cssVar.colorSuccess};
|
|
276
|
+
--lobe-alert-background: color-mix(
|
|
277
|
+
in srgb,
|
|
278
|
+
${cssVar.colorSuccess} 5%,
|
|
279
|
+
${cssVar.colorBgContainer}
|
|
280
|
+
);
|
|
281
|
+
--lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorSuccess} 14%, transparent);
|
|
282
|
+
`,
|
|
283
|
+
toneWarning: css`
|
|
284
|
+
--lobe-alert-accent: ${cssVar.colorWarning};
|
|
285
|
+
--lobe-alert-background: color-mix(
|
|
286
|
+
in srgb,
|
|
287
|
+
${cssVar.colorWarning} 5%,
|
|
288
|
+
${cssVar.colorBgContainer}
|
|
289
|
+
);
|
|
290
|
+
--lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorWarning} 14%, transparent);
|
|
291
|
+
`,
|
|
292
|
+
unifiedRoot: css`
|
|
293
|
+
border-radius: 0;
|
|
294
|
+
background: transparent;
|
|
295
|
+
box-shadow: none;
|
|
296
|
+
`,
|
|
297
|
+
banner: css`
|
|
298
|
+
border-radius: 0;
|
|
299
|
+
box-shadow: none;
|
|
300
|
+
`,
|
|
301
|
+
wrappedAction: css`
|
|
302
|
+
@media (width <= 480px) {
|
|
303
|
+
order: 4;
|
|
304
|
+
width: calc(100% - 30px);
|
|
305
|
+
margin-block-start: -2px;
|
|
306
|
+
margin-inline-start: 30px;
|
|
307
|
+
}
|
|
308
|
+
`
|
|
309
|
+
}));
|
|
310
|
+
const toneVariants = cva("", {
|
|
311
|
+
defaultVariants: { type: "info" },
|
|
312
|
+
variants: { type: {
|
|
313
|
+
error: styles.toneError,
|
|
314
|
+
info: styles.toneInfo,
|
|
315
|
+
secondary: styles.toneSecondary,
|
|
316
|
+
success: styles.toneSuccess,
|
|
317
|
+
warning: styles.toneWarning
|
|
318
|
+
} }
|
|
319
|
+
});
|
|
320
|
+
const rootVariants = cva(styles.root, {
|
|
321
|
+
compoundVariants: [{
|
|
322
|
+
class: styles.unifiedRoot,
|
|
323
|
+
hasExtra: true
|
|
324
|
+
}],
|
|
325
|
+
defaultVariants: {
|
|
326
|
+
banner: false,
|
|
327
|
+
colorfulText: false,
|
|
328
|
+
glass: false,
|
|
329
|
+
hasDescription: false,
|
|
330
|
+
hasExtra: false,
|
|
331
|
+
variant: "soft"
|
|
332
|
+
},
|
|
333
|
+
variants: {
|
|
334
|
+
banner: {
|
|
335
|
+
false: null,
|
|
336
|
+
true: styles.banner
|
|
337
|
+
},
|
|
338
|
+
colorfulText: {
|
|
339
|
+
false: styles.neutralText,
|
|
340
|
+
true: styles.colorfulText
|
|
341
|
+
},
|
|
342
|
+
glass: {
|
|
343
|
+
false: null,
|
|
344
|
+
true: staticStylish.blur
|
|
345
|
+
},
|
|
346
|
+
hasDescription: {
|
|
347
|
+
false: null,
|
|
348
|
+
true: styles.detailed
|
|
349
|
+
},
|
|
350
|
+
hasExtra: {
|
|
351
|
+
false: null,
|
|
352
|
+
true: null
|
|
353
|
+
},
|
|
354
|
+
variant: {
|
|
355
|
+
borderless: styles.plain,
|
|
356
|
+
filled: styles.soft,
|
|
357
|
+
outlined: styles.outlined,
|
|
358
|
+
plain: styles.plain,
|
|
359
|
+
soft: styles.soft
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
const integratedVariants = cva(styles.integrated, {
|
|
364
|
+
defaultVariants: {
|
|
365
|
+
banner: false,
|
|
366
|
+
glass: false,
|
|
367
|
+
variant: "soft"
|
|
368
|
+
},
|
|
369
|
+
variants: {
|
|
370
|
+
banner: {
|
|
371
|
+
false: null,
|
|
372
|
+
true: styles.banner
|
|
373
|
+
},
|
|
374
|
+
glass: {
|
|
375
|
+
false: null,
|
|
376
|
+
true: staticStylish.blur
|
|
377
|
+
},
|
|
378
|
+
variant: {
|
|
379
|
+
borderless: styles.extraPlain,
|
|
380
|
+
filled: styles.soft,
|
|
381
|
+
outlined: styles.outlined,
|
|
382
|
+
plain: styles.extraPlain,
|
|
383
|
+
soft: styles.soft
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
const extraVariants = cva(styles.extra, {
|
|
388
|
+
defaultVariants: {
|
|
389
|
+
banner: false,
|
|
390
|
+
variant: "soft"
|
|
391
|
+
},
|
|
392
|
+
variants: {
|
|
393
|
+
banner: {
|
|
394
|
+
false: null,
|
|
395
|
+
true: styles.extraBanner
|
|
396
|
+
},
|
|
397
|
+
variant: {
|
|
398
|
+
borderless: styles.extraPlain,
|
|
399
|
+
filled: null,
|
|
400
|
+
outlined: null,
|
|
401
|
+
plain: styles.extraPlain,
|
|
402
|
+
soft: null
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
const extraHeaderVariants = cva(styles.extraHeader, {
|
|
407
|
+
defaultVariants: { variant: "soft" },
|
|
408
|
+
variants: { variant: {
|
|
409
|
+
borderless: styles.extraHeaderPlain,
|
|
410
|
+
filled: null,
|
|
411
|
+
outlined: null,
|
|
412
|
+
plain: styles.extraHeaderPlain,
|
|
413
|
+
soft: null
|
|
414
|
+
} }
|
|
415
|
+
});
|
|
416
|
+
//#endregion
|
|
417
|
+
export { extraHeaderVariants, extraVariants, integratedVariants, rootVariants, styles, toneVariants };
|
|
418
|
+
|
|
419
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Alert/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n action: css`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n\n min-height: 32px;\n margin-inline-start: auto;\n `,\n close: css`\n cursor: pointer;\n\n position: relative;\n scale: 1;\n\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 32px;\n height: 32px;\n margin: 0;\n padding: 0;\n border: none;\n border-radius: ${cssVar.borderRadiusSM};\n\n color: ${cssVar.colorTextTertiary};\n\n background: transparent;\n\n transition:\n color 160ms ${cssVar.motionEaseOut},\n background-color 160ms ${cssVar.motionEaseOut},\n scale 160ms ${cssVar.motionEaseOut};\n\n &::after {\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n translate: -50% -50%;\n\n width: 40px;\n height: 40px;\n }\n\n &:hover:not(:disabled) {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillTertiary};\n }\n\n &:active:not(:disabled) {\n scale: 0.96;\n }\n\n &:focus-visible {\n outline: 2px solid ${cssVar.colorPrimaryBorder};\n outline-offset: 1px;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition-duration: 0s;\n }\n `,\n colorfulText: css`\n color: var(--lobe-alert-accent);\n `,\n container: css`\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: 100%;\n `,\n content: css`\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n `,\n description: css`\n font-size: 13px;\n line-height: 20px;\n color: ${cssVar.colorTextSecondary};\n text-wrap: pretty;\n overflow-wrap: anywhere;\n `,\n detailed: css`\n padding-block: 12px;\n padding-inline: 14px;\n `,\n extra: css`\n position: relative;\n max-width: 100%;\n color: ${cssVar.colorText};\n `,\n extraBanner: css`\n border-radius: 0;\n `,\n extraContent: css`\n overflow: hidden;\n\n margin-block: 0 12px;\n margin-inline: 12px;\n padding: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n\n font-size: 12px;\n color: ${cssVar.colorText};\n\n background: ${cssVar.colorFillQuaternary};\n `,\n extraHeader: css`\n cursor: pointer;\n user-select: none;\n\n display: flex;\n gap: 6px;\n align-items: center;\n\n min-height: 40px;\n padding-block: 8px;\n padding-inline: 14px;\n border-block-start: 1px solid ${cssVar.colorBorderSecondary};\n border-radius: 0;\n\n font-size: 12px;\n font-weight: 500;\n line-height: 20px;\n color: ${cssVar.colorTextSecondary};\n\n background: transparent;\n\n transition:\n color 160ms ${cssVar.motionEaseOut},\n background-color 160ms ${cssVar.motionEaseOut};\n\n &::marker,\n &::-webkit-details-marker {\n content: '';\n display: none;\n }\n\n &:hover {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillQuaternary};\n }\n\n &:focus-visible {\n outline: 2px solid ${cssVar.colorPrimaryBorder};\n outline-offset: -2px;\n }\n `,\n extraHeaderPlain: css`\n margin-block-start: 6px;\n padding-inline: 0;\n border-block-start-color: ${cssVar.colorBorderSecondary};\n `,\n extraIndicator: css`\n flex-shrink: 0;\n color: ${cssVar.colorTextTertiary};\n transition: transform 160ms ${cssVar.motionEaseOut};\n\n details[open] > summary > & {\n transform: rotate(90deg);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition-duration: 0s;\n }\n `,\n extraPlain: css`\n background: transparent;\n `,\n icon: css`\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n height: 20px;\n\n color: var(--lobe-alert-accent);\n `,\n integrated: css`\n overflow: hidden;\n border-radius: ${cssVar.borderRadius};\n `,\n neutralText: css`\n color: ${cssVar.colorText};\n `,\n root: css`\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: flex-start;\n\n box-sizing: border-box;\n width: 100%;\n max-width: 100%;\n padding-block: 10px;\n padding-inline: 12px;\n border: none;\n border-radius: ${cssVar.borderRadius};\n\n font-size: 14px;\n color: ${cssVar.colorText};\n\n background: var(--lobe-alert-background);\n box-shadow: inset 0 0 0 1px var(--lobe-alert-soft-border);\n\n @media (width <= 480px) {\n flex-wrap: wrap;\n }\n `,\n soft: css`\n background: var(--lobe-alert-background);\n box-shadow: inset 0 0 0 1px var(--lobe-alert-soft-border);\n `,\n outlined: css`\n background: transparent;\n box-shadow: inset 0 0 0 1px ${cssVar.colorBorderSecondary};\n `,\n plain: css`\n padding-block: 2px;\n padding-inline: 0;\n background: transparent;\n box-shadow: none;\n `,\n title: css`\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: inherit;\n text-wrap: pretty;\n overflow-wrap: anywhere;\n `,\n titleDetailed: css`\n font-weight: 500;\n `,\n toneError: css`\n --lobe-alert-accent: ${cssVar.colorError};\n --lobe-alert-background: color-mix(\n in srgb,\n ${cssVar.colorError} 5%,\n ${cssVar.colorBgContainer}\n );\n --lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorError} 14%, transparent);\n `,\n toneInfo: css`\n --lobe-alert-accent: ${cssVar.colorInfo};\n --lobe-alert-background: color-mix(in srgb, ${cssVar.colorInfo} 5%, ${cssVar.colorBgContainer});\n --lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorInfo} 14%, transparent);\n `,\n toneSecondary: css`\n --lobe-alert-accent: ${cssVar.colorTextSecondary};\n --lobe-alert-background: color-mix(\n in srgb,\n ${cssVar.colorTextSecondary} 4%,\n ${cssVar.colorBgContainer}\n );\n --lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorTextSecondary} 12%, transparent);\n `,\n toneSuccess: css`\n --lobe-alert-accent: ${cssVar.colorSuccess};\n --lobe-alert-background: color-mix(\n in srgb,\n ${cssVar.colorSuccess} 5%,\n ${cssVar.colorBgContainer}\n );\n --lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorSuccess} 14%, transparent);\n `,\n toneWarning: css`\n --lobe-alert-accent: ${cssVar.colorWarning};\n --lobe-alert-background: color-mix(\n in srgb,\n ${cssVar.colorWarning} 5%,\n ${cssVar.colorBgContainer}\n );\n --lobe-alert-soft-border: color-mix(in srgb, ${cssVar.colorWarning} 14%, transparent);\n `,\n unifiedRoot: css`\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n `,\n banner: css`\n border-radius: 0;\n box-shadow: none;\n `,\n wrappedAction: css`\n @media (width <= 480px) {\n order: 4;\n width: calc(100% - 30px);\n margin-block-start: -2px;\n margin-inline-start: 30px;\n }\n `,\n}));\n\nexport const toneVariants = cva('', {\n defaultVariants: { type: 'info' },\n variants: {\n type: {\n error: styles.toneError,\n info: styles.toneInfo,\n secondary: styles.toneSecondary,\n success: styles.toneSuccess,\n warning: styles.toneWarning,\n },\n },\n});\n\nexport const rootVariants = cva(styles.root, {\n compoundVariants: [{ class: styles.unifiedRoot, hasExtra: true }],\n defaultVariants: {\n banner: false,\n colorfulText: false,\n glass: false,\n hasDescription: false,\n hasExtra: false,\n variant: 'soft',\n },\n variants: {\n banner: { false: null, true: styles.banner },\n colorfulText: { false: styles.neutralText, true: styles.colorfulText },\n glass: { false: null, true: lobeStaticStylish.blur },\n hasDescription: { false: null, true: styles.detailed },\n hasExtra: { false: null, true: null },\n variant: {\n borderless: styles.plain,\n filled: styles.soft,\n outlined: styles.outlined,\n plain: styles.plain,\n soft: styles.soft,\n },\n },\n});\n\nexport const integratedVariants = cva(styles.integrated, {\n defaultVariants: { banner: false, glass: false, variant: 'soft' },\n variants: {\n banner: { false: null, true: styles.banner },\n glass: { false: null, true: lobeStaticStylish.blur },\n variant: {\n borderless: styles.extraPlain,\n filled: styles.soft,\n outlined: styles.outlined,\n plain: styles.extraPlain,\n soft: styles.soft,\n },\n },\n});\n\nexport const extraVariants = cva(styles.extra, {\n defaultVariants: { banner: false, variant: 'soft' },\n variants: {\n banner: { false: null, true: styles.extraBanner },\n variant: {\n borderless: styles.extraPlain,\n filled: null,\n outlined: null,\n plain: styles.extraPlain,\n soft: null,\n },\n },\n});\n\nexport const extraHeaderVariants = cva(styles.extraHeader, {\n defaultVariants: { variant: 'soft' },\n variants: {\n variant: {\n borderless: styles.extraHeaderPlain,\n filled: null,\n outlined: null,\n plain: styles.extraHeaderPlain,\n soft: null,\n },\n },\n});\n"],"mappings":";;;;AAKA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,QAAQ,GAAG;;;;;;;;CAQX,OAAO,GAAG;;;;;;;;;;;;;;;;qBAgBS,OAAO,eAAe;;aAE9B,OAAO,kBAAkB;;;;;oBAKlB,OAAO,cAAc;+BACV,OAAO,cAAc;oBAChC,OAAO,cAAc;;;;;;;;;;;;;;;eAe1B,OAAO,UAAU;oBACZ,OAAO,kBAAkB;;;;;;;;2BAQlB,OAAO,mBAAmB;;;;;;;;;;;;;CAanD,cAAc,GAAG;;;CAGjB,WAAW,GAAG;;;;;;CAMd,SAAS,GAAG;;;;;;CAMZ,aAAa,GAAG;;;aAGL,OAAO,mBAAmB;;;;CAIrC,UAAU,GAAG;;;;CAIb,OAAO,GAAG;;;aAGC,OAAO,UAAU;;CAE5B,aAAa,GAAG;;;CAGhB,cAAc,GAAG;;;;;;qBAME,OAAO,eAAe;;;aAG9B,OAAO,UAAU;;kBAEZ,OAAO,oBAAoB;;CAE3C,aAAa,GAAG;;;;;;;;;;;oCAWkB,OAAO,qBAAqB;;;;;;aAMnD,OAAO,mBAAmB;;;;;oBAKnB,OAAO,cAAc;+BACV,OAAO,cAAc;;;;;;;;;eASrC,OAAO,UAAU;oBACZ,OAAO,oBAAoB;;;;2BAIpB,OAAO,mBAAmB;;;;CAInD,kBAAkB,GAAG;;;gCAGS,OAAO,qBAAqB;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EACnB,QAAQ;EACR,UAAU;EACV,OAAO,OAAO;EACd,MAAM;CACR,EACF;AACF,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { IconProps } from "../../Icon/type.mjs";
|
|
2
|
+
import "../../Icon/index.mjs";
|
|
3
|
+
import { ButtonHTMLAttributes, CSSProperties, HTMLAttributes, MouseEventHandler, ReactNode, Ref } from "react";
|
|
4
|
+
//#region src/base-ui/Alert/type.d.ts
|
|
5
|
+
type AlertType = 'success' | 'info' | 'warning' | 'error' | 'secondary';
|
|
6
|
+
type AlertVariant = 'soft' | 'outlined' | 'plain' |
|
|
7
|
+
/** @deprecated Use `soft` instead. */
|
|
8
|
+
'filled' |
|
|
9
|
+
/** @deprecated Use `plain` instead. */
|
|
10
|
+
'borderless';
|
|
11
|
+
type AlertRef = HTMLDivElement;
|
|
12
|
+
interface AlertCloseConfig extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onClick' | 'type'> {
|
|
13
|
+
/** Called after the alert has been removed from the document. */
|
|
14
|
+
afterClose?: () => void;
|
|
15
|
+
/** Custom close affordance. */
|
|
16
|
+
closeIcon?: ReactNode;
|
|
17
|
+
/** Called when the close affordance is activated. */
|
|
18
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
19
|
+
}
|
|
20
|
+
interface AlertClassNames {
|
|
21
|
+
action?: string;
|
|
22
|
+
/** @deprecated Use `root` instead. */
|
|
23
|
+
alert?: string;
|
|
24
|
+
close?: string;
|
|
25
|
+
container?: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
extra?: string;
|
|
29
|
+
extraContent?: string;
|
|
30
|
+
extraHeader?: string;
|
|
31
|
+
extraIndicator?: string;
|
|
32
|
+
icon?: string;
|
|
33
|
+
root?: string;
|
|
34
|
+
/** Alias for `content`, matching the former antd semantic part. */
|
|
35
|
+
section?: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
}
|
|
38
|
+
interface AlertStyles {
|
|
39
|
+
action?: CSSProperties;
|
|
40
|
+
/** @deprecated Use `root` instead. */
|
|
41
|
+
alert?: CSSProperties;
|
|
42
|
+
close?: CSSProperties;
|
|
43
|
+
container?: CSSProperties;
|
|
44
|
+
content?: CSSProperties;
|
|
45
|
+
description?: CSSProperties;
|
|
46
|
+
extra?: CSSProperties;
|
|
47
|
+
extraContent?: CSSProperties;
|
|
48
|
+
extraHeader?: CSSProperties;
|
|
49
|
+
extraIndicator?: CSSProperties;
|
|
50
|
+
icon?: CSSProperties;
|
|
51
|
+
root?: CSSProperties;
|
|
52
|
+
/** Alias for `content`, matching the former antd semantic part. */
|
|
53
|
+
section?: CSSProperties;
|
|
54
|
+
title?: CSSProperties;
|
|
55
|
+
}
|
|
56
|
+
interface AlertOwnProps {
|
|
57
|
+
/** Optional action rendered after the message content. */
|
|
58
|
+
action?: ReactNode;
|
|
59
|
+
/** @deprecated Use `closable.afterClose` instead. */
|
|
60
|
+
afterClose?: () => void;
|
|
61
|
+
/** Removes the side border and radius for full-width notices. */
|
|
62
|
+
banner?: boolean;
|
|
63
|
+
classNames?: AlertClassNames;
|
|
64
|
+
/** Whether the alert can be dismissed. */
|
|
65
|
+
closable?: AlertCloseConfig | boolean;
|
|
66
|
+
/** @deprecated Use `closable.closeIcon` instead. */
|
|
67
|
+
closeIcon?: ReactNode;
|
|
68
|
+
/** @deprecated Use `closable.closeIcon` instead. */
|
|
69
|
+
closeText?: ReactNode;
|
|
70
|
+
/** Whether the title adopts the semantic color. Neutral text is used by default. */
|
|
71
|
+
colorfulText?: boolean;
|
|
72
|
+
/** Supporting detail displayed beneath the title. */
|
|
73
|
+
description?: ReactNode;
|
|
74
|
+
/** Optional expandable or isolated detail content. */
|
|
75
|
+
extra?: ReactNode;
|
|
76
|
+
/** Whether expandable detail content starts open. */
|
|
77
|
+
extraDefaultExpand?: boolean;
|
|
78
|
+
/** Renders detail content as an independent sibling instead of a disclosure. */
|
|
79
|
+
extraIsolate?: boolean;
|
|
80
|
+
/** Enables backdrop blur for translucent host surfaces. */
|
|
81
|
+
glass?: boolean;
|
|
82
|
+
/** Custom semantic icon. */
|
|
83
|
+
icon?: IconProps['icon'];
|
|
84
|
+
/** Props forwarded to the Icon component. */
|
|
85
|
+
iconProps?: Omit<IconProps, 'icon'>;
|
|
86
|
+
/** @deprecated Use `title` instead. */
|
|
87
|
+
message?: ReactNode;
|
|
88
|
+
/** @deprecated Use `closable.onClose` instead. */
|
|
89
|
+
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
90
|
+
ref?: Ref<AlertRef>;
|
|
91
|
+
/** Alias for `className`, retained for migration compatibility. */
|
|
92
|
+
rootClassName?: string;
|
|
93
|
+
/** Whether the semantic icon is rendered. */
|
|
94
|
+
showIcon?: boolean;
|
|
95
|
+
styles?: AlertStyles;
|
|
96
|
+
text?: {
|
|
97
|
+
detail?: string;
|
|
98
|
+
};
|
|
99
|
+
/** Primary message content. */
|
|
100
|
+
title?: ReactNode;
|
|
101
|
+
/** Semantic tone. */
|
|
102
|
+
type?: AlertType;
|
|
103
|
+
/** Surface treatment. `filled` and `borderless` remain as migration aliases. */
|
|
104
|
+
variant?: AlertVariant;
|
|
105
|
+
}
|
|
106
|
+
type NativeAlertProps = Omit<HTMLAttributes<HTMLDivElement>, keyof AlertOwnProps | 'children' | 'title'>;
|
|
107
|
+
type AlertProps = AlertOwnProps & NativeAlertProps;
|
|
108
|
+
//#endregion
|
|
109
|
+
export { AlertClassNames, AlertCloseConfig, AlertProps, AlertRef, AlertStyles, AlertType, AlertVariant };
|
|
110
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -20,7 +20,7 @@ declare const SplitButtonMain: (props: ButtonProps) => import("react").JSX.Eleme
|
|
|
20
20
|
interface SplitButtonMenuProps extends Omit<DropdownMenuProps, 'children'> {
|
|
21
21
|
icon?: ReactNode;
|
|
22
22
|
}
|
|
23
|
-
declare const SplitButtonMenu: ({ icon, ...menuProps }: SplitButtonMenuProps) => import("react").JSX.Element;
|
|
23
|
+
declare const SplitButtonMenu: ({ icon, disabled, ...menuProps }: SplitButtonMenuProps) => import("react").JSX.Element;
|
|
24
24
|
type SplitButtonComponent = typeof SplitButton & {
|
|
25
25
|
Main: typeof SplitButtonMain;
|
|
26
26
|
Menu: typeof SplitButtonMenu;
|
|
@@ -7,7 +7,53 @@ import { createStaticStyles, cx } from "antd-style";
|
|
|
7
7
|
import { ChevronDownIcon } from "lucide-react";
|
|
8
8
|
//#region src/base-ui/Button/SplitButton.tsx
|
|
9
9
|
const SplitButtonContext = createContext({});
|
|
10
|
-
const styles = createStaticStyles(({ css }) => ({
|
|
10
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
11
|
+
interactionDisabled: css`
|
|
12
|
+
opacity: 0.5;
|
|
13
|
+
|
|
14
|
+
& > :where(button, a):disabled,
|
|
15
|
+
& > :where(button, a)[aria-disabled='true'] {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
solid: css`
|
|
20
|
+
& > :where(button, a):last-of-type::before {
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
content: '';
|
|
23
|
+
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset-block: 0;
|
|
26
|
+
inset-inline-start: 0;
|
|
27
|
+
|
|
28
|
+
width: 1px;
|
|
29
|
+
|
|
30
|
+
opacity: 0.2;
|
|
31
|
+
background: currentcolor;
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
solidDanger: css`
|
|
35
|
+
&:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {
|
|
36
|
+
border-color: ${cssVar.colorErrorHover};
|
|
37
|
+
background: ${cssVar.colorErrorHover};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {
|
|
41
|
+
border-color: ${cssVar.colorErrorActive};
|
|
42
|
+
background: ${cssVar.colorErrorActive};
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
solidPrimary: css`
|
|
46
|
+
&:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {
|
|
47
|
+
border-color: ${cssVar.colorPrimaryHover};
|
|
48
|
+
background: ${cssVar.colorPrimaryHover};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {
|
|
52
|
+
border-color: ${cssVar.colorPrimaryActive};
|
|
53
|
+
background: ${cssVar.colorPrimaryActive};
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
splitButton: css`
|
|
11
57
|
display: inline-flex;
|
|
12
58
|
flex-direction: row;
|
|
13
59
|
|
|
@@ -21,7 +67,8 @@ const styles = createStaticStyles(({ css }) => ({ splitButton: css`
|
|
|
21
67
|
border-start-start-radius: 0;
|
|
22
68
|
border-end-start-radius: 0;
|
|
23
69
|
}
|
|
24
|
-
`
|
|
70
|
+
`
|
|
71
|
+
}));
|
|
25
72
|
const SplitButton = ({ children, className, style, danger, disabled, loading, size, type }) => {
|
|
26
73
|
const shared = useMemo(() => ({
|
|
27
74
|
danger,
|
|
@@ -39,8 +86,8 @@ const SplitButton = ({ children, className, style, danger, disabled, loading, si
|
|
|
39
86
|
return /* @__PURE__ */ jsx(SplitButtonContext, {
|
|
40
87
|
value: shared,
|
|
41
88
|
children: /* @__PURE__ */ jsx("div", {
|
|
42
|
-
className: cx(styles.splitButton, className),
|
|
43
89
|
style,
|
|
90
|
+
className: cx(styles.splitButton, type === "primary" && styles.solid, type === "primary" && (danger ? styles.solidDanger : styles.solidPrimary), (disabled || loading) && styles.interactionDisabled, className),
|
|
44
91
|
children
|
|
45
92
|
})
|
|
46
93
|
});
|
|
@@ -52,12 +99,15 @@ const SplitButtonMain = (props) => {
|
|
|
52
99
|
...props
|
|
53
100
|
});
|
|
54
101
|
};
|
|
55
|
-
const SplitButtonMenu = ({ icon = /* @__PURE__ */ jsx(ChevronDownIcon, { size: 14 }), ...menuProps }) => {
|
|
102
|
+
const SplitButtonMenu = ({ icon = /* @__PURE__ */ jsx(ChevronDownIcon, { size: 14 }), disabled, ...menuProps }) => {
|
|
56
103
|
const shared = use(SplitButtonContext);
|
|
104
|
+
const interactionDisabled = disabled || shared.disabled || shared.loading;
|
|
57
105
|
return /* @__PURE__ */ jsx(DropdownMenu, {
|
|
58
106
|
...menuProps,
|
|
107
|
+
disabled: interactionDisabled,
|
|
59
108
|
children: /* @__PURE__ */ jsx(Button, {
|
|
60
109
|
...shared,
|
|
110
|
+
disabled: interactionDisabled,
|
|
61
111
|
icon
|
|
62
112
|
})
|
|
63
113
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.mjs","names":[],"sources":["../../../src/base-ui/Button/SplitButton.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport { ChevronDownIcon } from 'lucide-react';\nimport { createContext, type CSSProperties, type ReactNode, use, useMemo } from 'react';\n\nimport { DropdownMenu, type DropdownMenuProps } from '@/base-ui/DropdownMenu';\n\nimport Button from './Button';\nimport type { ButtonProps } from './type';\n\ninterface SharedVisualProps {\n danger?: boolean;\n disabled?: boolean;\n loading?: boolean;\n size?: ButtonProps['size'];\n type?: ButtonProps['type'];\n}\n\ninterface SplitButtonProps extends SharedVisualProps {\n children: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nconst SplitButtonContext = createContext<SharedVisualProps>({});\n\nconst styles = createStaticStyles(({ css }) => ({\n splitButton: css`\n display: inline-flex;\n flex-direction: row;\n\n & > :where(button, a):first-of-type {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > :where(button, a):last-of-type {\n margin-inline-start: -1px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n `,\n}));\n\nconst SplitButton = ({\n children,\n className,\n style,\n danger,\n disabled,\n loading,\n size,\n type,\n}: SplitButtonProps) => {\n const shared = useMemo<SharedVisualProps>(\n () => ({ danger, disabled, loading, size, type }),\n [danger, disabled, loading, size, type],\n );\n return (\n <SplitButtonContext value={shared}>\n <div
|
|
1
|
+
{"version":3,"file":"SplitButton.mjs","names":[],"sources":["../../../src/base-ui/Button/SplitButton.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport { ChevronDownIcon } from 'lucide-react';\nimport { createContext, type CSSProperties, type ReactNode, use, useMemo } from 'react';\n\nimport { DropdownMenu, type DropdownMenuProps } from '@/base-ui/DropdownMenu';\n\nimport Button from './Button';\nimport type { ButtonProps } from './type';\n\ninterface SharedVisualProps {\n danger?: boolean;\n disabled?: boolean;\n loading?: boolean;\n size?: ButtonProps['size'];\n type?: ButtonProps['type'];\n}\n\ninterface SplitButtonProps extends SharedVisualProps {\n children: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nconst SplitButtonContext = createContext<SharedVisualProps>({});\n\nconst styles = createStaticStyles(({ css, cssVar }) => ({\n interactionDisabled: css`\n opacity: 0.5;\n\n & > :where(button, a):disabled,\n & > :where(button, a)[aria-disabled='true'] {\n opacity: 1;\n }\n `,\n solid: css`\n & > :where(button, a):last-of-type::before {\n pointer-events: none;\n content: '';\n\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n\n width: 1px;\n\n opacity: 0.2;\n background: currentcolor;\n }\n `,\n solidDanger: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorHover};\n background: ${cssVar.colorErrorHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorActive};\n background: ${cssVar.colorErrorActive};\n }\n `,\n solidPrimary: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryHover};\n background: ${cssVar.colorPrimaryHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryActive};\n background: ${cssVar.colorPrimaryActive};\n }\n `,\n splitButton: css`\n display: inline-flex;\n flex-direction: row;\n\n & > :where(button, a):first-of-type {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > :where(button, a):last-of-type {\n margin-inline-start: -1px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n `,\n}));\n\nconst SplitButton = ({\n children,\n className,\n style,\n danger,\n disabled,\n loading,\n size,\n type,\n}: SplitButtonProps) => {\n const shared = useMemo<SharedVisualProps>(\n () => ({ danger, disabled, loading, size, type }),\n [danger, disabled, loading, size, type],\n );\n return (\n <SplitButtonContext value={shared}>\n <div\n style={style}\n className={cx(\n styles.splitButton,\n type === 'primary' && styles.solid,\n type === 'primary' && (danger ? styles.solidDanger : styles.solidPrimary),\n (disabled || loading) && styles.interactionDisabled,\n className,\n )}\n >\n {children}\n </div>\n </SplitButtonContext>\n );\n};\n\nconst SplitButtonMain = (props: ButtonProps) => {\n const shared = use(SplitButtonContext);\n return <Button {...shared} {...props} />;\n};\n\ninterface SplitButtonMenuProps extends Omit<DropdownMenuProps, 'children'> {\n icon?: ReactNode;\n}\n\nconst SplitButtonMenu = ({\n icon = <ChevronDownIcon size={14} />,\n disabled,\n ...menuProps\n}: SplitButtonMenuProps) => {\n const shared = use(SplitButtonContext);\n const interactionDisabled = disabled || shared.disabled || shared.loading;\n\n return (\n <DropdownMenu {...menuProps} disabled={interactionDisabled}>\n <Button {...shared} disabled={interactionDisabled} icon={icon} />\n </DropdownMenu>\n );\n};\n\ntype SplitButtonComponent = typeof SplitButton & {\n Main: typeof SplitButtonMain;\n Menu: typeof SplitButtonMenu;\n};\n\n(SplitButton as SplitButtonComponent).Main = SplitButtonMain;\n(SplitButton as SplitButtonComponent).Menu = SplitButtonMenu;\n\nexport type { SplitButtonMenuProps, SplitButtonProps };\nexport default SplitButton as SplitButtonComponent;\n"],"mappings":";;;;;;;;AA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AAU;GAA2B;EAAO,CAAA;CACpD,CAAA;AAElB;AAOA,YAAsC,OAAO;AAC7C,YAAsC,OAAO"}
|
|
@@ -24,7 +24,7 @@ declare const styles: {
|
|
|
24
24
|
declare const rootVariants: (props?: ({
|
|
25
25
|
shadow?: boolean | null | undefined;
|
|
26
26
|
size?: "large" | "middle" | "small" | null | undefined;
|
|
27
|
-
variant?: "filled" | "
|
|
27
|
+
variant?: "filled" | "borderless" | "outlined" | null | undefined;
|
|
28
28
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { rootVariants, styles };
|
package/es/base-ui/index.d.mts
CHANGED
|
@@ -29,27 +29,31 @@ import "./ScrollArea/index.mjs";
|
|
|
29
29
|
import { ToastAPI, ToastInstance, ToastOptions, ToastPosition, ToastPromiseOptions, ToastProps, ToastType } from "./Toast/type.mjs";
|
|
30
30
|
import { ToastHost, ToastHostProps, toast, useToast } from "./Toast/imperative.mjs";
|
|
31
31
|
import "./Toast/index.mjs";
|
|
32
|
+
import { AlertClassNames, AlertCloseConfig, AlertProps, AlertRef, AlertStyles, AlertType, AlertVariant } from "./Alert/type.mjs";
|
|
33
|
+
import Alert from "./Alert/Alert.mjs";
|
|
34
|
+
import { styles } from "./Alert/style.mjs";
|
|
35
|
+
import "./Alert/index.mjs";
|
|
32
36
|
import { InputClassNames, InputNumberProps, InputOTPProps, InputPasswordProps, InputProps, InputSize, InputStyles, InputVariant, TextAreaAutoSize, TextAreaProps } from "./Input/type.mjs";
|
|
33
37
|
import Input from "./Input/Input.mjs";
|
|
34
38
|
import InputNumber from "./Input/InputNumber.mjs";
|
|
35
39
|
import InputOTP from "./Input/InputOTP.mjs";
|
|
36
40
|
import InputPassword from "./Input/InputPassword.mjs";
|
|
37
|
-
import { rootVariants, styles as styles$
|
|
41
|
+
import { rootVariants, styles as styles$4 } from "./Input/style.mjs";
|
|
38
42
|
import TextArea from "./Input/TextArea.mjs";
|
|
39
43
|
import "./Input/index.mjs";
|
|
40
44
|
import { AutoCompleteOption, AutoCompleteProps } from "./AutoComplete/type.mjs";
|
|
41
45
|
import AutoComplete from "./AutoComplete/AutoComplete.mjs";
|
|
42
|
-
import { styles } from "./AutoComplete/style.mjs";
|
|
46
|
+
import { styles as styles$1 } from "./AutoComplete/style.mjs";
|
|
43
47
|
import "./AutoComplete/index.mjs";
|
|
44
48
|
import { ButtonIconPosition, ButtonProps, ButtonShape, ButtonSize, ButtonType } from "./Button/type.mjs";
|
|
45
49
|
import Button from "./Button/Button.mjs";
|
|
46
50
|
import _default, { SplitButtonMenuProps, SplitButtonProps } from "./Button/SplitButton.mjs";
|
|
47
|
-
import { styles as styles$
|
|
51
|
+
import { styles as styles$2 } from "./Button/style.mjs";
|
|
48
52
|
import "./Button/index.mjs";
|
|
49
53
|
import { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, CheckboxShape } from "./Checkbox/type.mjs";
|
|
50
54
|
import Checkbox from "./Checkbox/Checkbox.mjs";
|
|
51
55
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
52
|
-
import { styles as styles$
|
|
56
|
+
import { styles as styles$3 } from "./Checkbox/style.mjs";
|
|
53
57
|
import "./Checkbox/index.mjs";
|
|
54
58
|
import { ControlSize, controlHeight } from "./controlSize.mjs";
|
|
55
59
|
import { DrawerPlacement, DrawerProps, DrawerPush, DrawerSemanticNames, DrawerSemanticStyles } from "./Drawer/type.mjs";
|
|
@@ -83,7 +87,7 @@ import { Form } from "./Form/index.mjs";
|
|
|
83
87
|
import { RadioGroupOption, RadioGroupProps, RadioProps } from "./Radio/type.mjs";
|
|
84
88
|
import Radio from "./Radio/Radio.mjs";
|
|
85
89
|
import RadioGroup from "./Radio/RadioGroup.mjs";
|
|
86
|
-
import { styles as styles$
|
|
90
|
+
import { styles as styles$5 } from "./Radio/style.mjs";
|
|
87
91
|
import "./Radio/index.mjs";
|
|
88
92
|
import { SegmentedClassNames, SegmentedOption, SegmentedOptions, SegmentedOrientation, SegmentedProps, SegmentedSize, SegmentedStyles, SegmentedVariant } from "./Segmented/type.mjs";
|
|
89
93
|
import { SegmentedIndicator, SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedItemProps, SegmentedRoot, SegmentedRootProps } from "./Segmented/atoms.mjs";
|
|
@@ -96,16 +100,16 @@ import "./Select/index.mjs";
|
|
|
96
100
|
import { SliderProps, SliderWithInputProps } from "./Slider/type.mjs";
|
|
97
101
|
import Slider from "./Slider/Slider.mjs";
|
|
98
102
|
import SliderWithInput from "./Slider/SliderWithInput.mjs";
|
|
99
|
-
import { styles as styles$
|
|
103
|
+
import { styles as styles$6 } from "./Slider/style.mjs";
|
|
100
104
|
import "./Slider/index.mjs";
|
|
101
105
|
import { SwitchChangeEventHandler, SwitchClassNames, SwitchClickEventHandler, SwitchContextType, SwitchIconPosition, SwitchIconProps, SwitchProps, SwitchRootProps, SwitchSize, SwitchStyles, SwitchThumbProps } from "./Switch/type.mjs";
|
|
102
|
-
import { styles as styles$
|
|
106
|
+
import { styles as styles$7 } from "./Switch/style.mjs";
|
|
103
107
|
import { SwitchIcon, SwitchRoot, SwitchThumb, useSwitchContext } from "./Switch/atoms.mjs";
|
|
104
108
|
import Switch from "./Switch/Switch.mjs";
|
|
105
109
|
import "./Switch/index.mjs";
|
|
106
110
|
import { TabsClassNames, TabsIndicatorProps, TabsItem, TabsListProps, TabsOrientation, TabsPanelProps, TabsProps, TabsRootProps, TabsSize, TabsStyles, TabsTabProps, TabsVariant } from "./Tabs/type.mjs";
|
|
107
|
-
import { styles as styles$
|
|
111
|
+
import { styles as styles$8 } from "./Tabs/style.mjs";
|
|
108
112
|
import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
|
|
109
113
|
import Tabs from "./Tabs/Tabs.mjs";
|
|
110
114
|
import "./Tabs/index.mjs";
|
|
111
|
-
export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, type BaseModalProps, Button, type ButtonIconPosition, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, 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, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, 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, 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, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, 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, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, 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, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, 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, 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, TextArea, type TextAreaAutoSize, type TextAreaProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, styles as autoCompleteStyles, backdropTransition, styles$
|
|
115
|
+
export { Alert, type AlertClassNames, type AlertCloseConfig, type AlertProps, type AlertRef, type AlertStyles, type AlertType, type AlertVariant, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, type BaseModalProps, Button, type ButtonIconPosition, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, 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, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, 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, 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, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, 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, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, 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, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, 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, 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, TextArea, type TextAreaAutoSize, type TextAreaProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, styles as alertStyles, styles$1 as autoCompleteStyles, backdropTransition, styles$2 as buttonStyles, styles$3 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, getDrawerMotionConfig, styles$4 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$5 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$6 as sliderStyles, styles$7 as switchStyles, styles$8 as tabsStyles, toast, updateContextMenuItems, useDrawerActions, useDrawerOpen, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
|
package/es/base-ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Tooltip } from "./Tooltip/Tooltip.mjs";
|
|
2
2
|
import TooltipGroup from "./Tooltip/TooltipGroup.mjs";
|
|
3
|
-
import { styles as styles$
|
|
3
|
+
import { styles as styles$7 } from "./Switch/style.mjs";
|
|
4
4
|
import { SwitchIcon, SwitchRoot, SwitchThumb, useSwitchContext } from "./Switch/atoms.mjs";
|
|
5
5
|
import Switch from "./Switch/Switch.mjs";
|
|
6
6
|
import { DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger } from "./DropdownMenu/atoms.mjs";
|
|
@@ -19,19 +19,21 @@ import PopoverGroup from "./Popover/PopoverGroup.mjs";
|
|
|
19
19
|
import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
|
|
20
20
|
import { ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "./ScrollArea/atoms.mjs";
|
|
21
21
|
import { ScrollArea } from "./ScrollArea/ScrollArea.mjs";
|
|
22
|
+
import { styles } from "./Alert/style.mjs";
|
|
23
|
+
import Alert from "./Alert/Alert.mjs";
|
|
22
24
|
import { controlHeight } from "./controlSize.mjs";
|
|
23
|
-
import { rootVariants, styles as styles$
|
|
25
|
+
import { rootVariants, styles as styles$4 } from "./Input/style.mjs";
|
|
24
26
|
import Input from "./Input/Input.mjs";
|
|
25
27
|
import InputNumber from "./Input/InputNumber.mjs";
|
|
26
28
|
import InputOTP from "./Input/InputOTP.mjs";
|
|
27
29
|
import InputPassword from "./Input/InputPassword.mjs";
|
|
28
30
|
import TextArea from "./Input/TextArea.mjs";
|
|
29
|
-
import { styles } from "./AutoComplete/style.mjs";
|
|
31
|
+
import { styles as styles$1 } from "./AutoComplete/style.mjs";
|
|
30
32
|
import AutoComplete from "./AutoComplete/AutoComplete.mjs";
|
|
31
|
-
import { styles as styles$
|
|
33
|
+
import { styles as styles$2 } from "./Button/style.mjs";
|
|
32
34
|
import Button from "./Button/Button.mjs";
|
|
33
35
|
import SplitButton from "./Button/SplitButton.mjs";
|
|
34
|
-
import { styles as styles$
|
|
36
|
+
import { styles as styles$3 } from "./Checkbox/style.mjs";
|
|
35
37
|
import Checkbox from "./Checkbox/Checkbox.mjs";
|
|
36
38
|
import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
|
|
37
39
|
import { drawerBackdropTransition, getDrawerMotionConfig } from "./Drawer/constants.mjs";
|
|
@@ -53,17 +55,17 @@ import FormFooter from "./Form/components/FormFooter.mjs";
|
|
|
53
55
|
import FormGroup from "./Form/components/FormGroup.mjs";
|
|
54
56
|
import FormSubmitFooter from "./Form/components/FormSubmitFooter.mjs";
|
|
55
57
|
import { Form } from "./Form/index.mjs";
|
|
56
|
-
import { styles as styles$
|
|
58
|
+
import { styles as styles$5 } from "./Radio/style.mjs";
|
|
57
59
|
import Radio from "./Radio/Radio.mjs";
|
|
58
60
|
import RadioGroup from "./Radio/RadioGroup.mjs";
|
|
59
61
|
import { SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot } from "./Segmented/atoms.mjs";
|
|
60
62
|
import Segmented from "./Segmented/Segmented.mjs";
|
|
61
63
|
import { SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue } from "./Select/atoms.mjs";
|
|
62
64
|
import Select from "./Select/Select.mjs";
|
|
63
|
-
import { styles as styles$
|
|
65
|
+
import { styles as styles$6 } from "./Slider/style.mjs";
|
|
64
66
|
import Slider from "./Slider/Slider.mjs";
|
|
65
67
|
import SliderWithInput from "./Slider/SliderWithInput.mjs";
|
|
66
|
-
import { styles as styles$
|
|
68
|
+
import { styles as styles$8 } from "./Tabs/style.mjs";
|
|
67
69
|
import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
|
|
68
70
|
import Tabs from "./Tabs/Tabs.mjs";
|
|
69
|
-
export { AutoComplete, Button, Checkbox, CheckboxGroup, ContextMenuHost, ContextMenuTrigger, 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, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Radio, RadioGroup, 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, Slider, SliderWithInput, SplitButton, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, TextArea, ToastHost, Tooltip, TooltipGroup, styles as autoCompleteStyles, backdropTransition, styles$
|
|
71
|
+
export { Alert, AutoComplete, Button, Checkbox, CheckboxGroup, ContextMenuHost, ContextMenuTrigger, 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, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Radio, RadioGroup, 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, Slider, SliderWithInput, SplitButton, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, TextArea, ToastHost, Tooltip, TooltipGroup, styles as alertStyles, styles$1 as autoCompleteStyles, backdropTransition, styles$2 as buttonStyles, styles$3 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, getDrawerMotionConfig, styles$4 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$5 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$6 as sliderStyles, styles$7 as switchStyles, styles$8 as tabsStyles, toast, updateContextMenuItems, useDrawerActions, useDrawerOpen, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
|