@ciderpress/ui 1.0.0-rc.10 → 1.0.0-rc.11
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/dist/head/css/loader-apple.css +1 -1
- package/dist/head/css/loader-dots.css +1 -1
- package/dist/head/css/themes/amber.css +1 -1
- package/dist/head/css/themes/arcade.css +1 -1
- package/dist/head/css/themes/grannysmith.css +1 -1
- package/dist/head/css/themes/honeycrisp.css +1 -1
- package/dist/head/css/themes/midnight.css +1 -1
- package/dist/head/css/themes/mulled.css +1 -1
- package/dist/node.mjs +408 -15
- package/dist/theme/components/home/cta.css +15 -0
- package/dist/theme/components/home/cta.tsx +10 -2
- package/dist/theme/components/home/feature-card.css +1 -1
- package/dist/theme/components/home/feature-card.tsx +3 -2
- package/dist/theme/components/home/feature.tsx +34 -31
- package/dist/theme/components/home/hero-demo.css +11 -0
- package/dist/theme/components/home/home-visual.tsx +226 -0
- package/dist/theme/components/home/layout.tsx +350 -171
- package/dist/theme/components/home/split.css +46 -19
- package/dist/theme/components/home/split.tsx +28 -8
- package/dist/theme/components/home/tabs.css +299 -0
- package/dist/theme/components/home/tabs.tsx +351 -0
- package/dist/theme/components/home/trust-strip.css +41 -0
- package/dist/theme/components/home/trust-strip.tsx +168 -11
- package/dist/theme/components/home/workspaces.tsx +171 -69
- package/dist/theme/components/workspaces/card.css +4 -0
- package/dist/theme/components/workspaces/card.tsx +3 -3
- package/dist/theme/components/workspaces/grid.tsx +18 -6
- package/dist/theme/index.tsx +5 -0
- package/dist/theme/lib/rich-text-parse.ts +740 -0
- package/dist/theme/lib/rich-text.test.tsx +342 -0
- package/dist/theme/lib/rich-text.tsx +86 -0
- package/dist/theme/styles/overrides/fonts.css +7 -4
- package/dist/theme/styles/overrides/home.css +11 -2
- package/dist/theme/styles/overrides/rspress.css +10 -5
- package/dist/theme/styles/overrides/tokens.css +41 -23
- package/dist/theme/styles/rich-text.css +106 -0
- package/dist/theme/styles/themes/amber.css +32 -2
- package/dist/theme/styles/themes/arcade.css +16 -1
- package/dist/theme/styles/themes/grannysmith.css +32 -2
- package/dist/theme/styles/themes/honeycrisp.css +37 -7
- package/dist/theme/styles/themes/midnight.css +16 -1
- package/dist/theme/styles/themes/mulled.css +54 -9
- package/package.json +3 -3
- package/src/theme/components/home/cta.css +15 -0
- package/src/theme/components/home/cta.tsx +10 -2
- package/src/theme/components/home/feature-card.css +1 -1
- package/src/theme/components/home/feature-card.tsx +3 -2
- package/src/theme/components/home/feature.tsx +34 -31
- package/src/theme/components/home/hero-demo.css +11 -0
- package/src/theme/components/home/home-visual.tsx +226 -0
- package/src/theme/components/home/layout.tsx +350 -171
- package/src/theme/components/home/split.css +46 -19
- package/src/theme/components/home/split.tsx +28 -8
- package/src/theme/components/home/tabs.css +299 -0
- package/src/theme/components/home/tabs.tsx +351 -0
- package/src/theme/components/home/trust-strip.css +41 -0
- package/src/theme/components/home/trust-strip.tsx +168 -11
- package/src/theme/components/home/workspaces.tsx +171 -69
- package/src/theme/components/workspaces/card.css +4 -0
- package/src/theme/components/workspaces/card.tsx +3 -3
- package/src/theme/components/workspaces/grid.tsx +18 -6
- package/src/theme/index.tsx +5 -0
- package/src/theme/lib/rich-text-parse.ts +740 -0
- package/src/theme/lib/rich-text.test.tsx +342 -0
- package/src/theme/lib/rich-text.tsx +86 -0
- package/src/theme/styles/overrides/fonts.css +7 -4
- package/src/theme/styles/overrides/home.css +11 -2
- package/src/theme/styles/overrides/rspress.css +10 -5
- package/src/theme/styles/overrides/tokens.css +41 -23
- package/src/theme/styles/rich-text.css +106 -0
- package/src/theme/styles/themes/amber.css +32 -2
- package/src/theme/styles/themes/arcade.css +16 -1
- package/src/theme/styles/themes/grannysmith.css +32 -2
- package/src/theme/styles/themes/honeycrisp.css +37 -7
- package/src/theme/styles/themes/midnight.css +16 -1
- package/src/theme/styles/themes/mulled.css +54 -9
- package/dist/theme/components/home/hero-demo-custom.tsx +0 -116
- package/dist/theme/components/home/split-visual-custom.tsx +0 -26
- package/src/theme/components/home/hero-demo-custom.tsx +0 -116
- package/src/theme/components/home/split-visual-custom.tsx +0 -26
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type React from 'react'
|
|
2
|
-
|
|
3
|
-
interface CustomSplitVisualProps {
|
|
4
|
-
readonly code: string
|
|
5
|
-
readonly language?: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Custom Split visual — renders a user-supplied code snippet inside the
|
|
10
|
-
* same `<pre>` shell as the default `ConfigPreview`. Language hint is
|
|
11
|
-
* surfaced as a `data-language` attribute so themes can hook into it
|
|
12
|
-
* for syntax-highlighter overlays. No client-side highlighting is
|
|
13
|
-
* performed in the framework (keeps the bundle slim); the rendered
|
|
14
|
-
* `<pre>` matches the default surface so themes that style the
|
|
15
|
-
* default block also style the custom one.
|
|
16
|
-
*
|
|
17
|
-
* @param props - Code snippet + optional language hint
|
|
18
|
-
* @returns Pre-formatted code block
|
|
19
|
-
*/
|
|
20
|
-
export function CustomSplitVisual(props: CustomSplitVisualProps): React.ReactElement {
|
|
21
|
-
return (
|
|
22
|
-
<pre data-language={props.language ?? 'ts'} className="cp-split__code">
|
|
23
|
-
{props.code}
|
|
24
|
-
</pre>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { HomeHeroDemoConfig, HomeHeroDemoLine, HomeHeroDemoTerminal } from '@ciderpress/config'
|
|
2
|
-
import { match } from 'massaman/match'
|
|
3
|
-
import type React from 'react'
|
|
4
|
-
|
|
5
|
-
import { withMountBase } from '../../lib/with-mount-base.ts'
|
|
6
|
-
|
|
7
|
-
import './hero-demo.css'
|
|
8
|
-
|
|
9
|
-
interface CustomHeroDemoProps {
|
|
10
|
-
readonly config: HomeHeroDemoConfig
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Custom replacement for `<HeroDemo />`. Driven by `home.hero.demo` from
|
|
15
|
-
* `ciderpress.config.ts`:
|
|
16
|
-
*
|
|
17
|
-
* - **Image form** (`{ src, alt, width?, height? }`) — renders an
|
|
18
|
-
* `<img>` inside the framework's framed `cp-hero-demo` container
|
|
19
|
-
* (rounded corners + brand-soft glow shadow preserved).
|
|
20
|
-
* - **Terminal form** (`{ windowTitle?, command, lines }`) — keeps the
|
|
21
|
-
* fake-macOS chrome but paints the user's command + output lines.
|
|
22
|
-
*
|
|
23
|
-
* The discriminator is structural: image objects carry `src`, terminal
|
|
24
|
-
* objects carry `lines`.
|
|
25
|
-
*
|
|
26
|
-
* @param props - Validated `HomeHeroDemoConfig`
|
|
27
|
-
* @returns Custom hero demo element
|
|
28
|
-
*/
|
|
29
|
-
export function CustomHeroDemo(props: CustomHeroDemoProps): React.ReactElement {
|
|
30
|
-
return match(props.config)
|
|
31
|
-
.when(
|
|
32
|
-
(c): c is HomeHeroDemoTerminal => 'lines' in c,
|
|
33
|
-
(c) => <CustomTerminal config={c} />
|
|
34
|
-
)
|
|
35
|
-
.otherwise((c) => (
|
|
36
|
-
<div className="cp-hero-demo cp-hero-demo--image">
|
|
37
|
-
<img
|
|
38
|
-
src={withMountBase(c.src)}
|
|
39
|
-
alt={c.alt ?? ''}
|
|
40
|
-
width={c.width}
|
|
41
|
-
height={c.height}
|
|
42
|
-
className="cp-hero-demo__img"
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
))
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface CustomTerminalProps {
|
|
49
|
-
readonly config: HomeHeroDemoTerminal
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Render the terminal-form hero demo with user-supplied command + lines.
|
|
54
|
-
*
|
|
55
|
-
* @private
|
|
56
|
-
* @param props - Validated terminal config
|
|
57
|
-
* @returns Terminal-shell hero demo element
|
|
58
|
-
*/
|
|
59
|
-
function CustomTerminal(props: CustomTerminalProps): React.ReactElement {
|
|
60
|
-
const { windowTitle, command, lines } = props.config
|
|
61
|
-
return (
|
|
62
|
-
<div className="cp-hero-demo">
|
|
63
|
-
<div className="cp-hero-demo__bar">
|
|
64
|
-
<span className="cp-hero-demo__dot" />
|
|
65
|
-
<span className="cp-hero-demo__dot" />
|
|
66
|
-
<span className="cp-hero-demo__dot" />
|
|
67
|
-
{match(windowTitle)
|
|
68
|
-
.with(undefined, () => null)
|
|
69
|
-
.otherwise((t) => (
|
|
70
|
-
<span className="cp-hero-demo__title">{t}</span>
|
|
71
|
-
))}
|
|
72
|
-
</div>
|
|
73
|
-
<pre className="cp-hero-demo__body">
|
|
74
|
-
<span className="cp-hero-demo__prompt">$ </span>
|
|
75
|
-
{command}
|
|
76
|
-
{'\n\n'}
|
|
77
|
-
{lines.map((line, i) => (
|
|
78
|
-
<TerminalLine key={`${line.kind}-${i}`} line={line} />
|
|
79
|
-
))}
|
|
80
|
-
</pre>
|
|
81
|
-
</div>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
interface TerminalLineProps {
|
|
86
|
-
readonly line: HomeHeroDemoLine
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Render a single line of the structured terminal hero demo. Each
|
|
91
|
-
* kind gets a coloured prefix glyph mirroring the framework default.
|
|
92
|
-
*
|
|
93
|
-
* @private
|
|
94
|
-
* @param props - Single line entry
|
|
95
|
-
* @returns Glyph-prefixed line followed by a newline
|
|
96
|
-
*/
|
|
97
|
-
function TerminalLine(props: TerminalLineProps): React.ReactElement {
|
|
98
|
-
const className = match(props.line.kind)
|
|
99
|
-
.with('ok', () => 'cp-hero-demo__ok')
|
|
100
|
-
.with('info', () => 'cp-hero-demo__info')
|
|
101
|
-
.with('cmt', () => 'cp-hero-demo__cmt')
|
|
102
|
-
.with('err', () => 'cp-hero-demo__err')
|
|
103
|
-
.exhaustive()
|
|
104
|
-
const glyph = match(props.line.kind)
|
|
105
|
-
.with('ok', () => ' ✓')
|
|
106
|
-
.with('info', () => ' ▸')
|
|
107
|
-
.with('cmt', () => ' ↻')
|
|
108
|
-
.with('err', () => ' ✗')
|
|
109
|
-
.exhaustive()
|
|
110
|
-
return (
|
|
111
|
-
<>
|
|
112
|
-
<span className={className}>{glyph}</span> {props.line.text}
|
|
113
|
-
{'\n'}
|
|
114
|
-
</>
|
|
115
|
-
)
|
|
116
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type React from 'react'
|
|
2
|
-
|
|
3
|
-
interface CustomSplitVisualProps {
|
|
4
|
-
readonly code: string
|
|
5
|
-
readonly language?: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Custom Split visual — renders a user-supplied code snippet inside the
|
|
10
|
-
* same `<pre>` shell as the default `ConfigPreview`. Language hint is
|
|
11
|
-
* surfaced as a `data-language` attribute so themes can hook into it
|
|
12
|
-
* for syntax-highlighter overlays. No client-side highlighting is
|
|
13
|
-
* performed in the framework (keeps the bundle slim); the rendered
|
|
14
|
-
* `<pre>` matches the default surface so themes that style the
|
|
15
|
-
* default block also style the custom one.
|
|
16
|
-
*
|
|
17
|
-
* @param props - Code snippet + optional language hint
|
|
18
|
-
* @returns Pre-formatted code block
|
|
19
|
-
*/
|
|
20
|
-
export function CustomSplitVisual(props: CustomSplitVisualProps): React.ReactElement {
|
|
21
|
-
return (
|
|
22
|
-
<pre data-language={props.language ?? 'ts'} className="cp-split__code">
|
|
23
|
-
{props.code}
|
|
24
|
-
</pre>
|
|
25
|
-
)
|
|
26
|
-
}
|