@umami/react-zen 0.93.0 → 0.95.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/README.md CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  **zen** is a modern, minimalist React component library.
4
4
 
5
+ - Beautifully-designed components
5
6
  - Built on top of [React Aria](https://react-spectrum.adobe.com/react-aria/) primitives.
6
7
  - No Tailwind, pure CSS.
7
- - Out-of-the-box accessibility.
8
8
 
9
9
  [Learn more](https://zen.umami.is/)
10
10
 
11
11
  ## Installation
12
12
 
13
13
  ```shell
14
- yarn add @umami/react-zen
14
+ npm install @umami/react-zen
15
15
  ```
16
16
 
17
17
  ## Usage
package/dist/index.css CHANGED
@@ -3714,56 +3714,59 @@ body a.Button_button__NDYwM {
3714
3714
  }
3715
3715
 
3716
3716
  /* virtual-css:css:eedba9fc7e3d8030bbd07387da49f358 */
3717
- .Table_table__YWNjZ {
3717
+ .Table_table__MjczZ {
3718
3718
  font-size: var(--font-size);
3719
3719
  color: var(--font-color);
3720
3720
  border-collapse: collapse;
3721
3721
  width: 100%;
3722
3722
  position: relative;
3723
3723
  }
3724
- .Table_table__YWNjZ th,
3725
- .Table_table__YWNjZ td {
3724
+ .Table_table__MjczZ th,
3725
+ .Table_table__MjczZ td {
3726
3726
  min-width: 0;
3727
3727
  }
3728
- .Table_header__NDRkN,
3729
- .Table_body__MTcyZ {
3728
+ .Table_header__YjU3M,
3729
+ .Table_body__MzgxM {
3730
3730
  display: contents;
3731
3731
  }
3732
- .Table_header__NDRkN tr {
3733
- display: flex;
3732
+ .Table_header__YjU3M {
3733
+ display: grid;
3734
3734
  border-bottom: 1px solid var(--border-color);
3735
3735
  }
3736
- .Table_row__MDBjM {
3737
- display: flex;
3736
+ .Table_header__YjU3M tr {
3737
+ display: contents;
3738
+ }
3739
+ .Table_row__MTdmZ {
3740
+ display: grid;
3738
3741
  border-bottom: 1px solid color-mix(in srgb, var(--border-color), 50% transparent);
3739
3742
  }
3740
- .Table_header__NDRkN .Table_column__YmI1M:first-child,
3741
- .Table_row__MDBjM .Table_cell__Y2ZiM:first-child {
3743
+ .Table_header__YjU3M .Table_column__ZDFlM:first-child,
3744
+ .Table_row__MTdmZ .Table_cell__NzhiM:first-child {
3742
3745
  padding-left: 0;
3743
3746
  }
3744
- .Table_header__NDRkN .Table_column__YmI1M:last-child,
3745
- .Table_row__MDBjM .Table_cell__Y2ZiM:last-child {
3747
+ .Table_header__YjU3M .Table_column__ZDFlM:last-child,
3748
+ .Table_row__MTdmZ .Table_cell__NzhiM:last-child {
3746
3749
  padding-right: 0;
3747
3750
  }
3748
- .Table_column__YmI1M {
3751
+ .Table_column__ZDFlM {
3749
3752
  display: flex;
3750
3753
  padding: var(--padding);
3751
3754
  text-align: left;
3752
3755
  font-weight: 700;
3753
3756
  flex: 1;
3754
3757
  }
3755
- .Table_cell__Y2ZiM {
3758
+ .Table_cell__NzhiM {
3756
3759
  display: flex;
3757
3760
  padding: var(--padding);
3758
3761
  flex: 1;
3759
3762
  }
3760
- .Table_start__NjIyN {
3763
+ .Table_start__ODJiN {
3761
3764
  justify-content: flex-start;
3762
3765
  }
3763
- .Table_center__NGM2N {
3766
+ .Table_center__MTI5M {
3764
3767
  justify-content: center;
3765
3768
  }
3766
- .Table_end__MDhhO {
3769
+ .Table_end__MjE3N {
3767
3770
  justify-content: flex-end;
3768
3771
  }
3769
3772
 
package/dist/index.d.ts CHANGED
@@ -109,16 +109,14 @@ declare module '@umami/react-zen/forms/FormButtons' {
109
109
  declare module '@umami/react-zen/forms/FormField' {
110
110
  import { HTMLAttributes } from 'react';
111
111
  import { RegisterOptions, UseFormReturn, FieldValues } from 'react-hook-form';
112
- interface FormFieldProps extends HTMLAttributes<HTMLDivElement>, Partial<UseFormReturn> {
112
+ export interface FormFieldProps extends HTMLAttributes<HTMLDivElement>, Partial<UseFormReturn> {
113
113
  name: string;
114
114
  description?: string;
115
115
  label?: string;
116
116
  rules?: RegisterOptions<FieldValues, string>;
117
117
  children: any;
118
118
  }
119
- const FormField: import("react").ForwardRefExoticComponent<FormFieldProps & import("react").RefAttributes<any>>;
120
- export { FormField };
121
- export type { FormFieldProps };
119
+ export const FormField: import("react").ForwardRefExoticComponent<FormFieldProps & import("react").RefAttributes<any>>;
122
120
  }
123
121
 
124
122
  declare module '@umami/react-zen/forms/FormResetButton' {
@@ -437,20 +435,19 @@ declare module '@umami/react-zen/Dialog' {
437
435
  declare module '@umami/react-zen/DataTable' {
438
436
  import { ReactNode } from 'react';
439
437
  import { ColumnProps, TableProps } from 'react-aria-components';
440
- interface DataTableProps extends TableProps {
438
+ export interface DataTableProps extends TableProps {
441
439
  data?: any[];
440
+ columns?: string;
442
441
  }
443
- function DataTable({ data, className, children, ...props }: DataTableProps): import("react").JSX.Element;
444
- interface DataColumnProps extends ColumnProps {
442
+ export function DataTable({ data, className, children, ...props }: DataTableProps): import("react").JSX.Element;
443
+ export interface DataColumnProps extends ColumnProps {
445
444
  id: string;
446
445
  label?: ReactNode;
447
446
  align?: 'start' | 'center' | 'end';
448
447
  as?: string;
449
448
  hidden?: boolean;
450
449
  }
451
- function DataColumn(props: DataColumnProps): null;
452
- export { DataTable, DataColumn };
453
- export type { DataTableProps, DataColumnProps };
450
+ export function DataColumn(props: DataColumnProps): null;
454
451
  }
455
452
 
456
453
  declare module '@umami/react-zen/Dots' {
@@ -776,6 +773,7 @@ declare module '@umami/react-zen/Select' {
776
773
  interface SelectProps extends AriaSelectProps<HTMLSelectElement> {
777
774
  items?: any[];
778
775
  value?: string;
776
+ defaultValue?: string;
779
777
  label?: string;
780
778
  isLoading?: boolean;
781
779
  allowSearch?: boolean;
@@ -887,9 +885,9 @@ declare module '@umami/react-zen/Table' {
887
885
  align?: 'start' | 'center' | 'end';
888
886
  }
889
887
  function Table({ children, className, ...props }: TableProps): import("react").JSX.Element;
890
- function TableHeader({ children, className, ...props }: TableHeaderProps<any>): import("react").JSX.Element;
888
+ function TableHeader({ children, className, style, ...props }: TableHeaderProps<any>): import("react").JSX.Element;
891
889
  function TableBody({ children, className, ...props }: TableBodyProps<any>): import("react").JSX.Element;
892
- function TableRow({ children, className, ...props }: RowProps<any>): import("react").JSX.Element;
890
+ function TableRow({ children, className, style, ...props }: RowProps<any>): import("react").JSX.Element;
893
891
  function TableColumn({ children, className, align, ...props }: TableColumnProps): import("react").JSX.Element;
894
892
  function TableCell({ children, className, align, ...props }: TableCellProps): import("react").JSX.Element;
895
893
  export { Table, TableHeader, TableBody, TableRow, TableColumn, TableCell };
package/dist/index.js CHANGED
@@ -30290,21 +30290,38 @@ var import_react179 = require("react");
30290
30290
  var import_classnames23 = __toESM(require_classnames());
30291
30291
 
30292
30292
  // css-modules:E:\dev\umami-react-zen\src\components\Table.module.css
30293
- var Table_default = { "table": "Table_table__YWNjZ", "header": "Table_header__NDRkN", "body": "Table_body__MTcyZ", "row": "Table_row__MDBjM", "column": "Table_column__YmI1M", "cell": "Table_cell__Y2ZiM", "start": "Table_start__NjIyN", "center": "Table_center__NGM2N", "end": "Table_end__MDhhO" };
30293
+ var Table_default = { "table": "Table_table__MjczZ", "header": "Table_header__YjU3M", "body": "Table_body__MzgxM", "row": "Table_row__MTdmZ", "column": "Table_column__ZDFlM", "cell": "Table_cell__NzhiM", "start": "Table_start__ODJiN", "center": "Table_center__MTI5M", "end": "Table_end__MjE3N" };
30294
30294
 
30295
30295
  // src/components/Table.tsx
30296
30296
  var import_jsx_runtime32 = require("react/jsx-runtime");
30297
+ var gridTemplateColumns = "repeat(auto-fit, minmax(140px, 1fr))";
30297
30298
  function Table2({ children, className, ...props }) {
30298
30299
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)($1910c06f0ca9905e$export$54ec01a60f47d33d, { ...props, className: (0, import_classnames23.default)(Table_default.table, className), "aria-label": "Table", children });
30299
30300
  }
30300
- function TableHeader({ children, className, ...props }) {
30301
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)($1910c06f0ca9905e$export$f850895b287ef28e, { ...props, className: (0, import_classnames23.default)(Table_default.header, className), children });
30301
+ function TableHeader({ children, className, style, ...props }) {
30302
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
30303
+ $1910c06f0ca9905e$export$f850895b287ef28e,
30304
+ {
30305
+ ...props,
30306
+ className: (0, import_classnames23.default)(Table_default.header, className),
30307
+ style: { gridTemplateColumns, ...style },
30308
+ children
30309
+ }
30310
+ );
30302
30311
  }
30303
30312
  function TableBody({ children, className, ...props }) {
30304
30313
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)($1910c06f0ca9905e$export$76ccd210b9029917, { ...props, className: (0, import_classnames23.default)(Table_default.body, className), children });
30305
30314
  }
30306
- function TableRow({ children, className, ...props }) {
30307
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)($1910c06f0ca9905e$export$b59bdbef9ce70de2, { ...props, className: (0, import_classnames23.default)(Table_default.row, className), children });
30315
+ function TableRow({ children, className, style, ...props }) {
30316
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
30317
+ $1910c06f0ca9905e$export$b59bdbef9ce70de2,
30318
+ {
30319
+ ...props,
30320
+ className: (0, import_classnames23.default)(Table_default.row, className),
30321
+ style: { gridTemplateColumns, ...style },
30322
+ children
30323
+ }
30324
+ );
30308
30325
  }
30309
30326
  function TableColumn({ children, className, align, ...props }) {
30310
30327
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
@@ -30329,18 +30346,21 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
30329
30346
  var import_react180 = require("react");
30330
30347
  function DataTable({ data = [], className, children, ...props }) {
30331
30348
  const items = data.length && data?.[0]?.id === void 0 ? data.map((record, id) => ({ ...record, id })) : data;
30349
+ const widths = [];
30332
30350
  const columns = import_react179.Children.map(children, (child) => {
30351
+ widths.push(child?.props?.width || "1fr");
30333
30352
  return { ...child.props };
30334
30353
  });
30354
+ const gridTemplateColumns2 = widths.join(" ");
30335
30355
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Table2, { ...props, className: (0, import_classnames24.default)(DataTable_default.datatable, className), children: [
30336
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableHeader, { children: columns.filter((n) => n).map(({ id, label, as, hidden, ...columnProps }) => {
30356
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns.filter((n) => n).map(({ id, label, as, hidden, width, ...columnProps }) => {
30337
30357
  if (hidden) {
30338
30358
  return null;
30339
30359
  }
30340
30360
  return /* @__PURE__ */ (0, import_react180.createElement)(TableColumn, { ...columnProps, key: id, id }, label);
30341
30361
  }) }),
30342
30362
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableBody, { items, children: (row) => {
30343
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableRow, { children: columns.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
30363
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
30344
30364
  const value = typeof children2 === "function" ? children2(row) : children2 || row[id];
30345
30365
  return /* @__PURE__ */ (0, import_react180.createElement)(
30346
30366
  TableCell,
@@ -31027,6 +31047,7 @@ var Select2 = (0, import_react189.forwardRef)(
31027
31047
  ({
31028
31048
  items = [],
31029
31049
  value,
31050
+ defaultValue,
31030
31051
  label,
31031
31052
  isLoading,
31032
31053
  allowSearch,
@@ -31052,35 +31073,46 @@ var Select2 = (0, import_react189.forwardRef)(
31052
31073
  setSearch(value2);
31053
31074
  onSearch?.(value2);
31054
31075
  };
31055
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)($82d7e5349645de74$export$ef9b1a59e592288f, { "aria-label": "Select", ...props, ref, onSelectionChange: handleChange, children: [
31056
- label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Label2, { children: label }),
31057
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button2, { variant: "outline", ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Row, { justifyContent: "space-between", gap: "3", children: [
31058
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)($82d7e5349645de74$export$e288731fd71264f0, { children: renderValue }),
31059
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { rotate: 90, size: "xs", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icons.Chevron, {}) }) })
31060
- ] }) }),
31061
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Popover2, { ...popoverProps, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Column, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Box, { padding: "2", border: true, borderRadius: true, backgroundColor: true, shadow: "3", children: [
31062
- allowSearch && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box, { marginBottom: "2", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
31063
- SearchField2,
31064
- {
31065
- value: search,
31066
- onSearch: handleSearch,
31067
- delay: searchDelay,
31068
- defaultValue: searchValue,
31069
- autoFocus: true
31070
- }
31071
- ) }),
31072
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Loading, { icon: "dots", position: "center", size: "sm" }),
31073
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
31074
- List,
31075
- {
31076
- ...listProps,
31077
- items,
31078
- style: { ...listProps?.style, display: isLoading ? "none" : void 0 },
31079
- children
31080
- }
31081
- )
31082
- ] }) }) })
31083
- ] });
31076
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
31077
+ $82d7e5349645de74$export$ef9b1a59e592288f,
31078
+ {
31079
+ "aria-label": "Select",
31080
+ ...props,
31081
+ ref,
31082
+ selectedKey: value,
31083
+ defaultSelectedKey: defaultValue,
31084
+ onSelectionChange: handleChange,
31085
+ children: [
31086
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Label2, { children: label }),
31087
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button2, { variant: "outline", ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Row, { justifyContent: "space-between", gap: "3", children: [
31088
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)($82d7e5349645de74$export$e288731fd71264f0, { children: renderValue }),
31089
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { rotate: 90, size: "xs", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icons.Chevron, {}) }) })
31090
+ ] }) }),
31091
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Popover2, { ...popoverProps, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Column, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Box, { padding: "2", border: true, borderRadius: true, backgroundColor: true, shadow: "3", children: [
31092
+ allowSearch && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box, { marginBottom: "2", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
31093
+ SearchField2,
31094
+ {
31095
+ value: search,
31096
+ onSearch: handleSearch,
31097
+ delay: searchDelay,
31098
+ defaultValue: searchValue,
31099
+ autoFocus: true
31100
+ }
31101
+ ) }),
31102
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Loading, { icon: "dots", position: "center", size: "sm" }),
31103
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
31104
+ List,
31105
+ {
31106
+ ...listProps,
31107
+ items,
31108
+ style: { ...listProps?.style, display: isLoading ? "none" : void 0 },
31109
+ children
31110
+ }
31111
+ )
31112
+ ] }) }) })
31113
+ ]
31114
+ }
31115
+ );
31084
31116
  }
