@uxfront/ui 0.9.1 → 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 +4 -4
  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,224 +2,224 @@
2
2
  import UxPillLink from "./UxPillLink.vue";
3
3
 
4
4
  const { align = "start", valign = "center" } = defineProps<{
5
- id: string;
6
- /** Eyebrow before the rule, like `01`. */
7
- index?: string;
8
- /** Eyebrow after the rule, like `Compiler`. */
9
- role?: string;
10
- title: string;
11
- href?: string;
12
- /** Label of the link; defaults to `href` without its protocol. */
13
- linkLabel?: string;
14
- /** "end" puts the copy on the right, leaving the left to the formation. */
15
- align?: "start" | "end";
16
- /** "end" leaves the upper half of the screen to the formation. */
17
- valign?: "center" | "end";
18
- /** Items (`data-step-item="0"`, `"1"`, …) highlighted one after another as the chapter scrolls by. */
19
- steps?: number;
5
+ id: string;
6
+ /** Eyebrow before the rule, like `01`. */
7
+ index?: string;
8
+ /** Eyebrow after the rule, like `Compiler`. */
9
+ role?: string;
10
+ title: string;
11
+ href?: string;
12
+ /** Label of the link; defaults to `href` without its protocol. */
13
+ linkLabel?: string;
14
+ /** "end" puts the copy on the right, leaving the left to the formation. */
15
+ align?: "start" | "end";
16
+ /** "end" leaves the upper half of the screen to the formation. */
17
+ valign?: "center" | "end";
18
+ /** Items (`data-step-item="0"`, `"1"`, …) highlighted one after another as the chapter scrolls by. */
19
+ steps?: number;
20
20
  }>();
21
21
 
22
22
  defineSlots<{
23
- lead?(): unknown;
24
- /** Details below the lead, like `UxPillars`, `UxChips`, `UxTraits` or `UxSpec`. */
25
- default?(): unknown;
23
+ lead?(): unknown;
24
+ /** Details below the lead, like `UxPillars`, `UxChips`, `UxTraits` or `UxSpec`. */
25
+ default?(): unknown;
26
26
  }>();
27
27
  </script>
28
28
 
29
29
  <template>
30
- <section
31
- :id="id"
32
- class="ux-chapter"
33
- :class="{ 'ux-chapter--right': align === 'end', 'ux-chapter--bottom': valign === 'end' }"
34
- data-stage
35
- :data-steps="steps"
36
- :aria-labelledby="`${id}-title`"
37
- >
38
- <div class="ux-chapter__body" data-reveal>
39
- <p v-if="index || role" class="ux-chapter__eyebrow">
40
- <span>{{ index }}</span>
41
- <span class="ux-chapter__rule" />
42
- <span>{{ role }}</span>
43
- </p>
44
- <h2 :id="`${id}-title`" class="ux-chapter__title">{{ title }}</h2>
45
- <p v-if="$slots.lead" class="ux-chapter__lead"><slot name="lead" /></p>
46
- <slot />
47
- <UxPillLink
48
- v-if="href"
49
- class="ux-chapter__link"
50
- :href="href"
51
- :label="linkLabel ?? href.replace(/^https?:\/\//, '')"
52
- />
53
- </div>
54
- </section>
30
+ <section
31
+ :id="id"
32
+ class="ux-chapter"
33
+ :class="{ 'ux-chapter--right': align === 'end', 'ux-chapter--bottom': valign === 'end' }"
34
+ data-stage
35
+ :data-steps="steps"
36
+ :aria-labelledby="`${id}-title`"
37
+ >
38
+ <div class="ux-chapter__body" data-reveal>
39
+ <p v-if="index || role" class="ux-chapter__eyebrow">
40
+ <span>{{ index }}</span>
41
+ <span class="ux-chapter__rule" />
42
+ <span>{{ role }}</span>
43
+ </p>
44
+ <h2 :id="`${id}-title`" class="ux-chapter__title">{{ title }}</h2>
45
+ <p v-if="$slots.lead" class="ux-chapter__lead"><slot name="lead" /></p>
46
+ <slot />
47
+ <UxPillLink
48
+ v-if="href"
49
+ class="ux-chapter__link"
50
+ :href="href"
51
+ :label="linkLabel ?? href.replace(/^https?:\/\//, '')"
52
+ />
53
+ </div>
54
+ </section>
55
55
  </template>
56
56
 
57
57
  <style scoped>
58
58
  /* One screen per chapter. The page scrolls freely: the copy moves with it
59
59
  while the scene holds the chapter's formation behind it. */
