@simplix-react-ui-kits/site-core 0.1.0 → 0.1.1
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.
- package/README.md +4 -3
- package/dist/account/index.d.ts +1 -1
- package/dist/account/index.js +3 -3
- package/dist/action/index.d.ts +59 -3
- package/dist/action/index.js +82 -0
- package/dist/action/index.js.map +1 -1
- package/dist/checkout/index.d.ts +1 -1
- package/dist/checkout/index.js +1 -1
- package/dist/{chunk-BJUU2WTX.js → chunk-EELJOGWB.js} +12 -5
- package/dist/chunk-EELJOGWB.js.map +1 -0
- package/dist/{chunk-7K476KMZ.js → chunk-EOTYGKKM.js} +3 -3
- package/dist/{chunk-7K476KMZ.js.map → chunk-EOTYGKKM.js.map} +1 -1
- package/dist/{chunk-FKC262N4.js → chunk-EWBTUSZY.js} +9 -3
- package/dist/chunk-EWBTUSZY.js.map +1 -0
- package/dist/{chunk-5TFLOQT6.js → chunk-HRRP6HMF.js} +10 -5
- package/dist/chunk-HRRP6HMF.js.map +1 -0
- package/dist/{chunk-4KFQ26JW.js → chunk-HZGBIIGN.js} +27 -6
- package/dist/chunk-HZGBIIGN.js.map +1 -0
- package/dist/{chunk-JJQJFRBI.js → chunk-OWQVRM4W.js} +3 -3
- package/dist/{chunk-JJQJFRBI.js.map → chunk-OWQVRM4W.js.map} +1 -1
- package/dist/{chunk-6S23FFBB.js → chunk-TGG4ZKPG.js} +3 -3
- package/dist/{chunk-6S23FFBB.js.map → chunk-TGG4ZKPG.js.map} +1 -1
- package/dist/{chunk-JVMJF5JJ.js → chunk-UF2MDCWB.js} +5 -5
- package/dist/chunk-UF2MDCWB.js.map +1 -0
- package/dist/{chunk-EG6GE3YS.js → chunk-YXASVWY7.js} +3 -3
- package/dist/{chunk-EG6GE3YS.js.map → chunk-YXASVWY7.js.map} +1 -1
- package/dist/content/index.d.ts +95 -0
- package/dist/content/index.js +85 -0
- package/dist/content/index.js.map +1 -0
- package/dist/form/index.d.ts +229 -8
- package/dist/form/index.js +150 -10
- package/dist/form/index.js.map +1 -1
- package/dist/help/index.d.ts +1 -1
- package/dist/help/index.js +6 -6
- package/dist/install/index.d.ts +1 -1
- package/dist/install/index.js +4 -4
- package/dist/legal/index.d.ts +2 -2
- package/dist/legal/index.js +5 -5
- package/dist/link/index.d.ts +14 -1
- package/dist/link/index.js +8 -1
- package/dist/link/index.js.map +1 -1
- package/dist/marketing/index.d.ts +1 -1
- package/dist/page/index.d.ts +2 -2
- package/dist/page/index.js +4 -4
- package/dist/pricing/index.d.ts +1 -1
- package/dist/pricing/index.js +2 -2
- package/dist/shell/index.d.ts +1 -1
- package/dist/{site-action-B79fuwMb.d.ts → site-action-CPpf8JZl.d.ts} +1 -1
- package/dist/{site-page-Dl0A5T1N.d.ts → site-page-DKcjqh9y.d.ts} +7 -2
- package/package.json +10 -3
- package/src/action/action-tile.style.ts +63 -0
- package/src/action/action-tile.tsx +83 -0
- package/src/action/index.ts +11 -0
- package/src/content/content.style.ts +72 -0
- package/src/content/content.tsx +124 -0
- package/src/content/index.ts +12 -0
- package/src/form/choices.style.ts +16 -0
- package/src/form/choices.tsx +28 -5
- package/src/form/country-field.tsx +61 -0
- package/src/form/date-time.style.ts +26 -0
- package/src/form/date-time.tsx +123 -0
- package/src/form/dialog.style.ts +4 -2
- package/src/form/errors.tsx +16 -4
- package/src/form/form.style.ts +8 -0
- package/src/form/index.ts +11 -1
- package/src/form/phone-field.tsx +98 -0
- package/src/form/select.style.ts +6 -1
- package/src/form/select.tsx +13 -3
- package/src/form/signature.style.ts +20 -0
- package/src/form/signature.tsx +46 -0
- package/src/link/index.ts +1 -0
- package/src/link/mounted-href.ts +16 -0
- package/src/page/site-page.style.ts +13 -4
- package/src/page/site-page.tsx +8 -3
- package/src/styles/designs/base.css +121 -4
- package/templates/app-shell.hbs +5 -4
- package/dist/chunk-4KFQ26JW.js.map +0 -1
- package/dist/chunk-5TFLOQT6.js.map +0 -1
- package/dist/chunk-BJUU2WTX.js.map +0 -1
- package/dist/chunk-FKC262N4.js.map +0 -1
- package/dist/chunk-JVMJF5JJ.js.map +0 -1
- package/src/account/account.test.tsx +0 -186
- package/src/action/site-action.test.tsx +0 -154
- package/src/auth/auth.test.tsx +0 -132
- package/src/checkout/checkout.test.tsx +0 -187
- package/src/form/choices-field.test.tsx +0 -20
- package/src/form/errors.test.tsx +0 -49
- package/src/form/form.test.tsx +0 -275
- package/src/form/question-focus.test.ts +0 -182
- package/src/form/slider.test.tsx +0 -148
- package/src/form/typed-text.test.ts +0 -52
- package/src/help/article.test.tsx +0 -189
- package/src/help/help.test.tsx +0 -215
- package/src/help/screen-sketch.test.tsx +0 -59
- package/src/install/install.test.tsx +0 -177
- package/src/legal/legal.test.tsx +0 -161
- package/src/legal/policy.test.tsx +0 -137
- package/src/legal/refund.test.tsx +0 -148
- package/src/link/routes-in-page.test.ts +0 -26
- package/src/link/site-link.test.ts +0 -10
- package/src/marketing/marketing.test.tsx +0 -221
- package/src/page/site-failure.test.tsx +0 -65
- package/src/page/site-page.test.tsx +0 -109
- package/src/page/site-read.test.tsx +0 -41
- package/src/pricing/pack-card.test.tsx +0 -107
- package/src/pricing/pricing.test.tsx +0 -261
- package/src/shell/refusal-page.test.ts +0 -19
- package/src/shell/site-scheme-param.test.ts +0 -53
- package/src/shell/site-scheme-switch.test.ts +0 -80
- package/src/shell/site-scheme.test.ts +0 -149
- package/src/shell/site-shell.test.tsx +0 -401
- package/src/testing/markup.ts +0 -65
package/README.md
CHANGED
|
@@ -7,15 +7,16 @@ The parts every web site design shares: behaviour and markup, each element that
|
|
|
7
7
|
| `/account` | `AccountLayout` (the section list beside the section, stacked below the medium tier; `standing` takes a `NoticeBanner` that holds over every section), `SectionNav` (links with the current one as the page, a deleting section in the bad colour), `SectionHead` (h2, or h3 for a part), `SettingsRows` and `SettingsRow` (title with a chip, line, small actions), `SettingsBox` (a question on a card, plain or danger), `SettingsText`, `SettingsActions`, `IdentityRow` (round mark, name, line, chip), `SitePanel`, `PanelLine`, `QuotaMeter` (`shareWidth`), `DaySeries` (`dayHeight`), `TableCard` (first column bold, last at the end, `more` for a growing set) and `TableActions` |
|
|
8
8
|
| `/auth` | `AuthPage` (the sign-in server's ground outside the site window, `scheme="dark"` takes the dark values), `AuthCard` (the mark and the one h1), `AuthForm`, `AuthProviders`, `AuthOr`, `AuthText`, `AuthAlert`, `AuthLinks`, `AuthLink`, `AuthFieldHead`, `PasswordStrength`, `PasswordRules`, `AuthDoneMark`; the fields are `/form`'s (`SiteInput`, `CodeField`) |
|
|
9
9
|
| `/checkout` | `Stepper` (numbered discs joined by lines, the current one as the step, and the line under them), `CheckoutLayout` (our side beside the payment side, one column below the medium tier), `CheckoutHead`, `ChoiceCards` (offers, or a plan change with `size="sm"`; one Tab stop), `CheckoutRow`, `SavingTag`, `OrderSummary` (lines, the dashed tax line, the total in the display family), `ConsentChecklist` (agree to all, then each required consent with its document), `ConsentAgain`, `ProviderFrame` (the provider's frame on a dashed sunken ground with its name), `MethodGrid`, `ProgressChain` (paid to switched over), `DonePanel` (in a `SitePage rhythm="done"`) |
|
|
10
|
-
| `/
|
|
10
|
+
| `/content` | `SiteContentBody` (a formatted body a person wrote, the framework's viewer in the reading size; `empty` while there is none), `SiteScrollFrame` (a long body scrolling inside a named region with a tab stop, `sm` or `md`), `SiteMedia` (a video the product serves or an embedded page, in a site frame), `SiteMediaFailed` (the place of a video that cannot be played, a named picture), `SiteMediaProgress` (how far a video or a course was seen: a progress bar and its words) |
|
|
11
|
+
| `/form` | `FormField` (the name over the control, `muted` for a form inside a section), `FieldRow`, `FieldNote` (a hint or what is wrong, in the field's small print), `FieldInline`, `SiteInput`, `SiteTextarea`, `SiteCheckbox` (the framework checkbox; `required` with a badge for the eye only, `note` for a line under the words that describes the box), `SiteSwitch` (the framework switch), `RadioCards` (choices as cards, one Tab stop; a card whose title is a picture takes its accessible name as `name`), `SiteSelect` (the framework select; the trigger shows the chosen words itself, or an option's `short` form), `SitePhoneField` (the framework's phone number state: a calling code and the number in its country's form, kept as E.164; `SitePhoneControl`, `phoneCountryLabel`), `SiteCountryField` (the framework's countries as a select, with the country of the reader's time zone on offer; `SiteCountryControl`, `countrySelectOptions`, `countryOfBrowserZone`), `SiteDateField` and `SiteDateControl` (a day from the framework's calendar, its trigger on the control line), `SiteTimeField` and `SiteTimeControl` (a time of day in the framework's hour and minute boxes, empty while none is held), `SiteSignature` (the framework's signature pad in a site frame, written by hand or drawn from a typed name), `SiteSignatureImage` (a given signature for reading), `SitePhoneText` (a stored phone number for reading, in the form written across countries), `CodeField` (the framework `CodeInput`, one digit per cell), `ConfirmByTyping` (a question that goes ahead once a word is typed; `typedConfirms`), `SiteDialog` and `SiteDialogFrame` (the framework dialog as a site card), `SiteToasts` (the framework toast store drawn by the site; `SiteToastList`), `radioKeyTarget` and `radioTabStop` (how every site radio group walks). A part over a framework part keeps the framework's slot and carries the site name as its part mark (`partAttributes`), so the framework's keyboard and state stay and the site draws the look |
|
|
11
12
|
| `/help` | `SearchHero` (a band with the status line, the one h1, the lede, searches to try and the search), `StatusLine`, `SiteSearch` (a combobox whose matches open under it; the arrows move the active match and Enter opens it; `searchKeyTarget`), `CategoryGrid`, `ArticleList` (numbered rows with a badge on the heading), `SiteColumns`, and the way to ask support: `ContactPanel` (closed), `ContactForm` (the layout and its submit; the fields are the form segment's), `FormField` and `FieldRow` (from `/form`), `SuggestBox`, `AttachBox`, `ContactSent`; and the article: `ArticleIntro` (facts, where it applies, lead), `QuickBox`, `ArticleStep` (a numbered disc that ticks once the step is tried, and the tried toggle), `ArticleFigure`, `TipNote`, `DocSection`, `DocText`, `FeedbackPanel`, `RelatedLinks`, `DocProgress` |
|
|
12
13
|
| `/install` | `CheckCard` (a check of the reader's computer: idle with its action, running with a spinner, done with a chip per finding and the verdict; `checkPassed`), `DownloadGrid`, `DownloadCard` (title, needs, file, action; the highlighted one primary), `NoticeCard`, `InstallSteps` (numbered cards with a tag and a media slot), `ScreenSketch` (a drawn window with a progress bar, a pill or a code), `VideoCard` and `SiteProgress`, `DisclosureList` (questions that open one at a time to a cause, numbered steps and a `CopyBlock`), `NumberedList`, `ActionLine` |
|
|
13
14
|
| `/legal` | `DocLayout` (a document page: the trail, the one h1 with its badge, controls and notice, then the contents rail with ticks for tried steps and dots for changed sections and a side action, beside the sections; below the medium tier the rail spans the column and the product's jump control replaces its list), `LegalTable` (rows whose values carry their column's name on a narrow page), `NoticeBanner`, `VersionPicker` (the product's select and comparison switch, the switch dimmed while it cannot be used), `PrintButton`, `ChangeList`, `LegalArticle`, `PlainSummary`, `ClauseList`, `DiffText` (a clause written with `{+added+}` and `{-removed-}` marks, drawn as the current version, the previous one or the comparison; `diffVisible`, `diffChanged`), `FilledText` (a draft's unfilled `{fields}` drawn dashed), `KeyValues`, `InfoCard`, `InfoGrid` |
|
|
14
15
|
| `/link` | `SiteLinkProvider`, `SiteLink`, `useSiteLink`, `PlainSiteLink`: every site link is drawn with the router link the provider names, a plain anchor otherwise |
|
|
15
|
-
| `/action` | `SiteAction` (`SiteActionSpec`): a link when it opens an address, a button otherwise, and always a disabled button when disabled; `submit` makes it the form's submit button; `tone` primary, secondary, quiet, subtle (quiet in the muted ink) or danger (outlined in the bad colour), `size` md, sm or lg (a hero's), `block`, `pressed` for a toggle; a quiet or subtle action takes narrower side room for its size (`actionPad`) |
|
|
16
|
+
| `/action` | `SiteAction` (`SiteActionSpec`): a link when it opens an address, a button otherwise, and always a disabled button when disabled; `submit` makes it the form's submit button; `tone` primary, secondary, quiet, subtle (quiet in the muted ink) or danger (outlined in the bad colour), `size` md, sm or lg (a hero's), `block`, `pressed` for a toggle; a quiet or subtle action takes narrower side room for its size (`actionPad`), `SiteActionTile` and `SiteActionTiles` (a choice that goes on at once, pressed as a whole: its glyph, its title and what it is for) |
|
|
16
17
|
| `/shell` | `SiteWindow` (the `page` container, bar, main, footer; moves focus to the page when `page` changes), `SiteBar` (brand, page links with the current one, the visitor's `actions` in reading order or the signed-in account with its avatar, more menu below the narrow tier holding the pages and the actions marked `narrow: "menu"`, `tone="dark"`), `SiteFooter` (owner, legal links, language picker place, theme control place), `SiteBand` (a dark band), `useSiteScheme` (the reader's system, light or dark choice under `SITE_SCHEME_KEY`; `apply` draws the document in it) with `siteSchemeBootstrap()` (the head script that opens the page in that choice before the first paint), `avatarInitial`, `barMenuActions`, `menuKeyTarget` |
|
|
17
18
|
| `/marketing` | `HeroBand` (a band with the one h1, its accent line, lede, large actions, facts line and a media slot; `tone="dark"`), `PlayerCard` (choice, sentence, wave, play row), `PlayToggle`, `ReadAlong` (`readWordState`, `readWordAt`), `SiteWave` (bars from the product's levels, the share played), `SiteBars` (a picture of bars), `SampleRow` (a sample as one toggle: disc, name, meta, text or the product's wave while playing), `SampleList`, `SplitSection` (display heading and lede beside content), `NumberedSteps` (numbered cards with a media slot and a line of promises, `stepNumber`). The kit plays no audio: the product's player hands the parts its state |
|
|
18
|
-
| `/page` | `SitePage` (the column; `rhythm="spaced"` under a band that holds the page's head, `"open"` for a marketing page), `SitePageHead` (eyebrow, the one h1, lede), `SiteSection` (named by its h2, `size` md or lg), `SiteBreadcrumb` (its separator a glyph the product draws), `SiteChip` (a status in a tone, with a dot), `SiteBadge` (a small badge with a glyph, such as a draft mark), `SiteSpinner` (`size` sm beside a line, lg in a page's round mark while it waits), `SiteCaption`, `SiteLive` (a status only a screen reader reads), `SiteTextAction` (an action written as a link inside text: `link`, `inline` or `muted`); `rhythm` also takes `steps` (a purchase's steps) and `done` (a centred page after a step); `SiteFailure` (in a `SitePage rhythm="done"`: the round mark, quiet, bad or good, the one h1, what happened and the ways on, for an address the site has no page for, a page that failed, a session it cannot go on with, or the answer to a mailed link; `live` announces a sentence that arrives after the page opened); `SiteChip` has a `voice` tone; `SITE_CARD` and `SITE_CARD_GROUND` are the card ground other parts' styles build on |
|
|
19
|
+
| `/page` | `SitePage` (the column; `rhythm="spaced"` under a band that holds the page's head, `"open"` for a marketing page; `width="medium"` or `"narrow"` for a page that stays one column on every window), `SitePageHead` (eyebrow, the one h1, lede), `SiteSection` (named by its h2, `size` md or lg), `SiteBreadcrumb` (its separator a glyph the product draws), `SiteChip` (a status in a tone, with a dot), `SiteBadge` (a small badge with a glyph, such as a draft mark), `SiteSpinner` (`size` sm beside a line, lg in a page's round mark while it waits), `SiteCaption`, `SiteLive` (a status only a screen reader reads), `SiteTextAction` (an action written as a link inside text: `link`, `inline` or `muted`); `rhythm` also takes `steps` (a purchase's steps) and `done` (a centred page after a step); `SiteFailure` (in a `SitePage rhythm="done"`: the round mark, quiet, bad or good, the one h1, what happened and the ways on, for an address the site has no page for, a page that failed, a session it cannot go on with, or the answer to a mailed link; `live` announces a sentence that arrives after the page opened); `SiteChip` has a `voice` tone; `SITE_CARD` and `SITE_CARD_GROUND` are the card ground other parts' styles build on |
|
|
19
20
|
| `/pricing` | `SwitchRow`, `SegmentedSwitch` (a radio group walked with the arrows; `switchKeyTarget`), `PlanGrid`, `PlanCard` (name, price, unit, note, pitch, detail, features, highlight, current, actions), `FeatureList`, `OfferRow`, `PriceTable`, `QuestionList` |
|
|
20
21
|
|
|
21
22
|
The parts take plain props and name no product, endpoint or router: labels, addresses and handlers come from the product. A part writes no class; its look lives in its `.style.ts` declaration (`defineSlotStyle`), which the design kit's `design:css` turns into the stylesheet. `pnpm lint` runs `simplix-design-classes` (no look class on an element), `simplix-slot-spread`, the design literal check and `design:check`, which fails where `src/styles/designs/base.css` is behind the declarations. `tests/core` holds the checks of the contract and of the slot declarations as a whole; `tests/kit` is the suite every site design kit runs on itself (`pnpm test:kit` in the design kit), the site templates rendered by the CLI and type-checked against the kit.
|
package/dist/account/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, MouseEvent } from 'react';
|
|
3
|
-
import { S as SiteActionSpec } from '../site-action-
|
|
3
|
+
import { S as SiteActionSpec } from '../site-action-CPpf8JZl.js';
|
|
4
4
|
|
|
5
5
|
/** One section of {@link SectionNav}. */
|
|
6
6
|
interface SectionNavItem {
|
package/dist/account/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { siteSectionNavItemStyle, siteSectionNavStyle, siteAccountSectionStyle, siteAccountStyle, siteSectionHeadStyle, siteSettingsRowsStyle, siteSettingsRowTitleStyle, siteSettingsRowMetaStyle, siteSettingsRowTextStyle, siteSettingsRowActionsStyle, siteSettingsRowStyle, siteSettingsBoxStyle, siteSettingsTextStyle, siteSettingsActionsStyle, siteIdentityMarkStyle, siteIdentityNameStyle, siteIdentityMetaStyle, siteIdentityTextStyle, siteIdentityStyle } from '../chunk-
|
|
2
|
-
export { DaySeries, PanelLine, QuotaMeter, SitePanel, TableActions, TableCard, dayHeight, shareWidth } from '../chunk-
|
|
1
|
+
import { siteSectionNavItemStyle, siteSectionNavStyle, siteAccountSectionStyle, siteAccountStyle, siteSectionHeadStyle, siteSettingsRowsStyle, siteSettingsRowTitleStyle, siteSettingsRowMetaStyle, siteSettingsRowTextStyle, siteSettingsRowActionsStyle, siteSettingsRowStyle, siteSettingsBoxStyle, siteSettingsTextStyle, siteSettingsActionsStyle, siteIdentityMarkStyle, siteIdentityNameStyle, siteIdentityMetaStyle, siteIdentityTextStyle, siteIdentityStyle } from '../chunk-OWQVRM4W.js';
|
|
2
|
+
export { DaySeries, PanelLine, QuotaMeter, SitePanel, TableActions, TableCard, dayHeight, shareWidth } from '../chunk-OWQVRM4W.js';
|
|
3
3
|
import { nameByFirstHeading, useQuestionFocus, holdDroppedFocus } from '../chunk-N7CJCCWU.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-EELJOGWB.js';
|
|
5
5
|
import { SiteAction } from '../chunk-47HQIB4J.js';
|
|
6
6
|
import { SiteLink } from '../chunk-MR5ZALXA.js';
|
|
7
7
|
import { useRef, useEffect, useId } from 'react';
|
package/dist/action/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as SiteReason } from '../site-action-CPpf8JZl.js';
|
|
2
|
+
export { b as SiteAction, c as SiteActionBase, d as SiteActionProps, S as SiteActionSpec, e as SiteActionState, f as SiteActionTone, g as SiteRefusal, u as useRefusal } from '../site-action-CPpf8JZl.js';
|
|
2
3
|
import * as _simplix_react_ui_design from '@simplix-react/ui/design';
|
|
3
|
-
import 'react';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* A site action: a link or a button drawn as a pressable box. `tone` says how strongly it asks to be
|
|
@@ -52,4 +54,58 @@ declare const siteActionStyle: _simplix_react_ui_design.SlotStyle<{
|
|
|
52
54
|
*/
|
|
53
55
|
declare const siteActionReasonStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
/** Props for {@link SiteActionTile}. */
|
|
58
|
+
interface SiteActionTileProps {
|
|
59
|
+
/** A stable name among the tiles of one list. */
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly title: ReactNode;
|
|
62
|
+
/** What the choice is for, under the title. */
|
|
63
|
+
readonly body?: ReactNode;
|
|
64
|
+
/** A glyph before the words, which the product draws. */
|
|
65
|
+
readonly icon?: ReactNode;
|
|
66
|
+
/** The glyph at the end that says the tile leads on (a chevron), which the product draws. */
|
|
67
|
+
readonly trail?: ReactNode;
|
|
68
|
+
readonly onSelect: () => void;
|
|
69
|
+
/** The choice was made on an earlier pass through the step: the tile says it is the one. */
|
|
70
|
+
readonly pressed?: boolean;
|
|
71
|
+
/** The tile cannot be pressed now; give `reason` with it. */
|
|
72
|
+
readonly disabled?: boolean;
|
|
73
|
+
/** Why it cannot be pressed now, drawn for a screen reader unless `describedBy` names a line. */
|
|
74
|
+
readonly reason?: SiteReason;
|
|
75
|
+
/** The id of the line on the page that says why the tile waits. */
|
|
76
|
+
readonly describedBy?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A choice that goes on at once: a tile pressed as a whole, with its glyph, its title and what it
|
|
80
|
+
* is for (a kind of visit, whether the host's number is known). A choice held until a later save
|
|
81
|
+
* is a radio card instead.
|
|
82
|
+
*/
|
|
83
|
+
declare function SiteActionTile({ id, title, body, icon, trail, onSelect, pressed, disabled, reason, describedBy }: SiteActionTileProps): react.JSX.Element;
|
|
84
|
+
/** Props for {@link SiteActionTiles}. */
|
|
85
|
+
interface SiteActionTilesProps {
|
|
86
|
+
readonly children: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
/** Tiles one under the other. */
|
|
89
|
+
declare function SiteActionTiles({ children }: SiteActionTilesProps): react.JSX.Element;
|
|
90
|
+
|
|
91
|
+
/** Tiles one under the other. */
|
|
92
|
+
declare const siteActionTilesStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
93
|
+
/** A choice that goes on at once, pressed as a whole: on the accent's soft ground once it was made. */
|
|
94
|
+
declare const siteActionTileStyle: _simplix_react_ui_design.SlotStyle<{
|
|
95
|
+
pressed: {
|
|
96
|
+
true: string;
|
|
97
|
+
false: string;
|
|
98
|
+
};
|
|
99
|
+
}>;
|
|
100
|
+
/** The glyph before a tile's words. */
|
|
101
|
+
declare const siteActionTileIconStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
102
|
+
/** A tile's title over what it is for. */
|
|
103
|
+
declare const siteActionTileWordsStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
104
|
+
/** A tile's title. */
|
|
105
|
+
declare const siteActionTileTitleStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
106
|
+
/** What a tile is for, muted. */
|
|
107
|
+
declare const siteActionTileBodyStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
108
|
+
/** The glyph at a tile's end that says it leads on. */
|
|
109
|
+
declare const siteActionTileTrailStyle: _simplix_react_ui_design.SlotStyle<{}>;
|
|
110
|
+
|
|
111
|
+
export { SiteActionTile, type SiteActionTileProps, SiteActionTiles, type SiteActionTilesProps, SiteReason, siteActionReasonStyle, siteActionStyle, siteActionTileBodyStyle, siteActionTileIconStyle, siteActionTileStyle, siteActionTileTitleStyle, siteActionTileTrailStyle, siteActionTileWordsStyle, siteActionTilesStyle };
|
package/dist/action/index.js
CHANGED
|
@@ -1,4 +1,86 @@
|
|
|
1
|
+
import { useRefusal } from '../chunk-47HQIB4J.js';
|
|
1
2
|
export { SiteAction, siteActionReasonStyle, siteActionStyle, useRefusal } from '../chunk-47HQIB4J.js';
|
|
2
3
|
import '../chunk-MR5ZALXA.js';
|
|
4
|
+
import { defineSlotStyle, slotAttributes } from '@simplix-react/ui/design';
|
|
5
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var siteActionTilesStyle = defineSlotStyle({
|
|
8
|
+
slot: "site-action-tiles",
|
|
9
|
+
base: "flex min-w-0 flex-col gap-2.5",
|
|
10
|
+
variants: {},
|
|
11
|
+
defaultVariants: {}
|
|
12
|
+
});
|
|
13
|
+
var siteActionTileStyle = defineSlotStyle({
|
|
14
|
+
slot: "site-action-tile",
|
|
15
|
+
base: "flex w-full min-w-0 cursor-pointer items-center gap-3 rounded-(--site-radius-lg) border px-3.5 py-3 text-left font-(family-name:--site-font-sans) text-(--site-ink) outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:opacity-(--site-dim)",
|
|
16
|
+
variants: {
|
|
17
|
+
pressed: {
|
|
18
|
+
true: "border-(--site-accent) bg-(--site-accent-soft)",
|
|
19
|
+
false: "border-(--site-line) bg-(--site-surface) hover:border-(--site-control-line)"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { pressed: false }
|
|
23
|
+
});
|
|
24
|
+
var siteActionTileIconStyle = defineSlotStyle({
|
|
25
|
+
slot: "site-action-tile-icon",
|
|
26
|
+
base: "inline-grid shrink-0 place-items-center text-(--site-accent-text) [&_svg]:size-6",
|
|
27
|
+
variants: {},
|
|
28
|
+
defaultVariants: {}
|
|
29
|
+
});
|
|
30
|
+
var siteActionTileWordsStyle = defineSlotStyle({
|
|
31
|
+
slot: "site-action-tile-words",
|
|
32
|
+
base: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
33
|
+
variants: {},
|
|
34
|
+
defaultVariants: {}
|
|
35
|
+
});
|
|
36
|
+
var siteActionTileTitleStyle = defineSlotStyle({
|
|
37
|
+
slot: "site-action-tile-title",
|
|
38
|
+
base: "min-w-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) font-(--site-fw-strong)",
|
|
39
|
+
variants: {},
|
|
40
|
+
defaultVariants: {}
|
|
41
|
+
});
|
|
42
|
+
var siteActionTileBodyStyle = defineSlotStyle({
|
|
43
|
+
slot: "site-action-tile-body",
|
|
44
|
+
base: "min-w-0 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)",
|
|
45
|
+
variants: {},
|
|
46
|
+
defaultVariants: {}
|
|
47
|
+
});
|
|
48
|
+
var siteActionTileTrailStyle = defineSlotStyle({
|
|
49
|
+
slot: "site-action-tile-trail",
|
|
50
|
+
base: "inline-grid shrink-0 place-items-center text-(--site-ink-muted) [&_svg]:size-5",
|
|
51
|
+
variants: {},
|
|
52
|
+
defaultVariants: {}
|
|
53
|
+
});
|
|
54
|
+
function SiteActionTile({ id, title, body, icon, trail, onSelect, pressed, disabled = false, reason, describedBy }) {
|
|
55
|
+
const refusal = useRefusal(disabled, reason, describedBy);
|
|
56
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
|
+
/* @__PURE__ */ jsxs(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
...slotAttributes(siteActionTileStyle, { pressed: pressed === true }),
|
|
61
|
+
"data-action": id,
|
|
62
|
+
type: "button",
|
|
63
|
+
disabled,
|
|
64
|
+
"aria-pressed": pressed,
|
|
65
|
+
"aria-describedby": refusal.describedBy,
|
|
66
|
+
onClick: onSelect,
|
|
67
|
+
children: [
|
|
68
|
+
icon !== void 0 ? /* @__PURE__ */ jsx("span", { ...slotAttributes(siteActionTileIconStyle, {}), "aria-hidden": "true", children: icon }) : null,
|
|
69
|
+
/* @__PURE__ */ jsxs("span", { ...slotAttributes(siteActionTileWordsStyle, {}), children: [
|
|
70
|
+
/* @__PURE__ */ jsx("span", { ...slotAttributes(siteActionTileTitleStyle, {}), children: title }),
|
|
71
|
+
body !== void 0 ? /* @__PURE__ */ jsx("span", { ...slotAttributes(siteActionTileBodyStyle, {}), children: body }) : null
|
|
72
|
+
] }),
|
|
73
|
+
trail !== void 0 ? /* @__PURE__ */ jsx("span", { ...slotAttributes(siteActionTileTrailStyle, {}), "aria-hidden": "true", children: trail }) : null
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
refusal.hidden
|
|
78
|
+
] });
|
|
79
|
+
}
|
|
80
|
+
function SiteActionTiles({ children }) {
|
|
81
|
+
return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteActionTilesStyle, {}), children });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { SiteActionTile, SiteActionTiles, siteActionTileBodyStyle, siteActionTileIconStyle, siteActionTileStyle, siteActionTileTitleStyle, siteActionTileTrailStyle, siteActionTileWordsStyle, siteActionTilesStyle };
|
|
3
85
|
//# sourceMappingURL=index.js.map
|
|
4
86
|
//# sourceMappingURL=index.js.map
|
package/dist/action/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/action/action-tile.style.ts","../../src/action/action-tile.tsx"],"names":[],"mappings":";;;;;;AAGO,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EAAM,+BAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,sBAAsB,eAAA,CAAgB;AAAA,EACj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A,CAAC,SAAK,GAAG,cAAA,CAAe,sBAAsB,EAAE,GAAI,QAAA,EAAS,CAAA;AACtE","file":"index.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/** Tiles one under the other. */\nexport const siteActionTilesStyle = defineSlotStyle({\n slot: \"site-action-tiles\",\n base: \"flex min-w-0 flex-col gap-2.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A choice that goes on at once, pressed as a whole: on the accent's soft ground once it was made. */\nexport const siteActionTileStyle = defineSlotStyle({\n slot: \"site-action-tile\",\n base:\n \"flex w-full min-w-0 cursor-pointer items-center gap-3 rounded-(--site-radius-lg) border px-3.5 py-3 text-left font-(family-name:--site-font-sans) text-(--site-ink) outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:opacity-(--site-dim)\",\n variants: {\n pressed: {\n true: \"border-(--site-accent) bg-(--site-accent-soft)\",\n false: \"border-(--site-line) bg-(--site-surface) hover:border-(--site-control-line)\",\n },\n },\n defaultVariants: { pressed: false },\n});\n\n/** The glyph before a tile's words. */\nexport const siteActionTileIconStyle = defineSlotStyle({\n slot: \"site-action-tile-icon\",\n base: \"inline-grid shrink-0 place-items-center text-(--site-accent-text) [&_svg]:size-6\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A tile's title over what it is for. */\nexport const siteActionTileWordsStyle = defineSlotStyle({\n slot: \"site-action-tile-words\",\n base: \"flex min-w-0 flex-1 flex-col gap-0.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A tile's title. */\nexport const siteActionTileTitleStyle = defineSlotStyle({\n slot: \"site-action-tile-title\",\n base: \"min-w-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** What a tile is for, muted. */\nexport const siteActionTileBodyStyle = defineSlotStyle({\n slot: \"site-action-tile-body\",\n base: \"min-w-0 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The glyph at a tile's end that says it leads on. */\nexport const siteActionTileTrailStyle = defineSlotStyle({\n slot: \"site-action-tile-trail\",\n base: \"inline-grid shrink-0 place-items-center text-(--site-ink-muted) [&_svg]:size-5\",\n variants: {},\n defaultVariants: {},\n});\n","import type { ReactNode } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { useRefusal, type SiteReason } from \"./site-action\";\nimport {\n siteActionTileBodyStyle,\n siteActionTileIconStyle,\n siteActionTileStyle,\n siteActionTilesStyle,\n siteActionTileTitleStyle,\n siteActionTileTrailStyle,\n siteActionTileWordsStyle,\n} from \"./action-tile.style\";\n\n/** Props for {@link SiteActionTile}. */\nexport interface SiteActionTileProps {\n /** A stable name among the tiles of one list. */\n readonly id: string;\n readonly title: ReactNode;\n /** What the choice is for, under the title. */\n readonly body?: ReactNode;\n /** A glyph before the words, which the product draws. */\n readonly icon?: ReactNode;\n /** The glyph at the end that says the tile leads on (a chevron), which the product draws. */\n readonly trail?: ReactNode;\n readonly onSelect: () => void;\n /** The choice was made on an earlier pass through the step: the tile says it is the one. */\n readonly pressed?: boolean;\n /** The tile cannot be pressed now; give `reason` with it. */\n readonly disabled?: boolean;\n /** Why it cannot be pressed now, drawn for a screen reader unless `describedBy` names a line. */\n readonly reason?: SiteReason;\n /** The id of the line on the page that says why the tile waits. */\n readonly describedBy?: string;\n}\n\n/**\n * A choice that goes on at once: a tile pressed as a whole, with its glyph, its title and what it\n * is for (a kind of visit, whether the host's number is known). A choice held until a later save\n * is a radio card instead.\n */\nexport function SiteActionTile({ id, title, body, icon, trail, onSelect, pressed, disabled = false, reason, describedBy }: SiteActionTileProps) {\n const refusal = useRefusal(disabled, reason, describedBy);\n return (\n <>\n <button\n {...slotAttributes(siteActionTileStyle, { pressed: pressed === true })}\n data-action={id}\n type=\"button\"\n disabled={disabled}\n aria-pressed={pressed}\n aria-describedby={refusal.describedBy}\n onClick={onSelect}\n >\n {icon !== undefined ? (\n <span {...slotAttributes(siteActionTileIconStyle, {})} aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span {...slotAttributes(siteActionTileWordsStyle, {})}>\n <span {...slotAttributes(siteActionTileTitleStyle, {})}>{title}</span>\n {body !== undefined ? <span {...slotAttributes(siteActionTileBodyStyle, {})}>{body}</span> : null}\n </span>\n {trail !== undefined ? (\n <span {...slotAttributes(siteActionTileTrailStyle, {})} aria-hidden=\"true\">\n {trail}\n </span>\n ) : null}\n </button>\n {refusal.hidden}\n </>\n );\n}\n\n/** Props for {@link SiteActionTiles}. */\nexport interface SiteActionTilesProps {\n readonly children: ReactNode;\n}\n\n/** Tiles one under the other. */\nexport function SiteActionTiles({ children }: SiteActionTilesProps) {\n return <div {...slotAttributes(siteActionTilesStyle, {})}>{children}</div>;\n}\n"]}
|
package/dist/checkout/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { S as SiteActionSpec } from '../site-action-
|
|
3
|
+
import { S as SiteActionSpec } from '../site-action-CPpf8JZl.js';
|
|
4
4
|
|
|
5
5
|
/** One choice of {@link ChoiceCards}. */
|
|
6
6
|
interface ChoiceCardOption<T extends string> {
|
package/dist/checkout/index.js
CHANGED
|
@@ -3,8 +3,15 @@ import { defineSlotStyle } from '@simplix-react/ui/design';
|
|
|
3
3
|
// src/page/site-page.style.ts
|
|
4
4
|
var sitePageStyle = defineSlotStyle({
|
|
5
5
|
slot: "site-page",
|
|
6
|
-
base: "mx-auto flex w-full min-w-0
|
|
6
|
+
base: "mx-auto flex w-full min-w-0 flex-col px-6 @max-page-narrow/page:px-4",
|
|
7
7
|
variants: {
|
|
8
|
+
// How wide the column grows: the wide tier for a page of sections, a narrower tier for a page
|
|
9
|
+
// that is one column of fields or rows on every window (a flow made for a phone).
|
|
10
|
+
width: {
|
|
11
|
+
wide: "max-w-(--site-page-wide)",
|
|
12
|
+
medium: "max-w-(--site-page-medium)",
|
|
13
|
+
narrow: "max-w-(--site-page-narrow)"
|
|
14
|
+
},
|
|
8
15
|
rhythm: {
|
|
9
16
|
page: "gap-5 py-8 @max-page-narrow/page:py-5",
|
|
10
17
|
spaced: "gap-6 py-8",
|
|
@@ -13,7 +20,7 @@ var sitePageStyle = defineSlotStyle({
|
|
|
13
20
|
done: "items-center gap-5 py-16 text-center @max-page-narrow/page:py-5"
|
|
14
21
|
}
|
|
15
22
|
},
|
|
16
|
-
defaultVariants: { rhythm: "page" }
|
|
23
|
+
defaultVariants: { rhythm: "page", width: "wide" }
|
|
17
24
|
});
|
|
18
25
|
var sitePageHeadStyle = defineSlotStyle({
|
|
19
26
|
slot: "site-page-head",
|
|
@@ -156,7 +163,7 @@ var siteBadgeStyle = defineSlotStyle({
|
|
|
156
163
|
});
|
|
157
164
|
var siteTextActionStyle = defineSlotStyle({
|
|
158
165
|
slot: "site-text-action",
|
|
159
|
-
base: "cursor-pointer rounded-(--site-radius-xs) border-0 bg-transparent p-0 text-left font-(family-name:--site-font-sans) underline-offset-2 outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:text-(--site-ink-muted) disabled:no-underline",
|
|
166
|
+
base: "relative cursor-pointer rounded-(--site-radius-xs) border-0 bg-transparent p-0 text-left font-(family-name:--site-font-sans) underline-offset-2 outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:text-(--site-ink-muted) disabled:no-underline after:absolute after:top-1/2 after:left-1/2 after:h-full after:min-h-6 after:w-full after:min-w-6 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']",
|
|
160
167
|
variants: {
|
|
161
168
|
kind: {
|
|
162
169
|
link: "font-(--site-fw-strong) text-(--site-accent-text) no-underline hover:underline",
|
|
@@ -168,5 +175,5 @@ var siteTextActionStyle = defineSlotStyle({
|
|
|
168
175
|
});
|
|
169
176
|
|
|
170
177
|
export { SITE_CARD, SITE_CARD_GROUND, siteBadgeStyle, siteBreadcrumbItemStyle, siteBreadcrumbLinkStyle, siteBreadcrumbListStyle, siteBreadcrumbSeparatorStyle, siteBreadcrumbStyle, siteCaptionStyle, siteChipDotStyle, siteChipStyle, siteLiveStyle, sitePageEyebrowStyle, sitePageHeadStyle, sitePageLedeStyle, sitePageStyle, sitePageTitleStyle, siteSectionHeadingStyle, siteSectionLedeStyle, siteSectionStyle, siteSpinnerStyle, siteTextActionStyle };
|
|
171
|
-
//# sourceMappingURL=chunk-
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-EELJOGWB.js.map
|
|
179
|
+
//# sourceMappingURL=chunk-EELJOGWB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/page/site-page.style.ts"],"names":[],"mappings":";;;AAQO,IAAM,gBAAgB,eAAA,CAAgB;AAAA,EAC3C,IAAA,EAAM,WAAA;AAAA,EACN,IAAA,EAAM,sEAAA;AAAA,EACN,QAAA,EAAU;AAAA;AAAA;AAAA,IAGR,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,0BAAA;AAAA,MACN,MAAA,EAAQ,4BAAA;AAAA,MACR,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,uCAAA;AAAA,MACN,MAAA,EAAQ,YAAA;AAAA,MACR,IAAA,EAAM,aAAA;AAAA,MACN,KAAA,EAAO,uCAAA;AAAA,MACP,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,MAAA,EAAQ,MAAA,EAAQ,OAAO,MAAA;AAC5C,CAAC;AAGM,IAAM,oBAAoB,eAAA,CAAgB;AAAA,EAC/C,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,+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3B,CAAC","file":"chunk-EELJOGWB.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/**\n * The page column: centred, no wider than the wide tier, its regions one gap apart. A narrow page\n * keeps a smaller side room so the content gets the width. `rhythm=\"spaced\"` spaces the parts under a\n * band that holds the page's head (the help centre's search); `open` spaces the sections of a\n * marketing page further apart, under a hero.\n */\nexport const sitePageStyle = defineSlotStyle({\n slot: \"site-page\",\n base: \"mx-auto flex w-full min-w-0 flex-col px-6 @max-page-narrow/page:px-4\",\n variants: {\n // How wide the column grows: the wide tier for a page of sections, a narrower tier for a page\n // that is one column of fields or rows on every window (a flow made for a phone).\n width: {\n wide: \"max-w-(--site-page-wide)\",\n medium: \"max-w-(--site-page-medium)\",\n narrow: \"max-w-(--site-page-narrow)\",\n },\n rhythm: {\n page: \"gap-5 py-8 @max-page-narrow/page:py-5\",\n spaced: \"gap-6 py-8\",\n open: \"gap-8 py-10\",\n steps: \"gap-4 py-8 @max-page-narrow/page:py-5\",\n done: \"items-center gap-5 py-16 text-center @max-page-narrow/page:py-5\",\n },\n },\n defaultVariants: { rhythm: \"page\", width: \"wide\" },\n});\n\n/** The page's head: an optional eyebrow, the title and the lede. */\nexport const sitePageHeadStyle = defineSlotStyle({\n slot: \"site-page-head\",\n base: \"flex min-w-0 flex-col gap-1.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A short line above the title naming the page's group. */\nexport const sitePageEyebrowStyle = defineSlotStyle({\n slot: \"site-page-eyebrow\",\n base: \"text-(length:--site-fs-label) leading-(--site-lh-label) font-(--site-fw-strong) tracking-(--site-tracking-label) text-(--site-ink-muted) uppercase\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The page's title, in the display family. */\nexport const sitePageTitleStyle = defineSlotStyle({\n slot: \"site-page-title\",\n base:\n \"m-0 text-balance font-(family-name:--site-font-display) text-(length:--site-fs-title) leading-(--site-lh-title) font-(--site-fw-title) tracking-(--site-tracking-display)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The sentence under the title saying what the page is for. */\nexport const sitePageLedeStyle = defineSlotStyle({\n slot: \"site-page-lede\",\n base: \"m-0 text-(length:--site-fs-body) leading-(--site-lh-body) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A section of a page: its heading, an optional lede, then its body. */\nexport const siteSectionStyle = defineSlotStyle({\n slot: \"site-section\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/**\n * A section's heading. `size=\"md\"` is a plain heading in the text family; `lg` opens a part of the\n * page in the display family, as a set of offers below the plans does.\n */\nexport const siteSectionHeadingStyle = defineSlotStyle({\n slot: \"site-section-heading\",\n base: \"m-0\",\n variants: {\n size: {\n md: \"text-(length:--site-fs-subheading) leading-(--site-lh-subheading) font-(--site-fw-strong)\",\n lg: \"font-(family-name:--site-font-display) text-(length:--site-fs-headline) leading-(--site-lh-headline) font-(--site-fw-title) tracking-(--site-tracking-display)\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\n/** The sentence under a section's heading. */\nexport const siteSectionLedeStyle = defineSlotStyle({\n slot: \"site-section-lede\",\n base: \"m-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The trail from the site's top to the page shown. */\nexport const siteBreadcrumbStyle = defineSlotStyle({\n slot: \"site-breadcrumb\",\n base: \"flex min-w-0 flex-wrap items-center gap-1.5 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The trail's list, one row that wraps. */\nexport const siteBreadcrumbListStyle = defineSlotStyle({\n slot: \"site-breadcrumb-list\",\n base: \"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One step of the trail; the page shown is the last, in full ink. */\nexport const siteBreadcrumbItemStyle = defineSlotStyle({\n slot: \"site-breadcrumb-item\",\n base: \"flex min-w-0 items-center\",\n variants: {\n current: {\n true: \"\",\n false: \"\",\n },\n },\n defaultVariants: { current: false },\n});\n\n/** A step's link to the page it names. */\nexport const siteBreadcrumbLinkStyle = defineSlotStyle({\n slot: \"site-breadcrumb-link\",\n base:\n \"cursor-pointer rounded-(--site-radius-xs) font-(--site-fw-base) text-inherit no-underline underline-offset-2 outline-none hover:underline focus-visible:shadow-[var(--site-focus-ring)]\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The mark between two steps. */\nexport const siteBreadcrumbSeparatorStyle = defineSlotStyle({\n slot: \"site-breadcrumb-separator\",\n base: \"flex items-center text-(--site-ink-muted) [&_svg]:size-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/**\n * The card most page parts stand on: a hairline box on the surface with its content one gap apart.\n * Parts that are cards draw their own slot with this ground, so a region can be found by its slot. A\n * class that changes what the ground sets (its direction, its outline) is never appended to it in the\n * same base, where the stylesheet's order and not the class order decides; it goes in a variant.\n */\nexport const SITE_CARD_GROUND = \"gap-3 rounded-(--site-radius-xl) border border-(--site-line) bg-(--site-surface) px-4 py-3.5\";\n/** The card with its content one under the other. */\nexport const SITE_CARD = `flex min-w-0 flex-col ${SITE_CARD_GROUND}`;\n\n/** A status in one to three words, on its tone's soft ground (`voice` for something of the reader's own voice); `dot` adds a still dot in the tone's colour. */\nexport const siteChipStyle = defineSlotStyle({\n slot: \"site-chip\",\n base:\n \"inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-(--site-radius-full) px-2 font-(family-name:--site-font-sans) text-(length:--site-fs-label) leading-none font-(--site-fw-strong) tracking-(--site-tracking-label)\",\n variants: {\n tone: {\n neutral: \"bg-(--site-surface-sunken) text-(--site-ink-muted)\",\n accent: \"bg-(--site-accent-soft) text-(--site-accent-text)\",\n good: \"bg-(--site-good-soft) text-(--site-good)\",\n warn: \"bg-(--site-warn-soft) text-(--site-warn)\",\n bad: \"bg-(--site-bad-soft) text-(--site-bad)\",\n voice: \"bg-(--site-voice-soft) text-(--site-voice-text)\",\n },\n },\n defaultVariants: { tone: \"neutral\" },\n});\n\n/** The dot of a chip, in the chip's colour. */\nexport const siteChipDotStyle = defineSlotStyle({\n slot: \"site-chip-dot\",\n base: \"block size-1.5 shrink-0 rounded-(--site-radius-full) bg-current\",\n variants: {},\n defaultVariants: {},\n});\n\n/**\n * A ring that turns while something runs: small and in the words' colour beside a line, large and in\n * the accent inside a page's round mark while the page waits for its answer.\n */\nexport const siteSpinnerStyle = defineSlotStyle({\n slot: \"site-spinner\",\n base: \"inline-block shrink-0 animate-spin rounded-(--site-radius-full) border-2 motion-reduce:animate-none\",\n variants: {\n size: {\n sm: \"size-3 border-current border-r-transparent\",\n lg: \"size-6 border-(--site-accent) border-t-transparent\",\n },\n },\n defaultVariants: { size: \"sm\" },\n});\n\n/** A small muted line under a part: where to go next, what to do if stuck. */\nexport const siteCaptionStyle = defineSlotStyle({\n slot: \"site-caption\",\n base: \"m-0 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Words read only by a screen reader: a status line that speaks each change. */\nexport const siteLiveStyle = defineSlotStyle({\n slot: \"site-live\",\n base: \"sr-only\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A small badge in a tone with its glyph, such as a draft mark beside a title. */\nexport const siteBadgeStyle = defineSlotStyle({\n slot: \"site-badge\",\n base:\n \"inline-flex items-center gap-1 rounded-(--site-radius-full) px-2 py-0.5 text-(length:--site-fs-label) leading-(--site-lh-label) font-(--site-fw-strong) tracking-(--site-tracking-label) [&_svg]:size-3\",\n variants: {\n tone: {\n neutral: \"bg-(--site-surface-sunken) text-(--site-ink-muted)\",\n warn: \"bg-(--site-warn-soft) text-(--site-warn)\",\n },\n },\n defaultVariants: { tone: \"neutral\" },\n});\n\n/**\n * An action written as a link inside text. `link` is the accent's words, underlined under the pointer\n * (another step, a document); `inline` stays underlined and takes the soft ground under the pointer,\n * inside a sentence of muted words; `muted` is underlined muted words that darken under the pointer\n * (a way back, a view of a document beside a consent). The words are as small as the text they stand\n * in, so the area that takes a press is widened under them to the smallest target a finger hits,\n * centred on the words and drawn as nothing.\n */\nexport const siteTextActionStyle = defineSlotStyle({\n slot: \"site-text-action\",\n base:\n \"relative cursor-pointer rounded-(--site-radius-xs) border-0 bg-transparent p-0 text-left font-(family-name:--site-font-sans) underline-offset-2 outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:text-(--site-ink-muted) disabled:no-underline after:absolute after:top-1/2 after:left-1/2 after:h-full after:min-h-6 after:w-full after:min-w-6 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']\",\n variants: {\n kind: {\n link: \"font-(--site-fw-strong) text-(--site-accent-text) no-underline hover:underline\",\n inline: \"font-(--site-fw-strong) text-(--site-accent-text) underline hover:bg-(--site-accent-soft)\",\n muted: \"text-(--site-ink-muted) underline hover:text-(--site-ink)\",\n },\n },\n defaultVariants: { kind: \"link\" },\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { siteChipDotStyle, siteChipStyle, siteSpinnerStyle, siteCaptionStyle, siteLiveStyle, siteBadgeStyle, siteTextActionStyle } from './chunk-
|
|
1
|
+
import { siteChipDotStyle, siteChipStyle, siteSpinnerStyle, siteCaptionStyle, siteLiveStyle, siteBadgeStyle, siteTextActionStyle } from './chunk-EELJOGWB.js';
|
|
2
2
|
import { useRefusal } from './chunk-47HQIB4J.js';
|
|
3
3
|
import { SiteLink } from './chunk-MR5ZALXA.js';
|
|
4
4
|
import { slotAttributes } from '@simplix-react/ui/design';
|
|
@@ -38,5 +38,5 @@ function SiteTextAction({ children, href, onSelect, disabled = false, reason, na
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export { SiteBadge, SiteCaption, SiteChip, SiteLive, SiteSpinner, SiteTextAction };
|
|
41
|
-
//# sourceM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B,EAAE,MAAM,CAAA;AAC1D,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,QAAA,EAAU,MAAA,EAAQ,WAAW,CAAA;AACxD,EAAA,IAAI,IAAA,KAAS,MAAA,IAAa,CAAC,QAAA,EAAU;AACnC,IAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,KAAA,EAAO,IAAA,EAAY,OAAA,EAAS,QAAA,EAAU,YAAA,EAAY,IAAA,EAAM,kBAAA,EAAkB,WAAA,EACrF,QAAA,EACH,CAAA;AAAA,EAEJ;AACA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,QAAA,EAAA,EAAQ,GAAG,KAAA,EAAO,IAAA,EAAK,QAAA,EAAS,QAAA,EAAoB,YAAA,EAAY,IAAA,EAAM,kBAAA,EAAkB,OAAA,CAAQ,WAAA,EAAa,OAAA,EAAS,UACpH,QAAA,EACH,CAAA;AAAA,IACC,OAAA,CAAQ;AAAA,GAAA,EACX,CAAA;AAEJ","file":"chunk-EOTYGKKM.js","sourcesContent":["import type { MouseEvent, ReactNode } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { type SiteActionState, useRefusal } from \"../action/site-action\";\nimport { SiteLink } from \"../link/site-link\";\nimport { siteBadgeStyle, siteCaptionStyle, siteChipDotStyle, siteChipStyle, siteLiveStyle, siteSpinnerStyle, siteTextActionStyle } from \"./site-page.style\";\n\n/** How a {@link SiteChip} reads: plain, the accent, or a state that went well, needs care or failed. */\nexport type SiteChipTone = \"neutral\" | \"accent\" | \"good\" | \"warn\" | \"bad\" | \"voice\";\n\n/** Props for {@link SiteChip}. */\nexport interface SiteChipProps {\n readonly tone?: SiteChipTone;\n /** A still dot in the tone's colour before the words. */\n readonly dot?: boolean;\n readonly children: ReactNode;\n}\n\n/** A status in one to three words. The words carry the state; the colour only repeats it. */\nexport function SiteChip({ tone, dot = false, children }: SiteChipProps) {\n return (\n <span {...slotAttributes(siteChipStyle, { tone })}>\n {dot ? <span {...slotAttributes(siteChipDotStyle, {})} aria-hidden=\"true\" /> : null}\n {children}\n </span>\n );\n}\n\n/** Props for {@link SiteSpinner}. */\nexport interface SiteSpinnerProps {\n /** `sm` beside a line of words, `lg` inside a page's round mark. */\n readonly size?: \"sm\" | \"lg\";\n}\n\n/** A ring that turns while something runs; it says nothing itself, the words beside it do. */\nexport function SiteSpinner({ size }: SiteSpinnerProps = {}) {\n return <span {...slotAttributes(siteSpinnerStyle, { size })} aria-hidden=\"true\" />;\n}\n\n/** Props for {@link SiteCaption}. */\nexport interface SiteCaptionProps {\n readonly children: ReactNode;\n}\n\n/** A small muted line under a part. */\nexport function SiteCaption({ children }: SiteCaptionProps) {\n return <p {...slotAttributes(siteCaptionStyle, {})}>{children}</p>;\n}\n\n/** Props for {@link SiteLive}. */\nexport interface SiteLiveProps {\n /** What a screen reader says; a change of it is spoken. Empty says nothing. */\n readonly children?: ReactNode;\n}\n\n/** A status line only a screen reader reads; it stays mounted so each change of its words is spoken. */\nexport function SiteLive({ children }: SiteLiveProps) {\n return (\n <span {...slotAttributes(siteLiveStyle, {})} role=\"status\">\n {children}\n </span>\n );\n}\n\n/** Props for {@link SiteBadge}. */\nexport interface SiteBadgeProps {\n readonly tone?: \"neutral\" | \"warn\";\n /** A glyph before the words, which the product draws. */\n readonly icon?: ReactNode;\n /** What the badge means in full, shown on hover. */\n readonly title?: string;\n readonly children: ReactNode;\n}\n\n/** A small badge in a tone with its glyph, such as a draft mark beside a document's title. */\nexport function SiteBadge({ tone, icon, title, children }: SiteBadgeProps) {\n return (\n <span {...slotAttributes(siteBadgeStyle, { tone })} title={title}>\n {icon}\n {children}\n </span>\n );\n}\n\n/** Props for {@link SiteTextAction}. */\nexport type SiteTextActionProps = SiteActionState & {\n readonly children: ReactNode;\n /** The address it opens; drawn as a link. Without it, or when disabled, it is a button. */\n readonly href?: string;\n readonly onSelect?: (event: MouseEvent<HTMLElement>) => void;\n /** The accessible name, where the words alone repeat elsewhere on the page. */\n readonly name?: string;\n readonly kind?: \"link\" | \"inline\" | \"muted\";\n /** The id of a line on the page that says more, such as why the action cannot run now. */\n readonly describedBy?: string;\n};\n\n/** An action written as a link inside text: a link when it opens an address, a button otherwise. */\nexport function SiteTextAction({ children, href, onSelect, disabled = false, reason, name, kind, describedBy }: SiteTextActionProps) {\n const marks = slotAttributes(siteTextActionStyle, { kind });\n const refusal = useRefusal(disabled, reason, describedBy);\n if (href !== undefined && !disabled) {\n return (\n <SiteLink {...marks} href={href} onClick={onSelect} aria-label={name} aria-describedby={describedBy}>\n {children}\n </SiteLink>\n );\n }\n return (\n <>\n <button {...marks} type=\"button\" disabled={disabled} aria-label={name} aria-describedby={refusal.describedBy} onClick={onSelect}>\n {children}\n </button>\n {refusal.hidden}\n </>\n );\n}\n"]}
|
|
@@ -23,6 +23,12 @@ var siteCodeCellStyle = defineSlotStyle({
|
|
|
23
23
|
},
|
|
24
24
|
defaultVariants: { invalid: false }
|
|
25
25
|
});
|
|
26
|
+
var sitePhoneTextStyle = defineSlotStyle({
|
|
27
|
+
slot: "site-phone-text",
|
|
28
|
+
base: "whitespace-nowrap tabular-nums",
|
|
29
|
+
variants: {},
|
|
30
|
+
defaultVariants: {}
|
|
31
|
+
});
|
|
26
32
|
var siteFieldStyle = defineSlotStyle({
|
|
27
33
|
slot: "site-field",
|
|
28
34
|
base: "flex min-w-0 flex-col gap-1 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)",
|
|
@@ -126,6 +132,6 @@ function SiteTextarea({ onValueChange, invalid = false, ...rest }) {
|
|
|
126
132
|
);
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
export { FieldInline, FieldNote, FieldRow, FormField, SITE_FIELD_NARROW, SiteInput, SiteTextarea, siteCodeCellStyle, siteCodeStyle };
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
export { FieldInline, FieldNote, FieldRow, FormField, SITE_FIELD_NARROW, SiteInput, SiteTextarea, siteCodeCellStyle, siteCodeStyle, sitePhoneTextStyle };
|
|
136
|
+
//# sourceMappingURL=chunk-EWBTUSZY.js.map
|
|
137
|
+
//# sourceMappingURL=chunk-EWBTUSZY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/form/form.style.ts","../src/form/fields.style.ts","../src/form/fields.tsx"],"names":["defineSlotStyle"],"mappings":";;;;AAMO,IAAM,UAAA,GACX,meAAA;AAOK,IAAM,iBAAA,GAAoB;AAG1B,IAAM,gBAAgB,eAAA,CAAgB;AAAA,EAC3C,IAAA,EAAM,WAAA;AAAA,EACN,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,+CAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,oBAAoB,eAAA,CAAgB;AAAA,EAC/C,IAAA,EAAM,gBAAA;AAAA,EACN,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EACE,+iBAAA;AAAA,EACF,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,8BAAA;AAAA,MACN,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAC9B,CAAC;AAGM,IAAM,qBAAqB,eAAA,CAAgB;AAAA,EAChD,IAAA,EAAM,iBAAA;AAAA,EACN,IAAA,EAAM,gCAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;ACzCM,IAAM,iBAAiBA,eAAAA,CAAgB;AAAA,EAC5C,IAAA,EAAM,YAAA;AAAA,EACN,IAAA,EAAM,kHAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,yBAAA;AAAA,MACN,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,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AAA,GAAO,MAAA,EAAQ,GAAG,IAAA,EAAK,EAAmB;AACxH,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,gBAAc,OAAA,IAAW,MAAA;AAAA,MACzB,QAAA,EAAU,gBAAgB,CAAC,KAAA,KAAU,cAAc,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA,GAAI,MAAA;AAAA,MACxE,GAAG,IAAA;AAAA,MACH,GAAG,cAAA,CAAe,cAAA,EAAgB,EAAE,IAAA,EAAM,MAAM;AAAA;AAAA,GACnD;AAEJ;AAUO,SAAS,aAAa,EAAE,aAAA,EAAe,UAAU,KAAA,EAAO,GAAG,MAAK,EAAsB;AAC3F,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,gBAAc,OAAA,IAAW,MAAA;AAAA,MACzB,QAAA,EAAU,gBAAgB,CAAC,KAAA,KAAU,cAAc,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA,GAAI,MAAA;AAAA,MACxE,GAAG,IAAA;AAAA,MACH,GAAG,cAAA,CAAe,iBAAA,EAAmB,EAAE;AAAA;AAAA,GAC1C;AAEJ","file":"chunk-EWBTUSZY.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/**\n * What every text control shares: the control line, the surface, the ink, the pointer and keyboard\n * answers, and the disabled and refused looks. A size or a shape is a variant or another slot.\n */\nexport const SITE_FIELD =\n \"block w-full min-w-0 rounded-(--site-radius-md) border border-(--site-control-line) bg-(--site-surface) font-(family-name:--site-font-sans) text-(--site-ink) outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) placeholder:text-(--site-ink-muted) hover:border-(--site-ink-muted) focus-visible:border-(--site-accent) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:opacity-(--site-dim) aria-invalid:border-(--site-bad)\";\n\n/**\n * A phone-width text control is read at the size that keeps a phone browser from zooming into it on\n * focus; the size and leading are the product's `--site-fs-input` and `--site-lh-input`. Every slot\n * a reader types into carries it, the fields here and the help search alike.\n */\nexport const SITE_FIELD_NARROW = \"@max-page-narrow/page:text-(length:--site-fs-input) @max-page-narrow/page:leading-(--site-lh-input)\";\n\n/** The six-digit code's row of cells, centred. */\nexport const siteCodeStyle = defineSlotStyle({\n slot: \"site-code\",\n as: \"part\",\n base: \"flex w-full items-center justify-center gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One square cell of the code; a refused code draws a heavier border in the bad colour. */\nexport const siteCodeCellStyle = defineSlotStyle({\n slot: \"site-code-cell\",\n as: \"part\",\n base:\n \"aspect-square w-(--site-code-cell) min-w-0 shrink rounded-(--site-radius-md) bg-(--site-surface) p-0 text-center font-(family-name:--site-font-mono) text-(length:--site-fs-digits) leading-(--site-lh-digits) font-(--site-fw-digits) tracking-normal text-(--site-ink) caret-(--site-accent) shadow-none outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) focus-visible:border-(--site-accent) focus-visible:shadow-[var(--site-focus-ring)] disabled:cursor-not-allowed disabled:bg-(--site-surface-sunken) disabled:opacity-(--site-dim)\",\n variants: {\n invalid: {\n true: \"border-2 border-(--site-bad)\",\n false: \"border border-(--site-control-line) hover:border-(--site-ink-muted)\",\n },\n },\n defaultVariants: { invalid: false },\n});\n\n/** A stored phone number for reading, kept on one line. */\nexport const sitePhoneTextStyle = defineSlotStyle({\n slot: \"site-phone-text\",\n base: \"whitespace-nowrap tabular-nums\",\n variants: {},\n defaultVariants: {},\n});\n","import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\nimport { SITE_FIELD, SITE_FIELD_NARROW } from \"./form.style\";\n\n/** A field: its name over its control, and any note under it. `muted` draws the name in the muted ink. */\nexport const siteFieldStyle = defineSlotStyle({\n slot: \"site-field\",\n base: \"flex min-w-0 flex-col gap-1 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n variants: {\n muted: {\n true: \"text-(--site-ink-muted)\",\n false: \"\",\n },\n },\n defaultVariants: { muted: false },\n});\n\n/** Fields side by side, one below the narrow tier. */\nexport const siteFieldRowStyle = defineSlotStyle({\n slot: \"site-field-row\",\n base: \"grid min-w-0 grid-cols-2 gap-2.5 @max-page-narrow/page:grid-cols-1\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A short line under a control: a hint, or what is wrong with the value in the bad colour. */\nexport const siteFieldNoteStyle = defineSlotStyle({\n slot: \"site-field-note\",\n base: \"min-w-0\",\n variants: {\n tone: {\n muted: \"text-(--site-ink-muted)\",\n bad: \"text-(--site-bad)\",\n good: \"text-(--site-good)\",\n warn: \"text-(--site-warn)\",\n },\n // `inherit` is the field's small print; `caption` the caption size on its own line under a form.\n size: {\n inherit: \"\",\n caption: \"text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n },\n },\n defaultVariants: { tone: \"muted\", size: \"inherit\" },\n});\n\n/** A control and what stands beside it on one line (an address and where it came from). */\nexport const siteFieldInlineStyle = defineSlotStyle({\n slot: \"site-field-inline\",\n base: \"flex min-w-0 items-center gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A one-line text field. */\nexport const siteInputStyle = defineSlotStyle({\n slot: \"site-input\",\n base: `${SITE_FIELD} ${SITE_FIELD_NARROW}`,\n variants: {\n size: {\n md: \"h-(--site-control) px-2.5 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) font-(--site-fw-base)\",\n sm: \"h-(--site-control-sm) px-2 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n },\n // A value read character by character (a recovery code) in the mono family.\n mono: {\n true: \"font-(family-name:--site-font-mono)\",\n false: \"\",\n },\n },\n defaultVariants: { size: \"md\", mono: false },\n});\n\n/** A text of several lines, in the reading size and leading. */\nexport const siteTextareaStyle = defineSlotStyle({\n slot: \"site-textarea\",\n base: `${SITE_FIELD} min-h-16 resize-none px-2.5 py-2 text-(length:--site-fs-notes) leading-(--site-lh-notes) font-(--site-fw-base) ${SITE_FIELD_NARROW}`,\n variants: {},\n defaultVariants: {},\n});\n","import type { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { siteFieldStyle, siteFieldNoteStyle, siteFieldRowStyle, siteTextareaStyle, siteInputStyle, siteFieldInlineStyle } from \"./fields.style\";\n\n/** Props for {@link FormField}. */\nexport interface FormFieldProps {\n /** The field's name over the control. */\n readonly label: ReactNode;\n /** The control, then any {@link FieldNote} under it. */\n readonly children: ReactNode;\n /**\n * `label` wraps the control in a `<label>`, which names it; `group` draws a plain box for a\n * control that names itself (a select whose trigger carries its own label, a code's cells).\n */\n readonly as?: \"label\" | \"group\";\n /** Draws the name in the muted ink, as a form inside a section does; a sign-in card draws it in the ink. */\n readonly muted?: boolean;\n}\n\n/** A field: its name over the control, and any note under it. */\nexport function FormField({ label, children, as = \"label\", muted = false }: FormFieldProps) {\n const Tag = as === \"label\" ? \"label\" : \"div\";\n return (\n <Tag {...slotAttributes(siteFieldStyle, { muted })}>\n {label}\n {children}\n </Tag>\n );\n}\n\n/** Props for {@link FieldRow}. */\nexport interface FieldRowProps {\n readonly children: ReactNode;\n}\n\n/** Fields side by side, one below the narrow tier. */\nexport function FieldRow({ children }: FieldRowProps) {\n return <div {...slotAttributes(siteFieldRowStyle, {})}>{children}</div>;\n}\n\n/** Props for {@link FieldNote}. */\nexport interface FieldNoteProps {\n /** `bad` says what is wrong with the value; `good` and `warn` a check that passed or asks for care. */\n readonly tone?: \"muted\" | \"bad\" | \"good\" | \"warn\";\n /** Spoken as it changes, for a rule that is met while the reader types. */\n readonly live?: boolean;\n /** `caption` for a line standing on its own under a form rather than inside a field. */\n readonly size?: \"inherit\" | \"caption\";\n readonly children: ReactNode;\n}\n\n/** A short line under a control, in the small print of the field. */\nexport function FieldNote({ tone, live = false, size, children }: FieldNoteProps) {\n return (\n <small {...slotAttributes(siteFieldNoteStyle, { tone, size })} aria-live={live ? \"polite\" : undefined}>\n {children}\n </small>\n );\n}\n\n/** Props for {@link FieldInline}. */\nexport interface FieldInlineProps {\n readonly children: ReactNode;\n}\n\n/** A control and what stands beside it on one line, such as where a filled-in address came from. */\nexport function FieldInline({ children }: FieldInlineProps) {\n return <span {...slotAttributes(siteFieldInlineStyle, {})}>{children}</span>;\n}\n\n/** Props for {@link SiteInput}: a text input's own attributes, without a class. */\nexport interface SiteInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"className\" | \"style\" | \"size\" | \"onChange\"> {\n /** `sm` sits in a row of small controls. */\n readonly size?: \"md\" | \"sm\";\n /** Called with the field's text after every edit. */\n readonly onValueChange?: (value: string) => void;\n /** The value is refused: the line takes the bad colour and the field reports `aria-invalid`. */\n readonly invalid?: boolean;\n /** A value read character by character (a recovery code), in the mono family. */\n readonly mono?: boolean;\n}\n\n/** A one-line text field on the control line. */\nexport function SiteInput({ size, onValueChange, invalid = false, mono = false, type = \"text\", ...rest }: SiteInputProps) {\n return (\n <input\n type={type}\n aria-invalid={invalid || undefined}\n onChange={onValueChange ? (event) => onValueChange(event.target.value) : undefined}\n {...rest}\n {...slotAttributes(siteInputStyle, { size, mono })}\n />\n );\n}\n\n/** Props for {@link SiteTextarea}. */\nexport interface SiteTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"className\" | \"style\" | \"onChange\"> {\n /** Called with the text after every edit. */\n readonly onValueChange?: (value: string) => void;\n readonly invalid?: boolean;\n}\n\n/** A text of several lines, in the reading size and leading. */\nexport function SiteTextarea({ onValueChange, invalid = false, ...rest }: SiteTextareaProps) {\n return (\n <textarea\n aria-invalid={invalid || undefined}\n onChange={onValueChange ? (event) => onValueChange(event.target.value) : undefined}\n {...rest}\n {...slotAttributes(siteTextareaStyle, {})}\n />\n );\n}\n"]}
|
|
@@ -16,9 +16,14 @@ var siteSelectStyle = defineSlotStyle({
|
|
|
16
16
|
block: {
|
|
17
17
|
true: "w-full",
|
|
18
18
|
false: "w-auto"
|
|
19
|
+
},
|
|
20
|
+
// Beside another control in a row: the trigger keeps the width of its words, and the other control gives.
|
|
21
|
+
fit: {
|
|
22
|
+
true: "shrink-0",
|
|
23
|
+
false: ""
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
|
-
defaultVariants: { size: "md", block: false }
|
|
26
|
+
defaultVariants: { size: "md", block: false, fit: false }
|
|
22
27
|
});
|
|
23
28
|
var siteSelectValueStyle = defineSlotStyle({
|
|
24
29
|
slot: "site-select-value",
|
|
@@ -45,7 +50,7 @@ var siteSelectOptionStyle = defineSlotStyle({
|
|
|
45
50
|
variants: {},
|
|
46
51
|
defaultVariants: {}
|
|
47
52
|
});
|
|
48
|
-
function SiteSelect({ options, value, onValueChange, label, placeholder, size, block = false, disabled = false }) {
|
|
53
|
+
function SiteSelect({ options, value, onValueChange, label, placeholder, size, block = false, fit = false, disabled = false }) {
|
|
49
54
|
const chosen = options.find((option) => option.value === value);
|
|
50
55
|
return /* @__PURE__ */ jsxs(
|
|
51
56
|
Select,
|
|
@@ -57,7 +62,7 @@ function SiteSelect({ options, value, onValueChange, label, placeholder, size, b
|
|
|
57
62
|
if (picked !== void 0) onValueChange(picked.value);
|
|
58
63
|
},
|
|
59
64
|
children: [
|
|
60
|
-
/* @__PURE__ */ jsx(SelectTrigger, { ...partAttributes(siteSelectStyle, { size, block }), "aria-label": label, children: /* @__PURE__ */ jsx(SelectValue, { ...slotAttributes(siteSelectValueStyle, { placeholder: chosen === void 0 }), placeholder, children: chosen?.label }) }),
|
|
65
|
+
/* @__PURE__ */ jsx(SelectTrigger, { ...partAttributes(siteSelectStyle, { size, block, fit }), "aria-label": label, children: /* @__PURE__ */ jsx(SelectValue, { ...slotAttributes(siteSelectValueStyle, { placeholder: chosen === void 0 }), placeholder, children: chosen?.short ?? chosen?.label }) }),
|
|
61
66
|
/* @__PURE__ */ jsx(SelectContent, { ...partAttributes(siteSelectMenuStyle, {}), children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, { ...partAttributes(siteSelectOptionStyle, {}), value: option.value, disabled: option.disabled === true, children: option.label }, option.value)) })
|
|
62
67
|
]
|
|
63
68
|
}
|
|
@@ -228,5 +233,5 @@ function SiteSlider({ label, labelledBy, min, max, step = 1, pageStep, value, de
|
|
|
228
233
|
}
|
|
229
234
|
|
|
230
235
|
export { SLIDER_PAGE_STEPS, SiteSelect, SiteSlider, sliderKeyTarget, sliderShare, sliderSnap, sliderValueAt };
|
|
231
|
-
//# sourceMappingURL=chunk-
|
|
232
|
-
//# sourceMappingURL=chunk-
|
|
236
|
+
//# sourceMappingURL=chunk-HRRP6HMF.js.map
|
|
237
|
+
//# sourceMappingURL=chunk-HRRP6HMF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/form/select.style.ts","../src/form/select.tsx","../src/form/slider.style.ts","../src/form/slider.tsx"],"names":["defineSlotStyle","jsx","slotAttributes","jsxs"],"mappings":";;;;;;AAMO,IAAM,kBAAkB,eAAA,CAAgB;AAAA,EAC7C,IAAA,EAAM,aAAA;AAAA,EACN,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EACE,0tBAAA;AAAA,EACF,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,0GAAA;AAAA,MACJ,EAAA,EAAI;AAAA,KACN;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,QAAA;AAAA,MACN,KAAA,EAAO;AAAA,KACT;AAAA;AAAA,IAEA,GAAA,EAAK;AAAA,MACH,IAAA,EAAM,UAAA;AAAA,MACN,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,iBAAiB,EAAE,IAAA,EAAM,MAAM,KAAA,EAAO,KAAA,EAAO,KAAK,KAAA;AACpD,CAAC,CAAA;AAGM,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,WAA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AAA;AAAA,YACL,QAAA,EAAU,WAAW,EAAA,GAAK,CAAA;AAAA,YAC1B,YAAA,EAAY,KAAA;AAAA,YACZ,iBAAA,EAAiB,UAAA;AAAA,YACjB,kBAAA,EAAkB,WAAA;AAAA,YAClB,eAAA,EAAe,GAAA;AAAA,YACf,eAAA,EAAe,GAAA;AAAA,YACf,eAAA,EAAe,OAAA;AAAA,YACf,gBAAA,EAAgB,YAAY,OAAO,CAAA;AAAA,YACnC,kBAAA,EAAiB,YAAA;AAAA,YACjB,eAAA,EAAe,WAAW,IAAA,GAAO,MAAA;AAAA,YACjC,KAAA,EAAO,EAAE,IAAA,EAAM,KAAA,EAAM;AAAA,YACrB;AAAA;AAAA;AACF,OAAA,EACF;AAAA;AAAA,GACF;AAEJ","file":"chunk-HRRP6HMF.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/**\n * The framework select's trigger drawn in the site design: the control line, the value and the\n * chevron in the muted ink; the line takes the accent while the list is open.\n */\nexport const siteSelectStyle = defineSlotStyle({\n slot: \"site-select\",\n as: \"part\",\n base:\n \"inline-flex min-w-0 cursor-pointer items-center justify-between gap-1.5 rounded-(--site-radius-md) border border-(--site-control-line) bg-(--site-surface) py-0 pr-2 pl-2.5 text-left font-(family-name:--site-font-sans) text-(--site-ink) shadow-none outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) hover:border-(--site-ink-muted) focus-visible:shadow-[var(--site-focus-ring)] data-[state=open]:border-(--site-accent) data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--site-dim) [&>[data-slot=field-chevron]]:m-0 [&>[data-slot=field-chevron]]:size-3.5 [&>[data-slot=field-chevron]]:shrink-0 [&>[data-slot=field-chevron]]:text-(--site-ink-muted) [&>[data-slot=field-chevron]]:opacity-100\",\n variants: {\n size: {\n md: \"h-(--site-control) text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) font-(--site-fw-base)\",\n sm: \"h-(--site-control-sm) text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n },\n block: {\n true: \"w-full\",\n false: \"w-auto\",\n },\n // Beside another control in a row: the trigger keeps the width of its words, and the other control gives.\n fit: {\n true: \"shrink-0\",\n false: \"\",\n },\n },\n defaultVariants: { size: \"md\", block: false, fit: false },\n});\n\n/** The value the trigger shows; cut with an ellipsis where it is longer than the trigger. */\nexport const siteSelectValueStyle = defineSlotStyle({\n slot: \"site-select-value\",\n base: \"min-w-0 truncate\",\n variants: {\n placeholder: {\n true: \"text-(--site-ink-muted)\",\n false: \"\",\n },\n },\n defaultVariants: { placeholder: false },\n});\n\n/** The framework select's list drawn as a site floating card. */\nexport const siteSelectMenuStyle = defineSlotStyle({\n slot: \"site-select-menu\",\n as: \"part\",\n base: \"max-h-80 min-w-48 overflow-y-auto rounded-(--site-radius-lg) border border-(--site-line) bg-(--site-surface-raised) p-1.5 text-(--site-ink) shadow-[var(--site-shadow-float)] outline-none\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One option of the list: the check before the chosen one, the label, then its description. */\nexport const siteSelectOptionStyle = defineSlotStyle({\n slot: \"site-select-option\",\n as: \"part\",\n base:\n \"relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-(--site-radius-md) py-1.5 pr-2 pl-7 text-left text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) outline-none transition-colors duration-(--site-duration-fast) ease-(--site-ease) data-[highlighted]:bg-(--site-surface-sunken) data-[disabled]:cursor-default data-[disabled]:opacity-(--site-dim) [&>span:first-child]:left-2 [&>span:first-child]:text-(--site-accent) [&>span:first-child_svg]:size-3.5\",\n variants: {},\n defaultVariants: {},\n});\n","import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"@simplix-react/ui\";\nimport { partAttributes, slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { siteSelectMenuStyle, siteSelectValueStyle, siteSelectOptionStyle, siteSelectStyle } from \"./select.style\";\n\n/** One option of a {@link SiteSelect}. */\nexport interface SiteSelectOption<T extends string> {\n readonly value: T;\n /** The option's words, in the list and on the trigger once chosen. */\n readonly label: string;\n /**\n * What the trigger shows once the option is chosen, where the list's words are longer than the\n * trigger has room for (a calling code beside a number, where the list also names the country).\n */\n readonly short?: string;\n readonly disabled?: boolean;\n}\n\n/** Props for {@link SiteSelect}. */\nexport interface SiteSelectProps<T extends string> {\n readonly options: readonly SiteSelectOption<T>[];\n readonly value: T | null;\n readonly onValueChange: (value: T) => void;\n /** The control's accessible name; the field's visible name stands over it in a `FormField as=\"group\"`. */\n readonly label: string;\n /** What the trigger says while nothing is chosen. */\n readonly placeholder?: string;\n readonly size?: \"md\" | \"sm\";\n /** Stretches the trigger over its column. */\n readonly block?: boolean;\n /**\n * Keeps the trigger as wide as its words in a row it shares with another control (a calling code\n * beside its number), so the row's other control gives the width and the value is not cut.\n */\n readonly fit?: boolean;\n readonly disabled?: boolean;\n}\n\n/**\n * One choice from a list that opens under the trigger (a country, a reason). The list, its keyboard\n * and its focus are the framework select's; the kit draws the trigger, the list and the options.\n * The trigger shows the chosen option's words itself, so it reads the same before and after the\n * page hydrates.\n */\nexport function SiteSelect<T extends string>({ options, value, onValueChange, label, placeholder, size, block = false, fit = false, disabled = false }: SiteSelectProps<T>) {\n const chosen = options.find((option) => option.value === value);\n return (\n <Select\n value={chosen?.value}\n disabled={disabled}\n onValueChange={(next) => {\n const picked = options.find((option) => option.value === next);\n if (picked !== undefined) onValueChange(picked.value);\n }}\n >\n <SelectTrigger {...partAttributes(siteSelectStyle, { size, block, fit })} aria-label={label}>\n <SelectValue {...slotAttributes(siteSelectValueStyle, { placeholder: chosen === undefined })} placeholder={placeholder}>\n {chosen?.short ?? chosen?.label}\n </SelectValue>\n </SelectTrigger>\n <SelectContent {...partAttributes(siteSelectMenuStyle, {})}>\n {options.map((option) => (\n <SelectItem key={option.value} {...partAttributes(siteSelectOptionStyle, {})} value={option.value} disabled={option.disabled === true}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n}\n","import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/**\n * A slider: the track and the thumb on one line as tall as the thumb's reach. The whole line takes a\n * press, so a press beside the thin track still moves the value; a disabled slider dims.\n */\nexport const siteSliderStyle = defineSlotStyle({\n slot: \"site-slider\",\n base: \"flex h-(--site-slider-size) w-full min-w-0 flex-1 cursor-pointer touch-none items-center select-none\",\n variants: {\n disabled: {\n true: \"cursor-not-allowed opacity-(--site-dim)\",\n false: \"\",\n },\n },\n defaultVariants: { disabled: false },\n});\n\n/** The slider's track, sunken with a hairline inside its edge. */\nexport const siteSliderTrackStyle = defineSlotStyle({\n slot: \"site-slider-track\",\n base: \"relative block h-(--site-slider-track-size) w-full rounded-(--site-radius-full) bg-(--site-slider-track) shadow-[inset_0_0_0_1px_var(--site-slider-track-line)]\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The share of the track up to the value, in the accent; its width is the share. */\nexport const siteSliderFillStyle = defineSlotStyle({\n slot: \"site-slider-fill\",\n base: \"block h-full rounded-(--site-radius-full) bg-(--site-slider-fill)\",\n variants: {},\n defaultVariants: {},\n});\n\n/**\n * The thumb, centred on the value: a ringed disc that takes the soft accent under the pointer, the\n * focus ring from the keyboard, and grows while it is pressed or dragged.\n */\nexport const siteSliderThumbStyle = defineSlotStyle({\n slot: \"site-slider-thumb\",\n base: \"absolute top-1/2 block size-(--site-slider-thumb-size) -translate-1/2 rounded-(--site-radius-full) border-(length:--site-slider-thumb-ring) border-solid border-(--site-slider-thumb-line) bg-(--site-slider-thumb) outline-none transition-transform duration-(--site-duration-fast) ease-(--site-ease) hover:bg-(--site-slider-thumb-hover) focus-visible:shadow-[var(--site-focus-ring)] active:scale-(--site-slider-press)\",\n variants: {\n dragging: {\n true: \"scale-(--site-slider-press)\",\n false: \"\",\n },\n },\n defaultVariants: { dragging: false },\n});\n","import { useRef, useState, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { siteSliderTrackStyle, siteSliderFillStyle, siteSliderThumbStyle, siteSliderStyle } from \"./slider.style\";\n\n/** The range a slider moves over and the steps it moves in. */\nexport interface SiteSliderRange {\n readonly min: number;\n readonly max: number;\n /** The smallest move; every value the slider takes is `min` plus a whole number of steps. */\n readonly step: number;\n /** The move of Page Up and Page Down. */\n readonly pageStep: number;\n}\n\n/** How many steps a page move takes when none is given: ten, as the reference's slider moves. */\nexport const SLIDER_PAGE_STEPS = 10;\n\n/** The decimals a step is written with, so a snapped value carries no floating point residue. */\nconst decimals = (step: number) => {\n const text = String(step);\n const at = text.indexOf(\".\");\n return at < 0 ? 0 : text.length - at - 1;\n};\n\n/**\n * The value a slider takes for `value`: held inside the range, then moved to the nearest whole step\n * from `min`. A step that does not divide the range leaves the last value below `max` reachable only\n * by End, which snaps to `max` itself.\n */\nexport function sliderSnap(value: number, range: Pick<SiteSliderRange, \"min\" | \"max\" | \"step\">): number {\n const { min, max, step } = range;\n if (!Number.isFinite(value) || max <= min) return min;\n const held = Math.min(max, Math.max(min, value));\n if (held === max || step <= 0) return held;\n const snapped = min + Math.round((held - min) / step) * step;\n return Number(Math.min(max, snapped).toFixed(Math.max(decimals(step), decimals(min))));\n}\n\n/** The share of the track a value fills, from 0 to 1. */\nexport function sliderShare(value: number, min: number, max: number): number {\n if (max <= min) return 0;\n return Math.min(1, Math.max(0, (value - min) / (max - min)));\n}\n\n/**\n * The value a key moves the slider to: the arrows by a step (right and up raise it), Page Up and Page\n * Down by a page, Home and End to the ends; `null` for any other key or when the value would not move.\n */\nexport function sliderKeyTarget(key: string, value: number, range: SiteSliderRange): number | null {\n const by = (delta: number) => sliderSnap(value + delta, range);\n const next = (() => {\n switch (key) {\n case \"ArrowRight\":\n case \"ArrowUp\":\n return by(range.step);\n case \"ArrowLeft\":\n case \"ArrowDown\":\n return by(-range.step);\n case \"PageUp\":\n return by(range.pageStep);\n case \"PageDown\":\n return by(-range.pageStep);\n case \"Home\":\n return range.min;\n case \"End\":\n return range.max;\n default:\n return null;\n }\n })();\n return next === null || next === value ? null : next;\n}\n\n/** The value under a pointer at `x` over a track that starts at `left` and is `width` wide. */\nexport function sliderValueAt(x: number, left: number, width: number, range: Pick<SiteSliderRange, \"min\" | \"max\" | \"step\">): number {\n if (width <= 0) return range.min;\n return sliderSnap(range.min + ((x - left) / width) * (range.max - range.min), range);\n}\n\n/** The slider's accessible name: its own words, or the id of a visible label on the page. */\nexport type SiteSliderName = { readonly label: string; readonly labelledBy?: undefined } | { readonly labelledBy: string; readonly label?: undefined };\n\n/** Props for {@link SiteSlider}. */\nexport type SiteSliderProps = SiteSliderName & {\n readonly min: number;\n readonly max: number;\n readonly step?: number;\n /** The move of Page Up and Page Down; ten steps when not given. */\n readonly pageStep?: number;\n /** The value, when the product holds it; without it the slider holds its own from `defaultValue`. */\n readonly value?: number;\n /** The first value of a slider that holds its own; `min` when not given. */\n readonly defaultValue?: number;\n /** Runs on every move, by key, press or drag, with the snapped value. */\n readonly onValueChange?: (value: number) => void;\n /** Runs once a drag or a key move ends, with the value it ended on. */\n readonly onValueCommit?: (value: number) => void;\n /** How a screen reader reads a value (\"3 months\"); the number alone when not given. */\n readonly valueText?: (value: number) => string;\n /** The slider cannot be moved now; it is dimmed and leaves the tab order. */\n readonly disabled?: boolean;\n /** The id of a line that says more about the value, read after it. */\n readonly describedBy?: string;\n};\n\n/**\n * One value on a track: the track sunken with a hairline, filled in the accent up to the value, and a\n * ringed thumb on the value. The thumb is the ARIA slider: Tab reaches it, the arrows move it by a\n * step, Page Up and Page Down by a page, Home and End to the ends. A press on the track moves the\n * value there and a drag follows the pointer. It holds its own value unless `value` is given.\n */\nexport function SiteSlider({ label, labelledBy, min, max, step = 1, pageStep, value, defaultValue, onValueChange, onValueCommit, valueText, disabled = false, describedBy }: SiteSliderProps) {\n const range: SiteSliderRange = { min, max, step, pageStep: pageStep ?? step * SLIDER_PAGE_STEPS };\n const [own, setOwn] = useState(() => sliderSnap(defaultValue ?? min, range));\n const [dragging, setDragging] = useState(false);\n const track = useRef<HTMLSpanElement>(null);\n const thumb = useRef<HTMLSpanElement>(null);\n const current = sliderSnap(value ?? own, range);\n const latest = useRef(current);\n latest.current = current;\n\n const move = (next: number) => {\n if (next === latest.current) return;\n latest.current = next;\n if (value === undefined) setOwn(next);\n onValueChange?.(next);\n };\n const valueAtPointer = (event: PointerEvent<HTMLElement>) => {\n const box = track.current?.getBoundingClientRect();\n return box === undefined ? latest.current : sliderValueAt(event.clientX, box.left, box.width, range);\n };\n const onPointerDown = (event: PointerEvent<HTMLSpanElement>) => {\n if (disabled || event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture(event.pointerId);\n thumb.current?.focus();\n setDragging(true);\n move(valueAtPointer(event));\n };\n const onPointerMove = (event: PointerEvent<HTMLSpanElement>) => {\n if (!dragging) return;\n move(valueAtPointer(event));\n };\n const onPointerEnd = (event: PointerEvent<HTMLSpanElement>) => {\n if (!dragging) return;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId);\n setDragging(false);\n onValueCommit?.(latest.current);\n };\n const onKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n if (disabled) return;\n const next = sliderKeyTarget(event.key, latest.current, range);\n if (next === null) return;\n event.preventDefault();\n move(next);\n onValueCommit?.(next);\n };\n\n const share = `${String(sliderShare(current, min, max) * 100)}%`;\n return (\n <span\n {...slotAttributes(siteSliderStyle, { disabled })}\n role=\"group\"\n aria-label={label}\n aria-labelledby={labelledBy}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n >\n <span {...slotAttributes(siteSliderTrackStyle, {})} ref={track}>\n <span {...slotAttributes(siteSliderFillStyle, {})} style={{ width: share }} />\n <span\n {...slotAttributes(siteSliderThumbStyle, { dragging })}\n ref={thumb}\n role=\"slider\"\n tabIndex={disabled ? -1 : 0}\n aria-label={label}\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={current}\n aria-valuetext={valueText?.(current)}\n aria-orientation=\"horizontal\"\n aria-disabled={disabled ? true : undefined}\n style={{ left: share }}\n onKeyDown={onKeyDown}\n />\n </span>\n </span>\n );\n}\n"]}
|