@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
@@ -2,264 +2,264 @@
2
2
  import type { UxNavItem } from "../types";
3
3
 
4
4
  const {
5
- id = "top",
6
- index = [],
7
- indexLabel = "Sections",
8
- scrollLabel = "Scroll to explore",
5
+ id = "top",
6
+ index = [],
7
+ indexLabel = "Sections",
8
+ scrollLabel = "Scroll to explore",
9
9
  } = defineProps<{
10
- id?: string;
11
- /** A short mono line above the title, after a pulsing dot. */
12
- kicker?: string;
13
- /** A tag between the dot and the kicker, like "New". */
14
- badge?: string;
15
- /** The title as one sentence, for assistive technology. `lines` are only visual. */
16
- title: string;
17
- /** Section links, shown below the lead on small screens instead of the header's nav. */
18
- index?: UxNavItem[];
19
- indexLabel?: string;
20
- /** Where the scroll cue leads, usually the first chapter. */
21
- scrollHref?: string;
22
- scrollLabel?: string;
10
+ id?: string;
11
+ /** A short mono line above the title, after a pulsing dot. */
12
+ kicker?: string;
13
+ /** A tag between the dot and the kicker, like "New". */
14
+ badge?: string;
15
+ /** The title as one sentence, for assistive technology. `lines` are only visual. */
16
+ title: string;
17
+ /** Section links, shown below the lead on small screens instead of the header's nav. */
18
+ index?: Array<UxNavItem>;
19
+ indexLabel?: string;
20
+ /** Where the scroll cue leads, usually the first chapter. */
21
+ scrollHref?: string;
22
+ scrollLabel?: string;
23
23
  }>();
24
24
 
25
25
  defineSlots<{
26
- /** The title, one `UxHeroLine` per line. */
27
- lines(): unknown;
28
- lead?(): unknown;
26
+ /** The title, one `UxHeroLine` per line. */
27
+ lines(): unknown;
28
+ lead?(): unknown;
29
29
  }>();
30
30
  </script>
31
31
 
32
32
  <template>
33
- <section :id="id" class="ux-hero" data-stage :aria-labelledby="`${id}-title`">
34
- <div class="ux-hero__content">
35
- <p v-if="kicker" class="ux-hero__kicker ux-mono">
36
- <span class="ux-hero__pulse" aria-hidden="true" />
37
- <span v-if="badge" class="ux-hero__badge">{{ badge }}</span>
38
- {{ kicker }}
39
- </p>
40
- <h1 :id="`${id}-title`" class="ux-hero__title">
41
- <span class="ux-sr-only">{{ title }}</span>
42
- <span class="ux-hero__lines" aria-hidden="true"><slot name="lines" /></span>
43
- </h1>
44
- <p v-if="$slots.lead" class="ux-hero__lead"><slot name="lead" /></p>
45
- <ol v-if="index.length" class="ux-hero__index" :aria-label="indexLabel">
46
- <li v-for="item in index" :key="item.href">
47
- <a :href="item.href">
48
- <span v-if="item.index" class="ux-mono">{{ item.index }}</span>
49
- {{ item.label }}
50
- </a>
51
- </li>
52
- </ol>
53
- </div>
54
- <a v-if="scrollHref" class="ux-hero__scroll ux-mono" :href="scrollHref">
55
- <span class="ux-hero__scroll-line" aria-hidden="true" />
56
- {{ scrollLabel }}
57
- </a>
58
- </section>
33
+ <section :id="id" class="ux-hero" data-stage :aria-labelledby="`${id}-title`">
34
+ <div class="ux-hero__content">
35
+ <p v-if="kicker" class="ux-hero__kicker ux-mono">
36
+ <span class="ux-hero__pulse" aria-hidden="true" />
37
+ <span v-if="badge" class="ux-hero__badge">{{ badge }}</span>
38
+ {{ kicker }}
39
+ </p>
40
+ <h1 :id="`${id}-title`" class="ux-hero__title">
41
+ <span class="ux-sr-only">{{ title }}</span>
42
+ <span class="ux-hero__lines" aria-hidden="true"><slot name="lines" /></span>
43
+ </h1>
44
+ <p v-if="$slots.lead" class="ux-hero__lead"><slot name="lead" /></p>
45
+ <ol v-if="index.length" class="ux-hero__index" :aria-label="indexLabel">
46
+ <li v-for="item in index" :key="item.href">
47
+ <a :href="item.href">
48
+ <span v-if="item.index" class="ux-mono">{{ item.index }}</span>
49
+ {{ item.label }}
50
+ </a>
51
+ </li>
52
+ </ol>
53
+ </div>
54
+ <a v-if="scrollHref" class="ux-hero__scroll ux-mono" :href="scrollHref">
55
+ <span class="ux-hero__scroll-line" aria-hidden="true" />
56
+ {{ scrollLabel }}
57
+ </a>
58
+ </section>
59
59
  </template>
