@payfit/unity-components 3.0.3 → 3.1.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/esm/ai-kit.js +3 -1
- package/dist/esm/components/pill/Pill.d.ts +20 -2
- package/dist/esm/components/pill/Pill.js +10 -4
- package/dist/esm/modules/ai-kit/components/ai-button/AIButton.d.ts +63 -64
- package/dist/esm/modules/ai-kit/components/ai-button/AIButton.js +117 -95
- package/dist/esm/modules/ai-kit/components/ai-trigger-button/AITriggerButton.d.ts +124 -0
- package/dist/esm/modules/ai-kit/components/ai-trigger-button/AITriggerButton.js +108 -0
- package/dist/esm/modules/ai-kit/components/ai-trigger-button/figma/AITriggerButton.figma.d.ts +7 -0
- package/dist/esm/modules/ai-kit/components/payfit-ai-brand/PayfitAIBrand.d.ts +46 -0
- package/dist/esm/modules/ai-kit/components/payfit-ai-brand/PayfitAIBrand.js +74 -0
- package/dist/esm/modules/ai-kit/index.d.ts +2 -0
- package/dist/esm/modules/ai-kit/utils/ai-gradient-effect.d.ts +121 -57
- package/dist/esm/modules/ai-kit/utils/ai-gradient-effect.js +78 -18
- package/package.json +7 -7
- package/src/agent-references/component-catalog.json +60 -4
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { buttonBase as e } from "../../../../components/button/Button.variants.js";
|
|
2
|
+
import { Tooltip as t } from "../../../../components/tooltip/Tooltip.js";
|
|
3
|
+
import { aiGradientEffect as n, aiGradientSurfaceEffect as r } from "../../utils/ai-gradient-effect.js";
|
|
4
|
+
import { PayfitAIBrand as i } from "../payfit-ai-brand/PayfitAIBrand.js";
|
|
5
|
+
import { forwardRef as a, useState as o } from "react";
|
|
6
|
+
import { cn as s, uyTv as c } from "@payfit/unity-themes";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { ToggleButton as d } from "react-aria-components/ToggleButton";
|
|
9
|
+
//#region src/modules/ai-kit/components/ai-trigger-button/AITriggerButton.tsx
|
|
10
|
+
var f = c({
|
|
11
|
+
extend: e,
|
|
12
|
+
base: [
|
|
13
|
+
"uy:relative uy:isolate uy:[--uy-ai-gradient-border-width:2px]",
|
|
14
|
+
"uy:max-w-full",
|
|
15
|
+
"uy:text-content-neutral-enabled",
|
|
16
|
+
"uy:enabled:data-[hovered=\"true\"]:text-content-neutral-hover",
|
|
17
|
+
"uy:enabled:active:text-content-neutral-active",
|
|
18
|
+
"uy:enabled:data-[pressed=\"true\"]:text-content-neutral-pressed",
|
|
19
|
+
"uy:enabled:data-[focus-visible=\"true\"]:text-content-neutral-focus",
|
|
20
|
+
"uy:data-[pressed=\"true\"]:[--uy-ai-gradient-border-width:1px]",
|
|
21
|
+
"uy:data-[selected=\"true\"]:[--uy-ai-gradient-border-width:1px]",
|
|
22
|
+
"uy:data-[selected=\"true\"]:data-[hovered=\"true\"]:[--uy-ai-gradient-border-width:2px]",
|
|
23
|
+
"uy:data-[selected=\"true\"]:hover:[--uy-ai-gradient-border-width:2px]"
|
|
24
|
+
],
|
|
25
|
+
variants: {
|
|
26
|
+
isDisabled: {
|
|
27
|
+
true: [
|
|
28
|
+
"uy:disabled:border-border-neutral-high-disabled",
|
|
29
|
+
"uy:disabled:text-content-neutral-disabled",
|
|
30
|
+
"uy:data-[loading=\"true\"]:border-border-neutral-high-disabled",
|
|
31
|
+
"uy:data-[loading=\"true\"]:text-content-neutral-disabled"
|
|
32
|
+
],
|
|
33
|
+
false: ""
|
|
34
|
+
},
|
|
35
|
+
iconOnly: {
|
|
36
|
+
true: "uy:!px-100 uy:py-100",
|
|
37
|
+
false: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
compoundVariants: [{
|
|
41
|
+
isDisabled: !1,
|
|
42
|
+
className: n({
|
|
43
|
+
gradient: "linear",
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
glow: !1
|
|
46
|
+
})
|
|
47
|
+
}, {
|
|
48
|
+
iconOnly: !0,
|
|
49
|
+
mode: "compact",
|
|
50
|
+
className: "uy:!px-50 uy:py-50"
|
|
51
|
+
}],
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
isDisabled: !1,
|
|
54
|
+
iconOnly: !1
|
|
55
|
+
}
|
|
56
|
+
}), p = c({
|
|
57
|
+
base: "",
|
|
58
|
+
variants: { isDisabled: {
|
|
59
|
+
true: "",
|
|
60
|
+
false: r()
|
|
61
|
+
} },
|
|
62
|
+
defaultVariants: { isDisabled: !1 }
|
|
63
|
+
}), m = a(({ children: e, defaultSelected: n, iconOnly: r = !1, isDisabled: a = !1, isLoading: c = !1, isSelected: m, mode: h = "default", onChange: g, brandSlot: _, ...v }, y) => {
|
|
64
|
+
let [b, x] = o(n ?? !1), S = m ?? b, C = (e) => {
|
|
65
|
+
m === void 0 && x(e), g?.(e);
|
|
66
|
+
}, w = a || c, T = f({
|
|
67
|
+
iconOnly: r,
|
|
68
|
+
isDisabled: w,
|
|
69
|
+
mode: h
|
|
70
|
+
}), E = p({ isDisabled: w }), D = {
|
|
71
|
+
appearance: w ? "grayscale" : "color",
|
|
72
|
+
"aria-hidden": !0,
|
|
73
|
+
className: s("uy:[--uy-payfit-ai-brand-rotation:0deg]", "uy:[--uy-payfit-ai-brand-scale:1]", "uy:origin-center", "uy:transform-gpu", "uy:rotate-(--uy-payfit-ai-brand-rotation)", "uy:scale-(--uy-payfit-ai-brand-scale)", "uy:motion-safe:transition-[--uy-payfit-ai-brand-rotation,--uy-payfit-ai-brand-scale]", "uy:motion-safe:duration-600", "uy:motion-safe:ease-out", "uy:group-data-[hovered=\"true\"]:[--uy-payfit-ai-brand-rotation:370deg]", "uy:group-data-[hovered=\"true\"]:[--uy-payfit-ai-brand-scale:1.1]", "uy:group-data-[focus-visible=\"true\"]:[--uy-payfit-ai-brand-rotation:370deg]", "uy:group-data-[focus-visible=\"true\"]:[--uy-payfit-ai-brand-scale:1.1]") ?? "",
|
|
74
|
+
size: h === "default" ? 24 : 20
|
|
75
|
+
}, O = /* @__PURE__ */ u(d, {
|
|
76
|
+
...v,
|
|
77
|
+
ref: y,
|
|
78
|
+
"aria-expanded": S,
|
|
79
|
+
"data-dd-privacy": "allow",
|
|
80
|
+
"data-loading": c || void 0,
|
|
81
|
+
defaultSelected: n,
|
|
82
|
+
isDisabled: w,
|
|
83
|
+
isSelected: m,
|
|
84
|
+
onChange: C,
|
|
85
|
+
className: T,
|
|
86
|
+
children: [/* @__PURE__ */ l("span", {
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
className: E,
|
|
89
|
+
"data-unity-slot": "ai.surface"
|
|
90
|
+
}), /* @__PURE__ */ u("span", {
|
|
91
|
+
className: "uy:relative uy:z-20 uy:inline-flex uy:items-center uy:justify-center uy:gap-50",
|
|
92
|
+
children: [_?.(D) ?? /* @__PURE__ */ l(i, {
|
|
93
|
+
...D,
|
|
94
|
+
"data-unity-icon": "prefix"
|
|
95
|
+
}), /* @__PURE__ */ l("span", {
|
|
96
|
+
className: r ? "uy:sr-only" : void 0,
|
|
97
|
+
children: e
|
|
98
|
+
})]
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
return r ? /* @__PURE__ */ l(t, {
|
|
102
|
+
title: typeof e == "string" ? e : "Payfit AI",
|
|
103
|
+
children: O
|
|
104
|
+
}) : O;
|
|
105
|
+
});
|
|
106
|
+
m.displayName = "AITriggerButton";
|
|
107
|
+
//#endregion
|
|
108
|
+
export { m as AITriggerButton };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SVGAttributes } from 'react';
|
|
2
|
+
export type PayfitAIBrandProps = Omit<SVGAttributes<SVGSVGElement>, 'width' | 'height'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Sets the square width and height of the mark in pixels.
|
|
5
|
+
* @default 28
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Selects the full-color or disabled grayscale treatment.
|
|
10
|
+
* @default 'color'
|
|
11
|
+
*/
|
|
12
|
+
appearance?: 'color' | 'grayscale';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Renders the square PayFit AI brand mark used to identify AI Kit surfaces.
|
|
16
|
+
*
|
|
17
|
+
* Use the default `color` appearance for available AI actions. Set
|
|
18
|
+
* `appearance="grayscale"` when the adjacent control is disabled or loading.
|
|
19
|
+
* Pass `aria-hidden="true"` when nearby text already names the AI action;
|
|
20
|
+
* otherwise the mark exposes the accessible name “Payfit AI” by default.
|
|
21
|
+
* @param props - SVG attributes and PayFit AI brand options.
|
|
22
|
+
* @see {@link PayfitAIBrandProps} for size and appearance options.
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { PayfitAIBrand } from '@payfit/unity-components/ai-kit'
|
|
26
|
+
*
|
|
27
|
+
* export function AIActionLabel() {
|
|
28
|
+
* return <PayfitAIBrand size={24} aria-label="Payfit AI" />
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
* @remarks
|
|
32
|
+
* - The SVG preserves a square aspect ratio at every size.
|
|
33
|
+
* - It renders with `role="img"` unless it is decorative.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PayfitAIBrand: import('react').ForwardRefExoticComponent<Omit<SVGAttributes<SVGSVGElement>, "height" | "width"> & {
|
|
36
|
+
/**
|
|
37
|
+
* Sets the square width and height of the mark in pixels.
|
|
38
|
+
* @default 28
|
|
39
|
+
*/
|
|
40
|
+
size?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Selects the full-color or disabled grayscale treatment.
|
|
43
|
+
* @default 'color'
|
|
44
|
+
*/
|
|
45
|
+
appearance?: "color" | "grayscale";
|
|
46
|
+
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { uyTv as t } from "@payfit/unity-themes";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/modules/ai-kit/components/payfit-ai-brand/PayfitAIBrand.tsx
|
|
5
|
+
var i = t({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "uy:inline-flex",
|
|
8
|
+
circle: "",
|
|
9
|
+
asterisk: ""
|
|
10
|
+
},
|
|
11
|
+
variants: { appearance: {
|
|
12
|
+
color: {
|
|
13
|
+
root: ["uy:[filter:drop-shadow(0_0.586667px_1.466667px_rgb(0_0_0_/_0.14))_drop-shadow(0_0_0.293334px_rgb(0_0_0_/_0.3))]"],
|
|
14
|
+
circle: ["uy:fill-grayscale-l0"],
|
|
15
|
+
asterisk: ["uy:fill-[url(#payfit-ai-gradient)]"]
|
|
16
|
+
},
|
|
17
|
+
grayscale: {
|
|
18
|
+
circle: ["uy:fill-surface-neutral-disabled"],
|
|
19
|
+
asterisk: ["uy:fill-content-neutral-disabled"]
|
|
20
|
+
}
|
|
21
|
+
} }
|
|
22
|
+
}), a = e(({ appearance: e = "color", className: t, size: a = 28, ...o }, s) => {
|
|
23
|
+
let c = o["aria-hidden"] === !0 || o["aria-hidden"] === "true", { root: l, circle: u, asterisk: d } = i({ appearance: e });
|
|
24
|
+
return /* @__PURE__ */ n("span", {
|
|
25
|
+
className: l(),
|
|
26
|
+
children: /* @__PURE__ */ r("svg", {
|
|
27
|
+
...o,
|
|
28
|
+
className: t,
|
|
29
|
+
ref: s,
|
|
30
|
+
"aria-hidden": o["aria-hidden"],
|
|
31
|
+
"aria-label": c ? void 0 : o["aria-label"] ?? "Payfit AI",
|
|
32
|
+
fill: "none",
|
|
33
|
+
height: a,
|
|
34
|
+
role: c ? void 0 : o.role ?? "img",
|
|
35
|
+
viewBox: "0 0 160 160",
|
|
36
|
+
width: a,
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ n("rect", {
|
|
40
|
+
width: "160",
|
|
41
|
+
height: "160",
|
|
42
|
+
rx: "80",
|
|
43
|
+
className: u()
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ n("path", {
|
|
46
|
+
d: "M79.9999 40C81.9653 40 83.8309 40.7225 85.1534 42.0085C86.4741 43.2944 87.1759 45.0386 86.9214 46.8571C86.7676 47.9619 86.6214 49.0667 86.483 50.1714C85.6137 57.1091 85.048 64.0467 84.7853 70.9843C84.7715 71.3499 85.1756 71.5811 85.4883 71.3864C91.4215 67.6922 97.2034 63.7381 102.833 59.5234C103.73 58.8523 104.623 58.1745 105.511 57.4902C106.974 56.3625 108.849 56.0925 110.634 56.5826C112.419 57.0743 113.984 58.3137 114.966 60C115.949 61.6863 116.25 63.6482 115.787 65.4259C115.324 67.2019 114.15 68.676 112.433 69.367C111.39 69.7874 110.351 70.2144 109.316 70.648C102.817 73.371 96.4695 76.3545 90.2735 79.5979C89.947 79.7688 89.947 80.2312 90.2735 80.4021C96.4695 83.6455 102.817 86.629 109.316 89.352C110.351 89.7856 111.39 90.2126 112.433 90.633C114.15 91.324 115.324 92.7981 115.787 94.5741C116.25 96.3518 115.949 98.3137 114.966 100C113.984 101.686 112.419 102.926 110.634 103.417C108.849 103.907 106.974 103.637 105.511 102.51C104.623 101.825 103.73 101.148 102.833 100.477C97.2033 96.2619 91.4216 92.3076 85.4883 88.6134C85.1756 88.4187 84.7715 88.6499 84.7853 89.0155C85.048 95.9532 85.6137 102.891 86.483 109.829C86.6214 110.933 86.7676 112.038 86.9214 113.143C87.1759 114.961 86.4741 116.706 85.1534 117.992C83.8309 119.277 81.9653 120 79.9999 120C78.0345 120 76.1689 119.277 74.8464 117.992C73.5257 116.706 72.8238 114.961 73.0783 113.143C73.2322 112.038 73.3784 110.933 73.5168 109.829C74.3861 102.891 74.9518 95.9532 75.2145 89.0155C75.2283 88.6499 74.8242 88.4187 74.5115 88.6134C68.5783 92.3076 62.7966 96.2619 57.1667 100.477C56.2702 101.148 55.3774 101.825 54.4886 102.51C53.0262 103.637 51.1506 103.907 49.3662 103.417C47.5808 102.926 46.0164 101.686 45.0337 100C44.051 98.3137 43.7498 96.3518 44.2127 94.5741C44.6765 92.7981 45.8501 91.324 47.5671 90.633C48.6097 90.2126 49.6486 89.7856 50.6836 89.352C57.1829 86.629 63.5303 83.6455 69.7263 80.4021C70.0528 80.2312 70.0528 79.7688 69.7263 79.5979C63.5303 76.3545 57.1829 73.371 50.6836 70.648C49.6486 70.2144 48.6097 69.7874 47.5671 69.367C45.8501 68.676 44.6765 67.2019 44.2127 65.4259C43.7498 63.6482 44.051 61.6863 45.0337 60C46.0164 58.3137 47.5808 57.0743 49.3662 56.5826C51.1506 56.0925 53.0262 56.3626 54.4886 57.4902C55.3774 58.1745 56.2702 58.8523 57.1667 59.5234C62.7966 63.7381 68.5783 67.6922 74.5115 71.3864C74.8242 71.5811 75.2283 71.3499 75.2145 70.9843C74.9518 64.0467 74.3861 57.1091 73.5168 50.1714C73.3784 49.0667 73.2322 47.9619 73.0783 46.8571C72.8238 45.0386 73.5257 43.2944 74.8464 42.0085C76.1689 40.7225 78.0345 40 79.9999 40Z",
|
|
47
|
+
className: d()
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ n("defs", { children: /* @__PURE__ */ r("linearGradient", {
|
|
50
|
+
id: "payfit-ai-gradient",
|
|
51
|
+
x1: "44",
|
|
52
|
+
y1: "80.2797",
|
|
53
|
+
x2: "103.763",
|
|
54
|
+
y2: "53.2366",
|
|
55
|
+
gradientUnits: "userSpaceOnUse",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ n("stop", { stopColor: "#F5DD71" }),
|
|
58
|
+
/* @__PURE__ */ n("stop", {
|
|
59
|
+
offset: "0.5",
|
|
60
|
+
stopColor: "#FF7AFF"
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ n("stop", {
|
|
63
|
+
offset: "1",
|
|
64
|
+
stopColor: "#9FDFF9"
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}) })
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
a.displayName = "PayfitAIBrand";
|
|
73
|
+
//#endregion
|
|
74
|
+
export { a as PayfitAIBrand };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { AIButton, type AIButtonProps } from './components/ai-button/AIButton.js';
|
|
2
|
+
export { PayfitAIBrand, type PayfitAIBrandProps, } from './components/payfit-ai-brand/PayfitAIBrand.js';
|
|
3
|
+
export { AITriggerButton, type AITriggerButtonBrandSlotProps, type AITriggerButtonProps, } from './components/ai-trigger-button/AITriggerButton.js';
|
|
2
4
|
export { aiGradientEffect, aiGradientSurfaceEffect, } from './utils/ai-gradient-effect.js';
|
|
@@ -1,77 +1,141 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `--uy-ai-gradient-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* around the host
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
2
|
+
* @summary
|
|
3
|
+
* Applies the Payfit AI gradient border effect to an enabled interactive host.
|
|
4
|
+
* @description
|
|
5
|
+
* Pass the returned classes to the interactive element itself. The element
|
|
6
|
+
* continues to own its padding, margin, background, border radius, and
|
|
7
|
+
* semantic state styles. Set `--uy-ai-gradient-border-width` on that host to
|
|
8
|
+
* choose the visible border width.
|
|
9
|
+
* @param options - Variant options for the effect.
|
|
10
|
+
* @param {string} [options.gradient="linear"] - Gradient movement model. `linear` sweeps through
|
|
11
|
+
* a seamless repeat, `radial` pulses outward and inward, and `conic` rotates
|
|
12
|
+
* around the host. Defaults to `linear`.
|
|
13
|
+
* @param {string} [options.variant="outlined"] - Resting border visibility. `outlined` displays the
|
|
14
|
+
* border at rest; `ghost` displays it only in interactive states. Defaults to
|
|
15
|
+
* `outlined`.
|
|
16
|
+
* @param {boolean} [options.glow=false] - Enables the animated three-colour outer shadow on
|
|
17
|
+
* hover and focus-visible. Override `--uy-ai-gradient-glow-opacity` on the
|
|
18
|
+
* host to tune its strength. Defaults to `false`.
|
|
19
|
+
* @remarks
|
|
20
|
+
* - When the control needs an interior gradient surface, render a decorative
|
|
21
|
+
* element as the first child and apply {@link aiGradientSurfaceEffect}.
|
|
22
|
+
* - The surface utility creates the z-index 10 overlay layer. Elements that apply `aiGradientEffect`
|
|
23
|
+
* use`isolation: isolate` to avoid z-index conflicts.
|
|
24
|
+
* - Place all interactive content at z-index 20 so it remains above both the
|
|
25
|
+
* gradient border and surface.
|
|
26
|
+
* - The effect animates only on hover and focus-visible, respects
|
|
27
|
+
* reduced-motion preferences, and should only be applied while the host is
|
|
28
|
+
* enabled. Disabled states must supply their own non-animated
|
|
29
|
+
* border and surface.
|
|
30
|
+
* @notes
|
|
31
|
+
* This utility needs specific custom CSS properties set on the host element to work properly.
|
|
32
|
+
* - `--uy-ai-gradient-border-width` may be set on the host to control the
|
|
33
|
+
* visible gradient border width. It accepts a CSS length such as `1px` and
|
|
34
|
+
* defaults to `1px`.
|
|
35
|
+
* - `--uy-ai-gradient-angle` when `gradient: 'conic`. Set it for an advanced static starting angle
|
|
36
|
+
* for conic gradients and the glow. It accepts a CSS angle and defaults to
|
|
37
|
+
* `0deg`; the effect animates it when required.
|
|
38
|
+
* - `--uy-ai-gradient-glow-opacity` is optional when `glow: true`. It controls
|
|
39
|
+
* the glow's opacity, defaulting to `20%`.
|
|
40
|
+
* @returns Tailwind classes to apply to the interactive host.
|
|
23
41
|
* @example
|
|
24
42
|
* ```tsx
|
|
25
|
-
* const
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
43
|
+
* const myComponentStyles = uyTv({
|
|
44
|
+
* slots: {
|
|
45
|
+
* host: [
|
|
46
|
+
* 'uy:rounded-75',
|
|
47
|
+
* 'uy:bg-surface-neutral',
|
|
48
|
+
* 'uy:[--uy-ai-gradient-border-width:2px]',
|
|
49
|
+
* aiGradientEffect({
|
|
50
|
+
* gradient: 'linear',
|
|
51
|
+
* variant: 'outlined',
|
|
52
|
+
* glow: true,
|
|
53
|
+
* }),
|
|
54
|
+
* ],
|
|
55
|
+
* surface: [aiGradientSurfaceEffect()],
|
|
56
|
+
* content: ['uy:text-content-neutral'],
|
|
57
|
+
* },
|
|
36
58
|
* })
|
|
37
59
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* },
|
|
48
|
-
* ],
|
|
49
|
-
* })
|
|
60
|
+
* function Mycomponent() {
|
|
61
|
+
* console styles = myComponentStyles()
|
|
62
|
+
* return (
|
|
63
|
+
* <button className={styles.host()}>
|
|
64
|
+
* <span aria-hidden="true" className={styles.surface()} />
|
|
65
|
+
* <span className={styles.content()}>Ask AI</span>
|
|
66
|
+
* </button>
|
|
67
|
+
* )
|
|
68
|
+
* }
|
|
50
69
|
* ```
|
|
51
70
|
*/
|
|
52
71
|
export declare const aiGradientEffect: import('tailwind-variants').TVReturnType<{
|
|
72
|
+
gradient: {
|
|
73
|
+
linear: string[];
|
|
74
|
+
radial: string[];
|
|
75
|
+
conic: string[];
|
|
76
|
+
};
|
|
53
77
|
variant: {
|
|
54
|
-
outlined: "uy:
|
|
55
|
-
ghost:
|
|
78
|
+
outlined: "uy:supports-mask-border:before:opacity-100";
|
|
79
|
+
ghost: string[];
|
|
80
|
+
};
|
|
81
|
+
glow: {
|
|
82
|
+
true: string[];
|
|
83
|
+
false: never[];
|
|
56
84
|
};
|
|
57
85
|
}, undefined, string[], {
|
|
86
|
+
gradient: {
|
|
87
|
+
linear: string[];
|
|
88
|
+
radial: string[];
|
|
89
|
+
conic: string[];
|
|
90
|
+
};
|
|
58
91
|
variant: {
|
|
59
|
-
outlined: "uy:
|
|
60
|
-
ghost:
|
|
92
|
+
outlined: "uy:supports-mask-border:before:opacity-100";
|
|
93
|
+
ghost: string[];
|
|
94
|
+
};
|
|
95
|
+
glow: {
|
|
96
|
+
true: string[];
|
|
97
|
+
false: never[];
|
|
61
98
|
};
|
|
62
99
|
}, undefined, import('tailwind-variants').TVReturnTypeLike<{
|
|
100
|
+
gradient: {
|
|
101
|
+
linear: string[];
|
|
102
|
+
radial: string[];
|
|
103
|
+
conic: string[];
|
|
104
|
+
};
|
|
63
105
|
variant: {
|
|
64
|
-
outlined: "uy:
|
|
65
|
-
ghost:
|
|
106
|
+
outlined: "uy:supports-mask-border:before:opacity-100";
|
|
107
|
+
ghost: string[];
|
|
108
|
+
};
|
|
109
|
+
glow: {
|
|
110
|
+
true: string[];
|
|
111
|
+
false: never[];
|
|
66
112
|
};
|
|
67
113
|
}, undefined>>;
|
|
68
114
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
115
|
+
* Applies the Payfit AI gradient surface effect to a decorative child layer.
|
|
116
|
+
* @description
|
|
117
|
+
* This utility takes no options. It positions a presentational layer over its relative host,
|
|
118
|
+
* makes it non-interactive, inherits the host radius, and applies the Payfit AI
|
|
119
|
+
* gradient at 6% opacity for enabled hover, focus-visible, active, pressed,
|
|
120
|
+
* and selected states.
|
|
121
|
+
* @remarks
|
|
122
|
+
* - Render the surface element as the first child of a host styled with
|
|
123
|
+
* {@link aiGradientEffect}.
|
|
124
|
+
* - It occupies z-index 10; the host's interactive content must use a higher z-index.
|
|
125
|
+
* - The complete layer contract is shown in {@link aiGradientEffect}'s example.
|
|
126
|
+
* @notes
|
|
127
|
+
* - This utility has no consumer-set CSS custom properties. Set any host
|
|
128
|
+
* properties through {@link aiGradientEffect} instead.
|
|
129
|
+
* - The layer has no resting or disabled background. The host remains
|
|
130
|
+
* responsible for its background, disabled styling, and loading styling.
|
|
131
|
+
* - Mark the element `aria-hidden` because it is purely decorative.
|
|
132
|
+
* @returns Tailwind classes to apply to the decorative surface element.
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* <button className={styles.host()}>
|
|
136
|
+
* <span aria-hidden="true" className={styles.surface()} />
|
|
137
|
+
* <span className={styles.content()}>Ask AI</span>
|
|
138
|
+
* </button>
|
|
139
|
+
* ```
|
|
76
140
|
*/
|
|
77
141
|
export declare const aiGradientSurfaceEffect: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnTypeLike<unknown, undefined>>;
|
|
@@ -2,24 +2,84 @@ import { uyTv as e } from "@payfit/unity-themes";
|
|
|
2
2
|
//#region src/modules/ai-kit/utils/ai-gradient-effect.ts
|
|
3
3
|
var t = e({
|
|
4
4
|
base: [
|
|
5
|
-
"uy:
|
|
6
|
-
"uy:
|
|
7
|
-
"uy:
|
|
8
|
-
"uy:
|
|
9
|
-
"uy:
|
|
10
|
-
"uy:
|
|
11
|
-
"uy:
|
|
12
|
-
"uy:
|
|
5
|
+
"uy:relative",
|
|
6
|
+
"uy:group",
|
|
7
|
+
"uy:isolate",
|
|
8
|
+
"uy:border-solid",
|
|
9
|
+
"uy:border-(length:--uy-ai-gradient-border-width)",
|
|
10
|
+
"uy:motion-safe:transition-[--uy-ai-gradient-border-width]",
|
|
11
|
+
"uy:motion-safe:duration-50",
|
|
12
|
+
"uy:motion-safe:ease-linear",
|
|
13
|
+
"uy:supports-mask-border:border-transparent",
|
|
14
|
+
"uy:supports-mask-border:before:content-['']",
|
|
15
|
+
"uy:supports-mask-border:before:pointer-events-none",
|
|
16
|
+
"uy:supports-mask-border:before:absolute",
|
|
17
|
+
"uy:supports-mask-border:before:-inset-(--uy-ai-gradient-border-width)",
|
|
18
|
+
"uy:supports-mask-border:before:z-0",
|
|
19
|
+
"uy:supports-mask-border:before:rounded-[inherit]",
|
|
20
|
+
"uy:supports-mask-border:before:p-(--uy-ai-gradient-border-width)",
|
|
21
|
+
"uy:supports-mask-border:before:opacity-0",
|
|
22
|
+
"uy:supports-mask-border:before:[mask-image:linear-gradient(#000_0_0),linear-gradient(#000_0_0)]",
|
|
23
|
+
"uy:supports-mask-border:before:[mask-origin:content-box,border-box]",
|
|
24
|
+
"uy:supports-mask-border:before:[mask-clip:content-box,border-box]",
|
|
25
|
+
"uy:supports-mask-border:before:[mask-composite:exclude]",
|
|
26
|
+
"uy:supports-mask-border:before:[-webkit-mask-image:linear-gradient(#000_0_0),linear-gradient(#000_0_0)]",
|
|
27
|
+
"uy:supports-mask-border:before:[-webkit-mask-origin:content-box,border-box]",
|
|
28
|
+
"uy:supports-mask-border:before:[-webkit-mask-clip:content-box,border-box]",
|
|
29
|
+
"uy:supports-mask-border:before:[-webkit-mask-composite:xor]"
|
|
13
30
|
],
|
|
14
|
-
variants: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
variants: {
|
|
32
|
+
gradient: {
|
|
33
|
+
linear: [
|
|
34
|
+
"uy:supports-mask-border:before:[background:linear-gradient(90deg,var(--uy-gradient-payfit-ai-animated))_0%_50%/400%_100%_no-repeat]",
|
|
35
|
+
"uy:motion-safe:enabled:data-[hovered=\"true\"]:before:animate-uy-ai-gradient-linear-sweep",
|
|
36
|
+
"uy:motion-safe:enabled:data-[focus-visible=\"true\"]:before:animate-uy-ai-gradient-linear-sweep",
|
|
37
|
+
"uy:motion-safe:enabled:hover:before:animate-uy-ai-gradient-linear-sweep",
|
|
38
|
+
"uy:motion-safe:enabled:focus-visible:before:animate-uy-ai-gradient-linear-sweep"
|
|
39
|
+
],
|
|
40
|
+
radial: [
|
|
41
|
+
"uy:supports-mask-border:before:[background:radial-gradient(circle,var(--uy-gradient-payfit-ai))_center/100%_100%_no-repeat]",
|
|
42
|
+
"uy:motion-safe:enabled:data-[hovered=\"true\"]:before:animate-uy-ai-gradient-radial-pulse",
|
|
43
|
+
"uy:motion-safe:enabled:data-[focus-visible=\"true\"]:before:animate-uy-ai-gradient-radial-pulse",
|
|
44
|
+
"uy:motion-safe:enabled:hover:before:animate-uy-ai-gradient-radial-pulse",
|
|
45
|
+
"uy:motion-safe:enabled:focus-visible:before:animate-uy-ai-gradient-radial-pulse"
|
|
46
|
+
],
|
|
47
|
+
conic: [
|
|
48
|
+
"uy:supports-mask-border:before:[background:conic-gradient(from_var(--uy-ai-gradient-angle),var(--uy-gradient-payfit-ai))_center/cover_no-repeat]",
|
|
49
|
+
"uy:motion-safe:enabled:data-[hovered=\"true\"]:before:animate-uy-ai-gradient-angle-rotate",
|
|
50
|
+
"uy:motion-safe:enabled:data-[focus-visible=\"true\"]:before:animate-uy-ai-gradient-angle-rotate",
|
|
51
|
+
"uy:motion-safe:enabled:hover:before:animate-uy-ai-gradient-angle-rotate",
|
|
52
|
+
"uy:motion-safe:enabled:focus-visible:before:animate-uy-ai-gradient-angle-rotate"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
variant: {
|
|
56
|
+
outlined: "uy:supports-mask-border:before:opacity-100",
|
|
57
|
+
ghost: [
|
|
58
|
+
"uy:enabled:data-[hovered=\"true\"]:supports-mask-border:before:opacity-100",
|
|
59
|
+
"uy:enabled:data-[pressed=\"true\"]:supports-mask-border:before:opacity-100",
|
|
60
|
+
"uy:enabled:data-[selected=\"true\"]:supports-mask-border:before:opacity-100",
|
|
61
|
+
"uy:enabled:data-[focus-visible=\"true\"]:supports-mask-border:before:opacity-100"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
glow: {
|
|
65
|
+
true: [
|
|
66
|
+
"uy:enabled:data-[hovered=\"true\"]:[box-shadow:var(--uy-ai-gradient-glow)]",
|
|
67
|
+
"uy:enabled:data-[focus-visible=\"true\"]:[box-shadow:var(--uy-ai-gradient-glow)]",
|
|
68
|
+
"uy:enabled:hover:[box-shadow:var(--uy-ai-gradient-glow)]",
|
|
69
|
+
"uy:enabled:focus-visible:[box-shadow:var(--uy-ai-gradient-glow)]",
|
|
70
|
+
"uy:motion-safe:enabled:data-[hovered=\"true\"]:animate-uy-ai-gradient-angle-rotate",
|
|
71
|
+
"uy:motion-safe:enabled:data-[focus-visible=\"true\"]:animate-uy-ai-gradient-angle-rotate",
|
|
72
|
+
"uy:motion-safe:enabled:hover:animate-uy-ai-gradient-angle-rotate",
|
|
73
|
+
"uy:motion-safe:enabled:focus-visible:animate-uy-ai-gradient-angle-rotate"
|
|
74
|
+
],
|
|
75
|
+
false: []
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
defaultVariants: {
|
|
79
|
+
gradient: "linear",
|
|
80
|
+
variant: "outlined",
|
|
81
|
+
glow: !1
|
|
82
|
+
}
|
|
83
|
+
}), n = e({ base: /* @__PURE__ */ "uy:pointer-events-none.uy:absolute.uy:inset-0.uy:z-10.uy:rounded-[inherit].uy:group-enabled:group-data-[hovered=\"true\"]:opacity-6.uy:group-enabled:group-data-[hovered=\"true\"]:bg-linear-45.uy:group-enabled:group-data-[hovered=\"true\"]:gradient-stops-payfit-ai.uy:group-enabled:group-hover:opacity-6.uy:group-enabled:group-hover:bg-linear-45.uy:group-enabled:group-hover:gradient-stops-payfit-ai.uy:group-enabled:group-data-[focus-visible=\"true\"]:opacity-6.uy:group-enabled:group-data-[focus-visible=\"true\"]:bg-linear-45.uy:group-enabled:group-data-[focus-visible=\"true\"]:gradient-stops-payfit-ai.uy:group-enabled:group-focus-visible:opacity-6.uy:group-enabled:group-focus-visible:bg-linear-45.uy:group-enabled:group-focus-visible:gradient-stops-payfit-ai.uy:group-enabled:group-data-active:opacity-6.uy:group-enabled:group-data-active:bg-linear-45.uy:group-enabled:group-data-active:gradient-stops-payfit-ai.uy:group-enabled:group-data-[pressed=\"true\"]:opacity-6.uy:group-enabled:group-data-[pressed=\"true\"]:bg-linear-45.uy:group-enabled:group-data-[pressed=\"true\"]:gradient-stops-payfit-ai.uy:group-enabled:group-data-[selected=\"true\"]:opacity-6.uy:group-enabled:group-data-[selected=\"true\"]:bg-linear-45.uy:group-enabled:group-data-[selected=\"true\"]:gradient-stops-payfit-ai".split(".") });
|
|
24
84
|
//#endregion
|
|
25
85
|
export { t as aiGradientEffect, n as aiGradientSurfaceEffect };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@hookform/resolvers": "5.2.1",
|
|
78
78
|
"@internationalized/date": "3.12.4",
|
|
79
79
|
"minimatch": "10.2.5",
|
|
80
|
-
"@payfit/unity-illustrations": "3.0
|
|
80
|
+
"@payfit/unity-illustrations": "3.1.0",
|
|
81
81
|
"@radix-ui/react-avatar": "1.2.6",
|
|
82
82
|
"@radix-ui/react-slot": "1.3.3",
|
|
83
83
|
"@react-aria/interactions": "3.28.1",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@hookform/devtools": "^4",
|
|
114
|
-
"@payfit/unity-icons": "3.0
|
|
115
|
-
"@payfit/unity-themes": "3.0
|
|
114
|
+
"@payfit/unity-icons": "3.1.0",
|
|
115
|
+
"@payfit/unity-themes": "3.1.0",
|
|
116
116
|
"@storybook/react-vite": "^10",
|
|
117
117
|
"@tanstack/react-query": "^5",
|
|
118
118
|
"@tanstack/react-router": "^1.131",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
132
132
|
"@payfit/storybook-addon-datadog-rum": "0.0.0-use.local",
|
|
133
133
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
134
|
-
"@payfit/unity-icons": "3.0
|
|
135
|
-
"@payfit/unity-illustrations": "3.0
|
|
136
|
-
"@payfit/unity-themes": "3.0
|
|
134
|
+
"@payfit/unity-icons": "3.1.0",
|
|
135
|
+
"@payfit/unity-illustrations": "3.1.0",
|
|
136
|
+
"@payfit/unity-themes": "3.1.0",
|
|
137
137
|
"@payfit/vite-configs": "0.0.0-use.local",
|
|
138
138
|
"@storybook/addon-a11y": "10.6.0",
|
|
139
139
|
"@storybook/addon-designs": "11.1.4",
|