@thewhatmatters/wmds 0.4.0 → 0.4.1
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 +68 -0
- package/CONSUMING.md +8 -4
- package/dist/collapse.css +9 -1
- package/dist/colors.css +7 -0
- package/dist/components/atoms/Badge/Badge.d.ts +16 -4
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +54 -42
- package/dist/components/atoms/Badge/badgeStyles.d.ts +12 -2
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +24 -13
- package/dist/components/atoms/Button/Button.d.ts +11 -3
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +118 -98
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts +3 -1
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +19 -18
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts +7 -1
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusContent.js +9 -6
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts +5 -0
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusStyles.js +10 -10
- package/dist/components/atoms/Button/buttonStyles.d.ts +2 -0
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +12 -12
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +86 -69
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +6 -0
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +11 -11
- package/dist/components/atoms/IconButton/IconButton.d.ts +5 -0
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +73 -68
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +5 -0
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/iconButtonStyles.js +4 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts +13 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts.map +1 -1
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.js +32 -13
- package/dist/components/atoms/Prose/Prose.d.ts +23 -0
- package/dist/components/atoms/Prose/Prose.d.ts.map +1 -0
- package/dist/components/atoms/Prose/Prose.js +15 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts +17 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts.map +1 -0
- package/dist/components/atoms/Prose/proseStyles.js +16 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts +26 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.js +25 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts +11 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.js +12 -0
- package/dist/components/atoms/TextLink/TextLink.d.ts +10 -2
- package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/TextLink.js +15 -15
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts +13 -0
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/textLinkStyles.js +7 -3
- package/dist/components/molecules/Accordion/Accordion.d.ts +6 -1
- package/dist/components/molecules/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/Accordion.js +57 -50
- package/dist/components/molecules/Accordion/accordionStyles.d.ts +9 -0
- package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.js +2 -2
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts +5 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts.map +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.js +12 -10
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts +37 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.js +50 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts +21 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.js +27 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts +58 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/IndexList.js +96 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts +29 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/indexListStyles.js +24 -0
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts +3 -2
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/promptBarStyles.js +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +120 -10
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +654 -212
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +52 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.js +161 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +16 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +8 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +60 -10
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/chatDockStyles.js +15 -9
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +21 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.js +46 -0
- package/dist/components/organisms/Toast/Toast.js +5 -5
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -112
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/typography.d.ts +2 -2
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/lib/typography.js +27 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -0
- package/dist/typography.css +34 -0
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +15 -0
- package/docs/components.md +15 -11
- package/docs/exports.json +69 -4
- package/docs/patterns/components-accordion--flush.tsx +29 -0
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +25 -0
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +39 -0
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +30 -0
- 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-selectablecard--selectable-cards-pattern.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--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +101 -11
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +180 -0
- 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 +19 -0
- 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 +17 -0
- package/docs/patterns/components-descriptionlist--details.tsx +21 -0
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +52 -0
- package/docs/patterns/components-dialog--alert-dialog-destructive.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-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-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-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 +36 -0
- 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-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-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +11 -0
- 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 +16 -0
- package/docs/patterns/components-sectioncaption--with-action.tsx +19 -0
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-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--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-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--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.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 +15 -0
- 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-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-index.tsx +174 -0
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +143 -0
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +129 -1
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { ButtonBadge as t } from "./ButtonBadge.js";
|
|
4
|
-
import { buttonAlignClasses as n, buttonAligns as r, buttonBaseClasses as i, buttonEmphases as a, buttonEndIconSquareClasses as o,
|
|
5
|
-
import { ButtonIcon as
|
|
6
|
-
import { defaultStatusLabels as
|
|
7
|
-
import { ButtonStatusButton as
|
|
8
|
-
import { forwardRef as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { buttonAlignClasses as n, buttonAligns as r, buttonBaseClasses as i, buttonEmphases as a, buttonEndIconSquareClasses as o, buttonExternalIconClasses as s, buttonLayouts as c, buttonMonoLabelClasses as l, buttonNavLayoutClasses as u, buttonNavStateClasses as d, buttonOutlineQuietClasses as f, buttonPillClass as p, buttonRoleClasses as m, buttonRoles as h, buttonRowBaseClasses as g, buttonRowLayoutClasses as _, buttonRowWidthClasses as v, buttonSizeClasses as y, buttonWidths as b } from "./buttonStyles.js";
|
|
5
|
+
import { ButtonIcon as x } from "./ButtonIcon.js";
|
|
6
|
+
import { buttonStatusHoldMs as S, defaultStatusLabels as C, getNextButtonStatus as w } from "./buttonStatusStyles.js";
|
|
7
|
+
import { ButtonStatusButton as T } from "./ButtonStatusButton.js";
|
|
8
|
+
import { forwardRef as E } from "react";
|
|
9
|
+
import { SquareArrowOutUpRight as D } from "lucide-react";
|
|
10
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
11
|
+
import { useRender as A } from "@base-ui/react/use-render";
|
|
11
12
|
//#region src/components/atoms/Button/Button.tsx
|
|
12
|
-
function
|
|
13
|
-
e.width != null && e.layout !== "row" && console.warn("[WMDS Button] `width` applies to `layout=\"row\"` only."), e.align != null && (e.layout === "row" || e.layout === "nav") && console.warn("[WMDS Button] `align` applies to pill buttons only."), e.emphasis != null && e.role !== "outline" && console.warn("[WMDS Button] `emphasis` applies to `role=\"outline\"` only."), (e.layout === "row" || e.layout === "nav") && (e.status != null || e.icon != null || e.count != null || e.endIcon != null || e.mono) && console.warn(`[WMDS Button] \`layout="${e.layout}"\` is mutually exclusive with \`status\`, \`icon\`, \`count\`, \`endIcon\`, and \`mono\`.`), e.status != null && (e.
|
|
13
|
+
function j(e) {
|
|
14
|
+
e.external && (e.render == null || e.layout !== "pill") && console.warn("[WMDS Button] `external` needs `render={<a href />}` on a pill button."), e.external && e.endIcon != null && console.warn("[WMDS Button] `external` is mutually exclusive with `endIcon`."), e.width != null && e.layout !== "row" && console.warn("[WMDS Button] `width` applies to `layout=\"row\"` only."), e.align != null && (e.layout === "row" || e.layout === "nav") && console.warn("[WMDS Button] `align` applies to pill buttons only."), e.emphasis != null && e.role !== "outline" && console.warn("[WMDS Button] `emphasis` applies to `role=\"outline\"` only."), (e.layout === "row" || e.layout === "nav") && (e.status != null || e.icon != null || e.count != null || e.endIcon != null || e.mono) && console.warn(`[WMDS Button] \`layout="${e.layout}"\` is mutually exclusive with \`status\`, \`icon\`, \`count\`, \`endIcon\`, and \`mono\`.`), e.status != null && (e.count != null || e.endIcon != null || e.mono) && console.warn("[WMDS Button] `status` is mutually exclusive with `count`, `endIcon`, and `mono`."), e.endIcon != null && e.count != null && console.warn("[WMDS Button] `endIcon` is mutually exclusive with `count`."), e.render != null && (e.layout !== "pill" || e.status != null) && console.warn("[WMDS Button] `render` is supported on `layout=\"pill\"` without `status` only.");
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
return
|
|
16
|
+
var M = E(function({ render: e, type: t, disabled: n, ...r }, i) {
|
|
17
|
+
return A({
|
|
17
18
|
render: e,
|
|
18
19
|
ref: i,
|
|
19
20
|
defaultTagName: "button",
|
|
@@ -28,111 +29,130 @@ var k = w(function({ render: e, type: t, disabled: n, ...r }, i) {
|
|
|
28
29
|
disabled: n
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
|
-
}),
|
|
32
|
-
|
|
32
|
+
}), N = E(function({ children: r, role: a = "primary", layout: c = "pill", width: h, align: b, emphasis: S, size: C = "md", disabled: w, type: E = "button", status: A, statusLabels: N, disableOnError: P, icon: F, count: I, mono: L = !1, endIcon: R, selected: z = !1, render: B, external: V = !1, externalIcon: H = !0, className: U, onClick: W, "aria-label": G, "aria-pressed": K, "aria-keyshortcuts": q, id: J, name: Y, form: X, ...Z }, Q) {
|
|
33
|
+
if (j({
|
|
33
34
|
status: A,
|
|
34
|
-
icon:
|
|
35
|
-
count:
|
|
36
|
-
layout:
|
|
37
|
-
render:
|
|
38
|
-
endIcon:
|
|
39
|
-
mono:
|
|
40
|
-
width:
|
|
41
|
-
align:
|
|
42
|
-
emphasis:
|
|
43
|
-
role: a
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
icon: F,
|
|
36
|
+
count: I,
|
|
37
|
+
layout: c,
|
|
38
|
+
render: B,
|
|
39
|
+
endIcon: R,
|
|
40
|
+
mono: L,
|
|
41
|
+
width: h,
|
|
42
|
+
align: b,
|
|
43
|
+
emphasis: S,
|
|
44
|
+
role: a,
|
|
45
|
+
external: V
|
|
46
|
+
}), A != null) return /* @__PURE__ */ O(T, {
|
|
47
|
+
...Z,
|
|
48
|
+
ref: Q,
|
|
49
|
+
status: A,
|
|
50
|
+
role: a,
|
|
51
|
+
size: C,
|
|
52
|
+
statusLabels: N,
|
|
53
|
+
icon: F,
|
|
54
|
+
disableOnError: P,
|
|
48
55
|
disabled: w,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"aria-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
className: U,
|
|
57
|
+
type: E,
|
|
58
|
+
onClick: W,
|
|
59
|
+
"aria-label": G,
|
|
60
|
+
"aria-pressed": K,
|
|
61
|
+
"aria-keyshortcuts": q,
|
|
62
|
+
id: J,
|
|
63
|
+
name: Y,
|
|
64
|
+
form: X,
|
|
65
|
+
children: r
|
|
66
|
+
});
|
|
67
|
+
if (c === "row") return /* @__PURE__ */ O("button", {
|
|
68
|
+
...Z,
|
|
69
|
+
ref: Q,
|
|
70
|
+
type: E,
|
|
71
|
+
disabled: w,
|
|
72
|
+
onClick: W,
|
|
73
|
+
"aria-label": G,
|
|
74
|
+
"aria-pressed": K,
|
|
75
|
+
"aria-keyshortcuts": q,
|
|
76
|
+
id: J,
|
|
77
|
+
name: Y,
|
|
78
|
+
form: X,
|
|
79
|
+
className: e(g, m[a], _, v[h ?? "fill"], U),
|
|
57
80
|
"data-role": a,
|
|
58
81
|
"data-layout": "row",
|
|
59
|
-
"data-width":
|
|
82
|
+
"data-width": h ?? "fill",
|
|
60
83
|
children: r
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
84
|
+
});
|
|
85
|
+
if (c === "nav") return /* @__PURE__ */ O("button", {
|
|
86
|
+
...Z,
|
|
87
|
+
ref: Q,
|
|
88
|
+
type: E,
|
|
65
89
|
disabled: w,
|
|
66
|
-
onClick:
|
|
67
|
-
"aria-label":
|
|
68
|
-
"aria-pressed":
|
|
69
|
-
"aria-keyshortcuts":
|
|
70
|
-
"aria-current":
|
|
71
|
-
id:
|
|
72
|
-
name:
|
|
73
|
-
form:
|
|
74
|
-
className: e(
|
|
90
|
+
onClick: W,
|
|
91
|
+
"aria-label": G,
|
|
92
|
+
"aria-pressed": K,
|
|
93
|
+
"aria-keyshortcuts": q,
|
|
94
|
+
"aria-current": z ? "page" : void 0,
|
|
95
|
+
id: J,
|
|
96
|
+
name: Y,
|
|
97
|
+
form: X,
|
|
98
|
+
className: e(g, u, d(z), U),
|
|
75
99
|
"data-layout": "nav",
|
|
76
|
-
"data-selected":
|
|
100
|
+
"data-selected": z ? "" : void 0,
|
|
77
101
|
children: r
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
102
|
+
});
|
|
103
|
+
let $ = V && B != null;
|
|
104
|
+
return /* @__PURE__ */ k(M, {
|
|
105
|
+
...Z,
|
|
106
|
+
...$ ? {
|
|
107
|
+
target: "_blank",
|
|
108
|
+
rel: "noopener noreferrer"
|
|
109
|
+
} : null,
|
|
110
|
+
ref: Q,
|
|
111
|
+
render: B,
|
|
112
|
+
type: E,
|
|
83
113
|
disabled: w,
|
|
84
|
-
onClick:
|
|
85
|
-
"aria-label":
|
|
86
|
-
"aria-pressed":
|
|
87
|
-
"aria-keyshortcuts":
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
90
|
-
form:
|
|
91
|
-
className: e(i, n[
|
|
114
|
+
onClick: W,
|
|
115
|
+
"aria-label": G,
|
|
116
|
+
"aria-pressed": K,
|
|
117
|
+
"aria-keyshortcuts": q,
|
|
118
|
+
id: J,
|
|
119
|
+
name: Y,
|
|
120
|
+
form: X,
|
|
121
|
+
className: e(i, n[b ?? "center"], a === "outline" && S === "quiet" ? f : m[a], y[C], p, "gap-2", U),
|
|
92
122
|
"data-role": a,
|
|
93
|
-
"data-size":
|
|
94
|
-
"data-align":
|
|
95
|
-
"data-emphasis": a === "outline" ?
|
|
96
|
-
"data-mono":
|
|
97
|
-
"data-end-icon":
|
|
123
|
+
"data-size": C,
|
|
124
|
+
"data-align": b,
|
|
125
|
+
"data-emphasis": a === "outline" ? S ?? "strong" : void 0,
|
|
126
|
+
"data-mono": L ? "" : void 0,
|
|
127
|
+
"data-end-icon": R ? "" : void 0,
|
|
128
|
+
"data-external": $ ? "" : void 0,
|
|
98
129
|
children: [
|
|
99
|
-
|
|
100
|
-
size:
|
|
101
|
-
children:
|
|
130
|
+
F ? /* @__PURE__ */ O(x, {
|
|
131
|
+
size: C,
|
|
132
|
+
children: F
|
|
102
133
|
}) : null,
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
className:
|
|
105
|
-
children: r
|
|
134
|
+
/* @__PURE__ */ k("span", {
|
|
135
|
+
className: L ? l : void 0,
|
|
136
|
+
children: [r, $ ? /* @__PURE__ */ O("span", {
|
|
137
|
+
className: "sr-only",
|
|
138
|
+
children: " (opens in a new tab)"
|
|
139
|
+
}) : null]
|
|
106
140
|
}),
|
|
107
|
-
|
|
141
|
+
$ && H ? /* @__PURE__ */ O(D, {
|
|
142
|
+
className: s,
|
|
143
|
+
strokeWidth: 2,
|
|
144
|
+
"aria-hidden": !0
|
|
145
|
+
}) : null,
|
|
146
|
+
R ? /* @__PURE__ */ O("span", {
|
|
108
147
|
className: o,
|
|
109
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ O(x, {
|
|
110
149
|
size: "xs",
|
|
111
|
-
children:
|
|
150
|
+
children: R
|
|
112
151
|
})
|
|
113
152
|
}) : null,
|
|
114
|
-
|
|
153
|
+
I == null ? null : /* @__PURE__ */ O(t, { value: I })
|
|
115
154
|
]
|
|
116
|
-
}) : /* @__PURE__ */ T(C, {
|
|
117
|
-
...q,
|
|
118
|
-
ref: J,
|
|
119
|
-
status: A,
|
|
120
|
-
role: a,
|
|
121
|
-
size: S,
|
|
122
|
-
statusLabels: j,
|
|
123
|
-
disableOnError: M,
|
|
124
|
-
disabled: w,
|
|
125
|
-
className: z,
|
|
126
|
-
type: D,
|
|
127
|
-
onClick: B,
|
|
128
|
-
"aria-label": V,
|
|
129
|
-
"aria-pressed": H,
|
|
130
|
-
"aria-keyshortcuts": U,
|
|
131
|
-
id: W,
|
|
132
|
-
name: G,
|
|
133
|
-
form: K,
|
|
134
|
-
children: r
|
|
135
155
|
});
|
|
136
156
|
});
|
|
137
157
|
//#endregion
|
|
138
|
-
export {
|
|
158
|
+
export { N as Button, r as buttonAligns, a as buttonEmphases, c as buttonLayouts, h as buttonRoles, S as buttonStatusHoldMs, b as buttonWidths, C as defaultStatusLabels, w as getNextButtonStatus };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type ButtonStatus } from "./buttonStatusStyles";
|
|
3
3
|
import { type ButtonRole, type ButtonSize } from "./buttonStyles";
|
|
4
4
|
export interface ButtonStatusButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "role" | "size"> {
|
|
@@ -6,6 +6,8 @@ export interface ButtonStatusButtonProps extends Omit<ButtonHTMLAttributes<HTMLB
|
|
|
6
6
|
role?: ButtonRole;
|
|
7
7
|
size?: ButtonSize;
|
|
8
8
|
statusLabels?: Partial<Record<ButtonStatus, string>>;
|
|
9
|
+
/** Leading icon while idle; the status glyphs morph out of it. */
|
|
10
|
+
icon?: ReactElement;
|
|
9
11
|
disableOnError?: boolean;
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonStatusButton.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/ButtonStatusButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,uBACf,SAAQ,IAAI,CACV,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAC3C;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ButtonStatusButton.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/ButtonStatusButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,uBACf,SAAQ,IAAI,CACV,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAC3C;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,kEAAkE;IAClE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,uHAkE7B,CAAC"}
|
|
@@ -8,35 +8,36 @@ import { forwardRef as d } from "react";
|
|
|
8
8
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
9
|
import { motion as m } from "motion/react";
|
|
10
10
|
//#region src/components/atoms/Button/ButtonStatusButton.tsx
|
|
11
|
-
var h = d(function({ status: d, role: h = "primary", size: g = "md", statusLabels: _,
|
|
12
|
-
let
|
|
11
|
+
var h = d(function({ status: d, role: h = "primary", size: g = "md", statusLabels: _, icon: v, disableOnError: y = !1, disabled: b, className: x, children: S, type: C = "button", onClick: w, "aria-label": T, "aria-pressed": E, "aria-keyshortcuts": D, id: O, name: k, form: A, ...j }, M) {
|
|
12
|
+
let N = u(S, _)[d], P = b || d === "loading" || d === "error" && y, F = r(d, h);
|
|
13
13
|
return /* @__PURE__ */ p(m.button, {
|
|
14
|
-
...
|
|
15
|
-
ref:
|
|
16
|
-
type:
|
|
14
|
+
...j,
|
|
15
|
+
ref: M,
|
|
16
|
+
type: C,
|
|
17
17
|
layout: !0,
|
|
18
|
-
disabled:
|
|
18
|
+
disabled: P,
|
|
19
19
|
"aria-busy": d === "loading" || void 0,
|
|
20
20
|
"aria-live": "polite",
|
|
21
|
-
"aria-label":
|
|
22
|
-
"aria-pressed":
|
|
23
|
-
"aria-keyshortcuts":
|
|
21
|
+
"aria-label": T,
|
|
22
|
+
"aria-pressed": E,
|
|
23
|
+
"aria-keyshortcuts": D,
|
|
24
24
|
"data-role": h,
|
|
25
25
|
"data-size": g,
|
|
26
26
|
"data-status": d,
|
|
27
|
-
animate:
|
|
27
|
+
animate: F,
|
|
28
28
|
initial: !1,
|
|
29
|
-
className: e(t, "justify-center", l[g], d !== "idle" && c[g], n, i(d, h), "overflow-hidden",
|
|
30
|
-
whileTap:
|
|
29
|
+
className: e(t, "justify-center", l[g], (d !== "idle" || v != null) && c[g], n, i(d, h), "overflow-hidden", x),
|
|
30
|
+
whileTap: P ? void 0 : { scale: .98 },
|
|
31
31
|
transition: a,
|
|
32
|
-
onClick:
|
|
33
|
-
id:
|
|
34
|
-
name:
|
|
35
|
-
form:
|
|
32
|
+
onClick: w,
|
|
33
|
+
id: O,
|
|
34
|
+
name: k,
|
|
35
|
+
form: A,
|
|
36
36
|
children: [/* @__PURE__ */ f(o, {
|
|
37
37
|
status: d,
|
|
38
|
-
size: g
|
|
39
|
-
|
|
38
|
+
size: g,
|
|
39
|
+
icon: v
|
|
40
|
+
}), /* @__PURE__ */ f(s, { label: N })]
|
|
40
41
|
});
|
|
41
42
|
});
|
|
42
43
|
//#endregion
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
1
2
|
import { type ButtonSize } from "./buttonStyles";
|
|
2
3
|
import type { ButtonStatus } from "./buttonStatusStyles";
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The status glyph. With `icon`, idle shows that icon and each status morphs out of it — a copy
|
|
6
|
+
* button's Copy glyph turns into the check.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ButtonStatusIcon({ status, size, icon, }: {
|
|
4
9
|
status: ButtonStatus;
|
|
5
10
|
size: ButtonSize;
|
|
11
|
+
icon?: ReactElement;
|
|
6
12
|
}): import("react").JSX.Element | null;
|
|
7
13
|
export declare function ButtonStatusLabel({ label }: {
|
|
8
14
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonStatusContent.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/ButtonStatusContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonStatusContent.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/ButtonStatusContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAwCzD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,IAAI,EACJ,IAAI,GACL,EAAE;IACD,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB,sCAiCA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,+BAkB7D"}
|
|
@@ -26,8 +26,8 @@ function p({ status: n, size: r }) {
|
|
|
26
26
|
"aria-hidden": !0
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
function m({ status:
|
|
30
|
-
return
|
|
29
|
+
function m({ status: r, size: i, icon: a }) {
|
|
30
|
+
return r === "idle" && a == null ? null : /* @__PURE__ */ s(c, {
|
|
31
31
|
mode: "popLayout",
|
|
32
32
|
initial: !1,
|
|
33
33
|
children: /* @__PURE__ */ s(l.span, {
|
|
@@ -51,11 +51,14 @@ function m({ status: e, size: t }) {
|
|
|
51
51
|
},
|
|
52
52
|
transition: n,
|
|
53
53
|
"aria-hidden": !0,
|
|
54
|
-
children: /* @__PURE__ */ s(
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
children: r === "idle" ? /* @__PURE__ */ s("span", {
|
|
55
|
+
className: e("inline-flex shrink-0 [&>svg]:size-full [&>svg]:shrink-0 [&>svg]:stroke-current", t[i]),
|
|
56
|
+
children: a
|
|
57
|
+
}) : /* @__PURE__ */ s(p, {
|
|
58
|
+
status: r,
|
|
59
|
+
size: i
|
|
57
60
|
})
|
|
58
|
-
},
|
|
61
|
+
}, r)
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
function h({ label: e }) {
|
|
@@ -2,6 +2,11 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
/** Multi-state pill cycle — inspired by [Motion multi-state badge](https://motion.dev/examples/react-multi-state-badge). */
|
|
3
3
|
export type ButtonStatus = "idle" | "loading" | "success" | "error";
|
|
4
4
|
export declare const buttonStatusCycle: ButtonStatus[];
|
|
5
|
+
/**
|
|
6
|
+
* How long a confirmation (`success`, or `error` after a quick action such as a copy) holds before
|
|
7
|
+
* the button returns to `idle`, in milliseconds.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buttonStatusHoldMs = 2000;
|
|
5
10
|
export declare const defaultStatusLabels: Record<ButtonStatus, string>;
|
|
6
11
|
export declare function getNextButtonStatus(current: ButtonStatus): ButtonStatus;
|
|
7
12
|
export declare function resolveStatusLabels(children: ReactNode, overrides?: Partial<Record<ButtonStatus, string>>): Record<ButtonStatus, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonStatusStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/buttonStatusStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,4HAA4H;AAC5H,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAA4C,CAAC;AAEzF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK5D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAGvE;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,EACnB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GAChD,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAW9B;AAED,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB;;;;;CAKW,CAAC;AAEhD,eAAO,MAAM,0BAA0B;;;;;CAKQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"buttonStatusStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/buttonStatusStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,4HAA4H;AAC5H,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAA4C,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK5D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAGvE;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,EACnB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GAChD,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAW9B;AAED,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB;;;;;CAKW,CAAC;AAEhD,eAAO,MAAM,0BAA0B;;;;;CAKQ,CAAC"}
|
|
@@ -7,33 +7,33 @@ var n = [
|
|
|
7
7
|
"loading",
|
|
8
8
|
"success",
|
|
9
9
|
"error"
|
|
10
|
-
], r = {
|
|
10
|
+
], r = 2e3, i = {
|
|
11
11
|
idle: "Start",
|
|
12
12
|
loading: "Processing",
|
|
13
13
|
success: "Success",
|
|
14
14
|
error: "Error"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function a(e) {
|
|
17
17
|
return n[(n.indexOf(e) + 1) % n.length];
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function o(e, t) {
|
|
20
20
|
return {
|
|
21
|
-
idle: t?.idle ?? (typeof e == "string" || typeof e == "number" ? String(e) :
|
|
22
|
-
loading: t?.loading ??
|
|
23
|
-
success: t?.success ??
|
|
24
|
-
error: t?.error ??
|
|
21
|
+
idle: t?.idle ?? (typeof e == "string" || typeof e == "number" ? String(e) : i.idle),
|
|
22
|
+
loading: t?.loading ?? i.loading,
|
|
23
|
+
success: t?.success ?? i.success,
|
|
24
|
+
error: t?.error ?? i.error
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var s = {
|
|
28
28
|
xs: `${e.sm} ${t.xs} py-1 text-sm leading-none`,
|
|
29
29
|
sm: `${e.md} ${t.sm} py-1.5 text-sm leading-none`,
|
|
30
30
|
md: `${e.lg} ${t.md} py-2.5 text-sm leading-none`,
|
|
31
31
|
lg: `min-h-12 ${t.lg} py-3 text-base leading-none`
|
|
32
|
-
},
|
|
32
|
+
}, c = {
|
|
33
33
|
xs: "gap-1.5",
|
|
34
34
|
sm: "gap-1.5",
|
|
35
35
|
md: "gap-2",
|
|
36
36
|
lg: "gap-2"
|
|
37
37
|
};
|
|
38
38
|
//#endregion
|
|
39
|
-
export { n as buttonStatusCycle,
|
|
39
|
+
export { n as buttonStatusCycle, r as buttonStatusHoldMs, c as buttonStatusIconGapClasses, s as buttonStatusSizeClasses, i as defaultStatusLabels, a as getNextButtonStatus, o as resolveStatusLabels };
|
|
@@ -27,6 +27,8 @@ export declare const buttonAlignClasses: Record<ButtonAlign, string>;
|
|
|
27
27
|
* Size is `--font-size-sm` (12px) — small, still a control label.
|
|
28
28
|
*/
|
|
29
29
|
export declare const buttonMonoLabelClasses = "!font-mono !text-[length:var(--font-size-sm)] !font-normal !uppercase !leading-none !tracking-[0.14em]";
|
|
30
|
+
/** Trailing new-tab glyph on an `external` link button — the icon **TextLink** `external` shows. */
|
|
31
|
+
export declare const buttonExternalIconClasses = "-ml-0.5 size-[0.85em] shrink-0 stroke-current";
|
|
30
32
|
/** Trailing accent square for a Lucide glyph (`endIcon`). */
|
|
31
33
|
export declare const buttonEndIconSquareClasses = "inline-flex size-5 shrink-0 items-center justify-center rounded-none bg-accent text-on-accent";
|
|
32
34
|
/** Horizontal padding per size — md = 20px (`px-5`). Shared by action and status modes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/buttonStyles.ts"],"names":[],"mappings":"AAMA,uEAAuE;AACvE,eAAO,MAAM,WAAW,iFAAkF,CAAC;AAE3G,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,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,QAGqB,CAAC;AAEzD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAI/D"}
|
|
@@ -13,7 +13,7 @@ var i = [
|
|
|
13
13
|
"pill",
|
|
14
14
|
"row",
|
|
15
15
|
"nav"
|
|
16
|
-
], s = ["fill", "hug"], c = ["center", "start"], l = ["strong", "quiet"], u = "inline-flex cursor-pointer items-center font-sans font-medium tracking-normal transition-[color,transform,box-shadow,border-color,outline-color,background-color] " + e("fast") + " " + t + " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-body disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none aria-disabled:opacity-50 no-underline", d = {
|
|
16
|
+
], s = ["fill", "hug"], c = ["center", "start"], l = ["strong", "quiet"], u = "inline-flex cursor-pointer items-center font-sans font-medium normal-case tracking-normal transition-[color,transform,box-shadow,border-color,outline-color,background-color] " + e("fast") + " " + t + " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-body disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none aria-disabled:opacity-50 no-underline", d = {
|
|
17
17
|
primary: "bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-active",
|
|
18
18
|
secondary: "bg-secondary text-secondary-foreground shadow-raised hover:bg-secondary-hover active:bg-secondary-active",
|
|
19
19
|
ghost: "bg-transparent text-ghost-foreground hover:bg-ghost-hover active:bg-ghost-active",
|
|
@@ -23,32 +23,32 @@ var i = [
|
|
|
23
23
|
}, f = "border border-border bg-transparent text-fg hover:bg-ghost-hover active:bg-ghost-active", p = {
|
|
24
24
|
center: "justify-center",
|
|
25
25
|
start: "justify-start text-left"
|
|
26
|
-
}, m = "!font-mono !text-[length:var(--font-size-sm)] !font-normal !uppercase !leading-none !tracking-[0.14em]", h = "inline-flex size-5 shrink-0 items-center justify-center rounded-none bg-accent text-on-accent",
|
|
26
|
+
}, m = "!font-mono !text-[length:var(--font-size-sm)] !font-normal !uppercase !leading-none !tracking-[0.14em]", h = "-ml-0.5 size-[0.85em] shrink-0 stroke-current", g = "inline-flex size-5 shrink-0 items-center justify-center rounded-none bg-accent text-on-accent", _ = {
|
|
27
27
|
xs: "px-3.5",
|
|
28
28
|
sm: "px-4",
|
|
29
29
|
md: "px-5",
|
|
30
30
|
lg: "px-7"
|
|
31
|
-
}, _ = {
|
|
32
|
-
xs: `${n.sm} ${g.xs} py-1 text-sm leading-none`,
|
|
33
|
-
sm: `${n.md} ${g.sm} py-1.5 text-sm leading-none`,
|
|
34
|
-
md: `${n.lg} ${g.md} py-2.5 text-sm leading-none`,
|
|
35
|
-
lg: `min-h-12 ${g.lg} py-3 text-base leading-none`
|
|
36
31
|
}, v = {
|
|
32
|
+
xs: `${n.sm} ${_.xs} py-1 text-sm leading-none`,
|
|
33
|
+
sm: `${n.md} ${_.sm} py-1.5 text-sm leading-none`,
|
|
34
|
+
md: `${n.lg} ${_.md} py-2.5 text-sm leading-none`,
|
|
35
|
+
lg: `min-h-12 ${_.lg} py-3 text-base leading-none`
|
|
36
|
+
}, y = {
|
|
37
37
|
xs: "size-3.5",
|
|
38
38
|
sm: "size-4",
|
|
39
39
|
md: "size-4",
|
|
40
40
|
lg: "size-[1.125rem]"
|
|
41
|
-
},
|
|
41
|
+
}, b = {
|
|
42
42
|
xs: r.sm,
|
|
43
43
|
sm: r.md,
|
|
44
44
|
md: r.lg,
|
|
45
45
|
lg: "size-12 shrink-0"
|
|
46
|
-
},
|
|
46
|
+
}, x = "flex cursor-pointer items-center font-sans tracking-normal transition-[color,background-color,outline-color] " + e("fast") + " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50", S = "h-auto min-h-0 rounded-md px-1.5 py-1 text-left font-normal focus-visible:ring-inset focus-visible:ring-offset-0", C = {
|
|
47
47
|
fill: "w-full justify-between gap-3",
|
|
48
48
|
hug: "w-auto justify-start gap-1.5"
|
|
49
|
-
},
|
|
50
|
-
function
|
|
49
|
+
}, w = "h-auto min-h-0 w-full justify-start gap-2.5 rounded-xl px-2.5 py-2 text-left text-sm font-normal leading-[var(--line-height-sm)] focus-visible:ring-inset focus-visible:ring-offset-0";
|
|
50
|
+
function T(e) {
|
|
51
51
|
return e ? "bg-secondary text-secondary-foreground" : "bg-transparent text-muted hover:bg-ghost-hover hover:text-fg";
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
export { p as buttonAlignClasses, c as buttonAligns, u as buttonBaseClasses, l as buttonEmphases,
|
|
54
|
+
export { p as buttonAlignClasses, c as buttonAligns, u as buttonBaseClasses, l as buttonEmphases, g as buttonEndIconSquareClasses, h as buttonExternalIconClasses, _ as buttonHorizontalPadding, y as buttonIconSizeClasses, o as buttonLayouts, m as buttonMonoLabelClasses, w as buttonNavLayoutClasses, T as buttonNavStateClasses, f as buttonOutlineQuietClasses, a as buttonPillClass, d as buttonRoleClasses, i as buttonRoles, x as buttonRowBaseClasses, S as buttonRowLayoutClasses, C as buttonRowWidthClasses, v as buttonSizeClasses, s as buttonWidths, b as iconButtonSizeClasses };
|
|
@@ -13,6 +13,13 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
13
13
|
labelHidden?: boolean;
|
|
14
14
|
/** Neutral helper below the label. */
|
|
15
15
|
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Trailing count — for example how many posts a filter option matches. Muted, at the row's end.
|
|
18
|
+
* Screen readers hear it after the label in parentheses: "Guides (2)".
|
|
19
|
+
*/
|
|
20
|
+
count?: number;
|
|
21
|
+
/** What screen readers hear for `count`, for example "2 posts". Default: the number. */
|
|
22
|
+
countLabel?: string;
|
|
16
23
|
/** Mixed selection — sets native `indeterminate` on the input. */
|
|
17
24
|
indeterminate?: boolean;
|
|
18
25
|
/** Validation status — tints box border; pair with `message`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAIf,OAAO,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAIf,OAAO,EAoBL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE5E,qDAAqD;AACrD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACrC;AAcD;;;GAGG;AACH,eAAO,MAAM,QAAQ,4GA4MnB,CAAC"}
|