@umami/react-zen 0.194.0 → 0.195.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/dist/index.d.mts CHANGED
@@ -405,12 +405,12 @@ declare function Grid({ display, justifyContent, justifyItems, alignContent, ali
405
405
 
406
406
  interface DataCardProps extends GridProps {
407
407
  data?: {
408
- id: string;
409
408
  label: ReactNode;
410
409
  value: any;
411
410
  }[];
411
+ labelWidth?: string;
412
412
  }
413
- declare function DataCard({ data, ...props }: DataCardProps): react.JSX.Element;
413
+ declare function DataCard({ data, labelWidth, ...props }: DataCardProps): react.JSX.Element;
414
414
 
415
415
  interface DataTableProps extends TableProps {
416
416
  data?: any[];
package/dist/index.d.ts CHANGED
@@ -405,12 +405,12 @@ declare function Grid({ display, justifyContent, justifyItems, alignContent, ali
405
405
 
406
406
  interface DataCardProps extends GridProps {
407
407
  data?: {
408
- id: string;
409
408
  label: ReactNode;
410
409
  value: any;
411
410
  }[];
411
+ labelWidth?: string;
412
412
  }
413
- declare function DataCard({ data, ...props }: DataCardProps): react.JSX.Element;
413
+ declare function DataCard({ data, labelWidth, ...props }: DataCardProps): react.JSX.Element;
414
414
 
415
415
  interface DataTableProps extends TableProps {
416
416
  data?: any[];
package/dist/index.js CHANGED
@@ -34,8 +34,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  // node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
35
35
  var require_use_sync_external_store_shim_production = __commonJS({
36
36
  "node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
37
- var import_react199 = __toESM(require("react"));
38
- var React5 = import_react199.default;
37
+ var import_react200 = __toESM(require("react"));
38
+ var React5 = import_react200.default;
39
39
  function is2(x, y) {
40
40
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
41
41
  }
@@ -87,7 +87,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
87
87
  // node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
88
88
  var require_use_sync_external_store_shim_development = __commonJS({
89
89
  "node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
90
- var import_react199 = __toESM(require("react"));
90
+ var import_react200 = __toESM(require("react"));
91
91
  (function() {
92
92
  function is2(x, y) {
93
93
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
@@ -141,7 +141,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
141
141
  return getSnapshot();
142
142
  }
143
143
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
144
- var React5 = import_react199.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState20 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
144
+ var React5 = import_react200.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState20 = React5.useState, useEffect13 = React5.useEffect, useLayoutEffect3 = React5.useLayoutEffect, useDebugValue = React5.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
145
145
  exports.useSyncExternalStore = void 0 !== React5.useSyncExternalStore ? React5.useSyncExternalStore : shim;
146
146
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
147
147
  })();
@@ -33271,20 +33271,21 @@ function Container({
33271
33271
  }
33272
33272
 
33273
33273
  // src/components/DataCard.tsx
33274
+ var import_react188 = require("react");
33274
33275
  var import_jsx_runtime41 = require("react/jsx-runtime");
33275
- function DataCard({ data = [], ...props }) {
33276
+ function DataCard({ data = [], labelWidth = "auto", ...props }) {
33276
33277
  const rows = mapIdProperty(data);
33277
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Grid, { width: "100%", ...props, children: rows.map((row) => {
33278
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { columns: "180px 1fr", border: "bottom", borderColor: "4", gapX: "3", children: [
33279
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Row, { paddingY: "3", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { size: "3", weight: "bold", children: row?.label }) }),
33280
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Row, { paddingY: "3", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { size: "3", children: row?.value }) })
33281
- ] }, row?.id);
33278
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Grid, { width: "100%", columns: `${labelWidth} 1fr`, border: true, borderRadius: "3", padding: "6", ...props, children: rows.map((row, index) => {
33279
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react188.Fragment, { children: [
33280
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Row, { paddingY: "3", border: "bottom", borderColor: "4", paddingRight: "6", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { size: "3", weight: "bold", children: row?.label }) }),
33281
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Row, { paddingY: "3", border: "bottom", borderColor: "4", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { size: "3", children: row?.value }) })
33282
+ ] }, index);
33282
33283
  }) });
33283
33284
  }
33284
33285
 
33285
33286
  // src/components/DataTable.tsx
33286
33287
  var import_classnames28 = __toESM(require_classnames());
33287
- var import_react188 = require("react");
33288
+ var import_react189 = require("react");
33288
33289
 
33289
33290
  // src/components/Table.tsx
33290
33291
  var import_classnames27 = __toESM(require_classnames());
@@ -33343,7 +33344,7 @@ var DataTable_default = { "datatable": "DataTable_datatable__MWRkN", "cell": "Da
33343
33344
 
33344
33345
  // src/components/DataTable.tsx
33345
33346
  var import_jsx_runtime43 = require("react/jsx-runtime");
33346
- var import_react189 = require("react");
33347
+ var import_react190 = require("react");
33347
33348
  function DataTable({
33348
33349
  data = [],
33349
33350
  displayMode = "table",
@@ -33353,7 +33354,7 @@ function DataTable({
33353
33354
  }) {
33354
33355
  const rows = mapIdProperty(data);
33355
33356
  const widths = [];
33356
- const columns = import_react188.Children.map(children, (child) => {
33357
+ const columns = import_react189.Children.map(children, (child) => {
33357
33358
  if (child) {
33358
33359
  widths.push(child?.props?.width || "1fr");
33359
33360
  return { ...child?.props };
@@ -33362,12 +33363,12 @@ function DataTable({
33362
33363
  })?.filter((n) => n);
33363
33364
  const gridTemplateColumns2 = widths.join(" ");
33364
33365
  if (displayMode === "cards") {
33365
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Grid, { gap: "6", width: "100%", children: rows.map((row, index) => {
33366
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Grid, { id: "grid", width: "100%", gap: "6", children: rows.map((row, index) => {
33366
33367
  const items = columns?.filter(({ hidden }) => !hidden).map(({ id, label, children: children2 }) => {
33367
33368
  const value = typeof children2 === "function" ? children2(row, index) : children2 ?? row[id];
33368
33369
  return { id, label, value };
33369
33370
  });
33370
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DataCard, { data: items }, row.id);
33371
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DataCard, { data: items }, `${row.id}-${index}`);
33371
33372
  }) });
33372
33373
  }
33373
33374
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Table2, { ...props, className: (0, import_classnames28.default)(DataTable_default.datatable, className), children: [
@@ -33375,7 +33376,7 @@ function DataTable({
33375
33376
  if (hidden) {
33376
33377
  return null;
33377
33378
  }
33378
- return /* @__PURE__ */ (0, import_react189.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
33379
+ return /* @__PURE__ */ (0, import_react190.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
33379
33380
  }) }),
33380
33381
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TableBody, { children: rows.map((row, index) => {
33381
33382
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns?.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
@@ -33383,14 +33384,14 @@ function DataTable({
33383
33384
  return null;
33384
33385
  }
33385
33386
  const value = typeof children2 === "function" ? children2(row, index) : children2 || row[id];
33386
- return /* @__PURE__ */ (0, import_react189.createElement)(
33387
+ return /* @__PURE__ */ (0, import_react190.createElement)(
33387
33388
  TableCell,
33388
33389
  {
33389
33390
  ...cellProps,
33390
33391
  key: id,
33391
33392
  className: (0, import_classnames28.default)(DataTable_default.cell, className2)
33392
33393
  },
33393
- as ? (0, import_react188.createElement)(as, {}, value) : value
33394
+ as ? (0, import_react189.createElement)(as, {}, value) : value
33394
33395
  );
33395
33396
  }) }, index);
33396
33397
  }) })
@@ -33417,7 +33418,7 @@ function Dots({ size = "md", className, ...props }) {
33417
33418
  }
33418
33419
 
33419
33420
  // src/components/FloatingTooltip.tsx
33420
- var import_react190 = require("react");
33421
+ var import_react191 = require("react");
33421
33422
  var import_classnames31 = __toESM(require_classnames());
33422
33423
 
33423
33424
  // src/components/Tooltip.tsx
@@ -33444,8 +33445,8 @@ var FloatingTooltip_default = { "floating": "FloatingTooltip_floating__ZjM4N" };
33444
33445
  // src/components/FloatingTooltip.tsx
33445
33446
  var import_jsx_runtime46 = require("react/jsx-runtime");
33446
33447
  function FloatingTooltip({ className, style, children, ...props }) {
33447
- const [position, setPosition] = (0, import_react190.useState)({ x: -1e3, y: -1e3 });
33448
- (0, import_react190.useEffect)(() => {
33448
+ const [position, setPosition] = (0, import_react191.useState)({ x: -1e3, y: -1e3 });
33449
+ (0, import_react191.useEffect)(() => {
33449
33450
  const handler = (e) => {
33450
33451
  setPosition({ x: e.clientX, y: e.clientY });
33451
33452
  };
@@ -33501,7 +33502,7 @@ function Heading2({
33501
33502
  }
33502
33503
 
33503
33504
  // src/components/HoverTrigger.tsx
33504
- var import_react191 = require("react");
33505
+ var import_react192 = require("react");
33505
33506
 
33506
33507
  // css-modules:E:\dev\umami-react-zen\src\components\HoverTrigger.module.css
33507
33508
  var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
@@ -33517,12 +33518,12 @@ function HoverTrigger({
33517
33518
  children
33518
33519
  }) {
33519
33520
  const [triggerElement, popupElement] = children;
33520
- const triggerRef = (0, import_react191.useRef)(null);
33521
- const [open, setOpen] = (0, import_react191.useState)(isOpen);
33522
- const isOverMenu = (0, import_react191.useRef)(false);
33523
- const isOverButton = (0, import_react191.useRef)(false);
33524
- const timeout = (0, import_react191.useRef)(null);
33525
- (0, import_react191.useEffect)(() => {
33521
+ const triggerRef = (0, import_react192.useRef)(null);
33522
+ const [open, setOpen] = (0, import_react192.useState)(isOpen);
33523
+ const isOverMenu = (0, import_react192.useRef)(false);
33524
+ const isOverButton = (0, import_react192.useRef)(false);
33525
+ const timeout = (0, import_react192.useRef)(null);
33526
+ (0, import_react192.useEffect)(() => {
33526
33527
  if (isOpen !== open) {
33527
33528
  setOpen(isOpen);
33528
33529
  }
@@ -33630,7 +33631,7 @@ function Image({
33630
33631
  }
33631
33632
 
33632
33633
  // src/components/InlineEditField.tsx
33633
- var import_react192 = require("react");
33634
+ var import_react193 = require("react");
33634
33635
  var import_classnames34 = __toESM(require_classnames());
33635
33636
 
33636
33637
  // css-modules:E:\dev\umami-react-zen\src\components\InlineEditField.module.css
@@ -33649,8 +33650,8 @@ function InlineEditField({
33649
33650
  onCancel,
33650
33651
  ...props
33651
33652
  }) {
33652
- const [value, setValue] = (0, import_react192.useState)(defaultValue);
33653
- const [edit, setEdit] = (0, import_react192.useState)(defaultEdit);
33653
+ const [value, setValue] = (0, import_react193.useState)(defaultValue);
33654
+ const [edit, setEdit] = (0, import_react193.useState)(defaultEdit);
33654
33655
  const handleEdit = () => setEdit(true);
33655
33656
  const handleChange = (e) => {
33656
33657
  const val = e.target.value;
@@ -33661,7 +33662,7 @@ function InlineEditField({
33661
33662
  setEdit(false);
33662
33663
  onCommit?.(value);
33663
33664
  };
33664
- const handleCancel = (0, import_react192.useCallback)(() => {
33665
+ const handleCancel = (0, import_react193.useCallback)(() => {
33665
33666
  setEdit(false);
33666
33667
  setValue(defaultValue);
33667
33668
  onCancel?.();
@@ -33801,7 +33802,7 @@ function Modal2({
33801
33802
  }
33802
33803
 
33803
33804
  // src/components/Navbar.tsx
33804
- var import_react193 = require("react");
33805
+ var import_react194 = require("react");
33805
33806
  var import_classnames38 = __toESM(require_classnames());
33806
33807
 
33807
33808
  // css-modules:E:\dev\umami-react-zen\src\components\Navbar.module.css
@@ -33809,16 +33810,16 @@ var Navbar_default = { "nav": "Navbar_nav__ZjEwM", "item": "Navbar_item__MWVhZ",
33809
33810
 
33810
33811
  // src/components/Navbar.tsx
33811
33812
  var import_jsx_runtime55 = require("react/jsx-runtime");
33812
- var NavbarContext = (0, import_react193.createContext)(void 0);
33813
+ var NavbarContext = (0, import_react194.createContext)(void 0);
33813
33814
  var useNavigationContext = () => {
33814
- const context = (0, import_react193.useContext)(NavbarContext);
33815
+ const context = (0, import_react194.useContext)(NavbarContext);
33815
33816
  if (!context) {
33816
33817
  throw new Error("useNavigationContext must be used within a Navbar");
33817
33818
  }
33818
33819
  return context;
33819
33820
  };
33820
33821
  function Navbar({ showArrow = true, className, children, ...props }) {
33821
- const [activeMenu, setActiveMenu] = (0, import_react193.useState)("");
33822
+ const [activeMenu, setActiveMenu] = (0, import_react194.useState)("");
33822
33823
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NavbarContext.Provider, { value: { activeMenu, setActiveMenu }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { ...props, className: (0, import_classnames38.default)(Navbar_default.nav, className), children }) });
33823
33824
  }
33824
33825
  function NavbarItem({ label, children, className, ...props }) {
@@ -33836,7 +33837,7 @@ function NavbarItem({ label, children, className, ...props }) {
33836
33837
  }
33837
33838
 
33838
33839
  // src/components/NavMenu.tsx
33839
- var import_react194 = require("react");
33840
+ var import_react195 = require("react");
33840
33841
  var import_classnames39 = __toESM(require_classnames());
33841
33842
 
33842
33843
  // css-modules:E:\dev\umami-react-zen\src\components\NavMenu.module.css
@@ -33844,7 +33845,7 @@ var NavMenu_default = { "navmenu": "NavMenu_navmenu__MzRmN", "item": "NavMenu_it
33844
33845
 
33845
33846
  // src/components/NavMenu.tsx
33846
33847
  var import_jsx_runtime56 = require("react/jsx-runtime");
33847
- var NavMenuContext = (0, import_react194.createContext)(null);
33848
+ var NavMenuContext = (0, import_react195.createContext)(null);
33848
33849
  function NavMenu({
33849
33850
  itemBackgroundColor = "2",
33850
33851
  muteItems,
@@ -33870,7 +33871,7 @@ function NavMenuGroup({
33870
33871
  children,
33871
33872
  ...props
33872
33873
  }) {
33873
- const [minimized, setMinimized] = (0, import_react194.useState)(!!isMinimized);
33874
+ const [minimized, setMinimized] = (0, import_react195.useState)(!!isMinimized);
33874
33875
  const handleClick = () => {
33875
33876
  if (allowMinimize) {
33876
33877
  setMinimized((state) => !state);
@@ -33906,7 +33907,7 @@ function NavMenuGroup({
33906
33907
  );
33907
33908
  }
33908
33909
  function NavMenuItem({ isSelected, className, children, ...props }) {
33909
- const { itemBackgroundColor } = (0, import_react194.useContext)(NavMenuContext);
33910
+ const { itemBackgroundColor } = (0, import_react195.useContext)(NavMenuContext);
33910
33911
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
33911
33912
  Row,
33912
33913
  {
@@ -33920,11 +33921,11 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
33920
33921
  }
33921
33922
 
33922
33923
  // src/components/PasswordField.tsx
33923
- var import_react195 = require("react");
33924
+ var import_react196 = require("react");
33924
33925
  var import_classnames40 = __toESM(require_classnames());
33925
33926
  var import_jsx_runtime57 = require("react/jsx-runtime");
33926
33927
  function PasswordField({ label, className, ...props }) {
33927
- const [show, setShow] = (0, import_react195.useState)(false);
33928
+ const [show, setShow] = (0, import_react196.useState)(false);
33928
33929
  const type = show ? "text" : "password";
33929
33930
  const handleShowPassword = () => setShow((state) => !state);
33930
33931
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
@@ -34031,7 +34032,7 @@ function Radio2({ children, className, ...props }) {
34031
34032
  }
34032
34033
 
34033
34034
  // src/components/SearchField.tsx
34034
- var import_react196 = require("react");
34035
+ var import_react197 = require("react");
34035
34036
  var import_classnames45 = __toESM(require_classnames());
34036
34037
  var import_jsx_runtime62 = require("react/jsx-runtime");
34037
34038
  function SearchField2({
@@ -34045,7 +34046,7 @@ function SearchField2({
34045
34046
  className,
34046
34047
  ...props
34047
34048
  }) {
34048
- const [search, setSearch] = (0, import_react196.useState)(defaultValue);
34049
+ const [search, setSearch] = (0, import_react197.useState)(defaultValue);
34049
34050
  const searchValue = useDebounce(search, delay);
34050
34051
  const handleChange = (value2) => {
34051
34052
  setSearch(value2);
@@ -34059,7 +34060,7 @@ function SearchField2({
34059
34060
  onSearch?.("");
34060
34061
  onChange?.("");
34061
34062
  };
34062
- (0, import_react196.useEffect)(() => {
34063
+ (0, import_react197.useEffect)(() => {
34063
34064
  if (delay > 0) {
34064
34065
  onSearch?.(searchValue);
34065
34066
  }
@@ -34084,7 +34085,7 @@ function SearchField2({
34084
34085
  }
34085
34086
 
34086
34087
  // src/components/Select.tsx
34087
- var import_react197 = require("react");
34088
+ var import_react198 = require("react");
34088
34089
  var import_classnames46 = __toESM(require_classnames());
34089
34090
 
34090
34091
  // css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
@@ -34112,7 +34113,7 @@ function Select2({
34112
34113
  children,
34113
34114
  ...props
34114
34115
  }) {
34115
- const [search, setSearch] = (0, import_react197.useState)("");
34116
+ const [search, setSearch] = (0, import_react198.useState)("");
34116
34117
  const handleChange = (e) => {
34117
34118
  onSelectionChange?.(e);
34118
34119
  onChange?.(e);
@@ -34177,7 +34178,7 @@ function Select2({
34177
34178
  }
34178
34179
 
34179
34180
  // src/components/Sidebar.tsx
34180
- var import_react198 = require("react");
34181
+ var import_react199 = require("react");
34181
34182
  var import_classnames47 = __toESM(require_classnames());
34182
34183
 
34183
34184
  // css-modules:E:\dev\umami-react-zen\src\components\Sidebar.module.css
@@ -34185,7 +34186,7 @@ var Sidebar_default = { "sidebar": "Sidebar_sidebar__NDg2N", "header": "Sidebar_
34185
34186
 
34186
34187
  // src/components/Sidebar.tsx
34187
34188
  var import_jsx_runtime64 = require("react/jsx-runtime");
34188
- var SidebarContext = (0, import_react198.createContext)(null);
34189
+ var SidebarContext = (0, import_react199.createContext)(null);
34189
34190
  function Sidebar({
34190
34191
  itemBackgroundColor = "2",
34191
34192
  isCollapsed,
@@ -34241,7 +34242,7 @@ function SidebarItem({
34241
34242
  children,
34242
34243
  ...props
34243
34244
  }) {
34244
- const { isCollapsed, itemBackgroundColor } = (0, import_react198.useContext)(SidebarContext);
34245
+ const { isCollapsed, itemBackgroundColor } = (0, import_react199.useContext)(SidebarContext);
34245
34246
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, closeDelay: 0, isDisabled: !isCollapsed, children: [
34246
34247
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)($f645667febf57a63$export$35a3bebf7ef2d934, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
34247
34248
  Row,
package/dist/index.mjs CHANGED
@@ -33149,14 +33149,15 @@ function Container({
33149
33149
  }
33150
33150
 
33151
33151
  // src/components/DataCard.tsx
33152
+ import { Fragment as Fragment8 } from "react";
33152
33153
  import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
33153
- function DataCard({ data = [], ...props }) {
33154
+ function DataCard({ data = [], labelWidth = "auto", ...props }) {
33154
33155
  const rows = mapIdProperty(data);
33155
- return /* @__PURE__ */ jsx41(Grid, { width: "100%", ...props, children: rows.map((row) => {
33156
- return /* @__PURE__ */ jsxs22(Grid, { columns: "180px 1fr", border: "bottom", borderColor: "4", gapX: "3", children: [
33157
- /* @__PURE__ */ jsx41(Row, { paddingY: "3", children: /* @__PURE__ */ jsx41(Text, { size: "3", weight: "bold", children: row?.label }) }),
33158
- /* @__PURE__ */ jsx41(Row, { paddingY: "3", children: /* @__PURE__ */ jsx41(Text, { size: "3", children: row?.value }) })
33159
- ] }, row?.id);
33156
+ return /* @__PURE__ */ jsx41(Grid, { width: "100%", columns: `${labelWidth} 1fr`, border: true, borderRadius: "3", padding: "6", ...props, children: rows.map((row, index) => {
33157
+ return /* @__PURE__ */ jsxs22(Fragment8, { children: [
33158
+ /* @__PURE__ */ jsx41(Row, { paddingY: "3", border: "bottom", borderColor: "4", paddingRight: "6", children: /* @__PURE__ */ jsx41(Text, { size: "3", weight: "bold", children: row?.label }) }),
33159
+ /* @__PURE__ */ jsx41(Row, { paddingY: "3", border: "bottom", borderColor: "4", children: /* @__PURE__ */ jsx41(Text, { size: "3", children: row?.value }) })
33160
+ ] }, index);
33160
33161
  }) });
33161
33162
  }
33162
33163
 
@@ -33240,12 +33241,12 @@ function DataTable({
33240
33241
  })?.filter((n) => n);
33241
33242
  const gridTemplateColumns2 = widths.join(" ");
33242
33243
  if (displayMode === "cards") {
33243
- return /* @__PURE__ */ jsx43(Grid, { gap: "6", width: "100%", children: rows.map((row, index) => {
33244
+ return /* @__PURE__ */ jsx43(Grid, { id: "grid", width: "100%", gap: "6", children: rows.map((row, index) => {
33244
33245
  const items = columns?.filter(({ hidden }) => !hidden).map(({ id, label, children: children2 }) => {
33245
33246
  const value = typeof children2 === "function" ? children2(row, index) : children2 ?? row[id];
33246
33247
  return { id, label, value };
33247
33248
  });
33248
- return /* @__PURE__ */ jsx43(DataCard, { data: items }, row.id);
33249
+ return /* @__PURE__ */ jsx43(DataCard, { data: items }, `${row.id}-${index}`);
33249
33250
  }) });
33250
33251
  }
33251
33252
  return /* @__PURE__ */ jsxs23(Table2, { ...props, className: (0, import_classnames28.default)(DataTable_default.datatable, className), children: [
@@ -33385,7 +33386,7 @@ import { useRef as useRef8, useState as useState13, useEffect as useEffect11 } f
33385
33386
  var HoverTrigger_default = { "wrapper": "HoverTrigger_wrapper__NGFlN" };
33386
33387
 
33387
33388
  // src/components/HoverTrigger.tsx
33388
- import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs26 } from "react/jsx-runtime";
33389
+ import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs26 } from "react/jsx-runtime";
33389
33390
  var CLOSE_DELAY = 500;
33390
33391
  function HoverTrigger({
33391
33392
  isOpen,
@@ -33436,7 +33437,7 @@ function HoverTrigger({
33436
33437
  }
33437
33438
  }, closeDelay);
33438
33439
  };
33439
- return /* @__PURE__ */ jsxs26(Fragment8, { children: [
33440
+ return /* @__PURE__ */ jsxs26(Fragment9, { children: [
33440
33441
  /* @__PURE__ */ jsx48("div", { ref: triggerRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: triggerElement }),
33441
33442
  /* @__PURE__ */ jsx48(Popover2, { isOpen: open, isNonModal: true, triggerRef, children: /* @__PURE__ */ jsx48(
33442
33443
  "div",
@@ -33605,7 +33606,7 @@ var import_classnames36 = __toESM(require_classnames());
33605
33606
  var Menu_default = { "menu": "Menu_menu__YTM5N", "separator": "Menu_separator__YjFhN", "section": "Menu_section__NWFlM", "header": "Menu_header__YzJkN", "item": "Menu_item__NGRkO", "checkmark": "Menu_checkmark__MWQ1O", "hideCheckmark": "Menu_hideCheckmark__YzBhM", "label": "Menu_label__NGMxM", "content": "Menu_content__MTA2O" };
33606
33607
 
33607
33608
  // src/components/Menu.tsx
33608
- import { Fragment as Fragment9, jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
33609
+ import { Fragment as Fragment10, jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
33609
33610
  function Menu2({ className, children, ...props }) {
33610
33611
  return /* @__PURE__ */ jsx53($3674c52c6b3c5bce$export$d9b273488cd8ce6f, { ...props, className: (0, import_classnames36.default)(Menu_default.menu, className), children });
33611
33612
  }
@@ -33639,7 +33640,7 @@ function MenuSection({
33639
33640
  maxHeight,
33640
33641
  overflow: maxHeight ? "auto" : void 0
33641
33642
  };
33642
- return /* @__PURE__ */ jsxs30(Fragment9, { children: [
33643
+ return /* @__PURE__ */ jsxs30(Fragment10, { children: [
33643
33644
  title && /* @__PURE__ */ jsx53($72a5793c14baf454$export$8b251419efc915eb, { className: Menu_default.header, children: title }),
33644
33645
  /* @__PURE__ */ jsx53(
33645
33646
  $3674c52c6b3c5bce$export$4b1545b4f2016d26,
@@ -33804,12 +33805,12 @@ function NavMenuItem({ isSelected, className, children, ...props }) {
33804
33805
  // src/components/PasswordField.tsx
33805
33806
  import { useState as useState17 } from "react";
33806
33807
  var import_classnames40 = __toESM(require_classnames());
33807
- import { Fragment as Fragment10, jsx as jsx57, jsxs as jsxs33 } from "react/jsx-runtime";
33808
+ import { Fragment as Fragment11, jsx as jsx57, jsxs as jsxs33 } from "react/jsx-runtime";
33808
33809
  function PasswordField({ label, className, ...props }) {
33809
33810
  const [show, setShow] = useState17(false);
33810
33811
  const type = show ? "text" : "password";
33811
33812
  const handleShowPassword = () => setShow((state) => !state);
33812
- return /* @__PURE__ */ jsxs33(Fragment10, { children: [
33813
+ return /* @__PURE__ */ jsxs33(Fragment11, { children: [
33813
33814
  label && /* @__PURE__ */ jsx57(Label2, { children: label }),
33814
33815
  /* @__PURE__ */ jsxs33($bcdf0525bf22703d$export$2c73285ae9390cec, { "aria-label": "Password", ...props, className: (0, import_classnames40.default)(TextField_default.field, className), children: [
33815
33816
  /* @__PURE__ */ jsx57($3985021b0ad6602f$export$f5b8910cec6cf069, { type }),
@@ -33837,10 +33838,10 @@ var import_classnames42 = __toESM(require_classnames());
33837
33838
  var ProgressBar_default = { "progressbar": "ProgressBar_progressbar__YzdlO", "track": "ProgressBar_track__YzgzY", "fill": "ProgressBar_fill__ZTJlM", "value": "ProgressBar_value__NDk1Z" };
33838
33839
 
33839
33840
  // src/components/ProgressBar.tsx
33840
- import { Fragment as Fragment11, jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
33841
+ import { Fragment as Fragment12, jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
33841
33842
  function ProgressBar2({ className, showPercentage, ...props }) {
33842
33843
  return /* @__PURE__ */ jsx59($0393f8ab869a0f1a$export$c17561cb55d4db30, { ...props, className: (0, import_classnames42.default)(ProgressBar_default.progressbar, className), children: ({ percentage = 0, valueText }) => {
33843
- return /* @__PURE__ */ jsxs34(Fragment11, { children: [
33844
+ return /* @__PURE__ */ jsxs34(Fragment12, { children: [
33844
33845
  /* @__PURE__ */ jsx59("div", { className: ProgressBar_default.track, children: /* @__PURE__ */ jsx59("div", { className: ProgressBar_default.fill, style: { width: `${percentage}%` } }) }),
33845
33846
  showPercentage && /* @__PURE__ */ jsx59("div", { className: ProgressBar_default.value, children: valueText })
33846
33847
  ] });
@@ -33854,13 +33855,13 @@ var import_classnames43 = __toESM(require_classnames());
33854
33855
  var ProgressCircle_default = { "progresscircle": "ProgressCircle_progresscircle__NGMyY", "track": "ProgressCircle_track__YzY2M", "fill": "ProgressCircle_fill__ZmMzM", "value": "ProgressCircle_value__YjM0Y" };
33855
33856
 
33856
33857
  // src/components/ProgressCircle.tsx
33857
- import { Fragment as Fragment12, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
33858
+ import { Fragment as Fragment13, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
33858
33859
  function ProgressCircle({ className, showPercentage, ...props }) {
33859
33860
  return /* @__PURE__ */ jsx60($0393f8ab869a0f1a$export$c17561cb55d4db30, { ...props, className: (0, import_classnames43.default)(ProgressCircle_default.progresscircle, className), children: ({ percentage = 0, valueText }) => {
33860
33861
  const radius = 45;
33861
33862
  const circumference = radius * 2 * Math.PI;
33862
33863
  const offset = circumference - percentage / 100 * circumference;
33863
- return /* @__PURE__ */ jsxs35(Fragment12, { children: [
33864
+ return /* @__PURE__ */ jsxs35(Fragment13, { children: [
33864
33865
  /* @__PURE__ */ jsxs35("svg", { viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg", children: [
33865
33866
  /* @__PURE__ */ jsx60("circle", { className: ProgressCircle_default.track, cx: "50", cy: "50", r: "45" }),
33866
33867
  /* @__PURE__ */ jsx60(
@@ -33915,7 +33916,7 @@ function Radio2({ children, className, ...props }) {
33915
33916
  // src/components/SearchField.tsx
33916
33917
  import { useState as useState18, useEffect as useEffect12 } from "react";
33917
33918
  var import_classnames45 = __toESM(require_classnames());
33918
- import { Fragment as Fragment13, jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
33919
+ import { Fragment as Fragment14, jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
33919
33920
  function SearchField2({
33920
33921
  label,
33921
33922
  placeholder,
@@ -33946,7 +33947,7 @@ function SearchField2({
33946
33947
  onSearch?.(searchValue);
33947
33948
  }
33948
33949
  }, [searchValue, delay]);
33949
- return /* @__PURE__ */ jsxs37(Fragment13, { children: [
33950
+ return /* @__PURE__ */ jsxs37(Fragment14, { children: [
33950
33951
  label && /* @__PURE__ */ jsx62(Label2, { children: label }),
33951
33952
  /* @__PURE__ */ jsxs37(
33952
33953
  $440f4836bcb56932$export$b94867ecbd698f21,
@@ -34150,7 +34151,7 @@ var import_classnames48 = __toESM(require_classnames());
34150
34151
  var Slider_default = { "slider": "Slider_slider__MjBhO", "header": "Slider_header__ZTE2M", "track": "Slider_track__ODk5M", "fill": "Slider_fill__YzdhM", "thumb": "Slider_thumb__NGEzM" };
34151
34152
 
34152
34153
  // src/components/Slider.tsx
34153
- import { Fragment as Fragment14, jsx as jsx65, jsxs as jsxs40 } from "react/jsx-runtime";
34154
+ import { Fragment as Fragment15, jsx as jsx65, jsxs as jsxs40 } from "react/jsx-runtime";
34154
34155
  function Slider2({ className, showValue = true, label, ...props }) {
34155
34156
  return /* @__PURE__ */ jsxs40($6f909507e6374d18$export$472062a354075cee, { ...props, className: (0, import_classnames48.default)(Slider_default.slider, className), children: [
34156
34157
  /* @__PURE__ */ jsxs40("div", { className: Slider_default.header, children: [
@@ -34159,7 +34160,7 @@ function Slider2({ className, showValue = true, label, ...props }) {
34159
34160
  ] }),
34160
34161
  /* @__PURE__ */ jsx65($6f909507e6374d18$export$105594979f116971, { className: Slider_default.track, children: ({ state }) => {
34161
34162
  const isHorizontal = state.orientation === "horizontal";
34162
- return /* @__PURE__ */ jsxs40(Fragment14, { children: [
34163
+ return /* @__PURE__ */ jsxs40(Fragment15, { children: [
34163
34164
  /* @__PURE__ */ jsx65(
34164
34165
  "div",
34165
34166
  {
@@ -34284,10 +34285,10 @@ var import_classnames52 = __toESM(require_classnames());
34284
34285
  var Toggle_default = { "toggle": "Toggle_toggle__OWVjZ" };
34285
34286
 
34286
34287
  // src/components/Toggle.tsx
34287
- import { Fragment as Fragment15, jsx as jsx70, jsxs as jsxs44 } from "react/jsx-runtime";
34288
+ import { Fragment as Fragment16, jsx as jsx70, jsxs as jsxs44 } from "react/jsx-runtime";
34288
34289
  function Toggle({ label, children, className, ...props }) {
34289
34290
  const isSelected = typeof props.value !== "undefined" ? !!props.value : void 0;
34290
- return /* @__PURE__ */ jsxs44(Fragment15, { children: [
34291
+ return /* @__PURE__ */ jsxs44(Fragment16, { children: [
34291
34292
  label && /* @__PURE__ */ jsx70(Label2, { children: label }),
34292
34293
  /* @__PURE__ */ jsx70(
34293
34294
  $efde0372d7a700fe$export$d2b052e7b4be1756,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.194.0",
3
+ "version": "0.195.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",