@uxfront/ui 0.9.0 → 0.9.2

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.
Files changed (34) hide show
  1. package/README.md +46 -46
  2. package/package.json +5 -5
  3. package/src/components/UxAnchor.vue +100 -100
  4. package/src/components/UxChapter.vue +157 -157
  5. package/src/components/UxChips.vue +32 -32
  6. package/src/components/UxCode.vue +42 -42
  7. package/src/components/UxErrorPage.vue +37 -37
  8. package/src/components/UxFeatures.vue +70 -70
  9. package/src/components/UxFinale.vue +148 -148
  10. package/src/components/UxHeader.vue +171 -171
  11. package/src/components/UxHero.vue +179 -179
  12. package/src/components/UxHeroLine.vue +18 -18
  13. package/src/components/UxHud.vue +139 -137
  14. package/src/components/UxPillLink.vue +41 -41
  15. package/src/components/UxPillars.vue +22 -22
  16. package/src/components/UxSection.vue +60 -60
  17. package/src/components/UxSite.vue +52 -48
  18. package/src/components/UxSpec.vue +21 -21
  19. package/src/components/UxSplit.vue +138 -138
  20. package/src/components/UxStage.vue +40 -38
  21. package/src/components/UxStageFallback.vue +28 -28
  22. package/src/components/UxTraits.vue +55 -55
  23. package/src/components/UxVideo.vue +50 -40
  24. package/src/components/icons/UxArrowIcon.vue +4 -4
  25. package/src/components/icons/UxFrameworkLogo.vue +4 -4
  26. package/src/components/icons/UxFrontMark.vue +10 -10
  27. package/src/components/icons/UxGithubIcon.vue +6 -6
  28. package/src/components/icons/UxStarIcon.vue +6 -6
  29. package/src/composables/experience.ts +58 -53
  30. package/src/directives/scramble.ts +41 -37
  31. package/src/frameworks.ts +12 -12
  32. package/src/styles/base.css +88 -88
  33. package/src/styles/tokens.css +28 -28
  34. package/src/types.ts +26 -26
@@ -6,35 +6,35 @@ import UxGithubIcon from "./icons/UxGithubIcon.vue";
6
6
  import UxStarIcon from "./icons/UxStarIcon.vue";
7
7
 
8
8
  const {
9
- homeHref = "#top",
10
- nav = [],
11
- navLabel = "Sections",
9
+ homeHref = "#top",
10
+ nav = [],
11
+ navLabel = "Sections",
12
12
  } = defineProps<{
13
- /** Shown beside the mark unless the `brand` slot restyles it; also names the link. */
14
- brand: string;
15
- homeHref?: string;
16
- /** Accessible name of the brand link. Defaults to "<brand>, back to top". */
17
- homeLabel?: string;
18
- nav?: UxNavItem[];
19
- navLabel?: string;
20
- /** A GitHub URL, linked at the end of the header. */
21
- github?: string;
22
- /** The repository's star count, shown beside the GitHub link. Leave it out to hide it. */
23
- githubStars?: number;
13
+ /** Shown beside the mark unless the `brand` slot restyles it; also names the link. */
14
+ brand: string;
15
+ homeHref?: string;
16
+ /** Accessible name of the brand link. Defaults to "<brand>, back to top". */
17
+ homeLabel?: string;
18
+ nav?: Array<UxNavItem>;
19
+ navLabel?: string;
20
+ /** A GitHub URL, linked at the end of the header. */
21
+ github?: string;
22
+ /** The repository's star count, shown beside the GitHub link. Leave it out to hide it. */
23
+ githubStars?: number;
24
24
  }>();
25
25
 
26
26
  defineSlots<{
27
- /** Before the name. Defaults to `UxFrontMark`; pass an empty slot to leave the mark out. */
28
- mark?(): unknown;
29
- /** Restyles the name, like `<strong>UX</strong>Front`. */
30
- brand?(): unknown;
31
- /**
32
- * Beside the brand link, not inside it, so it can hold links of its own,
33
- * like "by <a>UXFront</a>". Smaller and muted.
34
- */
35
- byline?(): unknown;
36
- /** Extra links at the end of the header, before the GitHub link. */
37
- actions?(): unknown;
27
+ /** Before the name. Defaults to `UxFrontMark`; pass an empty slot to leave the mark out. */
28
+ mark?(): unknown;
29
+ /** Restyles the name, like `<strong>UX</strong>Front`. */
30
+ brand?(): unknown;
31
+ /**
32
+ * Beside the brand link, not inside it, so it can hold links of its own,
33
+ * like "by <a>UXFront</a>". Smaller and muted.
34
+ */
35
+ byline?(): unknown;
36
+ /** Extra links at the end of the header, before the GitHub link. */
37
+ actions?(): unknown;
38
38
  }>();
