@simplix-react-ui-kits/site-core 0.0.0-stage → 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.
Files changed (207) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +21 -2
  3. package/dist/account/index.d.ts +227 -0
  4. package/dist/account/index.js +99 -0
  5. package/dist/account/index.js.map +1 -0
  6. package/dist/action/index.d.ts +111 -0
  7. package/dist/action/index.js +86 -0
  8. package/dist/action/index.js.map +1 -0
  9. package/dist/auth/index.d.ts +151 -0
  10. package/dist/auth/index.js +269 -0
  11. package/dist/auth/index.js.map +1 -0
  12. package/dist/checkout/index.d.ts +241 -0
  13. package/dist/checkout/index.js +664 -0
  14. package/dist/checkout/index.js.map +1 -0
  15. package/dist/chunk-47HQIB4J.js +101 -0
  16. package/dist/chunk-47HQIB4J.js.map +1 -0
  17. package/dist/chunk-5PMA4PYV.js +57 -0
  18. package/dist/chunk-5PMA4PYV.js.map +1 -0
  19. package/dist/chunk-6T2QH62E.js +171 -0
  20. package/dist/chunk-6T2QH62E.js.map +1 -0
  21. package/dist/chunk-EELJOGWB.js +179 -0
  22. package/dist/chunk-EELJOGWB.js.map +1 -0
  23. package/dist/chunk-EOTYGKKM.js +42 -0
  24. package/dist/chunk-EOTYGKKM.js.map +1 -0
  25. package/dist/chunk-EWBTUSZY.js +137 -0
  26. package/dist/chunk-EWBTUSZY.js.map +1 -0
  27. package/dist/chunk-HRRP6HMF.js +237 -0
  28. package/dist/chunk-HRRP6HMF.js.map +1 -0
  29. package/dist/chunk-HZGBIIGN.js +207 -0
  30. package/dist/chunk-HZGBIIGN.js.map +1 -0
  31. package/dist/chunk-J2R7XPUR.js +17 -0
  32. package/dist/chunk-J2R7XPUR.js.map +1 -0
  33. package/dist/chunk-MR5ZALXA.js +21 -0
  34. package/dist/chunk-MR5ZALXA.js.map +1 -0
  35. package/dist/chunk-N7CJCCWU.js +50 -0
  36. package/dist/chunk-N7CJCCWU.js.map +1 -0
  37. package/dist/chunk-OWQVRM4W.js +365 -0
  38. package/dist/chunk-OWQVRM4W.js.map +1 -0
  39. package/dist/chunk-TGG4ZKPG.js +341 -0
  40. package/dist/chunk-TGG4ZKPG.js.map +1 -0
  41. package/dist/chunk-UF2MDCWB.js +37 -0
  42. package/dist/chunk-UF2MDCWB.js.map +1 -0
  43. package/dist/chunk-YXASVWY7.js +201 -0
  44. package/dist/chunk-YXASVWY7.js.map +1 -0
  45. package/dist/content/index.d.ts +95 -0
  46. package/dist/content/index.js +85 -0
  47. package/dist/content/index.js.map +1 -0
  48. package/dist/fields-CNo_DejX.d.ts +66 -0
  49. package/dist/form/index.d.ts +551 -0
  50. package/dist/form/index.js +421 -0
  51. package/dist/form/index.js.map +1 -0
  52. package/dist/help/index.d.ts +435 -0
  53. package/dist/help/index.js +871 -0
  54. package/dist/help/index.js.map +1 -0
  55. package/dist/install/index.d.ts +188 -0
  56. package/dist/install/index.js +136 -0
  57. package/dist/install/index.js.map +1 -0
  58. package/dist/legal/index.d.ts +422 -0
  59. package/dist/legal/index.js +1115 -0
  60. package/dist/legal/index.js.map +1 -0
  61. package/dist/link/index.d.ts +45 -0
  62. package/dist/link/index.js +26 -0
  63. package/dist/link/index.js.map +1 -0
  64. package/dist/marketing/index.d.ts +191 -0
  65. package/dist/marketing/index.js +458 -0
  66. package/dist/marketing/index.js.map +1 -0
  67. package/dist/page/index.d.ts +118 -0
  68. package/dist/page/index.js +57 -0
  69. package/dist/page/index.js.map +1 -0
  70. package/dist/pricing/index.d.ts +213 -0
  71. package/dist/pricing/index.js +480 -0
  72. package/dist/pricing/index.js.map +1 -0
  73. package/dist/shell/index.d.ts +339 -0
  74. package/dist/shell/index.js +294 -0
  75. package/dist/shell/index.js.map +1 -0
  76. package/dist/site-action-CPpf8JZl.d.ts +107 -0
  77. package/dist/site-link-BitGv4gj.d.ts +38 -0
  78. package/dist/site-page-DKcjqh9y.d.ts +62 -0
  79. package/dist/slider-5MWkQ-OQ.d.ts +67 -0
  80. package/package.json +130 -3
  81. package/regions.json +1493 -0
  82. package/scripts/check-site-regions.mjs +123 -0
  83. package/scripts/site-regions-rendered.mjs +295 -0
  84. package/src/account/account-layout.tsx +132 -0
  85. package/src/account/account.style.ts +376 -0
  86. package/src/account/figures.tsx +238 -0
  87. package/src/account/index.ts +6 -0
  88. package/src/account/settings.tsx +162 -0
  89. package/src/action/action-tile.style.ts +63 -0
  90. package/src/action/action-tile.tsx +83 -0
  91. package/src/action/index.ts +14 -0
  92. package/src/action/site-action.style.ts +72 -0
  93. package/src/action/site-action.tsx +172 -0
  94. package/src/auth/auth.style.ts +238 -0
  95. package/src/auth/auth.tsx +308 -0
  96. package/src/auth/index.ts +2 -0
  97. package/src/checkout/checkout-order.style.ts +145 -0
  98. package/src/checkout/checkout-payment.style.ts +134 -0
  99. package/src/checkout/checkout-progress.style.ts +98 -0
  100. package/src/checkout/checkout.style.ts +147 -0
  101. package/src/checkout/checkout.tsx +426 -0
  102. package/src/checkout/choice-cards.style.ts +94 -0
  103. package/src/checkout/choice-cards.tsx +89 -0
  104. package/src/checkout/index.ts +23 -0
  105. package/src/content/content.style.ts +72 -0
  106. package/src/content/content.tsx +124 -0
  107. package/src/content/index.ts +12 -0
  108. package/src/form/choices.style.ts +143 -0
  109. package/src/form/choices.tsx +200 -0
  110. package/src/form/code-field.tsx +76 -0
  111. package/src/form/confirm-by-typing.style.ts +59 -0
  112. package/src/form/confirm-by-typing.tsx +92 -0
  113. package/src/form/country-field.tsx +61 -0
  114. package/src/form/date-time.style.ts +26 -0
  115. package/src/form/date-time.tsx +123 -0
  116. package/src/form/dialog.style.ts +67 -0
  117. package/src/form/dialog.tsx +63 -0
  118. package/src/form/errors.style.ts +17 -0
  119. package/src/form/errors.tsx +129 -0
  120. package/src/form/fields.style.ts +78 -0
  121. package/src/form/fields.tsx +114 -0
  122. package/src/form/form.style.ts +47 -0
  123. package/src/form/index.ts +33 -0
  124. package/src/form/phone-field.tsx +98 -0
  125. package/src/form/question-focus.ts +121 -0
  126. package/src/form/radio-keys.ts +37 -0
  127. package/src/form/select.style.ts +60 -0
  128. package/src/form/select.tsx +70 -0
  129. package/src/form/signature.style.ts +20 -0
  130. package/src/form/signature.tsx +46 -0
  131. package/src/form/slider.style.ts +49 -0
  132. package/src/form/slider.tsx +194 -0
  133. package/src/form/toasts.style.ts +54 -0
  134. package/src/form/toasts.tsx +58 -0
  135. package/src/help/article.style.ts +258 -0
  136. package/src/help/article.tsx +332 -0
  137. package/src/help/contact.style.ts +139 -0
  138. package/src/help/contact.tsx +209 -0
  139. package/src/help/help-lists.style.ts +123 -0
  140. package/src/help/help-lists.tsx +136 -0
  141. package/src/help/help.style.ts +41 -0
  142. package/src/help/index.ts +13 -0
  143. package/src/help/screen-sketch.tsx +152 -0
  144. package/src/help/screen.style.ts +210 -0
  145. package/src/help/search-hero.style.ts +161 -0
  146. package/src/help/search-hero.tsx +180 -0
  147. package/src/install/check-card.tsx +72 -0
  148. package/src/install/disclosure-list.tsx +142 -0
  149. package/src/install/download-card.tsx +82 -0
  150. package/src/install/index.ts +10 -0
  151. package/src/install/install-steps.tsx +103 -0
  152. package/src/install/install.style.ts +420 -0
  153. package/src/install/video-card.tsx +51 -0
  154. package/src/legal/doc-layout.style.ts +147 -0
  155. package/src/legal/doc-layout.tsx +141 -0
  156. package/src/legal/index.ts +10 -0
  157. package/src/legal/legal-parts.style.ts +337 -0
  158. package/src/legal/legal-parts.tsx +380 -0
  159. package/src/legal/legal-table.style.ts +55 -0
  160. package/src/legal/legal-table.tsx +40 -0
  161. package/src/legal/policy-parts.tsx +162 -0
  162. package/src/legal/policy.style.ts +137 -0
  163. package/src/legal/refund-parts.tsx +294 -0
  164. package/src/legal/refund.style.ts +369 -0
  165. package/src/link/index.ts +5 -0
  166. package/src/link/mounted-href.ts +16 -0
  167. package/src/link/routes-in-page.ts +41 -0
  168. package/src/link/site-link.tsx +52 -0
  169. package/src/marketing/hero-band.tsx +73 -0
  170. package/src/marketing/index.ts +9 -0
  171. package/src/marketing/levels.ts +33 -0
  172. package/src/marketing/marketing.style.ts +389 -0
  173. package/src/marketing/numbered-steps.tsx +85 -0
  174. package/src/marketing/player.tsx +182 -0
  175. package/src/marketing/sample-row.tsx +103 -0
  176. package/src/page/index.ts +8 -0
  177. package/src/page/site-bits.tsx +117 -0
  178. package/src/page/site-failure.style.ts +43 -0
  179. package/src/page/site-failure.tsx +56 -0
  180. package/src/page/site-page.style.ts +244 -0
  181. package/src/page/site-page.tsx +134 -0
  182. package/src/page/site-read.tsx +36 -0
  183. package/src/pricing/index.ts +8 -0
  184. package/src/pricing/offer-parts.tsx +135 -0
  185. package/src/pricing/pack-card.tsx +133 -0
  186. package/src/pricing/packs.style.ts +126 -0
  187. package/src/pricing/plan-card.tsx +139 -0
  188. package/src/pricing/pricing.style.ts +316 -0
  189. package/src/pricing/segmented-switch.tsx +87 -0
  190. package/src/shell/index.ts +26 -0
  191. package/src/shell/refusal-page.ts +22 -0
  192. package/src/shell/site-bar.tsx +297 -0
  193. package/src/shell/site-footer.tsx +76 -0
  194. package/src/shell/site-scheme.ts +222 -0
  195. package/src/shell/site-shell.style.ts +241 -0
  196. package/src/shell/site-window.tsx +140 -0
  197. package/src/styles/designs/base.css +2988 -0
  198. package/templates/app-shell.hbs +168 -0
  199. package/templates/auth-page.hbs +30 -0
  200. package/templates/error-page.hbs +30 -0
  201. package/templates/static-page.account-section.hbs +30 -0
  202. package/templates/static-page.account.hbs +59 -0
  203. package/templates/static-page.checkout-done.hbs +35 -0
  204. package/templates/static-page.checkout.hbs +58 -0
  205. package/templates/static-page.doc.hbs +55 -0
  206. package/templates/static-page.hbs +31 -0
  207. package/templates/static-page.packs.hbs +37 -0
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ SimpleCORE License 1.0 (SCL-1.0)
2
+
3
+ Copyright (c) 2025 SimpleCORE
4
+
5
+ Permission is hereby granted, free of charge, to any individual or organization (the “Licensee”) to use, modify, and integrate this software (the “Software”) into their own internal or commercial products, subject to the following terms:
6
+
7
+ 1. **Internal and Product Use Permitted**
8
+ The Licensee may use and modify the Software internally, including incorporation into products that are developed, marketed, and sold by the Licensee. This includes the right to compile, bundle, or statically link the Software for use within their own distributed applications.
9
+
10
+ 2. **Commercial Redistribution Requires Permission**
11
+ The Licensee may **not** sell, license, lease, or otherwise redistribute this Software, in source or binary form, to third parties — whether standalone or as part of a product — without prior **written consent** from SimpleCORE.
12
+
13
+ 3. **Third-party Distribution Requires Permission**
14
+ The Licensee may **not** distribute the Software or derivative works to any third party in any form (source, binary, object code, container image, etc.) without prior **written consent** from SimpleCORE.
15
+
16
+ 4. **No SaaS / Hosted Service Offering Without Permission**
17
+ The Licensee may **not** use the Software to provide a hosted service (e.g., SaaS, PaaS, or API-based access) to third parties unless a separate commercial license is obtained from SimpleCORE.
18
+
19
+ 5. **Open Source Use Exception (Optional)**
20
+ Non-commercial open source use (e.g., academic research, nonprofit projects) is permitted, subject to compliance with this License, and with clear attribution to SimpleCORE.
21
+
22
+ 6. **No Warranty**
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY...
24
+
25
+ For licensing inquiries, contact: license@simplecore.kr
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # @simplix-react-ui-kits/site-core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The parts every web site design shares: behaviour and markup, each element that carries a look marked with `data-slot`. A design kit (`@simplix-react-ui-kits/site-clarity`) re-exports these segments and draws the slots; an app imports the design kit, never this package.
4
+
5
+ | Segment | Exports |
6
+ | --- | --- |
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
+ | `/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
+ | `/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
+ | `/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 |
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` |
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` |
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` |
15
+ | `/link` | `SiteLinkProvider`, `SiteLink`, `useSiteLink`, `PlainSiteLink`: every site link is drawn with the router link the provider names, a plain anchor otherwise |
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) |
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` |
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 |
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 |
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` |
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.
@@ -0,0 +1,227 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, MouseEvent } from 'react';
3
+ import { S as SiteActionSpec } from '../site-action-CPpf8JZl.js';
4
+
5
+ /** One section of {@link SectionNav}. */
6
+ interface SectionNavItem {
7
+ readonly key: string;
8
+ readonly label: ReactNode;
9
+ /**
10
+ * The section's own address (`/account/credits`), so a section can be opened and shared. A section
11
+ * that is not open yet has none and is drawn as its words in the list's place, offering no press.
12
+ */
13
+ readonly href?: string;
14
+ readonly current?: boolean;
15
+ /** A section that removes something (deleting the account), in the bad colour while not current. */
16
+ readonly danger?: boolean;
17
+ readonly onSelect?: (event: MouseEvent<HTMLElement>) => void;
18
+ }
19
+ /** Props for {@link SectionNav}. */
20
+ interface SectionNavProps {
21
+ /** The list's accessible name ("My account"). */
22
+ readonly label: string;
23
+ readonly items: readonly SectionNavItem[];
24
+ }
25
+ /**
26
+ * The sections of My account as links, the current one marked as the page. A section without an
27
+ * address (not open yet) keeps its place and its look as plain words, as the bar's pages do.
28
+ */
29
+ declare function SectionNav({ label, items }: SectionNavProps): react.JSX.Element;
30
+ /** Props for {@link AccountLayout}. */
31
+ interface AccountLayoutProps {
32
+ /** The section list, a {@link SectionNav}. */
33
+ readonly nav: ReactNode;
34
+ /**
35
+ * A state that holds over every section (a renewal that failed and is being retried), drawn above
36
+ * the section's heading on every section: a `NoticeBanner` from `/legal`.
37
+ */
38
+ readonly standing?: ReactNode;
39
+ /** The section: its {@link SectionHead}, then its parts. */
40
+ readonly children: ReactNode;
41
+ }
42
+ /**
43
+ * My account: the section list beside the section; below the medium tier the list stands over it.
44
+ *
45
+ * <p>A part of the section that goes away while it holds the focus (a notice whose action was
46
+ * pressed, a row a question replaced) would drop the focus to the document; the section's heading
47
+ * takes it then, so the reader stays in the section. A page that knows a better place moves the
48
+ * focus on from there.
49
+ */
50
+ declare function AccountLayout({ nav, standing, children }: AccountLayoutProps): react.JSX.Element;
51
+ /** Props for {@link SectionHead}. */
52
+ interface SectionHeadProps {
53
+ /**
54
+ * `1` is the section's title where it is the page's heading (the account page has no title above
55
+ * it, and its h1 names the tab); `2` is the section's title where a page title stands above it, or
56
+ * a part's title under a level 1 section; `3` a part's title inside a level 2 section.
57
+ */
58
+ readonly level?: 1 | 2 | 3;
59
+ readonly children: ReactNode;
60
+ }
61
+ /** A heading inside My account, in the display family. */
62
+ declare function SectionHead({ level, children }: SectionHeadProps): react.JSX.Element;
63
+
64
+ /** Props for {@link SettingsRows}. */
65
+ interface SettingsRowsProps {
66
+ /** The rows, each a {@link SettingsRow}. */
67
+ readonly children: ReactNode;
68
+ }
69
+ /** Rows of settings on one card, ruled apart. */
70
+ declare function SettingsRows({ children }: SettingsRowsProps): react.JSX.Element;
71
+ /** Props for {@link SettingsRow}. */
72
+ interface SettingsRowProps {
73
+ readonly title: ReactNode;
74
+ /** Beside the title: a `SiteChip` with the setting's state. */
75
+ readonly badge?: ReactNode;
76
+ /** Under the title: the state, date or amount, muted. */
77
+ readonly meta?: ReactNode;
78
+ /** At the end, small: what can be done with the setting. */
79
+ readonly actions?: readonly SiteActionSpec[];
80
+ }
81
+ /** One setting: its title and chip over its line, its small actions at the end. */
82
+ declare function SettingsRow({ title, badge, meta, actions }: SettingsRowProps): react.JSX.Element;
83
+ /** Props for {@link SettingsBox}. */
84
+ interface SettingsBoxProps {
85
+ /** `danger` sets the box on the bad colour's soft ground. */
86
+ readonly tone?: "plain" | "danger";
87
+ /**
88
+ * The element `id` of the control the page draws in the box's place once it closes (the action the
89
+ * box replaced while asking), which takes back a focus the closing box would drop.
90
+ */
91
+ readonly returnFocusTo?: string;
92
+ readonly children: ReactNode;
93
+ }
94
+ /**
95
+ * A question or a confirmation inside a section, on a card of its own.
96
+ *
97
+ * <p>The box opens on a press (changing the plan, cancelling, asking for a refund), often in place of
98
+ * the control that opened it, so it takes the focus when it opens and gives it back to that control
99
+ * when it closes, as a typed confirmation does; the reader who asked is read the question and tabs on
100
+ * into it. It is the focus's target, never a Tab stop, and it is named by its first heading (the
101
+ * question's title) so the focus moving in announces the question.
102
+ */
103
+ declare function SettingsBox({ tone, returnFocusTo, children }: SettingsBoxProps): react.JSX.Element;
104
+ /** Props for {@link SettingsText}. */
105
+ interface SettingsTextProps {
106
+ /** `plain`: a quote for a change; `muted`: what a choice means; `strong`: a state in bold. */
107
+ readonly tone?: "plain" | "muted" | "strong";
108
+ readonly children: ReactNode;
109
+ }
110
+ /** A sentence inside a section in the reading size. */
111
+ declare function SettingsText({ tone, children }: SettingsTextProps): react.JSX.Element;
112
+ /** Props for {@link SettingsActions}. */
113
+ interface SettingsActionsProps {
114
+ /** The committing action first, then the way back. */
115
+ readonly actions: readonly SiteActionSpec[];
116
+ /** Small inside a question; `md` for an action standing alone in the section (cancelling). */
117
+ readonly size?: "sm" | "md";
118
+ }
119
+ /** The actions of a question inside a section. */
120
+ declare function SettingsActions({ actions, size }: SettingsActionsProps): react.JSX.Element;
121
+ /** Props for {@link IdentityRow}. */
122
+ interface IdentityRowProps {
123
+ /** The round mark's content: an initial, or a glyph the product draws. */
124
+ readonly mark: ReactNode;
125
+ /** `voice` for something of the reader's own voice. */
126
+ readonly tone?: "accent" | "voice";
127
+ /** The mark's accessible name; without it the mark is decoration beside the name. */
128
+ readonly markLabel?: string;
129
+ readonly name: ReactNode;
130
+ readonly meta?: ReactNode;
131
+ /** At the end: a `SiteChip` saying its state. */
132
+ readonly badge?: ReactNode;
133
+ }
134
+ /** Who or what a part is about: the round mark, the name over its line, and a chip at the end. */
135
+ declare function IdentityRow({ mark, tone, markLabel, name, meta, badge }: IdentityRowProps): react.JSX.Element;
136
+
137
+ /** The share of a whole as a width, held between empty and full. */
138
+ declare const shareWidth: (share: number) => string;
139
+ /** Props for {@link SitePanel}. */
140
+ interface SitePanelProps {
141
+ /** The panel's title (an `h3`), or none. */
142
+ readonly title?: ReactNode;
143
+ /** The panel's accessible name when it is a region of its own ("Last 14 days"). */
144
+ readonly label?: string;
145
+ readonly children: ReactNode;
146
+ }
147
+ /** A bordered panel inside a section: a meter, a chart, or what the free plan gives. */
148
+ declare function SitePanel({ title, label, children }: SitePanelProps): react.JSX.Element;
149
+ /** Props for {@link PanelLine}. */
150
+ interface PanelLineProps {
151
+ /** What the line says, muted. */
152
+ readonly children: ReactNode;
153
+ /** At the end, small: the way to more (topping up, the plans). */
154
+ readonly action?: SiteActionSpec;
155
+ }
156
+ /** A line inside a panel: what it says at the start and an action at the end. */
157
+ declare function PanelLine({ children, action }: PanelLineProps): react.JSX.Element;
158
+ /** Props for {@link QuotaMeter}. */
159
+ interface QuotaMeterProps {
160
+ /** The share left or used, from 0 to 1. */
161
+ readonly share: number;
162
+ /** The bar's accessible description ("11,760 of 50,000 characters used"). */
163
+ readonly label: string;
164
+ /** What it says at the start (the period) and at the end (what is left). */
165
+ readonly start: ReactNode;
166
+ readonly end: ReactNode;
167
+ }
168
+ /** A share of an allowance: a bar on the sunken track, with a line at each end under it. */
169
+ declare function QuotaMeter({ share, label, start, end }: QuotaMeterProps): react.JSX.Element;
170
+ /** One day of {@link DaySeries}. */
171
+ interface SeriesDay {
172
+ readonly key: string;
173
+ readonly value: number;
174
+ /** What the day says to a screen reader and under the pointer ("Oct 3: 1,240 characters"). */
175
+ readonly label: string;
176
+ }
177
+ /** Props for {@link DaySeries}. */
178
+ interface DaySeriesProps {
179
+ readonly days: readonly SeriesDay[];
180
+ /** The first and the last day under the bars. */
181
+ readonly from?: ReactNode;
182
+ readonly to?: ReactNode;
183
+ /** The least height a day's bar keeps, as a share of the tallest, so a day without use still shows. */
184
+ readonly floor?: number;
185
+ }
186
+ /** A day's height as a share of the tallest day, never under the floor. */
187
+ declare const dayHeight: (value: number, max: number, floor?: number) => string;
188
+ /** A run of days as bars on one line, the tallest reaching the top; each day is read out by its label. */
189
+ declare function DaySeries({ days, from, to, floor }: DaySeriesProps): react.JSX.Element;
190
+ /** One column of {@link TableCard}. */
191
+ interface TableCardColumn<K extends string> {
192
+ readonly key: K;
193
+ readonly label: ReactNode;
194
+ }
195
+ /** Props for {@link TableCard}. */
196
+ interface TableCardProps<K extends string> {
197
+ /** The table's accessible name. */
198
+ readonly label: string;
199
+ /** The first column is the row's subject in bold, the last sits at the end (a figure or actions). */
200
+ readonly columns: readonly TableCardColumn<K>[];
201
+ readonly rows: readonly {
202
+ readonly key: string;
203
+ readonly cells: Readonly<Record<K, ReactNode>>;
204
+ }[];
205
+ /** For rows that grow: the way to show the next ones, under the table. */
206
+ readonly more?: SiteActionSpec;
207
+ }
208
+ /**
209
+ * A table on a card: equal columns, a head row on the sunken ground, the first column bold, the
210
+ * middle ones muted and the last one at the end, so figures line up down it. A set that grows past
211
+ * a page passes `more`.
212
+ *
213
+ * <p>Pressing `more` moves the focus to the first row it added once the rows arrive, so a reader on
214
+ * the keyboard reads on from where the table grew. The control is gone after the last page, and the
215
+ * focus would otherwise fall back to the document.
216
+ */
217
+ declare function TableCard<K extends string>({ label, columns, rows, more }: TableCardProps<K>): react.JSX.Element;
218
+ /** Props for {@link TableActions}. */
219
+ interface TableActionsProps {
220
+ readonly actions: readonly SiteActionSpec[];
221
+ /** Where the row stands, a `SiteChip`, drawn before the actions (a refund asked for a payment). */
222
+ readonly badge?: ReactNode;
223
+ }
224
+ /** A row's small actions in its end cell, wrapping toward the end, after the row's state when it has one. */
225
+ declare function TableActions({ actions, badge }: TableActionsProps): react.JSX.Element;
226
+
227
+ export { AccountLayout, type AccountLayoutProps, DaySeries, type DaySeriesProps, IdentityRow, type IdentityRowProps, PanelLine, type PanelLineProps, QuotaMeter, type QuotaMeterProps, SectionHead, type SectionHeadProps, SectionNav, type SectionNavItem, type SectionNavProps, type SeriesDay, SettingsActions, type SettingsActionsProps, SettingsBox, type SettingsBoxProps, SettingsRow, type SettingsRowProps, SettingsRows, type SettingsRowsProps, SettingsText, type SettingsTextProps, SitePanel, type SitePanelProps, TableActions, type TableActionsProps, TableCard, type TableCardColumn, type TableCardProps, dayHeight, shareWidth };
@@ -0,0 +1,99 @@
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
+ import { nameByFirstHeading, useQuestionFocus, holdDroppedFocus } from '../chunk-N7CJCCWU.js';
4
+ import '../chunk-EELJOGWB.js';
5
+ import { SiteAction } from '../chunk-47HQIB4J.js';
6
+ import { SiteLink } from '../chunk-MR5ZALXA.js';
7
+ import { useRef, useEffect, useId } from 'react';
8
+ import { slotAttributes } from '@simplix-react/ui/design';
9
+ import { jsx, jsxs } from 'react/jsx-runtime';
10
+
11
+ function SectionNav({ label, items }) {
12
+ return /* @__PURE__ */ jsx("nav", { ...slotAttributes(siteSectionNavStyle, {}), "aria-label": label, children: items.map((item) => {
13
+ const state = item.current === true ? "current" : item.danger === true ? "danger" : "plain";
14
+ if (item.href === void 0) {
15
+ return /* @__PURE__ */ jsx("span", { ...slotAttributes(siteSectionNavItemStyle, { state, pending: true }), children: item.label }, item.key);
16
+ }
17
+ return /* @__PURE__ */ jsx(SiteLink, { ...slotAttributes(siteSectionNavItemStyle, { state }), href: item.href, "aria-current": item.current === true ? "page" : void 0, onClick: item.onSelect, children: item.label }, item.key);
18
+ }) });
19
+ }
20
+ function AccountLayout({ nav, standing, children }) {
21
+ const section = useRef(null);
22
+ useEffect(() => {
23
+ const node = section.current;
24
+ if (node === null) return;
25
+ const doc = node.ownerDocument;
26
+ let focused = null;
27
+ const track = (event) => {
28
+ focused = event.target instanceof Element && node.contains(event.target) ? event.target : null;
29
+ };
30
+ const watch = new MutationObserver(() => {
31
+ if (focused === null || focused.isConnected) return;
32
+ focused = null;
33
+ if (doc.activeElement !== null && doc.activeElement !== doc.body) return;
34
+ const heading = node.querySelector("h1, h2");
35
+ if (heading !== null) holdDroppedFocus(heading);
36
+ });
37
+ doc.addEventListener("focusin", track);
38
+ watch.observe(node, { childList: true, subtree: true });
39
+ return () => {
40
+ doc.removeEventListener("focusin", track);
41
+ watch.disconnect();
42
+ };
43
+ }, []);
44
+ return /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteAccountStyle, {}), children: [
45
+ nav,
46
+ /* @__PURE__ */ jsxs("section", { ref: section, ...slotAttributes(siteAccountSectionStyle, {}), children: [
47
+ standing,
48
+ children
49
+ ] })
50
+ ] });
51
+ }
52
+ function SectionHead({ level = 2, children }) {
53
+ const Tag = level === 1 ? "h1" : level === 2 ? "h2" : "h3";
54
+ return /* @__PURE__ */ jsx(Tag, { tabIndex: level === 3 ? void 0 : -1, ...slotAttributes(siteSectionHeadStyle, { level: String(level) }), children });
55
+ }
56
+ function SettingsRows({ children }) {
57
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteSettingsRowsStyle, {}), children });
58
+ }
59
+ function SettingsRow({ title, badge, meta, actions = [] }) {
60
+ return /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteSettingsRowStyle, {}), children: [
61
+ /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteSettingsRowTextStyle, {}), children: [
62
+ /* @__PURE__ */ jsxs("b", { ...slotAttributes(siteSettingsRowTitleStyle, {}), children: [
63
+ title,
64
+ badge
65
+ ] }),
66
+ meta !== void 0 ? /* @__PURE__ */ jsx("span", { ...slotAttributes(siteSettingsRowMetaStyle, {}), children: meta }) : null
67
+ ] }),
68
+ actions.length > 0 ? /* @__PURE__ */ jsx("div", { ...slotAttributes(siteSettingsRowActionsStyle, {}), children: actions.map((action) => /* @__PURE__ */ jsx(SiteAction, { ...action, size: "sm" }, action.id)) }) : null
69
+ ] });
70
+ }
71
+ function SettingsBox({ tone, returnFocusTo, children }) {
72
+ const root = useRef(null);
73
+ const headingId = useId();
74
+ useEffect(() => {
75
+ if (root.current !== null) nameByFirstHeading(root.current, headingId);
76
+ }, [headingId]);
77
+ useQuestionFocus(root, returnFocusTo);
78
+ return /* @__PURE__ */ jsx("div", { ref: root, tabIndex: -1, role: "group", ...slotAttributes(siteSettingsBoxStyle, { tone }), children });
79
+ }
80
+ function SettingsText({ tone, children }) {
81
+ return /* @__PURE__ */ jsx("p", { ...slotAttributes(siteSettingsTextStyle, { tone }), children });
82
+ }
83
+ function SettingsActions({ actions, size = "sm" }) {
84
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteSettingsActionsStyle, {}), children: actions.map((action) => /* @__PURE__ */ jsx(SiteAction, { ...action, size }, action.id)) });
85
+ }
86
+ function IdentityRow({ mark, tone, markLabel, name, meta, badge }) {
87
+ return /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteIdentityStyle, {}), children: [
88
+ /* @__PURE__ */ jsx("span", { ...slotAttributes(siteIdentityMarkStyle, { tone }), role: markLabel !== void 0 ? "img" : void 0, "aria-label": markLabel, "aria-hidden": markLabel === void 0 ? true : void 0, children: mark }),
89
+ /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteIdentityTextStyle, {}), children: [
90
+ /* @__PURE__ */ jsx("b", { ...slotAttributes(siteIdentityNameStyle, {}), children: name }),
91
+ meta !== void 0 ? /* @__PURE__ */ jsx("span", { ...slotAttributes(siteIdentityMetaStyle, {}), children: meta }) : null
92
+ ] }),
93
+ badge
94
+ ] });
95
+ }
96
+
97
+ export { AccountLayout, IdentityRow, SectionHead, SectionNav, SettingsActions, SettingsBox, SettingsRow, SettingsRows, SettingsText };
98
+ //# sourceMappingURL=index.js.map
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/account/account-layout.tsx","../../src/account/settings.tsx"],"names":["jsx","slotAttributes","jsxs","useRef","useEffect"],"mappings":";;;;;;;;;;AAiCO,SAAS,UAAA,CAAW,EAAE,KAAA,EAAO,KAAA,EAAM,EAAoB;AAC5D,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,cAAA,CAAe,mBAAA,EAAqB,EAAE,CAAA,EAAG,YAAA,EAAY,KAAA,EAC3D,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,KAAS;AACnB,IAAA,MAAM,KAAA,GAAQ,KAAK,OAAA,KAAY,IAAA,GAAO,YAAY,IAAA,CAAK,MAAA,KAAW,OAAO,QAAA,GAAW,OAAA;AACpF,IAAA,IAAI,IAAA,CAAK,SAAS,MAAA,EAAW;AAC3B,MAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAqB,GAAG,cAAA,CAAe,yBAAyB,EAAE,KAAA,EAAO,OAAA,EAAS,IAAA,EAAM,CAAA,EACtF,QAAA,EAAA,IAAA,CAAK,KAAA,EAAA,EADG,KAAK,GAEhB,CAAA;AAAA,IAEJ;AACA,IAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAyB,GAAG,cAAA,CAAe,uBAAA,EAAyB,EAAE,KAAA,EAAO,CAAA,EAAG,IAAA,EAAM,IAAA,CAAK,IAAA,EAAM,gBAAc,IAAA,CAAK,OAAA,KAAY,IAAA,GAAO,MAAA,GAAS,MAAA,EAAW,OAAA,EAAS,KAAK,QAAA,EACvK,QAAA,EAAA,IAAA,CAAK,KAAA,EAAA,EADO,IAAA,CAAK,GAEpB,CAAA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A,EAAI,QAAA,EAAA,IAAA,EAAK,CAAA,GAAU;AAAA,KAAA,EAC7F,CAAA;AAAA,IACC;AAAA,GAAA,EACH,CAAA;AAEJ","file":"index.js","sourcesContent":["import { useEffect, useRef, type MouseEvent, type ReactNode } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { holdDroppedFocus } from \"../form/question-focus\";\nimport { SiteLink } from \"../link/site-link\";\nimport { siteAccountSectionStyle, siteAccountStyle, siteSectionHeadStyle, siteSectionNavItemStyle, siteSectionNavStyle } from \"./account.style\";\n\n/** One section of {@link SectionNav}. */\nexport interface SectionNavItem {\n readonly key: string;\n readonly label: ReactNode;\n /**\n * The section's own address (`/account/credits`), so a section can be opened and shared. A section\n * that is not open yet has none and is drawn as its words in the list's place, offering no press.\n */\n readonly href?: string;\n readonly current?: boolean;\n /** A section that removes something (deleting the account), in the bad colour while not current. */\n readonly danger?: boolean;\n readonly onSelect?: (event: MouseEvent<HTMLElement>) => void;\n}\n\n/** Props for {@link SectionNav}. */\nexport interface SectionNavProps {\n /** The list's accessible name (\"My account\"). */\n readonly label: string;\n readonly items: readonly SectionNavItem[];\n}\n\n/**\n * The sections of My account as links, the current one marked as the page. A section without an\n * address (not open yet) keeps its place and its look as plain words, as the bar's pages do.\n */\nexport function SectionNav({ label, items }: SectionNavProps) {\n return (\n <nav {...slotAttributes(siteSectionNavStyle, {})} aria-label={label}>\n {items.map((item) => {\n const state = item.current === true ? \"current\" : item.danger === true ? \"danger\" : \"plain\";\n if (item.href === undefined) {\n return (\n <span key={item.key} {...slotAttributes(siteSectionNavItemStyle, { state, pending: true })}>\n {item.label}\n </span>\n );\n }\n return (\n <SiteLink key={item.key} {...slotAttributes(siteSectionNavItemStyle, { state })} href={item.href} aria-current={item.current === true ? \"page\" : undefined} onClick={item.onSelect}>\n {item.label}\n </SiteLink>\n );\n })}\n </nav>\n );\n}\n\n/** Props for {@link AccountLayout}. */\nexport interface AccountLayoutProps {\n /** The section list, a {@link SectionNav}. */\n readonly nav: ReactNode;\n /**\n * A state that holds over every section (a renewal that failed and is being retried), drawn above\n * the section's heading on every section: a `NoticeBanner` from `/legal`.\n */\n readonly standing?: ReactNode;\n /** The section: its {@link SectionHead}, then its parts. */\n readonly children: ReactNode;\n}\n\n/**\n * My account: the section list beside the section; below the medium tier the list stands over it.\n *\n * <p>A part of the section that goes away while it holds the focus (a notice whose action was\n * pressed, a row a question replaced) would drop the focus to the document; the section's heading\n * takes it then, so the reader stays in the section. A page that knows a better place moves the\n * focus on from there.\n */\nexport function AccountLayout({ nav, standing, children }: AccountLayoutProps) {\n const section = useRef<HTMLElement>(null);\n useEffect(() => {\n const node = section.current;\n if (node === null) return;\n const doc = node.ownerDocument;\n let focused: Element | null = null;\n const track = (event: FocusEvent) => {\n focused = event.target instanceof Element && node.contains(event.target) ? event.target : null;\n };\n const watch = new MutationObserver(() => {\n if (focused === null || focused.isConnected) return;\n focused = null;\n if (doc.activeElement !== null && doc.activeElement !== doc.body) return;\n const heading = node.querySelector<HTMLElement>(\"h1, h2\");\n if (heading !== null) holdDroppedFocus(heading);\n });\n doc.addEventListener(\"focusin\", track);\n watch.observe(node, { childList: true, subtree: true });\n return () => {\n doc.removeEventListener(\"focusin\", track);\n watch.disconnect();\n };\n }, []);\n return (\n <div {...slotAttributes(siteAccountStyle, {})}>\n {nav}\n <section ref={section} {...slotAttributes(siteAccountSectionStyle, {})}>\n {standing}\n {children}\n </section>\n </div>\n );\n}\n\n/** Props for {@link SectionHead}. */\nexport interface SectionHeadProps {\n /**\n * `1` is the section's title where it is the page's heading (the account page has no title above\n * it, and its h1 names the tab); `2` is the section's title where a page title stands above it, or\n * a part's title under a level 1 section; `3` a part's title inside a level 2 section.\n */\n readonly level?: 1 | 2 | 3;\n readonly children: ReactNode;\n}\n\n/** A heading inside My account, in the display family. */\nexport function SectionHead({ level = 2, children }: SectionHeadProps) {\n const Tag = level === 1 ? \"h1\" : level === 2 ? \"h2\" : \"h3\";\n // The section's title takes the focus a part of the section dropped (AccountLayout); never a Tab stop.\n return (\n <Tag tabIndex={level === 3 ? undefined : -1} {...slotAttributes(siteSectionHeadStyle, { level: String(level) })}>\n {children}\n </Tag>\n );\n}\n","import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\n\nimport { SiteAction, type SiteActionSpec } from \"../action/site-action\";\nimport { nameByFirstHeading, useQuestionFocus } from \"../form/question-focus\";\nimport {\n siteIdentityMarkStyle,\n siteIdentityMetaStyle,\n siteIdentityNameStyle,\n siteIdentityStyle,\n siteIdentityTextStyle,\n siteSettingsActionsStyle,\n siteSettingsBoxStyle,\n siteSettingsRowActionsStyle,\n siteSettingsRowMetaStyle,\n siteSettingsRowsStyle,\n siteSettingsRowStyle,\n siteSettingsRowTextStyle,\n siteSettingsRowTitleStyle,\n siteSettingsTextStyle,\n} from \"./account.style\";\n\n/** Props for {@link SettingsRows}. */\nexport interface SettingsRowsProps {\n /** The rows, each a {@link SettingsRow}. */\n readonly children: ReactNode;\n}\n\n/** Rows of settings on one card, ruled apart. */\nexport function SettingsRows({ children }: SettingsRowsProps) {\n return <div {...slotAttributes(siteSettingsRowsStyle, {})}>{children}</div>;\n}\n\n/** Props for {@link SettingsRow}. */\nexport interface SettingsRowProps {\n readonly title: ReactNode;\n /** Beside the title: a `SiteChip` with the setting's state. */\n readonly badge?: ReactNode;\n /** Under the title: the state, date or amount, muted. */\n readonly meta?: ReactNode;\n /** At the end, small: what can be done with the setting. */\n readonly actions?: readonly SiteActionSpec[];\n}\n\n/** One setting: its title and chip over its line, its small actions at the end. */\nexport function SettingsRow({ title, badge, meta, actions = [] }: SettingsRowProps) {\n return (\n <div {...slotAttributes(siteSettingsRowStyle, {})}>\n <div {...slotAttributes(siteSettingsRowTextStyle, {})}>\n <b {...slotAttributes(siteSettingsRowTitleStyle, {})}>\n {title}\n {badge}\n </b>\n {meta !== undefined ? <span {...slotAttributes(siteSettingsRowMetaStyle, {})}>{meta}</span> : null}\n </div>\n {actions.length > 0 ? (\n <div {...slotAttributes(siteSettingsRowActionsStyle, {})}>\n {actions.map((action) => (\n <SiteAction key={action.id} {...action} size=\"sm\" />\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\n/** Props for {@link SettingsBox}. */\nexport interface SettingsBoxProps {\n /** `danger` sets the box on the bad colour's soft ground. */\n readonly tone?: \"plain\" | \"danger\";\n /**\n * The element `id` of the control the page draws in the box's place once it closes (the action the\n * box replaced while asking), which takes back a focus the closing box would drop.\n */\n readonly returnFocusTo?: string;\n readonly children: ReactNode;\n}\n\n/**\n * A question or a confirmation inside a section, on a card of its own.\n *\n * <p>The box opens on a press (changing the plan, cancelling, asking for a refund), often in place of\n * the control that opened it, so it takes the focus when it opens and gives it back to that control\n * when it closes, as a typed confirmation does; the reader who asked is read the question and tabs on\n * into it. It is the focus's target, never a Tab stop, and it is named by its first heading (the\n * question's title) so the focus moving in announces the question.\n */\nexport function SettingsBox({ tone, returnFocusTo, children }: SettingsBoxProps) {\n const root = useRef<HTMLDivElement>(null);\n const headingId = useId();\n // Named before the focus moves in, so the move announces the name.\n useEffect(() => {\n if (root.current !== null) nameByFirstHeading(root.current, headingId);\n }, [headingId]);\n useQuestionFocus(root, returnFocusTo);\n return (\n <div ref={root} tabIndex={-1} role=\"group\" {...slotAttributes(siteSettingsBoxStyle, { tone })}>\n {children}\n </div>\n );\n}\n\n/** Props for {@link SettingsText}. */\nexport interface SettingsTextProps {\n /** `plain`: a quote for a change; `muted`: what a choice means; `strong`: a state in bold. */\n readonly tone?: \"plain\" | \"muted\" | \"strong\";\n readonly children: ReactNode;\n}\n\n/** A sentence inside a section in the reading size. */\nexport function SettingsText({ tone, children }: SettingsTextProps) {\n return <p {...slotAttributes(siteSettingsTextStyle, { tone })}>{children}</p>;\n}\n\n/** Props for {@link SettingsActions}. */\nexport interface SettingsActionsProps {\n /** The committing action first, then the way back. */\n readonly actions: readonly SiteActionSpec[];\n /** Small inside a question; `md` for an action standing alone in the section (cancelling). */\n readonly size?: \"sm\" | \"md\";\n}\n\n/** The actions of a question inside a section. */\nexport function SettingsActions({ actions, size = \"sm\" }: SettingsActionsProps) {\n return (\n <div {...slotAttributes(siteSettingsActionsStyle, {})}>\n {actions.map((action) => (\n <SiteAction key={action.id} {...action} size={size} />\n ))}\n </div>\n );\n}\n\n/** Props for {@link IdentityRow}. */\nexport interface IdentityRowProps {\n /** The round mark's content: an initial, or a glyph the product draws. */\n readonly mark: ReactNode;\n /** `voice` for something of the reader's own voice. */\n readonly tone?: \"accent\" | \"voice\";\n /** The mark's accessible name; without it the mark is decoration beside the name. */\n readonly markLabel?: string;\n readonly name: ReactNode;\n readonly meta?: ReactNode;\n /** At the end: a `SiteChip` saying its state. */\n readonly badge?: ReactNode;\n}\n\n/** Who or what a part is about: the round mark, the name over its line, and a chip at the end. */\nexport function IdentityRow({ mark, tone, markLabel, name, meta, badge }: IdentityRowProps) {\n return (\n <div {...slotAttributes(siteIdentityStyle, {})}>\n <span {...slotAttributes(siteIdentityMarkStyle, { tone })} role={markLabel !== undefined ? \"img\" : undefined} aria-label={markLabel} aria-hidden={markLabel === undefined ? true : undefined}>\n {mark}\n </span>\n <div {...slotAttributes(siteIdentityTextStyle, {})}>\n <b {...slotAttributes(siteIdentityNameStyle, {})}>{name}</b>\n {meta !== undefined ? <span {...slotAttributes(siteIdentityMetaStyle, {})}>{meta}</span> : null}\n </div>\n {badge}\n </div>\n );\n}\n"]}
@@ -0,0 +1,111 @@
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';
3
+ import * as _simplix_react_ui_design from '@simplix-react/ui/design';
4
+ import * as react from 'react';
5
+ import { ReactNode } from 'react';
6
+
7
+ /**
8
+ * A site action: a link or a button drawn as a pressable box. `tone` says how strongly it asks to be
9
+ * pressed (one primary per region), `size` follows the region it stands in (`sm` inside a row, `lg` in a
10
+ * hero), and
11
+ * `block` stretches it over its column, as a plan card's actions are, and lets a long label wrap there.
12
+ * `size` sets the least height, so a wrapped label grows the box instead of overflowing it.
13
+ *
14
+ * <p>The variants are written in declaration order at one specificity. `pad` comes last: a quiet
15
+ * action draws no ground, so it takes narrower side room than the size gives, and how much narrower
16
+ * depends on the size (`quietSm`, `quietMd`); {@link actionPad} picks it from the tone and the size.
17
+ * `subtle` is a quiet action in the muted ink (a way out that should not draw the eye, such as
18
+ * cancelling a subscription); `danger` is outlined in the bad colour for an action that removes.
19
+ *
20
+ * <p>A refused action takes the disabled ground and ink. An action that waits for its answer
21
+ * (`aria-busy`) is refused too, but it keeps its own tone, drawn at the `--site-recede` opacity: a
22
+ * grey button reads as a refusal, and a press that is on its way is not one.
23
+ */
24
+ declare const siteActionStyle: _simplix_react_ui_design.SlotStyle<{
25
+ size: {
26
+ md: string;
27
+ sm: string;
28
+ lg: string;
29
+ };
30
+ tone: {
31
+ primary: string;
32
+ secondary: string;
33
+ quiet: string;
34
+ subtle: string;
35
+ danger: string;
36
+ };
37
+ block: {
38
+ true: string;
39
+ false: string;
40
+ };
41
+ pad: {
42
+ size: string;
43
+ quietSm: string;
44
+ quietMd: string;
45
+ };
46
+ narrow: {
47
+ shown: string;
48
+ hidden: string;
49
+ };
50
+ }>;
51
+ /**
52
+ * Why a disabled action cannot run, for a screen reader only, where the page draws no line that says
53
+ * so; the action is described by it. It is taken out of the layout, so it moves nothing beside it.
54
+ */
55
+ declare const siteActionReasonStyle: _simplix_react_ui_design.SlotStyle<{}>;
56
+
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 };
@@ -0,0 +1,86 @@
1
+ import { useRefusal } from '../chunk-47HQIB4J.js';
2
+ export { SiteAction, siteActionReasonStyle, siteActionStyle, useRefusal } from '../chunk-47HQIB4J.js';
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 };
85
+ //# sourceMappingURL=index.js.map
86
+ //# sourceMappingURL=index.js.map