@bioturing/components 0.46.4 → 0.48.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.
Files changed (139) hide show
  1. package/dist/components/base-menu/component.js +19 -21
  2. package/dist/components/base-menu/component.js.map +1 -1
  3. package/dist/components/base-menu/index.d.ts +1 -1
  4. package/dist/components/base-menu/index.d.ts.map +1 -1
  5. package/dist/components/base-menu/index.js +12 -7
  6. package/dist/components/base-menu/index.js.map +1 -1
  7. package/dist/components/base-menu/item.css +1 -1
  8. package/dist/components/base-menu/item.d.ts +13 -2
  9. package/dist/components/base-menu/item.d.ts.map +1 -1
  10. package/dist/components/base-menu/item.js +62 -47
  11. package/dist/components/base-menu/item.js.map +1 -1
  12. package/dist/components/base-menu/style.css +1 -1
  13. package/dist/components/checkbox/component.d.ts +2 -2
  14. package/dist/components/checkbox/component.d.ts.map +1 -1
  15. package/dist/components/checkbox/component.js.map +1 -1
  16. package/dist/components/choice-list/component.js +12 -12
  17. package/dist/components/combobox/component.d.ts.map +1 -1
  18. package/dist/components/combobox/component.js +121 -121
  19. package/dist/components/combobox/component.js.map +1 -1
  20. package/dist/components/combobox/style.css +1 -1
  21. package/dist/components/data-table/component.d.ts.map +1 -1
  22. package/dist/components/data-table/component.js +99 -79
  23. package/dist/components/data-table/component.js.map +1 -1
  24. package/dist/components/data-table/components/TableBody.d.ts +3 -2
  25. package/dist/components/data-table/components/TableBody.d.ts.map +1 -1
  26. package/dist/components/data-table/components/TableBody.js +106 -89
  27. package/dist/components/data-table/components/TableBody.js.map +1 -1
  28. package/dist/components/data-table/components/TableHeader.d.ts +3 -1
  29. package/dist/components/data-table/components/TableHeader.d.ts.map +1 -1
  30. package/dist/components/data-table/components/TableHeader.js +121 -93
  31. package/dist/components/data-table/components/TableHeader.js.map +1 -1
  32. package/dist/components/data-table/components/TablePagination.d.ts.map +1 -1
  33. package/dist/components/data-table/components/TablePagination.js +36 -31
  34. package/dist/components/data-table/components/TablePagination.js.map +1 -1
  35. package/dist/components/data-table/hooks.d.ts.map +1 -1
  36. package/dist/components/data-table/hooks.js +98 -83
  37. package/dist/components/data-table/hooks.js.map +1 -1
  38. package/dist/components/data-table/style.css +1 -1
  39. package/dist/components/data-table/types.d.ts +1 -1
  40. package/dist/components/data-table/types.d.ts.map +1 -1
  41. package/dist/components/data-table/utils.js +37 -30
  42. package/dist/components/data-table/utils.js.map +1 -1
  43. package/dist/components/data-table/variant-minimal.css +1 -0
  44. package/dist/components/data-table/variant-zebra.css +1 -0
  45. package/dist/components/dialog/Dialog.js +46 -46
  46. package/dist/components/dialog/Dialog.js.map +1 -1
  47. package/dist/components/dialog/dialog.css +1 -1
  48. package/dist/components/dropdown-menu/component.d.ts.map +1 -1
  49. package/dist/components/dropdown-menu/component.js +121 -144
  50. package/dist/components/dropdown-menu/component.js.map +1 -1
  51. package/dist/components/dropdown-menu/index.d.ts +2 -0
  52. package/dist/components/dropdown-menu/index.d.ts.map +1 -1
  53. package/dist/components/dropdown-menu/item.d.ts +7 -15
  54. package/dist/components/dropdown-menu/item.d.ts.map +1 -1
  55. package/dist/components/dropdown-menu/item.js +132 -81
  56. package/dist/components/dropdown-menu/item.js.map +1 -1
  57. package/dist/components/dropdown-menu/radio-group.d.ts +14 -0
  58. package/dist/components/dropdown-menu/radio-group.d.ts.map +1 -0
  59. package/dist/components/dropdown-menu/radio-group.js +45 -0
  60. package/dist/components/dropdown-menu/radio-group.js.map +1 -0
  61. package/dist/components/dropdown-menu/search-mode.d.ts +4 -0
  62. package/dist/components/dropdown-menu/search-mode.d.ts.map +1 -0
  63. package/dist/components/dropdown-menu/search-mode.js +6 -0
  64. package/dist/components/dropdown-menu/search-mode.js.map +1 -0
  65. package/dist/components/dropdown-menu/style.css +1 -1
  66. package/dist/components/dropdown-menu/submenu.d.ts +25 -0
  67. package/dist/components/dropdown-menu/submenu.d.ts.map +1 -0
  68. package/dist/components/dropdown-menu/submenu.js +96 -0
  69. package/dist/components/dropdown-menu/submenu.js.map +1 -0
  70. package/dist/components/dropdown-menu/types.d.ts +85 -12
  71. package/dist/components/dropdown-menu/types.d.ts.map +1 -1
  72. package/dist/components/dropdown-menu/useDropdownMenu.d.ts +4 -8
  73. package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
  74. package/dist/components/dropdown-menu/useDropdownMenu.js +108 -81
  75. package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
  76. package/dist/components/form/FormItem/ItemHolder.d.ts +6 -5
  77. package/dist/components/form/FormItem/ItemHolder.d.ts.map +1 -1
  78. package/dist/components/form/FormItem/ItemHolder.js +32 -29
  79. package/dist/components/form/FormItem/ItemHolder.js.map +1 -1
  80. package/dist/components/form/FormItem/index.d.ts +6 -0
  81. package/dist/components/form/FormItem/index.d.ts.map +1 -1
  82. package/dist/components/form/FormItem/index.js +138 -127
  83. package/dist/components/form/FormItem/index.js.map +1 -1
  84. package/dist/components/form/FormValidationContext.d.ts +5 -0
  85. package/dist/components/form/FormValidationContext.d.ts.map +1 -0
  86. package/dist/components/form/FormValidationContext.js +7 -0
  87. package/dist/components/form/FormValidationContext.js.map +1 -0
  88. package/dist/components/form/component.d.ts +6 -1
  89. package/dist/components/form/component.d.ts.map +1 -1
  90. package/dist/components/form/component.js +30 -20
  91. package/dist/components/form/component.js.map +1 -1
  92. package/dist/components/form/formValidationRule.d.ts +19 -0
  93. package/dist/components/form/formValidationRule.d.ts.map +1 -0
  94. package/dist/components/form/formValidationRule.js +22 -0
  95. package/dist/components/form/formValidationRule.js.map +1 -0
  96. package/dist/components/form/index.d.ts +2 -0
  97. package/dist/components/form/index.d.ts.map +1 -1
  98. package/dist/components/form/useFormValidation.d.ts +3 -0
  99. package/dist/components/form/useFormValidation.d.ts.map +1 -0
  100. package/dist/components/form/useFormValidation.js +18 -0
  101. package/dist/components/form/useFormValidation.js.map +1 -0
  102. package/dist/components/index.d.ts +2 -0
  103. package/dist/components/index.d.ts.map +1 -1
  104. package/dist/components/keyboard-shortcut/component.d.ts +2 -0
  105. package/dist/components/keyboard-shortcut/component.d.ts.map +1 -1
  106. package/dist/components/keyboard-shortcut/component.js +69 -49
  107. package/dist/components/keyboard-shortcut/component.js.map +1 -1
  108. package/dist/components/modal/Modal.d.ts +1 -1
  109. package/dist/components/modal/Modal.js +9 -9
  110. package/dist/components/modal/Modal.js.map +1 -1
  111. package/dist/components/modal/style.css +1 -1
  112. package/dist/components/select/component.js +29 -29
  113. package/dist/components/select/component.js.map +1 -1
  114. package/dist/components/theme-provider/component.d.ts +3 -1
  115. package/dist/components/theme-provider/component.d.ts.map +1 -1
  116. package/dist/components/theme-provider/component.js +32 -31
  117. package/dist/components/theme-provider/component.js.map +1 -1
  118. package/dist/components/theme-provider/context/index.d.ts +2 -1
  119. package/dist/components/theme-provider/context/index.d.ts.map +1 -1
  120. package/dist/components/theme-provider/context/provider.d.ts +2 -3
  121. package/dist/components/theme-provider/context/provider.d.ts.map +1 -1
  122. package/dist/components/theme-provider/context/provider.js +13 -6
  123. package/dist/components/theme-provider/context/provider.js.map +1 -1
  124. package/dist/components/theme-provider/context/themeStore.d.ts +15 -0
  125. package/dist/components/theme-provider/context/themeStore.d.ts.map +1 -1
  126. package/dist/components/theme-provider/context/themeStore.js +10 -9
  127. package/dist/components/theme-provider/context/themeStore.js.map +1 -1
  128. package/dist/components/theme-provider/style.css +1 -1
  129. package/dist/components/tooltip/component.d.ts.map +1 -1
  130. package/dist/components/tooltip/component.js +23 -12
  131. package/dist/components/tooltip/component.js.map +1 -1
  132. package/dist/index.js +273 -258
  133. package/dist/index.js.map +1 -1
  134. package/dist/metadata.d.ts +9 -0
  135. package/dist/metadata.d.ts.map +1 -1
  136. package/dist/metadata.js +14 -0
  137. package/dist/metadata.js.map +1 -1
  138. package/dist/stats.html +1 -1
  139. package/package.json +6 -6
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { createContext as t } from "react";
3
+ const e = t({});
4
+ export {
5
+ e as FormValidationContext
6
+ };
7
+ //# sourceMappingURL=FormValidationContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormValidationContext.js","sources":["../../../src/components/form/FormValidationContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\n\nexport interface FormValidationContextValue {\n ignoreDefaultRules?: string[];\n}\n\nexport const FormValidationContext = createContext<FormValidationContextValue>({});\n"],"names":["FormValidationContext","createContext"],"mappings":";;AAQO,MAAMA,IAAwBC,EAA0C,CAAA,CAAE;"}
@@ -3,10 +3,15 @@ import { default as useFormInstance } from 'antd/es/form/hooks/useFormInstance';
3
3
  import { FormItemProps } from './item';