39
39
 
40
40
  const { state } = useExperience();
@@ -44,229 +44,229 @@ const full = new Intl.NumberFormat("en");
44
44
  </script>
45
45
 
46
46
  <template>
47
- <header class="ux-header">
48
- <div class="ux-header__start">
49
- <a
50
- class="ux-header__brand"
51
- :href="homeHref"
52
- :aria-label="homeLabel ?? `${brand}, back to top`"
53
- >
54
- <slot v-if="$slots.mark" name="mark" />
55
- <UxFrontMark v-else class="ux-header__mark" />
56
- <span
57
- ><slot name="brand">{{ brand }}</slot></span
58
- >
59
- </a>
60
- <span v-if="$slots.byline" class="ux-header__byline"><slot name="byline" /></span>
61
- </div>
62
- <nav v-if="nav.length" class="ux-header__nav" :aria-label="navLabel">
63
- <ul>
64
- <li v-for="item in nav" :key="item.href">
65
- <a
66
- :href="item.href"
67
- :aria-current="
68
- state.activeId && item.href === `#${state.activeId}` ? 'location' : undefined
69
- "
70
- >
71
- <span v-if="item.index" class="ux-header__index">{{ item.index }}</span>
72
- {{ item.label }}
73
- </a>
74
- </li>
75
- </ul>
76
- </nav>
77
- <div v-if="$slots.actions || github" class="ux-header__end">
78
- <slot name="actions" />
79
- <a
80
- v-if="github"
81
- class="ux-header__github"
82
- :href="github"
83
- :aria-label="githubStars == null ? undefined : `GitHub, ${full.format(githubStars)} stars`"
84
- >
85
- <UxGithubIcon />
86
- <span>GitHub</span>
87
- <span v-if="githubStars != null" class="ux-header__stars">
88
- <UxStarIcon />
89
- {{ compact.format(githubStars) }}
90
- </span>
91
- </a>
92
- </div>
93
- </header>
47
+ <header class="ux-header">
48
+ <div class="ux-header__start">
49
+ <a
50
+ class="ux-header__brand"
51
+ :href="homeHref"
52
+ :aria-label="homeLabel ?? `${brand}, back to top`"
53
+ >
54
+ <slot v-if="$slots.mark" name="mark" />
55
+ <UxFrontMark v-else class="ux-header__mark" />
56
+ <span
57
+ ><slot name="brand">{{ brand }}</slot></span
58
+ >
59
+ </a>
60
+ <span v-if="$slots.byline" class="ux-header__byline"><slot name="byline" /></span>
61
+ </div>
62
+ <nav v-if="nav.length" class="ux-header__nav" :aria-label="navLabel">
63
+ <ul>
64
+ <li v-for="item in nav" :key="item.href">
65
+ <a
66
+ :href="item.href"
67
+ :aria-current="
68
+ state.activeId && item.href === `#${state.activeId}` ? 'location' : undefined
69
+ "
70
+ >
71
+ <span v-if="item.index" class="ux-header__index">{{ item.index }}</span>
72
+ {{ item.label }}
73
+ </a>
74
+ </li>
75
+ </ul>
76
+ </nav>
77
+ <div v-if="$slots.actions || github" class="ux-header__end">
78
+ <slot name="actions" />
79
+ <a
80
+ v-if="github"
81
+ class="ux-header__github"
82
+ :href="github"
83
+ :aria-label="githubStars == null ? undefined : `GitHub, ${full.format(githubStars)} stars`"
84
+ >
85
+ <UxGithubIcon />
86
+ <span>GitHub</span>
87
+ <span v-if="githubStars != null" class="ux-header__stars">
88
+ <UxStarIcon />
89
+ {{ compact.format(githubStars) }}
90
+ </span>
91
+ </a>
92
+ </div>
93
+ </header>
94
94
  </template>
95
95
 
96
96
  <style scoped>
97
97
  .ux-header {
98
- position: fixed;
99
- inset: 0 0 auto;
100
- z-index: 20;
101
- display: flex;
102
- align-items: center;
103
- justify-content: space-between;
104
- gap: 2rem;
105
- padding: 1.1rem var(--ux-gutter);
106
- background: linear-gradient(180deg, rgb(5 5 7 / 0.85), rgb(5 5 7 / 0));
98
+ position: fixed;
99
+ inset: 0 0 auto;
100
+ z-index: 20;
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: space-between;
104
+ gap: 2rem;
105
+ padding: 1.1rem var(--ux-gutter);
106
+ background: linear-gradient(180deg, rgb(5 5 7 / 0.85), rgb(5 5 7 / 0));
107
107
  }
