@altertable/data-app-react 0.0.0-stage → 0.72.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 +21 -0
- package/README.md +59 -2
- package/THIRD_PARTY_NOTICES +18 -0
- package/dist/chunks/index-xwy62xrb.js +16996 -0
- package/dist/chunks/index-xwy62xrb.js.map +120 -0
- package/dist/index.js +2888 -0
- package/dist/index.js.map +23 -0
- package/dist/types/actions.d.ts +53 -0
- package/dist/types/annotations/AnnotationBar.d.ts +30 -0
- package/dist/types/annotations/AnnotationControls.d.ts +10 -0
- package/dist/types/annotations/AnnotationEditor.d.ts +16 -0
- package/dist/types/annotations/AnnotationMarkers.d.ts +19 -0
- package/dist/types/annotations/AnnotationSelectionLayer.d.ts +12 -0
- package/dist/types/annotations/AnnotationTarget.d.ts +9 -0
- package/dist/types/annotations/AnnotationTooltip.d.ts +9 -0
- package/dist/types/annotations/AnnotationTrigger.d.ts +10 -0
- package/dist/types/annotations/annotation-editor-state.d.ts +58 -0
- package/dist/types/annotations/annotation-screenshot.d.ts +4 -0
- package/dist/types/annotations/annotation-targets.d.ts +34 -0
- package/dist/types/annotations/getAnnotationProps.d.ts +17 -0
- package/dist/types/annotations/styles.d.ts +3 -0
- package/dist/types/annotations/useAnnotationGeometry.d.ts +22 -0
- package/dist/types/annotations/useDataAppAnnotations.d.ts +22 -0
- package/dist/types/app-context.d.ts +3 -0
- package/dist/types/bindings.d.ts +169 -0
- package/dist/types/content.d.ts +36 -0
- package/dist/types/date-formatting.d.ts +12 -0
- package/dist/types/details.d.ts +46 -0
- package/dist/types/exploration.d.ts +44 -0
- package/dist/types/hooks.d.ts +114 -0
- package/dist/types/index.d.ts +78 -0
- package/dist/types/injectStyles.d.ts +7 -0
- package/dist/types/mount.d.ts +13 -0
- package/dist/types/search-suggestions.d.ts +8 -0
- package/dist/types/source-owner.d.ts +2 -0
- package/dist/types/style-contract.d.ts +88 -0
- package/dist/types/style-validation.d.ts +2 -0
- package/dist/types/styles.d.ts +8 -0
- package/dist/types/ui/AboutData.d.ts +73 -0
- package/dist/types/ui/AltertableLogo.d.ts +3 -0
- package/dist/types/ui/AppFooter.d.ts +6 -0
- package/dist/types/ui/AppHeader.d.ts +10 -0
- package/dist/types/ui/AppLayout.d.ts +10 -0
- package/dist/types/ui/AppScope.d.ts +7 -0
- package/dist/types/ui/AppToolbar.d.ts +30 -0
- package/dist/types/ui/AreaChart.d.ts +7 -0
- package/dist/types/ui/BarChart.d.ts +6 -0
- package/dist/types/ui/Breakdown.d.ts +13 -0
- package/dist/types/ui/Button.d.ts +12 -0
- package/dist/types/ui/ChartLegend.d.ts +32 -0
- package/dist/types/ui/Checkbox.d.ts +21 -0
- package/dist/types/ui/CheckboxGroup.d.ts +7 -0
- package/dist/types/ui/ChoicePicker.d.ts +39 -0
- package/dist/types/ui/Comparison.d.ts +14 -0
- package/dist/types/ui/ComposedChart.d.ts +41 -0
- package/dist/types/ui/ComposedChartLegend.d.ts +9 -0
- package/dist/types/ui/ContentSkeleton.d.ts +7 -0
- package/dist/types/ui/DataApp.d.ts +24 -0
- package/dist/types/ui/DataAppFrame.d.ts +52 -0
- package/dist/types/ui/DataBoundary.d.ts +14 -0
- package/dist/types/ui/DataSection.d.ts +14 -0
- package/dist/types/ui/DataSectionBoundary.d.ts +30 -0
- package/dist/types/ui/DataTable.d.ts +29 -0
- package/dist/types/ui/DataValue.d.ts +9 -0
- package/dist/types/ui/DataViewToast.d.ts +11 -0
- package/dist/types/ui/DataWidget.d.ts +37 -0
- package/dist/types/ui/DateDisplay.d.ts +9 -0
- package/dist/types/ui/DateRangePicker.d.ts +30 -0
- package/dist/types/ui/DateTimeTooltip.d.ts +10 -0
- package/dist/types/ui/DimensionPicker.d.ts +14 -0
- package/dist/types/ui/EmptyState.d.ts +6 -0
- package/dist/types/ui/ExplorationActionControl.d.ts +60 -0
- package/dist/types/ui/ExportControl.d.ts +4 -0
- package/dist/types/ui/FilterActions.d.ts +10 -0
- package/dist/types/ui/FilterBar.d.ts +3 -0
- package/dist/types/ui/FunnelChart.d.ts +20 -0
- package/dist/types/ui/GettingStarted.d.ts +6 -0
- package/dist/types/ui/GlossaryDefinition.d.ts +7 -0
- package/dist/types/ui/GlossaryExplanation.d.ts +16 -0
- package/dist/types/ui/GradientScroll.d.ts +23 -0
- package/dist/types/ui/Grid.d.ts +12 -0
- package/dist/types/ui/GridItem.d.ts +7 -0
- package/dist/types/ui/HelpPopover.d.ts +21 -0
- package/dist/types/ui/IconButton.d.ts +19 -0
- package/dist/types/ui/InspectionContext.d.ts +12 -0
- package/dist/types/ui/InspectionProvider.d.ts +29 -0
- package/dist/types/ui/JourneyChart.d.ts +10 -0
- package/dist/types/ui/Kbd.d.ts +7 -0
- package/dist/types/ui/LineChart.d.ts +7 -0
- package/dist/types/ui/LiveControl.d.ts +10 -0
- package/dist/types/ui/Menu.d.ts +13 -0
- package/dist/types/ui/MetricWidget.d.ts +51 -0
- package/dist/types/ui/NumberField.d.ts +27 -0
- package/dist/types/ui/NumberFilterPicker.d.ts +11 -0
- package/dist/types/ui/PeriodSummary.d.ts +17 -0
- package/dist/types/ui/PickerField.d.ts +23 -0
- package/dist/types/ui/PieChart.d.ts +11 -0
- package/dist/types/ui/PopoverSurface.d.ts +5 -0
- package/dist/types/ui/PresentStory.d.ts +30 -0
- package/dist/types/ui/QueryList.d.ts +14 -0
- package/dist/types/ui/RadioGroup.d.ts +18 -0
- package/dist/types/ui/Ranking.d.ts +13 -0
- package/dist/types/ui/RefreshControl.d.ts +9 -0
- package/dist/types/ui/RequestHint.d.ts +20 -0
- package/dist/types/ui/RetentionChart.d.ts +27 -0
- package/dist/types/ui/ScatterChart.d.ts +17 -0
- package/dist/types/ui/SearchField.d.ts +23 -0
- package/dist/types/ui/SearchInput.d.ts +10 -0
- package/dist/types/ui/SearchMatch.d.ts +6 -0
- package/dist/types/ui/SearchTypeahead.d.ts +15 -0
- package/dist/types/ui/SectionHeading.d.ts +8 -0
- package/dist/types/ui/Select.d.ts +22 -0
- package/dist/types/ui/SelectionMark.d.ts +5 -0
- package/dist/types/ui/Sheet.d.ts +21 -0
- package/dist/types/ui/Skeleton.d.ts +8 -0
- package/dist/types/ui/Stack.d.ts +7 -0
- package/dist/types/ui/StaticDataApp.d.ts +4 -0
- package/dist/types/ui/StatusPanel.d.ts +10 -0
- package/dist/types/ui/TableWidget.d.ts +67 -0
- package/dist/types/ui/Tabs.d.ts +10 -0
- package/dist/types/ui/TextContent.d.ts +4 -0
- package/dist/types/ui/TextWidget.d.ts +20 -0
- package/dist/types/ui/ThemeSelector.d.ts +12 -0
- package/dist/types/ui/Toast.d.ts +8 -0
- package/dist/types/ui/Tooltip.d.ts +23 -0
- package/dist/types/ui/TooltipSurface.d.ts +3 -0
- package/dist/types/ui/TrendChart.d.ts +5 -0
- package/dist/types/ui/UpdatedAt.d.ts +9 -0
- package/dist/types/ui/VariableBar.d.ts +6 -0
- package/dist/types/ui/VisualizationWidget.d.ts +43 -0
- package/dist/types/ui/WidgetDisclosure.d.ts +6 -0
- package/dist/types/ui/WidgetEvidence.d.ts +12 -0
- package/dist/types/ui/WidgetViewTabs.d.ts +16 -0
- package/dist/types/ui/chart-data.d.ts +36 -0
- package/dist/types/ui/chart-date-axis.d.ts +15 -0
- package/dist/types/ui/chart-interaction.d.ts +27 -0
- package/dist/types/ui/chart-primitives.d.ts +22 -0
- package/dist/types/ui/chart-time.d.ts +19 -0
- package/dist/types/ui/chartColor.d.ts +2 -0
- package/dist/types/ui/classNames.d.ts +1 -0
- package/dist/types/ui/csv-export.d.ts +19 -0
- package/dist/types/ui/data-context.d.ts +76 -0
- package/dist/types/ui/data-identifiers.d.ts +32 -0
- package/dist/types/ui/icons.d.ts +49 -0
- package/dist/types/ui/index.d.ts +111 -0
- package/dist/types/ui/journey-flow.d.ts +49 -0
- package/dist/types/ui/keyboard.d.ts +6 -0
- package/dist/types/ui/metric-comparison.d.ts +30 -0
- package/dist/types/ui/metric.d.ts +11 -0
- package/dist/types/ui/presentation.d.ts +25 -0
- package/dist/types/ui/search.d.ts +6 -0
- package/dist/types/ui/searchItems.d.ts +36 -0
- package/dist/types/ui/shortcuts.d.ts +45 -0
- package/dist/types/ui/story.d.ts +20 -0
- package/dist/types/ui/time-interval.d.ts +96 -0
- package/dist/types/ui/use-chart-scroll-to-end.d.ts +2 -0
- package/dist/types/ui/useAppAppearance.d.ts +3 -0
- package/dist/types/ui/useDataAppPresentation.d.ts +3 -0
- package/dist/types/ui/useSvgId.d.ts +2 -0
- package/dist/types/ui/variables.d.ts +36 -0
- package/dist/types/ui/widget-views.d.ts +3 -0
- package/dist/types/view-control-bar.d.ts +18 -0
- package/dist/types/view-controls.d.ts +20 -0
- package/dist/types/view-runtime.d.ts +34 -0
- package/dist/types/view.d.ts +87 -0
- package/dist/types/widgets.d.ts +90 -0
- package/dist/ui/index.js +3520 -0
- package/dist/ui/index.js.map +36 -0
- package/package.json +65 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,2888 @@
|
|
|
1
|
+
import {
|
|
2
|
+
injectStyles,
|
|
3
|
+
injectDataAppStyles2,
|
|
4
|
+
useDataApp,
|
|
5
|
+
DateFormattingContext,
|
|
6
|
+
useDateFormatting2,
|
|
7
|
+
AppIcon2,
|
|
8
|
+
classNames,
|
|
9
|
+
Button2,
|
|
10
|
+
EmptyState2,
|
|
11
|
+
shortcuts,
|
|
12
|
+
Kbd,
|
|
13
|
+
TooltipProvider2,
|
|
14
|
+
Tooltip2,
|
|
15
|
+
Sheet2,
|
|
16
|
+
InspectionContext,
|
|
17
|
+
useInspectionDefaults,
|
|
18
|
+
mountDataApp2,
|
|
19
|
+
breakdownState,
|
|
20
|
+
useDeclaredResult,
|
|
21
|
+
PrimaryViewContext,
|
|
22
|
+
ownedSource,
|
|
23
|
+
DataSectionBoundary,
|
|
24
|
+
DetailView2,
|
|
25
|
+
DetailContent2,
|
|
26
|
+
useDetailNavigation2,
|
|
27
|
+
DetailRoutes,
|
|
28
|
+
resolveActions,
|
|
29
|
+
DateTimeTooltip2,
|
|
30
|
+
DateDisplay2,
|
|
31
|
+
RegisteredBinding,
|
|
32
|
+
registeredEvidence,
|
|
33
|
+
datasetTable,
|
|
34
|
+
MetricRecords,
|
|
35
|
+
exportDatasets,
|
|
36
|
+
searchVariable2,
|
|
37
|
+
choiceVariable2,
|
|
38
|
+
multiChoiceVariable2,
|
|
39
|
+
dateRangeVariable2,
|
|
40
|
+
sectionContent,
|
|
41
|
+
SearchSuggestionsContext,
|
|
42
|
+
Select2,
|
|
43
|
+
Skeleton2,
|
|
44
|
+
createDataHooks2,
|
|
45
|
+
useDataAppAnnotations2,
|
|
46
|
+
AnnotationTooltip,
|
|
47
|
+
IconButton2,
|
|
48
|
+
TextContent2,
|
|
49
|
+
Stack2,
|
|
50
|
+
DataAppFrame,
|
|
51
|
+
ExplorationActionControl2,
|
|
52
|
+
getAnnotationProps,
|
|
53
|
+
ContentSkeleton,
|
|
54
|
+
VisualizationWidget2,
|
|
55
|
+
comparisonChange,
|
|
56
|
+
metricComparison,
|
|
57
|
+
MetricWidget2,
|
|
58
|
+
TableWidget2,
|
|
59
|
+
TextWidget2,
|
|
60
|
+
DataValue2,
|
|
61
|
+
chartColor2,
|
|
62
|
+
createDataContext2,
|
|
63
|
+
SectionHeading2
|
|
64
|
+
} from "./chunks/index-xwy62xrb.js";
|
|
65
|
+
// packages/data-app-react/src/ui/DataApp.tsx
|
|
66
|
+
import { KEY_SEPARATOR } from "@altertable/data-app/internal";
|
|
67
|
+
import { jsx } from "react/jsx-runtime";
|
|
68
|
+
function DataApp(props) {
|
|
69
|
+
const {
|
|
70
|
+
view,
|
|
71
|
+
datasets,
|
|
72
|
+
story,
|
|
73
|
+
showSearchSuggestions = true,
|
|
74
|
+
details = [],
|
|
75
|
+
children,
|
|
76
|
+
...frame
|
|
77
|
+
} = props;
|
|
78
|
+
const app = useDataApp();
|
|
79
|
+
const result = useDeclaredResult(view);
|
|
80
|
+
const source = ownedSource(view, result.snapshot ?? { loading: true });
|
|
81
|
+
const suggestionGroups = showSearchSuggestions && frame.showSearch !== false && result.searchControls ? datasets.flatMap((dataset, index) => {
|
|
82
|
+
const reading = dataset.readSearchSuggestions(source);
|
|
83
|
+
if (!reading)
|
|
84
|
+
return [];
|
|
85
|
+
return [
|
|
86
|
+
reading.loading ? [] : reading.value.map((item) => ({
|
|
87
|
+
...item,
|
|
88
|
+
id: [index, item.id].join(KEY_SEPARATOR)
|
|
89
|
+
}))
|
|
90
|
+
];
|
|
91
|
+
}) : [];
|
|
92
|
+
return /* @__PURE__ */ jsx(DateFormattingContext, {
|
|
93
|
+
value: { timeZone: result.timeZone },
|
|
94
|
+
children: /* @__PURE__ */ jsx(SearchSuggestionsContext, {
|
|
95
|
+
value: suggestionGroups.length ? {
|
|
96
|
+
groups: suggestionGroups,
|
|
97
|
+
busy: result.refreshing
|
|
98
|
+
} : null,
|
|
99
|
+
children: /* @__PURE__ */ jsx(PrimaryViewContext, {
|
|
100
|
+
value: { declaration: view, result },
|
|
101
|
+
children: /* @__PURE__ */ jsx(DetailRoutes, {
|
|
102
|
+
details,
|
|
103
|
+
children: /* @__PURE__ */ jsx(DataAppFrame, {
|
|
104
|
+
...frame,
|
|
105
|
+
request: result,
|
|
106
|
+
dataContext: result.dataContext,
|
|
107
|
+
story: (snapshot) => story(ownedSource(view, snapshot)).map((finding) => ({
|
|
108
|
+
...finding,
|
|
109
|
+
evidence: registeredEvidence(finding.evidence, view)
|
|
110
|
+
})),
|
|
111
|
+
csvExport: (snapshot) => exportDatasets(datasets, ownedSource(view, snapshot), view.scope(snapshot), app.title),
|
|
112
|
+
children
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// packages/data-app-react/src/ui/Grid.tsx
|
|
120
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
121
|
+
function Grid({
|
|
122
|
+
children,
|
|
123
|
+
columns = 1,
|
|
124
|
+
minItemWidth = "regular",
|
|
125
|
+
gap = "lg",
|
|
126
|
+
align = "start",
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}) {
|
|
130
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
131
|
+
...props,
|
|
132
|
+
className: classNames("altertable-grid", className),
|
|
133
|
+
"data-columns": columns,
|
|
134
|
+
"data-min-item-width": minItemWidth,
|
|
135
|
+
"data-gap": gap,
|
|
136
|
+
"data-align": align,
|
|
137
|
+
children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// packages/data-app-react/src/ui/GridItem.tsx
|
|
141
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
142
|
+
function GridItem({
|
|
143
|
+
children,
|
|
144
|
+
span = 1,
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}) {
|
|
148
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
149
|
+
...props,
|
|
150
|
+
className: classNames("altertable-grid-item", className),
|
|
151
|
+
"data-span": span,
|
|
152
|
+
children
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// packages/data-app-react/src/widgets.tsx
|
|
156
|
+
import { useEffect, useRef, useState } from "react";
|
|
157
|
+
import { formatMetric } from "@altertable/data-app/format";
|
|
158
|
+
import { jsx as jsx4, jsxs, Fragment } from "react/jsx-runtime";
|
|
159
|
+
function MetricWidget({
|
|
160
|
+
metric,
|
|
161
|
+
source,
|
|
162
|
+
records,
|
|
163
|
+
actions,
|
|
164
|
+
action,
|
|
165
|
+
...presentation
|
|
166
|
+
}) {
|
|
167
|
+
const navigation = useDetailNavigation2();
|
|
168
|
+
const itemActions = resolveActions(actions, metric, RegisteredBinding.owner(metric), source, (target, input, trigger) => navigation.open(target, input, trigger));
|
|
169
|
+
const [widgetElement, setWidgetElement] = useState(null);
|
|
170
|
+
const availableActions = itemActions(undefined);
|
|
171
|
+
return /* @__PURE__ */ jsx4(MetricWidget2, {
|
|
172
|
+
...presentation,
|
|
173
|
+
ref: setWidgetElement,
|
|
174
|
+
metric: metric.definition,
|
|
175
|
+
reading: metric.read(source),
|
|
176
|
+
action: action || availableActions.length ? /* @__PURE__ */ jsxs(Fragment, {
|
|
177
|
+
children: [
|
|
178
|
+
action,
|
|
179
|
+
/* @__PURE__ */ jsx4(ExplorationActionControl2, {
|
|
180
|
+
actions: availableActions,
|
|
181
|
+
ariaLabel: metric.definition.label
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
}) : undefined,
|
|
185
|
+
records: records ? MetricRecords.render(records, metric, source, {
|
|
186
|
+
open(target, input) {
|
|
187
|
+
navigation.open(target, input, widgetElement?.querySelector("header button"));
|
|
188
|
+
}
|
|
189
|
+
}) : undefined
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function TableWidget({
|
|
193
|
+
dataset,
|
|
194
|
+
source,
|
|
195
|
+
title,
|
|
196
|
+
actions,
|
|
197
|
+
...presentation
|
|
198
|
+
}) {
|
|
199
|
+
const data = datasetTable(dataset, source);
|
|
200
|
+
const navigation = useDetailNavigation2();
|
|
201
|
+
const itemActions = resolveActions(actions, dataset, RegisteredBinding.owner(dataset), source, (target, input, trigger) => navigation.open(target, input, trigger));
|
|
202
|
+
const hasRowActions = actions && (data.reading.loading || data.reading.value.some((row) => itemActions(row).length > 0));
|
|
203
|
+
return /* @__PURE__ */ jsx4(TableWidget2, {
|
|
204
|
+
...presentation,
|
|
205
|
+
...data,
|
|
206
|
+
title: title ?? data.title,
|
|
207
|
+
columns: hasRowActions ? [
|
|
208
|
+
...data.columns,
|
|
209
|
+
{
|
|
210
|
+
id: "$exploration-actions",
|
|
211
|
+
header: "Actions",
|
|
212
|
+
cell: (row) => /* @__PURE__ */ jsx4(ExplorationActionControl2, {
|
|
213
|
+
actions: itemActions(row),
|
|
214
|
+
ariaLabel: `${data.title}: ${data.rowKey(row)}`
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
] : data.columns
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function VisualizationWidget({
|
|
221
|
+
dataset,
|
|
222
|
+
source,
|
|
223
|
+
title,
|
|
224
|
+
actions,
|
|
225
|
+
breakdown,
|
|
226
|
+
children,
|
|
227
|
+
views,
|
|
228
|
+
viewLabel,
|
|
229
|
+
initialView,
|
|
230
|
+
...presentation
|
|
231
|
+
}) {
|
|
232
|
+
const data = datasetTable(dataset, source);
|
|
233
|
+
const navigation = useDetailNavigation2();
|
|
234
|
+
const itemActions = resolveActions(actions, dataset, RegisteredBinding.owner(dataset), source, (target, input, trigger) => navigation.open(target, input, trigger));
|
|
235
|
+
const state = breakdown && breakdownState(breakdown, RegisteredBinding.owner(dataset));
|
|
236
|
+
const controlRef = useRef(null);
|
|
237
|
+
const recoverFocus = useRef(false);
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
if (recoverFocus.current) {
|
|
240
|
+
recoverFocus.current = false;
|
|
241
|
+
controlRef.current?.querySelector("button")?.focus();
|
|
242
|
+
}
|
|
243
|
+
}, [state?.value]);
|
|
244
|
+
function resolvedActions(row) {
|
|
245
|
+
return itemActions(row).map((action) => ({
|
|
246
|
+
...action,
|
|
247
|
+
onSelect(trigger) {
|
|
248
|
+
recoverFocus.current = true;
|
|
249
|
+
action.onSelect(trigger);
|
|
250
|
+
}
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
const action = state ? /* @__PURE__ */ jsx4("div", {
|
|
254
|
+
ref: controlRef,
|
|
255
|
+
children: /* @__PURE__ */ jsx4(Select2, {
|
|
256
|
+
label: state.variable.label ?? "Break down by",
|
|
257
|
+
labelPlacement: "inline",
|
|
258
|
+
icon: "breakdown",
|
|
259
|
+
size: "compact",
|
|
260
|
+
align: "end",
|
|
261
|
+
options: state.options.map((level) => ({
|
|
262
|
+
id: level.id,
|
|
263
|
+
label: level.label
|
|
264
|
+
})),
|
|
265
|
+
value: state.value,
|
|
266
|
+
onChange: (id) => state.set(id)
|
|
267
|
+
})
|
|
268
|
+
}) : presentation.action;
|
|
269
|
+
const common = {
|
|
270
|
+
...presentation,
|
|
271
|
+
action,
|
|
272
|
+
title: title ?? data.title,
|
|
273
|
+
reading: data.reading,
|
|
274
|
+
evidence: data.evidence,
|
|
275
|
+
emptyFallback: data.emptyFallback,
|
|
276
|
+
isEmpty: (rows) => rows.length === 0
|
|
277
|
+
};
|
|
278
|
+
return children ? /* @__PURE__ */ jsx4(VisualizationWidget2, {
|
|
279
|
+
...common,
|
|
280
|
+
children: (rows) => children(rows, resolvedActions)
|
|
281
|
+
}) : /* @__PURE__ */ jsx4(VisualizationWidget2, {
|
|
282
|
+
...common,
|
|
283
|
+
views: views.map((view) => ({
|
|
284
|
+
...view,
|
|
285
|
+
render: (rows) => view.render(rows, resolvedActions)
|
|
286
|
+
})),
|
|
287
|
+
viewLabel,
|
|
288
|
+
initialView
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function TextWidget(props) {
|
|
292
|
+
if (props.metric) {
|
|
293
|
+
const { metric, source, title, children, ...presentation } = props;
|
|
294
|
+
return /* @__PURE__ */ jsx4(TextWidget2, {
|
|
295
|
+
...presentation,
|
|
296
|
+
title: title ?? metric.definition.label,
|
|
297
|
+
evidence: metric.definition.evidence,
|
|
298
|
+
reading: metric.read(source),
|
|
299
|
+
children: children ?? ((values) => formatMetric(values.current, metric.definition.format))
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const { dataset, source, title, children, ...presentation } = props;
|
|
303
|
+
return /* @__PURE__ */ jsx4(TextWidget2, {
|
|
304
|
+
...presentation,
|
|
305
|
+
title: title ?? dataset.name,
|
|
306
|
+
evidence: dataset.evidence,
|
|
307
|
+
reading: dataset.read(source),
|
|
308
|
+
children
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function DataValue(props) {
|
|
312
|
+
if (props.metric) {
|
|
313
|
+
const {
|
|
314
|
+
metric,
|
|
315
|
+
source,
|
|
316
|
+
children,
|
|
317
|
+
loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
|
|
318
|
+
inline: true
|
|
319
|
+
}),
|
|
320
|
+
...presentation
|
|
321
|
+
} = props;
|
|
322
|
+
return /* @__PURE__ */ jsx4(DataValue2, {
|
|
323
|
+
...presentation,
|
|
324
|
+
reading: metric.read(source),
|
|
325
|
+
loadingFallback,
|
|
326
|
+
children: children ?? ((values) => formatMetric(values.current, metric.definition.format))
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (props.dataset) {
|
|
330
|
+
const {
|
|
331
|
+
dataset,
|
|
332
|
+
source,
|
|
333
|
+
children,
|
|
334
|
+
loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
|
|
335
|
+
inline: true
|
|
336
|
+
}),
|
|
337
|
+
...presentation
|
|
338
|
+
} = props;
|
|
339
|
+
return /* @__PURE__ */ jsx4(DataValue2, {
|
|
340
|
+
...presentation,
|
|
341
|
+
reading: dataset.read(source),
|
|
342
|
+
loadingFallback,
|
|
343
|
+
children
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
const {
|
|
347
|
+
scope,
|
|
348
|
+
children,
|
|
349
|
+
loadingFallback = /* @__PURE__ */ jsx4(Skeleton2, {
|
|
350
|
+
inline: true
|
|
351
|
+
}),
|
|
352
|
+
...presentation
|
|
353
|
+
} = props;
|
|
354
|
+
return /* @__PURE__ */ jsx4(DataValue2, {
|
|
355
|
+
...presentation,
|
|
356
|
+
reading: scope,
|
|
357
|
+
loadingFallback,
|
|
358
|
+
children: children ?? ((value) => value)
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
// packages/data-app-react/src/ui/Breakdown.tsx
|
|
362
|
+
import { formatCount, formatPercent } from "@altertable/data-app/format";
|
|
363
|
+
import { invariant } from "@altertable/data-app/internal";
|
|
364
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
365
|
+
function Breakdown({
|
|
366
|
+
total,
|
|
367
|
+
items,
|
|
368
|
+
formatValue = formatCount,
|
|
369
|
+
className,
|
|
370
|
+
...props
|
|
371
|
+
}) {
|
|
372
|
+
invariant(Number.isFinite(total) && total >= 0 && items.every((item) => Number.isFinite(item.value) && item.value >= 0) && items.reduce((sum, item) => sum + item.value, 0) <= total, "Breakdown items must be nonnegative parts of the observed total.");
|
|
373
|
+
const dominant = total > 0 && items.some((item) => item.value / total >= 0.85);
|
|
374
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
375
|
+
...props,
|
|
376
|
+
className: classNames("altertable-breakdown", className),
|
|
377
|
+
"data-dominant": dominant || undefined,
|
|
378
|
+
children: [
|
|
379
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
380
|
+
className: "altertable-breakdown-summary",
|
|
381
|
+
children: [
|
|
382
|
+
/* @__PURE__ */ jsx5("span", {
|
|
383
|
+
children: "Share of total"
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ jsxs2("strong", {
|
|
386
|
+
children: [
|
|
387
|
+
formatValue(total),
|
|
388
|
+
" total"
|
|
389
|
+
]
|
|
390
|
+
})
|
|
391
|
+
]
|
|
392
|
+
}),
|
|
393
|
+
/* @__PURE__ */ jsx5("div", {
|
|
394
|
+
className: "altertable-breakdown-bar",
|
|
395
|
+
"aria-hidden": "true",
|
|
396
|
+
children: items.map((item) => /* @__PURE__ */ jsx5("span", {
|
|
397
|
+
style: {
|
|
398
|
+
width: `${total ? item.value / total * 100 : 0}%`,
|
|
399
|
+
backgroundColor: chartColor2(item.id)
|
|
400
|
+
}
|
|
401
|
+
}, item.id))
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ jsx5("dl", {
|
|
404
|
+
className: "altertable-breakdown-list",
|
|
405
|
+
children: items.map((item) => {
|
|
406
|
+
const share = total ? item.value / total : 0;
|
|
407
|
+
const color = {
|
|
408
|
+
"--altertable-breakdown-color": chartColor2(item.id)
|
|
409
|
+
};
|
|
410
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
411
|
+
className: "altertable-breakdown-row",
|
|
412
|
+
"data-empty": item.value === 0 || undefined,
|
|
413
|
+
style: color,
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsxs2("dt", {
|
|
416
|
+
children: [
|
|
417
|
+
/* @__PURE__ */ jsx5("span", {
|
|
418
|
+
className: "altertable-breakdown-swatch",
|
|
419
|
+
"aria-hidden": "true"
|
|
420
|
+
}),
|
|
421
|
+
item.label
|
|
422
|
+
]
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ jsx5("dd", {
|
|
425
|
+
className: "altertable-breakdown-value",
|
|
426
|
+
children: formatValue(item.value)
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ jsx5("dd", {
|
|
429
|
+
className: "altertable-breakdown-share",
|
|
430
|
+
children: formatPercent(share)
|
|
431
|
+
})
|
|
432
|
+
]
|
|
433
|
+
}, item.id);
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
]
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
// packages/data-app-react/src/ui/Ranking.tsx
|
|
440
|
+
import { formatCount as formatCount2 } from "@altertable/data-app/format";
|
|
441
|
+
import { invariant as invariant2 } from "@altertable/data-app/internal";
|
|
442
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
443
|
+
function Ranking({
|
|
444
|
+
items,
|
|
445
|
+
formatValue = formatCount2,
|
|
446
|
+
className,
|
|
447
|
+
...props
|
|
448
|
+
}) {
|
|
449
|
+
invariant2(items.every((item) => Number.isFinite(item.value) && item.value >= 0), "Ranking values must be finite and nonnegative.");
|
|
450
|
+
const max = Math.max(0, ...items.map((item) => item.value));
|
|
451
|
+
return /* @__PURE__ */ jsx6("ol", {
|
|
452
|
+
...props,
|
|
453
|
+
className: classNames("altertable-ranking", className),
|
|
454
|
+
children: items.map((item) => /* @__PURE__ */ jsxs3("li", {
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
457
|
+
className: "altertable-ranking-reading",
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ jsx6("span", {
|
|
460
|
+
children: item.label
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ jsx6("strong", {
|
|
463
|
+
children: formatValue(item.value)
|
|
464
|
+
})
|
|
465
|
+
]
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ jsx6("div", {
|
|
468
|
+
className: "altertable-ranking-track",
|
|
469
|
+
"aria-hidden": "true",
|
|
470
|
+
children: /* @__PURE__ */ jsx6("span", {
|
|
471
|
+
style: { width: `${max ? item.value / max * 100 : 0}%` }
|
|
472
|
+
})
|
|
473
|
+
}),
|
|
474
|
+
item.detail != null && /* @__PURE__ */ jsx6("div", {
|
|
475
|
+
className: "altertable-ranking-detail",
|
|
476
|
+
children: item.detail
|
|
477
|
+
})
|
|
478
|
+
]
|
|
479
|
+
}, item.id))
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
// packages/data-app-react/src/ui/Comparison.tsx
|
|
483
|
+
import { jsx as jsx7, jsxs as jsxs4, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
484
|
+
function Comparison(props) {
|
|
485
|
+
const dateFormatting = useDateFormatting2();
|
|
486
|
+
if ("metric" in props) {
|
|
487
|
+
if (props.reading.loading)
|
|
488
|
+
return /* @__PURE__ */ jsx7(ContentSkeleton, {
|
|
489
|
+
variant: "panel"
|
|
490
|
+
});
|
|
491
|
+
const comparison = metricComparison(props.metric, props.reading, dateFormatting);
|
|
492
|
+
if (!comparison)
|
|
493
|
+
return null;
|
|
494
|
+
return /* @__PURE__ */ jsx7(ComparisonContent, {
|
|
495
|
+
...comparison,
|
|
496
|
+
label: props.metric.label,
|
|
497
|
+
emphasis: props.emphasis
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return /* @__PURE__ */ jsx7(ComparisonContent, {
|
|
501
|
+
...props
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
function ComparisonContent({
|
|
505
|
+
label,
|
|
506
|
+
current,
|
|
507
|
+
previous,
|
|
508
|
+
favorableDirection,
|
|
509
|
+
emphasis = "standard"
|
|
510
|
+
}) {
|
|
511
|
+
const max = Math.max(current.value, previous?.value ?? 0, 1);
|
|
512
|
+
const { percent, tone, icon } = comparisonChange({
|
|
513
|
+
current,
|
|
514
|
+
previous,
|
|
515
|
+
favorableDirection
|
|
516
|
+
});
|
|
517
|
+
return /* @__PURE__ */ jsxs4("figure", {
|
|
518
|
+
className: "altertable-comparison-visual",
|
|
519
|
+
"data-emphasis": emphasis,
|
|
520
|
+
"aria-label": `${label} comparison`,
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ jsx7("figcaption", {
|
|
523
|
+
children: label
|
|
524
|
+
}),
|
|
525
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
526
|
+
className: "altertable-comparison-row",
|
|
527
|
+
"data-period": "current",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
530
|
+
children: [
|
|
531
|
+
/* @__PURE__ */ jsx7("span", {
|
|
532
|
+
children: current.periodLabel ?? "Current period"
|
|
533
|
+
}),
|
|
534
|
+
/* @__PURE__ */ jsx7("strong", {
|
|
535
|
+
children: current.formattedValue
|
|
536
|
+
})
|
|
537
|
+
]
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ jsx7("span", {
|
|
540
|
+
className: "altertable-comparison-track",
|
|
541
|
+
children: /* @__PURE__ */ jsx7("span", {
|
|
542
|
+
style: { width: `${current.value / max * 100}%` }
|
|
543
|
+
})
|
|
544
|
+
})
|
|
545
|
+
]
|
|
546
|
+
}),
|
|
547
|
+
previous && /* @__PURE__ */ jsxs4("div", {
|
|
548
|
+
className: "altertable-comparison-row",
|
|
549
|
+
"data-period": "previous",
|
|
550
|
+
children: [
|
|
551
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
552
|
+
children: [
|
|
553
|
+
/* @__PURE__ */ jsx7("span", {
|
|
554
|
+
children: previous.periodLabel ?? "Previous period"
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ jsx7("strong", {
|
|
557
|
+
children: previous.formattedValue
|
|
558
|
+
})
|
|
559
|
+
]
|
|
560
|
+
}),
|
|
561
|
+
/* @__PURE__ */ jsx7("span", {
|
|
562
|
+
className: "altertable-comparison-track",
|
|
563
|
+
children: /* @__PURE__ */ jsx7("span", {
|
|
564
|
+
style: { width: `${(previous.value ?? 0) / max * 100}%` }
|
|
565
|
+
})
|
|
566
|
+
})
|
|
567
|
+
]
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ jsx7("p", {
|
|
570
|
+
className: "altertable-comparison-change",
|
|
571
|
+
"data-tone": tone,
|
|
572
|
+
children: percent === null ? "No comparable previous value" : /* @__PURE__ */ jsxs4(Fragment2, {
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ jsx7(AppIcon2, {
|
|
575
|
+
name: icon,
|
|
576
|
+
size: 17
|
|
577
|
+
}),
|
|
578
|
+
Math.abs(percent).toFixed(1),
|
|
579
|
+
"% vs",
|
|
580
|
+
" ",
|
|
581
|
+
previous?.periodLabel?.toLowerCase() ?? "previous period"
|
|
582
|
+
]
|
|
583
|
+
})
|
|
584
|
+
})
|
|
585
|
+
]
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
// packages/data-app-react/src/ui/DataSection.tsx
|
|
589
|
+
import { useContext } from "react";
|
|
590
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
591
|
+
function DataSection({
|
|
592
|
+
content,
|
|
593
|
+
...presentation
|
|
594
|
+
}) {
|
|
595
|
+
const primary = useContext(PrimaryViewContext);
|
|
596
|
+
const { view, ...section } = sectionContent(content);
|
|
597
|
+
if (primary?.declaration === view) {
|
|
598
|
+
const result = primary.result;
|
|
599
|
+
return /* @__PURE__ */ jsx8(DataSectionBoundary, {
|
|
600
|
+
...section,
|
|
601
|
+
...presentation,
|
|
602
|
+
result,
|
|
603
|
+
notice: "none"
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
return /* @__PURE__ */ jsx8(IndependentSection, {
|
|
607
|
+
view,
|
|
608
|
+
...section,
|
|
609
|
+
...presentation
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
function IndependentSection({
|
|
613
|
+
view,
|
|
614
|
+
...props
|
|
615
|
+
}) {
|
|
616
|
+
const result = useDeclaredResult(view);
|
|
617
|
+
const defaults = useInspectionDefaults();
|
|
618
|
+
const section = /* @__PURE__ */ jsx8(DataSectionBoundary, {
|
|
619
|
+
...props,
|
|
620
|
+
result,
|
|
621
|
+
notice: "inline"
|
|
622
|
+
});
|
|
623
|
+
return /* @__PURE__ */ jsx8(DateFormattingContext, {
|
|
624
|
+
value: { timeZone: result.timeZone },
|
|
625
|
+
children: /* @__PURE__ */ jsx8(InspectionContext, {
|
|
626
|
+
value: {
|
|
627
|
+
...defaults,
|
|
628
|
+
dataContext: result.dataContext,
|
|
629
|
+
queries: result.queries
|
|
630
|
+
},
|
|
631
|
+
children: section
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
// packages/data-app-react/src/ui/UpdatedAt.tsx
|
|
636
|
+
import { parseDateTime } from "@altertable/data-app/format";
|
|
637
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
638
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
639
|
+
function UpdatedAt({
|
|
640
|
+
timestamp,
|
|
641
|
+
locale,
|
|
642
|
+
label = "Updated",
|
|
643
|
+
children,
|
|
644
|
+
triggerProps,
|
|
645
|
+
...props
|
|
646
|
+
}) {
|
|
647
|
+
const defaults = useDateFormatting2({ locale, timeZone: props.timeZone });
|
|
648
|
+
const [now, setNow] = useState2(Date.now);
|
|
649
|
+
useEffect2(() => {
|
|
650
|
+
const interval = window.setInterval(() => setNow(Date.now()), 30000);
|
|
651
|
+
return () => window.clearInterval(interval);
|
|
652
|
+
}, []);
|
|
653
|
+
const elapsedMinutes = Math.floor(Math.max(0, now - timestamp) / 60000);
|
|
654
|
+
const relative = new Intl.RelativeTimeFormat(defaults.locale, {
|
|
655
|
+
numeric: "auto"
|
|
656
|
+
});
|
|
657
|
+
let age = "just now";
|
|
658
|
+
if (elapsedMinutes >= 1440)
|
|
659
|
+
age = relative.format(-Math.floor(elapsedMinutes / 1440), "day");
|
|
660
|
+
else if (elapsedMinutes >= 60)
|
|
661
|
+
age = relative.format(-Math.floor(elapsedMinutes / 60), "hour");
|
|
662
|
+
else if (elapsedMinutes >= 1)
|
|
663
|
+
age = relative.format(-elapsedMinutes, "minute");
|
|
664
|
+
const date = parseDateTime(timestamp);
|
|
665
|
+
if (!date)
|
|
666
|
+
return /* @__PURE__ */ jsx9("span", {
|
|
667
|
+
children: children ?? `${label} —`
|
|
668
|
+
});
|
|
669
|
+
return /* @__PURE__ */ jsx9(DateTimeTooltip2, {
|
|
670
|
+
...props,
|
|
671
|
+
...defaults,
|
|
672
|
+
date,
|
|
673
|
+
triggerProps: {
|
|
674
|
+
...triggerProps,
|
|
675
|
+
className: ["altertable-updated-at", triggerProps?.className].filter(Boolean).join(" ")
|
|
676
|
+
},
|
|
677
|
+
children: children ?? /* @__PURE__ */ jsxs5("time", {
|
|
678
|
+
dateTime: date.toISOString(),
|
|
679
|
+
children: [
|
|
680
|
+
label,
|
|
681
|
+
" ",
|
|
682
|
+
age
|
|
683
|
+
]
|
|
684
|
+
})
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
// packages/data-app-react/src/ui/PeriodSummary.tsx
|
|
688
|
+
import {
|
|
689
|
+
formatDateRange,
|
|
690
|
+
formatDateTime,
|
|
691
|
+
parseDateTime as parseDateTime2
|
|
692
|
+
} from "@altertable/data-app/format";
|
|
693
|
+
import { jsx as jsx10, jsxs as jsxs6, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
694
|
+
function duration(period) {
|
|
695
|
+
return `${period.amount} ${period.unit}${period.amount === 1 ? "" : "s"}`;
|
|
696
|
+
}
|
|
697
|
+
function label(period, options = {}) {
|
|
698
|
+
if (period.kind === "rolling")
|
|
699
|
+
return `Last ${duration(period)}`;
|
|
700
|
+
return formatDateRange(period, options);
|
|
701
|
+
}
|
|
702
|
+
function comparisonLabel(period, comparison, options) {
|
|
703
|
+
if (comparison.kind === "period") {
|
|
704
|
+
if (comparison.period.kind === "calendar")
|
|
705
|
+
return label(comparison.period, options);
|
|
706
|
+
return `${duration(comparison.period)} ending ${formatDateTime(comparison.period.end, options)}`;
|
|
707
|
+
}
|
|
708
|
+
return period.kind === "rolling" ? `Previous ${duration(period)}` : "Previous period";
|
|
709
|
+
}
|
|
710
|
+
function reportingPeriodText(period, options = {}) {
|
|
711
|
+
if (period.kind === "calendar")
|
|
712
|
+
return `${label(period, options)} in ${period.timeZone}`;
|
|
713
|
+
const end = parseDateTime2(period.end);
|
|
714
|
+
if (!end)
|
|
715
|
+
return label(period, options);
|
|
716
|
+
const start = new Date(end.getTime() - period.amount * (period.unit === "hour" ? 3600000 : 86400000));
|
|
717
|
+
return `${label(period, options)}, ${formatDateTime(start, options)} to ${formatDateTime(end, options)} in ${options.timeZone ?? "UTC"}`;
|
|
718
|
+
}
|
|
719
|
+
function PeriodSummary({
|
|
720
|
+
period,
|
|
721
|
+
comparison,
|
|
722
|
+
className
|
|
723
|
+
}) {
|
|
724
|
+
const options = useDateFormatting2();
|
|
725
|
+
const comparisonText = comparison ? comparisonLabel(period, comparison, options) : null;
|
|
726
|
+
const comparisonDetail = comparison?.kind === "period" ? reportingPeriodText(comparison.period, options) : comparisonText;
|
|
727
|
+
return /* @__PURE__ */ jsxs6("p", {
|
|
728
|
+
className: classNames("altertable-period-summary", className),
|
|
729
|
+
children: [
|
|
730
|
+
/* @__PURE__ */ jsx10("span", {
|
|
731
|
+
className: "altertable-sr-only",
|
|
732
|
+
children: `Reporting period: ${reportingPeriodText(period, options)}${comparisonDetail ? `, compared with ${comparisonDetail}` : ""}`
|
|
733
|
+
}),
|
|
734
|
+
/* @__PURE__ */ jsxs6("span", {
|
|
735
|
+
"aria-hidden": "true",
|
|
736
|
+
className: "altertable-period-summary-visible",
|
|
737
|
+
children: [
|
|
738
|
+
/* @__PURE__ */ jsx10(AppIcon2, {
|
|
739
|
+
name: period.kind === "rolling" ? "clock" : "calendar",
|
|
740
|
+
size: 16
|
|
741
|
+
}),
|
|
742
|
+
/* @__PURE__ */ jsx10("span", {
|
|
743
|
+
className: "altertable-period-summary-current",
|
|
744
|
+
children: label(period, options)
|
|
745
|
+
}),
|
|
746
|
+
comparisonText && /* @__PURE__ */ jsxs6(Fragment3, {
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ jsx10("span", {
|
|
749
|
+
className: "altertable-period-summary-vs",
|
|
750
|
+
"aria-hidden": "true",
|
|
751
|
+
children: "vs"
|
|
752
|
+
}),
|
|
753
|
+
/* @__PURE__ */ jsx10("span", {
|
|
754
|
+
children: comparisonText
|
|
755
|
+
})
|
|
756
|
+
]
|
|
757
|
+
})
|
|
758
|
+
]
|
|
759
|
+
})
|
|
760
|
+
]
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
// packages/data-app-react/src/ui/data-identifiers.tsx
|
|
764
|
+
import { invariant as invariant3 } from "@altertable/data-app/internal";
|
|
765
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
766
|
+
function qualifiedName(definition) {
|
|
767
|
+
const table = definition.kind === "table" ? definition : definition.table;
|
|
768
|
+
const path = [table.catalog, table.schema, table.name].join(".");
|
|
769
|
+
return definition.kind === "column" ? `${path}.${definition.name}` : path;
|
|
770
|
+
}
|
|
771
|
+
function assertAlias(id) {
|
|
772
|
+
invariant3(!!id && !id.includes("."), `Invalid data identifier alias ${id}.`);
|
|
773
|
+
}
|
|
774
|
+
function defineDataIdentifiers({ tables, columns }) {
|
|
775
|
+
const definitions = Object.create(null);
|
|
776
|
+
for (const [id, table] of Object.entries(tables)) {
|
|
777
|
+
assertAlias(id);
|
|
778
|
+
definitions[`tables.${id}`] = { kind: "table", ...table };
|
|
779
|
+
}
|
|
780
|
+
for (const [id, column] of Object.entries(columns)) {
|
|
781
|
+
assertAlias(id);
|
|
782
|
+
const table = tables[column.table];
|
|
783
|
+
invariant3(table, `Unknown table ${column.table} for column ${id}.`);
|
|
784
|
+
definitions[`columns.${column.table}.${id}`] = {
|
|
785
|
+
kind: "column",
|
|
786
|
+
tableId: `tables.${column.table}`,
|
|
787
|
+
table,
|
|
788
|
+
name: column.name
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
function DataIdentifier({
|
|
792
|
+
id,
|
|
793
|
+
display
|
|
794
|
+
}) {
|
|
795
|
+
const definition = definitions[id];
|
|
796
|
+
invariant3(definition, `Unknown data identifier ${id}.`);
|
|
797
|
+
const qualified = qualifiedName(definition);
|
|
798
|
+
const shown = display ?? (definition.kind === "table" ? "qualified" : "short");
|
|
799
|
+
const table = definition.kind === "table" ? definition : definition.table;
|
|
800
|
+
const prefix = definition.kind === "table" ? [table.catalog, table.schema] : [table.catalog, table.schema, table.name];
|
|
801
|
+
return /* @__PURE__ */ jsxs7("code", {
|
|
802
|
+
className: "altertable-data-identifier",
|
|
803
|
+
"data-kind": definition.kind,
|
|
804
|
+
title: qualified,
|
|
805
|
+
"data-identifier-id": id,
|
|
806
|
+
children: [
|
|
807
|
+
shown === "qualified" && /* @__PURE__ */ jsx11("span", {
|
|
808
|
+
className: "altertable-data-identifier-path",
|
|
809
|
+
children: prefix.map((segment, index) => /* @__PURE__ */ jsxs7("span", {
|
|
810
|
+
children: [
|
|
811
|
+
segment,
|
|
812
|
+
".",
|
|
813
|
+
/* @__PURE__ */ jsx11("wbr", {})
|
|
814
|
+
]
|
|
815
|
+
}, index))
|
|
816
|
+
}),
|
|
817
|
+
/* @__PURE__ */ jsx11("span", {
|
|
818
|
+
className: "altertable-data-identifier-name",
|
|
819
|
+
children: definition.name
|
|
820
|
+
})
|
|
821
|
+
]
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
return {
|
|
825
|
+
definitions,
|
|
826
|
+
DataIdentifier
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
// packages/data-app-react/src/annotations/AnnotationTarget.tsx
|
|
830
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
831
|
+
function AnnotationTarget({
|
|
832
|
+
annotationId,
|
|
833
|
+
label,
|
|
834
|
+
evidence,
|
|
835
|
+
...props
|
|
836
|
+
}) {
|
|
837
|
+
return /* @__PURE__ */ jsx12("div", {
|
|
838
|
+
...props,
|
|
839
|
+
...getAnnotationProps({
|
|
840
|
+
id: annotationId,
|
|
841
|
+
label,
|
|
842
|
+
evidence,
|
|
843
|
+
kind: "element"
|
|
844
|
+
})
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
// packages/data-app-react/src/annotations/AnnotationBar.tsx
|
|
848
|
+
import {
|
|
849
|
+
useEffect as useEffect3,
|
|
850
|
+
useEffectEvent,
|
|
851
|
+
useRef as useRef2,
|
|
852
|
+
useReducer,
|
|
853
|
+
useImperativeHandle
|
|
854
|
+
} from "react";
|
|
855
|
+
import { createPortal } from "react-dom";
|
|
856
|
+
import {
|
|
857
|
+
autoUpdate,
|
|
858
|
+
flip,
|
|
859
|
+
offset,
|
|
860
|
+
shift,
|
|
861
|
+
useFloating,
|
|
862
|
+
useMergeRefs
|
|
863
|
+
} from "@floating-ui/react";
|
|
864
|
+
import {
|
|
865
|
+
GripVertical,
|
|
866
|
+
Eye,
|
|
867
|
+
EyeOff,
|
|
868
|
+
Trash2,
|
|
869
|
+
X,
|
|
870
|
+
Minus,
|
|
871
|
+
LoaderCircle
|
|
872
|
+
} from "lucide-react";
|
|
873
|
+
import {
|
|
874
|
+
parseDataAppAnnotationDraft
|
|
875
|
+
} from "@altertable/data-app/contract";
|
|
876
|
+
import { jsx as jsx13, jsxs as jsxs8, Fragment as Fragment4 } from "react/jsx-runtime";
|
|
877
|
+
function annotationBarReducer(state, action) {
|
|
878
|
+
switch (action.type) {
|
|
879
|
+
case "positionMoved":
|
|
880
|
+
return { ...state, position: action.position };
|
|
881
|
+
case "reviewToggled":
|
|
882
|
+
return { ...state, reviewOpen: !state.reviewOpen };
|
|
883
|
+
case "reviewClosed":
|
|
884
|
+
return { ...state, reviewOpen: false };
|
|
885
|
+
case "previewOpened":
|
|
886
|
+
return { ...state, previewId: action.id };
|
|
887
|
+
case "previewClosed":
|
|
888
|
+
return { ...state, previewId: undefined };
|
|
889
|
+
case "discardDialogChanged":
|
|
890
|
+
return { ...state, discardOpen: action.open };
|
|
891
|
+
case "annotationsDiscarded":
|
|
892
|
+
return { ...state, discardOpen: false, reviewOpen: false };
|
|
893
|
+
case "submissionStarted":
|
|
894
|
+
return { ...state, pending: true, error: "" };
|
|
895
|
+
case "submissionAccepted":
|
|
896
|
+
return { ...state, reviewOpen: false };
|
|
897
|
+
case "submissionFailed":
|
|
898
|
+
return { ...state, error: "Could not send annotations. Try again." };
|
|
899
|
+
case "submissionFinished":
|
|
900
|
+
return { ...state, pending: false };
|
|
901
|
+
case "annotationModeObserved":
|
|
902
|
+
return {
|
|
903
|
+
...state,
|
|
904
|
+
observedActive: action.active,
|
|
905
|
+
...!action.active ? { reviewOpen: false, previewId: undefined } : {}
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
function AnnotationBar({
|
|
910
|
+
ref,
|
|
911
|
+
annotations,
|
|
912
|
+
active = true,
|
|
913
|
+
theme = "light",
|
|
914
|
+
disabled = false,
|
|
915
|
+
deletedAnnotationId,
|
|
916
|
+
onUndoDelete,
|
|
917
|
+
onDismissUndo,
|
|
918
|
+
hasUnsavedChanges = false,
|
|
919
|
+
pinsVisible,
|
|
920
|
+
onPinsVisibleChange,
|
|
921
|
+
onSelect,
|
|
922
|
+
onDelete,
|
|
923
|
+
onClear,
|
|
924
|
+
requestDiscard,
|
|
925
|
+
onSend,
|
|
926
|
+
onClose
|
|
927
|
+
}) {
|
|
928
|
+
const reviewElement = useRef2(null);
|
|
929
|
+
const reviewTrigger = useRef2(null);
|
|
930
|
+
const cancelDiscard = useRef2(null);
|
|
931
|
+
const barRef = useRef2(null);
|
|
932
|
+
const drag = useRef2(undefined);
|
|
933
|
+
const submitting = useRef2(false);
|
|
934
|
+
const [state, dispatch] = useReducer(annotationBarReducer, {
|
|
935
|
+
reviewOpen: false,
|
|
936
|
+
pending: false,
|
|
937
|
+
error: "",
|
|
938
|
+
discardOpen: false,
|
|
939
|
+
observedActive: active
|
|
940
|
+
});
|
|
941
|
+
const { position, reviewOpen, pending, error, discardOpen, previewId } = state;
|
|
942
|
+
const preview = annotations.find((annotation) => annotation.id === previewId);
|
|
943
|
+
const locked = disabled || pending;
|
|
944
|
+
const canSend = active && !locked && !hasUnsavedChanges && annotations.length > 0;
|
|
945
|
+
const { refs, floatingStyles } = useFloating({
|
|
946
|
+
placement: "top",
|
|
947
|
+
strategy: "fixed",
|
|
948
|
+
middleware: [offset(10), flip(), shift({ padding: 12 })],
|
|
949
|
+
whileElementsMounted: autoUpdate
|
|
950
|
+
});
|
|
951
|
+
const barElementRef = useMergeRefs([refs.setReference, barRef]);
|
|
952
|
+
const reviewRef = useMergeRefs([refs.setFloating, reviewElement]);
|
|
953
|
+
function move(left, top) {
|
|
954
|
+
const rect = barRef.current?.getBoundingClientRect();
|
|
955
|
+
if (!rect)
|
|
956
|
+
return;
|
|
957
|
+
dispatch({
|
|
958
|
+
type: "positionMoved",
|
|
959
|
+
position: {
|
|
960
|
+
left: Math.max(12, Math.min(left, window.innerWidth - rect.width - 12)),
|
|
961
|
+
top: Math.max(12, Math.min(top, window.innerHeight - rect.height - 12))
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
const keepInViewport = useEffectEvent(() => {
|
|
966
|
+
if (position)
|
|
967
|
+
move(position.left, position.top);
|
|
968
|
+
});
|
|
969
|
+
useEffect3(() => {
|
|
970
|
+
window.addEventListener("resize", keepInViewport);
|
|
971
|
+
return () => window.removeEventListener("resize", keepInViewport);
|
|
972
|
+
}, []);
|
|
973
|
+
useEffect3(() => {
|
|
974
|
+
if (reviewOpen)
|
|
975
|
+
reviewElement.current?.querySelector("button")?.focus();
|
|
976
|
+
}, [reviewOpen]);
|
|
977
|
+
if (state.observedActive !== active)
|
|
978
|
+
dispatch({ type: "annotationModeObserved", active });
|
|
979
|
+
function closeReview() {
|
|
980
|
+
dispatch({ type: "reviewClosed" });
|
|
981
|
+
reviewTrigger.current?.focus();
|
|
982
|
+
}
|
|
983
|
+
async function send() {
|
|
984
|
+
if (submitting.current || !canSend)
|
|
985
|
+
return;
|
|
986
|
+
submitting.current = true;
|
|
987
|
+
dispatch({ type: "submissionStarted" });
|
|
988
|
+
try {
|
|
989
|
+
const snapshot = annotations.map(parseDataAppAnnotationDraft);
|
|
990
|
+
await onSend(snapshot);
|
|
991
|
+
dispatch({ type: "submissionAccepted" });
|
|
992
|
+
} catch {
|
|
993
|
+
dispatch({ type: "submissionFailed" });
|
|
994
|
+
} finally {
|
|
995
|
+
submitting.current = false;
|
|
996
|
+
dispatch({ type: "submissionFinished" });
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
useImperativeHandle(ref, () => ({ send }));
|
|
1000
|
+
useEffect3(() => {
|
|
1001
|
+
if (discardOpen)
|
|
1002
|
+
cancelDiscard.current?.focus();
|
|
1003
|
+
}, [discardOpen]);
|
|
1004
|
+
function discardAnnotations() {
|
|
1005
|
+
dispatch({ type: "annotationsDiscarded" });
|
|
1006
|
+
onClear();
|
|
1007
|
+
onClose();
|
|
1008
|
+
}
|
|
1009
|
+
const undo = deletedAnnotationId && onUndoDelete ? /* @__PURE__ */ jsxs8("div", {
|
|
1010
|
+
className: "altertable-annotation-undo",
|
|
1011
|
+
"data-theme": theme,
|
|
1012
|
+
"data-inline": active && reviewOpen && annotations.length > 0 || undefined,
|
|
1013
|
+
"data-bar-visible": active && annotations.length > 0 || undefined,
|
|
1014
|
+
children: [
|
|
1015
|
+
/* @__PURE__ */ jsx13("output", {
|
|
1016
|
+
children: "Annotation deleted"
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1019
|
+
variant: "ghost",
|
|
1020
|
+
onClick: () => onUndoDelete(deletedAnnotationId),
|
|
1021
|
+
children: "Undo"
|
|
1022
|
+
}),
|
|
1023
|
+
onDismissUndo && /* @__PURE__ */ jsx13(Button2, {
|
|
1024
|
+
variant: "ghost",
|
|
1025
|
+
size: "icon-compact",
|
|
1026
|
+
"aria-label": "Dismiss deleted annotation",
|
|
1027
|
+
onClick: onDismissUndo,
|
|
1028
|
+
children: /* @__PURE__ */ jsx13(X, {
|
|
1029
|
+
size: 14,
|
|
1030
|
+
"aria-hidden": true
|
|
1031
|
+
})
|
|
1032
|
+
})
|
|
1033
|
+
]
|
|
1034
|
+
}) : null;
|
|
1035
|
+
if (annotations.length === 0 && !deletedAnnotationId)
|
|
1036
|
+
return null;
|
|
1037
|
+
const style = position ? {
|
|
1038
|
+
left: position.left,
|
|
1039
|
+
top: position.top,
|
|
1040
|
+
bottom: "auto",
|
|
1041
|
+
transform: "none"
|
|
1042
|
+
} : {};
|
|
1043
|
+
return /* @__PURE__ */ jsxs8(TooltipProvider2, {
|
|
1044
|
+
children: [
|
|
1045
|
+
active && annotations.length > 0 && /* @__PURE__ */ jsxs8("div", {
|
|
1046
|
+
ref: barElementRef,
|
|
1047
|
+
className: "altertable-annotation-bar",
|
|
1048
|
+
"data-theme": theme,
|
|
1049
|
+
style,
|
|
1050
|
+
tabIndex: -1,
|
|
1051
|
+
role: "toolbar",
|
|
1052
|
+
"aria-label": "Annotations",
|
|
1053
|
+
onKeyDown: (event) => {
|
|
1054
|
+
if (event.key !== "Escape" || locked || hasUnsavedChanges)
|
|
1055
|
+
return;
|
|
1056
|
+
event.preventDefault();
|
|
1057
|
+
if (reviewOpen)
|
|
1058
|
+
closeReview();
|
|
1059
|
+
else
|
|
1060
|
+
onClose();
|
|
1061
|
+
},
|
|
1062
|
+
children: [
|
|
1063
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1064
|
+
variant: "ghost",
|
|
1065
|
+
size: "icon-compact",
|
|
1066
|
+
"aria-label": "Move annotation bar",
|
|
1067
|
+
"data-atbl-internal-drag-handle": true,
|
|
1068
|
+
disabled: locked,
|
|
1069
|
+
onPointerDown: (event) => {
|
|
1070
|
+
const rect = barRef.current?.getBoundingClientRect();
|
|
1071
|
+
if (!rect)
|
|
1072
|
+
return;
|
|
1073
|
+
drag.current = {
|
|
1074
|
+
x: event.clientX,
|
|
1075
|
+
y: event.clientY,
|
|
1076
|
+
left: rect.left,
|
|
1077
|
+
top: rect.top
|
|
1078
|
+
};
|
|
1079
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
1080
|
+
},
|
|
1081
|
+
onPointerMove: (event) => {
|
|
1082
|
+
const origin = drag.current;
|
|
1083
|
+
if (origin)
|
|
1084
|
+
move(origin.left + event.clientX - origin.x, origin.top + event.clientY - origin.y);
|
|
1085
|
+
},
|
|
1086
|
+
onPointerUp: () => {
|
|
1087
|
+
drag.current = undefined;
|
|
1088
|
+
},
|
|
1089
|
+
onPointerCancel: () => {
|
|
1090
|
+
drag.current = undefined;
|
|
1091
|
+
},
|
|
1092
|
+
onKeyDown: (event) => {
|
|
1093
|
+
const delta = {
|
|
1094
|
+
ArrowLeft: [-10, 0],
|
|
1095
|
+
ArrowRight: [10, 0],
|
|
1096
|
+
ArrowUp: [0, -10],
|
|
1097
|
+
ArrowDown: [0, 10]
|
|
1098
|
+
}[event.key];
|
|
1099
|
+
const rect = barRef.current?.getBoundingClientRect();
|
|
1100
|
+
if (!delta || !rect)
|
|
1101
|
+
return;
|
|
1102
|
+
event.preventDefault();
|
|
1103
|
+
move(rect.left + delta[0], rect.top + delta[1]);
|
|
1104
|
+
},
|
|
1105
|
+
children: /* @__PURE__ */ jsx13(GripVertical, {
|
|
1106
|
+
size: 16,
|
|
1107
|
+
"aria-hidden": true
|
|
1108
|
+
})
|
|
1109
|
+
}),
|
|
1110
|
+
/* @__PURE__ */ jsxs8(Button2, {
|
|
1111
|
+
ref: reviewTrigger,
|
|
1112
|
+
className: "altertable-annotation-bar-count",
|
|
1113
|
+
variant: "ghost",
|
|
1114
|
+
size: "compact",
|
|
1115
|
+
"aria-label": "Review annotations",
|
|
1116
|
+
"aria-expanded": reviewOpen && annotations.length > 0,
|
|
1117
|
+
"aria-haspopup": "dialog",
|
|
1118
|
+
disabled: locked || !annotations.length,
|
|
1119
|
+
onClick: () => dispatch({ type: "reviewToggled" }),
|
|
1120
|
+
children: [
|
|
1121
|
+
"Annotating · ",
|
|
1122
|
+
annotations.length
|
|
1123
|
+
]
|
|
1124
|
+
}),
|
|
1125
|
+
/* @__PURE__ */ jsx13(AnnotationTooltip, {
|
|
1126
|
+
content: pinsVisible ? "Hide annotation pins" : "Show annotation pins",
|
|
1127
|
+
theme,
|
|
1128
|
+
children: /* @__PURE__ */ jsx13(Button2, {
|
|
1129
|
+
variant: "ghost",
|
|
1130
|
+
size: "icon-compact",
|
|
1131
|
+
"aria-label": pinsVisible ? "Hide annotation pins" : "Show annotation pins",
|
|
1132
|
+
"aria-pressed": !pinsVisible,
|
|
1133
|
+
disabled: locked,
|
|
1134
|
+
onClick: () => onPinsVisibleChange(!pinsVisible),
|
|
1135
|
+
children: pinsVisible ? /* @__PURE__ */ jsx13(EyeOff, {
|
|
1136
|
+
size: 16,
|
|
1137
|
+
"aria-hidden": true
|
|
1138
|
+
}) : /* @__PURE__ */ jsx13(Eye, {
|
|
1139
|
+
size: 16,
|
|
1140
|
+
"aria-hidden": true
|
|
1141
|
+
})
|
|
1142
|
+
})
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ jsx13(AnnotationTooltip, {
|
|
1145
|
+
content: "Discard all annotations",
|
|
1146
|
+
theme,
|
|
1147
|
+
children: /* @__PURE__ */ jsx13(Button2, {
|
|
1148
|
+
variant: "ghost",
|
|
1149
|
+
size: "icon-compact",
|
|
1150
|
+
"aria-label": "Discard all annotations",
|
|
1151
|
+
disabled: locked,
|
|
1152
|
+
onClick: () => requestDiscard ? requestDiscard(discardAnnotations) : dispatch({ type: "discardDialogChanged", open: true }),
|
|
1153
|
+
children: /* @__PURE__ */ jsx13(Trash2, {
|
|
1154
|
+
size: 16,
|
|
1155
|
+
"aria-hidden": true
|
|
1156
|
+
})
|
|
1157
|
+
})
|
|
1158
|
+
}),
|
|
1159
|
+
/* @__PURE__ */ jsx13(AnnotationTooltip, {
|
|
1160
|
+
content: hasUnsavedChanges ? "Save the open annotation before sending" : /* @__PURE__ */ jsxs8(Fragment4, {
|
|
1161
|
+
children: [
|
|
1162
|
+
"Send annotations ",
|
|
1163
|
+
/* @__PURE__ */ jsx13(Kbd, {
|
|
1164
|
+
shortcut: shortcuts.sendAnnotations
|
|
1165
|
+
})
|
|
1166
|
+
]
|
|
1167
|
+
}),
|
|
1168
|
+
theme,
|
|
1169
|
+
children: /* @__PURE__ */ jsxs8(Button2, {
|
|
1170
|
+
className: "altertable-annotation-bar-send",
|
|
1171
|
+
"data-pending": pending || undefined,
|
|
1172
|
+
"aria-busy": pending,
|
|
1173
|
+
size: "compact",
|
|
1174
|
+
"aria-label": "Send annotations",
|
|
1175
|
+
disabled: !canSend,
|
|
1176
|
+
onClick: () => void send(),
|
|
1177
|
+
children: [
|
|
1178
|
+
/* @__PURE__ */ jsx13("span", {
|
|
1179
|
+
className: "altertable-annotation-bar-send-label",
|
|
1180
|
+
children: "Send"
|
|
1181
|
+
}),
|
|
1182
|
+
pending && /* @__PURE__ */ jsx13(LoaderCircle, {
|
|
1183
|
+
className: "altertable-annotation-bar-spinner",
|
|
1184
|
+
size: 16,
|
|
1185
|
+
"aria-hidden": true
|
|
1186
|
+
})
|
|
1187
|
+
]
|
|
1188
|
+
})
|
|
1189
|
+
}),
|
|
1190
|
+
/* @__PURE__ */ jsx13(AnnotationTooltip, {
|
|
1191
|
+
content: /* @__PURE__ */ jsxs8(Fragment4, {
|
|
1192
|
+
children: [
|
|
1193
|
+
hasUnsavedChanges ? "Save or discard the open annotation first" : "Exit annotation mode",
|
|
1194
|
+
" ",
|
|
1195
|
+
/* @__PURE__ */ jsx13(Kbd, {
|
|
1196
|
+
children: "Esc"
|
|
1197
|
+
})
|
|
1198
|
+
]
|
|
1199
|
+
}),
|
|
1200
|
+
theme,
|
|
1201
|
+
children: /* @__PURE__ */ jsx13(Button2, {
|
|
1202
|
+
variant: "ghost",
|
|
1203
|
+
size: "icon-compact",
|
|
1204
|
+
"aria-label": "Exit annotation mode",
|
|
1205
|
+
disabled: locked || hasUnsavedChanges,
|
|
1206
|
+
onClick: onClose,
|
|
1207
|
+
children: /* @__PURE__ */ jsx13(X, {
|
|
1208
|
+
size: 16,
|
|
1209
|
+
"aria-hidden": true
|
|
1210
|
+
})
|
|
1211
|
+
})
|
|
1212
|
+
}),
|
|
1213
|
+
error && /* @__PURE__ */ jsx13("output", {
|
|
1214
|
+
className: "altertable-annotation-bar-error",
|
|
1215
|
+
role: "alert",
|
|
1216
|
+
children: error
|
|
1217
|
+
})
|
|
1218
|
+
]
|
|
1219
|
+
}),
|
|
1220
|
+
(!active || !reviewOpen || annotations.length === 0) && undo && createPortal(undo, document.body),
|
|
1221
|
+
active && reviewOpen && annotations.length > 0 && createPortal(/* @__PURE__ */ jsxs8("dialog", {
|
|
1222
|
+
open: true,
|
|
1223
|
+
ref: reviewRef,
|
|
1224
|
+
className: "altertable-annotation-bar-panel",
|
|
1225
|
+
"data-theme": theme,
|
|
1226
|
+
style: floatingStyles,
|
|
1227
|
+
"aria-label": "Review annotations",
|
|
1228
|
+
onKeyDown: (event) => {
|
|
1229
|
+
if (event.key === "Escape") {
|
|
1230
|
+
event.preventDefault();
|
|
1231
|
+
closeReview();
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
children: [
|
|
1235
|
+
/* @__PURE__ */ jsxs8("header", {
|
|
1236
|
+
children: [
|
|
1237
|
+
/* @__PURE__ */ jsx13("strong", {
|
|
1238
|
+
children: "Annotations"
|
|
1239
|
+
}),
|
|
1240
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1241
|
+
variant: "ghost",
|
|
1242
|
+
size: "icon-compact",
|
|
1243
|
+
"aria-label": "Minimize annotation review",
|
|
1244
|
+
onClick: closeReview,
|
|
1245
|
+
children: /* @__PURE__ */ jsx13(Minus, {
|
|
1246
|
+
size: 16,
|
|
1247
|
+
"aria-hidden": true
|
|
1248
|
+
})
|
|
1249
|
+
})
|
|
1250
|
+
]
|
|
1251
|
+
}),
|
|
1252
|
+
/* @__PURE__ */ jsx13("div", {
|
|
1253
|
+
"aria-label": "Annotation drafts",
|
|
1254
|
+
children: annotations.map((annotation, index) => /* @__PURE__ */ jsxs8("div", {
|
|
1255
|
+
className: "altertable-annotation-bar-row",
|
|
1256
|
+
children: [
|
|
1257
|
+
annotation.context.screenshot && /* @__PURE__ */ jsx13("button", {
|
|
1258
|
+
"data-atbl-focus": "ring",
|
|
1259
|
+
"data-atbl-control": "action",
|
|
1260
|
+
type: "button",
|
|
1261
|
+
className: "altertable-annotation-thumbnail",
|
|
1262
|
+
"aria-label": `View screenshot of ${annotation.target.label}`,
|
|
1263
|
+
onClick: () => dispatch({ type: "previewOpened", id: annotation.id }),
|
|
1264
|
+
children: /* @__PURE__ */ jsx13("img", {
|
|
1265
|
+
src: annotation.context.screenshot.dataUrl,
|
|
1266
|
+
alt: ""
|
|
1267
|
+
})
|
|
1268
|
+
}),
|
|
1269
|
+
/* @__PURE__ */ jsxs8(Button2, {
|
|
1270
|
+
variant: "ghost",
|
|
1271
|
+
className: "altertable-annotation-bar-open",
|
|
1272
|
+
"aria-label": `Open annotation ${index + 1}`,
|
|
1273
|
+
disabled: locked,
|
|
1274
|
+
onClick: () => {
|
|
1275
|
+
onPinsVisibleChange(true);
|
|
1276
|
+
onSelect(annotation.id);
|
|
1277
|
+
dispatch({ type: "reviewClosed" });
|
|
1278
|
+
},
|
|
1279
|
+
children: [
|
|
1280
|
+
/* @__PURE__ */ jsx13("strong", {
|
|
1281
|
+
children: annotation.target.label
|
|
1282
|
+
}),
|
|
1283
|
+
/* @__PURE__ */ jsx13("span", {
|
|
1284
|
+
children: annotation.comment
|
|
1285
|
+
})
|
|
1286
|
+
]
|
|
1287
|
+
}),
|
|
1288
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1289
|
+
variant: "ghost",
|
|
1290
|
+
size: "icon-compact",
|
|
1291
|
+
"aria-label": `Delete annotation ${index + 1}`,
|
|
1292
|
+
disabled: locked,
|
|
1293
|
+
onClick: () => onDelete(annotation.id),
|
|
1294
|
+
children: /* @__PURE__ */ jsx13(Trash2, {
|
|
1295
|
+
size: 16,
|
|
1296
|
+
"aria-hidden": true
|
|
1297
|
+
})
|
|
1298
|
+
})
|
|
1299
|
+
]
|
|
1300
|
+
}, annotation.id))
|
|
1301
|
+
}),
|
|
1302
|
+
undo
|
|
1303
|
+
]
|
|
1304
|
+
}), document.body),
|
|
1305
|
+
/* @__PURE__ */ jsx13(Sheet2, {
|
|
1306
|
+
open: Boolean(preview),
|
|
1307
|
+
onOpenChange: (open) => {
|
|
1308
|
+
if (!open)
|
|
1309
|
+
dispatch({ type: "previewClosed" });
|
|
1310
|
+
},
|
|
1311
|
+
placement: "center",
|
|
1312
|
+
className: "altertable-annotation-image-dialog",
|
|
1313
|
+
title: preview?.target.label ?? "Screenshot",
|
|
1314
|
+
description: preview?.comment,
|
|
1315
|
+
returnFocus: reviewTrigger,
|
|
1316
|
+
children: preview?.context.screenshot && /* @__PURE__ */ jsx13("img", {
|
|
1317
|
+
className: "altertable-annotation-preview",
|
|
1318
|
+
src: preview.context.screenshot.dataUrl,
|
|
1319
|
+
alt: `Captured area for ${preview.target.label}`
|
|
1320
|
+
})
|
|
1321
|
+
}),
|
|
1322
|
+
!requestDiscard && /* @__PURE__ */ jsx13(Sheet2, {
|
|
1323
|
+
open: discardOpen,
|
|
1324
|
+
onOpenChange: (open) => dispatch({ type: "discardDialogChanged", open }),
|
|
1325
|
+
placement: "center",
|
|
1326
|
+
title: "Discard all pending annotations?",
|
|
1327
|
+
returnFocus: barRef,
|
|
1328
|
+
footer: /* @__PURE__ */ jsxs8(Fragment4, {
|
|
1329
|
+
children: [
|
|
1330
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1331
|
+
ref: cancelDiscard,
|
|
1332
|
+
variant: "ghost",
|
|
1333
|
+
onClick: () => dispatch({ type: "discardDialogChanged", open: false }),
|
|
1334
|
+
children: "Cancel"
|
|
1335
|
+
}),
|
|
1336
|
+
/* @__PURE__ */ jsx13(Button2, {
|
|
1337
|
+
className: "altertable-annotation-discard-confirm",
|
|
1338
|
+
disabled: locked,
|
|
1339
|
+
onClick: discardAnnotations,
|
|
1340
|
+
children: "Discard"
|
|
1341
|
+
})
|
|
1342
|
+
]
|
|
1343
|
+
}),
|
|
1344
|
+
children: /* @__PURE__ */ jsx13("p", {
|
|
1345
|
+
className: "altertable-annotation-discard-description",
|
|
1346
|
+
children: "These annotations will be removed and won’t be sent to the agent."
|
|
1347
|
+
})
|
|
1348
|
+
})
|
|
1349
|
+
]
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
// packages/data-app-react/src/annotations/styles.ts
|
|
1353
|
+
function injectDataAppAnnotationStyles(options = {}) {
|
|
1354
|
+
return injectStyles({
|
|
1355
|
+
name: "injectDataAppAnnotationStyles",
|
|
1356
|
+
attribute: "data-altertable-annotation-styles",
|
|
1357
|
+
css: `/* packages/data-app-react/src/tokens.css */
|
|
1358
|
+
@layer atbl.tokens {
|
|
1359
|
+
:root {
|
|
1360
|
+
--atbl-background: var(--atbl-palette-background);
|
|
1361
|
+
--atbl-surface: var(--atbl-palette-surface);
|
|
1362
|
+
--atbl-subtle: var(--atbl-palette-subtle);
|
|
1363
|
+
--atbl-backdrop: #0f171e38;
|
|
1364
|
+
--atbl-text: var(--atbl-palette-text);
|
|
1365
|
+
--atbl-muted: var(--atbl-palette-muted);
|
|
1366
|
+
--atbl-border: var(--atbl-palette-border);
|
|
1367
|
+
--atbl-accent: var(--atbl-palette-accent);
|
|
1368
|
+
--atbl-on-accent: var(--atbl-palette-on-accent);
|
|
1369
|
+
--atbl-positive: var(--atbl-palette-positive);
|
|
1370
|
+
--atbl-danger: var(--atbl-palette-danger);
|
|
1371
|
+
--atbl-code-surface: #f4f6f9;
|
|
1372
|
+
--atbl-code-text: #273242;
|
|
1373
|
+
--atbl-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
1374
|
+
--atbl-focus-ring-offset: 2px;
|
|
1375
|
+
--atbl-focus-ring-inset: -1px;
|
|
1376
|
+
--atbl-font: var(--atbl-input-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-sans-serif, sans-serif);
|
|
1377
|
+
--atbl-space-xs: 5px;
|
|
1378
|
+
--atbl-space-sm: 10px;
|
|
1379
|
+
--atbl-space-md: 16px;
|
|
1380
|
+
--atbl-space-lg: 24px;
|
|
1381
|
+
--atbl-space-xl: 32px;
|
|
1382
|
+
--atbl-content-width: 1920px;
|
|
1383
|
+
--atbl-control-height: 2.375rem;
|
|
1384
|
+
--atbl-control-compact-height: 1.875rem;
|
|
1385
|
+
--atbl-control-icon-size: 1rem;
|
|
1386
|
+
--atbl-control-padding-inline: .75rem;
|
|
1387
|
+
--atbl-control-padding-block: .375rem;
|
|
1388
|
+
--atbl-control-gap: .5rem;
|
|
1389
|
+
--atbl-control-disabled-opacity: .5;
|
|
1390
|
+
--atbl-dropdown-padding: calc(var(--atbl-control-padding-block) * 2 / 3);
|
|
1391
|
+
--atbl-dropdown-item-padding-block: var(--atbl-control-padding-block);
|
|
1392
|
+
--atbl-dropdown-item-padding-inline: calc(var(--atbl-control-padding-inline) * 3 / 4);
|
|
1393
|
+
--atbl-dropdown-item-gap: 2px;
|
|
1394
|
+
--atbl-radius-control: 7px;
|
|
1395
|
+
--atbl-radius-surface: 12px;
|
|
1396
|
+
--atbl-radius-overlay: 16px;
|
|
1397
|
+
--atbl-shadow-surface: 0 3px 16px #141c280d;
|
|
1398
|
+
--atbl-shadow-overlay: 0 18px 50px #00000029;
|
|
1399
|
+
--atbl-shadow-control: 0 1px 3px #0000001a;
|
|
1400
|
+
--atbl-cursor-action: pointer;
|
|
1401
|
+
--atbl-cursor-disabled: default;
|
|
1402
|
+
--atbl-cursor-help: help;
|
|
1403
|
+
--atbl-cursor-busy: progress;
|
|
1404
|
+
--atbl-duration-fast: .12s;
|
|
1405
|
+
--atbl-duration-normal: .18s;
|
|
1406
|
+
--atbl-duration-slow: .24s;
|
|
1407
|
+
--atbl-ease-standard: ease;
|
|
1408
|
+
--atbl-ease-enter: cubic-bezier(.2, .7, .2, 1);
|
|
1409
|
+
--atbl-chart-1: color-mix(in srgb, var(--atbl-input-chart-1, #285fc0) var(--atbl-chart-strength), white);
|
|
1410
|
+
--atbl-chart-2: color-mix(in srgb, var(--atbl-input-chart-2, #a95319) var(--atbl-chart-strength), white);
|
|
1411
|
+
--atbl-chart-3: color-mix(in srgb, var(--atbl-input-chart-3, #147862) var(--atbl-chart-strength), white);
|
|
1412
|
+
--atbl-chart-4: color-mix(in srgb, var(--atbl-input-chart-4, #7243aa) var(--atbl-chart-strength), white);
|
|
1413
|
+
--atbl-chart-5: color-mix(in srgb, var(--atbl-input-chart-5, #aa3958) var(--atbl-chart-strength), white);
|
|
1414
|
+
--atbl-chart-6: color-mix(in srgb, var(--atbl-input-chart-6, #475569) var(--atbl-chart-strength), white);
|
|
1415
|
+
--atbl-chart-7: color-mix(in srgb, var(--atbl-input-chart-7, #285fc0) var(--atbl-chart-strength), white);
|
|
1416
|
+
--atbl-chart-8: color-mix(in srgb, var(--atbl-input-chart-8, #a95319) var(--atbl-chart-strength), white);
|
|
1417
|
+
--atbl-type-emphasis-weight: 680;
|
|
1418
|
+
--atbl-type-meta-weight: 500;
|
|
1419
|
+
--atbl-type-page-size: clamp(1.375rem, 2.4vw, 1.75rem);
|
|
1420
|
+
--atbl-type-section-size: 1.25rem;
|
|
1421
|
+
--atbl-type-widget-size: var(--atbl-type-label-size);
|
|
1422
|
+
--atbl-type-body-size: .875rem;
|
|
1423
|
+
--atbl-type-label-size: .8125rem;
|
|
1424
|
+
--atbl-type-meta-size: .75rem;
|
|
1425
|
+
--atbl-type-metric-size: clamp(1.625rem, 3vw, 2.125rem);
|
|
1426
|
+
--atbl-type-heading-weight: 650;
|
|
1427
|
+
--atbl-type-label-weight: 600;
|
|
1428
|
+
--atbl-type-body-leading: 1.65;
|
|
1429
|
+
--atbl-type-label-leading: 1.4;
|
|
1430
|
+
--atbl-type-heading-leading: 1.3;
|
|
1431
|
+
--atbl-type-metric-leading: 1.08;
|
|
1432
|
+
--atbl-text-measure: 70ch;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/* packages/data-app-react/src/appearance.css */
|
|
1437
|
+
@layer atbl.tokens {
|
|
1438
|
+
:root {
|
|
1439
|
+
--atbl-palette-background: #fff;
|
|
1440
|
+
--atbl-palette-surface: #fff;
|
|
1441
|
+
--atbl-palette-subtle: #f6f7f7;
|
|
1442
|
+
--atbl-palette-text: #202124;
|
|
1443
|
+
--atbl-palette-muted: #687078;
|
|
1444
|
+
--atbl-palette-border: #e3e6e8;
|
|
1445
|
+
--atbl-palette-accent: var(--atbl-input-accent, var(--atbl-text));
|
|
1446
|
+
--atbl-palette-on-accent: var(--atbl-input-on-accent, #fff);
|
|
1447
|
+
--atbl-palette-positive: #147862;
|
|
1448
|
+
--atbl-palette-danger: #b42318;
|
|
1449
|
+
--atbl-chart-strength: 100%;
|
|
1450
|
+
--atbl-accent-subtle-strength: 12%;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
:root[data-atbl-theme="dark"] {
|
|
1454
|
+
--atbl-palette-background: #151719;
|
|
1455
|
+
--atbl-palette-surface: #202326;
|
|
1456
|
+
--atbl-palette-subtle: #292d31;
|
|
1457
|
+
--atbl-palette-text: #f2f3f4;
|
|
1458
|
+
--atbl-palette-muted: #aeb5bc;
|
|
1459
|
+
--atbl-palette-border: #3b4248;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
:root[data-atbl-base-color="slate"] {
|
|
1463
|
+
--atbl-palette-background: #f8fafc;
|
|
1464
|
+
--atbl-palette-surface: #fff;
|
|
1465
|
+
--atbl-palette-subtle: #f1f5f9;
|
|
1466
|
+
--atbl-palette-text: #17212f;
|
|
1467
|
+
--atbl-palette-muted: #607083;
|
|
1468
|
+
--atbl-palette-border: #dce3ea;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
:root[data-atbl-base-color="slate"][data-atbl-theme="dark"] {
|
|
1472
|
+
--atbl-palette-background: #111820;
|
|
1473
|
+
--atbl-palette-surface: #1b2530;
|
|
1474
|
+
--atbl-palette-subtle: #263340;
|
|
1475
|
+
--atbl-palette-text: #f0f4f8;
|
|
1476
|
+
--atbl-palette-muted: #a8b5c3;
|
|
1477
|
+
--atbl-palette-border: #3a4857;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
:root[data-atbl-base-color="warm"] {
|
|
1481
|
+
--atbl-palette-background: #fbfaf8;
|
|
1482
|
+
--atbl-palette-surface: #fff;
|
|
1483
|
+
--atbl-palette-subtle: #f5f2ed;
|
|
1484
|
+
--atbl-palette-text: #292723;
|
|
1485
|
+
--atbl-palette-muted: #736e66;
|
|
1486
|
+
--atbl-palette-border: #e8e2da;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
:root[data-atbl-base-color="warm"][data-atbl-theme="dark"] {
|
|
1490
|
+
--atbl-palette-background: #1b1916;
|
|
1491
|
+
--atbl-palette-surface: #25221e;
|
|
1492
|
+
--atbl-palette-subtle: #302c27;
|
|
1493
|
+
--atbl-palette-text: #f5f1eb;
|
|
1494
|
+
--atbl-palette-muted: #bcb3a8;
|
|
1495
|
+
--atbl-palette-border: #494239;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
:root[data-atbl-theme="dark"] {
|
|
1499
|
+
--atbl-palette-accent: var(--atbl-input-dark-accent, var(--atbl-text));
|
|
1500
|
+
--atbl-accent-subtle-strength: 22%;
|
|
1501
|
+
--atbl-palette-on-accent: var(--atbl-input-on-accent, var(--atbl-background));
|
|
1502
|
+
--atbl-palette-positive: #6bc39a;
|
|
1503
|
+
--atbl-palette-danger: #f97066;
|
|
1504
|
+
--atbl-backdrop: #0000008c;
|
|
1505
|
+
--atbl-code-surface: #242a31;
|
|
1506
|
+
--atbl-code-text: #e5e9ef;
|
|
1507
|
+
--atbl-chart-strength: 60%;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
:root[data-atbl-density="compact"] {
|
|
1511
|
+
--atbl-control-height: 2.125rem;
|
|
1512
|
+
--atbl-control-compact-height: 1.625rem;
|
|
1513
|
+
--atbl-control-gap: .375rem;
|
|
1514
|
+
--atbl-control-padding-inline: .625rem;
|
|
1515
|
+
--atbl-control-padding-block: .25rem;
|
|
1516
|
+
--atbl-space-xs: 4px;
|
|
1517
|
+
--atbl-space-sm: 8px;
|
|
1518
|
+
--atbl-space-md: 12px;
|
|
1519
|
+
--atbl-space-lg: 18px;
|
|
1520
|
+
--atbl-space-xl: 24px;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
:root[data-atbl-density="spacious"] {
|
|
1524
|
+
--atbl-control-height: 2.625rem;
|
|
1525
|
+
--atbl-control-compact-height: 2.125rem;
|
|
1526
|
+
--atbl-control-gap: .625rem;
|
|
1527
|
+
--atbl-control-padding-inline: 1rem;
|
|
1528
|
+
--atbl-control-padding-block: .5rem;
|
|
1529
|
+
--atbl-space-xs: 6px;
|
|
1530
|
+
--atbl-space-sm: 12px;
|
|
1531
|
+
--atbl-space-md: 20px;
|
|
1532
|
+
--atbl-space-lg: 30px;
|
|
1533
|
+
--atbl-space-xl: 40px;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
:root[data-atbl-radius="none"] {
|
|
1537
|
+
--atbl-radius-control: 0px;
|
|
1538
|
+
--atbl-radius-surface: 0px;
|
|
1539
|
+
--atbl-radius-overlay: 0px;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
:root[data-atbl-radius="small"] {
|
|
1543
|
+
--atbl-radius-control: 4px;
|
|
1544
|
+
--atbl-radius-surface: 7px;
|
|
1545
|
+
--atbl-radius-overlay: 9px;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
:root[data-atbl-radius="large"] {
|
|
1549
|
+
--atbl-radius-control: 10px;
|
|
1550
|
+
--atbl-radius-surface: 18px;
|
|
1551
|
+
--atbl-radius-overlay: 24px;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
:root[data-atbl-elevation="flat"] {
|
|
1555
|
+
--atbl-shadow-surface: none;
|
|
1556
|
+
--atbl-shadow-overlay: none;
|
|
1557
|
+
--atbl-shadow-control: none;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
:root[data-atbl-elevation="raised"] {
|
|
1561
|
+
--atbl-shadow-surface: 0 8px 28px #141c281a;
|
|
1562
|
+
--atbl-shadow-overlay: 0 24px 72px #0000003d;
|
|
1563
|
+
--atbl-shadow-control: 0 2px 6px #00000029;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
@media (forced-colors: active) {
|
|
1567
|
+
:root {
|
|
1568
|
+
--atbl-focus-color: Highlight !important;
|
|
1569
|
+
--atbl-on-accent: HighlightText !important;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
/* packages/data-app-react/src/base.css */
|
|
1575
|
+
@layer atbl.base {
|
|
1576
|
+
:where([class^="altertable-"], [class*=" altertable-"]) {
|
|
1577
|
+
box-sizing: border-box;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
:where([class^="altertable-"], [class*=" altertable-"]) * {
|
|
1581
|
+
box-sizing: border-box;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
:where([class^="starter-"], [class*=" starter-"]) * {
|
|
1585
|
+
box-sizing: border-box;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
:where([class^="altertable-"], [class*=" altertable-"]) button {
|
|
1589
|
+
font: inherit;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
:root[data-atbl-appearance] {
|
|
1593
|
+
scrollbar-gutter: stable;
|
|
1594
|
+
font-family: var(--atbl-font);
|
|
1595
|
+
color: var(--atbl-text);
|
|
1596
|
+
background: var(--atbl-background);
|
|
1597
|
+
font-synthesis: none;
|
|
1598
|
+
-webkit-font-smoothing: antialiased;
|
|
1599
|
+
text-rendering: optimizeLegibility;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
:root[data-atbl-theme="light"] {
|
|
1603
|
+
--buncss-light: initial;
|
|
1604
|
+
--buncss-dark: ;
|
|
1605
|
+
color-scheme: light;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
:root[data-atbl-theme="dark"] {
|
|
1609
|
+
--buncss-light: ;
|
|
1610
|
+
--buncss-dark: initial;
|
|
1611
|
+
color-scheme: dark;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
:root[data-atbl-appearance] body, :root[data-atbl-appearance] #root {
|
|
1615
|
+
margin: 0;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.altertable-sr-only {
|
|
1619
|
+
position: fixed;
|
|
1620
|
+
overflow: hidden;
|
|
1621
|
+
clip: rect(0, 0, 0, 0);
|
|
1622
|
+
clip-path: inset(50%);
|
|
1623
|
+
white-space: nowrap;
|
|
1624
|
+
border: 0;
|
|
1625
|
+
width: 1px;
|
|
1626
|
+
height: 1px;
|
|
1627
|
+
margin: -1px;
|
|
1628
|
+
padding: 0;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/* packages/data-app-react/src/annotations/colors.css */
|
|
1633
|
+
@layer atbl.components {
|
|
1634
|
+
:root {
|
|
1635
|
+
--atbl-annotation-accent: #c026d3;
|
|
1636
|
+
--atbl-annotation-accent-hover: #a21caf;
|
|
1637
|
+
--atbl-annotation-on-accent: #fff;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
.altertable-annotation-trigger, .altertable-annotation-composer {
|
|
1641
|
+
--atbl-control-selected-surface: var(--atbl-annotation-accent);
|
|
1642
|
+
--atbl-control-selected-text: var(--atbl-annotation-on-accent);
|
|
1643
|
+
--atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
.altertable-annotation-trigger[aria-pressed="true"], .altertable-annotation-trigger:not([aria-pressed]) {
|
|
1647
|
+
background: var(--atbl-annotation-accent);
|
|
1648
|
+
color: var(--atbl-annotation-on-accent);
|
|
1649
|
+
border-color: #0000;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
.altertable-annotation-trigger[aria-pressed="true"]:hover:not(:disabled) {
|
|
1653
|
+
--atbl-control-selected-surface: var(--atbl-annotation-accent-hover);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
.altertable-annotation-trigger:not([aria-pressed]) {
|
|
1657
|
+
--atbl-control-hover-surface: var(--atbl-annotation-accent-hover);
|
|
1658
|
+
--atbl-control-pressed-surface: var(--atbl-annotation-accent-hover);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/* packages/data-app-react/src/ui/Button.css */
|
|
1663
|
+
@layer atbl.components {
|
|
1664
|
+
.altertable-button {
|
|
1665
|
+
display: inline-flex;
|
|
1666
|
+
justify-content: center;
|
|
1667
|
+
align-items: center;
|
|
1668
|
+
gap: var(--atbl-control-gap);
|
|
1669
|
+
min-height: var(--atbl-control-height);
|
|
1670
|
+
padding: var(--atbl-control-padding-block) var(--atbl-control-padding-inline);
|
|
1671
|
+
border: 1px solid var(--atbl-border);
|
|
1672
|
+
border-radius: var(--atbl-radius-control);
|
|
1673
|
+
background: var(--atbl-surface);
|
|
1674
|
+
color: var(--atbl-text);
|
|
1675
|
+
font: inherit;
|
|
1676
|
+
font-size: var(--atbl-type-label-size);
|
|
1677
|
+
font-weight: var(--atbl-type-label-weight);
|
|
1678
|
+
line-height: var(--atbl-type-label-leading);
|
|
1679
|
+
overflow-wrap: anywhere;
|
|
1680
|
+
transition: background-color var(--atbl-duration-fast) var(--atbl-ease-standard), border-color var(--atbl-duration-fast) var(--atbl-ease-standard), color var(--atbl-duration-fast) var(--atbl-ease-standard);
|
|
1681
|
+
-webkit-tap-highlight-color: transparent;
|
|
1682
|
+
max-inline-size: 100%;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.altertable-button[data-size="icon"] {
|
|
1686
|
+
width: var(--atbl-control-height);
|
|
1687
|
+
min-width: var(--atbl-control-height);
|
|
1688
|
+
height: var(--atbl-control-height);
|
|
1689
|
+
min-height: var(--atbl-control-height);
|
|
1690
|
+
flex: none;
|
|
1691
|
+
padding: 0;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.altertable-button[data-variant="primary"] {
|
|
1695
|
+
border-color: var(--atbl-text);
|
|
1696
|
+
background: var(--atbl-text);
|
|
1697
|
+
color: var(--atbl-background);
|
|
1698
|
+
--atbl-control-hover-surface: color-mix(in srgb, var(--atbl-text) 92%, var(--atbl-background));
|
|
1699
|
+
--atbl-control-pressed-surface: color-mix(in srgb, var(--atbl-text) 84%, var(--atbl-background));
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
.altertable-button[data-variant="outline"] {
|
|
1703
|
+
box-shadow: none;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
.altertable-button[data-variant="elevated"] {
|
|
1707
|
+
box-shadow: var(--atbl-shadow-surface);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
.altertable-button[data-variant="ghost"] {
|
|
1711
|
+
box-shadow: none;
|
|
1712
|
+
background: none;
|
|
1713
|
+
border-color: #0000;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1717
|
+
.altertable-button {
|
|
1718
|
+
transition: none;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.altertable-button[data-size="compact"] {
|
|
1723
|
+
min-height: var(--atbl-control-compact-height);
|
|
1724
|
+
padding: calc(var(--atbl-control-padding-block) * 2 / 3) calc(var(--atbl-control-padding-inline) * 2 / 3);
|
|
1725
|
+
font-size: var(--atbl-type-meta-size);
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
.altertable-button[data-size="icon-compact"] {
|
|
1729
|
+
width: var(--atbl-control-compact-height);
|
|
1730
|
+
min-width: var(--atbl-control-compact-height);
|
|
1731
|
+
height: var(--atbl-control-compact-height);
|
|
1732
|
+
min-height: var(--atbl-control-compact-height);
|
|
1733
|
+
flex: none;
|
|
1734
|
+
padding: 0;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
.altertable-button[data-size^="icon"] > svg {
|
|
1738
|
+
inline-size: var(--atbl-control-icon-size);
|
|
1739
|
+
block-size: var(--atbl-control-icon-size);
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.altertable-button[data-variant="inline"] {
|
|
1743
|
+
--atbl-control-hover-surface: transparent;
|
|
1744
|
+
--atbl-control-pressed-surface: transparent;
|
|
1745
|
+
--atbl-control-open-surface: transparent;
|
|
1746
|
+
box-shadow: none;
|
|
1747
|
+
font: inherit;
|
|
1748
|
+
text-underline-offset: .2em;
|
|
1749
|
+
background: none;
|
|
1750
|
+
border: 0;
|
|
1751
|
+
border-radius: 0;
|
|
1752
|
+
min-height: 0;
|
|
1753
|
+
padding: 0;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
.altertable-button[data-variant="inline"]:-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, [data-disabled])) {
|
|
1757
|
+
text-decoration: underline;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
.altertable-button[data-variant="inline"]:-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, [data-disabled])) {
|
|
1761
|
+
text-decoration: underline;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
.altertable-button[data-variant="inline"]:is(:hover, [data-hovered]):not(:is(:disabled, [data-disabled])) {
|
|
1765
|
+
text-decoration: underline;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
/* packages/data-app-react/src/ui/Tooltip.css */
|
|
1770
|
+
@layer atbl.components {
|
|
1771
|
+
.altertable-tooltip-trigger {
|
|
1772
|
+
display: inline-flex;
|
|
1773
|
+
align-items: center;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.altertable-tooltip-trigger[data-variant="chart"] {
|
|
1777
|
+
display: flex;
|
|
1778
|
+
align-items: flex-end;
|
|
1779
|
+
width: 100%;
|
|
1780
|
+
min-width: 0;
|
|
1781
|
+
height: 100%;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
.altertable-tooltip-content {
|
|
1785
|
+
z-index: 1300;
|
|
1786
|
+
border: 1px solid var(--atbl-border);
|
|
1787
|
+
border-radius: var(--atbl-radius-control);
|
|
1788
|
+
background: var(--atbl-surface);
|
|
1789
|
+
color: var(--atbl-text);
|
|
1790
|
+
box-shadow: var(--atbl-shadow-overlay);
|
|
1791
|
+
font: var(--atbl-type-meta-weight) var(--atbl-type-meta-size) / var(--atbl-type-label-leading) var(--atbl-font);
|
|
1792
|
+
white-space: normal;
|
|
1793
|
+
pointer-events: none;
|
|
1794
|
+
animation: altertable-tooltip-in var(--atbl-duration-fast) ease-out;
|
|
1795
|
+
width: max-content;
|
|
1796
|
+
max-width: min(240px, 100vw - 24px);
|
|
1797
|
+
padding: 6px 9px;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
.altertable-tooltip-content[data-variant="chart"] {
|
|
1801
|
+
display: grid;
|
|
1802
|
+
font-variant-numeric: tabular-nums;
|
|
1803
|
+
gap: 2px;
|
|
1804
|
+
padding: 8px 10px;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.altertable-tooltip-content[data-variant="chart"] strong {
|
|
1808
|
+
font-size: var(--atbl-type-body-size);
|
|
1809
|
+
font-weight: 650;
|
|
1810
|
+
line-height: 1.2;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
@keyframes altertable-tooltip-in {
|
|
1814
|
+
from {
|
|
1815
|
+
opacity: 0;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1820
|
+
.altertable-tooltip-content {
|
|
1821
|
+
animation: none;
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
.altertable-chart-tooltip-row {
|
|
1826
|
+
display: flex;
|
|
1827
|
+
align-items: flex-start;
|
|
1828
|
+
gap: 6px;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
.altertable-chart-tooltip-marker {
|
|
1832
|
+
flex-shrink: 0;
|
|
1833
|
+
width: 8px;
|
|
1834
|
+
height: 8px;
|
|
1835
|
+
margin-top: .3em;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
.altertable-chart-tooltip-reading {
|
|
1839
|
+
overflow-wrap: anywhere;
|
|
1840
|
+
min-width: 0;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
/* packages/data-app-react/src/ui/Kbd.css */
|
|
1845
|
+
@layer atbl.components {
|
|
1846
|
+
.altertable-kbd {
|
|
1847
|
+
display: inline-flex;
|
|
1848
|
+
border: 1px solid var(--atbl-border);
|
|
1849
|
+
background: var(--atbl-subtle);
|
|
1850
|
+
color: var(--atbl-muted);
|
|
1851
|
+
font: var(--atbl-type-label-weight) var(--atbl-type-meta-size) / var(--atbl-type-label-leading) var(--atbl-font);
|
|
1852
|
+
font-variant-numeric: tabular-nums;
|
|
1853
|
+
white-space: nowrap;
|
|
1854
|
+
border-radius: 5px;
|
|
1855
|
+
justify-content: center;
|
|
1856
|
+
align-items: center;
|
|
1857
|
+
min-width: 1.6em;
|
|
1858
|
+
padding: 2px 5px;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.altertable-button[data-variant="primary"] .altertable-kbd {
|
|
1862
|
+
color: inherit;
|
|
1863
|
+
border-color: color-mix(in srgb, currentColor 30%, transparent);
|
|
1864
|
+
background: none;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
/* packages/data-app-react/src/annotations/AnnotationBar.css */
|
|
1869
|
+
@layer atbl.components {
|
|
1870
|
+
.altertable-annotation-bar, .altertable-annotation-bar-panel {
|
|
1871
|
+
--bar-surface: #202326;
|
|
1872
|
+
--bar-text: #f2f3f4;
|
|
1873
|
+
--bar-muted: #aeb5bc;
|
|
1874
|
+
--bar-border: #3b4248;
|
|
1875
|
+
--bar-danger: #ffa6a0;
|
|
1876
|
+
--bar-danger-surface: #572723;
|
|
1877
|
+
--atbl-control-selected-surface: var(--atbl-subtle);
|
|
1878
|
+
--atbl-control-selected-text: var(--bar-text);
|
|
1879
|
+
--atbl-control-disabled-opacity: 1;
|
|
1880
|
+
--atbl-surface: var(--bar-surface);
|
|
1881
|
+
--atbl-text: var(--bar-text);
|
|
1882
|
+
--atbl-muted: var(--bar-muted);
|
|
1883
|
+
--atbl-border: var(--bar-border);
|
|
1884
|
+
--atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
|
|
1885
|
+
--atbl-subtle: color-mix(in srgb, var(--bar-text) 8%, var(--bar-surface));
|
|
1886
|
+
color: var(--bar-text);
|
|
1887
|
+
background: var(--bar-surface);
|
|
1888
|
+
font: 14px / 1.5 var(--atbl-font);
|
|
1889
|
+
box-sizing: border-box;
|
|
1890
|
+
border: 1px solid var(--bar-border);
|
|
1891
|
+
box-shadow: 0 8px 28px #0003;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip) {
|
|
1895
|
+
--bar-surface: #202326;
|
|
1896
|
+
--bar-text: #f2f3f4;
|
|
1897
|
+
--bar-muted: #aeb5bc;
|
|
1898
|
+
--bar-border: #3b4248;
|
|
1899
|
+
--bar-danger: #ffa6a0;
|
|
1900
|
+
--bar-danger-surface: #572723;
|
|
1901
|
+
--atbl-control-selected-surface: var(--atbl-subtle);
|
|
1902
|
+
--atbl-control-selected-text: var(--bar-text);
|
|
1903
|
+
--atbl-control-disabled-opacity: 1;
|
|
1904
|
+
--atbl-surface: var(--bar-surface);
|
|
1905
|
+
--atbl-text: var(--bar-text);
|
|
1906
|
+
--atbl-muted: var(--bar-muted);
|
|
1907
|
+
--atbl-border: var(--bar-border);
|
|
1908
|
+
--atbl-focus-outline: 2px solid var(--atbl-annotation-accent);
|
|
1909
|
+
--atbl-subtle: color-mix(in srgb, var(--bar-text) 8%, var(--bar-surface));
|
|
1910
|
+
color: var(--bar-text);
|
|
1911
|
+
background: var(--bar-surface);
|
|
1912
|
+
font: 14px / 1.5 var(--atbl-font);
|
|
1913
|
+
box-sizing: border-box;
|
|
1914
|
+
border: 1px solid var(--bar-border);
|
|
1915
|
+
box-shadow: 0 8px 28px #0003;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.altertable-annotation-bar[data-theme="dark"], .altertable-annotation-bar-panel[data-theme="dark"] {
|
|
1919
|
+
--bar-surface: #f2f3f4;
|
|
1920
|
+
--bar-text: #151719;
|
|
1921
|
+
--bar-muted: #505963;
|
|
1922
|
+
--bar-border: #dfe3e6;
|
|
1923
|
+
--bar-danger: #b42318;
|
|
1924
|
+
--bar-danger-surface: #ffe3e3;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
.altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip[data-theme="dark"]) {
|
|
1928
|
+
--bar-surface: #f2f3f4;
|
|
1929
|
+
--bar-text: #151719;
|
|
1930
|
+
--bar-muted: #505963;
|
|
1931
|
+
--bar-border: #dfe3e6;
|
|
1932
|
+
--bar-danger: #b42318;
|
|
1933
|
+
--bar-danger-surface: #ffe3e3;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
.altertable-annotation-bar {
|
|
1937
|
+
position: fixed;
|
|
1938
|
+
z-index: 1200;
|
|
1939
|
+
display: flex;
|
|
1940
|
+
border-radius: 18px;
|
|
1941
|
+
align-items: center;
|
|
1942
|
+
gap: 4px;
|
|
1943
|
+
max-width: calc(100vw - 24px);
|
|
1944
|
+
padding: 8px;
|
|
1945
|
+
bottom: 16px;
|
|
1946
|
+
left: 50%;
|
|
1947
|
+
transform: translateX(-50%);
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
.altertable-annotation-bar .altertable-button, .altertable-annotation-bar-panel .altertable-button {
|
|
1951
|
+
color: var(--bar-muted);
|
|
1952
|
+
font: inherit;
|
|
1953
|
+
flex-shrink: 0;
|
|
1954
|
+
width: auto;
|
|
1955
|
+
transition: none;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
.altertable-annotation-bar .altertable-annotation-bar-count {
|
|
1959
|
+
white-space: nowrap;
|
|
1960
|
+
color: var(--bar-text);
|
|
1961
|
+
padding-inline-start: 6px;
|
|
1962
|
+
padding-inline-end: 6px;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
.altertable-annotation-bar .altertable-button[data-atbl-internal-drag-handle] {
|
|
1966
|
+
--atbl-cursor-action: grab;
|
|
1967
|
+
touch-action: none;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.altertable-annotation-bar .altertable-button[data-atbl-internal-drag-handle]:active {
|
|
1971
|
+
--atbl-cursor-action: grabbing;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
.altertable-annotation-bar .altertable-annotation-bar-send {
|
|
1975
|
+
--atbl-control-hover-surface: var(--atbl-annotation-accent-hover);
|
|
1976
|
+
--atbl-control-pressed-surface: var(--atbl-annotation-accent-hover);
|
|
1977
|
+
background: var(--atbl-annotation-accent);
|
|
1978
|
+
color: var(--atbl-annotation-on-accent);
|
|
1979
|
+
border-color: #0000;
|
|
1980
|
+
border-radius: 12px;
|
|
1981
|
+
padding-inline-start: 14px;
|
|
1982
|
+
padding-inline-end: 14px;
|
|
1983
|
+
font-weight: 600;
|
|
1984
|
+
line-height: 1.25;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
.altertable-annotation-bar-panel {
|
|
1988
|
+
position: fixed;
|
|
1989
|
+
z-index: 1201;
|
|
1990
|
+
overflow: auto;
|
|
1991
|
+
border-radius: 16px;
|
|
1992
|
+
width: min(420px, 100vw - 24px);
|
|
1993
|
+
max-height: min(440px, 45vh);
|
|
1994
|
+
margin: 0;
|
|
1995
|
+
padding: 6px;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
.altertable-annotation-bar-panel header {
|
|
1999
|
+
display: flex;
|
|
2000
|
+
justify-content: space-between;
|
|
2001
|
+
align-items: center;
|
|
2002
|
+
padding: 4px 8px;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
.altertable-annotation-bar-row {
|
|
2006
|
+
display: flex;
|
|
2007
|
+
border-radius: 10px;
|
|
2008
|
+
align-items: center;
|
|
2009
|
+
gap: 8px;
|
|
2010
|
+
padding: 4px;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
.altertable-annotation-bar-row:hover, .altertable-annotation-bar-row:focus-within {
|
|
2014
|
+
background: var(--atbl-subtle);
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
.altertable-annotation-bar-row + .altertable-annotation-bar-row {
|
|
2018
|
+
border-top: 1px solid var(--bar-border);
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
.altertable-annotation-bar-panel .altertable-annotation-bar-open {
|
|
2022
|
+
display: grid;
|
|
2023
|
+
text-align: left;
|
|
2024
|
+
flex: 1;
|
|
2025
|
+
justify-content: stretch;
|
|
2026
|
+
gap: 2px;
|
|
2027
|
+
min-width: 0;
|
|
2028
|
+
height: auto;
|
|
2029
|
+
padding: 4px 6px;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
.altertable-annotation-bar-open strong {
|
|
2033
|
+
color: var(--bar-text);
|
|
2034
|
+
font-weight: 600;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
.altertable-annotation-bar-open span {
|
|
2038
|
+
color: var(--bar-muted);
|
|
2039
|
+
overflow-wrap: anywhere;
|
|
2040
|
+
font-size: 13px;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
.altertable-annotation-bar-panel .altertable-annotation-bar-open:hover:not(:disabled) {
|
|
2044
|
+
background: none;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
.altertable-annotation-bar-error {
|
|
2048
|
+
position: absolute;
|
|
2049
|
+
background: var(--bar-surface);
|
|
2050
|
+
color: var(--bar-text);
|
|
2051
|
+
border: 1px solid var(--bar-border);
|
|
2052
|
+
border-radius: 10px;
|
|
2053
|
+
padding: 8px 12px;
|
|
2054
|
+
font-size: 12px;
|
|
2055
|
+
bottom: calc(100% + 8px);
|
|
2056
|
+
left: 0;
|
|
2057
|
+
right: 0;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
@media (max-width: 420px) {
|
|
2061
|
+
.altertable-annotation-bar {
|
|
2062
|
+
gap: 0;
|
|
2063
|
+
padding: 6px;
|
|
2064
|
+
font-size: 12px;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
.altertable-annotation-bar .altertable-annotation-bar-send {
|
|
2068
|
+
padding-inline-start: 10px;
|
|
2069
|
+
padding-inline-end: 10px;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
@media (max-width: 360px) {
|
|
2074
|
+
.altertable-annotation-bar .altertable-button[data-size="icon-compact"] {
|
|
2075
|
+
width: 26px;
|
|
2076
|
+
min-width: 26px;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
.altertable-tooltip-content:has( > .altertable-annotation-bar-tooltip) {
|
|
2081
|
+
font-size: 12px;
|
|
2082
|
+
line-height: 1.3;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
.altertable-annotation-bar .altertable-button:hover:not(:disabled), .altertable-annotation-bar-panel .altertable-button:hover:not(:disabled) {
|
|
2086
|
+
color: var(--bar-text);
|
|
2087
|
+
background: var(--atbl-subtle);
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
.altertable-annotation-bar .altertable-annotation-bar-send:hover:not(:disabled) {
|
|
2091
|
+
color: var(--atbl-annotation-on-accent);
|
|
2092
|
+
background: var(--atbl-annotation-accent-hover);
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.altertable-annotation-bar .altertable-button:disabled, .altertable-annotation-bar-panel .altertable-button:disabled {
|
|
2096
|
+
color: var(--bar-muted);
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
.altertable-annotation-bar .altertable-annotation-bar-send:disabled {
|
|
2100
|
+
color: var(--bar-muted);
|
|
2101
|
+
background: var(--atbl-subtle);
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
.altertable-annotation-bar .altertable-annotation-bar-send {
|
|
2105
|
+
position: relative;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
.altertable-annotation-bar-send[data-pending] .altertable-annotation-bar-send-label {
|
|
2109
|
+
visibility: hidden;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
.altertable-annotation-bar-spinner {
|
|
2113
|
+
position: absolute;
|
|
2114
|
+
animation: 1s linear infinite annotation-bar-spin;
|
|
2115
|
+
margin: auto;
|
|
2116
|
+
inset: 0;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
@keyframes annotation-bar-spin {
|
|
2120
|
+
to {
|
|
2121
|
+
rotate: 360deg;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
.altertable-annotation-discard-description {
|
|
2126
|
+
color: var(--atbl-muted);
|
|
2127
|
+
font: 14px / 1.55 var(--atbl-font);
|
|
2128
|
+
margin: 0;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
.altertable-annotation-discard-confirm {
|
|
2132
|
+
color: var(--atbl-danger);
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2136
|
+
.altertable-annotation-bar-spinner {
|
|
2137
|
+
animation: none;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
.altertable-annotation-bar .altertable-button[aria-pressed="true"] {
|
|
2142
|
+
color: var(--bar-text);
|
|
2143
|
+
background: var(--atbl-subtle);
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
.altertable-annotation-undo {
|
|
2147
|
+
position: fixed;
|
|
2148
|
+
z-index: 1202;
|
|
2149
|
+
display: flex;
|
|
2150
|
+
border: 1px solid var(--atbl-border);
|
|
2151
|
+
border-radius: var(--atbl-radius-overlay);
|
|
2152
|
+
background: var(--atbl-surface);
|
|
2153
|
+
color: var(--atbl-text);
|
|
2154
|
+
box-shadow: var(--atbl-shadow-overlay);
|
|
2155
|
+
font: 13px / 1.5 var(--atbl-font);
|
|
2156
|
+
align-items: center;
|
|
2157
|
+
gap: 12px;
|
|
2158
|
+
padding: 8px 12px;
|
|
2159
|
+
bottom: 16px;
|
|
2160
|
+
left: 16px;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
.altertable-annotation-thumbnail {
|
|
2164
|
+
border: 1px solid var(--bar-border);
|
|
2165
|
+
overflow: hidden;
|
|
2166
|
+
background: var(--bar-surface);
|
|
2167
|
+
--atbl-cursor-action: zoom-in;
|
|
2168
|
+
border-radius: 6px;
|
|
2169
|
+
flex-shrink: 0;
|
|
2170
|
+
width: 56px;
|
|
2171
|
+
height: 40px;
|
|
2172
|
+
padding: 0;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
.altertable-annotation-thumbnail img {
|
|
2176
|
+
object-fit: contain;
|
|
2177
|
+
display: block;
|
|
2178
|
+
width: 100%;
|
|
2179
|
+
height: 100%;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
.altertable-annotation-thumbnail:focus-visible {
|
|
2183
|
+
outline: 2px solid var(--atbl-annotation-accent);
|
|
2184
|
+
outline-offset: 2px;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
.altertable-annotation-preview {
|
|
2188
|
+
display: block;
|
|
2189
|
+
object-fit: contain;
|
|
2190
|
+
width: 100%;
|
|
2191
|
+
max-height: 65vh;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
.altertable-annotation-undo[data-bar-visible] {
|
|
2195
|
+
bottom: 88px;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
.altertable-annotation-undo[data-inline] {
|
|
2199
|
+
position: static;
|
|
2200
|
+
box-shadow: none;
|
|
2201
|
+
border-radius: 8px;
|
|
2202
|
+
margin-top: 6px;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
.altertable-sheet.altertable-annotation-image-dialog[data-placement="center"] {
|
|
2206
|
+
width: min(960px, 100vw - 32px);
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
/* packages/data-app-react/src/ui/Sheet.css */
|
|
2211
|
+
@layer atbl.components {
|
|
2212
|
+
:root:has(.altertable-sheet:modal) {
|
|
2213
|
+
overflow: hidden;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
.altertable-sheet:not([open]) {
|
|
2217
|
+
display: none;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
.altertable-sheet {
|
|
2221
|
+
position: fixed;
|
|
2222
|
+
overflow: visible;
|
|
2223
|
+
border: 0;
|
|
2224
|
+
border-left: 1px solid var(--atbl-border);
|
|
2225
|
+
background: var(--atbl-surface);
|
|
2226
|
+
color: var(--atbl-text);
|
|
2227
|
+
box-shadow: var(--atbl-shadow-overlay);
|
|
2228
|
+
font: var(--atbl-type-body-size) / var(--atbl-type-label-leading) var(--atbl-font);
|
|
2229
|
+
opacity: 0;
|
|
2230
|
+
transition: translate var(--atbl-duration-slow) cubic-bezier(.22, 1, .36, 1), opacity var(--atbl-duration-slow) var(--atbl-ease-standard);
|
|
2231
|
+
border-radius: 0;
|
|
2232
|
+
width: min(640px, 100vw);
|
|
2233
|
+
max-width: none;
|
|
2234
|
+
height: 100dvh;
|
|
2235
|
+
max-height: none;
|
|
2236
|
+
margin: 0;
|
|
2237
|
+
padding: 0;
|
|
2238
|
+
inset: 0 0 0 auto;
|
|
2239
|
+
translate: 100%;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
.altertable-sheet[data-wide] {
|
|
2243
|
+
width: min(960px, 100vw);
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
.altertable-sheet[open] {
|
|
2247
|
+
opacity: 1;
|
|
2248
|
+
translate: 0;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
@starting-style {
|
|
2252
|
+
.altertable-sheet[open] {
|
|
2253
|
+
opacity: 0;
|
|
2254
|
+
translate: 100%;
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
.altertable-sheet[open][data-closing] {
|
|
2259
|
+
opacity: 0;
|
|
2260
|
+
transition-timing-function: ease-in;
|
|
2261
|
+
translate: 100%;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
.altertable-sheet::backdrop {
|
|
2265
|
+
background: var(--atbl-backdrop);
|
|
2266
|
+
opacity: 0;
|
|
2267
|
+
transition: opacity var(--atbl-duration-slow) var(--atbl-ease-standard);
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
.altertable-sheet[open]::backdrop {
|
|
2271
|
+
opacity: 1;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
.altertable-sheet[open][data-closing]::backdrop {
|
|
2275
|
+
opacity: 0;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
@starting-style {
|
|
2279
|
+
.altertable-sheet[open]::backdrop {
|
|
2280
|
+
opacity: 0;
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
.altertable-sheet-shell {
|
|
2285
|
+
display: grid;
|
|
2286
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
2287
|
+
height: 100%;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
.altertable-sheet-header {
|
|
2291
|
+
display: flex;
|
|
2292
|
+
justify-content: space-between;
|
|
2293
|
+
align-items: flex-start;
|
|
2294
|
+
gap: var(--atbl-space-md);
|
|
2295
|
+
padding: var(--atbl-space-lg) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2) calc((var(--atbl-space-md) + var(--atbl-space-lg)) / 2);
|
|
2296
|
+
border-bottom: 1px solid var(--atbl-border);
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.altertable-sheet-header h2 {
|
|
2300
|
+
font-size: var(--atbl-type-section-size);
|
|
2301
|
+
font-weight: var(--atbl-type-heading-weight);
|
|
2302
|
+
line-height: var(--atbl-type-heading-leading);
|
|
2303
|
+
letter-spacing: -.02em;
|
|
2304
|
+
overflow-wrap: anywhere;
|
|
2305
|
+
margin: 0;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
.altertable-sheet-header p {
|
|
2309
|
+
color: var(--atbl-muted);
|
|
2310
|
+
font-size: var(--atbl-type-label-size);
|
|
2311
|
+
margin: 4px 0 0;
|
|
2312
|
+
line-height: 1.45;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
.altertable-sheet-actions {
|
|
2316
|
+
display: flex;
|
|
2317
|
+
align-items: center;
|
|
2318
|
+
gap: 4px;
|
|
2319
|
+
margin: -4px -8px 0 0;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
.altertable-sheet-close {
|
|
2323
|
+
color: var(--atbl-muted);
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
.altertable-sheet-body {
|
|
2327
|
+
overflow-y: auto;
|
|
2328
|
+
overscroll-behavior: contain;
|
|
2329
|
+
padding: var(--atbl-space-lg) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2) calc(var(--atbl-space-xl) + var(--atbl-space-md) / 2);
|
|
2330
|
+
min-height: 0;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
.altertable-sheet-footer {
|
|
2334
|
+
padding: var(--atbl-space-md) calc((var(--atbl-space-lg) + var(--atbl-space-xl)) / 2);
|
|
2335
|
+
border-top: 1px solid var(--atbl-border);
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
@media (min-width: 601px) {
|
|
2339
|
+
.altertable-sheet:where([data-placement="side"][data-side="left"]) {
|
|
2340
|
+
border-left: 0;
|
|
2341
|
+
border-right: 1px solid var(--atbl-border);
|
|
2342
|
+
inset: 0 auto 0 0;
|
|
2343
|
+
translate: -100%;
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
.altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
|
|
2347
|
+
translate: 0;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
.altertable-sheet:where([data-placement="side"][data-side="left"])[open][data-closing] {
|
|
2351
|
+
translate: -100%;
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
@starting-style {
|
|
2355
|
+
.altertable-sheet:where([data-placement="side"][data-side="left"])[open] {
|
|
2356
|
+
translate: -100%;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
@media (max-width: 960px) {
|
|
2362
|
+
.altertable-sheet[data-wide] {
|
|
2363
|
+
box-shadow: none;
|
|
2364
|
+
border: 0;
|
|
2365
|
+
inset: auto 0 0;
|
|
2366
|
+
translate: 0 100%;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
.altertable-sheet[data-wide][open] {
|
|
2370
|
+
translate: 0;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
.altertable-sheet[data-wide][open][data-closing] {
|
|
2374
|
+
translate: 0 100%;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
@starting-style {
|
|
2378
|
+
.altertable-sheet[data-wide][open] {
|
|
2379
|
+
translate: 0 100%;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
@media (max-width: 600px) {
|
|
2385
|
+
.altertable-sheet {
|
|
2386
|
+
box-shadow: none;
|
|
2387
|
+
border: 0;
|
|
2388
|
+
inset: auto 0 0;
|
|
2389
|
+
translate: 0 100%;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
.altertable-sheet[open] {
|
|
2393
|
+
translate: 0;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
.altertable-sheet[open][data-closing] {
|
|
2397
|
+
translate: 0 100%;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
@starting-style {
|
|
2401
|
+
.altertable-sheet[open] {
|
|
2402
|
+
translate: 0 100%;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
.altertable-sheet-header {
|
|
2407
|
+
padding: 20px 20px 16px;
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
.altertable-sheet-body {
|
|
2411
|
+
padding: 20px 20px 32px;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
.altertable-sheet-footer {
|
|
2415
|
+
padding: 14px 20px;
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2420
|
+
.altertable-sheet, .altertable-sheet[open][data-closing] {
|
|
2421
|
+
transition: none;
|
|
2422
|
+
translate: 0;
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
.altertable-sheet::backdrop {
|
|
2426
|
+
transition: none;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
@starting-style {
|
|
2430
|
+
.altertable-sheet[open] {
|
|
2431
|
+
translate: 0;
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
.altertable-sheet[data-placement="center"] {
|
|
2437
|
+
border: 1px solid var(--atbl-border, #e3e6e8);
|
|
2438
|
+
border-radius: var(--atbl-radius-overlay);
|
|
2439
|
+
width: min(480px, 100vw - 32px);
|
|
2440
|
+
height: -moz-fit-content;
|
|
2441
|
+
height: fit-content;
|
|
2442
|
+
max-height: calc(100dvh - 32px);
|
|
2443
|
+
margin: auto;
|
|
2444
|
+
inset: 0;
|
|
2445
|
+
translate: 0;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
.altertable-sheet[data-placement="center"] .altertable-sheet-shell {
|
|
2449
|
+
height: auto;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
.altertable-sheet[data-placement="center"] .altertable-sheet-header {
|
|
2453
|
+
padding: 20px 24px 16px;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
.altertable-sheet[data-placement="center"] .altertable-sheet-body {
|
|
2457
|
+
padding: 0 24px 20px;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
.altertable-sheet[data-placement="center"] .altertable-sheet-footer {
|
|
2461
|
+
padding: 16px 24px;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
/* packages/data-app-react/src/ui/GradientScroll.css */
|
|
2466
|
+
@layer atbl.components {
|
|
2467
|
+
.altertable-gradient-scroll {
|
|
2468
|
+
overflow: auto;
|
|
2469
|
+
--atbl-scroll-fade-size: 1.5rem;
|
|
2470
|
+
min-width: 0;
|
|
2471
|
+
min-height: 0;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
.altertable-gradient-scroll[data-axis="vertical"] {
|
|
2475
|
+
overflow-x: hidden;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
.altertable-gradient-scroll[data-axis="horizontal"] {
|
|
2479
|
+
overflow-y: hidden;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
.altertable-gradient-scroll[data-axis="vertical"][data-fade-start][data-fade-end] {
|
|
2483
|
+
mask-image: linear-gradient(to bottom, transparent, black var(--atbl-scroll-fade-size), black calc(100% - var(--atbl-scroll-fade-size)), transparent);
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
.altertable-gradient-scroll[data-axis="vertical"][data-fade-start]:not([data-fade-end]) {
|
|
2487
|
+
mask-image: linear-gradient(to bottom, transparent, black var(--atbl-scroll-fade-size));
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
.altertable-gradient-scroll[data-axis="vertical"][data-fade-end]:not([data-fade-start]) {
|
|
2491
|
+
mask-image: linear-gradient(to bottom, black, black calc(100% - var(--atbl-scroll-fade-size)), transparent);
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
.altertable-gradient-scroll[data-axis="horizontal"][data-fade-start][data-fade-end] {
|
|
2495
|
+
mask-image: linear-gradient(to right, transparent, black var(--atbl-scroll-fade-size), black calc(100% - var(--atbl-scroll-fade-size)), transparent);
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
.altertable-gradient-scroll[data-axis="horizontal"][data-fade-start]:not([data-fade-end]) {
|
|
2499
|
+
mask-image: linear-gradient(to right, transparent, black var(--atbl-scroll-fade-size));
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
.altertable-gradient-scroll[data-axis="horizontal"][data-fade-end]:not([data-fade-start]) {
|
|
2503
|
+
mask-image: linear-gradient(to right, black, black calc(100% - var(--atbl-scroll-fade-size)), transparent);
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
/* packages/data-app-react/src/ui/Focus.css */
|
|
2508
|
+
@layer atbl.interaction {
|
|
2509
|
+
[data-atbl-focus="inset"][data-atbl-internal-focus-state="focused"][data-focused] {
|
|
2510
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2511
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
[data-atbl-focus="ring"]:-webkit-any(:focus-visible, [data-focus-visible]) {
|
|
2515
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2516
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
[data-atbl-focus="ring"]:-moz-any(:focus-visible, [data-focus-visible]) {
|
|
2520
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2521
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
[data-atbl-focus="ring"]:is(:focus-visible, [data-focus-visible]) {
|
|
2525
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2526
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
[data-atbl-focus="ring"]:has( > input:focus-visible) {
|
|
2530
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2531
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
[data-atbl-focus="inset"]:-webkit-any(:focus-visible, [data-focus-visible]) {
|
|
2535
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2536
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
[data-atbl-focus="inset"]:-moz-any(:focus-visible, [data-focus-visible]) {
|
|
2540
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2541
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
[data-atbl-focus="inset"]:is(:focus-visible, [data-focus-visible]) {
|
|
2545
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2546
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
[data-atbl-internal-prose] a:focus-visible {
|
|
2550
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2551
|
+
outline-offset: var(--atbl-focus-ring-offset);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
[data-atbl-focus="inset"][data-atbl-internal-focus-state="focused"][data-focused] {
|
|
2555
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
[data-atbl-focus="inset"]:-webkit-any(:focus-visible, [data-focus-visible]) {
|
|
2559
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
[data-atbl-focus="inset"]:-moz-any(:focus-visible, [data-focus-visible]) {
|
|
2563
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
[data-atbl-focus="inset"]:is(:focus-visible, [data-focus-visible]) {
|
|
2567
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
[data-atbl-focus="group"]:-webkit-any(:focus-within, [data-focus-within], [data-focus-visible]) {
|
|
2571
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2572
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
[data-atbl-focus="group"]:-moz-any(:focus-within, [data-focus-within], [data-focus-visible]) {
|
|
2576
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2577
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
[data-atbl-focus="group"]:is(:focus-within, [data-focus-within], [data-focus-visible]) {
|
|
2581
|
+
outline: var(--atbl-focus-outline, 1px solid var(--atbl-focus-color, var(--atbl-muted)));
|
|
2582
|
+
outline-offset: var(--atbl-focus-ring-inset);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
[data-atbl-focus="group"] input:focus-visible {
|
|
2586
|
+
outline: none;
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
@media (forced-colors: active) {
|
|
2590
|
+
[data-atbl-focus]:-webkit-any(:focus-visible, :focus-within, [data-focus-visible]) {
|
|
2591
|
+
outline-color: highlight !important;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
[data-atbl-focus]:-moz-any(:focus-visible, :focus-within, [data-focus-visible]) {
|
|
2595
|
+
outline-color: highlight !important;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
[data-atbl-focus]:is(:focus-visible, :focus-within, [data-focus-visible]) {
|
|
2599
|
+
outline-color: highlight !important;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
[data-atbl-internal-prose] a:focus-visible {
|
|
2603
|
+
outline-color: highlight !important;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
/* packages/data-app-react/src/interaction.css */
|
|
2609
|
+
@layer atbl.interaction {
|
|
2610
|
+
[data-atbl-control="default"] {
|
|
2611
|
+
cursor: default;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
[data-atbl-control="action"], [data-atbl-internal-prose] a {
|
|
2615
|
+
cursor: var(--atbl-cursor-action);
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
[data-atbl-control="help"] {
|
|
2619
|
+
cursor: var(--atbl-cursor-help);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
[data-atbl-control="text"] {
|
|
2623
|
+
cursor: text;
|
|
2624
|
+
font-size: var(--atbl-control-text-size, var(--atbl-type-body-size));
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
@media (max-width: 560px), (any-pointer: coarse) {
|
|
2628
|
+
[data-atbl-control="text"] {
|
|
2629
|
+
font-size: max(16px, var(--atbl-control-text-size, var(--atbl-type-body-size)));
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
[data-atbl-control]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
|
|
2634
|
+
cursor: var(--atbl-cursor-disabled);
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
[data-atbl-control]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
|
|
2638
|
+
cursor: var(--atbl-cursor-disabled);
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
[data-atbl-control]:is(:disabled, [data-disabled], [aria-disabled="true"], [data-unavailable]) {
|
|
2642
|
+
cursor: var(--atbl-cursor-disabled);
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
[data-atbl-control]:has( > input:disabled) {
|
|
2646
|
+
cursor: var(--atbl-cursor-disabled);
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
[data-atbl-control="action"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2650
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
[data-atbl-control="action"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2654
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
[data-atbl-control="action"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2658
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
[data-atbl-control="help"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2662
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
[data-atbl-control="help"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2666
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
[data-atbl-control="help"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2670
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
[data-atbl-control]:has( > input:disabled) {
|
|
2674
|
+
opacity: var(--atbl-control-disabled-opacity);
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
[data-atbl-control][aria-busy="true"]:not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2678
|
+
cursor: var(--atbl-cursor-busy);
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
[data-atbl-control][aria-busy="true"]:not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2682
|
+
cursor: var(--atbl-cursor-busy);
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
[data-atbl-control][aria-busy="true"]:not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2686
|
+
cursor: var(--atbl-cursor-busy);
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-webkit-any(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2690
|
+
background: var(--atbl-control-hover-surface, var(--atbl-subtle));
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-moz-any(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2694
|
+
background: var(--atbl-control-hover-surface, var(--atbl-subtle));
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):is(:hover, [data-hovered], [data-focused], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2698
|
+
background: var(--atbl-control-hover-surface, var(--atbl-subtle));
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-webkit-any(:active, [data-pressed]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2702
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):-moz-any(:active, [data-pressed]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2706
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
:where([data-atbl-internal-surface="control"], [data-atbl-internal-surface="option"]):is(:active, [data-pressed]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2710
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-surface)));
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
:where([data-atbl-internal-surface="control"]):-webkit-any([aria-expanded="true"], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2714
|
+
background: var(--atbl-control-open-surface, var(--atbl-surface));
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
:where([data-atbl-internal-surface="control"]):-moz-any([aria-expanded="true"], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2718
|
+
background: var(--atbl-control-open-surface, var(--atbl-surface));
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
:where([data-atbl-internal-surface="control"]):is([aria-expanded="true"], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2722
|
+
background: var(--atbl-control-open-surface, var(--atbl-surface));
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
:where([data-atbl-internal-surface="control"]):-webkit-any([data-variant="outline"], [data-variant="elevated"]):-webkit-any([aria-expanded="true"], [data-open="true"]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2726
|
+
border-color: var(--atbl-control-open-border, var(--atbl-muted));
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
:where([data-atbl-internal-surface="control"]):-moz-any([data-variant="outline"], [data-variant="elevated"]):-moz-any([aria-expanded="true"], [data-open="true"]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2730
|
+
border-color: var(--atbl-control-open-border, var(--atbl-muted));
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
:where([data-atbl-internal-surface="control"]):is([data-variant="outline"], [data-variant="elevated"]):is([aria-expanded="true"], [data-open="true"]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2734
|
+
border-color: var(--atbl-control-open-border, var(--atbl-muted));
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
:where([data-atbl-internal-surface="control"]):-webkit-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2738
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2739
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
:where([data-atbl-internal-surface="control"]):-moz-any([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2743
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2744
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
:where([data-atbl-internal-surface="control"]):is([aria-pressed="true"], [data-selected], [aria-current="true"], :has( > input:checked)):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2748
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2749
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2753
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2754
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2758
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2759
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2763
|
+
background: var(--atbl-control-selected-surface, var(--atbl-subtle));
|
|
2764
|
+
color: var(--atbl-control-selected-text, var(--atbl-text));
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2768
|
+
background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2772
|
+
background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:is(:hover, [data-hovered]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2776
|
+
background: var(--atbl-control-hover-surface, color-mix(in srgb, var(--atbl-text) 4%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:-webkit-any(:active, [data-pressed]):not(:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2780
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:-moz-any(:active, [data-pressed]):not(:-moz-any(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2784
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
:where([data-atbl-internal-surface="option"])[data-selected]:is(:active, [data-pressed]):not(:is(:disabled, [data-disabled], [aria-disabled="true"], :has( > input:disabled))) {
|
|
2788
|
+
background: var(--atbl-control-pressed-surface, color-mix(in srgb, var(--atbl-text) 8%, var(--atbl-control-selected-surface, var(--atbl-subtle))));
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
:where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):-webkit-any(:hover, [data-hovered]):not(:-webkit-any(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
|
|
2792
|
+
border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
:where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):-moz-any(:hover, [data-hovered]):not(:-moz-any(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
|
|
2796
|
+
border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
:where([data-atbl-internal-surface="field"], [data-atbl-internal-surface="control"][data-variant="outline"], [data-atbl-internal-surface="control"][data-variant="elevated"]):is(:hover, [data-hovered]):not(:is(:disabled, :has(input:disabled), [data-disabled], [aria-disabled="true"], [data-invalid], [aria-invalid="true"], :has(input[aria-invalid="true"]))) {
|
|
2800
|
+
border-color: var(--atbl-control-hover-border, color-mix(in srgb, var(--atbl-muted) 45%, var(--atbl-border)));
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
[data-atbl-internal-surface="field"]:-webkit-any([data-invalid], [aria-invalid="true"]) {
|
|
2804
|
+
border-color: var(--atbl-danger);
|
|
2805
|
+
--atbl-focus-color: var(--atbl-danger);
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
[data-atbl-internal-surface="field"]:-moz-any([data-invalid], [aria-invalid="true"]) {
|
|
2809
|
+
border-color: var(--atbl-danger);
|
|
2810
|
+
--atbl-focus-color: var(--atbl-danger);
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
[data-atbl-internal-surface="field"]:is([data-invalid], [aria-invalid="true"]) {
|
|
2814
|
+
border-color: var(--atbl-danger);
|
|
2815
|
+
--atbl-focus-color: var(--atbl-danger);
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
[data-atbl-internal-surface="field"]:has(input[aria-invalid="true"]) {
|
|
2819
|
+
border-color: var(--atbl-danger);
|
|
2820
|
+
--atbl-focus-color: var(--atbl-danger);
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
[data-atbl-control="text"]:-webkit-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2824
|
+
color: var(--atbl-muted);
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
[data-atbl-control="text"]:-moz-any(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2828
|
+
color: var(--atbl-muted);
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
[data-atbl-control="text"]:is(:disabled, [data-disabled], [aria-disabled="true"]) {
|
|
2832
|
+
color: var(--atbl-muted);
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
/* packages/data-app-react/src/annotations/styles.css */
|
|
2837
|
+
@layer atbl.tokens, atbl.base, atbl.components, atbl.interaction;
|
|
2838
|
+
`,
|
|
2839
|
+
options
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
export {
|
|
2843
|
+
AnnotationBar,
|
|
2844
|
+
AnnotationTarget,
|
|
2845
|
+
Breakdown,
|
|
2846
|
+
Button2 as Button,
|
|
2847
|
+
Comparison,
|
|
2848
|
+
DataApp,
|
|
2849
|
+
DataSection,
|
|
2850
|
+
DataValue,
|
|
2851
|
+
DateDisplay2 as DateDisplay,
|
|
2852
|
+
DateTimeTooltip2 as DateTimeTooltip,
|
|
2853
|
+
DetailContent2 as DetailContent,
|
|
2854
|
+
DetailView2 as DetailView,
|
|
2855
|
+
EmptyState2 as EmptyState,
|
|
2856
|
+
Grid,
|
|
2857
|
+
GridItem,
|
|
2858
|
+
IconButton2 as IconButton,
|
|
2859
|
+
MetricWidget,
|
|
2860
|
+
PeriodSummary,
|
|
2861
|
+
Ranking,
|
|
2862
|
+
SectionHeading2 as SectionHeading,
|
|
2863
|
+
Skeleton2 as Skeleton,
|
|
2864
|
+
Stack2 as Stack,
|
|
2865
|
+
TableWidget,
|
|
2866
|
+
TextContent2 as TextContent,
|
|
2867
|
+
TextWidget,
|
|
2868
|
+
Tooltip2 as Tooltip,
|
|
2869
|
+
TooltipProvider2 as TooltipProvider,
|
|
2870
|
+
UpdatedAt,
|
|
2871
|
+
VisualizationWidget,
|
|
2872
|
+
chartColor2 as chartColor,
|
|
2873
|
+
choiceVariable2 as choiceVariable,
|
|
2874
|
+
createDataContext2 as createDataContext,
|
|
2875
|
+
createDataHooks2 as createDataHooks,
|
|
2876
|
+
dateRangeVariable2 as dateRangeVariable,
|
|
2877
|
+
defineDataIdentifiers,
|
|
2878
|
+
injectDataAppAnnotationStyles,
|
|
2879
|
+
injectDataAppStyles2 as injectDataAppStyles,
|
|
2880
|
+
mountDataApp2 as mountDataApp,
|
|
2881
|
+
multiChoiceVariable2 as multiChoiceVariable,
|
|
2882
|
+
searchVariable2 as searchVariable,
|
|
2883
|
+
useDataAppAnnotations2 as useDataAppAnnotations,
|
|
2884
|
+
useDateFormatting2 as useDateFormatting,
|
|
2885
|
+
useDetailNavigation2 as useDetailNavigation
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
//# debugId=8E81DE85752CDA4F64756E2164756E21
|