Skip to content

Commit 014b1f8

Browse files
Merge pull request #570 from universal-ember/docs-updates-tests-and-such
Docs updates (document testing utilities)
2 parents 42ec1d7 + fc1447a commit 014b1f8

File tree

18 files changed

+314
-89
lines changed

18 files changed

+314
-89
lines changed
Lines changed: 86 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.typedoc__type-link,
22
.typedoc__unknown__yield,
3-
.typedoc-intrinsic {
3+
.typedoc__intrinsic {
44
border: 1px solid #222;
55
display: inline-block;
66
font-style: italic;
@@ -9,124 +9,158 @@
99
font-size: 0.75rem;
1010
padding: 0 0.5rem;
1111
}
12-
1312
.typedoc__type-link {
1413
padding: 0 0.5rem;
1514
}
16-
17-
.typedoc-declaration-name {
15+
.typedoc__declaration-name {
1816
margin: 0;
1917
display: inline-block;
2018
line-height: 1.5rem;
2119
}
22-
.typedoc-declaration {
23-
.typedoc-declaration-name {
24-
font-weight: bold;
20+
.typedoc__declaration {
21+
.typedoc__declaration-name {
22+
font-weight: 700;
2523
}
2624
}
2725
section {
28-
> .typedoc-declaration {
29-
> .typedoc-declaration-name {
26+
> .typedoc__declaration {
27+
> .typedoc__declaration-name {
3028
font-size: 1.5rem;
3129
}
3230
}
3331
}
34-
35-
.typedoc-heading {
32+
.typedoc__heading {
3633
display: block;
3734
}
38-
39-
.typedoc-property,
40-
.typedoc-component-arg {
35+
.typedoc__property,
36+
.typedoc__component-signature__arg {
4137
padding: 0 1rem;
4238
}
43-
44-
.typedoc-declaration-signatures {
39+
.typedoc__declaration-signatures {
4540
list-style: none;
4641
}
47-
48-
.typedoc-named-tuple,
49-
.typedoc-component-arg-info {
42+
.typedoc__named-tuple,
43+
.typedoc__component-signature__arg-info,
44+
.typedoc__helper-signature__arg-info,
45+
.typedoc__modifier-signature__arg-info {
5046
display: flex;
5147
gap: 0.25rem;
5248
align-items: baseline;
5349
justify-content: space-between;
5450
}
55-
.typedoc-component-arg-info > .typedoc-name {
51+
.typedoc__component-signature__arg-info > .typedoc__name,
52+
.typedoc__helper-signature__arg-info > .typedoc__name,
53+
.typedoc__modifier-signature__arg-info > .typedoc__name {
5654
display: inline-block;
5755
margin: 0;
5856
font-size: 1rem;
59-
font-weight: bold;
57+
font-weight: 700;
6058
}
61-
62-
.typedoc-declaration-children {
59+
.typedoc__helper-signature__arg-info {
60+
border-bottom: 1px rgba(125, 125, 125, 0.5) dashed;
61+
}
62+
.typedoc__helper__return {
63+
display: flex;
64+
align-items: center;
65+
justify-content: space-between;
66+
}
67+
.typedoc__helper__return > .typedoc__heading {
68+
margin: 0;
69+
}
70+
.typedoc__declaration-children,
71+
.typedoc__declaration-children li {
6372
list-style: none;
6473
padding: 0 0.5rem;
6574
}
66-
67-
/**
68-
*
69-
* Component Signatures
70-
*
71-
*/
75+
.typedoc__arg-flags {
76+
display: flex;
77+
gap: 0.25rem;
78+
align-items: baseline;
79+
justify-content: flex-start;
80+
margin: 0.5rem 0;
81+
}
82+
.typedoc__arg-flags > .typedoc__flag {
83+
display: inline-block;
84+
margin: 0;
85+
font-size: 0.75rem;
86+
padding: 0 0.5rem;
87+
border: 1px solid #222;
88+
border-radius: var(--pico-border-radius);
89+
font-family: var(--pico-font-family-monospace);
90+
}
91+
.typedoc__modifier-signature__element,
7292
.typedoc__component-signature__element,
7393
.typedoc__component-signature__block {
7494
display: block;
7595
padding: 0 1rem;
7696
}
97+
.typedoc__modifier-signature__element-type,
7798
.typedoc__component-signature__element-type {
7899
display: flex;
79100
gap: 0.25rem;
80101
align-items: baseline;
81102
justify-content: space-between;
82103
}
83-
104+
.typedoc__modifier-signature__element-type > .typedoc__name,
84105
.typedoc__component-signature__element-type > .typedoc__name {
85106
display: inline-block;
86107
margin: 0;
87108
line-height: 1.5rem;
88109
}
89-
90-
.typedoc__component-signature__block .typedoc-declaration-name + .typedoc-reference {
110+
.typedoc__modifier-signature__element-header,
111+
.typedoc__component-signature__element-header {
112+
display: flex;
113+
flex-direction: row;
114+
width: 100%;
115+
justify-content: space-between;
116+
align-items: baseline;
117+
}
118+
.typedoc__helper-signature__block .typedoc-rendered-comment,
119+
.typedoc__component-signature__block .typedoc-rendered-comment {
120+
border-top: 1px solid #333;
121+
padding-top: 0.5rem;
122+
margin-top: 0.5rem;
123+
}
124+
.typedoc__component-signature__block .typedoc__declaration-name + .typedoc__reference {
91125
margin-bottom: -0.25rem;
92126
}
93-
.typedoc__component-signature__block > .typedoc-property .typedoc-declaration-children {
127+
.typedoc__component-signature__block > .typedoc__property .typedoc__declaration-children {
94128
display: grid;
95129
gap: 0.5rem;
96130
}
97131
.typedoc__component-signature__block
98-
> .typedoc-property
99-
> .typedoc-declaration
100-
> ul.typedoc-declaration-children
132+
> .typedoc__property
133+
> .typedoc__declaration
134+
> ul.typedoc__declaration-children
101135
> li
102-
> .typedoc-declaration {
103-
@apply p-6 rounded-xl bg-sky-50 dark:bg-slate-800/60 dark:ring-1 dark:ring-slate-300/10;
136+
> .typedoc__declaration {
137+
border: 1px solid lightgray;
138+
padding: 0.5rem;
104139
}
105-
106-
.typedoc-component-arg {
140+
.typedoc__helper-signature__arg,
141+
.typedoc__modifier-signature__arg,
142+
.typedoc__component-signature__arg {
107143
margin-bottom: 0.5rem;
108144
display: grid;
109145
gap: 0.25rem;
110146
}
111-
.typedoc-component-arg > .typedoc-name,
147+
.typedoc__helper-signature__arg > .typedoc__name,
148+
.typedoc__modifier-signature__arg > .typedoc__name,
149+
.typedoc__component-signature__arg > .typedoc__name,
112150
.typedoc__component-signature__block > .typedoc__name {
113151
font-size: 1.2rem;
114152
overflow-y: hidden;
115153
overflow-x: hidden;
116154
overflow: hidden;
155+
margin: 0;
117156
max-height: unset;
118157
}
119-
120-
.typedoc-component-arg .typedoc-rendered-comment p {
158+
.typedoc__helper-signature__arg .typedoc-rendered-comment p,
159+
.typedoc__modifier-signature__arg .typedoc-rendered-comment p,
160+
.typedoc__component-signature__arg .typedoc-rendered-comment p {
121161
margin-top: 0;
122162
margin-bottom: 0.25rem;
123163
}
124-
125-
/**
126-
* References
127-
*/
128-
.typedoc__reference {
129-
}
130164
.typedoc__reference__name {
131165
display: inline;
132166
border: 1px solid #222;
@@ -145,27 +179,17 @@ section {
145179
.typedoc__reference__typeArgument {
146180
border: 1px solid;
147181
}
148-
149-
/**
150-
* Array formatting
151-
*/
152-
.typedoc__array > div.typedoc-declaration > ul.typedoc-declaration-children {
182+
.typedoc__array > div.typedoc__declaration > ul.typedoc__declaration-children {
153183
border: 1px solid;
154184
margin: 0;
155185
}
156-
157-
/**
158-
* Signature / Function Formatting
159-
*/
160186
.typedoc__function__type {
161187
display: flex;
162188
gap: 0.25rem;
163189
}
164-
165190
.typedoc__function__type:has(.typedoc__function__parameter) {
166191
display: grid;
167192
}
168-
169193
.typedoc__function__parameters {
170194
margin-left: 1rem;
171195
display: grid;
@@ -181,10 +205,6 @@ section {
181205
grid-auto-flow: column;
182206
gap: 0.5rem;
183207
}
184-
.typedoc__function__parameter__comment {
185-
/* font-style: italic; */
186-
/* font-size: 0.75rem; */
187-
}
188208
.typedoc__function__return_type,
189209
.typedoc__function__close {
190210
display: inline-block;
@@ -197,18 +217,10 @@ section {
197217
font-family: monospace;
198218
font-size: 1rem;
199219
}
200-
201-
/**
202-
* Literal
203-
*/
204220
.typedoc__literal {
205221
font-family: monospace;
206222
font-size: 0.75rem;
207223
}
208-
209-
/**
210-
* Union
211-
*/
212224
.typedoc__union {
213225
display: inline-flex;
214226
flex-wrap: wrap;
@@ -218,9 +230,9 @@ section {
218230
display: inline-flex;
219231
gap: 0.25rem;
220232
}
221-
.typedoc__union__type::before {
233+
.typedoc__union__type:before {
222234
content: "|";
223235
}
224-
.typedoc__union .typedoc__union__type:first-child::before {
236+
.typedoc__union .typedoc__union__type:first-child:before {
225237
display: none;
226238
}

docs-app/app/routes/api-docs.gts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
import {
22
APIDocs as KolayAPIDocs,
3+
CommentQuery as KolayCommentQuery,
34
ComponentSignature as KolayComponentSignature,
45
ModifierSignature as KolayModifierSignature,
56
} from 'kolay';
67

78
import type { TOC } from '@ember/component/template-only';
89

10+
export function comment(name: string, declaration: string) {
11+
return <template>
12+
<KolayCommentQuery
13+
@package="ember-primitives"
14+
@module="declarations/{{declaration}}"
15+
@name={{name}}
16+
/>
17+
</template>;
18+
}
19+
920
export const APIDocs: TOC<{
1021
Args: { declaration: string; name: string };
1122
}> = <template>

docs-app/app/routes/application.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
99
import { Callout } from '@universal-ember/docs-support';
1010

1111
import { Tabs } from '../components/tabs.gts';
12-
import { APIDocs, ComponentSignature, ModifierSignature } from './api-docs';
12+
import { APIDocs, comment, ComponentSignature, ModifierSignature } from './api-docs';
1313

1414
export default class Application extends Route {
1515
async model() {
@@ -40,6 +40,7 @@ export default class Application extends Route {
4040
ComponentSignature,
4141
ModifierSignature,
4242
Tabs,
43+
comment,
4344
},
4445
resolve: {
4546
// ember-primitives
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Testing: a11y
2+
3+
Utilities for helping test the accessibility behaviors.
4+
5+
```gjs live no-shadow
6+
import { APIDocs } from 'kolay';
7+
8+
<template>
9+
<APIDocs
10+
@package="ember-primitives"
11+
@module="declarations/test-support/a11y"
12+
@name="setupTabster" />
13+
</template>
14+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Testing: dom
2+
3+
Utilities for interacting with the (shadow) dom in testing
4+
5+
```gjs live no-shadow
6+
import { APIDocs } from 'kolay';
7+
8+
<template>
9+
<APIDocs
10+
@package="ember-primitives"
11+
@module="declarations/test-support/dom"
12+
@name="findInFirstShadow" />
13+
14+
<APIDocs
15+
@package="ember-primitives"
16+
@module="declarations/test-support/dom"
17+
@name="findInShadow" />
18+
19+
<APIDocs
20+
@package="ember-primitives"
21+
@module="declarations/test-support/dom"
22+
@name="findShadow" />
23+
24+
<APIDocs
25+
@package="ember-primitives"
26+
@module="declarations/test-support/dom"
27+
@name="hasShadowRoot" />
28+
</template>
29+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Testing: OTP
2+
3+
Utilities for working with the one-time-password component.
4+
5+
6+
```gjs live no-shadow
7+
import { APIDocs } from 'kolay';
8+
9+
<template>
10+
<APIDocs
11+
@package="ember-primitives"
12+
@module="declarations/test-support/otp"
13+
@name="fillOTP" />
14+
</template>
15+
```

0 commit comments

Comments
 (0)