60
60
  .ux-chapter {
61
- position: relative;
62
- display: flex;
63
- align-items: center;
64
- min-height: 100vh;
65
- min-height: 100svh;
66
- padding: 6rem var(--ux-gutter) 5rem;
61
+ position: relative;
62
+ display: flex;
63
+ align-items: center;
64
+ min-height: 100vh;
65
+ min-height: 100svh;
66
+ padding: 6rem var(--ux-gutter) 5rem;
67
67
  }
68
68
 
69
69
  .ux-chapter--right {
70
- justify-content: flex-end;
70
+ justify-content: flex-end;
71
71
  }
72
72
 
73
73
  .ux-chapter--bottom {
74
- align-items: flex-end;
74
+ align-items: flex-end;
75
75
  }
76
76
 
77
77
  .ux-chapter__body {
78
- position: relative;
79
- isolation: isolate;
80
- width: min(100%, 33rem, 40vw);
78
+ position: relative;
79
+ isolation: isolate;
80
+ width: min(100%, 33rem, 40vw);
81
81
  }
82
82
 
83
83
  /* A soft pool of darkness keeps the copy legible over the particles. */
84
84
  .ux-chapter__body::before {
85
- content: "";
86
- position: absolute;
87
- inset: -25% -35%;
88
- z-index: -1;
89
- background: radial-gradient(closest-side, rgb(5 5 7 / 0.78), rgb(5 5 7 / 0));
90
- pointer-events: none;
85
+ content: "";
86
+ position: absolute;
87
+ inset: -25% -35%;
88
+ z-index: -1;
89
+ background: radial-gradient(closest-side, rgb(5 5 7 / 0.78), rgb(5 5 7 / 0));
90
+ pointer-events: none;
91
91
  }
92
92
 
93
93
  .ux-chapter__eyebrow {
94
- display: flex;
95
- align-items: center;
96
- gap: 0.75rem;
97
- margin: 0 0 1.5rem;
98
- font-family: var(--font-ux-mono);
99
- font-size: 0.75rem;
100
- letter-spacing: 0.08em;
101
- text-transform: uppercase;
102
- color: var(--ux-fg-2);
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 0.75rem;
97
+ margin: 0 0 1.5rem;
98
+ font-family: var(--font-ux-mono);
99
+ font-size: 0.75rem;
100
+ letter-spacing: 0.08em;
101
+ text-transform: uppercase;
102
+ color: var(--ux-fg-2);
103
103
  }
104
104
 
105
105
  .ux-chapter__rule {
106
- width: 2.5rem;
107
- height: 1px;
108
- background: var(--ux-line-strong);
106
+ width: 2.5rem;
107
+ height: 1px;
108
+ background: var(--ux-line-strong);
109
109
  }
110
110
 
111
111
  .ux-chapter__title {
112
- margin: 0 0 1.5rem;
113
- font-size: clamp(2.75rem, 1.2rem + 4.6vw, 5.75rem);
114
- font-weight: 500;
115
- line-height: 0.92;
116
- letter-spacing: -0.055em;
117
- text-wrap: balance;
112
+ margin: 0 0 1.5rem;
113
+ font-size: clamp(2.75rem, 1.2rem + 4.6vw, 5.75rem);
114
+ font-weight: 500;
115
+ line-height: 0.92;
116
+ letter-spacing: -0.055em;
117
+ text-wrap: balance;
118
118
  }
119
119
 
120
120
  .ux-chapter__lead {
121
- margin: 0 0 2rem;
122
- font-size: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
123
- line-height: 1.35;
124
- letter-spacing: -0.015em;
125
- color: var(--ux-fg);
126
- text-wrap: pretty;
121
+ margin: 0 0 2rem;
122
+ font-size: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem);
123
+ line-height: 1.35;
124
+ letter-spacing: -0.015em;
125
+ color: var(--ux-fg);
126
+ text-wrap: pretty;
127
127
  }
128
128
 
129
129
  .ux-chapter__link {
130
- margin-top: 2.25rem;
131
- background: rgb(5 5 7 / 0.4);
132
- backdrop-filter: blur(8px);
130
+ margin-top: 2.25rem;
131
+ background: rgb(5 5 7 / 0.4);
132
+ backdrop-filter: blur(8px);
133
133
  }
134
134
 
135
135
  /* Short screens: the copy still fits one screen, between the header and the HUD. */
