@thewhatmatters/wmds 0.4.31 → 0.4.33
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 +40 -0
- package/bin/wmds-check.mjs +38 -0
- package/dist/colors.css +2 -1
- 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/Card/Card.d.ts +10 -1
- package/dist/components/molecules/Card/Card.d.ts.map +1 -1
- package/dist/components/molecules/Card/Card.js +56 -43
- 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/components/organisms/Carousel/Carousel.d.ts +21 -1
- package/dist/components/organisms/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/Carousel.js +319 -190
- package/dist/components/organisms/Carousel/carouselStyles.d.ts +9 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselStyles.js +12 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -97
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/stateColors.css +2 -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
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,46 @@ Every release of `@thewhatmatters/wmds` is listed here, newest first.
|
|
|
7
7
|
- **Pasted patterns:** when a release changes a **Pattern — …** story's Show code, it is named under Consumer actions so apps re-copy it.
|
|
8
8
|
- **How to add an entry** (contributors): add your change to the top entry. If that version is already on npm (`npm view @thewhatmatters/wmds versions`), start a new entry above it and bump `version` in `package.json` to match. `npm run check:changelog` enforces the format.
|
|
9
9
|
|
|
10
|
+
## 0.4.33
|
|
11
|
+
|
|
12
|
+
**Cards can take their own tone, and a Carousel can drift on its own with a Pause button and a follow cursor.**
|
|
13
|
+
|
|
14
|
+
- **Card** `tone` (new): `inverse`, `field` or `light`, the same scopes **Band** uses, so a card can stand apart from its section (testimonials, offers). Everything inside re-skins. New export `cardTones` / `CardTone`.
|
|
15
|
+
- **`[data-theme="light"]`** now scopes the light palette (colors.css and stateColors.css), so a light card or block works inside a dark or toned section.
|
|
16
|
+
- **Carousel** `autoplay` (new): drifts the row slowly back and forth (`true` or `{ speed }` in px a second). It holds on hover, on focus inside the row, during a drag or a scrub, off screen and in a hidden tab, and never runs under reduced motion. A **Pause** / **Play** button sits beside the scrubber (WCAG 2.2.2).
|
|
17
|
+
- **Carousel** `loop` (new): the items repeat seamlessly. A copy follows the last item (hidden from assistive tech, `inert`), and the row wraps back as it passes one full set, so it never ends; with `autoplay` it drifts one way. No scrubber or counter with a loop.
|
|
18
|
+
- **Carousel** sets **`--carousel-velocity`** on its root while the row moves: -1 to 1, which way and how fast, smoothed by a Motion spring and easing back to 0 when it stops (always 0 under reduced motion). Use it straight, without a CSS transition. Items can lean or skew with it, e.g. `rotate-[calc(var(--carousel-velocity,0)*8deg)]`.
|
|
19
|
+
- **Carousel**: a row you can drag no longer selects text (`select-none` while it overflows), so a press-and-drag doesn't paint selection over the items.
|
|
20
|
+
- **Carousel** `cursor` (new): a decorative badge that follows a mouse over the row (fine pointers that can hover), e.g. a hand icon that says "drag me".
|
|
21
|
+
- **Carousel** reads reduced motion through Motion's config, so a `MotionConfig reducedMotion` around it is respected (no change under the default `user`).
|
|
22
|
+
- New tests: **cardTone.test.ts**, and Carousel interaction tests **autoplay drifts, holds on hover and focus, and pauses**, **autoplay never runs under reduced motion** , **loop repeats the items seamlessly and wraps back** and **--carousel-velocity follows the row's movement and settles to 0**. New stories **Card → Reference — tones** and **Carousel → Reference — autoplay with a follow cursor**.
|
|
23
|
+
|
|
24
|
+
### Consumer actions
|
|
25
|
+
|
|
26
|
+
If your brand stylesheet sets colours on `:root` only, also list `[data-theme="light"]` (`:root, [data-theme="light"] { … }`) so a `tone="light"` card picks them up.
|
|
27
|
+
|
|
28
|
+
## 0.4.32
|
|
29
|
+
|
|
30
|
+
**Errors and validation: an error summary, errors announced as errors, no lost typing, and no iOS zoom. Labels and placeholders: every field named, the hint above the field, and inset buttons you can tap and see focused.**
|
|
31
|
+
|
|
32
|
+
- **ErrorSummary** (new): "There's a problem" at the top of a form after a failed submit, one link per error in the field's own words. It takes focus when it appears, and each link moves focus to its field (V5). Story **Components/ErrorSummary → Pattern — form with an error summary**; interaction test **Internal/Interactions/ErrorSummary**.
|
|
33
|
+
- **Input, TextArea, Checkbox, Radio, Switch, CheckboxGroup, RadioGroup**: the status band reads a visually hidden "Error:" or "Warning:" before the message, so screen readers hear what kind of message it is (V6).
|
|
34
|
+
- **Status without a message** (V10): those components warn in the console when `status="error"` or `"warning"` has no `message`. **wmds-check** `status-without-message` (new, error) catches it in app code. A status-only success tick is fine.
|
|
35
|
+
- **Input** keeps the same `<input>` when a status appears. It used to swap its wrapper and remount the field, which dropped focus and, in an uncontrolled field, **what people had typed** (V4).
|
|
36
|
+
- **No iOS zoom:** Input, TextArea and Search (`sm` and `md`) and PromptBar set 16px text on touch screens (`pointer: coarse`), so Safari doesn't zoom the page when a field gets focus. Fine pointers keep 12px / 14px.
|
|
37
|
+
- **IntakeForm** default messages follow V1: "Enter your email address." for an empty field, "Enter an email address like name@example.com." and "Enter a website address like example.com." for a broken rule (were "Please enter a valid email address." / "…URL.").
|
|
38
|
+
- Unit test: every status band's message clears 4.5:1 on its band in light and dark (V7: 4.62–6.97:1 measured).
|
|
39
|
+
- **A success tick only** (V8): a status-only `success` on Input or TextArea shows the tick and keeps the normal border (it also turned the border green).
|
|
40
|
+
- **The hint sits above the field** (Labels F8): Input and TextArea render `description` between the label and the field, and keep it when a status message shows (it used to sit below and hide behind the message). Story **Components/Input → Pattern — hint with an error**.
|
|
41
|
+
- **Label required** (F7): **wmds-check** `missing-label` (new, error) fails an Input, TextArea, Select or Search with no `label`, `aria-label` or `aria-labelledby`. Hide a label (`aria-label`) only on a field alone with its button: search, a one-field newsletter.
|
|
42
|
+
- **Search** takes a `label` prop: the field's name for screen readers, which may stay hidden (F10). It warns in the console when there's no label at all.
|
|
43
|
+
- **Inset buttons** (F10) in Search, PromptBar and CopyField get a 44px tap area on touch screens, and show their own focus ring. The pill's ring now marks only the field (Search used to ring the whole pill for the button too; PromptBar and CopyField hid the button's ring).
|
|
44
|
+
- **No placeholders in forms** (F9): IntakeForm drops its placeholders ("https://", "What should feel different…"), and the stories no longer put examples in placeholders. Search keeps one, naming the action.
|
|
45
|
+
|
|
46
|
+
### Consumer actions
|
|
47
|
+
|
|
48
|
+
None required. Fix any `status="error"` / `"warning"` without a `message` that `npx wmds-check` reports; say what's wrong and how to fix it. After a failed submit, add **ErrorSummary** at the top of the form (copy the Pattern). On phones and tablets, field text is now 16px. Give every field a `label` (fix what `npx wmds-check` reports as `missing-label`); pass `label` to Search; move examples and formats out of placeholders into `description`. If you style around the hint, it now renders above the field.
|
|
49
|
+
|
|
10
50
|
## 0.4.31
|
|
11
51
|
|
|
12
52
|
**SiteNav's phone menu follows the Header rule: a "Menu" button that becomes "Close", a full-height panel under the bar, and a link tap closes it.**
|
package/bin/wmds-check.mjs
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* content, data, handlers, and exports may change
|
|
19
19
|
* pattern-stale warn a pasted pattern's header names an older package version
|
|
20
20
|
* pattern-removed error a pasted pattern's id no longer ships
|
|
21
|
+
* status-without-message error a WMDS field with status="error" or "warning" and no message
|
|
22
|
+
* (Errors and validation V10; a status-only success tick is fine)
|
|
23
|
+
* missing-label error a WMDS Input, TextArea, Select or Search with no label, aria-label or
|
|
24
|
+
* aria-labelledby (Labels and placeholders F7; a spread {...props} is trusted)
|
|
21
25
|
* brand-contrast error a brand-kit pair in the app's CSS under WCAG AA 4.5:1: --color-on-X (and
|
|
22
26
|
* --color-on-X-muted) on --color-X, for primary, brand-surface and field,
|
|
23
27
|
* when both are hex values in the same rule
|
|
@@ -235,6 +239,40 @@ for (const file of files) {
|
|
|
235
239
|
}
|
|
236
240
|
});
|
|
237
241
|
|
|
242
|
+
// Reads a JSX element whole from its "<" (it may span lines), counting braces so `=>` and `{…}`
|
|
243
|
+
// values don't end it early.
|
|
244
|
+
const elementFrom = (start) => {
|
|
245
|
+
let depth = 0;
|
|
246
|
+
let end = start + 1;
|
|
247
|
+
for (; end < source.length; end++) {
|
|
248
|
+
const char = source[end];
|
|
249
|
+
if (char === "{") depth++;
|
|
250
|
+
else if (char === "}") depth--;
|
|
251
|
+
else if (char === ">" && depth === 0 && source[end - 1] !== "=") break;
|
|
252
|
+
}
|
|
253
|
+
return source.slice(start, end + 1);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// F7: every field has a name. A hidden one (aria-label) is the app's call; none at all fails.
|
|
257
|
+
if (/from\s+["']@thewhatmatters\/wmds["']/.test(source)) {
|
|
258
|
+
for (const match of source.matchAll(/<(Input|TextArea|Select|Search)(?=[\s/>])/g)) {
|
|
259
|
+
const element = elementFrom(match.index);
|
|
260
|
+
if (/\b(label|aria-label|aria-labelledby)=|\{\s*\.\.\./.test(element)) continue;
|
|
261
|
+
const line = source.slice(0, match.index).split("\n").length;
|
|
262
|
+
if (ignored(lines, line - 1, "missing-label")) continue;
|
|
263
|
+
report(file, line, "missing-label", "error", `<${match[1]}> has no label — add label (or aria-label when it sits alone with its button)`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// V10: an error or warning status always says what's wrong.
|
|
268
|
+
for (const match of source.matchAll(/\bstatus=(?:"(error|warning)"|\{\s*["'](error|warning)["']\s*\})/g)) {
|
|
269
|
+
const element = elementFrom(source.lastIndexOf("<", match.index));
|
|
270
|
+
if (!/^<[A-Z]/.test(element) || /\bmessage=/.test(element)) continue;
|
|
271
|
+
const line = source.slice(0, match.index).split("\n").length;
|
|
272
|
+
if (ignored(lines, line - 1, "status-without-message")) continue;
|
|
273
|
+
report(file, line, "status-without-message", "error", `status="${match[1] ?? match[2]}" with no message — say what's wrong and how to fix it`);
|
|
274
|
+
}
|
|
275
|
+
|
|
238
276
|
// Pasted patterns.
|
|
239
277
|
// The header is the file's first comment line. A "use client" / "use server" directive or blank
|
|
240
278
|
// lines may come before it.
|
package/dist/colors.css
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* Status roles: error | success | warning (+ *-muted, on-*).
|
|
9
9
|
* Brand actions: primary / on-primary (WhatMatters — separate from accent).
|
|
10
10
|
*/
|
|
11
|
-
:root
|
|
11
|
+
:root,
|
|
12
|
+
[data-theme="light"] {
|
|
12
13
|
/* Native UI (scrollbars, form controls, autofill) follows the theme. */
|
|
13
14
|
color-scheme: light;
|
|
14
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAIf,OAAO,EAoBL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA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I,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC;AAcD;;;GAGG;AACH,eAAO,MAAM,QAAQ,4GAiNnB,CAAC"}
|
|
@@ -1,119 +1,120 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import "../Input/inputShellStyles.js";
|
|
4
|
-
import { InputStatusBanner as t } from "../inputShared/InputStatusBanner.js";
|
|
5
|
-
import { checkboxBoxClassesFor as
|
|
6
|
-
import { forwardRef as f, useCallback as p, useId as
|
|
7
|
-
import { Check as
|
|
8
|
-
import { Fragment as
|
|
4
|
+
import { InputStatusBanner as t, warnStatusWithoutMessage as ee } from "../inputShared/InputStatusBanner.js";
|
|
5
|
+
import { checkboxBoxClassesFor as n, checkboxCheckIconSizeClasses as r, checkboxCountClasses as te, checkboxCountTitleLineClasses as i, checkboxDescriptionClasses as a, checkboxDescriptionRowClasses as ne, checkboxHiddenInputClasses as re, checkboxHitTargetDescriptionAlignClasses as ie, checkboxHitTargetSizeClasses as ae, checkboxIndeterminateBarSizeClasses as o, checkboxLabelClassesFor as s, checkboxMarkClasses as c, checkboxRowBaseClasses as oe, checkboxRowSizeClasses as se, checkboxSizes as l, checkboxStatusBannerClassesFor as u, checkboxTextColumnClasses as d } from "./checkboxStyles.js";
|
|
6
|
+
import { forwardRef as f, useCallback as p, useId as ce, useState as le } from "react";
|
|
7
|
+
import { Check as ue, Loader2 as de } from "lucide-react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/atoms/Checkbox/Checkbox.tsx
|
|
10
|
-
var
|
|
10
|
+
var _ = {
|
|
11
11
|
sm: "sm",
|
|
12
12
|
md: "md"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function v(e) {
|
|
15
15
|
e.message != null && e.status == null && console.warn("[WMDS Checkbox] `message` requires `status`.");
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var y = f(function({ size: l = "md", label: f, labelHidden: y = !1, description: b, count: x, countLabel: fe, indeterminate: S = !1, status: C, message: w, loading: T = !1, className: E, disabled: D, readOnly: O, checked: k, defaultChecked: A, id: j, onChange: M, ...N }, P) {
|
|
18
|
+
ee("Checkbox", C, w);
|
|
19
|
+
let F = ce(), I = j ?? F;
|
|
20
|
+
v({
|
|
21
|
+
status: C,
|
|
22
|
+
message: w
|
|
22
23
|
});
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
].filter(Boolean).join(" ") || void 0,
|
|
28
|
-
e && (e.indeterminate =
|
|
29
|
-
}, [
|
|
30
|
-
if (
|
|
24
|
+
let L = k !== void 0, [R, z] = le(A ?? !1), B = L ? !!k : R, V = D || T, H = T && !D, U = w != null && w.length > 0 && C != null, W = U ? `${I}-message` : void 0, G = b != null && !y ? `${I}-description` : void 0, pe = [
|
|
25
|
+
N["aria-describedby"],
|
|
26
|
+
G,
|
|
27
|
+
W
|
|
28
|
+
].filter(Boolean).join(" ") || void 0, me = p((e) => {
|
|
29
|
+
e && (e.indeterminate = S), typeof P == "function" ? P(e) : P != null && (P.current = e);
|
|
30
|
+
}, [S, P]), K = (e) => {
|
|
31
|
+
if (O || H) {
|
|
31
32
|
e.preventDefault();
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
},
|
|
35
|
+
L || z(e.target.checked), M?.(e);
|
|
36
|
+
}, he = n(l, B, S, V, U ? void 0 : C), q = b != null && !y, J = x != null, Y = x?.toLocaleString("en-US"), X = J ? /* @__PURE__ */ h("span", {
|
|
36
37
|
className: "sr-only",
|
|
37
|
-
children: ` (${
|
|
38
|
-
}) : null, Z = J ? /* @__PURE__ */
|
|
38
|
+
children: ` (${fe ?? Y})`
|
|
39
|
+
}) : null, Z = J ? /* @__PURE__ */ h("span", {
|
|
39
40
|
className: te,
|
|
40
41
|
"aria-hidden": !0,
|
|
41
42
|
children: Y
|
|
42
|
-
}) : null, Q = (t) => /* @__PURE__ */
|
|
43
|
+
}) : null, Q = (t) => /* @__PURE__ */ g("span", {
|
|
43
44
|
className: e("relative flex shrink-0 items-center justify-center", ae[l], t),
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
-
...
|
|
46
|
-
ref:
|
|
47
|
-
id:
|
|
45
|
+
children: [/* @__PURE__ */ h("input", {
|
|
46
|
+
...N,
|
|
47
|
+
ref: me,
|
|
48
|
+
id: I,
|
|
48
49
|
type: "checkbox",
|
|
49
|
-
checked:
|
|
50
|
-
defaultChecked:
|
|
51
|
-
disabled:
|
|
52
|
-
"aria-disabled":
|
|
53
|
-
readOnly:
|
|
54
|
-
"aria-invalid":
|
|
55
|
-
"aria-describedby":
|
|
56
|
-
"aria-checked":
|
|
57
|
-
"aria-busy":
|
|
58
|
-
onChange:
|
|
50
|
+
checked: L ? k : void 0,
|
|
51
|
+
defaultChecked: L ? void 0 : A,
|
|
52
|
+
disabled: D,
|
|
53
|
+
"aria-disabled": H || void 0,
|
|
54
|
+
readOnly: O,
|
|
55
|
+
"aria-invalid": C === "error" || void 0,
|
|
56
|
+
"aria-describedby": pe,
|
|
57
|
+
"aria-checked": S ? "mixed" : void 0,
|
|
58
|
+
"aria-busy": T || void 0,
|
|
59
|
+
onChange: K,
|
|
59
60
|
className: re
|
|
60
|
-
}), /* @__PURE__ */
|
|
61
|
-
className:
|
|
61
|
+
}), /* @__PURE__ */ h("span", {
|
|
62
|
+
className: he,
|
|
62
63
|
"aria-hidden": !0,
|
|
63
|
-
children:
|
|
64
|
-
className: e(
|
|
64
|
+
children: T ? /* @__PURE__ */ h(de, {
|
|
65
|
+
className: e(r[l], c, "animate-spin"),
|
|
65
66
|
strokeWidth: 2
|
|
66
|
-
}) :
|
|
67
|
-
className: e(
|
|
67
|
+
}) : S ? /* @__PURE__ */ h("span", { className: e(o[l], c, "rounded-full bg-current") }) : B ? /* @__PURE__ */ h(ue, {
|
|
68
|
+
className: e(r[l], c),
|
|
68
69
|
strokeWidth: 3,
|
|
69
70
|
"aria-hidden": !0
|
|
70
71
|
}) : null
|
|
71
72
|
})]
|
|
72
|
-
}), $ = /* @__PURE__ */
|
|
73
|
-
htmlFor:
|
|
74
|
-
className: e(
|
|
75
|
-
children:
|
|
73
|
+
}), $ = /* @__PURE__ */ h("label", {
|
|
74
|
+
htmlFor: I,
|
|
75
|
+
className: e(oe, !q && "items-center", !q && se[l], V && "cursor-not-allowed", E),
|
|
76
|
+
children: y ? /* @__PURE__ */ g(m, { children: [Q(), /* @__PURE__ */ g("span", {
|
|
76
77
|
className: "sr-only",
|
|
77
78
|
children: [f, X]
|
|
78
|
-
})] }) : q ? /* @__PURE__ */
|
|
79
|
+
})] }) : q ? /* @__PURE__ */ g("span", {
|
|
79
80
|
className: e(ne[l], J && "flex-1"),
|
|
80
|
-
children: [Q(ie[l]), /* @__PURE__ */
|
|
81
|
+
children: [Q(ie[l]), /* @__PURE__ */ g("span", {
|
|
81
82
|
className: e(d, J && "flex-1"),
|
|
82
|
-
children: [J ? /* @__PURE__ */
|
|
83
|
-
className:
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
className:
|
|
83
|
+
children: [J ? /* @__PURE__ */ g("span", {
|
|
84
|
+
className: i,
|
|
85
|
+
children: [/* @__PURE__ */ g("span", {
|
|
86
|
+
className: s(V, !0),
|
|
86
87
|
children: [f, X]
|
|
87
88
|
}), Z]
|
|
88
|
-
}) : /* @__PURE__ */
|
|
89
|
-
className:
|
|
89
|
+
}) : /* @__PURE__ */ h("span", {
|
|
90
|
+
className: s(V, !0),
|
|
90
91
|
children: f
|
|
91
|
-
}), /* @__PURE__ */
|
|
92
|
-
id:
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
92
|
+
}), /* @__PURE__ */ h("span", {
|
|
93
|
+
id: G,
|
|
94
|
+
className: a,
|
|
95
|
+
children: b
|
|
95
96
|
})]
|
|
96
97
|
})]
|
|
97
|
-
}) : /* @__PURE__ */
|
|
98
|
+
}) : /* @__PURE__ */ g(m, { children: [
|
|
98
99
|
Q(),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
className:
|
|
100
|
+
/* @__PURE__ */ g("span", {
|
|
101
|
+
className: s(V),
|
|
101
102
|
children: [f, X]
|
|
102
103
|
}),
|
|
103
104
|
Z
|
|
104
105
|
] })
|
|
105
106
|
});
|
|
106
|
-
return !
|
|
107
|
+
return !U || C == null || W == null ? $ : /* @__PURE__ */ g("div", {
|
|
107
108
|
className: "flex w-full flex-col gap-1.5",
|
|
108
|
-
children: [$, /* @__PURE__ */
|
|
109
|
-
status:
|
|
110
|
-
message:
|
|
111
|
-
messageId:
|
|
112
|
-
size:
|
|
109
|
+
children: [$, /* @__PURE__ */ h(t, {
|
|
110
|
+
status: C,
|
|
111
|
+
message: w,
|
|
112
|
+
messageId: W,
|
|
113
|
+
size: _[l],
|
|
113
114
|
messagePosition: "bottom",
|
|
114
|
-
bannerClassName: u(
|
|
115
|
+
bannerClassName: u(C)
|
|
115
116
|
})]
|
|
116
117
|
});
|
|
117
118
|
});
|
|
118
119
|
//#endregion
|
|
119
|
-
export {
|
|
120
|
+
export { y as Checkbox, l as checkboxSizes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,EA2BL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtF,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,yFAAyF;IACzF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,wGAAwG;IACxG,MAAM,CAAC,EAAE,OAAO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AAC,EAAE,oBAAoB,CAAC;CAClC;AA2CD;;;GAGG;AACH,eAAO,MAAM,KAAK,yGAgLhB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
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, inputAttachedInputClasses as
|
|
5
|
-
import { InputStatusBanner as
|
|
6
|
-
import { InputTrailingAffordance as
|
|
7
|
-
import { forwardRef as T, useId as
|
|
4
|
+
import { inputAttachedFieldClasses as n, inputAttachedInputClasses as ee, inputBaseClasses as r, inputCompoundInnerFieldClassesFor as i, inputCompoundShellClassesFor as a, inputControlStackClasses as o, inputDisabledClasses as te, inputEndBadgeAndStatusGapClasses as s, inputEndBadgeGapClasses as c, inputEndBadgeWrapperClasses as ne, inputFieldStackClasses as l, inputIconGapClasses as u, inputIconPositionClasses as d, inputIconSizeClasses as f, inputInlineClasses as p, inputMessagePositions as m, inputShellClasses as h, inputSizeClasses as g, inputSizes as _, inputSoloFocusRingBaseClasses as re, inputSoloFocusRingColorClasses as v, inputSoloRadiusClasses as ie, inputStatusGapClasses as y, inputStatusShellClasses as ae, inputStatuses as b, inputTrailingInsetClasses as x, inputTrailingInsetPositionClasses as S } from "./inputShellStyles.js";
|
|
5
|
+
import { InputStatusBanner as C, warnStatusWithoutMessage as w } from "../inputShared/InputStatusBanner.js";
|
|
6
|
+
import { InputTrailingAffordance as oe } from "../inputShared/InputTrailingAffordance.js";
|
|
7
|
+
import { forwardRef as T, useId as se } from "react";
|
|
8
8
|
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/atoms/Input/Input.tsx
|
|
10
10
|
function k(e) {
|
|
@@ -14,30 +14,31 @@ function A(e) {
|
|
|
14
14
|
e.message != null && e.status == null && console.warn("[WMDS Input] `message` requires `status`."), e.inline && (e.label != null || e.description != null || e.status != null || e.message != null) && console.warn("[WMDS Input] `inline` is for a parent pill (Search, CopyField) — omit label, description, and validation.");
|
|
15
15
|
}
|
|
16
16
|
function j(e, t, n) {
|
|
17
|
-
return t && n ?
|
|
17
|
+
return t && n ? s[e] : t ? c[e] : n ? y[e] : !1;
|
|
18
18
|
}
|
|
19
|
-
var M = T(function({ size:
|
|
20
|
-
|
|
19
|
+
var M = T(function({ size: s = "md", label: c, description: m, status: _, message: y, messagePosition: b = "bottom", loading: T = !1, icon: M, endBadge: N, mono: P = !1, inline: F = !1, className: I, disabled: L, id: R, "aria-describedby": z, ...B }, V) {
|
|
20
|
+
w("Input", _, y);
|
|
21
|
+
let H = se(), U = R ?? H;
|
|
21
22
|
k({
|
|
22
|
-
label:
|
|
23
|
+
label: c,
|
|
23
24
|
"aria-label": B["aria-label"],
|
|
24
25
|
"aria-labelledby": B["aria-labelledby"]
|
|
25
26
|
}), A({
|
|
26
|
-
status:
|
|
27
|
-
message:
|
|
28
|
-
messagePosition:
|
|
27
|
+
status: _,
|
|
28
|
+
message: y,
|
|
29
|
+
messagePosition: b,
|
|
29
30
|
loading: T,
|
|
30
31
|
inline: F,
|
|
31
|
-
label:
|
|
32
|
-
description:
|
|
32
|
+
label: c,
|
|
33
|
+
description: m
|
|
33
34
|
});
|
|
34
|
-
let W =
|
|
35
|
+
let W = y != null && y.length > 0 && _ != null, G = N != null, K = !W && (T || _ != null), q = M != null, J = j(s, G, K), Y = m == null ? void 0 : `${U}-description`, X = W ? `${U}-message` : void 0, ce = [
|
|
35
36
|
z,
|
|
36
37
|
Y,
|
|
37
38
|
X
|
|
38
|
-
].filter(Boolean).join(" ") || void 0,
|
|
39
|
+
].filter(Boolean).join(" ") || void 0, le = /* @__PURE__ */ O(E, { children: [
|
|
39
40
|
q ? /* @__PURE__ */ D("span", {
|
|
40
|
-
className: e("pointer-events-none absolute top-1/2 inline-flex -translate-y-1/2 [&>svg]:size-full [&>svg]:shrink-0 [&>svg]:stroke-current",
|
|
41
|
+
className: e("pointer-events-none absolute top-1/2 inline-flex -translate-y-1/2 [&>svg]:size-full [&>svg]:shrink-0 [&>svg]:stroke-current", d[s], f[s]),
|
|
41
42
|
"aria-hidden": !0,
|
|
42
43
|
children: M
|
|
43
44
|
}) : null,
|
|
@@ -46,60 +47,54 @@ var M = T(function({ size: l = "md", label: u, description: h, status: v, messag
|
|
|
46
47
|
ref: V,
|
|
47
48
|
id: U,
|
|
48
49
|
disabled: L,
|
|
49
|
-
"aria-invalid":
|
|
50
|
-
"aria-describedby":
|
|
51
|
-
className: e(
|
|
50
|
+
"aria-invalid": _ === "error" || void 0,
|
|
51
|
+
"aria-describedby": ce,
|
|
52
|
+
className: e(te, P && "type-code !font-mono !leading-none", W ? e(n, g[s], q && u[s], J, ee) : e(r, F ? e(p, q && u[s], I ?? g[s]) : e(g[s], q && u[s], J, _ != null && _ !== "success" ? e("border", ae[_]) : h[s], ie[s], re, _ != null && _ !== "success" ? v[_] : v.default, I)))
|
|
52
53
|
}),
|
|
53
54
|
G || K ? /* @__PURE__ */ O("span", {
|
|
54
|
-
className: e(
|
|
55
|
+
className: e(x, S[s]),
|
|
55
56
|
children: [G ? /* @__PURE__ */ D("span", {
|
|
56
|
-
className:
|
|
57
|
+
className: ne,
|
|
57
58
|
children: N
|
|
58
|
-
}) : null, K ? /* @__PURE__ */ D(
|
|
59
|
-
size:
|
|
60
|
-
status: T ? void 0 :
|
|
59
|
+
}) : null, K ? /* @__PURE__ */ D(oe, {
|
|
60
|
+
size: s,
|
|
61
|
+
status: T ? void 0 : _,
|
|
61
62
|
loading: T
|
|
62
63
|
}) : null]
|
|
63
64
|
}) : null
|
|
64
|
-
] }),
|
|
65
|
-
status:
|
|
66
|
-
message:
|
|
65
|
+
] }), Z = W && _ != null && X != null ? /* @__PURE__ */ D(C, {
|
|
66
|
+
status: _,
|
|
67
|
+
message: y,
|
|
67
68
|
messageId: X,
|
|
68
|
-
size:
|
|
69
|
-
messagePosition:
|
|
70
|
-
}) : null,
|
|
71
|
-
className:
|
|
69
|
+
size: s,
|
|
70
|
+
messagePosition: b
|
|
71
|
+
}) : null, Q = W && _ != null, $ = /* @__PURE__ */ O("div", {
|
|
72
|
+
className: Q ? a(s, _) : e(F ? "relative flex min-w-0 flex-1 items-center" : o),
|
|
72
73
|
children: [
|
|
73
|
-
|
|
74
|
+
Q && b === "top" ? Z : null,
|
|
74
75
|
/* @__PURE__ */ D("div", {
|
|
75
|
-
className:
|
|
76
|
-
children:
|
|
76
|
+
className: Q ? i(s, _, b) : "relative flex w-full items-center",
|
|
77
|
+
children: le
|
|
77
78
|
}),
|
|
78
|
-
|
|
79
|
+
Q && b === "bottom" ? Z : null
|
|
79
80
|
]
|
|
80
|
-
}) : /* @__PURE__ */ D("div", {
|
|
81
|
-
className: e(F ? "relative flex min-w-0 flex-1 items-center" : s),
|
|
82
|
-
children: /* @__PURE__ */ D("div", {
|
|
83
|
-
className: "relative flex w-full items-center",
|
|
84
|
-
children: Z
|
|
85
|
-
})
|
|
86
81
|
});
|
|
87
|
-
return F ||
|
|
88
|
-
className:
|
|
82
|
+
return F || c == null && m == null ? $ : /* @__PURE__ */ O("div", {
|
|
83
|
+
className: l,
|
|
89
84
|
children: [
|
|
90
|
-
|
|
85
|
+
c == null ? null : /* @__PURE__ */ D("label", {
|
|
91
86
|
htmlFor: U,
|
|
92
87
|
className: e(t("ui-label"), L && "opacity-50"),
|
|
93
|
-
children:
|
|
88
|
+
children: c
|
|
94
89
|
}),
|
|
95
|
-
$,
|
|
96
90
|
Y == null ? null : /* @__PURE__ */ D("p", {
|
|
97
91
|
id: Y,
|
|
98
92
|
className: t("caption"),
|
|
99
|
-
children:
|
|
100
|
-
})
|
|
93
|
+
children: m
|
|
94
|
+
}),
|
|
95
|
+
$
|
|
101
96
|
]
|
|
102
97
|
});
|
|
103
98
|
});
|
|
104
99
|
//#endregion
|
|
105
|
-
export { M as Input,
|
|
100
|
+
export { M as Input, m as inputMessagePositions, _ as inputSizes, b as inputStatuses };
|
|
@@ -20,8 +20,8 @@ var n = [
|
|
|
20
20
|
warning: "focus-within:outline-none focus-within:ring-2 focus-within:ring-warning-focus-ring",
|
|
21
21
|
success: "focus-within:outline-none focus-within:ring-2 focus-within:ring-success-focus-ring"
|
|
22
22
|
}, d = {
|
|
23
|
-
sm: "h-8 px-2.5 text-xs leading-none",
|
|
24
|
-
md: "h-11 px-3 text-sm leading-none",
|
|
23
|
+
sm: "h-8 px-2.5 text-xs pointer-coarse:text-base leading-none",
|
|
24
|
+
md: "h-11 px-3 text-sm pointer-coarse:text-base leading-none",
|
|
25
25
|
lg: "min-h-12 px-4 text-base leading-none"
|
|
26
26
|
}, f = "border border-border-control", p = "shadow-raised", m = {
|
|
27
27
|
sm: e(f, p),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAGf,OAAO,EAgBL,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qDAAqD;AACrD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,MAAM,CAAC,EAA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