@payfit/unity-components 3.9.6 → 3.9.8

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.
Files changed (39) hide show
  1. package/dist/esm/ai-kit.js +25 -18
  2. package/dist/esm/core/components/card/Card.d.ts +30 -0
  3. package/dist/esm/core/components/card/Card.js +27 -21
  4. package/dist/esm/core/components/card/parts/CardTitle.d.ts +1 -4
  5. package/dist/esm/core/components/card/parts/CardTitle.js +15 -14
  6. package/dist/esm/core/components/definition-list/DefinitionList.context.d.ts +5 -1
  7. package/dist/esm/core/components/definition-list/DefinitionList.context.js +6 -2
  8. package/dist/esm/core/components/definition-list/DefinitionList.d.ts +12 -2
  9. package/dist/esm/core/components/definition-list/DefinitionList.js +34 -16
  10. package/dist/esm/core/components/definition-list/parts/DefinitionItem.js +50 -15
  11. package/dist/esm/core/components/definition-list/parts/DefinitionListGroup.d.ts +15 -0
  12. package/dist/esm/core/components/definition-list/parts/DefinitionListGroup.js +41 -0
  13. package/dist/esm/core/index.d.ts +1 -0
  14. package/dist/esm/core/index.js +139 -138
  15. package/dist/esm/index.js +152 -151
  16. package/dist/esm/modules/ai-kit/components/aichat-event-feedback/AIChatEventFeedback.d.ts +62 -0
  17. package/dist/esm/modules/ai-kit/components/aichat-event-feedback/AIChatEventFeedback.js +85 -0
  18. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.context.d.ts +7 -0
  19. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.context.js +10 -0
  20. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.d.ts +30 -0
  21. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.js +35 -0
  22. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.variants.d.ts +55 -0
  23. package/dist/esm/modules/ai-kit/components/proposal-card/ProposalCard.variants.js +31 -0
  24. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardActions.d.ts +7 -0
  25. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardActions.js +18 -0
  26. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardContent.d.ts +9 -0
  27. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardContent.js +19 -0
  28. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardHeader.d.ts +12 -0
  29. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardHeader.js +44 -0
  30. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardSubtitle.d.ts +7 -0
  31. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardSubtitle.js +16 -0
  32. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardTitle.d.ts +7 -0
  33. package/dist/esm/modules/ai-kit/components/proposal-card/parts/ProposalCardTitle.js +23 -0
  34. package/dist/esm/modules/ai-kit/index.d.ts +7 -0
  35. package/i18n/en-GB.json +2 -0
  36. package/i18n/es-ES.json +2 -0
  37. package/i18n/fr-FR.json +2 -0
  38. package/package.json +7 -7
  39. package/src/agent-references/component-catalog.json +49 -0
@@ -1,21 +1,28 @@
1
1
  import { RawAIOutcomeCard as e } from "./modules/ai-kit/components/ai-outcome-card/RawAIOutcomeCard.js";
2
2
  import { aiGradientEffect as t, aiGradientSurfaceEffect as n } from "./modules/ai-kit/utils/ai-gradient-effect.js";
3
3
  import { AIButton as r } from "./modules/ai-kit/components/ai-button/AIButton.js";
