@flytedan/flytebot-design-system 0.12.9 → 0.12.11
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 +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -11
- package/dist/index.d.ts +31 -11
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +264 -57
- package/styles/tokens.css +27 -0
package/dist/index.d.cts
CHANGED
|
@@ -31,12 +31,16 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
31
31
|
size?: "sm" | "md" | "lg";
|
|
32
32
|
/** "ghost" and "outline" are quiet: no fill, the glyph carries the tone. "solid" is a
|
|
33
33
|
* filled button in the tone's colour — for the one action on a surface that has to be
|
|
34
|
-
* found at a glance, like the add/remove button on every row of a transfer list.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
* found at a glance, like the add/remove button on every row of a transfer list. "soft"
|
|
35
|
+
* is the same idea with a lighter, less saturated fill and a visibly darker border
|
|
36
|
+
* drawn around it, for a caller that wants the button to read as a button without the
|
|
37
|
+
* full-saturation "solid" look — only "ok" and "danger" tones are defined for it. */
|
|
38
|
+
variant?: "ghost" | "outline" | "solid" | "soft";
|
|
39
|
+
/** What the action does. On "solid"/"soft" it picks the fill; on "ghost"/"outline" it
|
|
40
|
+
* tints the glyph. "neutral" is the default look of each variant, which for "solid" is
|
|
41
|
+
* the brand fill ("soft" has no neutral fill — pass "ok" or "danger"). Every tone has
|
|
42
|
+
* hover, pressed and focus states and is legible in both themes — the fills are the
|
|
43
|
+
* --btn-solid-* / --btn-soft-* tokens, measured against light and dark grounds. */
|
|
40
44
|
tone?: "neutral" | "ok" | "danger";
|
|
41
45
|
round?: boolean;
|
|
42
46
|
disabled?: boolean;
|
|
@@ -1346,10 +1350,11 @@ interface EntityRowAction {
|
|
|
1346
1350
|
label: string;
|
|
1347
1351
|
onClick: () => void;
|
|
1348
1352
|
/** Picks the fill — "add" is the constructive (ok) fill, "remove" the destructive
|
|
1349
|
-
* (danger) fill, and no tone the brand fill. The button is always a filled
|
|
1350
|
-
*
|
|
1351
|
-
* list, and has to be findable at a glance on a default
|
|
1352
|
-
* alike. No effect on layout, so a caller can still pass
|
|
1353
|
+
* (danger) fill, and no tone the brand fill. The button is always a filled IconButton
|
|
1354
|
+
* (variant "soft": a lighter fill with a darker border, MP-52): it is the one action on
|
|
1355
|
+
* the row, repeated down a long list, and has to be findable at a glance on a default
|
|
1356
|
+
* card and on a danger-toned one alike. No effect on layout, so a caller can still pass
|
|
1357
|
+
* any icon. */
|
|
1353
1358
|
tone?: "add" | "remove";
|
|
1354
1359
|
}
|
|
1355
1360
|
/** Width in px a metric cell takes when it doesn't ask for its own. Wide enough for a
|
|
@@ -1390,8 +1395,23 @@ interface EntityRowMetric {
|
|
|
1390
1395
|
* as the drag ghost) hands one of these around whole, so a prop added here can't be
|
|
1391
1396
|
* silently dropped by the second render site the way individually-spread props were.
|
|
1392
1397
|
*/
|
|
1398
|
+
/** An icon shown before the row's title, itself the Tooltip trigger together with the
|
|
1399
|
+
* title text (MP-52: "hovering EITHER the icon or the name" opens the same explanation —
|
|
1400
|
+
* one hoverable/focusable region rather than two separate targets that could disagree). */
|
|
1401
|
+
interface EntityRowTitleIcon {
|
|
1402
|
+
/** Phosphor icon name, e.g. "warning". */
|
|
1403
|
+
icon: string;
|
|
1404
|
+
tone?: "danger";
|
|
1405
|
+
/** The long-form explanation, shown in the kit's Tooltip on hover, keyboard focus and
|
|
1406
|
+
* tap — never a native `title`, so it is never truncated to a browser tooltip. */
|
|
1407
|
+
tooltip: React.ReactNode;
|
|
1408
|
+
}
|
|
1393
1409
|
interface EntityRowContent {
|
|
1394
1410
|
title: string;
|
|
1411
|
+
/** Renders before `title`, wrapped with it in the kit Tooltip. Drive this from the
|
|
1412
|
+
* row's own existing state (e.g. the same signal that sets `tone: "danger"`) — it is
|
|
1413
|
+
* not a second source of truth, just a second thing that one signal explains. */
|
|
1414
|
+
titleIcon?: EntityRowTitleIcon;
|
|
1395
1415
|
/** A secondary line — a count, a subtitle, whatever the caller's data has that a raw
|
|
1396
1416
|
* title doesn't. Optional because plenty of rows are fine with just a name. Sits
|
|
1397
1417
|
* inline after the title; for numbers that must line up row-to-row use `metrics`. */
|
|
@@ -1470,7 +1490,7 @@ declare function EntityRowMetrics({ metrics, className, style }: EntityRowMetric
|
|
|
1470
1490
|
* same move — pointer-only and keyboard users get an equally real affordance, not a
|
|
1471
1491
|
* degraded fallback.
|
|
1472
1492
|
*/
|
|
1473
|
-
declare function EntityRow({ title, meta, metrics, accessory, tone, action, draggable, onPointerDown, style, className, }: EntityRowProps): React.JSX.Element;
|
|
1493
|
+
declare function EntityRow({ title, titleIcon, meta, metrics, accessory, tone, action, draggable, onPointerDown, style, className, }: EntityRowProps): React.JSX.Element;
|
|
1474
1494
|
|
|
1475
1495
|
type TransferListSide = "left" | "right";
|
|
1476
1496
|
interface TransferListSideProps<T> {
|
package/dist/index.d.ts
CHANGED
|
@@ -31,12 +31,16 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
31
31
|
size?: "sm" | "md" | "lg";
|
|
32
32
|
/** "ghost" and "outline" are quiet: no fill, the glyph carries the tone. "solid" is a
|
|
33
33
|
* filled button in the tone's colour — for the one action on a surface that has to be
|
|
34
|
-
* found at a glance, like the add/remove button on every row of a transfer list.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
* found at a glance, like the add/remove button on every row of a transfer list. "soft"
|
|
35
|
+
* is the same idea with a lighter, less saturated fill and a visibly darker border
|
|
36
|
+
* drawn around it, for a caller that wants the button to read as a button without the
|
|
37
|
+
* full-saturation "solid" look — only "ok" and "danger" tones are defined for it. */
|
|
38
|
+
variant?: "ghost" | "outline" | "solid" | "soft";
|
|
39
|
+
/** What the action does. On "solid"/"soft" it picks the fill; on "ghost"/"outline" it
|
|
40
|
+
* tints the glyph. "neutral" is the default look of each variant, which for "solid" is
|
|
41
|
+
* the brand fill ("soft" has no neutral fill — pass "ok" or "danger"). Every tone has
|
|
42
|
+
* hover, pressed and focus states and is legible in both themes — the fills are the
|
|
43
|
+
* --btn-solid-* / --btn-soft-* tokens, measured against light and dark grounds. */
|
|
40
44
|
tone?: "neutral" | "ok" | "danger";
|
|
41
45
|
round?: boolean;
|
|
42
46
|
disabled?: boolean;
|
|
@@ -1346,10 +1350,11 @@ interface EntityRowAction {
|
|
|
1346
1350
|
label: string;
|
|
1347
1351
|
onClick: () => void;
|
|
1348
1352
|
/** Picks the fill — "add" is the constructive (ok) fill, "remove" the destructive
|
|
1349
|
-
* (danger) fill, and no tone the brand fill. The button is always a filled
|
|
1350
|
-
*
|
|
1351
|
-
* list, and has to be findable at a glance on a default
|
|
1352
|
-
* alike. No effect on layout, so a caller can still pass
|
|
1353
|
+
* (danger) fill, and no tone the brand fill. The button is always a filled IconButton
|
|
1354
|
+
* (variant "soft": a lighter fill with a darker border, MP-52): it is the one action on
|
|
1355
|
+
* the row, repeated down a long list, and has to be findable at a glance on a default
|
|
1356
|
+
* card and on a danger-toned one alike. No effect on layout, so a caller can still pass
|
|
1357
|
+
* any icon. */
|
|
1353
1358
|
tone?: "add" | "remove";
|
|
1354
1359
|
}
|
|
1355
1360
|
/** Width in px a metric cell takes when it doesn't ask for its own. Wide enough for a
|
|
@@ -1390,8 +1395,23 @@ interface EntityRowMetric {
|
|
|
1390
1395
|
* as the drag ghost) hands one of these around whole, so a prop added here can't be
|
|
1391
1396
|
* silently dropped by the second render site the way individually-spread props were.
|
|
1392
1397
|
*/
|
|
1398
|
+
/** An icon shown before the row's title, itself the Tooltip trigger together with the
|
|
1399
|
+
* title text (MP-52: "hovering EITHER the icon or the name" opens the same explanation —
|
|
1400
|
+
* one hoverable/focusable region rather than two separate targets that could disagree). */
|
|
1401
|
+
interface EntityRowTitleIcon {
|
|
1402
|
+
/** Phosphor icon name, e.g. "warning". */
|
|
1403
|
+
icon: string;
|
|
1404
|
+
tone?: "danger";
|
|
1405
|
+
/** The long-form explanation, shown in the kit's Tooltip on hover, keyboard focus and
|
|
1406
|
+
* tap — never a native `title`, so it is never truncated to a browser tooltip. */
|
|
1407
|
+
tooltip: React.ReactNode;
|
|
1408
|
+
}
|
|
1393
1409
|
interface EntityRowContent {
|
|
1394
1410
|
title: string;
|
|
1411
|
+
/** Renders before `title`, wrapped with it in the kit Tooltip. Drive this from the
|
|
1412
|
+
* row's own existing state (e.g. the same signal that sets `tone: "danger"`) — it is
|
|
1413
|
+
* not a second source of truth, just a second thing that one signal explains. */
|
|
1414
|
+
titleIcon?: EntityRowTitleIcon;
|
|
1395
1415
|
/** A secondary line — a count, a subtitle, whatever the caller's data has that a raw
|
|
1396
1416
|
* title doesn't. Optional because plenty of rows are fine with just a name. Sits
|
|
1397
1417
|
* inline after the title; for numbers that must line up row-to-row use `metrics`. */
|
|
@@ -1470,7 +1490,7 @@ declare function EntityRowMetrics({ metrics, className, style }: EntityRowMetric
|
|
|
1470
1490
|
* same move — pointer-only and keyboard users get an equally real affordance, not a
|
|
1471
1491
|
* degraded fallback.
|
|
1472
1492
|
*/
|
|
1473
|
-
declare function EntityRow({ title, meta, metrics, accessory, tone, action, draggable, onPointerDown, style, className, }: EntityRowProps): React.JSX.Element;
|
|
1493
|
+
declare function EntityRow({ title, titleIcon, meta, metrics, accessory, tone, action, draggable, onPointerDown, style, className, }: EntityRowProps): React.JSX.Element;
|
|
1474
1494
|
|
|
1475
1495
|
type TransferListSide = "left" | "right";
|
|
1476
1496
|
interface TransferListSideProps<T> {
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ function IconButton({
|
|
|
71
71
|
const overflowRow = useOverflowRow();
|
|
72
72
|
const cls = [
|
|
73
73
|
"fd-btn-icon",
|
|
74
|
-
variant === "outline" ? "fd-btn-icon-outline" : variant === "solid" ? "fd-btn-icon-solid" : "",
|
|
74
|
+
variant === "outline" ? "fd-btn-icon-outline" : variant === "solid" ? "fd-btn-icon-solid" : variant === "soft" ? "fd-btn-icon-soft" : "",
|
|
75
75
|
tone !== "neutral" ? "is-" + tone : "",
|
|
76
76
|
size === "sm" ? "fd-btn-icon-sm" : size === "lg" ? "fd-btn-icon-lg" : "",
|
|
77
77
|
round ? "fd-btn-icon-round" : "",
|
|
@@ -2937,6 +2937,7 @@ function EntityRowMetrics({ metrics, className = "", style }) {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
function EntityRow({
|
|
2939
2939
|
title,
|
|
2940
|
+
titleIcon,
|
|
2940
2941
|
meta,
|
|
2941
2942
|
metrics,
|
|
2942
2943
|
accessory,
|
|
@@ -2954,11 +2955,15 @@ function EntityRow({
|
|
|
2954
2955
|
onPointerDown,
|
|
2955
2956
|
className: ["fd-erow", tone === "danger" ? "fd-erow-danger" : "", className].filter(Boolean).join(" "),
|
|
2956
2957
|
style: {
|
|
2957
|
-
display
|
|
2958
|
-
|
|
2959
|
-
|
|
2958
|
+
// display/alignItems/gap/padding moved to the .fd-erow stylesheet rule
|
|
2959
|
+
// (MP-114 follow-ups): an inline style always wins over a stylesheet rule
|
|
2960
|
+
// regardless of specificity or media/container query, which would have made
|
|
2961
|
+
// it impossible for the narrow-container rule below to ever switch this row
|
|
2962
|
+
// from a flex row to a grid — and padding specifically is also read back by
|
|
2963
|
+
// .fd-tlist-footer's own indent calc(), as --erow-pad-x, so it has to be a
|
|
2964
|
+
// real, readable stylesheet value rather than a number only this component
|
|
2965
|
+
// ever sees.
|
|
2960
2966
|
height: "100%",
|
|
2961
|
-
padding: "0 12px",
|
|
2962
2967
|
cursor: draggable ? "grab" : void 0,
|
|
2963
2968
|
// Own the gesture on touch too — without this, a touch-drag on a draggable row
|
|
2964
2969
|
// starts the page scrolling instead of (or as well as) the pointer drag.
|
|
@@ -2966,10 +2971,25 @@ function EntityRow({
|
|
|
2966
2971
|
...style
|
|
2967
2972
|
},
|
|
2968
2973
|
children: [
|
|
2969
|
-
draggable ?
|
|
2974
|
+
draggable ? (
|
|
2975
|
+
// font-size moved to the .fd-erow-grip stylesheet rule, same reason as the
|
|
2976
|
+
// row's own padding above: .fd-tlist-footer's indent reads it back as
|
|
2977
|
+
// --erow-grip-size.
|
|
2978
|
+
/* @__PURE__ */ jsx39("i", { className: "ph ph-dots-six-vertical fd-erow-grip", "aria-hidden": "true", style: { flex: "none", color: "var(--text-muted)" } })
|
|
2979
|
+
) : null,
|
|
2970
2980
|
/* @__PURE__ */ jsxs36("span", { className: "fd-erow-body", children: [
|
|
2971
2981
|
/* @__PURE__ */ jsxs36("span", { className: "fd-erow-titleline", children: [
|
|
2972
|
-
/* @__PURE__ */ jsx39(
|
|
2982
|
+
titleIcon ? /* @__PURE__ */ jsx39(Tooltip, { label: titleIcon.tooltip, children: /* @__PURE__ */ jsxs36(
|
|
2983
|
+
"button",
|
|
2984
|
+
{
|
|
2985
|
+
type: "button",
|
|
2986
|
+
className: ["fd-erow-title-icon", titleIcon.tone ? "is-" + titleIcon.tone : ""].filter(Boolean).join(" "),
|
|
2987
|
+
children: [
|
|
2988
|
+
/* @__PURE__ */ jsx39("i", { className: "ph ph-" + titleIcon.icon, "aria-hidden": "true" }),
|
|
2989
|
+
/* @__PURE__ */ jsx39("span", { className: "fd-erow-title fd-body-sm", children: title })
|
|
2990
|
+
]
|
|
2991
|
+
}
|
|
2992
|
+
) }) : /* @__PURE__ */ jsx39("span", { className: "fd-erow-title fd-body-sm", children: title }),
|
|
2973
2993
|
meta ? /* @__PURE__ */ jsx39("span", { className: "fd-erow-meta", children: meta }) : null
|
|
2974
2994
|
] }),
|
|
2975
2995
|
hasStrip ? /* @__PURE__ */ jsxs36("span", { className: "fd-erow-strip", children: [
|
|
@@ -2983,7 +3003,7 @@ function EntityRow({
|
|
|
2983
3003
|
icon: action.icon,
|
|
2984
3004
|
label: action.label,
|
|
2985
3005
|
size: "sm",
|
|
2986
|
-
variant: "solid",
|
|
3006
|
+
variant: action.tone ? "soft" : "solid",
|
|
2987
3007
|
tone: action.tone === "add" ? "ok" : action.tone === "remove" ? "danger" : "neutral",
|
|
2988
3008
|
className: "fd-erow-action",
|
|
2989
3009
|
onClick: action.onClick
|