design-zystem 1.0.450 → 1.0.452
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/dist/ui/index.d.mts +3 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +25 -9
- package/dist/ui/index.mjs +25 -9
- package/package.json +1 -1
package/dist/ui/index.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ declare const layoutVariants: (props?: ({
|
|
|
23
23
|
wrap?: boolean | null | undefined;
|
|
24
24
|
fullWidth?: boolean | null | undefined;
|
|
25
25
|
fullHeight?: boolean | null | undefined;
|
|
26
|
+
grow?: boolean | null | undefined;
|
|
26
27
|
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
27
28
|
paddingX?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
28
29
|
paddingY?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
@@ -903,6 +904,7 @@ interface TableCellProps {
|
|
|
903
904
|
borderLeft?: boolean;
|
|
904
905
|
/** Curseur sur toute la cellule — quand un enfant de la cellule porte sa propre action de clic. */
|
|
905
906
|
cursor?: keyof typeof CURSOR_CLASS;
|
|
907
|
+
onClick?: () => void;
|
|
906
908
|
className?: string;
|
|
907
909
|
/** Fusionne la cellule sur ce nombre de colonnes — ignore `width` pour laisser le navigateur répartir l'espace fusionné. */
|
|
908
910
|
colSpan?: number;
|
|
@@ -911,7 +913,7 @@ interface TableCellProps {
|
|
|
911
913
|
tooltip?: ReactNode;
|
|
912
914
|
theme?: TableCellTheme;
|
|
913
915
|
}
|
|
914
|
-
declare const TableCell: ({ children, secondary, isExpanded, width, centerContent, sticky, stickyOffset, surface, backgroundColor, accentColor, borderLeft, colSpan, cursor, className, wrap, maxLines, tooltip, theme, }: TableCellProps) => react.JSX.Element;
|
|
916
|
+
declare const TableCell: ({ children, secondary, isExpanded, width, centerContent, sticky, stickyOffset, surface, backgroundColor, accentColor, borderLeft, colSpan, cursor, onClick, className, wrap, maxLines, tooltip, theme, }: TableCellProps) => react.JSX.Element;
|
|
915
917
|
|
|
916
918
|
interface TableFooterProps {
|
|
917
919
|
children?: ReactNode;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ declare const layoutVariants: (props?: ({
|
|
|
23
23
|
wrap?: boolean | null | undefined;
|
|
24
24
|
fullWidth?: boolean | null | undefined;
|
|
25
25
|
fullHeight?: boolean | null | undefined;
|
|
26
|
+
grow?: boolean | null | undefined;
|
|
26
27
|
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
27
28
|
paddingX?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
28
29
|
paddingY?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | null | undefined;
|
|
@@ -903,6 +904,7 @@ interface TableCellProps {
|
|
|
903
904
|
borderLeft?: boolean;
|
|
904
905
|
/** Curseur sur toute la cellule — quand un enfant de la cellule porte sa propre action de clic. */
|
|
905
906
|
cursor?: keyof typeof CURSOR_CLASS;
|
|
907
|
+
onClick?: () => void;
|
|
906
908
|
className?: string;
|
|
907
909
|
/** Fusionne la cellule sur ce nombre de colonnes — ignore `width` pour laisser le navigateur répartir l'espace fusionné. */
|
|
908
910
|
colSpan?: number;
|
|
@@ -911,7 +913,7 @@ interface TableCellProps {
|
|
|
911
913
|
tooltip?: ReactNode;
|
|
912
914
|
theme?: TableCellTheme;
|
|
913
915
|
}
|
|
914
|
-
declare const TableCell: ({ children, secondary, isExpanded, width, centerContent, sticky, stickyOffset, surface, backgroundColor, accentColor, borderLeft, colSpan, cursor, className, wrap, maxLines, tooltip, theme, }: TableCellProps) => react.JSX.Element;
|
|
916
|
+
declare const TableCell: ({ children, secondary, isExpanded, width, centerContent, sticky, stickyOffset, surface, backgroundColor, accentColor, borderLeft, colSpan, cursor, onClick, className, wrap, maxLines, tooltip, theme, }: TableCellProps) => react.JSX.Element;
|
|
915
917
|
|
|
916
918
|
interface TableFooterProps {
|
|
917
919
|
children?: ReactNode;
|
package/dist/ui/index.js
CHANGED
|
@@ -319,6 +319,10 @@ var layoutVariants = (0, import_class_variance_authority.cva)("flex box-border",
|
|
|
319
319
|
true: "h-full",
|
|
320
320
|
false: ""
|
|
321
321
|
},
|
|
322
|
+
grow: {
|
|
323
|
+
true: "flex-1 min-h-0 min-w-0",
|
|
324
|
+
false: ""
|
|
325
|
+
},
|
|
322
326
|
padding: {
|
|
323
327
|
0: "p-0",
|
|
324
328
|
0.5: "p-0.5",
|
|
@@ -446,6 +450,7 @@ var Layout = (0, import_react.forwardRef)(
|
|
|
446
450
|
wrap,
|
|
447
451
|
fullWidth,
|
|
448
452
|
fullHeight,
|
|
453
|
+
grow,
|
|
449
454
|
padding,
|
|
450
455
|
paddingX,
|
|
451
456
|
paddingY,
|
|
@@ -468,6 +473,7 @@ var Layout = (0, import_react.forwardRef)(
|
|
|
468
473
|
"wrap",
|
|
469
474
|
"fullWidth",
|
|
470
475
|
"fullHeight",
|
|
476
|
+
"grow",
|
|
471
477
|
"padding",
|
|
472
478
|
"paddingX",
|
|
473
479
|
"paddingY",
|
|
@@ -496,6 +502,7 @@ var Layout = (0, import_react.forwardRef)(
|
|
|
496
502
|
// Pleine largeur par défaut ; une `width` explicite reprend la main.
|
|
497
503
|
fullWidth: fullWidth != null ? fullWidth : width === void 0,
|
|
498
504
|
fullHeight,
|
|
505
|
+
grow,
|
|
499
506
|
padding,
|
|
500
507
|
paddingX,
|
|
501
508
|
paddingY,
|
|
@@ -4259,6 +4266,15 @@ var TableExpandChevron = ({ isExpanded }) => /* @__PURE__ */ (0, import_jsx_runt
|
|
|
4259
4266
|
}
|
|
4260
4267
|
);
|
|
4261
4268
|
|
|
4269
|
+
// src/ui/components/ui/table/activateFromKeyboard.ts
|
|
4270
|
+
var ACTIVATION_KEYS = ["Enter", " "];
|
|
4271
|
+
var activateFromKeyboard = (activate) => (event) => {
|
|
4272
|
+
if (event.target !== event.currentTarget) return;
|
|
4273
|
+
if (!ACTIVATION_KEYS.includes(event.key)) return;
|
|
4274
|
+
event.preventDefault();
|
|
4275
|
+
activate();
|
|
4276
|
+
};
|
|
4277
|
+
|
|
4262
4278
|
// src/ui/components/ui/table/tableCellThemeClass.ts
|
|
4263
4279
|
var TABLE_CELL_THEME_CLASS = {
|
|
4264
4280
|
"blue-700": "text-blue-700",
|
|
@@ -4302,6 +4318,7 @@ var TableCell = ({
|
|
|
4302
4318
|
borderLeft = false,
|
|
4303
4319
|
colSpan,
|
|
4304
4320
|
cursor,
|
|
4321
|
+
onClick,
|
|
4305
4322
|
className,
|
|
4306
4323
|
wrap = false,
|
|
4307
4324
|
maxLines,
|
|
@@ -4339,12 +4356,19 @@ var TableCell = ({
|
|
|
4339
4356
|
children: content
|
|
4340
4357
|
}
|
|
4341
4358
|
) : content;
|
|
4359
|
+
const handleClick = onClick ? (event) => {
|
|
4360
|
+
event.stopPropagation();
|
|
4361
|
+
onClick();
|
|
4362
|
+
} : void 0;
|
|
4342
4363
|
const hoverableText = tooltip ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tooltip, { content: tooltip, children: text }) : text;
|
|
4343
4364
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4344
4365
|
"td",
|
|
4345
4366
|
{
|
|
4346
4367
|
colSpan,
|
|
4347
4368
|
"data-sticky": sticky,
|
|
4369
|
+
onClick: handleClick,
|
|
4370
|
+
onKeyDown: onClick && activateFromKeyboard(onClick),
|
|
4371
|
+
tabIndex: onClick ? 0 : void 0,
|
|
4348
4372
|
className: cn(
|
|
4349
4373
|
"h-10 px-2 py-2 text-center text-xs font-semibold",
|
|
4350
4374
|
isWrapping ? "whitespace-normal break-words" : "text-ellipsis whitespace-nowrap",
|
|
@@ -4357,6 +4381,7 @@ var TableCell = ({
|
|
|
4357
4381
|
sticky && backgroundColor && "z-[2]",
|
|
4358
4382
|
accentColor && "border-l-4",
|
|
4359
4383
|
cursor && CURSOR_CLASS[cursor],
|
|
4384
|
+
onClick && "cursor-pointer",
|
|
4360
4385
|
theme && TABLE_CELL_THEME_CLASS[theme],
|
|
4361
4386
|
className
|
|
4362
4387
|
),
|
|
@@ -4414,15 +4439,6 @@ var TableFooterCell = ({
|
|
|
4414
4439
|
}
|
|
4415
4440
|
);
|
|
4416
4441
|
|
|
4417
|
-
// src/ui/components/ui/table/activateFromKeyboard.ts
|
|
4418
|
-
var ACTIVATION_KEYS = ["Enter", " "];
|
|
4419
|
-
var activateFromKeyboard = (activate) => (event) => {
|
|
4420
|
-
if (event.target !== event.currentTarget) return;
|
|
4421
|
-
if (!ACTIVATION_KEYS.includes(event.key)) return;
|
|
4422
|
-
event.preventDefault();
|
|
4423
|
-
activate();
|
|
4424
|
-
};
|
|
4425
|
-
|
|
4426
4442
|
// src/ui/components/ui/table/TableGroupLabel.tsx
|
|
4427
4443
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4428
4444
|
var TableGroupLabel = ({
|
package/dist/ui/index.mjs
CHANGED
|
@@ -89,6 +89,10 @@ var layoutVariants = cva("flex box-border", {
|
|
|
89
89
|
true: "h-full",
|
|
90
90
|
false: ""
|
|
91
91
|
},
|
|
92
|
+
grow: {
|
|
93
|
+
true: "flex-1 min-h-0 min-w-0",
|
|
94
|
+
false: ""
|
|
95
|
+
},
|
|
92
96
|
padding: {
|
|
93
97
|
0: "p-0",
|
|
94
98
|
0.5: "p-0.5",
|
|
@@ -216,6 +220,7 @@ var Layout = forwardRef(
|
|
|
216
220
|
wrap,
|
|
217
221
|
fullWidth,
|
|
218
222
|
fullHeight,
|
|
223
|
+
grow,
|
|
219
224
|
padding,
|
|
220
225
|
paddingX,
|
|
221
226
|
paddingY,
|
|
@@ -238,6 +243,7 @@ var Layout = forwardRef(
|
|
|
238
243
|
"wrap",
|
|
239
244
|
"fullWidth",
|
|
240
245
|
"fullHeight",
|
|
246
|
+
"grow",
|
|
241
247
|
"padding",
|
|
242
248
|
"paddingX",
|
|
243
249
|
"paddingY",
|
|
@@ -266,6 +272,7 @@ var Layout = forwardRef(
|
|
|
266
272
|
// Pleine largeur par défaut ; une `width` explicite reprend la main.
|
|
267
273
|
fullWidth: fullWidth != null ? fullWidth : width === void 0,
|
|
268
274
|
fullHeight,
|
|
275
|
+
grow,
|
|
269
276
|
padding,
|
|
270
277
|
paddingX,
|
|
271
278
|
paddingY,
|
|
@@ -4045,6 +4052,15 @@ var TableExpandChevron = ({ isExpanded }) => /* @__PURE__ */ jsx48(
|
|
|
4045
4052
|
}
|
|
4046
4053
|
);
|
|
4047
4054
|
|
|
4055
|
+
// src/ui/components/ui/table/activateFromKeyboard.ts
|
|
4056
|
+
var ACTIVATION_KEYS = ["Enter", " "];
|
|
4057
|
+
var activateFromKeyboard = (activate) => (event) => {
|
|
4058
|
+
if (event.target !== event.currentTarget) return;
|
|
4059
|
+
if (!ACTIVATION_KEYS.includes(event.key)) return;
|
|
4060
|
+
event.preventDefault();
|
|
4061
|
+
activate();
|
|
4062
|
+
};
|
|
4063
|
+
|
|
4048
4064
|
// src/ui/components/ui/table/tableCellThemeClass.ts
|
|
4049
4065
|
var TABLE_CELL_THEME_CLASS = {
|
|
4050
4066
|
"blue-700": "text-blue-700",
|
|
@@ -4088,6 +4104,7 @@ var TableCell = ({
|
|
|
4088
4104
|
borderLeft = false,
|
|
4089
4105
|
colSpan,
|
|
4090
4106
|
cursor,
|
|
4107
|
+
onClick,
|
|
4091
4108
|
className,
|
|
4092
4109
|
wrap = false,
|
|
4093
4110
|
maxLines,
|
|
@@ -4125,12 +4142,19 @@ var TableCell = ({
|
|
|
4125
4142
|
children: content
|
|
4126
4143
|
}
|
|
4127
4144
|
) : content;
|
|
4145
|
+
const handleClick = onClick ? (event) => {
|
|
4146
|
+
event.stopPropagation();
|
|
4147
|
+
onClick();
|
|
4148
|
+
} : void 0;
|
|
4128
4149
|
const hoverableText = tooltip ? /* @__PURE__ */ jsx49(Tooltip, { content: tooltip, children: text }) : text;
|
|
4129
4150
|
return /* @__PURE__ */ jsx49(
|
|
4130
4151
|
"td",
|
|
4131
4152
|
{
|
|
4132
4153
|
colSpan,
|
|
4133
4154
|
"data-sticky": sticky,
|
|
4155
|
+
onClick: handleClick,
|
|
4156
|
+
onKeyDown: onClick && activateFromKeyboard(onClick),
|
|
4157
|
+
tabIndex: onClick ? 0 : void 0,
|
|
4134
4158
|
className: cn(
|
|
4135
4159
|
"h-10 px-2 py-2 text-center text-xs font-semibold",
|
|
4136
4160
|
isWrapping ? "whitespace-normal break-words" : "text-ellipsis whitespace-nowrap",
|
|
@@ -4143,6 +4167,7 @@ var TableCell = ({
|
|
|
4143
4167
|
sticky && backgroundColor && "z-[2]",
|
|
4144
4168
|
accentColor && "border-l-4",
|
|
4145
4169
|
cursor && CURSOR_CLASS[cursor],
|
|
4170
|
+
onClick && "cursor-pointer",
|
|
4146
4171
|
theme && TABLE_CELL_THEME_CLASS[theme],
|
|
4147
4172
|
className
|
|
4148
4173
|
),
|
|
@@ -4200,15 +4225,6 @@ var TableFooterCell = ({
|
|
|
4200
4225
|
}
|
|
4201
4226
|
);
|
|
4202
4227
|
|
|
4203
|
-
// src/ui/components/ui/table/activateFromKeyboard.ts
|
|
4204
|
-
var ACTIVATION_KEYS = ["Enter", " "];
|
|
4205
|
-
var activateFromKeyboard = (activate) => (event) => {
|
|
4206
|
-
if (event.target !== event.currentTarget) return;
|
|
4207
|
-
if (!ACTIVATION_KEYS.includes(event.key)) return;
|
|
4208
|
-
event.preventDefault();
|
|
4209
|
-
activate();
|
|
4210
|
-
};
|
|
4211
|
-
|
|
4212
4228
|
// src/ui/components/ui/table/TableGroupLabel.tsx
|
|
4213
4229
|
import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4214
4230
|
var TableGroupLabel = ({
|