@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
@@ -1,99 +1,99 @@
1
1
  <script setup lang="ts">
2
2
  defineProps<{
3
- id: string;
4
- /** Eyebrow before the rule, like `01`. */
5
- index?: string;
6
- /** Eyebrow after the rule. */
7
- role?: string;
8
- title: string;
3
+ id: string;
4
+ /** Eyebrow before the rule, like `01`. */
5
+ index?: string;
6
+ /** Eyebrow after the rule. */
7
+ role?: string;
8
+ title: string;
9
9
  }>();
10
10
 
11
11
  defineSlots<{
12
- lead?(): unknown;
13
- default(): unknown;
12
+ lead?(): unknown;
13
+ default(): unknown;
14
14
  }>();
15
15
  </script>
16
16
 
17
17
  <template>
18
- <!-- A section with a chapter's heading and room for wide content, like
18
+ <!-- A section with a chapter's heading and room for wide content, like
19
19
  plans or an FAQ, on a panel that keeps it legible over the scene. Like
20
20
  UxChapter, it holds a formation while it's on screen. -->
21
- <section :id="id" class="ux-section" data-stage :aria-labelledby="`${id}-title`">
22
- <div class="ux-section__head" data-reveal>
23
- <p v-if="index || role" class="ux-section__eyebrow">
24
- <span>{{ index }}</span>
25
- <span class="ux-section__rule" />
26
- <span>{{ role }}</span>
27
- </p>
28
- <h2 :id="`${id}-title`" class="ux-section__title">{{ title }}</h2>
29
- <p v-if="$slots.lead" class="ux-section__lead"><slot name="lead" /></p>
30
- </div>
31
- <div class="ux-section__panel">
32
- <slot />
33
- </div>
34
- </section>
21
+ <section :id="id" class="ux-section" data-stage :aria-labelledby="`${id}-title`">
22
+ <div class="ux-section__head" data-reveal>
23
+ <p v-if="index || role" class="ux-section__eyebrow">
24
+ <span>{{ index }}</span>
25
+ <span class="ux-section__rule" />
26
+ <span>{{ role }}</span>
27
+ </p>
28
+ <h2 :id="`${id}-title`" class="ux-section__title">{{ title }}</h2>
29
+ <p v-if="$slots.lead" class="ux-section__lead"><slot name="lead" /></p>
30
+ </div>
31
+ <div class="ux-section__panel">
32
+ <slot />
33
+ </div>
34
+ </section>
35
35
  </template>
36
36
 
37
37
  <style scoped>
38
38
  .ux-section {
39
- position: relative;
40
- min-height: 100vh;
41
- min-height: 100svh;
42
- padding: 8rem var(--ux-gutter) 6rem;
39
+ position: relative;
40
+ min-height: 100vh;
41
+ min-height: 100svh;
42
+ padding: 8rem var(--ux-gutter) 6rem;
43
43
  }
44
44
 
45
45
  .ux-section__head,
46
46
  .ux-section__panel {
47
- width: min(100%, 72rem);
48
- margin: 0 auto;
47
+ width: min(100%, 72rem);
48
+ margin: 0 auto;
49
49
  }
50
50
 
51
51
  .ux-section__head {
52
- margin-bottom: 2.5rem;
52
+ margin-bottom: 2.5rem;
53
53
  }
54
54
 
55
55
  .ux-section__eyebrow {
56
- display: flex;
57
- align-items: center;
58
- gap: 0.75rem;
59
- margin: 0 0 1.5rem;
60
- font-family: var(--font-ux-mono);
61
- font-size: 0.75rem;
62
- letter-spacing: 0.08em;
63
- text-transform: uppercase;
64
- color: var(--ux-fg-2);
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 0.75rem;
59
+ margin: 0 0 1.5rem;
60
+ font-family: var(--font-ux-mono);
61
+ font-size: 0.75rem;
62
+ letter-spacing: 0.08em;
63
+ text-transform: uppercase;
64
+ color: var(--ux-fg-2);
65
65
  }
66
66
 
67
67
  .ux-section__rule {
68
- width: 2.5rem;
69
- height: 1px;
70
- background: var(--ux-line-strong);
68
+ width: 2.5rem;
69
+ height: 1px;
70
+ background: var(--ux-line-strong);
71
71
  }
72
72
 
73
73
  .ux-section__title {
74
- max-width: 48rem;
75
- margin: 0 0 1.25rem;
76
- font-size: clamp(2.5rem, 1.2rem + 3.6vw, 4.5rem);
77
- font-weight: 500;
78
- line-height: 0.95;
79
- letter-spacing: -0.055em;
80
- text-wrap: balance;
74
+ max-width: 48rem;
75
+ margin: 0 0 1.25rem;
76
+ font-size: clamp(2.5rem, 1.2rem + 3.6vw, 4.5rem);
77
+ font-weight: 500;
78
+ line-height: 0.95;
79
+ letter-spacing: -0.055em;
80
+ text-wrap: balance;
81
81
  }