136
136
  @media (max-height: 860px) {
137
- .ux-chapter {
138
- padding-top: 5rem;
139
- padding-bottom: 4rem;
140
- }
141
-
142
- .ux-chapter__eyebrow {
143
- margin-bottom: 1rem;
144
- }
145
-
146
- .ux-chapter__title {
147
- margin-bottom: 1rem;
148
- font-size: clamp(2.5rem, 8vh, 5.75rem);
149
- }
150
-
151
- .ux-chapter__lead {
152
- margin-bottom: 1.25rem;
153
- font-size: clamp(1.0625rem, 2.3vh, 1.5rem);
154
- }
155
-
156
- .ux-chapter__link {
157
- margin-top: 1.5rem;
158
- }
137
+ .ux-chapter {
138
+ padding-top: 5rem;
139
+ padding-bottom: 4rem;
140
+ }
141
+
142
+ .ux-chapter__eyebrow {
143
+ margin-bottom: 1rem;
144
+ }
145
+
146
+ .ux-chapter__title {
147
+ margin-bottom: 1rem;
148
+ font-size: clamp(2.5rem, 8vh, 5.75rem);
149
+ }
150
+
151
+ .ux-chapter__lead {
152
+ margin-bottom: 1.25rem;
153
+ font-size: clamp(1.0625rem, 2.3vh, 1.5rem);
154
+ }
155
+
156
+ .ux-chapter__link {
157
+ margin-top: 1.5rem;
158
+ }
159
159
  }
160
160
 
161
161
  /* Portrait, squarish and small screens (STACKED_QUERY in @uxfront/scene,
162
162
  which frames the camera to match): the formation owns the top of the
163
163
  screen and the copy starts below it, then scrolls over it. */
164
164
  @media (max-aspect-ratio: 5/4), (max-width: 1099px) and (max-aspect-ratio: 8/5) {
165
- .ux-chapter {
166
- display: block;
167
- padding: 58svh var(--ux-gutter) 0;
168
- }
169
-
170
- .ux-chapter__body {
171
- width: min(100%, 36rem);
172
- }
173
-
174
- .ux-chapter--right .ux-chapter__body {
175
- margin-left: auto;
176
- }
177
-
178
- /* A full-width band that travels with the copy as it passes over the art. */
179
- .ux-chapter__body::before {
180
- inset: -4rem -100vw;
181
- background: linear-gradient(
182
- 180deg,
183
- rgb(5 5 7 / 0),
184
- rgb(5 5 7 / 0.9) 4rem,
185
- rgb(5 5 7 / 0.9) calc(100% - 4rem),
186
- rgb(5 5 7 / 0)
187
- );
188
- }
165
+ .ux-chapter {
166
+ display: block;
167
+ padding: 58svh var(--ux-gutter) 0;
168
+ }
169
+
170
+ .ux-chapter__body {
171
+ width: min(100%, 36rem);
172
+ }
173
+
174
+ .ux-chapter--right .ux-chapter__body {
175
+ margin-left: auto;
176
+ }
177
+
178
+ /* A full-width band that travels with the copy as it passes over the art. */
179
+ .ux-chapter__body::before {
180
+ inset: -4rem -100vw;
181
+ background: linear-gradient(
182
+ 180deg,
183
+ rgb(5 5 7 / 0),
184
+ rgb(5 5 7 / 0.9) 4rem,
185
+ rgb(5 5 7 / 0.9) calc(100% - 4rem),
186
+ rgb(5 5 7 / 0)
187
+ );
188
+ }
189
189
  }
190
190
 
191
191
  /* Landscape phones: too short to fit the copy on one screen, wide enough to
192
192
  keep the formation beside it. The copy scrolls past in its own column. */
193
193
  @media (max-width: 1099px) and (min-aspect-ratio: 1601/1000) {
194
- .ux-chapter {
195
- display: block;
196
- padding: 24svh var(--ux-gutter) 20svh;
197
- }
198
-
199
- .ux-chapter__body {
200
- width: min(100%, 46vw);
201
- }
202
-
203
- .ux-chapter--right .ux-chapter__body {
204
- margin-left: auto;
205
- }
194
+ .ux-chapter {
195
+ display: block;
196
+ padding: 24svh var(--ux-gutter) 20svh;
197
+ }
198
+
199
+ .ux-chapter__body {
200
+ width: min(100%, 46vw);
201
+ }
202
+
203
+ .ux-chapter--right .ux-chapter__body {
204
+ margin-left: auto;
205
+ }
206
206
  }
207
207
 
