@tedi-design-system/react 19.1.0-rc.10 → 19.1.0-rc.12
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/bundle-stats.html +1 -1
- package/component.manifest.json +9 -0
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/content/card/card.d.ts +4 -0
- package/src/tedi/components/content/carousel/carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/carousel.d.ts +5 -0
- package/src/tedi/components/content/carousel/carousel.es.js +20 -20
- package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/use-carousel.d.ts +1 -1
- package/src/tedi/components/content/carousel/use-carousel.es.js +127 -127
- package/src/tedi/components/content/table-card/index.d.ts +1 -0
- package/src/tedi/components/content/table-card/table-card.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.d.ts +131 -0
- package/src/tedi/components/content/table-card/table-card.es.js +206 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.es.js +18 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.d.ts +42 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.es.js +41 -23
- package/src/tedi/components/content/text-group/text-group.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.d.ts +10 -0
- package/src/tedi/components/content/text-group/text-group.es.js +14 -13
- package/src/tedi/components/content/text-group/text-group.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.module.scss.es.js +5 -1
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +181 -176
- package/src/tedi/index.d.ts +1 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +9 -2
- package/src/tedi/providers/label-provider/labels-map.es.js +7 -0
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +102 -100
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BreakpointSupport } from '../../../helpers';
|
|
3
|
+
import { TextModifiers } from '../../base/typography/text/text';
|
|
4
|
+
import { CardContentPadding } from '../card/card';
|
|
5
|
+
type TableCardAlign = 'left' | 'right';
|
|
6
|
+
export interface TableCardRow {
|
|
7
|
+
/** Row label (usually the column header). Strings are wrapped in a `<Label>`; nodes render as-is. */
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
/** Row value — text, a `StatusBadge`, a link, etc. */
|
|
10
|
+
value: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Show the value in bold.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
bold?: boolean;
|
|
16
|
+
/** In a multi-column body, span this row across N columns. Ignored when `columns` is 1. */
|
|
17
|
+
colSpan?: number;
|
|
18
|
+
}
|
|
19
|
+
type TableCardBreakpointProps = {
|
|
20
|
+
/**
|
|
21
|
+
* Row layout: `horizontal` (label beside value) or `vertical` (label above value).
|
|
22
|
+
* @default horizontal
|
|
23
|
+
*/
|
|
24
|
+
layout?: 'horizontal' | 'vertical';
|
|
25
|
+
/**
|
|
26
|
+
* Number of equal-width columns. Best with `layout="vertical"`.
|
|
27
|
+
* @default 1
|
|
28
|
+
*/
|
|
29
|
+
columns?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Label column width (horizontal layout); a `number` is pixels.
|
|
32
|
+
* @default 8.25rem horizontal, auto vertical
|
|
33
|
+
*/
|
|
34
|
+
labelWidth?: string | number;
|
|
35
|
+
/** Label text alignment. Defaults to `right` in horizontal layout, `left` otherwise. */
|
|
36
|
+
labelAlign?: TableCardAlign;
|
|
37
|
+
/** Value text alignment. Defaults to `right` in horizontal layout, `left` otherwise. */
|
|
38
|
+
valueAlign?: TableCardAlign;
|
|
39
|
+
/**
|
|
40
|
+
* Vertical alignment of each label against its value (horizontal layout only).
|
|
41
|
+
* `'center'` keeps the label centred when a value is taller, e.g. a `StatusBadge`.
|
|
42
|
+
* @default start
|
|
43
|
+
*/
|
|
44
|
+
rowAlign?: 'start' | 'center';
|
|
45
|
+
/**
|
|
46
|
+
* Padding of the card body (the rows section). Accepts the same values as `Card.Content`:
|
|
47
|
+
* a number in rems, `{ vertical, horizontal }`, or `{ top, right, bottom, left }`.
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
padding?: CardContentPadding;
|
|
51
|
+
/**
|
|
52
|
+
* Vertical gap between rows in the body. A `number` is rems (matching `padding`); pass a
|
|
53
|
+
* string for any other CSS length.
|
|
54
|
+
* Defaults to the layout gutter in `vertical` layout and the list's compact spacing otherwise.
|
|
55
|
+
*/
|
|
56
|
+
rowGap?: string | number;
|
|
57
|
+
/** Class name for the root element. */
|
|
58
|
+
className?: string;
|
|
59
|
+
};
|
|
60
|
+
export interface TableCardProps extends BreakpointSupport<TableCardBreakpointProps> {
|
|
61
|
+
/** Label / value pairs (one per column) rendered as the card body - a single `<dl>`. */
|
|
62
|
+
rows: TableCardRow[];
|
|
63
|
+
/** Header title. Required for `collapsible`. */
|
|
64
|
+
title?: React.ReactNode;
|
|
65
|
+
/** Secondary line under the title. */
|
|
66
|
+
subtitle?: React.ReactNode;
|
|
67
|
+
/** Content rendered at the end of the header — a `StatusBadge`, a link, etc. */
|
|
68
|
+
endSlot?: React.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Heading tag for `title` (for the document outline). The title stays body-sized unless
|
|
71
|
+
* `titleModifiers` is set.
|
|
72
|
+
* @default h3
|
|
73
|
+
*/
|
|
74
|
+
titleElement?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
75
|
+
/** Visual size / weight of the title (`Text` modifiers), independent of `titleElement`. */
|
|
76
|
+
titleModifiers?: TextModifiers;
|
|
77
|
+
/**
|
|
78
|
+
* Make the header a toggle that shows / hides the body. Provide a `title` (or, failing that,
|
|
79
|
+
* `ariaLabel`) so the toggle has an accessible name.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
collapsible?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Initial open state (uncontrolled). Ignored when `open` is set.
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
defaultOpen?: boolean;
|
|
88
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
89
|
+
open?: boolean;
|
|
90
|
+
/** Called with the next open state when the header toggles. */
|
|
91
|
+
onOpenChange?: (open: boolean) => void;
|
|
92
|
+
/** Footer content (e.g. `Button`s), divided from the body. */
|
|
93
|
+
actions?: React.ReactNode;
|
|
94
|
+
/** Emphasised summary / total row after the body, on a muted background. */
|
|
95
|
+
summary?: {
|
|
96
|
+
label: React.ReactNode;
|
|
97
|
+
value: React.ReactNode;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Show a leading checkbox to select the row.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
selectable?: boolean;
|
|
104
|
+
/** Controlled selected state. Pair with `onSelectedChange`. */
|
|
105
|
+
selected?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Initial selected state in uncontrolled mode. Ignored when `selected` is provided.
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
defaultSelected?: boolean;
|
|
111
|
+
/** Called with the next selected state when the checkbox toggles. */
|
|
112
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Label text size — `small` uses the 14px label style, `default` the 16px body style.
|
|
115
|
+
* @default default
|
|
116
|
+
*/
|
|
117
|
+
labelSize?: 'small' | 'default';
|
|
118
|
+
/** Accessible name for the selection checkbox. Defaults to the `table-card.select-row` label. */
|
|
119
|
+
selectionLabel?: string;
|
|
120
|
+
/** Accessible name for the card region. */
|
|
121
|
+
ariaLabel?: string;
|
|
122
|
+
/** Root element id (also wires the collapsible ARIA). Auto-generated when omitted. */
|
|
123
|
+
id?: string;
|
|
124
|
+
/** Extra full-width body content after `rows` (e.g. child row-groups). Collapses with the body. */
|
|
125
|
+
children?: React.ReactNode;
|
|
126
|
+
}
|
|
127
|
+
export declare const TableCard: {
|
|
128
|
+
(props: TableCardProps): JSX.Element;
|
|
129
|
+
displayName: string;
|
|
130
|
+
};
|
|
131
|
+
export default TableCard;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsx as l, jsxs as d, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import c from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import L from "react";
|
|
4
|
+
import { Icon as ye } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { Text as b } from "../../base/typography/text/text.es.js";
|
|
6
|
+
import { Checkbox as Ae } from "../../form/checkbox/checkbox.es.js";
|
|
7
|
+
import { Card as u } from "../card/card.es.js";
|
|
8
|
+
import { Label as Ne } from "../label/label.es.js";
|
|
9
|
+
import { TextGroupList as D } from "../text-group/text-group-list/text-group-list.es.js";
|
|
10
|
+
import e from "./table-card.module.scss.es.js";
|
|
11
|
+
import { useBreakpointProps as Ce } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
12
|
+
import { useLabels as Le } from "../../../providers/label-provider/use-labels.es.js";
|
|
13
|
+
const xe = {
|
|
14
|
+
horizontal: {
|
|
15
|
+
labelAlign: "right",
|
|
16
|
+
valueAlign: "right",
|
|
17
|
+
labelWidth: "var(--text-group-label-width-sm)",
|
|
18
|
+
rowGap: "0"
|
|
19
|
+
},
|
|
20
|
+
vertical: { labelAlign: "left", valueAlign: "left", labelWidth: "auto", rowGap: "var(--layout-grid-gutters-16)" }
|
|
21
|
+
}, ze = (t) => t.bold ? /* @__PURE__ */ l(b, { element: "span", modifiers: "bold", children: t.value }) : t.value, Te = (t, S) => typeof t == "string" ? /* @__PURE__ */ l(Ne, { isSmall: S, children: t }) : t, Be = (t) => {
|
|
22
|
+
const { getCurrentBreakpointProps: S } = Ce(t.defaultServerBreakpoint), { getLabel: x } = Le(), {
|
|
23
|
+
rows: E,
|
|
24
|
+
title: o,
|
|
25
|
+
subtitle: i,
|
|
26
|
+
endSlot: p,
|
|
27
|
+
titleElement: z = "h3",
|
|
28
|
+
titleModifiers: m,
|
|
29
|
+
collapsible: n = !1,
|
|
30
|
+
defaultOpen: F = !0,
|
|
31
|
+
open: T,
|
|
32
|
+
onOpenChange: y,
|
|
33
|
+
actions: B,
|
|
34
|
+
summary: r,
|
|
35
|
+
selectable: _ = !1,
|
|
36
|
+
selected: k,
|
|
37
|
+
defaultSelected: U = !1,
|
|
38
|
+
onSelectedChange: A,
|
|
39
|
+
labelSize: V = "default",
|
|
40
|
+
selectionLabel: M = x("table-card.select-row"),
|
|
41
|
+
ariaLabel: N,
|
|
42
|
+
id: Y,
|
|
43
|
+
children: w,
|
|
44
|
+
layout: G = "horizontal",
|
|
45
|
+
columns: q = 1,
|
|
46
|
+
labelWidth: J,
|
|
47
|
+
labelAlign: K,
|
|
48
|
+
valueAlign: Q,
|
|
49
|
+
rowAlign: X = "start",
|
|
50
|
+
padding: Z = 1,
|
|
51
|
+
rowGap: C,
|
|
52
|
+
className: ee
|
|
53
|
+
} = S(t), le = G === "horizontal", f = xe[G], ae = K ?? f.labelAlign, te = Q ?? f.valueAlign, H = J ?? f.labelWidth, oe = typeof C == "number" ? `${C}rem` : C ?? f.rowGap, ie = L.useId(), v = Y ?? ie, W = `${v}-body`, [ne, re] = L.useState(F), I = T !== void 0, s = n ? I ? T : ne : !0, se = () => {
|
|
54
|
+
const a = !s;
|
|
55
|
+
I || re(a), y == null || y(a);
|
|
56
|
+
}, [de, ce] = L.useState(U), O = k !== void 0, be = O ? k : de, me = (a) => {
|
|
57
|
+
O || ce(a), A == null || A(a);
|
|
58
|
+
}, $ = z;
|
|
59
|
+
n && !o && !N && console.warn(
|
|
60
|
+
"TableCard: a `collapsible` card needs a `title` or `ariaLabel` so its toggle has an accessible name."
|
|
61
|
+
);
|
|
62
|
+
const pe = !!(_ || o || i || p || n), h = !!B, P = !!r, he = !!w, R = n ? s || h : _, ge = s && !R, ue = P || h || he, _e = h, g = _ && !n && !!o && !i, fe = E.map((a) => ({
|
|
63
|
+
label: Te(a.label, V === "small"),
|
|
64
|
+
value: ze(a),
|
|
65
|
+
...a.colSpan ? { colSpan: a.colSpan } : {}
|
|
66
|
+
})), j = _ ? /* @__PURE__ */ l(
|
|
67
|
+
Ae,
|
|
68
|
+
{
|
|
69
|
+
id: `${v}-select`,
|
|
70
|
+
name: `${v}-select`,
|
|
71
|
+
value: "selected",
|
|
72
|
+
label: g ? /* @__PURE__ */ l(
|
|
73
|
+
b,
|
|
74
|
+
{
|
|
75
|
+
element: "span",
|
|
76
|
+
color: "primary",
|
|
77
|
+
modifiers: m,
|
|
78
|
+
className: c(e["tedi-table-card__title"], {
|
|
79
|
+
[e["tedi-table-card__title--body"]]: !m
|
|
80
|
+
}),
|
|
81
|
+
children: o
|
|
82
|
+
}
|
|
83
|
+
) : M,
|
|
84
|
+
hideLabel: !g,
|
|
85
|
+
checked: be,
|
|
86
|
+
onChange: (a, ve) => me(ve)
|
|
87
|
+
}
|
|
88
|
+
) : null;
|
|
89
|
+
return /* @__PURE__ */ d(u, { padding: 0, className: c(e["tedi-table-card"], ee), "aria-label": N, id: v, children: [
|
|
90
|
+
pe && /* @__PURE__ */ d(
|
|
91
|
+
u.Content,
|
|
92
|
+
{
|
|
93
|
+
padding: ge ? { top: 1, right: 1, bottom: 0, left: 1 } : 1,
|
|
94
|
+
hasSeparator: R,
|
|
95
|
+
className: c(e["tedi-table-card__header"], {
|
|
96
|
+
[e["tedi-table-card__header--select-title"]]: g
|
|
97
|
+
}),
|
|
98
|
+
children: [
|
|
99
|
+
g ? /* @__PURE__ */ l($, { className: e["tedi-table-card__heading"], children: j }) : j,
|
|
100
|
+
n ? /* @__PURE__ */ l($, { className: e["tedi-table-card__heading"], children: /* @__PURE__ */ d(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
className: e["tedi-table-card__toggle"],
|
|
105
|
+
"aria-expanded": s,
|
|
106
|
+
"aria-controls": W,
|
|
107
|
+
"aria-label": o ? void 0 : N ?? x(s ? "close" : "open"),
|
|
108
|
+
onClick: se,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ d("span", { className: e["tedi-table-card__title-group"], children: [
|
|
111
|
+
o && /* @__PURE__ */ l(
|
|
112
|
+
b,
|
|
113
|
+
{
|
|
114
|
+
element: "span",
|
|
115
|
+
modifiers: m,
|
|
116
|
+
className: c(e["tedi-table-card__title"], {
|
|
117
|
+
[e["tedi-table-card__title--body"]]: !m
|
|
118
|
+
}),
|
|
119
|
+
children: o
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
i && /* @__PURE__ */ l(b, { element: "span", color: "secondary", modifiers: "small", children: i })
|
|
123
|
+
] }),
|
|
124
|
+
p && /* @__PURE__ */ l("span", { className: e["tedi-table-card__end-slot"], children: p }),
|
|
125
|
+
/* @__PURE__ */ l(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
className: c(e["tedi-table-card__chevron"], {
|
|
129
|
+
[e["tedi-table-card__chevron--open"]]: s
|
|
130
|
+
}),
|
|
131
|
+
children: /* @__PURE__ */ l(ye, { name: "expand_more", size: 24, color: "inherit" })
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
) }) : /* @__PURE__ */ d(Se, { children: [
|
|
137
|
+
(o || i) && !g && /* @__PURE__ */ d("span", { className: e["tedi-table-card__title-group"], children: [
|
|
138
|
+
o && /* @__PURE__ */ l(
|
|
139
|
+
b,
|
|
140
|
+
{
|
|
141
|
+
element: z,
|
|
142
|
+
modifiers: m,
|
|
143
|
+
className: c(e["tedi-table-card__title"], {
|
|
144
|
+
[e["tedi-table-card__title--body"]]: !m
|
|
145
|
+
}),
|
|
146
|
+
children: o
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
i && /* @__PURE__ */ l(b, { element: "span", color: "secondary", modifiers: "small", children: i })
|
|
150
|
+
] }),
|
|
151
|
+
p && /* @__PURE__ */ l("div", { className: e["tedi-table-card__end-slot"], children: p })
|
|
152
|
+
] })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ d(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
id: W,
|
|
160
|
+
hidden: n && !s,
|
|
161
|
+
className: c({ [e["tedi-table-card__body--has-footer"]]: h }),
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ l(u.Content, { padding: Z, hasSeparator: ue, children: /* @__PURE__ */ l(
|
|
164
|
+
D,
|
|
165
|
+
{
|
|
166
|
+
columns: q,
|
|
167
|
+
items: fe,
|
|
168
|
+
rowGap: oe,
|
|
169
|
+
...le ? {
|
|
170
|
+
type: "horizontal",
|
|
171
|
+
labelAlign: ae,
|
|
172
|
+
valueAlign: te,
|
|
173
|
+
labelWidth: H,
|
|
174
|
+
rowAlign: X
|
|
175
|
+
} : {
|
|
176
|
+
type: "vertical",
|
|
177
|
+
labelAlign: "left",
|
|
178
|
+
labelWidth: H
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
) }),
|
|
182
|
+
w,
|
|
183
|
+
P && /* @__PURE__ */ l(u.Content, { padding: 1, background: "tertiary", hasSeparator: _e, children: /* @__PURE__ */ l(
|
|
184
|
+
D,
|
|
185
|
+
{
|
|
186
|
+
type: "horizontal",
|
|
187
|
+
labelAlign: "left",
|
|
188
|
+
valueAlign: "right",
|
|
189
|
+
items: [
|
|
190
|
+
{
|
|
191
|
+
label: r == null ? void 0 : r.label,
|
|
192
|
+
value: /* @__PURE__ */ l(b, { element: "span", modifiers: "bold", children: r == null ? void 0 : r.value })
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
) })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
h && /* @__PURE__ */ l(u.Content, { padding: { vertical: 0.5, horizontal: 1 }, className: e["tedi-table-card__actions"], children: B })
|
|
201
|
+
] });
|
|
202
|
+
};
|
|
203
|
+
Be.displayName = "TableCard";
|
|
204
|
+
export {
|
|
205
|
+
Be as TableCard
|
|
206
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-table-card":"tedi-table-card-891665aa","tedi-table-card__body--has-footer":"tedi-table-card__body--has-footer-fdfe85e8","tedi-table-card__header":"tedi-table-card__header-5b99672d","tedi-table-card__header--select-title":"tedi-table-card__header--select-title-4c3092eb","tedi-table-card__heading":"tedi-table-card__heading-19e529e5","tedi-table-card__toggle":"tedi-table-card__toggle-967a66cb","tedi-table-card__chevron":"tedi-table-card__chevron-2771a16f","tedi-table-card__title-group":"tedi-table-card__title-group-5dba284a","tedi-table-card__title":"tedi-table-card__title-cdc97d8a","tedi-table-card__title--body":"tedi-table-card__title--body-d1a03544","tedi-table-card__chevron--open":"tedi-table-card__chevron--open-5ed89ee0","tedi-table-card__end-slot":"tedi-table-card__end-slot-1c4a8fc1","tedi-table-card__actions":"tedi-table-card__actions-66d83aef"};exports.default=e;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"tedi-table-card": "tedi-table-card-891665aa",
|
|
3
|
+
"tedi-table-card__body--has-footer": "tedi-table-card__body--has-footer-fdfe85e8",
|
|
4
|
+
"tedi-table-card__header": "tedi-table-card__header-5b99672d",
|
|
5
|
+
"tedi-table-card__header--select-title": "tedi-table-card__header--select-title-4c3092eb",
|
|
6
|
+
"tedi-table-card__heading": "tedi-table-card__heading-19e529e5",
|
|
7
|
+
"tedi-table-card__toggle": "tedi-table-card__toggle-967a66cb",
|
|
8
|
+
"tedi-table-card__chevron": "tedi-table-card__chevron-2771a16f",
|
|
9
|
+
"tedi-table-card__title-group": "tedi-table-card__title-group-5dba284a",
|
|
10
|
+
"tedi-table-card__title": "tedi-table-card__title-cdc97d8a",
|
|
11
|
+
"tedi-table-card__title--body": "tedi-table-card__title--body-d1a03544",
|
|
12
|
+
"tedi-table-card__chevron--open": "tedi-table-card__chevron--open-5ed89ee0",
|
|
13
|
+
"tedi-table-card__end-slot": "tedi-table-card__end-slot-1c4a8fc1",
|
|
14
|
+
"tedi-table-card__actions": "tedi-table-card__actions-66d83aef"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
e as default
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../../../../../external/classnames/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../../../../../external/classnames/index.cjs.js"),_=require("../../label/label.cjs.js"),t=require("../text-group.module.scss.cjs.js"),j=require("../../../../helpers/hooks/use-breakpoint-props.cjs.js"),A=e=>typeof e=="string"?r.jsx(_.Label,{children:e}):e,u=e=>typeof e=="number"?`${e}%`:e,d=e=>{const{getCurrentBreakpointProps:c}=j.useBreakpointProps(e.defaultServerBreakpoint),{items:p,labelWidth:g="auto",className:x,type:i="vertical",labelAlign:f="left",valueAlign:b="left",columns:o=1,rowGap:a,rowAlign:h="start"}=c(e),v=s.default(t.default["tedi-text-group"],t.default["tedi-text-group--list"],t.default[`tedi-text-group--${i}`],{[t.default["tedi-text-group--columns"]]:o>1},{[t.default["tedi-text-group--row-align-center"]]:i==="horizontal"&&h==="center"},x),y={"--label-width":u(g),...o>1?{"--tedi-text-group-columns":o}:{},...a!==void 0?{"--tedi-text-group-list-gap":typeof a=="number"?`${a}px`:a}:{}};return r.jsx("dl",{className:v,style:y,children:p.map((l,m)=>{const w=l.labelAlign??f,L=l.valueAlign??b,n={};l.labelWidth!==void 0&&(n["--label-width"]=u(l.labelWidth)),o>1&&l.colSpan&&l.colSpan>1&&(n.gridColumn=`span ${Math.min(l.colSpan,o)}`);const S=Object.keys(n).length>0;return r.jsxs("div",{className:t.default["tedi-text-group__row"],style:S?n:void 0,children:[r.jsx("dt",{className:s.default(t.default["tedi-text-group__label"],t.default[`tedi-text-group--align-${w}`]),children:A(l.label)}),r.jsx("dd",{className:s.default(t.default["tedi-text-group__value"],t.default[`tedi-text-group__value--align-${L}`]),children:l.value})]},m)})})};d.displayName="TextGroup.List";exports.TextGroupList=d;
|
|
@@ -11,12 +11,25 @@ type TextGroupListBreakpointProps = {
|
|
|
11
11
|
* @default left
|
|
12
12
|
*/
|
|
13
13
|
labelAlign?: TextAlign;
|
|
14
|
+
/**
|
|
15
|
+
* Alignment for the value text. `'right'` grows the value so it sits flush
|
|
16
|
+
* against the trailing edge (numeric / summary columns). Horizontal only.
|
|
17
|
+
* @default left
|
|
18
|
+
*/
|
|
19
|
+
valueAlign?: TextAlign;
|
|
14
20
|
/**
|
|
15
21
|
* Width for the label column (e.g., `'200px'`, `'30%'`, or a `number`
|
|
16
22
|
* interpreted as a percent).
|
|
17
23
|
* @default auto
|
|
18
24
|
*/
|
|
19
25
|
labelWidth?: string | number;
|
|
26
|
+
/**
|
|
27
|
+
* Vertical alignment of the label against its value within each row.
|
|
28
|
+
* `'center'` aligns them on the cross axis (useful when a value is taller,
|
|
29
|
+
* e.g. a `StatusBadge`). Horizontal layout only.
|
|
30
|
+
* @default 'start'
|
|
31
|
+
*/
|
|
32
|
+
rowAlign?: 'start' | 'center';
|
|
20
33
|
} | {
|
|
21
34
|
/**
|
|
22
35
|
* Type of text group layout.
|
|
@@ -28,6 +41,14 @@ type TextGroupListBreakpointProps = {
|
|
|
28
41
|
* @default left
|
|
29
42
|
*/
|
|
30
43
|
labelAlign?: 'left';
|
|
44
|
+
/**
|
|
45
|
+
* Value alignment is horizontal-only; not available in vertical layout.
|
|
46
|
+
*/
|
|
47
|
+
valueAlign?: never;
|
|
48
|
+
/**
|
|
49
|
+
* Row alignment is horizontal-only; not available in vertical layout.
|
|
50
|
+
*/
|
|
51
|
+
rowAlign?: never;
|
|
31
52
|
/**
|
|
32
53
|
* Width for the label column (e.g., `'200px'`, `'30%'`, or a `number`
|
|
33
54
|
* interpreted as a percent).
|
|
@@ -51,11 +72,21 @@ export interface TextGroupListItem {
|
|
|
51
72
|
* value when omitted.
|
|
52
73
|
*/
|
|
53
74
|
labelAlign?: TextAlign;
|
|
75
|
+
/**
|
|
76
|
+
* Per-row override of the list-level `valueAlign`. Falls back to the list's
|
|
77
|
+
* value when omitted.
|
|
78
|
+
*/
|
|
79
|
+
valueAlign?: TextAlign;
|
|
54
80
|
/**
|
|
55
81
|
* Per-row override of the list-level `labelWidth`. Falls back to the list's
|
|
56
82
|
* value when omitted.
|
|
57
83
|
*/
|
|
58
84
|
labelWidth?: string | number;
|
|
85
|
+
/**
|
|
86
|
+
* In a multi-column layout (`columns > 1`), span this row across N grid
|
|
87
|
+
* columns. Ignored in single-column layouts. Clamped to the column count.
|
|
88
|
+
*/
|
|
89
|
+
colSpan?: number;
|
|
59
90
|
}
|
|
60
91
|
export type TextGroupListProps = BreakpointSupport<TextGroupListBreakpointProps> & {
|
|
61
92
|
/**
|
|
@@ -64,6 +95,17 @@ export type TextGroupListProps = BreakpointSupport<TextGroupListBreakpointProps>
|
|
|
64
95
|
* `<TextGroup>`s would break.
|
|
65
96
|
*/
|
|
66
97
|
items: TextGroupListItem[];
|
|
98
|
+
/**
|
|
99
|
+
* Lay the pairs out in this many equal-width columns (CSS grid, filling
|
|
100
|
+
* left-to-right, top-to-bottom). `1` keeps the plain stacked list.
|
|
101
|
+
* @default 1
|
|
102
|
+
*/
|
|
103
|
+
columns?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Vertical gap between rows. Accepts any CSS length (a `number` is treated as
|
|
106
|
+
* pixels). Defaults to the component's compact spacing.
|
|
107
|
+
*/
|
|
108
|
+
rowGap?: string | number;
|
|
67
109
|
/**
|
|
68
110
|
* Additional class name(s) to apply to the root `<dl>` element.
|
|
69
111
|
*/
|
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Label as
|
|
1
|
+
import { jsx as s, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { Label as A } from "../../label/label.es.js";
|
|
4
4
|
import e from "../text-group.module.scss.es.js";
|
|
5
|
-
import { useBreakpointProps as
|
|
6
|
-
const
|
|
7
|
-
const { getCurrentBreakpointProps:
|
|
8
|
-
items:
|
|
9
|
-
labelWidth:
|
|
10
|
-
className:
|
|
11
|
-
type:
|
|
12
|
-
labelAlign:
|
|
13
|
-
|
|
5
|
+
import { useBreakpointProps as N } from "../../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
6
|
+
const S = (t) => typeof t == "string" ? /* @__PURE__ */ s(A, { children: t }) : t, p = (t) => typeof t == "number" ? `${t}%` : t, $ = (t) => {
|
|
7
|
+
const { getCurrentBreakpointProps: d } = N(t.defaultServerBreakpoint), {
|
|
8
|
+
items: c,
|
|
9
|
+
labelWidth: u = "auto",
|
|
10
|
+
className: g,
|
|
11
|
+
type: a = "vertical",
|
|
12
|
+
labelAlign: m = "left",
|
|
13
|
+
valueAlign: x = "left",
|
|
14
|
+
columns: o = 1,
|
|
15
|
+
rowGap: r,
|
|
16
|
+
rowAlign: h = "start"
|
|
17
|
+
} = d(t), b = n(
|
|
14
18
|
e["tedi-text-group"],
|
|
15
19
|
e["tedi-text-group--list"],
|
|
16
|
-
e[`tedi-text-group--${
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
e[`tedi-text-group--${a}`],
|
|
21
|
+
{ [e["tedi-text-group--columns"]]: o > 1 },
|
|
22
|
+
{ [e["tedi-text-group--row-align-center"]]: a === "horizontal" && h === "center" },
|
|
23
|
+
g
|
|
24
|
+
), f = {
|
|
25
|
+
"--label-width": p(u),
|
|
26
|
+
...o > 1 ? { "--tedi-text-group-columns": o } : {},
|
|
27
|
+
...r !== void 0 ? { "--tedi-text-group-list-gap": typeof r == "number" ? `${r}px` : r } : {}
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ s("dl", { className: b, style: f, children: c.map((l, v) => {
|
|
30
|
+
const y = l.labelAlign ?? m, w = l.valueAlign ?? x, i = {};
|
|
31
|
+
l.labelWidth !== void 0 && (i["--label-width"] = p(l.labelWidth)), o > 1 && l.colSpan && l.colSpan > 1 && (i.gridColumn = `span ${Math.min(l.colSpan, o)}`);
|
|
32
|
+
const L = Object.keys(i).length > 0;
|
|
33
|
+
return /* @__PURE__ */ _("div", { className: e["tedi-text-group__row"], style: L ? i : void 0, children: [
|
|
34
|
+
/* @__PURE__ */ s("dt", { className: n(e["tedi-text-group__label"], e[`tedi-text-group--align-${y}`]), children: S(l.label) }),
|
|
35
|
+
/* @__PURE__ */ s(
|
|
36
|
+
"dd",
|
|
37
|
+
{
|
|
38
|
+
className: n(e["tedi-text-group__value"], e[`tedi-text-group__value--align-${w}`]),
|
|
39
|
+
children: l.value
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] }, v);
|
|
25
43
|
}) });
|
|
26
44
|
};
|
|
27
|
-
|
|
45
|
+
$.displayName = "TextGroup.List";
|
|
28
46
|
export {
|
|
29
|
-
|
|
47
|
+
$ as TextGroupList
|
|
30
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("../../../../../external/classnames/index.cjs.js"),g=require("../label/label.cjs.js"),t=require("./text-group.module.scss.cjs.js"),b=require("./text-group-list/text-group-list.cjs.js"),m=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),v=e=>typeof e=="string"?r.jsx(g.Label,{children:e}):e,y=e=>typeof e=="number"?`${e}%`:e,u=e=>{const{getCurrentBreakpointProps:o}=m.useBreakpointProps(e.defaultServerBreakpoint),{label:s,value:a,labelWidth:i="auto",className:n,type:d="vertical",labelAlign:c="left",valueAlign:p="left"}=o(e),x=l.default(t.default["tedi-text-group"],t.default[`tedi-text-group--${d}`],n),f=y(i);return r.jsxs("dl",{className:x,style:{"--label-width":f},children:[r.jsx("dt",{className:l.default(t.default["tedi-text-group__label"],t.default[`tedi-text-group--align-${c}`]),children:v(s)}),r.jsx("dd",{className:l.default(t.default["tedi-text-group__value"],t.default[`tedi-text-group__value--align-${p}`]),children:a})]})};u.displayName="TextGroup";const G=Object.assign(u,{List:b.TextGroupList});exports.TextGroup=G;
|
|
@@ -11,6 +11,12 @@ type TextGroupBreakpointProps = {
|
|
|
11
11
|
* @default left
|
|
12
12
|
*/
|
|
13
13
|
labelAlign?: TextAlign;
|
|
14
|
+
/**
|
|
15
|
+
* Alignment for the value text. `'right'` grows the value so it sits flush
|
|
16
|
+
* against the trailing edge. Horizontal only.
|
|
17
|
+
* @default 'left'
|
|
18
|
+
*/
|
|
19
|
+
valueAlign?: TextAlign;
|
|
14
20
|
/**
|
|
15
21
|
* Width for the label (e.g., '200px', '30%', etc.)
|
|
16
22
|
* @default auto
|
|
@@ -26,6 +32,10 @@ type TextGroupBreakpointProps = {
|
|
|
26
32
|
* @default left
|
|
27
33
|
*/
|
|
28
34
|
labelAlign?: 'left';
|
|
35
|
+
/**
|
|
36
|
+
* Value alignment is horizontal-only; not available in vertical layout.
|
|
37
|
+
*/
|
|
38
|
+
valueAlign?: never;
|
|
29
39
|
/**
|
|
30
40
|
* Width for the label (e.g., '200px', '30%', etc.)
|
|
31
41
|
* @default auto
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import r from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { Label as f } from "../label/label.es.js";
|
|
4
4
|
import e from "./text-group.module.scss.es.js";
|
|
5
|
-
import { TextGroupList as
|
|
6
|
-
import { useBreakpointProps as
|
|
5
|
+
import { TextGroupList as b } from "./text-group-list/text-group-list.es.js";
|
|
6
|
+
import { useBreakpointProps as v } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
7
7
|
const y = (t) => typeof t == "string" ? /* @__PURE__ */ o(f, { children: t }) : t, h = (t) => typeof t == "number" ? `${t}%` : t, s = (t) => {
|
|
8
|
-
const { getCurrentBreakpointProps: l } =
|
|
8
|
+
const { getCurrentBreakpointProps: l } = v(t.defaultServerBreakpoint), {
|
|
9
9
|
label: a,
|
|
10
10
|
value: i,
|
|
11
11
|
labelWidth: n = "auto",
|
|
12
12
|
className: p,
|
|
13
|
-
type:
|
|
14
|
-
labelAlign:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ o("
|
|
13
|
+
type: u = "vertical",
|
|
14
|
+
labelAlign: c = "left",
|
|
15
|
+
valueAlign: d = "left"
|
|
16
|
+
} = l(t), m = r(e["tedi-text-group"], e[`tedi-text-group--${u}`], p), x = h(n);
|
|
17
|
+
return /* @__PURE__ */ g("dl", { className: m, style: { "--label-width": x }, children: [
|
|
18
|
+
/* @__PURE__ */ o("dt", { className: r(e["tedi-text-group__label"], e[`tedi-text-group--align-${c}`]), children: y(a) }),
|
|
19
|
+
/* @__PURE__ */ o("dd", { className: r(e["tedi-text-group__value"], e[`tedi-text-group__value--align-${d}`]), children: i })
|
|
19
20
|
] });
|
|
20
21
|
};
|
|
21
22
|
s.displayName = "TextGroup";
|
|
22
|
-
const
|
|
23
|
-
List:
|
|
23
|
+
const $ = Object.assign(s, {
|
|
24
|
+
List: b
|
|
24
25
|
});
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
$ as TextGroup
|
|
27
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-text-group":"tedi-text-group-be3b15d8","tedi-text-group--horizontal":"tedi-text-group--horizontal-9d91c910","tedi-text-group__label":"tedi-text-group__label-a8904597","tedi-text-group__value":"tedi-text-group__value-4bbf1a22","tedi-text-group--align-left":"tedi-text-group--align-left-cc82fd31","tedi-text-group--align-right":"tedi-text-group--align-right-0eebe973","tedi-text-group--list":"tedi-text-group--list-bd143f34","tedi-text-group__row":"tedi-text-group__row-fc6928bf"};exports.default=t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-text-group":"tedi-text-group-be3b15d8","tedi-text-group--horizontal":"tedi-text-group--horizontal-9d91c910","tedi-text-group__label":"tedi-text-group__label-a8904597","tedi-text-group__value":"tedi-text-group__value-4bbf1a22","tedi-text-group__value--align-right":"tedi-text-group__value--align-right-b93b121e","tedi-text-group__value--align-left":"tedi-text-group__value--align-left-ed3950e5","tedi-text-group--align-left":"tedi-text-group--align-left-cc82fd31","tedi-text-group--align-right":"tedi-text-group--align-right-0eebe973","tedi-text-group--list":"tedi-text-group--list-bd143f34","tedi-text-group--columns":"tedi-text-group--columns-d5214f99","tedi-text-group__row":"tedi-text-group__row-fc6928bf","tedi-text-group--row-align-center":"tedi-text-group--row-align-center-df365a32"};exports.default=t;
|
|
@@ -3,10 +3,14 @@ const t = {
|
|
|
3
3
|
"tedi-text-group--horizontal": "tedi-text-group--horizontal-9d91c910",
|
|
4
4
|
"tedi-text-group__label": "tedi-text-group__label-a8904597",
|
|
5
5
|
"tedi-text-group__value": "tedi-text-group__value-4bbf1a22",
|
|
6
|
+
"tedi-text-group__value--align-right": "tedi-text-group__value--align-right-b93b121e",
|
|
7
|
+
"tedi-text-group__value--align-left": "tedi-text-group__value--align-left-ed3950e5",
|
|
6
8
|
"tedi-text-group--align-left": "tedi-text-group--align-left-cc82fd31",
|
|
7
9
|
"tedi-text-group--align-right": "tedi-text-group--align-right-0eebe973",
|
|
8
10
|
"tedi-text-group--list": "tedi-text-group--list-bd143f34",
|
|
9
|
-
"tedi-text-
|
|
11
|
+
"tedi-text-group--columns": "tedi-text-group--columns-d5214f99",
|
|
12
|
+
"tedi-text-group__row": "tedi-text-group__row-fc6928bf",
|
|
13
|
+
"tedi-text-group--row-align-center": "tedi-text-group--row-align-center-df365a32"
|
|
10
14
|
};
|
|
11
15
|
export {
|
|
12
16
|
t as default
|