@overmap-ai/blocks 1.0.20 → 1.0.23

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.
@@ -7,6 +7,7 @@ export interface CheckboxProps extends RadixCheckboxProps {
7
7
  labelClassName?: string;
8
8
  label?: ReactNode;
9
9
  doesLabelCheck?: boolean;
10
+ alwaysShow?: boolean;
10
11
  }
11
12
  export interface SelectAllCheckboxProps extends Omit<CheckboxProps, "checked"> {
12
13
  children: Array<ReactElement<CheckboxProps>>;
@@ -14,6 +14,7 @@ export interface TableCell {
14
14
  filterValue?: ValueLabel;
15
15
  sortValue?: ValueLabel;
16
16
  searchValue?: ValueLabel;
17
+ disabled?: boolean;
17
18
  className?: string;
18
19
  }
19
20
  export interface TableColumn {
@@ -25,12 +26,14 @@ export interface TableColumn {
25
26
  width?: string;
26
27
  maxWidth?: string;
27
28
  className?: string;
29
+ disabled?: boolean;
28
30
  filterValues?: FilterValue[];
29
31
  }
30
32
  export interface TableRow {
31
33
  id: IdLabel;
32
34
  onClick?: (row: TableRow) => void;
33
35
  className?: string;
36
+ disabled?: boolean;
34
37
  columns: {
35
38
  [columnId: string]: TableCell;
36
39
  };
@@ -10,7 +10,7 @@ export interface TextAreaProps extends Omit<ComponentProps<typeof RadixTextArea>
10
10
  * @default false
11
11
  * */
12
12
  showInputLength?: boolean;
13
- resize: "vertical" | "horizontal" | "both";
13
+ resize: "vertical" | "horizontal" | "both" | "none";
14
14
  inputLengthTemplate?: string;
15
15
  variant?: ComponentProps<typeof RadixTextArea>["variant"] | "ghost";
16
16
  }
package/dist/blocks.js CHANGED
@@ -336,7 +336,7 @@ const _Button$1 = forwardRef(function Button$1(props, ref) {
336
336
  },
337
337
  loading,
338
338
  children,
339
- disabled,
339
+ disabled: disabled2,
340
340
  ...rest
341
341
  } = props;
342
342
  const color = useSeverityColor(severity);
@@ -355,7 +355,7 @@ const _Button$1 = forwardRef(function Button$1(props, ref) {
355
355
  color,
356
356
  size: useResponsiveMapping(size, SizeMapping),
357
357
  variant,
358
- disabled: loading || disabled,
358
+ disabled: loading || disabled2,
359
359
  highContrast,
360
360
  ...rest,
361
361
  children: loading ? /* @__PURE__ */ jsx(Spinner, {}) : children
@@ -661,10 +661,10 @@ const useDiscardAlertDialog = () => {
661
661
  );
662
662
  };
663
663
  const DropdownMenu = memo(
664
- forwardRef(({ trigger, disabled, children, ...rest }) => {
664
+ forwardRef(({ trigger, disabled: disabled2, children, ...rest }) => {
665
665
  const infoColor = useSeverityColor("info");
666
666
  return /* @__PURE__ */ jsxs(DropdownMenu$1.Root, { children: [
667
- /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled, children: trigger }),
667
+ /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled: disabled2, children: trigger }),
668
668
  /* @__PURE__ */ jsx(DropdownMenu$1.Content, { variant: "soft", color: infoColor, ...rest, children })
669
669
  ] });
670
670
  })
@@ -989,7 +989,7 @@ const DropdownItemMenu = memo(
989
989
  ({
990
990
  trigger,
991
991
  items,
992
- disabled,
992
+ disabled: disabled2,
993
993
  closeOnSelect = true,
994
994
  filterValue,
995
995
  onFilterValueChange,
@@ -998,7 +998,7 @@ const DropdownItemMenu = memo(
998
998
  }) => {
999
999
  const infoColor = useSeverityColor("info");
1000
1000
  return /* @__PURE__ */ jsxs(DropdownMenu$1.Root, { children: [
1001
- /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled, children: trigger }),
1001
+ /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled: disabled2, children: trigger }),
1002
1002
  /* @__PURE__ */ jsx(DropdownMenu$1.Content, { variant: "soft", ...rest, color: infoColor, children: /* @__PURE__ */ jsx(
1003
1003
  DropdownMenuItemGroup,
1004
1004
  {
@@ -1018,7 +1018,7 @@ const DropdownSelect = memo(
1018
1018
  ({
1019
1019
  trigger,
1020
1020
  items,
1021
- disabled = false,
1021
+ disabled: disabled2 = false,
1022
1022
  value,
1023
1023
  onValueChange,
1024
1024
  placeholder,
@@ -1030,7 +1030,7 @@ const DropdownSelect = memo(
1030
1030
  }, ref) => {
1031
1031
  const infoColor = useSeverityColor("info");
1032
1032
  return /* @__PURE__ */ jsxs(DropdownMenu$1.Root, { children: [
1033
- /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled, children: trigger }),
1033
+ /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled: disabled2, children: trigger }),
1034
1034
  /* @__PURE__ */ jsx(DropdownMenu$1.Content, { ref, variant: "soft", color: infoColor, side, children: /* @__PURE__ */ jsx(
1035
1035
  DropdownMenuSelectGroup,
1036
1036
  {
@@ -1053,7 +1053,7 @@ const DropdownMultiSelect = memo(
1053
1053
  ({
1054
1054
  trigger,
1055
1055
  items,
1056
- disabled = false,
1056
+ disabled: disabled2 = false,
1057
1057
  values,
1058
1058
  onValueChange,
1059
1059
  placeholder,
@@ -1065,7 +1065,7 @@ const DropdownMultiSelect = memo(
1065
1065
  }, ref) => {
1066
1066
  const infoColor = useSeverityColor("info");
1067
1067
  return /* @__PURE__ */ jsxs(DropdownMenu$1.Root, { children: [
1068
- /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled, children: trigger }),
1068
+ /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, { disabled: disabled2, children: trigger }),
1069
1069
  /* @__PURE__ */ jsx(DropdownMenu$1.Content, { ref, variant: "soft", color: infoColor, side, children: /* @__PURE__ */ jsx(
1070
1070
  DropdownMenuMultiSelectGroup,
1071
1071
  {
@@ -1156,7 +1156,7 @@ const SELECT_ALL_VALUE = "__select_all__";
1156
1156
  const MultiSelect = memo(
1157
1157
  forwardRef((props, ref) => {
1158
1158
  const [open, setOpen] = useState(false);
1159
- const { placeholder, value, onValueChange, options, disabled, name, ...triggerProps } = props;
1159
+ const { placeholder, value, onValueChange, options, disabled: disabled2, name, ...triggerProps } = props;
1160
1160
  const size = useResponsiveMapping(props.size, SizeMapping);
1161
1161
  const color = useSeverityColor(props.severity);
1162
1162
  const optionsMap = useMemo(() => new Map(options.map((o) => [o.value, o.label])), [options]);
@@ -1197,7 +1197,7 @@ const MultiSelect = memo(
1197
1197
  value: "",
1198
1198
  onOpenChange: handleOpenChange,
1199
1199
  onValueChange: handleValueChange,
1200
- disabled,
1200
+ disabled: disabled2,
1201
1201
  size,
1202
1202
  name,
1203
1203
  autoComplete: "off",
@@ -1976,7 +1976,7 @@ const _ToggleGroup = forwardRef(function ToggleGroup2({
1976
1976
  value,
1977
1977
  onValueChange,
1978
1978
  defaultValue,
1979
- disabled,
1979
+ disabled: disabled2,
1980
1980
  items,
1981
1981
  // ButtonGroup Props
1982
1982
  className,
@@ -1991,7 +1991,7 @@ const _ToggleGroup = forwardRef(function ToggleGroup2({
1991
1991
  ref,
1992
1992
  value,
1993
1993
  onValueChange,
1994
- disabled,
1994
+ disabled: disabled2,
1995
1995
  orientation: direction === "column" ? "vertical" : "horizontal",
1996
1996
  loop,
1997
1997
  rovingFocus,
@@ -2761,7 +2761,7 @@ const $e698a72e93240346$var$CHECKBOX_NAME = "Checkbox";
2761
2761
  const [$e698a72e93240346$var$createCheckboxContext, $e698a72e93240346$export$b566c4ff5488ea01] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($e698a72e93240346$var$CHECKBOX_NAME);
2762
2762
  const [$e698a72e93240346$var$CheckboxProvider, $e698a72e93240346$var$useCheckboxContext] = $e698a72e93240346$var$createCheckboxContext($e698a72e93240346$var$CHECKBOX_NAME);
2763
2763
  const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
2764
- const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
2764
+ const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled: disabled2, value = "on", onCheckedChange, ...checkboxProps } = props;
2765
2765
  const [button, setButton] = useState(null);
2766
2766
  const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
2767
2767
  forwardedRef,
@@ -2789,15 +2789,15 @@ const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef((pr
2789
2789
  return /* @__PURE__ */ createElement($e698a72e93240346$var$CheckboxProvider, {
2790
2790
  scope: __scopeCheckbox,
2791
2791
  state: checked,
2792
- disabled
2792
+ disabled: disabled2
2793
2793
  }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
2794
2794
  type: "button",
2795
2795
  role: "checkbox",
2796
2796
  "aria-checked": $e698a72e93240346$var$isIndeterminate(checked) ? "mixed" : checked,
2797
2797
  "aria-required": required,
2798
2798
  "data-state": $e698a72e93240346$var$getState(checked),
2799
- "data-disabled": disabled ? "" : void 0,
2800
- disabled,
2799
+ "data-disabled": disabled2 ? "" : void 0,
2800
+ disabled: disabled2,
2801
2801
  value
2802
2802
  }, checkboxProps, {
2803
2803
  ref: composedRefs,
@@ -2822,7 +2822,7 @@ const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef((pr
2822
2822
  value,
2823
2823
  checked,
2824
2824
  required,
2825
- disabled,
2825
+ disabled: disabled2,
2826
2826
  style: {
2827
2827
  transform: "translateX(-100%)"
2828
2828
  }
@@ -2907,14 +2907,14 @@ const styles$2 = {
2907
2907
  noTextHighlight,
2908
2908
  checkboxHidden
2909
2909
  };
2910
- const _Checkbox = forwardRef(function Checkbox2({ className, labelClassName, label, checked, onCheckedChange, ...rest }, ref) {
2910
+ const _Checkbox = forwardRef(function Checkbox2({ className, labelClassName, label, checked, onCheckedChange, alwaysShow = true, ...rest }, ref) {
2911
2911
  return /* @__PURE__ */ jsx(HoverUtility, { children: ({ isHovered, ...props }) => /* @__PURE__ */ jsxs(Flex$1, { className: styles$2.checkboxContainer, ...props, children: [
2912
2912
  /* @__PURE__ */ jsx(
2913
2913
  $e698a72e93240346$export$be92b6f5f03c0fe9,
2914
2914
  {
2915
2915
  className: classNames(
2916
2916
  styles$2.checkbox,
2917
- !isHovered && !checked && styles$2.checkboxHidden,
2917
+ !alwaysShow && !isHovered && !checked && styles$2.checkboxHidden,
2918
2918
  className
2919
2919
  ),
2920
2920
  checked,
@@ -3008,24 +3008,26 @@ const SelectAllCheckbox = memo(function SelectAllCheckbox2({
3008
3008
  childrenWithProps
3009
3009
  ] });
3010
3010
  });
3011
- const outerTableContainer = "_outerTableContainer_kx4ca_1";
3012
- const headerContainer = "_headerContainer_kx4ca_13";
3013
- const tableTopContainer = "_tableTopContainer_kx4ca_17";
3014
- const tableContainer = "_tableContainer_kx4ca_21";
3015
- const searchContainer = "_searchContainer_kx4ca_26";
3016
- const columnFilterSelect = "_columnFilterSelect_kx4ca_36";
3017
- const table = "_table_kx4ca_17";
3018
- const tableHeaderCell = "_tableHeaderCell_kx4ca_54";
3019
- const showSortIcon = "_showSortIcon_kx4ca_70";
3020
- const tableRow = "_tableRow_kx4ca_74";
3021
- const tableCell = "_tableCell_kx4ca_89";
3022
- const noDataTextContainer = "_noDataTextContainer_kx4ca_99";
3023
- const tableBottomContainer = "_tableBottomContainer_kx4ca_105";
3024
- const rowsPerPageContainer = "_rowsPerPageContainer_kx4ca_109";
3025
- const rowsPerPageText = "_rowsPerPageText_kx4ca_119";
3026
- const pageText = "_pageText_kx4ca_124";
3027
- const descriptionSecondLine = "_descriptionSecondLine_kx4ca_128";
3011
+ const disabled = "_disabled_5i91d_1";
3012
+ const outerTableContainer = "_outerTableContainer_5i91d_5";
3013
+ const headerContainer = "_headerContainer_5i91d_17";
3014
+ const tableTopContainer = "_tableTopContainer_5i91d_21";
3015
+ const tableContainer = "_tableContainer_5i91d_25";
3016
+ const searchContainer = "_searchContainer_5i91d_30";
3017
+ const columnFilterSelect = "_columnFilterSelect_5i91d_40";
3018
+ const table = "_table_5i91d_21";
3019
+ const tableHeaderCell = "_tableHeaderCell_5i91d_58";
3020
+ const showSortIcon = "_showSortIcon_5i91d_74";
3021
+ const tableRow = "_tableRow_5i91d_78";
3022
+ const tableCell = "_tableCell_5i91d_93";
3023
+ const noDataTextContainer = "_noDataTextContainer_5i91d_103";
3024
+ const tableBottomContainer = "_tableBottomContainer_5i91d_109";
3025
+ const rowsPerPageContainer = "_rowsPerPageContainer_5i91d_113";
3026
+ const rowsPerPageText = "_rowsPerPageText_5i91d_123";
3027
+ const pageText = "_pageText_5i91d_128";
3028
+ const descriptionSecondLine = "_descriptionSecondLine_5i91d_132";
3028
3029
  const styles$1 = {
3030
+ disabled,
3029
3031
  outerTableContainer,
3030
3032
  headerContainer,
3031
3033
  tableTopContainer,
@@ -3154,7 +3156,7 @@ const _Table = forwardRef(function Table2(props, ref) {
3154
3156
  })
3155
3157
  )
3156
3158
  ).map((row) => {
3157
- const destructedRow = { ...row.columns, ...row };
3159
+ const destructedRow = { ...row.columns, ...row, disabled: row.disabled };
3158
3160
  const { columns: _, ...newRow } = destructedRow;
3159
3161
  return newRow;
3160
3162
  }),
@@ -3440,23 +3442,29 @@ const _Table = forwardRef(function Table2(props, ref) {
3440
3442
  Row,
3441
3443
  {
3442
3444
  item: row,
3443
- className: classNames(styles$1.tableRow, rowClassName, row.className),
3444
- onClick: row.onClick,
3445
+ className: classNames(styles$1.tableRow, rowClassName, row.className, {
3446
+ [styles$1.disabled]: row.disabled
3447
+ }),
3448
+ onClick: !row.disabled && row.onClick,
3445
3449
  children: [
3446
3450
  showSelect && /* @__PURE__ */ jsx(CellSelect, { item: row }, row.id),
3447
- columns.map((column, i) => /* @__PURE__ */ jsx(
3448
- Cell,
3449
- {
3450
- className: classNames(
3451
- styles$1.tableCell,
3452
- cellClassName,
3453
- row[column.id].className
3454
- ),
3455
- onClick: row[column.id].onClick,
3456
- children: /* @__PURE__ */ jsx(Text$1, { size: "2", children: row[column.id].label })
3457
- },
3458
- i
3459
- ))
3451
+ columns.map((column, i) => {
3452
+ const cell = row[column.id];
3453
+ return /* @__PURE__ */ jsx(
3454
+ Cell,
3455
+ {
3456
+ className: classNames(
3457
+ styles$1.tableCell,
3458
+ cellClassName,
3459
+ cell.className,
3460
+ { [styles$1.disabled]: cell.disabled || column.disabled }
3461
+ ),
3462
+ onClick: cell.disabled || column.disabled ? void 0 : row[column.id].onClick,
3463
+ children: cell.label
3464
+ },
3465
+ i
3466
+ );
3467
+ })
3460
3468
  ]
3461
3469
  },
3462
3470
  row.id