108
108
 
109
109
  .ux-header a {
110
- display: inline-flex;
111
- align-items: center;
112
- min-height: 2.75rem;
113
- color: var(--ux-fg);
114
- text-decoration: none;
110
+ display: inline-flex;
111
+ align-items: center;
112
+ min-height: 2.75rem;
113
+ color: var(--ux-fg);
114
+ text-decoration: none;
115
115
  }
116
116
 
117
117
  .ux-header__brand {
118
- gap: 0.6rem;
119
- font-size: 1.0625rem;
120
- font-weight: 500;
121
- letter-spacing: -0.02em;
118
+ gap: 0.6rem;
119
+ font-size: 1.0625rem;
120
+ font-weight: 500;
121
+ letter-spacing: -0.02em;
122
122
  }
123
123
 
124
124
  .ux-header__brand :slotted(svg),
125
125
  .ux-header__mark {
126
- width: 1.5rem;
127
- height: 1.5rem;
126
+ width: 1.5rem;
127
+ height: 1.5rem;
128
128
  }
129
129
 
130
130
  .ux-header__start {
131
- display: flex;
132
- align-items: center;
133
- gap: 0.75rem;
134
- min-width: 0;
131
+ display: flex;
132
+ align-items: center;
133
+ gap: 0.75rem;
134
+ min-width: 0;
135
135
  }
136
136
 
137
137
  .ux-header__byline {
138
- display: inline-flex;
139
- align-items: center;
140
- gap: 0.35rem;
141
- font-size: 0.8125rem;
142
- white-space: nowrap;
143
- color: var(--ux-fg-3);
138
+ display: inline-flex;
139
+ align-items: center;
140
+ gap: 0.35rem;
141
+ font-size: 0.8125rem;
142
+ white-space: nowrap;
143
+ color: var(--ux-fg-3);
144
144
  }
145
145
 
146
146
  .ux-header__byline :slotted(a) {
147
- display: inline-flex;
148
- align-items: center;
149
- gap: 0.3rem;
150
- min-height: 2.75rem;
151
- font-weight: 500;
152
- letter-spacing: -0.02em;
153
- color: var(--ux-fg-2);
154
- text-decoration: none;
155
- transition: color 0.3s var(--ux-ease-out);
147
+ display: inline-flex;
148
+ align-items: center;
149
+ gap: 0.3rem;
150
+ min-height: 2.75rem;
151
+ font-weight: 500;
152
+ letter-spacing: -0.02em;
153
+ color: var(--ux-fg-2);
154
+ text-decoration: none;
155
+ transition: color 0.3s var(--ux-ease-out);
156
156
  }
157
157
 
158
158
  .ux-header__byline :slotted(a:hover) {
159
- color: var(--ux-fg);
159
+ color: var(--ux-fg);
160
160
  }
161
161
 
162
162
  .ux-header__byline :slotted(svg) {
163
- width: 0.875rem;
164
- height: 0.875rem;
163
+ width: 0.875rem;
164
+ height: 0.875rem;
165
165
  }
166
166
 
167
167
  .ux-header__nav ul {
168
- display: flex;
169
- gap: clamp(1rem, 2.4vw, 2.5rem);
170
- margin: 0;
171
- padding: 0;
172
- list-style: none;
168
+ display: flex;
169
+ gap: clamp(1rem, 2.4vw, 2.5rem);
170
+ margin: 0;
171
+ padding: 0;
172
+ list-style: none;
173
173
  }
174
174
 
175
175
  .ux-header__nav a {
176
- position: relative;
177
- gap: 0.5rem;
178
- font-size: 0.875rem;
179
- color: var(--ux-fg-2);
180
- transition: color 0.3s var(--ux-ease-out);
176
+ position: relative;
177
+ gap: 0.5rem;
178
+ font-size: 0.875rem;
179
+ color: var(--ux-fg-2);
180
+ transition: color 0.3s var(--ux-ease-out);
181
181
  }
182
182
 
183
183
  .ux-header__nav a::after {
184
- content: "";
185
- position: absolute;
186
- left: 0;
187
- right: 0;
188
- bottom: 0.55rem;
189
- height: 1px;
190
- background: currentColor;
191
- transform: scaleX(0);
192
- transform-origin: right;
193
- transition: transform 0.5s var(--ux-ease-out);
184
+ content: "";
185
+ position: absolute;
186
+ left: 0;
187
+ right: 0;
188
+ bottom: 0.55rem;
189
+ height: 1px;
190
+ background: currentColor;
191
+ transform: scaleX(0);
192
+ transform-origin: right;
193
+ transition: transform 0.5s var(--ux-ease-out);
194
194
  }
