Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Release

# Fully automatic releases. Successful CI on a master push starts this workflow;
# if the commits since the last published version warrant a release, it bumps
# the version, publishes to npm and tags it. No version-bump PR, no manual step.
# Successful CI on a master push starts this workflow automatically. An
# owner-authorized local-QA run can also be dispatched for the exact current
# master SHA. If the commits since the last published version warrant a release,
# it bumps the version, publishes to npm and tags it. No version-bump PR.
#
# The version comes from conventional commits (scripts/next-version.ts):
# type! / BREAKING CHANGE -> major, feat -> minor, fix|perf|revert -> patch.
Expand All @@ -23,31 +24,55 @@ on:
workflow_run:
workflows: [CI]
types: [completed]
workflow_dispatch:
inputs:
master_sha:
description: Full current master SHA after the owner-authorized local QA gate
required: true
type: string

permissions:
contents: read

jobs:
decide:
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'master'
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'master'
) ||
(
github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/master' &&
inputs.master_sha == github.sha
)
runs-on: ubicloud-standard-2
env:
TARGET_SHA: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || inputs.master_sha }}
outputs:
mode: ${{ steps.decide.outputs.mode }}
version: ${{ steps.decide.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # next-version.ts reads commit history
ref: ${{ github.event.workflow_run.head_sha }}
ref: ${{ env.TARGET_SHA }}

- name: Require the tested revision to remain master
- name: Require the exact selected revision to remain master before running it
run: |
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
test "$GITHUB_REF" = "refs/heads/master"
test "$TARGET_SHA" = "$GITHUB_SHA"
fi
if [[ ! "$TARGET_SHA" =~ ^[0-9a-f]{40}$ ]]; then
echo "TARGET_SHA must be a full lowercase 40-character commit SHA" >&2
exit 1
fi
git fetch origin master
test "$(git rev-parse HEAD)" = "${{ github.event.workflow_run.head_sha }}"
test "$(git rev-parse origin/master)" = "${{ github.event.workflow_run.head_sha }}"
test "$(git rev-parse HEAD)" = "$TARGET_SHA"
test "$(git rev-parse origin/master)" = "$TARGET_SHA"

- uses: oven-sh/setup-bun@v1
with:
Expand Down Expand Up @@ -86,16 +111,18 @@ jobs:
release_sha: ${{ steps.release-sha.outputs.value }}
env:
VERSION: ${{ needs.decide.outputs.version }}
TARGET_SHA: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || inputs.master_sha }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_sha }}
ref: ${{ env.TARGET_SHA }}

- name: Require the tested revision to remain master
- name: Require the selected revision to remain master before release preparation
run: |
git fetch origin master
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)"
test "$(git rev-parse HEAD)" = "$TARGET_SHA"
test "$(git rev-parse origin/master)" = "$TARGET_SHA"

# Mirrors ci.yml — the build resolves this plugin from a sibling directory.
- name: Checkout rsbuild-plugin-ui-css-purge
Expand Down
30 changes: 16 additions & 14 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ natively, and Claude Code loads it through the `@AGENTS.md` import in
implementation files.** It is the frontend working agreement: SolidJS/`@pathscale/ui`
conventions, and a context-efficient workflow. Reading it first keeps
context small and avoids re-deriving patterns that already exist.
- **Releases are automatic — never run `npm publish` by hand.** A successful CI run for
`master` starts [`.github/workflows/release.yml`](.github/workflows/release.yml) at the
exact revision CI tested. The workflow stops if `master` advances before release,
derives the version from conventional commits, bumps `package.json`, publishes through
npm Trusted Publishing (OIDC), and tags the published revision. There is no `NPM_TOKEN`
in this repository, so a local publish cannot authenticate anyway, and a hand-written
version bump only fights the workflow. Publishing is irreversible and a version can
never be reused, so if a release looks wrong, read the workflow run before touching
anything.
- **After a merge, confirm the fix actually published.** The release is gated by CI and
fails closed when another merge advances `master`. Confirm the npm version and tag both
point at the expected release revision:
- **Releases use the guarded workflow — never run `npm publish` by hand.** A successful
CI run for `master` starts the automatic path at the exact revision CI tested. An
authorized `workflow_dispatch` may use the local-QA path only with the explicitly
supplied full SHA that is still the exact `master` head. When a release is warranted,
both paths reuse the release preparation checks, publish through npm Trusted Publishing
(OIDC), and tag the published revision. There is no `NPM_TOKEN` in this repository, so a local publish
cannot authenticate anyway, and a hand-written version bump only fights the workflow.
Publishing is irreversible and a version can never be reused, so if a release looks
wrong, read the workflow run before touching anything.
- **After a merge, confirm the fix actually published.** The automatic release is gated
by successful master CI; the manual path is only for an explicitly authorized local-QA
release at the exact current `master` SHA. Either path fails closed when `master`
advances. Confirm the npm version and tag both point at the expected release revision:

