Skip to content

Commit 4c96ac2

Browse files
authored
Merge pull request #45 from PureStackStudio/feature-ts-format
Feature ts format
2 parents baae22a + 401baf8 commit 4c96ac2

296 files changed

Lines changed: 25285 additions & 8519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎frontend/components/landing/feature-showcase.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ const featureShowcaseTemplate = html`<Panel
3838
variant="link"
3939
icon="tabler:arrow-up-right"
4040
iconPosition="end"
41-
>{{ linkLabel }}</BtnLink
42-
>
41+
>{{ linkLabel }}</BtnLink>
4342
</Panel>`
4443

4544
export function defineFeatureShowcaseComponent() {

‎frontend/components/landing/regor-relationship.ts‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@ export interface RegorRelationship {
77

88
const regorRelationshipTemplate = html`<figure class="regor-connection">
99
<div class="regor-loop">
10-
<svg class="regor-loop-path" viewBox="0 0 360 220" preserveAspectRatio="none" fill="none" aria-hidden="true">
11-
<path class="regor-loop-ui" d="M80 62 V60 Q80 35 105 35 H255 Q280 35 280 54"/>
10+
<svg
11+
class="regor-loop-path"
12+
viewBox="0 0 360 220"
13+
preserveAspectRatio="none"
14+
fill="none"
15+
aria-hidden="true"
16+
>
17+
<path
18+
class="regor-loop-ui"
19+
d="M80 62 V60 Q80 35 105 35 H255 Q280 35 280 54"/>
1220
<path class="regor-loop-ui" d="M275 48 L280 55 L285 48"/>
13-
<path class="regor-loop-docs" d="M280 160 Q280 185 255 185 H105 Q80 185 80 166"/>
21+
<path
22+
class="regor-loop-docs"
23+
d="M280 160 Q280 185 255 185 H105 Q80 185 80 166"/>
1424
<path class="regor-loop-docs" d="M75 172 L80 165 L85 172"/>
1525
</svg>
16-
<span class="regor-loop-label regor-loop-label--ui">Reactive UI <Icon name="lucide:arrow-right"/></span>
26+
<span class="regor-loop-label regor-loop-label--ui"
27+
>Reactive UI <Icon name="lucide:arrow-right"/></span>
1728
<div class="regor-loop-node regor-loop-node--regor">
1829
<span class="regor-loop-mark"><Icon name="lucide:orbit"/></span>
1930
<strong>Regor</strong>
@@ -22,9 +33,12 @@ const regorRelationshipTemplate = html`<figure class="regor-connection">
2233
<span class="regor-loop-mark"><Icon name="tabler:stack-2"/></span>
2334
<strong>PureStack</strong>
2435
</div>
25-
<span class="regor-loop-label regor-loop-label--docs"><Icon name="lucide:arrow-left"/>Documentation</span>
36+
<span class="regor-loop-label regor-loop-label--docs"
37+
><Icon name="lucide:arrow-left"/>Documentation</span>
2638
</div>
27-
<figcaption>{{ uiCaption }}<br/>{{ docsCaption }}</figcaption>
39+
<figcaption>
40+
{{ uiCaption }}<br/>{{ docsCaption }}
41+
</figcaption>
2842
</figure>`
2943

3044
export function defineRegorRelationshipComponent() {

‎frontend/components/landing/source-workbench.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ const sourceWorkbenchTemplate = html`<Panel
2323
tabVariant="none"
2424
>
2525
<TabPane id="content" label="index.mdx" icon="tabler:file-code"
26-
><slot name="content"></slot
27-
></TabPane>
26+
><slot name="content"></slot></TabPane>
2827
<TabPane id="interactive" label="counter.ts" icon="tabler:braces"
29-
><slot name="interactive"></slot
30-
></TabPane>
28+
><slot name="interactive"></slot></TabPane>
3129
<TabPane id="style" label="styles.ts" icon="tabler:palette"
32-
><slot name="style"></slot
33-
></TabPane>
30+
><slot name="style"></slot></TabPane>
3431
</Tabs>
3532
<Flex class="workbench-status" align="center" justify="between">
3633
<span><Icon name="tabler:check"/>Same source. Connected workflow.</span>

‎frontend/components/shared/copy-button.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ const copyButtonTemplate = html`<Btn
1515
tone="neutral"
1616
variant="subtle"
1717
icon="tabler:copy"
18-
>Copy</Btn
19-
>`
18+
>Copy</Btn>`
2019

2120
export function defineCopyButtonComponent() {
2221
return defineComponent<CopyButton>(copyButtonTemplate, {

‎frontend/components/shell/palette-picker.ts‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,34 @@ import { palettePresets } from '../../theme/presets'
44
export interface PalettePicker {}
55

66
const template = html`<details class="palette-picker">
7-
<summary class="palette-picker__trigger" aria-label="Site color" title="Choose site color">
7+
<summary
8+
class="palette-picker__trigger"
9+
aria-label="Site color"
10+
title="Choose site color"
11+
>
812
<Icon name="tabler:palette" aria-hidden="true"/>
913
</summary>
1014
<fieldset class="palette-picker__panel">
1115
<legend>Site color</legend>
1216
<p>Choose your site’s color palette.</p>
13-
<div class="palette-picker__options">
14-
${palettePresets.map(renderColorOption).join('')}
15-
</div>
17+
<div class="palette-picker__options">${palettePresets.map(renderColorOption).join('')}</div>
1618
<span class="palette-picker__note">Saved on this device.</span>
1719
</fieldset>
18-
</details><PageScript src="/modules/palette-picker.ts"/>`
20+
</details>
21+
<PageScript src="/modules/palette-picker.ts"/>`
1922

2023
export function definePalettePickerComponent() {
2124
return defineComponent<PalettePicker>(template)
2225
}
2326

2427
function renderColorOption(preset: (typeof palettePresets)[number]) {
25-
return html`<label class="palette-picker__option" data-site-color-option="${preset.id}">
26-
<input type="radio" name="site-palette" value="${preset.id}"/>
27-
<span class="palette-picker__swatch" aria-hidden="true"><Icon name="tabler:check"/></span>
28-
<span>${preset.label}</span>
29-
</label>`
28+
return html`<label
29+
class="palette-picker__option"
30+
data-site-color-option="${preset.id}"
31+
>
32+
<input type="radio" name="site-palette" value="${preset.id}"/>
33+
<span class="palette-picker__swatch" aria-hidden="true"
34+
><Icon name="tabler:check"/></span>
35+
<span>${preset.label}</span>
36+
</label>`
3037
}

‎frontend/designs/social-preview.svg‎

Lines changed: 1 addition & 0 deletions
Loading

‎frontend/docs/apiProperty.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const apiPropertyTemplate = html`<section class="api-property" :id="anchor" :ari
1111
<header class="api-property__header">
1212
<h4>
1313
<a :href="'#' + anchor"
14-
><code>{{ name }}</code><span aria-hidden="true"> #</span></a
15-
>
14+
><code>{{ name }}</code><span aria-hidden="true"> #</span></a>
1615
</h4>
1716
<code class="api-property__type">{{ valueType }}</code>
1817
<dl class="api-property__default">

‎frontend/docs/componentGuide.ts‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,20 @@ export function defineComponentGuideComponents() {
2424
return {
2525
ComponentHeader: defineComponent<ComponentHeader>(
2626
html`<header class="component-header">
27-
<div class="component-header__top">
28-
<div class="component-header__identity"><code>{{ name }}</code><span>{{ kind }}</span></div>
29-
<nav class="component-header__links" aria-label="Component resources">
30-
<a href="#api-reference">API <span aria-hidden="true">↗</span></a>
31-
<a :href="source" target="_blank" rel="noopener">Source <span aria-hidden="true">↗</span></a>
32-
</nav>
33-
</div>
34-
<p class="component-header__summary">{{ summary }}</p>
35-
<a class="component-header__back" :href="sectionHref">{{ section }} <span aria-hidden="true">↗</span></a>
36-
</header>`,
27+
<div class="component-header__top">
28+
<div class="component-header__identity">
29+
<code>{{ name }}</code><span>{{ kind }}</span>
30+
</div>
31+
<nav class="component-header__links" aria-label="Component resources">
32+
<a href="#api-reference">API <span aria-hidden="true">↗</span></a>
33+
<a :href="source" target="_blank" rel="noopener"
34+
>Source <span aria-hidden="true">↗</span></a>
35+
</nav>
36+
</div>
37+
<p class="component-header__summary">{{ summary }}</p>
38+
<a class="component-header__back" :href="sectionHref"
39+
>{{ section }} <span aria-hidden="true">↗</span></a>
40+
</header>`,
3741
{
3842
props: ['name', 'summary', 'source', 'kind', 'section', 'sectionHref'],
3943
context: (head) => ({
@@ -45,10 +49,12 @@ export function defineComponentGuideComponents() {
4549
),
4650
ComponentExample: defineComponent<ComponentExample>(
4751
html`<section class="component-example" :aria-label="label">
48-
<header class="component-example__heading"><span class="component-example__dot" aria-hidden="true"></span><strong>{{ label }}</strong><span class="component-example__tag">COMPOSITION</span></header>
49-
<div class="component-example__stage"><slot></slot></div>
50-
<p class="component-example__caption">{{ caption }}</p>
51-
</section>`,
52+
<header class="component-example__heading">
53+
<span class="component-example__dot" aria-hidden="true"></span><strong>{{ label }}</strong><span class="component-example__tag">COMPOSITION</span>
54+
</header>
55+
<div class="component-example__stage"><slot></slot></div>
56+
<p class="component-example__caption">{{ caption }}</p>
57+
</section>`,
5258
{ props: ['label', 'caption'] },
5359
),
5460
}

‎frontend/docs/dataGuide.ts‎

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,29 @@ export interface ChartAppearanceControls {
7676
export function defineChartAppearanceControls() {
7777
return defineComponent<ChartAppearanceControls>(
7878
html`<Grid columns="1" columnsMd="3">
79-
<FormSelectField :id="prefix + '-tone'" label="Chart tone" :model="tone" :options="tones"/>
80-
<FormSelectField :id="prefix + '-variant'" label="Chart variant" :model="variant" :options="variants"/>
81-
<FormSelectField :id="prefix + '-mode'" label="Variant mode" :model="variantMode" :options="modes"/>
82-
<FormInputField r-if="showWidth" :id="prefix + '-width'" label="SVG width (px; blank is responsive)" type="number" min="240" :model="width"/>
83-
</Grid>`,
79+
<FormSelectField
80+
:id="prefix + '-tone'"
81+
label="Chart tone"
82+
:model="tone"
83+
:options="tones"/>
84+
<FormSelectField
85+
:id="prefix + '-variant'"
86+
label="Chart variant"
87+
:model="variant"
88+
:options="variants"/>
89+
<FormSelectField
90+
:id="prefix + '-mode'"
91+
label="Variant mode"
92+
:model="variantMode"
93+
:options="modes"/>
94+
<FormInputField
95+
r-if="showWidth"
96+
:id="prefix + '-width'"
97+
label="SVG width (px; blank is responsive)"
98+
type="number"
99+
min="240"
100+
:model="width"/>
101+
</Grid>`,
84102
{
85103
props: ['tone', 'variant', 'variantMode', 'width', 'showWidth', 'prefix'],
86104
context: (head) => ({
@@ -104,13 +122,43 @@ export interface ChartAppearanceGallery {
104122
export function defineChartAppearanceGallery() {
105123
return defineComponent<ChartAppearanceGallery>(
106124
html`<div class="component-appearance-grid data-chart-gallery">
107-
<div class="component-appearance-cell" r-for="sample in samples">
108-
<code>{{ sample.label }}</code>
109-
<BarChart r-if="component === 'BarChart'" :items="sample.items" :tone="sample.tone" :variant="sample.variant" :variantMode="sample.mode" width="100%" height="160" :animated="false" :ariaLabel="sample.label + ': Monday 24, Tuesday 38, Wednesday -12'"/>
110-
<LineChart r-if="component === 'LineChart'" :series="sample.series" :tone="sample.tone" :variant="sample.variant" :variantMode="sample.mode" width="100%" height="160" :showArea="true" :showPoints="true" :animated="false" :ariaLabel="sample.label + ': requests 18, 32, 25, 48'"/>
111-
<DoughnutChart r-if="component === 'DoughnutChart'" :segments="sample.segments" :tone="sample.tone" :variant="sample.variant" :variantMode="sample.mode" size="160" centerLabel="Tasks" centerValue="30" :animated="false" :ariaLabel="sample.label + ': complete 18, review 7, planned 5'"/>
112-
</div>
113-
</div>`,
125+
<div class="component-appearance-cell" r-for="sample in samples">
126+
<code>{{ sample.label }}</code>
127+
<BarChart
128+
r-if="component === 'BarChart'"
129+
:items="sample.items"
130+
:tone="sample.tone"
131+
:variant="sample.variant"
132+
:variantMode="sample.mode"
133+
width="100%"
134+
height="160"
135+
:animated="false"
136+
:ariaLabel="sample.label + ': Monday 24, Tuesday 38, Wednesday -12'"/>
137+
<LineChart
138+
r-if="component === 'LineChart'"
139+
:series="sample.series"
140+
:tone="sample.tone"
141+
:variant="sample.variant"
142+
:variantMode="sample.mode"
143+
width="100%"
144+
height="160"
145+
:showArea="true"
146+
:showPoints="true"
147+
:animated="false"
148+
:ariaLabel="sample.label + ': requests 18, 32, 25, 48'"/>
149+
<DoughnutChart
150+
r-if="component === 'DoughnutChart'"
151+
:segments="sample.segments"
152+
:tone="sample.tone"
153+
:variant="sample.variant"
154+
:variantMode="sample.mode"
155+
size="160"
156+
centerLabel="Tasks"
157+
centerValue="30"
158+
:animated="false"
159+
:ariaLabel="sample.label + ': complete 18, review 7, planned 5'"/>
160+
</div>
161+
</div>`,
114162
{
115163
props: ['component', 'axis'],
116164
context: (head) => {

‎frontend/docs/formAppearance.ts‎

Lines changed: 92 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,103 @@ const inputTypes = [
4444
'week',
4545
]
4646

47-
const template = html`<div class="component-appearance-grid forms-appearance-grid" :class="{ 'forms-appearance-grid--composer': component === 'Composer' }">
47+
const template = html`<div
48+
class="component-appearance-grid forms-appearance-grid"
49+
:class="{ 'forms-appearance-grid--composer': component === 'Composer' }"
50+
>
4851
<div class="component-appearance-cell" r-for="sample in samples">
4952
<code>{{ sample.label }}</code>
50-
<AppForm r-if="component === 'AppForm'" class="p-3" :tone="sample.tone" :variant="sample.variant" @submit.prevent="sample.submit($event)">
51-
<FormInputField :id="sample.id" label="Project name" name="project" :model="sample.model" :required="true"/>
53+
<AppForm
54+
r-if="component === 'AppForm'"
55+
class="p-3"
56+
:tone="sample.tone"
57+
:variant="sample.variant"
58+
@submit.prevent="sample.submit($event)"
59+
>
60+
<FormInputField
61+
:id="sample.id"
62+
label="Project name"
63+
name="project"
64+
:model="sample.model"
65+
:required="true"/>
5266
<FormSubmit label="Preview save" :tone="sample.tone"/>
53-
<FormStatus :hidden="!sample.receipt">{{ sample.receipt }}</FormStatus>
67+
<FormStatus :hidden="!sample.receipt"
68+
>{{ sample.receipt }}</FormStatus>
5469
</AppForm>
55-
<FormInputField r-if="component === 'FormInputField'" :id="sample.id" :label="axis === 'type' ? sample.label : 'Project name'" :type="axis === 'type' ? sample.label : 'text'" :model="sample.model" :tone="sample.tone" :variant="sample.variant" placeholder="Your next idea"/>
56-
<FormSelectField r-if="component === 'FormSelectField'" :id="sample.id" label="Region" :model="sample.model" :options="options" :tone="sample.tone" :variant="sample.variant"/>
57-
<FormCheck r-if="component === 'FormCheck'" :id="sample.id" label="Release updates" :checked="sample.checked" :tone="sample.tone"/>
58-
<form r-if="component === 'FormSubmit'" @submit.prevent="sample.submit($event)">
59-
<FormSubmit :label="sample.label" :tone="sample.tone" :variant="sample.variant"/>
60-
<FormStatus :hidden="!sample.receipt">{{ sample.receipt }}</FormStatus>
70+
<FormInputField
71+
r-if="component === 'FormInputField'"
72+
:id="sample.id"
73+
:label="axis === 'type' ? sample.label : 'Project name'"
74+
:type="axis === 'type' ? sample.label : 'text'"
75+
:model="sample.model"
76+
:tone="sample.tone"
77+
:variant="sample.variant"
78+
placeholder="Your next idea"/>
79+
<FormSelectField
80+
r-if="component === 'FormSelectField'"
81+
:id="sample.id"
82+
label="Region"
83+
:model="sample.model"
84+
:options="options"
85+
:tone="sample.tone"
86+
:variant="sample.variant"/>
87+
<FormCheck
88+
r-if="component === 'FormCheck'"
89+
:id="sample.id"
90+
label="Release updates"
91+
:checked="sample.checked"
92+
:tone="sample.tone"/>
93+
<form
94+
r-if="component === 'FormSubmit'"
95+
@submit.prevent="sample.submit($event)"
96+
>
97+
<FormSubmit
98+
:label="sample.label"
99+
:tone="sample.tone"
100+
:variant="sample.variant"/>
101+
<FormStatus :hidden="!sample.receipt"
102+
>{{ sample.receipt }}</FormStatus>
61103
</form>
62-
<FormStatus r-if="component === 'FormStatus'" :tone="sample.tone" :variant="sample.variant">Your draft is ready for review.</FormStatus>
63-
<AutoCompleteInput r-if="component === 'AutoCompleteInput'" :id="sample.id" label="Region" :model="sample.query" :selectedValue="sample.selected" :options="options" :tone="sample.tone" :variant="sample.variant" placeholder="Search a region"/>
64-
<MultiAutoCompleteInput r-if="component === 'MultiAutoCompleteInput'" :id="sample.id" label="Release tags" :items="sample.items" :model="sample.query" :options="tags" :tone="sample.tone" :variant="sample.variant" placeholder="Add a tag" :allowCustomValues="true"/>
65-
<Composer r-if="component === 'Composer'" :html="sample.content" :label="sample.label + ' editor'" :tone="sample.tone" :variant="sample.variant" minHeight="8rem"/>
66-
<DropFiles r-if="component === 'DropFiles'" :files="sample.files" label="Attachments" hint="Choose files, drop, or paste." :tone="sample.tone" :variant="sample.variant"/>
104+
<FormStatus
105+
r-if="component === 'FormStatus'"
106+
:tone="sample.tone"
107+
:variant="sample.variant"
108+
>Your draft is ready for review.</FormStatus>
109+
<AutoCompleteInput
110+
r-if="component === 'AutoCompleteInput'"
111+
:id="sample.id"
112+
label="Region"
113+
:model="sample.query"
114+
:selectedValue="sample.selected"
115+
:options="options"
116+
:tone="sample.tone"
117+
:variant="sample.variant"
118+
placeholder="Search a region"/>
119+
<MultiAutoCompleteInput
120+
r-if="component === 'MultiAutoCompleteInput'"
121+
:id="sample.id"
122+
label="Release tags"
123+
:items="sample.items"
124+
:model="sample.query"
125+
:options="tags"
126+
:tone="sample.tone"
127+
:variant="sample.variant"
128+
placeholder="Add a tag"
129+
:allowCustomValues="true"/>
130+
<Composer
131+
r-if="component === 'Composer'"
132+
:html="sample.content"
133+
:label="sample.label + ' editor'"
134+
:tone="sample.tone"
135+
:variant="sample.variant"
136+
minHeight="8rem"/>
137+
<DropFiles
138+
r-if="component === 'DropFiles'"
139+
:files="sample.files"
140+
label="Attachments"
141+
hint="Choose files, drop, or paste."
142+
:tone="sample.tone"
143+
:variant="sample.variant"/>
67144
</div>
68145
</div>`
69146

0 commit comments

Comments
 (0)