@lobehub/ui 5.58.0 → 5.60.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/es/ActionIcon/style.mjs +8 -2
- package/es/ActionIcon/style.mjs.map +1 -1
- package/es/Grid/style.mjs +8 -8
- package/es/Grid/style.mjs.map +1 -1
- package/es/awesome/Grainient/Grainient.d.mts +11 -0
- package/es/awesome/Grainient/Grainient.mjs +311 -0
- package/es/awesome/Grainient/Grainient.mjs.map +1 -0
- package/es/awesome/Grainient/index.d.mts +3 -0
- package/es/awesome/Grainient/style.mjs +25 -0
- package/es/awesome/Grainient/style.mjs.map +1 -0
- package/es/awesome/Grainient/type.d.mts +122 -0
- package/es/awesome/index.d.mts +4 -1
- package/es/awesome/index.mjs +2 -1
- package/es/base-ui/ActionIcon/style.mjs +8 -2
- package/es/base-ui/ActionIcon/style.mjs.map +1 -1
- package/es/base-ui/Input/style.mjs +8 -2
- package/es/base-ui/Input/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
- package/es/dashboard/AuthLayout/Aside.mjs +30 -0
- package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
- package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
- package/es/dashboard/AuthLayout/index.d.mts +3 -2
- package/es/dashboard/AuthLayout/style.mjs +120 -1
- package/es/dashboard/AuthLayout/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/type.d.mts +39 -3
- package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +32 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/index.d.mts +4 -0
- package/es/dashboard/AuthTools/style.mjs +63 -0
- package/es/dashboard/AuthTools/style.mjs.map +1 -0
- package/es/dashboard/AuthTools/type.d.mts +30 -0
- package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs +18 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
- package/es/dashboard/ChartGrid/index.d.mts +3 -0
- package/es/dashboard/ChartGrid/style.mjs +32 -0
- package/es/dashboard/ChartGrid/style.mjs.map +1 -0
- package/es/dashboard/ChartGrid/type.d.mts +9 -0
- package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs +81 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +3 -2
- package/es/dashboard/ConsoleNav/style.mjs +15 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/type.d.mts +14 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +22 -6
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +21 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +11 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
- package/es/dashboard/FilterStrip/index.d.mts +3 -0
- package/es/dashboard/FilterStrip/style.mjs +94 -0
- package/es/dashboard/FilterStrip/style.mjs.map +1 -0
- package/es/dashboard/FilterStrip/type.d.mts +26 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
- package/es/dashboard/LabelWithKey/index.d.mts +3 -0
- package/es/dashboard/LabelWithKey/type.d.mts +12 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
- package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
- package/es/dashboard/MetricStrip/index.d.mts +3 -0
- package/es/dashboard/MetricStrip/style.mjs +161 -0
- package/es/dashboard/MetricStrip/style.mjs.map +1 -0
- package/es/dashboard/MetricStrip/type.d.mts +37 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
- package/es/dashboard/PageSkeleton/style.mjs +1 -1
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
- package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs +21 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
- package/es/dashboard/PageToolbar/index.d.mts +3 -0
- package/es/dashboard/PageToolbar/style.mjs +34 -0
- package/es/dashboard/PageToolbar/style.mjs.map +1 -0
- package/es/dashboard/PageToolbar/type.d.mts +12 -0
- package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs +39 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
- package/es/dashboard/PanelSurface/index.d.mts +3 -0
- package/es/dashboard/PanelSurface/style.mjs +24 -0
- package/es/dashboard/PanelSurface/style.mjs.map +1 -0
- package/es/dashboard/PanelSurface/type.d.mts +18 -0
- package/es/dashboard/Section/Section.d.mts +10 -0
- package/es/dashboard/Section/Section.mjs +81 -0
- package/es/dashboard/Section/Section.mjs.map +1 -0
- package/es/dashboard/Section/index.d.mts +3 -0
- package/es/dashboard/Section/style.mjs +35 -0
- package/es/dashboard/Section/style.mjs.map +1 -0
- package/es/dashboard/Section/type.d.mts +24 -0
- package/es/dashboard/StatCard/StatCard.d.mts +2 -1
- package/es/dashboard/StatCard/StatCard.mjs +24 -72
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
- package/es/dashboard/StatCard/type.d.mts +16 -5
- package/es/dashboard/Surface/Surface.d.mts +4 -3
- package/es/dashboard/Surface/Surface.mjs +83 -7
- package/es/dashboard/Surface/Surface.mjs.map +1 -1
- package/es/dashboard/Surface/index.d.mts +3 -2
- package/es/dashboard/Surface/link.d.mts +19 -0
- package/es/dashboard/Surface/link.mjs +33 -0
- package/es/dashboard/Surface/link.mjs.map +1 -0
- package/es/dashboard/Surface/style.d.mts +45 -3
- package/es/dashboard/Surface/style.mjs +358 -8
- package/es/dashboard/Surface/style.mjs.map +1 -1
- package/es/dashboard/Surface/type.d.mts +30 -2
- package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
- package/es/dashboard/TableIconActions/index.d.mts +3 -0
- package/es/dashboard/TableIconActions/type.d.mts +18 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
- package/es/dashboard/TitleWithTips/index.d.mts +3 -0
- package/es/dashboard/TitleWithTips/type.d.mts +11 -0
- package/es/dashboard/index.d.mts +38 -4
- package/es/dashboard/index.mjs +17 -3
- package/package.json +1 -1
- package/es/dashboard/StatCard/style.mjs +0 -135
- package/es/dashboard/StatCard/style.mjs.map +0 -1
|
@@ -3,19 +3,369 @@ import { createStaticStyles } from "antd-style";
|
|
|
3
3
|
/**
|
|
4
4
|
* A content card sitting on the workspace.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
6
|
+
* Backgrounds: light mode uses `colorBgContainer`. Dark mode uses the translucent
|
|
7
|
+
* `colorFillTertiary` (white 6%): on the #0d0d0d workspace it reads as about #1c1c1c, a subtle
|
|
8
|
+
* raised step. `colorFillQuaternary` (white 2%, about #111) would barely separate from the page.
|
|
9
|
+
*
|
|
10
|
+
* Borders and inner dividers (table, header and cell lines, PageSkeleton) use `colorFillSecondary`
|
|
11
|
+
* (white 10% / black 6%); hover and focus use the stronger `colorFill`. Painted over the dark card
|
|
12
|
+
* the border lands near #2f2f2f against #1c1c1c, and in light near #f0f0f0 against #ffffff.
|
|
13
|
+
*
|
|
14
|
+
* Anything that must hide content scrolled beneath it (table header cells, pinned and sticky
|
|
15
|
+
* cells, their scroll shadows) uses `--lobe-surface-bg-solid`: the same white 6% blended onto
|
|
16
|
+
* `--lobe-surface-canvas` (default `colorBgContainer`, the ConsoleShell workspace). `color-mix`
|
|
17
|
+
* in srgb with an opaque base is plain alpha compositing, so it matches the translucent card.
|
|
18
|
+
* Set `--lobe-surface-canvas` when a card sits on another page color.
|
|
19
|
+
*
|
|
20
|
+
* A Surface inside another Surface (`useSurfaceDepth() > 0`) drops its own fill so fills do not
|
|
21
|
+
* stack. Row hover backgrounds keep their own mix. Layout containers (ConsoleShell, ConsoleNav,
|
|
22
|
+
* FilterSidebar split divider, AuthLayout page canvas) keep their own tokens.
|
|
23
|
+
*
|
|
24
|
+
* Apply the card with `useSurfaceCardClassName()`; plain `surfaceStyles.card` is the light look.
|
|
9
25
|
*/
|
|
10
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
26
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
27
|
+
card: css`
|
|
28
|
+
--lobe-surface-bg: ${cssVar.colorBgContainer};
|
|
29
|
+
--lobe-surface-bg-solid: ${cssVar.colorBgContainer};
|
|
30
|
+
|
|
11
31
|
&&,
|
|
12
32
|
&&:hover {
|
|
13
|
-
border: 1px solid ${cssVar.
|
|
33
|
+
border: 1px solid ${cssVar.colorFillSecondary};
|
|
14
34
|
border-radius: ${cssVar.borderRadiusLG};
|
|
15
|
-
background:
|
|
16
|
-
box-shadow:
|
|
35
|
+
background: var(--lobe-surface-bg);
|
|
36
|
+
box-shadow: rgb(0 0 0 / 4%) 0 1px 2px 0;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
cardDark: css`
|
|
40
|
+
&&& {
|
|
41
|
+
--lobe-surface-bg: ${cssVar.colorFillTertiary};
|
|
42
|
+
|
|
43
|
+
/* colorFillTertiary is white 6% in dark; blend the same amount onto the page. */
|
|
44
|
+
--lobe-surface-bg-solid: color-mix(
|
|
45
|
+
in srgb,
|
|
46
|
+
#fff 6%,
|
|
47
|
+
var(--lobe-surface-canvas, ${cssVar.colorBgContainer})
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
cardNested: css`
|
|
52
|
+
&&&,
|
|
53
|
+
&&&:hover {
|
|
54
|
+
background: transparent;
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
chart: css`
|
|
58
|
+
min-inline-size: 0;
|
|
59
|
+
`,
|
|
60
|
+
/** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */
|
|
61
|
+
clip: css`
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
`,
|
|
64
|
+
loading: css`
|
|
65
|
+
padding-block: 4px 8px;
|
|
66
|
+
`,
|
|
67
|
+
arrow: css`
|
|
68
|
+
flex: none;
|
|
69
|
+
|
|
70
|
+
margin-block-start: 8px;
|
|
71
|
+
margin-inline-start: auto;
|
|
72
|
+
|
|
73
|
+
color: ${cssVar.colorTextTertiary};
|
|
74
|
+
|
|
75
|
+
transition:
|
|
76
|
+
color 150ms ease-out,
|
|
77
|
+
transform 150ms ease-out;
|
|
78
|
+
`,
|
|
79
|
+
arrowLink: css`
|
|
80
|
+
display: flex;
|
|
81
|
+
flex: none;
|
|
82
|
+
align-items: center;
|
|
83
|
+
color: inherit;
|
|
84
|
+
|
|
85
|
+
& [data-surface-arrow] {
|
|
86
|
+
margin-block-start: 0;
|
|
87
|
+
}
|
|
88
|
+
`,
|
|
89
|
+
bleed: css`
|
|
90
|
+
&& th,
|
|
91
|
+
&& td {
|
|
92
|
+
padding-inline: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&& th {
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
`,
|
|
99
|
+
body: css`
|
|
100
|
+
--surface-pad-inline: 16px;
|
|
101
|
+
--surface-pad-block: 16px;
|
|
102
|
+
|
|
103
|
+
padding: 16px;
|
|
104
|
+
`,
|
|
105
|
+
/** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */
|
|
106
|
+
content: css`
|
|
107
|
+
min-inline-size: 0;
|
|
108
|
+
|
|
109
|
+
/* Ant Design paints its own container color on .ant-table and the cells.
|
|
110
|
+
Clear it so the card background shows through; the card owns the fill. */
|
|
111
|
+
&& .ant-table,
|
|
112
|
+
&& th,
|
|
113
|
+
&& td {
|
|
114
|
+
background: transparent;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&& .ant-table-css-var,
|
|
118
|
+
&& .ant-table-wrapper {
|
|
119
|
+
--ant-table-border-color: ${cssVar.colorFillSecondary};
|
|
120
|
+
--ant-table-row-hover-bg: color-mix(
|
|
121
|
+
in srgb,
|
|
122
|
+
${cssVar.colorText} 6%,
|
|
123
|
+
${cssVar.colorBgElevated}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&& th {
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
color: ${cssVar.colorTextSecondary};
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
|
|
132
|
+
background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});
|
|
133
|
+
box-shadow: inset 0 -1px 0 ${cssVar.colorFillSecondary};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Pinned body cells inherit the transparent body, so a scrolled cell paints
|
|
137
|
+
straight through them. Frost with the card color. Header pins stay the
|
|
138
|
+
same solid fill as the rest of the header — a translucent header reads
|
|
139
|
+
as a lighter strip in dark mode. */
|
|
140
|
+
&& td.ant-table-cell-fix-start,
|
|
141
|
+
&& td.ant-table-cell-fix-end {
|
|
142
|
+
background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});
|
|
143
|
+
backdrop-filter: blur(12px);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&& td.ant-table-cell-fix-end-shadow-show::after {
|
|
147
|
+
background: linear-gradient(
|
|
148
|
+
to left,
|
|
149
|
+
color-mix(
|
|
150
|
+
in srgb,
|
|
151
|
+
var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,
|
|
152
|
+
transparent
|
|
153
|
+
),
|
|
154
|
+
transparent
|
|
155
|
+
);
|
|
156
|
+
backdrop-filter: blur(8px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&& td.ant-table-cell-fix-start-shadow-show::after {
|
|
160
|
+
background: linear-gradient(
|
|
161
|
+
to right,
|
|
162
|
+
color-mix(
|
|
163
|
+
in srgb,
|
|
164
|
+
var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,
|
|
165
|
+
transparent
|
|
166
|
+
),
|
|
167
|
+
transparent
|
|
168
|
+
);
|
|
169
|
+
backdrop-filter: blur(8px);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[dir='rtl'] && td.ant-table-cell-fix-end-shadow-show::after {
|
|
173
|
+
background: linear-gradient(
|
|
174
|
+
to right,
|
|
175
|
+
color-mix(
|
|
176
|
+
in srgb,
|
|
177
|
+
var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,
|
|
178
|
+
transparent
|
|
179
|
+
),
|
|
180
|
+
transparent
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[dir='rtl'] && td.ant-table-cell-fix-start-shadow-show::after {
|
|
185
|
+
background: linear-gradient(
|
|
186
|
+
to left,
|
|
187
|
+
color-mix(
|
|
188
|
+
in srgb,
|
|
189
|
+
var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,
|
|
190
|
+
transparent
|
|
191
|
+
),
|
|
192
|
+
transparent
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&& td {
|
|
197
|
+
border-block-end-color: ${cssVar.colorFillSecondary};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&& tr:hover > td,
|
|
201
|
+
&& .ant-table-tbody > tr.ant-table-row:hover > td {
|
|
202
|
+
background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* base-ui Table pins with inline position:sticky, not .ant-table-cell-fix-*.
|
|
206
|
+
The transparent body rule above would let scrolled text show through. */
|
|
207
|
+
&& td[style*='sticky'] {
|
|
208
|
+
background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&& tr:hover > td[style*='sticky'] {
|
|
212
|
+
background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});
|
|
213
|
+
}
|
|
214
|
+
`,
|
|
215
|
+
/** Whole card answers hover when its header drills into another page. */
|
|
216
|
+
cardLinked: css`
|
|
217
|
+
&&:hover,
|
|
218
|
+
&&:focus-within {
|
|
219
|
+
border-color: ${cssVar.colorFill};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&&:hover [data-surface-arrow] {
|
|
223
|
+
transform: translate(1px, -1px);
|
|
224
|
+
color: ${cssVar.colorText};
|
|
225
|
+
}
|
|
226
|
+
`,
|
|
227
|
+
desc: css`
|
|
228
|
+
margin-block-start: -4px;
|
|
229
|
+
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
font-weight: 400;
|
|
232
|
+
line-height: 1.45;
|
|
233
|
+
color: ${cssVar.colorTextSecondary};
|
|
234
|
+
`,
|
|
235
|
+
extra: css`
|
|
236
|
+
display: flex;
|
|
237
|
+
flex: none;
|
|
238
|
+
gap: 8px;
|
|
239
|
+
align-items: center;
|
|
240
|
+
|
|
241
|
+
block-size: 32px;
|
|
242
|
+
`,
|
|
243
|
+
header: css`
|
|
244
|
+
display: flex;
|
|
245
|
+
gap: 12px;
|
|
246
|
+
align-items: flex-start;
|
|
247
|
+
justify-content: space-between;
|
|
248
|
+
|
|
249
|
+
box-sizing: border-box;
|
|
250
|
+
min-block-size: 48px;
|
|
251
|
+
padding-block: 8px;
|
|
252
|
+
padding-inline: 16px;
|
|
253
|
+
border-block-end: 1px solid ${cssVar.colorFillSecondary};
|
|
254
|
+
`,
|
|
255
|
+
heading: css`
|
|
256
|
+
min-inline-size: 0;
|
|
257
|
+
`,
|
|
258
|
+
headingLink: css`
|
|
259
|
+
display: flex;
|
|
260
|
+
flex: 1;
|
|
261
|
+
gap: 12px;
|
|
262
|
+
align-items: flex-start;
|
|
263
|
+
|
|
264
|
+
min-inline-size: 0;
|
|
265
|
+
|
|
266
|
+
color: inherit;
|
|
267
|
+
text-decoration: none;
|
|
268
|
+
|
|
269
|
+
&:hover {
|
|
270
|
+
color: inherit;
|
|
271
|
+
}
|
|
272
|
+
`,
|
|
273
|
+
/**
|
|
274
|
+
* A table inside padded card body meets the card's left, right, and bottom
|
|
275
|
+
* edges. A table that is the only body content also meets the header.
|
|
276
|
+
* Padding amounts come from `--surface-pad-*` on the same element.
|
|
277
|
+
*/
|
|
278
|
+
tableBleed: css`
|
|
279
|
+
/* A table nested in a cell keeps the cell's own inset. */
|
|
280
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) {
|
|
281
|
+
width: calc(100% + 2 * var(--surface-pad-inline, 16px));
|
|
282
|
+
margin-inline: calc(-1 * var(--surface-pad-inline, 16px));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):last-child {
|
|
286
|
+
margin-block-end: calc(-1 * var(--surface-pad-block, 16px));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):first-child:last-child {
|
|
290
|
+
margin-block-start: calc(-1 * var(--surface-pad-block, 16px));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* ProTable keeps its search and toolbar in the padding. The table itself
|
|
294
|
+
meets the card's left, right, and bottom edges. Lower-specificity
|
|
295
|
+
selectors stay above the :has(th/td) rules for stylelint. */
|
|
296
|
+
&& .ant-table-css-var,
|
|
297
|
+
&& .ant-table-wrapper {
|
|
298
|
+
--ant-table-cell-padding-inline: var(--surface-pad-inline, 16px);
|
|
299
|
+
--ant-table-cell-padding-inline-md: var(--surface-pad-inline, 16px);
|
|
300
|
+
--ant-table-cell-padding-inline-sm: var(--surface-pad-inline, 16px);
|
|
301
|
+
--ant-table-header-border-radius: 0;
|
|
17
302
|
}
|
|
18
|
-
|
|
303
|
+
|
|
304
|
+
&& .ant-table-wrapper {
|
|
305
|
+
width: calc(100% + 2 * var(--surface-pad-inline, 16px));
|
|
306
|
+
max-width: none;
|
|
307
|
+
margin-inline: calc(-1 * var(--surface-pad-inline, 16px));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* A plain table that is the card body meets the header and the bottom edge.
|
|
311
|
+
Its own corner radius would otherwise float inside the card padding. */
|
|
312
|
+
&& > .lobe-flex:only-child > .ant-table-wrapper:only-child {
|
|
313
|
+
margin-block: calc(-1 * var(--surface-pad-block, 16px));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&& .ant-pro-table:last-child {
|
|
317
|
+
margin-block-end: calc(-1 * var(--surface-pad-block, 16px));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
&& .ant-table-wrapper .ant-table,
|
|
321
|
+
&& .ant-table-wrapper .ant-table-container,
|
|
322
|
+
&& .ant-table-thead > tr > th,
|
|
323
|
+
&& .ant-table-thead > tr > th:first-child,
|
|
324
|
+
&& .ant-table-thead > tr > th:last-child {
|
|
325
|
+
border-radius: 0;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
&& .ant-table-wrapper .ant-table-cell {
|
|
329
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
&& .ant-table-wrapper .ant-pagination {
|
|
333
|
+
margin-block: 0;
|
|
334
|
+
padding-block: 12px;
|
|
335
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) th,
|
|
339
|
+
&& :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) td {
|
|
340
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* The root's negative bottom margin includes this sibling. Without block
|
|
344
|
+
padding the pager sits on the card edge. Same inset as the ant pagination. */
|
|
345
|
+
&&
|
|
346
|
+
:has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper]))
|
|
347
|
+
> :not([data-table-wrapper]) {
|
|
348
|
+
margin-block: 0;
|
|
349
|
+
padding-block: 12px;
|
|
350
|
+
padding-inline: var(--surface-pad-inline, 16px);
|
|
351
|
+
}
|
|
352
|
+
`,
|
|
353
|
+
title: css`
|
|
354
|
+
overflow: hidden;
|
|
355
|
+
|
|
356
|
+
min-inline-size: 0;
|
|
357
|
+
|
|
358
|
+
font-size: 14px;
|
|
359
|
+
font-weight: 500;
|
|
360
|
+
|
|
361
|
+
/* The title line is the 32px control row; extra and the arrow center on it, and a
|
|
362
|
+
description adds its own line below without moving them. */
|
|
363
|
+
line-height: 32px;
|
|
364
|
+
color: ${cssVar.colorText};
|
|
365
|
+
text-overflow: ellipsis;
|
|
366
|
+
white-space: nowrap;
|
|
367
|
+
`
|
|
368
|
+
}));
|
|
19
369
|
//#endregion
|
|
20
370
|
export { styles };
|
|
21
371
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Surface/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\n/**\n * A content card sitting on the workspace.\n *\n * Outlined `Block` uses `colorBorderSecondary` on `colorBgContainer`.\n * The workspace is already that container, so a card inside it steps up to\n * `colorBgElevated` and `colorBorder`.\n */\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n card: css`\n &&,\n &&:hover {\n border: 1px solid ${cssVar.colorBorder};\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorBgElevated};\n box-shadow: ${cssVar.boxShadowTertiary};\n }\n `,\n}));\n"],"mappings":";;;;;;;;;AASA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc,EAC7D,MAAM,GAAG;;;0BAGe,OAAO,YAAY;uBACtB,OAAO,eAAe;oBACzB,OAAO,gBAAgB;oBACvB,OAAO,kBAAkB;;IAG7C,EAAE"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/dashboard/Surface/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\n/**\n * A content card sitting on the workspace.\n *\n * Backgrounds: light mode uses `colorBgContainer`. Dark mode uses the translucent\n * `colorFillTertiary` (white 6%): on the #0d0d0d workspace it reads as about #1c1c1c, a subtle\n * raised step. `colorFillQuaternary` (white 2%, about #111) would barely separate from the page.\n *\n * Borders and inner dividers (table, header and cell lines, PageSkeleton) use `colorFillSecondary`\n * (white 10% / black 6%); hover and focus use the stronger `colorFill`. Painted over the dark card\n * the border lands near #2f2f2f against #1c1c1c, and in light near #f0f0f0 against #ffffff.\n *\n * Anything that must hide content scrolled beneath it (table header cells, pinned and sticky\n * cells, their scroll shadows) uses `--lobe-surface-bg-solid`: the same white 6% blended onto\n * `--lobe-surface-canvas` (default `colorBgContainer`, the ConsoleShell workspace). `color-mix`\n * in srgb with an opaque base is plain alpha compositing, so it matches the translucent card.\n * Set `--lobe-surface-canvas` when a card sits on another page color.\n *\n * A Surface inside another Surface (`useSurfaceDepth() > 0`) drops its own fill so fills do not\n * stack. Row hover backgrounds keep their own mix. Layout containers (ConsoleShell, ConsoleNav,\n * FilterSidebar split divider, AuthLayout page canvas) keep their own tokens.\n *\n * Apply the card with `useSurfaceCardClassName()`; plain `surfaceStyles.card` is the light look.\n */\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n card: css`\n --lobe-surface-bg: ${cssVar.colorBgContainer};\n --lobe-surface-bg-solid: ${cssVar.colorBgContainer};\n\n &&,\n &&:hover {\n border: 1px solid ${cssVar.colorFillSecondary};\n border-radius: ${cssVar.borderRadiusLG};\n background: var(--lobe-surface-bg);\n box-shadow: rgb(0 0 0 / 4%) 0 1px 2px 0;\n }\n `,\n cardDark: css`\n &&& {\n --lobe-surface-bg: ${cssVar.colorFillTertiary};\n\n /* colorFillTertiary is white 6% in dark; blend the same amount onto the page. */\n --lobe-surface-bg-solid: color-mix(\n in srgb,\n #fff 6%,\n var(--lobe-surface-canvas, ${cssVar.colorBgContainer})\n );\n }\n `,\n cardNested: css`\n &&&,\n &&&:hover {\n background: transparent;\n }\n `,\n chart: css`\n min-inline-size: 0;\n `,\n /** Rounded corners clip a bled table, header rule, or chart. Bare cards keep overflow visible. */\n clip: css`\n overflow: hidden;\n `,\n loading: css`\n padding-block: 4px 8px;\n `,\n arrow: css`\n flex: none;\n\n margin-block-start: 8px;\n margin-inline-start: auto;\n\n color: ${cssVar.colorTextTertiary};\n\n transition:\n color 150ms ease-out,\n transform 150ms ease-out;\n `,\n arrowLink: css`\n display: flex;\n flex: none;\n align-items: center;\n color: inherit;\n\n & [data-surface-arrow] {\n margin-block-start: 0;\n }\n `,\n bleed: css`\n && th,\n && td {\n padding-inline: 16px;\n }\n\n && th {\n white-space: nowrap;\n }\n `,\n body: css`\n --surface-pad-inline: 16px;\n --surface-pad-block: 16px;\n\n padding: 16px;\n `,\n /** Table and header rules for the rich card. Kept off `card` so the shared class stays a plain frame. */\n content: css`\n min-inline-size: 0;\n\n /* Ant Design paints its own container color on .ant-table and the cells.\n Clear it so the card background shows through; the card owns the fill. */\n && .ant-table,\n && th,\n && td {\n background: transparent;\n }\n\n && .ant-table-css-var,\n && .ant-table-wrapper {\n --ant-table-border-color: ${cssVar.colorFillSecondary};\n --ant-table-row-hover-bg: color-mix(\n in srgb,\n ${cssVar.colorText} 6%,\n ${cssVar.colorBgElevated}\n );\n }\n\n && th {\n font-weight: 500;\n color: ${cssVar.colorTextSecondary};\n white-space: nowrap;\n\n background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});\n box-shadow: inset 0 -1px 0 ${cssVar.colorFillSecondary};\n }\n\n /* Pinned body cells inherit the transparent body, so a scrolled cell paints\n straight through them. Frost with the card color. Header pins stay the\n same solid fill as the rest of the header — a translucent header reads\n as a lighter strip in dark mode. */\n && td.ant-table-cell-fix-start,\n && td.ant-table-cell-fix-end {\n background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});\n backdrop-filter: blur(12px);\n }\n\n && td.ant-table-cell-fix-end-shadow-show::after {\n background: linear-gradient(\n to left,\n color-mix(\n in srgb,\n var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,\n transparent\n ),\n transparent\n );\n backdrop-filter: blur(8px);\n }\n\n && td.ant-table-cell-fix-start-shadow-show::after {\n background: linear-gradient(\n to right,\n color-mix(\n in srgb,\n var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,\n transparent\n ),\n transparent\n );\n backdrop-filter: blur(8px);\n }\n\n [dir='rtl'] && td.ant-table-cell-fix-end-shadow-show::after {\n background: linear-gradient(\n to right,\n color-mix(\n in srgb,\n var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,\n transparent\n ),\n transparent\n );\n }\n\n [dir='rtl'] && td.ant-table-cell-fix-start-shadow-show::after {\n background: linear-gradient(\n to left,\n color-mix(\n in srgb,\n var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer}) 72%,\n transparent\n ),\n transparent\n );\n }\n\n && td {\n border-block-end-color: ${cssVar.colorFillSecondary};\n }\n\n && tr:hover > td,\n && .ant-table-tbody > tr.ant-table-row:hover > td {\n background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});\n }\n\n /* base-ui Table pins with inline position:sticky, not .ant-table-cell-fix-*.\n The transparent body rule above would let scrolled text show through. */\n && td[style*='sticky'] {\n background: var(--lobe-surface-bg-solid, ${cssVar.colorBgContainer});\n }\n\n && tr:hover > td[style*='sticky'] {\n background: color-mix(in srgb, ${cssVar.colorText} 6%, ${cssVar.colorBgElevated});\n }\n `,\n /** Whole card answers hover when its header drills into another page. */\n cardLinked: css`\n &&:hover,\n &&:focus-within {\n border-color: ${cssVar.colorFill};\n }\n\n &&:hover [data-surface-arrow] {\n transform: translate(1px, -1px);\n color: ${cssVar.colorText};\n }\n `,\n desc: css`\n margin-block-start: -4px;\n\n font-size: 13px;\n font-weight: 400;\n line-height: 1.45;\n color: ${cssVar.colorTextSecondary};\n `,\n /* One fixed control row (32px, the height of a small Segmented or a default ActionIcon), so a\n header with controls is exactly as tall as one without, and the controls sit centered with\n 8px clear above the divider. */\n extra: css`\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n\n block-size: 32px;\n `,\n header: css`\n display: flex;\n gap: 12px;\n align-items: flex-start;\n justify-content: space-between;\n\n box-sizing: border-box;\n min-block-size: 48px;\n padding-block: 8px;\n padding-inline: 16px;\n border-block-end: 1px solid ${cssVar.colorFillSecondary};\n `,\n heading: css`\n min-inline-size: 0;\n `,\n headingLink: css`\n display: flex;\n flex: 1;\n gap: 12px;\n align-items: flex-start;\n\n min-inline-size: 0;\n\n color: inherit;\n text-decoration: none;\n\n &:hover {\n color: inherit;\n }\n `,\n /**\n * A table inside padded card body meets the card's left, right, and bottom\n * edges. A table that is the only body content also meets the header.\n * Padding amounts come from `--surface-pad-*` on the same element.\n */\n tableBleed: css`\n /* A table nested in a cell keeps the cell's own inset. */\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) {\n width: calc(100% + 2 * var(--surface-pad-inline, 16px));\n margin-inline: calc(-1 * var(--surface-pad-inline, 16px));\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):last-child {\n margin-block-end: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])):first-child:last-child {\n margin-block-start: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n /* ProTable keeps its search and toolbar in the padding. The table itself\n meets the card's left, right, and bottom edges. Lower-specificity\n selectors stay above the :has(th/td) rules for stylelint. */\n && .ant-table-css-var,\n && .ant-table-wrapper {\n --ant-table-cell-padding-inline: var(--surface-pad-inline, 16px);\n --ant-table-cell-padding-inline-md: var(--surface-pad-inline, 16px);\n --ant-table-cell-padding-inline-sm: var(--surface-pad-inline, 16px);\n --ant-table-header-border-radius: 0;\n }\n\n && .ant-table-wrapper {\n width: calc(100% + 2 * var(--surface-pad-inline, 16px));\n max-width: none;\n margin-inline: calc(-1 * var(--surface-pad-inline, 16px));\n }\n\n /* A plain table that is the card body meets the header and the bottom edge.\n Its own corner radius would otherwise float inside the card padding. */\n && > .lobe-flex:only-child > .ant-table-wrapper:only-child {\n margin-block: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && .ant-pro-table:last-child {\n margin-block-end: calc(-1 * var(--surface-pad-block, 16px));\n }\n\n && .ant-table-wrapper .ant-table,\n && .ant-table-wrapper .ant-table-container,\n && .ant-table-thead > tr > th,\n && .ant-table-thead > tr > th:first-child,\n && .ant-table-thead > tr > th:last-child {\n border-radius: 0;\n }\n\n && .ant-table-wrapper .ant-table-cell {\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n && .ant-table-wrapper .ant-pagination {\n margin-block: 0;\n padding-block: 12px;\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) th,\n && :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper])) td {\n padding-inline: var(--surface-pad-inline, 16px);\n }\n\n /* The root's negative bottom margin includes this sibling. Without block\n padding the pager sits on the card edge. Same inset as the ant pagination. */\n &&\n :has(> [data-table-wrapper]):not(td :has(> [data-table-wrapper]))\n > :not([data-table-wrapper]) {\n margin-block: 0;\n padding-block: 12px;\n padding-inline: var(--surface-pad-inline, 16px);\n }\n `,\n title: css`\n overflow: hidden;\n\n min-inline-size: 0;\n\n font-size: 14px;\n font-weight: 500;\n\n /* The title line is the 32px control row; extra and the arrow center on it, and a\n description adds its own line below without moving them. */\n line-height: 32px;\n color: ${cssVar.colorText};\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,MAAM,GAAG;yBACc,OAAO,iBAAiB;+BAClB,OAAO,iBAAiB;;;;0BAI7B,OAAO,mBAAmB;uBAC7B,OAAO,eAAe;;;;;CAK3C,UAAU,GAAG;;2BAEY,OAAO,kBAAkB;;;;;;qCAMf,OAAO,iBAAiB;;;;CAI3D,YAAY,GAAG;;;;;;CAMf,OAAO,GAAG;;;;CAIV,MAAM,GAAG;;;CAGT,SAAS,GAAG;;;CAGZ,OAAO,GAAG;;;;;;aAMC,OAAO,kBAAkB;;;;;;CAMpC,WAAW,GAAG;;;;;;;;;;CAUd,OAAO,GAAG;;;;;;;;;;CAUV,MAAM,GAAG;;;;;;;CAOT,SAAS,GAAG;;;;;;;;;;;;;kCAaoB,OAAO,mBAAmB;;;UAGlD,OAAO,UAAU;UACjB,OAAO,gBAAgB;;;;;;eAMlB,OAAO,mBAAmB;;;iDAGQ,OAAO,iBAAiB;mCACtC,OAAO,mBAAmB;;;;;;;;;iDASZ,OAAO,iBAAiB;;;;;;;;;yCAShC,OAAO,iBAAiB;;;;;;;;;;;;;yCAaxB,OAAO,iBAAiB;;;;;;;;;;;;;yCAaxB,OAAO,iBAAiB;;;;;;;;;;;;yCAYxB,OAAO,iBAAiB;;;;;;;;gCAQjC,OAAO,mBAAmB;;;;;uCAKnB,OAAO,UAAU,OAAO,OAAO,gBAAgB;;;;;;iDAMrC,OAAO,iBAAiB;;;;uCAIlC,OAAO,UAAU,OAAO,OAAO,gBAAgB;;;;CAIpF,YAAY,GAAG;;;sBAGK,OAAO,UAAU;;;;;eAKxB,OAAO,UAAU;;;CAG9B,MAAM,GAAG;;;;;;aAME,OAAO,mBAAmB;;CAKrC,OAAO,GAAG;;;;;;;;CAQV,QAAQ,GAAG;;;;;;;;;;kCAUqB,OAAO,mBAAmB;;CAE1D,SAAS,GAAG;;;CAGZ,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;CAoBhB,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Ef,OAAO,GAAG;;;;;;;;;;;aAWC,OAAO,UAAU;;;;AAI9B,EAAE"}
|
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
//#region src/dashboard/Surface/type.d.ts
|
|
3
|
-
interface
|
|
3
|
+
interface SurfaceLinkProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
href: string;
|
|
7
|
+
rel?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Renders a link with the app's router. Defaults to a plain `<a>`. */
|
|
11
|
+
type SurfaceRenderLink = (props: SurfaceLinkProps) => ReactNode;
|
|
12
|
+
interface SurfaceProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
13
|
+
/** Drop body padding and widen table cells so a table sits on the card edges. */
|
|
14
|
+
bleed?: boolean;
|
|
15
|
+
/** Full-width slot under the body, for a chart that meets the card edges. */
|
|
16
|
+
chart?: ReactNode;
|
|
4
17
|
children?: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
extra?: ReactNode;
|
|
20
|
+
/** Makes the heading a link to the page this card summarises. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/**
|
|
23
|
+
* First load: with no children the body is a placeholder block.
|
|
24
|
+
* A refresh with children keeps them and shows a small spinner in the header.
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** Pad the body. Defaults to on for a card with a header and off for a bare card. */
|
|
28
|
+
padded?: boolean;
|
|
29
|
+
/** Overrides the link renderer from `SurfaceLinkProvider`. */
|
|
30
|
+
renderLink?: SurfaceRenderLink;
|
|
31
|
+
/** Visible heading. */
|
|
32
|
+
title?: ReactNode;
|
|
5
33
|
}
|
|
6
34
|
//#endregion
|
|
7
|
-
export { SurfaceProps };
|
|
35
|
+
export { SurfaceLinkProps, SurfaceProps, SurfaceRenderLink };
|
|
8
36
|
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TableIconActionProps, TableIconActionsProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/TableIconActions/TableIconActions.d.ts
|
|
3
|
+
/** Column width for a row of `count` small filled action icons. */
|
|
4
|
+
declare const tableActionColumnWidth: (count: number) => number;
|
|
5
|
+
/** Right-aligned row of icon actions for a table's last column. */
|
|
6
|
+
declare const TableIconActions: {
|
|
7
|
+
({ children }: TableIconActionsProps): import("react").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
/** One row action: a small filled icon button whose label is its name and tooltip. */
|
|
11
|
+
declare const TableIconAction: {
|
|
12
|
+
({ danger, disabled, icon, label, loading, onClick }: TableIconActionProps): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TableIconAction, TableIconActions as default, tableActionColumnWidth };
|
|
17
|
+
//# sourceMappingURL=TableIconActions.d.mts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import ActionIcon from "../../base-ui/ActionIcon/ActionIcon.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/dashboard/TableIconActions/TableIconActions.tsx
|
|
6
|
+
/** `ActionIcon` `size="small"` is 24px. */
|
|
7
|
+
const ACTION_ICON_SIZE = 24;
|
|
8
|
+
const ACTION_ICON_GAP = 4;
|
|
9
|
+
/** Table cell horizontal padding, so the icons are not clipped by the column. */
|
|
10
|
+
const ACTION_CELL_PADDING = 32;
|
|
11
|
+
/** Column width for a row of `count` small filled action icons. */
|
|
12
|
+
const tableActionColumnWidth = (count) => count * ACTION_ICON_SIZE + Math.max(0, count - 1) * ACTION_ICON_GAP + ACTION_CELL_PADDING;
|
|
13
|
+
/** Right-aligned row of icon actions for a table's last column. */
|
|
14
|
+
const TableIconActions = ({ children }) => /* @__PURE__ */ jsx(FlexBasic_default, {
|
|
15
|
+
horizontal: true,
|
|
16
|
+
align: "center",
|
|
17
|
+
gap: ACTION_ICON_GAP,
|
|
18
|
+
justify: "flex-end",
|
|
19
|
+
width: "100%",
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
TableIconActions.displayName = "TableIconActions";
|
|
23
|
+
/** One row action: a small filled icon button whose label is its name and tooltip. */
|
|
24
|
+
const TableIconAction = ({ danger, disabled, icon, label, loading, onClick }) => /* @__PURE__ */ jsx(ActionIcon, {
|
|
25
|
+
"aria-label": label,
|
|
26
|
+
danger,
|
|
27
|
+
disabled,
|
|
28
|
+
icon,
|
|
29
|
+
loading,
|
|
30
|
+
size: "small",
|
|
31
|
+
title: label,
|
|
32
|
+
variant: "filled",
|
|
33
|
+
onClick
|
|
34
|
+
});
|
|
35
|
+
TableIconAction.displayName = "TableIconAction";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { TableIconAction, TableIconActions as default, tableActionColumnWidth };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=TableIconActions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableIconActions.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/TableIconActions/TableIconActions.tsx"],"sourcesContent":["'use client';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport { Flexbox } from '@/Flex';\n\nimport type { TableIconActionProps, TableIconActionsProps } from './type';\n\n/** `ActionIcon` `size=\"small\"` is 24px. */\nconst ACTION_ICON_SIZE = 24;\nconst ACTION_ICON_GAP = 4;\n/** Table cell horizontal padding, so the icons are not clipped by the column. */\nconst ACTION_CELL_PADDING = 32;\n\n/** Column width for a row of `count` small filled action icons. */\nexport const tableActionColumnWidth = (count: number) =>\n count * ACTION_ICON_SIZE + Math.max(0, count - 1) * ACTION_ICON_GAP + ACTION_CELL_PADDING;\n\n/** Right-aligned row of icon actions for a table's last column. */\nconst TableIconActions = ({ children }: TableIconActionsProps) => (\n <Flexbox horizontal align={'center'} gap={ACTION_ICON_GAP} justify={'flex-end'} width={'100%'}>\n {children}\n </Flexbox>\n);\n\nTableIconActions.displayName = 'TableIconActions';\n\n/** One row action: a small filled icon button whose label is its name and tooltip. */\nexport const TableIconAction = ({\n danger,\n disabled,\n icon,\n label,\n loading,\n onClick,\n}: TableIconActionProps) => (\n <ActionIcon\n aria-label={label}\n danger={danger}\n disabled={disabled}\n icon={icon}\n loading={loading}\n size={'small'}\n title={label}\n variant={'filled'}\n onClick={onClick}\n />\n);\n\nTableIconAction.displayName = 'TableIconAction';\n\nexport default TableIconActions;\n"],"mappings":";;;;;;AAQA,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;;AAExB,MAAM,sBAAsB;;AAG5B,MAAa,0BAA0B,UACrC,QAAQ,mBAAmB,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI,kBAAkB;;AAGxE,MAAM,oBAAoB,EAAE,eAC1B,oBAACA,mBAAD;CAAS,YAAA;CAAW,OAAO;CAAU,KAAK;CAAiB,SAAS;CAAY,OAAO;CACpF;AACM,CAAA;AAGX,iBAAiB,cAAc;;AAG/B,MAAa,mBAAmB,EAC9B,QACA,UACA,MACA,OACA,SACA,cAEA,oBAAC,YAAD;CACE,cAAY;CACJ;CACE;CACJ;CACG;CACT,MAAM;CACN,OAAO;CACP,SAAS;CACA;AACV,CAAA;AAGH,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TableIconActionProps, TableIconActionsProps } from "./type.mjs";
|
|
2
|
+
import TableIconActions, { TableIconAction, tableActionColumnWidth } from "./TableIconActions.mjs";
|
|
3
|
+
export { TableIconAction, type TableIconActionProps, type TableIconActionsProps, TableIconActions as default, tableActionColumnWidth };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
import { LucideIcon } from "lucide-react";
|
|
3
|
+
//#region src/dashboard/TableIconActions/type.d.ts
|
|
4
|
+
interface TableIconActionsProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface TableIconActionProps {
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon: LucideIcon;
|
|
11
|
+
/** Accessible name and tooltip. Required: the button has no visible text. */
|
|
12
|
+
label: string;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TableIconActionProps, TableIconActionsProps };
|
|
18
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TitleWithTipsProps } from "./type.mjs";
|
|
2
|
+
//#region src/dashboard/TitleWithTips/TitleWithTips.d.ts
|
|
3
|
+
/** A column or field title with an info icon that explains it on hover. */
|
|
4
|
+
declare const TitleWithTips: {
|
|
5
|
+
({ className, tips, title }: TitleWithTipsProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TitleWithTips as default };
|
|
10
|
+
//# sourceMappingURL=TitleWithTips.d.mts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import FlexBasic_default from "../../Flex/FlexBasic.mjs";
|
|
3
|
+
import Icon from "../../Icon/Icon.mjs";
|
|
4
|
+
import { Tooltip } from "../../base-ui/Tooltip/Tooltip.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cssVar } from "antd-style";
|
|
7
|
+
import { InfoIcon } from "lucide-react";
|
|
8
|
+
//#region src/dashboard/TitleWithTips/TitleWithTips.tsx
|
|
9
|
+
/** A column or field title with an info icon that explains it on hover. */
|
|
10
|
+
const TitleWithTips = ({ className, tips, title }) => /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
11
|
+
horizontal: true,
|
|
12
|
+
align: "center",
|
|
13
|
+
className,
|
|
14
|
+
gap: 4,
|
|
15
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), /* @__PURE__ */ jsx(Tooltip, {
|
|
16
|
+
title: tips,
|
|
17
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
18
|
+
color: cssVar.colorTextTertiary,
|
|
19
|
+
icon: InfoIcon,
|
|
20
|
+
style: { cursor: "help" }
|
|
21
|
+
})
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
TitleWithTips.displayName = "TitleWithTips";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TitleWithTips as default };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=TitleWithTips.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleWithTips.mjs","names":["Flexbox"],"sources":["../../../src/dashboard/TitleWithTips/TitleWithTips.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar } from 'antd-style';\nimport { InfoIcon } from 'lucide-react';\n\nimport Tooltip from '@/base-ui/Tooltip';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport type { TitleWithTipsProps } from './type';\n\n/** A column or field title with an info icon that explains it on hover. */\nconst TitleWithTips = ({ className, tips, title }: TitleWithTipsProps) => (\n <Flexbox horizontal align={'center'} className={className} gap={4}>\n <span>{title}</span>\n <Tooltip title={tips}>\n <Icon color={cssVar.colorTextTertiary} icon={InfoIcon} style={{ cursor: 'help' }} />\n </Tooltip>\n </Flexbox>\n);\n\nTitleWithTips.displayName = 'TitleWithTips';\n\nexport default TitleWithTips;\n"],"mappings":";;;;;;;;;AAYA,MAAM,iBAAiB,EAAE,WAAW,MAAM,YACxC,qBAACA,mBAAD;CAAS,YAAA;CAAW,OAAO;CAAqB;CAAW,KAAK;CAAhE,UAAA,CACE,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,GACnB,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,oBAAC,MAAD;GAAM,OAAO,OAAO;GAAmB,MAAM;GAAU,OAAO,EAAE,QAAQ,OAAO;EAAI,CAAA;CAC5E,CAAA,CACF;;AAGX,cAAc,cAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/dashboard/TitleWithTips/type.d.ts
|
|
3
|
+
interface TitleWithTipsProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Tooltip shown on the info icon. */
|
|
6
|
+
tips: ReactNode;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TitleWithTipsProps };
|
|
11
|
+
//# sourceMappingURL=type.d.mts.map
|