@overmap-ai/blocks 1.0.40-TableStyling.0 → 1.0.40-TableStyling.2

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.
@@ -1,6 +1,6 @@
1
1
  import { AccentColorProps } from '../typings';
2
2
  import { ExternalToast } from './typings';
3
- export interface CustomToastProps extends Pick<ExternalToast, "title" | "description" | "icon">, AccentColorProps {
3
+ export interface CustomToastProps extends Pick<ExternalToast, "title" | "description" | "icon" | "closeButton" | "action">, AccentColorProps {
4
4
  toastId: string | number;
5
5
  }
6
6
  export declare const CustomToast: import('react').NamedExoticComponent<CustomToastProps>;
@@ -0,0 +1,12 @@
1
+ import { ExternalToast } from './typings';
2
+ export declare const toast: ((options: ExternalToast) => string | number) & {
3
+ success: (options: ExternalToast) => string | number;
4
+ info: (options: ExternalToast) => string | number;
5
+ warning: (options: ExternalToast) => string | number;
6
+ error: (options: ExternalToast) => string | number;
7
+ custom: (jsx: (id: string | number) => import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>, data?: import('sonner').ExternalToast | undefined) => string | number;
8
+ dismiss: (id?: string | number | undefined) => string | number;
9
+ } & {
10
+ getHistory: () => (import('sonner').ToastT | import('sonner').ToastToDismiss)[];
11
+ getToasts: () => (import('sonner').ToastT | import('sonner').ToastToDismiss)[];
12
+ };
@@ -1,5 +1,7 @@
1
+ import { ReactNode } from 'react';
1
2
  import { ExternalToast as SonnerExternalToast } from 'sonner';
2
- export interface ExternalToast extends Omit<SonnerExternalToast, "richColors" | "unstyled" | "descriptionClassName" | "cancelButtonStyle" | "actionButtonStyle" | "action" | "cancel" | "closeButton" | "description" | "title"> {
3
+ export interface ExternalToast extends Omit<SonnerExternalToast, "richColors" | "unstyled" | "descriptionClassName" | "cancelButtonStyle" | "actionButtonStyle" | "action" | "cancel" | "description" | "title"> {
3
4
  title: string;
5
+ action?: ReactNode;
4
6
  description?: string;
5
7
  }
package/dist/blocks.js CHANGED
@@ -6098,8 +6098,11 @@ const TextArea = memo((props) => {
6098
6098
  });
6099
6099
  TextArea.displayName = "TextArea";
6100
6100
  const CustomToast = memo((props) => {
6101
- const { toastId, title, description, icon, accentColor } = props;
6101
+ const { toastId, title, description, icon, accentColor, closeButton, action } = props;
6102
6102
  const { radius } = useProvider();
6103
+ const handleAction = useCallback(() => {
6104
+ toast$1.dismiss(toastId);
6105
+ }, [toastId]);
6103
6106
  const handleClose = useCallback(() => {
6104
6107
  toast$1.dismiss(toastId);
6105
6108
  }, [toastId]);
@@ -6107,7 +6110,7 @@ const CustomToast = memo((props) => {
6107
6110
  "div",
6108
6111
  {
6109
6112
  className: cx(
6110
- "flex items-center gap-2 bg-(--base-2) p-4 ring ring-(--base-6) shadow-md max-w-full max-h-full",
6113
+ "flex items-center gap-2 bg-(--base-2) p-4 ring ring-(--base-6) shadow-md max-w-full max-h-full",
6111
6114
  radiusCva({ radius, maxLarge: true })
6112
6115
  ),
6113
6116
  "data-accent-color": accentColor,
@@ -6119,7 +6122,8 @@ const CustomToast = memo((props) => {
6119
6122
  description && /* @__PURE__ */ jsx(Text, { accentColor: "base", size: "sm", weight: "regular", children: description })
6120
6123
  ] })
6121
6124
  ] }),
6122
- /* @__PURE__ */ jsx(
6125
+ /* @__PURE__ */ jsx(Slot, { onClick: handleAction, children: action }),
6126
+ closeButton && /* @__PURE__ */ jsx(
6123
6127
  IconButton,
6124
6128
  {
6125
6129
  type: "button",
@@ -6127,7 +6131,7 @@ const CustomToast = memo((props) => {
6127
6131
  "aria-label": "Close",
6128
6132
  accentColor: "base",
6129
6133
  variant: "ghost",
6130
- size: "sm",
6134
+ size: "xs",
6131
6135
  children: /* @__PURE__ */ jsx(LuIcon, { icon: X })
6132
6136
  }
6133
6137
  )
@@ -6136,37 +6140,119 @@ const CustomToast = memo((props) => {
6136
6140
  );
6137
6141
  });
6138
6142
  const basic = (options) => {
6139
- const { icon, description, title, ...rest } = options;
6143
+ const { icon, description, title, closeButton, action, ...rest } = options;
6140
6144
  return toast$1.custom(
6141
- (id) => /* @__PURE__ */ jsx(CustomToast, { toastId: id, icon, description, title }),
6145
+ (id) => /* @__PURE__ */ jsx(
6146
+ CustomToast,
6147
+ {
6148
+ toastId: id,
6149
+ icon,
6150
+ description,
6151
+ title,
6152
+ closeButton,
6153
+ action
6154
+ }
6155
+ ),
6142
6156
  rest
6143
6157
  );
6144
6158
  };
6145
6159
  const success = (options) => {
6146
- const { icon = /* @__PURE__ */ jsx(LuIcon, { icon: Check, color: "var(--accent-9)" }), description, title, ...rest } = options;
6160
+ const {
6161
+ icon = /* @__PURE__ */ jsx(LuIcon, { icon: Check, color: "var(--accent-9)" }),
6162
+ description,
6163
+ title,
6164
+ closeButton,
6165
+ action,
6166
+ ...rest
6167
+ } = options;
6147
6168
  return toast$1.custom(
6148
- (id) => /* @__PURE__ */ jsx(CustomToast, { accentColor: "success", toastId: id, icon, description, title }),
6169
+ (id) => /* @__PURE__ */ jsx(
6170
+ CustomToast,
6171
+ {
6172
+ accentColor: "success",
6173
+ toastId: id,
6174
+ icon,
6175
+ description,
6176
+ title,
6177
+ closeButton,
6178
+ action
6179
+ }
6180
+ ),
6149
6181
  rest
6150
6182
  );
6151
6183
  };
6152
6184
  const info = (options) => {
6153
- const { icon = /* @__PURE__ */ jsx(LuIcon, { icon: InfoIcon, color: "var(--base-11)" }), description, title, ...rest } = options;
6185
+ const {
6186
+ icon = /* @__PURE__ */ jsx(LuIcon, { icon: InfoIcon, color: "var(--base-11)" }),
6187
+ description,
6188
+ title,
6189
+ closeButton,
6190
+ action,
6191
+ ...rest
6192
+ } = options;
6154
6193
  return toast$1.custom(
6155
- (id) => /* @__PURE__ */ jsx(CustomToast, { toastId: id, icon, description, title }),
6194
+ (id) => /* @__PURE__ */ jsx(
6195
+ CustomToast,
6196
+ {
6197
+ accentColor: "base",
6198
+ toastId: id,
6199
+ icon,
6200
+ description,
6201
+ title,
6202
+ closeButton,
6203
+ action
6204
+ }
6205
+ ),
6156
6206
  rest
6157
6207
  );
6158
6208
  };
6159
6209
  const warning = (options) => {
6160
- const { icon = /* @__PURE__ */ jsx(LuIcon, { icon: TriangleAlertIcon, color: "var(--accent-9)" }), description, title, ...rest } = options;
6210
+ const {
6211
+ icon = /* @__PURE__ */ jsx(LuIcon, { icon: TriangleAlertIcon, color: "var(--accent-9)" }),
6212
+ description,
6213
+ title,
6214
+ closeButton,
6215
+ action,
6216
+ ...rest
6217
+ } = options;
6161
6218
  return toast$1.custom(
6162
- (id) => /* @__PURE__ */ jsx(CustomToast, { accentColor: "warning", toastId: id, icon, description, title }),
6219
+ (id) => /* @__PURE__ */ jsx(
6220
+ CustomToast,
6221
+ {
6222
+ accentColor: "warning",
6223
+ toastId: id,
6224
+ icon,
6225
+ description,
6226
+ title,
6227
+ closeButton,
6228
+ action
6229
+ }
6230
+ ),
6163
6231
  rest
6164
6232
  );
6165
6233
  };
6166
6234
  const error = (options) => {
6167
- const { icon = /* @__PURE__ */ jsx(LuIcon, { icon: CircleAlertIcon, color: "var(--accent-9)" }), description, title, ...rest } = options;
6235
+ const {
6236
+ icon = /* @__PURE__ */ jsx(LuIcon, { icon: CircleAlertIcon, color: "var(--accent-9)" }),
6237
+ description,
6238
+ title,
6239
+ closeButton,
6240
+ action,
6241
+ ...rest
6242
+ } = options;
6168
6243
  return toast$1.custom(
6169
- (id) => /* @__PURE__ */ jsx(CustomToast, { accentColor: "danger", toastId: id, icon, description, title }),
6244
+ (id) => /* @__PURE__ */ jsx(
6245
+ CustomToast,
6246
+ {
6247
+ accentColor: "danger",
6248
+ toastId: id,
6249
+ icon,
6250
+ description,
6251
+ title,
6252
+ closeButton,
6253
+ action
6254
+ }
6255
+ ),
6170
6256
  rest
6171
6257
  );
6172
6258
  };
@@ -6178,8 +6264,6 @@ const toast = Object.assign(
6178
6264
  warning,
6179
6265
  error,
6180
6266
  custom: toast$1.custom,
6181
- promise: toast$1.promise,
6182
- loading: toast$1.loading,
6183
6267
  dismiss: toast$1.dismiss
6184
6268
  },
6185
6269
  { getHistory: toast$1.getHistory, getToasts: toast$1.getToasts }