82
82
 
83
83
  .ux-section__lead {
84
- max-width: 40rem;
85
- font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
86
- line-height: 1.45;
87
- color: var(--ux-fg-2);
88
- text-wrap: pretty;
84
+ max-width: 40rem;
85
+ font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
86
+ line-height: 1.45;
87
+ color: var(--ux-fg-2);
88
+ text-wrap: pretty;
89
89
  }
90
90
 
91
91
  .ux-section__panel {
92
- padding: clamp(1rem, 0.5rem + 2vw, 2rem);
93
- border: 1px solid var(--ux-line);
94
- border-radius: 8px;
95
- background: rgb(5 5 7 / 0.82);
96
- backdrop-filter: blur(12px);
97
- text-shadow: none;
92
+ padding: clamp(1rem, 0.5rem + 2vw, 2rem);
93
+ border: 1px solid var(--ux-line);
94
+ border-radius: 8px;
95
+ background: rgb(5 5 7 / 0.82);
96
+ backdrop-filter: blur(12px);
97
+ text-shadow: none;
98
98
  }
99
99
  </style>
@@ -9,50 +9,54 @@ import UxStage from "./UxStage.vue";
9
9
  import UxStageFallback from "./UxStageFallback.vue";
10
10
 
11
11
  const { scene, skipLabel = "Skip to the content" } = defineProps<{
12
- /** The formations, one per `data-stage` section (UxHero, UxChapter, UxFinale), in order. */
13
- scene: Formation[];
14
- /** The skip link's target, like `#first-chapter`. No skip link without it. */
15
- skipTo?: string;
16
- skipLabel?: string;
12
+ /** The formations, one per `data-stage` section (UxHero, UxChapter, UxFinale), in order. */
13
+ scene: Array<Formation>;
14
+ /** The skip link's target, like `#first-chapter`. No skip link without it. */
15
+ skipTo?: string;
16
+ skipLabel?: string;
17
17
  }>();
18
18
 
19
19
  defineSlots<{
20
- /** `UxAnchor` labels pinned to the formations. */
21
- anchors?(): unknown;
22
- /** Clickable `UxAnchor`s (variant "button"), layered above the copy. */
23
- controls?(): unknown;
24
- /** Shown instead of the scene without a capable GPU. Defaults to a CSS monolith. */
25
- fallback?(): unknown;
26
- header?(): unknown;
27
- /** Defaults to `UxHud`. */
28
- hud?(): unknown;
29
- /** The sections, inside `<main>`. */
30
- default(): unknown;
20
+ /** `UxAnchor` labels pinned to the formations. */
21
+ anchors?(): unknown;
22
+ /** Clickable `UxAnchor`s (variant "button"), layered above the copy. */
23
+ controls?(): unknown;
24
+ /** Shown instead of the scene without a capable GPU. Defaults to a CSS monolith. */
25
+ fallback?(): unknown;
26
+ header?(): unknown;
27
+ /** Defaults to `UxHud`. */
28
+ hud?(): unknown;
29
+ /** The sections, inside `<main>`. */
30
+ default(): unknown;
31
31
  }>();
32
32
 
33
33
  inject(uxRenderHookKey, null)?.();
34
34
 
35
35
  const root = useTemplateRef("root");
36
36
  const experience = provideExperience(scene);
37
- onMounted(() => experience.start(root.value!));
37
+ onMounted(() => {
38
+ if (root.value) {
39
+ experience.start(root.value);
40
+ }
41
+ });
38
42
  onBeforeUnmount(() => experience.stop());
39
43
  </script>
40
44
 
41
45
  <template>
42
- <div ref="root" class="ux-site" :data-motion="experience.state.motion">
43
- <a v-if="skipTo" class="ux-site__skip" :href="skipTo">{{ skipLabel }}</a>
44
- <UxStage>
45
- <template #fallback
46
- ><slot name="fallback"><UxStageFallback /></slot
47
- ></template>
48
- <template #anchors><slot name="anchors" /></template>
49
- <template #controls><slot name="controls" /></template>
50
- </UxStage>
51
- <slot name="header" />
52
- <!-- Early in the tab order: the motion toggle should be quick to reach. -->
53
- <slot name="hud"><UxHud /></slot>
54
- <main class="ux-site__main"><slot /></main>
55
- </div>
46
+ <div ref="root" class="ux-site" :data-motion="experience.state.motion">
47
+ <a v-if="skipTo" class="ux-site__skip" :href="skipTo">{{ skipLabel }}</a>
48
+ <UxStage>
49
+ <template #fallback
50
+ ><slot name="fallback"><UxStageFallback /></slot
51
+ ></template>
52
+ <template #anchors><slot name="anchors" /></template>
53
+ <template #controls><slot name="controls" /></template>
54
+ </UxStage>
55
+ <slot name="header" />
56
+ <!-- Early in the tab order: the motion toggle should be quick to reach. -->
57
+ <slot name="hud"><UxHud /></slot>
58
+ <main class="ux-site__main"><slot /></main>
59
+ </div>
56
60
  </template>
