design-zystem 1.0.449 → 1.0.451

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.
@@ -903,6 +903,7 @@ interface TableCellProps {
903
903
  borderLeft?: boolean;
904
904
  /** Curseur sur toute la cellule — quand un enfant de la cellule porte sa propre action de clic. */
905
905
  cursor?: keyof typeof CURSOR_CLASS;
906
+ onClick?: () => void;
906
907
  className?: string;
907
908
  /** Fusionne la cellule sur ce nombre de colonnes — ignore `width` pour laisser le navigateur répartir l'espace fusionné. */
908
909
  colSpan?: number;
@@ -911,7 +912,7 @@ interface TableCellProps {
911
912
  tooltip?: ReactNode;
912
913
  theme?: TableCellTheme;
913
914
  }
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;
915
+ 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
916
 
916
917
  interface TableFooterProps {
917
918
  children?: ReactNode;
@@ -903,6 +903,7 @@ interface TableCellProps {
903
903
  borderLeft?: boolean;
904
904
  /** Curseur sur toute la cellule — quand un enfant de la cellule porte sa propre action de clic. */
905
905
  cursor?: keyof typeof CURSOR_CLASS;
906
+ onClick?: () => void;
906
907
  className?: string;
907
908
  /** Fusionne la cellule sur ce nombre de colonnes — ignore `width` pour laisser le navigateur répartir l'espace fusionné. */
908
909
  colSpan?: number;
@@ -911,7 +912,7 @@ interface TableCellProps {
911
912
  tooltip?: ReactNode;
912
913
  theme?: TableCellTheme;
913
914
  }
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;
915
+ 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
916
 
916
917
  interface TableFooterProps {
917
918
  children?: ReactNode;
package/dist/ui/index.js CHANGED
@@ -4259,6 +4259,15 @@ var TableExpandChevron = ({ isExpanded }) => /* @__PURE__ */ (0, import_jsx_runt
4259
4259
  }
4260
4260
  );
4261
4261
 
4262
+ // src/ui/components/ui/table/activateFromKeyboard.ts
4263
+ var ACTIVATION_KEYS = ["Enter", " "];
4264
+ var activateFromKeyboard = (activate) => (event) => {
4265
+ if (event.target !== event.currentTarget) return;
4266
+ if (!ACTIVATION_KEYS.includes(event.key)) return;
4267
+ event.preventDefault();
4268
+ activate();
4269
+ };
4270
+
4262
4271
  // src/ui/components/ui/table/tableCellThemeClass.ts
4263
4272
  var TABLE_CELL_THEME_CLASS = {
4264
4273
  "blue-700": "text-blue-700",
@@ -4302,6 +4311,7 @@ var TableCell = ({
4302
4311
  borderLeft = false,
4303
4312
  colSpan,
4304
4313
  cursor,
4314
+ onClick,
4305
4315
  className,
4306
4316
  wrap = false,
4307
4317
  maxLines,
@@ -4339,12 +4349,19 @@ var TableCell = ({
4339
4349
  children: content
4340
4350
  }
4341
4351
  ) : content;
4352
+ const handleClick = onClick ? (event) => {
4353
+ event.stopPropagation();
4354
+ onClick();
4355
+ } : void 0;
4342
4356
  const hoverableText = tooltip ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tooltip, { content: tooltip, children: text }) : text;
4343
4357
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4344
4358
  "td",
4345
4359
  {
4346
4360
  colSpan,
4347
4361
  "data-sticky": sticky,
4362
+ onClick: handleClick,
4363
+ onKeyDown: onClick && activateFromKeyboard(onClick),
4364
+ tabIndex: onClick ? 0 : void 0,
4348
4365
  className: cn(
4349
4366
  "h-10 px-2 py-2 text-center text-xs font-semibold",
4350
4367
  isWrapping ? "whitespace-normal break-words" : "text-ellipsis whitespace-nowrap",
@@ -4357,6 +4374,7 @@ var TableCell = ({
4357
4374
  sticky && backgroundColor && "z-[2]",
4358
4375
  accentColor && "border-l-4",
4359
4376
  cursor && CURSOR_CLASS[cursor],
4377
+ onClick && "cursor-pointer",
4360
4378
  theme && TABLE_CELL_THEME_CLASS[theme],
4361
4379
  className
4362
4380
  ),
@@ -4414,15 +4432,6 @@ var TableFooterCell = ({
4414
4432
  }
4415
4433
  );
4416
4434
 
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
4435
  // src/ui/components/ui/table/TableGroupLabel.tsx
4427
4436
  var import_jsx_runtime53 = require("react/jsx-runtime");
4428
4437
  var TableGroupLabel = ({
@@ -5037,7 +5046,7 @@ var TableStatusCell = ({
5037
5046
  theme,
5038
5047
  width,
5039
5048
  variant
5040
- }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TableCell, { width, centerContent: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge, { size: "l", theme, variant, children }) });
5049
+ }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TableCell, { width, centerContent: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Badge, { size: "l", theme, variant, fullWidth: true, children }) });
5041
5050
 
5042
5051
  // src/ui/components/ui/Popover.tsx
5043
5052
  var RadixPopover4 = __toESM(require("@radix-ui/react-popover"));
package/dist/ui/index.mjs CHANGED
@@ -4045,6 +4045,15 @@ var TableExpandChevron = ({ isExpanded }) => /* @__PURE__ */ jsx48(
4045
4045
  }
4046
4046
  );
4047
4047
 
4048
+ // src/ui/components/ui/table/activateFromKeyboard.ts
4049
+ var ACTIVATION_KEYS = ["Enter", " "];
4050
+ var activateFromKeyboard = (activate) => (event) => {
4051
+ if (event.target !== event.currentTarget) return;
4052
+ if (!ACTIVATION_KEYS.includes(event.key)) return;
4053
+ event.preventDefault();
4054
+ activate();
4055
+ };
4056
+
4048
4057
  // src/ui/components/ui/table/tableCellThemeClass.ts
4049
4058
  var TABLE_CELL_THEME_CLASS = {
4050
4059
  "blue-700": "text-blue-700",
@@ -4088,6 +4097,7 @@ var TableCell = ({
4088
4097
  borderLeft = false,
4089
4098
  colSpan,
4090
4099
  cursor,
4100
+ onClick,
4091
4101
  className,
4092
4102
  wrap = false,
4093
4103
  maxLines,
@@ -4125,12 +4135,19 @@ var TableCell = ({
4125
4135
  children: content
4126
4136
  }
4127
4137
  ) : content;
4138
+ const handleClick = onClick ? (event) => {
4139
+ event.stopPropagation();
4140
+ onClick();
4141
+ } : void 0;
4128
4142
  const hoverableText = tooltip ? /* @__PURE__ */ jsx49(Tooltip, { content: tooltip, children: text }) : text;
4129
4143
  return /* @__PURE__ */ jsx49(
4130
4144
  "td",
4131
4145
  {
4132
4146
  colSpan,
4133
4147
  "data-sticky": sticky,
4148
+ onClick: handleClick,
4149
+ onKeyDown: onClick && activateFromKeyboard(onClick),
4150
+ tabIndex: onClick ? 0 : void 0,
4134
4151
  className: cn(
4135
4152
  "h-10 px-2 py-2 text-center text-xs font-semibold",
4136
4153
  isWrapping ? "whitespace-normal break-words" : "text-ellipsis whitespace-nowrap",
@@ -4143,6 +4160,7 @@ var TableCell = ({
4143
4160
  sticky && backgroundColor && "z-[2]",
4144
4161
  accentColor && "border-l-4",
4145
4162
  cursor && CURSOR_CLASS[cursor],
4163
+ onClick && "cursor-pointer",
4146
4164
  theme && TABLE_CELL_THEME_CLASS[theme],
4147
4165
  className
4148
4166
  ),
@@ -4200,15 +4218,6 @@ var TableFooterCell = ({
4200
4218
  }
4201
4219
  );
4202
4220
 
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
4221
  // src/ui/components/ui/table/TableGroupLabel.tsx
4213
4222
  import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
4214
4223
  var TableGroupLabel = ({
@@ -4830,7 +4839,7 @@ var TableStatusCell = ({
4830
4839
  theme,
4831
4840
  width,
4832
4841
  variant
4833
- }) => /* @__PURE__ */ jsx63(TableCell, { width, centerContent: true, children: /* @__PURE__ */ jsx63(Badge, { size: "l", theme, variant, children }) });
4842
+ }) => /* @__PURE__ */ jsx63(TableCell, { width, centerContent: true, children: /* @__PURE__ */ jsx63(Badge, { size: "l", theme, variant, fullWidth: true, children }) });
4834
4843
 
4835
4844
  // src/ui/components/ui/Popover.tsx
4836
4845
  import * as RadixPopover4 from "@radix-ui/react-popover";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.449",
3
+ "version": "1.0.451",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",