@thewhatmatters/wmds 0.4.33 → 0.4.34

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 (217) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/bin/wmds-check.mjs +24 -0
  3. package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +1 -1
  4. package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
  5. package/dist/components/atoms/Checkbox/checkboxStyles.js +6 -6
  6. package/dist/components/atoms/Input/Input.d.ts +13 -3
  7. package/dist/components/atoms/Input/Input.d.ts.map +1 -1
  8. package/dist/components/atoms/Input/Input.js +102 -67
  9. package/dist/components/atoms/Input/autofillFields.d.ts +9 -0
  10. package/dist/components/atoms/Input/autofillFields.d.ts.map +1 -0
  11. package/dist/components/atoms/Input/autofillFields.js +8 -0
  12. package/dist/components/atoms/Input/fieldWidth.d.ts +19 -0
  13. package/dist/components/atoms/Input/fieldWidth.d.ts.map +1 -0
  14. package/dist/components/atoms/Input/fieldWidth.js +24 -0
  15. package/dist/components/atoms/Radio/radioStyles.d.ts +1 -1
  16. package/dist/components/atoms/Radio/radioStyles.d.ts.map +1 -1
  17. package/dist/components/atoms/Radio/radioStyles.js +6 -6
  18. package/dist/components/molecules/Field/Field.d.ts +11 -3
  19. package/dist/components/molecules/Field/Field.d.ts.map +1 -1
  20. package/dist/components/molecules/Field/Field.js +45 -30
  21. package/dist/components/molecules/Field/fieldStyles.d.ts +9 -6
  22. package/dist/components/molecules/Field/fieldStyles.d.ts.map +1 -1
  23. package/dist/components/molecules/Field/fieldStyles.js +1 -1
  24. package/dist/components/molecules/IntakeForm/IntakeForm.d.ts +15 -5
  25. package/dist/components/molecules/IntakeForm/IntakeForm.d.ts.map +1 -1
  26. package/dist/components/molecules/IntakeForm/IntakeForm.js +110 -70
  27. package/dist/components/molecules/PillGroup/PillGroup.d.ts +7 -3
  28. package/dist/components/molecules/PillGroup/PillGroup.d.ts.map +1 -1
  29. package/dist/components/molecules/PillGroup/PillGroup.js +37 -27
  30. package/dist/components/molecules/PillGroup/pillGroupStyles.d.ts +3 -0
  31. package/dist/components/molecules/PillGroup/pillGroupStyles.d.ts.map +1 -1
  32. package/dist/components/molecules/PillGroup/pillGroupStyles.js +4 -3
  33. package/dist/components/molecules/Search/Search.d.ts +1 -1
  34. package/dist/components/molecules/Search/Search.d.ts.map +1 -1
  35. package/dist/components/molecules/Select/Select.d.ts +19 -1
  36. package/dist/components/molecules/Select/Select.d.ts.map +1 -1
  37. package/dist/components/molecules/Select/Select.js +102 -60
  38. package/dist/components/molecules/Select/selectStyles.d.ts +9 -1
  39. package/dist/components/molecules/Select/selectStyles.d.ts.map +1 -1
  40. package/dist/components/molecules/Select/selectStyles.js +11 -3
  41. package/dist/components/molecules/Select/usStateOptions.d.ts +8 -0
  42. package/dist/components/molecules/Select/usStateOptions.d.ts.map +1 -0
  43. package/dist/components/molecules/Select/usStateOptions.js +7 -0
  44. package/dist/components/molecules/StepProgress/StepProgress.d.ts.map +1 -1
  45. package/dist/components/molecules/StepProgress/StepProgress.js +1 -0
  46. package/dist/components/organisms/IntakeModal/IntakeModal.d.ts +3 -0
  47. package/dist/components/organisms/IntakeModal/IntakeModal.d.ts.map +1 -1
  48. package/dist/components/organisms/IntakeModal/IntakeModal.js +7 -7
  49. package/dist/components/organisms/IntakeModal/intakeModalStyles.js +1 -1
  50. package/dist/index.d.ts +3 -2
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +143 -141
  53. package/dist/styles.css +1 -1
  54. package/docs/components.md +1 -1
  55. package/docs/exports.json +1 -1
  56. package/docs/patterns/components-accordion--flush.tsx +1 -1
  57. package/docs/patterns/components-appshell--portal-dashboard-pattern.tsx +1 -1
  58. package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
  59. package/docs/patterns/components-badge--outline-tags.tsx +1 -1
  60. package/docs/patterns/components-badge--status-pill.tsx +1 -1
  61. package/docs/patterns/components-badge--with-avatar.tsx +1 -1
  62. package/docs/patterns/components-band--page-in-bands.tsx +1 -1
  63. package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
  64. package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
  65. package/docs/patterns/components-breadcrumb--path.tsx +1 -1
  66. package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
  67. package/docs/patterns/components-button-button--copy-button.tsx +1 -1
  68. package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
  69. package/docs/patterns/components-button-button--external-link.tsx +1 -1
  70. package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
  71. package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
  72. package/docs/patterns/components-button-button--link-render.tsx +1 -1
  73. package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
  74. package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
  75. package/docs/patterns/components-button-button--primary-action.tsx +1 -1
  76. package/docs/patterns/components-button-button--row-hug.tsx +1 -1
  77. package/docs/patterns/components-button-button--row-layout.tsx +1 -1
  78. package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
  79. package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
  80. package/docs/patterns/components-button-button--with-count.tsx +1 -1
  81. package/docs/patterns/components-button-button--with-icon.tsx +1 -1
  82. package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
  83. package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
  84. package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
  85. package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
  86. package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
  87. package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
  88. package/docs/patterns/components-card-card--terminal-frame.tsx +1 -1
  89. package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
  90. package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
  91. package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
  92. package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
  93. package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
  94. package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
  95. package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
  96. package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
  97. package/docs/patterns/components-chart--revenue-by-line.tsx +1 -1
  98. package/docs/patterns/components-chart--segmented-ring-pattern.tsx +1 -1
  99. package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
  100. package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
  101. package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
  102. package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
  103. package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
  104. package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
  105. package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
  106. package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
  107. package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
  108. package/docs/patterns/components-copyfield--clipboard-blocked.tsx +1 -1
  109. package/docs/patterns/components-copyfield--copied.tsx +1 -1
  110. package/docs/patterns/components-copyfield--copy-key.tsx +1 -1
  111. package/docs/patterns/components-copyfield--on-navy.tsx +1 -1
  112. package/docs/patterns/components-descriptionlist--details.tsx +1 -1
  113. package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
  114. package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
  115. package/docs/patterns/components-dialog--alert-dialog-typed-confirmation.tsx +1 -1
  116. package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
  117. package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
  118. package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
  119. package/docs/patterns/components-displaycontrols--theme-switch.tsx +1 -1
  120. package/docs/patterns/components-errorsummary--contact-form.tsx +1 -1
  121. package/docs/patterns/components-field--horizontal-input.tsx +1 -1
  122. package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
  123. package/docs/patterns/components-field--multi-control.tsx +1 -1
  124. package/docs/patterns/components-filterpanel--panel.tsx +1 -1
  125. package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
  126. package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
  127. package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
  128. package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
  129. package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
  130. package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
  131. package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
  132. package/docs/patterns/components-herointro--with-actions.tsx +1 -1
  133. package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
  134. package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
  135. package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
  136. package/docs/patterns/components-indexlist--post-index.tsx +1 -1
  137. package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
  138. package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
  139. package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
  140. package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
  141. package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
  142. package/docs/patterns/components-kbd--command-row.tsx +1 -1
  143. package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
  144. package/docs/patterns/components-kbd--shortcut.tsx +1 -1
  145. package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
  146. package/docs/patterns/components-linktile--router-link.tsx +1 -1
  147. package/docs/patterns/components-logview--detail-pane.tsx +1 -1
  148. package/docs/patterns/components-logview--log-viewer.tsx +1 -1
  149. package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
  150. package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
  151. package/docs/patterns/components-navlist--app-sidebar.tsx +1 -1
  152. package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
  153. package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
  154. package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
  155. package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
  156. package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
  157. package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +2 -2
  158. package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
  159. package/docs/patterns/components-prose--article-body.tsx +1 -1
  160. package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
  161. package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
  162. package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
  163. package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
  164. package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
  165. package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
  166. package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
  167. package/docs/patterns/components-sheet--side-sheet-header-actions.tsx +1 -1
  168. package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +1 -1
  169. package/docs/patterns/components-sheet--side-sheet.tsx +1 -1
  170. package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
  171. package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
  172. package/docs/patterns/components-sitenav--compact.tsx +1 -1
  173. package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
  174. package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
  175. package/docs/patterns/components-stat--hero-stat.tsx +1 -1
  176. package/docs/patterns/components-stat--insights-row.tsx +1 -1
  177. package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
  178. package/docs/patterns/components-switch--default.tsx +1 -1
  179. package/docs/patterns/components-switch--settings-row.tsx +1 -1
  180. package/docs/patterns/components-tab--settings-pages.tsx +1 -1
  181. package/docs/patterns/components-table--approvals-with-sheet.tsx +1 -1
  182. package/docs/patterns/components-table--approvals.tsx +1 -1
  183. package/docs/patterns/components-table--basic.tsx +1 -1
  184. package/docs/patterns/components-taskrows--action-details.tsx +1 -1
  185. package/docs/patterns/components-taskrows--capsules.tsx +1 -1
  186. package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
  187. package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
  188. package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
  189. package/docs/patterns/components-taskrows--needs-you-table.tsx +1 -1
  190. package/docs/patterns/components-taskrows--status-list.tsx +1 -1
  191. package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
  192. package/docs/patterns/components-textarea--save-status.tsx +1 -1
  193. package/docs/patterns/components-textlink--external-destination.tsx +1 -1
  194. package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
  195. package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
  196. package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
  197. package/docs/patterns/components-textsequence--default.tsx +1 -1
  198. package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
  199. package/docs/patterns/components-textsequence--shapes.tsx +1 -1
  200. package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
  201. package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
  202. package/docs/patterns/components-tooltip--controlled.tsx +1 -1
  203. package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
  204. package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
  205. package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
  206. package/docs/patterns/components-tooltip--placement.tsx +1 -1
  207. package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
  208. package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
  209. package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
  210. package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
  211. package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
  212. package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
  213. package/docs/patterns/guides-post-page--post-page.tsx +1 -1
  214. package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
  215. package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
  216. package/docs/patterns/index.json +1 -1
  217. package/package.json +1 -1
