@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.
Files changed (112) hide show
  1. package/README.md +4 -3
  2. package/dist/account/index.d.ts +1 -1
  3. package/dist/account/index.js +3 -3
  4. package/dist/action/index.d.ts +59 -3
  5. package/dist/action/index.js +82 -0
  6. package/dist/action/index.js.map +1 -1
  7. package/dist/checkout/index.d.ts +1 -1
  8. package/dist/checkout/index.js +1 -1
  9. package/dist/{chunk-BJUU2WTX.js → chunk-EELJOGWB.js} +12 -5
  10. package/dist/chunk-EELJOGWB.js.map +1 -0
  11. package/dist/{chunk-7K476KMZ.js → chunk-EOTYGKKM.js} +3 -3
  12. package/dist/{chunk-7K476KMZ.js.map → chunk-EOTYGKKM.js.map} +1 -1
  13. package/dist/{chunk-FKC262N4.js → chunk-EWBTUSZY.js} +9 -3
  14. package/dist/chunk-EWBTUSZY.js.map +1 -0
  15. package/dist/{chunk-5TFLOQT6.js → chunk-HRRP6HMF.js} +10 -5
  16. package/dist/chunk-HRRP6HMF.js.map +1 -0
  17. package/dist/{chunk-4KFQ26JW.js → chunk-HZGBIIGN.js} +27 -6
  18. package/dist/chunk-HZGBIIGN.js.map +1 -0
  19. package/dist/{chunk-JJQJFRBI.js → chunk-OWQVRM4W.js} +3 -3
  20. package/dist/{chunk-JJQJFRBI.js.map → chunk-OWQVRM4W.js.map} +1 -1
  21. package/dist/{chunk-6S23FFBB.js → chunk-TGG4ZKPG.js} +3 -3
  22. package/dist/{chunk-6S23FFBB.js.map → chunk-TGG4ZKPG.js.map} +1 -1
  23. package/dist/{chunk-JVMJF5JJ.js → chunk-UF2MDCWB.js} +5 -5
  24. package/dist/chunk-UF2MDCWB.js.map +1 -0
  25. package/dist/{chunk-EG6GE3YS.js → chunk-YXASVWY7.js} +3 -3
  26. package/dist/{chunk-EG6GE3YS.js.map → chunk-YXASVWY7.js.map} +1 -1
  27. package/dist/content/index.d.ts +95 -0
  28. package/dist/content/index.js +85 -0
  29. package/dist/content/index.js.map +1 -0
  30. package/dist/form/index.d.ts +229 -8
  31. package/dist/form/index.js +150 -10
  32. package/dist/form/index.js.map +1 -1
  33. package/dist/help/index.d.ts +1 -1
  34. package/dist/help/index.js +6 -6
  35. package/dist/install/index.d.ts +1 -1
  36. package/dist/install/index.js +4 -4
  37. package/dist/legal/index.d.ts +2 -2
  38. package/dist/legal/index.js +5 -5
  39. package/dist/link/index.d.ts +14 -1
  40. package/dist/link/index.js +8 -1
  41. package/dist/link/index.js.map +1 -1
  42. package/dist/marketing/index.d.ts +1 -1
  43. package/dist/page/index.d.ts +2 -2
  44. package/dist/page/index.js +4 -4
  45. package/dist/pricing/index.d.ts +1 -1
  46. package/dist/pricing/index.js +2 -2
  47. package/dist/shell/index.d.ts +1 -1
  48. package/dist/{site-action-B79fuwMb.d.ts → site-action-CPpf8JZl.d.ts} +1 -1
  49. package/dist/{site-page-Dl0A5T1N.d.ts → site-page-DKcjqh9y.d.ts} +7 -2
  50. package/package.json +10 -3
  51. package/src/action/action-tile.style.ts +63 -0
  52. package/src/action/action-tile.tsx +83 -0
  53. package/src/action/index.ts +11 -0
  54. package/src/content/content.style.ts +72 -0
  55. package/src/content/content.tsx +124 -0
  56. package/src/content/index.ts +12 -0
  57. package/src/form/choices.style.ts +16 -0
  58. package/src/form/choices.tsx +28 -5
  59. package/src/form/country-field.tsx +61 -0
  60. package/src/form/date-time.style.ts +26 -0
  61. package/src/form/date-time.tsx +123 -0
  62. package/src/form/dialog.style.ts +4 -2
  63. package/src/form/errors.tsx +16 -4
  64. package/src/form/form.style.ts +8 -0
  65. package/src/form/index.ts +11 -1
  66. package/src/form/phone-field.tsx +98 -0
  67. package/src/form/select.style.ts +6 -1
  68. package/src/form/select.tsx +13 -3
  69. package/src/form/signature.style.ts +20 -0
  70. package/src/form/signature.tsx +46 -0
  71. package/src/link/index.ts +1 -0
  72. package/src/link/mounted-href.ts +16 -0
  73. package/src/page/site-page.style.ts +13 -4
  74. package/src/page/site-page.tsx +8 -3
  75. package/src/styles/designs/base.css +121 -4
  76. package/templates/app-shell.hbs +5 -4
  77. package/dist/chunk-4KFQ26JW.js.map +0 -1
  78. package/dist/chunk-5TFLOQT6.js.map +0 -1
  79. package/dist/chunk-BJUU2WTX.js.map +0 -1
  80. package/dist/chunk-FKC262N4.js.map +0 -1
  81. package/dist/chunk-JVMJF5JJ.js.map +0 -1
  82. package/src/account/account.test.tsx +0 -186
  83. package/src/action/site-action.test.tsx +0 -154
  84. package/src/auth/auth.test.tsx +0 -132
  85. package/src/checkout/checkout.test.tsx +0 -187
  86. package/src/form/choices-field.test.tsx +0 -20
  87. package/src/form/errors.test.tsx +0 -49
  88. package/src/form/form.test.tsx +0 -275
  89. package/src/form/question-focus.test.ts +0 -182
  90. package/src/form/slider.test.tsx +0 -148
  91. package/src/form/typed-text.test.ts +0 -52
  92. package/src/help/article.test.tsx +0 -189
  93. package/src/help/help.test.tsx +0 -215
  94. package/src/help/screen-sketch.test.tsx +0 -59
  95. package/src/install/install.test.tsx +0 -177
  96. package/src/legal/legal.test.tsx +0 -161
  97. package/src/legal/policy.test.tsx +0 -137
  98. package/src/legal/refund.test.tsx +0 -148
  99. package/src/link/routes-in-page.test.ts +0 -26
  100. package/src/link/site-link.test.ts +0 -10
  101. package/src/marketing/marketing.test.tsx +0 -221
  102. package/src/page/site-failure.test.tsx +0 -65
  103. package/src/page/site-page.test.tsx +0 -109
  104. package/src/page/site-read.test.tsx +0 -41
  105. package/src/pricing/pack-card.test.tsx +0 -107
  106. package/src/pricing/pricing.test.tsx +0 -261
  107. package/src/shell/refusal-page.test.ts +0 -19
  108. package/src/shell/site-scheme-param.test.ts +0 -53
  109. package/src/shell/site-scheme-switch.test.ts +0 -80
  110. package/src/shell/site-scheme.test.ts +0 -149
  111. package/src/shell/site-shell.test.tsx +0 -401
  112. package/src/testing/markup.ts +0 -65
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/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\n\nimport { SITE_CARD } from \"../page/site-page.style\";\n\n/** An article's meta, where it applies and its lead, under its title. */\nexport const siteArticleIntroStyle = defineSlotStyle({\n slot: \"site-article-intro\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The article's category, reading time and date, muted on one line; they wrap. */\nexport const siteArticleFactsStyle = defineSlotStyle({\n slot: \"site-article-facts\",\n base: \"flex min-w-0 flex-wrap gap-x-3 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One fact of the article. */\nexport const siteArticleFactStyle = defineSlotStyle({\n slot: \"site-article-fact\",\n base: \"min-w-0\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Where the article applies, as chips; they wrap. */\nexport const siteArticleWhereStyle = defineSlotStyle({\n slot: \"site-article-where\",\n base: \"flex min-w-0 flex-wrap gap-1.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The article's lead, in body text. */\nexport const siteArticleLeadStyle = defineSlotStyle({\n slot: \"site-article-lead\",\n base: \"m-0 text-(length:--site-fs-body) leading-(--site-lh-body)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The checks to do first, on the accent's soft ground. */\nexport const siteQuickBoxStyle = defineSlotStyle({\n slot: \"site-quick-box\",\n base: \"flex min-w-0 scroll-mt-4 flex-col gap-2 rounded-(--site-radius-xl) bg-(--site-accent-soft) px-4 py-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The quick box's title. */\nexport const siteQuickTitleStyle = defineSlotStyle({\n slot: \"site-quick-title\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The quick checks, each a question and its answer. */\nexport const siteQuickListStyle = defineSlotStyle({\n slot: \"site-quick-list\",\n base: \"m-0 flex min-w-0 list-none flex-col gap-1 p-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One quick check. */\nexport const siteQuickItemStyle = defineSlotStyle({\n slot: \"site-quick-item\",\n base: \"min-w-0\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The question of a quick check, in the strong weight. */\nexport const siteQuickAskStyle = defineSlotStyle({\n slot: \"site-quick-ask\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A step of an article: its numbered disc beside its title, words, picture and the mark for having tried it. */\nexport const siteArticleStepStyle = defineSlotStyle({\n slot: \"site-article-step\",\n base: \"flex min-w-0 scroll-mt-4 gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The step's title, words, picture and toggle, one under the other. */\nexport const siteArticleStepBodyStyle = defineSlotStyle({\n slot: \"site-article-step-body\",\n base: \"flex min-w-0 flex-1 flex-col gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A section heading inside a document, at the heading size. */\nexport const siteDocHeadingStyle = defineSlotStyle({\n slot: \"site-doc-heading\",\n base: \"m-0 text-(length:--site-fs-heading) leading-(--site-lh-heading) font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A paragraph inside a document; `muted` for one that introduces rather than states. */\nexport const siteDocTextStyle = defineSlotStyle({\n slot: \"site-doc-text\",\n base: \"m-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane)\",\n variants: {\n tone: {\n plain: \"\",\n muted: \"text-(--site-ink-muted)\",\n },\n },\n defaultVariants: { tone: \"plain\" },\n});\n\n/** Where a step's toggle or a section's action stands: at the start, its own width. */\nexport const siteDocActionStyle = defineSlotStyle({\n slot: \"site-doc-action\",\n base: \"flex self-start\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A picture of what the screen shows, on the sunken ground, with its caption. */\nexport const siteFigureStyle = defineSlotStyle({\n slot: \"site-figure\",\n base: \"m-0 flex min-w-0 flex-col gap-2 rounded-(--site-radius-xl) bg-(--site-surface-sunken) p-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The figure's caption. */\nexport const siteFigureCaptionStyle = defineSlotStyle({\n slot: \"site-figure-caption\",\n base: \"text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A tip on the warning's soft ground, its glyph first. */\nexport const siteTipStyle = defineSlotStyle({\n slot: \"site-tip\",\n base: \"m-0 flex min-w-0 items-start gap-2 rounded-(--site-radius-lg) bg-(--site-warn-soft) px-3 py-2 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The tip's glyph, in the warning colour. */\nexport const siteTipMarkStyle = defineSlotStyle({\n slot: \"site-tip-mark\",\n base: \"mt-0.5 flex shrink-0 text-(--site-warn) [&_svg]:size-3.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A section of a document after its steps: a heading, its words and its action. */\nexport const siteDocSectionStyle = defineSlotStyle({\n slot: \"site-doc-section\",\n base: \"flex min-w-0 scroll-mt-4 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Whether an article helped: the question with yes and no, then what was missing or the thanks. */\nexport const siteFeedbackStyle = defineSlotStyle({\n slot: \"site-feedback\",\n base: SITE_CARD,\n variants: {},\n defaultVariants: {},\n});\n\n/** The feedback's question and its answers; they wrap. */\nexport const siteFeedbackRowStyle = defineSlotStyle({\n slot: \"site-feedback-row\",\n base: \"flex min-w-0 flex-wrap items-center gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The feedback's question. */\nexport const siteFeedbackAskStyle = defineSlotStyle({\n slot: \"site-feedback-ask\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** What was missing, after a no: the reasons to pick and the actions. */\nexport const siteFeedbackMoreStyle = defineSlotStyle({\n slot: \"site-feedback-more\",\n // The thanks takes the focus as it replaces the answers; the focus is the reader's place, not a control.\n base: \"flex min-w-0 flex-col gap-2 outline-none\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A row of toggles or actions inside the feedback; they wrap. */\nexport const siteFeedbackChoicesStyle = defineSlotStyle({\n slot: \"site-feedback-choices\",\n base: \"flex min-w-0 flex-wrap\",\n variants: {\n gap: {\n tight: \"gap-1.5\",\n loose: \"gap-2\",\n },\n },\n defaultVariants: { gap: \"loose\" },\n});\n\n/** The thanks after the feedback is sent, its tick first. */\nexport const siteFeedbackThanksStyle = defineSlotStyle({\n slot: \"site-feedback-thanks\",\n base: \"m-0 flex min-w-0 items-center gap-2 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) [&_svg]:size-4 [&_svg]:text-(--site-good)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Articles that continue this one, two to a row, one below the narrow tier. */\nexport const siteRelatedStyle = defineSlotStyle({\n slot: \"site-related\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The related articles' grid. */\nexport const siteRelatedGridStyle = defineSlotStyle({\n slot: \"site-related-grid\",\n base: \"grid min-w-0 grid-cols-2 gap-2 @max-page-narrow/page:grid-cols-1\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One related article as a small card link: its title and its category. */\nexport const siteRelatedLinkStyle = defineSlotStyle({\n slot: \"site-related-link\",\n base:\n \"flex min-w-0 cursor-pointer flex-col rounded-(--site-radius-lg) border border-(--site-line) bg-(--site-surface) px-3 py-2.5 text-left text-inherit no-underline outline-none hover:border-(--site-control-line) focus-visible:shadow-[var(--site-focus-ring)]\",\n variants: {\n // An article not written yet: the same card with no press and its line kept under the pointer.\n pending: { true: \"cursor-default hover:border-(--site-line)\", false: \"\" },\n },\n defaultVariants: { pending: false },\n});\n\n/** How far the reader got: the count, the bar and an action, under the contents. */\nexport const siteDocProgressStyle = defineSlotStyle({\n slot: \"site-doc-progress\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n"]}
1
+ {"version":3,"sources":["../src/help/article.style.ts"],"names":[],"mappings":";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AACnB,CAAC;AAGM,IAAM,2BAA2B,eAAA,CAAgB;AAAA,EACtD,IAAA,EAAM,uBAAA;AAAA,EACN,IAAA,EAAM,wBAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA,MACH,KAAA,EAAO,SAAA;AAAA,MACP,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,GAAA,EAAK,OAAA;AAC1B,CAAC;AAGM,IAAM,0BAA0B,eAAA,CAAgB;AAAA,EACrD,IAAA,EAAM,sBAAA;AAAA,EACN,IAAA,EAAM,+IAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,mBAAmB,eAAA,CAAgB;AAAA,EAC9C,IAAA,EAAM,cAAA;AAAA,EACN,IAAA,EAAM,6BAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EAAM,kEAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EACE,+PAAA;AAAA,EACF,QAAA,EAAU;AAAA;AAAA,IAER,OAAA,EAAS,EAAE,IAAA,EAAM,2CAAA,EAA6C,OAAO,EAAA;AAAG,GAC1E;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAC9B,CAAC;AAGM,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EAAM,6BAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC","file":"chunk-YXASVWY7.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\nimport { SITE_CARD } from \"../page/site-page.style\";\n\n/** An article's meta, where it applies and its lead, under its title. */\nexport const siteArticleIntroStyle = defineSlotStyle({\n slot: \"site-article-intro\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The article's category, reading time and date, muted on one line; they wrap. */\nexport const siteArticleFactsStyle = defineSlotStyle({\n slot: \"site-article-facts\",\n base: \"flex min-w-0 flex-wrap gap-x-3 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One fact of the article. */\nexport const siteArticleFactStyle = defineSlotStyle({\n slot: \"site-article-fact\",\n base: \"min-w-0\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Where the article applies, as chips; they wrap. */\nexport const siteArticleWhereStyle = defineSlotStyle({\n slot: \"site-article-where\",\n base: \"flex min-w-0 flex-wrap gap-1.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The article's lead, in body text. */\nexport const siteArticleLeadStyle = defineSlotStyle({\n slot: \"site-article-lead\",\n base: \"m-0 text-(length:--site-fs-body) leading-(--site-lh-body)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The checks to do first, on the accent's soft ground. */\nexport const siteQuickBoxStyle = defineSlotStyle({\n slot: \"site-quick-box\",\n base: \"flex min-w-0 scroll-mt-4 flex-col gap-2 rounded-(--site-radius-xl) bg-(--site-accent-soft) px-4 py-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The quick box's title. */\nexport const siteQuickTitleStyle = defineSlotStyle({\n slot: \"site-quick-title\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The quick checks, each a question and its answer. */\nexport const siteQuickListStyle = defineSlotStyle({\n slot: \"site-quick-list\",\n base: \"m-0 flex min-w-0 list-none flex-col gap-1 p-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One quick check. */\nexport const siteQuickItemStyle = defineSlotStyle({\n slot: \"site-quick-item\",\n base: \"min-w-0\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The question of a quick check, in the strong weight. */\nexport const siteQuickAskStyle = defineSlotStyle({\n slot: \"site-quick-ask\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A step of an article: its numbered disc beside its title, words, picture and the mark for having tried it. */\nexport const siteArticleStepStyle = defineSlotStyle({\n slot: \"site-article-step\",\n base: \"flex min-w-0 scroll-mt-4 gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The step's title, words, picture and toggle, one under the other. */\nexport const siteArticleStepBodyStyle = defineSlotStyle({\n slot: \"site-article-step-body\",\n base: \"flex min-w-0 flex-1 flex-col gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A section heading inside a document, at the heading size. */\nexport const siteDocHeadingStyle = defineSlotStyle({\n slot: \"site-doc-heading\",\n base: \"m-0 text-(length:--site-fs-heading) leading-(--site-lh-heading) font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A paragraph inside a document; `muted` for one that introduces rather than states. */\nexport const siteDocTextStyle = defineSlotStyle({\n slot: \"site-doc-text\",\n base: \"m-0 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane)\",\n variants: {\n tone: {\n plain: \"\",\n muted: \"text-(--site-ink-muted)\",\n },\n },\n defaultVariants: { tone: \"plain\" },\n});\n\n/** Where a step's toggle or a section's action stands: at the start, its own width. */\nexport const siteDocActionStyle = defineSlotStyle({\n slot: \"site-doc-action\",\n base: \"flex self-start\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A picture of what the screen shows, on the sunken ground, with its caption. */\nexport const siteFigureStyle = defineSlotStyle({\n slot: \"site-figure\",\n base: \"m-0 flex min-w-0 flex-col gap-2 rounded-(--site-radius-xl) bg-(--site-surface-sunken) p-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The figure's caption. */\nexport const siteFigureCaptionStyle = defineSlotStyle({\n slot: \"site-figure-caption\",\n base: \"text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A tip on the warning's soft ground, its glyph first. */\nexport const siteTipStyle = defineSlotStyle({\n slot: \"site-tip\",\n base: \"m-0 flex min-w-0 items-start gap-2 rounded-(--site-radius-lg) bg-(--site-warn-soft) px-3 py-2 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The tip's glyph, in the warning colour. */\nexport const siteTipMarkStyle = defineSlotStyle({\n slot: \"site-tip-mark\",\n base: \"mt-0.5 flex shrink-0 text-(--site-warn) [&_svg]:size-3.5\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A section of a document after its steps: a heading, its words and its action. */\nexport const siteDocSectionStyle = defineSlotStyle({\n slot: \"site-doc-section\",\n base: \"flex min-w-0 scroll-mt-4 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Whether an article helped: the question with yes and no, then what was missing or the thanks. */\nexport const siteFeedbackStyle = defineSlotStyle({\n slot: \"site-feedback\",\n base: SITE_CARD,\n variants: {},\n defaultVariants: {},\n});\n\n/** The feedback's question and its answers; they wrap. */\nexport const siteFeedbackRowStyle = defineSlotStyle({\n slot: \"site-feedback-row\",\n base: \"flex min-w-0 flex-wrap items-center gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The feedback's question. */\nexport const siteFeedbackAskStyle = defineSlotStyle({\n slot: \"site-feedback-ask\",\n base: \"font-(--site-fw-strong)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** What was missing, after a no: the reasons to pick and the actions. */\nexport const siteFeedbackMoreStyle = defineSlotStyle({\n slot: \"site-feedback-more\",\n // The thanks takes the focus as it replaces the answers; the focus is the reader's place, not a control.\n base: \"flex min-w-0 flex-col gap-2 outline-none\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A row of toggles or actions inside the feedback; they wrap. */\nexport const siteFeedbackChoicesStyle = defineSlotStyle({\n slot: \"site-feedback-choices\",\n base: \"flex min-w-0 flex-wrap\",\n variants: {\n gap: {\n tight: \"gap-1.5\",\n loose: \"gap-2\",\n },\n },\n defaultVariants: { gap: \"loose\" },\n});\n\n/** The thanks after the feedback is sent, its tick first. */\nexport const siteFeedbackThanksStyle = defineSlotStyle({\n slot: \"site-feedback-thanks\",\n base: \"m-0 flex min-w-0 items-center gap-2 text-(length:--site-fs-body-pane) leading-(--site-lh-body-pane) [&_svg]:size-4 [&_svg]:text-(--site-good)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** Articles that continue this one, two to a row, one below the narrow tier. */\nexport const siteRelatedStyle = defineSlotStyle({\n slot: \"site-related\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The related articles' grid. */\nexport const siteRelatedGridStyle = defineSlotStyle({\n slot: \"site-related-grid\",\n base: \"grid min-w-0 grid-cols-2 gap-2 @max-page-narrow/page:grid-cols-1\",\n variants: {},\n defaultVariants: {},\n});\n\n/** One related article as a small card link: its title and its category. */\nexport const siteRelatedLinkStyle = defineSlotStyle({\n slot: \"site-related-link\",\n base:\n \"flex min-w-0 cursor-pointer flex-col rounded-(--site-radius-lg) border border-(--site-line) bg-(--site-surface) px-3 py-2.5 text-left text-inherit no-underline outline-none hover:border-(--site-control-line) focus-visible:shadow-[var(--site-focus-ring)]\",\n variants: {\n // An article not written yet: the same card with no press and its line kept under the pointer.\n pending: { true: \"cursor-default hover:border-(--site-line)\", false: \"\" },\n },\n defaultVariants: { pending: false },\n});\n\n/** How far the reader got: the count, the bar and an action, under the contents. */\nexport const siteDocProgressStyle = defineSlotStyle({\n slot: \"site-doc-progress\",\n base: \"flex min-w-0 flex-col gap-2\",\n variants: {},\n defaultVariants: {},\n});\n"]}
@@ -0,0 +1,95 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import { PlateViewer } from '@simplix-react/ui/plate-viewer';
4
+ import * as _simplix_react_ui_design from '@simplix-react/ui/design';
5
+
6
+ /** Props for {@link SiteContentBody}. */
7
+ interface SiteContentBodyProps {
8
+ /** The body as it was saved: the editor's serialized value, plain text, or a parsed value. */
9
+ readonly value: ComponentProps<typeof PlateViewer>["value"];
10
+ /** The plugin set of the editor the body was written with, where it is not the default. */
11
+ readonly variant?: ComponentProps<typeof PlateViewer>["variant"];
12
+ /** What stands in the body's place while there is none. */
13
+ readonly empty?: ReactNode;
14
+ }
15
+ /**
16
+ * A formatted body a person wrote, read on a site page: the framework's viewer (its headings, lists,
17
+ * links and tables) in the site's reading size. A value of plain text is one paragraph per line.
18
+ */
19
+ declare function SiteContentBody({ value, variant, empty }: SiteContentBodyProps): react.JSX.Element;
20
+ /** Props for {@link SiteScrollFrame}. */
21
+ interface SiteScrollFrameProps {
22
+ /** The frame's accessible name: it is a region the keyboard reaches, so it says what it holds. */
23
+ readonly label: string;
24
+ /** `sm` for a notice of a few paragraphs, `md` for a document. */
25
+ readonly size?: "sm" | "md";
26
+ readonly children: ReactNode;
27
+ }
28
+ /**
29
+ * A frame a long body scrolls inside instead of stretching the page (the words of a pledge above
30
+ * its signature). It is a named region with a tab stop, so a reader on the keyboard can scroll it.
31
+ */
32
+ declare function SiteScrollFrame({ label, size, children }: SiteScrollFrameProps): react.JSX.Element;
33
+ /** Props for {@link SiteMedia}. */
34
+ interface SiteMediaProps {
35
+ /** `video` plays a file the product serves; `frame` embeds another player or a document viewer. */
36
+ readonly kind: "video" | "frame";
37
+ readonly src: string;
38
+ /** The accessible title of an embedded frame. */
39
+ readonly title?: string;
40
+ /** Called when a `video` has played to its end. */
41
+ readonly onEnded?: () => void;
42
+ /** Draws a `frame` at 16:9, as an embedded video player is. */
43
+ readonly widescreen?: boolean;
44
+ /** The height of a `frame` that is not widescreen, in CSS pixels (a document viewer). */
45
+ readonly height?: number;
46
+ }
47
+ /** A video or an embedded page in a site frame: the framework's media part, which plays and reports. */
48
+ declare function SiteMedia({ kind, src, title, onEnded, widescreen, height }: SiteMediaProps): react.JSX.Element;
49
+ /** Props for {@link SiteMediaFailed}. */
50
+ interface SiteMediaFailedProps {
51
+ /** What the frame says to a screen reader ("The video cannot be played"). */
52
+ readonly label: string;
53
+ /** The glyph in the middle of the frame, which the product draws. */
54
+ readonly mark: ReactNode;
55
+ }
56
+ /**
57
+ * The place of a video that cannot be played: the player's frame with a mark in it. What happened
58
+ * and the way on (a retry) are said by a notice under it.
59
+ */
60
+ declare function SiteMediaFailed({ label, mark }: SiteMediaFailedProps): react.JSX.Element;
61
+ /** The width of the seen share, held between none and all of the track. */
62
+ declare function mediaProgressWidth(percent: number): string;
63
+ /** Props for {@link SiteMediaProgress}. */
64
+ interface SiteMediaProgressProps {
65
+ /** How far it was seen, from 0 to 100. */
66
+ readonly percent: number;
67
+ /** The words beside the bar, which also name it ("Progress 40%"). */
68
+ readonly label: string;
69
+ }
70
+ /** How far a video or a course was seen: a progress bar and its words beside it. */
71
+ declare function SiteMediaProgress({ percent, label }: SiteMediaProgressProps): react.JSX.Element;
72
+
73
+ /** A formatted body a person wrote (the words of a document, a course's description), in the reading size. */
74
+ declare const siteContentBodyStyle: _simplix_react_ui_design.SlotStyle<{}>;
75
+ /** A frame a long body scrolls inside: `sm` holds a notice of a few paragraphs, `md` a document. */
76
+ declare const siteScrollFrameStyle: _simplix_react_ui_design.SlotStyle<{
77
+ size: {
78
+ sm: string;
79
+ md: string;
80
+ };
81
+ }>;
82
+ /** The frame of a video or an embedded page. */
83
+ declare const siteMediaStyle: _simplix_react_ui_design.SlotStyle<{}>;
84
+ /** The place of a video that cannot be played: the player's 16:9 frame on the sunken ground, the mark in its middle. */
85
+ declare const siteMediaFailedStyle: _simplix_react_ui_design.SlotStyle<{}>;
86
+ /** How far a video or a course was seen: the bar, then its words. */
87
+ declare const siteMediaProgressStyle: _simplix_react_ui_design.SlotStyle<{}>;
88
+ /** The track of {@link siteMediaProgressStyle}. */
89
+ declare const siteMediaProgressTrackStyle: _simplix_react_ui_design.SlotStyle<{}>;
90
+ /** The seen share of the track. */
91
+ declare const siteMediaProgressFillStyle: _simplix_react_ui_design.SlotStyle<{}>;
92
+ /** The words beside the track ("Progress 40%"). */
93
+ declare const siteMediaProgressLabelStyle: _simplix_react_ui_design.SlotStyle<{}>;
94
+
95
+ export { SiteContentBody, type SiteContentBodyProps, SiteMedia, SiteMediaFailed, type SiteMediaFailedProps, SiteMediaProgress, type SiteMediaProgressProps, type SiteMediaProps, SiteScrollFrame, type SiteScrollFrameProps, mediaProgressWidth, siteContentBodyStyle, siteMediaFailedStyle, siteMediaProgressFillStyle, siteMediaProgressLabelStyle, siteMediaProgressStyle, siteMediaProgressTrackStyle, siteMediaStyle, siteScrollFrameStyle };
@@ -0,0 +1,85 @@
1
+ import { MediaEmbed } from '@simplix-react/ui';
2
+ import { defineSlotStyle, slotAttributes } from '@simplix-react/ui/design';
3
+ import { PlateViewer } from '@simplix-react/ui/plate-viewer';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ // src/content/content.tsx
7
+ var siteContentBodyStyle = defineSlotStyle({
8
+ slot: "site-content-body",
9
+ base: "min-w-0 text-(length:--site-fs-notes) leading-(--site-lh-notes) font-(--site-fw-base) text-(--site-ink)",
10
+ variants: {},
11
+ defaultVariants: {}
12
+ });
13
+ var siteScrollFrameStyle = defineSlotStyle({
14
+ slot: "site-scroll-frame",
15
+ base: "min-w-0 overflow-y-auto rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface) px-3 py-2.5 outline-none focus-visible:shadow-[var(--site-focus-ring)]",
16
+ variants: {
17
+ size: {
18
+ sm: "max-h-60",
19
+ md: "max-h-80"
20
+ }
21
+ },
22
+ defaultVariants: { size: "md" }
23
+ });
24
+ var siteMediaStyle = defineSlotStyle({
25
+ slot: "site-media",
26
+ base: "min-w-0 overflow-hidden rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface)",
27
+ variants: {},
28
+ defaultVariants: {}
29
+ });
30
+ var siteMediaFailedStyle = defineSlotStyle({
31
+ slot: "site-media-failed",
32
+ base: "flex aspect-video min-w-0 items-center justify-center rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface-sunken) text-(--site-ink-muted) [&_svg]:size-8",
33
+ variants: {},
34
+ defaultVariants: {}
35
+ });
36
+ var siteMediaProgressStyle = defineSlotStyle({
37
+ slot: "site-media-progress",
38
+ base: "flex min-w-0 items-center gap-3",
39
+ variants: {},
40
+ defaultVariants: {}
41
+ });
42
+ var siteMediaProgressTrackStyle = defineSlotStyle({
43
+ slot: "site-media-progress-track",
44
+ base: "relative h-1.5 min-w-0 flex-1 overflow-hidden rounded-(--site-radius-full) bg-(--site-surface-sunken)",
45
+ variants: {},
46
+ defaultVariants: {}
47
+ });
48
+ var siteMediaProgressFillStyle = defineSlotStyle({
49
+ slot: "site-media-progress-fill",
50
+ base: "absolute inset-y-0 left-0 rounded-(--site-radius-full) bg-(--site-accent) transition-[width] duration-(--site-duration-base) ease-(--site-ease)",
51
+ variants: {},
52
+ defaultVariants: {}
53
+ });
54
+ var siteMediaProgressLabelStyle = defineSlotStyle({
55
+ slot: "site-media-progress-label",
56
+ base: "shrink-0 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)",
57
+ variants: {},
58
+ defaultVariants: {}
59
+ });
60
+ function SiteContentBody({ value, variant, empty }) {
61
+ const none = value === null || value === void 0 || value === "";
62
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteContentBodyStyle, {}), children: none ? empty : /* @__PURE__ */ jsx(PlateViewer, { value, variant }) });
63
+ }
64
+ function SiteScrollFrame({ label, size, children }) {
65
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteScrollFrameStyle, { size }), role: "region", "aria-label": label, tabIndex: 0, children });
66
+ }
67
+ function SiteMedia({ kind, src, title, onEnded, widescreen, height }) {
68
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteMediaStyle, {}), children: /* @__PURE__ */ jsx(MediaEmbed, { kind, src, title, onEnded, widescreen, height }) });
69
+ }
70
+ function SiteMediaFailed({ label, mark }) {
71
+ return /* @__PURE__ */ jsx("div", { ...slotAttributes(siteMediaFailedStyle, {}), role: "img", "aria-label": label, children: mark });
72
+ }
73
+ function mediaProgressWidth(percent) {
74
+ return `${Math.min(100, Math.max(0, Number.isFinite(percent) ? percent : 0))}%`;
75
+ }
76
+ function SiteMediaProgress({ percent, label }) {
77
+ return /* @__PURE__ */ jsxs("div", { ...slotAttributes(siteMediaProgressStyle, {}), children: [
78
+ /* @__PURE__ */ jsx("div", { ...slotAttributes(siteMediaProgressTrackStyle, {}), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent, "aria-label": label, children: /* @__PURE__ */ jsx("i", { ...slotAttributes(siteMediaProgressFillStyle, {}), style: { width: mediaProgressWidth(percent) } }) }),
79
+ /* @__PURE__ */ jsx("span", { ...slotAttributes(siteMediaProgressLabelStyle, {}), children: label })
80
+ ] });
81
+ }
82
+
83
+ export { SiteContentBody, SiteMedia, SiteMediaFailed, SiteMediaProgress, SiteScrollFrame, mediaProgressWidth, siteContentBodyStyle, siteMediaFailedStyle, siteMediaProgressFillStyle, siteMediaProgressLabelStyle, siteMediaProgressStyle, siteMediaProgressTrackStyle, siteMediaStyle, siteScrollFrameStyle };
84
+ //# sourceMappingURL=index.js.map
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/content/content.style.ts","../../src/content/content.tsx"],"names":[],"mappings":";;;;;;AAGO,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EAAM,yGAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,iBAAiB;AACnB,CAAC;AAGM,IAAM,uBAAuB,eAAA,CAAgB;AAAA,EAClD,IAAA,EAAM,mBAAA;AAAA,EACN,IAAA,EACE,2KAAA;A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,CAAA,CAAA,CAAA;AAC9E;AAWO,SAAS,iBAAA,CAAkB,EAAE,OAAA,EAAS,KAAA,EAAM,EAA2B;AAC5E,EAAA,4BACG,KAAA,EAAA,EAAK,GAAG,eAAe,sBAAA,EAAwB,EAAE,CAAA,EAChD,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,KAAA,EAAA,EAAK,GAAG,cAAA,CAAe,2BAAA,EAA6B,EAAE,CAAA,EAAG,IAAA,EAAK,aAAA,EAAc,eAAA,EAAe,CAAA,EAAG,eAAA,EAAe,GAAA,EAAK,iBAAe,OAAA,EAAS,YAAA,EAAY,KAAA,EACrJ,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAG,GAAG,cAAA,CAAe,0BAAA,EAA4B,EAAE,CAAA,EAAG,KAAA,EAAO,EAAE,KAAA,EAAO,kBAAA,CAAmB,OAAO,CAAA,IAAK,CAAA,EACxG,CAAA;AAAA,oBACA,GAAA,CAAC,UAAM,GAAG,cAAA,CAAe,6BAA6B,EAAE,GAAI,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EACpE,CAAA;AAEJ","file":"index.js","sourcesContent":["import { defineSlotStyle } from \"@simplix-react/ui/design\";\n\n/** A formatted body a person wrote (the words of a document, a course's description), in the reading size. */\nexport const siteContentBodyStyle = defineSlotStyle({\n slot: \"site-content-body\",\n base: \"min-w-0 text-(length:--site-fs-notes) leading-(--site-lh-notes) font-(--site-fw-base) text-(--site-ink)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** A frame a long body scrolls inside: `sm` holds a notice of a few paragraphs, `md` a document. */\nexport const siteScrollFrameStyle = defineSlotStyle({\n slot: \"site-scroll-frame\",\n base:\n \"min-w-0 overflow-y-auto rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface) px-3 py-2.5 outline-none focus-visible:shadow-[var(--site-focus-ring)]\",\n variants: {\n size: {\n sm: \"max-h-60\",\n md: \"max-h-80\",\n },\n },\n defaultVariants: { size: \"md\" },\n});\n\n/** The frame of a video or an embedded page. */\nexport const siteMediaStyle = defineSlotStyle({\n slot: \"site-media\",\n base: \"min-w-0 overflow-hidden rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The place of a video that cannot be played: the player's 16:9 frame on the sunken ground, the mark in its middle. */\nexport const siteMediaFailedStyle = defineSlotStyle({\n slot: \"site-media-failed\",\n base:\n \"flex aspect-video min-w-0 items-center justify-center rounded-(--site-radius-md) border border-(--site-line) bg-(--site-surface-sunken) text-(--site-ink-muted) [&_svg]:size-8\",\n variants: {},\n defaultVariants: {},\n});\n\n/** How far a video or a course was seen: the bar, then its words. */\nexport const siteMediaProgressStyle = defineSlotStyle({\n slot: \"site-media-progress\",\n base: \"flex min-w-0 items-center gap-3\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The track of {@link siteMediaProgressStyle}. */\nexport const siteMediaProgressTrackStyle = defineSlotStyle({\n slot: \"site-media-progress-track\",\n base: \"relative h-1.5 min-w-0 flex-1 overflow-hidden rounded-(--site-radius-full) bg-(--site-surface-sunken)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The seen share of the track. */\nexport const siteMediaProgressFillStyle = defineSlotStyle({\n slot: \"site-media-progress-fill\",\n base: \"absolute inset-y-0 left-0 rounded-(--site-radius-full) bg-(--site-accent) transition-[width] duration-(--site-duration-base) ease-(--site-ease)\",\n variants: {},\n defaultVariants: {},\n});\n\n/** The words beside the track (\"Progress 40%\"). */\nexport const siteMediaProgressLabelStyle = defineSlotStyle({\n slot: \"site-media-progress-label\",\n base: \"shrink-0 text-(length:--site-fs-caption) leading-(--site-lh-caption) font-(--site-fw-caption) text-(--site-ink-muted)\",\n variants: {},\n defaultVariants: {},\n});\n","import type { ComponentProps, ReactNode } from \"react\";\nimport { MediaEmbed } from \"@simplix-react/ui\";\nimport { slotAttributes } from \"@simplix-react/ui/design\";\nimport { PlateViewer } from \"@simplix-react/ui/plate-viewer\";\n\nimport {\n siteContentBodyStyle,\n siteMediaFailedStyle,\n siteMediaProgressFillStyle,\n siteMediaProgressLabelStyle,\n siteMediaProgressStyle,\n siteMediaProgressTrackStyle,\n siteMediaStyle,\n siteScrollFrameStyle,\n} from \"./content.style\";\n\n/** Props for {@link SiteContentBody}. */\nexport interface SiteContentBodyProps {\n /** The body as it was saved: the editor's serialized value, plain text, or a parsed value. */\n readonly value: ComponentProps<typeof PlateViewer>[\"value\"];\n /** The plugin set of the editor the body was written with, where it is not the default. */\n readonly variant?: ComponentProps<typeof PlateViewer>[\"variant\"];\n /** What stands in the body's place while there is none. */\n readonly empty?: ReactNode;\n}\n\n/**\n * A formatted body a person wrote, read on a site page: the framework's viewer (its headings, lists,\n * links and tables) in the site's reading size. A value of plain text is one paragraph per line.\n */\nexport function SiteContentBody({ value, variant, empty }: SiteContentBodyProps) {\n const none = value === null || value === undefined || value === \"\";\n return <div {...slotAttributes(siteContentBodyStyle, {})}>{none ? empty : <PlateViewer value={value} variant={variant} />}</div>;\n}\n\n/** Props for {@link SiteScrollFrame}. */\nexport interface SiteScrollFrameProps {\n /** The frame's accessible name: it is a region the keyboard reaches, so it says what it holds. */\n readonly label: string;\n /** `sm` for a notice of a few paragraphs, `md` for a document. */\n readonly size?: \"sm\" | \"md\";\n readonly children: ReactNode;\n}\n\n/**\n * A frame a long body scrolls inside instead of stretching the page (the words of a pledge above\n * its signature). It is a named region with a tab stop, so a reader on the keyboard can scroll it.\n */\nexport function SiteScrollFrame({ label, size, children }: SiteScrollFrameProps) {\n return (\n <div {...slotAttributes(siteScrollFrameStyle, { size })} role=\"region\" aria-label={label} tabIndex={0}>\n {children}\n </div>\n );\n}\n\n/** Props for {@link SiteMedia}. */\nexport interface SiteMediaProps {\n /** `video` plays a file the product serves; `frame` embeds another player or a document viewer. */\n readonly kind: \"video\" | \"frame\";\n readonly src: string;\n /** The accessible title of an embedded frame. */\n readonly title?: string;\n /** Called when a `video` has played to its end. */\n readonly onEnded?: () => void;\n /** Draws a `frame` at 16:9, as an embedded video player is. */\n readonly widescreen?: boolean;\n /** The height of a `frame` that is not widescreen, in CSS pixels (a document viewer). */\n readonly height?: number;\n}\n\n/** A video or an embedded page in a site frame: the framework's media part, which plays and reports. */\nexport function SiteMedia({ kind, src, title, onEnded, widescreen, height }: SiteMediaProps) {\n return (\n <div {...slotAttributes(siteMediaStyle, {})}>\n <MediaEmbed kind={kind} src={src} title={title} onEnded={onEnded} widescreen={widescreen} height={height} />\n </div>\n );\n}\n\n/** Props for {@link SiteMediaFailed}. */\nexport interface SiteMediaFailedProps {\n /** What the frame says to a screen reader (\"The video cannot be played\"). */\n readonly label: string;\n /** The glyph in the middle of the frame, which the product draws. */\n readonly mark: ReactNode;\n}\n\n/**\n * The place of a video that cannot be played: the player's frame with a mark in it. What happened\n * and the way on (a retry) are said by a notice under it.\n */\nexport function SiteMediaFailed({ label, mark }: SiteMediaFailedProps) {\n return (\n <div {...slotAttributes(siteMediaFailedStyle, {})} role=\"img\" aria-label={label}>\n {mark}\n </div>\n );\n}\n\n/** The width of the seen share, held between none and all of the track. */\nexport function mediaProgressWidth(percent: number): string {\n return `${Math.min(100, Math.max(0, Number.isFinite(percent) ? percent : 0))}%`;\n}\n\n/** Props for {@link SiteMediaProgress}. */\nexport interface SiteMediaProgressProps {\n /** How far it was seen, from 0 to 100. */\n readonly percent: number;\n /** The words beside the bar, which also name it (\"Progress 40%\"). */\n readonly label: string;\n}\n\n/** How far a video or a course was seen: a progress bar and its words beside it. */\nexport function SiteMediaProgress({ percent, label }: SiteMediaProgressProps) {\n return (\n <div {...slotAttributes(siteMediaProgressStyle, {})}>\n <div {...slotAttributes(siteMediaProgressTrackStyle, {})} role=\"progressbar\" aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent} aria-label={label}>\n <i {...slotAttributes(siteMediaProgressFillStyle, {})} style={{ width: mediaProgressWidth(percent) }} />\n </div>\n <span {...slotAttributes(siteMediaProgressLabelStyle, {})}>{label}</span>\n </div>\n );\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  export { F as FieldInline, a as FieldInlineProps, b as FieldNote, c as FieldNoteProps, d as FieldRow, e as FieldRowProps, f as FormField, g as FormFieldProps, S as SiteInput, h as SiteInputProps, i as SiteTextarea, j as SiteTextareaProps } from '../fields-CNo_DejX.js';
2
2
  import * as react from 'react';
