@thewhatmatters/wmds 0.4.43 → 0.4.45
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/dist/components/atoms/Button/ButtonSpinner.js +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +57 -38
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusContent.js +10 -10
- package/dist/components/atoms/Button/buttonStatusMotion.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusMotion.js +2 -2
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts +4 -0
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusStyles.js +4 -4
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +41 -40
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +75 -74
- package/dist/components/atoms/Input/Input.d.ts +2 -0
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +87 -81
- package/dist/components/atoms/Status/Status.js +1 -1
- package/dist/components/atoms/Status/statusRingStyles.d.ts +1 -1
- package/dist/components/atoms/Status/statusRingStyles.d.ts.map +1 -1
- package/dist/components/atoms/Status/statusRingStyles.js +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/atoms/Switch/Switch.js +53 -52
- package/dist/components/atoms/TextArea/TextArea.d.ts +2 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +59 -49
- package/dist/components/atoms/inputShared/InputTrailingAffordance.d.ts.map +1 -1
- package/dist/components/atoms/inputShared/InputTrailingAffordance.js +16 -14
- package/dist/components/molecules/CalEmbed/CalEmbed.d.ts.map +1 -1
- package/dist/components/molecules/CalEmbed/CalEmbed.js +17 -23
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +41 -0
- package/dist/components/molecules/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/molecules/EmptyState/EmptyState.js +46 -0
- package/dist/components/molecules/EmptyState/emptyStateStyles.d.ts +10 -0
- package/dist/components/molecules/EmptyState/emptyStateStyles.d.ts.map +1 -0
- package/dist/components/molecules/EmptyState/emptyStateStyles.js +11 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts +6 -1
- package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -1
- package/dist/components/molecules/IndexList/IndexList.js +67 -58
- package/dist/components/molecules/LinkTile/LinkTile.d.ts +4 -2
- package/dist/components/molecules/LinkTile/LinkTile.d.ts.map +1 -1
- package/dist/components/molecules/LinkTile/LinkTile.js +89 -81
- package/dist/components/molecules/LogView/LogView.d.ts.map +1 -1
- package/dist/components/molecules/LogView/LogView.js +68 -63
- package/dist/components/molecules/Progress/Progress.d.ts +38 -0
- package/dist/components/molecules/Progress/Progress.d.ts.map +1 -0
- package/dist/components/molecules/Progress/Progress.js +96 -0
- package/dist/components/molecules/Progress/progressStyles.d.ts +17 -0
- package/dist/components/molecules/Progress/progressStyles.d.ts.map +1 -0
- package/dist/components/molecules/Progress/progressStyles.js +9 -0
- package/dist/components/molecules/Stat/Stat.d.ts.map +1 -1
- package/dist/components/molecules/Stat/Stat.js +65 -61
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/TaskRowsTable.js +77 -76
- package/dist/components/molecules/TileGrid/TileGrid.d.ts +6 -1
- package/dist/components/molecules/TileGrid/TileGrid.d.ts.map +1 -1
- package/dist/components/molecules/TileGrid/TileGrid.js +52 -47
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts +10 -4
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts.map +1 -1
- package/dist/components/organisms/Chart/ChartSegmentedRing.js +7 -2
- package/dist/components/organisms/Chart/chartStyles.d.ts +4 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts.map +1 -1
- package/dist/components/organisms/Chart/chartStyles.js +4 -2
- package/dist/components/organisms/SiteNav/SiteNav.d.ts +8 -1
- package/dist/components/organisms/SiteNav/SiteNav.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/SiteNav.js +73 -69
- package/dist/components/organisms/SiteNav/siteNavStyles.d.ts +6 -0
- package/dist/components/organisms/SiteNav/siteNavStyles.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/siteNavStyles.js +6 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +158 -153
- package/dist/lib/useDelayedLoading.d.ts +13 -0
- package/dist/lib/useDelayedLoading.d.ts.map +1 -0
- package/dist/lib/useDelayedLoading.js +27 -0
- package/dist/motion.css +10 -0
- package/dist/styles.css +1 -1
- package/docs/components.md +1 -1
- package/docs/exports.json +26 -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 +2 -2
- 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-above.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-notice--account-not-connected.tsx +1 -1
- package/docs/patterns/components-notice--holiday-closure.tsx +1 -1
- package/docs/patterns/components-notice--private-buyout.tsx +1 -1
- package/docs/patterns/components-notice--sync-failed.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-progress--upload-pattern.tsx +9 -0
- 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 +9 -1
- package/package.json +1 -1
|
@@ -2,90 +2,91 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { buttonBaseClasses as t, buttonRoleClasses as n, iconButtonSizeClasses as r } from "../Button/buttonStyles.js";
|
|
4
4
|
import { ButtonIcon as i } from "../Button/ButtonIcon.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useDelayedLoading as a } from "../../../lib/useDelayedLoading.js";
|
|
6
|
+
import { ButtonSpinner as o } from "../Button/ButtonSpinner.js";
|
|
7
|
+
import { iconButtonExpandedStyle as s, iconButtonInsetHitClasses as c, iconButtonInsetIconSizeClasses as l, iconButtonPressedClasses as u, iconButtonShapeClass as d } from "./iconButtonStyles.js";
|
|
8
|
+
import { forwardRef as f } from "react";
|
|
9
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
10
|
+
import { useRender as m } from "@base-ui/react/use-render";
|
|
10
11
|
//#region src/components/atoms/IconButton/IconButton.tsx
|
|
11
|
-
function
|
|
12
|
+
function h(e) {
|
|
12
13
|
e.fab && e.role != null && e.role !== "primary" && console.warn("[WMDS IconButton] `fab` uses primary role — omit `role` or set `primary`."), e.render != null && (e.fab || e.inset) && console.warn("[WMDS IconButton] `render` is not supported with `fab` or `inset`."), e.pressed !== void 0 && (e.fab || e.inset) && console.warn("[WMDS IconButton] `pressed` (toggle) is not supported with `fab` or `inset`.");
|
|
13
14
|
}
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
fab:
|
|
17
|
-
role:
|
|
18
|
-
render:
|
|
19
|
-
inset:
|
|
20
|
-
pressed:
|
|
15
|
+
var g = f(function({ icon: f, "aria-label": g, role: _, size: v = "md", inset: y = !1, title: b, fab: x = !1, loading: S = !1, pressed: C, disabled: w, type: T = "button", render: E, className: D, onClick: O, onKeyDown: k, "aria-current": A, "aria-haspopup": j, "aria-expanded": M, "aria-controls": N, id: P, name: F, form: I, ...L }, R) {
|
|
16
|
+
h({
|
|
17
|
+
fab: x,
|
|
18
|
+
role: _,
|
|
19
|
+
render: E,
|
|
20
|
+
inset: y,
|
|
21
|
+
pressed: C
|
|
21
22
|
});
|
|
22
|
-
let
|
|
23
|
+
let z = x ? "primary" : _ ?? "ghost", B = w || S, V = a(S), H = B, U = H ? (e) => {
|
|
23
24
|
e.preventDefault(), e.stopPropagation();
|
|
24
|
-
} :
|
|
25
|
-
className: e("inline-flex shrink-0 items-center justify-center text-inherit [&>svg]:size-full",
|
|
25
|
+
} : O, W = b === void 0 ? g : b, G = y ? v : null, K = y ? c[G ?? "md"] : r[v], q = e(t, "justify-center", C === !0 ? u : n[z], K, d, y && "focus-visible:ring-offset-1 focus-visible:ring-offset-surface", x && "shadow-soft-card", D), J = V ? /* @__PURE__ */ p(o, { size: y ? "xs" : v }) : y ? /* @__PURE__ */ p("span", {
|
|
26
|
+
className: e("inline-flex shrink-0 items-center justify-center text-inherit [&>svg]:size-full", l[G ?? "md"]),
|
|
26
27
|
"aria-hidden": !0,
|
|
27
|
-
children:
|
|
28
|
-
}) : /* @__PURE__ */
|
|
29
|
-
size:
|
|
30
|
-
children:
|
|
28
|
+
children: f
|
|
29
|
+
}) : /* @__PURE__ */ p(i, {
|
|
30
|
+
size: v,
|
|
31
|
+
children: f
|
|
31
32
|
});
|
|
32
|
-
return
|
|
33
|
-
render:
|
|
34
|
-
ref:
|
|
33
|
+
return m({
|
|
34
|
+
render: E,
|
|
35
|
+
ref: R,
|
|
35
36
|
defaultTagName: "button",
|
|
36
|
-
props:
|
|
37
|
-
...
|
|
38
|
-
className:
|
|
39
|
-
"aria-label":
|
|
40
|
-
"aria-current":
|
|
41
|
-
"aria-haspopup":
|
|
42
|
-
"aria-expanded":
|
|
43
|
-
"aria-controls":
|
|
44
|
-
"aria-pressed":
|
|
45
|
-
"data-pressed":
|
|
46
|
-
"aria-busy":
|
|
47
|
-
"aria-disabled":
|
|
48
|
-
"data-disabled":
|
|
49
|
-
"data-role":
|
|
50
|
-
"data-size":
|
|
51
|
-
"data-pattern":
|
|
52
|
-
"data-loading":
|
|
53
|
-
title:
|
|
54
|
-
onClick:
|
|
55
|
-
onKeyDown:
|
|
56
|
-
id:
|
|
57
|
-
name:
|
|
58
|
-
form:
|
|
59
|
-
style:
|
|
60
|
-
children:
|
|
37
|
+
props: E ? {
|
|
38
|
+
...L,
|
|
39
|
+
className: q,
|
|
40
|
+
"aria-label": g,
|
|
41
|
+
"aria-current": A,
|
|
42
|
+
"aria-haspopup": j,
|
|
43
|
+
"aria-expanded": M,
|
|
44
|
+
"aria-controls": N,
|
|
45
|
+
"aria-pressed": C ?? L["aria-pressed"],
|
|
46
|
+
"data-pressed": C === !0 ? "" : void 0,
|
|
47
|
+
"aria-busy": S || void 0,
|
|
48
|
+
"aria-disabled": B ? !0 : void 0,
|
|
49
|
+
"data-disabled": B ? "" : void 0,
|
|
50
|
+
"data-role": z,
|
|
51
|
+
"data-size": v,
|
|
52
|
+
"data-pattern": x ? "fab" : y ? "inset" : "icon",
|
|
53
|
+
"data-loading": S || void 0,
|
|
54
|
+
title: W === "" ? void 0 : W,
|
|
55
|
+
onClick: U,
|
|
56
|
+
onKeyDown: k,
|
|
57
|
+
id: P,
|
|
58
|
+
name: F,
|
|
59
|
+
form: I,
|
|
60
|
+
style: M && z === "ghost" ? s : void 0,
|
|
61
|
+
children: J
|
|
61
62
|
} : {
|
|
62
|
-
...
|
|
63
|
-
className:
|
|
64
|
-
type:
|
|
65
|
-
"aria-disabled":
|
|
66
|
-
"data-disabled":
|
|
67
|
-
"aria-busy":
|
|
68
|
-
"aria-label":
|
|
69
|
-
"aria-current":
|
|
70
|
-
"aria-haspopup":
|
|
71
|
-
"aria-expanded":
|
|
72
|
-
"aria-controls":
|
|
73
|
-
"aria-pressed":
|
|
74
|
-
"data-pressed":
|
|
75
|
-
title:
|
|
76
|
-
onClick:
|
|
77
|
-
onKeyDown:
|
|
78
|
-
id:
|
|
79
|
-
name:
|
|
80
|
-
form:
|
|
81
|
-
style:
|
|
82
|
-
"data-role":
|
|
83
|
-
"data-size":
|
|
84
|
-
"data-pattern":
|
|
85
|
-
"data-loading":
|
|
86
|
-
children:
|
|
63
|
+
...L,
|
|
64
|
+
className: q,
|
|
65
|
+
type: T,
|
|
66
|
+
"aria-disabled": H || void 0,
|
|
67
|
+
"data-disabled": B ? "" : void 0,
|
|
68
|
+
"aria-busy": S || void 0,
|
|
69
|
+
"aria-label": g,
|
|
70
|
+
"aria-current": A,
|
|
71
|
+
"aria-haspopup": j,
|
|
72
|
+
"aria-expanded": M,
|
|
73
|
+
"aria-controls": N,
|
|
74
|
+
"aria-pressed": C ?? L["aria-pressed"],
|
|
75
|
+
"data-pressed": C === !0 ? "" : void 0,
|
|
76
|
+
title: W === "" ? void 0 : W,
|
|
77
|
+
onClick: U,
|
|
78
|
+
onKeyDown: k,
|
|
79
|
+
id: P,
|
|
80
|
+
name: F,
|
|
81
|
+
form: I,
|
|
82
|
+
style: M && z === "ghost" ? s : void 0,
|
|
83
|
+
"data-role": z,
|
|
84
|
+
"data-size": v,
|
|
85
|
+
"data-pattern": x ? "fab" : y ? "inset" : "icon",
|
|
86
|
+
"data-loading": S || void 0,
|
|
87
|
+
children: J
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
});
|
|
90
91
|
//#endregion
|
|
91
|
-
export {
|
|
92
|
+
export { g as IconButton };
|
|
@@ -23,6 +23,8 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
23
23
|
messagePosition?: InputMessagePosition;
|
|
24
24
|
/** Trailing spinner — async validation. Combinable with `endBadge`. */
|
|
25
25
|
loading?: boolean;
|
|
26
|
+
/** Read out while `loading` (Loading states Y4). Default "Checking…". */
|
|
27
|
+
loadingLabel?: string;
|
|
26
28
|
/** Leading Lucide icon. */
|
|
27
29
|
icon?: ReactElement;
|
|
28
30
|
/** Monospace value — `type-code` instead of the sans face. For a read-only key or id. */
|
|
@@ -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,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE5D,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,GAAG,OAAO,CAAC;IACrE,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;;;;;;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,
|
|
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,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE5D,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,GAAG,OAAO,CAAC;IACrE,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,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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,yGAwMhB,CAAC"}
|
|
@@ -1,135 +1,141 @@
|
|
|
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 r, inputBaseClasses as
|
|
5
|
-
import { InputStatusBanner as
|
|
6
|
-
import { InputTrailingAffordance as
|
|
7
|
-
import { isAutofillField as
|
|
8
|
-
import { fieldWidthBandStyle as
|
|
9
|
-
import { forwardRef as
|
|
10
|
-
import { Fragment as
|
|
4
|
+
import { inputAttachedFieldClasses as n, inputAttachedInputClasses as r, inputBaseClasses as ee, inputCompoundInnerFieldClassesFor as te, inputCompoundShellClassesFor as ne, inputControlStackClasses as i, inputDisabledClasses as a, inputEndBadgeAndStatusGapClasses as o, inputEndBadgeGapClasses as s, inputEndBadgeWrapperClasses as re, inputFieldStackClasses as ie, inputIconGapClasses as c, inputIconPositionClasses as ae, inputIconSizeClasses as oe, inputInlineClasses as l, inputMessagePositions as u, inputShellClasses as d, inputSizeClasses as f, inputSizes as p, inputSoloFocusRingBaseClasses as se, inputSoloFocusRingColorClasses as m, inputSoloRadiusClasses as ce, inputStatusGapClasses as h, inputStatusShellClasses as le, inputStatuses as g, inputTrailingInsetClasses as ue, inputTrailingInsetPositionClasses as de } from "./inputShellStyles.js";
|
|
5
|
+
import { InputStatusBanner as fe, warnStatusWithoutMessage as _ } from "../inputShared/InputStatusBanner.js";
|
|
6
|
+
import { InputTrailingAffordance as pe } from "../inputShared/InputTrailingAffordance.js";
|
|
7
|
+
import { isAutofillField as v } from "./autofillFields.js";
|
|
8
|
+
import { fieldWidthBandStyle as y, fieldWidthStyle as b, fieldWidths as x } from "./fieldWidth.js";
|
|
9
|
+
import { forwardRef as S, useId as me } from "react";
|
|
10
|
+
import { Fragment as he, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/atoms/Input/Input.tsx
|
|
12
|
-
function
|
|
12
|
+
function T(e) {
|
|
13
13
|
e.label == null && e["aria-label"] == null && e["aria-labelledby"] == null && console.warn("[WMDS Input] Provide `label`, `aria-label`, or `aria-labelledby`.");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
e &&
|
|
15
|
+
function E(e, t) {
|
|
16
|
+
e && v(t) && console.warn(`[WMDS Input] No \`endBadge\` on an autofill field (autocomplete="${t}"): put "(optional)" in the label.`);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function D(e) {
|
|
19
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.");
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var O = {
|
|
22
22
|
sm: .625,
|
|
23
23
|
md: .75,
|
|
24
24
|
lg: 1
|
|
25
|
-
},
|
|
25
|
+
}, k = {
|
|
26
26
|
sm: 2,
|
|
27
27
|
md: 2.5,
|
|
28
28
|
lg: 2.75
|
|
29
|
-
},
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
29
|
+
}, A = {
|
|
30
|
+
[h.sm]: 2,
|
|
31
|
+
[h.md]: 2.5,
|
|
32
|
+
[h.lg]: 2.75,
|
|
33
|
+
[s.sm]: 4.5,
|
|
34
|
+
[s.md]: 5,
|
|
35
|
+
[s.lg]: 6,
|
|
36
|
+
[o.sm]: 6.5,
|
|
37
|
+
[o.md]: 7,
|
|
38
|
+
[o.lg]: 8
|
|
39
39
|
};
|
|
40
|
-
function
|
|
41
|
-
let r =
|
|
42
|
-
return `${(t ?
|
|
40
|
+
function j(e, t, n) {
|
|
41
|
+
let r = O[e];
|
|
42
|
+
return `${(t ? k[e] : r) + (n === !1 ? r : A[n] ?? r)}rem + 2px`;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return t && n ?
|
|
44
|
+
function M(e, t, n) {
|
|
45
|
+
return t && n ? o[e] : t ? s[e] : n ? h[e] : !1;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
label:
|
|
47
|
+
var N = S(function({ size: o = "md", label: s, description: u, status: p, message: h, messagePosition: g = "bottom", loading: v = !1, loadingLabel: x = "Checking…", icon: S, endBadge: O, width: k = "full", mono: A = !1, inline: N = !1, className: P, disabled: F, id: I, "aria-describedby": L, ...R }, z) {
|
|
48
|
+
_("Input", p, h);
|
|
49
|
+
let ge = me(), B = I ?? ge;
|
|
50
|
+
T({
|
|
51
|
+
label: s,
|
|
52
52
|
"aria-label": R["aria-label"],
|
|
53
53
|
"aria-labelledby": R["aria-labelledby"]
|
|
54
|
-
}),
|
|
55
|
-
status:
|
|
56
|
-
message:
|
|
57
|
-
messagePosition:
|
|
58
|
-
loading:
|
|
59
|
-
inline:
|
|
60
|
-
label:
|
|
61
|
-
description:
|
|
54
|
+
}), D({
|
|
55
|
+
status: p,
|
|
56
|
+
message: h,
|
|
57
|
+
messagePosition: g,
|
|
58
|
+
loading: v,
|
|
59
|
+
inline: N,
|
|
60
|
+
label: s,
|
|
61
|
+
description: u
|
|
62
62
|
});
|
|
63
|
-
let V =
|
|
64
|
-
|
|
65
|
-
let U = !V && (
|
|
63
|
+
let V = h != null && h.length > 0 && p != null, H = O != null;
|
|
64
|
+
E(H, R.autoComplete);
|
|
65
|
+
let U = !V && (v || p != null), W = S != null, G = M(o, H, U), K = u == null ? void 0 : `${B}-description`, q = V ? `${B}-message` : void 0, J = H ? `${B}-badge` : void 0, _e = [
|
|
66
66
|
L,
|
|
67
67
|
K,
|
|
68
68
|
J,
|
|
69
69
|
q
|
|
70
|
-
].filter(Boolean).join(" ") || void 0,
|
|
71
|
-
W ? /* @__PURE__ */
|
|
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",
|
|
70
|
+
].filter(Boolean).join(" ") || void 0, ve = /* @__PURE__ */ w(he, { children: [
|
|
71
|
+
W ? /* @__PURE__ */ C("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", ae[o], oe[o]),
|
|
73
73
|
"aria-hidden": !0,
|
|
74
74
|
children: S
|
|
75
75
|
}) : null,
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ C("input", {
|
|
77
77
|
...R,
|
|
78
78
|
ref: z,
|
|
79
79
|
id: B,
|
|
80
80
|
disabled: F,
|
|
81
|
-
"aria-invalid":
|
|
82
|
-
"aria-
|
|
83
|
-
|
|
81
|
+
"aria-invalid": p === "error" || void 0,
|
|
82
|
+
"aria-busy": v || void 0,
|
|
83
|
+
"aria-describedby": _e,
|
|
84
|
+
className: e(a, A && "type-code !font-mono !leading-none", V ? e(n, f[o], W && c[o], G, r) : e(ee, N ? e(l, W && c[o], P ?? f[o]) : e(f[o], W && c[o], G, p != null && p !== "success" ? e("border", le[p]) : d[o], ce[o], se, p != null && p !== "success" ? m[p] : m.default, P)))
|
|
84
85
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
v ? /* @__PURE__ */ C("span", {
|
|
87
|
+
role: "status",
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: x
|
|
90
|
+
}) : null,
|
|
91
|
+
H || U ? /* @__PURE__ */ w("span", {
|
|
92
|
+
className: e(ue, de[o]),
|
|
93
|
+
children: [U ? /* @__PURE__ */ C(pe, {
|
|
94
|
+
size: o,
|
|
95
|
+
status: v ? void 0 : p,
|
|
96
|
+
loading: v
|
|
97
|
+
}) : null, H ? /* @__PURE__ */ C("span", {
|
|
92
98
|
id: J,
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
99
|
+
className: re,
|
|
100
|
+
children: O
|
|
95
101
|
}) : null]
|
|
96
102
|
}) : null
|
|
97
|
-
] }), Y = V &&
|
|
98
|
-
status:
|
|
99
|
-
message:
|
|
103
|
+
] }), Y = V && p != null && q != null ? /* @__PURE__ */ C(fe, {
|
|
104
|
+
status: p,
|
|
105
|
+
message: h,
|
|
100
106
|
messageId: q,
|
|
101
|
-
size:
|
|
102
|
-
messagePosition:
|
|
103
|
-
className: k === "full" ? void 0 :
|
|
104
|
-
}) : null, X = V &&
|
|
105
|
-
style: X && !
|
|
106
|
-
className: X ?
|
|
107
|
+
size: o,
|
|
108
|
+
messagePosition: g,
|
|
109
|
+
className: k === "full" ? void 0 : g === "bottom" ? "rounded-tr-[1.375rem]" : "rounded-br-[1.375rem]"
|
|
110
|
+
}) : null, X = V && p != null, Z = j(o, W, G), Q = N ? void 0 : b(k, Z), $ = /* @__PURE__ */ w("div", {
|
|
111
|
+
style: X && !N ? y(k, Z) : Q,
|
|
112
|
+
className: X ? ne(o, p) : e(N ? "relative flex min-w-0 flex-1 items-center" : i),
|
|
107
113
|
children: [
|
|
108
|
-
X &&
|
|
109
|
-
/* @__PURE__ */
|
|
114
|
+
X && g === "top" ? Y : null,
|
|
115
|
+
/* @__PURE__ */ C("div", {
|
|
110
116
|
style: X ? Q : void 0,
|
|
111
|
-
className: X ?
|
|
112
|
-
children:
|
|
117
|
+
className: X ? te(o, p, g) : "relative flex w-full items-center",
|
|
118
|
+
children: ve
|
|
113
119
|
}),
|
|
114
|
-
X &&
|
|
120
|
+
X && g === "bottom" ? Y : null
|
|
115
121
|
]
|
|
116
122
|
});
|
|
117
|
-
return
|
|
118
|
-
className:
|
|
123
|
+
return N || s == null && u == null ? $ : /* @__PURE__ */ w("div", {
|
|
124
|
+
className: ie,
|
|
119
125
|
children: [
|
|
120
|
-
|
|
126
|
+
s == null ? null : /* @__PURE__ */ C("label", {
|
|
121
127
|
htmlFor: B,
|
|
122
128
|
className: e(t("ui-label"), F && "opacity-50"),
|
|
123
|
-
children:
|
|
129
|
+
children: s
|
|
124
130
|
}),
|
|
125
|
-
K == null ? null : /* @__PURE__ */
|
|
131
|
+
K == null ? null : /* @__PURE__ */ C("p", {
|
|
126
132
|
id: K,
|
|
127
133
|
className: t("caption"),
|
|
128
|
-
children:
|
|
134
|
+
children: u
|
|
129
135
|
}),
|
|
130
136
|
$
|
|
131
137
|
]
|
|
132
138
|
});
|
|
133
139
|
});
|
|
134
140
|
//#endregion
|
|
135
|
-
export {
|
|
141
|
+
export { N as Input, x as fieldWidths, u as inputMessagePositions, p as inputSizes, g as inputStatuses };
|
|
@@ -31,7 +31,7 @@ function h({ active: t = !1, step: n, label: r, besideLabel: s = !1, className:
|
|
|
31
31
|
children: [/* @__PURE__ */ f("svg", {
|
|
32
32
|
width: 24,
|
|
33
33
|
height: 24,
|
|
34
|
-
className: e(l, t && "animate-spin"),
|
|
34
|
+
className: e(l, t && "animate-spin motion-reduce:animate-none"),
|
|
35
35
|
"aria-hidden": !0,
|
|
36
36
|
children: [/* @__PURE__ */ d("circle", {
|
|
37
37
|
cx: 12,
|
|
@@ -5,7 +5,7 @@ export declare const statusRingStrokePx = 2;
|
|
|
5
5
|
export declare const statusRingArcVisibleRatio = 0.28;
|
|
6
6
|
export declare const statusRingShellClasses = "relative inline-flex shrink-0 items-center justify-center";
|
|
7
7
|
export declare const statusRingSvgClasses = "absolute inset-0";
|
|
8
|
-
export declare const statusRingSvgActiveClasses = "animate-spin";
|
|
8
|
+
export declare const statusRingSvgActiveClasses = "animate-spin motion-reduce:animate-none";
|
|
9
9
|
export declare const statusRingTrackClasses = "stroke-border";
|
|
10
10
|
export declare const statusRingArcClasses = "stroke-muted";
|
|
11
11
|
export declare const statusRingStepClasses: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusRingStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Status/statusRingStyles.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,sBAAsB,8DAC0B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"statusRingStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Status/statusRingStyles.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,sBAAsB,8DAC0B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,4CAA4C,CAAC;AAEpF,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,qBAAqB,QAAgG,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { typographyClass as e } from "../../../lib/typography.js";
|
|
3
3
|
//#region src/components/atoms/Status/statusRingStyles.ts
|
|
4
|
-
var t = 24, n = .28, r = "relative inline-flex shrink-0 items-center justify-center", i = "absolute inset-0", a = "animate-spin", o = "stroke-border", s = "stroke-muted", c = `${e("caption")} relative font-semibold tabular-nums text-fg text-[0.65625rem]`;
|
|
4
|
+
var t = 24, n = .28, r = "relative inline-flex shrink-0 items-center justify-center", i = "absolute inset-0", a = "animate-spin motion-reduce:animate-none", o = "stroke-border", s = "stroke-muted", c = `${e("caption")} relative font-semibold tabular-nums text-fg text-[0.65625rem]`;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { s as statusRingArcClasses, n as statusRingArcVisibleRatio, r as statusRingShellClasses, t as statusRingSizePx, c as statusRingStepClasses, a as statusRingSvgActiveClasses, i as statusRingSvgClasses, o as statusRingTrackClasses };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAMf,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAaD;;;GAGG;AACH,eAAO,MAAM,MAAM,0GAkLjB,CAAC"}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
|
+
import { useDelayedLoading as n } from "../../../lib/useDelayedLoading.js";
|
|
4
5
|
import "../Input/inputShellStyles.js";
|
|
5
|
-
import { InputStatusBanner as
|
|
6
|
-
import { switchDescriptionClasses as
|
|
7
|
-
import { forwardRef as
|
|
8
|
-
import { Loader2 as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { motion as
|
|
6
|
+
import { InputStatusBanner as r, warnStatusWithoutMessage as ee } from "../inputShared/InputStatusBanner.js";
|
|
7
|
+
import { switchDescriptionClasses as i, switchDescriptionRowClasses as a, switchHiddenInputClasses as o, switchHitTargetDescriptionAlignClasses as te, switchHitTargetSizeClasses as ne, switchLabelClassesFor as s, switchLayouts as c, switchRowBaseClasses as l, switchRowLabelOnlyClasses as u, switchRowSizeClasses as d, switchSettingsRowClasses as f, switchSizes as p, switchStatusBannerClassesFor as m, switchTextColumnClasses as h, switchThumbClasses as re, switchThumbOffsetPx as ie, switchThumbSizeClasses as g, switchTrackClassesFor as ae } from "./switchStyles.js";
|
|
8
|
+
import { forwardRef as _, useId as v, useState as oe } from "react";
|
|
9
|
+
import { Loader2 as se } from "lucide-react";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import { motion as S } from "motion/react";
|
|
11
12
|
//#region src/components/atoms/Switch/Switch.tsx
|
|
12
|
-
var
|
|
13
|
+
var ce = {
|
|
13
14
|
sm: "sm",
|
|
14
15
|
md: "md"
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
+
function le(e) {
|
|
17
18
|
e.message != null && e.status == null && console.warn("[WMDS Switch] `message` requires `status`.");
|
|
18
19
|
}
|
|
19
|
-
var C =
|
|
20
|
-
|
|
21
|
-
let L =
|
|
22
|
-
|
|
20
|
+
var C = _(function({ size: c = "md", layout: p = "inline", label: _, labelHidden: C = !1, description: w, status: T, message: E, loading: D = !1, className: O, disabled: k, readOnly: A, checked: j, defaultChecked: M, id: N, onChange: P, ...F }, I) {
|
|
21
|
+
ee("Switch", T, E);
|
|
22
|
+
let L = v(), R = N ?? L;
|
|
23
|
+
le({
|
|
23
24
|
status: T,
|
|
24
25
|
message: E
|
|
25
26
|
});
|
|
26
|
-
let z = j !== void 0, [B, V] =
|
|
27
|
+
let z = j !== void 0, [B, V] = oe(M ?? !1), H = z ? !!j : B, U = k || D, W = D && !k, ue = n(D), G = E != null && E.length > 0 && T != null, K = G ? `${R}-message` : void 0, q = w != null && !C ? `${R}-description` : void 0, de = [
|
|
27
28
|
F["aria-describedby"],
|
|
28
29
|
q,
|
|
29
30
|
K
|
|
30
|
-
].filter(Boolean).join(" ") || void 0,
|
|
31
|
+
].filter(Boolean).join(" ") || void 0, fe = (e) => {
|
|
31
32
|
if (A || W) {
|
|
32
33
|
e.preventDefault();
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
z || V(e.target.checked), P?.(e);
|
|
36
|
-
},
|
|
37
|
-
className: e("relative flex shrink-0 items-center justify-center",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
37
|
+
}, pe = ae(c, H, U, G ? void 0 : T), J = w != null && !C, Y = t("fast"), X = ie[c], Z = (t) => /* @__PURE__ */ x("span", {
|
|
38
|
+
className: e("relative flex shrink-0 items-center justify-center", ne[c], t),
|
|
39
|
+
children: [/* @__PURE__ */ b("input", {
|
|
39
40
|
...F,
|
|
40
41
|
ref: I,
|
|
41
42
|
id: R,
|
|
@@ -47,65 +48,65 @@ var C = m(function({ size: o = "md", layout: c = "inline", label: m, labelHidden
|
|
|
47
48
|
"aria-disabled": W || void 0,
|
|
48
49
|
readOnly: A,
|
|
49
50
|
"aria-invalid": T === "error" || void 0,
|
|
50
|
-
"aria-describedby":
|
|
51
|
+
"aria-describedby": de,
|
|
51
52
|
"aria-busy": D || void 0,
|
|
52
|
-
onChange:
|
|
53
|
-
className:
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
-
className:
|
|
53
|
+
onChange: fe,
|
|
54
|
+
className: o
|
|
55
|
+
}), /* @__PURE__ */ b("span", {
|
|
56
|
+
className: pe,
|
|
56
57
|
"aria-hidden": !0,
|
|
57
|
-
children:
|
|
58
|
-
className: e(
|
|
58
|
+
children: ue ? /* @__PURE__ */ b(S.span, {
|
|
59
|
+
className: e(g[c], "flex items-center justify-center"),
|
|
59
60
|
animate: { x: H ? X : 0 },
|
|
60
61
|
transition: Y,
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
-
className: "size-full animate-spin text-fg",
|
|
62
|
+
children: /* @__PURE__ */ b(se, {
|
|
63
|
+
className: "size-full animate-spin motion-reduce:animate-none text-fg",
|
|
63
64
|
strokeWidth: 2
|
|
64
65
|
})
|
|
65
|
-
}) : /* @__PURE__ */
|
|
66
|
-
className: e(
|
|
66
|
+
}) : /* @__PURE__ */ b(S.span, {
|
|
67
|
+
className: e(re, g[c]),
|
|
67
68
|
animate: { x: H ? X : 0 },
|
|
68
69
|
transition: Y
|
|
69
70
|
})
|
|
70
71
|
})]
|
|
71
|
-
}), Q = C ? /* @__PURE__ */
|
|
72
|
+
}), Q = C ? /* @__PURE__ */ b("span", {
|
|
72
73
|
className: "sr-only",
|
|
73
|
-
children:
|
|
74
|
-
}) : /* @__PURE__ */
|
|
75
|
-
className:
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
-
className:
|
|
78
|
-
children:
|
|
79
|
-
}), J ? /* @__PURE__ */
|
|
74
|
+
children: _
|
|
75
|
+
}) : /* @__PURE__ */ x("span", {
|
|
76
|
+
className: h,
|
|
77
|
+
children: [/* @__PURE__ */ b("span", {
|
|
78
|
+
className: s(U, J),
|
|
79
|
+
children: _
|
|
80
|
+
}), J ? /* @__PURE__ */ b("span", {
|
|
80
81
|
id: q,
|
|
81
|
-
className:
|
|
82
|
+
className: i,
|
|
82
83
|
children: w
|
|
83
84
|
}) : null]
|
|
84
|
-
}), $ = /* @__PURE__ */
|
|
85
|
+
}), $ = /* @__PURE__ */ b("label", {
|
|
85
86
|
htmlFor: R,
|
|
86
|
-
className: e(
|
|
87
|
-
children: C ? /* @__PURE__ */ y
|
|
87
|
+
className: e(l, p === "settings" ? f : u, p === "inline" && !J && d[c], p === "inline" && J && void 0, U && "cursor-not-allowed", O),
|
|
88
|
+
children: C ? /* @__PURE__ */ x(y, { children: [Z(), /* @__PURE__ */ b("span", {
|
|
88
89
|
className: "sr-only",
|
|
89
|
-
children:
|
|
90
|
-
})] }) :
|
|
91
|
-
className:
|
|
92
|
-
children: [Z(
|
|
93
|
-
}) : /* @__PURE__ */ y
|
|
94
|
-
className:
|
|
95
|
-
children:
|
|
90
|
+
children: _
|
|
91
|
+
})] }) : p === "settings" ? /* @__PURE__ */ x(y, { children: [Q, Z()] }) : J ? /* @__PURE__ */ x("span", {
|
|
92
|
+
className: a[c],
|
|
93
|
+
children: [Z(te[c]), Q]
|
|
94
|
+
}) : /* @__PURE__ */ x(y, { children: [Z(), C ? null : /* @__PURE__ */ b("span", {
|
|
95
|
+
className: s(U),
|
|
96
|
+
children: _
|
|
96
97
|
})] })
|
|
97
98
|
});
|
|
98
|
-
return !G || T == null || K == null ? $ : /* @__PURE__ */
|
|
99
|
+
return !G || T == null || K == null ? $ : /* @__PURE__ */ x("div", {
|
|
99
100
|
className: "flex w-full flex-col gap-1.5",
|
|
100
|
-
children: [$, /* @__PURE__ */
|
|
101
|
+
children: [$, /* @__PURE__ */ b(r, {
|
|
101
102
|
status: T,
|
|
102
103
|
message: E,
|
|
103
104
|
messageId: K,
|
|
104
|
-
size:
|
|
105
|
+
size: ce[c],
|
|
105
106
|
messagePosition: "bottom",
|
|
106
|
-
bannerClassName:
|
|
107
|
+
bannerClassName: m(T)
|
|
107
108
|
})]
|
|
108
109
|
});
|
|
109
110
|
});
|
|
110
111
|
//#endregion
|
|
111
|
-
export { C as Switch,
|
|
112
|
+
export { C as Switch, c as switchLayouts, p as switchSizes };
|