195
195
 
196
196
  .ux-header__nav a:hover,
197
197
  .ux-header__nav a[aria-current] {
198
- color: var(--ux-fg);
198
+ color: var(--ux-fg);
199
199
  }
200
200
 
201
201
  .ux-header__nav a:hover::after,
202
202
  .ux-header__nav a[aria-current]::after {
203
- transform: scaleX(1);
204
- transform-origin: left;
203
+ transform: scaleX(1);
204
+ transform-origin: left;
205
205
  }
206
206
 
207
207
  .ux-header__index {
208
- font-family: var(--font-ux-mono);
209
- font-size: 0.75rem;
210
- color: var(--ux-fg-3);
208
+ font-family: var(--font-ux-mono);
209
+ font-size: 0.75rem;
210
+ color: var(--ux-fg-3);
211
211
  }
212
212
 
213
213
  .ux-header__end {
214
- display: flex;
215
- align-items: center;
216
- gap: 1.5rem;
214
+ display: flex;
215
+ align-items: center;
216
+ gap: 1.5rem;
217
217
  }
218
218
 
219
219
  .ux-header__end :slotted(a) {
220
- gap: 0.5rem;
221
- font-size: 0.875rem;
222
- color: var(--ux-fg-2);
223
- transition: color 0.3s var(--ux-ease-out);
220
+ gap: 0.5rem;
221
+ font-size: 0.875rem;
222
+ color: var(--ux-fg-2);
223
+ transition: color 0.3s var(--ux-ease-out);
224
224
  }
225
225
 
226
226
  .ux-header__end :slotted(a:hover) {
227
- color: var(--ux-fg);
227
+ color: var(--ux-fg);
228
228
  }
229
229
 
230
230
  .ux-header__github {
231
- gap: 0.5rem;
232
- font-size: 0.875rem;
231
+ gap: 0.5rem;
232
+ font-size: 0.875rem;
233
233
  }
234
234
 
235
235
  .ux-header__github svg {
236
- width: 1.125rem;
237
- height: 1.125rem;
236
+ width: 1.125rem;
237
+ height: 1.125rem;
238
238
  }
239
239
 
240
240
  .ux-header__stars {
241
- display: inline-flex;
242
- align-items: center;
243
- gap: 0.25rem;
244
- padding: 0.125rem 0.5rem;
245
- border: 1px solid var(--ux-line-strong);
246
- border-radius: 999px;
247
- font-family: var(--font-ux-mono);
248
- font-size: 0.75rem;
249
- font-variant-numeric: tabular-nums;
250
- color: var(--ux-fg-2);
241
+ display: inline-flex;
242
+ align-items: center;
243
+ gap: 0.25rem;
244
+ padding: 0.125rem 0.5rem;
245
+ border: 1px solid var(--ux-line-strong);
246
+ border-radius: 999px;
247
+ font-family: var(--font-ux-mono);
248
+ font-size: 0.75rem;
249
+ font-variant-numeric: tabular-nums;
250
+ color: var(--ux-fg-2);
251
251
  }
252
252
 
253
253
  .ux-header__github .ux-header__stars svg {
254
- width: 0.75rem;
255
- height: 0.75rem;
254
+ width: 0.75rem;
255
+ height: 0.75rem;
256
256
  }
257
257
 
258
258
  @media (max-width: 960px) {
259
- .ux-header__nav {
260
- display: none;
261
- }
259
+ .ux-header__nav {
260
+ display: none;
261
+ }
262
262
  }
263
263
 
264
264
  /* Where the copy scrolls under the header (stacked and landscape-phone
265
265
  layouts, see UxChapter), a solid band keeps it off the logo. */
266
266
  @media (max-width: 1099px), (max-aspect-ratio: 5/4) {
267
- .ux-header {
268
- padding-bottom: 1.6rem;
269
- background: linear-gradient(180deg, rgb(5 5 7 / 0.96), rgb(5 5 7 / 0.9) 58%, rgb(5 5 7 / 0));
270
- }
267
+ .ux-header {
268
+ padding-bottom: 1.6rem;
269
+ background: linear-gradient(180deg, rgb(5 5 7 / 0.96), rgb(5 5 7 / 0.9) 58%, rgb(5 5 7 / 0));
270
+ }
271
271
  }
272
272
  </style>