@ttoss/fsl-ui 0.2.4 → 0.2.6
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/README.md +1 -1
- package/dist/components/AppShell/AppShell.cjs +124 -0
- package/dist/components/AppShell/AppShell.d.cts +74 -0
- package/dist/components/AppShell/AppShell.d.mts +74 -0
- package/dist/components/AppShell/AppShell.mjs +123 -0
- package/dist/components/Badge/Badge.cjs +61 -0
- package/dist/components/Badge/Badge.d.cts +56 -0
- package/dist/components/Badge/Badge.d.mts +56 -0
- package/dist/components/Badge/Badge.mjs +60 -0
- package/dist/components/Box/Box.cjs +114 -0
- package/dist/components/Box/Box.d.cts +115 -0
- package/dist/components/Box/Box.d.mts +115 -0
- package/dist/components/Box/Box.mjs +113 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +1 -1
- package/dist/components/Button/Button.cjs +2 -2
- package/dist/components/Button/Button.d.cts +2 -1
- package/dist/components/Button/Button.d.mts +2 -1
- package/dist/components/Button/Button.mjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.mjs +1 -1
- package/dist/components/Code/Code.cjs +69 -0
- package/dist/components/Code/Code.d.cts +53 -0
- package/dist/components/Code/Code.d.mts +53 -0
- package/dist/components/Code/Code.mjs +68 -0
- package/dist/components/Container/Container.cjs +65 -0
- package/dist/components/Container/Container.d.cts +61 -0
- package/dist/components/Container/Container.d.mts +61 -0
- package/dist/components/Container/Container.mjs +64 -0
- package/dist/components/FileTrigger/FileTrigger.cjs +1 -1
- package/dist/components/FileTrigger/FileTrigger.mjs +1 -1
- package/dist/components/Grid/Grid.cjs +88 -0
- package/dist/components/Grid/Grid.d.cts +87 -0
- package/dist/components/Grid/Grid.d.mts +87 -0
- package/dist/components/Grid/Grid.mjs +87 -0
- package/dist/components/GridList/GridList.cjs +2 -2
- package/dist/components/GridList/GridList.mjs +2 -2
- package/dist/components/Group/Group.cjs +1 -1
- package/dist/components/Group/Group.mjs +1 -1
- package/dist/components/Heading/Heading.cjs +78 -0
- package/dist/components/Heading/Heading.d.cts +63 -0
- package/dist/components/Heading/Heading.d.mts +63 -0
- package/dist/components/Heading/Heading.mjs +77 -0
- package/dist/components/Icon/Icon.cjs +2 -1
- package/dist/components/Icon/Icon.d.cts +59 -0
- package/dist/components/Icon/Icon.d.mts +59 -0
- package/dist/components/Icon/Icon.mjs +1 -1
- package/dist/components/Icon/glyphs.cjs +37 -10
- package/dist/components/Icon/glyphs.mjs +34 -10
- package/dist/components/Icon/intents.cjs +32 -0
- package/dist/components/Icon/intents.d.cts +33 -0
- package/dist/components/Icon/intents.d.mts +33 -0
- package/dist/components/Icon/intents.mjs +32 -0
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.mjs +1 -1
- package/dist/components/ListBox/ListBox.cjs +1 -1
- package/dist/components/ListBox/ListBox.mjs +1 -1
- package/dist/components/Meter/Meter.cjs +11 -1
- package/dist/components/Meter/Meter.mjs +11 -1
- package/dist/components/NumberField/NumberField.cjs +2 -2
- package/dist/components/NumberField/NumberField.mjs +2 -2
- package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs +2 -2
- package/dist/components/RadioGroup/RadioGroup.mjs +2 -2
- package/dist/components/Select/Select.cjs +2 -2
- package/dist/components/Select/Select.mjs +2 -2
- package/dist/components/Separator/Separator.cjs +1 -1
- package/dist/components/Separator/Separator.mjs +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.mjs +1 -1
- package/dist/components/Stack/Stack.cjs +89 -0
- package/dist/components/Stack/Stack.d.cts +75 -0
- package/dist/components/Stack/Stack.d.mts +75 -0
- package/dist/components/Stack/Stack.mjs +88 -0
- package/dist/components/Surface/Surface.cjs +84 -0
- package/dist/components/Surface/Surface.d.cts +72 -0
- package/dist/components/Surface/Surface.d.mts +72 -0
- package/dist/components/Surface/Surface.mjs +83 -0
- package/dist/components/Switch/Switch.cjs +3 -3
- package/dist/components/Switch/Switch.d.cts +1 -1
- package/dist/components/Switch/Switch.d.mts +1 -1
- package/dist/components/Switch/Switch.mjs +3 -3
- package/dist/components/Table/Table.cjs +248 -0
- package/dist/components/Table/Table.d.cts +128 -0
- package/dist/components/Table/Table.d.mts +128 -0
- package/dist/components/Table/Table.mjs +239 -0
- package/dist/components/Tabs/Tabs.cjs +71 -28
- package/dist/components/Tabs/Tabs.d.cts +0 -17
- package/dist/components/Tabs/Tabs.d.mts +0 -17
- package/dist/components/Tabs/Tabs.mjs +69 -28
- package/dist/components/Text/Text.cjs +70 -0
- package/dist/components/Text/Text.d.cts +89 -0
- package/dist/components/Text/Text.d.mts +89 -0
- package/dist/components/Text/Text.mjs +69 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/components/ToggleButton/ToggleButton.mjs +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -1
- package/dist/components/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/Toolbar/Toolbar.mjs +1 -1
- package/dist/composites/Accordion/Accordion.cjs +14 -9
- package/dist/composites/Accordion/Accordion.mjs +14 -9
- package/dist/composites/Dialog/Dialog.cjs +1 -1
- package/dist/composites/Dialog/Dialog.mjs +1 -1
- package/dist/composites/Disclosure/Disclosure.cjs +14 -9
- package/dist/composites/Disclosure/Disclosure.mjs +14 -9
- package/dist/composites/Form/Form.cjs +1 -1
- package/dist/composites/Form/Form.mjs +1 -1
- package/dist/composites/Menu/Menu.cjs +2 -2
- package/dist/composites/Menu/Menu.mjs +2 -2
- package/dist/composites/Popover/Popover.cjs +1 -1
- package/dist/composites/Popover/Popover.mjs +1 -1
- package/dist/composites/SearchField/SearchField.cjs +2 -2
- package/dist/composites/SearchField/SearchField.mjs +2 -2
- package/dist/composites/TagGroup/TagGroup.cjs +2 -2
- package/dist/composites/TagGroup/TagGroup.mjs +2 -2
- package/dist/composites/TextArea/TextArea.cjs +2 -2
- package/dist/composites/TextArea/TextArea.mjs +2 -2
- package/dist/composites/TextField/TextField.cjs +2 -2
- package/dist/composites/TextField/TextField.mjs +2 -2
- package/dist/composites/Tooltip/Tooltip.cjs +1 -1
- package/dist/composites/Tooltip/Tooltip.mjs +1 -1
- package/dist/index.cjs +46 -0
- package/dist/index.d.cts +14 -1
- package/dist/index.d.mts +14 -1
- package/dist/index.mjs +14 -1
- package/llms.txt +51 -8
- package/package.json +4 -4
- package/src/tokens/CONTRACT.md +28 -10
|
@@ -24,7 +24,7 @@ interface SwitchProps$1 extends Omit<SwitchProps, 'style' | 'children'> {
|
|
|
24
24
|
*
|
|
25
25
|
* Entity = Selection → reads `vars.colors.input.primary.*`, radii: `round`
|
|
26
26
|
* (pill track + circular thumb), border: `outline.control`,
|
|
27
|
-
* sizing: `hit
|
|
27
|
+
* sizing: `hit`, motion: `feedback`.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { focusRingOutline } from "../../tokens/focusRing.mjs";
|
|
3
3
|
import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
|
|
4
4
|
import { vars } from "@ttoss/fsl-theme/vars";
|
|
5
|
-
import { Switch } from "react-aria-components";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Switch } from "react-aria-components";
|
|
7
7
|
|
|
8
8
|
//#region src/components/Switch/Switch.tsx
|
|
9
9
|
/** Formal semantic identity — Switch root (Selection entity, toggle.binary). */
|
|
@@ -81,7 +81,7 @@ var resolveLabelColor = ({
|
|
|
81
81
|
*
|
|
82
82
|
* Entity = Selection → reads `vars.colors.input.primary.*`, radii: `round`
|
|
83
83
|
* (pill track + circular thumb), border: `outline.control`,
|
|
84
|
-
* sizing: `hit
|
|
84
|
+
* sizing: `hit`, motion: `feedback`.
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* ```tsx
|
|
@@ -106,7 +106,7 @@ var Switch$1 = ({
|
|
|
106
106
|
display: "inline-flex",
|
|
107
107
|
alignItems: "center",
|
|
108
108
|
gap: vars.spacing.gap.inline.sm,
|
|
109
|
-
minHeight: vars.sizing.hit
|
|
109
|
+
minHeight: vars.sizing.hit,
|
|
110
110
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
111
111
|
opacity: isDisabled ? vars.opacity.disabled : void 0,
|
|
112
112
|
...vars.text.label.md,
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
const require_focusRing = require('../../tokens/focusRing.cjs');
|
|
3
|
+
const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
|
|
4
|
+
const require_Icon = require('../Icon/Icon.cjs');
|
|
5
|
+
let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let react_aria_components = require("react-aria-components");
|
|
8
|
+
|
|
9
|
+
//#region src/components/Table/Table.tsx
|
|
10
|
+
/** Formal semantic identity — Table root (Collection entity, surface). */
|
|
11
|
+
var tableMeta = {
|
|
12
|
+
displayName: "Table",
|
|
13
|
+
entity: "Collection",
|
|
14
|
+
structure: "root"
|
|
15
|
+
};
|
|
16
|
+
/** Formal semantic identity — TableColumn header (Collection `title` role). */
|
|
17
|
+
var tableColumnMeta = {
|
|
18
|
+
displayName: "TableColumn",
|
|
19
|
+
entity: "Collection",
|
|
20
|
+
structure: "title"
|
|
21
|
+
};
|
|
22
|
+
/** Formal semantic identity — TableRow (Selection entity, selectable row). */
|
|
23
|
+
var tableRowMeta = {
|
|
24
|
+
displayName: "TableRow",
|
|
25
|
+
entity: "Selection",
|
|
26
|
+
structure: "item",
|
|
27
|
+
composition: "selection"
|
|
28
|
+
};
|
|
29
|
+
/** Formal semantic identity — TableCell (Collection `content` role). */
|
|
30
|
+
var tableCellMeta = {
|
|
31
|
+
displayName: "TableCell",
|
|
32
|
+
entity: "Collection",
|
|
33
|
+
structure: "content"
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A semantic data table built on React Aria's `Table` — column headers,
|
|
37
|
+
* keyboard grid navigation, sorting, and row selection.
|
|
38
|
+
*
|
|
39
|
+
* Per ADR-007 the CONTAINER is Entity = Collection (an `informational`
|
|
40
|
+
* surface) and each `TableRow` is Entity = Selection (`input` chrome, the
|
|
41
|
+
* `selected` State). Compose `TableHeader` + `TableColumn` for the header
|
|
42
|
+
* and `TableBody` + `TableRow` + `TableCell` for the data. Sorting is
|
|
43
|
+
* controlled via `sortDescriptor`/`onSortChange` with `allowsSorting` on the
|
|
44
|
+
* sortable columns. Row selection uses React Aria's `selectionMode`;
|
|
45
|
+
* clicking a row toggles it (there is no checkbox column yet — it ships
|
|
46
|
+
* when a consumer demands bulk actions).
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Table aria-label="Team" sortDescriptor={sort} onSortChange={setSort}>
|
|
51
|
+
* <TableHeader>
|
|
52
|
+
* <TableColumn id="name" isRowHeader allowsSorting>Name</TableColumn>
|
|
53
|
+
* <TableColumn id="role">Role</TableColumn>
|
|
54
|
+
* </TableHeader>
|
|
55
|
+
* <TableBody>
|
|
56
|
+
* <TableRow id="ada">
|
|
57
|
+
* <TableCell>Ada Lovelace</TableCell>
|
|
58
|
+
* <TableCell>Admin</TableCell>
|
|
59
|
+
* </TableRow>
|
|
60
|
+
* </TableBody>
|
|
61
|
+
* </Table>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
var Table = props => {
|
|
65
|
+
const surface = _ttoss_fsl_theme_vars.vars.colors.informational.primary;
|
|
66
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Table, {
|
|
67
|
+
...props,
|
|
68
|
+
"data-scope": "table",
|
|
69
|
+
"data-part": "root",
|
|
70
|
+
style: {
|
|
71
|
+
boxSizing: "border-box",
|
|
72
|
+
inlineSize: "100%",
|
|
73
|
+
borderCollapse: "separate",
|
|
74
|
+
borderSpacing: 0,
|
|
75
|
+
borderRadius: _ttoss_fsl_theme_vars.vars.radii.surface,
|
|
76
|
+
borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.surface.width,
|
|
77
|
+
borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.surface.style,
|
|
78
|
+
borderColor: surface?.border?.default ?? "transparent",
|
|
79
|
+
backgroundColor: surface?.background?.default,
|
|
80
|
+
color: surface?.text?.default
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
Table.displayName = tableMeta.displayName;
|
|
85
|
+
/**
|
|
86
|
+
* The header row group. An internal frame part — place `TableColumn`s
|
|
87
|
+
* inside it.
|
|
88
|
+
*/
|
|
89
|
+
var TableHeader = props => {
|
|
90
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.TableHeader, {
|
|
91
|
+
...props,
|
|
92
|
+
"data-scope": "table",
|
|
93
|
+
"data-part": "header"
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
TableHeader.displayName = "TableHeader";
|
|
97
|
+
/**
|
|
98
|
+
* A column header (Collection `title` role). With `allowsSorting`, React
|
|
99
|
+
* Aria makes it a keyboard-operable sort control (`aria-sort` included) and
|
|
100
|
+
* the current direction renders as an arrow Icon
|
|
101
|
+
* (`action.sortAscending` / `action.sortDescending`).
|
|
102
|
+
*
|
|
103
|
+
* Set `isRowHeader` on the column whose cells name the row for assistive
|
|
104
|
+
* technology.
|
|
105
|
+
*/
|
|
106
|
+
var TableColumn = ({
|
|
107
|
+
children,
|
|
108
|
+
...props
|
|
109
|
+
}) => {
|
|
110
|
+
const colors = _ttoss_fsl_theme_vars.vars.colors.informational.muted;
|
|
111
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Column, {
|
|
112
|
+
...props,
|
|
113
|
+
"data-scope": "table",
|
|
114
|
+
"data-part": "title",
|
|
115
|
+
style: ({
|
|
116
|
+
allowsSorting,
|
|
117
|
+
isHovered,
|
|
118
|
+
isFocusVisible
|
|
119
|
+
}) => {
|
|
120
|
+
return {
|
|
121
|
+
boxSizing: "border-box",
|
|
122
|
+
textAlign: "start",
|
|
123
|
+
paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
|
|
124
|
+
paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
|
|
125
|
+
..._ttoss_fsl_theme_vars.vars.text.label.sm,
|
|
126
|
+
cursor: allowsSorting ? "pointer" : void 0,
|
|
127
|
+
transitionProperty: "color",
|
|
128
|
+
transitionDuration: _ttoss_fsl_theme_vars.vars.motion.feedback.duration,
|
|
129
|
+
transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.feedback.easing,
|
|
130
|
+
color: allowsSorting ? require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.text, {
|
|
131
|
+
isHovered
|
|
132
|
+
}) : colors?.text?.default,
|
|
133
|
+
borderBlockEndWidth: _ttoss_fsl_theme_vars.vars.border.divider.width,
|
|
134
|
+
borderBlockEndStyle: _ttoss_fsl_theme_vars.vars.border.divider.style,
|
|
135
|
+
borderBlockEndColor: colors?.border?.default ?? "transparent",
|
|
136
|
+
outline: require_focusRing.focusRingOutline(isFocusVisible),
|
|
137
|
+
outlineOffset: "-2px"
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
children: ({
|
|
141
|
+
allowsSorting,
|
|
142
|
+
sortDirection
|
|
143
|
+
}) => {
|
|
144
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsxs)("span", {
|
|
145
|
+
style: {
|
|
146
|
+
display: "inline-flex",
|
|
147
|
+
alignItems: "center",
|
|
148
|
+
gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm
|
|
149
|
+
},
|
|
150
|
+
children: [children, allowsSorting && sortDirection && /* @__PURE__ */(0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
151
|
+
intent: sortDirection === "ascending" ? "action.sortAscending" : "action.sortDescending",
|
|
152
|
+
size: "sm"
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
TableColumn.displayName = tableColumnMeta.displayName;
|
|
159
|
+
/** The data row group. An internal frame part — place `TableRow`s inside. */
|
|
160
|
+
var TableBody = props => {
|
|
161
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.TableBody, {
|
|
162
|
+
...props,
|
|
163
|
+
"data-scope": "table",
|
|
164
|
+
"data-part": "body"
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
TableBody.displayName = "TableBody";
|
|
168
|
+
/**
|
|
169
|
+
* A single data row. Entity = Selection → reads `vars.colors.input.*` and
|
|
170
|
+
* surfaces the `selected` State when the parent Table has a `selectionMode`.
|
|
171
|
+
*/
|
|
172
|
+
var TableRow = props => {
|
|
173
|
+
const c = _ttoss_fsl_theme_vars.vars.colors.input.primary;
|
|
174
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Row, {
|
|
175
|
+
...props,
|
|
176
|
+
"data-scope": "table",
|
|
177
|
+
"data-part": "item",
|
|
178
|
+
style: ({
|
|
179
|
+
isSelected,
|
|
180
|
+
isHovered,
|
|
181
|
+
isFocusVisible,
|
|
182
|
+
isDisabled,
|
|
183
|
+
selectionMode
|
|
184
|
+
}) => {
|
|
185
|
+
return {
|
|
186
|
+
boxSizing: "border-box",
|
|
187
|
+
blockSize: _ttoss_fsl_theme_vars.vars.sizing.hit,
|
|
188
|
+
cursor: selectionMode === "none" ? void 0 : isDisabled ? "not-allowed" : "pointer",
|
|
189
|
+
opacity: isDisabled ? _ttoss_fsl_theme_vars.vars.opacity.disabled : void 0,
|
|
190
|
+
transitionProperty: "background-color, color",
|
|
191
|
+
transitionDuration: _ttoss_fsl_theme_vars.vars.motion.feedback.duration,
|
|
192
|
+
transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.feedback.easing,
|
|
193
|
+
backgroundColor: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.background, {
|
|
194
|
+
isDisabled,
|
|
195
|
+
isSelected,
|
|
196
|
+
isHovered: isHovered && selectionMode !== "none"
|
|
197
|
+
}),
|
|
198
|
+
color: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.text, {
|
|
199
|
+
isDisabled,
|
|
200
|
+
isSelected
|
|
201
|
+
}),
|
|
202
|
+
outline: require_focusRing.focusRingOutline(isFocusVisible),
|
|
203
|
+
outlineOffset: "-2px"
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
TableRow.displayName = tableRowMeta.displayName;
|
|
209
|
+
/**
|
|
210
|
+
* A data cell (Collection `content` role). Focusable during keyboard grid
|
|
211
|
+
* navigation; typography and color inherit from the row.
|
|
212
|
+
*/
|
|
213
|
+
var TableCell = props => {
|
|
214
|
+
const colors = _ttoss_fsl_theme_vars.vars.colors.informational.muted;
|
|
215
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Cell, {
|
|
216
|
+
...props,
|
|
217
|
+
"data-scope": "table",
|
|
218
|
+
"data-part": "content",
|
|
219
|
+
style: ({
|
|
220
|
+
isFocusVisible
|
|
221
|
+
}) => {
|
|
222
|
+
return {
|
|
223
|
+
boxSizing: "border-box",
|
|
224
|
+
paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
|
|
225
|
+
paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
|
|
226
|
+
..._ttoss_fsl_theme_vars.vars.text.body.sm,
|
|
227
|
+
borderBlockEndWidth: _ttoss_fsl_theme_vars.vars.border.divider.width,
|
|
228
|
+
borderBlockEndStyle: _ttoss_fsl_theme_vars.vars.border.divider.style,
|
|
229
|
+
borderBlockEndColor: colors?.border?.default ?? "transparent",
|
|
230
|
+
outline: require_focusRing.focusRingOutline(isFocusVisible),
|
|
231
|
+
outlineOffset: "-2px"
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
TableCell.displayName = tableCellMeta.displayName;
|
|
237
|
+
|
|
238
|
+
//#endregion
|
|
239
|
+
exports.Table = Table;
|
|
240
|
+
exports.TableBody = TableBody;
|
|
241
|
+
exports.TableCell = TableCell;
|
|
242
|
+
exports.TableColumn = TableColumn;
|
|
243
|
+
exports.TableHeader = TableHeader;
|
|
244
|
+
exports.TableRow = TableRow;
|
|
245
|
+
exports.tableCellMeta = tableCellMeta;
|
|
246
|
+
exports.tableColumnMeta = tableColumnMeta;
|
|
247
|
+
exports.tableMeta = tableMeta;
|
|
248
|
+
exports.tableRowMeta = tableRowMeta;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CellProps, ColumnProps, RowProps, SortDescriptor, SortDirection, TableBodyProps, TableHeaderProps, TableProps } from "react-aria-components";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Table/Table.d.ts
|
|
6
|
+
/** Formal semantic identity — Table root (Collection entity, surface). */
|
|
7
|
+
declare const tableMeta: {
|
|
8
|
+
readonly displayName: "Table";
|
|
9
|
+
readonly entity: "Collection";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Formal semantic identity — TableColumn header (Collection `title` role). */
|
|
13
|
+
declare const tableColumnMeta: {
|
|
14
|
+
readonly displayName: "TableColumn";
|
|
15
|
+
readonly entity: "Collection";
|
|
16
|
+
readonly structure: "title";
|
|
17
|
+
};
|
|
18
|
+
/** Formal semantic identity — TableRow (Selection entity, selectable row). */
|
|
19
|
+
declare const tableRowMeta: {
|
|
20
|
+
readonly displayName: "TableRow";
|
|
21
|
+
readonly entity: "Selection";
|
|
22
|
+
readonly structure: "item";
|
|
23
|
+
readonly composition: "selection";
|
|
24
|
+
};
|
|
25
|
+
/** Formal semantic identity — TableCell (Collection `content` role). */
|
|
26
|
+
declare const tableCellMeta: {
|
|
27
|
+
readonly displayName: "TableCell";
|
|
28
|
+
readonly entity: "Collection";
|
|
29
|
+
readonly structure: "content";
|
|
30
|
+
};
|
|
31
|
+
/** Props for the Table component. */
|
|
32
|
+
type TableProps$1 = Omit<TableProps, 'style' | 'className'>;
|
|
33
|
+
/**
|
|
34
|
+
* A semantic data table built on React Aria's `Table` — column headers,
|
|
35
|
+
* keyboard grid navigation, sorting, and row selection.
|
|
36
|
+
*
|
|
37
|
+
* Per ADR-007 the CONTAINER is Entity = Collection (an `informational`
|
|
38
|
+
* surface) and each `TableRow` is Entity = Selection (`input` chrome, the
|
|
39
|
+
* `selected` State). Compose `TableHeader` + `TableColumn` for the header
|
|
40
|
+
* and `TableBody` + `TableRow` + `TableCell` for the data. Sorting is
|
|
41
|
+
* controlled via `sortDescriptor`/`onSortChange` with `allowsSorting` on the
|
|
42
|
+
* sortable columns. Row selection uses React Aria's `selectionMode`;
|
|
43
|
+
* clicking a row toggles it (there is no checkbox column yet — it ships
|
|
44
|
+
* when a consumer demands bulk actions).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Table aria-label="Team" sortDescriptor={sort} onSortChange={setSort}>
|
|
49
|
+
* <TableHeader>
|
|
50
|
+
* <TableColumn id="name" isRowHeader allowsSorting>Name</TableColumn>
|
|
51
|
+
* <TableColumn id="role">Role</TableColumn>
|
|
52
|
+
* </TableHeader>
|
|
53
|
+
* <TableBody>
|
|
54
|
+
* <TableRow id="ada">
|
|
55
|
+
* <TableCell>Ada Lovelace</TableCell>
|
|
56
|
+
* <TableCell>Admin</TableCell>
|
|
57
|
+
* </TableRow>
|
|
58
|
+
* </TableBody>
|
|
59
|
+
* </Table>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const Table: {
|
|
63
|
+
(props: TableProps$1): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
displayName: "Table";
|
|
65
|
+
};
|
|
66
|
+
/** Props for the TableHeader frame. */
|
|
67
|
+
type TableHeaderProps$1<T extends object = object> = Omit<TableHeaderProps<T>, 'style' | 'className'>;
|
|
68
|
+
/**
|
|
69
|
+
* The header row group. An internal frame part — place `TableColumn`s
|
|
70
|
+
* inside it.
|
|
71
|
+
*/
|
|
72
|
+
declare const TableHeader: {
|
|
73
|
+
<T extends object = object>(props: TableHeaderProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
displayName: string;
|
|
75
|
+
};
|
|
76
|
+
/** Props for a TableColumn header cell. */
|
|
77
|
+
type TableColumnProps = Omit<ColumnProps, 'style' | 'className' | 'children'> & {
|
|
78
|
+
/**
|
|
79
|
+
* Column header content. Plain nodes only — the column owns its render
|
|
80
|
+
* prop internally (label + sort-direction indicator).
|
|
81
|
+
*/
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* A column header (Collection `title` role). With `allowsSorting`, React
|
|
86
|
+
* Aria makes it a keyboard-operable sort control (`aria-sort` included) and
|
|
87
|
+
* the current direction renders as an arrow Icon
|
|
88
|
+
* (`action.sortAscending` / `action.sortDescending`).
|
|
89
|
+
*
|
|
90
|
+
* Set `isRowHeader` on the column whose cells name the row for assistive
|
|
91
|
+
* technology.
|
|
92
|
+
*/
|
|
93
|
+
declare const TableColumn: {
|
|
94
|
+
({
|
|
95
|
+
children,
|
|
96
|
+
...props
|
|
97
|
+
}: TableColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
displayName: "TableColumn";
|
|
99
|
+
};
|
|
100
|
+
/** Props for the TableBody frame. */
|
|
101
|
+
type TableBodyProps$1<T extends object = object> = Omit<TableBodyProps<T>, 'style' | 'className'>;
|
|
102
|
+
/** The data row group. An internal frame part — place `TableRow`s inside. */
|
|
103
|
+
declare const TableBody: {
|
|
104
|
+
<T extends object = object>(props: TableBodyProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
displayName: string;
|
|
106
|
+
};
|
|
107
|
+
/** Props for a TableRow. */
|
|
108
|
+
type TableRowProps<T extends object = object> = Omit<RowProps<T>, 'style' | 'className'>;
|
|
109
|
+
/**
|
|
110
|
+
* A single data row. Entity = Selection → reads `vars.colors.input.*` and
|
|
111
|
+
* surfaces the `selected` State when the parent Table has a `selectionMode`.
|
|
112
|
+
*/
|
|
113
|
+
declare const TableRow: {
|
|
114
|
+
<T extends object = object>(props: TableRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
displayName: "TableRow";
|
|
116
|
+
};
|
|
117
|
+
/** Props for a TableCell. */
|
|
118
|
+
type TableCellProps = Omit<CellProps, 'style' | 'className'>;
|
|
119
|
+
/**
|
|
120
|
+
* A data cell (Collection `content` role). Focusable during keyboard grid
|
|
121
|
+
* navigation; typography and color inherit from the row.
|
|
122
|
+
*/
|
|
123
|
+
declare const TableCell: {
|
|
124
|
+
(props: TableCellProps): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
displayName: "TableCell";
|
|
126
|
+
};
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type SortDescriptor, type SortDirection, Table, TableBody, TableBodyProps$1 as TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableHeader, TableHeaderProps$1 as TableHeaderProps, TableProps$1 as TableProps, TableRow, TableRowProps, tableCellMeta, tableColumnMeta, tableMeta, tableRowMeta };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
|
|
2
|
+
import { CellProps, ColumnProps, RowProps, SortDescriptor, SortDirection, TableBodyProps, TableHeaderProps, TableProps } from "react-aria-components";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Table/Table.d.ts
|
|
6
|
+
/** Formal semantic identity — Table root (Collection entity, surface). */
|
|
7
|
+
declare const tableMeta: {
|
|
8
|
+
readonly displayName: "Table";
|
|
9
|
+
readonly entity: "Collection";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Formal semantic identity — TableColumn header (Collection `title` role). */
|
|
13
|
+
declare const tableColumnMeta: {
|
|
14
|
+
readonly displayName: "TableColumn";
|
|
15
|
+
readonly entity: "Collection";
|
|
16
|
+
readonly structure: "title";
|
|
17
|
+
};
|
|
18
|
+
/** Formal semantic identity — TableRow (Selection entity, selectable row). */
|
|
19
|
+
declare const tableRowMeta: {
|
|
20
|
+
readonly displayName: "TableRow";
|
|
21
|
+
readonly entity: "Selection";
|
|
22
|
+
readonly structure: "item";
|
|
23
|
+
readonly composition: "selection";
|
|
24
|
+
};
|
|
25
|
+
/** Formal semantic identity — TableCell (Collection `content` role). */
|
|
26
|
+
declare const tableCellMeta: {
|
|
27
|
+
readonly displayName: "TableCell";
|
|
28
|
+
readonly entity: "Collection";
|
|
29
|
+
readonly structure: "content";
|
|
30
|
+
};
|
|
31
|
+
/** Props for the Table component. */
|
|
32
|
+
type TableProps$1 = Omit<TableProps, 'style' | 'className'>;
|
|
33
|
+
/**
|
|
34
|
+
* A semantic data table built on React Aria's `Table` — column headers,
|
|
35
|
+
* keyboard grid navigation, sorting, and row selection.
|
|
36
|
+
*
|
|
37
|
+
* Per ADR-007 the CONTAINER is Entity = Collection (an `informational`
|
|
38
|
+
* surface) and each `TableRow` is Entity = Selection (`input` chrome, the
|
|
39
|
+
* `selected` State). Compose `TableHeader` + `TableColumn` for the header
|
|
40
|
+
* and `TableBody` + `TableRow` + `TableCell` for the data. Sorting is
|
|
41
|
+
* controlled via `sortDescriptor`/`onSortChange` with `allowsSorting` on the
|
|
42
|
+
* sortable columns. Row selection uses React Aria's `selectionMode`;
|
|
43
|
+
* clicking a row toggles it (there is no checkbox column yet — it ships
|
|
44
|
+
* when a consumer demands bulk actions).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Table aria-label="Team" sortDescriptor={sort} onSortChange={setSort}>
|
|
49
|
+
* <TableHeader>
|
|
50
|
+
* <TableColumn id="name" isRowHeader allowsSorting>Name</TableColumn>
|
|
51
|
+
* <TableColumn id="role">Role</TableColumn>
|
|
52
|
+
* </TableHeader>
|
|
53
|
+
* <TableBody>
|
|
54
|
+
* <TableRow id="ada">
|
|
55
|
+
* <TableCell>Ada Lovelace</TableCell>
|
|
56
|
+
* <TableCell>Admin</TableCell>
|
|
57
|
+
* </TableRow>
|
|
58
|
+
* </TableBody>
|
|
59
|
+
* </Table>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const Table$1: {
|
|
63
|
+
(props: TableProps$1): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
displayName: "Table";
|
|
65
|
+
};
|
|
66
|
+
/** Props for the TableHeader frame. */
|
|
67
|
+
type TableHeaderProps$1<T extends object = object> = Omit<TableHeaderProps<T>, 'style' | 'className'>;
|
|
68
|
+
/**
|
|
69
|
+
* The header row group. An internal frame part — place `TableColumn`s
|
|
70
|
+
* inside it.
|
|
71
|
+
*/
|
|
72
|
+
declare const TableHeader$1: {
|
|
73
|
+
<T extends object = object>(props: TableHeaderProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
displayName: string;
|
|
75
|
+
};
|
|
76
|
+
/** Props for a TableColumn header cell. */
|
|
77
|
+
type TableColumnProps = Omit<ColumnProps, 'style' | 'className' | 'children'> & {
|
|
78
|
+
/**
|
|
79
|
+
* Column header content. Plain nodes only — the column owns its render
|
|
80
|
+
* prop internally (label + sort-direction indicator).
|
|
81
|
+
*/
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* A column header (Collection `title` role). With `allowsSorting`, React
|
|
86
|
+
* Aria makes it a keyboard-operable sort control (`aria-sort` included) and
|
|
87
|
+
* the current direction renders as an arrow Icon
|
|
88
|
+
* (`action.sortAscending` / `action.sortDescending`).
|
|
89
|
+
*
|
|
90
|
+
* Set `isRowHeader` on the column whose cells name the row for assistive
|
|
91
|
+
* technology.
|
|
92
|
+
*/
|
|
93
|
+
declare const TableColumn: {
|
|
94
|
+
({
|
|
95
|
+
children,
|
|
96
|
+
...props
|
|
97
|
+
}: TableColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
displayName: "TableColumn";
|
|
99
|
+
};
|
|
100
|
+
/** Props for the TableBody frame. */
|
|
101
|
+
type TableBodyProps$1<T extends object = object> = Omit<TableBodyProps<T>, 'style' | 'className'>;
|
|
102
|
+
/** The data row group. An internal frame part — place `TableRow`s inside. */
|
|
103
|
+
declare const TableBody$1: {
|
|
104
|
+
<T extends object = object>(props: TableBodyProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
displayName: string;
|
|
106
|
+
};
|
|
107
|
+
/** Props for a TableRow. */
|
|
108
|
+
type TableRowProps<T extends object = object> = Omit<RowProps<T>, 'style' | 'className'>;
|
|
109
|
+
/**
|
|
110
|
+
* A single data row. Entity = Selection → reads `vars.colors.input.*` and
|
|
111
|
+
* surfaces the `selected` State when the parent Table has a `selectionMode`.
|
|
112
|
+
*/
|
|
113
|
+
declare const TableRow: {
|
|
114
|
+
<T extends object = object>(props: TableRowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
displayName: "TableRow";
|
|
116
|
+
};
|
|
117
|
+
/** Props for a TableCell. */
|
|
118
|
+
type TableCellProps = Omit<CellProps, 'style' | 'className'>;
|
|
119
|
+
/**
|
|
120
|
+
* A data cell (Collection `content` role). Focusable during keyboard grid
|
|
121
|
+
* navigation; typography and color inherit from the row.
|
|
122
|
+
*/
|
|
123
|
+
declare const TableCell: {
|
|
124
|
+
(props: TableCellProps): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
displayName: "TableCell";
|
|
126
|
+
};
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type SortDescriptor, type SortDirection, Table$1 as Table, TableBody$1 as TableBody, TableBodyProps$1 as TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableHeader$1 as TableHeader, TableHeaderProps$1 as TableHeaderProps, TableProps$1 as TableProps, TableRow, TableRowProps, tableCellMeta, tableColumnMeta, tableMeta, tableRowMeta };
|