31085
31117
  );
31086
31118
 
package/dist/index.mjs CHANGED
@@ -30179,21 +30179,38 @@ import { Children as Children2, createElement as createElement5 } from "react";
30179
30179
  var import_classnames23 = __toESM(require_classnames());
30180
30180
 
30181
30181
  // css-modules:E:\dev\umami-react-zen\src\components\Table.module.css
30182
- var Table_default = { "table": "Table_table__YWNjZ", "header": "Table_header__NDRkN", "body": "Table_body__MTcyZ", "row": "Table_row__MDBjM", "column": "Table_column__YmI1M", "cell": "Table_cell__Y2ZiM", "start": "Table_start__NjIyN", "center": "Table_center__NGM2N", "end": "Table_end__MDhhO" };
30182
+ var Table_default = { "table": "Table_table__MjczZ", "header": "Table_header__YjU3M", "body": "Table_body__MzgxM", "row": "Table_row__MTdmZ", "column": "Table_column__ZDFlM", "cell": "Table_cell__NzhiM", "start": "Table_start__ODJiN", "center": "Table_center__MTI5M", "end": "Table_end__MjE3N" };
30183
30183
 
30184
30184
  // src/components/Table.tsx
30185
30185
  import { jsx as jsx32 } from "react/jsx-runtime";
