@thewhatmatters/wmds 0.4.31 → 0.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/bin/wmds-check.mjs +38 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +73 -72
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +44 -49
- package/dist/components/atoms/Input/inputShellStyles.js +2 -2
- package/dist/components/atoms/Radio/Radio.d.ts.map +1 -1
- package/dist/components/atoms/Radio/Radio.js +61 -60
- package/dist/components/atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/atoms/Switch/Switch.js +31 -30
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +56 -55
- package/dist/components/atoms/TextArea/textareaShellStyles.js +2 -2
- package/dist/components/atoms/inputShared/InputStatusBanner.d.ts +5 -0
- package/dist/components/atoms/inputShared/InputStatusBanner.d.ts.map +1 -1
- package/dist/components/atoms/inputShared/InputStatusBanner.js +15 -4
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.js +53 -53
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts.map +1 -1
- package/dist/components/molecules/CopyField/copyFieldStyles.js +1 -1
- package/dist/components/molecules/ErrorSummary/ErrorSummary.d.ts +32 -0
- package/dist/components/molecules/ErrorSummary/ErrorSummary.d.ts.map +1 -0
- package/dist/components/molecules/ErrorSummary/ErrorSummary.js +37 -0
- package/dist/components/molecules/ErrorSummary/errorSummaryStyles.d.ts +12 -0
- package/dist/components/molecules/ErrorSummary/errorSummaryStyles.d.ts.map +1 -0
- package/dist/components/molecules/ErrorSummary/errorSummaryStyles.js +5 -0
- package/dist/components/molecules/IntakeForm/IntakeForm.d.ts.map +1 -1
- package/dist/components/molecules/IntakeForm/IntakeForm.js +4 -6
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts +3 -2
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/promptBarStyles.js +2 -2
- package/dist/components/molecules/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/RadioGroup.js +53 -53
- package/dist/components/molecules/Search/Search.d.ts +5 -0
- package/dist/components/molecules/Search/Search.d.ts.map +1 -1
- package/dist/components/molecules/Search/Search.js +14 -13
- package/dist/components/molecules/Search/searchStyles.d.ts +2 -1
- package/dist/components/molecules/Search/searchStyles.d.ts.map +1 -1
- package/dist/components/molecules/Search/searchStyles.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +1 -1
- package/docs/components.md +2 -1
- package/docs/exports.json +14 -1
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-appshell--portal-dashboard-pattern.tsx +1 -1
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--status-pill.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-band--page-in-bands.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-card--terminal-frame.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--revenue-by-line.tsx +1 -1
- package/docs/patterns/components-chart--segmented-ring-pattern.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-copyfield--clipboard-blocked.tsx +1 -1
- package/docs/patterns/components-copyfield--copied.tsx +1 -1
- package/docs/patterns/components-copyfield--copy-key.tsx +1 -1
- package/docs/patterns/components-copyfield--on-navy.tsx +1 -1
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-typed-confirmation.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +3 -3
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-displaycontrols--theme-switch.tsx +1 -1
- package/docs/patterns/components-errorsummary--contact-form.tsx +35 -0
- package/docs/patterns/components-field--horizontal-input.tsx +2 -2
- package/docs/patterns/components-field--horizontal-text-area.tsx +2 -2
- package/docs/patterns/components-field--multi-control.tsx +2 -2
- package/docs/patterns/components-filterpanel--panel.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herointro--with-actions.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
- package/docs/patterns/components-linktile--router-link.tsx +1 -1
- package/docs/patterns/components-logview--detail-pane.tsx +1 -1
- package/docs/patterns/components-logview--log-viewer.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--app-sidebar.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +3 -3
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet-header-actions.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--hero-stat.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-table--approvals-with-sheet.tsx +1 -1
- package/docs/patterns/components-table--approvals.tsx +1 -1
- package/docs/patterns/components-table--basic.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--needs-you-table.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textarea--save-status.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +3 -3
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
- package/docs/patterns/index.json +9 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAMf,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAaD;;;GAGG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAMf,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAaD;;;GAGG;AACH,eAAO,MAAM,MAAM,0GAgLjB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
4
|
import "../Input/inputShellStyles.js";
|
|
5
|
-
import { InputStatusBanner as ee } from "../inputShared/InputStatusBanner.js";
|
|
6
|
-
import { switchDescriptionClasses as
|
|
7
|
-
import { forwardRef as
|
|
5
|
+
import { InputStatusBanner as ee, warnStatusWithoutMessage as n } from "../inputShared/InputStatusBanner.js";
|
|
6
|
+
import { switchDescriptionClasses as te, switchDescriptionRowClasses as r, switchHiddenInputClasses as i, switchHitTargetDescriptionAlignClasses as ne, switchHitTargetSizeClasses as re, switchLabelClassesFor as a, switchLayouts as o, switchRowBaseClasses as ie, switchRowLabelOnlyClasses as s, switchRowSizeClasses as ae, switchSettingsRowClasses as oe, switchSizes as c, switchStatusBannerClassesFor as l, switchTextColumnClasses as u, switchThumbClasses as d, switchThumbOffsetPx as f, switchThumbSizeClasses as p, switchTrackClassesFor as se } from "./switchStyles.js";
|
|
7
|
+
import { forwardRef as m, useId as ce, useState as h } from "react";
|
|
8
8
|
import { Loader2 as g } from "lucide-react";
|
|
9
9
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
10
10
|
import { motion as b } from "motion/react";
|
|
@@ -16,24 +16,25 @@ var x = {
|
|
|
16
16
|
function S(e) {
|
|
17
17
|
e.message != null && e.status == null && console.warn("[WMDS Switch] `message` requires `status`.");
|
|
18
18
|
}
|
|
19
|
-
var C =
|
|
20
|
-
|
|
19
|
+
var C = m(function({ size: o = "md", layout: c = "inline", label: m, labelHidden: C = !1, description: w, status: T, message: E, loading: D = !1, className: O, disabled: k, readOnly: A, checked: j, defaultChecked: M, id: N, onChange: P, ...F }, I) {
|
|
20
|
+
n("Switch", T, E);
|
|
21
|
+
let L = ce(), R = N ?? L;
|
|
21
22
|
S({
|
|
22
23
|
status: T,
|
|
23
24
|
message: E
|
|
24
25
|
});
|
|
25
|
-
let z = j !== void 0, [B, V] =
|
|
26
|
+
let z = j !== void 0, [B, V] = h(M ?? !1), H = z ? !!j : B, U = k || D, W = D && !k, G = E != null && E.length > 0 && T != null, K = G ? `${R}-message` : void 0, q = w != null && !C ? `${R}-description` : void 0, le = [
|
|
26
27
|
F["aria-describedby"],
|
|
27
28
|
q,
|
|
28
29
|
K
|
|
29
|
-
].filter(Boolean).join(" ") || void 0,
|
|
30
|
+
].filter(Boolean).join(" ") || void 0, ue = (e) => {
|
|
30
31
|
if (A || W) {
|
|
31
32
|
e.preventDefault();
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
z || V(e.target.checked), P?.(e);
|
|
35
|
-
},
|
|
36
|
-
className: e("relative flex shrink-0 items-center justify-center",
|
|
36
|
+
}, de = se(o, H, U, G ? void 0 : T), J = w != null && !C, Y = t("fast"), X = f[o], Z = (t) => /* @__PURE__ */ y("span", {
|
|
37
|
+
className: e("relative flex shrink-0 items-center justify-center", re[o], t),
|
|
37
38
|
children: [/* @__PURE__ */ v("input", {
|
|
38
39
|
...F,
|
|
39
40
|
ref: I,
|
|
@@ -46,15 +47,15 @@ var C = h(function({ size: s = "md", layout: l = "inline", label: h, labelHidden
|
|
|
46
47
|
"aria-disabled": W || void 0,
|
|
47
48
|
readOnly: A,
|
|
48
49
|
"aria-invalid": T === "error" || void 0,
|
|
49
|
-
"aria-describedby":
|
|
50
|
+
"aria-describedby": le,
|
|
50
51
|
"aria-busy": D || void 0,
|
|
51
|
-
onChange:
|
|
52
|
-
className:
|
|
52
|
+
onChange: ue,
|
|
53
|
+
className: i
|
|
53
54
|
}), /* @__PURE__ */ v("span", {
|
|
54
|
-
className:
|
|
55
|
+
className: de,
|
|
55
56
|
"aria-hidden": !0,
|
|
56
57
|
children: D ? /* @__PURE__ */ v(b.span, {
|
|
57
|
-
className: e(
|
|
58
|
+
className: e(p[o], "flex items-center justify-center"),
|
|
58
59
|
animate: { x: H ? X : 0 },
|
|
59
60
|
transition: Y,
|
|
60
61
|
children: /* @__PURE__ */ v(g, {
|
|
@@ -62,36 +63,36 @@ var C = h(function({ size: s = "md", layout: l = "inline", label: h, labelHidden
|
|
|
62
63
|
strokeWidth: 2
|
|
63
64
|
})
|
|
64
65
|
}) : /* @__PURE__ */ v(b.span, {
|
|
65
|
-
className: e(
|
|
66
|
+
className: e(d, p[o]),
|
|
66
67
|
animate: { x: H ? X : 0 },
|
|
67
68
|
transition: Y
|
|
68
69
|
})
|
|
69
70
|
})]
|
|
70
71
|
}), Q = C ? /* @__PURE__ */ v("span", {
|
|
71
72
|
className: "sr-only",
|
|
72
|
-
children:
|
|
73
|
+
children: m
|
|
73
74
|
}) : /* @__PURE__ */ y("span", {
|
|
74
|
-
className:
|
|
75
|
+
className: u,
|
|
75
76
|
children: [/* @__PURE__ */ v("span", {
|
|
76
|
-
className:
|
|
77
|
-
children:
|
|
77
|
+
className: a(U, J),
|
|
78
|
+
children: m
|
|
78
79
|
}), J ? /* @__PURE__ */ v("span", {
|
|
79
80
|
id: q,
|
|
80
|
-
className:
|
|
81
|
+
className: te,
|
|
81
82
|
children: w
|
|
82
83
|
}) : null]
|
|
83
84
|
}), $ = /* @__PURE__ */ v("label", {
|
|
84
85
|
htmlFor: R,
|
|
85
|
-
className: e(
|
|
86
|
+
className: e(ie, c === "settings" ? oe : s, c === "inline" && !J && ae[o], c === "inline" && J && void 0, U && "cursor-not-allowed", O),
|
|
86
87
|
children: C ? /* @__PURE__ */ y(_, { children: [Z(), /* @__PURE__ */ v("span", {
|
|
87
88
|
className: "sr-only",
|
|
88
|
-
children:
|
|
89
|
-
})] }) :
|
|
90
|
-
className:
|
|
91
|
-
children: [Z(
|
|
89
|
+
children: m
|
|
90
|
+
})] }) : c === "settings" ? /* @__PURE__ */ y(_, { children: [Q, Z()] }) : J ? /* @__PURE__ */ y("span", {
|
|
91
|
+
className: r[o],
|
|
92
|
+
children: [Z(ne[o]), Q]
|
|
92
93
|
}) : /* @__PURE__ */ y(_, { children: [Z(), C ? null : /* @__PURE__ */ v("span", {
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
94
|
+
className: a(U),
|
|
95
|
+
children: m
|
|
95
96
|
})] })
|
|
96
97
|
});
|
|
97
98
|
return !G || T == null || K == null ? $ : /* @__PURE__ */ y("div", {
|
|
@@ -100,11 +101,11 @@ var C = h(function({ size: s = "md", layout: l = "inline", label: h, labelHidden
|
|
|
100
101
|
status: T,
|
|
101
102
|
message: E,
|
|
102
103
|
messageId: K,
|
|
103
|
-
size: x[
|
|
104
|
+
size: x[o],
|
|
104
105
|
messagePosition: "bottom",
|
|
105
|
-
bannerClassName:
|
|
106
|
+
bannerClassName: l(T)
|
|
106
107
|
})]
|
|
107
108
|
});
|
|
108
109
|
});
|
|
109
110
|
//#endregion
|
|
110
|
-
export { C as Switch,
|
|
111
|
+
export { C as Switch, o as switchLayouts, c as switchSizes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAKvE,OAAO,EAqBL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE1G,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACjE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC;AAqBD;;;GAGG;AACH,eAAO,MAAM,QAAQ,+
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAKvE,OAAO,EAqBL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE1G,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACjE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC;AAqBD;;;GAGG;AACH,eAAO,MAAM,QAAQ,+GAgKnB,CAAC"}
|
|
@@ -1,105 +1,106 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { typographyClass as t } from "../../../lib/typography.js";
|
|
4
|
-
import { inputAttachedFieldClasses as n, inputCompoundShellClassesFor as r, inputControlStackClasses as i, inputDisabledClasses as a, inputFieldStackClasses as o, inputStatusGapClasses as
|
|
5
|
-
import { InputStatusBanner as c } from "../inputShared/InputStatusBanner.js";
|
|
6
|
-
import { InputTrailingAffordance as
|
|
7
|
-
import { textareaBaseClasses as
|
|
8
|
-
import { forwardRef as
|
|
9
|
-
import { Fragment as
|
|
4
|
+
import { inputAttachedFieldClasses as n, inputCompoundShellClassesFor as r, inputControlStackClasses as i, inputDisabledClasses as a, inputFieldStackClasses as o, inputStatusGapClasses as ee } from "../Input/inputShellStyles.js";
|
|
5
|
+
import { InputStatusBanner as s, warnStatusWithoutMessage as c } from "../inputShared/InputStatusBanner.js";
|
|
6
|
+
import { InputTrailingAffordance as l } from "../inputShared/InputTrailingAffordance.js";
|
|
7
|
+
import { textareaBaseClasses as u, textareaCompoundFieldPaddingClasses as d, textareaCompoundInnerFieldClassesFor as f, textareaFixedPaddingClasses as p, textareaInlineClasses as m, textareaMinHeightClasses as h, textareaResizeClasses as g, textareaResizes as _, textareaShellFieldClasses as v, textareaSoloShellClassesFor as te, textareaStatusBannerClassesFor as y, textareaTrailingInsetClasses as b, textareaTrailingInsetPositionClasses as x } from "./textareaShellStyles.js";
|
|
8
|
+
import { forwardRef as S, useId as C } from "react";
|
|
9
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/atoms/TextArea/TextArea.tsx
|
|
11
|
-
function
|
|
11
|
+
function D(e) {
|
|
12
12
|
e.label == null && e["aria-label"] == null && e["aria-labelledby"] == null && console.warn("[WMDS TextArea] Provide `label`, `aria-label`, or `aria-labelledby`.");
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function O(e) {
|
|
15
15
|
e.message != null && e.status == null && console.warn("[WMDS TextArea] `message` requires `status`."), e.inline && (e.label != null || e.description != null || e.liveStatus != null || e.status != null || e.message != null) && console.warn("[WMDS TextArea] `inline` is for PromptBar only — omit label, description, and validation.");
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
var k = S(function({ size: s = "md", label: _, description: y, status: S, message: k, liveStatus: A, messagePosition: j = "bottom", loading: M = !1, rows: N = 4, resize: P = "vertical", inline: F = !1, className: I, disabled: L, id: R, "aria-describedby": z, ...B }, V) {
|
|
18
|
+
c("TextArea", S, k);
|
|
19
|
+
let H = C(), U = R ?? H;
|
|
20
|
+
D({
|
|
21
|
+
label: _,
|
|
21
22
|
"aria-label": B["aria-label"],
|
|
22
23
|
"aria-labelledby": B["aria-labelledby"]
|
|
23
|
-
}),
|
|
24
|
-
status:
|
|
25
|
-
message:
|
|
24
|
+
}), O({
|
|
25
|
+
status: S,
|
|
26
|
+
message: k,
|
|
26
27
|
inline: F,
|
|
27
|
-
label:
|
|
28
|
-
description:
|
|
28
|
+
label: _,
|
|
29
|
+
description: y,
|
|
29
30
|
liveStatus: A
|
|
30
31
|
});
|
|
31
|
-
let W =
|
|
32
|
+
let W = k != null && k.length > 0 && S != null, G = !W && (M || S != null), K = y == null ? void 0 : `${U}-description`, q = W ? `${U}-message` : void 0, J = [
|
|
32
33
|
z,
|
|
33
34
|
K,
|
|
34
35
|
q
|
|
35
36
|
].filter(Boolean).join(" ") || void 0;
|
|
36
|
-
if (F) return /* @__PURE__ */
|
|
37
|
+
if (F) return /* @__PURE__ */ T("textarea", {
|
|
37
38
|
...B,
|
|
38
39
|
ref: V,
|
|
39
40
|
id: U,
|
|
40
41
|
rows: N,
|
|
41
42
|
disabled: L,
|
|
42
|
-
"aria-invalid":
|
|
43
|
+
"aria-invalid": S === "error" || void 0,
|
|
43
44
|
"aria-describedby": J,
|
|
44
|
-
className: e(a,
|
|
45
|
+
className: e(a, m, I)
|
|
45
46
|
});
|
|
46
|
-
let Y = /* @__PURE__ */
|
|
47
|
+
let Y = /* @__PURE__ */ T("textarea", {
|
|
47
48
|
...B,
|
|
48
49
|
ref: V,
|
|
49
50
|
id: U,
|
|
50
51
|
rows: N,
|
|
51
52
|
disabled: L,
|
|
52
|
-
"aria-invalid":
|
|
53
|
+
"aria-invalid": S === "error" || void 0,
|
|
53
54
|
"aria-describedby": J,
|
|
54
|
-
className: e(a,
|
|
55
|
-
}), X = G ? /* @__PURE__ */
|
|
56
|
-
className: e(
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
-
size:
|
|
59
|
-
status: M ? void 0 :
|
|
55
|
+
className: e(a, g[P], u, p[s], h[s], v, G && ee[s], W && e(n, "rounded-none border-0 shadow-none focus-visible:!outline-none focus-visible:!ring-0", "rounded-none"))
|
|
56
|
+
}), X = G ? /* @__PURE__ */ T("span", {
|
|
57
|
+
className: e(b, x[s]),
|
|
58
|
+
children: /* @__PURE__ */ T(l, {
|
|
59
|
+
size: s,
|
|
60
|
+
status: M ? void 0 : S,
|
|
60
61
|
loading: M
|
|
61
62
|
})
|
|
62
|
-
}) : null, Z = /* @__PURE__ */
|
|
63
|
-
className: e(
|
|
63
|
+
}) : null, Z = /* @__PURE__ */ E(w, { children: [Y, X] }), re = /* @__PURE__ */ T("div", {
|
|
64
|
+
className: e(te(s, S === "success" ? void 0 : S, P), I),
|
|
64
65
|
children: Z
|
|
65
|
-
}),
|
|
66
|
-
className: e("relative w-full",
|
|
66
|
+
}), ie = /* @__PURE__ */ T("div", {
|
|
67
|
+
className: e("relative w-full", d(P, s)),
|
|
67
68
|
children: Z
|
|
68
|
-
}), Q = W &&
|
|
69
|
-
status:
|
|
70
|
-
message:
|
|
69
|
+
}), Q = W && S != null && q != null ? /* @__PURE__ */ T(ne, {
|
|
70
|
+
status: S,
|
|
71
|
+
message: k,
|
|
71
72
|
messageId: q,
|
|
72
|
-
size:
|
|
73
|
+
size: s,
|
|
73
74
|
messagePosition: j
|
|
74
|
-
}) : null, $ = W &&
|
|
75
|
-
className: r(
|
|
75
|
+
}) : null, $ = W && S != null ? /* @__PURE__ */ E("div", {
|
|
76
|
+
className: r(s, S),
|
|
76
77
|
children: [
|
|
77
78
|
j === "top" ? Q : null,
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
className:
|
|
80
|
-
children:
|
|
79
|
+
/* @__PURE__ */ T("div", {
|
|
80
|
+
className: f(s, S, j),
|
|
81
|
+
children: ie
|
|
81
82
|
}),
|
|
82
83
|
j === "bottom" ? Q : null
|
|
83
84
|
]
|
|
84
|
-
}) : /* @__PURE__ */
|
|
85
|
+
}) : /* @__PURE__ */ T("div", {
|
|
85
86
|
className: i,
|
|
86
|
-
children:
|
|
87
|
+
children: re
|
|
87
88
|
});
|
|
88
|
-
return
|
|
89
|
+
return _ == null && y == null && A == null ? $ : /* @__PURE__ */ E("div", {
|
|
89
90
|
className: o,
|
|
90
91
|
children: [
|
|
91
|
-
|
|
92
|
+
_ == null ? null : /* @__PURE__ */ T("label", {
|
|
92
93
|
htmlFor: U,
|
|
93
94
|
className: e(t("ui-label"), L && "opacity-50"),
|
|
94
|
-
children:
|
|
95
|
+
children: _
|
|
95
96
|
}),
|
|
96
|
-
|
|
97
|
-
K == null ? null : /* @__PURE__ */ w("p", {
|
|
97
|
+
K == null ? null : /* @__PURE__ */ T("p", {
|
|
98
98
|
id: K,
|
|
99
99
|
className: t("caption"),
|
|
100
|
-
children:
|
|
100
|
+
children: y
|
|
101
101
|
}),
|
|
102
|
-
|
|
102
|
+
$,
|
|
103
|
+
A == null ? null : /* @__PURE__ */ T("p", {
|
|
103
104
|
role: "status",
|
|
104
105
|
"aria-live": "polite",
|
|
105
106
|
id: `${U}-live-status`,
|
|
@@ -109,15 +110,15 @@ var O = x(function({ size: c = "md", label: h, description: v, status: x, messag
|
|
|
109
110
|
]
|
|
110
111
|
});
|
|
111
112
|
});
|
|
112
|
-
function
|
|
113
|
-
return /* @__PURE__ */
|
|
113
|
+
function ne({ status: e, message: t, messageId: n, size: r, messagePosition: i }) {
|
|
114
|
+
return /* @__PURE__ */ T(s, {
|
|
114
115
|
status: e,
|
|
115
116
|
message: t,
|
|
116
117
|
messageId: n,
|
|
117
118
|
size: r,
|
|
118
119
|
messagePosition: i,
|
|
119
|
-
bannerClassName:
|
|
120
|
+
bannerClassName: y(e, r, i)
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
123
|
//#endregion
|
|
123
|
-
export {
|
|
124
|
+
export { k as TextArea, _ as textareaResizes };
|
|
@@ -19,8 +19,8 @@ var g = [
|
|
|
19
19
|
md: "min-h-24",
|
|
20
20
|
lg: "min-h-28"
|
|
21
21
|
}, b = {
|
|
22
|
-
sm: "px-2.5 py-2 text-xs leading-normal",
|
|
23
|
-
md: "px-3 py-2.5 text-sm leading-normal",
|
|
22
|
+
sm: "px-2.5 py-2 text-xs pointer-coarse:text-base leading-normal",
|
|
23
|
+
md: "px-3 py-2.5 text-sm pointer-coarse:text-base leading-normal",
|
|
24
24
|
lg: "px-4 py-3 text-base leading-normal"
|
|
25
25
|
}, x = {
|
|
26
26
|
sm: "pr-2.5 pb-2.5",
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type InputMessagePosition, type InputSize, type InputStatus } from "../Input/inputShellStyles";
|
|
2
|
+
/**
|
|
3
|
+
* Errors and validation V10: an error or a warning always says what's wrong. Warns in the console when a
|
|
4
|
+
* field has `status="error"` or `"warning"` and no `message`; a status-only success tick is fine.
|
|
5
|
+
*/
|
|
6
|
+
export declare function warnStatusWithoutMessage(component: string, status: InputStatus | undefined, message: unknown): void;
|
|
2
7
|
/** Tinted validation band — shared by **Input** and **TextArea** (ADR-0006). */
|
|
3
8
|
export declare function InputStatusBanner({ status, message, messageId, size, messagePosition, bannerClassName, className, }: {
|
|
4
9
|
status: InputStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputStatusBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/inputShared/InputStatusBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"InputStatusBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/inputShared/InputStatusBanner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAkBnC;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,QAI5G;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,OAAO,EACP,SAAS,EACT,IAAI,EACJ,eAAe,EACf,eAAe,EACf,SAAS,GACV,EAAE;IACD,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,eAAe,EAAE,oBAAoB,CAAC;IACtC,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmBA"}
|
|
@@ -12,13 +12,24 @@ function c({ status: e }) {
|
|
|
12
12
|
"aria-hidden": !0
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
var l = {
|
|
16
|
+
error: "Error:",
|
|
17
|
+
warning: "Warning:",
|
|
18
|
+
success: null
|
|
19
|
+
};
|
|
20
|
+
function u(e, t, n) {
|
|
21
|
+
(t === "error" || t === "warning") && (n == null || n === "") && console.warn(`[WMDS ${e}] \`status="${t}"\` needs a \`message\` that says what's wrong and how to fix it.`);
|
|
22
|
+
}
|
|
23
|
+
function d({ status: n, message: r, messageId: i, size: a, messagePosition: u, bannerClassName: d, className: f }) {
|
|
16
24
|
return /* @__PURE__ */ s("p", {
|
|
17
25
|
id: i,
|
|
18
|
-
className: e(
|
|
26
|
+
className: e(d ?? t(n, a, u), "text-xs font-normal tracking-normal", f),
|
|
19
27
|
role: n === "error" ? "alert" : "status",
|
|
20
|
-
children: [/* @__PURE__ */ o(c, { status: n }), /* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ o(c, { status: n }), /* @__PURE__ */ s("span", { children: [l[n] == null ? null : /* @__PURE__ */ s("span", {
|
|
29
|
+
className: "sr-only",
|
|
30
|
+
children: [l[n], " "]
|
|
31
|
+
}), r] })]
|
|
21
32
|
});
|
|
22
33
|
}
|
|
23
34
|
//#endregion
|
|
24
|
-
export {
|
|
35
|
+
export { d as InputStatusBanner, u as warnStatusWithoutMessage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CheckboxGroup/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAUL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,KAAK,wBAAwB,EAC7B,KAAK,YAAY,GAClB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,qDAAqD;AACrD,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC1C;AAkBD,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,WAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAwB,EACxB,IAAW,EACX,QAAgB,EAChB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CheckboxGroup/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAUL,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,KAAK,wBAAwB,EAC7B,KAAK,YAAY,GAClB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,qDAAqD;AACrD,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,4BAA4B,CAAC;CAC1C;AAkBD,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,WAAmB,EACnB,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAwB,EACxB,IAAW,EACX,QAAgB,EAChB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,+BA4EpB;AAED,eAAO,MAAM,aAAa;;CAExB,CAAC"}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
-
import { InputStatusBanner as t } from "../../atoms/inputShared/InputStatusBanner.js";
|
|
4
|
-
import { checkboxStatusBannerClassesFor as
|
|
5
|
-
import { checkboxGroupDescriptionClasses as
|
|
6
|
-
import { CheckboxGroupProvider as
|
|
7
|
-
import { CheckboxGroupItem as
|
|
8
|
-
import { useId as
|
|
9
|
-
import { jsx as
|
|
3
|
+
import { InputStatusBanner as t, warnStatusWithoutMessage as n } from "../../atoms/inputShared/InputStatusBanner.js";
|
|
4
|
+
import { checkboxStatusBannerClassesFor as r } from "../../atoms/Checkbox/checkboxStyles.js";
|
|
5
|
+
import { checkboxGroupDescriptionClasses as i, checkboxGroupDescriptionSpacingClasses as a, checkboxGroupFieldStackClasses as o, checkboxGroupItemsClasses as s, checkboxGroupLabelClassesFor as c, checkboxGroupLegendLabelOnlySpacingClasses as l, checkboxGroupLegendWithDescriptionSpacingClasses as u, checkboxGroupMessageTopSpacingClasses as d, checkboxGroupOrientations as f } from "./checkboxGroupStyles.js";
|
|
6
|
+
import { CheckboxGroupProvider as p } from "./CheckboxGroupContext.js";
|
|
7
|
+
import { CheckboxGroupItem as m } from "./CheckboxGroupItem.js";
|
|
8
|
+
import { useId as h, useMemo as g } from "react";
|
|
9
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/molecules/CheckboxGroup/CheckboxGroup.tsx
|
|
11
|
-
var
|
|
11
|
+
var y = {
|
|
12
12
|
sm: "sm",
|
|
13
13
|
md: "md"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function b(e) {
|
|
16
16
|
e.message != null && e.status == null && console.warn("[WMDS CheckboxGroup] `message` requires `status`."), e.values != null != (e.onValuesChange != null) && console.warn("[WMDS CheckboxGroup] `values` and `onValuesChange` must be used together.");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
status:
|
|
22
|
-
message:
|
|
23
|
-
values:
|
|
24
|
-
onValuesChange:
|
|
25
|
-
});
|
|
26
|
-
let
|
|
27
|
-
values:
|
|
28
|
-
onValuesChange:
|
|
29
|
-
disabled:
|
|
30
|
-
size:
|
|
18
|
+
function x({ label: f, labelHidden: m = !1, description: x, values: S, onValuesChange: C, orientation: w = "vertical", size: T = "md", disabled: E = !1, status: D, message: O, children: k, className: A }) {
|
|
19
|
+
let j = h();
|
|
20
|
+
b({
|
|
21
|
+
status: D,
|
|
22
|
+
message: O,
|
|
23
|
+
values: S,
|
|
24
|
+
onValuesChange: C
|
|
25
|
+
}), n("CheckboxGroup", D, O);
|
|
26
|
+
let M = f == null ? void 0 : `${j}-legend`, N = x == null ? void 0 : `${j}-description`, P = O != null && D != null ? `${j}-message` : void 0, F = [N, P].filter(Boolean).join(" ") || void 0, I = g(() => ({
|
|
27
|
+
values: S,
|
|
28
|
+
onValuesChange: C,
|
|
29
|
+
disabled: E,
|
|
30
|
+
size: T
|
|
31
31
|
}), [
|
|
32
|
-
x,
|
|
33
32
|
S,
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
C,
|
|
34
|
+
E,
|
|
35
|
+
T
|
|
36
36
|
]);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
disabled:
|
|
39
|
-
className: e(
|
|
37
|
+
return /* @__PURE__ */ v("fieldset", {
|
|
38
|
+
disabled: E,
|
|
39
|
+
className: e(o, "min-w-0 border-0 p-0", A),
|
|
40
40
|
children: [
|
|
41
|
-
|
|
42
|
-
id: j,
|
|
43
|
-
className: e(s(T), p && "sr-only", b == null ? c : l),
|
|
44
|
-
children: d
|
|
45
|
-
}),
|
|
46
|
-
b == null ? null : /* @__PURE__ */ g("p", {
|
|
41
|
+
f == null ? null : /* @__PURE__ */ _("legend", {
|
|
47
42
|
id: M,
|
|
48
|
-
className: e(
|
|
49
|
-
children:
|
|
43
|
+
className: e(c(E), m && "sr-only", x == null ? l : u),
|
|
44
|
+
children: f
|
|
45
|
+
}),
|
|
46
|
+
x == null ? null : /* @__PURE__ */ _("p", {
|
|
47
|
+
id: N,
|
|
48
|
+
className: e(i, a),
|
|
49
|
+
children: x
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ _("div", {
|
|
52
52
|
role: "group",
|
|
53
|
-
"aria-labelledby":
|
|
54
|
-
"aria-describedby":
|
|
55
|
-
"aria-invalid":
|
|
56
|
-
"aria-disabled":
|
|
57
|
-
className:
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
value:
|
|
60
|
-
children:
|
|
53
|
+
"aria-labelledby": M,
|
|
54
|
+
"aria-describedby": F,
|
|
55
|
+
"aria-invalid": D === "error" || void 0,
|
|
56
|
+
"aria-disabled": E || void 0,
|
|
57
|
+
className: s[w],
|
|
58
|
+
children: /* @__PURE__ */ _(p, {
|
|
59
|
+
value: I,
|
|
60
|
+
children: k
|
|
61
61
|
})
|
|
62
62
|
}),
|
|
63
|
-
|
|
64
|
-
status:
|
|
65
|
-
message:
|
|
66
|
-
messageId:
|
|
67
|
-
size:
|
|
63
|
+
O != null && D != null && P != null ? /* @__PURE__ */ _(t, {
|
|
64
|
+
status: D,
|
|
65
|
+
message: O,
|
|
66
|
+
messageId: P,
|
|
67
|
+
size: y[T],
|
|
68
68
|
messagePosition: "bottom",
|
|
69
|
-
bannerClassName: e(
|
|
69
|
+
bannerClassName: e(r(D), d)
|
|
70
70
|
}) : null
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
var
|
|
74
|
+
var S = Object.assign(x, { Item: m });
|
|
75
75
|
//#endregion
|
|
76
|
-
export {
|
|
76
|
+
export { S as CheckboxGroup, f as checkboxGroupOrientations };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyFieldStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CopyField/copyFieldStyles.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAiE,CAAC;AAEpG;;;GAGG;AACH,eAAO,MAAM,qBAAqB,yDAAyD,CAAC;AAE5F;;;GAGG;
|
|
1
|
+
{"version":3,"file":"copyFieldStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CopyField/copyFieldStyles.ts"],"names":[],"mappings":"AAOA,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAiE,CAAC;AAEpG;;;GAGG;AACH,eAAO,MAAM,qBAAqB,yDAAyD,CAAC;AAE5F;;;GAGG;AAEH,eAAO,MAAM,sBAAsB,QAAuE,CAAC;AAE3G;;;GAGG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { promptBarSendClasses as t, promptBarShellClasses as n, promptBarShellStartPadClasses as r } from "../PromptBar/promptBarStyles.js";
|
|
4
4
|
//#region src/components/molecules/CopyField/copyFieldStyles.ts
|
|
5
|
-
var i = "flex w-full min-w-0 flex-col gap-2", a = "type-label", o = e(n, r.field), s = "h-9 min-h-9 w-full min-w-0 flex-1 truncate px-0 py-0", c = e(t, "shrink-0"), l = "type-supporting";
|
|
5
|
+
var i = "flex w-full min-w-0 flex-col gap-2", a = "type-label", o = e(n, r.field), s = "h-9 min-h-9 w-full min-w-0 flex-1 truncate px-0 py-0", c = e(t, "shrink-0 pointer-coarse:overflow-visible"), l = "type-supporting";
|
|
6
6
|
//#endregion
|
|
7
7
|
export { c as copyFieldButtonClasses, i as copyFieldClasses, l as copyFieldHintClasses, a as copyFieldLabelClasses, o as copyFieldShellClasses, s as copyFieldValueClasses };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ErrorSummaryHeadingLevel } from "./errorSummaryStyles";
|
|
3
|
+
export { errorSummaryHeadingLevels, type ErrorSummaryHeadingLevel } from "./errorSummaryStyles";
|
|
4
|
+
/** Layout-only — margin or grid placement. */
|
|
5
|
+
export type ErrorSummaryLayoutClassName = string;
|
|
6
|
+
export interface ErrorSummaryItem {
|
|
7
|
+
/** The `id` of the field with the error; its link moves focus there. */
|
|
8
|
+
field: string;
|
|
9
|
+
/** The same words as the field's own message ("Enter your email address"). */
|
|
10
|
+
message: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface ErrorSummaryProps {
|
|
13
|
+
/** One line per error, in the order the fields appear. Renders nothing when empty. */
|
|
14
|
+
errors: ErrorSummaryItem[];
|
|
15
|
+
/** Default: "There's a problem". */
|
|
16
|
+
title?: ReactNode;
|
|
17
|
+
/** Its heading level in the page outline. Default `h2`. */
|
|
18
|
+
as?: ErrorSummaryHeadingLevel;
|
|
19
|
+
/**
|
|
20
|
+
* Move focus to the summary when its errors change, so a screen reader starts here after a failed
|
|
21
|
+
* submit. Default `true`.
|
|
22
|
+
*/
|
|
23
|
+
focusOnShow?: boolean;
|
|
24
|
+
className?: ErrorSummaryLayoutClassName;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The summary at the top of a form after a failed submit (Errors and validation V5): "There's a problem",
|
|
28
|
+
* then one link per error, worded like the field's own message. It takes focus when it appears, and each
|
|
29
|
+
* link moves focus to its field. The fields keep their inline messages too.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ErrorSummary({ errors, title, as: Heading, focusOnShow, className }: ErrorSummaryProps): import("react").JSX.Element | null;
|
|
32
|
+
//# sourceMappingURL=ErrorSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ErrorSummary/ErrorSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,yBAAyB,EAAE,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhG,8CAA8C;AAC9C,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2DAA2D;IAC3D,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,2BAA2B,CAAC;CACzC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,KAA2B,EAAE,EAAE,EAAE,OAAc,EAAE,WAAkB,EAAE,SAAS,EAAE,EAAE,iBAAiB,sCA4CzI"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
+
import { errorSummaryClasses as t, errorSummaryHeadingLevels as n, errorSummaryLinkClasses as r, errorSummaryListClasses as i, errorSummaryTitleClasses as a } from "./errorSummaryStyles.js";
|
|
4
|
+
import { useEffect as o, useId as s, useRef as c } from "react";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/molecules/ErrorSummary/ErrorSummary.tsx
|
|
7
|
+
function d({ errors: n, title: d = "There's a problem", as: f = "h2", focusOnShow: p = !0, className: m }) {
|
|
8
|
+
let h = c(null), g = s(), _ = n.map((e) => e.field).join("|");
|
|
9
|
+
return o(() => {
|
|
10
|
+
p && _ !== "" && h.current?.focus();
|
|
11
|
+
}, [p, _]), n.length === 0 ? null : /* @__PURE__ */ u("div", {
|
|
12
|
+
ref: h,
|
|
13
|
+
role: "alert",
|
|
14
|
+
"aria-labelledby": g,
|
|
15
|
+
tabIndex: -1,
|
|
16
|
+
className: e(t, m),
|
|
17
|
+
"data-error-summary": "",
|
|
18
|
+
children: [/* @__PURE__ */ l(f, {
|
|
19
|
+
id: g,
|
|
20
|
+
className: a,
|
|
21
|
+
children: d
|
|
22
|
+
}), /* @__PURE__ */ l("ul", {
|
|
23
|
+
className: i,
|
|
24
|
+
children: n.map((e) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l("a", {
|
|
25
|
+
href: `#${e.field}`,
|
|
26
|
+
className: r,
|
|
27
|
+
onClick: (t) => {
|
|
28
|
+
let n = document.getElementById(e.field);
|
|
29
|
+
n != null && (t.preventDefault(), n.scrollIntoView({ block: "center" }), n.focus({ preventScroll: !0 }));
|
|
30
|
+
},
|
|
31
|
+
children: e.message
|
|
32
|
+
}) }, e.field))
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { d as ErrorSummary, n as errorSummaryHeadingLevels };
|