4
- import { PayfitAIBrand as i } from "./modules/ai-kit/components/payfit-ai-brand/PayfitAIBrand.js";
5
- import { AITriggerButton as a } from "./modules/ai-kit/components/ai-trigger-button/AITriggerButton.js";
6
- import { AIComposerAttachment as o } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAttachment.js";
7
- import { AIComposerAttachmentsGroup as s } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAttachmentsGroup.js";
8
- import { AIComposer as c } from "./modules/ai-kit/components/ai-composer/AIComposer.js";
9
- import { AIComposerAction as l } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAction.js";
10
- import { AIComposerActions as u } from "./modules/ai-kit/components/ai-composer/parts/AIComposerActions.js";
11
- import { AIComposerAlert as d } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAlert.js";
12
- import { AIComposerSubmitAction as f } from "./modules/ai-kit/components/ai-composer/parts/AIComposerSubmitAction.js";
13
- import { AIComposerTextArea as p } from "./modules/ai-kit/components/ai-composer/parts/AIComposerTextArea.js";
14
- import { useAIKitFieldContext as m, useAIKitFormContext as h } from "./modules/ai-kit/hooks/ai-kit-form-context.js";
15
- import { aiKitForm as g, useAIKitForm as _ } from "./modules/ai-kit/hooks/use-ai-kit-form.js";
16
- import { AIOutcomeCardIcon as v } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardIcon.js";
17
- import { AIOutcomeCardTitle as y } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardTitle.js";
18
- import { AIOutcomeCardDescription as b } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardDescription.js";
19
- import { AIOutcomeCardActions as x } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardActions.js";
20
- import { AIOutcomeCardAction as S } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardAction.js";
21
- export { r as AIButton, c as AIComposer, l as AIComposerAction, u as AIComposerActions, d as AIComposerAlert, o as AIComposerAttachment, s as AIComposerAttachmentsGroup, f as AIComposerSubmitAction, p as AIComposerTextArea, S as AIOutcomeCardAction, x as AIOutcomeCardActions, b as AIOutcomeCardDescription, v as AIOutcomeCardIcon, y as AIOutcomeCardTitle, a as AITriggerButton, i as PayfitAIBrand, e as RawAIOutcomeCard, t as aiGradientEffect, n as aiGradientSurfaceEffect, g as aiKitForm, m as useAIKitFieldContext, _ as useAIKitForm, h as useAIKitFormContext };
4
+ import { AIProposalCard as i } from "./modules/ai-kit/components/proposal-card/ProposalCard.js";
5
+ import { AIProposalCardHeader as a } from "./modules/ai-kit/components/proposal-card/parts/ProposalCardHeader.js";
6
+ import { AIProposalCardSubtitle as o } from "./modules/ai-kit/components/proposal-card/parts/ProposalCardSubtitle.js";
7
+ import { AIProposalCardTitle as s } from "./modules/ai-kit/components/proposal-card/parts/ProposalCardTitle.js";
8
+ import { AIProposalCardContent as c } from "./modules/ai-kit/components/proposal-card/parts/ProposalCardContent.js";
9
+ import { AIProposalCardActions as l } from "./modules/ai-kit/components/proposal-card/parts/ProposalCardActions.js";
10
+ import { PayfitAIBrand as u } from "./modules/ai-kit/components/payfit-ai-brand/PayfitAIBrand.js";
11
+ import { AITriggerButton as d } from "./modules/ai-kit/components/ai-trigger-button/AITriggerButton.js";
12
+ import { AIComposerAttachment as f } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAttachment.js";
13
+ import { AIComposerAttachmentsGroup as p } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAttachmentsGroup.js";
14
+ import { AIComposer as m } from "./modules/ai-kit/components/ai-composer/AIComposer.js";
15
+ import { AIComposerAction as h } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAction.js";
16
+ import { AIComposerActions as g } from "./modules/ai-kit/components/ai-composer/parts/AIComposerActions.js";
17
+ import { AIComposerAlert as _ } from "./modules/ai-kit/components/ai-composer/parts/AIComposerAlert.js";
18
+ import { AIComposerSubmitAction as v } from "./modules/ai-kit/components/ai-composer/parts/AIComposerSubmitAction.js";
19
+ import { AIComposerTextArea as y } from "./modules/ai-kit/components/ai-composer/parts/AIComposerTextArea.js";
20
+ import { useAIKitFieldContext as b, useAIKitFormContext as x } from "./modules/ai-kit/hooks/ai-kit-form-context.js";
21
+ import { aiKitForm as S, useAIKitForm as C } from "./modules/ai-kit/hooks/use-ai-kit-form.js";
22
+ import { AIChatEventFeedback as w } from "./modules/ai-kit/components/aichat-event-feedback/AIChatEventFeedback.js";
23
+ import { AIOutcomeCardIcon as T } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardIcon.js";
24
+ import { AIOutcomeCardTitle as E } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardTitle.js";
25
+ import { AIOutcomeCardDescription as D } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardDescription.js";
26
+ import { AIOutcomeCardActions as O } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardActions.js";
27
+ import { AIOutcomeCardAction as k } from "./modules/ai-kit/components/ai-outcome-card/parts/AIOutcomeCardAction.js";
28
+ export { r as AIButton, w as AIChatEventFeedback, m as AIComposer, h as AIComposerAction, g as AIComposerActions, _ as AIComposerAlert, f as AIComposerAttachment, p as AIComposerAttachmentsGroup, v as AIComposerSubmitAction, y as AIComposerTextArea, k as AIOutcomeCardAction, O as AIOutcomeCardActions, D as AIOutcomeCardDescription, T as AIOutcomeCardIcon, E as AIOutcomeCardTitle, i as AIProposalCard, l as AIProposalCardActions, c as AIProposalCardContent, a as AIProposalCardHeader, o as AIProposalCardSubtitle, s as AIProposalCardTitle, d as AITriggerButton, u as PayfitAIBrand, e as RawAIOutcomeCard, t as aiGradientEffect, n as aiGradientSurfaceEffect, S as aiKitForm, b as useAIKitFieldContext, C as useAIKitForm, x as useAIKitFormContext };
@@ -1,6 +1,14 @@
1
1
  import { VariantProps } from '@payfit/unity-themes';