60
60
 
61
61
  <style scoped>
62
62
  .ux-hero {
63
- position: relative;
64
- display: flex;
65
- flex-direction: column;
66
- justify-content: flex-end;
67
- min-height: 100vh;
68
- min-height: 100svh;
69
- padding: 7rem var(--ux-gutter) 8.5rem;
63
+ position: relative;
64
+ display: flex;
65
+ flex-direction: column;
66
+ justify-content: flex-end;
67
+ min-height: 100vh;
68
+ min-height: 100svh;
69
+ padding: 7rem var(--ux-gutter) 8.5rem;
70
70
  }
71
71
 
72
72
  .ux-hero__content {
73
- /* Keeps long lines, like the kicker, clear of the formation. */
74
- max-width: min(60rem, 64vw);
73
+ /* Keeps long lines, like the kicker, clear of the formation. */
74
+ max-width: min(60rem, 64vw);
75
75
  }
76
76
 
77
77
  .ux-hero__kicker {
78
- display: flex;
79
- align-items: center;
80
- gap: 0.75rem;
81
- margin-bottom: 1.75rem;
82
- color: var(--ux-fg-2);
83
- animation: rise 1.2s var(--ux-ease-out) both;
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 0.75rem;
81
+ margin-bottom: 1.75rem;
82
+ color: var(--ux-fg-2);
83
+ animation: rise 1.2s var(--ux-ease-out) both;
84
84
  }
85
85
 
86
86
  .ux-hero__pulse {
87
- width: 6px;
88
- height: 6px;
89
- border-radius: 50%;
90
- background: var(--ux-fg);
91
- box-shadow: 0 0 0 0 rgb(255 255 255 / 0.6);
92
- animation: pulse 2.4s var(--ux-ease-out) infinite;
87
+ width: 6px;
88
+ height: 6px;
89
+ border-radius: 50%;
90
+ background: var(--ux-fg);
91
+ box-shadow: 0 0 0 0 rgb(255 255 255 / 0.6);
92
+ animation: pulse 2.4s var(--ux-ease-out) infinite;
93
93
  }
94
94
 
95
95
  .ux-hero__badge {
96
- flex: none;
97
- padding: 0.3em 0.6em 0.25em;
98
- font-size: 0.6875rem;
99
- line-height: 1;
100
- border: 1px solid var(--ux-line-strong);
101
- border-radius: 999px;
96
+ flex: none;
97
+ padding: 0.3em 0.6em 0.25em;
98
+ font-size: 0.6875rem;
99
+ line-height: 1;
100
+ border: 1px solid var(--ux-line-strong);
101
+ border-radius: 999px;
102
102
  }
103
103
 
104
104
  .ux-hero__title {
105
- /* Wide enough to lead, never wide enough to reach the formation. */
106
- font-size: clamp(2.5rem, min(0.5rem + 5.2vw, 11vh), 6.75rem);
107
- font-weight: 500;
108
- line-height: 0.94;
109
- letter-spacing: -0.055em;
105
+ /* Wide enough to lead, never wide enough to reach the formation. */
106
+ font-size: clamp(2.5rem, min(0.5rem + 5.2vw, 11vh), 6.75rem);
107
+ font-weight: 500;
108
+ line-height: 0.94;
109
+ letter-spacing: -0.055em;
110
110
  }
111
111
 
112
112
  .ux-hero__lines {
113
- display: block;
113
+ display: block;
114
114
  }
115
115
 
116
116
  .ux-hero__lead {
117
- max-width: 34rem;
118
- margin-top: 2rem;
119
- font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
120
- line-height: 1.45;
121
- letter-spacing: -0.01em;
122
- color: var(--ux-fg-2);
123
- text-wrap: pretty;
124
- animation: rise 1.2s 0.35s var(--ux-ease-out) both;
117
+ max-width: 34rem;
118
+ margin-top: 2rem;
119
+ font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
120
+ line-height: 1.45;
121
+ letter-spacing: -0.01em;
122
+ color: var(--ux-fg-2);
123
+ text-wrap: pretty;
124
+ animation: rise 1.2s 0.35s var(--ux-ease-out) both;
125
125
  }
126
126
 
127
127
  .ux-hero__index {
128
- display: none;
128
+ display: none;
129
129
  }
130
130
 