@@ -16,60 +16,75 @@ function _(e) {
16
16
  let t = g(e.children);
17
17
  t != null && t.props.label != null && console.warn("[WMDS Field] Child has its own `label` — omit one label source (Field or control).");
18
18
  }
19
- function v({ label: s, description: l, orientation: u = "vertical", htmlFor: d, disabled: v = !1, children: b, className: x }) {
20
- let S = f();
19
+ function v({ label: s, description: l, counter: u, orientation: d = "vertical", htmlFor: v, disabled: b = !1, children: x, className: S }) {
20
+ let C = f();
21
21
  _({
22
22
  label: s,
23
- children: b
23
+ children: x
24
24
  });
25
- let C = h(b), w = g(b), T = d ?? w?.props.id ?? (w == null ? void 0 : `${S}-control`), E = l == null ? void 0 : `${S}-description`, D = s == null ? void 0 : `${S}-legend`, O = w == null ? w : y(w, T, E), k = C > 1 ? /* @__PURE__ */ p("div", {
25
+ let w = h(x), T = g(x), E = v ?? T?.props.id ?? (T == null ? void 0 : `${C}-control`), D = l == null ? void 0 : `${C}-description`, O = u == null ? void 0 : `${C}-counter`, k = [D, O].filter(Boolean).join(" ") || void 0, A = s == null ? void 0 : `${C}-legend`, j = T == null ? T : y(T, E, k), M = w > 1 ? /* @__PURE__ */ p("div", {
26
26
  className: o,
27
- children: b
28
- }) : O ?? b, A = l == null ? null : /* @__PURE__ */ p("p", {
29
- id: E,
27
+ children: x
28
+ }) : j ?? x, N = l == null ? null : /* @__PURE__ */ p("p", {
29
+ id: D,
30
30
  className: t,
31
31
  children: l
32
+ }), P = u == null ? null : /* @__PURE__ */ p("p", {
33
+ id: O,
34
+ className: t,
35
+ "data-field-counter": "",
36
+ children: u
32
37
  });
33
- return s == null && l == null ? /* @__PURE__ */ p("div", {
34
- className: e("w-full", x),
35
- children: b
38
+ return s == null && l == null && u == null ? /* @__PURE__ */ p("div", {
39
+ className: e("w-full", S),
40
+ children: x
36
41
  }) : s == null ? /* @__PURE__ */ m("div", {
37
- className: e(c, x),
38
- children: [C > 1 ? b : O ?? b, A]
39
- }) : C > 1 ? /* @__PURE__ */ m("div", {
42
+ className: e(c, S),
43
+ children: [
44
+ N,
45
+ w > 1 ? x : j ?? x,
46
+ P
47
+ ]
48
+ }) : w > 1 ? /* @__PURE__ */ m("div", {
40
49
  role: "group",
41
- "aria-labelledby": D,
42
- "aria-describedby": E,
43
- className: e(c, x),
50
+ "aria-labelledby": A,
51
+ "aria-describedby": k,
52
+ className: e(c, S),
44
53
  children: [
45
54
  /* @__PURE__ */ p("span", {
46
- id: D,
47
- className: a(v),
55
+ id: A,
56
+ className: a(b),
48
57
  children: s
49
58
  }),
50
- k,
51
- A
59
+ N,
60
+ M,
61
+ P
52
62
  ]
53
- }) : u === "horizontal" ? /* @__PURE__ */ m("div", {
54
- className: e(i, x),
63
+ }) : d === "horizontal" ? /* @__PURE__ */ m("div", {
64
+ className: e(i, S),
55
65
  children: [/* @__PURE__ */ p("label", {
56
- htmlFor: T,
57
- className: e(r, a(v)),
66
+ htmlFor: E,
67
+ className: e(r, a(b)),
58
68
  children: s
59
69
  }), /* @__PURE__ */ m("div", {
60
70
  className: n,
61
- children: [k, A]
71
+ children: [
72
+ N,
73
+ M,
74
+ P
75
+ ]
62
76
  })]
63
77
  }) : /* @__PURE__ */ m("div", {
64
- className: e(c, x),
78
+ className: e(c, S),
65
79
  children: [
66
80
  /* @__PURE__ */ p("label", {
67
- htmlFor: T,
68
- className: a(v),
81
+ htmlFor: E,
82
+ className: a(b),
69
83
  children: s
70
84
  }),
71
- k,
72
- A
85
+ N,
86
+ M,
87
+ P
73
88
  ]
74
89
  });
75
90
  }
@@ -2,12 +2,15 @@ export declare const fieldOrientations: readonly ["vertical", "horizontal"];
2
2
  export type FieldOrientation = (typeof fieldOrientations)[number];
3
3
  /** Vertical label → control → description — matches Input field stack rhythm. */
4
4
  export declare const fieldVerticalStackClasses = "flex w-full flex-col gap-1.5";
5
- /** Label beside control — Stripe-style two-column row. */
6
- export declare const fieldHorizontalStackClasses = "flex w-full items-start gap-4";
7
- /** Left label column — fixed band; control column flexes. */
8
- export declare const fieldHorizontalLabelColumnClasses = "w-[7.5rem] shrink-0 pt-2.5 md:w-32";
9
- /** Right control column in horizontal layout. */
10
- export declare const fieldHorizontalControlColumnClasses = "flex min-w-0 flex-1 flex-col gap-1.5";
5
+ /**
6
+ * Label beside control — Stripe-style two-column row, from `lg` (1024) only. Below that it stacks like
7
+ * the vertical Field, since a side label squeezes the control on phones and tablets (Form layout L8).
8
+ */
9
+ export declare const fieldHorizontalStackClasses = "flex w-full flex-col gap-1.5 lg:flex-row lg:items-start lg:gap-4";
10
+ /** Left label column from `lg` — fixed band; control column flexes. Stacked above the control below `lg`. */
11
+ export declare const fieldHorizontalLabelColumnClasses = "lg:w-32 lg:shrink-0 lg:pt-2.5";
12
+ /** Right control column in horizontal layout (full width while stacked). */
13
+ export declare const fieldHorizontalControlColumnClasses = "flex w-full min-w-0 flex-col gap-1.5 lg:flex-1";
11
14
  /** Gap between multiple controls under one label. */
12
15
  export declare const fieldMultiControlStackClasses = "flex w-full flex-col gap-2";
13
16
  export declare const fieldLabelClasses: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fieldStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Field/fieldStyles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,qCAAsC,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,iCAAiC,CAAC;AAExE,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,kCAAkC,CAAC;AAE3E,6DAA6D;AAC7D,eAAO,MAAM,iCAAiC,uCACR,CAAC;AAEvC,iDAAiD;AACjD,eAAO,MAAM,mCAAmC,yCACR,CAAC;AAEzC,qDAAqD;AACrD,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E,eAAO,MAAM,iBAAiB,QAA8B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,QAA6B,CAAC;AAElE,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAE/D"}
1
+ {"version":3,"file":"fieldStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Field/fieldStyles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,qCAAsC,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,iCAAiC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,qEAAqE,CAAC;AAE9G,6GAA6G;AAC7G,eAAO,MAAM,iCAAiC,kCAAkC,CAAC;AAEjF,4EAA4E;AAC5E,eAAO,MAAM,mCAAmC,mDACE,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E,eAAO,MAAM,iBAAiB,QAA8B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,QAA6B,CAAC;AAElE,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAE/D"}
@@ -3,7 +3,7 @@ import { cn as e } from "../../../lib/cn.js";
3
3
  import { typographyClass as t } from "../../../lib/typography.js";
4
4
  import "../../atoms/Input/inputShellStyles.js";
5
5
  //#region src/components/molecules/Field/fieldStyles.ts
6
- var n = ["vertical", "horizontal"], r = "flex w-full flex-col gap-1.5", i = "flex w-full items-start gap-4", a = "w-[7.5rem] shrink-0 pt-2.5 md:w-32", o = "flex min-w-0 flex-1 flex-col gap-1.5", s = "flex w-full flex-col gap-2", c = t("ui-label"), l = t("caption");
6
+ var n = ["vertical", "horizontal"], r = "flex w-full flex-col gap-1.5", i = "flex w-full flex-col gap-1.5 lg:flex-row lg:items-start lg:gap-4", a = "lg:w-32 lg:shrink-0 lg:pt-2.5", o = "flex w-full min-w-0 flex-col gap-1.5 lg:flex-1", s = "flex w-full flex-col gap-2", c = t("ui-label"), l = t("caption");
7
7
  function u(t) {
8
8
  return e(c, t && "opacity-50");
9
9
  }
@@ -16,27 +16,37 @@ export interface IntakeFormProps {
16
16
  /** Character ceiling for project details. Default 400. */
17
17
  detailsMax?: number;
18
18
  /**
19
- * Shows the optional Company field. Default `true`. Left out, the form closes up and
19
+ * Shows the optional Company field. Default `false` (Required and optional Q9: ask less). Left out, the form closes up and
20
20
  * `values.company` keeps its value (empty), so `isIntakeAboutValid` and the app's submit code are
21
21
  * unchanged.
22
22
  */
23
23
  company?: boolean;
24
24
  /**
25
- * Shows the optional Link field. Default `true`. Left out, the form closes up and `values.url`
25
+ * Shows the optional website field ("Your website", with an Optional badge). Default `true`. Left out, the form closes up and `values.url`
26
26
  * keeps its value (empty, which is valid).
27
27
  */
28
28
  link?: boolean;
29
+ /**
30
+ * How many times Continue was pressed on this step (the caller counts; Buttons U6: Continue stays
31
+ * enabled). From 1 on, every field shows its error. Two or more errors put an **ErrorSummary** at the
32
+ * top and focus it; one error focuses its field (Errors and validation V5). Default 0.
33
+ */
34
+ submitCount?: number;
29
35
  className?: IntakeFormLayoutClassName;
30
36
  }
31
37
  /** Empty link is fine. A filled value must be an http(s) URL. */
32
38
  export declare function isIntakeUrlValid(value: string | null | undefined): boolean;
33
39
  /** Name, a real email, and details within the counter. Company and link stay optional. */
34
40
  export declare function isIntakeAboutValid(values: IntakeAboutValues, detailsMax?: number): boolean;
41
+ /** Form layout L9: what the counter says. People may type past the limit; the counter tells them by how much. */
42
+ export declare function intakeCounterText(length: number, max: number): string;
35
43
  /**
36
44
  * About-you step — **Field** rows for name, email, company, link, and project details.
37
45
  * Required fields show **Input** / **TextArea** `status` + `message` on blur when invalid.
38
- * Company and link stay optional; `company={false}` and `link={false}` leave them out (the short
39
- * form: name, email, details). The details description is the character counter.
46
+ * Name, email and details are required (`aria-required`); the website is optional and says so with a
47
+ * badge. Company is off by default (`company` shows it, labelled "Company (optional)"); `link={false}`
48
+ * leaves the website out (the short form: name, email, details). Hints sit above their fields; the details
49
+ * counter sits below the box, next to what it counts.
40
50
  */
41
- export declare function IntakeForm({ values, onChange, detailsMax, company, link, className, }: IntakeFormProps): import("react").JSX.Element;
51
+ export declare function IntakeForm({ values, onChange, detailsMax, company, link, submitCount, className, }: IntakeFormProps): import("react").JSX.Element;
42
52
  //# sourceMappingURL=IntakeForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntakeForm.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/IntakeForm/IntakeForm.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qCAAqC;AACrC,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAM9B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC;AAMD,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAW1E;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,UAAU,GAAE,MAAyB,GACpC,OAAO,CAQT;AA+BD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,UAA6B,EAC7B,OAAc,EACd,IAAW,EACX,SAAS,GACV,EAAE,eAAe,+BAuFjB"}
1
+ {"version":3,"file":"IntakeForm.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/IntakeForm/IntakeForm.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qCAAqC;AACrC,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAM9B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC;AAMD,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAW1E;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,UAAU,GAAE,MAAyB,GACpC,OAAO,CAQT;AAID,iHAAiH;AACjH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AA0CD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,UAA6B,EAC7B,OAAe,EACf,IAAW,EACX,WAAe,EACf,SAAS,GACV,EAAE,eAAe,+BA+HjB"}
@@ -1,20 +1,22 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/cn.js";
3
- import { Input as t } from "../../atoms/Input/Input.js";
4
- import { TextArea as n } from "../../atoms/TextArea/TextArea.js";
5
- import { Field as r } from "../Field/Field.js";
6
- import { intakeDetailsMax as i, intakeFormClasses as a } from "./intakeFormStyles.js";
7
- import { useState as o } from "react";
8
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import { Badge as t } from "../../atoms/Badge/Badge.js";
4
+ import { Input as n } from "../../atoms/Input/Input.js";
5
+ import { TextArea as r } from "../../atoms/TextArea/TextArea.js";
6
+ import { Field as i } from "../Field/Field.js";
7
+ import { ErrorSummary as a } from "../ErrorSummary/ErrorSummary.js";
8
+ import { intakeDetailsMax as o, intakeFormClasses as s } from "./intakeFormStyles.js";
9
+ import { useEffect as c, useId as l, useState as u } from "react";
10
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
11
  //#region src/components/molecules/IntakeForm/IntakeForm.tsx
10
- var l = {
12
+ var p = {
11
13
  name: "",
12
14
  email: "",
13
15
  company: "",
14
16
  url: "",
15
17
  details: ""
16
- }, u = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
17
- function d(e) {
18
+ }, m = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
19
+ function h(e) {
18
20
  let t = (e ?? "").trim();
19
21
  if (t.length === 0) return !0;
20
22
  try {
@@ -24,112 +26,150 @@ function d(e) {
24
26
  return !1;
25
27
  }
26
28
  }
27
- function f(e, t = 400) {
28
- return e.name.trim().length > 0 && u.test(e.email.trim()) && d(e.url) && e.details.trim().length > 0 && e.details.length <= t;
29
+ function g(e, t = 400) {
30
+ return e.name.trim().length > 0 && m.test(e.email.trim()) && h(e.url) && e.details.trim().length > 0 && e.details.length <= t;
29
31
  }
30
- function p(e, t, n) {
32
+ var _ = (e) => `${e} character${e === 1 ? "" : "s"}`;
33
+ function v(e, t) {
34
+ return e > t ? `You have ${_(e - t)} too many` : `${_(t - e)} left`;
35
+ }
36
+ function y(e, t = 1e3) {
37
+ let [n, r] = u(e);
38
+ return c(() => {
39
+ let n = setTimeout(() => r(e), t);
40
+ return () => clearTimeout(n);
41
+ }, [e, t]), n;
42
+ }
43
+ function b(e, t, n) {
31
44
  if (e === "name") return t.name.trim().length === 0 ? "Enter your name." : void 0;
32
- if (e === "email") return t.email.trim().length === 0 ? "Enter your email address." : u.test(t.email.trim()) ? void 0 : "Enter an email address like name@example.com.";
33
- if (e === "url") return d(t.url) ? void 0 : "Enter a website address like example.com.";
45
+ if (e === "email") return t.email.trim().length === 0 ? "Enter your email address." : m.test(t.email.trim()) ? void 0 : "Enter an email address like name@example.com.";
46
+ if (e === "url") return h(t.url) ? void 0 : "Enter a website address like example.com.";
34
47
  if (t.details.trim().length === 0) return "Tell us a bit about the project.";
35
- if (t.details.length > n) return `Keep project details to ${n} characters.`;
48
+ if (t.details.length > n) return v(t.details.length, n);
36
49
  }
37
- function m({ values: i, onChange: l, detailsMax: u = 400, company: d = !0, link: f = !0, className: m }) {
38
- let [h, g] = o({});
39
- function _(e) {
40
- g((t) => t[e] ? t : {
50
+ function x({ values: o, onChange: p, detailsMax: m = 400, company: h = !1, link: g = !0, submitCount: _ = 0, className: x }) {
51
+ let [S, C] = u({}), w = l(), T = (e) => `${w}-${e}`, E = _ > 0;
52
+ function D(e) {
53
+ C((t) => t[e] ? t : {
41
54
  ...t,
42
55
  [e]: !0
43
56
  });
44
57
  }
45
- function v(e) {
46
- if (h[e]) return p(e, i, u);
58
+ function O(e) {
59
+ if (!(!S[e] && !E)) return b(e, o, m);
47
60
  }
48
- let y = v("name"), b = v("email"), x = v("url"), S = v("details");
49
- return /* @__PURE__ */ c("div", {
50
- className: e(a, m),
61
+ let k = O("name"), A = O("email"), j = O("url"), M = O("details"), N = v(o.details.length, m), P = y(N), F = E ? [
62
+ ["name", k],
63
+ ["email", A],
64
+ ...g ? [["url", j]] : [],
65
+ ["details", M]
66
+ ].filter(([, e]) => e != null).map(([e, t]) => ({
67
+ field: T(e),
68
+ message: t
69
+ })) : [], I = F.length === 1 ? F[0].field : void 0;
70
+ return c(() => {
71
+ _ > 0 && I != null && document.getElementById(I)?.focus();
72
+ }, [_]), /* @__PURE__ */ f("div", {
73
+ className: e(s, x),
51
74
  children: [
52
- /* @__PURE__ */ s(r, {
75
+ F.length >= 2 ? /* @__PURE__ */ d(a, { errors: F }, _) : null,
76
+ /* @__PURE__ */ d(i, {
53
77
  label: "Name",
54
- children: /* @__PURE__ */ s(t, {
78
+ children: /* @__PURE__ */ d(n, {
79
+ id: T("name"),
55
80
  "aria-label": "Name",
81
+ "aria-required": !0,
56
82
  autoComplete: "name",
57
- value: i.name,
58
- status: y == null ? void 0 : "error",
59
- message: y,
60
- onBlur: () => _("name"),
61
- onChange: (e) => l({
62
- ...i,
83
+ value: o.name,
84
+ status: k == null ? void 0 : "error",
85
+ message: k,
86
+ onBlur: () => D("name"),
87
+ onChange: (e) => p({
88
+ ...o,
63
89
  name: e.target.value
64
90
  })
65
91
  })
66
92
  }),
67
- /* @__PURE__ */ s(r, {
93
+ /* @__PURE__ */ d(i, {
68
94
  label: "Email",
69
- children: /* @__PURE__ */ s(t, {
95
+ children: /* @__PURE__ */ d(n, {
96
+ id: T("email"),
70
97
  "aria-label": "Email",
98
+ "aria-required": !0,
71
99
  type: "email",
72
100
  autoComplete: "email",
73
- value: i.email,
74
- status: b == null ? void 0 : "error",
75
- message: b,
76
- onBlur: () => _("email"),
77
- onChange: (e) => l({
78
- ...i,
101
+ value: o.email,
102
+ status: A == null ? void 0 : "error",
103
+ message: A,
104
+ onBlur: () => D("email"),
105
+ onChange: (e) => p({
106
+ ...o,
79
107
  email: e.target.value
80
108
  })
81
109
  })
82
110
  }),
83
- d ? /* @__PURE__ */ s(r, {
84
- label: "Company",
85
- description: "Optional",
86
- children: /* @__PURE__ */ s(t, {
87
- "aria-label": "Company",
111
+ h ? /* @__PURE__ */ d(i, {
112
+ label: "Company (optional)",
113
+ description: "So we can read up on you first.",
114
+ children: /* @__PURE__ */ d(n, {
115
+ "aria-label": "Company (optional)",
88
116
  autoComplete: "organization",
89
- value: i.company,
90
- onChange: (e) => l({
91
- ...i,
117
+ value: o.company,
118
+ onChange: (e) => p({
119
+ ...o,
92
120
  company: e.target.value
93
121
  })
94
122
  })
95
123
  }) : null,
96
- f ? /* @__PURE__ */ s(r, {
97
- label: "Link",
98
- description: "Optional",
99
- children: /* @__PURE__ */ s(t, {
100
- "aria-label": "Link",
124
+ g ? /* @__PURE__ */ d(i, {
125
+ label: "Your website",
126
+ description: "So we can see what you have now.",
127
+ children: /* @__PURE__ */ d(n, {
128
+ id: T("url"),
129
+ "aria-label": "Your website",
130
+ endBadge: /* @__PURE__ */ d(t, {
131
+ size: "sm",
132
+ children: "Optional"
133
+ }),
101
134
  type: "url",
102
135
  inputMode: "url",
103
136
  autoComplete: "url",
104
- value: i.url,
105
- status: x == null ? void 0 : "error",
106
- message: x,
107
- onBlur: () => _("url"),
108
- onChange: (e) => l({
109
- ...i,
137
+ value: o.url,
138
+ status: j == null ? void 0 : "error",
139
+ message: j,
140
+ onBlur: () => D("url"),
141
+ onChange: (e) => p({
142
+ ...o,
110
143
  url: e.target.value
111
144
  })
112
145
  })
113
146
  }) : null,
114
- /* @__PURE__ */ s(r, {
147
+ /* @__PURE__ */ d(i, {
115
148
  label: "What should feel different when this work is done?",
116
- description: S == null ? `${i.details.length} / ${u}` : void 0,
117
- children: /* @__PURE__ */ s(n, {
149
+ counter: M == null ? N : void 0,
150
+ children: /* @__PURE__ */ d(r, {
151
+ id: T("details"),
118
152
  "aria-label": "What should feel different when this work is done?",
153
+ "aria-required": !0,
119
154
  rows: 5,
120
- maxLength: u,
121
- value: i.details,
122
- status: S == null ? void 0 : "error",
123
- message: S,
124
- onBlur: () => _("details"),
125
- onChange: (e) => l({
126
- ...i,
155
+ value: o.details,
156
+ status: M == null ? void 0 : "error",
157
+ message: M,
158
+ onBlur: () => D("details"),
159
+ onChange: (e) => p({
160
+ ...o,
127
161
  details: e.target.value
128
162
  })
129
163
  })
164
+ }),
165
+ /* @__PURE__ */ d("p", {
166
+ className: "sr-only",
167
+ "aria-live": "polite",
168
+ "data-intake-counter-live": "",
169
+ children: P
130
170
  })
131
171
  ]
132
172
  });
133
173
  }
134
174
  //#endregion
135
- export { m as IntakeForm, l as intakeAboutEmpty, i as intakeDetailsMax, f as isIntakeAboutValid, d as isIntakeUrlValid };
175
+ export { x as IntakeForm, p as intakeAboutEmpty, v as intakeCounterText, o as intakeDetailsMax, g as isIntakeAboutValid, h as isIntakeUrlValid };
@@ -4,8 +4,12 @@ export type PillGroupLayoutClassName = string;
4
4
  export declare const pillGroupEmphases: readonly ["solid", "muted"];
5
5
  export type PillGroupEmphasis = (typeof pillGroupEmphases)[number];
6
6
  export interface PillGroupProps {
7
- /** Accessible name for the radio group. */
8
- "aria-label": string;
7
+ /**
8
+ * The question, shown above the pills and naming the group (Dropdowns C2, C9). Prefer it to `aria-label`.
9
+ */
10
+ label?: ReactNode;
11
+ /** Accessible name when the question is visible elsewhere (a heading right above). */
12
+ "aria-label"?: string;
9
13
  value: string | null;
10
14
  onValueChange: (value: string) => void;
11
15
  children: ReactNode;
@@ -21,7 +25,7 @@ export interface PillGroupItemProps {
21
25
  emphasis?: PillGroupEmphasis;
22
26
  className?: PillGroupLayoutClassName;
23
27
  }
24
- declare function PillGroupRoot({ "aria-label": ariaLabel, value, onValueChange, children, className, }: PillGroupProps): import("react").JSX.Element;
28
+ declare function PillGroupRoot({ label, "aria-label": ariaLabel, value, onValueChange, children, className, }: PillGroupProps): import("react").JSX.Element;
25
29
  /** One radio pill. Wraps with its siblings. */
26
30
  declare function PillGroupItem({ value, children, emphasis, className, }: PillGroupItemProps): import("react").JSX.Element;
27
31
  export declare const PillGroup: typeof PillGroupRoot & {
@@ -1 +1 @@
1
- {"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,qCAAqC;AACrC,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAkBnE,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC;AASD,iBAAS,aAAa,CAAC,EACrB,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,+BAchB;AAED,+CAA+C;AAC/C,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,QAAkB,EAClB,SAAS,GACV,EAAE,kBAAkB,+BAiBpB;AAED,eAAO,MAAM,SAAS;;CAEpB,CAAC"}
1
+ {"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAWf,qCAAqC;AACrC,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAkBnE,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC;AASD,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,+BAgChB;AAED,+CAA+C;AAC/C,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,QAAkB,EAClB,SAAS,GACV,EAAE,kBAAkB,+BAiBpB;AAED,eAAO,MAAM,SAAS;;CAEpB,CAAC"}
@@ -1,53 +1,63 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/cn.js";
3
- import { pillGroupClasses as t, pillGroupIdleClasses as n, pillGroupMutedClasses as r, pillGroupSelectedClasses as i } from "./pillGroupStyles.js";
4
- import { createContext as a, useContext as o, useId as s } from "react";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
3
+ import { pillGroupClasses as t, pillGroupFieldClasses as n, pillGroupIdleClasses as r, pillGroupLabelClasses as i, pillGroupMutedClasses as a, pillGroupSelectedClasses as o } from "./pillGroupStyles.js";
4
+ import { createContext as s, useContext as c, useId as l } from "react";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
6
  //#region src/components/molecules/PillGroup/PillGroup.tsx
7
- var u = ["solid", "muted"], d = a(null);
8
- function f(e) {
9
- let t = o(d);
7
+ var f = ["solid", "muted"], p = s(null);
8
+ function m(e) {
9
+ let t = c(p);
10
10
  if (t == null) throw Error(`${e} must be used inside PillGroup.`);
11
11
  return t;
12
12
  }
13
- function p(e, t) {
14
- return e ? i : t === "muted" ? r : n;
13
+ function h(e, t) {
14
+ return e ? o : t === "muted" ? a : r;
15
15
  }
16
- function m({ "aria-label": n, value: r, onValueChange: i, children: a, className: o }) {
17
- let l = s();
18
- return /* @__PURE__ */ c(d.Provider, {
16
+ function g({ label: r, "aria-label": a, value: o, onValueChange: s, children: c, className: f }) {
17
+ let m = l(), h = `${m}-label`;
18
+ r == null && a == null && console.warn("[WMDS PillGroup] Provide `label` (the question) or `aria-label`.");
19
+ let g = /* @__PURE__ */ u("div", {
20
+ role: "radiogroup",
21
+ "aria-label": r == null ? a : void 0,
22
+ "aria-labelledby": r == null ? void 0 : h,
23
+ className: e(t, r == null && f),
24
+ children: c
25
+ });
26
+ return /* @__PURE__ */ u(p.Provider, {
19
27
  value: {
20
- name: l,
21
- value: r,
22
- onValueChange: i
28
+ name: m,
29
+ value: o,
30
+ onValueChange: s
23
31
  },
24
- children: /* @__PURE__ */ c("div", {
25
- role: "radiogroup",
26
- "aria-label": n,
27
- className: e(t, o),
28
- children: a
32
+ children: r == null ? g : /* @__PURE__ */ d("div", {
33
+ className: e(n, f),
34
+ children: [/* @__PURE__ */ u("span", {
35
+ id: h,
36
+ className: i,
37
+ children: r
38
+ }), g]
29
39
  })
30
40
  });
31
41
  }
32
- function h({ value: t, children: n, emphasis: r = "solid", className: i }) {
33
- let a = f("PillGroup.Item"), o = a.value === t;
34
- return /* @__PURE__ */ l("label", {
42
+ function _({ value: t, children: n, emphasis: r = "solid", className: i }) {
43
+ let a = m("PillGroup.Item"), o = a.value === t;
44
+ return /* @__PURE__ */ d("label", {
35
45
  className: "inline-flex",
36
46
  "data-emphasis": r,
37
47
  "data-value": t,
38
- children: [/* @__PURE__ */ c("input", {
48
+ children: [/* @__PURE__ */ u("input", {
39
49
  type: "radio",
40
50
  className: "peer sr-only",
41
51
  name: a.name,
42
52
  value: t,
43
53
  checked: o,
44
54
  onChange: () => a.onValueChange(t)
45
- }), /* @__PURE__ */ c("span", {
46
- className: e(p(o, r), i),
55
+ }), /* @__PURE__ */ u("span", {
56
+ className: e(h(o, r), i),
47
57
  children: n
48
58
  })]
49
59
  });
50
60
  }
51
- var g = Object.assign(m, { Item: h });
61
+ var v = Object.assign(g, { Item: _ });
52
62
  //#endregion
53
- export { g as PillGroup, u as pillGroupEmphases };
63
+ export { v as PillGroup, f as pillGroupEmphases };
@@ -10,4 +10,7 @@ export declare const pillGroupIdleClasses: string;
10
10
  export declare const pillGroupMutedClasses: string;
11
11
  /** Selected pill — brand navy fill. Owned by PillGroup, not a Badge variant. */
12
12
  export declare const pillGroupSelectedClasses: string;
13
+ /** Question above the pills (Dropdowns C2, C9). */
14
+ export declare const pillGroupFieldClasses = "flex flex-col gap-2";
15
+ export declare const pillGroupLabelClasses: string;
13
16
  //# sourceMappingURL=pillGroupStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pillGroupStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PillGroup/pillGroupStyles.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,QAIjC,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,oBAAoB,QAAuD,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAuD,CAAC;AAE1F,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,QAGpC,CAAC"}
1
+ {"version":3,"file":"pillGroupStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/PillGroup/pillGroupStyles.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,QAIjC,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,oBAAoB,QAAuD,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAuD,CAAC;AAE1F,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,QAGpC,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D,eAAO,MAAM,qBAAqB,QAA8B,CAAC"}
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../../lib/cn.js";
3
- import { badgeBaseClasses as t, badgeMutedClasses as n, badgeSolidClasses as r } from "../../atoms/Badge/badgeStyles.js";
3
+ import { typographyClass as t } from "../../../lib/typography.js";
4
+ import { badgeBaseClasses as n, badgeMutedClasses as r, badgeSolidClasses as i } from "../../atoms/Badge/badgeStyles.js";
4
5
  //#region src/components/molecules/PillGroup/pillGroupStyles.ts
5
- var i = "flex flex-wrap gap-2", a = e(t, "min-h-11 cursor-pointer rounded-[var(--radius-control)] px-4", "peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-body"), o = e(a, r.neutral), s = e(a, n.neutral), c = e(a, "border border-transparent bg-brand text-on-brand");
6
+ var a = "flex flex-wrap gap-2", o = e(n, "min-h-11 cursor-pointer rounded-[var(--radius-control)] px-4", "peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-body"), s = e(o, i.neutral), c = e(o, r.neutral), l = e(o, "border border-transparent bg-brand text-on-brand"), u = "flex flex-col gap-2", d = t("ui-label");
6
7
  //#endregion
7
- export { i as pillGroupClasses, o as pillGroupIdleClasses, s as pillGroupMutedClasses, c as pillGroupSelectedClasses, a as pillGroupShapeClasses };
8
+ export { a as pillGroupClasses, u as pillGroupFieldClasses, s as pillGroupIdleClasses, d as pillGroupLabelClasses, c as pillGroupMutedClasses, l as pillGroupSelectedClasses, o as pillGroupShapeClasses };
@@ -5,7 +5,7 @@ export type { SearchSize } from "./searchStyles";
5
5
  export { searchSizes } from "./searchStyles";
6
6
  /** Layout-only — width, margin, flex placement. */
7
7
  export type SearchLayoutClassName = string;
8
- export interface SearchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
8
+ export interface SearchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "width"> {
9
9
  size?: SearchSize;
10
10
  /**
11
11
  * The field's name, read by screen readers (Labels and placeholders F7, F10). It may stay visually
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Search/Search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,0GA4CjB,CAAC"}
1
+ {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Search/Search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACrE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,0GA4CjB,CAAC"}