@purestack/ts-components 1.1.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/LICENSE +21 -0
- package/README.md +10 -0
- package/dist/ts-components.d.mts +1662 -0
- package/dist/ts-components.d.mts.map +1 -0
- package/dist/ts-components.mjs +9200 -0
- package/dist/ts-components.mjs.map +1 -0
- package/package.json +130 -0
- package/src/defineComponents.ts +87 -0
- package/src/index.ts +270 -0
- package/src/registerStyles.ts +63 -0
- package/src/standard/alertBox/alertBox.ts +64 -0
- package/src/standard/autoId.ts +25 -0
- package/src/standard/badge/badge.ts +41 -0
- package/src/standard/badge/badgeStyle.ts +21 -0
- package/src/standard/barChart/barChart.ts +338 -0
- package/src/standard/barChart/barChartStyle.ts +81 -0
- package/src/standard/btn/btn.ts +191 -0
- package/src/standard/btn/btnStyle.ts +59 -0
- package/src/standard/btnGroup/btnGroup.ts +208 -0
- package/src/standard/btnGroup/btnGroupStyle.ts +85 -0
- package/src/standard/chart/cartesianChart.ts +99 -0
- package/src/standard/chart/chartDefaults.ts +25 -0
- package/src/standard/chart/chartUtils.ts +84 -0
- package/src/standard/classicLogo/classicLogo.ts +429 -0
- package/src/standard/classicLogo/classicLogoStyle.ts +292 -0
- package/src/standard/componentVariant.ts +153 -0
- package/src/standard/composer/composer.ts +1035 -0
- package/src/standard/composer/composerCanvasInitialStyle.ts +225 -0
- package/src/standard/composer/composerCanvasRevertStyle.ts +14 -0
- package/src/standard/composer/composerCanvasSharedStyle.ts +60 -0
- package/src/standard/composer/composerCanvasStyleTypes.ts +8 -0
- package/src/standard/composer/composerCanvasThemeStyle.ts +53 -0
- package/src/standard/composer/composerStyle.ts +156 -0
- package/src/standard/composer/emailHtmlPolicy.ts +474 -0
- package/src/standard/consent/consent.ts +173 -0
- package/src/standard/consent/consentStyle.ts +44 -0
- package/src/standard/contactForm/contactForm.ts +135 -0
- package/src/standard/contactForm/contactFormStyle.ts +116 -0
- package/src/standard/doughnutChart/doughnutChart.ts +527 -0
- package/src/standard/doughnutChart/doughnutChartStyle.ts +64 -0
- package/src/standard/dropFiles/dropFiles.ts +480 -0
- package/src/standard/dropFiles/dropFilesStyle.ts +171 -0
- package/src/standard/expandablePanel/expandablePanel.ts +106 -0
- package/src/standard/expandablePanel/expandablePanelStyle.ts +56 -0
- package/src/standard/flex/flex.ts +269 -0
- package/src/standard/flex/flexStyle.ts +556 -0
- package/src/standard/footer/footer.ts +93 -0
- package/src/standard/footer/footerStyle.ts +39 -0
- package/src/standard/form/autoCompleteInput.ts +567 -0
- package/src/standard/form/form.ts +205 -0
- package/src/standard/form/formCheck.ts +96 -0
- package/src/standard/form/formInputField.ts +184 -0
- package/src/standard/form/formSelectField.ts +152 -0
- package/src/standard/form/formStyle.ts +585 -0
- package/src/standard/form/multiAutoCompleteInput.ts +880 -0
- package/src/standard/grid/grid.ts +177 -0
- package/src/standard/grid/gridStyle.ts +56 -0
- package/src/standard/icon/icon.ts +96 -0
- package/src/standard/icon/iconStyle.ts +50 -0
- package/src/standard/landing/codeShowcase.ts +54 -0
- package/src/standard/landing/comparisonColumn.ts +30 -0
- package/src/standard/landing/comparisonFeature.ts +22 -0
- package/src/standard/landing/comparisonTable.ts +38 -0
- package/src/standard/landing/ctaSection.ts +59 -0
- package/src/standard/landing/featureCard.ts +41 -0
- package/src/standard/landing/landing.ts +52 -0
- package/src/standard/landing/landingBand.ts +217 -0
- package/src/standard/landing/landingSection.ts +43 -0
- package/src/standard/landing/landingTypes.ts +141 -0
- package/src/standard/landing/metricItem.ts +25 -0
- package/src/standard/landing/metricStrip.ts +20 -0
- package/src/standard/lineChart/lineChart.ts +462 -0
- package/src/standard/lineChart/lineChartStyle.ts +91 -0
- package/src/standard/logo/logo.ts +192 -0
- package/src/standard/logo/logoStyle.ts +164 -0
- package/src/standard/modal/modal.ts +171 -0
- package/src/standard/modal/modalStore.ts +154 -0
- package/src/standard/modal/modalStyle.ts +190 -0
- package/src/standard/navMenu/navMenu.ts +278 -0
- package/src/standard/navMenu/navMenuStyle.ts +323 -0
- package/src/standard/pageLinks/pageLinks.ts +90 -0
- package/src/standard/pageScript/pageScript.ts +155 -0
- package/src/standard/pageToc/pageToc.ts +154 -0
- package/src/standard/pageToc/pageTocStyle.ts +372 -0
- package/src/standard/panel/panel.ts +55 -0
- package/src/standard/panel/panelStyle.ts +15 -0
- package/src/standard/pricing/pricing.ts +146 -0
- package/src/standard/searchBox/searchBox.ts +54 -0
- package/src/standard/searchBox/searchBoxStyle.ts +180 -0
- package/src/standard/sectionHeader/sectionHeader.ts +99 -0
- package/src/standard/signIn/signIn.ts +167 -0
- package/src/standard/signIn/signInStyle.ts +70 -0
- package/src/standard/tabs/tabs.ts +193 -0
- package/src/standard/tabs/tabsStyle.ts +231 -0
- package/src/standard/themeToggle/themeToggle.ts +33 -0
- package/src/standard/themeToggle/themeToggleStyle.ts +88 -0
- package/src/standard/toast/toastHost.ts +42 -0
- package/src/standard/toast/toastStore.ts +50 -0
- package/src/standard/topBar/topBar.ts +101 -0
- package/src/standard/topBar/topBarStyle.ts +169 -0
- package/src/standard/virtualList/variableVirtualTable.ts +371 -0
- package/src/standard/virtualList/virtualList.ts +423 -0
- package/src/standard/virtualList/virtualListStyle.ts +34 -0
- package/src/standard/virtualList/virtualTable.ts +179 -0
- package/src/standard/virtualList/virtualTableStyle.ts +24 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { CSSProps } from '@purestack/ts-css'
|
|
2
|
+
import { docLayoutVar } from '@purestack/ts-style'
|
|
3
|
+
import { computed, defineComponent, html, type RefOrValue, unref } from 'regor'
|
|
4
|
+
import type {
|
|
5
|
+
ComponentVariant,
|
|
6
|
+
ComponentVariantMode,
|
|
7
|
+
} from '../componentVariant'
|
|
8
|
+
import { resolveComponentClasses } from '../componentVariant'
|
|
9
|
+
import type { LandingBand, LandingBandEdge } from './landingTypes'
|
|
10
|
+
|
|
11
|
+
const DEFAULT_LANDING_BAND_VARIANT: ComponentVariant = 'surfaceAlt'
|
|
12
|
+
const DEFAULT_LANDING_BAND_VARIANT_MODE: ComponentVariantMode = 'stateless'
|
|
13
|
+
const DEFAULT_LANDING_BAND_HEIGHT = '16rem'
|
|
14
|
+
const DEFAULT_LANDING_BAND_EDGE_SIZE = '4rem'
|
|
15
|
+
const DEFAULT_LANDING_BAND_EDGE_START = '0%'
|
|
16
|
+
const LANDING_BAND_INLINE_PADDING = '1em'
|
|
17
|
+
|
|
18
|
+
export function defineLandingBandComponent() {
|
|
19
|
+
const landingBandTemplate = html`<section :class="classes" :style="bandStyle">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</section>`
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
landingBand: defineComponent<LandingBand>(landingBandTemplate, {
|
|
25
|
+
props: [
|
|
26
|
+
'tone',
|
|
27
|
+
'variant',
|
|
28
|
+
'variantMode',
|
|
29
|
+
'image',
|
|
30
|
+
'imageFit',
|
|
31
|
+
'imagePosition',
|
|
32
|
+
'display',
|
|
33
|
+
'alignItems',
|
|
34
|
+
'justifyContent',
|
|
35
|
+
'height',
|
|
36
|
+
'marginTop',
|
|
37
|
+
'marginBottom',
|
|
38
|
+
'paddingTop',
|
|
39
|
+
'paddingBottom',
|
|
40
|
+
'topEdge',
|
|
41
|
+
'bottomEdge',
|
|
42
|
+
'edgeSize',
|
|
43
|
+
'topEdgeStart',
|
|
44
|
+
'bottomEdgeStart',
|
|
45
|
+
],
|
|
46
|
+
context: (head) => resolveLandingBand(head.props),
|
|
47
|
+
}),
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function resolveLandingBand(props: LandingBand): LandingBand {
|
|
52
|
+
const height = computed(() =>
|
|
53
|
+
resolveStyleValue(props.height, DEFAULT_LANDING_BAND_HEIGHT),
|
|
54
|
+
)
|
|
55
|
+
const edgeSize = computed(() =>
|
|
56
|
+
resolveStyleValue(props.edgeSize, DEFAULT_LANDING_BAND_EDGE_SIZE),
|
|
57
|
+
)
|
|
58
|
+
const inlineStartBleed = resolveLandingBandInlineBleed('start')
|
|
59
|
+
const inlineEndBleed = resolveLandingBandInlineBleed('end')
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
...props,
|
|
63
|
+
classes: computed(() =>
|
|
64
|
+
resolveComponentClasses(props, {
|
|
65
|
+
defaultVariant: DEFAULT_LANDING_BAND_VARIANT,
|
|
66
|
+
defaultVariantMode: DEFAULT_LANDING_BAND_VARIANT_MODE,
|
|
67
|
+
classes: ['rounded-none', resolveLandingBandBorderClass(props)],
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
bandStyle: computed<Partial<CSSProps>>(() => ({
|
|
71
|
+
display: resolveCssPropValue(props.display, 'flex'),
|
|
72
|
+
alignItems: resolveCssPropValue(props.alignItems, 'start'),
|
|
73
|
+
justifyContent: resolveCssPropValue(props.justifyContent, 'center'),
|
|
74
|
+
borderRadius: '0 !important',
|
|
75
|
+
borderLeft: 'none !important',
|
|
76
|
+
borderRight: 'none !important',
|
|
77
|
+
overflow: 'hidden',
|
|
78
|
+
boxSizing: 'border-box',
|
|
79
|
+
pointerEvents: 'none',
|
|
80
|
+
minHeight: height(),
|
|
81
|
+
marginInlineStart: `calc(-1 * (${inlineStartBleed}))`,
|
|
82
|
+
marginInlineEnd: `calc(-1 * (${inlineEndBleed}))`,
|
|
83
|
+
paddingInlineStart: `calc(${LANDING_BAND_INLINE_PADDING} + ${inlineStartBleed})`,
|
|
84
|
+
paddingInlineEnd: `calc(${LANDING_BAND_INLINE_PADDING} + ${inlineEndBleed})`,
|
|
85
|
+
paddingTop: resolveLandingBandEdgePadding(
|
|
86
|
+
props.paddingTop,
|
|
87
|
+
edgeSize(),
|
|
88
|
+
props.topEdge,
|
|
89
|
+
),
|
|
90
|
+
paddingBottom: resolveLandingBandEdgePadding(
|
|
91
|
+
props.paddingBottom,
|
|
92
|
+
edgeSize(),
|
|
93
|
+
props.bottomEdge,
|
|
94
|
+
),
|
|
95
|
+
marginTop: resolveStyleValue(props.marginTop, '0'),
|
|
96
|
+
marginBottom: resolveStyleValue(props.marginBottom, '0'),
|
|
97
|
+
backgroundImage: resolveBackgroundImage(props.image),
|
|
98
|
+
backgroundSize: unref(props.imageFit) || 'cover',
|
|
99
|
+
backgroundPosition: unref(props.imagePosition) || 'center',
|
|
100
|
+
backgroundRepeat: 'no-repeat',
|
|
101
|
+
clipPath: resolveLandingBandClipPath(props, edgeSize()),
|
|
102
|
+
})),
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function resolveLandingBandInlineBleed(side: 'start' | 'end') {
|
|
107
|
+
return `${resolveCenteredViewportBleed()} + ${resolveDocLayoutInlineCorrection(side)}`
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function resolveCenteredViewportBleed() {
|
|
111
|
+
return '50vw - 50%'
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function resolveDocLayoutInlineCorrection(side: 'start' | 'end') {
|
|
115
|
+
const inlineStartState = `(${resolveDocLayoutInlineStartState()})`
|
|
116
|
+
const inlineEndState = `(${resolveDocLayoutInlineEndState()})`
|
|
117
|
+
const balance =
|
|
118
|
+
side === 'start'
|
|
119
|
+
? `${inlineStartState} - ${inlineEndState}`
|
|
120
|
+
: `${inlineEndState} - ${inlineStartState}`
|
|
121
|
+
return `(${balance}) / 2`
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function resolveDocLayoutInlineStartState() {
|
|
125
|
+
return [
|
|
126
|
+
docLayoutVar('activeShellPaddingInlineStart'),
|
|
127
|
+
docLayoutVar('activeNavWidth'),
|
|
128
|
+
].join(' + ')
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function resolveDocLayoutInlineEndState() {
|
|
132
|
+
return [
|
|
133
|
+
docLayoutVar('activeShellPaddingInlineEnd'),
|
|
134
|
+
docLayoutVar('activeTocWidth'),
|
|
135
|
+
].join(' + ')
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function resolveLandingBandClipPath(
|
|
139
|
+
props: LandingBand,
|
|
140
|
+
edgeSize: string,
|
|
141
|
+
): string | undefined {
|
|
142
|
+
const topEdge = resolveLandingBandEdge(props.topEdge)
|
|
143
|
+
const bottomEdge = resolveLandingBandEdge(props.bottomEdge)
|
|
144
|
+
|
|
145
|
+
if (topEdge === 'flat' && bottomEdge === 'flat') return undefined
|
|
146
|
+
|
|
147
|
+
const topStart = resolveStyleValue(
|
|
148
|
+
props.topEdgeStart,
|
|
149
|
+
DEFAULT_LANDING_BAND_EDGE_START,
|
|
150
|
+
)
|
|
151
|
+
const bottomStart = resolveStyleValue(
|
|
152
|
+
props.bottomEdgeStart,
|
|
153
|
+
DEFAULT_LANDING_BAND_EDGE_START,
|
|
154
|
+
)
|
|
155
|
+
const topLeftY = topEdge === 'slant-up' ? edgeSize : '0'
|
|
156
|
+
const topRightY = topEdge === 'slant-down' ? edgeSize : '0'
|
|
157
|
+
const bottomRightY =
|
|
158
|
+
bottomEdge === 'slant-up' ? `calc(100% - ${edgeSize})` : '100%'
|
|
159
|
+
const bottomLeftY =
|
|
160
|
+
bottomEdge === 'slant-down' ? `calc(100% - ${edgeSize})` : '100%'
|
|
161
|
+
const points = [
|
|
162
|
+
`0 ${topLeftY}`,
|
|
163
|
+
`${topStart} ${topLeftY}`,
|
|
164
|
+
`100% ${topRightY}`,
|
|
165
|
+
`100% ${bottomRightY}`,
|
|
166
|
+
`${bottomStart} ${bottomLeftY}`,
|
|
167
|
+
`0 ${bottomLeftY}`,
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
return `polygon(${points.join(', ')})`
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function resolveLandingBandEdgePadding(
|
|
174
|
+
padding: RefOrValue<string> | undefined,
|
|
175
|
+
edgeSize: string,
|
|
176
|
+
edge: RefOrValue<LandingBandEdge> | undefined,
|
|
177
|
+
) {
|
|
178
|
+
const resolvedPadding = resolveStyleValue(padding, '1em')
|
|
179
|
+
return resolveLandingBandEdge(edge) === 'flat'
|
|
180
|
+
? resolvedPadding
|
|
181
|
+
: `calc(${resolvedPadding} + ${edgeSize})`
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function resolveLandingBandEdge(edge?: RefOrValue<LandingBandEdge>) {
|
|
185
|
+
const resolved = unref(edge)
|
|
186
|
+
return resolved === 'slant-up' || resolved === 'slant-down'
|
|
187
|
+
? resolved
|
|
188
|
+
: 'flat'
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function resolveLandingBandBorderClass(props: LandingBand) {
|
|
192
|
+
return resolveLandingBandEdge(props.topEdge) === 'flat' &&
|
|
193
|
+
resolveLandingBandEdge(props.bottomEdge) === 'flat'
|
|
194
|
+
? undefined
|
|
195
|
+
: 'b-0'
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function resolveBackgroundImage(image?: RefOrValue<string>) {
|
|
199
|
+
const resolved = unref(image)
|
|
200
|
+
return typeof resolved === 'string' && resolved.trim()
|
|
201
|
+
? `url("${resolved.trim()}")`
|
|
202
|
+
: undefined
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function resolveStyleValue(
|
|
206
|
+
value: RefOrValue<string> | undefined,
|
|
207
|
+
fallback: string,
|
|
208
|
+
) {
|
|
209
|
+
const resolved = unref(value)
|
|
210
|
+
return typeof resolved === 'string' && resolved.trim()
|
|
211
|
+
? resolved.trim()
|
|
212
|
+
: fallback
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function resolveCssPropValue<T>(value: RefOrValue<T> | undefined, fallback: T) {
|
|
216
|
+
return unref(value) || fallback
|
|
217
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent, html } from 'regor'
|
|
2
|
+
import type { LandingSection } from './landingTypes'
|
|
3
|
+
|
|
4
|
+
export function defineLandingSectionComponent() {
|
|
5
|
+
const landingSectionTemplate = html`<Panel
|
|
6
|
+
:tone="tone"
|
|
7
|
+
:variant="variant || 'none'"
|
|
8
|
+
:variantMode="variantMode"
|
|
9
|
+
class="mb-6"
|
|
10
|
+
>
|
|
11
|
+
<Grid
|
|
12
|
+
columns="1"
|
|
13
|
+
:columnsLg="columnsLg || columns"
|
|
14
|
+
:alignItems="alignItems || 'start'"
|
|
15
|
+
>
|
|
16
|
+
<SectionHeader
|
|
17
|
+
r-if="eyebrow || title || subtitle"
|
|
18
|
+
:eyebrow="eyebrow"
|
|
19
|
+
:title="title"
|
|
20
|
+
:subtitle="subtitle"
|
|
21
|
+
:titleTag="titleTag || 'h2'"
|
|
22
|
+
subtitleClass="mb-0"/>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</Grid>
|
|
25
|
+
</Panel>`
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
landingSection: defineComponent<LandingSection>(landingSectionTemplate, {
|
|
29
|
+
props: [
|
|
30
|
+
'eyebrow',
|
|
31
|
+
'title',
|
|
32
|
+
'subtitle',
|
|
33
|
+
'titleTag',
|
|
34
|
+
'tone',
|
|
35
|
+
'variant',
|
|
36
|
+
'variantMode',
|
|
37
|
+
'columns',
|
|
38
|
+
'columnsLg',
|
|
39
|
+
'alignItems',
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { CSSProps } from '@purestack/ts-css'
|
|
2
|
+
import type { SemanticTone } from '@purestack/ts-style'
|
|
3
|
+
import type { ComputedRef, RefOrValue } from 'regor'
|
|
4
|
+
import type {
|
|
5
|
+
ComponentVariant,
|
|
6
|
+
ComponentVariantMode,
|
|
7
|
+
} from '../componentVariant'
|
|
8
|
+
import type { GridAlignItems } from '../grid/grid'
|
|
9
|
+
|
|
10
|
+
export type LandingBandImageFit =
|
|
11
|
+
| 'cover'
|
|
12
|
+
| 'contain'
|
|
13
|
+
| 'fill'
|
|
14
|
+
| 'none'
|
|
15
|
+
| 'scale-down'
|
|
16
|
+
|
|
17
|
+
export type LandingBandEdge = 'flat' | 'slant-up' | 'slant-down'
|
|
18
|
+
|
|
19
|
+
export type LandingTitleTag =
|
|
20
|
+
| 'h1'
|
|
21
|
+
| 'h2'
|
|
22
|
+
| 'h3'
|
|
23
|
+
| 'h4'
|
|
24
|
+
| 'h5'
|
|
25
|
+
| 'h6'
|
|
26
|
+
| 'p'
|
|
27
|
+
| 'div'
|
|
28
|
+
| 'span'
|
|
29
|
+
|
|
30
|
+
export interface LandingBand {
|
|
31
|
+
tone?: RefOrValue<SemanticTone>
|
|
32
|
+
variant?: RefOrValue<ComponentVariant>
|
|
33
|
+
variantMode?: RefOrValue<ComponentVariantMode>
|
|
34
|
+
image?: RefOrValue<string>
|
|
35
|
+
imageFit?: RefOrValue<LandingBandImageFit>
|
|
36
|
+
imagePosition?: RefOrValue<string>
|
|
37
|
+
display?: RefOrValue<CSSProps['display']>
|
|
38
|
+
alignItems?: RefOrValue<CSSProps['alignItems']>
|
|
39
|
+
justifyContent?: RefOrValue<CSSProps['justifyContent']>
|
|
40
|
+
height?: RefOrValue<string>
|
|
41
|
+
paddingTop?: RefOrValue<string>
|
|
42
|
+
paddingBottom?: RefOrValue<string>
|
|
43
|
+
marginTop?: RefOrValue<string>
|
|
44
|
+
marginBottom?: RefOrValue<string>
|
|
45
|
+
topEdge?: RefOrValue<LandingBandEdge>
|
|
46
|
+
bottomEdge?: RefOrValue<LandingBandEdge>
|
|
47
|
+
edgeSize?: RefOrValue<string>
|
|
48
|
+
topEdgeStart?: RefOrValue<string>
|
|
49
|
+
bottomEdgeStart?: RefOrValue<string>
|
|
50
|
+
classes?: ComputedRef<string>
|
|
51
|
+
bandStyle?: ComputedRef<Partial<CSSProps>>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface LandingSection {
|
|
55
|
+
eyebrow?: RefOrValue<string>
|
|
56
|
+
title?: RefOrValue<string>
|
|
57
|
+
subtitle?: RefOrValue<string>
|
|
58
|
+
titleTag?: RefOrValue<LandingTitleTag>
|
|
59
|
+
tone?: RefOrValue<SemanticTone>
|
|
60
|
+
variant?: RefOrValue<ComponentVariant>
|
|
61
|
+
variantMode?: RefOrValue<ComponentVariantMode>
|
|
62
|
+
columns?: RefOrValue<number | string>
|
|
63
|
+
columnsLg?: RefOrValue<number | string>
|
|
64
|
+
alignItems?: RefOrValue<GridAlignItems>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface FeatureCard {
|
|
68
|
+
eyebrow?: RefOrValue<string>
|
|
69
|
+
title?: RefOrValue<string>
|
|
70
|
+
summary?: RefOrValue<string>
|
|
71
|
+
badge?: RefOrValue<string>
|
|
72
|
+
icon?: RefOrValue<string>
|
|
73
|
+
tone?: RefOrValue<SemanticTone>
|
|
74
|
+
variant?: RefOrValue<ComponentVariant>
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface MetricStrip {
|
|
78
|
+
tone?: RefOrValue<SemanticTone>
|
|
79
|
+
variant?: RefOrValue<ComponentVariant>
|
|
80
|
+
columns?: RefOrValue<number | string>
|
|
81
|
+
columnsSm?: RefOrValue<number | string>
|
|
82
|
+
columnsLg?: RefOrValue<number | string>
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface MetricItem {
|
|
86
|
+
label?: RefOrValue<string>
|
|
87
|
+
value?: RefOrValue<string>
|
|
88
|
+
detail?: RefOrValue<string>
|
|
89
|
+
icon?: RefOrValue<string>
|
|
90
|
+
tone?: RefOrValue<SemanticTone>
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface CodeShowcase {
|
|
94
|
+
eyebrow?: RefOrValue<string>
|
|
95
|
+
title?: RefOrValue<string>
|
|
96
|
+
summary?: RefOrValue<string>
|
|
97
|
+
language?: RefOrValue<string>
|
|
98
|
+
resultTitle?: RefOrValue<string>
|
|
99
|
+
resultMeta?: RefOrValue<string>
|
|
100
|
+
tone?: RefOrValue<SemanticTone>
|
|
101
|
+
variant?: RefOrValue<ComponentVariant>
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ComparisonTable {
|
|
105
|
+
eyebrow?: RefOrValue<string>
|
|
106
|
+
title?: RefOrValue<string>
|
|
107
|
+
subtitle?: RefOrValue<string>
|
|
108
|
+
tone?: RefOrValue<SemanticTone>
|
|
109
|
+
variant?: RefOrValue<ComponentVariant>
|
|
110
|
+
columns?: RefOrValue<number | string>
|
|
111
|
+
columnsLg?: RefOrValue<number | string>
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface ComparisonColumn {
|
|
115
|
+
title?: RefOrValue<string>
|
|
116
|
+
summary?: RefOrValue<string>
|
|
117
|
+
badge?: RefOrValue<string>
|
|
118
|
+
icon?: RefOrValue<string>
|
|
119
|
+
tone?: RefOrValue<SemanticTone>
|
|
120
|
+
variant?: RefOrValue<ComponentVariant>
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface ComparisonFeature {
|
|
124
|
+
icon?: RefOrValue<string>
|
|
125
|
+
tone?: RefOrValue<SemanticTone>
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface CtaSection {
|
|
129
|
+
eyebrow?: RefOrValue<string>
|
|
130
|
+
title?: RefOrValue<string>
|
|
131
|
+
subtitle?: RefOrValue<string>
|
|
132
|
+
primaryLabel?: RefOrValue<string>
|
|
133
|
+
primaryHref?: RefOrValue<string>
|
|
134
|
+
primaryIcon?: RefOrValue<string>
|
|
135
|
+
secondaryLabel?: RefOrValue<string>
|
|
136
|
+
secondaryHref?: RefOrValue<string>
|
|
137
|
+
secondaryIcon?: RefOrValue<string>
|
|
138
|
+
meta?: RefOrValue<string>
|
|
139
|
+
tone?: RefOrValue<SemanticTone>
|
|
140
|
+
variant?: RefOrValue<ComponentVariant>
|
|
141
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent, html } from 'regor'
|
|
2
|
+
import type { MetricItem } from './landingTypes'
|
|
3
|
+
|
|
4
|
+
export function defineMetricItemComponent() {
|
|
5
|
+
const metricItemTemplate = html`<Flex align="start">
|
|
6
|
+
<IconFrame
|
|
7
|
+
r-if="icon"
|
|
8
|
+
:name="icon"
|
|
9
|
+
:tone="tone"
|
|
10
|
+
variant="surface"
|
|
11
|
+
size="sm"/>
|
|
12
|
+
<div>
|
|
13
|
+
<p class="prose-meta mb-1" r-if="label">{{ label }}</p>
|
|
14
|
+
<strong class="fs-body">{{ value }}</strong>
|
|
15
|
+
<p class="text-subtle fs-xs mb-0" r-if="detail">{{ detail }}</p>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</div>
|
|
18
|
+
</Flex>`
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
metricItem: defineComponent<MetricItem>(metricItemTemplate, {
|
|
22
|
+
props: ['label', 'value', 'detail', 'icon', 'tone'],
|
|
23
|
+
}),
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent, html } from 'regor'
|
|
2
|
+
import type { MetricStrip } from './landingTypes'
|
|
3
|
+
|
|
4
|
+
export function defineMetricStripComponent() {
|
|
5
|
+
const metricStripTemplate = html`<Panel :tone="tone" :variant="variant || 'surface'" class="w-full">
|
|
6
|
+
<Grid
|
|
7
|
+
:columns="columns || 1"
|
|
8
|
+
:columnsSm="columnsSm || 2"
|
|
9
|
+
:columnsLg="columnsLg || 4"
|
|
10
|
+
>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</Grid>
|
|
13
|
+
</Panel>`
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
metricStrip: defineComponent<MetricStrip>(metricStripTemplate, {
|
|
17
|
+
props: ['tone', 'variant', 'columns', 'columnsSm', 'columnsLg'],
|
|
18
|
+
}),
|
|
19
|
+
}
|
|
20
|
+
}
|