@lobehub/ui 5.48.2 → 5.49.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/Highlighter/FullFeatured.mjs +1 -1
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/LangSelect.mjs +1 -1
- package/es/Highlighter/LangSelect.mjs.map +1 -1
- package/es/Highlighter/style.mjs +14 -11
- package/es/Highlighter/style.mjs.map +1 -1
- package/es/Mermaid/FullFeatured.mjs +1 -1
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/ThemeProvider/ThemeProvider.mjs +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/awesome/AgentSkillCard/AgentSkillCard.d.mts +6 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs +83 -0
- package/es/awesome/AgentSkillCard/AgentSkillCard.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/agents.d.mts +6 -0
- package/es/awesome/AgentSkillCard/agents.mjs +40 -0
- package/es/awesome/AgentSkillCard/agents.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/index.d.mts +4 -0
- package/es/awesome/AgentSkillCard/style.mjs +85 -0
- package/es/awesome/AgentSkillCard/style.mjs.map +1 -0
- package/es/awesome/AgentSkillCard/type.d.mts +41 -0
- package/es/awesome/BentoGrid/BentoCard.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoCard.mjs +39 -0
- package/es/awesome/BentoGrid/BentoCard.mjs.map +1 -0
- package/es/awesome/BentoGrid/BentoGrid.d.mts +6 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs +20 -0
- package/es/awesome/BentoGrid/BentoGrid.mjs.map +1 -0
- package/es/awesome/BentoGrid/index.d.mts +4 -0
- package/es/awesome/BentoGrid/style.mjs +102 -0
- package/es/awesome/BentoGrid/style.mjs.map +1 -0
- package/es/awesome/BentoGrid/type.d.mts +40 -0
- package/es/awesome/CodeShowcase/CodeShowcase.d.mts +6 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs +51 -0
- package/es/awesome/CodeShowcase/CodeShowcase.mjs.map +1 -0
- package/es/awesome/CodeShowcase/index.d.mts +3 -0
- package/es/awesome/CodeShowcase/style.mjs +50 -0
- package/es/awesome/CodeShowcase/style.mjs.map +1 -0
- package/es/awesome/CodeShowcase/type.d.mts +27 -0
- package/es/awesome/FeatureGrid/FeatureGrid.d.mts +6 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs +48 -0
- package/es/awesome/FeatureGrid/FeatureGrid.mjs.map +1 -0
- package/es/awesome/FeatureGrid/index.d.mts +3 -0
- package/es/awesome/FeatureGrid/style.mjs +75 -0
- package/es/awesome/FeatureGrid/style.mjs.map +1 -0
- package/es/awesome/FeatureGrid/type.d.mts +25 -0
- package/es/awesome/FluidGradient/FluidGradient.d.mts +6 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs +293 -0
- package/es/awesome/FluidGradient/FluidGradient.mjs.map +1 -0
- package/es/awesome/FluidGradient/index.d.mts +3 -0
- package/es/awesome/FluidGradient/style.mjs +52 -0
- package/es/awesome/FluidGradient/style.mjs.map +1 -0
- package/es/awesome/FluidGradient/type.d.mts +22 -0
- package/es/awesome/InstallBanner/InstallBanner.d.mts +6 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs +35 -0
- package/es/awesome/InstallBanner/InstallBanner.mjs.map +1 -0
- package/es/awesome/InstallBanner/index.d.mts +3 -0
- package/es/awesome/InstallBanner/style.mjs +46 -0
- package/es/awesome/InstallBanner/style.mjs.map +1 -0
- package/es/awesome/InstallBanner/type.d.mts +18 -0
- package/es/awesome/LandingHero/LandingHero.d.mts +6 -0
- package/es/awesome/LandingHero/LandingHero.mjs +55 -0
- package/es/awesome/LandingHero/LandingHero.mjs.map +1 -0
- package/es/awesome/LandingHero/index.d.mts +3 -0
- package/es/awesome/LandingHero/style.mjs +155 -0
- package/es/awesome/LandingHero/style.mjs.map +1 -0
- package/es/awesome/LandingHero/type.d.mts +29 -0
- package/es/awesome/LandingSection/LandingSection.d.mts +6 -0
- package/es/awesome/LandingSection/LandingSection.mjs +61 -0
- package/es/awesome/LandingSection/LandingSection.mjs.map +1 -0
- package/es/awesome/LandingSection/index.d.mts +3 -0
- package/es/awesome/LandingSection/style.mjs +88 -0
- package/es/awesome/LandingSection/style.mjs.map +1 -0
- package/es/awesome/LandingSection/type.d.mts +40 -0
- package/es/awesome/LogoMarquee/LogoMarquee.d.mts +6 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs +52 -0
- package/es/awesome/LogoMarquee/LogoMarquee.mjs.map +1 -0
- package/es/awesome/LogoMarquee/index.d.mts +3 -0
- package/es/awesome/LogoMarquee/style.mjs +70 -0
- package/es/awesome/LogoMarquee/style.mjs.map +1 -0
- package/es/awesome/LogoMarquee/type.d.mts +40 -0
- package/es/awesome/index.d.mts +33 -1
- package/es/awesome/index.mjs +13 -1
- package/es/awesome/landingActions.d.mts +20 -0
- package/es/awesome/landingActions.mjs +123 -0
- package/es/awesome/landingActions.mjs.map +1 -0
- package/es/awesome/landingIcon.mjs +13 -0
- package/es/awesome/landingIcon.mjs.map +1 -0
- package/es/awesome/landingLink.d.mts +12 -0
- package/es/awesome/landingLink.mjs +23 -0
- package/es/awesome/landingLink.mjs.map +1 -0
- package/es/awesome/landingTokens.d.mts +10 -0
- package/es/awesome/landingTokens.mjs +19 -0
- package/es/awesome/landingTokens.mjs.map +1 -0
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/Segmented/atoms.mjs +1 -0
- package/es/base-ui/Segmented/atoms.mjs.map +1 -1
- package/es/base-ui/Segmented/style.mjs +127 -125
- package/es/base-ui/Segmented/style.mjs.map +1 -1
- package/es/base-ui/index.mjs +4 -4
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +9 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs +54 -0
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -0
- package/es/dashboard/AuthLayout/index.d.mts +3 -0
- package/es/dashboard/AuthLayout/style.mjs +120 -0
- package/es/dashboard/AuthLayout/style.mjs.map +1 -0
- package/es/dashboard/AuthLayout/type.d.mts +16 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.d.mts +9 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs +55 -0
- package/es/dashboard/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/index.d.mts +3 -0
- package/es/dashboard/Breadcrumb/style.mjs +66 -0
- package/es/dashboard/Breadcrumb/style.mjs.map +1 -0
- package/es/dashboard/Breadcrumb/type.d.mts +25 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.d.mts +9 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs +275 -0
- package/es/dashboard/ConsoleNav/ConsoleNav.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/active.d.mts +7 -0
- package/es/dashboard/ConsoleNav/active.mjs +29 -0
- package/es/dashboard/ConsoleNav/active.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +4 -0
- package/es/dashboard/ConsoleNav/style.mjs +283 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/type.d.mts +71 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs +37 -0
- package/es/dashboard/ConsoleShell/ConsoleBrand.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +9 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +149 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/context.d.mts +6 -0
- package/es/dashboard/ConsoleShell/context.mjs +16 -0
- package/es/dashboard/ConsoleShell/context.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/index.d.mts +5 -0
- package/es/dashboard/ConsoleShell/style.mjs +209 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -0
- package/es/dashboard/ConsoleShell/type.d.mts +67 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.d.mts +17 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +151 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/context.d.mts +7 -0
- package/es/dashboard/FilterSidebar/context.mjs +19 -0
- package/es/dashboard/FilterSidebar/context.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/index.d.mts +4 -0
- package/es/dashboard/FilterSidebar/style.mjs +155 -0
- package/es/dashboard/FilterSidebar/style.mjs.map +1 -0
- package/es/dashboard/FilterSidebar/type.d.mts +44 -0
- package/es/dashboard/FilterSidebar/width.mjs +18 -0
- package/es/dashboard/FilterSidebar/width.mjs.map +1 -0
- package/es/dashboard/PageHeader/PageHeader.d.mts +9 -0
- package/es/dashboard/PageHeader/PageHeader.mjs +37 -0
- package/es/dashboard/PageHeader/PageHeader.mjs.map +1 -0
- package/es/dashboard/PageHeader/index.d.mts +3 -0
- package/es/dashboard/PageHeader/style.mjs +47 -0
- package/es/dashboard/PageHeader/style.mjs.map +1 -0
- package/es/dashboard/PageHeader/type.d.mts +14 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.d.mts +25 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +136 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/style.mjs +122 -0
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -0
- package/es/dashboard/PageSkeleton/type.d.mts +22 -0
- package/es/dashboard/PageTabs/PageTabs.d.mts +9 -0
- package/es/dashboard/PageTabs/PageTabs.mjs +37 -0
- package/es/dashboard/PageTabs/PageTabs.mjs.map +1 -0
- package/es/dashboard/PageTabs/index.d.mts +3 -0
- package/es/dashboard/PageTabs/style.mjs +57 -0
- package/es/dashboard/PageTabs/style.mjs.map +1 -0
- package/es/dashboard/PageTabs/type.d.mts +17 -0
- package/es/dashboard/RouteProgress/RouteProgress.d.mts +9 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs +44 -0
- package/es/dashboard/RouteProgress/RouteProgress.mjs.map +1 -0
- package/es/dashboard/RouteProgress/style.mjs +19 -0
- package/es/dashboard/RouteProgress/style.mjs.map +1 -0
- package/es/dashboard/RouteProgress/type.d.mts +8 -0
- package/es/dashboard/StatCard/StatCard.d.mts +9 -0
- package/es/dashboard/StatCard/StatCard.mjs +84 -0
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -0
- package/es/dashboard/StatCard/index.d.mts +3 -0
- package/es/dashboard/StatCard/style.mjs +135 -0
- package/es/dashboard/StatCard/style.mjs.map +1 -0
- package/es/dashboard/StatCard/type.d.mts +26 -0
- package/es/dashboard/Surface/Surface.d.mts +13 -0
- package/es/dashboard/Surface/Surface.mjs +20 -0
- package/es/dashboard/Surface/Surface.mjs.map +1 -0
- package/es/dashboard/Surface/index.d.mts +4 -0
- package/es/dashboard/Surface/style.d.mts +14 -0
- package/es/dashboard/Surface/style.mjs +22 -0
- package/es/dashboard/Surface/style.mjs.map +1 -0
- package/es/dashboard/Surface/type.d.mts +8 -0
- package/es/dashboard/hooks.mjs +49 -0
- package/es/dashboard/hooks.mjs.map +1 -0
- package/es/dashboard/index.d.mts +37 -0
- package/es/dashboard/index.d.ts +1 -0
- package/es/dashboard/index.js +1 -0
- package/es/dashboard/index.mjs +17 -0
- package/es/static-css/registry.mjs +2 -2
- package/es/static-css/registry.mjs.map +1 -1
- package/es/storybook/StoryBook/index.mjs +4 -0
- package/es/storybook/StoryBook/index.mjs.map +1 -1
- package/es/storybook/StoryBook/style.mjs +7 -2
- package/es/storybook/StoryBook/style.mjs.map +1 -1
- package/es/styles/theme/token/base.mjs +2 -2
- package/es/styles/theme/token/base.mjs.map +1 -1
- package/package.json +6 -2
package/es/awesome/index.mjs
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import Spotlight from "./Spotlight/Spotlight.mjs";
|
|
2
|
+
import { DEFAULT_SKILL_AGENTS } from "./AgentSkillCard/agents.mjs";
|
|
3
|
+
import AgentSkillCard from "./AgentSkillCard/AgentSkillCard.mjs";
|
|
2
4
|
import AuroraBackground from "./AuroraBackground/AuroraBackground.mjs";
|
|
5
|
+
import BentoCard from "./BentoGrid/BentoCard.mjs";
|
|
6
|
+
import BentoGrid from "./BentoGrid/BentoGrid.mjs";
|
|
3
7
|
import BottomGradientButton from "./BottomGradientButton/BottomGradientButton.mjs";
|
|
8
|
+
import CodeShowcase from "./CodeShowcase/CodeShowcase.mjs";
|
|
9
|
+
import FeatureGrid from "./FeatureGrid/FeatureGrid.mjs";
|
|
4
10
|
import SpotlightCard from "./SpotlightCard/SpotlightCard.mjs";
|
|
5
11
|
import Features from "./Features/Features.mjs";
|
|
12
|
+
import { LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, accentGradient } from "./landingTokens.mjs";
|
|
13
|
+
import FluidGradient from "./FluidGradient/FluidGradient.mjs";
|
|
6
14
|
import Giscus from "./Giscus/Giscus.mjs";
|
|
7
15
|
import GradientButton from "./GradientButton/GradientButton.mjs";
|
|
8
16
|
import GridBackground from "./GridBackground/GridBackground.mjs";
|
|
9
17
|
import GridShowcase from "./GridBackground/GridShowcase.mjs";
|
|
10
18
|
import Hero from "./Hero/Hero.mjs";
|
|
19
|
+
import InstallBanner from "./InstallBanner/InstallBanner.mjs";
|
|
20
|
+
import LandingHero from "./LandingHero/LandingHero.mjs";
|
|
21
|
+
import LandingSection from "./LandingSection/LandingSection.mjs";
|
|
22
|
+
import LogoMarquee from "./LogoMarquee/LogoMarquee.mjs";
|
|
11
23
|
import Spline from "./Spline/Spine.mjs";
|
|
12
24
|
import TypewriterEffect from "./TypewriterEffect/TypewriterEffect.mjs";
|
|
13
|
-
export { AuroraBackground, BottomGradientButton, Features, Giscus, GradientButton, GridBackground, GridShowcase, Hero, Spline, Spotlight, SpotlightCard, TypewriterEffect };
|
|
25
|
+
export { AgentSkillCard, AuroraBackground, BentoCard, BentoGrid, BottomGradientButton, CodeShowcase, DEFAULT_SKILL_AGENTS, FeatureGrid, Features, FluidGradient, Giscus, GradientButton, GridBackground, GridShowcase, Hero, InstallBanner, LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, LandingHero, LandingSection, LogoMarquee, Spline, Spotlight, SpotlightCard, TypewriterEffect, accentGradient as landingAccentGradient };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IconProps } from "../Icon/type.mjs";
|
|
2
|
+
import "../Icon/index.mjs";
|
|
3
|
+
import "./landingLink.mjs";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/awesome/landingActions.d.ts
|
|
6
|
+
interface LandingAction {
|
|
7
|
+
/** Opens in a new tab. Inferred from absolute URLs when omitted. */
|
|
8
|
+
external?: boolean;
|
|
9
|
+
href: string;
|
|
10
|
+
icon?: IconProps['icon'];
|
|
11
|
+
/** Places the icon after the label, e.g. for an arrow. */
|
|
12
|
+
iconPlacement?: 'start' | 'end';
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** The primary action is a filled pill; others render as BottomGradientButton. */
|
|
15
|
+
primary?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type LandingNavigate = (href: string) => void;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { LandingAction, LandingNavigate };
|
|
20
|
+
//# sourceMappingURL=landingActions.d.mts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import Icon from "../Icon/Icon.mjs";
|
|
2
|
+
import { isExternalHref, renderLandingLink } from "./landingLink.mjs";
|
|
3
|
+
import BottomGradientButton from "./BottomGradientButton/BottomGradientButton.mjs";
|
|
4
|
+
import { accentGradient } from "./landingTokens.mjs";
|
|
5
|
+
import { Fragment } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createStaticStyles, cx } from "antd-style";
|
|
8
|
+
//#region src/awesome/landingActions.tsx
|
|
9
|
+
const styles = createStaticStyles(({ css, cssVar, responsive }) => ({
|
|
10
|
+
action: css`
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
|
|
16
|
+
min-block-size: 44px;
|
|
17
|
+
padding-block: 0;
|
|
18
|
+
padding-inline: 22px;
|
|
19
|
+
border: 1px solid transparent;
|
|
20
|
+
border-radius: 999px;
|
|
21
|
+
|
|
22
|
+
font-size: ${cssVar.fontSize};
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
color: ${cssVar.colorText};
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
|
|
28
|
+
background-image:
|
|
29
|
+
linear-gradient(${cssVar.colorBgContainer}, ${cssVar.colorBgContainer}), ${accentGradient};
|
|
30
|
+
background-clip: padding-box, border-box;
|
|
31
|
+
background-origin: border-box;
|
|
32
|
+
|
|
33
|
+
transition:
|
|
34
|
+
filter 140ms ease,
|
|
35
|
+
transform 90ms ease;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
color: ${cssVar.colorText};
|
|
39
|
+
filter: brightness(1.06);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:active {
|
|
43
|
+
transform: scale(0.97);
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
actionPrimary: css`
|
|
47
|
+
&& {
|
|
48
|
+
color: ${cssVar.colorBgContainer};
|
|
49
|
+
background: ${cssVar.colorText};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&&:hover {
|
|
53
|
+
color: ${cssVar.colorBgContainer};
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
actionSmall: css`
|
|
57
|
+
&& {
|
|
58
|
+
gap: 6px;
|
|
59
|
+
min-block-size: 34px;
|
|
60
|
+
padding-inline: 14px;
|
|
61
|
+
font-size: ${cssVar.fontSizeSM};
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
group: css`
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
gap: 12px;
|
|
68
|
+
|
|
69
|
+
&[data-size='small'] {
|
|
70
|
+
gap: 8px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
${responsive.mobile} {
|
|
74
|
+
&[data-size='large'] {
|
|
75
|
+
align-self: stretch;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-size='large'] > * {
|
|
79
|
+
flex: 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
}));
|
|
84
|
+
const LandingActions = ({ actions, className, onNavigate, renderLink, size = "large" }) => /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: cx(styles.group, className),
|
|
86
|
+
"data-size": size,
|
|
87
|
+
children: actions.map(({ external, href, icon, iconPlacement = "start", label, primary }) => {
|
|
88
|
+
const iconNode = icon && /* @__PURE__ */ jsx(Icon, {
|
|
89
|
+
icon,
|
|
90
|
+
size: size === "small" ? 14 : 16
|
|
91
|
+
});
|
|
92
|
+
if (!primary) {
|
|
93
|
+
const isExternal = external ?? isExternalHref(href);
|
|
94
|
+
return /* @__PURE__ */ jsx(BottomGradientButton, {
|
|
95
|
+
href,
|
|
96
|
+
icon: iconNode,
|
|
97
|
+
iconPlacement,
|
|
98
|
+
rel: isExternal ? "noreferrer" : void 0,
|
|
99
|
+
size: size === "small" ? "middle" : "large",
|
|
100
|
+
target: isExternal ? "_blank" : void 0,
|
|
101
|
+
onClick: !isExternal && onNavigate ? (event) => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
onNavigate(href);
|
|
104
|
+
} : void 0,
|
|
105
|
+
children: label
|
|
106
|
+
}, href);
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsx(Fragment, { children: renderLandingLink(renderLink, {
|
|
109
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
110
|
+
iconPlacement === "start" && iconNode,
|
|
111
|
+
label,
|
|
112
|
+
iconPlacement === "end" && iconNode
|
|
113
|
+
] }),
|
|
114
|
+
className: cx(styles.action, styles.actionPrimary, size === "small" && styles.actionSmall),
|
|
115
|
+
external,
|
|
116
|
+
href
|
|
117
|
+
}) }, href);
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { LandingActions };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=landingActions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landingActions.mjs","names":[],"sources":["../../src/awesome/landingActions.tsx"],"sourcesContent":["import { createStaticStyles, cx } from 'antd-style';\nimport { Fragment, type ReactNode } from 'react';\n\nimport BottomGradientButton from '@/awesome/BottomGradientButton';\nimport { isExternalHref, type LandingLinkRender, renderLandingLink } from '@/awesome/landingLink';\nimport { accentGradient } from '@/awesome/landingTokens';\nimport Icon, { type IconProps } from '@/Icon';\n\nexport interface LandingAction {\n /** Opens in a new tab. Inferred from absolute URLs when omitted. */\n external?: boolean;\n href: string;\n icon?: IconProps['icon'];\n /** Places the icon after the label, e.g. for an arrow. */\n iconPlacement?: 'start' | 'end';\n label: ReactNode;\n /** The primary action is a filled pill; others render as BottomGradientButton. */\n primary?: boolean;\n}\n\nconst styles = createStaticStyles(({ css, cssVar, responsive }) => ({\n action: css`\n display: inline-flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n\n min-block-size: 44px;\n padding-block: 0;\n padding-inline: 22px;\n border: 1px solid transparent;\n border-radius: 999px;\n\n font-size: ${cssVar.fontSize};\n font-weight: 600;\n color: ${cssVar.colorText};\n text-decoration: none;\n white-space: nowrap;\n\n background-image:\n linear-gradient(${cssVar.colorBgContainer}, ${cssVar.colorBgContainer}), ${accentGradient};\n background-clip: padding-box, border-box;\n background-origin: border-box;\n\n transition:\n filter 140ms ease,\n transform 90ms ease;\n\n &:hover {\n color: ${cssVar.colorText};\n filter: brightness(1.06);\n }\n\n &:active {\n transform: scale(0.97);\n }\n `,\n actionPrimary: css`\n && {\n color: ${cssVar.colorBgContainer};\n background: ${cssVar.colorText};\n }\n\n &&:hover {\n color: ${cssVar.colorBgContainer};\n }\n `,\n actionSmall: css`\n && {\n gap: 6px;\n min-block-size: 34px;\n padding-inline: 14px;\n font-size: ${cssVar.fontSizeSM};\n }\n `,\n group: css`\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n\n &[data-size='small'] {\n gap: 8px;\n }\n\n ${responsive.mobile} {\n &[data-size='large'] {\n align-self: stretch;\n }\n\n &[data-size='large'] > * {\n flex: 1;\n }\n }\n `,\n}));\n\nexport type LandingNavigate = (href: string) => void;\n\nexport interface LandingActionsProps {\n actions: LandingAction[];\n className?: string;\n /** Client-side navigation for internal non-primary actions, which render as buttons with an href. */\n onNavigate?: LandingNavigate;\n renderLink?: LandingLinkRender;\n size?: 'large' | 'small';\n}\n\nexport const LandingActions = ({\n actions,\n className,\n onNavigate,\n renderLink,\n size = 'large',\n}: LandingActionsProps) => (\n <div className={cx(styles.group, className)} data-size={size}>\n {actions.map(({ external, href, icon, iconPlacement = 'start', label, primary }) => {\n const iconNode = icon && <Icon icon={icon} size={size === 'small' ? 14 : 16} />;\n if (!primary) {\n const isExternal = external ?? isExternalHref(href);\n return (\n <BottomGradientButton\n href={href}\n icon={iconNode}\n iconPlacement={iconPlacement}\n key={href}\n rel={isExternal ? 'noreferrer' : undefined}\n size={size === 'small' ? 'middle' : 'large'}\n target={isExternal ? '_blank' : undefined}\n onClick={\n !isExternal && onNavigate\n ? (event) => {\n event.preventDefault();\n onNavigate(href);\n }\n : undefined\n }\n >\n {label}\n </BottomGradientButton>\n );\n }\n return (\n <Fragment key={href}>\n {renderLandingLink(renderLink, {\n children: (\n <>\n {iconPlacement === 'start' && iconNode}\n {label}\n {iconPlacement === 'end' && iconNode}\n </>\n ),\n className: cx(\n styles.action,\n styles.actionPrimary,\n size === 'small' && styles.actionSmall,\n ),\n external,\n href,\n })}\n </Fragment>\n );\n })}\n </div>\n);\n"],"mappings":";;;;;;;;AAoBA,MAAM,SAAS,oBAAoB,EAAE,KAAK,QAAQ,kBAAkB;CAClE,QAAQ,GAAG;;;;;;;;;;;;iBAYI,OAAO,SAAS;;aAEpB,OAAO,UAAU;;;;;wBAKN,OAAO,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,eAAe;;;;;;;;;eASjF,OAAO,UAAU;;;;;;;;CAQ9B,eAAe,GAAG;;eAEL,OAAO,iBAAiB;oBACnB,OAAO,UAAU;;;;eAItB,OAAO,iBAAiB;;;CAGrC,aAAa,GAAG;;;;;mBAKC,OAAO,WAAW;;;CAGnC,OAAO,GAAG;;;;;;;;;MASN,WAAW,OAAO;;;;;;;;;;AAUxB,EAAE;AAaF,MAAa,kBAAkB,EAC7B,SACA,WACA,YACA,YACA,OAAO,cAEP,oBAAC,OAAD;CAAK,WAAW,GAAG,OAAO,OAAO,SAAS;CAAG,aAAW;CACrD,UAAA,QAAQ,KAAK,EAAE,UAAU,MAAM,MAAM,gBAAgB,SAAS,OAAO,cAAc;EAClF,MAAM,WAAW,QAAQ,oBAAC,MAAD;GAAY;GAAM,MAAM,SAAS,UAAU,KAAK;EAAK,CAAA;EAC9E,IAAI,CAAC,SAAS;GACZ,MAAM,aAAa,YAAY,eAAe,IAAI;GAClD,OACE,oBAAC,sBAAD;IACQ;IACN,MAAM;IACS;IAEf,KAAK,aAAa,eAAe,KAAA;IACjC,MAAM,SAAS,UAAU,WAAW;IACpC,QAAQ,aAAa,WAAW,KAAA;IAChC,SACE,CAAC,cAAc,cACV,UAAU;KACT,MAAM,eAAe;KACrB,WAAW,IAAI;IACjB,IACA,KAAA;IAGL,UAAA;GACmB,GAdf,IAce;EAE1B;EACA,OACE,oBAAC,UAAD,EAAA,UACG,kBAAkB,YAAY;GAC7B,UACE,qBAAA,YAAA,EAAA,UAAA;IACG,kBAAkB,WAAW;IAC7B;IACA,kBAAkB,SAAS;GAC5B,EAAA,CAAA;GAEJ,WAAW,GACT,OAAO,QACP,OAAO,eACP,SAAS,WAAW,OAAO,WAC7B;GACA;GACA;EACF,CAAC,EACO,GAjBK,IAiBL;CAEd,CAAC;AACE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isValidElement } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/awesome/landingIcon.tsx
|
|
4
|
+
const isElementType = (icon) => typeof icon === "function" || typeof icon === "object" && icon !== null && !isValidElement(icon) && "$$typeof" in icon;
|
|
5
|
+
/** Renders an icon given either a component (e.g. from `@lobehub/icons`) or a ready-made node. */
|
|
6
|
+
const renderLandingIcon = (icon, size) => {
|
|
7
|
+
if (!isElementType(icon)) return icon;
|
|
8
|
+
return /* @__PURE__ */ jsx(icon, { size });
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { renderLandingIcon };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=landingIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landingIcon.mjs","names":["IconComponent"],"sources":["../../src/awesome/landingIcon.tsx"],"sourcesContent":["import { type ElementType, isValidElement, type ReactNode } from 'react';\n\nexport type LandingIconSource = ElementType<{ size: number }> | ReactNode;\n\nconst isElementType = (icon: LandingIconSource): icon is ElementType<{ size: number }> =>\n typeof icon === 'function' ||\n (typeof icon === 'object' && icon !== null && !isValidElement(icon) && '$$typeof' in icon);\n\n/** Renders an icon given either a component (e.g. from `@lobehub/icons`) or a ready-made node. */\nexport const renderLandingIcon = (icon: LandingIconSource, size: number): ReactNode => {\n if (!isElementType(icon)) return icon as ReactNode;\n const IconComponent = icon;\n return <IconComponent size={size} />;\n};\n"],"mappings":";;;AAIA,MAAM,iBAAiB,SACrB,OAAO,SAAS,cACf,OAAO,SAAS,YAAY,SAAS,QAAQ,CAAC,eAAe,IAAI,KAAK,cAAc;;AAGvF,MAAa,qBAAqB,MAAyB,SAA4B;CACrF,IAAI,CAAC,cAAc,IAAI,GAAG,OAAO;CAEjC,OAAO,oBAACA,MAAD,EAAqB,KAAO,CAAA;AACrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/awesome/landingLink.d.ts
|
|
3
|
+
interface LandingLinkProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
external?: boolean;
|
|
7
|
+
href: string;
|
|
8
|
+
}
|
|
9
|
+
type LandingLinkRender = (props: LandingLinkProps) => ReactNode;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { LandingLinkProps, LandingLinkRender };
|
|
12
|
+
//# sourceMappingURL=landingLink.d.mts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/awesome/landingLink.tsx
|
|
3
|
+
const isExternalHref = (href) => /^[a-z][\d+.a-z-]*:/i.test(href);
|
|
4
|
+
const renderLandingLink = (renderLink, { external, href, ...props }) => {
|
|
5
|
+
const isExternal = external ?? isExternalHref(href);
|
|
6
|
+
if (renderLink) return renderLink({
|
|
7
|
+
...props,
|
|
8
|
+
external: isExternal,
|
|
9
|
+
href
|
|
10
|
+
});
|
|
11
|
+
return /* @__PURE__ */ jsx("a", {
|
|
12
|
+
href,
|
|
13
|
+
...isExternal ? {
|
|
14
|
+
rel: "noreferrer",
|
|
15
|
+
target: "_blank"
|
|
16
|
+
} : {},
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { isExternalHref, renderLandingLink };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=landingLink.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landingLink.mjs","names":[],"sources":["../../src/awesome/landingLink.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface LandingLinkProps {\n children: ReactNode;\n className?: string;\n external?: boolean;\n href: string;\n}\n\nexport type LandingLinkRender = (props: LandingLinkProps) => ReactNode;\n\nexport const isExternalHref = (href: string) => /^[a-z][\\d+.a-z-]*:/i.test(href);\n\nexport const renderLandingLink = (\n renderLink: LandingLinkRender | undefined,\n { external, href, ...props }: LandingLinkProps,\n): ReactNode => {\n const isExternal = external ?? isExternalHref(href);\n if (renderLink) return renderLink({ ...props, external: isExternal, href });\n\n return (\n <a href={href} {...(isExternal ? { rel: 'noreferrer', target: '_blank' } : {})} {...props} />\n );\n};\n"],"mappings":";;AAWA,MAAa,kBAAkB,SAAiB,sBAAsB,KAAK,IAAI;AAE/E,MAAa,qBACX,YACA,EAAE,UAAU,MAAM,GAAG,YACP;CACd,MAAM,aAAa,YAAY,eAAe,IAAI;CAClD,IAAI,YAAY,OAAO,WAAW;EAAE,GAAG;EAAO,UAAU;EAAY;CAAK,CAAC;CAE1E,OACE,oBAAC,KAAD;EAAS;EAAM,GAAK,aAAa;GAAE,KAAK;GAAc,QAAQ;EAAS,IAAI,CAAC;EAAI,GAAI;CAAQ,CAAA;AAEhG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/awesome/landingTokens.d.ts
|
|
2
|
+
type LandingPalette = [string, string, string];
|
|
3
|
+
declare const LANDING_PALETTE_LIGHT: LandingPalette;
|
|
4
|
+
declare const LANDING_PALETTE_DARK: LandingPalette;
|
|
5
|
+
/** Consumers can override the accent of every landing component with this CSS variable. */
|
|
6
|
+
declare const LANDING_GRADIENT_VAR = "--lobe-landing-gradient";
|
|
7
|
+
declare const accentGradient: string;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, LandingPalette, accentGradient };
|
|
10
|
+
//# sourceMappingURL=landingTokens.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/awesome/landingTokens.ts
|
|
2
|
+
const LANDING_PALETTE_LIGHT = [
|
|
3
|
+
"#7c5cff",
|
|
4
|
+
"#d6549e",
|
|
5
|
+
"#f0885f"
|
|
6
|
+
];
|
|
7
|
+
const LANDING_PALETTE_DARK = [
|
|
8
|
+
"#a78bfa",
|
|
9
|
+
"#ef7fc0",
|
|
10
|
+
"#f8a878"
|
|
11
|
+
];
|
|
12
|
+
const landingGradient = ([from, via, to]) => `linear-gradient(105deg, ${from} 8%, ${via} 55%, ${to} 95%)`;
|
|
13
|
+
/** Consumers can override the accent of every landing component with this CSS variable. */
|
|
14
|
+
const LANDING_GRADIENT_VAR = "--lobe-landing-gradient";
|
|
15
|
+
const accentGradient = `var(${LANDING_GRADIENT_VAR}, ${landingGradient(LANDING_PALETTE_LIGHT)})`;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { LANDING_GRADIENT_VAR, LANDING_PALETTE_DARK, LANDING_PALETTE_LIGHT, accentGradient, landingGradient };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=landingTokens.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landingTokens.mjs","names":[],"sources":["../../src/awesome/landingTokens.ts"],"sourcesContent":["export type LandingPalette = [string, string, string];\n\nexport const LANDING_PALETTE_LIGHT: LandingPalette = ['#7c5cff', '#d6549e', '#f0885f'];\nexport const LANDING_PALETTE_DARK: LandingPalette = ['#a78bfa', '#ef7fc0', '#f8a878'];\n\nexport const landingGradient = ([from, via, to]: LandingPalette) =>\n `linear-gradient(105deg, ${from} 8%, ${via} 55%, ${to} 95%)`;\n\n/** Consumers can override the accent of every landing component with this CSS variable. */\nexport const LANDING_GRADIENT_VAR = '--lobe-landing-gradient';\n\nexport const accentGradient = `var(${LANDING_GRADIENT_VAR}, ${landingGradient(LANDING_PALETTE_LIGHT)})`;\n"],"mappings":";AAEA,MAAa,wBAAwC;CAAC;CAAW;CAAW;AAAS;AACrF,MAAa,uBAAuC;CAAC;CAAW;CAAW;AAAS;AAEpF,MAAa,mBAAmB,CAAC,MAAM,KAAK,QAC1C,2BAA2B,KAAK,OAAO,IAAI,QAAQ,GAAG;;AAGxD,MAAa,uBAAuB;AAEpC,MAAa,iBAAiB,OAAO,qBAAqB,IAAI,gBAAgB,qBAAqB,EAAE"}
|
|
@@ -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?: "
|
|
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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.mjs","names":["BaseUIToggleGroup","BaseUIToggle"],"sources":["../../../src/base-ui/Segmented/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Toggle as BaseUIToggle } from '@base-ui/react/toggle';\nimport { ToggleGroup as BaseUIToggleGroup } from '@base-ui/react/toggle-group';\nimport { cx } from 'antd-style';\nimport { type ComponentProps, type CSSProperties, type FC, type ReactNode } from 'react';\n\nimport { itemVariants, listVariants, styles } from './style';\nimport type { SegmentedSize, SegmentedVariant } from './type';\n\nexport type SegmentedRootProps<Value extends string = string> = Omit<\n ComponentProps<typeof BaseUIToggleGroup<Value>>,\n 'className' | 'render'\n> & {\n block?: boolean;\n className?: string;\n glass?: boolean;\n shadow?: boolean;\n variant?: SegmentedVariant;\n};\n\nexport const SegmentedRoot = <Value extends string = string>({\n block = false,\n className,\n glass = false,\n shadow = false,\n variant = 'filled',\n ...rest\n}: SegmentedRootProps<Value>) => {\n return (\n <BaseUIToggleGroup<Value>\n className={cx(listVariants({ block, glass, shadow, variant }), className)}\n {...rest}\n />\n );\n};\n\nSegmentedRoot.displayName = 'SegmentedRoot';\n\nexport type SegmentedItemProps<Value extends string = string> = Omit<\n ComponentProps<typeof BaseUIToggle<Value>>,\n 'className' | 'render'\n> & {\n block?: boolean;\n className?: string;\n size?: SegmentedSize;\n};\n\nexport const SegmentedItem = <Value extends string = string>({\n block = false,\n className,\n size = 'middle',\n ...rest\n}: SegmentedItemProps<Value>) => {\n return <BaseUIToggle<Value> className={cx(itemVariants({ block, size }), className)} {...rest} />;\n};\n\nSegmentedItem.displayName = 'SegmentedItem';\n\ninterface SimpleSpanProps {\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nexport const SegmentedItemIcon: FC<SimpleSpanProps> = ({ children, className, style }) => (\n <span className={cx(styles.itemIcon, className)} style={style}>\n {children}\n </span>\n);\nSegmentedItemIcon.displayName = 'SegmentedItemIcon';\n\nexport const SegmentedItemLabel: FC<SimpleSpanProps> = ({ children, className, style }) => (\n <span className={cx(styles.itemLabel, className)} style={style}>\n {children}\n </span>\n);\nSegmentedItemLabel.displayName = 'SegmentedItemLabel';\n\nexport interface SegmentedIndicatorProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport const SegmentedIndicator: FC<SegmentedIndicatorProps> = ({ className, style }) => (\n <span aria-hidden className={cx(styles.indicator, className)} style={style} />\n);\nSegmentedIndicator.displayName = 'SegmentedIndicator';\n"],"mappings":";;;;;;;AAqBA,MAAa,iBAAgD,EAC3D,QAAQ,OACR,WACA,QAAQ,OACR,SAAS,OACT,UAAU,UACV,GAAG,WAC4B;CAC/B,OACE,oBAACA,aAAD;EACE,WAAW,GAAG,aAAa;GAAE;GAAO;GAAO;GAAQ;EAAQ,CAAC,GAAG,SAAS;EACxE,GAAI;CACL,CAAA;AAEL;AAEA,cAAc,cAAc;AAW5B,MAAa,iBAAgD,EAC3D,QAAQ,OACR,WACA,OAAO,UACP,GAAG,WAC4B;CAC/B,OAAO,oBAACC,QAAD;EAAqB,WAAW,GAAG,aAAa;GAAE;GAAO;EAAK,CAAC,GAAG,SAAS;EAAG,GAAI;CAAO,CAAA;AAClG;AAEA,cAAc,cAAc;AAQ5B,MAAa,qBAA0C,EAAE,UAAU,WAAW,YAC5E,oBAAC,QAAD;CAAM,WAAW,GAAG,OAAO,UAAU,SAAS;CAAU;CACrD;AACG,CAAA;AAER,kBAAkB,cAAc;AAEhC,MAAa,sBAA2C,EAAE,UAAU,WAAW,YAC7E,oBAAC,QAAD;CAAM,WAAW,GAAG,OAAO,WAAW,SAAS;CAAU;CACtD;AACG,CAAA;AAER,mBAAmB,cAAc;AAOjC,MAAa,sBAAmD,EAAE,WAAW,YAC3E,oBAAC,QAAD;CAAM,eAAA;CAAY,WAAW,GAAG,OAAO,WAAW,SAAS;CAAU;AAAQ,CAAA;AAE/E,mBAAmB,cAAc"}
|
|
1
|
+
{"version":3,"file":"atoms.mjs","names":["BaseUIToggleGroup","BaseUIToggle"],"sources":["../../../src/base-ui/Segmented/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Toggle as BaseUIToggle } from '@base-ui/react/toggle';\nimport { ToggleGroup as BaseUIToggleGroup } from '@base-ui/react/toggle-group';\nimport { cx } from 'antd-style';\nimport { type ComponentProps, type CSSProperties, type FC, type ReactNode } from 'react';\n\nimport { itemVariants, listVariants, styles } from './style';\nimport type { SegmentedSize, SegmentedVariant } from './type';\n\nexport type SegmentedRootProps<Value extends string = string> = Omit<\n ComponentProps<typeof BaseUIToggleGroup<Value>>,\n 'className' | 'render'\n> & {\n block?: boolean;\n className?: string;\n glass?: boolean;\n shadow?: boolean;\n variant?: SegmentedVariant;\n};\n\nexport const SegmentedRoot = <Value extends string = string>({\n block = false,\n className,\n glass = false,\n shadow = false,\n variant = 'filled',\n ...rest\n}: SegmentedRootProps<Value>) => {\n return (\n <BaseUIToggleGroup<Value>\n className={cx(listVariants({ block, glass, shadow, variant }), className)}\n data-variant={variant}\n {...rest}\n />\n );\n};\n\nSegmentedRoot.displayName = 'SegmentedRoot';\n\nexport type SegmentedItemProps<Value extends string = string> = Omit<\n ComponentProps<typeof BaseUIToggle<Value>>,\n 'className' | 'render'\n> & {\n block?: boolean;\n className?: string;\n size?: SegmentedSize;\n};\n\nexport const SegmentedItem = <Value extends string = string>({\n block = false,\n className,\n size = 'middle',\n ...rest\n}: SegmentedItemProps<Value>) => {\n return <BaseUIToggle<Value> className={cx(itemVariants({ block, size }), className)} {...rest} />;\n};\n\nSegmentedItem.displayName = 'SegmentedItem';\n\ninterface SimpleSpanProps {\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nexport const SegmentedItemIcon: FC<SimpleSpanProps> = ({ children, className, style }) => (\n <span className={cx(styles.itemIcon, className)} style={style}>\n {children}\n </span>\n);\nSegmentedItemIcon.displayName = 'SegmentedItemIcon';\n\nexport const SegmentedItemLabel: FC<SimpleSpanProps> = ({ children, className, style }) => (\n <span className={cx(styles.itemLabel, className)} style={style}>\n {children}\n </span>\n);\nSegmentedItemLabel.displayName = 'SegmentedItemLabel';\n\nexport interface SegmentedIndicatorProps {\n className?: string;\n style?: CSSProperties;\n}\n\nexport const SegmentedIndicator: FC<SegmentedIndicatorProps> = ({ className, style }) => (\n <span aria-hidden className={cx(styles.indicator, className)} style={style} />\n);\nSegmentedIndicator.displayName = 'SegmentedIndicator';\n"],"mappings":";;;;;;;AAqBA,MAAa,iBAAgD,EAC3D,QAAQ,OACR,WACA,QAAQ,OACR,SAAS,OACT,UAAU,UACV,GAAG,WAC4B;CAC/B,OACE,oBAACA,aAAD;EACE,WAAW,GAAG,aAAa;GAAE;GAAO;GAAO;GAAQ;EAAQ,CAAC,GAAG,SAAS;EACxE,gBAAc;EACd,GAAI;CACL,CAAA;AAEL;AAEA,cAAc,cAAc;AAW5B,MAAa,iBAAgD,EAC3D,QAAQ,OACR,WACA,OAAO,UACP,GAAG,WAC4B;CAC/B,OAAO,oBAACC,QAAD;EAAqB,WAAW,GAAG,aAAa;GAAE;GAAO;EAAK,CAAC,GAAG,SAAS;EAAG,GAAI;CAAO,CAAA;AAClG;AAEA,cAAc,cAAc;AAQ5B,MAAa,qBAA0C,EAAE,UAAU,WAAW,YAC5E,oBAAC,QAAD;CAAM,WAAW,GAAG,OAAO,UAAU,SAAS;CAAU;CACrD;AACG,CAAA;AAER,kBAAkB,cAAc;AAEhC,MAAa,sBAA2C,EAAE,UAAU,WAAW,YAC7E,oBAAC,QAAD;CAAM,WAAW,GAAG,OAAO,WAAW,SAAS;CAAU;CACtD;AACG,CAAA;AAER,mBAAmB,cAAc;AAOjC,MAAa,sBAAmD,EAAE,WAAW,YAC3E,oBAAC,QAAD;CAAM,eAAA;CAAY,WAAW,GAAG,OAAO,WAAW,SAAS;CAAU;AAAQ,CAAA;AAE/E,mBAAmB,cAAc"}
|
|
@@ -3,8 +3,9 @@ import { focusRing } from "../focusRing.mjs";
|
|
|
3
3
|
import { createStaticStyles } from "antd-style";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
//#region src/base-ui/Segmented/style.ts
|
|
6
|
-
const styles = createStaticStyles(({ css, cssVar }) =>
|
|
7
|
-
|
|
6
|
+
const styles = createStaticStyles(({ css, cssVar }) => {
|
|
7
|
+
return {
|
|
8
|
+
indicator: css`
|
|
8
9
|
pointer-events: none;
|
|
9
10
|
|
|
10
11
|
position: absolute;
|
|
@@ -17,7 +18,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
17
18
|
border-radius: ${cssVar.borderRadius};
|
|
18
19
|
|
|
19
20
|
background: ${cssVar.colorBgElevated};
|
|
20
|
-
box-shadow:
|
|
21
|
+
box-shadow: none;
|
|
21
22
|
|
|
22
23
|
transition-timing-function: ${cssVar.motionEaseOut};
|
|
23
24
|
transition-duration: 240ms;
|
|
@@ -31,130 +32,131 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
31
32
|
transition-duration: 0s;
|
|
32
33
|
}
|
|
33
34
|
`,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
display: flex;
|
|
136
|
-
align-self: stretch;
|
|
137
|
-
width: 100%;
|
|
138
|
-
`,
|
|
139
|
-
listFilled: css`
|
|
140
|
-
border: 1px solid ${cssVar.colorFillQuaternary};
|
|
141
|
-
background: ${cssVar.colorBgLayout};
|
|
142
|
-
`,
|
|
143
|
-
listGlass: staticStylish.blur,
|
|
144
|
-
listOutlined: css`
|
|
145
|
-
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
146
|
-
background: transparent;
|
|
147
|
-
`,
|
|
148
|
-
listShadow: staticStylish.shadow,
|
|
149
|
-
root: css`
|
|
150
|
-
display: inline-flex;
|
|
151
|
-
|
|
152
|
-
&[data-block='true'] {
|
|
35
|
+
item: css`
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
user-select: none;
|
|
38
|
+
|
|
39
|
+
position: relative;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
gap: 6px;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: ${cssVar.borderRadius};
|
|
51
|
+
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
color: ${cssVar.colorTextSecondary};
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
|
|
56
|
+
background: transparent;
|
|
57
|
+
outline: none;
|
|
58
|
+
|
|
59
|
+
transition:
|
|
60
|
+
color 120ms ${cssVar.motionEaseOut},
|
|
61
|
+
transform 120ms ${cssVar.motionEaseOut};
|
|
62
|
+
|
|
63
|
+
&:hover:not([data-disabled], [data-pressed]) {
|
|
64
|
+
color: ${cssVar.colorText};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:active:not([data-disabled]) {
|
|
68
|
+
transform: scale(0.98);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
${focusRing};
|
|
72
|
+
|
|
73
|
+
&[data-pressed] {
|
|
74
|
+
color: ${cssVar.colorText};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-disabled] {
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
color: ${cssVar.colorTextDisabled};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (prefers-reduced-motion: reduce) {
|
|
83
|
+
transition-duration: 0s;
|
|
84
|
+
}
|
|
85
|
+
`,
|
|
86
|
+
itemBlock: css`
|
|
87
|
+
flex: 1 1 0;
|
|
88
|
+
`,
|
|
89
|
+
itemIcon: css`
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
`,
|
|
94
|
+
itemLabel: css`
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
`,
|
|
98
|
+
itemLarge: css`
|
|
99
|
+
height: 36px;
|
|
100
|
+
padding-inline: 16px;
|
|
101
|
+
border-radius: ${cssVar.borderRadius};
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
`,
|
|
104
|
+
itemMiddle: css`
|
|
105
|
+
height: 32px;
|
|
106
|
+
padding-inline: 12px;
|
|
107
|
+
border-radius: ${cssVar.borderRadius};
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
`,
|
|
110
|
+
itemSmall: css`
|
|
111
|
+
height: 26px;
|
|
112
|
+
padding-inline: 10px;
|
|
113
|
+
border-radius: ${cssVar.borderRadius};
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
`,
|
|
116
|
+
list: css`
|
|
117
|
+
position: relative;
|
|
118
|
+
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
flex-wrap: nowrap;
|
|
121
|
+
gap: 4px;
|
|
122
|
+
align-items: center;
|
|
123
|
+
align-self: flex-start;
|
|
124
|
+
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
padding: 3px;
|
|
127
|
+
border-radius: ${cssVar.borderRadiusLG};
|
|
128
|
+
|
|
129
|
+
&[data-orientation='vertical'] {
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
align-items: stretch;
|
|
132
|
+
align-self: stretch;
|
|
133
|
+
}
|
|
134
|
+
`,
|
|
135
|
+
listBlock: css`
|
|
153
136
|
display: flex;
|
|
137
|
+
align-self: stretch;
|
|
154
138
|
width: 100%;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
139
|
+
`,
|
|
140
|
+
listFilled: css`
|
|
141
|
+
border: 1px solid ${cssVar.colorFillQuaternary};
|
|
142
|
+
background: ${cssVar.colorBgLayout};
|
|
143
|
+
`,
|
|
144
|
+
listGlass: staticStylish.blur,
|
|
145
|
+
listOutlined: css`
|
|
146
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
147
|
+
background: transparent;
|
|
148
|
+
`,
|
|
149
|
+
listShadow: staticStylish.shadow,
|
|
150
|
+
root: css`
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
|
|
153
|
+
&[data-block='true'] {
|
|
154
|
+
display: flex;
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
157
|
+
`
|
|
158
|
+
};
|
|
159
|
+
});
|
|
158
160
|
const listVariants = cva(styles.list, {
|
|
159
161
|
defaultVariants: {
|
|
160
162
|
block: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Segmented/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { focusRing } from '@/base-ui/focusRing';\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) =>
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Segmented/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { focusRing } from '@/base-ui/focusRing';\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n const indicator = css`\n pointer-events: none;\n\n position: absolute;\n z-index: 0;\n inset-block-start: var(--active-item-top);\n inset-inline-start: var(--active-item-left);\n\n width: var(--active-item-width);\n height: var(--active-item-height);\n border-radius: ${cssVar.borderRadius};\n\n background: ${cssVar.colorBgElevated};\n box-shadow: none;\n\n transition-timing-function: ${cssVar.motionEaseOut};\n transition-duration: 240ms;\n transition-property: inset-inline-start, inset-block-start, width, height;\n\n [data-orientation='horizontal'] &:dir(rtl) {\n inset-inline-start: var(--active-item-right);\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition-duration: 0s;\n }\n `;\n\n return {\n indicator,\n item: css`\n cursor: pointer;\n user-select: none;\n\n position: relative;\n z-index: 1;\n\n display: inline-flex;\n flex-shrink: 0;\n gap: 6px;\n align-items: center;\n justify-content: center;\n\n box-sizing: border-box;\n border: 0;\n border-radius: ${cssVar.borderRadius};\n\n font-weight: 500;\n color: ${cssVar.colorTextSecondary};\n white-space: nowrap;\n\n background: transparent;\n outline: none;\n\n transition:\n color 120ms ${cssVar.motionEaseOut},\n transform 120ms ${cssVar.motionEaseOut};\n\n &:hover:not([data-disabled], [data-pressed]) {\n color: ${cssVar.colorText};\n }\n\n &:active:not([data-disabled]) {\n transform: scale(0.98);\n }\n\n ${focusRing};\n\n &[data-pressed] {\n color: ${cssVar.colorText};\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: ${cssVar.colorTextDisabled};\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition-duration: 0s;\n }\n `,\n itemBlock: css`\n flex: 1 1 0;\n `,\n itemIcon: css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n `,\n itemLabel: css`\n display: inline-flex;\n align-items: center;\n `,\n itemLarge: css`\n height: 36px;\n padding-inline: 16px;\n border-radius: ${cssVar.borderRadius};\n font-size: 14px;\n `,\n itemMiddle: css`\n height: 32px;\n padding-inline: 12px;\n border-radius: ${cssVar.borderRadius};\n font-size: 13px;\n `,\n itemSmall: css`\n height: 26px;\n padding-inline: 10px;\n border-radius: ${cssVar.borderRadius};\n font-size: 12px;\n `,\n list: css`\n position: relative;\n\n display: inline-flex;\n flex-wrap: nowrap;\n gap: 4px;\n align-items: center;\n align-self: flex-start;\n\n box-sizing: border-box;\n padding: 3px;\n border-radius: ${cssVar.borderRadiusLG};\n\n &[data-orientation='vertical'] {\n flex-direction: column;\n align-items: stretch;\n align-self: stretch;\n }\n `,\n listBlock: css`\n display: flex;\n align-self: stretch;\n width: 100%;\n `,\n listFilled: css`\n border: 1px solid ${cssVar.colorFillQuaternary};\n background: ${cssVar.colorBgLayout};\n `,\n listGlass: lobeStaticStylish.blur,\n listOutlined: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: transparent;\n `,\n listShadow: lobeStaticStylish.shadow,\n root: css`\n display: inline-flex;\n\n &[data-block='true'] {\n display: flex;\n width: 100%;\n }\n `,\n };\n});\n\nexport const listVariants = cva(styles.list, {\n defaultVariants: {\n block: false,\n glass: false,\n shadow: false,\n variant: 'filled',\n },\n variants: {\n block: {\n false: null,\n true: styles.listBlock,\n },\n glass: {\n false: null,\n true: styles.listGlass,\n },\n shadow: {\n false: null,\n true: styles.listShadow,\n },\n variant: {\n filled: styles.listFilled,\n outlined: styles.listOutlined,\n },\n },\n});\n\nexport const itemVariants = cva(styles.item, {\n defaultVariants: {\n block: false,\n size: 'middle',\n },\n variants: {\n block: {\n false: null,\n true: styles.itemBlock,\n },\n size: {\n large: styles.itemLarge,\n middle: styles.itemMiddle,\n small: styles.itemSmall,\n },\n },\n});\n"],"mappings":";;;;;AAMA,MAAa,SAAS,oBAAoB,EAAE,KAAK,aAAa;CA6B5D,OAAO;EACL,WA7BgB,GAAG;;;;;;;;;;qBAUF,OAAO,aAAa;;kBAEvB,OAAO,gBAAgB;;;kCAGP,OAAO,cAAc;;;;;;;;;;;;EAenD,MAAM,GAAG;;;;;;;;;;;;;;;uBAeU,OAAO,aAAa;;;eAG5B,OAAO,mBAAmB;;;;;;;sBAOnB,OAAO,cAAc;0BACjB,OAAO,cAAc;;;iBAG9B,OAAO,UAAU;;;;;;;QAO1B,UAAU;;;iBAGD,OAAO,UAAU;;;;;iBAKjB,OAAO,kBAAkB;;;;;;;EAOtC,WAAW,GAAG;;;EAGd,UAAU,GAAG;;;;;EAKb,WAAW,GAAG;;;;EAId,WAAW,GAAG;;;uBAGK,OAAO,aAAa;;;EAGvC,YAAY,GAAG;;;uBAGI,OAAO,aAAa;;;EAGvC,WAAW,GAAG;;;uBAGK,OAAO,aAAa;;;EAGvC,MAAM,GAAG;;;;;;;;;;;uBAWU,OAAO,eAAe;;;;;;;;EAQzC,WAAW,GAAG;;;;;EAKd,YAAY,GAAG;0BACO,OAAO,oBAAoB;oBACjC,OAAO,cAAc;;EAErC,WAAWA,cAAkB;EAC7B,cAAc,GAAG;0BACK,OAAO,qBAAqB;;;EAGlD,YAAYA,cAAkB;EAC9B,MAAM,GAAG;;;;;;;;CAQX;AACF,CAAC;AAED,MAAa,eAAe,IAAI,OAAO,MAAM;CAC3C,iBAAiB;EACf,OAAO;EACP,OAAO;EACP,QAAQ;EACR,SAAS;CACX;CACA,UAAU;EACR,OAAO;GACL,OAAO;GACP,MAAM,OAAO;EACf;EACA,OAAO;GACL,OAAO;GACP,MAAM,OAAO;EACf;EACA,QAAQ;GACN,OAAO;GACP,MAAM,OAAO;EACf;EACA,SAAS;GACP,QAAQ,OAAO;GACf,UAAU,OAAO;EACnB;CACF;AACF,CAAC;AAED,MAAa,eAAe,IAAI,OAAO,MAAM;CAC3C,iBAAiB;EACf,OAAO;EACP,MAAM;CACR;CACA,UAAU;EACR,OAAO;GACL,OAAO;GACP,MAAM,OAAO;EACf;EACA,MAAM;GACJ,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,OAAO,OAAO;EAChB;CACF;AACF,CAAC"}
|