@flytedan/flytebot-design-system 0.38.0 → 0.39.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.cjs +3 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +51 -57
package/dist/index.d.cts
CHANGED
|
@@ -20,14 +20,14 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
20
20
|
block?: boolean;
|
|
21
21
|
as?: "button" | "a";
|
|
22
22
|
/** When `disabled` (or `loading`), stay in the tab order instead of going natively
|
|
23
|
-
* `disabled`: renders `aria-disabled="true"`
|
|
24
|
-
* keeps the `:focus-visible` ring, and swallows
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
23
|
+
* `disabled`: renders `aria-disabled="true"` only while actually disabled/loading (never
|
|
24
|
+
* the `disabled` attribute), keeps the `:focus-visible` ring, and swallows
|
|
25
|
+
* click/Enter/Space — including never letting a click bubble to an ancestor's own
|
|
26
|
+
* handler — without ever submitting a form. Use whenever a button's disabled state can
|
|
27
|
+
* flip while it holds focus (e.g. a controlled panel re-seeding mid-edit) — a native
|
|
28
|
+
* `disabled` drops focus to `<body>` the instant it applies, and nothing can intercept or
|
|
29
|
+
* redirect that. Once enabled again, this behaves exactly like a plain button: no
|
|
30
|
+
* `aria-disabled` attribute at all. */
|
|
31
31
|
focusableWhenDisabled?: boolean;
|
|
32
32
|
}
|
|
33
33
|
declare function Button({ children, variant, size, icon, trailingIcon, arrow, loading, disabled, focusableWhenDisabled, block, as, className, onClick, onKeyDown, ...rest }: ButtonProps): React.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
20
20
|
block?: boolean;
|
|
21
21
|
as?: "button" | "a";
|
|
22
22
|
/** When `disabled` (or `loading`), stay in the tab order instead of going natively
|
|
23
|
-
* `disabled`: renders `aria-disabled="true"`
|
|
24
|
-
* keeps the `:focus-visible` ring, and swallows
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
23
|
+
* `disabled`: renders `aria-disabled="true"` only while actually disabled/loading (never
|
|
24
|
+
* the `disabled` attribute), keeps the `:focus-visible` ring, and swallows
|
|
25
|
+
* click/Enter/Space — including never letting a click bubble to an ancestor's own
|
|
26
|
+
* handler — without ever submitting a form. Use whenever a button's disabled state can
|
|
27
|
+
* flip while it holds focus (e.g. a controlled panel re-seeding mid-edit) — a native
|
|
28
|
+
* `disabled` drops focus to `<body>` the instant it applies, and nothing can intercept or
|
|
29
|
+
* redirect that. Once enabled again, this behaves exactly like a plain button: no
|
|
30
|
+
* `aria-disabled` attribute at all. */
|
|
31
31
|
focusableWhenDisabled?: boolean;
|
|
32
32
|
}
|
|
33
33
|
declare function Button({ children, variant, size, icon, trailingIcon, arrow, loading, disabled, focusableWhenDisabled, block, as, className, onClick, onKeyDown, ...rest }: ButtonProps): React.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -8,9 +8,6 @@ var VARIANTS = {
|
|
|
8
8
|
danger: "fd-btn-danger",
|
|
9
9
|
link: "fd-btn-link"
|
|
10
10
|
};
|
|
11
|
-
function isActivationKey(key) {
|
|
12
|
-
return key === "Enter" || key === " ";
|
|
13
|
-
}
|
|
14
11
|
function Button({
|
|
15
12
|
children,
|
|
16
13
|
variant = "primary",
|
|
@@ -43,15 +40,13 @@ function Button({
|
|
|
43
40
|
{
|
|
44
41
|
className: cls,
|
|
45
42
|
disabled: Tag2 === "button" ? (disabled || loading) && !focusableWhenDisabled : void 0,
|
|
46
|
-
"aria-disabled":
|
|
43
|
+
"aria-disabled": disabled || loading ? "true" : void 0,
|
|
47
44
|
"aria-busy": loading ? "true" : void 0,
|
|
48
45
|
onClick: inert ? (e) => {
|
|
49
46
|
e.preventDefault();
|
|
47
|
+
e.stopPropagation();
|
|
50
48
|
} : onClick,
|
|
51
|
-
onKeyDown
|
|
52
|
-
if (isActivationKey(e.key)) e.preventDefault();
|
|
53
|
-
onKeyDown?.(e);
|
|
54
|
-
} : onKeyDown,
|
|
49
|
+
onKeyDown,
|
|
55
50
|
...rest,
|
|
56
51
|
children: [
|
|
57
52
|
icon && !loading ? /* @__PURE__ */ jsx("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) : null,
|