@financedistrict/apps-ui 0.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/LICENSE +19 -0
- package/README.md +119 -0
- package/dist/Radio-BYWz1n7p.d.cts +32 -0
- package/dist/Radio-BYWz1n7p.d.ts +32 -0
- package/dist/SelectTrigger-By0iPBI3.d.cts +78 -0
- package/dist/SelectTrigger-By0iPBI3.d.ts +78 -0
- package/dist/accordion.cjs +322 -0
- package/dist/accordion.d.cts +156 -0
- package/dist/accordion.d.ts +156 -0
- package/dist/accordion.js +2 -0
- package/dist/apps-ui.umd.js +1 -0
- package/dist/button.cjs +366 -0
- package/dist/button.d.cts +52 -0
- package/dist/button.d.ts +52 -0
- package/dist/button.js +3 -0
- package/dist/checkbox.cjs +74 -0
- package/dist/checkbox.d.cts +63 -0
- package/dist/checkbox.d.ts +63 -0
- package/dist/checkbox.js +2 -0
- package/dist/chunk-3RU7JMFE.js +27 -0
- package/dist/chunk-5TWRK4NW.js +783 -0
- package/dist/chunk-7EOSDFS3.js +9 -0
- package/dist/chunk-AIQ4UOGK.js +142 -0
- package/dist/chunk-B3MMGTPV.js +200 -0
- package/dist/chunk-DAHQYLUI.js +146 -0
- package/dist/chunk-DGBXADSS.js +1 -0
- package/dist/chunk-E6KPNTWW.js +295 -0
- package/dist/chunk-EOAB6G2D.js +149 -0
- package/dist/chunk-FAOVKDVM.js +32 -0
- package/dist/chunk-FV76Z4Z2.js +78 -0
- package/dist/chunk-GLTLBUZ7.js +285 -0
- package/dist/chunk-GTZFV43T.js +154 -0
- package/dist/chunk-HRGZNL4A.js +88 -0
- package/dist/chunk-IEVN3J2F.js +98 -0
- package/dist/chunk-IRS3T6LF.js +352 -0
- package/dist/chunk-IYYHCQXG.js +146 -0
- package/dist/chunk-JIXW3455.js +89 -0
- package/dist/chunk-N4VAP2GB.js +77 -0
- package/dist/chunk-SJ2ZRYVV.js +167 -0
- package/dist/chunk-SNU4YXOR.js +66 -0
- package/dist/chunk-TT6JQATV.js +99 -0
- package/dist/chunk-UPQ3ZPCO.js +66 -0
- package/dist/chunk-UVUSVFOH.js +264 -0
- package/dist/chunk-WJFPGGJB.js +255 -0
- package/dist/chunk-WXEBQA7A.js +371 -0
- package/dist/chunk-Y2O4YYZQ.js +184 -0
- package/dist/cut-corner.cjs +111 -0
- package/dist/cut-corner.d.cts +49 -0
- package/dist/cut-corner.d.ts +49 -0
- package/dist/cut-corner.js +1 -0
- package/dist/dialog.cjs +441 -0
- package/dist/dialog.d.cts +240 -0
- package/dist/dialog.d.ts +240 -0
- package/dist/dialog.js +3 -0
- package/dist/feature-card.cjs +182 -0
- package/dist/feature-card.d.cts +54 -0
- package/dist/feature-card.d.ts +54 -0
- package/dist/feature-card.js +2 -0
- package/dist/filter.cjs +873 -0
- package/dist/filter.d.cts +129 -0
- package/dist/filter.d.ts +129 -0
- package/dist/filter.js +6 -0
- package/dist/index.cjs +4583 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +27 -0
- package/dist/inline-select.cjs +856 -0
- package/dist/inline-select.d.cts +92 -0
- package/dist/inline-select.d.ts +92 -0
- package/dist/inline-select.js +6 -0
- package/dist/input.cjs +263 -0
- package/dist/input.d.cts +157 -0
- package/dist/input.d.ts +157 -0
- package/dist/input.js +4 -0
- package/dist/panel.cjs +185 -0
- package/dist/panel.d.cts +103 -0
- package/dist/panel.d.ts +103 -0
- package/dist/panel.js +2 -0
- package/dist/property-grid.cjs +110 -0
- package/dist/property-grid.d.cts +56 -0
- package/dist/property-grid.d.ts +56 -0
- package/dist/property-grid.js +2 -0
- package/dist/radio.cjs +74 -0
- package/dist/radio.d.cts +39 -0
- package/dist/radio.d.ts +39 -0
- package/dist/radio.js +2 -0
- package/dist/scrollbar.cjs +34 -0
- package/dist/scrollbar.d.cts +35 -0
- package/dist/scrollbar.d.ts +35 -0
- package/dist/scrollbar.js +1 -0
- package/dist/search-bar.cjs +408 -0
- package/dist/search-bar.d.cts +42 -0
- package/dist/search-bar.d.ts +42 -0
- package/dist/search-bar.js +4 -0
- package/dist/select.cjs +998 -0
- package/dist/select.d.cts +357 -0
- package/dist/select.d.ts +357 -0
- package/dist/select.js +5 -0
- package/dist/selectable-feature-card.cjs +159 -0
- package/dist/selectable-feature-card.d.cts +74 -0
- package/dist/selectable-feature-card.d.ts +74 -0
- package/dist/selectable-feature-card.js +3 -0
- package/dist/sidebar-item.cjs +175 -0
- package/dist/sidebar-item.d.cts +75 -0
- package/dist/sidebar-item.d.ts +75 -0
- package/dist/sidebar-item.js +2 -0
- package/dist/switch.cjs +86 -0
- package/dist/switch.d.cts +72 -0
- package/dist/switch.d.ts +72 -0
- package/dist/switch.js +2 -0
- package/dist/table-cell.cjs +196 -0
- package/dist/table-cell.d.cts +76 -0
- package/dist/table-cell.d.ts +76 -0
- package/dist/table-cell.js +2 -0
- package/dist/table-title.cjs +34 -0
- package/dist/table-title.d.cts +16 -0
- package/dist/table-title.d.ts +16 -0
- package/dist/table-title.js +2 -0
- package/dist/tabs.cjs +299 -0
- package/dist/tabs.d.cts +116 -0
- package/dist/tabs.d.ts +116 -0
- package/dist/tabs.js +2 -0
- package/dist/toast.cjs +87 -0
- package/dist/toast.d.cts +48 -0
- package/dist/toast.d.ts +48 -0
- package/dist/toast.js +2 -0
- package/dist/token-input.cjs +415 -0
- package/dist/token-input.d.cts +90 -0
- package/dist/token-input.d.ts +90 -0
- package/dist/token-input.js +3 -0
- package/dist/tooltip.cjs +384 -0
- package/dist/tooltip.d.cts +142 -0
- package/dist/tooltip.d.ts +142 -0
- package/dist/tooltip.js +2 -0
- package/package.json +200 -0
- package/src/fonts.css +33 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
// src/table-cell/TableCell.tsx
|
|
30
|
+
function cn(...inputs) {
|
|
31
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
32
|
+
}
|
|
33
|
+
var tableCellVariants = classVarianceAuthority.cva(
|
|
34
|
+
[
|
|
35
|
+
// The cell is the group that drives hover/active styling of its descendants.
|
|
36
|
+
"group",
|
|
37
|
+
// Layout — 56px row, slots on a horizontal axis; overflow clipped for truncation.
|
|
38
|
+
"flex h-14 w-full items-center gap-3 overflow-hidden px-2 py-4",
|
|
39
|
+
// Brand-accent background on hover / keyboard-focus / active (self). Reset
|
|
40
|
+
// native control chrome so an asChild button/anchor styles cleanly.
|
|
41
|
+
"appearance-none bg-transparent outline-none transition-colors",
|
|
42
|
+
"hover:bg-card-brand-accent focus-visible:bg-card-brand-accent data-[state=active]:bg-card-brand-accent"
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
variants: {
|
|
46
|
+
last: {
|
|
47
|
+
// Row divider on all but the last row; recolors on hover / focus / active.
|
|
48
|
+
false: [
|
|
49
|
+
"border-b border-card-border",
|
|
50
|
+
"hover:border-card-brand-border-accent focus-visible:border-card-brand-border-accent data-[state=active]:border-card-brand-border-accent"
|
|
51
|
+
],
|
|
52
|
+
true: ""
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
last: false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
function setRef(ref, node) {
|
|
61
|
+
if (typeof ref === "function") ref(node);
|
|
62
|
+
else if (ref) ref.current = node;
|
|
63
|
+
}
|
|
64
|
+
function TableCell({
|
|
65
|
+
className,
|
|
66
|
+
last = false,
|
|
67
|
+
leading,
|
|
68
|
+
trailing,
|
|
69
|
+
active = false,
|
|
70
|
+
asChild = false,
|
|
71
|
+
children,
|
|
72
|
+
ref,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
const rootClassName = cn(tableCellVariants({ last }), className);
|
|
76
|
+
const dataState = active ? "active" : void 0;
|
|
77
|
+
const leadingSlot = leading != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
+
"span",
|
|
79
|
+
{
|
|
80
|
+
"data-slot": "table-cell-leading",
|
|
81
|
+
className: "flex shrink-0 items-center",
|
|
82
|
+
children: leading
|
|
83
|
+
}
|
|
84
|
+
) : null;
|
|
85
|
+
const trailingSlot = trailing != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "table-cell-trailing",
|
|
89
|
+
className: "flex shrink-0 items-center",
|
|
90
|
+
children: trailing
|
|
91
|
+
}
|
|
92
|
+
) : null;
|
|
93
|
+
const middleSlot = (middle) => middle != null ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "table-cell-middle",
|
|
97
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
98
|
+
children: middle
|
|
99
|
+
}
|
|
100
|
+
) : null;
|
|
101
|
+
if (asChild) {
|
|
102
|
+
if (!React__namespace.isValidElement(children)) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
"TableCell: `asChild` requires a single React element child"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
const child = children;
|
|
108
|
+
const childProps = child.props;
|
|
109
|
+
return React__namespace.cloneElement(
|
|
110
|
+
child,
|
|
111
|
+
{
|
|
112
|
+
...props,
|
|
113
|
+
...childProps,
|
|
114
|
+
"data-slot": "table-cell",
|
|
115
|
+
"data-state": dataState,
|
|
116
|
+
className: cn(
|
|
117
|
+
rootClassName,
|
|
118
|
+
childProps.className
|
|
119
|
+
),
|
|
120
|
+
ref: (node) => {
|
|
121
|
+
setRef(ref, node);
|
|
122
|
+
setRef(childProps.ref, node);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
leadingSlot,
|
|
126
|
+
middleSlot(childProps.children),
|
|
127
|
+
trailingSlot
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
"data-slot": "table-cell",
|
|
134
|
+
"data-state": dataState,
|
|
135
|
+
className: rootClassName,
|
|
136
|
+
ref,
|
|
137
|
+
...props,
|
|
138
|
+
children: [
|
|
139
|
+
leadingSlot,
|
|
140
|
+
middleSlot(children),
|
|
141
|
+
trailingSlot
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function CellText({ label, meta, className, ...props }) {
|
|
147
|
+
const hasMeta = Array.isArray(meta) && meta.length > 0;
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
"data-slot": "cell-text",
|
|
152
|
+
className: cn("flex min-w-0 flex-col gap-0.5", className),
|
|
153
|
+
...props,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "cell-text-label",
|
|
159
|
+
className: cn(
|
|
160
|
+
"body-03 min-w-0 truncate",
|
|
161
|
+
"text-card-foreground",
|
|
162
|
+
"group-hover:text-card-brand-foreground group-focus-visible:text-card-brand-foreground group-data-[state=active]:text-card-brand-foreground"
|
|
163
|
+
),
|
|
164
|
+
children: label
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
hasMeta && /* @__PURE__ */ jsxRuntime.jsx(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
"data-slot": "cell-text-meta",
|
|
171
|
+
className: cn(
|
|
172
|
+
"flex min-w-0 items-center gap-1",
|
|
173
|
+
"body-mono-04",
|
|
174
|
+
"text-card-foreground-muted",
|
|
175
|
+
"group-hover:text-card-brand-foreground-muted group-focus-visible:text-card-brand-foreground-muted group-data-[state=active]:text-card-brand-foreground-muted"
|
|
176
|
+
),
|
|
177
|
+
children: meta.map((segment, index) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
178
|
+
index > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
179
|
+
"span",
|
|
180
|
+
{
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
className: "size-0.5 shrink-0 rounded-full bg-current"
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: segment })
|
|
186
|
+
] }, index))
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
exports.CellText = CellText;
|
|
195
|
+
exports.TableCell = TableCell;
|
|
196
|
+
exports.tableCellVariants = tableCellVariants;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TableCell frame — mirrors the Figma `BaseTableCell` (state default/hover ×
|
|
7
|
+
* position first&middle/last). Binds ONLY to the semantic `card/*` token layer;
|
|
8
|
+
* theme switch is automatic via `.dark`.
|
|
9
|
+
*
|
|
10
|
+
* The Figma `position` variant is a binary "is this the last row" flag, so it is
|
|
11
|
+
* modelled as a boolean `last` (house style — cf. Button `iconOnly`): `last`
|
|
12
|
+
* omits the bottom divider, otherwise the row draws it.
|
|
13
|
+
*
|
|
14
|
+
* State is NOT a cva variant. The cell is a Tailwind `group`; its own surface
|
|
15
|
+
* (background + divider) recolors on self `hover:` / `focus-visible:` /
|
|
16
|
+
* `data-[state=active]:` (`data-state` is set from the `active` prop in
|
|
17
|
+
* <TableCell>). Descendants like <CellText> recolor via the same group
|
|
18
|
+
* (`group-hover:` / `group-focus-visible:` / `group-data-[state=active]:`).
|
|
19
|
+
* (`group-hover:` cannot fire from the group element's OWN hover — hence the
|
|
20
|
+
* surface uses plain `hover:`/`focus-visible:`.)
|
|
21
|
+
*
|
|
22
|
+
* `focus-visible` mirrors hover so an INTERACTIVE cell (one made focusable by a
|
|
23
|
+
* consumer — `asChild` onto a `<button>`/`<a>`, or a `tabIndex`) shows the same
|
|
24
|
+
* brand-accent treatment as its keyboard focus indicator. A plain presentational
|
|
25
|
+
* <div> cell never receives focus, so this is inert until the cell is made
|
|
26
|
+
* focusable. `appearance-none` + `outline-none` let an `asChild` button/anchor
|
|
27
|
+
* render cleanly with the fill (not the native ring) as the focus affordance.
|
|
28
|
+
*/
|
|
29
|
+
declare const tableCellVariants: (props?: ({
|
|
30
|
+
last?: boolean | null | undefined;
|
|
31
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
32
|
+
type TableCellVariantsProps = VariantProps<typeof tableCellVariants>;
|
|
33
|
+
|
|
34
|
+
interface TableCellProps extends React.ComponentProps<"div">, TableCellVariantsProps {
|
|
35
|
+
/** Leading slot (e.g. a network icon). Hidden when omitted. */
|
|
36
|
+
leading?: React.ReactNode;
|
|
37
|
+
/** Trailing slot (e.g. a Button). Hidden when omitted. */
|
|
38
|
+
trailing?: React.ReactNode;
|
|
39
|
+
/** The last row in its column — omits the bottom divider. */
|
|
40
|
+
last?: boolean;
|
|
41
|
+
/** Force the brand-accent highlight (active / selected row). */
|
|
42
|
+
active?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Render the single child element as the root (e.g. a `<td>` / `<a>`) instead
|
|
45
|
+
* of a `<div>`, keeping all cell styling. The child's own children become the
|
|
46
|
+
* middle content; `leading`/`trailing` are injected around them.
|
|
47
|
+
*/
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The atomic presentational cell for FD data tables (Layer 1). Presentational by
|
|
52
|
+
* default (a non-focusable `<div>`). For an INTERACTIVE cell (e.g. one that opens
|
|
53
|
+
* a details panel), make it focusable — `asChild` onto a `<button>`/`<a>`, or
|
|
54
|
+
* pass `tabIndex`/`role`/`onClick` — and it shows the brand-accent treatment on
|
|
55
|
+
* keyboard focus (`:focus-visible`), identical to hover.
|
|
56
|
+
*/
|
|
57
|
+
declare function TableCell({ className, last, leading, trailing, active, asChild, children, ref, ...props }: TableCellProps): React.JSX.Element;
|
|
58
|
+
|
|
59
|
+
interface CellTextProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
60
|
+
/** Primary line (Archivo 14/20 — `body-03`). */
|
|
61
|
+
label: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Optional secondary line: mono (Chakra Petch 12/16 — `body-mono-04`)
|
|
64
|
+
* segments joined by a 2px dot separator. Arbitrary length.
|
|
65
|
+
*/
|
|
66
|
+
meta?: React.ReactNode[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Middle-slot helper for <TableCell>: a `label` line above an optional `meta`
|
|
70
|
+
* row. Recolors to the brand foregrounds via the parent <TableCell> group on
|
|
71
|
+
* hover / keyboard focus / `data-state="active"`, so it MUST be rendered inside
|
|
72
|
+
* a <TableCell>.
|
|
73
|
+
*/
|
|
74
|
+
declare function CellText({ label, meta, className, ...props }: CellTextProps): React.JSX.Element;
|
|
75
|
+
|
|
76
|
+
export { CellText, type CellTextProps, TableCell, type TableCellProps, type TableCellVariantsProps, tableCellVariants };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TableCell frame — mirrors the Figma `BaseTableCell` (state default/hover ×
|
|
7
|
+
* position first&middle/last). Binds ONLY to the semantic `card/*` token layer;
|
|
8
|
+
* theme switch is automatic via `.dark`.
|
|
9
|
+
*
|
|
10
|
+
* The Figma `position` variant is a binary "is this the last row" flag, so it is
|
|
11
|
+
* modelled as a boolean `last` (house style — cf. Button `iconOnly`): `last`
|
|
12
|
+
* omits the bottom divider, otherwise the row draws it.
|
|
13
|
+
*
|
|
14
|
+
* State is NOT a cva variant. The cell is a Tailwind `group`; its own surface
|
|
15
|
+
* (background + divider) recolors on self `hover:` / `focus-visible:` /
|
|
16
|
+
* `data-[state=active]:` (`data-state` is set from the `active` prop in
|
|
17
|
+
* <TableCell>). Descendants like <CellText> recolor via the same group
|
|
18
|
+
* (`group-hover:` / `group-focus-visible:` / `group-data-[state=active]:`).
|
|
19
|
+
* (`group-hover:` cannot fire from the group element's OWN hover — hence the
|
|
20
|
+
* surface uses plain `hover:`/`focus-visible:`.)
|
|
21
|
+
*
|
|
22
|
+
* `focus-visible` mirrors hover so an INTERACTIVE cell (one made focusable by a
|
|
23
|
+
* consumer — `asChild` onto a `<button>`/`<a>`, or a `tabIndex`) shows the same
|
|
24
|
+
* brand-accent treatment as its keyboard focus indicator. A plain presentational
|
|
25
|
+
* <div> cell never receives focus, so this is inert until the cell is made
|
|
26
|
+
* focusable. `appearance-none` + `outline-none` let an `asChild` button/anchor
|
|
27
|
+
* render cleanly with the fill (not the native ring) as the focus affordance.
|
|
28
|
+
*/
|
|
29
|
+
declare const tableCellVariants: (props?: ({
|
|
30
|
+
last?: boolean | null | undefined;
|
|
31
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
32
|
+
type TableCellVariantsProps = VariantProps<typeof tableCellVariants>;
|
|
33
|
+
|
|
34
|
+
interface TableCellProps extends React.ComponentProps<"div">, TableCellVariantsProps {
|
|
35
|
+
/** Leading slot (e.g. a network icon). Hidden when omitted. */
|
|
36
|
+
leading?: React.ReactNode;
|
|
37
|
+
/** Trailing slot (e.g. a Button). Hidden when omitted. */
|
|
38
|
+
trailing?: React.ReactNode;
|
|
39
|
+
/** The last row in its column — omits the bottom divider. */
|
|
40
|
+
last?: boolean;
|
|
41
|
+
/** Force the brand-accent highlight (active / selected row). */
|
|
42
|
+
active?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Render the single child element as the root (e.g. a `<td>` / `<a>`) instead
|
|
45
|
+
* of a `<div>`, keeping all cell styling. The child's own children become the
|
|
46
|
+
* middle content; `leading`/`trailing` are injected around them.
|
|
47
|
+
*/
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The atomic presentational cell for FD data tables (Layer 1). Presentational by
|
|
52
|
+
* default (a non-focusable `<div>`). For an INTERACTIVE cell (e.g. one that opens
|
|
53
|
+
* a details panel), make it focusable — `asChild` onto a `<button>`/`<a>`, or
|
|
54
|
+
* pass `tabIndex`/`role`/`onClick` — and it shows the brand-accent treatment on
|
|
55
|
+
* keyboard focus (`:focus-visible`), identical to hover.
|
|
56
|
+
*/
|
|
57
|
+
declare function TableCell({ className, last, leading, trailing, active, asChild, children, ref, ...props }: TableCellProps): React.JSX.Element;
|
|
58
|
+
|
|
59
|
+
interface CellTextProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
60
|
+
/** Primary line (Archivo 14/20 — `body-03`). */
|
|
61
|
+
label: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Optional secondary line: mono (Chakra Petch 12/16 — `body-mono-04`)
|
|
64
|
+
* segments joined by a 2px dot separator. Arbitrary length.
|
|
65
|
+
*/
|
|
66
|
+
meta?: React.ReactNode[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Middle-slot helper for <TableCell>: a `label` line above an optional `meta`
|
|
70
|
+
* row. Recolors to the brand foregrounds via the parent <TableCell> group on
|
|
71
|
+
* hover / keyboard focus / `data-state="active"`, so it MUST be rendered inside
|
|
72
|
+
* a <TableCell>.
|
|
73
|
+
*/
|
|
74
|
+
declare function CellText({ label, meta, className, ...props }: CellTextProps): React.JSX.Element;
|
|
75
|
+
|
|
76
|
+
export { CellText, type CellTextProps, TableCell, type TableCellProps, type TableCellVariantsProps, tableCellVariants };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// src/lib/cn.ts
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
function TableTitle({ className, children, ref, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "table-title",
|
|
16
|
+
className: cn(
|
|
17
|
+
"flex h-8 w-full items-center overflow-hidden border-b border-card-border px-2 py-1.5",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
ref,
|
|
21
|
+
...props,
|
|
22
|
+
children: children != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
"p",
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "table-title-label",
|
|
26
|
+
className: "caption-03-medium min-w-0 truncate uppercase text-card-foreground-muted",
|
|
27
|
+
children
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.TableTitle = TableTitle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface TableTitleProps extends React.ComponentProps<"div"> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The section-header row for FD data tables — a static 32px band that labels the
|
|
7
|
+
* table (or a column group) sitting above the <TableCell> rows (Layer 1). The
|
|
8
|
+
* `children` are the label; they render in the muted `caption-03-medium` style,
|
|
9
|
+
* uppercased, and truncate with an ellipsis when they overflow. Omitting children
|
|
10
|
+
* yields the empty header band (the Figma `showTitle=false` variant). Owns the
|
|
11
|
+
* bottom divider (`card/border`); override via `className` when composed inside a
|
|
12
|
+
* table shell that draws its own separators.
|
|
13
|
+
*/
|
|
14
|
+
declare function TableTitle({ className, children, ref, ...props }: TableTitleProps): React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { TableTitle, type TableTitleProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface TableTitleProps extends React.ComponentProps<"div"> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The section-header row for FD data tables — a static 32px band that labels the
|
|
7
|
+
* table (or a column group) sitting above the <TableCell> rows (Layer 1). The
|
|
8
|
+
* `children` are the label; they render in the muted `caption-03-medium` style,
|
|
9
|
+
* uppercased, and truncate with an ellipsis when they overflow. Omitting children
|
|
10
|
+
* yields the empty header band (the Figma `showTitle=false` variant). Owns the
|
|
11
|
+
* bottom divider (`card/border`); override via `className` when composed inside a
|
|
12
|
+
* table shell that draws its own separators.
|
|
13
|
+
*/
|
|
14
|
+
declare function TableTitle({ className, children, ref, ...props }: TableTitleProps): React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { TableTitle, type TableTitleProps };
|