4
4
  import * as React from "react";
5
5
  export interface FormProps<Values = unknown> extends AntdFormProps<Values> {
6
+ /**
7
+ * Rule keys to ignore from `componentConfig.formValidationRules` for every Form.Item in this Form.
8
+ */
9
+ ignoreDefaultRules?: string[];
6
10
  }
7
11
  interface InternalFormProps<Values = unknown> extends React.ComponentProps<typeof AntdInternalForm<Values>> {
12
+ ignoreDefaultRules?: string[];
8
13
  }
9
- export declare const Form: (<Values = unknown>({ ...rest }: InternalFormProps<Values>) => import("react/jsx-runtime").JSX.Element) & {
14
+ export declare const Form: (<Values = unknown>({ ignoreDefaultRules, ...rest }: InternalFormProps<Values>) => import("react/jsx-runtime").JSX.Element) & {
10
15
  useForm: typeof useForm;
11
16
  useFormInstance: typeof useFormInstance;
12
17
  useWatch: typeof useWatch;
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/form/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,OAAO,IAAI,gBAAgB,EAC3B,OAAO,EACP,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAG3B,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAItD,OAAO,aAAa,CAAC;AAErB,MAA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 +1,36 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import m from "antd/es/form/ErrorList";
4
- import t, { useWatch as e, useForm as i } from "antd/es/form/Form";
5
- import s from "antd/es/form/FormList";
6
- import { FormProvider as n } from "antd/es/form/context";
7
- import p from "antd/es/form/hooks/useFormInstance";
8
- import { FormLabel as F } from "./label.js";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import e from "antd/es/form/ErrorList";
4
+ import n, { useWatch as s, useForm as a } from "antd/es/form/Form";
5
+ import p from "antd/es/form/FormList";
6
+ import { FormProvider as c } from "antd/es/form/context";
7
+ import F from "antd/es/form/hooks/useFormInstance";
8
+ import * as f from "react";
9
+ import { FormValidationContext as d } from "./FormValidationContext.js";
10
+ import { FormLabel as l } from "./label.js";
9
11
  import './style.css';/* empty css */
10
- import f from "./FormItem/index.js";
11
- const a = ({
12
- ...r
13
- }) => /* @__PURE__ */ o(t, { ...r }), x = Object.assign(a, {
14
- useForm: i,
15
- useFormInstance: p,
16
- useWatch: e,
17
- Item: f,
18
- List: s,
19
- ErrorList: m,
20
- Provider: n,
21
- Label: F
12
+ import u from "./FormItem/index.js";
13
+ const v = ({
14
+ ignoreDefaultRules: o,
15
+ ...t
16
+ }) => {
17
+ const m = o?.join(","), i = f.useMemo(
18
+ () => ({ ignoreDefaultRules: o }),
19
+ // eslint-disable-next-line react-hooks/exhaustive-deps
20
+ [m]
21
+ );
22
+ return /* @__PURE__ */ r(d.Provider, { value: i, children: /* @__PURE__ */ r(n, { ...t }) });
23
+ }, A = Object.assign(v, {
24
+ useForm: a,
25
+ useFormInstance: F,
26
+ useWatch: s,
27
+ Item: u,
28
+ List: p,
29
+ ErrorList: e,
30
+ Provider: c,
31
+ Label: l
22
32
  });
23
33
  export {
24
- x as Form
34
+ A as Form
25
35
  };
26
36
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/form/component.tsx"],"sourcesContent":["\"use client\";\nimport ErrorList from \"antd/es/form/ErrorList\";\nimport {\n FormProps as AntdFormProps,\n default as AntdInternalForm,\n useForm,\n useWatch,\n} from \"antd/es/form/Form\";\nimport FormList from \"antd/es/form/FormList\";\nimport { FormProvider } from \"antd/es/form/context\";\nimport useFormInstance from \"antd/es/form/hooks/useFormInstance\";\nimport * as React from \"react\";\nimport { FormItem, type FormItemProps } from \"./item\";\nimport { FormLabel } from \"./label\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface FormProps<Values = unknown> extends AntdFormProps<Values> {}\n\ninterface InternalFormProps<Values = unknown>\n extends React.ComponentProps<typeof AntdInternalForm<Values>> {}\n\nconst InternalForm = <Values = unknown,>({\n ...rest\n}: InternalFormProps<Values>) => {\n return <AntdInternalForm {...rest} />;\n};\n\nexport const Form = Object.assign(InternalForm, {\n useForm,\n useFormInstance,\n useWatch,\n Item: FormItem,\n List: FormList,\n ErrorList,\n Provider: FormProvider,\n Label: FormLabel,\n});\n\nexport type { FormItemProps };\n"],"names":["InternalForm","rest","jsx","AntdInternalForm","Form","useForm","useFormInstance","useWatch","FormItem","FormList","ErrorList","FormProvider","FormLabel"],"mappings":";;;;;;;;;;AAuBA,MAAMA,IAAe,CAAoB;AAAA,EACvC,GAAGC;AACL,MACS,gBAAAC,EAACC,GAAA,EAAkB,GAAGF,EAAA,CAAM,GAGxBG,IAAO,OAAO,OAAOJ,GAAc;AAAA,EAC9C,SAAAK;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAUC;AAAA,EACV,OAAOC;AACT,CAAC;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/form/component.tsx"],"sourcesContent":["\"use client\";\nimport ErrorList from \"antd/es/form/ErrorList\";\nimport {\n FormProps as AntdFormProps,\n default as AntdInternalForm,\n useForm,\n useWatch,\n} from \"antd/es/form/Form\";\nimport FormList from \"antd/es/form/FormList\";\nimport { FormProvider } from \"antd/es/form/context\";\nimport useFormInstance from \"antd/es/form/hooks/useFormInstance\";\nimport * as React from \"react\";\nimport { FormValidationContext } from \"./FormValidationContext\";\nimport { FormItem, type FormItemProps } from \"./item\";\nimport { FormLabel } from \"./label\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface FormProps<Values = unknown> extends AntdFormProps<Values> {\n /**\n * Rule keys to ignore from `componentConfig.formValidationRules` for every Form.Item in this Form.\n */\n ignoreDefaultRules?: string[];\n}\n\ninterface InternalFormProps<Values = unknown> extends React.ComponentProps<\n typeof AntdInternalForm<Values>\n> {\n ignoreDefaultRules?: string[];\n}\n\nconst InternalForm = <Values = unknown,>({\n ignoreDefaultRules,\n ...rest\n}: InternalFormProps<Values>) => {\n const ignoreKey = ignoreDefaultRules?.join(\",\");\n const validationContext = React.useMemo(\n () => ({ ignoreDefaultRules }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [ignoreKey],\n );\n\n return (\n <FormValidationContext.Provider value={validationContext}>\n <AntdInternalForm {...rest} />\n </FormValidationContext.Provider>\n );\n};\n\nexport const Form = Object.assign(InternalForm, {\n useForm,\n useFormInstance,\n useWatch,\n Item: FormItem,\n List: FormList,\n ErrorList,\n Provider: FormProvider,\n Label: FormLabel,\n});\n\nexport type { FormItemProps };\n"],"names":["InternalForm","ignoreDefaultRules","rest","ignoreKey","validationContext","React","jsx","FormValidationContext","AntdInternalForm","Form","useForm","useFormInstance","useWatch","FormItem","FormList","ErrorList","FormProvider","FormLabel"],"mappings":";;;;;;;;;;;;AAgCA,MAAMA,IAAe,CAAoB;AAAA,EACvC,oBAAAC;AAAA,EACA,GAAGC;AACL,MAAiC;AAC/B,QAAMC,IAAYF,GAAoB,KAAK,GAAG,GACxCG,IAAoBC,EAAM;AAAA,IAC9B,OAAO,EAAE,oBAAAJ,EAAA;AAAA;AAAA,IAET,CAACE,CAAS;AAAA,EAAA;AAGZ,SACE,gBAAAG,EAACC,EAAsB,UAAtB,EAA+B,OAAOH,GACrC,UAAA,gBAAAE,EAACE,GAAA,EAAkB,GAAGN,EAAA,CAAM,EAAA,CAC9B;AAEJ,GAEaO,IAAO,OAAO,OAAOT,GAAc;AAAA,EAC9C,SAAAU;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAUC;AAAA,EACV,OAAOC;AACT,CAAC;"}
@@ -0,0 +1,19 @@
1
+ import { Rule } from 'rc-field-form/lib/interface';
2
+ export declare const BLOCKED_CHARS_RULE_KEY = "blockedChars";
3
+ /**
4
+ * Blocks characters and sequences that are commonly risky in user-entered text:
5
+ * angle brackets (`<`, `>`), quotes (`'`, `"`), ampersand (`&`), backslash (`\\`),
6
+ * slash (`/`), and directory traversal (`..`).
7
+ */
8
+ export declare const DEFAULT_BLOCKED_CHARS_PATTERN: RegExp;
9
+ export declare const DEFAULT_BLOCKED_CHARS_MESSAGE = "This field cannot contain <, >, ', \", &, \\, /, or ..";
10
+ export type FormValidationRule = Rule & {
11
+ key: string;
12
+ sanitize?: (value: unknown) => unknown;
13
+ };
14
+ export declare function createBlockedCharsRule(options?: {
15
+ pattern?: RegExp;
16
+ message?: string;
17
+ }): FormValidationRule;
18
+ export declare const BLOCKED_CHARS_RULE: FormValidationRule;
19
+ //# sourceMappingURL=formValidationRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formValidationRule.d.ts","sourceRoot":"","sources":["../../../src/components/form/formValidationRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,QAAqB,CAAC;AAChE,eAAO,MAAM,6BAA6B,2DACgB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACxC,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,kBAAkB,CAiBrB;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -0,0 +1,22 @@
1
+ const o = "blockedChars", c = /[<>'"&\\/]|\.\./g, i = `This field cannot contain <, >, ', ", &, \\, /, or ..`;
2
+ function E(n) {
3
+ const r = n?.pattern ?? c, s = n?.message ?? i;
4
+ return {
5
+ key: o,
6
+ sanitize: (e) => {
7
+ if (typeof e != "string") return e;
8
+ const t = e.replace(r, "");
9
+ return t === e ? e : t;
10
+ },
11
+ validator: (e, t) => typeof t == "string" && new RegExp(r.source, r.flags).test(t) ? Promise.reject(s) : Promise.resolve()
12
+ };
13
+ }
14
+ const _ = E();
15
+ export {
16
+ _ as BLOCKED_CHARS_RULE,
17
+ o as BLOCKED_CHARS_RULE_KEY,
18
+ i as DEFAULT_BLOCKED_CHARS_MESSAGE,
19
+ c as DEFAULT_BLOCKED_CHARS_PATTERN,
20
+ E as createBlockedCharsRule
21
+ };
22
+ //# sourceMappingURL=formValidationRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formValidationRule.js","sources":["../../../src/components/form/formValidationRule.ts"],"sourcesContent":["import type { Rule } from \"rc-field-form/lib/interface\";\n\nexport const BLOCKED_CHARS_RULE_KEY = \"blockedChars\";\n\n/**\n * Blocks characters and sequences that are commonly risky in user-entered text:\n * angle brackets (`<`, `>`), quotes (`'`, `\"`), ampersand (`&`), backslash (`\\\\`),\n * slash (`/`), and directory traversal (`..`).\n */\nexport const DEFAULT_BLOCKED_CHARS_PATTERN = /[<>'\"&\\\\/]|\\.\\./g;\nexport const DEFAULT_BLOCKED_CHARS_MESSAGE =\n \"This field cannot contain <, >, ', \\\", &, \\\\, /, or ..\";\n\nexport type FormValidationRule = Rule & {\n key: string;\n sanitize?: (value: unknown) => unknown;\n};\n\nexport function createBlockedCharsRule(options?: {\n pattern?: RegExp;\n message?: string;\n}): FormValidationRule {\n const pattern = options?.pattern ?? DEFAULT_BLOCKED_CHARS_PATTERN;\n const message = options?.message ?? DEFAULT_BLOCKED_CHARS_MESSAGE;\n return {\n key: BLOCKED_CHARS_RULE_KEY,\n sanitize: (value: unknown) => {\n if (typeof value !== \"string\") return value;\n const sanitized = value.replace(pattern, \"\");\n return sanitized === value ? value : sanitized;\n },\n validator: (_: unknown, value: unknown) => {\n if (typeof value === \"string\" && new RegExp(pattern.source, pattern.flags).test(value)) {\n return Promise.reject(message);\n }\n return Promise.resolve();\n },\n };\n}\n\nexport const BLOCKED_CHARS_RULE = createBlockedCharsRule();\n"],"names":["BLOCKED_CHARS_RULE_KEY","DEFAULT_BLOCKED_CHARS_PATTERN","DEFAULT_BLOCKED_CHARS_MESSAGE","createBlockedCharsRule","options","pattern","message","value","sanitized","_","BLOCKED_CHARS_RULE"],"mappings":"AAEO,MAAMA,IAAyB,gBAOzBC,IAAgC,oBAChCC,IACX;AAOK,SAASC,EAAuBC,GAGhB;AACrB,QAAMC,IAAUD,GAAS,WAAWH,GAC9BK,IAAUF,GAAS,WAAWF;AACpC,SAAO;AAAA,IACL,KAAKF;AAAA,IACL,UAAU,CAACO,MAAmB;AAC5B,UAAI,OAAOA,KAAU,SAAU,QAAOA;AACtC,YAAMC,IAAYD,EAAM,QAAQF,GAAS,EAAE;AAC3C,aAAOG,MAAcD,IAAQA,IAAQC;AAAA,IACvC;AAAA,IACA,WAAW,CAACC,GAAYF,MAClB,OAAOA,KAAU,YAAY,IAAI,OAAOF,EAAQ,QAAQA,EAAQ,KAAK,EAAE,KAAKE,CAAK,IAC5E,QAAQ,OAAOD,CAAO,IAExB,QAAQ,QAAA;AAAA,EACjB;AAEJ;AAEO,MAAMI,IAAqBP,EAAA;"}
@@ -1,2 +1,4 @@
1
1
  export * from './component';
2
+ export * from './formValidationRule';
3
+ export { useFormValidation } from './useFormValidation';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from 'rc-field-form/lib/interface';
2
+ export declare function useFormValidation(ignoreRules?: string[]): Rule[] | null;
3
+ //# sourceMappingURL=useFormValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormValidation.d.ts","sourceRoot":"","sources":["../../../src/components/form/useFormValidation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,wBAAgB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAmBvE"}
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { useMemo as u } from "react";
3
+ import { useThemeContext as a } from "../theme-provider/context/themeStore.js";
4
+ function y(i) {
5
+ const { componentConfig: s } = a(), e = s?.formValidationRules, n = i?.join(","), r = e ? e.map((t) => t.key).join(",") : void 0;
6
+ return u(() => {
7
+ if (!e?.length)
8
+ return null;
9
+ const t = n ? new Set(n.split(",")) : null;
10
+ return e.filter(
11
+ (o) => !t?.has(o.key)
12
+ ).map(({ key: o, sanitize: m, ...l }) => l);
13
+ }, [n, r]);
14
+ }
15
+ export {
16
+ y as useFormValidation
17
+ };
18
+ //# sourceMappingURL=useFormValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormValidation.js","sources":["../../../src/components/form/useFormValidation.ts"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { useThemeContext } from \"../theme-provider/context\";\nimport type { FormValidationRule } from \"./formValidationRule\";\nimport type { Rule } from \"rc-field-form/lib/interface\";\n\nexport function useFormValidation(ignoreRules?: string[]): Rule[] | null {\n const { componentConfig } = useThemeContext();\n const validationRules = componentConfig?.formValidationRules;\n const ignoreKey = ignoreRules?.join(\",\");\n const rulesKey = validationRules ? validationRules.map((r) => r.key).join(\",\") : undefined;\n\n return useMemo(() => {\n if (!validationRules?.length) {\n return null;\n }\n\n const ignoreSet = ignoreKey ? new Set(ignoreKey.split(\",\")) : null;\n const activeRules: FormValidationRule[] = validationRules.filter(\n (rule) => !ignoreSet?.has(rule.key),\n );\n\n return activeRules.map(({ key: _key, sanitize: _sanitize, ...rule }) => rule);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [ignoreKey, rulesKey]);\n}\n"],"names":["useFormValidation","ignoreRules","componentConfig","useThemeContext","validationRules","ignoreKey","rulesKey","r","useMemo","ignoreSet","rule","_key","_sanitize"],"mappings":";;;AAOO,SAASA,EAAkBC,GAAuC;AACvE,QAAM,EAAE,iBAAAC,EAAA,IAAoBC,EAAA,GACtBC,IAAkBF,GAAiB,qBACnCG,IAAYJ,GAAa,KAAK,GAAG,GACjCK,IAAWF,IAAkBA,EAAgB,IAAI,CAACG,MAAMA,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI;AAEjF,SAAOC,EAAQ,MAAM;AACnB,QAAI,CAACJ,GAAiB;AACpB,aAAO;AAGT,UAAMK,IAAYJ,IAAY,IAAI,IAAIA,EAAU,MAAM,GAAG,CAAC,IAAI;AAK9D,WAJ0CD,EAAgB;AAAA,MACxD,CAACM,MAAS,CAACD,GAAW,IAAIC,EAAK,GAAG;AAAA,IAAA,EAGjB,IAAI,CAAC,EAAE,KAAKC,GAAM,UAAUC,GAAW,GAAGF,EAAA,MAAWA,CAAI;AAAA,EAE9E,GAAG,CAACL,GAAWC,CAAQ,CAAC;AAC1B;"}
@@ -29,6 +29,7 @@ export * from './tree/index';
29
29
  export * from './spin/index';
30
30
  export * from './empty/component';
31
31
  export * from './form/component';
32
+ export * from './form/formValidationRule';
32
33
  export * from './field/component';
33
34
  export * from './tour/component';
34
35
  export * from './toast/index';
@@ -55,6 +56,7 @@ export * from './loader/index';
55
56
  export * from './window-portal/index';
56
57
  export * from './alert/index';
57
58
  export * from './label-with-help/index';
59
+ export * from './base-menu/index';
58
60
  export * from './utils/index';
59
61
  export * from './hooks/index';
60
62
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAEL,MAAM,EACN,GAAG,EACH,YAAY,EACZ,MAAM,EACN,OAAO,EAIP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EAER,GAAG,EAEH,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EAER,IAAI,EACJ,WAAW,EAEX,IAAI,EAGJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EAEP,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,MAAM,EAEN,IAAI,EACJ,MAAM,EACN,GAAG,EAGH,QAAQ,EAER,KAAK,EAEL,SAAS,EACT,KAAK,EAGL,IAAI,EAEJ,KAAK,EACL,UAAU,EACV,QAAQ,EAGR,QAAQ,EAER,UAAU,EACV,UAAU,EAEV,OAAO,EACP,SAAS,EAET,iBAAiB,GAClB,MAAM,MAAM,CAAC;AAEd,YAAY,EACV,UAAU,EACV,QAAQ,EAER,eAAe,EACf,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,YAAY,EAKZ,YAAY,EACZ,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,EACb,i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yBAAyB,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAEL,MAAM,EACN,GAAG,EACH,YAAY,EACZ,MAAM,EACN,OAAO,EAIP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EAER,GAAG,EAEH,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EAER,IAAI,EACJ,WAAW,EAEX,IAAI,EAGJ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EAEP,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,MAAM,EAEN,IAAI,EACJ,MAAM,EACN,GAAG,EAGH,QAAQ,EAER,KAAK,EAEL,SAAS,EACT,KAAK,EAGL,IAAI,EAEJ,KAAK,EACL,UAAU,EACV,QAAQ,EAGR,QAAQ,EAER,UAAU,EACV,UAAU,EAEV,OAAO,EACP,SAAS,EAET,iBAAiB,GAClB,MAAM,MAAM,CAAC;AAEd,YAAY,EACV,UAAU,EACV,QAAQ,EAER,eAAe,EACf,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,YAAY,EAKZ,YAAY,EACZ,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAElB,WAAW,EACX,QAAQ,EAGR,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EAEb,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,YAAY,EAEZ,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EAIT,gBAAgB,EAChB,WAAW,EAC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B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAElC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -8,6 +8,8 @@ export interface KeyboardShortcutProps {
8
8
  style?: React.CSSProperties;
9
9
  /** Size variant */
10
10
  size?: "small" | "medium" | "large";
11
+ /** Whether to display modifier keys as symbols. When false, shows text labels like "Shift" instead of "⇧". Default: true */
12
+ useSymbol?: boolean;
11
13
  /** Children to display as keyboard shortcuts */
12
14
  children?: React.ReactNode;
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard-shortcut/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mBAAmB;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsF5D,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard-shortcut/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,mBAAmB;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,4HAA4H;IAC5H,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAsDD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+D5D,CAAC"}
@@ -1,72 +1,92 @@
1
- import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
- import h from "react";
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ import i from "react";
3
3
  import './style.css';/* empty css */
4
- import { useCls as i } from "../utils/antdUtils.js";
5
- import { clsx as m } from "../utils/cn.js";
6
- const g = ({
7
- keys: o,
4
+ import { useCls as u } from "../utils/antdUtils.js";
5
+ import { clsx as l } from "../utils/cn.js";
6
+ const f = /* @__PURE__ */ new Set([
7
+ "meta",
8
+ "cmd",
9
+ "command",
10
+ "ctrl",
11
+ "control",
12
+ "shift",
13
+ "alt",
14
+ "option"
15
+ ]), b = {
16
+ meta: "⌘",
17
+ cmd: "⌘",
18
+ command: "⌘",
19
+ ctrl: "⌃",
20
+ control: "⌃",
21
+ shift: "⇧",
22
+ alt: "⌥",
23
+ option: "⌥"
24
+ }, w = {
25
+ meta: "Cmd",
26
+ cmd: "Cmd",
27
+ command: "Cmd",
28
+ ctrl: "Ctrl",
29
+ control: "Ctrl",
30
+ shift: "Shift",
31
+ alt: "Alt",
32
+ option: "Option"
33
+ }, C = {
34
+ enter: "↵",
35
+ return: "↵",
36
+ space: "Space",
37
+ tab: "⇥",
38
+ escape: "Esc",
39
+ esc: "Esc",
40
+ delete: "⌫",
41
+ backspace: "⌫",
42
+ arrowup: "↑",
43
+ arrowdown: "↓",
44
+ arrowleft: "←",
45
+ arrowright: "→",
46
+ up: "↑",
47
+ down: "↓",
48
+ left: "←",
49
+ right: "→"
50
+ }, K = ({
51
+ keys: a,
8
52
  className: c,
9
53
  style: s,
10
54
  size: n = "medium",
11
- children: l
55
+ useSymbol: d = !0,
56
+ children: m
12
57
  }) => {
13
- const r = i(), p = (e) => {
14
- const a = {
15
- meta: "⌘",
16
- cmd: "⌘",
17
- command: "⌘",
18
- ctrl: "Ctrl",
19
- control: "Ctrl",
20
- shift: "⇧",
21
- alt: "⌥",
22
- option: "⌥",
23
- enter: "↵",
24
- return: "↵",
25
- space: "Space",
26
- tab: "⇥",
27
- escape: "Esc",
28
- esc: "Esc",
29
- delete: "⌫",
30
- backspace: "⌫",
31
- arrowup: "↑",
32
- arrowdown: "↓",
33
- arrowleft: "←",
34
- arrowright: "→",
35
- up: "↑",
36
- down: "↓",
37
- left: "←",
38
- right: "→"
39
- }, d = e.toLowerCase();
40
- return a[d] || e.toUpperCase();
58
+ const t = u(), p = (o) => {
59
+ const r = o.toLowerCase();
60
+ return f.has(r) ? (d ? b : w)[r] || o : C[r] || o.toUpperCase();
41
61
  };
42
- return l ? /* @__PURE__ */ t(
62
+ return m ? /* @__PURE__ */ e(
43
63
  "span",
44
64
  {
45
- className: m(
46
- r("keyboard-shortcut"),
47
- r(`keyboard-shortcut-${n}`),
65
+ className: l(
66
+ t("keyboard-shortcut"),
67
+ t(`keyboard-shortcut-${n}`),
48
68
  c
49
69
  ),
50
70
  style: s,
51
- children: /* @__PURE__ */ t("kbd", { className: r("keyboard-shortcut-key"), children: l })
71
+ children: /* @__PURE__ */ e("kbd", { className: t("keyboard-shortcut-key"), children: m })
52
72
  }
53
- ) : !o || o.length === 0 ? null : /* @__PURE__ */ t(
73
+ ) : !a || a.length === 0 ? null : /* @__PURE__ */ e(
54
74
  "span",
55
75
  {
56
- className: m(
57
- r("keyboard-shortcut"),
58
- r(`keyboard-shortcut-${n}`),
76
+ className: l(
77
+ t("keyboard-shortcut"),
78
+ t(`keyboard-shortcut-${n}`),
59
79
  c
60
80
  ),
61
81
  style: s,
62
- children: o.map((e, a) => /* @__PURE__ */ u(h.Fragment, { children: [
63
- /* @__PURE__ */ t("kbd", { className: r("keyboard-shortcut-key"), children: p(e) }),
64
- a < o.length - 1 && /* @__PURE__ */ t("span", { className: r("keyboard-shortcut-separator"), children: "+" })
65
- ] }, a))
82
+ children: a.map((o, r) => /* @__PURE__ */ h(i.Fragment, { children: [
83
+ /* @__PURE__ */ e("kbd", { className: t("keyboard-shortcut-key"), children: p(o) }),
84
+ r < a.length - 1 && /* @__PURE__ */ e("span", { className: t("keyboard-shortcut-separator"), children: "+" })
85
+ ] }, r))
66
86
  }
67
87
  );
68
88
  };
69
89
  export {
70
- g as KeyboardShortcut
90
+ K as KeyboardShortcut
71
91
  };
72
92
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/keyboard-shortcut/component.tsx"],"sourcesContent":["import React from \"react\";\nimport { useCls, clsx } from \"../utils\";\nimport \"./style.css\";\n\nexport interface KeyboardShortcutProps {\n /** The keyboard shortcut keys to display (optional if using children) */\n keys?: string[];\n /** Custom className */\n className?: string;\n /** Custom style */\n style?: React.CSSProperties;\n /** Size variant */\n size?: \"small\" | \"medium\" | \"large\";\n /** Children to display as keyboard shortcuts */\n children?: React.ReactNode;\n}\n\nexport const KeyboardShortcut: React.FC<KeyboardShortcutProps> = ({\n keys,\n className,\n style,\n size = \"medium\",\n children,\n}) => {\n const cls = useCls();\n\n const formatKey = (key: string): string => {\n // Common key mappings for better display\n const keyMap: Record<string, string> = {\n meta: \"⌘\",\n cmd: \"⌘\",\n command: \"⌘\",\n ctrl: \"Ctrl\",\n control: \"Ctrl\",\n shift: \"⇧\",\n alt: \"⌥\",\n option: \"⌥\",\n enter: \"↵\",\n return: \"↵\",\n space: \"Space\",\n tab: \"⇥\",\n escape: \"Esc\",\n esc: \"Esc\",\n delete: \"⌫\",\n backspace: \"⌫\",\n arrowup: \"↑\",\n arrowdown: \"↓\",\n arrowleft: \"←\",\n arrowright: \"→\",\n up: \"↑\",\n down: \"↓\",\n left: \"←\",\n right: \"→\",\n };\n\n const lowerKey = key.toLowerCase();\n return keyMap[lowerKey] || key.toUpperCase();\n };\n\n // If children are provided, use them directly\n if (children) {\n return (\n <span\n className={clsx(\n cls(\"keyboard-shortcut\"),\n cls(`keyboard-shortcut-${size}`),\n className\n )}\n style={style}\n >\n <kbd className={cls(\"keyboard-shortcut-key\")}>\n {children}\n </kbd>\n </span>\n );\n }\n\n // If no keys provided, return null\n if (!keys || keys.length === 0) {\n return null;\n }\n\n return (\n <span\n className={clsx(\n cls(\"keyboard-shortcut\"),\n cls(`keyboard-shortcut-${size}`),\n className\n )}\n style={style}\n >\n {keys.map((key, index) => (\n <React.Fragment key={index}>\n <kbd className={cls(\"keyboard-shortcut-key\")}>\n {formatKey(key)}\n </kbd>\n {index < keys.length - 1 && (\n <span className={cls(\"keyboard-shortcut-separator\")}>+</span>\n )}\n </React.Fragment>\n ))}\n </span>\n );\n};"],"names":["KeyboardShortcut","keys","className","style","size","children","cls","useCls","formatKey","key","keyMap","lowerKey","jsx","clsx","index","jsxs","React"],"mappings":";;;;;AAiBO,MAAMA,IAAoD,CAAC;AAAA,EAChE,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAMC,EAAA,GAENC,IAAY,CAACC,MAAwB;AAEzC,UAAMC,IAAiC;AAAA,MACrC,MAAM;AAAA,MACN,KAAK;AAAA,MACL,SAAS;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAO;AAAA,MACP,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,SAAS;AAAA,MACT,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA,GAGHC,IAAWF,EAAI,YAAA;AACrB,WAAOC,EAAOC,CAAQ,KAAKF,EAAI,YAAA;AAAA,EACjC;AAGA,SAAIJ,IAEA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTP,EAAI,mBAAmB;AAAA,QACvBA,EAAI,qBAAqBF,CAAI,EAAE;AAAA,QAC/BF;AAAA,MAAA;AAAA,MAEF,OAAAC;AAAA,MAEA,4BAAC,OAAA,EAAI,WAAWG,EAAI,uBAAuB,GACxC,UAAAD,EAAA,CACH;AAAA,IAAA;AAAA,EAAA,IAMF,CAACJ,KAAQA,EAAK,WAAW,IACpB,OAIP,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTP,EAAI,mBAAmB;AAAA,QACvBA,EAAI,qBAAqBF,CAAI,EAAE;AAAA,QAC/BF;AAAA,MAAA;AAAA,MAEF,OAAAC;AAAA,MAEC,UAAAF,EAAK,IAAI,CAACQ,GAAKK,MACd,gBAAAC,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,QAAA,gBAAAJ,EAAC,SAAI,WAAWN,EAAI,uBAAuB,GACxC,UAAAE,EAAUC,CAAG,GAChB;AAAA,QACCK,IAAQb,EAAK,SAAS,KACrB,gBAAAW,EAAC,UAAK,WAAWN,EAAI,6BAA6B,GAAG,UAAA,IAAA,CAAC;AAAA,MAAA,EAAA,GALrCQ,CAOrB,CACD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/keyboard-shortcut/component.tsx"],"sourcesContent":["import React from \"react\";\nimport { useCls, clsx } from \"../utils\";\nimport \"./style.css\";\n\nexport interface KeyboardShortcutProps {\n /** The keyboard shortcut keys to display (optional if using children) */\n keys?: string[];\n /** Custom className */\n className?: string;\n /** Custom style */\n style?: React.CSSProperties;\n /** Size variant */\n size?: \"small\" | \"medium\" | \"large\";\n /** Whether to display modifier keys as symbols. When false, shows text labels like \"Shift\" instead of \"⇧\". Default: true */\n useSymbol?: boolean;\n /** Children to display as keyboard shortcuts */\n children?: React.ReactNode;\n}\n\nconst MODIFIER_KEYS = new Set([\n \"meta\",\n \"cmd\",\n \"command\",\n \"ctrl\",\n \"control\",\n \"shift\",\n \"alt\",\n \"option\",\n]);\n\nconst SYMBOL_MAP: Record<string, string> = {\n meta: \"⌘\",\n cmd: \"⌘\",\n command: \"⌘\",\n ctrl: \"⌃\",\n control: \"⌃\",\n shift: \"⇧\",\n alt: \"⌥\",\n option: \"⌥\",\n};\n\nconst TEXT_MAP: Record<string, string> = {\n meta: \"Cmd\",\n cmd: \"Cmd\",\n command: \"Cmd\",\n ctrl: \"Ctrl\",\n control: \"Ctrl\",\n shift: \"Shift\",\n alt: \"Alt\",\n option: \"Option\",\n};\n\nconst KEY_MAP: Record<string, string> = {\n enter: \"↵\",\n return: \"↵\",\n space: \"Space\",\n tab: \"⇥\",\n escape: \"Esc\",\n esc: \"Esc\",\n delete: \"⌫\",\n backspace: \"⌫\",\n arrowup: \"↑\",\n arrowdown: \"↓\",\n arrowleft: \"←\",\n arrowright: \"→\",\n up: \"↑\",\n down: \"↓\",\n left: \"←\",\n right: \"→\",\n};\n\nexport const KeyboardShortcut: React.FC<KeyboardShortcutProps> = ({\n keys,\n className,\n style,\n size = \"medium\",\n useSymbol = true,\n children,\n}) => {\n const cls = useCls();\n\n const formatKey = (key: string): string => {\n const lowerKey = key.toLowerCase();\n if (MODIFIER_KEYS.has(lowerKey)) {\n const map = useSymbol ? SYMBOL_MAP : TEXT_MAP;\n return map[lowerKey] || key;\n }\n return KEY_MAP[lowerKey] || key.toUpperCase();\n };\n\n // If children are provided, use them directly\n if (children) {\n return (\n <span\n className={clsx(\n cls(\"keyboard-shortcut\"),\n cls(`keyboard-shortcut-${size}`),\n className\n )}\n style={style}\n >\n <kbd className={cls(\"keyboard-shortcut-key\")}>\n {children}\n </kbd>\n </span>\n );\n }\n\n // If no keys provided, return null\n if (!keys || keys.length === 0) {\n return null;\n }\n\n return (\n <span\n className={clsx(\n cls(\"keyboard-shortcut\"),\n cls(`keyboard-shortcut-${size}`),\n className\n )}\n style={style}\n >\n {keys.map((key, index) => (\n <React.Fragment key={index}>\n <kbd className={cls(\"keyboard-shortcut-key\")}>\n {formatKey(key)}\n </kbd>\n {index < keys.length - 1 && (\n <span className={cls(\"keyboard-shortcut-separator\")}>+</span>\n )}\n </React.Fragment>\n ))}\n </span>\n );\n};"],"names":["MODIFIER_KEYS","SYMBOL_MAP","TEXT_MAP","KEY_MAP","KeyboardShortcut","keys","className","style","size","useSymbol","children","cls","useCls","formatKey","key","lowerKey","jsx","clsx","index","jsxs","React"],"mappings":";;;;;AAmBA,MAAMA,wBAAoB,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEKC,IAAqC;AAAA,EACzC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AACV,GAEMC,IAAmC;AAAA,EACvC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AACV,GAEMC,IAAkC;AAAA,EACtC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT,GAEaC,IAAoD,CAAC;AAAA,EAChE,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAMC,EAAA,GAENC,IAAY,CAACC,MAAwB;AACzC,UAAMC,IAAWD,EAAI,YAAA;AACrB,WAAId,EAAc,IAAIe,CAAQ,KAChBN,IAAYR,IAAaC,GAC1Ba,CAAQ,KAAKD,IAEnBX,EAAQY,CAAQ,KAAKD,EAAI,YAAA;AAAA,EAClC;AAGA,SAAIJ,IAEA,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTN,EAAI,mBAAmB;AAAA,QACvBA,EAAI,qBAAqBH,CAAI,EAAE;AAAA,QAC/BF;AAAA,MAAA;AAAA,MAEF,OAAAC;AAAA,MAEA,4BAAC,OAAA,EAAI,WAAWI,EAAI,uBAAuB,GACxC,UAAAD,EAAA,CACH;AAAA,IAAA;AAAA,EAAA,IAMF,CAACL,KAAQA,EAAK,WAAW,IACpB,OAIP,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTN,EAAI,mBAAmB;AAAA,QACvBA,EAAI,qBAAqBH,CAAI,EAAE;AAAA,QAC/BF;AAAA,MAAA;AAAA,MAEF,OAAAC;AAAA,MAEC,UAAAF,EAAK,IAAI,CAACS,GAAKI,MACd,gBAAAC,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,QAAA,gBAAAJ,EAAC,SAAI,WAAWL,EAAI,uBAAuB,GACxC,UAAAE,EAAUC,CAAG,GAChB;AAAA,QACCI,IAAQb,EAAK,SAAS,KACrB,gBAAAW,EAAC,UAAK,WAAWL,EAAI,6BAA6B,GAAG,UAAA,IAAA,CAAC;AAAA,MAAA,EAAA,GALrCO,CAOrB,CACD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -30,7 +30,7 @@ export interface ModalProps extends Omit<AntModalProps, "centered"> {
30
30
  hideCancelButton?: boolean;
31
31
  /**
32
32
  * Custom Content Padding
33
- * @default "24px"
33
+ * @default "var(--ds-modal-padding)"
34
34
  */
35
35
  contentPadding?: number | string | boolean;
36
36
  /**
@@ -75,7 +75,7 @@ const to = ({
75
75
  ...f,
76
76
  body: {
77
77
  ...typeof t < "u" ? {
78
- "--ds-modal-content-padding": t === !1 || t === 0 ? "0" : typeof t == "number" ? `${t}px` : t
78
+ "--ds-modal-body-content-padding": t === !1 || t === 0 ? "0" : typeof t == "number" ? `${t}px` : t
79
79
  } : {},
80
80
  ...f?.body
81
81
  }
@@ -109,19 +109,19 @@ const to = ({
109
109
  ...T
110
110
  }),
111
111
  [T]
112
- ), H = n(
112
+ ), b = n(
113
113
  () => ({
114
114
  ...N
115
115
  }),
116
116
  [N]
117
- ), [He, V] = x(ne), b = typeof z > "u", be = b ? He : z, y = ke(
117
+ ), [be, V] = x(ne), H = typeof z > "u", He = H ? be : z, y = ke(
118
118
  (e) => {
119
119
  a || O?.(e);
120
120
  }
121
121
  ), X = n(
122
122
  () => ({
123
123
  okButtonProps: v,
124
- cancelButtonProps: H,
124
+ cancelButtonProps: b,
125
125
  onCancel: y,
126
126
  onOk: u,
127
127
  okType: B,
@@ -131,7 +131,7 @@ const to = ({
131
131
  }),
132
132
  [
133
133
  v,
134
- H,
134
+ b,
135
135
  u,
136
136
  B,
137
137
  a,
@@ -150,7 +150,7 @@ const to = ({
150
150
  xe,
151
151
  {
152
152
  closeIcon: !1,
153
- open: be,
153
+ open: He,
154
154
  width: fe,
155
155
  style: ue,
156
156
  title: /* @__PURE__ */ i(Q, { children: [
@@ -185,12 +185,12 @@ const to = ({
185
185
  styles: pe,
186
186
  modalRender: (e) => /* @__PURE__ */ o("div", { ref: ve, className: r("modal-inner"), children: e }),
187
187
  okButtonProps: v,
188
- cancelButtonProps: H,
188
+ cancelButtonProps: b,
189
189
  onOk: (e) => {
190
- b && V(!1), u?.(e);
190
+ H && V(!1), u?.(e);
191
191
  },
192
192
  onCancel: (e) => {
193
- a || (b && V(!1), O?.(e));
193
+ a || (H && V(!1), O?.(e));
194
194
  },
195
195
  okText: R,
196
196
  cancelText: E,
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntModal,\n type ModalProps as AntModalProps,\n} from \"antd/es/modal\";\nimport { XIcon } from \"@bioturing/assets\";\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useStableCallback } from \"@base-ui/utils/useStableCallback\";\nimport { clsx, useCls } from \"../utils\";\nimport { ModalContextProvider } from \"antd/es/modal/context\";\nimport NormalCancelBtn from \"antd/es/modal/components/NormalCancelBtn\";\nimport NormalOkBtn from \"antd/es/modal/components/NormalOkBtn\";\nimport { getConfirmLocale } from \"antd/es/modal/locale\";\nimport { useLocale } from \"antd/es/locale\";\nimport { IconButton } from \"../icon-button\";\nimport { ModalSize } from \"./constants\";\nimport { ModalType } from \"./functions\";\nimport { Truncate } from \"../truncate\";\nimport { Stack } from \"../stack\";\nimport { useTheme } from \"../theme-provider\";\nimport { Spin } from \"../spin\";\n\n// Define props interface extending Ant Design's ModalProps\nexport interface ModalProps extends Omit<AntModalProps, \"centered\"> {\n /**\n * Predefined sizes for the modal\n * - xsmall: 400px\n * - small: 520px\n * - medium: 640px (default)\n * - large: 840px\n * - xlarge: 1024px\n * - fullscreen: 100vw (takes full screen width with margins)\n * @default \"medium\" for default type, \"xsmall\" for other types\n */\n size?:\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"fullscreen\";\n /**\n * Mark modal as loading\n * @default false\n */\n loading?: boolean;\n /**\n * Hide Ok button\n * @default false\n */\n hideOkButton?: boolean;\n /**\n * Hide Cancel button\n * @default false\n */\n hideCancelButton?: boolean;\n /**\n * Custom Content Padding\n * @default \"24px\"\n */\n contentPadding?: number | string | boolean;\n /**\n * Add more content below the title\n */\n afterTitle?: React.ReactNode;\n /**\n * Add more actions before close button\n */\n beforeCloseButton?: React.ReactNode;\n /**\n * Add more actions after close button\n */\n afterCloseButton?: React.ReactNode;\n /**\n * Set header and footer to fixed position\n * @default false\n */\n defaultFixedHeaderFooter?: boolean;\n /**\n * Centered Modal\n * @default true\n */\n centered?: boolean;\n /**\n * Modal type\n * @default \"default\"\n */\n type?: ModalType;\n /**\n * Default open state for uncontrolled modal\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Modal background\n * @default \"elevated\" if size smaller than \"medium\", otherwise \"container\"\n */\n background?: \"elevated\" | \"container\";\n /**\n * Modal old close callback\n * @deprecated use onCancel instead\n */\n onClose?: () => void;\n /**\n * Make modal body scrollable\n * @default true\n */\n bodyScrollable?: boolean;\n}\n\n// Create Modal component\nexport const Modal = ({\n open: externalOpen,\n closeIcon,\n children,\n size: sizeProp,\n footer,\n width,\n style,\n styles,\n classNames,\n okButtonProps,\n cancelButtonProps,\n loading,\n onOk,\n onCancel,\n okText,\n okType = \"primary\",\n confirmLoading,\n cancelText = \"Close\",\n hideOkButton = false,\n hideCancelButton = false,\n contentPadding,\n title,\n afterTitle,\n beforeCloseButton,\n afterCloseButton,\n defaultFixedHeaderFooter = false,\n centered = true,\n type = \"default\",\n defaultOpen = true,\n background: backgroundProp,\n bodyScrollable = true,\n rootClassName,\n ...rest\n}: ModalProps) => {\n // Default close icon with Phosphor icon\n const defaultCloseIcon =\n closeIcon === undefined ? <XIcon size={16} weight=\"bold\" /> : closeIcon;\n\n // Use custom width if provided, otherwise use the size from the map\n const defaultModalSize = type === \"default\" ? \"medium\" : \"xsmall\";\n\n const size: keyof typeof ModalSize = sizeProp || defaultModalSize;\n const modalWidth = width || ModalSize[size];\n\n const [sizeTracking, setSizeTracking] = useState<{\n headerHeight: number | undefined;\n footerHeight: number | undefined;\n }>({\n headerHeight: undefined,\n footerHeight: undefined,\n });\n\n const background =\n backgroundProp ||\n (size &&\n size in ModalSize &&\n parseInt(ModalSize[size]) <= parseInt(ModalSize.medium)\n ? \"elevated\"\n : \"container\");\n\n // Memoize modal styles to prevent recreating on every render\n const modalStyle = useMemo(\n () =>\n ({\n \"--ds-modal-bg\": `var(--ds-color-bg-${background})`,\n \"--ds-modal-header-height\": sizeTracking.headerHeight\n ? `${sizeTracking.headerHeight}px`\n : undefined,\n \"--ds-modal-footer-height\": sizeTracking.footerHeight\n ? `${sizeTracking.footerHeight}px`\n : undefined,\n ...style,\n ...(size === \"fullscreen\"\n ? { top: 0, maxWidth: \"100%\", height: \"100%\" }\n : {}),\n }) as React.CSSProperties,\n [\n background,\n style,\n size,\n sizeTracking.headerHeight,\n sizeTracking.footerHeight,\n ],\n );\n\n const modalStyles = useMemo(\n () => ({\n ...styles,\n body: {\n ...((typeof contentPadding != \"undefined\"\n ? {\n \"--ds-modal-content-padding\":\n contentPadding === false || contentPadding === 0\n ? \"0\"\n : typeof contentPadding == \"number\"\n ? `${contentPadding}px`\n : contentPadding,\n }\n : {}) as React.CSSProperties),\n ...styles?.body,\n },\n }),\n [styles, contentPadding],\n );\n\n const [isContentOverflow, setIsContentOverflow] = useState(false);\n\n const cls = useCls();\n\n const { className: themeClassName } = useTheme();\n\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const modalInnerRef = useCallback(\n (node: HTMLElement | null) => {\n // If the node is null (component unmounting), just return\n if (!node) return;\n\n const modalBody = node.querySelector(\".\" + cls(\"modal-body\"));\n if (!(modalBody instanceof HTMLElement)) return;\n\n const modalHeader = node.querySelector(\".\" + cls(\"modal-header\"));\n const modalFooter = node.querySelector(\".\" + cls(\"modal-footer\"));\n\n const resizeObserverHandler = () => {\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n if (modalHeader instanceof HTMLElement) {\n setSizeTracking((prev) => ({\n ...prev,\n headerHeight: modalHeader.offsetHeight,\n }));\n }\n if (modalFooter instanceof HTMLElement) {\n setSizeTracking((prev) => ({\n ...prev,\n footerHeight: modalFooter.offsetHeight,\n }));\n }\n };\n\n // Create ResizeObserver to detect overflow\n const resizeObserver = new ResizeObserver(resizeObserverHandler);\n\n // Store reference to the observer\n resizeObserverRef.current = resizeObserver;\n\n // Start observing\n resizeObserver.observe(modalBody);\n\n // Initial check\n resizeObserverHandler();\n },\n [cls],\n );\n\n // clean up resize observer\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n };\n }, []);\n\n const [locale] = useLocale(\"Modal\", getConfirmLocale());\n\n const okTextLocale: React.ReactNode = okText || locale?.okText;\n const cancelTextLocale = cancelText || locale?.cancelText;\n\n const modalOkButtonProps = useMemo(\n () => ({\n // loading: typeof confirmLoading === \"boolean\" ? confirmLoading : loading,\n ...okButtonProps,\n }),\n [okButtonProps],\n );\n\n const modalCancelButtonProps = useMemo(\n () => ({\n ...cancelButtonProps,\n }),\n [cancelButtonProps],\n );\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n\n const uncontrolledOpen = typeof externalOpen === \"undefined\";\n\n const open = uncontrolledOpen ? internalOpen : externalOpen;\n\n const handleCancel = useStableCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n if (confirmLoading) {\n return;\n }\n onCancel?.(e);\n },\n );\n\n const modalContextValue = useMemo(\n () => ({\n okButtonProps: modalOkButtonProps,\n cancelButtonProps: modalCancelButtonProps,\n onCancel: handleCancel,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n }),\n [\n modalOkButtonProps,\n modalCancelButtonProps,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n handleCancel,\n ],\n );\n\n const defaultFooter = useMemo(\n () => (\n <ModalContextProvider value={modalContextValue}>\n {hideOkButton ? (\n <NormalCancelBtn />\n ) : hideCancelButton ? (\n <NormalOkBtn />\n ) : (\n <>\n <NormalCancelBtn />\n <NormalOkBtn />\n </>\n )}\n </ModalContextProvider>\n ),\n [modalContextValue, hideOkButton, hideCancelButton],\n );\n\n const renderTitle = () => {\n return (\n <>\n <Stack align=\"center\" gap={8} className={cls(\"modal-title-wrapper\")}>\n <Stack.Child grow>\n {typeof title === \"string\" ? <Truncate>{title}</Truncate> : title}\n </Stack.Child>\n <Stack.Child stack hug align=\"center\" gap={8}>\n {beforeCloseButton}\n <IconButton\n onClick={(e: React.MouseEvent<HTMLButtonElement>) =>\n handleCancel(e)\n }\n >\n {defaultCloseIcon}\n </IconButton>\n {afterCloseButton}\n </Stack.Child>\n {}\n </Stack>\n {afterTitle ? afterTitle : null}\n </>\n );\n };\n return (\n <AntModal\n closeIcon={false}\n open={open}\n width={modalWidth}\n style={modalStyle}\n title={renderTitle()}\n rootClassName={clsx(themeClassName, rootClassName)}\n classNames={{\n ...classNames,\n wrapper: cls(\n \"modal-wrap\",\n size == \"fullscreen\" && \"modal-fullscreen\",\n isContentOverflow && \"modal-content-overflow\",\n bodyScrollable === false && \"modal-no-body-scroll\",\n loading && \"modal-loading\",\n defaultFixedHeaderFooter || isContentOverflow || size == \"fullscreen\"\n ? \"modal-fixed\"\n : \"\",\n ),\n }}\n styles={modalStyles}\n modalRender={(modal) => (\n <div ref={modalInnerRef} className={cls(\"modal-inner\")}>\n {modal}\n </div>\n )}\n okButtonProps={modalOkButtonProps}\n cancelButtonProps={modalCancelButtonProps}\n onOk={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onOk?.(e);\n }}\n onCancel={(e) => {\n if (confirmLoading) return;\n if (uncontrolledOpen) setInternalOpen(false);\n onCancel?.(e);\n }}\n okText={okText}\n cancelText={cancelText}\n okType=\"primary\"\n confirmLoading={confirmLoading}\n footer={\n typeof footer === \"undefined\"\n ? hideOkButton && hideCancelButton\n ? null\n : defaultFooter\n : footer\n }\n centered={centered}\n {...rest}\n >\n {children}\n {loading ? (\n <div className={cls(\"modal-loading-overlay\")}>\n <Spin />\n </div>\n ) : null}\n </AntModal>\n );\n};\n"],"names":["Modal","externalOpen","closeIcon","children","sizeProp","footer","width","style","styles","classNames","okButtonProps","cancelButtonProps","loading","onOk","onCancel","okText","okType","confirmLoading","cancelText","hideOkButton","hideCancelButton","contentPadding","title","afterTitle","beforeCloseButton","afterCloseButton","defaultFixedHeaderFooter","centered","type","defaultOpen","backgroundProp","bodyScrollable","rootClassName","rest","defaultCloseIcon","jsx","XIcon","size","modalWidth","ModalSize","sizeTracking","setSizeTracking","useState","background","modalStyle","useMemo","modalStyles","isContentOverflow","setIsContentOverflow","cls","useCls","themeClassName","useTheme","resizeObserverRef","useRef","modalInnerRef","useCallback","node","modalBody","modalHeader","modalFooter","resizeObserverHandler","hasOverflow","prev","resizeObserver","useEffect","locale","useLocale","getConfirmLocale","okTextLocale","cancelTextLocale","modalOkButtonProps","modalCancelButtonProps","internalOpen","setInternalOpen","uncontrolledOpen","open","handleCancel","useStableCallback","modalContextValue","defaultFooter","ModalContextProvider","NormalCancelBtn","NormalOkBtn","jsxs","Fragment","AntModal","Stack","Truncate","IconButton","clsx","modal","Spin"],"mappings":";;;;;;;;;;;;;;;;;;;AAsHO,MAAMA,KAAQ,CAAC;AAAA,EACpB,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,0BAAAC,KAA2B;AAAA,EAC3B,UAAAC,KAAW;AAAA,EACX,MAAAC,KAAO;AAAA,EACP,aAAAC,KAAc;AAAA,EACd,YAAYC;AAAA,EACZ,gBAAAC,KAAiB;AAAA,EACjB,eAAAC;AAAA,EACA,GAAGC;AACL,MAAkB;AAEhB,QAAMC,KACJhC,MAAc,SAAY,gBAAAiC,EAACC,MAAM,MAAM,IAAI,QAAO,OAAA,CAAO,IAAKlC,GA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C,UAAA,gBAAAd,EAACyD,IAAA,CAAA,CAAK,EAAA,CACR,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntModal,\n type ModalProps as AntModalProps,\n} from \"antd/es/modal\";\nimport { XIcon } from \"@bioturing/assets\";\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useStableCallback } from \"@base-ui/utils/useStableCallback\";\nimport { clsx, useCls } from \"../utils\";\nimport { ModalContextProvider } from \"antd/es/modal/context\";\nimport NormalCancelBtn from \"antd/es/modal/components/NormalCancelBtn\";\nimport NormalOkBtn from \"antd/es/modal/components/NormalOkBtn\";\nimport { getConfirmLocale } from \"antd/es/modal/locale\";\nimport { useLocale } from \"antd/es/locale\";\nimport { IconButton } from \"../icon-button\";\nimport { ModalSize } from \"./constants\";\nimport { ModalType } from \"./functions\";\nimport { Truncate } from \"../truncate\";\nimport { Stack } from \"../stack\";\nimport { useTheme } from \"../theme-provider\";\nimport { Spin } from \"../spin\";\n\n// Define props interface extending Ant Design's ModalProps\nexport interface ModalProps extends Omit<AntModalProps, \"centered\"> {\n /**\n * Predefined sizes for the modal\n * - xsmall: 400px\n * - small: 520px\n * - medium: 640px (default)\n * - large: 840px\n * - xlarge: 1024px\n * - fullscreen: 100vw (takes full screen width with margins)\n * @default \"medium\" for default type, \"xsmall\" for other types\n */\n size?:\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"fullscreen\";\n /**\n * Mark modal as loading\n * @default false\n */\n loading?: boolean;\n /**\n * Hide Ok button\n * @default false\n */\n hideOkButton?: boolean;\n /**\n * Hide Cancel button\n * @default false\n */\n hideCancelButton?: boolean;\n /**\n * Custom Content Padding\n * @default \"var(--ds-modal-padding)\"\n */\n contentPadding?: number | string | boolean;\n /**\n * Add more content below the title\n */\n afterTitle?: React.ReactNode;\n /**\n * Add more actions before close button\n */\n beforeCloseButton?: React.ReactNode;\n /**\n * Add more actions after close button\n */\n afterCloseButton?: React.ReactNode;\n /**\n * Set header and footer to fixed position\n * @default false\n */\n defaultFixedHeaderFooter?: boolean;\n /**\n * Centered Modal\n * @default true\n */\n centered?: boolean;\n /**\n * Modal type\n * @default \"default\"\n */\n type?: ModalType;\n /**\n * Default open state for uncontrolled modal\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Modal background\n * @default \"elevated\" if size smaller than \"medium\", otherwise \"container\"\n */\n background?: \"elevated\" | \"container\";\n /**\n * Modal old close callback\n * @deprecated use onCancel instead\n */\n onClose?: () => void;\n /**\n * Make modal body scrollable\n * @default true\n */\n bodyScrollable?: boolean;\n}\n\n// Create Modal component\nexport const Modal = ({\n open: externalOpen,\n closeIcon,\n children,\n size: sizeProp,\n footer,\n width,\n style,\n styles,\n classNames,\n okButtonProps,\n cancelButtonProps,\n loading,\n onOk,\n onCancel,\n okText,\n okType = \"primary\",\n confirmLoading,\n cancelText = \"Close\",\n hideOkButton = false,\n hideCancelButton = false,\n contentPadding,\n title,\n afterTitle,\n beforeCloseButton,\n afterCloseButton,\n defaultFixedHeaderFooter = false,\n centered = true,\n type = \"default\",\n defaultOpen = true,\n background: backgroundProp,\n bodyScrollable = true,\n rootClassName,\n ...rest\n}: ModalProps) => {\n // Default close icon with Phosphor icon\n const defaultCloseIcon =\n closeIcon === undefined ? <XIcon size={16} weight=\"bold\" /> : closeIcon;\n\n // Use custom width if provided, otherwise use the size from the map\n const defaultModalSize = type === \"default\" ? \"medium\" : \"xsmall\";\n\n const size: keyof typeof ModalSize = sizeProp || defaultModalSize;\n const modalWidth = width || ModalSize[size];\n\n const [sizeTracking, setSizeTracking] = useState<{\n headerHeight: number | undefined;\n footerHeight: number | undefined;\n }>({\n headerHeight: undefined,\n footerHeight: undefined,\n });\n\n const background =\n backgroundProp ||\n (size &&\n size in ModalSize &&\n parseInt(ModalSize[size]) <= parseInt(ModalSize.medium)\n ? \"elevated\"\n : \"container\");\n\n // Memoize modal styles to prevent recreating on every render\n const modalStyle = useMemo(\n () =>\n ({\n \"--ds-modal-bg\": `var(--ds-color-bg-${background})`,\n \"--ds-modal-header-height\": sizeTracking.headerHeight\n ? `${sizeTracking.headerHeight}px`\n : undefined,\n \"--ds-modal-footer-height\": sizeTracking.footerHeight\n ? `${sizeTracking.footerHeight}px`\n : undefined,\n ...style,\n ...(size === \"fullscreen\"\n ? { top: 0, maxWidth: \"100%\", height: \"100%\" }\n : {}),\n }) as React.CSSProperties,\n [\n background,\n style,\n size,\n sizeTracking.headerHeight,\n sizeTracking.footerHeight,\n ],\n );\n\n const modalStyles = useMemo(\n () => ({\n ...styles,\n body: {\n ...((typeof contentPadding != \"undefined\"\n ? {\n \"--ds-modal-body-content-padding\":\n contentPadding === false || contentPadding === 0\n ? \"0\"\n : typeof contentPadding == \"number\"\n ? `${contentPadding}px`\n : contentPadding,\n }\n : {}) as React.CSSProperties),\n ...styles?.body,\n },\n }),\n [styles, contentPadding],\n );\n\n const [isContentOverflow, setIsContentOverflow] = useState(false);\n\n const cls = useCls();\n\n const { className: themeClassName } = useTheme();\n\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const modalInnerRef = useCallback(\n (node: HTMLElement | null) => {\n // If the node is null (component unmounting), just return\n if (!node) return;\n\n const modalBody = node.querySelector(\".\" + cls(\"modal-body\"));\n if (!(modalBody instanceof HTMLElement)) return;\n\n const modalHeader = node.querySelector(\".\" + cls(\"modal-header\"));\n const modalFooter = node.querySelector(\".\" + cls(\"modal-footer\"));\n\n const resizeObserverHandler = () => {\n const hasOverflow = modalBody.scrollHeight > modalBody.clientHeight;\n setIsContentOverflow(hasOverflow);\n if (modalHeader instanceof HTMLElement) {\n setSizeTracking((prev) => ({\n ...prev,\n headerHeight: modalHeader.offsetHeight,\n }));\n }\n if (modalFooter instanceof HTMLElement) {\n setSizeTracking((prev) => ({\n ...prev,\n footerHeight: modalFooter.offsetHeight,\n }));\n }\n };\n\n // Create ResizeObserver to detect overflow\n const resizeObserver = new ResizeObserver(resizeObserverHandler);\n\n // Store reference to the observer\n resizeObserverRef.current = resizeObserver;\n\n // Start observing\n resizeObserver.observe(modalBody);\n\n // Initial check\n resizeObserverHandler();\n },\n [cls],\n );\n\n // clean up resize observer\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n };\n }, []);\n\n const [locale] = useLocale(\"Modal\", getConfirmLocale());\n\n const okTextLocale: React.ReactNode = okText || locale?.okText;\n const cancelTextLocale = cancelText || locale?.cancelText;\n\n const modalOkButtonProps = useMemo(\n () => ({\n // loading: typeof confirmLoading === \"boolean\" ? confirmLoading : loading,\n ...okButtonProps,\n }),\n [okButtonProps],\n );\n\n const modalCancelButtonProps = useMemo(\n () => ({\n ...cancelButtonProps,\n }),\n [cancelButtonProps],\n );\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n\n const uncontrolledOpen = typeof externalOpen === \"undefined\";\n\n const open = uncontrolledOpen ? internalOpen : externalOpen;\n\n const handleCancel = useStableCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n if (confirmLoading) {\n return;\n }\n onCancel?.(e);\n },\n );\n\n const modalContextValue = useMemo(\n () => ({\n okButtonProps: modalOkButtonProps,\n cancelButtonProps: modalCancelButtonProps,\n onCancel: handleCancel,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n }),\n [\n modalOkButtonProps,\n modalCancelButtonProps,\n onOk,\n okType,\n confirmLoading,\n okTextLocale,\n cancelTextLocale,\n handleCancel,\n ],\n );\n\n const defaultFooter = useMemo(\n () => (\n <ModalContextProvider value={modalContextValue}>\n {hideOkButton ? (\n <NormalCancelBtn />\n ) : hideCancelButton ? (\n <NormalOkBtn />\n ) : (\n <>\n <NormalCancelBtn />\n <NormalOkBtn />\n </>\n )}\n </ModalContextProvider>\n ),\n [modalContextValue, hideOkButton, hideCancelButton],\n );\n\n const renderTitle = () => {\n return (\n <>\n <Stack align=\"center\" gap={8} className={cls(\"modal-title-wrapper\")}>\n <Stack.Child grow>\n {typeof title === \"string\" ? <Truncate>{title}</Truncate> : title}\n </Stack.Child>\n <Stack.Child stack hug align=\"center\" gap={8}>\n {beforeCloseButton}\n <IconButton\n onClick={(e: React.MouseEvent<HTMLButtonElement>) =>\n handleCancel(e)\n }\n >\n {defaultCloseIcon}\n </IconButton>\n {afterCloseButton}\n </Stack.Child>\n {}\n </Stack>\n {afterTitle ? afterTitle : null}\n </>\n );\n };\n return (\n <AntModal\n closeIcon={false}\n open={open}\n width={modalWidth}\n style={modalStyle}\n title={renderTitle()}\n rootClassName={clsx(themeClassName, rootClassName)}\n classNames={{\n ...classNames,\n wrapper: cls(\n \"modal-wrap\",\n size == \"fullscreen\" && \"modal-fullscreen\",\n isContentOverflow && \"modal-content-overflow\",\n bodyScrollable === false && \"modal-no-body-scroll\",\n loading && \"modal-loading\",\n defaultFixedHeaderFooter || isContentOverflow || size == \"fullscreen\"\n ? \"modal-fixed\"\n : \"\",\n ),\n }}\n styles={modalStyles}\n modalRender={(modal) => (\n <div ref={modalInnerRef} className={cls(\"modal-inner\")}>\n {modal}\n </div>\n )}\n okButtonProps={modalOkButtonProps}\n cancelButtonProps={modalCancelButtonProps}\n onOk={(e) => {\n if (uncontrolledOpen) setInternalOpen(false);\n onOk?.(e);\n }}\n onCancel={(e) => {\n if (confirmLoading) return;\n if (uncontrolledOpen) setInternalOpen(false);\n onCancel?.(e);\n }}\n okText={okText}\n cancelText={cancelText}\n okType=\"primary\"\n confirmLoading={confirmLoading}\n footer={\n typeof footer === \"undefined\"\n ? hideOkButton && hideCancelButton\n ? null\n : defaultFooter\n : footer\n }\n centered={centered}\n {...rest}\n >\n {children}\n {loading ? (\n <div className={cls(\"modal-loading-overlay\")}>\n <Spin />\n </div>\n ) : null}\n </AntModal>\n );\n};\n"],"names":["Modal","externalOpen","closeIcon","children","sizeProp","footer","width","style","styles","classNames","okButtonProps","cancelButtonProps","loading","onOk","onCancel","okText","okType","confirmLoading","cancelText","hideOkButton","hideCancelButton","contentPadding","title","afterTitle","beforeCloseButton","afterCloseButton","defaultFixedHeaderFooter","centered","type","defaultOpen","backgroundProp","bodyScrollable","rootClassName","rest","defaultCloseIcon","jsx","XIcon","size","modalWidth","ModalSize","sizeTracking","setSizeTracking","useState","background","modalStyle","useMemo","modalStyles","isContentOverflow","setIsContentOverflow","cls","useCls","themeClassName","useTheme","resizeObserverRef","useRef","modalInnerRef","useCallback","node","modalBody","modalHeader","modalFooter","resizeObserverHandler","hasOverflow","prev","resizeObserver","useEffect","locale","useLocale","getConfirmLocale","okTextLocale","cancelTextLocale","modalOkButtonProps","modalCancelButtonProps","internalOpen","setInternalOpen","uncontrolledOpen","open","handleCancel","useStableCallback","modalContextValue","defaultFooter","ModalContextProvider","NormalCancelBtn","NormalOkBtn","jsxs","Fragment","AntModal","Stack","Truncate","IconButton","clsx","modal","Spin"],"mappings":";;;;;;;;;;;;;;;;;;;AAsHO,MAAMA,KAAQ,CAAC;AAAA,EACpB,MAAMC;AAAA,EACN,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAMC;AAAA,EACN,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,0BAAAC,KAA2B;AAAA,EAC3B,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