208
208
  @media (max-width: 760px) {
209
- .ux-chapter__eyebrow {
210
- margin-bottom: 1rem;
211
- }
209
+ .ux-chapter__eyebrow {
210
+ margin-bottom: 1rem;
211
+ }
212
212
 
213
- .ux-chapter__title {
214
- margin-bottom: 1rem;
215
- }
213
+ .ux-chapter__title {
214
+ margin-bottom: 1rem;
215
+ }
216
216
 
217
- .ux-chapter__lead {
218
- margin-bottom: 1.25rem;
219
- }
217
+ .ux-chapter__lead {
218
+ margin-bottom: 1.25rem;
219
+ }
220
220
 
221
- .ux-chapter__link {
222
- margin-top: 1.5rem;
223
- }
221
+ .ux-chapter__link {
222
+ margin-top: 1.5rem;
223
+ }
224
224
  }
225
225
  </style>
@@ -2,50 +2,50 @@
2
2
  import type { UxChip } from "../types";
3
3
  import UxFrameworkLogo from "./icons/UxFrameworkLogo.vue";
4
4
 
5
- defineProps<{ items: UxChip[] }>();
5
+ defineProps<{ items: Array<UxChip> }>();
6
6
  </script>
7
7
 
8
8
  <template>
9
- <!-- Pills that light up one after another (set `steps` on the UxChapter). -->
10
- <ul class="ux-chips">
11
- <li
12
- v-for="(item, i) in items"
13
- :key="item.label"
14
- :data-step-item="i"
15
- :style="item.tone ? { '--tone': item.tone } : undefined"
16
- >
17
- <UxFrameworkLogo v-if="item.framework" :name="item.framework" />
18
- {{ item.label }}
19
- </li>
20
- </ul>
9
+ <!-- Pills that light up one after another (set `steps` on the UxChapter). -->
10
+ <ul class="ux-chips">
11
+ <li
12
+ v-for="(item, i) in items"
13
+ :key="item.label"
14
+ :data-step-item="i"
15
+ :style="item.tone ? { '--tone': item.tone } : undefined"
16
+ >
17
+ <UxFrameworkLogo v-if="item.framework" :name="item.framework" />
18
+ {{ item.label }}
19
+ </li>
20
+ </ul>
21
21
  </template>
22
22
 
23
23
  <style scoped>
24
24
  .ux-chips {
25
- display: flex;
26
- flex-wrap: wrap;
27
- gap: 0.5rem;
28
- padding: 0;
29
- list-style: none;
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ gap: 0.5rem;
28
+ padding: 0;
29
+ list-style: none;
30
30
  }
31
31
 
32
32
  .ux-chips li {
33
- --tone: var(--ux-fg);
34
- display: inline-flex;
35
- align-items: center;
36
- gap: 0.55rem;
37
- padding: 0.5rem 0.85rem;
38
- font-family: var(--font-ux-mono);
39
- font-size: 0.8125rem;
40
- letter-spacing: 0.02em;
41
- color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
42
- border: 1px solid color-mix(in srgb, var(--tone) calc(20% + var(--active, 0) * 60%), transparent);
43
- border-radius: 999px;
44
- background: color-mix(in srgb, var(--tone) calc(var(--active, 0) * 14%), rgb(5 5 7 / 0.5));
33
+ --tone: var(--ux-fg);
34
+ display: inline-flex;
35
+ align-items: center;
36
+ gap: 0.55rem;
37
+ padding: 0.5rem 0.85rem;
38
+ font-family: var(--font-ux-mono);
39
+ font-size: 0.8125rem;
40
+ letter-spacing: 0.02em;
41
+ color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
42
+ border: 1px solid color-mix(in srgb, var(--tone) calc(20% + var(--active, 0) * 60%), transparent);
43
+ border-radius: 999px;
44
+ background: color-mix(in srgb, var(--tone) calc(var(--active, 0) * 14%), rgb(5 5 7 / 0.5));
45
45
  }
46
46
 
47
47
  .ux-chips svg {
48
- width: 0.9375rem;
49
- height: 0.9375rem;
48
+ width: 0.9375rem;
49
+ height: 0.9375rem;
50
50
  }
51
51
  </style>
@@ -1,73 +1,73 @@
1
1
  <script setup lang="ts">
2
2
  defineProps<{
3
- /** The caption, like a file name: `styleframe.config.ts`. */
4
- title: string;
5
- /** Plain text, shown as is. Leave it out to put highlighted markup in the default slot. */
6
- code?: string;
3
+ /** The caption, like a file name: `styleframe.config.ts`. */
4
+ title: string;
5
+ /** Plain text, shown as is. Leave it out to put highlighted markup in the default slot. */
6
+ code?: string;
7
7
  }>();
8
8
 
9
9
  defineSlots<{
10
- /** One or more highlighted `<pre>` blocks, like Shiki's output. */
11
- default?(): unknown;
10
+ /** One or more highlighted `<pre>` blocks, like Shiki's output. */
11
+ default?(): unknown;
12
12
  }>();