131
131
  .ux-hero__scroll {
132
- position: absolute;
133
- left: var(--ux-gutter);
134
- bottom: 4.25rem;
135
- display: inline-flex;
136
- align-items: center;
137
- gap: 0.9rem;
138
- min-height: 2.75rem;
139
- color: var(--ux-fg-2);
140
- text-decoration: none;
141
- animation: rise 1.2s 0.6s var(--ux-ease-out) both;
132
+ position: absolute;
133
+ left: var(--ux-gutter);
134
+ bottom: 4.25rem;
135
+ display: inline-flex;
136
+ align-items: center;
137
+ gap: 0.9rem;
138
+ min-height: 2.75rem;
139
+ color: var(--ux-fg-2);
140
+ text-decoration: none;
141
+ animation: rise 1.2s 0.6s var(--ux-ease-out) both;
142
142
  }
143
143
 
144
144
  .ux-hero__scroll-line {
145
- position: relative;
146
- width: 3rem;
147
- height: 1px;
148
- overflow: hidden;
149
- background: var(--ux-line-strong);
145
+ position: relative;
146
+ width: 3rem;
147
+ height: 1px;
148
+ overflow: hidden;
149
+ background: var(--ux-line-strong);
150
150
  }
151
151
 
152
152
  .ux-hero__scroll-line::after {
153
- content: "";
154
- position: absolute;
155
- inset: 0;
156
- background: var(--ux-fg);
157
- animation: sweep 2.2s var(--ux-ease-in-out) infinite;
153
+ content: "";
154
+ position: absolute;
155
+ inset: 0;
156
+ background: var(--ux-fg);
157
+ animation: sweep 2.2s var(--ux-ease-in-out) infinite;
158
158
  }
159
159
 
160
160
  @keyframes rise {
161
- from {
162
- filter: blur(8px);
163
- transform: translate3d(0, 1rem, 0);
164
- }
161
+ from {
162
+ filter: blur(8px);
163
+ transform: translate3d(0, 1rem, 0);
164
+ }
165
165
  }
166
166
 
167
167
  @keyframes pulse {
168
- 70%,
169
- 100% {
170
- box-shadow: 0 0 0 10px rgb(255 255 255 / 0);
171
- }
168
+ 70%,
169
+ 100% {
170
+ box-shadow: 0 0 0 10px rgb(255 255 255 / 0);
171
+ }
172
172
  }
173
173
 
174
174
  @keyframes sweep {
175
- from {
176
- transform: translateX(-100%);
177
- }
178
- to {
179
- transform: translateX(100%);
180
- }
175
+ from {
176
+ transform: translateX(-100%);
177
+ }
178
+ to {
179
+ transform: translateX(100%);
180
+ }
181
181
  }
182
182
 
183
183
  @media (max-width: 960px) {
184
- .ux-hero__index {
185
- display: flex;
186
- flex-wrap: wrap;
187
- gap: 0.25rem 1.25rem;
188
- margin-top: 1.75rem;
189
- padding: 0;
190
- list-style: none;
191
- }
184
+ .ux-hero__index {
185
+ display: flex;
186
+ flex-wrap: wrap;
187
+ gap: 0.25rem 1.25rem;
188
+ margin-top: 1.75rem;
189
+ padding: 0;
190
+ list-style: none;
191
+ }
192
192
 
193
- .ux-hero__index a {
194
- display: inline-flex;
195
- align-items: center;
196
- gap: 0.5rem;
197
- min-height: 2.75rem;
198
- font-size: 0.9375rem;
199
- color: var(--ux-fg);
200
- text-decoration: none;
201
- }
193
+ .ux-hero__index a {
194
+ display: inline-flex;
195
+ align-items: center;
196
+ gap: 0.5rem;
197
+ min-height: 2.75rem;
198
+ font-size: 0.9375rem;
199
+ color: var(--ux-fg);
200
+ text-decoration: none;
201
+ }
202
202
 
203
- .ux-hero__index .ux-mono {
204
- color: var(--ux-fg-3);
205
- }
203
+ .ux-hero__index .ux-mono {
204
+ color: var(--ux-fg-3);
205
+ }
206
206
 
207
- .ux-hero__scroll {
208
- display: none;
209
- }
207
+ .ux-hero__scroll {
208
+ display: none;
209
+ }
210
210
  }
211
211
 
212
212
  /* Portrait, squarish and small screens (STACKED_QUERY in @uxfront/scene):
213
213
  the formation holds the top of the screen and the copy starts below it. */
