@mattermost/compass-ui 0.1.0-alpha.20 → 0.1.0-alpha.22
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/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.css +1 -1
- package/dist/components/combobox/Combobox.d.ts +55 -3
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +299 -272
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/Combobox.module.scss.cjs +1 -1
- package/dist/components/combobox/Combobox.module.scss.js +25 -25
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/date-range-picker/DateRangePicker.css +1 -1
- package/dist/components/date-range-picker/DateRangePicker.module.scss.cjs +1 -1
- package/dist/components/date-range-picker/DateRangePicker.module.scss.js +26 -26
- package/dist/components/emoji-popover/EmojiPopover.css +1 -1
- package/dist/components/emoji-popover/EmojiPopover.module.scss.cjs +1 -1
- package/dist/components/emoji-popover/EmojiPopover.module.scss.js +21 -21
- package/dist/components/menu-item/MenuItem.cjs.map +1 -1
- package/dist/components/menu-item/MenuItem.css +1 -1
- package/dist/components/menu-item/MenuItem.d.ts +6 -1
- package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.js.map +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.cjs +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.js +18 -18
- package/dist/components/modal/Modal.cjs +1 -1
- package/dist/components/modal/Modal.cjs.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +91 -93
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/ModalOverlay.cjs +2 -0
- package/dist/components/modal/ModalOverlay.cjs.map +1 -0
- package/dist/components/modal/ModalOverlay.css +1 -1
- package/dist/components/modal/ModalOverlay.d.ts +43 -0
- package/dist/components/modal/ModalOverlay.d.ts.map +1 -0
- package/dist/components/modal/ModalOverlay.js +59 -0
- package/dist/components/modal/ModalOverlay.js.map +1 -0
- package/dist/components/modal/ModalOverlay.module.scss.cjs +1 -1
- package/dist/components/modal/ModalOverlay.module.scss.js +3 -3
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +4 -2
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/password-input/PasswordInput.css +1 -1
- package/dist/components/password-input/PasswordInput.module.scss.cjs +1 -1
- package/dist/components/password-input/PasswordInput.module.scss.js +12 -12
- package/dist/components/popover-menu/PopoverMenu.cjs +1 -1
- package/dist/components/popover-menu/PopoverMenu.cjs.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.css +1 -1
- package/dist/components/popover-menu/PopoverMenu.d.ts +6 -2
- package/dist/components/popover-menu/PopoverMenu.d.ts.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.js +29 -29
- package/dist/components/popover-menu/PopoverMenu.js.map +1 -1
- package/dist/components/popover-menu/PopoverMenu.module.scss.cjs +1 -1
- package/dist/components/popover-menu/PopoverMenu.module.scss.js +13 -12
- package/dist/components/popover-menu/PopoverMenu.module.scss.js.map +1 -1
- package/dist/components/profile-popover/ProfilePopover.css +1 -1
- package/dist/components/profile-popover/ProfilePopover.module.scss.cjs +1 -1
- package/dist/components/profile-popover/ProfilePopover.module.scss.js +33 -33
- package/dist/components/search-input/SearchInput.css +1 -1
- package/dist/components/search-input/SearchInput.module.scss.cjs +1 -1
- package/dist/components/search-input/SearchInput.module.scss.js +15 -15
- package/dist/components/team-avatar/TeamAvatar.cjs +1 -1
- package/dist/components/team-avatar/TeamAvatar.cjs.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.css +1 -1
- package/dist/components/team-avatar/TeamAvatar.d.ts +8 -1
- package/dist/components/team-avatar/TeamAvatar.d.ts.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.js +23 -21
- package/dist/components/team-avatar/TeamAvatar.js.map +1 -1
- package/dist/components/team-avatar/TeamAvatar.module.scss.cjs +1 -1
- package/dist/components/team-avatar/TeamAvatar.module.scss.js +17 -16
- package/dist/components/team-avatar/TeamAvatar.module.scss.js.map +1 -1
- package/dist/components/team-avatar/index.d.ts +1 -1
- package/dist/components/team-avatar/index.d.ts.map +1 -1
- package/dist/components/text-area/TextArea.css +1 -1
- package/dist/components/text-area/TextArea.module.scss.cjs +1 -1
- package/dist/components/text-area/TextArea.module.scss.js +12 -12
- package/dist/components/text-input/TextInput.css +1 -1
- package/dist/components/text-input/TextInput.module.scss.cjs +1 -1
- package/dist/components/text-input/TextInput.module.scss.js +19 -19
- package/dist/components/tile-button/TileButton.cjs +2 -0
- package/dist/components/tile-button/TileButton.cjs.map +1 -0
- package/dist/components/tile-button/TileButton.css +1 -0
- package/dist/components/tile-button/TileButton.d.ts +54 -0
- package/dist/components/tile-button/TileButton.d.ts.map +1 -0
- package/dist/components/tile-button/TileButton.js +74 -0
- package/dist/components/tile-button/TileButton.js.map +1 -0
- package/dist/components/tile-button/TileButton.module.scss.cjs +2 -0
- package/dist/components/tile-button/TileButton.module.scss.cjs.map +1 -0
- package/dist/components/tile-button/TileButton.module.scss.js +12 -0
- package/dist/components/tile-button/TileButton.module.scss.js.map +1 -0
- package/dist/components/{action-button → tile-button}/index.cjs +1 -1
- package/dist/components/tile-button/index.d.ts +3 -0
- package/dist/components/tile-button/index.d.ts.map +1 -0
- package/dist/components/tile-button/index.js +5 -0
- package/dist/components/tour-point/TourPoint.css +1 -1
- package/dist/components/tour-point/TourPoint.module.scss.cjs +1 -1
- package/dist/components/tour-point/TourPoint.module.scss.js +28 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +111 -109
- package/dist/index.js.map +1 -1
- package/dist/utils/scrollLock.cjs +2 -0
- package/dist/utils/scrollLock.cjs.map +1 -0
- package/dist/utils/scrollLock.d.ts +9 -0
- package/dist/utils/scrollLock.d.ts.map +1 -0
- package/dist/utils/scrollLock.js +38 -0
- package/dist/utils/scrollLock.js.map +1 -0
- package/dist/utils/slot.cjs.map +1 -1
- package/dist/utils/slot.d.ts +1 -1
- package/dist/utils/slot.js.map +1 -1
- package/dist/utils/useOnExited.cjs +2 -0
- package/dist/utils/useOnExited.cjs.map +1 -0
- package/dist/utils/useOnExited.d.ts +7 -0
- package/dist/utils/useOnExited.d.ts.map +1 -0
- package/dist/utils/useOnExited.js +14 -0
- package/dist/utils/useOnExited.js.map +1 -0
- package/package.json +5 -4
- package/dist/components/action-button/ActionButton.cjs +0 -2
- package/dist/components/action-button/ActionButton.cjs.map +0 -1
- package/dist/components/action-button/ActionButton.css +0 -1
- package/dist/components/action-button/ActionButton.d.ts +0 -54
- package/dist/components/action-button/ActionButton.d.ts.map +0 -1
- package/dist/components/action-button/ActionButton.js +0 -74
- package/dist/components/action-button/ActionButton.js.map +0 -1
- package/dist/components/action-button/ActionButton.module.scss.cjs +0 -2
- package/dist/components/action-button/ActionButton.module.scss.cjs.map +0 -1
- package/dist/components/action-button/ActionButton.module.scss.js +0 -12
- package/dist/components/action-button/ActionButton.module.scss.js.map +0 -1
- package/dist/components/action-button/index.d.ts +0 -3
- package/dist/components/action-button/index.d.ts.map +0 -1
- package/dist/components/action-button/index.js +0 -5
- /package/dist/components/{action-button → tile-button}/index.cjs.map +0 -0
- /package/dist/components/{action-button → tile-button}/index.js.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._action-button_1nxkv_2{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-xxxs);width:108px;min-width:64px;max-width:100%;padding:var(--spacing-m) 0 var(--spacing-s);border:none;border-radius:var(--radius-s);background-color:rgba(var(--center-channel-color-rgb),.04);--action-button-fg: rgba(var(--center-channel-color-rgb), .64);color:var(--action-button-fg);cursor:pointer;text-decoration:none;transition:background-color var(--duration-quick) var(--ease-transition),color var(--duration-quick) var(--ease-transition),outline-color var(--duration-quick) var(--ease-transition),outline-offset var(--duration-quick) var(--ease-transition);outline:2px solid color-mix(in srgb,var(--focus-ring-color) 0%,transparent);outline-offset:0}._action-button_1nxkv_2:any-link,._action-button_1nxkv_2:hover,._action-button_1nxkv_2:focus,._action-button_1nxkv_2:active,._action-button_1nxkv_2:visited{color:var(--action-button-fg);text-decoration:none}._action-button_1nxkv_2:focus-visible{outline-color:var(--focus-ring-color);outline-offset:3px}._action-button_1nxkv_2:hover:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--center-channel-color-rgb),.08);--action-button-fg: rgba(var(--center-channel-color-rgb), .75)}._action-button_1nxkv_2:active:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--button-bg-rgb),.08);--action-button-fg: var(--link-color)}._action-button_1nxkv_2:is(:disabled,._action-button--disabled_1nxkv_30){opacity:.48;cursor:not-allowed}._action-button--active_1nxkv_42{--action-button-fg: var(--link-color);background-color:rgba(var(--button-bg-rgb),.08)}._action-button--active_1nxkv_42 ._action-button__icon_1nxkv_46,._action-button--active_1nxkv_42 ._action-button__label_1nxkv_47{color:var(--link-color)}._action-button--active_1nxkv_42:hover:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--button-bg-rgb),.12)}._action-button--active_1nxkv_42:active:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--button-bg-rgb),.16)}._action-button--destructive_1nxkv_56{--focus-ring-color: var(--error-text, var(--color-danger));--action-button-fg: var(--error-text, var(--color-danger));background-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.04)}._action-button--destructive_1nxkv_56:hover:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.08);--action-button-fg: var(--error-text, var(--color-danger))}._action-button--destructive_1nxkv_56:active:not(:disabled,._action-button--disabled_1nxkv_30){background-color:rgba(var(--error-text-color-rgb, var(--color-danger-rgb)),.16);--action-button-fg: var(--error-text, var(--color-danger))}._action-button__icon_1nxkv_46{display:flex;align-items:center;justify-content:center;width:var(--icon-size-20);height:var(--icon-size-20);flex-shrink:0;color:var(--action-button-fg)}._action-button__label_1nxkv_47{font-family:var(--font-family-body);font-size:var(--font-size-50);font-weight:var(--font-weight-semibold);line-height:var(--line-height-50);letter-spacing:.11px;box-sizing:border-box;max-width:100%;padding-inline:var(--action-button-padding-inline, clamp(var(--spacing-xs), 33.33% - 13.33px, var(--spacing-l)));display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere;text-wrap:balance;white-space:normal;text-align:center;color:var(--action-button-fg)}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode, RefAttributes } from 'react';
|
|
2
|
-
interface ActionButtonOwnProps {
|
|
3
|
-
/** Pass `<Icon glyph={<SomeIcon />} />` — ActionButton provides the correct size (20) via context. */
|
|
4
|
-
icon: ReactNode;
|
|
5
|
-
/** Visible label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */
|
|
6
|
-
label: ReactNode;
|
|
7
|
-
destructive?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* When true, disables the control. On a native `<button>`, sets the `disabled`
|
|
11
|
-
* attribute. With `asChild`, sets `aria-disabled`, applies disabled styles, and
|
|
12
|
-
* blocks click / middle-click navigation (the link stays focusable).
|
|
13
|
-
*/
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface ActionButtonProps extends ActionButtonOwnProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
-
/**
|
|
18
|
-
* When true, merges ActionButton props onto the single child element instead of
|
|
19
|
-
* rendering a `<button>`. Use with `<a>` or a router `Link`. Default: false.
|
|
20
|
-
*/
|
|
21
|
-
asChild?: false;
|
|
22
|
-
/**
|
|
23
|
-
* When set, this is a toggle; maps to `aria-pressed`. Only applies to the native
|
|
24
|
-
* `<button>`; not available with `asChild`.
|
|
25
|
-
*/
|
|
26
|
-
active?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface ActionButtonAsChildProps extends ActionButtonOwnProps, Omit<HTMLAttributes<HTMLElement>, 'children' | 'color'> {
|
|
29
|
-
/**
|
|
30
|
-
* Merges ActionButton props onto the single child element instead of rendering a
|
|
31
|
-
* `<button>`. The child's own props (`href`, `to`, `target`, …) stay on the
|
|
32
|
-
* child. Do not pass `type` or `active` — they are not available on links.
|
|
33
|
-
* Pass an empty child; ActionButton supplies the icon and label anatomy.
|
|
34
|
-
*/
|
|
35
|
-
asChild: true;
|
|
36
|
-
/** Single empty element to render as the ActionButton (e.g. `<a href="…" />`). */
|
|
37
|
-
children: ReactElement;
|
|
38
|
-
}
|
|
39
|
-
type ActionButtonComponent = {
|
|
40
|
-
(props: ActionButtonAsChildProps & RefAttributes<HTMLElement>): ReactElement | null;
|
|
41
|
-
(props: ActionButtonProps & RefAttributes<HTMLButtonElement>): ReactElement | null;
|
|
42
|
-
displayName?: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Action Buttons surface a small set of high-frequency actions in a fixed context — a
|
|
46
|
-
* profile popover, a channel info panel, a card. They sit close to the content they act on
|
|
47
|
-
* and read as a row of equal-weight choices.
|
|
48
|
-
*
|
|
49
|
-
* Pass `asChild` with a single empty `<a>` or router `Link` child to render a navigational
|
|
50
|
-
* action with Action Button styling (no nested `<button>`).
|
|
51
|
-
*/
|
|
52
|
-
declare const ActionButton: ActionButtonComponent;
|
|
53
|
-
export default ActionButton;
|
|
54
|
-
//# sourceMappingURL=ActionButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAKf,UAAU,oBAAoB;IAC5B,sGAAsG;IACtG,IAAI,EAAE,SAAS,CAAC;IAChB,4EAA4E;IAC5E,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAAE,oBAAoB,CAAC,iBAAiB,CAAC;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,wBACf,SACE,oBAAoB,EACpB,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACzD;;;;;OAKG;IACH,OAAO,EAAE,IAAI,CAAC;IACd,kFAAkF;IAClF,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,KAAK,qBAAqB,GAAG;IAC3B,CACE,KAAK,EAAE,wBAAwB,GAAG,aAAa,CAAC,WAAW,CAAC,GAC3D,YAAY,GAAG,IAAI,CAAC;IACvB,CACE,KAAK,EAAE,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAC1D,YAAY,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,YAAY,EAyFZ,qBAAqB,CAAC;AAI5B,eAAe,YAAY,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as y, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as A } from "react";
|
|
3
|
-
import { IconSlotContext as s } from "../icon/Icon.js";
|
|
4
|
-
import { renderAsChild as P } from "../../utils/slot.js";
|
|
5
|
-
import t from "./ActionButton.module.scss.js";
|
|
6
|
-
const w = A(function(a, o) {
|
|
7
|
-
if (a.asChild) {
|
|
8
|
-
const {
|
|
9
|
-
icon: f,
|
|
10
|
-
label: v,
|
|
11
|
-
destructive: p = !1,
|
|
12
|
-
className: C,
|
|
13
|
-
disabled: N,
|
|
14
|
-
children: _,
|
|
15
|
-
asChild: F,
|
|
16
|
-
...B
|
|
17
|
-
} = a, j = [
|
|
18
|
-
t["action-button"],
|
|
19
|
-
p ? t["action-button--destructive"] : "",
|
|
20
|
-
C ?? ""
|
|
21
|
-
].filter(Boolean).join(" "), x = /* @__PURE__ */ i(y, { children: [
|
|
22
|
-
/* @__PURE__ */ e("span", { className: t["action-button__icon"], "aria-hidden": !0, children: /* @__PURE__ */ e(s.Provider, { value: { size: "20" }, children: f }) }),
|
|
23
|
-
/* @__PURE__ */ e("span", { className: t["action-button__label"], children: v })
|
|
24
|
-
] });
|
|
25
|
-
return P({
|
|
26
|
-
child: _,
|
|
27
|
-
props: {
|
|
28
|
-
...B,
|
|
29
|
-
className: j
|
|
30
|
-
},
|
|
31
|
-
ref: o,
|
|
32
|
-
content: x,
|
|
33
|
-
disabled: !!N,
|
|
34
|
-
disabledClassName: t["action-button--disabled"],
|
|
35
|
-
warnOnChildContent: !0
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
const {
|
|
39
|
-
icon: l,
|
|
40
|
-
label: c,
|
|
41
|
-
active: n,
|
|
42
|
-
destructive: r = !1,
|
|
43
|
-
className: d,
|
|
44
|
-
disabled: u,
|
|
45
|
-
type: m = "button",
|
|
46
|
-
asChild: g,
|
|
47
|
-
...b
|
|
48
|
-
} = a, h = [
|
|
49
|
-
t["action-button"],
|
|
50
|
-
n ? t["action-button--active"] : "",
|
|
51
|
-
r ? t["action-button--destructive"] : "",
|
|
52
|
-
d ?? ""
|
|
53
|
-
].filter(Boolean).join(" ");
|
|
54
|
-
return /* @__PURE__ */ i(
|
|
55
|
-
"button",
|
|
56
|
-
{
|
|
57
|
-
ref: o,
|
|
58
|
-
className: h,
|
|
59
|
-
type: m,
|
|
60
|
-
disabled: u,
|
|
61
|
-
"aria-pressed": n === void 0 ? void 0 : n,
|
|
62
|
-
...b,
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ e("span", { className: t["action-button__icon"], "aria-hidden": !0, children: /* @__PURE__ */ e(s.Provider, { value: { size: "20" }, children: l }) }),
|
|
65
|
-
/* @__PURE__ */ e("span", { className: t["action-button__label"], children: c })
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
w.displayName = "ActionButton";
|
|
71
|
-
export {
|
|
72
|
-
w as default
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=ActionButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.js","sources":["../../../src/components/action-button/ActionButton.tsx"],"sourcesContent":["import {\n forwardRef,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n type RefAttributes,\n} from 'react';\nimport { IconSlotContext } from '@/components/icon/Icon';\nimport { renderAsChild } from '@/utils/slot';\nimport styles from './ActionButton.module.scss';\n\ninterface ActionButtonOwnProps {\n /** Pass `<Icon glyph={<SomeIcon />} />` — ActionButton provides the correct size (20) via context. */\n icon: ReactNode;\n /** Visible label. Accepts translated nodes (e.g. `<FormattedMessage/>`). */\n label: ReactNode;\n destructive?: boolean;\n className?: string;\n /**\n * When true, disables the control. On a native `<button>`, sets the `disabled`\n * attribute. With `asChild`, sets `aria-disabled`, applies disabled styles, and\n * blocks click / middle-click navigation (the link stays focusable).\n */\n disabled?: boolean;\n}\n\nexport interface ActionButtonProps\n extends ActionButtonOwnProps, ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * When true, merges ActionButton props onto the single child element instead of\n * rendering a `<button>`. Use with `<a>` or a router `Link`. Default: false.\n */\n asChild?: false;\n /**\n * When set, this is a toggle; maps to `aria-pressed`. Only applies to the native\n * `<button>`; not available with `asChild`.\n */\n active?: boolean;\n}\n\nexport interface ActionButtonAsChildProps\n extends\n ActionButtonOwnProps,\n Omit<HTMLAttributes<HTMLElement>, 'children' | 'color'> {\n /**\n * Merges ActionButton props onto the single child element instead of rendering a\n * `<button>`. The child's own props (`href`, `to`, `target`, …) stay on the\n * child. Do not pass `type` or `active` — they are not available on links.\n * Pass an empty child; ActionButton supplies the icon and label anatomy.\n */\n asChild: true;\n /** Single empty element to render as the ActionButton (e.g. `<a href=\"…\" />`). */\n children: ReactElement;\n}\n\ntype ActionButtonComponent = {\n (\n props: ActionButtonAsChildProps & RefAttributes<HTMLElement>,\n ): ReactElement | null;\n (\n props: ActionButtonProps & RefAttributes<HTMLButtonElement>,\n ): ReactElement | null;\n displayName?: string;\n};\n\n/**\n * Action Buttons surface a small set of high-frequency actions in a fixed context — a\n * profile popover, a channel info panel, a card. They sit close to the content they act on\n * and read as a row of equal-weight choices.\n *\n * Pass `asChild` with a single empty `<a>` or router `Link` child to render a navigational\n * action with Action Button styling (no nested `<button>`).\n */\nconst ActionButton = forwardRef(function ActionButton(\n props: ActionButtonProps | ActionButtonAsChildProps,\n ref: Ref<HTMLButtonElement | HTMLElement>,\n) {\n if (props.asChild) {\n const {\n icon,\n label,\n destructive = false,\n className,\n disabled,\n children,\n asChild,\n ...rest\n } = props;\n void asChild;\n\n const rootClass = [\n styles['action-button'],\n destructive ? styles['action-button--destructive'] : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const anatomy = (\n <>\n <span className={styles['action-button__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {icon}\n </IconSlotContext.Provider>\n </span>\n <span className={styles['action-button__label']}>{label}</span>\n </>\n );\n\n return renderAsChild({\n child: children,\n props: {\n ...rest,\n className: rootClass,\n },\n ref,\n content: anatomy,\n disabled: Boolean(disabled),\n disabledClassName: styles['action-button--disabled'],\n warnOnChildContent: true,\n });\n }\n\n const {\n icon,\n label,\n active,\n destructive = false,\n className,\n disabled,\n type = 'button',\n asChild,\n ...htmlProps\n } = props;\n void asChild;\n\n const rootClass = [\n styles['action-button'],\n active ? styles['action-button--active'] : '',\n destructive ? styles['action-button--destructive'] : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n className={rootClass}\n type={type}\n disabled={disabled}\n aria-pressed={active === undefined ? undefined : active}\n {...htmlProps}\n >\n <span className={styles['action-button__icon']} aria-hidden>\n <IconSlotContext.Provider value={{ size: '20' }}>\n {icon}\n </IconSlotContext.Provider>\n </span>\n <span className={styles['action-button__label']}>{label}</span>\n </button>\n );\n}) as ActionButtonComponent;\n\nActionButton.displayName = 'ActionButton';\n\nexport default ActionButton;\n"],"names":["ActionButton","forwardRef","props","ref","icon","label","destructive","className","disabled","children","asChild","rest","rootClass","styles","anatomy","jsxs","Fragment","jsx","IconSlotContext","renderAsChild","active","type","htmlProps"],"mappings":";;;;;AA2EA,MAAMA,IAAeC,EAAW,SAC9BC,GACAC,GACA;AACA,MAAID,EAAM,SAAS;AACjB,UAAM;AAAA,MACJ,MAAAE;AAAAA,MACA,OAAAC;AAAAA,MACA,aAAAC,IAAc;AAAA,MACd,WAAAC;AAAAA,MACA,UAAAC;AAAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAAA,MACA,GAAGC;AAAA,IAAA,IACDT,GAGEU,IAAY;AAAA,MAChBC,EAAO,eAAe;AAAA,MACtBP,IAAcO,EAAO,4BAA4B,IAAI;AAAA,MACrDN,KAAa;AAAA,IAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,GAELO,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAK,WAAWJ,EAAO,qBAAqB,GAAG,eAAW,IACzD,UAAA,gBAAAI,EAACC,EAAgB,UAAhB,EAAyB,OAAO,EAAE,MAAM,QACtC,UAAAd,GACH,GACF;AAAA,wBACC,QAAA,EAAK,WAAWS,EAAO,sBAAsB,GAAI,UAAAR,EAAAA,CAAM;AAAA,IAAA,GAC1D;AAGF,WAAOc,EAAc;AAAA,MACnB,OAAOV;AAAA,MACP,OAAO;AAAA,QACL,GAAGE;AAAA,QACH,WAAWC;AAAAA,MAAA;AAAA,MAEb,KAAAT;AAAA,MACA,SAASW;AAAA,MACT,UAAU,EAAQN;AAAAA,MAClB,mBAAmBK,EAAO,yBAAyB;AAAA,MACnD,oBAAoB;AAAA,IAAA,CACrB;AAAA,EACH;AAEA,QAAM;AAAA,IACJ,MAAAT;AAAA,IACA,OAAAC;AAAA,IACA,QAAAe;AAAA,IACA,aAAAd,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAa,IAAO;AAAA,IACP,SAAAX;AAAA,IACA,GAAGY;AAAA,EAAA,IACDpB,GAGEU,IAAY;AAAA,IAChBC,EAAO,eAAe;AAAA,IACtBO,IAASP,EAAO,uBAAuB,IAAI;AAAA,IAC3CP,IAAcO,EAAO,4BAA4B,IAAI;AAAA,IACrDN,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAWS;AAAA,MACX,MAAAS;AAAA,MACA,UAAAb;AAAA,MACA,gBAAcY,MAAW,SAAY,SAAYA;AAAA,MAChD,GAAGE;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAL,EAAC,UAAK,WAAWJ,EAAO,qBAAqB,GAAG,eAAW,IACzD,UAAA,gBAAAI,EAACC,EAAgB,UAAhB,EAAyB,OAAO,EAAE,MAAM,KAAA,GACtC,aACH,GACF;AAAA,0BACC,QAAA,EAAK,WAAWL,EAAO,sBAAsB,GAAI,UAAAR,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9D,CAAC;AAEDL,EAAa,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./ActionButton.css');const t={"action-button":"_action-button_1nxkv_2","action-button--disabled":"_action-button--disabled_1nxkv_30","action-button--active":"_action-button--active_1nxkv_42","action-button__icon":"_action-button__icon_1nxkv_46","action-button__label":"_action-button__label_1nxkv_47","action-button--destructive":"_action-button--destructive_1nxkv_56"};exports.default=t;
|
|
2
|
-
//# sourceMappingURL=ActionButton.module.scss.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.module.scss.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import './ActionButton.css';const t = {
|
|
2
|
-
"action-button": "_action-button_1nxkv_2",
|
|
3
|
-
"action-button--disabled": "_action-button--disabled_1nxkv_30",
|
|
4
|
-
"action-button--active": "_action-button--active_1nxkv_42",
|
|
5
|
-
"action-button__icon": "_action-button__icon_1nxkv_46",
|
|
6
|
-
"action-button__label": "_action-button__label_1nxkv_47",
|
|
7
|
-
"action-button--destructive": "_action-button--destructive_1nxkv_56"
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
t as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ActionButton.module.scss.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EACV,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC"}
|
|
File without changes
|
|
File without changes
|