@ogcio/design-system-react 1.20.0 → 1.21.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/card/card-legacy.d.ts +1 -1
- package/dist/card/card-legacy.js +12 -12
- package/dist/card/card-next.d.ts +2 -3
- package/dist/card/card-next.js +226 -61
- package/dist/card/card.js +17 -16
- package/dist/card/types.d.ts +20 -30
- package/dist/index.d.ts +1 -2
- package/dist/index.js +85 -80
- package/dist/input-radio/input-radio.d.ts +1 -1
- package/dist/input-radio/input-radio.js +39 -40
- package/dist/input-radio/types.d.ts +0 -1
- package/dist/input-radio/types.js +0 -1
- package/dist/radio/types.d.ts +0 -1
- package/dist/styles.css +1 -1
- package/dist/summary-list/index.d.ts +6 -0
- package/dist/summary-list/index.js +12 -0
- package/dist/summary-list/summary-list-action.d.ts +5 -0
- package/dist/summary-list/summary-list-action.js +18 -0
- package/dist/summary-list/summary-list-context.d.ts +2 -0
- package/dist/summary-list/summary-list-context.js +20 -0
- package/dist/summary-list/summary-list-header.d.ts +5 -0
- package/dist/summary-list/summary-list-header.js +68 -0
- package/dist/summary-list/summary-list-row.d.ts +6 -0
- package/dist/summary-list/summary-list-row.js +63 -0
- package/dist/summary-list/summary-list-value.d.ts +5 -0
- package/dist/summary-list/summary-list-value.js +17 -0
- package/dist/summary-list/summary-list.d.ts +2 -11
- package/dist/summary-list/summary-list.js +37 -43
- package/dist/summary-list/types.d.ts +15 -11
- package/dist/utilities.d.ts +3 -0
- package/dist/utilities.js +17 -7
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CardProps } from './types.js';
|
|
2
2
|
export declare const CardLegacy: {
|
|
3
|
-
({ type, title, inset, subTitle, media, content, action, href, tag,
|
|
3
|
+
({ type, title, inset, subTitle, media, content, action, href, tag, titleAsChild, children, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
package/dist/card/card-legacy.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Button as
|
|
2
|
+
import { Button as k } from "../button/button.js";
|
|
3
3
|
import { translate as c } from "../i18n/utility.js";
|
|
4
4
|
import { Link as u } from "../link/link.js";
|
|
5
|
-
import { CardNext as
|
|
5
|
+
import { CardNext as b, CardMedia as L, CardContainer as T, CardHeader as V, CardTitle as $, CardSubtitle as j, CardTag as A, CardDescription as B, CardAction as H } from "./card-next.js";
|
|
6
6
|
const N = ({
|
|
7
7
|
type: C = "vertical",
|
|
8
8
|
title: d,
|
|
9
|
-
inset:
|
|
10
|
-
subTitle:
|
|
9
|
+
inset: p = "none",
|
|
10
|
+
subTitle: t,
|
|
11
11
|
media: o,
|
|
12
12
|
content: m,
|
|
13
13
|
action: h,
|
|
14
14
|
href: n,
|
|
15
15
|
tag: l,
|
|
16
|
-
dataTestid: s,
|
|
17
16
|
titleAsChild: a,
|
|
18
|
-
children:
|
|
17
|
+
children: s,
|
|
18
|
+
...y
|
|
19
19
|
}) => {
|
|
20
20
|
const f = () => !d || !n && !a ? d || "" : /* @__PURE__ */ e(
|
|
21
21
|
u,
|
|
@@ -26,7 +26,7 @@ const N = ({
|
|
|
26
26
|
title: d,
|
|
27
27
|
defaultValue: `Card link: ${d}`
|
|
28
28
|
}),
|
|
29
|
-
children: a ?
|
|
29
|
+
children: a ? s : d
|
|
30
30
|
}
|
|
31
31
|
), x = (r) => r.type === "link" ? /* @__PURE__ */ e(
|
|
32
32
|
u,
|
|
@@ -39,7 +39,7 @@ const N = ({
|
|
|
39
39
|
children: r.children
|
|
40
40
|
}
|
|
41
41
|
) : /* @__PURE__ */ e(
|
|
42
|
-
|
|
42
|
+
k,
|
|
43
43
|
{
|
|
44
44
|
...r,
|
|
45
45
|
"aria-label": c("card.actionButton", {
|
|
@@ -49,12 +49,12 @@ const N = ({
|
|
|
49
49
|
children: r.children
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
return /* @__PURE__ */ i(
|
|
53
|
-
o && /* @__PURE__ */ e(
|
|
54
|
-
/* @__PURE__ */ i(
|
|
52
|
+
return /* @__PURE__ */ i(b, { inset: p, type: C, ...y, children: [
|
|
53
|
+
o && /* @__PURE__ */ e(L, { media: o, href: n }),
|
|
54
|
+
/* @__PURE__ */ i(T, { children: [
|
|
55
55
|
/* @__PURE__ */ i(V, { children: [
|
|
56
56
|
/* @__PURE__ */ e($, { children: f() }),
|
|
57
|
-
/* @__PURE__ */ e(j, { children:
|
|
57
|
+
t && /* @__PURE__ */ e(j, { children: t }),
|
|
58
58
|
l && /* @__PURE__ */ e(A, { text: l.text, type: l.type })
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ e(B, { children: m }),
|
package/dist/card/card-next.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Context, FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { CardDescriptionProps, CardContainerProps, CardActionProps, CardHeaderProps, CardMediaProps, CardNextProps, CardSubtitleProps, CardTitleProps } from './types.js';
|
|
2
|
+
import { CardDescriptionProps, CardContainerProps, CardActionProps, CardHeaderProps, CardMediaProps, CardNextProps, CardSubtitleProps, CardTitleProps, CardTagProps } from './types.js';
|
|
4
3
|
export declare function useRequiredContext(context: Context<boolean>, componentName: string, parentName: string): true;
|
|
5
4
|
export declare const CardNext: FC<CardNextProps>;
|
|
6
5
|
export declare const CardMedia: FC<CardMediaProps>;
|
|
7
6
|
export declare const CardContainer: FC<CardContainerProps>;
|
|
8
7
|
export declare const CardTitle: FC<CardTitleProps>;
|
|
9
8
|
export declare const CardSubtitle: FC<CardSubtitleProps>;
|
|
10
|
-
export declare const CardTag: FC<
|
|
9
|
+
export declare const CardTag: FC<CardTagProps>;
|
|
11
10
|
export declare const CardHeader: FC<CardHeaderProps>;
|
|
12
11
|
export declare const CardDescription: FC<CardDescriptionProps>;
|
|
13
12
|
export declare const CardAction: FC<CardActionProps>;
|
package/dist/card/card-next.js
CHANGED
|
@@ -1,85 +1,250 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "@ogcio/design-system-react/browser-check";
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { jsx as r, jsxs as A } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as y, useId as M, useContext as N, Children as P, isValidElement as B, useState as S, useMemo as q, useEffect as F, cloneElement as O } from "react";
|
|
5
|
+
import { cn as d } from "../cn.js";
|
|
6
|
+
import { useBreakpoint as G, Breakpoint as z } from "../hooks/use-breakpoint.js";
|
|
7
|
+
import { Icon as J } from "../icon/icon.js";
|
|
8
|
+
import { Paragraph as K } from "../paragraph/paragraph.js";
|
|
9
|
+
import { Tag as Q } from "../tag/tag.js";
|
|
10
|
+
import { isSpecialComponent as U, getSpecialComponentType as L } from "../utils/utilities.js";
|
|
11
|
+
const $ = (e) => e.ariaLabel ?? e.label ?? e.title ?? e.alt ?? "", E = y(!1), I = y(!1), w = y(!1), x = y(null);
|
|
12
|
+
function u(e, t, a) {
|
|
13
|
+
if (!N(e))
|
|
14
|
+
throw new Error(`${t} must be used inside <${a}>`);
|
|
12
15
|
return !0;
|
|
13
16
|
}
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const W = (e, t) => e === "full" ? { padding: t } : {}, X = (e, t, a) => {
|
|
18
|
+
if (e === "body")
|
|
19
|
+
return a === "horizontal" ? { paddingBlock: t, paddingRight: t } : { paddingInline: t, paddingBottom: t };
|
|
20
|
+
}, se = ({
|
|
21
|
+
inset: e = "none",
|
|
22
|
+
insetSpace: t = 16,
|
|
23
|
+
type: a = "vertical",
|
|
24
|
+
background: i = "white",
|
|
25
|
+
className: o,
|
|
26
|
+
role: n,
|
|
27
|
+
children: l,
|
|
28
|
+
...g
|
|
19
29
|
}) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
var D, H;
|
|
31
|
+
const { breakpoint: C } = G(), b = C === z.ExtraSmall || C === z.Small, [m, p] = S(a), [s, v] = S(), [f, k] = S([]), R = q(
|
|
32
|
+
() => ({
|
|
33
|
+
setLabelId: (c) => v(c),
|
|
34
|
+
addDescId: (c) => k(
|
|
35
|
+
(T) => T.includes(c) ? T : [...T, c]
|
|
36
|
+
),
|
|
37
|
+
labelId: s,
|
|
38
|
+
descIds: f
|
|
39
|
+
}),
|
|
40
|
+
[s, f]
|
|
41
|
+
), j = P.toArray(l), h = j.find(
|
|
42
|
+
(c) => L(c) === "CardContainer"
|
|
43
|
+
), V = j.find(
|
|
44
|
+
(c) => L(c) === "CardMedia"
|
|
45
|
+
);
|
|
46
|
+
return F(() => {
|
|
47
|
+
if (b || a === "vertical") {
|
|
48
|
+
p("vertical");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
p("horizontal");
|
|
52
|
+
}, [b]), /* @__PURE__ */ r(E.Provider, { value: !0, children: /* @__PURE__ */ r(x.Provider, { value: R, children: /* @__PURE__ */ A(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: d(
|
|
56
|
+
"gi-card gi-not-prose",
|
|
57
|
+
{
|
|
58
|
+
"gi-card-vertical": m === "vertical",
|
|
59
|
+
"gi-card-horizontal": m === "horizontal",
|
|
60
|
+
"gi-bg-white": i === "white",
|
|
61
|
+
"gi-bg-color-surface-system-neutral-layer1": i === "grey"
|
|
62
|
+
},
|
|
63
|
+
o
|
|
64
|
+
),
|
|
65
|
+
style: W(e, t),
|
|
66
|
+
role: n ?? "article",
|
|
67
|
+
"aria-labelledby": s,
|
|
68
|
+
"aria-describedby": f != null && f.length ? f.join(" ") : void 0,
|
|
69
|
+
...g,
|
|
70
|
+
children: [
|
|
71
|
+
V,
|
|
72
|
+
h ? O(h, {
|
|
73
|
+
className: d((D = h.props) == null ? void 0 : D.className),
|
|
74
|
+
style: {
|
|
75
|
+
...(H = h.props) == null ? void 0 : H.style,
|
|
76
|
+
...X(e, t, m)
|
|
77
|
+
}
|
|
78
|
+
}) : null
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
) }) });
|
|
82
|
+
}, Y = ({ media: e, href: t }) => {
|
|
83
|
+
if (u(E, "CardMedia", "Card"), !e)
|
|
27
84
|
return null;
|
|
28
85
|
switch (e.type) {
|
|
29
86
|
case "image": {
|
|
30
|
-
const { src:
|
|
31
|
-
return /* @__PURE__ */ r("div", { className: "gi-card-image", children: /* @__PURE__ */ r("a", { href:
|
|
87
|
+
const { src: a, alt: i, aspectRatio: o } = e.config ?? {}, n = $(e.config);
|
|
88
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-image", children: /* @__PURE__ */ r("a", { href: t, "aria-label": n, title: n, children: /* @__PURE__ */ r(
|
|
32
89
|
"img",
|
|
33
90
|
{
|
|
34
|
-
src:
|
|
35
|
-
alt:
|
|
36
|
-
style:
|
|
37
|
-
className:
|
|
91
|
+
src: a,
|
|
92
|
+
alt: i ?? "",
|
|
93
|
+
style: o ? { aspectRatio: o } : void 0,
|
|
94
|
+
className: o ? "gi-w-full" : void 0
|
|
38
95
|
}
|
|
39
96
|
) }) });
|
|
40
97
|
}
|
|
41
|
-
case "icon":
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
98
|
+
case "icon": {
|
|
99
|
+
const a = $(e.config);
|
|
100
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-icon", children: /* @__PURE__ */ r("a", { href: t, "aria-label": a, title: a, children: /* @__PURE__ */ r(J, { ...e.config, "aria-hidden": "true" }) }) });
|
|
101
|
+
}
|
|
102
|
+
case "iframe": {
|
|
103
|
+
const { title: a } = e.config ?? "Embedded content";
|
|
104
|
+
return /* @__PURE__ */ r("div", { className: "gi-card-iframe", children: /* @__PURE__ */ r("iframe", { ...e.config, title: a }) });
|
|
105
|
+
}
|
|
45
106
|
default:
|
|
46
107
|
return null;
|
|
47
108
|
}
|
|
48
|
-
}
|
|
109
|
+
};
|
|
110
|
+
Object.defineProperty(Y, "componentType", {
|
|
111
|
+
value: "CardMedia",
|
|
112
|
+
writable: !1,
|
|
113
|
+
enumerable: !1
|
|
114
|
+
});
|
|
115
|
+
const Z = ({
|
|
116
|
+
children: e,
|
|
117
|
+
className: t,
|
|
118
|
+
...a
|
|
119
|
+
}) => (u(E, "CardContainer", "Card"), /* @__PURE__ */ r(w.Provider, { value: !0, children: /* @__PURE__ */ r("div", { className: d("gi-card-content", t), ...a, children: e }) }));
|
|
120
|
+
Object.defineProperty(Z, "componentType", {
|
|
121
|
+
value: "CardContainer",
|
|
122
|
+
writable: !1,
|
|
123
|
+
enumerable: !1
|
|
124
|
+
});
|
|
125
|
+
const ce = ({
|
|
49
126
|
children: e,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
127
|
+
className: t,
|
|
128
|
+
truncate: a,
|
|
129
|
+
id: i,
|
|
130
|
+
["aria-level"]: o = 2,
|
|
131
|
+
...n
|
|
132
|
+
}) => {
|
|
133
|
+
u(I, "CardTitle", "CardHeader");
|
|
134
|
+
const l = typeof e == "string", g = (s) => {
|
|
135
|
+
var v;
|
|
136
|
+
return a && B(s) ? O(s, {
|
|
137
|
+
className: d((v = s.props) == null ? void 0 : v.className, "gi-card-truncate-text")
|
|
138
|
+
}) : s;
|
|
139
|
+
}, C = a && !l ? P.map(e, g) : e, b = M(), m = i ?? `card-title-${b}`, p = N(x);
|
|
140
|
+
return p && p.setLabelId(m), /* @__PURE__ */ r(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
className: d(
|
|
144
|
+
"gi-card-title",
|
|
145
|
+
{
|
|
146
|
+
"gi-card-truncate-text": !!a && l
|
|
147
|
+
},
|
|
148
|
+
t
|
|
149
|
+
),
|
|
150
|
+
id: m,
|
|
151
|
+
role: "heading",
|
|
152
|
+
"aria-level": o,
|
|
153
|
+
title: l && a ? e.toString() : void 0,
|
|
154
|
+
...n,
|
|
155
|
+
children: C
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}, ue = ({
|
|
159
|
+
children: e,
|
|
160
|
+
className: t,
|
|
161
|
+
truncate: a,
|
|
162
|
+
id: i,
|
|
163
|
+
...o
|
|
164
|
+
}) => {
|
|
165
|
+
u(I, "CardSubtitle", "CardHeader");
|
|
166
|
+
const n = typeof e == "string" && a ? e : void 0, l = M(), g = i ?? `card-subtitle-${l}`, C = N(x);
|
|
167
|
+
return C && C.addDescId(g), /* @__PURE__ */ r(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
className: d(
|
|
171
|
+
"gi-card-subheading",
|
|
172
|
+
{
|
|
173
|
+
"gi-card-truncate-text": a
|
|
174
|
+
},
|
|
175
|
+
t
|
|
176
|
+
),
|
|
177
|
+
id: g,
|
|
178
|
+
title: n,
|
|
179
|
+
...o,
|
|
180
|
+
children: e
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}, _ = ({
|
|
184
|
+
text: e,
|
|
185
|
+
type: t,
|
|
186
|
+
className: a,
|
|
187
|
+
...i
|
|
188
|
+
}) => (u(I, "CardTag", "CardHeader"), /* @__PURE__ */ r(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
role: "note",
|
|
192
|
+
"aria-label": typeof e == "string" ? e : void 0,
|
|
193
|
+
className: d("gi-card-tag", a),
|
|
194
|
+
...i,
|
|
195
|
+
children: /* @__PURE__ */ r(Q, { text: e, type: t })
|
|
196
|
+
}
|
|
197
|
+
));
|
|
198
|
+
Object.defineProperty(_, "componentType", {
|
|
53
199
|
value: "CardTag",
|
|
54
200
|
writable: !1,
|
|
55
201
|
enumerable: !1
|
|
56
202
|
});
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
203
|
+
const Ce = ({
|
|
204
|
+
children: e,
|
|
205
|
+
className: t,
|
|
206
|
+
...a
|
|
207
|
+
}) => {
|
|
208
|
+
u(w, "CardHeader", "CardContainer");
|
|
209
|
+
const i = [], o = [];
|
|
210
|
+
return P.forEach(e, (n) => {
|
|
211
|
+
B(n) && (U(n, ["CardTag"]) ? o.push(n) : i.push(n));
|
|
212
|
+
}), /* @__PURE__ */ r(I.Provider, { value: !0, children: /* @__PURE__ */ A("div", { className: d("gi-card-header", t), role: "group", ...a, children: [
|
|
213
|
+
/* @__PURE__ */ r("div", { className: "gi-card-heading", children: i }),
|
|
214
|
+
o
|
|
68
215
|
] }) });
|
|
69
|
-
},
|
|
70
|
-
children: e
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
216
|
+
}, ge = ({
|
|
217
|
+
children: e,
|
|
218
|
+
className: t,
|
|
219
|
+
id: a,
|
|
220
|
+
...i
|
|
221
|
+
}) => {
|
|
222
|
+
if (u(w, "CardDescription", "CardContainer"), !e)
|
|
223
|
+
return null;
|
|
224
|
+
const o = M(), n = a ?? `card-desc-${o}`, l = N(x);
|
|
225
|
+
return l && l.addDescId(n), /* @__PURE__ */ r("div", { className: d("gi-card-paragraph", t), id: n, ...i, children: /* @__PURE__ */ r(K, { size: "sm", children: e }) });
|
|
226
|
+
}, me = ({
|
|
227
|
+
children: e,
|
|
228
|
+
className: t,
|
|
229
|
+
...a
|
|
230
|
+
}) => (u(w, "CardAction", "CardContainer"), /* @__PURE__ */ r(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
className: d("gi-card-action", t),
|
|
234
|
+
role: "group",
|
|
235
|
+
...a,
|
|
236
|
+
children: e
|
|
237
|
+
}
|
|
238
|
+
));
|
|
74
239
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
240
|
+
me as CardAction,
|
|
241
|
+
Z as CardContainer,
|
|
242
|
+
ge as CardDescription,
|
|
243
|
+
Ce as CardHeader,
|
|
244
|
+
Y as CardMedia,
|
|
245
|
+
se as CardNext,
|
|
246
|
+
ue as CardSubtitle,
|
|
247
|
+
_ as CardTag,
|
|
248
|
+
ce as CardTitle,
|
|
249
|
+
u as useRequiredContext
|
|
85
250
|
};
|
package/dist/card/card.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import "@ogcio/design-system-react/browser-check";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { CardLegacy as m } from "./card-legacy.js";
|
|
5
|
+
import { CardNext as g } from "./card-next.js";
|
|
6
|
+
const n = [
|
|
5
7
|
"title",
|
|
6
8
|
"subTitle",
|
|
7
9
|
"href",
|
|
@@ -10,17 +12,16 @@ const r = [
|
|
|
10
12
|
"content",
|
|
11
13
|
"action",
|
|
12
14
|
"titleAsChild"
|
|
13
|
-
],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
);
|
|
15
|
+
], u = (e) => {
|
|
16
|
+
if (n.some((t) => t in e))
|
|
17
|
+
return console.warn(
|
|
18
|
+
"[Card] Using legacy props. Please migrate to the new composable API."
|
|
19
|
+
), /* @__PURE__ */ r(m, { ...e });
|
|
20
|
+
const { inset: o, background: s, type: c, children: i, ...a } = e, d = new Set(n), l = Object.fromEntries(
|
|
21
|
+
Object.entries(a).filter(([t]) => !d.has(t))
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ r(g, { inset: o, type: c, background: s, ...l, children: i });
|
|
24
|
+
};
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
u as Card
|
|
26
27
|
};
|
package/dist/card/types.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { Button } from '../button/button.js';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
3
2
|
import { ButtonProps } from '../button/types.js';
|
|
4
3
|
import { IconProps } from '../icon/icon.js';
|
|
5
|
-
import {
|
|
4
|
+
import { LinkProps } from '../link/link.js';
|
|
6
5
|
import { TagProps } from '../tag/tag.js';
|
|
7
|
-
import {
|
|
6
|
+
import { CardContainer, CardMedia } from './card-next.js';
|
|
8
7
|
type CardNextChild = ReactElement<typeof CardMedia> | ReactElement<typeof CardContainer> | ReactElement | undefined | null;
|
|
9
|
-
type CardContainerChild = ReactElement<typeof CardHeader> | ReactElement<typeof CardDescription> | ReactElement<typeof CardAction> | undefined;
|
|
10
|
-
type CardHeaderChild = ReactElement<typeof CardTitle> | ReactElement<typeof CardSubtitle> | ReactElement<typeof CardTag> | undefined;
|
|
11
|
-
type CardActionChild = ReactElement<typeof Button> | ReactElement<typeof Link>;
|
|
12
|
-
type CardTitleChild = ReactElement<typeof Link> | string;
|
|
13
8
|
type InsetProps = 'body' | 'full' | 'none';
|
|
14
9
|
type TypeProps = 'vertical' | 'horizontal';
|
|
15
10
|
export type Action = (ButtonProps & {
|
|
@@ -38,11 +33,11 @@ export type MediaContent = {
|
|
|
38
33
|
type: 'iframe';
|
|
39
34
|
config: IframePropTypes;
|
|
40
35
|
};
|
|
41
|
-
export type CardProps = {
|
|
36
|
+
export type CardProps = ComponentPropsWithoutRef<'div'> & {
|
|
42
37
|
type?: TypeProps;
|
|
43
38
|
inset?: InsetProps;
|
|
39
|
+
background?: 'grey' | 'white';
|
|
44
40
|
children?: CardNextChild | CardNextChild[] | null;
|
|
45
|
-
dataTestid?: string;
|
|
46
41
|
/** @deprecated Use <CardTitle> instead */
|
|
47
42
|
title?: string;
|
|
48
43
|
/** @deprecated Use <CardTitle subtitle=""> instead */
|
|
@@ -60,33 +55,28 @@ export type CardProps = {
|
|
|
60
55
|
/** @deprecated Use <CardTitle> */
|
|
61
56
|
titleAsChild?: boolean;
|
|
62
57
|
};
|
|
63
|
-
export type CardContainerProps =
|
|
64
|
-
|
|
65
|
-
inset?: InsetProps;
|
|
66
|
-
};
|
|
67
|
-
export type CardDescriptionProps = {
|
|
58
|
+
export type CardContainerProps = ComponentPropsWithoutRef<'div'>;
|
|
59
|
+
export type CardDescriptionProps = ComponentPropsWithoutRef<'div'> & {
|
|
68
60
|
children?: string;
|
|
69
61
|
};
|
|
70
|
-
export type CardActionProps =
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
export type CardNextProps = {
|
|
74
|
-
children: CardNextChild | CardNextChild[];
|
|
62
|
+
export type CardActionProps = ComponentPropsWithoutRef<'div'>;
|
|
63
|
+
export type CardNextProps = ComponentPropsWithoutRef<'div'> & {
|
|
75
64
|
inset?: InsetProps;
|
|
65
|
+
insetSpace?: number;
|
|
76
66
|
type?: TypeProps;
|
|
77
|
-
|
|
67
|
+
background?: 'grey' | 'white';
|
|
78
68
|
};
|
|
79
|
-
export type CardHeaderProps =
|
|
80
|
-
|
|
69
|
+
export type CardHeaderProps = ComponentPropsWithoutRef<'div'>;
|
|
70
|
+
export type CardTitleProps = ComponentPropsWithoutRef<'div'> & {
|
|
71
|
+
truncate?: boolean;
|
|
81
72
|
};
|
|
82
|
-
export type
|
|
83
|
-
children:
|
|
73
|
+
export type CardSubtitleProps = ComponentPropsWithoutRef<'div'> & {
|
|
74
|
+
children: string;
|
|
75
|
+
truncate?: boolean;
|
|
84
76
|
};
|
|
85
|
-
export type
|
|
86
|
-
children?: string;
|
|
87
|
-
};
|
|
88
|
-
export type CardMediaProps = {
|
|
77
|
+
export type CardMediaProps = Omit<ComponentPropsWithoutRef<'div'> & {
|
|
89
78
|
media: MediaContent;
|
|
90
79
|
href?: string;
|
|
91
|
-
}
|
|
80
|
+
}, 'children'>;
|
|
81
|
+
export type CardTagProps = Omit<ComponentPropsWithoutRef<'div'> & TagProps, 'children'>;
|
|
92
82
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -83,8 +83,7 @@ export type { SideNavItemProps, SideNavProps } from './side-nav/types.js';
|
|
|
83
83
|
export { Spinner, type SpinnerProps } from './spinner/spinner.js';
|
|
84
84
|
export { Stack } from './stack/stack.js';
|
|
85
85
|
export { type StackProps } from './stack/types.js';
|
|
86
|
-
export
|
|
87
|
-
export type { SummaryListActionProps, SummaryListProps, SummaryListRowProps, SummaryListValueProps, } from './summary-list/types.js';
|
|
86
|
+
export * from './summary-list/index.js';
|
|
88
87
|
export { Caption, type CaptionProps } from './table/caption.js';
|
|
89
88
|
export { ColumnGroup } from './table/column-group.js';
|
|
90
89
|
export { Column } from './table/column.js';
|