Skip to content

The Open Standard for Generative UI

demo-page-updates (#430)

Prakhar6fc780d08c7a
diff --git a/docs/app/(home)/sections/HeroSection/HeroSection.module.css b/docs/app/(home)/sections/HeroSection/HeroSection.module.css
index cc19ab10b..768731faa 100644
--- a/docs/app/(home)/sections/HeroSection/HeroSection.module.css
+++ b/docs/app/(home)/sections/HeroSection/HeroSection.module.css
@@ -105,18 +105,18 @@
flex-shrink: 0;
padding-inline: 1.25rem;
border-radius: 100px;
- background: var(--openui-inverted-background);
- color: var(--openui-text-accent-primary);
+ background: var(--openui-highlight-strong);
+ color: var(--openui-text-neutral-primary);
transition: background-color 0.2s ease;
}
.mobilePlaygroundButton:hover {
- background: rgb(0 0 0 / 85%);
+ background: var(--openui-highlight);
}
.mobilePlaygroundLabel {
white-space: nowrap;
- color: var(--openui-text-accent-primary);
+ color: inherit;
}
.desktopHero {
@@ -147,6 +147,7 @@
flex-direction: column;
align-items: center;
gap: 1rem;
+ margin-top: 1rem;
}
.desktopTitle {
@@ -165,8 +166,8 @@
font-size: 1.75rem;
font-weight: 500;
line-height: 1.25;
- margin-left: 32px;
- margin-top: -12px;
+ margin-top: 1rem;
+ text-align: center;
color: var(--openui-text-neutral-secondary);
}
@@ -204,7 +205,7 @@
align-items: center;
justify-content: center;
gap: 0.75rem;
- min-height: 2.5rem;
+ min-height: 2.75rem;
padding: 0.875rem 1rem 0.875rem 1rem;
border-radius: var(--openui-radius-full);
background: var(--openui-highlight-strong);
@@ -235,10 +236,28 @@
display: inline-flex;
align-items: center;
justify-content: center;
+ gap: 0.5rem;
color: inherit;
text-decoration: none;
}
+.heroBannerBadge {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 1.5rem;
+ padding-inline: 0.4rem;
+ border-radius: var(--openui-radius-s);
+ background: var(--openui-text-info-primary);
+ border: 1px solid var(--openui-border-default);
+ font-size: 0.75rem;
+ font-weight: 600;
+ line-height: 1;
+ letter-spacing: 0.02em;
+ text-transform: uppercase;
+ color: var(--openui-text-info-inverted);
+}
+
.heroBannerActions {
display: flex;
flex-direction: column;
@@ -294,8 +313,15 @@
min-height: 3rem;
padding-inline: 1.25rem;
border-radius: 100px;
+ background: var(--openui-inverted-background);
+ color: var(--openui-text-accent-primary);
font-size: 18px;
line-height: 1.5rem;
+ transition: background-color 0.2s ease;
+}
+
+.mobileGithubButton:hover {
+ background: rgb(0 0 0 / 85%);
}
.mobileCtaArrow {
@@ -329,7 +355,7 @@
display: flex;
flex-direction: column;
align-items: center;
- margin-top: 32px;
+ margin-top: 40px;
gap: 1rem;
padding: 0.5rem 2.5rem 4rem;
}
@@ -438,8 +464,8 @@
.heroBanner {
align-items: center;
- gap: 1rem;
- padding: 0.5rem 0.75rem 0.5rem 1rem;
+ gap: 1.5rem;
+ padding: 0.6rem 0.75rem 0.6rem 1rem;
}
.heroBannerDesktop {
diff --git a/docs/app/(home)/sections/HeroSection/HeroSection.tsx b/docs/app/(home)/sections/HeroSection/HeroSection.tsx
index 8b2a52e6b..9849ebf8e 100644
--- a/docs/app/(home)/sections/HeroSection/HeroSection.tsx
+++ b/docs/app/(home)/sections/HeroSection/HeroSection.tsx
@@ -70,11 +70,11 @@ function DesktopPlaygroundButton({ className = "" }: { className?: string }) {
function MobilePlaygroundButton({ className = "" }: { className?: string }) {
return (
<PillLink
- href="/playground"
+ href="/demo/github"
className={`${styles.mobilePlaygroundButton} ${className}`.trim()}
arrow={<TrailingArrow />}
>
- <span className={styles.mobilePlaygroundLabel}>{secondaryCTA}</span>
+ <span className={styles.mobilePlaygroundLabel}>Try Demo</span>
</PillLink>
);
}
@@ -83,10 +83,13 @@ function AnnouncementBanner({ className = "" }: { className?: string }) {
return (
<>
<div className={`${styles.heroBanner} ${styles.heroBannerDesktop} ${className}`.trim()}>
- <span className={styles.heroBannerLabel}>We&apos;re introducing OpenUI Lang v0.5</span>
+ <span className={styles.heroBannerLabel}>
+ <span className={styles.heroBannerBadge}>New</span>
+ <span>We&apos;re introducing OpenUI Lang v0.5</span>
+ </span>
<div className={styles.heroBannerActions}>
<Link href="/demo/github" target="_blank" className={`${styles.heroBannerButton} ${styles.heroBannerButtonPrimary}`}>
- <span>Try now</span>
+ <span>Try</span>
</Link>
<Link href={architectureHref} className={styles.heroBannerButton}>
<span>Read more</span>
@@ -94,7 +97,10 @@ function AnnouncementBanner({ className = "" }: { className?: string }) {
</div>
</div>
<Link href={architectureHref} className={`${styles.heroBanner} ${styles.heroBannerMobile} ${className}`.trim()}>
- <span className={styles.heroBannerLabel}>We&apos;re introducing OpenUI Lang v0.5</span>
+ <span className={styles.heroBannerLabel}>
+ <span className={styles.heroBannerBadge}>New</span>
+ <span>Introducing OpenUI Lang v0.5</span>
+ </span>
</Link>
</>
);
diff --git a/docs/app/demo/github/components/GitHubConnect/GitHubConnect.css b/docs/app/demo/github/components/GitHubConnect/GitHubConnect.css
index 69b934127..a768658dc 100644
--- a/docs/app/demo/github/components/GitHubConnect/GitHubConnect.css
+++ b/docs/app/demo/github/components/GitHubConnect/GitHubConnect.css
@@ -1,327 +1,451 @@
+/* ── Layout ── */
+
.gh-connect {
- --gh-chip-font: var(--openui-text-label-sm);
- --gh-chip-font-heavy: var(--openui-text-label-sm-heavy);
- width: min(100%, 1120px);
+ width: fit-content;
margin: 0 auto;
- padding: clamp(40px, 8vh, 88px) var(--openui-space-xl) clamp(48px, 8vh, 88px);
- display: flex;
- justify-content: center;
+ padding: 120px 16px;
}
.gh-builder {
- width: min(100%, 980px);
display: flex;
flex-direction: column;
- align-items: center;
- gap: var(--openui-space-3xl);
+ gap: var(--openui-space-2xl);
}
-.gh-builder-copy {
- display: flex;
- max-width: 900px;
- flex-direction: column;
+/* ── Brand ── */
+
+.gh-brand {
+ display: inline-flex;
align-items: center;
gap: var(--openui-space-s);
- text-align: center;
+ color: var(--openui-text-neutral-primary);
+ font: var(--openui-text-body-lg-heavy);
+ letter-spacing: var(--openui-text-body-lg-heavy-letter-spacing);
}
-.gh-builder-title {
+.gh-brandIcon {
+ display: inline-flex;
+ width: 24px;
+ height: 24px;
+ align-items: center;
+ justify-content: center;
+}
+
+/* ── Sentence block ── */
+
+.gh-sentence {
display: flex;
flex-direction: column;
- align-items: center;
gap: var(--openui-space-s);
+}
+
+.gh-sentenceLine {
margin: 0;
color: var(--openui-text-neutral-primary);
font-family: var(--openui-font-body);
font-size: 32px;
font-weight: 500;
- line-height: 1.4;
- text-wrap: balance;
- letter-spacing: -0.02em;
-}
-
-.gh-builder-inline {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: center;
- gap: var(--openui-space-m);
+ line-height: 1.5;
+ letter-spacing: -0.03em;
}
-.gh-builder-inline-single {
- width: 100%;
+.gh-sentenceIdentity {
+ font-family: var(--openui-font-body);
+ font-size: 32px;
+ font-weight: 500;
+ line-height: 1.5;
+ letter-spacing: -0.03em;
}
-.gh-inline-copy {
+.gh-sentenceLine-secondary {
+ margin-top: var(--openui-space-m);
color: var(--openui-text-neutral-secondary);
}
-.gh-inline-input,
-.gh-inline-select-wrap {
- position: relative;
+/* ── Username input (inline) ── */
+
+.gh-inputWrap {
display: inline-flex;
- max-width: 100%;
align-items: center;
- justify-content: center;
- gap: var(--openui-space-s);
- padding: 0 0 var(--openui-space-s);
- border-bottom: 1px solid var(--openui-border-interactive);
- transition:
- border-color 0.15s ease,
- color 0.15s ease;
+ gap: 0.25em;
+ padding-bottom: 0.125em;
+ border-bottom: 1.5px solid var(--openui-border-interactive);
+ color: var(--openui-text-neutral-primary);
+ font: inherit;
+ vertical-align: middle;
+ transition: border-color 0.2s ease;
}
-.gh-inline-input:focus-within,
-.gh-inline-select-wrap:focus-within {
+.gh-inputWrap:focus-within {
border-bottom-color: var(--openui-border-interactive-emphasis);
}
-.gh-inline-input {
- width: fit-content;
-}
-
-.gh-inline-input-with-avatar {
- padding-left: var(--openui-space-s);
+.gh-inputPrefix {
+ color: var(--openui-text-neutral-secondary);
+ user-select: none;
}
-.gh-inline-inputControl {
+.gh-inputSizer {
display: inline-grid;
- min-width: 1ch;
- max-width: min(14ch, 32vw);
+ min-width: 4ch;
+ max-width: min(16ch, 50vw);
}
-.gh-inline-inputSizer,
-.gh-inline-input-field {
+.gh-inputGhost,
+.gh-inputField {
grid-area: 1 / 1;
-}
-
-.gh-inline-inputSizer {
- visibility: hidden;
- white-space: pre;
font: inherit;
line-height: inherit;
}
-.gh-inline-avatar {
- width: 28px;
- height: 28px;
- flex-shrink: 0;
- border-radius: var(--openui-radius-full);
+.gh-inputGhost {
+ visibility: hidden;
+ white-space: pre;
}
-.gh-inline-input-field {
+.gh-inputField {
width: 100%;
min-width: 0;
padding: 0;
border: none;
background: transparent;
- color: var(--openui-text-neutral-primary);
+ color: inherit;
font: inherit;
- line-height: inherit;
- text-align: center;
outline: none;
}
-.gh-inline-input-field::placeholder {
+.gh-inputField::placeholder {
color: var(--openui-text-neutral-tertiary);
}
-.gh-inline-select-dropdown {
- width: fit-content;
- min-width: 0;
- max-width: min(22ch, 48vw);
-}
-
-.gh-error {
- color: var(--openui-text-danger-primary);
- font: var(--openui-text-label-sm);
- letter-spacing: var(--openui-text-label-sm-letter-spacing);
- text-align: center;
-}
-
-.gh-reset-button:focus-visible,
-.gh-generate-button:focus-visible,
-.gh-inline-input-field:focus-visible,
-.gh-inline-selectButton:focus-visible,
-.gh-dropdownOption:focus-visible {
- outline: 2px solid var(--openui-border-accent);
- outline-offset: 3px;
-}
-
-.gh-inline-selectButton {
+.gh-inputClear {
display: inline-flex;
- width: fit-content;
- max-width: 100%;
- min-width: 0;
align-items: center;
justify-content: center;
- gap: var(--openui-space-s);
padding: 0;
border: none;
background: transparent;
- color: var(--openui-text-neutral-tertiary);
+ color: var(--openui-text-neutral-secondary);
cursor: pointer;
- font: inherit;
- line-height: inherit;
+ opacity: 0;
+ transition: opacity 0.15s ease, color 0.15s ease;
}
-.gh-inline-selectButton-filled {
+.gh-inputWrap:hover .gh-inputClear,
+.gh-inputWrap:focus-within .gh-inputClear {
+ opacity: 1;
+}
+
+.gh-inputClear:hover {
color: var(--openui-text-neutral-primary);
}
-.gh-inline-selectValue {
+/* ── Inline ellipsis hint (before topic is selected) ── */
+
+.gh-selectHintInline {
+ color: var(--openui-text-neutral-tertiary);
+ letter-spacing: 0.1em;
+}
+
+/* ── Chip (selected identity / focus) ── */
+
+.gh-chip {
display: inline-flex;
- min-width: 0;
align-items: center;
gap: var(--openui-space-s);
+ padding: 10px 18px 10px 10px;
+ border: 1px solid color-mix(in srgb, var(--gh-tone-fill) 22%, var(--gh-tone-border));
+ border-radius: var(--openui-radius-full);
+ background: color-mix(in srgb, var(--gh-tone-bg) 52%, var(--openui-foreground));
+ color: var(--openui-text-neutral-primary);
+ box-shadow: var(--openui-shadow-s);
+ font-family: var(--openui-font-body);
+ font-size: 32px;
+ font-weight: 500;
+ line-height: 1;
+ letter-spacing: -0.03em;
white-space: nowrap;
+ vertical-align: middle;
}
-.gh-inline-selectLeading {
+.gh-chip-neutral {
+ --gh-tone-fill: var(--openui-text-neutral-secondary);
+ --gh-tone-bg: var(--openui-highlight-subtle);
+ --gh-tone-border: var(--openui-border-default);
+}
+
+.gh-chipLeading {
display: inline-flex;
+ flex-shrink: 0;
align-items: center;
justify-content: center;
- flex-shrink: 0;
}
-.gh-inline-selectText {
- display: inline-flex;
- min-width: 0;
- align-items: baseline;
- gap: var(--openui-space-xs);
+.gh-chipLabel {
+ white-space: nowrap;
}
-.gh-inline-selectPlaceholder {
- color: var(--openui-text-neutral-tertiary);
+.gh-chipClear {
+ display: inline-flex;
+ flex-shrink: 0;
+ align-items: center;
+ justify-content: center;
+ padding: 0;
+ border: none;
+ background: transparent;
+ color: var(--openui-text-neutral-secondary);
+ cursor: pointer;
+ transition: color 0.15s ease;
}
-.gh-inline-selectLabel {
- color: inherit;
+.gh-chipClear:hover {
+ color: var(--openui-text-neutral-primary);
}
-.gh-inline-selectDescription {
- color: var(--openui-text-neutral-tertiary);
- font: var(--openui-text-body-sm);
- letter-spacing: var(--openui-text-body-sm-letter-spacing);
+.gh-chipAvatar,
+.gh-chipMonogram {
+ width: 1.25em;
+ height: 1.25em;
+ border-radius: var(--openui-radius-full);
}
-.gh-inline-selectChevron {
+.gh-chipAvatar {
flex-shrink: 0;
+}
+
+.gh-chipMonogram {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--openui-highlight);
+ color: var(--openui-text-neutral-secondary);
+ font-size: 0.65em;
+ font-weight: 600;
+}
+
+/* ── Developer picker ── */
+
+.gh-devPicker {
+ display: flex;
+ flex-direction: column;
+ gap: var(--openui-space-m);
+}
+
+.gh-devPickerCaption {
+ margin: 0;
color: var(--openui-text-neutral-tertiary);
- transition: transform 0.15s ease;
+ font: var(--openui-text-label-sm-heavy);
}
-.gh-inline-selectChevron-open {
- transform: rotate(180deg);
+/* ── Option list (shared) ── */
+
+.gh-choiceList {
+ display: flex;
+ flex-direction: column;
+ gap: 0.625rem;
}
-.gh-dropdownMenu {
- position: absolute;
- top: calc(100% + var(--openui-space-s));
- left: 50%;
- z-index: 20;
- width: max-content;
- min-width: min(360px, 88vw);
- max-width: min(420px, 92vw);
- padding: var(--openui-space-s);
- border: 1px solid var(--openui-border-default);
- border-radius: calc(var(--openui-radius-3xl) + 6px);
- background: var(--openui-foreground);
- box-shadow: var(--openui-shadow-xl);
- transform: translateX(-50%);
-}
-
-.gh-dropdownOption {
+.gh-choiceList-developer {
+ max-width: 18rem;
+}
+
+.gh-choiceList-focus {
+ max-width: 20rem;
+}
+
+.gh-choiceOption {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
- gap: var(--openui-space-s);
- padding: var(--openui-space-s) var(--openui-space-m);
- border: none;
- border-radius: var(--openui-radius-2xl);
- background: transparent;
+ gap: var(--openui-space-m);
+ padding: 0.75rem 1rem;
+ border: 1px solid color-mix(in srgb, var(--gh-tone-fill) 18%, var(--gh-tone-border));
+ border-radius: calc(var(--openui-radius-3xl) + 4px);
+ background: color-mix(in srgb, var(--gh-tone-bg) 34%, var(--openui-foreground));
color: var(--openui-text-neutral-primary);
+ box-shadow: var(--openui-shadow-s);
cursor: pointer;
text-align: left;
- transition: background-color 0.15s ease;
+ transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
-.gh-dropdownOption:hover,
-.gh-dropdownOption-selected {
- background: var(--openui-highlight-subtle);
+.gh-choiceOption:hover,
+.gh-choiceOption-selected {
+ transform: translateY(-1px);
+ border-color: color-mix(in srgb, var(--gh-tone-fill) 36%, var(--openui-border-interactive-emphasis));
+ background: color-mix(in srgb, var(--gh-tone-bg) 54%, var(--openui-foreground));
}
-.gh-dropdownOptionContent {
+.gh-choiceOptionPrimary {
display: inline-flex;
min-width: 0;
align-items: center;
gap: var(--openui-space-s);
}
-.gh-dropdownOptionLeading {
+.gh-choiceOptionLeading {
display: inline-flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
}
-.gh-dropdownOptionCopy {
- display: flex;
- min-width: 0;
- flex-direction: column;
- gap: 2px;
-}
-
-.gh-dropdownOptionLabel {
+.gh-choiceOptionLabel {
color: var(--openui-text-neutral-primary);
font: var(--openui-text-body-default-heavy);
letter-spacing: var(--openui-text-body-default-heavy-letter-spacing);
}
-.gh-dropdownOptionDescription {
- color: var(--openui-text-neutral-secondary);
- font: var(--openui-text-body-sm);
- letter-spacing: var(--openui-text-body-sm-letter-spacing);
-}
-
-.gh-dropdownOptionCheck {
+.gh-choiceOptionCheck {
flex-shrink: 0;
- color: var(--openui-text-neutral-secondary);
+ color: var(--gh-tone-fill);
}
-.gh-dropdown-avatar {
- width: 28px;
- height: 28px;
+.gh-choiceAvatar {
+ width: 1.125rem;
+ height: 1.125rem;
border-radius: var(--openui-radius-full);
+ flex-shrink: 0;
}
-.gh-dropdown-icon {
+.gh-choiceIconBubble {
display: inline-flex;
- width: 24px;
- height: 24px;
+ width: 1.75rem;
+ height: 1.75rem;
align-items: center;
justify-content: center;
border-radius: var(--openui-radius-full);
- background: var(--openui-highlight-subtle);
- font-size: 14px;
- line-height: 1;
+ background: color-mix(in srgb, var(--gh-tone-fill) 14%, var(--openui-highlight-subtle));
+ color: var(--gh-tone-fill);
+}
+
+.gh-choiceSwatch {
+ display: inline-flex;
+ width: 0.875rem;
+ height: 0.875rem;
+ border-radius: 50%;
+ background: var(--gh-tone-fill);
}
-.gh-start-actions {
+/* ── Focus picker ── */
+
+.gh-focusPicker {
+ display: flex;
+ flex-direction: column;
+ gap: var(--openui-space-m);
+}
+
+.gh-focusPickerCaption {
+ margin: 0;
+ color: var(--openui-text-neutral-tertiary);
+ font: var(--openui-text-label-sm-heavy);
+}
+
+/* ── Error ── */
+
+.gh-error {
+ color: var(--openui-text-danger-primary);
+ font: var(--openui-text-label-default-heavy);
+ letter-spacing: var(--openui-text-label-default-heavy-letter-spacing);
+}
+
+/* ── Actions ── */
+
+.gh-actions {
display: flex;
- justify-content: center;
align-items: center;
- gap: var(--openui-space-s);
- width: auto;
+ gap: var(--openui-space-m-l);
}
-.gh-reset-button,
-.gh-generate-button {
- width: fit-content;
- min-width: 0;
+.openui-button-base.gh-cta {
+ min-height: 3rem;
+ padding: 0.75rem 1.25rem;
+ border: none;
+ border-radius: var(--openui-radius-full);
+ background: var(--openui-interactive-accent-default);
+ color: var(--openui-text-accent-primary);
+ box-shadow: var(--openui-shadow-l);
+ font: var(--openui-text-body-large-heavy);
+ letter-spacing: var(--openui-text-body-default-heavy-letter-spacing);
+}
+
+.openui-button-base.gh-cta:hover:not(:disabled) {
+ background: var(--openui-interactive-accent-hover);
+}
+
+.gh-startOver {
+ border: none;
+ background: transparent;
+ color: var(--openui-text-neutral-secondary);
+ min-height: 3rem;
+ padding: 0.75rem 0;
+ font: var(--openui-text-body-large-heavy);
+ letter-spacing: var(--openui-text-body-default-heavy-letter-spacing);
+ cursor: pointer;
+ transition: color 0.2s ease;
+}
+
+.gh-startOver:hover:not(:disabled) {
+ color: var(--openui-text-neutral-primary);
+}
+
+.gh-startOver:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
}
+/* ── Focus ring ── */
+
+.gh-cta:focus-visible,
+.gh-inputClear:focus-visible,
+.gh-chipClear:focus-visible,
+.gh-choiceOption:focus-visible,
+.gh-startOver:focus-visible {
+ outline: 2px solid var(--openui-border-accent);
+ outline-offset: 3px;
+}
+
+/* ── Tone tokens ── */
+
+.gh-tone-green, .gh-tone-mint {
+ --gh-tone-fill: var(--openui-text-success-primary);
+ --gh-tone-bg: var(--openui-success-background);
+ --gh-tone-border: var(--openui-border-success);
+}
+
+.gh-tone-purple, .gh-tone-violet {
+ --gh-tone-fill: var(--openui-text-purple-primary);
+ --gh-tone-bg: var(--openui-purple-background);
+ --gh-tone-border: var(--openui-border-accent);
+}
+
+.gh-tone-red, .gh-tone-rose {
+ --gh-tone-fill: var(--openui-text-danger-primary);
+ --gh-tone-bg: var(--openui-danger-background);
+ --gh-tone-border: var(--openui-border-danger);
+}
+
+.gh-tone-blue {
+ --gh-tone-fill: var(--openui-text-info-primary);
+ --gh-tone-bg: var(--openui-info-background);
+ --gh-tone-border: var(--openui-border-info);
+}
+
+.gh-tone-amber, .gh-tone-peach {
+ --gh-tone-fill: var(--openui-text-alert-primary);
+ --gh-tone-bg: var(--openui-alert-background);
+ --gh-tone-border: var(--openui-border-alert);
+}
+
+.gh-tone-pink {
+ --gh-tone-fill: var(--openui-text-pink-primary);
+ --gh-tone-bg: var(--openui-pink-background);
+ --gh-tone-border: color-mix(in srgb, var(--openui-text-pink-primary) 24%, var(--openui-border-default));
+}
+
+/* ── Visually hidden ── */
+
.gh-visually-hidden {
position: absolute;
width: 1px;
@@ -334,60 +458,54 @@
border: 0;
}
-@media (max-width: 900px) {
- .gh-builder-title {
- font-size: clamp(34px, 7vw, 48px);
- }
+/* ── Animation ── */
- .gh-inline-inputControl {
- max-width: min(12ch, 36vw);
- }
+@keyframes gh-step-fade-in {
+ from { opacity: 0; transform: translateY(8px); }
+ to { opacity: 1; transform: translateY(0); }
+}
- .gh-inline-select-dropdown {
- max-width: min(20ch, 60vw);
- }
+.gh-step-appear {
+ animation: gh-step-fade-in 200ms ease;
}
+/* ── Mobile ── */
+
@media (max-width: 768px) {
.gh-connect {
- padding: var(--openui-space-2xl) var(--openui-space-m-l) var(--openui-space-2xl);
+ padding: var(--openui-space-3xl) var(--openui-space-m-l) var(--openui-space-2xl);
}
.gh-builder {
- gap: var(--openui-space-m-l);
- }
-
- .gh-builder-title {
- gap: var(--openui-space-xs);
- font-size:28px;
- line-height: 1.4;
- letter-spacing: -0.02em;
+ gap: var(--openui-space-xl);
}
- .gh-builder-inline {
- flex-direction: column;
- gap: var(--openui-space-xs);
+ .gh-sentenceLine {
+ font-size: 32px;
}
- .gh-inline-copy {
- font: var(--openui-text-body-sm);
- letter-spacing: var(--openui-text-body-sm-letter-spacing);
+ .gh-sentenceIdentity {
+ font-size: 32px;
}
- .gh-inline-inputControl {
- max-width: min(12ch, 68vw);
+ .gh-chip {
+ font-size: 24px;
+ padding: 8px 14px 8px 8px;
}
- .gh-inline-select-dropdown {
- max-width: min(18ch, 72vw);
+ .gh-choiceList-developer,
+ .gh-choiceList-focus {
+ max-width: 100%;
}
- .gh-dropdownMenu {
- min-width: min(280px, 82vw);
- max-width: min(320px, 86vw);
+ .gh-choiceOption {
+ width: 100%;
}
- .gh-start-actions {
- flex-wrap: nowrap;
+ .gh-actions {
+ margin-top:32px;
+ flex-wrap: wrap;
+ align-items: flex-start;
+ gap: var(--openui-space-l);
}
}
diff --git a/docs/app/demo/github/components/GitHubConnect/GitHubConnect.tsx b/docs/app/demo/github/components/GitHubConnect/GitHubConnect.tsx
index ba59c7200..b85b11ecd 100644
--- a/docs/app/demo/github/components/GitHubConnect/GitHubConnect.tsx
+++ b/docs/app/demo/github/components/GitHubConnect/GitHubConnect.tsx
@@ -1,191 +1,149 @@
"use client";
+import { GitHubIcon } from "@/components/brand-logo";
import { Button } from "@openuidev/react-ui";
-import { Check, ChevronDown } from "lucide-react";
import {
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
- type FormEvent,
- type ReactNode,
-} from "react";
-import { GITHUB_STARTERS } from "../../constants";
+ Activity,
+ Check,
+ CircleDot,
+ Code2,
+ GitPullRequest,
+ Hexagon,
+ Search,
+ X,
+ type LucideIcon,
+} from "lucide-react";
+import { useCallback, useEffect, useRef, useState, type FormEvent } from "react";
+import {
+ GITHUB_STARTERS,
+ type GitHubStarterIconKey,
+ type GitHubStarterTone,
+} from "../../constants";
import "./GitHubConnect.css";
type GitHubConnectProps = {
onConnectAndPrompt: (username: string, prompt: string) => void;
};
-const DEMO_USERS = [
- { username: "torvalds", label: "Linus Torvalds" },
- { username: "yyx990803", label: "Evan You" },
- { username: "gaearon", label: "Dan Abramov" },
- { username: "rauchg", label: "Guillermo Rauch" },
-];
+type DeveloperTone = "peach" | "mint" | "violet" | "rose";
-type DropdownOption = {
+type PickerOption = {
value: string;
label: string;
- description?: string;
- leading?: ReactNode;
+ kind: "developer" | "focus";
+ tone: DeveloperTone | GitHubStarterTone;
+ icon?: GitHubStarterIconKey;
+ avatarUsername?: string;
};
-const DEVELOPER_OPTIONS: DropdownOption[] = DEMO_USERS.map((user) => ({
+const STARTER_ICON_MAP: Record<GitHubStarterIconKey, LucideIcon> = {
+ "commit-activity": Activity,
+ "pull-requests": GitPullRequest,
+ "issue-tracking": CircleDot,
+ "code-reviews": Search,
+ "language-breakdown": Code2,
+ "repository-stats": Hexagon,
+};
+
+const DEMO_USERS = [
+ { username: "torvalds", tone: "peach" },
+ { username: "yyx990803", tone: "mint" },
+ { username: "sindresorhus", tone: "violet" },
+ { username: "gaearon", tone: "rose" },
+] as const satisfies ReadonlyArray<{ username: string; tone: DeveloperTone }>;
+
+const DEVELOPER_OPTIONS: PickerOption[] = DEMO_USERS.map((user) => ({
value: user.username,
- label: user.label,
- description: `@${user.username}`,
- leading: (
- <img
- src={`https://github.com/${user.username}.png?size=40`}
- alt=""
- className="gh-dropdown-avatar"
- />
- ),
+ label: `@${user.username}`,
+ kind: "developer",
+ tone: user.tone,
+ avatarUsername: user.username,
}));
-const FOCUS_AREA_OPTIONS: DropdownOption[] = GITHUB_STARTERS.map((starter) => ({
+const FOCUS_AREA_OPTIONS: PickerOption[] = GITHUB_STARTERS.map((starter) => ({
value: starter.prompt,
label: starter.label,
- leading: <span className="gh-dropdown-icon">{starter.icon}</span>,
+ kind: "focus",
+ tone: starter.tone,
+ icon: starter.icon,
}));
-function getRandomStarterPrompt() {
- const idx = Math.floor(Math.random() * GITHUB_STARTERS.length);
- return GITHUB_STARTERS[idx].prompt;
+function GitHubStarterIcon({ icon }: { icon: GitHubStarterIconKey }) {
+ const Icon = STARTER_ICON_MAP[icon];
+ return <Icon size={16} strokeWidth={2} />;
+}
+
+function renderOptionLeading(option: PickerOption) {
+ if (option.kind === "developer") {
+ return option.avatarUsername ? (
+ <img
+ src={`https://github.com/${option.avatarUsername}.png?size=40`}
+ alt=""
+ className="gh-choiceAvatar"
+ />
+ ) : (
+ <span className={`gh-choiceSwatch gh-tone-${option.tone}`} />
+ );
+ }
+
+ if (option.icon) {
+ return (
+ <span className={`gh-choiceIconBubble gh-tone-${option.tone}`}>
+ <GitHubStarterIcon icon={option.icon} />
+ </span>
+ );
+ }
+
+ return null;
}
-type InlineDropdownProps = {
- id: string;
+type OptionListProps = {
ariaLabel: string;
- placeholder: string;
- options: DropdownOption[];
+ options: PickerOption[];
value: string | null;
onChange: (value: string) => void;
- showSelectedDescription?: boolean;
+ className?: string;
};
-function InlineDropdown({
- id,
- ariaLabel,
- placeholder,
- options,
- value,
- onChange,
- showSelectedDescription = false,
-}: InlineDropdownProps) {
- const [isOpen, setIsOpen] = useState(false);
- const containerRef = useRef<HTMLDivElement>(null);
-
- useEffect(() => {
- if (!isOpen) return;
-
- const handlePointerDown = (event: PointerEvent) => {
- if (!containerRef.current?.contains(event.target as Node)) {
- setIsOpen(false);
- }
- };
-
- const handleEscape = (event: KeyboardEvent) => {
- if (event.key === "Escape") {
- setIsOpen(false);
- }
- };
-
- window.addEventListener("pointerdown", handlePointerDown);
- window.addEventListener("keydown", handleEscape);
-
- return () => {
- window.removeEventListener("pointerdown", handlePointerDown);
- window.removeEventListener("keydown", handleEscape);
- };
- }, [isOpen]);
-
- const selectedOption = options.find((option) => option.value === value) ?? null;
-
+function OptionList({ ariaLabel, options, value, onChange, className = "" }: OptionListProps) {
return (
- <div
- ref={containerRef}
- className={`gh-inline-select-wrap gh-inline-select-dropdown ${isOpen ? "gh-inline-select-wrap-open" : ""}`}
- >
- <button
- id={id}
- type="button"
- className={`gh-inline-selectButton ${selectedOption ? "gh-inline-selectButton-filled" : ""}`}
- aria-label={ariaLabel}
- aria-haspopup="listbox"
- aria-expanded={isOpen}
- onClick={() => setIsOpen((prev) => !prev)}
- >
- {selectedOption ? (
- <span className="gh-inline-selectValue">
- {selectedOption.leading && (
- <span className="gh-inline-selectLeading" aria-hidden="true">
- {selectedOption.leading}
- </span>
- )}
- <span className="gh-inline-selectText">
- <span className="gh-inline-selectLabel">{selectedOption.label}</span>
- {showSelectedDescription && selectedOption.description && (
- <span className="gh-inline-selectDescription">{selectedOption.description}</span>
+ <div className={`gh-choiceList ${className}`.trim()} role="listbox" aria-label={ariaLabel}>
+ {options.map((option) => {
+ const isSelected = option.value === value;
+ const leading = renderOptionLeading(option);
+
+ return (
+ <button
+ key={option.value}
+ type="button"
+ className={`gh-choiceOption gh-choiceOption-${option.kind} gh-tone-${option.tone} ${isSelected ? "gh-choiceOption-selected" : ""}`}
+ role="option"
+ aria-selected={isSelected}
+ onClick={() => onChange(option.value)}
+ >
+ <span className="gh-choiceOptionPrimary">
+ {leading && (
+ <span className="gh-choiceOptionLeading" aria-hidden="true">
+ {leading}
+ </span>
)}
+ <span className="gh-choiceOptionLabel">{option.label}</span>
</span>
- </span>
- ) : (
- <span className="gh-inline-selectPlaceholder">{placeholder}</span>
- )}
- <ChevronDown
- aria-hidden="true"
- size={18}
- className={`gh-inline-selectChevron ${isOpen ? "gh-inline-selectChevron-open" : ""}`}
- />
- </button>
-
- {isOpen && (
- <div className="gh-dropdownMenu" role="listbox" aria-labelledby={id}>
- {options.map((option) => {
- const isSelected = option.value === value;
-
- return (
- <button
- key={option.value}
- type="button"
- className={`gh-dropdownOption ${isSelected ? "gh-dropdownOption-selected" : ""}`}
- role="option"
- aria-selected={isSelected}
- onClick={() => {
- onChange(option.value);
- setIsOpen(false);
- }}
- >
- <span className="gh-dropdownOptionContent">
- {option.leading && <span className="gh-dropdownOptionLeading">{option.leading}</span>}
- <span className="gh-dropdownOptionCopy">
- <span className="gh-dropdownOptionLabel">{option.label}</span>
- {option.description && (
- <span className="gh-dropdownOptionDescription">{option.description}</span>
- )}
- </span>
- </span>
- {isSelected && <Check size={16} className="gh-dropdownOptionCheck" aria-hidden="true" />}
- </button>
- );
- })}
- </div>
- )}
+ {isSelected && <Check size={16} className="gh-choiceOptionCheck" aria-hidden="true" />}
+ </button>
+ );
+ })}
</div>
);
}
export function GitHubConnect({ onConnectAndPrompt }: GitHubConnectProps) {
- const initialGithubPrompt = useMemo(() => getRandomStarterPrompt(), []);
const [username, setUsername] = useState("");
const [selectedDeveloperUsername, setSelectedDeveloperUsername] = useState<string | null>(null);
const [avatarUrl, setAvatarUrl] = useState<string | null>(null);
const [error, setError] = useState("");
- const [defaultGithubPrompt, setDefaultGithubPrompt] = useState(initialGithubPrompt);
- const [selectedGithubPrompt, setSelectedGithubPrompt] = useState(initialGithubPrompt);
+ const [selectedGithubPrompt, setSelectedGithubPrompt] = useState<string | null>(null);
+ const [validating, setValidating] = useState(false);
const inputRef = useRef<HTMLInputElement>(null);
const debounceRef = useRef<ReturnType<typeof setTimeout>>(undefined);
@@ -195,10 +153,8 @@ export function GitHubConnect({ onConnectAndPrompt }: GitHubConnectProps) {
useEffect(() => {
if (debounceRef.current) clearTimeout(debounceRef.current);
-
- if (!username.trim() || username.trim().length < 2) {
- return;
- }
+ if (selectedDeveloperUsername) return;
+ if (!username.trim() || username.trim().length < 2) return;
debounceRef.current = setTimeout(() => {
const url = `https://github.com/${username.trim()}.png?size=64`;
@@ -211,79 +167,65 @@ export function GitHubConnect({ onConnectAndPrompt }: GitHubConnectProps) {
return () => {
if (debounceRef.current) clearTimeout(debounceRef.current);
};
- }, [username]);
+ }, [selectedDeveloperUsername, username]);
+
+ const focusInput = useCallback(() => {
+ window.requestAnimationFrame(() => inputRef.current?.focus());
+ }, []);
+
+ const handleReset = useCallback(() => {
+ setUsername("");
+ setSelectedDeveloperUsername(null);
+ setAvatarUrl(null);
+ setError("");
+ setSelectedGithubPrompt(null);
+ focusInput();
+ }, [focusInput]);
const validate = useCallback((name: string): boolean => {
const trimmed = name.trim();
- if (!trimmed) {
- setError("Enter a GitHub username");
- return false;
- }
- if (!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(trimmed)) {
- setError("Invalid username format");
- return false;
- }
- if (trimmed.length > 39) {
- setError("Username too long");
- return false;
- }
+ if (!trimmed) { setError("Enter a GitHub username"); return false; }
+ if (!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(trimmed)) { setError("Invalid username format"); return false; }
+ if (trimmed.length > 39) { setError("Username too long"); return false; }
setError("");
return true;
}, []);
- const handlePopularDeveloperSelect = useCallback(
- (nextUsername: string) => {
- setSelectedDeveloperUsername(nextUsername);
- setUsername("");
- setAvatarUrl(null);
- setError("");
- },
- [],
- );
-
- const trimmedUsername = username.trim();
- const effectiveUsername = trimmedUsername || selectedDeveloperUsername || "";
- const hasValidUsername =
- effectiveUsername.length > 0 &&
- effectiveUsername.length <= 39 &&
- /^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(effectiveUsername);
- const canStart = selectedGithubPrompt !== null && hasValidUsername;
- const canReset = Boolean(
- trimmedUsername || selectedDeveloperUsername || error || selectedGithubPrompt !== defaultGithubPrompt,
- );
-
- const handleReset = useCallback(() => {
- const nextDefaultPrompt = getRandomStarterPrompt();
+ const handlePopularDeveloperSelect = useCallback((nextUsername: string) => {
+ setSelectedDeveloperUsername(nextUsername);
setUsername("");
- setSelectedDeveloperUsername(null);
setAvatarUrl(null);
setError("");
- setDefaultGithubPrompt(nextDefaultPrompt);
- setSelectedGithubPrompt(nextDefaultPrompt);
- inputRef.current?.focus();
}, []);
- const [validating, setValidating] = useState(false);
+ const handleClearIdentity = useCallback(() => handleReset(), [handleReset]);
+ const handleClearSelectedFocus = useCallback(() => { setSelectedGithubPrompt(null); setError(""); }, []);
+ const handleClearTypedUsername = useCallback(() => { setUsername(""); setAvatarUrl(null); setError(""); focusInput(); }, [focusInput]);
+
+ const trimmedUsername = username.trim();
+ const effectiveUsername = trimmedUsername || selectedDeveloperUsername || "";
+ const selectedDeveloperOption = DEVELOPER_OPTIONS.find((o) => o.value === selectedDeveloperUsername) ?? null;
+ const selectedFocusOption = FOCUS_AREA_OPTIONS.find((o) => o.value === selectedGithubPrompt) ?? null;
+ const selectedDeveloperLeading = selectedDeveloperOption ? renderOptionLeading(selectedDeveloperOption) : null;
+ const selectedFocusLeading = selectedFocusOption ? renderOptionLeading(selectedFocusOption) : null;
+ const hasValidUsername = effectiveUsername.length > 0 && effectiveUsername.length <= 39 && /^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(effectiveUsername);
+ const hasIdentitySelection = Boolean(effectiveUsername);
+ const isTypedIdentityLocked = Boolean(trimmedUsername && selectedGithubPrompt && hasValidUsername);
+ const showDeveloperPicker = !selectedDeveloperOption && !trimmedUsername;
+ const canStart = Boolean(selectedGithubPrompt) && hasValidUsername;
+ const canReset = Boolean(trimmedUsername || selectedDeveloperUsername || error || selectedGithubPrompt);
const handleStartGenerating = async () => {
if (!selectedGithubPrompt) return;
if (!validate(effectiveUsername)) return;
-
setValidating(true);
try {
const res = await fetch(`https://api.github.com/users/${effectiveUsername}`);
- if (!res.ok) {
- setError("GitHub user not found");
- setValidating(false);
- return;
- }
+ if (!res.ok) { setError("GitHub user not found"); setValidating(false); return; }
} catch {
- setError("Could not verify username");
- setValidating(false);
- return;
+ setError("Could not verify username"); setValidating(false); return;
}
setValidating(false);
-
onConnectAndPrompt(effectiveUsername, selectedGithubPrompt);
};
@@ -292,88 +234,125 @@ export function GitHubConnect({ onConnectAndPrompt }: GitHubConnectProps) {
void handleStartGenerating();
};
+ const renderIdentityControl = () => {
+ if (selectedDeveloperOption) {
+ return (
+ <span className={`gh-chip gh-tone-${selectedDeveloperOption.tone}`}>
+ {selectedDeveloperLeading && <span className="gh-chipLeading">{selectedDeveloperLeading}</span>}
+ <span className="gh-chipLabel">{selectedDeveloperOption.label}</span>
+ <button type="button" className="gh-chipClear" aria-label="Clear selected developer" onClick={handleClearIdentity}>
+ <X size={14} />
+ </button>
+ </span>
+ );
+ }
+ if (isTypedIdentityLocked) {
+ return (
+ <span className="gh-chip gh-chip-neutral">
+ <span className="gh-chipLeading">
+ {avatarUrl ? <img src={avatarUrl} alt="" className="gh-chipAvatar" /> : <span className="gh-chipMonogram">@</span>}
+ </span>
+ <span className="gh-chipLabel">@{effectiveUsername}</span>
+ <button type="button" className="gh-chipClear" aria-label="Clear username" onClick={handleClearIdentity}>
+ <X size={14} />
+ </button>
+ </span>
+ );
+ }
+ return (
+ <span className={`gh-inputWrap ${avatarUrl ? "gh-inputWrap-withAvatar" : ""}`}>
+ {avatarUrl && <img src={avatarUrl} alt="" className="gh-chipAvatar" />}
+ <span className="gh-inputPrefix">@</span>
+ <span className="gh-inputSizer">
+ <span className="gh-inputGhost">{username || "username"}</span>
+ <input
+ id="gh-username-input"
+ ref={inputRef}
+ className="gh-inputField"
+ value={username}
+ onChange={(e) => { setSelectedDeveloperUsername(null); setUsername(e.target.value); setAvatarUrl(null); setError(""); }}
+ placeholder="username"
+ autoComplete="off"
+ spellCheck={false}
+ />
+ </span>
+ {trimmedUsername && (
+ <button type="button" className="gh-inputClear" aria-label="Clear" onClick={handleClearTypedUsername}>
+ <X size={14} />
+ </button>
+ )}
+ </span>
+ );
+ };
+
return (
<div className="gh-connect">
<form className="gh-builder" onSubmit={handleSubmit}>
- <div className="gh-builder-copy">
- <h1 className="gh-builder-title">
- <span>Create an interactive GitHub dashboard for</span>
- <span className="gh-builder-inline">
- <label className="gh-visually-hidden" htmlFor="gh-username-input">
- GitHub username
- </label>
- <span className={`gh-inline-input ${avatarUrl ? "gh-inline-input-with-avatar" : ""}`}>
- {avatarUrl && <img src={avatarUrl} alt="" className="gh-inline-avatar" />}
- <span className="gh-inline-inputControl">
- <span aria-hidden="true" className="gh-inline-inputSizer">
- {username || "your username"}
- </span>
- <input
- id="gh-username-input"
- ref={inputRef}
- className="gh-inline-input-field"
- value={username}
- onChange={(e) => {
- setSelectedDeveloperUsername(null);
- setUsername(e.target.value);
- setAvatarUrl(null);
- setError("");
- }}
- placeholder="username"
- autoComplete="off"
- spellCheck={false}
- />
+ <div className="gh-brand">
+ <span className="gh-brandIcon"><GitHubIcon /></span>
+ <span className="gh-brandLabel">GitPulse</span>
+ </div>
+
+ <div className="gh-sentence">
+ <p className="gh-sentenceLine">Create an interactive GitHub dashboard for</p>
+ <div className="gh-sentenceIdentity">{renderIdentityControl()}</div>
+
+ {hasIdentitySelection && (
+ <p className="gh-sentenceLine gh-sentenceLine-secondary">
+ that focuses on{" "}
+ {selectedFocusOption ? (
+ <span className={`gh-chip gh-chip-focus gh-tone-${selectedFocusOption.tone}`}>
+ {selectedFocusLeading && <span className="gh-chipLeading">{selectedFocusLeading}</span>}
+ <span className="gh-chipLabel">{selectedFocusOption.label}</span>
+ <button type="button" className="gh-chipClear" aria-label="Clear topic" onClick={handleClearSelectedFocus}>
+ <X size={14} />
+ </button>
</span>
- </span>
- <span className="gh-inline-copy">or</span>
- <label className="gh-visually-hidden" htmlFor="gh-developer-select">
- Popular developer
- </label>
- <InlineDropdown
- id="gh-developer-select"
- ariaLabel="Select a developer"
- placeholder="select a developer"
- options={DEVELOPER_OPTIONS}
- value={selectedDeveloperUsername}
- onChange={handlePopularDeveloperSelect}
- />
- </span>
- <span>that focuses on</span>
- <span className="gh-builder-inline gh-builder-inline-single">
- <label className="gh-visually-hidden" htmlFor="gh-focus-area-select">
- Focus area
- </label>
- <InlineDropdown
- id="gh-focus-area-select"
- ariaLabel="Select a focus area"
- placeholder="focus area"
- options={FOCUS_AREA_OPTIONS}
- value={selectedGithubPrompt}
- onChange={(nextPrompt) => {
- setSelectedGithubPrompt(nextPrompt);
- setError("");
- }}
- />
- </span>
- </h1>
+ ) : (
+ <span className="gh-selectHintInline">...</span>
+ )}
+ </p>
+ )}
</div>
+ {showDeveloperPicker && (
+ <div className="gh-devPicker gh-step-appear">
+ <p className="gh-devPickerCaption">or select a developer</p>
+ <OptionList
+ ariaLabel="Select a developer"
+ options={DEVELOPER_OPTIONS}
+ value={selectedDeveloperUsername}
+ onChange={handlePopularDeveloperSelect}
+ className="gh-choiceList-developer"
+ />
+ </div>
+ )}
+
+ {hasIdentitySelection && !selectedFocusOption && (
+ <div className="gh-focusPicker gh-step-appear">
+ <p className="gh-focusPickerCaption">Select a topic</p>
+ <OptionList
+ ariaLabel="Select a focus area"
+ options={FOCUS_AREA_OPTIONS}
+ value={selectedGithubPrompt}
+ onChange={(v) => { setSelectedGithubPrompt(v); setError(""); }}
+ className="gh-choiceList-focus"
+ />
+ </div>
+ )}
+
{error && <div className="gh-error">{error}</div>}
- <div className="gh-start-actions">
- <Button
- className="gh-reset-button"
- variant="secondary"
- type="button"
- onClick={handleReset}
- disabled={!canReset}
- >
- Reset
- </Button>
- <Button className="gh-generate-button" type="submit" disabled={!canStart || validating}>
- {validating ? "Verifying..." : "Generate"}
- </Button>
- </div>
+ {hasIdentitySelection && selectedGithubPrompt && (
+ <div className="gh-actions gh-step-appear">
+ <Button className="gh-cta" size="large" type="submit" disabled={!canStart || validating}>
+ {validating ? "Verifying..." : "Let's go"}
+ </Button>
+ <button type="button" className="gh-startOver" onClick={handleReset} disabled={!canReset}>
+ Start over
+ </button>
+ </div>
+ )}
</form>
</div>
);
diff --git a/docs/app/demo/github/constants.ts b/docs/app/demo/github/constants.ts
index f5f3222ac..12a992833 100644
--- a/docs/app/demo/github/constants.ts
+++ b/docs/app/demo/github/constants.ts
@@ -1,35 +1,65 @@
export type Theme = "system" | "light" | "dark";
export type Status = "idle" | "streaming" | "done" | "error";
-export const GITHUB_STARTERS = [
+export type GitHubStarterIconKey =
+ | "commit-activity"
+ | "pull-requests"
+ | "issue-tracking"
+ | "code-reviews"
+ | "language-breakdown"
+ | "repository-stats";
+
+export type GitHubStarterTone = "green" | "purple" | "red" | "blue" | "amber" | "pink";
+
+export type GitHubStarter = {
+ label: string;
+ prompt: string;
+ icon: GitHubStarterIconKey;
+ tone: GitHubStarterTone;
+};
+
+export const GITHUB_STARTERS: GitHubStarter[] = [
{
- label: "Profile Dashboard",
+ label: "Commit Activity",
prompt:
- "Build a profile dashboard with KPIs, language breakdown chart, and top repos table with sorting and language filter",
- icon: "📊",
+ "Build a dashboard focused on commit activity, contribution streaks, busiest repositories, and recent work patterns over time.",
+ icon: "commit-activity",
+ tone: "green",
},
{
- label: "Coding Patterns",
+ label: "Pull Requests",
prompt:
- "Analyze my coding patterns — show activity breakdown, language distribution, and a recent events timeline",
- icon: "🔥",
+ "Create a pull request dashboard with open versus merged trends, review turnaround, and the repositories with the most PR activity.",
+ icon: "pull-requests",
+ tone: "purple",
},
{
- label: "Star History",
- prompt: "Show star history charts for my most popular repos with a comparison view",
- icon: "⭐",
+ label: "Issue Tracking",
+ prompt:
+ "Show issue tracking insights with open versus closed trends, response speed, issue backlog, and the repos with the most active discussions.",
+ icon: "issue-tracking",
+ tone: "red",
+ },
+ {
+ label: "Code Reviews",
+ prompt:
+ "Analyze code reviews by showing review volume, average turnaround, participation by repository, and recent review activity.",
+ icon: "code-reviews",
+ tone: "blue",
},
{
- label: "Repo Organizer",
+ label: "Language Breakdown",
prompt:
- "Build a repo organizer with bookmarks, tags, search, and language filter. Include a bookmark form in a modal.",
- icon: "🗂️",
+ "Visualize language breakdown across repositories with usage share, top projects per language, and how the stack changes over time.",
+ icon: "language-breakdown",
+ tone: "amber",
},
{
- label: "Open Source Impact",
+ label: "Repository Stats",
prompt:
- "Show my open source impact — follower stats, total stars, top repos by forks, language expertise breakdown, and community reach",
- icon: "🌍",
+ "Build a repository stats dashboard with stars, forks, watchers, top repositories, and overall portfolio health.",
+ icon: "repository-stats",
+ tone: "pink",
},
];
diff --git a/docs/app/demo/github/layout.css b/docs/app/demo/github/layout.css
index 9be46683a..f6e452c03 100644
--- a/docs/app/demo/github/layout.css
+++ b/docs/app/demo/github/layout.css
@@ -47,6 +47,8 @@
flex-direction: column;
height: 100vh;
background: var(--openui-foreground);
+ position: relative;
+ isolation: isolate;
}
.app-body {
@@ -57,6 +59,7 @@
}
.app-body-home {
+ align-items: stretch;
overflow-y: auto;
}
@@ -70,11 +73,26 @@
}
.content-wrapper-home {
- justify-content: center;
+ position: relative;
+ align-items: stretch;
+ justify-content: flex-start;
padding: 0;
overflow: visible;
}
+.content-wrapper-home::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ background: var(--openui-foreground);
+ pointer-events: none;
+}
+
+.content-wrapper-home > * {
+ position: relative;
+ z-index: 1;
+}
+
/* ─── Split Screen ──────────────────────────────────────────────────────────── */
.split-screen {
display: grid;
@@ -554,6 +572,15 @@
width: min(100%, 600px);
}
+.gh-starter-icon {
+ display: inline-flex;
+ width: 24px;
+ height: 24px;
+ align-items: center;
+ justify-content: center;
+ border-radius: var(--openui-radius-full);
+}
+
/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
.app {
diff --git a/docs/app/demo/github/page.tsx b/docs/app/demo/github/page.tsx
index 082bac644..a6ed51f82 100644
--- a/docs/app/demo/github/page.tsx
+++ b/docs/app/demo/github/page.tsx
@@ -2,7 +2,15 @@
import { mergeStatements } from "@openuidev/react-lang";
import { Button } from "@openuidev/react-ui";
-import { Code2 } from "lucide-react";
+import {
+ Activity,
+ CircleDot,
+ Code2,
+ GitPullRequest,
+ Hexagon,
+ Search,
+ type LucideIcon,
+} from "lucide-react";
import { useTheme } from "next-themes";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { ConversationPanel } from "./components/ConversationPanel/ConversationPanel";
@@ -12,6 +20,7 @@ import { PreviewPanel } from "./components/PreviewPanel/PreviewPanel";
import {
GITHUB_STARTERS,
type ChatMessage,
+ type GitHubStarterIconKey,
type Status,
type Theme,
type ToolCallEntry,
@@ -60,6 +69,20 @@ function isPureCode(response: string): boolean {
return stmtCount / lines.length > 0.7;
}
+const STARTER_ICON_MAP: Record<GitHubStarterIconKey, LucideIcon> = {
+ "commit-activity": Activity,
+ "pull-requests": GitPullRequest,
+ "issue-tracking": CircleDot,
+ "code-reviews": Search,
+ "language-breakdown": Code2,
+ "repository-stats": Hexagon,
+};
+
+function renderStarterIcon(icon: GitHubStarterIconKey) {
+ const Icon = STARTER_ICON_MAP[icon];
+ return <Icon size={16} strokeWidth={2} />;
+}
+
// ── Tool call tracking wrapper ───────────────────────────────────────────
type ToolCallListener = (calls: ToolCallEntry[]) => void;
@@ -445,7 +468,7 @@ export default function GitHubDemoPage() {
onClick={() => send(s.prompt)}
disabled={isStreaming}
>
- <span className="gh-starter-icon">{s.icon}</span>
+ <span className={`gh-starter-icon gh-tone-${s.tone}`}>{renderStarterIcon(s.icon)}</span>
<div className="gh-starter-label">{s.label}</div>
<div className="gh-starter-desc">
{s.prompt.length > 60 ? s.prompt.slice(0, 60) + "..." : s.prompt}