@datum-cloud/datum-ui 0.10.2 → 1.0.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.
@@ -1,13 +1,23 @@
1
1
  import type { VariantProps } from 'class-variance-authority';
2
- export interface EmptyContentAction {
3
- type: 'button' | 'link' | 'external-link';
2
+ import type { AnchorHTMLAttributes, ReactNode } from 'react';
3
+ import type { ButtonProps } from '../../base/button/button';
4
+ /** Shared by every action kind: full Button surface + presentation concerns. */
5
+ interface BaseAction extends Omit<ButtonProps, 'asChild' | 'htmlType' | 'children'> {
4
6
  label: string;
5
- onClick?: () => void;
6
- to?: string;
7
- variant?: 'default' | 'destructive' | 'outline';
8
- icon?: React.ReactNode;
9
- iconPosition?: 'start' | 'end';
7
+ /** Tooltip shown on hover/focus — pairs with `disabled` to explain why (RBAC). */
8
+ tooltip?: ReactNode;
9
+ tooltipSide?: 'top' | 'right' | 'bottom' | 'left';
10
+ /** Skip rendering entirely (e.g. no RBAC permission to even see it). */
11
+ hidden?: boolean;
10
12
  }
13
+ export interface ButtonAction extends BaseAction {
14
+ as?: 'button';
15
+ }
16
+ export interface LinkAction extends BaseAction, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | keyof BaseAction> {
17
+ as: 'link' | 'external-link';
18
+ to: string;
19
+ }
20
+ export type EmptyContentAction = ButtonAction | LinkAction;
11
21
  declare const containerVariants: (props?: ({
12
22
  variant?: "default" | "dashed" | "minimal" | null | undefined;
13
23
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"empty-content.d.ts","sourceRoot":"","sources":["../../../../src/components/features/empty-content/empty-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAS5D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,eAAe,CAAA;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAC/B;AAGD,QAAA,MAAM,iBAAiB;;;;8EA2BtB,CAAA;AAiFD,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,iBAAiB,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC9B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC1C,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oFAAoF;IACpF,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAClC;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAuB,EACvB,QAAQ,EACR,OAAmB,EACnB,IAAW,EACX,SAAS,EACT,OAAY,EACZ,WAAwB,EACxB,OAAkB,EAClB,QAAQ,EACR,aAAa,GACd,EAAE,iBAAiB,+BA8FnB"}
1
+ {"version":3,"file":"empty-content.d.ts","sourceRoot":"","sources":["../../../../src/components/features/empty-content/empty-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAW3D,gFAAgF;AAChF,UAAU,UAAW,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACjD,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,EAAE,CAAC,EAAE,QAAQ,CAAA;CACd;AAED,MAAM,WAAW,UACf,SAAQ,UAAU,EAClB,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,UAAU,CAAC;IACxE,EAAE,EAAE,MAAM,GAAG,eAAe,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAA;AAG1D,QAAA,MAAM,iBAAiB;;;;8EA2BtB,CAAA;AA8FD,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,iBAAiB,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC9B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC1C,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oFAAoF;IACpF,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAClC;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAuB,EACvB,QAAQ,EACR,OAAmB,EACnB,IAAW,EACX,SAAS,EACT,OAAY,EACZ,WAAwB,EACxB,OAAkB,EAClB,QAAQ,EACR,aAAa,GACd,EAAE,iBAAiB,+BAqHnB"}
@@ -1,2 +1,2 @@
1
- import { t as EmptyContent } from "../empty-content-CDYMYCKj.mjs";
1
+ import { t as EmptyContent } from "../empty-content-C4Z0QVfg.mjs";
2
2
  export { EmptyContent };
@@ -1,6 +1,8 @@
1
1
  import { t as cn } from "./cn-dlASUkDY.mjs";
2
2
  import { t as Button } from "./button-B_N7A8gv.mjs";
3
+ import { t as Tooltip } from "./tooltip-BqrOCH8l.mjs";
3
4
  import { cva } from "class-variance-authority";
5
+ import { Fragment } from "react";
4
6
  import { jsx, jsxs } from "react/jsx-runtime";
5
7
  //#region src/components/features/empty-content/assets/milo-stamp.svg
6
8
  var milo_stamp_default = "data:image/svg+xml,<svg width=\"31\" height=\"32\" viewBox=\"0 0 31 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">%0A<path opacity=\"0.12\" d=\"M27.1902 28.0179L16.4448 29.5107L4.37812 27.9436L14.8494 27.3087L27.1902 28.0179Z\" fill=\"black\"/>%0A<path d=\"M13.0963 11.6877C14.7043 14.9839 16.8292 17.9935 18.6849 21.1497C18.7736 21.5347 18.7763 21.9348 18.8252 22.3239C18.8674 22.6637 19.028 23.7378 18.989 23.983C18.9161 24.4481 18.0354 24.9642 17.6277 25.1134C16.7257 25.4456 15.5767 25.6807 14.6304 25.8932C13.8306 25.1273 13.039 24.3119 12.1914 23.5977C11.9708 23.4106 11.6233 23.0054 11.355 23.0437C11.2998 23.0516 11.2084 22.9782 11.163 23.0844C10.623 24.4942 10.1288 25.9397 9.85711 27.427C9.52163 27.6826 9.00036 28.1049 8.87664 28.5148C8.41962 28.4523 7.95449 28.4093 7.49864 28.3375C7.60704 27.8435 7.79108 26.8922 8.42294 26.9604L8.20621 26.4674C8.41963 26.4781 8.63473 26.5338 8.84927 26.5502L8.94065 26.5078L8.98842 26.1945C9.0746 25.8732 8.96699 25.5773 9.00294 25.3559C9.3092 23.4547 9.84286 21.1943 9.88087 19.2586C9.89868 18.3364 9.2645 17.0669 9.22819 16.1153C9.22418 16.0158 9.20329 15.9458 9.28997 15.8673C10.5356 14.5334 11.6319 13.0383 12.9025 11.7282C12.9735 11.6551 13.0899 11.6944 13.0963 11.6877ZM13.5824 20.2485L13.4513 18.3639C13.3263 18.3198 13.2992 18.3556 13.213 18.4304C13.1036 18.5265 12.1361 20.2828 12.0251 20.5356C11.7635 21.1314 11.5187 21.8582 11.4718 22.4984C11.7007 22.244 11.9467 22.0011 12.1754 21.7485C12.8195 21.9677 13.9904 22.5647 14.6394 22.5287C15.1512 22.4993 16.1052 21.6602 16.6795 21.5809C16.6841 21.4433 16.562 21.4201 16.4691 21.3727C16.1152 21.1908 13.8021 20.2245 13.5821 20.2504L13.5824 20.2485Z\" fill=\"%23983223\"/>%0A<mask id=\"mask0_7903_11345\" style=\"mask-type:alpha\" maskUnits=\"userSpaceOnUse\" x=\"8\" y=\"22\" width=\"14\" height=\"8\">%0A<path d=\"M8.6951 28.6662C8.81882 28.2563 9.52262 27.6819 9.8581 27.4262C10.7714 26.7294 11.7076 26.4502 12.815 26.2191C13.4138 26.0944 13.9988 26.0334 14.6314 25.8925C15.5795 25.6802 16.7267 25.4449 17.6286 25.1127C18.0363 24.9634 18.9171 24.4473 18.99 23.9823C19.029 23.737 18.8686 22.6611 18.8262 22.3232C21.2601 22.3357 21.9187 24.9979 20.899 26.8839C20.002 28.5428 17.6604 29.6666 15.8131 29.5802C13.6111 29.4781 10.9258 28.9663 8.69533 28.6644L8.6951 28.6662Z\" fill=\"%23591D14\"/>%0A</mask>%0A<g mask=\"url(%23mask0_7903_11345)\">%0A<path d=\"M8.6951 28.6662C8.81882 28.2563 9.52262 27.6819 9.8581 27.4262C10.7714 26.7294 11.7076 26.4502 12.815 26.2191C13.4138 26.0944 13.9988 26.0334 14.6314 25.8925C15.5795 25.6802 16.7267 25.4449 17.6286 25.1127C18.0363 24.9634 18.9171 24.4473 18.99 23.9823C19.029 23.737 18.8686 22.6611 18.8262 22.3232C21.2601 22.3357 21.9187 24.9979 20.899 26.8839C20.002 28.5428 17.6604 29.6666 15.8131 29.5802C13.6111 29.4781 10.9258 28.9663 8.69533 28.6644L8.6951 28.6662Z\" fill=\"%23591D14\"/>%0A<path d=\"M21.7949 24.2123C21.7949 24.2123 20.8311 27.6822 17.9009 28.4147C14.9708 29.1473 13.3129 28.7617 11.8093 28.6075C10.3057 28.4533 7.56832 28.7617 7.56832 28.7617L19.019 34.7762L21.7949 24.2123Z\" fill=\"%2340150F\"/>%0A</g>%0A<path d=\"M11.3557 23.0432L12.8148 26.2193C11.7073 26.4504 10.7712 26.7296 9.85782 27.4264C10.1295 25.9392 10.6221 24.4915 11.1637 23.0838C11.2109 22.9778 11.3005 23.051 11.3557 23.0432Z\" fill=\"%23BEA284\"/>%0A<path d=\"M13.5825 20.2479C13.8025 20.2221 16.1156 21.1883 16.4695 21.3702C16.5624 21.4177 16.6843 21.4427 16.6799 21.5785C16.1056 21.6577 15.1516 22.4969 14.6398 22.5263C13.9905 22.5641 12.8199 21.9652 12.1757 21.746C12.6348 21.241 13.0337 20.6666 13.5828 20.2461L13.5825 20.2479Z\" fill=\"%23C47C4E\"/>%0A<path d=\"M14.6297 25.8925C13.9971 26.0334 13.4121 26.0945 12.8133 26.2192L11.3543 23.043C11.6225 23.0047 11.9701 23.4099 12.1907 23.597C13.0383 24.3112 13.828 25.1263 14.6297 25.8925Z\" fill=\"%23B7443F\"/>%0A<path d=\"M12.1754 21.7485C11.947 21.9993 11.7007 22.244 11.4719 22.4985C11.5185 21.8601 11.7633 21.1333 12.0251 20.5357C12.1361 20.2829 13.1036 18.5265 13.2131 18.4304C13.2993 18.3556 13.3244 18.3196 13.4513 18.3639L13.5824 20.2486C13.0333 20.6691 12.6344 21.2435 12.1754 21.7485Z\" fill=\"%23B7443F\"/>%0A<path d=\"M3.63342 10.4694C5.39176 11.0729 7.17567 10.8972 8.98325 10.9729L9.28932 15.8665C9.20264 15.945 9.22353 16.015 9.22753 16.1145C9.26384 17.0661 9.89803 18.3356 9.88022 19.2578C9.84221 21.1935 9.30671 23.4537 9.00229 25.3551C8.91402 24.7928 8.35266 23.6541 8.37263 23.1505C8.38997 22.7399 8.79753 22.374 8.7713 21.9392C8.75961 21.7397 8.51385 21.2691 8.41953 21.0441C8.36372 20.9118 8.42796 20.7463 8.19352 20.7685C8.23548 20.602 8.4602 20.4087 8.27657 20.1665C7.64523 19.383 7.04866 18.576 6.43391 17.7796C6.34746 17.6677 6.18927 17.6342 6.17326 17.6135C6.00036 17.3895 4.9165 15.8698 4.92048 15.7228L6.45934 12.458L5.97174 11.0654C5.80195 10.9333 4.24487 11.2914 3.85808 11.2491C3.51356 11.2123 3.37522 11.0245 3.11866 10.8701L3.6371 10.4699L3.63342 10.4694Z\" fill=\"%23BEA284\"/>%0A<path d=\"M11.1538 8.6355C12.0633 8.99907 12.9006 9.50277 13.7915 9.90878C13.9803 9.9947 14.1082 10.1475 14.3191 10.1634C14.3268 10.1906 14.4199 10.2362 14.3953 10.3115C14.3608 10.5218 13.7234 10.9609 13.5415 11.1411C13.3704 11.3096 13.2224 11.5595 13.0937 11.6886C13.0873 11.6952 12.9712 11.6542 12.8999 11.729C11.6293 13.0392 10.533 14.5343 9.28737 15.8682L8.9813 10.9745C7.17165 10.9005 5.38774 11.0762 3.63148 10.4711C3.66871 10.3414 3.796 10.1505 3.78244 10.0236C3.85546 10.0367 3.93432 9.96094 3.978 9.95535C6.3884 9.61366 8.75796 9.06686 11.1517 8.6371L11.1538 8.6355Z\" fill=\"%23F7E6CA\"/>%0A<path d=\"M8.19201 20.7688C8.13839 20.9823 8.08181 21.1898 8.0174 21.4001L5.87814 22.0587C5.8969 21.8258 5.85979 21.4755 5.87492 21.3579L6.08769 19.7043C6.09195 19.6712 6.01729 19.5402 6.02714 19.4201C6.07689 18.8157 6.25388 18.224 6.16992 17.6136C6.18593 17.6344 6.34413 17.6678 6.43058 17.7798C7.04556 18.5743 7.64372 19.3834 8.27323 20.1667C8.4587 20.4091 8.23213 20.6022 8.19017 20.7686L8.19201 20.7688Z\" fill=\"%23B7443F\"/>%0A<path d=\"M6.61115 25.7951C6.29036 25.6754 5.79838 25.6233 5.6479 25.2976C5.80136 24.3518 5.79385 23.0602 5.87789 22.0587L8.01716 21.4001C7.56838 22.8701 7.04937 24.32 6.61115 25.7951Z\" fill=\"%23983223\"/>%0A<path d=\"M5.64781 25.2972C5.79828 25.6229 6.29027 25.675 6.61106 25.7947C6.38055 26.5701 6.05569 27.3239 6.02812 28.1478L3.54773 27.8286C3.6412 27.5231 4.01677 26.8542 4.2569 26.6573C4.55972 26.4086 5.16901 26.4926 5.27949 26.3742C5.31848 26.3325 5.62971 25.4088 5.64781 25.2972Z\" fill=\"%23B7443F\"/>%0A<path d=\"M8.20616 26.4667L8.42289 26.9597C7.79103 26.8914 7.60723 27.8409 7.49859 28.3368C7.19294 28.2881 6.87007 28.3008 6.58169 28.1759C6.39886 28.0291 6.89779 27.1127 7.04157 26.9388C7.40874 26.4949 7.67181 26.4391 8.208 26.467L8.20616 26.4667Z\" fill=\"%23B7443F\"/>%0A<path d=\"M8.85011 26.5495C8.78657 26.39 8.98508 26.2119 8.98928 26.1938L8.94149 26.5071L8.85011 26.5495Z\" fill=\"%23C1A17F\"/>%0A<path d=\"M6.19939 2.8617C6.42593 3.4381 6.69064 4.0082 6.81757 4.61848C6.99346 4.77559 8.22358 3.91034 8.42513 3.70841L8.517 3.72023L9.14824 3.89484C9.16798 4.40915 8.72163 5.84591 8.98431 6.21404L13.7909 9.90869C12.8999 9.50268 12.0626 8.99898 11.1531 8.63541C10.7251 8.30391 9.05156 6.67842 8.65512 6.63862C8.25867 6.59881 7.65627 7.53549 7.51392 7.88699C7.45282 7.88286 7.39153 7.86564 7.33019 7.86335C7.01086 7.84841 6.35946 7.8449 6.10046 7.98528C5.75373 7.92199 5.38794 7.91975 5.04216 7.84911C4.90738 7.82243 4.76653 7.88648 4.83182 7.68383C5.40291 7.01955 6.42893 6.36151 6.92563 5.68019C7.22975 5.26172 7.0202 5.1339 6.8473 4.7213C6.50873 4.94295 6.15138 5.33963 5.76673 5.46944C5.53046 5.54924 5.60575 5.44312 5.5107 5.29641C5.57464 4.45108 5.32895 3.00745 5.26953 2.09021L6.19732 2.8633L6.19939 2.8617Z\" fill=\"%23983223\"/>%0A<path d=\"M10.435 4.06019L9.53404 4.87814L12.3324 6.73241C12.8256 7.79138 13.9992 9.07798 14.319 10.1632C14.1082 10.1473 13.9803 9.99448 13.7915 9.90855L8.98489 6.2139C8.72197 5.84761 9.16856 4.40901 9.14882 3.8947L8.51758 3.72009L10.435 4.06019Z\" fill=\"%23C47C4E\"/>%0A<path d=\"M12.8101 5.20601C12.6983 5.69778 12.4415 6.22694 12.3336 6.73228L9.53519 4.87801L10.4361 4.06006C11.4399 3.32818 12.4403 2.57906 13.4312 1.83059C13.6029 1.94794 13.4523 2.16016 13.4183 2.294C13.1839 3.25934 13.0165 4.29869 12.8101 5.20601Z\" fill=\"%23983223\"/>%0A<path d=\"M5.51262 5.29453C5.60584 5.441 5.53032 5.54895 5.76866 5.46756C6.1533 5.33775 6.51066 4.94107 6.84922 4.71941C7.02029 5.13179 7.23168 5.25984 6.92756 5.67831C6.43245 6.3617 5.40644 7.01974 4.83375 7.68195C4.76845 7.8846 4.90747 7.82031 5.04408 7.84722C5.38987 7.91786 5.75566 7.92011 6.10239 7.9834C5.61478 8.24564 5.07515 9.04285 4.53095 9.32396L3.98136 9.95178C3.93769 9.95737 3.85883 10.0331 3.78581 10.02C3.76494 9.81934 3.07678 9.43382 2.83438 9.43065C3.06431 8.8775 4.30665 8.38177 4.56135 7.97002C4.83986 7.51837 4.57561 6.75595 4.7373 6.26873C4.87133 5.86573 5.46602 5.91797 5.5147 5.29293L5.51262 5.29453Z\" fill=\"%23C47C4E\"/>%0A<path d=\"M8.42566 3.70809C8.22595 3.91026 6.994 4.77527 6.8181 4.61816C6.69117 4.00788 6.4267 3.43594 6.19992 2.86138C5.88731 2.06845 5.64449 1.2266 5.19749 0.491093C5.31647 0.248653 5.6709 0.658472 5.7689 0.753263C6.70812 1.66977 7.53763 2.74213 8.42566 3.70809Z\" fill=\"%2340150F\"/>%0A<path d=\"M2.8339 9.43269C3.0763 9.43586 3.76445 9.82138 3.78533 10.022C3.79888 10.1489 3.67159 10.3399 3.63436 10.4696L3.11592 10.8698C2.96873 10.7799 2.78216 10.7783 2.63039 10.6224C2.24602 10.2274 2.03754 9.42361 2.8339 9.43269Z\" fill=\"black\"/>%0A<path d=\"M12.8101 5.20649C13.0181 4.30124 13.1836 3.26166 13.4182 2.29447C13.4507 2.15856 13.6028 1.94841 13.4312 1.83107C13.6132 1.69386 13.7903 1.4645 14.0074 1.34488C13.8051 2.64122 13.2656 3.95954 12.8101 5.20649Z\" fill=\"%23C47C4E\"/>%0A<path d=\"M6.20082 2.86228L5.27304 2.08919C5.25348 1.77663 5.10185 0.690636 5.19838 0.492001C5.64539 1.22751 5.88821 2.06936 6.20082 2.86228Z\" fill=\"%23BF3D36\"/>%0A<path d=\"M11.1545 8.63562C8.76076 9.06538 6.39121 9.61218 3.9808 9.95388L4.53039 9.32606C5.07459 9.04494 5.61422 8.24774 6.10183 7.98549C6.36083 7.84512 7.01222 7.84862 7.33155 7.86356C7.35051 8.02102 6.72874 8.46959 7.11077 8.49074C7.298 8.50175 7.888 8.5179 8.02709 8.49657C8.17767 8.47299 8.61592 8.07178 8.29799 7.98791C8.08657 7.93269 7.74637 7.90573 7.51528 7.8872C7.65764 7.5357 8.27314 6.59885 8.65648 6.63883C9.03983 6.67882 10.7283 8.30436 11.1545 8.63562Z\" fill=\"%23B7443F\"/>%0A<path d=\"M7.51478 7.88671C7.74586 7.90524 8.0863 7.93036 8.29748 7.98742C8.61358 8.07105 8.1774 8.47066 8.02658 8.49608C7.88933 8.51764 7.29933 8.5015 7.11027 8.49024C6.72823 8.4691 7.35001 8.02053 7.33105 7.86307C7.39239 7.86536 7.45368 7.88258 7.51478 7.88671Z\" fill=\"black\"/>%0A</svg>%0A";
@@ -97,40 +99,52 @@ const BUTTON_SIZE_MAP = {
97
99
  lg: "default",
98
100
  xl: "default"
99
101
  };
102
+ const BUTTON_SIZE_TO_CONTAINER = {
103
+ xs: "xs",
104
+ small: "sm",
105
+ default: "lg",
106
+ large: "xl",
107
+ icon: "md",
108
+ link: "md"
109
+ };
100
110
  function EmptyContent({ title = "No data found", subtitle, variant = "default", size = "md", className, actions = [], orientation = "vertical", spacing = "normal", userName, linkComponent }) {
101
111
  const buttonSize = BUTTON_SIZE_MAP[size ?? "md"];
102
112
  const LinkComp = linkComponent || "a";
113
+ const visibleActions = actions.filter((action) => !action.hidden);
103
114
  const renderAction = (action) => {
104
- const { icon: actionIcon, iconPosition = "start" } = action;
105
- const buttonContent = /* @__PURE__ */ jsxs(Button, {
106
- size: buttonSize,
107
- type: action.variant === "destructive" ? "danger" : "secondary",
108
- theme: action.variant === "outline" ? "outline" : "solid",
109
- className: actionButtonVariants({ size }),
110
- children: [
111
- actionIcon && iconPosition === "start" && actionIcon,
112
- /* @__PURE__ */ jsx("span", { children: action.label }),
113
- actionIcon && iconPosition === "end" && actionIcon
114
- ]
115
+ const renderAsLink = (action.as === "link" || action.as === "external-link") && !action.disabled;
116
+ const { as: _as, label, tooltip, tooltipSide, hidden: _hidden, to, target, rel, download, hrefLang, referrerPolicy, ping, type = "secondary", size: sizeOverride, className: actionClassName, ...buttonProps } = action;
117
+ const resolvedSize = sizeOverride ?? buttonSize;
118
+ const button = /* @__PURE__ */ jsx(Button, {
119
+ type,
120
+ size: resolvedSize,
121
+ className: cn(actionButtonVariants({ size: BUTTON_SIZE_TO_CONTAINER[resolvedSize ?? "xs"] ?? "md" }), actionClassName),
122
+ ...buttonProps,
123
+ children: label
124
+ });
125
+ let control = button;
126
+ if (renderAsLink) {
127
+ const isExternal = action.as === "external-link";
128
+ control = /* @__PURE__ */ jsx(LinkComp, {
129
+ ...LinkComp === "a" ? { href: to ?? "" } : { to: to ?? "" },
130
+ target: target ?? (isExternal ? "_blank" : "_self"),
131
+ rel: isExternal ? "noopener noreferrer" : rel,
132
+ download,
133
+ hrefLang,
134
+ referrerPolicy,
135
+ ping,
136
+ children: button
137
+ });
138
+ }
139
+ if (tooltip) control = /* @__PURE__ */ jsx(Tooltip, {
140
+ message: tooltip,
141
+ side: tooltipSide,
142
+ children: /* @__PURE__ */ jsx("span", {
143
+ className: "inline-flex",
144
+ children: control
145
+ })
115
146
  });
116
- if (action.type === "link" || action.type === "external-link") return /* @__PURE__ */ jsx(LinkComp, {
117
- ...LinkComp === "a" ? { href: action.to ?? "" } : { to: action.to ?? "" },
118
- target: action.type === "external-link" ? "_blank" : "_self",
119
- rel: action.type === "external-link" ? "noopener noreferrer" : void 0,
120
- children: buttonContent
121
- }, action.label);
122
- return /* @__PURE__ */ jsxs(Button, {
123
- size: buttonSize,
124
- onClick: action.onClick,
125
- type: action.variant === "destructive" ? "danger" : "secondary",
126
- theme: action.variant === "outline" ? "outline" : "solid",
127
- className: actionButtonVariants({ size }),
128
- children: [
129
- actionIcon && iconPosition === "start" && actionIcon,
130
- /* @__PURE__ */ jsx("span", { children: action.label }),
131
- actionIcon && iconPosition === "end" && actionIcon
132
- ]
133
- }, action.label);
147
+ return /* @__PURE__ */ jsx(Fragment, { children: control }, `${action.as ?? "button"}-${label}`);
134
148
  };
135
149
  return /* @__PURE__ */ jsxs("div", {
136
150
  className: cn(containerVariants({
@@ -168,12 +182,12 @@ function EmptyContent({ title = "No data found", subtitle, variant = "default",
168
182
  className: subtitleVariants({ size }),
169
183
  children: subtitle
170
184
  }),
171
- actions.length > 0 && /* @__PURE__ */ jsx("div", {
185
+ visibleActions.length > 0 && /* @__PURE__ */ jsx("div", {
172
186
  className: actionsContainerVariants({
173
187
  size,
174
188
  spacing
175
189
  }),
176
- children: actions.map(renderAction)
190
+ children: visibleActions.map(renderAction)
177
191
  }),
178
192
  /* @__PURE__ */ jsx("img", {
179
193
  src: milo_stamp_default,
package/dist/index.mjs CHANGED
@@ -52,7 +52,7 @@ import { a as formatJson, c as isValidYaml, d as CodeEditor, i as CodeEditorTabs
52
52
  import { t as toast } from "./toast-qSJgeN-g.mjs";
53
53
  import { n as Toaster, t as useToast } from "./toast-0C5jhuto.mjs";
54
54
  import { i as FileInputButton, n as DropzoneContent, r as DropzoneEmptyState, t as Dropzone } from "./dropzone-ZJhq4Ec9.mjs";
55
- import { t as EmptyContent } from "./empty-content-CDYMYCKj.mjs";
55
+ import { t as EmptyContent } from "./empty-content-C4Z0QVfg.mjs";
56
56
  import { A as FormCheckbox, C as FormDialog, D as FormCustom, E as FormDatePicker, M as FormAutosearch, N as FormAutocomplete, O as FormCopyBox, S as FormError, T as FormDateTimePicker, _ as FormRadioGroup, a as useField, b as FormFieldArray, c as useWatchAll, d as FormTextarea, f as FormSwitch, g as FormRoot, h as FormSelectItem, i as useFieldContext, j as FormButton, k as FormCombobox, l as FormTransfer, m as FormSelect, n as useFormState, o as FormWhen, p as FormSubmit, r as useFormContext, s as useWatch, t as Form, u as FormTimePicker, v as FormRadioItem, w as FormDescription, x as FormField, y as FormInput } from "./form-De6Tukoy.mjs";
57
57
  import { t as useCopyToClipboard } from "./use-copy-to-clipboard-BOCe6C1j.mjs";
58
58
  import { n as useAdapter, t as FormAdapterProvider } from "./adapter-context-h0jCVqGO.mjs";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datum-cloud/datum-ui",
3
3
  "type": "module",
4
- "version": "0.10.2",
4
+ "version": "1.0.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "url": "https://github.com/datum-cloud/datum-ui"