3
3
  import { ReactNode } from 'react';
4
- import { b as SiteActionBase, f as SiteReason, S as SiteActionSpec } from '../site-action-B79fuwMb.js';
5
- import { useErrorStore, Toast } from '@simplix-react/ui';
6
- export { S as SLIDER_PAGE_STEPS, a as SiteSlider, b as SiteSliderName, c as SiteSliderProps, d as SiteSliderRange, s as sliderKeyTarget, e as sliderShare, f as sliderSnap, g as sliderValueAt } from '../slider-5MWkQ-OQ.js';
4
+ import { TimeValue, PhoneNumberState, PhoneCountryOption, CountryOption, useErrorStore, Toast } from '@simplix-react/ui';
7
5
  import * as _simplix_react_ui_design from '@simplix-react/ui/design';
6
+ import { c as SiteActionBase, a as SiteReason, S as SiteActionSpec } from '../site-action-CPpf8JZl.js';
7
+ export { S as SLIDER_PAGE_STEPS, a as SiteSlider, b as SiteSliderName, c as SiteSliderProps, d as SiteSliderRange, s as sliderKeyTarget, e as sliderShare, f as sliderSnap, g as sliderValueAt } from '../slider-5MWkQ-OQ.js';
8
8
 
9
9
  /** Props for {@link SiteCheckbox}. */
