@danxbot/ui 6.5.0 → 6.6.0
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/index.js +1503 -1517
- package/dist/index.js.map +1 -1
- package/dist/types/components/Button.d.ts +17 -1
- package/dist/types/components/IconButton.d.ts +1 -1
- package/package.json +1 -1
|
@@ -126,7 +126,23 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Va
|
|
|
126
126
|
* for the announcement.
|
|
127
127
|
*/
|
|
128
128
|
disabledReason?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Whether `Button` wraps ITSELF in the `disabledReason` tooltip. Defaults to
|
|
131
|
+
* `true` — a plain, directly-used `Button` needs this, since nothing else
|
|
132
|
+
* will show the reason.
|
|
133
|
+
*
|
|
134
|
+
* `false` is for a caller that already wraps the rendered control in its
|
|
135
|
+
* own, wider-scoped tooltip — `IconButton` (SG-839) is the one case today:
|
|
136
|
+
* it needs a tooltip in MORE states than `Button` does on its own (naming
|
|
137
|
+
* itself while enabled, not only explaining itself while off), so it
|
|
138
|
+
* supplies that tooltip itself and sets this to `false` to avoid nesting two
|
|
139
|
+
* tooltips around one trigger. Every other piece of the `disabledReason`
|
|
140
|
+
* contract — the `aria-disabled`/`aria-describedby` wiring, the `sr-only`
|
|
141
|
+
* description, the click guard, the dimmed/not-allowed styling — stays
|
|
142
|
+
* here regardless of this flag; only the self-wrapping tooltip is optional.
|
|
143
|
+
*/
|
|
144
|
+
disabledReasonTooltip?: boolean;
|
|
129
145
|
ref?: Ref<HTMLButtonElement>;
|
|
130
146
|
}
|
|
131
|
-
export declare function Button({ className, variant, size, iconOnly, fullWidth, render, loading, leadingIcon, trailingIcon, disabled, children, onPointerDown, onClick, disabledReason, ref, "aria-disabled": ariaDisabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
147
|
+
export declare function Button({ className, variant, size, iconOnly, fullWidth, render, loading, leadingIcon, trailingIcon, disabled, children, onPointerDown, onClick, disabledReason, disabledReasonTooltip, ref, "aria-disabled": ariaDisabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
132
148
|
export { button as buttonVariants };
|
|
@@ -21,7 +21,7 @@ declare const VARIANT_FOR: {
|
|
|
21
21
|
};
|
|
22
22
|
export type IconButtonVariant = keyof typeof VARIANT_FOR;
|
|
23
23
|
export type IconButtonTone = "neutral" | "danger";
|
|
24
|
-
export interface IconButtonProps extends Omit<ButtonProps, "children" | "iconOnly" | "leadingIcon" | "trailingIcon" | "variant" | "aria-label" | "disabled" | "aria-disabled"> {
|
|
24
|
+
export interface IconButtonProps extends Omit<ButtonProps, "children" | "iconOnly" | "leadingIcon" | "trailingIcon" | "variant" | "aria-label" | "disabled" | "aria-disabled" | "disabledReasonTooltip"> {
|
|
25
25
|
/** The glyph. Rendered `aria-hidden` — the name comes from `label`. */
|
|
26
26
|
icon: ReactNode;
|
|
27
27
|
/**
|