So check, every time:

Expand All @@ -38,8 +39,9 @@ natively, and Claude Code loads it through the `@AGENTS.md` import in
git tag --points-at HEAD # a tag here with no npm release is the hole
```

If master is ahead of npm, inspect the CI and Release runs. Fix or re-run the failed
workflow rather than manufacturing another version bump.
If master is ahead of npm, inspect the CI and Release runs. Retry the automatic path
when master CI succeeds; use the manual path only after authorized local QA, supplying
the exact current `master` SHA. Never manufacture an extra version bump.
- **One open PR per repository. Add to it.** If a PR is already open here, push your
commits onto that branch instead of opening a second one. Two open PRs against the
same library mean two releases, two version bumps, and a consumer that has to wait for
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ work against them directly.

| family | components |
|---|---|
| **Layout** | Flex, Grid, Join, Surface, Card, GlassPanel, Separator, ScrollShadow, Skeleton, EmptyState, Footer, Header, Navbar, Toolbar, FloatingDock |
| **Layout** | Flex, Grid, Join, Card, Separator, ScrollArea, ScrollHorizontal, Skeleton, Empty, Footer, Header, Navbar, Toolbar, Dock |
| **Typography & misc** | Text, Link, Kbd, Badge, Chip, Tag, TagGroup, Avatar, Icon, Tooltip, Breadcrumbs, Pagination, Meter, ProgressBar, ProgressCircle, Spinner |
| **Inputs** | Input, InputGroup, InputOTP, TextField, TextArea, NumberField, SearchField, PasswordField, ColorField, Checkbox, CheckboxGroup, Radio, RadioGroup, Toggle, Slider, Select, ComboBox, ListBox, SizePicker |
| **Forms** | Form, Fieldset, Label, Description, ErrorMessage, FieldError, PasswordRequirements |
Expand Down Expand Up @@ -175,6 +175,13 @@ import — the published size is the whole library, not what ships to your users
| **[Contributing](https://github.com/pathscale/ui/blob/master/CONTRIBUTING.md)** | local setup, component checklist, proposal template |
| **[Releasing](https://github.com/pathscale/ui/blob/master/docs/releasing.md)** | how a push to master becomes an npm version, and the gates it passes |

## Honey password validation

`@pathscale/ui/passwordRules` exports `isPrintableAsciiPassword` and
`PASSWORD_CHARSET_MESSAGE` for inline signup and password-change validation.
Printable ASCII (U+0020–U+007E), including spaces, is accepted without normalization.
Do not apply this restriction to sign-in or reauthentication.

## License

MIT
21 changes: 20 additions & 1 deletion docs/api-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ invisible for a day behind a doc that looked correct the whole time.
When an API change is intentional, run `bun run check:api -- --write`, read the
diff, and commit it. The diff is the review.

187 components. An empty list means the component adds nothing beyond
188 components. An empty list means the component adds nothing beyond
HTML attributes and `UIBaseProps`; that is an assertion, not a gap.

---
Expand Down Expand Up @@ -1506,6 +1506,15 @@ state?: State
value?: number
```

