@thewhatmatters/wmds 0.4.32 → 0.4.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/bin/wmds-check.mjs +24 -0
- package/dist/colors.css +2 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +6 -6
- package/dist/components/atoms/Input/Input.d.ts +13 -3
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +102 -67
- package/dist/components/atoms/Input/autofillFields.d.ts +9 -0
- package/dist/components/atoms/Input/autofillFields.d.ts.map +1 -0
- package/dist/components/atoms/Input/autofillFields.js +8 -0
- package/dist/components/atoms/Input/fieldWidth.d.ts +19 -0
- package/dist/components/atoms/Input/fieldWidth.d.ts.map +1 -0
- package/dist/components/atoms/Input/fieldWidth.js +24 -0
- package/dist/components/atoms/Radio/radioStyles.d.ts +1 -1
- package/dist/components/atoms/Radio/radioStyles.d.ts.map +1 -1
- package/dist/components/atoms/Radio/radioStyles.js +6 -6
- 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/Field/Field.d.ts +11 -3
- package/dist/components/molecules/Field/Field.d.ts.map +1 -1
- package/dist/components/molecules/Field/Field.js +45 -30
- package/dist/components/molecules/Field/fieldStyles.d.ts +9 -6
- package/dist/components/molecules/Field/fieldStyles.d.ts.map +1 -1
- package/dist/components/molecules/Field/fieldStyles.js +1 -1
- package/dist/components/molecules/IntakeForm/IntakeForm.d.ts +15 -5
- package/dist/components/molecules/IntakeForm/IntakeForm.d.ts.map +1 -1
- package/dist/components/molecules/IntakeForm/IntakeForm.js +110 -70
- package/dist/components/molecules/PillGroup/PillGroup.d.ts +7 -3
- package/dist/components/molecules/PillGroup/PillGroup.d.ts.map +1 -1
- package/dist/components/molecules/PillGroup/PillGroup.js +37 -27
- package/dist/components/molecules/PillGroup/pillGroupStyles.d.ts +3 -0
- package/dist/components/molecules/PillGroup/pillGroupStyles.d.ts.map +1 -1
- package/dist/components/molecules/PillGroup/pillGroupStyles.js +4 -3
- package/dist/components/molecules/Search/Search.d.ts +1 -1
- package/dist/components/molecules/Search/Search.d.ts.map +1 -1
- package/dist/components/molecules/Select/Select.d.ts +19 -1
- package/dist/components/molecules/Select/Select.d.ts.map +1 -1
- package/dist/components/molecules/Select/Select.js +102 -60
- package/dist/components/molecules/Select/selectStyles.d.ts +9 -1
- package/dist/components/molecules/Select/selectStyles.d.ts.map +1 -1
- package/dist/components/molecules/Select/selectStyles.js +11 -3
- package/dist/components/molecules/Select/usStateOptions.d.ts +8 -0
- package/dist/components/molecules/Select/usStateOptions.d.ts.map +1 -0
- package/dist/components/molecules/Select/usStateOptions.js +7 -0
- package/dist/components/molecules/StepProgress/StepProgress.d.ts.map +1 -1
- package/dist/components/molecules/StepProgress/StepProgress.js +1 -0
- 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/components/organisms/IntakeModal/IntakeModal.d.ts +3 -0
- package/dist/components/organisms/IntakeModal/IntakeModal.d.ts.map +1 -1
- package/dist/components/organisms/IntakeModal/IntakeModal.js +7 -7
- package/dist/components/organisms/IntakeModal/intakeModalStyles.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -141
- 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 +1 -1
- package/docs/exports.json +1 -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 +1 -1
- 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 +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,70 @@ 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.34
|
|
11
|
+
|
|
12
|
+
**Required and optional fields: mark the exception, read the badge with the field, never on autofill. Field width and form layout: widths that hint at the answer, a State select, side labels only on wide screens, and counters that don't cut text. Dropdowns, radios and checkboxes: a native Select for forms, bigger boxes with visible borders, and errors on Continue.**
|
|
13
|
+
|
|
14
|
+
- **Field** `description` sits **between the label and the control** (was below; Labels and placeholders F8), so every hint is read before typing. New **`counter`** prop: a character counter, the one helper that stays below the control. Both join the control's accessible description (hint first). New test **fieldHintOrder.test.ts**.
|
|
15
|
+
- **IntakeForm**: hints above their fields; the details counter ("67 / 400") uses `counter`, below the box. Company's hint is "So we can read up on you first."
|
|
16
|
+
- **Input** `endBadge` (Required and optional Q8):
|
|
17
|
+
- Screen readers hear the badge as part of the field's description, after the hint.
|
|
18
|
+
- With a status icon, the icon comes first, then the badge (it used to be the badge, then the icon).
|
|
19
|
+
- The field keeps room for the badge, so a long value stops before it. A new interaction test checks this at phone width.
|
|
20
|
+
- Input warns in the console when `endBadge` sits on an autofill field (`autoComplete` name, email, tel, password, address or organization fields).
|
|
21
|
+
- **wmds-check** `badge-on-autofill` (new, error): fails an Input with `endBadge` on an autofill field. Put "(optional)" in the label there.
|
|
22
|
+
- **IntakeForm** (Q2, Q7, Q9):
|
|
23
|
+
- Name, email and project details carry `aria-required`.
|
|
24
|
+
- The website field is now labelled "Your website", with an "Optional" badge and a stated use ("So we can see what you have now.").
|
|
25
|
+
- **Company is off by default** (`company` turns it on). It's labelled "Company (optional)", since it's an autofill field.
|
|
26
|
+
- **Field width** (Form layout L7): **Input** and **Select** take `width` in characters (`2ch`, `4ch`, `5ch`, `10ch`, `20ch`; default `full`) for fixed-length answers, never wider than their container. The label and hint keep their own width. A short field keeps its width when an error shows; the status band under it is at least 18rem wide, so the message reads on one or two lines. Story **Components/Input → Pattern — field widths** (city, state and ZIP share a row).
|
|
27
|
+
- **State select** (L7): `usStateOptions` (new export) lists the 50 states and DC as two-letter abbreviations. Story **Components/Select → Pattern — US state**.
|
|
28
|
+
- **Select `native`** (Dropdowns C8): the browser's own `<select>` in the WMDS shell, with the same chevron, sizes and focus ring, and 16px text on touch. The phone opens its own picker, typing jumps to an option, the browser can autofill it (`autoComplete="address-level1"`), and it submits with a plain form. It's the default when a Select has `name` or `autoComplete`. The custom listbox stays for toolbars, filters and menus with icons or counts (native options are text only). New `required` prop.
|
|
29
|
+
- **Select** `description` sits above the trigger (Labels F8), like Input, TextArea and Field.
|
|
30
|
+
- **Field** `orientation="horizontal"` (L8) puts the label beside the control only from `lg` (1024) and stacks below it. Use it for dense app settings only, never marketing or contact forms.
|
|
31
|
+
- **IntakeForm counter** (L9): no `maxLength`, so a long paste stays whole. The counter says "N characters left" or "You have N characters too many". A screen reader hears it once typing pauses, not on every keystroke. Over the limit, the error band repeats the counter's words ("You have 7 characters too many"), and the counter line hides while the band shows: one message, not two. `intakeCounterText` is exported. Story **Pattern — over the character limit**.
|
|
32
|
+
- **IntakeModal footer** (Buttons U6, U8): Continue comes first and stays enabled; Back follows as a `ghost` button. **IntakeForm `submitCount`** (new): the caller counts Continue presses. From the first press, every field shows its error. Two or more errors put an **ErrorSummary** at the top and focus it; one error focuses its field (V5, closes gap #49). `continueDisabled` is now discouraged. Story **Components/IntakeModal → Pattern — errors on Continue**.
|
|
33
|
+
- **Select**'s empty-choice text ("Select…") uses `text-muted`, which clears 4.5:1. It was `text-disabled`, which failed axe.
|
|
34
|
+
- **StepProgress** names its progressbar ("Step 1 of 4"), fixing a known axe violation.
|
|
35
|
+
- **Checkbox and Radio** (Dropdowns C3, C4):
|
|
36
|
+
- The box is 24px (`md`; `sm` grows to 24px on touch screens).
|
|
37
|
+
- Rows are 44px tall on touch screens.
|
|
38
|
+
- The empty box's border uses `border-control`, which clears 3:1 (it was 1.3:1).
|
|
39
|
+
- **PillGroup** `label` (new): a visible question above the pills that names the group (C2, C9). `aria-label` is now optional, for a question shown as a heading right above.
|
|
40
|
+
- **Docs** (C7, C9): when to use Select, Switch, SegmentedControl, PillGroup and SelectableCard. The Select "with label" story now has 8 alphabetical options, and the PillGroup story starts with nothing selected.
|
|
41
|
+
- **Stories:** the Input badge stories use a website field with "Optional", not an email field. They add "Pattern — end badge with a long value" and "Pattern — end badge + status icon". The validation morph demo drops its badge from the email field.
|
|
42
|
+
|
|
43
|
+
### Consumer actions
|
|
44
|
+
|
|
45
|
+
- Run `npx wmds-check`, and move any badge on a name, email, phone, password, address or company field into its label ("Business email (optional)").
|
|
46
|
+
- Mark the exception: in a mostly-required form, badge the optional fields "Optional".
|
|
47
|
+
- `IntakeForm` no longer shows Company unless you pass `company`. The website field's accessible name changed from "Link" to "Your website".
|
|
48
|
+
|
|
49
|
+
- Give ZIP, phone, year and state fields a `width`, and use `usStateOptions` for a State select with `autoComplete="address-level1"`. Remove `maxLength` from text people write, and show a counter instead.
|
|
50
|
+
- Form Selects with `name` or `autoComplete` are now native; pass `native={false}` to keep the custom listbox (needed for options with `start`/`end`).
|
|
51
|
+
- IntakeModal: stop passing `continueDisabled`. Count Continue presses into IntakeForm's `submitCount` instead, and note that Back is now a ghost button after Continue.
|
|
52
|
+
- Give **PillGroup** a `label` (the question).
|
|
53
|
+
- `Field orientation="horizontal"` now stacks below 1024px. If you relied on side labels on tablets, that changes.
|
|
54
|
+
- If a **Field** `description` is a character counter, pass it as `counter` so it stays below the control.
|
|
55
|
+
|
|
56
|
+
## 0.4.33
|
|
57
|
+
|
|
58
|
+
**Cards can take their own tone, and a Carousel can drift on its own with a Pause button and a follow cursor.**
|
|
59
|
+
|
|
60
|
+
- **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`.
|
|
61
|
+
- **`[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.
|
|
62
|
+
- **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).
|
|
63
|
+
- **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.
|
|
64
|
+
- **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)]`.
|
|
65
|
+
- **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.
|
|
66
|
+
- **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".
|
|
67
|
+
- **Carousel** reads reduced motion through Motion's config, so a `MotionConfig reducedMotion` around it is respected (no change under the default `user`).
|
|
68
|
+
- 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**.
|
|
69
|
+
|
|
70
|
+
### Consumer actions
|
|
71
|
+
|
|
72
|
+
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.
|
|
73
|
+
|
|
10
74
|
## 0.4.32
|
|
11
75
|
|
|
12
76
|
**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.**
|
package/bin/wmds-check.mjs
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
* (Errors and validation V10; a status-only success tick is fine)
|
|
23
23
|
* missing-label error a WMDS Input, TextArea, Select or Search with no label, aria-label or
|
|
24
24
|
* aria-labelledby (Labels and placeholders F7; a spread {...props} is trusted)
|
|
25
|
+
* badge-on-autofill error an Input with endBadge on an autofill field (autoComplete name, email, tel,
|
|
26
|
+
* password, address, organization…; Required and optional Q8): autofill paints
|
|
27
|
+
* over the badge, so say "(optional)" in the label
|
|
25
28
|
* brand-contrast error a brand-kit pair in the app's CSS under WCAG AA 4.5:1: --color-on-X (and
|
|
26
29
|
* --color-on-X-muted) on --color-X, for primary, brand-surface and field,
|
|
27
30
|
* when both are hex values in the same rule
|
|
@@ -55,6 +58,15 @@ try {
|
|
|
55
58
|
// Not installed: the pattern rules are skipped.
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
// Required and optional Q8: autocomplete tokens browsers fill (same list as autofillFields.ts).
|
|
62
|
+
const autofillTokens = [
|
|
63
|
+
"name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname",
|
|
64
|
+
"email", "username", "new-password", "current-password", "one-time-code", "organization", "organization-title",
|
|
65
|
+
"street-address", "address-line1", "address-line2", "address-line3", "address-level1", "address-level2",
|
|
66
|
+
"address-level3", "address-level4", "country", "country-name", "postal-code",
|
|
67
|
+
"tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-extension",
|
|
68
|
+
];
|
|
69
|
+
|
|
58
70
|
const skipDirs = new Set(["node_modules", ".next", "dist", "build", "out", ".git", "coverage", "storybook-static"]);
|
|
59
71
|
const files = [];
|
|
60
72
|
const cssFiles = [];
|
|
@@ -264,6 +276,18 @@ for (const file of files) {
|
|
|
264
276
|
}
|
|
265
277
|
}
|
|
266
278
|
|
|
279
|
+
// Q8: no badge inside an autofill field. Keep this list in step with src/components/atoms/Input/autofillFields.ts.
|
|
280
|
+
for (const match of source.matchAll(/<Input(?=[\s/>])/g)) {
|
|
281
|
+
const element = elementFrom(match.index);
|
|
282
|
+
if (!/\bendBadge=/.test(element)) continue;
|
|
283
|
+
const autoComplete = element.match(/\bautoComplete=(?:"([^"]*)"|\{\s*["']([^"']*)["']\s*\})/);
|
|
284
|
+
const value = autoComplete?.[1] ?? autoComplete?.[2];
|
|
285
|
+
if (value == null || !value.toLowerCase().split(/\s+/).some((token) => autofillTokens.includes(token))) continue;
|
|
286
|
+
const line = source.slice(0, match.index).split("\n").length;
|
|
287
|
+
if (ignored(lines, line - 1, "badge-on-autofill")) continue;
|
|
288
|
+
report(file, line, "badge-on-autofill", "error", `endBadge on autoComplete="${value}" — autofill covers it; put "(optional)" in the label`);
|
|
289
|
+
}
|
|
290
|
+
|
|
267
291
|
// V10: an error or warning status always says what's wrong.
|
|
268
292
|
for (const match of source.matchAll(/\bstatus=(?:"(error|warning)"|\{\s*["'](error|warning)["']\s*\})/g)) {
|
|
269
293
|
const element = elementFrom(source.lastIndexOf("<", match.index));
|
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
|
|
|
@@ -9,7 +9,7 @@ export declare const checkboxBoxSizeClasses: Record<CheckboxSize, string>;
|
|
|
9
9
|
export declare const checkboxCheckIconSizeClasses: Record<CheckboxSize, string>;
|
|
10
10
|
export declare const checkboxIndeterminateBarSizeClasses: Record<CheckboxSize, string>;
|
|
11
11
|
export declare const checkboxBoxBaseClasses: string;
|
|
12
|
-
export declare const checkboxBoxUncheckedClasses = "border-border-
|
|
12
|
+
export declare const checkboxBoxUncheckedClasses = "border-border-control bg-surface group-hover/checkbox:border-border-control group-hover/checkbox:bg-body";
|
|
13
13
|
export declare const checkboxBoxCheckedClasses = "border-primary bg-primary text-primary-foreground group-hover/checkbox:border-primary group-hover/checkbox:bg-primary";
|
|
14
14
|
/** Check / indeterminate / spinner marks on the filled box. */
|
|
15
15
|
export declare const checkboxMarkClasses = "stroke-current text-inherit";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkboxStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/checkboxStyles.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,aAAa,uBAAwB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkboxStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/checkboxStyles.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,aAAa,uBAAwB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,a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;AAEvD,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,iBAAiB,CAAC;AAE1D,eAAO,MAAM,kBAAkB,QAA0D,CAAC;AAE1F,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,eAAO,MAAM,0BAA0B,+HACuF,CAAC;AAE/H,eAAO,MAAM,wBAAwB,sKACgI,CAAC;AAEtK,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,OAAO,EACtB,QAAQ,CAAC,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CAWR;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAK7F;AAED,iEAAiE;AACjE,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAK1E"}
|
|
@@ -5,21 +5,21 @@ import { motionTransition as n } from "../../../lib/motion.js";
|
|
|
5
5
|
import { inputStatusBannerSurfaceClasses as r, inputStatusShellClasses as i } from "../Input/inputShellStyles.js";
|
|
6
6
|
//#region src/components/atoms/Checkbox/checkboxStyles.ts
|
|
7
7
|
var a = ["sm", "md"], o = {
|
|
8
|
-
sm: "min-h-7 gap-2",
|
|
9
|
-
md: "min-h-9 gap-2.5"
|
|
8
|
+
sm: "min-h-7 gap-2 pointer-coarse:min-h-11",
|
|
9
|
+
md: "min-h-9 gap-2.5 pointer-coarse:min-h-11"
|
|
10
10
|
}, s = {
|
|
11
|
-
sm: "size-7",
|
|
11
|
+
sm: "size-7 pointer-coarse:size-9",
|
|
12
12
|
md: "size-9"
|
|
13
13
|
}, c = {
|
|
14
|
-
sm: "size-[18px] rounded",
|
|
15
|
-
md: "size-
|
|
14
|
+
sm: "size-[18px] rounded pointer-coarse:size-6",
|
|
15
|
+
md: "size-6 rounded-md"
|
|
16
16
|
}, l = {
|
|
17
17
|
sm: "size-3",
|
|
18
18
|
md: "size-3.5"
|
|
19
19
|
}, u = {
|
|
20
20
|
sm: "h-0.5 w-2.5",
|
|
21
21
|
md: "h-0.5 w-3"
|
|
22
|
-
}, d = e("pointer-events-none flex items-center justify-center border shadow-none", "transition-[background-color,border-color,color]", n("fast")), f = "border-border-
|
|
22
|
+
}, d = e("pointer-events-none flex items-center justify-center border shadow-none", "transition-[background-color,border-color,color]", n("fast")), f = "border-border-control bg-surface group-hover/checkbox:border-border-control group-hover/checkbox:bg-body", p = "border-primary bg-primary text-primary-foreground group-hover/checkbox:border-primary group-hover/checkbox:bg-primary", m = "stroke-current text-inherit", h = "opacity-50", g = t("ui-label"), _ = e(t("caption"), "leading-snug"), v = e("ml-auto shrink-0 tabular-nums", t("caption")), y = "flex-1", b = "flex min-w-0 items-baseline gap-2", x = "flex min-w-0 flex-col gap-px", S = e(g, "leading-tight"), C = {
|
|
23
23
|
sm: "flex min-w-0 items-start gap-2",
|
|
24
24
|
md: "flex min-w-0 items-start gap-2.5"
|
|
25
25
|
}, w = {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type InputMessagePosition, type InputSize, type InputStatus } from "./inputShellStyles";
|
|
3
|
+
import { type FieldWidth } from "./fieldWidth";
|
|
4
|
+
export { fieldWidths, type FieldWidth } from "./fieldWidth";
|
|
3
5
|
export type { InputMessagePosition, InputSize, InputStatus } from "./inputShellStyles";
|
|
4
6
|
export { inputMessagePositions, inputSizes, inputStatuses } from "./inputShellStyles";
|
|
5
7
|
/** Layout-only — not for colors, borders, or typography overrides. */
|
|
6
8
|
export type InputLayoutClassName = string;
|
|
7
|
-
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
9
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "width"> {
|
|
8
10
|
size?: InputSize;
|
|
9
11
|
/**
|
|
10
12
|
* Optional visible label — omit for bare inputs. No label asterisk; use `endBadge` for Required.
|
|
@@ -26,10 +28,18 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
26
28
|
/** Monospace value — `type-code` instead of the sans face. For a read-only key or id. */
|
|
27
29
|
mono?: boolean;
|
|
28
30
|
/**
|
|
29
|
-
* Trailing inset inside the shell — pass {@link Badge} (
|
|
30
|
-
* Atoms cannot import Badge; compose at call site. Combinable with
|
|
31
|
+
* Trailing inset inside the shell — pass {@link Badge} ("Optional" or "Required", whichever is the
|
|
32
|
+
* exception in the form). Atoms cannot import Badge; compose at call site. Combinable with
|
|
33
|
+
* `status` / `loading`: the status icon comes first, then the badge. Screen readers hear it as part
|
|
34
|
+
* of the field's description. Not on autofill fields (name, email, tel, password, address,
|
|
35
|
+
* organization): autofill paints over it, so put "(optional)" in the label there.
|
|
31
36
|
*/
|
|
32
37
|
endBadge?: ReactElement;
|
|
38
|
+
/**
|
|
39
|
+
* Field width in characters for fixed-length answers (ZIP `5ch`, year `4ch`, phone `10ch`); default
|
|
40
|
+
* `full`. Free-form answers stay full width (Form layout L7). The label and hint keep their own width.
|
|
41
|
+
*/
|
|
42
|
+
width?: FieldWidth;
|
|
33
43
|
/** Inside a parent pill (Search, CopyField) — no outer shell; the parent owns border and focus ring. */
|
|
34
44
|
inline?: boolean;
|
|
35
45
|
className?: InputLayoutClassName;
|
|
@@ -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;A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AC;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;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,wGAAwG;IACxG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAyED;;;GAGG;AACH,eAAO,MAAM,KAAK,yGAgMhB,CAAC"}
|
|
@@ -1,100 +1,135 @@
|
|
|
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 {
|
|
8
|
-
import {
|
|
4
|
+
import { inputAttachedFieldClasses as n, inputAttachedInputClasses as r, inputBaseClasses as i, inputCompoundInnerFieldClassesFor as ee, inputCompoundShellClassesFor as te, inputControlStackClasses as a, inputDisabledClasses as o, inputEndBadgeAndStatusGapClasses as s, inputEndBadgeGapClasses as c, inputEndBadgeWrapperClasses as ne, inputFieldStackClasses as re, inputIconGapClasses as l, inputIconPositionClasses as ie, inputIconSizeClasses as ae, inputInlineClasses as u, inputMessagePositions as d, inputShellClasses as f, inputSizeClasses as p, inputSizes as m, inputSoloFocusRingBaseClasses as oe, inputSoloFocusRingColorClasses as h, inputSoloRadiusClasses as se, inputStatusGapClasses as g, inputStatusShellClasses as ce, inputStatuses as _, inputTrailingInsetClasses as le, inputTrailingInsetPositionClasses as ue } from "./inputShellStyles.js";
|
|
5
|
+
import { InputStatusBanner as de, warnStatusWithoutMessage as fe } from "../inputShared/InputStatusBanner.js";
|
|
6
|
+
import { InputTrailingAffordance as v } from "../inputShared/InputTrailingAffordance.js";
|
|
7
|
+
import { isAutofillField as y } from "./autofillFields.js";
|
|
8
|
+
import { fieldWidthBandStyle as b, fieldWidthStyle as x, fieldWidths as S } from "./fieldWidth.js";
|
|
9
|
+
import { forwardRef as C, useId as pe } from "react";
|
|
10
|
+
import { Fragment as me, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
11
|
//#region src/components/atoms/Input/Input.tsx
|
|
10
|
-
function
|
|
12
|
+
function E(e) {
|
|
11
13
|
e.label == null && e["aria-label"] == null && e["aria-labelledby"] == null && console.warn("[WMDS Input] Provide `label`, `aria-label`, or `aria-labelledby`.");
|
|
12
14
|
}
|
|
13
|
-
function
|
|
15
|
+
function D(e, t) {
|
|
16
|
+
e && y(t) && console.warn(`[WMDS Input] No \`endBadge\` on an autofill field (autocomplete="${t}"): put "(optional)" in the label.`);
|
|
17
|
+
}
|
|
18
|
+
function O(e) {
|
|
14
19
|
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
20
|
}
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
var k = {
|
|
22
|
+
sm: .625,
|
|
23
|
+
md: .75,
|
|
24
|
+
lg: 1
|
|
25
|
+
}, A = {
|
|
26
|
+
sm: 2,
|
|
27
|
+
md: 2.5,
|
|
28
|
+
lg: 2.75
|
|
29
|
+
}, j = {
|
|
30
|
+
[g.sm]: 2,
|
|
31
|
+
[g.md]: 2.5,
|
|
32
|
+
[g.lg]: 2.75,
|
|
33
|
+
[c.sm]: 4.5,
|
|
34
|
+
[c.md]: 5,
|
|
35
|
+
[c.lg]: 6,
|
|
36
|
+
[s.sm]: 6.5,
|
|
37
|
+
[s.md]: 7,
|
|
38
|
+
[s.lg]: 8
|
|
39
|
+
};
|
|
40
|
+
function M(e, t, n) {
|
|
41
|
+
let r = k[e];
|
|
42
|
+
return `${(t ? A[e] : r) + (n === !1 ? r : j[n] ?? r)}rem + 2px`;
|
|
43
|
+
}
|
|
44
|
+
function N(e, t, n) {
|
|
45
|
+
return t && n ? s[e] : t ? c[e] : n ? g[e] : !1;
|
|
18
46
|
}
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
47
|
+
var P = C(function({ size: s = "md", label: c, description: d, status: m, message: g, messagePosition: _ = "bottom", loading: y = !1, icon: S, endBadge: C, width: k = "full", mono: A = !1, inline: j = !1, className: P, disabled: F, id: I, "aria-describedby": L, ...R }, z) {
|
|
48
|
+
fe("Input", m, g);
|
|
49
|
+
let he = pe(), B = I ?? he;
|
|
50
|
+
E({
|
|
23
51
|
label: c,
|
|
24
|
-
"aria-label":
|
|
25
|
-
"aria-labelledby":
|
|
26
|
-
}),
|
|
27
|
-
status:
|
|
28
|
-
message:
|
|
29
|
-
messagePosition:
|
|
30
|
-
loading:
|
|
31
|
-
inline:
|
|
52
|
+
"aria-label": R["aria-label"],
|
|
53
|
+
"aria-labelledby": R["aria-labelledby"]
|
|
54
|
+
}), O({
|
|
55
|
+
status: m,
|
|
56
|
+
message: g,
|
|
57
|
+
messagePosition: _,
|
|
58
|
+
loading: y,
|
|
59
|
+
inline: j,
|
|
32
60
|
label: c,
|
|
33
|
-
description:
|
|
61
|
+
description: d
|
|
34
62
|
});
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
let V = g != null && g.length > 0 && m != null, H = C != null;
|
|
64
|
+
D(H, R.autoComplete);
|
|
65
|
+
let U = !V && (y || m != null), W = S != null, G = N(s, H, U), K = d == null ? void 0 : `${B}-description`, q = V ? `${B}-message` : void 0, J = H ? `${B}-badge` : void 0, ge = [
|
|
66
|
+
L,
|
|
67
|
+
K,
|
|
68
|
+
J,
|
|
69
|
+
q
|
|
70
|
+
].filter(Boolean).join(" ") || void 0, _e = /* @__PURE__ */ T(me, { children: [
|
|
71
|
+
W ? /* @__PURE__ */ w("span", {
|
|
72
|
+
className: e("pointer-events-none absolute top-1/2 inline-flex -translate-y-1/2 [&>svg]:size-full [&>svg]:shrink-0 [&>svg]:stroke-current", ie[s], ae[s]),
|
|
42
73
|
"aria-hidden": !0,
|
|
43
|
-
children:
|
|
74
|
+
children: S
|
|
44
75
|
}) : null,
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
...
|
|
47
|
-
ref:
|
|
48
|
-
id:
|
|
49
|
-
disabled:
|
|
50
|
-
"aria-invalid":
|
|
51
|
-
"aria-describedby":
|
|
52
|
-
className: e(
|
|
76
|
+
/* @__PURE__ */ w("input", {
|
|
77
|
+
...R,
|
|
78
|
+
ref: z,
|
|
79
|
+
id: B,
|
|
80
|
+
disabled: F,
|
|
81
|
+
"aria-invalid": m === "error" || void 0,
|
|
82
|
+
"aria-describedby": ge,
|
|
83
|
+
className: e(o, A && "type-code !font-mono !leading-none", V ? e(n, p[s], W && l[s], G, r) : e(i, j ? e(u, W && l[s], P ?? p[s]) : e(p[s], W && l[s], G, m != null && m !== "success" ? e("border", ce[m]) : f[s], se[s], oe, m != null && m !== "success" ? h[m] : h.default, P)))
|
|
53
84
|
}),
|
|
54
|
-
|
|
55
|
-
className: e(
|
|
56
|
-
children: [
|
|
57
|
-
className: ne,
|
|
58
|
-
children: N
|
|
59
|
-
}) : null, K ? /* @__PURE__ */ D(oe, {
|
|
85
|
+
H || U ? /* @__PURE__ */ T("span", {
|
|
86
|
+
className: e(le, ue[s]),
|
|
87
|
+
children: [U ? /* @__PURE__ */ w(v, {
|
|
60
88
|
size: s,
|
|
61
|
-
status:
|
|
62
|
-
loading:
|
|
89
|
+
status: y ? void 0 : m,
|
|
90
|
+
loading: y
|
|
91
|
+
}) : null, H ? /* @__PURE__ */ w("span", {
|
|
92
|
+
id: J,
|
|
93
|
+
className: ne,
|
|
94
|
+
children: C
|
|
63
95
|
}) : null]
|
|
64
96
|
}) : null
|
|
65
|
-
] }),
|
|
66
|
-
status:
|
|
67
|
-
message:
|
|
68
|
-
messageId:
|
|
97
|
+
] }), Y = V && m != null && q != null ? /* @__PURE__ */ w(de, {
|
|
98
|
+
status: m,
|
|
99
|
+
message: g,
|
|
100
|
+
messageId: q,
|
|
69
101
|
size: s,
|
|
70
|
-
messagePosition:
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
messagePosition: _,
|
|
103
|
+
className: k === "full" ? void 0 : _ === "bottom" ? "rounded-tr-[1.375rem]" : "rounded-br-[1.375rem]"
|
|
104
|
+
}) : null, X = V && m != null, Z = M(s, W, G), Q = j ? void 0 : x(k, Z), $ = /* @__PURE__ */ T("div", {
|
|
105
|
+
style: X && !j ? b(k, Z) : Q,
|
|
106
|
+
className: X ? te(s, m) : e(j ? "relative flex min-w-0 flex-1 items-center" : a),
|
|
73
107
|
children: [
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
108
|
+
X && _ === "top" ? Y : null,
|
|
109
|
+
/* @__PURE__ */ w("div", {
|
|
110
|
+
style: X ? Q : void 0,
|
|
111
|
+
className: X ? ee(s, m, _) : "relative flex w-full items-center",
|
|
112
|
+
children: _e
|
|
78
113
|
}),
|
|
79
|
-
|
|
114
|
+
X && _ === "bottom" ? Y : null
|
|
80
115
|
]
|
|
81
116
|
});
|
|
82
|
-
return
|
|
83
|
-
className:
|
|
117
|
+
return j || c == null && d == null ? $ : /* @__PURE__ */ T("div", {
|
|
118
|
+
className: re,
|
|
84
119
|
children: [
|
|
85
|
-
c == null ? null : /* @__PURE__ */
|
|
86
|
-
htmlFor:
|
|
87
|
-
className: e(t("ui-label"),
|
|
120
|
+
c == null ? null : /* @__PURE__ */ w("label", {
|
|
121
|
+
htmlFor: B,
|
|
122
|
+
className: e(t("ui-label"), F && "opacity-50"),
|
|
88
123
|
children: c
|
|
89
124
|
}),
|
|
90
|
-
|
|
91
|
-
id:
|
|
125
|
+
K == null ? null : /* @__PURE__ */ w("p", {
|
|
126
|
+
id: K,
|
|
92
127
|
className: t("caption"),
|
|
93
|
-
children:
|
|
128
|
+
children: d
|
|
94
129
|
}),
|
|
95
130
|
$
|
|
96
131
|
]
|
|
97
132
|
});
|
|
98
133
|
});
|
|
99
134
|
//#endregion
|
|
100
|
-
export {
|
|
135
|
+
export { P as Input, S as fieldWidths, d as inputMessagePositions, m as inputSizes, _ as inputStatuses };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Required and optional fields Q8: autocomplete tokens the browser or a password manager fills.
|
|
3
|
+
* Autofill paints over a badge inside the field, so these fields say "(optional)" in the label instead.
|
|
4
|
+
* bin/wmds-check.mjs keeps the same list (a unit test holds them together).
|
|
5
|
+
*/
|
|
6
|
+
export declare const autofillTokens: readonly ["name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "email", "username", "new-password", "current-password", "one-time-code", "organization", "organization-title", "street-address", "address-line1", "address-line2", "address-line3", "address-level1", "address-level2", "address-level3", "address-level4", "country", "country-name", "postal-code", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-extension"];
|
|
7
|
+
/** True when an `autocomplete` value names an autofill field ("shipping postal-code" counts). */
|
|
8
|
+
export declare function isAutofillField(autoComplete: string | undefined): boolean;
|
|
9
|
+
//# sourceMappingURL=autofillFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autofillFields.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/autofillFields.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,cAAc,wfAgCjB,CAAC;AAEX,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAIzE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/atoms/Input/autofillFields.ts
|
|
3
|
+
var e = /* @__PURE__ */ "name.honorific-prefix.given-name.additional-name.family-name.honorific-suffix.nickname.email.username.new-password.current-password.one-time-code.organization.organization-title.street-address.address-line1.address-line2.address-line3.address-level1.address-level2.address-level3.address-level4.country.country-name.postal-code.tel.tel-country-code.tel-national.tel-area-code.tel-local.tel-extension".split(".");
|
|
4
|
+
function t(t) {
|
|
5
|
+
return t != null && t.toLowerCase().split(/\s+/).some((t) => e.includes(t));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as autofillTokens, t as isAutofillField };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Form layout L7: a field's width hints at the answer. Characters for fixed-length answers (ZIP 5ch,
|
|
4
|
+
* a US state 2ch, a year 4ch, a phone 10ch…), `full` for everything else.
|
|
5
|
+
*/
|
|
6
|
+
export declare const fieldWidths: readonly ["2ch", "4ch", "5ch", "10ch", "20ch", "full"];
|
|
7
|
+
export type FieldWidth = (typeof fieldWidths)[number];
|
|
8
|
+
/**
|
|
9
|
+
* Width for the field's shell: the characters plus the shell's own padding, border and insets (`chrome`,
|
|
10
|
+
* a CSS length), never wider than its container. `ch` is the inherited body face's, so the shell has a
|
|
11
|
+
* little room to spare at the smaller field sizes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fieldWidthStyle(width: FieldWidth, chrome: string): CSSProperties | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The status band under a short field: at least 18rem (or the container), so a message reads on one or
|
|
16
|
+
* two lines while the field itself keeps its width — no jump when an error appears.
|
|
17
|
+
*/
|
|
18
|
+
export declare function fieldWidthBandStyle(width: FieldWidth, chrome: string): CSSProperties | undefined;
|
|
19
|
+
//# sourceMappingURL=fieldWidth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldWidth.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/fieldWidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,WAAW,wDAAyD,CAAC;AAElF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAG5F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAGhG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/atoms/Input/fieldWidth.ts
|
|
3
|
+
var e = [
|
|
4
|
+
"2ch",
|
|
5
|
+
"4ch",
|
|
6
|
+
"5ch",
|
|
7
|
+
"10ch",
|
|
8
|
+
"20ch",
|
|
9
|
+
"full"
|
|
10
|
+
];
|
|
11
|
+
function t(e, t) {
|
|
12
|
+
if (e !== "full") return {
|
|
13
|
+
width: `calc(${e} + ${t})`,
|
|
14
|
+
maxWidth: "100%"
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function n(e, t) {
|
|
18
|
+
if (e !== "full") return {
|
|
19
|
+
width: `max(calc(${e} + ${t}), min(100%, 18rem))`,
|
|
20
|
+
maxWidth: "100%"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as fieldWidthBandStyle, t as fieldWidthStyle, e as fieldWidths };
|
|
@@ -7,7 +7,7 @@ export declare const radioHitTargetSizeClasses: Record<RadioSize, string>;
|
|
|
7
7
|
export declare const radioCircleSizeClasses: Record<RadioSize, string>;
|
|
8
8
|
export declare const radioDotSizeClasses: Record<RadioSize, string>;
|
|
9
9
|
export declare const radioCircleBaseClasses: string;
|
|
10
|
-
export declare const radioCircleUncheckedClasses = "border-border-
|
|
10
|
+
export declare const radioCircleUncheckedClasses = "border-border-control bg-surface group-hover/radio:border-border-control group-hover/radio:bg-body";
|
|
11
11
|
export declare const radioCircleCheckedClasses = "border-primary bg-primary group-hover/radio:border-primary group-hover/radio:bg-primary";
|
|
12
12
|
export declare const radioDotClasses = "rounded-full bg-primary-foreground";
|
|
13
13
|
export declare const radioCircleDisabledClasses = "opacity-50";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radioStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radio/radioStyles.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,UAAU,uBAAwB,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"radioStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radio/radioStyles.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,UAAU,uBAAwB,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAIzD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG/D,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAI5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAGzD,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAIlC,CAAC;AAEF,eAAO,MAAM,2BAA2B,uGAE8D,CAAC;AAEvG,eAAO,MAAM,yBAAyB,4FACqD,CAAC;AAE5F,eAAO,MAAM,eAAe,uCAAuC,CAAC;AAEpE,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD,eAAO,MAAM,iBAAiB,QAA8B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,QAAiD,CAAC;AAEtF,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE,eAAO,MAAM,gCAAgC,QAAyC,CAAC;AAEvF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAGhE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG3E,CAAC;AAEF,eAAO,MAAM,mBAAmB,oDAAoD,CAAC;AAErF,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAEvD,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,8FACyD,CAAC;AAE9F,eAAO,MAAM,qBAAqB,sKACmI,CAAC;AAEtK,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CASR;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAK1F;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAKvE"}
|
|
@@ -5,18 +5,18 @@ import { motionTransition as n } from "../../../lib/motion.js";
|
|
|
5
5
|
import { inputStatusBannerSurfaceClasses as r, inputStatusShellClasses as i } from "../Input/inputShellStyles.js";
|
|
6
6
|
//#region src/components/atoms/Radio/radioStyles.ts
|
|
7
7
|
var a = ["sm", "md"], o = {
|
|
8
|
-
sm: "min-h-7 gap-2",
|
|
9
|
-
md: "min-h-9 gap-2.5"
|
|
8
|
+
sm: "min-h-7 gap-2 pointer-coarse:min-h-11",
|
|
9
|
+
md: "min-h-9 gap-2.5 pointer-coarse:min-h-11"
|
|
10
10
|
}, s = {
|
|
11
|
-
sm: "size-7",
|
|
11
|
+
sm: "size-7 pointer-coarse:size-9",
|
|
12
12
|
md: "size-9"
|
|
13
13
|
}, c = {
|
|
14
|
-
sm: "size-[18px] rounded-full",
|
|
15
|
-
md: "size-
|
|
14
|
+
sm: "size-[18px] rounded-full pointer-coarse:size-6",
|
|
15
|
+
md: "size-6 rounded-full"
|
|
16
16
|
}, l = {
|
|
17
17
|
sm: "size-2",
|
|
18
18
|
md: "size-2.5"
|
|
19
|
-
}, u = e("pointer-events-none flex items-center justify-center border shadow-none", "transition-[background-color,border-color]", n("fast")), d = "border-border-
|
|
19
|
+
}, u = e("pointer-events-none flex items-center justify-center border shadow-none", "transition-[background-color,border-color]", n("fast")), d = "border-border-control bg-surface group-hover/radio:border-border-control group-hover/radio:bg-body", f = "border-primary bg-primary group-hover/radio:border-primary group-hover/radio:bg-primary", p = "rounded-full bg-primary-foreground", m = "opacity-50", h = t("ui-label"), g = e(t("caption"), "leading-snug"), _ = "flex min-w-0 flex-col gap-px", v = e(h, "leading-tight"), y = {
|
|
20
20
|
sm: "flex min-w-0 items-start gap-2",
|
|
21
21
|
md: "flex min-w-0 items-start gap-2.5"
|
|
22
22
|
}, b = {
|
|
@@ -17,8 +17,17 @@ export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
|
17
17
|
/** Overrides automatic headerless detection. Normally omitted: Body without Header gets a 2px top inset. */
|
|
18
18
|
headerless?: boolean;
|
|
19
19
|
as?: "div" | "article" | "section";
|
|
20
|
+
/**
|
|
21
|
+
* The card's own colour pair, so a card can stand apart from its section (testimonials, offers):
|
|
22
|
+
* `inverse` (the brand surface, dark roles), `field` (the saturated field colour, flat), or `light` (the
|
|
23
|
+
* light palette, e.g. a paper card on a dark or toned section). Default: the section's own colours.
|
|
24
|
+
* Everything inside re-skins, as in **Band** `tone`.
|
|
25
|
+
*/
|
|
26
|
+
tone?: CardTone;
|
|
20
27
|
className?: CardLayoutClassName;
|
|
21
28
|
}
|
|
29
|
+
export declare const cardTones: readonly ["default", "inverse", "field", "light"];
|
|
30
|
+
export type CardTone = (typeof cardTones)[number];
|
|
22
31
|
export interface CardSectionProps extends HTMLAttributes<HTMLElement> {
|
|
23
32
|
children?: ReactNode;
|
|
24
33
|
className?: CardLayoutClassName;
|
|
@@ -50,7 +59,7 @@ export interface CardHeaderProps extends CardSectionProps {
|
|
|
50
59
|
/** End slot — kebab, chips-as-tabs, Badge, or any trailing cluster. Always packs to the right. */
|
|
51
60
|
end?: ReactNode;
|
|
52
61
|
}
|
|
53
|
-
declare function CardRoot({ shape, variant, padding, bodyTerminal, headerless, as: Component, className, children, ...props }: CardProps): import("react").JSX.Element;
|
|
62
|
+
declare function CardRoot({ shape, variant, padding, bodyTerminal, headerless, as: Component, tone, className, children, ...props }: CardProps): import("react").JSX.Element;
|
|
54
63
|
declare function CardHeader({ className, children, start, end, ...props }: CardHeaderProps): import("react").JSX.Element;
|
|
55
64
|
/** Inset well — composition slot, or a dark embed when `variant="terminal"`. */
|
|
56
65
|
declare function CardBody({ className, children, variant, src, srcDoc, title, height, readOnly, state, message, ...props }: CardBodyProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EACnB,mBAAmB,EAEnB,mCAAmC,EACnC,iCAAiC,EACjC,wCAAwC,EACxC,mCAAmC,EACnC,iCAAiC,EAcjC,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,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6FAA6F;IAC7F,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kGAAkG;IAClG,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AASD,iBAAS,QAAQ,CAAC,EAChB,KAAiB,EACjB,OAAmB,EACnB,OAAgB,EAChB,YAAY,EACZ,UAAU,EACV,EAAE,EAAE,SAAiB,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,+
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EACnB,mBAAmB,EAEnB,mCAAmC,EACnC,iCAAiC,EACjC,wCAAwC,EACxC,mCAAmC,EACnC,iCAAiC,EAcjC,mBAAmB,EAQnB,gBAAgB,EAEhB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,mB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