57
61
 
58
62
  <style>
@@ -63,31 +67,31 @@ onBeforeUnmount(() => experience.stop());
63
67
 
64
68
  <style scoped>
65
69
  .ux-site {
66
- position: relative;
67
- /* The copy's soft scrims bleed past the edges; never let them scroll. */
68
- overflow-x: clip;
70
+ position: relative;
71
+ /* The copy's soft scrims bleed past the edges; never let them scroll. */
72
+ overflow-x: clip;
69
73
  }
70
74
 
71
75
  .ux-site__main {
72
- position: relative;
73
- z-index: 1;
74
- text-shadow: 0 0 2rem rgb(5 5 7 / 0.8);
76
+ position: relative;
77
+ z-index: 1;
78
+ text-shadow: 0 0 2rem rgb(5 5 7 / 0.8);
75
79
  }
76
80
 
77
81
  .ux-site__skip {
78
- position: fixed;
79
- top: 1rem;
80
- left: 1rem;
81
- z-index: 50;
82
- padding: 0.75rem 1rem;
83
- color: var(--ux-bg);
84
- background: var(--ux-fg);
85
- border-radius: 4px;
86
- transform: translateY(-200%);
87
- transition: transform 0.3s var(--ux-ease-out);
82
+ position: fixed;
83
+ top: 1rem;
84
+ left: 1rem;
85
+ z-index: 50;
86
+ padding: 0.75rem 1rem;
87
+ color: var(--ux-bg);
88
+ background: var(--ux-fg);
89
+ border-radius: 4px;
90
+ transform: translateY(-200%);
91
+ transition: transform 0.3s var(--ux-ease-out);
88
92
  }
89
93
 
90
94
  .ux-site__skip:focus-visible {
91
- transform: none;
95
+ transform: none;
92
96
  }
93
97
  </style>
@@ -1,45 +1,45 @@
1
1
  <script setup lang="ts">
2
2
  import type { UxSpecRow } from "../types";
3
3
 
4
- defineProps<{ items: UxSpecRow[] }>();
4
+ defineProps<{ items: Array<UxSpecRow> }>();
5
5
  </script>
6
6
 
7
7
  <template>
8
- <!-- Term and detail rows that light up one after another (set `steps` on the UxChapter). -->
9
- <dl class="ux-spec">
10
- <div v-for="(item, i) in items" :key="item.term" :data-step-item="i">
11
- <dt class="ux-mono">{{ item.term }}</dt>
12
- <dd>{{ item.detail }}</dd>
13
- </div>
14
- </dl>
8
+ <!-- Term and detail rows that light up one after another (set `steps` on the UxChapter). -->
9
+ <dl class="ux-spec">
10
+ <div v-for="(item, i) in items" :key="item.term" :data-step-item="i">
11
+ <dt class="ux-mono">{{ item.term }}</dt>
12
+ <dd>{{ item.detail }}</dd>
13
+ </div>
14
+ </dl>
15
15
  </template>
16
16
 
17
17
  <style scoped>
18
18
  .ux-spec {
19
- display: grid;
19
+ display: grid;
20
20
  }
21
21
 
22
22
  .ux-spec div {
23
- display: grid;
24
- grid-template-columns: 7.5rem 1fr;
25
- gap: 1rem;
26
- padding: 0.85rem 0;
27
- border-top: 1px solid
28
- color-mix(in srgb, var(--ux-fg) calc(10% + var(--active, 0) * 40%), transparent);
23
+ display: grid;
24
+ grid-template-columns: 7.5rem 1fr;
25
+ gap: 1rem;
26
+ padding: 0.85rem 0;
27
+ border-top: 1px solid
28
+ color-mix(in srgb, var(--ux-fg) calc(10% + var(--active, 0) * 40%), transparent);
29
29
  }
30
30
 
31
31
  .ux-spec dt {
32
- padding-top: 0.15rem;
33
- color: var(--ux-fg-3);
32
+ padding-top: 0.15rem;
33
+ color: var(--ux-fg-3);
34
34
  }
35
35
 
36
36
  .ux-spec dd {
37
- color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
37
+ color: color-mix(in srgb, var(--ux-fg) calc(var(--active, 0) * 100%), var(--ux-fg-2));
38
38
  }
39
39
 
40
40
  @media (max-width: 760px) {
41
- .ux-spec div {
42
- grid-template-columns: 6rem 1fr;
43
- }
41
+ .ux-spec div {
42
+ grid-template-columns: 6rem 1fr;
43
+ }
44
44
  }
45
45
  </style>