13
13
  </script>
14
14
 
15
15
  <template>
16
- <!-- A code sample in a window frame, named after its file. Plain `code`
16
+ <!-- A code sample in a window frame, named after its file. Plain `code`
17
17
  grows with its text. Highlighted markup scrolls past 70svh, and each of
18
18
  its <pre> blocks draws the rule above it, dashed between two. -->
19
- <figure class="ux-code" :class="{ 'ux-code--plain': code !== undefined }" data-outline>
20
- <figcaption class="ux-mono">{{ title }}</figcaption>
21
- <pre v-if="code !== undefined"><code>{{ code }}</code></pre>
22
- <slot v-else />
23
- </figure>
19
+ <figure class="ux-code" :class="{ 'ux-code--plain': code !== undefined }" data-outline>
20
+ <figcaption class="ux-mono">{{ title }}</figcaption>
21
+ <pre v-if="code !== undefined"><code>{{ code }}</code></pre>
22
+ <slot v-else />
23
+ </figure>
24
24
  </template>
25
25
 
26
26
  <style scoped>
27
27
  .ux-code {
28
- margin: 0;
29
- border: 1px solid var(--ux-line-strong);
30
- border-radius: 6px;
31
- background: rgb(5 5 7 / 0.85);
32
- backdrop-filter: blur(10px);
33
- overflow: hidden;
34
- text-shadow: none;
28
+ margin: 0;
29
+ border: 1px solid var(--ux-line-strong);
30
+ border-radius: 6px;
31
+ background: rgb(5 5 7 / 0.85);
32
+ backdrop-filter: blur(10px);
33
+ overflow: hidden;
34
+ text-shadow: none;
35
35
  }
36
36
 
37
37
  .ux-code figcaption {
38
- padding: 0.6rem 1rem;
39
- font-size: 0.75rem;
40
- color: var(--ux-fg-3);
38
+ padding: 0.6rem 1rem;
39
+ font-size: 0.75rem;
40
+ color: var(--ux-fg-3);
41
41
  }
42
42
 
43
43
  .ux-code :deep(pre) {
44
- max-height: 70svh;
45
- margin: 0;
46
- padding: 1rem;
47
- overflow: auto;
48
- font-family: var(--font-ux-mono);
49
- font-size: 0.8125rem;
50
- line-height: 1.6;
51
- color: var(--ux-fg-2);
52
- border-top: 1px solid var(--ux-line);
44
+ max-height: 70svh;
45
+ margin: 0;
46
+ padding: 1rem;
47
+ overflow: auto;
48
+ font-family: var(--font-ux-mono);
49
+ font-size: 0.8125rem;
50
+ line-height: 1.6;
51
+ color: var(--ux-fg-2);
52
+ border-top: 1px solid var(--ux-line);
53
53
  }
54
54
 
55
55
  .ux-code :deep(pre + pre) {
56
- border-top-style: dashed;
56
+ border-top-style: dashed;
57
57
  }
58
58
 
59
59
  .ux-code :deep(.line) {
60
- display: block;
60
+ display: block;
61
61
  }
62
62
 
63
63
  .ux-code--plain figcaption {
64
- border-bottom: 1px solid var(--ux-line);
64
+ border-bottom: 1px solid var(--ux-line);
65
65
  }
66
66
 
67
67
  .ux-code--plain pre {
68
- max-height: none;
69
- overflow-x: auto;
70
- border-top: 0;
68
+ max-height: none;
69
+ overflow-x: auto;
70
+ border-top: 0;
71
71
  }
72
72
 
73
73
  /* The page is always dark: take the dark theme's colours, whatever colour
@@ -75,10 +75,10 @@ defineSlots<{
75
75
  `html.light .shiki span` and `html.dark .shiki span`, so this outranks them.
76
76
  A touch of the foreground lifts dim comments, like #676e95, to 4.5:1. */
77
77
  html .ux-code :deep(pre span) {
78
- color: color-mix(in srgb, var(--shiki-dark), var(--ux-fg) 12%);
79
- background: none;
80
- font-style: var(--shiki-dark-font-style);
81
- font-weight: var(--shiki-dark-font-weight);
82
- text-decoration: var(--shiki-dark-text-decoration);
78
+ color: color-mix(in srgb, var(--shiki-dark), var(--ux-fg) 12%);
79
+ background: none;
80
+ font-style: var(--shiki-dark-font-style);
81
+ font-weight: var(--shiki-dark-font-weight);
82
+ text-decoration: var(--shiki-dark-text-decoration);
83
83
  }
84
84
  </style>