2
2
  import { ComponentProps, PropsWithChildren } from 'react';
3
3
  export declare const card: import('tailwind-variants').TVReturnType<{
4
+ density: {
5
+ default: {
6
+ base: string;
7
+ };
8
+ compact: {
9
+ base: string;
10
+ };
11
+ };
4
12
  shadow: {
5
13
  none: {
6
14
  base: string;
@@ -44,6 +52,14 @@ export declare const card: import('tailwind-variants').TVReturnType<{
44
52
  }, {
45
53
  base: string[];
46
54
  }, undefined, {
55
+ density: {
56
+ default: {
57
+ base: string;
58
+ };
59
+ compact: {
60
+ base: string;
61
+ };
62
+ };
47
63
  shadow: {
48
64
  none: {
49
65
  base: string;
@@ -87,6 +103,14 @@ export declare const card: import('tailwind-variants').TVReturnType<{
87
103
  }, {
88
104
  base: string[];
89
105
  }, import('tailwind-variants').TVReturnTypeLike<{
106
+ density: {
107
+ default: {
108
+ base: string;
109
+ };
110
+ compact: {
111
+ base: string;
112
+ };
113
+ };
90
114
  shadow: {
91
115
  none: {
92
116
  base: string;
@@ -131,6 +155,12 @@ export declare const card: import('tailwind-variants').TVReturnType<{
131
155
  base: string[];
132
156
  }>>;
133
157
  export interface CardProps extends PropsWithChildren<VariantProps<typeof card>>, ComponentProps<'section'> {
158
+ /**
159
+ * Controls the Card's internal padding without changing its surface,
160
+ * spacing between children, or accessible labelling behavior.
161
+ * @default 'default'
162
+ */
163
+ density?: VariantProps<typeof card>['density'];
134
164
  /**
135
165
  * The background color of the card.
136
166
  * @default 'surface.neutral'
@@ -5,8 +5,12 @@ import { jsx as o } from "react/jsx-runtime";
5
5
  import { useId as s } from "react-aria/useId";
6
6
  //#region src/core/components/card/Card.tsx
7
7
  var c = a({
8
- slots: { base: ["uy:flex uy:flex-col uy:gap-200 uy:p-200 uy:sm:p-300 uy:rounded-lg"] },
8
+ slots: { base: ["uy:flex uy:flex-col uy:gap-200 uy:rounded-lg"] },
9
9
  variants: {
10
+ density: {
11
+ default: { base: "uy:p-200 uy:sm:p-300" },
12
+ compact: { base: "uy:p-200" }
13
+ },
10
14
  shadow: {
11
15
  none: { base: "uy:shadow-none" },
12
16
  raising: { base: "uy:shadow-100" },
@@ -25,37 +29,39 @@ var c = a({
25
29
  }
26
30
  },
27
31
  defaultVariants: {
32
+ density: "default",
28
33
  shadow: "none",
29
34
  bgColor: "surface.neutral"
30
35
  }
31
- }), l = t(({ shadow: t, bgColor: a, children: l, className: u, ...d }, f) => {
32
- let p = s(), m = r(null), [h, g] = i(!1), _ = d.id ?? `unity-card-${p}`, v = `unity-card-${p}__title`, y = d["aria-label"];
36
+ }), l = t(({ density: t, shadow: a, bgColor: l, children: u, className: d, asElement: f, ...p }, m) => {
37
+ let h = s(), g = r(null), [_, v] = i(!1), y = p.id ?? `unity-card-${h}`, b = `unity-card-${h}__title`, x = p["aria-label"];
33
38
  n(() => {
34
- let e = m.current;
39
+ let e = g.current;
35
40
  if (!e) return;
36
41
  let t = e.querySelector("[data-unity-slot=\"card.title\"]");
37
- g(!!t), process.env.NODE_ENV === "development" && !t && !y && console.warn("Card: A Card must have either a CardTitle child or an aria-label prop for accessibility.");
38
- }, [l, y]);
39
- let b = (a ?? "surface.neutral") === "surface.neutral" && (t ?? "none") !== "none", { base: x } = c({
40
- className: u,
41
- shadow: b ? t : "none",
42
- bgColor: a
43
- }), S = { titleId: v }, C = d.asElement ?? "section";
42
+ v(!!t), process.env.NODE_ENV === "development" && !t && !x && console.warn("Card: A Card must have either a CardTitle child or an aria-label prop for accessibility.");
43
+ }, [u, x]);
44
+ let S = (l ?? "surface.neutral") === "surface.neutral" && (a ?? "none") !== "none", { base: C } = c({
45
+ className: d,
46
+ density: t,
47
+ shadow: S ? a : "none",
48
+ bgColor: l
49
+ }), w = { titleId: b }, T = f ?? "section";
44
50
  return /* @__PURE__ */ o(e.Provider, {
45
- value: S,
46
- children: /* @__PURE__ */ o(C, {
51
+ value: w,
52
+ children: /* @__PURE__ */ o(T, {
47
53
  "data-dd-privacy": "show",
48
- ...d,
49
- id: _,
54
+ ...p,
55
+ id: y,
50
56
  ref: (e) => {
51
- m.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
57
+ g.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
52
58
  },
53
- className: x(),
54
- "aria-labelledby": h ? v : void 0,
55
- "aria-label": h ? void 0 : y,
59
+ className: C(),
60
+ "aria-labelledby": _ ? b : void 0,
61
+ "aria-label": _ ? void 0 : x,
56
62
  "data-unity-component": "card",
57
- "data-unity-variant": b ? "shadow" : void 0,
58
- children: l
63
+ "data-unity-variant": S ? "shadow" : void 0,
64
+ children: u
59
65
  })
60
66
  });
61
67
  });
@@ -48,8 +48,5 @@ export interface CardTitleProps extends PropsWithChildren {
48
48
  * - Use `isHidden` to hide the title visually while keeping it accessible
49
49
  * - The default heading level is 3, but you can configure it based on your page structure
50
50
  */
51
- declare function CardTitle({ children, level, isHidden }: CardTitleProps): import('react/jsx-runtime').JSX.Element;
52
- declare namespace CardTitle {
53
- var displayName: string;
54
- }
51
+ declare const CardTitle: import('react').ForwardRefExoticComponent<CardTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
55
52
  export { CardTitle };
@@ -1,26 +1,27 @@
1
1
  import { useCardContext as e } from "../Card.context.js";
2
- import { uyTv as t } from "@payfit/unity-themes";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { Heading as r } from "react-aria-components/Heading";
2
+ import { forwardRef as t } from "react";
3
+ import { uyTv as n } from "@payfit/unity-themes";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { Heading as i } from "react-aria-components/Heading";
5
6
  //#region src/core/components/card/parts/CardTitle.tsx
6
- var i = t({
7
+ var a = n({
7
8
  base: ["uy:typography-h3 uy:text-content-neutral uy:leading-none"],
8
9
  variants: { isHidden: {
9
10
  true: "uy:sr-only",
10
11
  false: ""
11
12
  } },
12
13
  defaultVariants: { isHidden: !1 }
13
- });
14
- function a({ children: t, level: a = 3, isHidden: o = !1 }) {
15
- let { titleId: s } = e();
16
- return /* @__PURE__ */ n(r, {
17
- level: a,
18
- id: s,
19
- className: i({ isHidden: o }),
14
+ }), o = t(({ children: t, level: n = 3, isHidden: o = !1 }, s) => {
15
+ let { titleId: c } = e();
16
+ return /* @__PURE__ */ r(i, {
17
+ ref: s,
18
+ level: n,
19
+ id: c,
20
+ className: a({ isHidden: o }),
20
21
  "data-unity-slot": "card.title",
21
22
  children: t
22
23
  });
23
- }
24
- a.displayName = "CardTitle";
24
+ });
25
+ o.displayName = "CardTitle";
25
26
  //#endregion
26
- export { a as CardTitle };
27
+ export { o as CardTitle };
@@ -7,11 +7,15 @@ export interface DefinitionListContextValue {
7
7
  * La disposition des éléments de la liste.
8
8
  */
9
9
  layout: 'horizontal' | 'vertical';
10
+ /** The visual treatment for DefinitionItem rows. */
11
+ variant: 'default' | 'divided';
12
+ /** The row density. */
13
+ density: 'default' | 'padded';
10
14
  }
11
15
  /**
12
16
  * Fournisseur de contexte pour la DefinitionList.
13
17
  */
14
- export declare const DefinitionListContextProvider: ({ children, layout, }: PropsWithChildren<DefinitionListContextValue>) => import('react/jsx-runtime').JSX.Element;
18
+ export declare const DefinitionListContextProvider: ({ children, layout, variant, density, }: PropsWithChildren<DefinitionListContextValue>) => import('react/jsx-runtime').JSX.Element;
15
19
  /**
16
20
  * Hook pour accéder au contexte de la DefinitionList.
17
21
  * Doit être utilisé à l'intérieur d'un composant DefinitionList.
@@ -1,8 +1,12 @@
1
1
  import { createContext as e, useContext as t } from "react";
2
2
  import { jsx as n } from "react/jsx-runtime";
3
3
  //#region src/core/components/definition-list/DefinitionList.context.tsx
4
- var r = e(void 0), i = ({ children: e, layout: t }) => /* @__PURE__ */ n(r.Provider, {
5
- value: { layout: t },
4
+ var r = e(void 0), i = ({ children: e, layout: t, variant: i, density: a }) => /* @__PURE__ */ n(r.Provider, {
5
+ value: {
6
+ layout: t,
7
+ variant: i,
8
+ density: a
9
+ },
6
10
  children: e
7
11
  }), a = () => {
8
12
  let e = t(r);
@@ -1,12 +1,22 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { DefinitionListContextValue } from './DefinitionList.context.js';
3
3
  import * as React from 'react';
4
- export interface DefinitionListProps {
4
+ export interface DefinitionListProps extends Omit<ComponentPropsWithoutRef<'dl'>, 'children'> {
5
5
  /**
6
6
  * The layout of the definition list.
7
7
  * @default 'horizontal'
8
8
  */
9
9
  layout?: DefinitionListContextValue['layout'];
10
+ /**
11
+ * Selects the visual treatment for definition rows.
12
+ * @default 'default'
13
+ */
14
+ variant?: DefinitionListContextValue['variant'];
15
+ /**
16
+ * Controls the row padding.
17
+ * @default 'default'
18
+ */
19
+ density?: DefinitionListContextValue['density'];
10
20
  /**
11
21
  * The content of the definition list, typically DefinitionItem components.
12
22
  */
@@ -1,24 +1,42 @@
1
1
  import { DefinitionListContextProvider as e } from "./DefinitionList.context.js";
2
2
  import * as t from "react";
3
- import { uyTv as n } from "@payfit/unity-themes";
4
- import { jsx as r } from "react/jsx-runtime";
3
+ import { uyMerge as n, uyTv as r } from "@payfit/unity-themes";
4
+ import { jsx as i } from "react/jsx-runtime";
5
5
  //#region src/core/components/definition-list/DefinitionList.tsx
6
- var i = n({
7
- base: "uy:flex uy:flex-col",
8
- variants: { layout: {
9
- horizontal: ["uy:gap-y-100", "uy:grid uy:grid-cols-[auto_1fr] uy:gap-x-1000"],
10
- vertical: "uy:gap-200"
11
- } },
6
+ var a = r({
7
+ base: "uy:grid",
8
+ variants: {
9
+ layout: {
10
+ horizontal: ["uy:gap-y-100", "uy:grid uy:grid-cols-[auto_1fr] uy:gap-x-1000"],
11
+ vertical: "uy:gap-200"
12
+ },
13
+ variant: {
14
+ default: {},
15
+ divided: {}
16
+ }
17
+ },
18
+ compoundVariants: [{
19
+ layout: "horizontal",
20
+ variant: "divided",
21
+ class: ["uy:gap-0", "uy:[&>[data-unity-slot=\"definition-list.item\"]:last-child]:border-b-0"]
22
+ }],
12
23
  defaultVariants: { layout: "horizontal" }
13
- }), a = t.forwardRef(({ layout: t = "vertical", children: n, ...a }, o) => /* @__PURE__ */ r(e, {
24
+ }), o = t.forwardRef(({ layout: t = "vertical", variant: r = "default", density: o = "default", children: s, className: c, ...l }, u) => /* @__PURE__ */ i(e, {
14
25
  layout: t,
15
- children: /* @__PURE__ */ r("dl", {
16
- ref: o,
17
- className: i({ layout: t }),
18
- ...a,
19
- children: n
26
+ variant: r,
27
+ density: o,
28
+ children: /* @__PURE__ */ i("dl", {
29
+ ref: u,
30
+ className: n(a({
31
+ layout: t,
32
+ variant: r
33
+ }), c),
34
+ "data-unity-variant": r,
35
+ "data-unity-density": o,
36
+ ...l,
37
+ children: s
20
38
  })
21
39
  }));
22
- a.displayName = "DefinitionList";
40
+ o.displayName = "DefinitionList";
23
41
  //#endregion
24
- export { a as DefinitionList };
42
+ export { o as DefinitionList };
@@ -1,45 +1,80 @@
1
- import { Text as e } from "../../text/Text.js";
2
- import { useDefinitionListContext as t } from "../DefinitionList.context.js";
1
+ import { useDefinitionListContext as e } from "../DefinitionList.context.js";
2
+ import * as t from "react";
3
3
  import { forwardRef as n } from "react";
4
4
  import { uyTv as r } from "@payfit/unity-themes";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region src/core/components/definition-list/parts/DefinitionItem.tsx
7
7
  var o = r({
8
8
  slots: {
9
- base: "uy:flex",
10
- term: "uy:items-center uy:flex uy:gap-25",
11
- description: "uy:flex-1 uy:typography-body"
9
+ base: "uy:grid",
10
+ term: "uy:grid uy:grid-flow-col uy:auto-cols-max uy:items-center uy:gap-25",
11
+ description: "uy:typography-body"
12
12
  },
13
13
  variants: {
14
14
  layout: {
15
15
  horizontal: { base: ["uy:grid uy:grid-cols-subgrid uy:col-span-2"] },
16
- vertical: { base: "uy:flex-col uy:gap-25" }
16
+ vertical: { base: "uy:grid-cols-1 uy:gap-25" }
17
+ },
18
+ variant: {
19
+ default: { term: "uy:typography-body-strong" },
20
+ divided: {
21
+ base: "uy:border-b uy:border-solid uy:border-border-neutral",
22
+ term: "uy:typography-body-strong"
23
+ }
24
+ },
25
+ density: {
26
+ default: {},
27
+ padded: { base: "uy:py-100" }
28
+ },
29
+ isRichDescription: {
30
+ true: { description: "uy:!leading-none" },
31
+ false: {}
17
32
  },
18
33
  verticalAlign: {
19
34
  start: { base: "uy:items-start" },
20
- center: { base: "uy:items-center" }
35
+ center: { base: "uy:items-center" },
36
+ end: { base: "uy:items-end" }
21
37
  }
22
38
  },
39
+ compoundVariants: [{
40
+ layout: "horizontal",
41
+ variant: "divided",
42
+ density: "default",
43
+ class: {
44
+ base: "uy:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] uy:gap-x-300",
45
+ description: "uy:justify-self-end uy:text-right uy:typography-body"
46
+ }
47
+ }, {
48
+ layout: "horizontal",
49
+ variant: "divided",
50
+ density: "padded",
51
+ class: {
52
+ base: "uy:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] uy:gap-x-300",
53
+ description: "uy:justify-self-end uy:text-right uy:typography-body"
54
+ }
55
+ }],
23
56
  defaultVariants: { layout: "horizontal" }
24
57
  }), s = n(({ term: n, termSuffix: r, description: s, verticalAlign: c, ...l }, u) => {
25
- let { layout: d } = t(), { base: f, term: p, description: m } = o({
58
+ let { layout: d, variant: f, density: p } = e(), { base: m, term: h, description: g } = o({
26
59
  layout: d,
60
+ variant: f,
61
+ density: p,
62
+ isRichDescription: t.isValidElement(s),
27
63
  verticalAlign: c
28
64
  });
29
65
  return /* @__PURE__ */ a("div", {
30
66
  ref: u,
31
- className: f(),
67
+ className: m(),
68
+ "data-unity-slot": "definition-list.item",
32
69
  ...l,
33
70
  children: [/* @__PURE__ */ a("dt", {
34
- className: p(),
35
- children: [/* @__PURE__ */ i(e, {
36
- variant: "bodyStrong",
37
- color: "inherit",
38
- asElement: "span",
71
+ className: h(),
72
+ children: [/* @__PURE__ */ i("span", {
73
+ "data-dd-privacy": "mask",
39
74
  children: n
40
75
  }), r]
41
76
  }), /* @__PURE__ */ i("dd", {
42
- className: m(),
77
+ className: g(),
43
78
  "data-dd-privacy": "mask",
44
79
  children: s
45
80
  })]
@@ -0,0 +1,15 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ export interface DefinitionListGroupProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
3
+ /** A visible label that identifies the related definition items. */
4
+ label: ReactNode;
5
+ /** DefinitionItem descendants that belong to this labelled group. */
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * Groups related definition items under a visible group term.
10
+ *
11
+ * DefinitionListGroup must be rendered inside DefinitionList. The group term
12
+ * and its nested definition list preserve the association between the group
13
+ * label and its definition items.
14
+ */
15
+ export declare const DefinitionListGroup: import('react').ForwardRefExoticComponent<DefinitionListGroupProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,41 @@
1
+ import { useDefinitionListContext as e } from "../DefinitionList.context.js";
2
+ import { forwardRef as t } from "react";
3
+ import { uyMerge as n, uyTv as r } from "@payfit/unity-themes";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/core/components/definition-list/parts/DefinitionListGroup.tsx
6
+ var o = r({
7
+ slots: {
8
+ base: "uy:mt-200 uy:flex uy:flex-col uy:gap-100 uy:first:mt-0",
9
+ label: "uy:typography-body-small uy:text-content-neutral-lowest",
10
+ items: ["uy:m-0 uy:px-100 uy:border uy:border-solid", "uy:border-border-neutral uy:rounded-100"],
11
+ list: ["uy:m-0 uy:flex uy:flex-col", "uy:[&>[data-unity-slot=\"definition-list.item\"]:last-child]:border-b-0"]
12
+ },
13
+ variants: { layout: {
14
+ horizontal: {
15
+ base: "uy:col-span-2",
16
+ list: "uy:grid uy:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]"
17
+ },
18
+ vertical: {}
19
+ } }
20
+ }), s = t(({ label: t, children: r, className: s, ...c }, l) => {
21
+ let { layout: u } = e(), { base: d, label: f, items: p, list: m } = o({ layout: u });
22
+ return /* @__PURE__ */ a("div", {
23
+ ref: l,
24
+ className: n(d(), s),
25
+ ...c,
26
+ children: [/* @__PURE__ */ i("dt", {
27
+ className: f(),
28
+ children: t
29
+ }), /* @__PURE__ */ i("dd", {
30
+ className: p(),
31
+ "data-unity-slot": "definition-list.group",
32
+ children: /* @__PURE__ */ i("dl", {
33
+ className: m(),
34
+ children: r
35
+ })
36
+ })]
37
+ });
38
+ });
39
+ s.displayName = "DefinitionListGroup";
40
+ //#endregion
41
+ export { s as DefinitionListGroup };
@@ -60,6 +60,7 @@ export * from './components/date-range-calendar/DateRangeCalendar.js';
60
60
  export * from './components/date-range-picker/DateRangePicker.js';
61
61
  export * from './components/definition-list/DefinitionList.js';
62
62
  export * from './components/definition-list/parts/DefinitionItem.js';
63
+ export * from './components/definition-list/parts/DefinitionListGroup.js';
63
64
  export * from './components/definition-tooltip/DefinitionTooltip.js';
64
65
  export * from './components/dialog/Dialog.js';
65
66
  export * from './components/dialog/parts/DialogActions.js';