30186
+ var gridTemplateColumns = "repeat(auto-fit, minmax(140px, 1fr))";
30186
30187
  function Table2({ children, className, ...props }) {
30187
30188
  return /* @__PURE__ */ jsx32($1910c06f0ca9905e$export$54ec01a60f47d33d, { ...props, className: (0, import_classnames23.default)(Table_default.table, className), "aria-label": "Table", children });
30188
30189
  }
30189
- function TableHeader({ children, className, ...props }) {
30190
- return /* @__PURE__ */ jsx32($1910c06f0ca9905e$export$f850895b287ef28e, { ...props, className: (0, import_classnames23.default)(Table_default.header, className), children });
30190
+ function TableHeader({ children, className, style, ...props }) {
30191
+ return /* @__PURE__ */ jsx32(
30192
+ $1910c06f0ca9905e$export$f850895b287ef28e,
30193
+ {
30194
+ ...props,
30195
+ className: (0, import_classnames23.default)(Table_default.header, className),
30196
+ style: { gridTemplateColumns, ...style },
30197
+ children
30198
+ }
30199
+ );
30191
30200
  }
30192
30201
  function TableBody({ children, className, ...props }) {
30193
30202
  return /* @__PURE__ */ jsx32($1910c06f0ca9905e$export$76ccd210b9029917, { ...props, className: (0, import_classnames23.default)(Table_default.body, className), children });
30194
30203
  }
30195
- function TableRow({ children, className, ...props }) {
30196
- return /* @__PURE__ */ jsx32($1910c06f0ca9905e$export$b59bdbef9ce70de2, { ...props, className: (0, import_classnames23.default)(Table_default.row, className), children });
30204
+ function TableRow({ children, className, style, ...props }) {
30205
+ return /* @__PURE__ */ jsx32(
30206
+ $1910c06f0ca9905e$export$b59bdbef9ce70de2,
30207
+ {
30208
+ ...props,
30209
+ className: (0, import_classnames23.default)(Table_default.row, className),
30210
+ style: { gridTemplateColumns, ...style },
30211
+ children
30212
+ }
30213
+ );
30197
30214
  }
30198
30215
  function TableColumn({ children, className, align, ...props }) {
30199
30216
  return /* @__PURE__ */ jsx32(
@@ -30218,18 +30235,21 @@ import { jsx as jsx33, jsxs as jsxs16 } from "react/jsx-runtime";
30218
30235
  import { createElement as createElement6 } from "react";
30219
30236
  function DataTable({ data = [], className, children, ...props }) {
30220
30237
  const items = data.length && data?.[0]?.id === void 0 ? data.map((record, id) => ({ ...record, id })) : data;
30238
+ const widths = [];
30221
30239
  const columns = Children2.map(children, (child) => {
30240
+ widths.push(child?.props?.width || "1fr");
30222
30241
  return { ...child.props };
30223
30242
  });
30243
+ const gridTemplateColumns2 = widths.join(" ");
30224
30244
  return /* @__PURE__ */ jsxs16(Table2, { ...props, className: (0, import_classnames24.default)(DataTable_default.datatable, className), children: [
30225
- /* @__PURE__ */ jsx33(TableHeader, { children: columns.filter((n) => n).map(({ id, label, as, hidden, ...columnProps }) => {
30245
+ /* @__PURE__ */ jsx33(TableHeader, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns.filter((n) => n).map(({ id, label, as, hidden, width, ...columnProps }) => {
30226
30246
  if (hidden) {
30227
30247
  return null;
30228
30248
  }
30229
30249
  return /* @__PURE__ */ createElement6(TableColumn, { ...columnProps, key: id, id }, label);
30230
30250
  }) }),
30231
30251
  /* @__PURE__ */ jsx33(TableBody, { items, children: (row) => {
30232
- return /* @__PURE__ */ jsx33(TableRow, { children: columns.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
30252
+ return /* @__PURE__ */ jsx33(TableRow, { style: { gridTemplateColumns: gridTemplateColumns2 }, children: columns.map(({ id, as, hidden, className: className2, children: children2, ...cellProps }) => {
30233
30253
  const value = typeof children2 === "function" ? children2(row) : children2 || row[id];
30234
30254
  return /* @__PURE__ */ createElement6(
30235
30255
  TableCell,
@@ -30920,6 +30940,7 @@ var Select2 = forwardRef9(
30920
30940
  ({
30921
30941
  items = [],
30922
30942
  value,
30943
+ defaultValue,
30923
30944
  label,
30924
30945
  isLoading,
30925
30946
  allowSearch,
@@ -30945,35 +30966,46 @@ var Select2 = forwardRef9(
30945
30966
  setSearch(value2);
30946
30967
  onSearch?.(value2);
30947
30968
  };
30948
- return /* @__PURE__ */ jsxs30($82d7e5349645de74$export$ef9b1a59e592288f, { "aria-label": "Select", ...props, ref, onSelectionChange: handleChange, children: [
30949
- label && /* @__PURE__ */ jsx53(Label2, { children: label }),
30950
- /* @__PURE__ */ jsx53(Button2, { variant: "outline", ...buttonProps, children: /* @__PURE__ */ jsxs30(Row, { justifyContent: "space-between", gap: "3", children: [
30951
- /* @__PURE__ */ jsx53($82d7e5349645de74$export$e288731fd71264f0, { children: renderValue }),
30952
- /* @__PURE__ */ jsx53("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx53(Icon, { rotate: 90, size: "xs", children: /* @__PURE__ */ jsx53(Icons.Chevron, {}) }) })
30953
- ] }) }),
30954
- /* @__PURE__ */ jsx53(Popover2, { ...popoverProps, children: /* @__PURE__ */ jsx53(Column, { children: /* @__PURE__ */ jsxs30(Box, { padding: "2", border: true, borderRadius: true, backgroundColor: true, shadow: "3", children: [
30955
- allowSearch && /* @__PURE__ */ jsx53(Box, { marginBottom: "2", children: /* @__PURE__ */ jsx53(
30956
- SearchField2,
30957
- {
30958
- value: search,
30959
- onSearch: handleSearch,
30960
- delay: searchDelay,
30961
- defaultValue: searchValue,
30962
- autoFocus: true
30963
- }
30964
- ) }),
30965
- isLoading && /* @__PURE__ */ jsx53(Loading, { icon: "dots", position: "center", size: "sm" }),
30966
- /* @__PURE__ */ jsx53(
30967
- List,
30968
- {
30969
- ...listProps,
30970
- items,
30971
- style: { ...listProps?.style, display: isLoading ? "none" : void 0 },
30972
- children
30973
- }
30974
- )
30975
- ] }) }) })
30976
- ] });
30969
+ return /* @__PURE__ */ jsxs30(
30970
+ $82d7e5349645de74$export$ef9b1a59e592288f,
30971
+ {
30972
+ "aria-label": "Select",
30973
+ ...props,
30974
+ ref,
30975
+ selectedKey: value,
30976
+ defaultSelectedKey: defaultValue,
30977
+ onSelectionChange: handleChange,
30978
+ children: [
30979
+ label && /* @__PURE__ */ jsx53(Label2, { children: label }),
30980
+ /* @__PURE__ */ jsx53(Button2, { variant: "outline", ...buttonProps, children: /* @__PURE__ */ jsxs30(Row, { justifyContent: "space-between", gap: "3", children: [
30981
+ /* @__PURE__ */ jsx53($82d7e5349645de74$export$e288731fd71264f0, { children: renderValue }),
30982
+ /* @__PURE__ */ jsx53("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx53(Icon, { rotate: 90, size: "xs", children: /* @__PURE__ */ jsx53(Icons.Chevron, {}) }) })
30983
+ ] }) }),
30984
+ /* @__PURE__ */ jsx53(Popover2, { ...popoverProps, children: /* @__PURE__ */ jsx53(Column, { children: /* @__PURE__ */ jsxs30(Box, { padding: "2", border: true, borderRadius: true, backgroundColor: true, shadow: "3", children: [
30985
+ allowSearch && /* @__PURE__ */ jsx53(Box, { marginBottom: "2", children: /* @__PURE__ */ jsx53(
30986
+ SearchField2,
30987
+ {
30988
+ value: search,
30989
+ onSearch: handleSearch,
30990
+ delay: searchDelay,
30991
+ defaultValue: searchValue,
30992
+ autoFocus: true
30993
+ }
30994
+ ) }),
30995
+ isLoading && /* @__PURE__ */ jsx53(Loading, { icon: "dots", position: "center", size: "sm" }),
30996
+ /* @__PURE__ */ jsx53(
30997
+ List,
30998
+ {
30999
+ ...listProps,
31000
+ items,
31001
+ style: { ...listProps?.style, display: isLoading ? "none" : void 0 },
31002
+ children
31003
+ }
31004
+ )
31005
+ ] }) }) })
31006
+ ]
31007
+ }
31008
+ );
30977
31009
  }
30978
31010
  );
30979
31011
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.93.0",
3
+ "version": "0.95.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",
package/styles.css CHANGED
@@ -4030,56 +4030,59 @@ body a.Button_button__NDYwM {
4030
4030
  }
4031
4031
 
4032
4032
  /* virtual-css:css:eedba9fc7e3d8030bbd07387da49f358 */
4033
- .Table_table__YWNjZ {
4033
+ .Table_table__MjczZ {
4034
4034
  font-size: var(--font-size);
4035
4035
  color: var(--font-color);
4036
4036
  border-collapse: collapse;
4037
4037
  width: 100%;
4038
4038
  position: relative;
4039
4039
  }
4040
- .Table_table__YWNjZ th,
4041
- .Table_table__YWNjZ td {
4040
+ .Table_table__MjczZ th,
4041
+ .Table_table__MjczZ td {
4042
4042
  min-width: 0;
4043
4043
  }
4044
- .Table_header__NDRkN,
4045
- .Table_body__MTcyZ {
4044
+ .Table_header__YjU3M,
4045
+ .Table_body__MzgxM {
4046
4046
  display: contents;
4047
4047
  }
4048
- .Table_header__NDRkN tr {
4049
- display: flex;
4048
+ .Table_header__YjU3M {
4049
+ display: grid;
4050
4050
  border-bottom: 1px solid var(--border-color);
4051
4051
  }
4052
- .Table_row__MDBjM {
4053
- display: flex;
4052
+ .Table_header__YjU3M tr {
4053
+ display: contents;
4054
+ }
4055
+ .Table_row__MTdmZ {
4056
+ display: grid;
4054
4057
  border-bottom: 1px solid color-mix(in srgb, var(--border-color), 50% transparent);
4055
4058
  }
4056
- .Table_header__NDRkN .Table_column__YmI1M:first-child,
4057
- .Table_row__MDBjM .Table_cell__Y2ZiM:first-child {
4059
+ .Table_header__YjU3M .Table_column__ZDFlM:first-child,
4060
+ .Table_row__MTdmZ .Table_cell__NzhiM:first-child {
4058
4061
  padding-left: 0;
4059
4062
  }
4060
- .Table_header__NDRkN .Table_column__YmI1M:last-child,
4061
- .Table_row__MDBjM .Table_cell__Y2ZiM:last-child {
4063
+ .Table_header__YjU3M .Table_column__ZDFlM:last-child,
4064
+ .Table_row__MTdmZ .Table_cell__NzhiM:last-child {
4062
4065
  padding-right: 0;
4063
4066
  }
4064
- .Table_column__YmI1M {
4067
+ .Table_column__ZDFlM {
4065
4068
  display: flex;
4066
4069
  padding: var(--padding);
4067
4070
  text-align: left;
4068
4071
  font-weight: 700;
4069
4072
  flex: 1;
4070
4073
  }
4071
- .Table_cell__Y2ZiM {
4074
+ .Table_cell__NzhiM {
4072
4075
  display: flex;
4073
4076
  padding: var(--padding);
4074
4077
  flex: 1;
4075
4078
  }
4076
- .Table_start__NjIyN {
4079
+ .Table_start__ODJiN {
4077
4080
  justify-content: flex-start;
4078
4081
  }
4079
- .Table_center__NGM2N {
4082
+ .Table_center__MTI5M {
4080
4083
  justify-content: center;
4081
4084
  }
4082
- .Table_end__MDhhO {
4085
+ .Table_end__MjE3N {
4083
4086
  justify-content: flex-end;
4084
4087
  }
4085
4088