@flytedan/flytebot-design-system 0.5.0 → 0.6.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/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +26 -1
package/dist/index.d.cts
CHANGED
|
@@ -452,11 +452,13 @@ interface TagProps {
|
|
|
452
452
|
children?: React.ReactNode;
|
|
453
453
|
icon?: string;
|
|
454
454
|
selected?: boolean;
|
|
455
|
+
/** Colors the chip once selected — e.g. a favoured ("success") or excluded ("danger") toggle. No effect while unselected. */
|
|
456
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger";
|
|
455
457
|
onRemove?: () => void;
|
|
456
458
|
onClick?: () => void;
|
|
457
459
|
className?: string;
|
|
458
460
|
}
|
|
459
|
-
declare function Tag({ children, icon, selected, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
|
|
461
|
+
declare function Tag({ children, icon, selected, tone, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
|
|
460
462
|
|
|
461
463
|
/** Confirmation of something that already happened. Bottom-right, 5s, undo where reversible. */
|
|
462
464
|
interface ToastProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -452,11 +452,13 @@ interface TagProps {
|
|
|
452
452
|
children?: React.ReactNode;
|
|
453
453
|
icon?: string;
|
|
454
454
|
selected?: boolean;
|
|
455
|
+
/** Colors the chip once selected — e.g. a favoured ("success") or excluded ("danger") toggle. No effect while unselected. */
|
|
456
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger";
|
|
455
457
|
onRemove?: () => void;
|
|
456
458
|
onClick?: () => void;
|
|
457
459
|
className?: string;
|
|
458
460
|
}
|
|
459
|
-
declare function Tag({ children, icon, selected, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
|
|
461
|
+
declare function Tag({ children, icon, selected, tone, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
|
|
460
462
|
|
|
461
463
|
/** Confirmation of something that already happened. Bottom-right, 5s, undo where reversible. */
|
|
462
464
|
interface ToastProps {
|
package/dist/index.js
CHANGED
|
@@ -205,7 +205,14 @@ function Popover({
|
|
|
205
205
|
bottom: pos.bottom == null ? "auto" : pos.bottom,
|
|
206
206
|
width: matchWidth ? pos.width : width,
|
|
207
207
|
minWidth: minWidth || (matchWidth ? void 0 : 200),
|
|
208
|
-
|
|
208
|
+
// Size to content by default — cap only at real available room between the
|
|
209
|
+
// anchor and the viewport edge (pos.maxH, computed by usePopoverPosition).
|
|
210
|
+
// A caller-supplied `maxHeight` narrows that further (e.g. a long menu that
|
|
211
|
+
// should scroll well before it reaches the viewport edge); it must never
|
|
212
|
+
// widen past pos.maxH, which is why it's still Math.min'd against it. There
|
|
213
|
+
// is intentionally no arbitrary default here — an unrequested cap would clip
|
|
214
|
+
// ordinary content that simply happens to be taller than some fixed number.
|
|
215
|
+
maxHeight: maxHeight != null ? Math.min(maxHeight, pos.maxH) : pos.maxH,
|
|
209
216
|
transformOrigin: pos.side === "top" ? "bottom center" : "top center",
|
|
210
217
|
zIndex: 140,
|
|
211
218
|
...style
|
|
@@ -928,12 +935,13 @@ function hasModifier(e) {
|
|
|
928
935
|
|
|
929
936
|
// src/components/feedback/Tag.tsx
|
|
930
937
|
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
931
|
-
|
|
938
|
+
var TONES2 = { info: "fd-tag-info", success: "fd-tag-success", warning: "fd-tag-warning", danger: "fd-tag-danger" };
|
|
939
|
+
function Tag({ children, icon, selected = false, tone = "neutral", onRemove, onClick, className = "", ...rest }) {
|
|
932
940
|
return /* @__PURE__ */ jsxs17(
|
|
933
941
|
"button",
|
|
934
942
|
{
|
|
935
943
|
type: "button",
|
|
936
|
-
className: ["fd-tag", className].filter(Boolean).join(" "),
|
|
944
|
+
className: ["fd-tag", selected ? TONES2[tone] : null, className].filter(Boolean).join(" "),
|
|
937
945
|
"aria-pressed": selected,
|
|
938
946
|
onClick,
|
|
939
947
|
...rest,
|