10
10
  interface SiteCheckboxProps {
@@ -17,6 +17,11 @@ interface SiteCheckboxProps {
17
17
  readonly disabled?: boolean;
18
18
  /** The id of the line that says why the box cannot be changed now; give it with `disabled`. */
19
19
  readonly describedBy?: string;
20
+ /**
21
+ * A line under the words that says what checking the box does ("The time you agree is recorded").
22
+ * It describes the box and is no part of its name; it is drawn only with `label`.
23
+ */
24
+ readonly note?: ReactNode;
20
25
  /**
21
26
  * The step cannot go ahead without it: the box reports `aria-required`, and `badge` is drawn
22
27
  * before the words for the eye only ("Required"), so a screen reader never hears it glued to the
@@ -37,7 +42,7 @@ interface SiteCheckboxProps {
37
42
  * A box that is checked, unchecked or mixed, with its words beside it. The box is the framework's
38
43
  * checkbox (its keyboard and state), drawn in the site design.
39
44
  */
40
- declare function SiteCheckbox({ checked, onCheckedChange, label, name, disabled, describedBy, required, badge, field }: SiteCheckboxProps): react.JSX.Element;
45
+ declare function SiteCheckbox({ checked, onCheckedChange, label, name, disabled, describedBy, note, required, badge, field }: SiteCheckboxProps): react.JSX.Element;
41
46
  /** Props for {@link SiteSwitch}. */
42
47
  interface SiteSwitchProps {
43
48
  readonly checked: boolean;
@@ -58,6 +63,11 @@ interface RadioCardOption<T extends string> {
58
63
  readonly body?: ReactNode;
59
64
  /** Beside the title, such as a `SiteChip` saying it is the default. */
60
65
  readonly badge?: ReactNode;
66
+ /**
67
+ * The card's accessible name, where its title is a picture: the picture is drawn alone, and the
68
+ * words that say what it shows are read without being drawn beside it.
69
+ */
70
+ readonly name?: string;
61
71
  readonly disabled?: boolean;
62
72
  }
63
73
  /** Props for {@link RadioCards}. */
@@ -74,11 +84,92 @@ interface RadioCardsProps<T extends string> {
74
84
  */
75
85
  declare function RadioCards<T extends string>({ label, value, options, onValueChange }: RadioCardsProps<T>): react.JSX.Element;
76
86
 
87
+ /** Props for {@link SiteDateControl}. */
88
+ interface SiteDateControlProps {
89
+ /** The chosen day, or `null` while there is none. */
90
+ readonly value: Date | null;
91
+ /** Called with the day the reader chose, or with `null` when the choice is cleared. */
92
+ readonly onValueChange: (value: Date | null) => void;
93
+ /** The id of the trigger, which a label names through `htmlFor`. */
94
+ readonly id?: string;
95
+ /** What the trigger says while no day is chosen. */
96
+ readonly placeholder?: string;
97
+ /** The language of the calendar ("ko", "en", "ja"). */
98
+ readonly locale?: string;
99
+ readonly minDate?: Date;
100
+ readonly maxDate?: Date;
101
+ /** Draws the way to take the choice back. */
102
+ readonly clearable?: boolean;
103
+ readonly disabled?: boolean;
104
+ }
105
+ /**
106
+ * A day chosen from a calendar. The calendar, its keyboard and its focus are the framework date
107
+ * picker's; the kit draws the trigger on the control line.
108
+ */
109
+ declare function SiteDateControl({ value, onValueChange, id, placeholder, locale, minDate, maxDate, clearable, disabled }: SiteDateControlProps): react.JSX.Element;
110
+ /** Props for {@link SiteDateField}. */
111
+ interface SiteDateFieldProps extends Omit<SiteDateControlProps, "id"> {
112
+ /** The field's name over the control. */
113
+ readonly label: ReactNode;
114
+ /** Any note under the control. */
115
+ readonly children?: ReactNode;
116
+ }
117
+ /** A day under its name: the name names the trigger, and pressing it opens the calendar. */
118
+ declare function SiteDateField({ label, children, ...control }: SiteDateFieldProps): react.JSX.Element;
119
+ /** Props for {@link SiteTimeControl}. */
120
+ interface SiteTimeControlProps {
121
+ /** The chosen time of day, or `null` while there is none: the boxes stand empty. */
122
+ readonly value: TimeValue | null;
123
+ /** Called with a whole time after every change. */
124
+ readonly onValueChange: (value: TimeValue) => void;
125
+ /** The id of the element that names the control: its boxes are a group with no single label. */
126
+ readonly labelledBy?: string;
127
+ /** A 12-hour clock with the half of the day beside it; `false` for a 24-hour clock. */
128
+ readonly hour12?: boolean;
129
+ /** The step between the minutes of the list; typing and stepping take any minute. */
130
+ readonly minuteStep?: number;
131
+ readonly minTime?: TimeValue;
132
+ readonly maxTime?: TimeValue;
133
+ readonly disabled?: boolean;
134
+ }
135
+ /**
136
+ * A time of day typed or stepped in hour and minute boxes. The boxes, their keyboard and their
137
+ * lists are the framework time picker's; the kit draws the row on the control line, as wide as
138
+ * its column and never narrower than what it holds.
139
+ */
140
+ declare function SiteTimeControl({ value, onValueChange, labelledBy, hour12, minuteStep, minTime, maxTime, disabled }: SiteTimeControlProps): react.JSX.Element;
141
+ /** Props for {@link SiteTimeField}. */
142
+ interface SiteTimeFieldProps extends Omit<SiteTimeControlProps, "labelledBy"> {
143
+ /** The field's name over the control, which names its boxes as a group. */
144
+ readonly label: ReactNode;
145
+ /** Any note under the control. */
146
+ readonly children?: ReactNode;
147
+ }
148
+ /** A time of day under its name. */
149
+ declare function SiteTimeField({ label, children, ...control }: SiteTimeFieldProps): react.JSX.Element;
150
+
151
+ /**
152
+ * The framework's date picker in the site design: its trigger on the control line, in the site's
153
+ * control height, radius and sans face; the line takes the accent while the calendar is open.
154
+ */
155
+ declare const siteDateStyle: _simplix_react_ui_design.SlotStyle<{}>;
156
+ /**
157
+ * The framework's time picker in the site design: its row of boxes on the control line, as wide
158
+ * as the column, in the site's control height and radius; the chosen half of the day on the accent.
159
+ * The lists a wide window opens under the boxes are a raised site surface, the held value on the accent.
160
+ */
161
+ declare const siteTimeStyle: _simplix_react_ui_design.SlotStyle<{}>;
162
+
77
163
  /** One option of a {@link SiteSelect}. */
78
164
  interface SiteSelectOption<T extends string> {
79
165
  readonly value: T;
80
166
  /** The option's words, in the list and on the trigger once chosen. */
81
167
  readonly label: string;
168
+ /**
169
+ * What the trigger shows once the option is chosen, where the list's words are longer than the
170
+ * trigger has room for (a calling code beside a number, where the list also names the country).
171
+ */
172
+ readonly short?: string;
82
173
  readonly disabled?: boolean;
83
174
  }
84
175
  /** Props for {@link SiteSelect}. */
@@ -93,6 +184,11 @@ interface SiteSelectProps<T extends string> {
93
184
  readonly size?: "md" | "sm";
94
185
  /** Stretches the trigger over its column. */
95
186
  readonly block?: boolean;
187
+ /**
188
+ * Keeps the trigger as wide as its words in a row it shares with another control (a calling code
189
+ * beside its number), so the row's other control gives the width and the value is not cut.
190
+ */
191
+ readonly fit?: boolean;
96
192
  readonly disabled?: boolean;
97
193
  }
98
194
  /**
@@ -101,7 +197,127 @@ interface SiteSelectProps<T extends string> {
101
197
  * The trigger shows the chosen option's words itself, so it reads the same before and after the
102
198
  * page hydrates.
103
199
  */
104
- declare function SiteSelect<T extends string>({ options, value, onValueChange, label, placeholder, size, block, disabled }: SiteSelectProps<T>): react.JSX.Element;
200
+ declare function SiteSelect<T extends string>({ options, value, onValueChange, label, placeholder, size, block, fit, disabled }: SiteSelectProps<T>): react.JSX.Element;
201
+
202
+ /** Props for {@link SiteSignature}. */
203
+ interface SiteSignatureProps {
204
+ /** `drawn` is written by hand on the pad; `typed` draws {@link typedName} as the signature. */
205
+ readonly mode: "drawn" | "typed";
206
+ /** The name drawn as the signature in the `typed` mode. */
207
+ readonly typedName?: string;
208
+ /** Called with the signature as a PNG data address, or with `null` while there is none. */
209
+ readonly onValueChange?: (dataUrl: string | null) => void;
210
+ readonly disabled?: boolean;
211
+ /** The frame's accessible name ("Signature"). */
212
+ readonly label: string;
213
+ }
214
+ /**
215
+ * A signature written by hand or drawn from a typed name: the framework's signature pad (its
216
+ * canvas, its pointer handling and the picture it gives) in a site frame.
217
+ */
218
+ declare function SiteSignature({ mode, typedName, onValueChange, disabled, label }: SiteSignatureProps): react.JSX.Element;
219
+ /** Props for {@link SiteSignatureImage}. */
220
+ interface SiteSignatureImageProps {
221
+ /** The address of the signature's picture. */
222
+ readonly src: string;
223
+ /** What the picture is, for a reader who does not see it ("My signature"). */
224
+ readonly alt: string;
225
+ }
226
+ /** A signature that was given, for reading: its picture across a site frame. */
227
+ declare function SiteSignatureImage({ src, alt }: SiteSignatureImageProps): react.JSX.Element;
228
+
229
+ /** The frame a signature is written in. */
230
+ declare const siteSignatureStyle: _simplix_react_ui_design.SlotStyle<{}>;
231
+ /**
232
+ * A signature that was given: its picture across the frame. The picture carries its own paper (the
233
+ * pad fills a white ground before it draws), so the frame adds no ground of its own.
234
+ */
235
+ declare const siteSignatureImageStyle: _simplix_react_ui_design.SlotStyle<{}>;
236
+
237
+ /** A country as the calling-code list writes it: the code, then the country's name. */
238
+ declare function phoneCountryLabel(option: Pick<PhoneCountryOption, "callingCode" | "localName">): string;
239
+ /** Props for {@link SitePhoneControl}. */
240
+ interface SitePhoneControlProps {
241
+ /** The number being written: its country, its national text and the ways to change them. */
242
+ readonly state: Pick<PhoneNumberState, "options" | "country" | "national" | "setCountry" | "setNational">;
243
+ /** The accessible name of the calling-code select ("Country calling code"). */
244
+ readonly countryLabel: string;
245
+ /** The accessible name of the number field, where no visible name stands over it. */
246
+ readonly numberLabel?: string;
247
+ readonly placeholder?: string;
248
+ /** The number is refused: the field takes the bad colour and reports `aria-invalid`. */
249
+ readonly invalid?: boolean;
250
+ readonly disabled?: boolean;
251
+ }
252
+ /**
253
+ * A phone number as two controls on one line: the calling code of a country, and the number in
254
+ * that country's own form. The trigger shows the code alone; the list names each country after
255
+ * its code.
256
+ */
257
+ declare function SitePhoneControl({ state, countryLabel, numberLabel, placeholder, invalid, disabled }: SitePhoneControlProps): react.JSX.Element;
258
+ /** Props for {@link SitePhoneField}. */
259
+ interface SitePhoneFieldProps extends Omit<SitePhoneControlProps, "state"> {
260
+ /** The number as E.164 (`+821012345678`), or an empty string. */
261
+ readonly value: string;
262
+ /** Called with the E.164 number after every edit, or with `""` once the digits are gone. */
263
+ readonly onValueChange: (value: string) => void;
264
+ /** ISO 3166-1 alpha-2 country the field starts from while the value carries none. */
265
+ readonly defaultCountry?: string;
266
+ }
267
+ /**
268
+ * A phone number kept as E.164: the framework's phone number state (its countries, its formatting
269
+ * as the reader types) drawn in the site design. It stands in a `FormField as="group"`, which
270
+ * names the two controls together.
271
+ */
272
+ declare function SitePhoneField({ value, onValueChange, defaultCountry, ...control }: SitePhoneFieldProps): react.JSX.Element;
273
+ /** Props for {@link SitePhoneText}. */
274
+ interface SitePhoneTextProps {
275
+ /** The number as E.164 (`+821012345678`). */
276
+ readonly value: string | null | undefined;
277
+ /** What stands in its place while there is none. */
278
+ readonly empty?: ReactNode;
279
+ }
280
+ /**
281
+ * A stored phone number for reading, in the form written across countries (`+82 10 1234 5678`),
282
+ * kept on one line. Until the phone library has loaded it shows the value as it is stored.
283
+ */
284
+ declare function SitePhoneText({ value, empty }: SitePhoneTextProps): react.JSX.Element;
285
+
286
+ /** The countries as the options of a select: each by its code, under its name in the reader's language. */
287
+ declare function countrySelectOptions(countries: readonly Pick<CountryOption, "code" | "localName">[]): SiteSelectOption<string>[];
288
+ /** The country of the time zone the browser reports, or undefined where the zone names none. */
289
+ declare function countryOfBrowserZone(): string | undefined;
290
+ /** Props for {@link SiteCountryControl}. */
291
+ interface SiteCountryControlProps {
292
+ /** The countries to choose from. */
293
+ readonly countries: readonly Pick<CountryOption, "code" | "localName">[];
294
+ /** ISO 3166-1 alpha-2 code of the chosen country, or `null`. */
295
+ readonly value: string | null;
296
+ readonly onValueChange: (code: string) => void;
297
+ /** The select's accessible name; the field's visible name stands over it in a `FormField as="group"`. */
298
+ readonly label: string;
299
+ readonly placeholder?: string;
300
+ readonly disabled?: boolean;
301
+ /**
302
+ * Offers the country of the reader's time zone beside the select: the action's accessible name
303
+ * and its glyph, which the product draws. Left out, the field is the select alone.
304
+ */
305
+ readonly detect?: {
306
+ readonly name: string;
307
+ readonly glyph: ReactNode;
308
+ };
309
+ /** The country the detect action chooses; `undefined` where it cannot tell, and the action is then left out. */
310
+ readonly detected?: string;
311
+ }
312
+ /** A country chosen from a list, with the way to take the one the reader's time zone names. */
313
+ declare function SiteCountryControl({ countries, value, onValueChange, label, placeholder, disabled, detect, detected }: SiteCountryControlProps): react.JSX.Element;
314
+ /** Props for {@link SiteCountryField}. */
315
+ type SiteCountryFieldProps = Omit<SiteCountryControlProps, "countries" | "detected">;
316
+ /**
317
+ * A country kept as its ISO 3166-1 alpha-2 code: the framework's list of countries, named in the
318
+ * reader's language, drawn as a site select.
319
+ */
320
+ declare function SiteCountryField(props: SiteCountryFieldProps): react.JSX.Element;
105
321
 
106
322
  /** Props for {@link CodeField}. */
107
323
  interface CodeFieldProps {
@@ -240,8 +456,11 @@ interface SiteErrorsCopy {
240
456
  readonly titles: Readonly<Record<SiteErrorKind, string>>;
241
457
  /** What a server not answering means for the reader (try again in a moment). */
242
458
  readonly unavailable: string;
243
- /** What is said when the failure carries no sentence of its own. */
244
- readonly fallback: string;
459
+ /**
460
+ * What is said when the failure carries no sentence of its own: one sentence, or the sentence for
461
+ * the failure (a product that words each error code the server sends).
462
+ */
463
+ readonly fallback: string | ((event: SiteErrorEvent) => string);
245
464
  /** Closes the failure shown. */
246
465
  readonly close: string;
247
466
  /** Closes every failure waiting, with how many there are. */
@@ -326,5 +545,7 @@ declare const siteCodeCellStyle: _simplix_react_ui_design.SlotStyle<{
326
545
  false: string;
327
546
  };
328
547
  }>;
548
+ /** A stored phone number for reading, kept on one line. */
549
+ declare const sitePhoneTextStyle: _simplix_react_ui_design.SlotStyle<{}>;
329
550
 
330
- export { CodeField, type CodeFieldProps, ConfirmByTyping, type ConfirmByTypingProps, type RadioCardOption, RadioCards, type RadioCardsProps, type RadioKeyOption, SiteCheckbox, type SiteCheckboxProps, SiteDialog, SiteDialogFrame, type SiteDialogFrameProps, type SiteDialogProps, type SiteErrorEvent, type SiteErrorKind, SiteErrorList, type SiteErrorListProps, type SiteErrorView, SiteErrors, type SiteErrorsCopy, type SiteErrorsProps, SiteSelect, type SiteSelectOption, type SiteSelectProps, SiteSwitch, type SiteSwitchProps, SiteToastList, type SiteToastListProps, SiteToasts, radioKeyTarget, radioTabStop, siteCodeCellStyle, siteCodeStyle, siteErrorKind, siteErrorView, typedConfirms };
551
+ export { CodeField, type CodeFieldProps, ConfirmByTyping, type ConfirmByTypingProps, type RadioCardOption, RadioCards, type RadioCardsProps, type RadioKeyOption, SiteCheckbox, type SiteCheckboxProps, SiteCountryControl, type SiteCountryControlProps, SiteCountryField, type SiteCountryFieldProps, SiteDateControl, type SiteDateControlProps, SiteDateField, type SiteDateFieldProps, SiteDialog, SiteDialogFrame, type SiteDialogFrameProps, type SiteDialogProps, type SiteErrorEvent, type SiteErrorKind, SiteErrorList, type SiteErrorListProps, type SiteErrorView, SiteErrors, type SiteErrorsCopy, type SiteErrorsProps, SitePhoneControl, type SitePhoneControlProps, SitePhoneField, type SitePhoneFieldProps, SitePhoneText, type SitePhoneTextProps, SiteSelect, type SiteSelectOption, type SiteSelectProps, SiteSignature, SiteSignatureImage, type SiteSignatureImageProps, type SiteSignatureProps, SiteSwitch, type SiteSwitchProps, SiteTimeControl, type SiteTimeControlProps, SiteTimeField, type SiteTimeFieldProps, SiteToastList, type SiteToastListProps, SiteToasts, countryOfBrowserZone, countrySelectOptions, phoneCountryLabel, radioKeyTarget, radioTabStop, siteCodeCellStyle, siteCodeStyle, siteDateStyle, siteErrorKind, siteErrorView, sitePhoneTextStyle, siteSignatureImageStyle, siteSignatureStyle, siteTimeStyle, typedConfirms };