214
214
  @media (max-aspect-ratio: 5/4), (max-width: 1099px) and (max-aspect-ratio: 8/5) {
215
- .ux-hero {
216
- justify-content: flex-start;
217
- padding-top: 46svh;
218
- padding-bottom: 4rem;
219
- }
215
+ .ux-hero {
216
+ justify-content: flex-start;
217
+ padding-top: 46svh;
218
+ padding-bottom: 4rem;
219
+ }
220
220
 
221
- .ux-hero__content {
222
- max-width: 60rem;
223
- }
221
+ .ux-hero__content {
222
+ max-width: 60rem;
223
+ }
224
224
 
225
- .ux-hero__title {
226
- font-size: min(8.6vw, 6.75rem);
227
- }
225
+ .ux-hero__title {
226
+ font-size: min(8.6vw, 6.75rem);
227
+ }
228
228
 
229
- .ux-hero__scroll {
230
- display: none;
231
- }
229
+ .ux-hero__scroll {
230
+ display: none;
231
+ }
232
232
  }
233
233
 
234
234
  /* Landscape phones keep the formation beside the copy, with less air. */
235
235
  @media (max-height: 560px) and (min-aspect-ratio: 1601/1000) {
236
- .ux-hero {
237
- padding-top: 5.5rem;
238
- padding-bottom: 4.5rem;
239
- }
236
+ .ux-hero {
237
+ padding-top: 5.5rem;
238
+ padding-bottom: 4.5rem;
239
+ }
240
240
 
241
- .ux-hero__kicker {
242
- margin-bottom: 1rem;
243
- }
241
+ .ux-hero__kicker {
242
+ margin-bottom: 1rem;
243
+ }
244
244
 
245
- .ux-hero__lead {
246
- margin-top: 1rem;
247
- }
245
+ .ux-hero__lead {
246
+ margin-top: 1rem;
247
+ }
248
248
  }
249
249
 
250
250
  @media (max-width: 760px) {
251
- .ux-hero__lead {
252
- margin-top: 1.25rem;
253
- }
251
+ .ux-hero__lead {
252
+ margin-top: 1.25rem;
253
+ }
254
254
  }
255
255
 
256
256
  @media (prefers-reduced-motion: reduce) {
257
- .ux-hero__kicker,
258
- .ux-hero__lead,
259
- .ux-hero__scroll,
260
- .ux-hero__pulse,
261
- .ux-hero__scroll-line::after {
262
- animation: none;
263
- }
257
+ .ux-hero__kicker,
258
+ .ux-hero__lead,
259
+ .ux-hero__scroll,
260
+ .ux-hero__pulse,
261
+ .ux-hero__scroll-line::after {
262
+ animation: none;
263
+ }
264
264
  }
265
265
  </style>
@@ -1,43 +1,43 @@
1
1
  <template>
2
- <!-- One line of the UxHero title, focusing in after the one before. -->
3
- <span class="ux-hero-line"><slot /></span>
2
+ <!-- One line of the UxHero title, focusing in after the one before. -->
3
+ <span class="ux-hero-line"><slot /></span>
4
4
  </template>
5
5
 
6
6
  <style scoped>
7
7
  .ux-hero-line {
8
- display: block;
9
- animation: focus-in 1.5s var(--ux-ease-out) both;
8
+ display: block;
9
+ animation: focus-in 1.5s var(--ux-ease-out) both;
10
10
  }
11
11
 
12
12
  .ux-hero-line:nth-child(2) {
13
- animation-delay: 0.1s;
13
+ animation-delay: 0.1s;
14
14
  }
15
15
 
16
16
  .ux-hero-line:nth-child(3) {
17
- animation-delay: 0.2s;
17
+ animation-delay: 0.2s;
18
18
  }
19
19
 
20
20
  .ux-hero-line:nth-child(n + 4) {
21
- animation-delay: 0.3s;
21
+ animation-delay: 0.3s;
22
22
  }
23
23
 
24
24
  .ux-hero-line :slotted(em) {
25
- padding-right: 0.06em;
26
- font-size: 1.08em;
27
- letter-spacing: -0.035em;
25
+ padding-right: 0.06em;
26
+ font-size: 1.08em;
27
+ letter-spacing: -0.035em;
28
28
  }
29
29
 
30
30
  @keyframes focus-in {
31
- from {
32
- filter: blur(14px);
33
- transform: translate3d(0, 0.28em, 0);
34
- letter-spacing: -0.02em;
35
- }
31
+ from {
32
+ filter: blur(14px);
33
+ transform: translate3d(0, 0.28em, 0);
34
+ letter-spacing: -0.02em;
35
+ }
36
36
  }
37
37
 
38
38
  @media (prefers-reduced-motion: reduce) {
39
- .ux-hero-line {
40
- animation: none;
41
- }
39
+ .ux-hero-line {
40
+ animation: none;
41
+ }
42
42
  }
43
43
  </style>