@flytedan/flytebot-design-system 0.5.0 → 0.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.cjs +3 -2
- 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 +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +20 -0
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
|
@@ -928,12 +928,13 @@ function hasModifier(e) {
|
|
|
928
928
|
|
|
929
929
|
// src/components/feedback/Tag.tsx
|
|
930
930
|
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
931
|
-
|
|
931
|
+
var TONES2 = { info: "fd-tag-info", success: "fd-tag-success", warning: "fd-tag-warning", danger: "fd-tag-danger" };
|
|
932
|
+
function Tag({ children, icon, selected = false, tone = "neutral", onRemove, onClick, className = "", ...rest }) {
|
|
932
933
|
return /* @__PURE__ */ jsxs17(
|
|
933
934
|
"button",
|
|
934
935
|
{
|
|
935
936
|
type: "button",
|
|
936
|
-
className: ["fd-tag", className].filter(Boolean).join(" "),
|
|
937
|
+
className: ["fd-tag", selected ? TONES2[tone] : null, className].filter(Boolean).join(" "),
|
|
937
938
|
"aria-pressed": selected,
|
|
938
939
|
onClick,
|
|
939
940
|
...rest,
|