### QrCode

```ts
level?: QrErrorCorrectionLevel
size?: number | string
title: string
value: string
```

### PWAInstallPrompt

```ts
Expand Down Expand Up @@ -1594,6 +1603,16 @@ variant?: ScrollAreaVariant
visibility?: ScrollAreaVisibility
```

### ScrollHorizontal

```ts
gap?: number
height?: number | string
itemWidth?: number
mobileGap?: number
mobileItemWidth?: number
```

### Select

```ts
Expand Down
115 changes: 112 additions & 3 deletions docs/ui-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
agents alike, and for every consuming application. Those apps link here rather than
keeping their own copy — one library, one set of conventions, no drift.

SolidJS component library, HeroUI-parity API, daisyUI-style theming. 101 public
SolidJS component library, HeroUI-parity API, daisyUI-style theming. 103 public
component families.

This file is **how to USE the library** (as a consumer, or when writing demos and
Expand Down Expand Up @@ -308,16 +308,67 @@ A trigger given plain text is unchanged and needs nothing.

## Component inventory (by family)

- **Layout/primitives**: Flex, Grid, Join, Card, Separator, ScrollArea, Skeleton, Empty, Footer, Header, Navbar, Toolbar, Dock
- **Layout/primitives**: Flex, Grid, Join, Card, Separator, ScrollArea, ScrollHorizontal, Skeleton, Empty, Footer, Header, Navbar, Toolbar, Dock
- **Typography/misc**: Text, Link, Kbd, Badge, Chip, Tag/TagGroup, Avatar, Icon, Tooltip, Breadcrumb, Pagination, Meter, Progress, RadialProgress, Spinner (alias: Loading)
- **Inputs**: Input, InputGroup, InputOTP, TextField, Textarea, NumberField, SearchField, PasswordField (+ password-requirements/rules, `passwordRules.ts`), ColorField, Checkbox(+Group), Radio(+Group), Switch, Slider, Select, ComboBox, ListBox, SizePicker, Form pieces (Label, Description, ErrorMessage, FieldError, Fieldset)

For Honey signup and password changes, import `isPrintableAsciiPassword` and
`PASSWORD_CHARSET_MESSAGE` from `@pathscale/ui/passwordRules`. The validator allows
only U+0020 through U+007E, preserves spaces, and leaves length and confirmation to
the form's existing rules. Show the message inline when validation fails. Never use
this validator for sign-in or reauthentication: existing passwords remain accepted.
- **Dates**: Calendar, RangeCalendar, DatePicker, DateRangePicker (internal date engine); DateField, TimeField (separate segmented editors)
- **Color**: ColorPicker, ColorArea, ColorSlider, ColorSwatch(+Picker), ColorWheel, ComplexColorWheel, ColorWheelFlower, ThemeColorPicker
- **Overlays**: Dialog, Drawer, Popover, Dropdown, Menu, Toast, Collapsible(+Group), Accordion
- **Data**: DataGrid (assembled, `createDataGrid` model), FlexGrid (incremental reveal, `createFlexGrid` model), Table (headless compound, bring your own model), plus primitives `useStreamingBuffer`, `useStreamingSubscription`
- **Auth kit**: AuthForm, AuthCard, AuthFieldGroup, AuthSubmitButton, AuthFooterLinks, AuthPoweredBy, AuthErrorMessage, AuthSuccessMessage — Layouts composing Button/Card/fields. Their spacing, alignment and tone are recipe parameters (`gap`, `align`, `variant`), so a consumer asks for the presentation it wants rather than restating utility classes. AuthCard exposes `header`, `headings`, `title`, `description`, `branding`, `body` and `footer` as `data-slot` targets.
- **Connection settings**: ConnectionSettings (the panel) with `createConnectionSettings` (the store). See below.
- **Visual FX**: MetalBorder (WebGL liquid-metal border; presets `chromatic|silver|gold`, `kind="pill"|"circle"`, `glow`, `strength` 0-100, `theme="dark"|"light"|"auto"`), GlowCard (mouse-tracking glow), NoiseBackground (animated gradient blobs), ImmersiveLanding (full mini-app w/ PWA widgets), VideoPreview, LiveChat, ChatBubble, LanguageSwitcher
- **Visual FX**: MetalBorder (WebGL liquid-metal border; presets `chromatic|silver|gold`, `kind="pill"|"circle"`, `glow`, `strength` 0-100, `theme="dark"|"light"|"auto"`), GlowCard (mouse-tracking glow), NoiseBackground (animated gradient blobs), QrCode, ImmersiveLanding (full mini-app w/ PWA widgets), VideoPreview, LiveChat, ChatBubble, LanguageSwitcher

## ScrollHorizontal

Use `ScrollHorizontal` for a gallery whose cards move horizontally as the page
scrolls vertically. Intro and outro sections remain regular consumer content.
Children can be existing Layouts such as `Card`:

```tsx
import { Card, ScrollHorizontal } from "@pathscale/ui";

<section aria-labelledby="gallery-intro">
<h2 id="gallery-intro">Stories</h2>
<p>Introductory copy stays outside the gallery.</p>
</section>

<ScrollHorizontal
aria-label="Featured stories"
itemWidth={400}
mobileItemWidth={280}
gap={30}
mobileGap={15}
height="auto"
>
<Card>First story</Card>
<Card>Second story</Card>
<Card>Third story</Card>
</ScrollHorizontal>

<section>Outro content follows the gallery.</section>
```

`itemWidth` and `mobileItemWidth` set card widths; `gap` and `mobileGap` set
spacing. Defaults are 400px and 280px for widths, and 30px and 15px for gaps.
The default `height="auto"` measures the row and creates enough vertical travel
to reach the last card. Pass a number for a pixel height or a CSS length string
to choose a different section height.

The gallery exposes a labelled `region` with a keyboard-focusable horizontal
viewport. Supply `aria-label` or `aria-labelledby` with a useful name. Focus
entering an offscreen card moves the page to reveal it without changing DOM or
focus order. Reduced motion disables sticky translation and leaves a normal
horizontal scroller. After hydration, supported browsers use a CSS view timeline;
other browsers use a passive scroll listener with frame-scheduled progress.
The component also accepts `class`, `style` and `dataTheme` props. `ScrollArea`
remains the component for an ordinary scrollable region.

Renames from old versions: Loading→Spinner, DropdownSelect→Select, RangeSlider→Slider, Callout→Alert, EmptyState→Empty, Toggle→Switch, Modal→Dialog, TextArea→Textarea, Disclosure→Collapsible, FloatingDock→Dock, ProgressBar→Progress, ProgressCircle→RadialProgress, ScrollShadow→ScrollArea, Breadcrumbs→Breadcrumb. ~40 components removed outright (Carousel, Rating, Steps, Stats, FileInput, …).

Expand Down Expand Up @@ -588,6 +639,48 @@ enablePopmotion((opts) => animate({ ...opts })); // ⚠️ WITHOUT this, all J
- Solid components: `<Presence when={open()}>{(isExiting, onExitComplete) => <MotionDiv initial animate exit isExiting={isExiting()} onExitComplete={onExitComplete}>…` — Presence force-unmounts after 800ms if `onExitComplete` never fires. `<AnimatedCollapse open duration=0.24>` for height collapse.
- `resolvePreset(name, {reduceMotion})` returns the `noMotion` preset under prefers-reduced-motion. Note Dialog/Toast/Drawer animate via CSS, not this system.

The root barrel and `@pathscale/ui/motion` subpath also export small browser
motion helpers:

```tsx
import {
animateElement,
createInView,
createScrollProgress,
springKeyframes,
stagger,
} from "@pathscale/ui/motion";

const visible = createInView(() => observedElement, { once: true });
const progress = createScrollProgress(() => section, {
range: "start-start/end-end",
});
const delay = stagger(index, 50); // milliseconds

const samples = springKeyframes({ stiffness: 180, damping: 20, mass: 1 });
const animation = animateElement(element, { opacity: samples }, {
duration: ((samples.length - 1) / 60) * 1000,
});
```

`createInView` and `createScrollProgress` return Solid accessors and attach
browser listeners only after mount. Visibility starts as `true` if the observer
is unavailable. Scroll progress starts at zero, samples scroll updates at most
once per animation frame, and also writes `--scroll-progress` to its target for
CSS. Its supported range tracks the target from viewport top to its bottom at
viewport bottom; the target's previous inline custom property is restored on
cleanup. `supportsViewTimeline()` checks the CSS timeline and attachment range
used by `ScrollHorizontal`.

`animateElement` uses WAAPI when available, defaults to the library's base
duration and `motionEasings.out`, and applies the final keyframe immediately when
WAAPI is unavailable. Its options follow WAAPI timing fields in milliseconds;
the returned `finished` promise resolves on completion or cancellation, and
`cancel()` stops the animation. Live reduced-motion changes finish an active
animation by default. `springKeyframes` returns normalized 60 Hz samples for a
WAAPI property; use `(samples.length - 1) / 60 * 1000` milliseconds as the
duration to preserve that sample rate.

## Streaming

```ts
Expand Down Expand Up @@ -639,6 +732,22 @@ token, with `@plugin "@iconify/tailwind4"` under Tailwind v4 or
than ours. Both sources inherit colour through `currentColor`, so `flavor` works
the same either way.

## QR codes

`QrCode` encodes `value` into one inline SVG. Its required `title` is both the
SVG title and its accessible name. Encoding is synchronous, so a changed value
updates the matrix immediately. `level` accepts `L`, `M`, `Q` or `H` and defaults
to `M`; `size` accepts a number of CSS pixels or another CSS length.

```tsx
import { QrCode } from "@pathscale/ui";

<QrCode value={otpauthUri} title="Authenticator setup QR code" size={192} />
```

For non-Solid use, `qrMatrix(value, level?)` returns the dark modules as a
`boolean[][]`.

## Dates

Calendar/DatePicker/RangeCalendar/DateRangePicker use the internal engine (native `Date`, a built-in name table, no `Intl` and no date lib). Values are `Date` objects; ranges are `{start: Date, end: Date}`. Controlled via `value/defaultValue/onChange`. `DateField`/`TimeField` are separate segmented text editors, not calendar-backed.
Expand Down
2 changes: 2 additions & 0 deletions layouts.library.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,13 @@
"PasswordRequirements",
"Popover",
"Progress",
"QrCode",
"RadialProgress",
"Radio",
"RadioGroup",
"RangeCalendar",
"ScrollArea",
"ScrollHorizontal",
"Select",
"Separator",
"SizePicker",
Expand Down
8 changes: 8 additions & 0 deletions src/component-families.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ export const componentFamilies = [
"id": "progress",
"name": "Progress"
},
{
"id": "qr-code",
"name": "QrCode"
},
{
"id": "radio",
"name": "Radio"
Expand All @@ -258,6 +262,10 @@ export const componentFamilies = [
"id": "scroll-area",
"name": "ScrollArea"
},
{
"id": "scroll-horizontal",
"name": "ScrollHorizontal"
},
{
"id": "select",
"name": "Select"
Expand Down
5 changes: 5 additions & 0 deletions src/components/qr-code/QrCode.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@layer components {
.qr-code {
display: block;
}
}
Loading
Loading