@bioturing/components 0.39.1 → 0.41.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/base.d.ts +35 -1
  2. package/dist/base.d.ts.map +1 -1
  3. package/dist/base.js +47 -1
  4. package/dist/base.js.map +1 -1
  5. package/dist/components/alert/component.d.ts +61 -0
  6. package/dist/components/alert/component.d.ts.map +1 -0
  7. package/dist/components/alert/component.js +76 -0
  8. package/dist/components/alert/component.js.map +1 -0
  9. package/dist/components/alert/index.d.ts +2 -0
  10. package/dist/components/alert/index.d.ts.map +1 -0
  11. package/dist/components/alert/style.css +1 -0
  12. package/dist/components/base-menu/component.d.ts +1 -1
  13. package/dist/components/base-menu/index.d.ts +1 -1
  14. package/dist/components/base-menu/index.d.ts.map +1 -1
  15. package/dist/components/base-menu/item.d.ts +1 -1
  16. package/dist/components/base-menu/item.d.ts.map +1 -1
  17. package/dist/components/base-menu/item.js +1 -1
  18. package/dist/components/base-menu/item.js.map +1 -1
  19. package/dist/components/button/component.d.ts +1 -1
  20. package/dist/components/button/component.d.ts.map +1 -1
  21. package/dist/components/button/component.js +18 -17
  22. package/dist/components/button/component.js.map +1 -1
  23. package/dist/components/button/style.css +1 -1
  24. package/dist/components/checkbox/component.d.ts.map +1 -1
  25. package/dist/components/choice-list/component.d.ts +8 -4
  26. package/dist/components/choice-list/component.d.ts.map +1 -1
  27. package/dist/components/choice-list/component.js +89 -94
  28. package/dist/components/choice-list/component.js.map +1 -1
  29. package/dist/components/color-select/component.js +6 -6
  30. package/dist/components/combobox/component.js +1 -1
  31. package/dist/components/combobox/component.js.map +1 -1
  32. package/dist/components/command-palette/component.d.ts +6 -0
  33. package/dist/components/command-palette/component.d.ts.map +1 -1
  34. package/dist/components/command-palette/component.js +182 -63
  35. package/dist/components/command-palette/component.js.map +1 -1
  36. package/dist/components/command-palette/index.d.ts +3 -1
  37. package/dist/components/command-palette/index.d.ts.map +1 -1
  38. package/dist/components/command-palette/style.css +1 -1
  39. package/dist/components/drag-drop/draggable.js +1 -1
  40. package/dist/components/drag-drop/draggable.js.map +1 -1
  41. package/dist/components/drag-drop/droppable.js +1 -1
  42. package/dist/components/drag-drop/droppable.js.map +1 -1
  43. package/dist/components/drag-drop/types.d.ts +1 -1
  44. package/dist/components/drag-drop/types.d.ts.map +1 -1
  45. package/dist/components/drag-drop/value.js +13 -13
  46. package/dist/components/dropdown-menu/component.d.ts +1 -1
  47. package/dist/components/dropdown-menu/component.d.ts.map +1 -1
  48. package/dist/components/dropdown-menu/component.js +162 -135
  49. package/dist/components/dropdown-menu/component.js.map +1 -1
  50. package/dist/components/dropdown-menu/divider.js +2 -2
  51. package/dist/components/dropdown-menu/divider.js.map +1 -1
  52. package/dist/components/dropdown-menu/item.js +2 -2
  53. package/dist/components/dropdown-menu/item.js.map +1 -1
  54. package/dist/components/dropdown-menu/style.css +1 -1
  55. package/dist/components/dropdown-menu/useDropdownMenu.js +1 -1
  56. package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
  57. package/dist/components/hooks/antd.d.ts.map +1 -1
  58. package/dist/components/hooks/index.d.ts +1 -0
  59. package/dist/components/hooks/index.d.ts.map +1 -1
  60. package/dist/components/hooks/useBaseUIPlacement.d.ts +64 -0
  61. package/dist/components/hooks/useBaseUIPlacement.d.ts.map +1 -0
  62. package/dist/components/hooks/useBaseUIPlacement.js +61 -0
  63. package/dist/components/hooks/useBaseUIPlacement.js.map +1 -0
  64. package/dist/components/hooks/useControlledState.d.ts +1 -0
  65. package/dist/components/hooks/useControlledState.d.ts.map +1 -1
  66. package/dist/components/hooks/useControlledState.js +16 -16
  67. package/dist/components/hooks/useControlledState.js.map +1 -1
  68. package/dist/components/hooks/useTransitionStatus.js +2 -2
  69. package/dist/components/hooks/useTransitionStatus.js.map +1 -1
  70. package/dist/components/icon-button/style.css +1 -1
  71. package/dist/components/index.d.ts +3 -2
  72. package/dist/components/index.d.ts.map +1 -1
  73. package/dist/components/nav/index.d.ts.map +1 -1
  74. package/dist/components/nav/item.d.ts +1 -1
  75. package/dist/components/nav/item.d.ts.map +1 -1
  76. package/dist/components/nav/item.js +1 -1
  77. package/dist/components/nav/item.js.map +1 -1
  78. package/dist/components/popup-panel/component.d.ts +4 -4
  79. package/dist/components/popup-panel/component.d.ts.map +1 -1
  80. package/dist/components/popup-panel/component.js +142 -152
  81. package/dist/components/popup-panel/component.js.map +1 -1
  82. package/dist/components/resizable/component.js +1 -1
  83. package/dist/components/resizable/component.js.map +1 -1
  84. package/dist/components/scroll-area/component.d.ts +1 -1
  85. package/dist/components/scroll-area/component.d.ts.map +1 -1
  86. package/dist/components/scroll-area/component.js +1 -1
  87. package/dist/components/scroll-area/component.js.map +1 -1
  88. package/dist/components/select/component.d.ts.map +1 -1
  89. package/dist/components/select/component.js +153 -138
  90. package/dist/components/select/component.js.map +1 -1
  91. package/dist/components/select/item.js +13 -13
  92. package/dist/components/select-trigger/component.js +19 -19
  93. package/dist/components/splitter/splitter.d.ts.map +1 -1
  94. package/dist/components/splitter/splitter.js +53 -51
  95. package/dist/components/splitter/splitter.js.map +1 -1
  96. package/dist/components/stack/StackChild.js +2 -2
  97. package/dist/components/stack/StackChild.js.map +1 -1
  98. package/dist/components/toast/component.d.ts +1 -1
  99. package/dist/components/toast/component.d.ts.map +1 -1
  100. package/dist/components/toast/component.js +1 -1
  101. package/dist/components/toast/component.js.map +1 -1
  102. package/dist/components/toast/function.d.ts +2 -2
  103. package/dist/components/toast/function.d.ts.map +1 -1
  104. package/dist/components/toast/function.js +1 -1
  105. package/dist/components/toast/function.js.map +1 -1
  106. package/dist/components/transition/component.d.ts +1 -1
  107. package/dist/components/transition/component.d.ts.map +1 -1
  108. package/dist/components/transition/component.js +2 -2
  109. package/dist/components/transition/component.js.map +1 -1
  110. package/dist/components/tree/useTreeCommon.d.ts.map +1 -1
  111. package/dist/components/utils/WithRenderProp.d.ts +1 -1
  112. package/dist/components/utils/WithRenderProp.d.ts.map +1 -1
  113. package/dist/components/utils/WithRenderProp.js +1 -1
  114. package/dist/components/utils/WithRenderProp.js.map +1 -1
  115. package/dist/components/utils/index.d.ts +1 -0
  116. package/dist/components/utils/index.d.ts.map +1 -1
  117. package/dist/components/utils/renderProp.d.ts +24 -0
  118. package/dist/components/utils/renderProp.d.ts.map +1 -0
  119. package/dist/components/utils/renderProp.js +19 -0
  120. package/dist/components/utils/renderProp.js.map +1 -0
  121. package/dist/components/vertical-collapsible-panel/component.js +1 -1
  122. package/dist/components/vertical-collapsible-panel/component.js.map +1 -1
  123. package/dist/index.js +271 -266
  124. package/dist/index.js.map +1 -1
  125. package/dist/metadata.d.ts +9 -0
  126. package/dist/metadata.d.ts.map +1 -1
  127. package/dist/metadata.js +29 -14
  128. package/dist/metadata.js.map +1 -1
  129. package/dist/stats.html +1 -1
  130. package/dist/tailwind.css +125 -1
  131. package/package.json +4 -4
  132. package/dist/components/cmdk/command-score.d.ts +0 -2
  133. package/dist/components/cmdk/command-score.d.ts.map +0 -1
  134. package/dist/components/cmdk/command-score.js +0 -48
  135. package/dist/components/cmdk/command-score.js.map +0 -1
  136. package/dist/components/cmdk/index.d.ts +0 -440
  137. package/dist/components/cmdk/index.d.ts.map +0 -1
  138. package/dist/components/cmdk/index.js +0 -595
  139. package/dist/components/cmdk/index.js.map +0 -1
package/dist/base.d.ts CHANGED
@@ -1,2 +1,36 @@
1
- export * from '@base-ui-components/react';
1
+ export * from '@base-ui/react';
2
+ export { isWebKit, isIOS, isFirefox, isSafari, isEdge, isAndroid, isMac, isJSDOM as isJSDOMFromDetectBrowser, } from '@base-ui/utils/detectBrowser';
3
+ export { isJSDOM, expectType, type IfEquals } from '@base-ui/utils/testUtils';
4
+ export * from '@base-ui/utils/empty';
5
+ export * from '@base-ui/utils/error';
6
+ export * from '@base-ui/utils/fastObjectShallowCompare';
7
+ export * from '@base-ui/utils/formatErrorMessage';
8
+ export * from '@base-ui/utils/generateId';
9
+ export * from '@base-ui/utils/getReactElementRef';
10
+ export * from '@base-ui/utils/inertValue';
11
+ export * from '@base-ui/utils/isElementDisabled';
12
+ export * from '@base-ui/utils/isMouseWithinBounds';
13
+ export * from '@base-ui/utils/mergeObjects';
14
+ export * from '@base-ui/utils/owner';
15
+ export * from '@base-ui/utils/reactVersion';
16
+ export * from '@base-ui/utils/safeReact';
17
+ export * from '@base-ui/utils/useAnimationFrame';
18
+ export * from '@base-ui/utils/useControlled';
19
+ export * from '@base-ui/utils/useEnhancedClickHandler';
20
+ export * from '@base-ui/utils/useForcedRerendering';
21
+ export * from '@base-ui/utils/useId';
22
+ export * from '@base-ui/utils/useInterval';
23
+ export * from '@base-ui/utils/useIsoLayoutEffect';
24
+ export * from '@base-ui/utils/useMergedRefs';
25
+ export * from '@base-ui/utils/useOnFirstRender';
26
+ export * from '@base-ui/utils/useOnMount';
27
+ export * from '@base-ui/utils/usePreviousValue';
28
+ export * from '@base-ui/utils/useRefWithInit';
29
+ export * from '@base-ui/utils/useScrollLock';
30
+ export * from '@base-ui/utils/useStableCallback';
31
+ export * from '@base-ui/utils/useTimeout';
32
+ export * from '@base-ui/utils/useValueAsRef';
33
+ export * from '@base-ui/utils/visuallyHidden';
34
+ export * from '@base-ui/utils/warn';
35
+ export * from '@base-ui/utils/store';
2
36
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAO/B,OAAO,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,IAAI,wBAAwB,GACpC,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAG9E,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC"}
package/dist/base.js CHANGED
@@ -1,2 +1,48 @@
1
- export * from "@base-ui-components/react";
1
+ export * from "@base-ui/react";
2
+ import { isAndroid as t, isEdge as f, isFirefox as p, isIOS as x, isJSDOM as m, isMac as i, isSafari as s, isWebKit as S } from "@base-ui/utils/detectBrowser";
3
+ import { expectType as D, isJSDOM as M } from "@base-ui/utils/testUtils";
4
+ export * from "@base-ui/utils/empty";
5
+ export * from "@base-ui/utils/error";
6
+ export * from "@base-ui/utils/fastObjectShallowCompare";
7
+ export * from "@base-ui/utils/formatErrorMessage";
8
+ export * from "@base-ui/utils/generateId";
9
+ export * from "@base-ui/utils/getReactElementRef";
10
+ export * from "@base-ui/utils/inertValue";
11
+ export * from "@base-ui/utils/isElementDisabled";
12
+ export * from "@base-ui/utils/isMouseWithinBounds";
13
+ export * from "@base-ui/utils/mergeObjects";
14
+ export * from "@base-ui/utils/owner";
15
+ export * from "@base-ui/utils/reactVersion";
16
+ export * from "@base-ui/utils/safeReact";
17
+ export * from "@base-ui/utils/useAnimationFrame";
18
+ export * from "@base-ui/utils/useControlled";
19
+ export * from "@base-ui/utils/useEnhancedClickHandler";
20
+ export * from "@base-ui/utils/useForcedRerendering";
21
+ export * from "@base-ui/utils/useId";
22
+ export * from "@base-ui/utils/useInterval";
23
+ export * from "@base-ui/utils/useIsoLayoutEffect";
24
+ export * from "@base-ui/utils/useMergedRefs";
25
+ export * from "@base-ui/utils/useOnFirstRender";
26
+ export * from "@base-ui/utils/useOnMount";
27
+ export * from "@base-ui/utils/usePreviousValue";
28
+ export * from "@base-ui/utils/useRefWithInit";
29
+ export * from "@base-ui/utils/useScrollLock";
30
+ export * from "@base-ui/utils/useStableCallback";
31
+ export * from "@base-ui/utils/useTimeout";
32
+ export * from "@base-ui/utils/useValueAsRef";
33
+ export * from "@base-ui/utils/visuallyHidden";
34
+ export * from "@base-ui/utils/warn";
35
+ export * from "@base-ui/utils/store";
36
+ export {
37
+ D as expectType,
38
+ t as isAndroid,
39
+ f as isEdge,
40
+ p as isFirefox,
41
+ x as isIOS,
42
+ M as isJSDOM,
43
+ m as isJSDOMFromDetectBrowser,
44
+ i as isMac,
45
+ s as isSafari,
46
+ S as isWebKit
47
+ };
2
48
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"base.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,61 @@
1
+ import { default as React } from 'react';
2
+ export interface AlertProps {
3
+ /**
4
+ * Type of alert
5
+ * @default "info"
6
+ */
7
+ type?: "success" | "info" | "warning" | "error" | "instruction";
8
+ /**
9
+ * Content of the alert message
10
+ */
11
+ message?: React.ReactNode;
12
+ /**
13
+ * Additional content of the alert
14
+ */
15
+ description?: React.ReactNode;
16
+ /**
17
+ * Whether to show icon
18
+ * @default true
19
+ */
20
+ showIcon?: boolean;
21
+ /**
22
+ * Custom icon, effective when showIcon is true
23
+ */
24
+ icon?: React.ReactNode;
25
+ /**
26
+ * Whether alert can be closed
27
+ * @default false
28
+ */
29
+ closable?: boolean;
30
+ /**
31
+ * Custom close icon
32
+ */
33
+ closeIcon?: React.ReactNode;
34
+ /**
35
+ * Callback when close animation is finished
36
+ */
37
+ afterClose?: () => void;
38
+ /**
39
+ * Callback when close
40
+ */
41
+ onClose?: (e: React.MouseEvent<HTMLButtonElement>) => void;
42
+ /**
43
+ * Custom action
44
+ */
45
+ action?: React.ReactNode;
46
+ /**
47
+ * Whether to show as banner
48
+ * @default false
49
+ */
50
+ banner?: boolean;
51
+ /**
52
+ * Additional class name
53
+ */
54
+ className?: string;
55
+ /**
56
+ * Additional styles
57
+ */
58
+ style?: React.CSSProperties;
59
+ }
60
+ export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
61
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/alert/component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAW7D,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;IAEhE;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAE3D;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAwGD,eAAO,MAAM,KAAK,mFAAyB,CAAC"}
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
3
+ import { forwardRef as M, useState as R, useMemo as f } from "react";
4
+ import { LightbulbIcon as S, InfoIcon as T, WarningIcon as X, XCircleIcon as _, CheckCircleIcon as $, XIcon as z } from "@bioturing/assets";
5
+ import './style.css';/* empty css */
6
+ import { useCls as B } from "../utils/antdUtils.js";
7
+ import { IconButton as D } from "../icon-button/component.js";
8
+ import { cn as E } from "../utils/cn.js";
9
+ const O = {
10
+ success: $,
11
+ error: _,
12
+ warning: X,
13
+ info: T,
14
+ instruction: S
15
+ }, P = ({
16
+ type: n = "info",
17
+ message: i,
18
+ description: t,
19
+ showIcon: h = !0,
20
+ icon: l,
21
+ closable: o = !1,
22
+ closeIcon: a,
23
+ afterClose: N,
24
+ onClose: I,
25
+ action: m,
26
+ banner: C = !1,
27
+ className: p,
28
+ style: v,
29
+ ...w
30
+ }, A) => {
31
+ const e = B(), [g, x] = R(!1), b = (c) => {
32
+ x(!0), I?.(c), setTimeout(() => {
33
+ N?.();
34
+ }, 300);
35
+ }, s = h, j = !!t, u = f(() => {
36
+ if (!s) return null;
37
+ if (l) return l;
38
+ const c = O[n];
39
+ return /* @__PURE__ */ r(c, { weight: "fill", className: e(`alert-icon-${n}`) });
40
+ }, [l, n, s, e]), k = f(() => o ? /* @__PURE__ */ r(
41
+ D,
42
+ {
43
+ size: "small",
44
+ onClick: b,
45
+ className: e("alert-close"),
46
+ children: a ?? /* @__PURE__ */ r(z, {})
47
+ }
48
+ ) : null, [o, a, e]);
49
+ if (g) return null;
50
+ const L = E(
51
+ e("alert"),
52
+ e(`alert-${n}`),
53
+ {
54
+ [e("alert-with-description")]: j,
55
+ [e("alert-no-icon")]: !s,
56
+ [e("alert-banner")]: C,
57
+ [e("alert-closable")]: o,
58
+ [e("alert-instruction")]: n === "instruction"
59
+ },
60
+ p
61
+ );
62
+ return /* @__PURE__ */ d("div", { ref: A, className: L, style: v, role: "alert", ...w, children: [
63
+ u && /* @__PURE__ */ r("div", { className: e("alert-icon"), children: u }),
64
+ /* @__PURE__ */ d("div", { className: e("alert-content"), children: [
65
+ i && /* @__PURE__ */ r("div", { className: e("alert-message"), children: i }),
66
+ t && /* @__PURE__ */ r("div", { className: e("alert-description"), children: t }),
67
+ m && /* @__PURE__ */ r("div", { className: e("alert-action"), children: m })
68
+ ] }),
69
+ k
70
+ ] });
71
+ }, W = M(P);
72
+ W.displayName = "Alert";
73
+ export {
74
+ W as Alert
75
+ };
76
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/alert/component.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useState, useMemo } from \"react\";\nimport { useCls, cn } from \"../utils\";\nimport {\n CheckCircleIcon,\n XCircleIcon,\n WarningIcon,\n InfoIcon,\n LightbulbIcon,\n XIcon,\n} from \"@bioturing/assets\";\nimport { IconButton } from \"../icon-button\";\nimport \"./style.css\";\n\nexport interface AlertProps {\n /**\n * Type of alert\n * @default \"info\"\n */\n type?: \"success\" | \"info\" | \"warning\" | \"error\" | \"instruction\";\n\n /**\n * Content of the alert message\n */\n message?: React.ReactNode;\n\n /**\n * Additional content of the alert\n */\n description?: React.ReactNode;\n\n /**\n * Whether to show icon\n * @default true\n */\n showIcon?: boolean;\n\n /**\n * Custom icon, effective when showIcon is true\n */\n icon?: React.ReactNode;\n\n /**\n * Whether alert can be closed\n * @default false\n */\n closable?: boolean;\n\n /**\n * Custom close icon\n */\n closeIcon?: React.ReactNode;\n\n /**\n * Callback when close animation is finished\n */\n afterClose?: () => void;\n\n /**\n * Callback when close\n */\n onClose?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /**\n * Custom action\n */\n action?: React.ReactNode;\n\n /**\n * Whether to show as banner\n * @default false\n */\n banner?: boolean;\n\n /**\n * Additional class name\n */\n className?: string;\n\n /**\n * Additional styles\n */\n style?: React.CSSProperties;\n}\n\nconst ALERT_ICON_MAP = {\n success: CheckCircleIcon,\n error: XCircleIcon,\n warning: WarningIcon,\n info: InfoIcon,\n instruction: LightbulbIcon,\n};\n\nconst AlertInner = (\n {\n type = \"info\",\n message,\n description,\n showIcon = true,\n icon,\n closable = false,\n closeIcon,\n afterClose,\n onClose,\n action,\n banner = false,\n className,\n style,\n ...rest\n }: AlertProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const cls = useCls();\n const [closed, setClosed] = useState(false);\n\n const handleClose = (e: React.MouseEvent<HTMLButtonElement>) => {\n setClosed(true);\n onClose?.(e);\n // Call afterClose after animation\n setTimeout(() => {\n afterClose?.();\n }, 300);\n };\n\n // Determine if icon should be shown\n const isShowIcon = showIcon;\n const withDescription = !!description;\n\n // Render icon\n const iconNode = useMemo(() => {\n if (!isShowIcon) return null;\n\n if (icon) return icon;\n\n const IconComponent = ALERT_ICON_MAP[type];\n return (\n <IconComponent weight=\"fill\" className={cls(`alert-icon-${type}`)} />\n );\n }, [icon, type, isShowIcon, cls]);\n\n // Render close button\n const closeNode = useMemo(() => {\n if (!closable) return null;\n\n return (\n <IconButton\n size=\"small\"\n onClick={handleClose}\n className={cls(\"alert-close\")}\n >\n {closeIcon ?? <XIcon />}\n </IconButton>\n );\n }, [closable, closeIcon, cls]);\n\n if (closed) return null;\n\n const alertCls = cn(\n cls(\"alert\"),\n cls(`alert-${type}`),\n {\n [cls(\"alert-with-description\")]: withDescription,\n [cls(\"alert-no-icon\")]: !isShowIcon,\n [cls(\"alert-banner\")]: banner,\n [cls(\"alert-closable\")]: closable,\n [cls(\"alert-instruction\")]: type === \"instruction\",\n },\n className\n );\n\n return (\n <div ref={ref} className={alertCls} style={style} role=\"alert\" {...rest}>\n {iconNode && <div className={cls(\"alert-icon\")}>{iconNode}</div>}\n\n <div className={cls(\"alert-content\")}>\n {message && <div className={cls(\"alert-message\")}>{message}</div>}\n {description && (\n <div className={cls(\"alert-description\")}>{description}</div>\n )}\n {action && <div className={cls(\"alert-action\")}>{action}</div>}\n </div>\n\n {closeNode}\n </div>\n );\n};\n\nexport const Alert = forwardRef(AlertInner);\n\nAlert.displayName = \"Alert\";\n"],"names":["ALERT_ICON_MAP","CheckCircleIcon","XCircleIcon","WarningIcon","InfoIcon","LightbulbIcon","AlertInner","type","message","description","showIcon","icon","closable","closeIcon","afterClose","onClose","action","banner","className","style","rest","ref","cls","useCls","closed","setClosed","useState","handleClose","e","isShowIcon","withDescription","iconNode","useMemo","IconComponent","jsx","closeNode","IconButton","XIcon","alertCls","cn","jsxs","Alert","forwardRef"],"mappings":";;;;;;;;AAsFA,MAAMA,IAAiB;AAAA,EACrB,SAASC;AAAA,EACT,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,MAAMC;AAAA,EACN,aAAaC;AACf,GAEMC,IAAa,CACjB;AAAA,EACE,MAAAC,IAAO;AAAA,EACP,SAAAC;AA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AAC,GAAG,CAACO;AAAA,MACzB,CAACP,EAAI,cAAc,CAAC,GAAGL;AAAA,MACvB,CAACK,EAAI,gBAAgB,CAAC,GAAGV;AAAA,MACzB,CAACU,EAAI,mBAAmB,CAAC,GAAGf,MAAS;AAAA,IAAA;AAAA,IAEvCW;AAAA,EAAA;AAGF,SACE,gBAAAsB,EAAC,SAAI,KAAAnB,GAAU,WAAWiB,GAAU,OAAAnB,GAAc,MAAK,SAAS,GAAGC,GAChE,UAAA;AAAA,IAAAW,uBAAa,OAAA,EAAI,WAAWT,EAAI,YAAY,GAAI,UAAAS,GAAS;AAAA,IAE1D,gBAAAS,EAAC,OAAA,EAAI,WAAWlB,EAAI,eAAe,GAChC,UAAA;AAAA,MAAAd,uBAAY,OAAA,EAAI,WAAWc,EAAI,eAAe,GAAI,UAAAd,GAAQ;AAAA,MAC1DC,KACC,gBAAAyB,EAAC,OAAA,EAAI,WAAWZ,EAAI,mBAAmB,GAAI,UAAAb,GAAY;AAAA,MAExDO,KAAU,gBAAAkB,EAAC,OAAA,EAAI,WAAWZ,EAAI,cAAc,GAAI,UAAAN,EAAA,CAAO;AAAA,IAAA,GAC1D;AAAA,IAECmB;AAAA,EAAA,GACH;AAEJ,GAEaM,IAAQC,EAAWpC,CAAU;AAE1CmC,EAAM,cAAc;"}
@@ -0,0 +1,2 @@
1
+ export * from './component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ @layer components{.ds-alert{position:relative;display:flex;align-items:flex-start;padding:.5rem .75rem;border-radius:.5rem;border:.0625rem solid transparent;gap:.5rem}.ds-alert-success{background-color:var(--ds-color-success-bg);border-color:var(--ds-color-success-border)}.ds-alert-info{background-color:var(--ds-color-info-bg);border-color:var(--ds-color-info-border)}.ds-alert-warning{background-color:var(--ds-color-warning-bg);border-color:var(--ds-color-warning-border)}.ds-alert-error{background-color:var(--ds-color-error-bg);border-color:var(--ds-color-error-border)}.ds-alert-instruction{background-color:var(--ds-color-fill-tertiary);border-color:var(--ds-color-border)}.ds-alert-banner{border-inline-start:0;border-inline-end:0;border-radius:0;padding-inline:.75rem}.ds-alert-banner.ds-alert-success,.ds-alert-banner.ds-alert-info,.ds-alert-banner.ds-alert-warning,.ds-alert-banner.ds-alert-error{border-color:transparent}.ds-alert-banner.ds-alert-instruction{border:none;background-color:var(--ds-color-fill-secondary)}.ds-alert-icon{display:flex;align-items:center;padding:.125rem 0;flex-shrink:0}.ds-alert-icon-success,.ds-alert-icon-error,.ds-alert-icon-warning,.ds-alert-icon-info,.ds-alert-icon-instruction{font-size:1.25rem;width:1.25rem;height:1.25rem}.ds-alert-icon .ds-alert-icon-success{color:var(--ds-color-success)}.ds-alert-icon .ds-alert-icon-error{color:var(--ds-color-error)}.ds-alert-icon .ds-alert-icon-warning{color:var(--ds-color-warning)}.ds-alert-icon .ds-alert-icon-info{color:var(--ds-color-primary)}.ds-alert-icon .ds-alert-icon-instruction{color:var(--ds-color-icon)}.ds-alert-content{flex:1;min-width:0}.ds-alert-message{color:var(--ds-color-text);font-size:.875rem;line-height:1.25rem;padding-top:.125rem;padding-bottom:.125rem}.ds-alert-with-description .ds-alert-message{font-weight:600;font-size:1rem;line-height:1.5rem;padding-top:0}.ds-alert-description{color:var(--ds-color-text);font-size:.875rem;line-height:1.25rem;margin-top:.125rem}.ds-alert-action{display:flex;align-items:flex-start;padding-top:.5rem;padding-bottom:.125rem;flex-shrink:0}.ds-alert-close{flex-shrink:0;padding-top:.125rem}}
@@ -5,7 +5,7 @@ export declare const BaseMenuContainer: React.ForwardRefExoticComponent<Omit<Rea
5
5
  export declare const BaseMenuList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
6
  export declare const BaseMenuSearch: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
7
  export declare const BaseMenuDivider: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
- render?: import("@base-ui-components/react").useRender.RenderProp<Record<string, unknown>>;
8
+ render?: import("@base-ui/react").useRender.RenderProp<Record<string, unknown>>;
9
9
  as?: "div";
10
10
  state?: Record<string, unknown>;
11
11
  } & React.RefAttributes<HTMLDivElement>>;
@@ -7,7 +7,7 @@ export declare const BaseMenu: {
7
7
  Search: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
8
8
  List: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
9
9
  Divider: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
- render?: import("@base-ui-components/react").useRender.RenderProp<Record<string, unknown>>;
10
+ render?: import("@base-ui/react").useRender.RenderProp<Record<string, unknown>>;
11
11
  as?: "div";
12
12
  state?: Record<string, unknown>;
13
13
  } & import('react').RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base-menu/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;2BASs9F,MAAO,GAAG,CAAC,iBAAiB;WAAqD,CAAC,EAAC,MAAO,YAAY;yCAAh5D,MAAO,GAAG,CAAC,iBAAiB,sMAAkU,MAAO,YAAY;CADjjD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base-menu/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAChD,eAAO,MAAM,QAAQ;;;;;;;;;;;;WAS4hG,CAAC;;CADjjG,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { default as React, ComponentPropsWithoutRef } from 'react';
2
2
  import { ElementTypeToDOMType } from '../utils/types';
3
- import { useRender } from '@base-ui-components/react';
3
+ import { useRender } from '@base-ui/react';
4
4
  export type BaseMenuItemProps<T extends keyof React.JSX.IntrinsicElements = "div"> = ComponentPropsWithoutRef<T> & {
5
5
  /** Whether the item is disabled */
6
6
  disabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/base-menu/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,MAAM,iBAAiB,CAC3B,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,IACjD,wBAAwB,CAAC,CAAC,CAAC,GAAG;IAChC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAu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C,KAAK,CAAC,YAAY,CAAC;IACxB,2CAA2C;IAC3C,UAAU,CAAC,EAAE;QACX,4CAA4C;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,oCAAoC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,oCAAoC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,sCAAsC;QACtC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC;IAC9B,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,EAC5E,+JAiBG,iBAAiB,CAAC,CAAC,CAAC,EACvB,KAAK,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SA0DjD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAoC,CAC3D,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,EAEnD,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG;IAC5B,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CACnD,KACE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -2,7 +2,7 @@ import { jsxs as v, Fragment as R, jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as j } from "react";
3
3
  import { Checkbox as k } from "antd";
4
4
  import './item.css';/* empty css */
5
- import { useRender as B } from "@base-ui-components/react";
5
+ import { useRender as B } from "@base-ui/react";
6
6
  import { useCls as E } from "../utils/antdUtils.js";
7
7
  import { clsx as a } from "../utils/cn.js";
8
8
  import { WithRenderProp as M } from "../utils/WithRenderProp.js";
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sources":["../../../src/components/base-menu/item.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { clsx, useCls, WithRenderProp } from \"../utils\";\nimport { ElementTypeToDOMType } from \"../utils/types\";\nimport { Checkbox } from \"antd\";\n\nimport \"./item.css\";\n\nimport { useRender } from \"@base-ui-components/react\";\n\nexport type BaseMenuItemProps<\n T extends keyof React.JSX.IntrinsicElements = \"div\"\n> = ComponentPropsWithoutRef<T> & {\n /** Whether the item is disabled */\n disabled?: boolean;\n /** Whether the item represents a dangerous action */\n danger?: boolean;\n /** Whether the item is currently selected */\n selected?: boolean;\n /** Whether the item is currently active/highlighted */\n active?: boolean;\n /** Whether the item has focus */\n focused?: boolean;\n /** Icon to display before the text */\n icon?: React.ReactNode;\n /** Text content of the item */\n children?: React.ReactNode;\n /** Suffix content to display after the text */\n suffix?: React.ReactNode;\n /** Whether to show checkbox */\n showCheckbox?: boolean;\n /** Whether the checkbox is indeterminate */\n indeterminate?: boolean;\n /** Custom render function for the item label */\n labelRender?: (\n props: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n /** Custom className for different parts */\n classNames?: {\n /** Custom className for the root element */\n root?: string;\n /** Custom className for the icon */\n icon?: string;\n /** Custom className for the text */\n text?: string;\n /** Custom className for the suffix */\n suffix?: string;\n };\n onSelect?: () => void;\n render?: useRender.RenderProp;\n as?: T;\n};\n\nconst BaseMenuItemInner = <T extends keyof React.JSX.IntrinsicElements = \"div\">(\n {\n disabled = false,\n danger = false,\n selected = false,\n active = false,\n focused = false,\n icon,\n children,\n suffix,\n showCheckbox = false,\n indeterminate = false,\n labelRender,\n classNames,\n render,\n onSelect,\n as,\n ...props\n }: BaseMenuItemProps<T>,\n ref: React.ForwardedRef<ElementTypeToDOMType<T>>\n) => {\n const cls = useCls();\n\n const content = (\n <>\n {showCheckbox && (\n <Checkbox\n checked={selected}\n tabIndex={-1}\n indeterminate={indeterminate}\n />\n )}\n {icon && (\n <span className={clsx(cls(\"menu-item-icon\"), classNames?.icon)}>\n {icon}\n </span>\n )}\n {children && (\n <WithRenderProp\n render={labelRender}\n as=\"span\"\n className={clsx(cls(\"menu-item-text\"), classNames?.text)}\n >\n {children}\n </WithRenderProp>\n )}\n {suffix && (\n <span className={clsx(cls(\"menu-item-suffix\"), classNames?.suffix)}>\n {suffix}\n </span>\n )}\n </>\n );\n\n const renderedElement = useRender({\n render: render || undefined,\n props: {\n ...props,\n className: clsx(\n // Base menu item styles\n cls(\"menu-item-base\"),\n showCheckbox && cls(\"menu-item-show-checkbox\"),\n classNames?.root\n ),\n \"data-disabled\": disabled,\n \"data-danger\": danger,\n \"data-selected\": selected,\n \"data-active\": active,\n \"data-focus\": focused,\n \"aria-disabled\": disabled,\n children: content,\n },\n ref: ref as unknown as React.Ref<ElementTypeToDOMType<T>>,\n defaultTagName: as || \"div\",\n });\n\n return renderedElement;\n};\n\nexport const BaseMenuItem = forwardRef(BaseMenuItemInner) as <\n T extends keyof React.JSX.IntrinsicElements = \"div\"\n>(\n props: BaseMenuItemProps<T> & {\n ref?: React.ForwardedRef<ElementTypeToDOMType<T>>;\n }\n) => ReturnType<typeof BaseMenuItemInner>;\n"],"names":["BaseMenuItemInner","disabled","danger","selected","active","focused","icon","children","suffix","showCheckbox","indeterminate","labelRender","classNames","render","onSelect","as","props","ref","cls","useCls","content","jsxs","Fragment","jsx","Checkbox","clsx","WithRenderProp","useRender","BaseMenuItem","forwardRef"],"mappings":";;;;;;;;AAoDA,MAAMA,IAAoB,CACxB;AAAA,EACE,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,SAAAC,IAAU;AAAA,EACV,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAAA,EAChB,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,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"],"sourcesContent":["import React, { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { clsx, useCls, WithRenderProp } from \"../utils\";\nimport { ElementTypeToDOMType } from \"../utils/types\";\nimport { Checkbox } from \"antd\";\n\nimport \"./item.css\";\n\nimport { useRender } from \"@base-ui/react\";\n\nexport type BaseMenuItemProps<\n T extends keyof React.JSX.IntrinsicElements = \"div\"\n> = ComponentPropsWithoutRef<T> & {\n /** Whether the item is disabled */\n disabled?: boolean;\n /** Whether the item represents a dangerous action */\n danger?: boolean;\n /** Whether the item is currently selected */\n selected?: boolean;\n /** Whether the item is currently active/highlighted */\n active?: boolean;\n /** Whether the item has focus */\n focused?: boolean;\n /** Icon to display before the text */\n icon?: React.ReactNode;\n /** Text content of the item */\n children?: React.ReactNode;\n /** Suffix content to display after the text */\n suffix?: React.ReactNode;\n /** Whether to show checkbox */\n showCheckbox?: boolean;\n /** Whether the checkbox is indeterminate */\n indeterminate?: boolean;\n /** Custom render function for the item label */\n labelRender?: (\n props: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n /** Custom className for different parts */\n classNames?: {\n /** Custom className for the root element */\n root?: string;\n /** Custom className for the icon */\n icon?: string;\n /** Custom className for the text */\n text?: string;\n /** Custom className for the suffix */\n suffix?: string;\n };\n onSelect?: () => void;\n render?: useRender.RenderProp;\n as?: T;\n};\n\nconst BaseMenuItemInner = <T extends keyof React.JSX.IntrinsicElements = \"div\">(\n {\n disabled = false,\n danger = false,\n selected = false,\n active = false,\n focused = false,\n icon,\n children,\n suffix,\n showCheckbox = false,\n indeterminate = false,\n labelRender,\n classNames,\n render,\n onSelect,\n as,\n ...props\n }: BaseMenuItemProps<T>,\n ref: React.ForwardedRef<ElementTypeToDOMType<T>>\n) => {\n const cls = useCls();\n\n const content = (\n <>\n {showCheckbox && (\n <Checkbox\n checked={selected}\n tabIndex={-1}\n indeterminate={indeterminate}\n />\n )}\n {icon && (\n <span className={clsx(cls(\"menu-item-icon\"), classNames?.icon)}>\n {icon}\n </span>\n )}\n {children && (\n <WithRenderProp\n render={labelRender}\n as=\"span\"\n className={clsx(cls(\"menu-item-text\"), classNames?.text)}\n >\n {children}\n </WithRenderProp>\n )}\n {suffix && (\n <span className={clsx(cls(\"menu-item-suffix\"), classNames?.suffix)}>\n {suffix}\n </span>\n )}\n </>\n );\n\n const renderedElement = useRender({\n render: render || undefined,\n props: {\n ...props,\n className: clsx(\n // Base menu item styles\n cls(\"menu-item-base\"),\n showCheckbox && cls(\"menu-item-show-checkbox\"),\n classNames?.root\n ),\n \"data-disabled\": disabled,\n \"data-danger\": danger,\n \"data-selected\": selected,\n \"data-active\": active,\n \"data-focus\": focused,\n \"aria-disabled\": disabled,\n children: content,\n },\n ref: ref as unknown as React.Ref<ElementTypeToDOMType<T>>,\n defaultTagName: as || \"div\",\n });\n\n return renderedElement;\n};\n\nexport const BaseMenuItem = forwardRef(BaseMenuItemInner) as <\n T extends keyof React.JSX.IntrinsicElements = \"div\"\n>(\n props: BaseMenuItemProps<T> & {\n ref?: React.ForwardedRef<ElementTypeToDOMType<T>>;\n }\n) => ReturnType<typeof BaseMenuItemInner>;\n"],"names":["BaseMenuItemInner","disabled","danger","selected","active","focused","icon","children","suffix","showCheckbox","indeterminate","labelRender","classNames","render","onSelect","as","props","ref","cls","useCls","content","jsxs","Fragment","jsx","Checkbox","clsx","WithRenderProp","useRender","BaseMenuItem","forwardRef"],"mappings":";;;;;;;;AAoDA,MAAMA,IAAoB,CACxB;AAAA,EACE,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,SAAAC,IAAU;AAAA,EACV,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAAA,EAChB,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EAC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({ negativeMargin, type, size, variant, icon, loading, classNames, ...rest }: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => import("react/jsx-runtime").JSX.Element;
9
+ declare const ButtonInner: ({ negativeMargin, type, size, variant, icon, loading, classNames, className, ...rest }: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => import("react/jsx-runtime").JSX.Element;
10
10
  export declare const Button: (props: ButtonProps & {
11
11
  ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;
12
12
  }) => ReturnType<typeof ButtonInner>;
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/button/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,IAAI,eAAe,EACpC,MAAM,gBAAgB,CAAC;AAOxB,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,WAAW,GACf,6EASG,WAAW,EACd,KAAK,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,4CA2CtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAA8B,CAC/C,KAAK,EAAE,WAAW,GAAG;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CACjE,KACE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/button/component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,IAAI,eAAe,EACpC,MAAM,gBAAgB,CAAC;AAOxB,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,WAAW,GACf,wFAUG,WAAW,EACd,KAAK,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,4CA2CtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAA8B,CAC/C,KAAK,EAAE,WAAW,GAAG;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;CACjE,KACE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import f from "antd/es/button";
4
- import { forwardRef as d } from "react";
5
- import { CircleNotchIcon as b } from "@bioturing/assets";
3
+ import d from "antd/es/button";
4
+ import { forwardRef as b } from "react";
5
+ import { CircleNotchIcon as g } from "@bioturing/assets";
6
6
  import './style.css';/* empty css */
7
- import { useCls as g } from "../utils/antdUtils.js";
8
- import { cn as w } from "../utils/cn.js";
9
- const N = ({
7
+ import { useCls as w } from "../utils/antdUtils.js";
8
+ import { cn as N } from "../utils/cn.js";
9
+ const x = ({
10
10
  negativeMargin: m = !0,
11
11
  type: t,
12
12
  size: e,
@@ -14,28 +14,29 @@ const N = ({
14
14
  icon: i,
15
15
  loading: c,
16
16
  classNames: p,
17
- ...a
18
- }, l) => {
19
- const u = m && (n === "text" || n === "link" || t == "text" || t === "link"), o = g(), s = /* @__PURE__ */ r(
20
- f,
17
+ className: a,
18
+ ...l
19
+ }, u) => {
20
+ const f = m && (n === "text" || n === "link" || t == "text" || t === "link"), o = w(), s = /* @__PURE__ */ r(
21
+ d,
21
22
  {
22
- ref: l,
23
+ ref: u,
23
24
  type: t,
24
25
  size: e,
25
26
  variant: n,
26
27
  icon: i,
27
28
  loading: c && {
28
- icon: /* @__PURE__ */ r(b, {})
29
+ icon: /* @__PURE__ */ r(g, {})
29
30
  },
30
- className: w(i && o("btn-with-icon")),
31
+ className: N(a, i && o("btn-with-icon")),
31
32
  classNames: {
32
33
  icon: c ? o("btn-loading-icon") : void 0,
33
34
  ...p
34
35
  },
35
- ...a
36
+ ...l
36
37
  }
37
38
  );
38
- return u ? /* @__PURE__ */ r(
39
+ return f ? /* @__PURE__ */ r(
39
40
  "span",
40
41
  {
41
42
  className: o(
@@ -46,8 +47,8 @@ const N = ({
46
47
  children: s
47
48
  }
48
49
  ) : s;
49
- }, v = d(N);
50
+ }, A = b(x);
50
51
  export {
51
- v as Button
52
+ A as Button
52
53
  };
53
54
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/button/component.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n default as AntdButton,\n type ButtonProps as AntdButtonProps,\n} from \"antd/es/button\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport { useCls } from \"../utils\";\nimport { cn } from \"../utils\";\nimport { CircleNotchIcon } from \"@bioturing/assets\";\nimport \"./style.css\";\n\nexport interface ButtonProps extends AntdButtonProps {\n /**\n * If true, negative margin will be applied to the text and link buttons to make it align with content\n * @default true\n */\n negativeMargin?: boolean;\n}\n\nconst ButtonInner = (\n {\n negativeMargin = true,\n type,\n size,\n variant,\n icon,\n loading,\n classNames,\n ...rest\n }: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) => {\n const useNegativeMargin =\n negativeMargin &&\n (variant === \"text\" ||\n variant === \"link\" ||\n type == \"text\" ||\n type === \"link\");\n const cls = useCls();\n // const iconNode = loading ? <Spin /> : icon;\n const renderedButton = (\n <AntdButton\n ref={ref}\n type={type}\n size={size}\n variant={variant}\n icon={icon}\n loading={\n loading && {\n icon: <CircleNotchIcon />,\n }\n }\n className={cn(icon && cls(\"btn-with-icon\"))}\n classNames={{\n icon: loading ? cls(\"btn-loading-icon\") : undefined,\n ...classNames,\n }}\n {...rest}\n />\n );\n return useNegativeMargin ? (\n <span\n className={cls(\n \"btn-wrapper\",\n \"btn-negative-margin-wrapper\",\n \"btn-wrapper-\" + size\n )}\n >\n {renderedButton}\n </span>\n ) : (\n renderedButton\n );\n};\n\nexport const Button = forwardRef(ButtonInner) as (\n props: ButtonProps & {\n ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;\n }\n) => ReturnType<typeof ButtonInner>;\n"],"names":["ButtonInner","negativeMargin","type","size","variant","icon","loading","classNames","rest","ref","useNegativeMargin","cls","useCls","renderedButton","jsx","AntdButton","CircleNotchIcon","cn","Button","forwardRef"],"mappings":";;;;;;;;AAsBA,MAAMA,IAAc,CAClB;AAAA,EACE,gBAAAC,IAAiB;AAAA,EACjB,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IACJT,MACCG,MAAY,UACXA,MAAY,UACZF,KAAQ,UACRA,MAAS,SACPS,IAAMC,EAAA,GAENC,IACJ,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAAP;AAAA,MACA,MAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,SACEC,KAAW;AAAA,QACT,wBAAOU,GAAA,CAAA,CAAgB;AAAA,MAAA;AAAA,MAG3B,WAAWC,EAAGZ,KAAQM,EAAI,eAAe,CAAC;AAAA,MAC1C,YAAY;AAAA,QACV,MAAML,IAAUK,EAAI,kBAAkB,IAAI;AAAA,QAC1C,GAAGJ;AAAA,MAAA;AAAA,MAEJ,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGR,SAAOE,IACL,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiBR;AAAA,MAAA;AAAA,MAGlB,UAAAU;AAAA,IAAA;AAAA,EAAA,IAGHA;AAEJ,GAEaK,IAASC,EAAWnB,CAAW;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/button/component.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n default as AntdButton,\n type ButtonProps as AntdButtonProps,\n} from \"antd/es/button\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport { useCls } from \"../utils\";\nimport { cn } from \"../utils\";\nimport { CircleNotchIcon } from \"@bioturing/assets\";\nimport \"./style.css\";\n\nexport interface ButtonProps extends AntdButtonProps {\n /**\n * If true, negative margin will be applied to the text and link buttons to make it align with content\n * @default true\n */\n negativeMargin?: boolean;\n}\n\nconst ButtonInner = (\n {\n negativeMargin = true,\n type,\n size,\n variant,\n icon,\n loading,\n classNames,\n className,\n ...rest\n }: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) => {\n const useNegativeMargin =\n negativeMargin &&\n (variant === \"text\" ||\n variant === \"link\" ||\n type == \"text\" ||\n type === \"link\");\n const cls = useCls();\n // const iconNode = loading ? <Spin /> : icon;\n const renderedButton = (\n <AntdButton\n ref={ref}\n type={type}\n size={size}\n variant={variant}\n icon={icon}\n loading={\n loading && {\n icon: <CircleNotchIcon />,\n }\n }\n className={cn(className, icon && cls(\"btn-with-icon\"))}\n classNames={{\n icon: loading ? cls(\"btn-loading-icon\") : undefined,\n ...classNames,\n }}\n {...rest}\n />\n );\n return useNegativeMargin ? (\n <span\n className={cls(\n \"btn-wrapper\",\n \"btn-negative-margin-wrapper\",\n \"btn-wrapper-\" + size\n )}\n >\n {renderedButton}\n </span>\n ) : (\n renderedButton\n );\n};\n\nexport const Button = forwardRef(ButtonInner) as (\n props: ButtonProps & {\n ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;\n }\n) => ReturnType<typeof ButtonInner>;\n"],"names":["ButtonInner","negativeMargin","type","size","variant","icon","loading","classNames","className","rest","ref","useNegativeMargin","cls","useCls","renderedButton","jsx","AntdButton","CircleNotchIcon","cn","Button","forwardRef"],"mappings":";;;;;;;;AAsBA,MAAMA,IAAc,CAClB;AAAA,EACE,gBAAAC,IAAiB;AAAA,EACjB,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IACJV,MACCG,MAAY,UACXA,MAAY,UACZF,KAAQ,UACRA,MAAS,SACPU,IAAMC,EAAA,GAENC,IACJ,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,MAAAR;AAAA,MACA,MAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,SACEC,KAAW;AAAA,QACT,wBAAOW,GAAA,CAAA,CAAgB;AAAA,MAAA;AAAA,MAG3B,WAAWC,EAAGV,GAAWH,KAAQO,EAAI,eAAe,CAAC;AAAA,MACrD,YAAY;AAAA,QACV,MAAMN,IAAUM,EAAI,kBAAkB,IAAI;AAAA,QAC1C,GAAGL;AAAA,MAAA;AAAA,MAEJ,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGR,SAAOE,IACL,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiBT;AAAA,MAAA;AAAA,MAGlB,UAAAW;AAAA,IAAA;AAAA,EAAA,IAGHA;AAEJ,GAEaK,IAASC,EAAWpB,CAAW;"}
@@ -1 +1 @@
1
- @layer components{span.ds-btn-icon{display:flex;align-items:center}.ds-btn-negative-margin-wrapper{display:inline-flex;flex-shrink:0}.ds-btn-negative-margin-wrapper,.ds-btn-negative-margin-wrapper.ds-btn-wrapper-lg{margin-inline:-1rem}.ds-btn-negative-margin-wrapper.ds-btn-wrapper-sm{margin-inline:-.5rem}.ds-btn-loading-icon svg{animation:spin 1s linear infinite}.ds-btn-loading:not(.ds-btn-with-icon) .ds-btn-loading-icon{position:absolute}.ds-btn-loading:not(.ds-btn-with-icon)>*:not(.ds-btn-loading-icon){opacity:0}}
1
+ @layer components{span.ds-btn-icon{display:flex;align-items:center}.ds-btn-negative-margin-wrapper{display:inline-flex;flex-shrink:0}.ds-btn-negative-margin-wrapper,.ds-btn-negative-margin-wrapper.ds-btn-wrapper-large{margin-inline:-1rem}.ds-btn-negative-margin-wrapper.ds-btn-wrapper-small{margin-inline:-.5rem}.ds-btn-loading-icon svg{animation:spin 1s linear infinite}.ds-btn-loading:not(.ds-btn-with-icon) .ds-btn-loading-icon{position:absolute}.ds-btn-loading:not(.ds-btn-with-icon)>*:not(.ds-btn-loading-icon){opacity:0}}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/component.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,MAAM,CAAC;AAKd,OAAO,aAAa,CAAC;AAGrB,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC;AAGD,QAAA,MAAM,iBAAiB,GACrB,kCAA8C,aAAa,EAC3D,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,4CASvD,CAAC;AAUF,eAAO,MAAM,QAAQ,WANZ,aAAa,GAAG;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC;CAClE,KACE,UAAU,CAAC,OAAO,iBAAiB,CAAC;+EAFG,MAAO,aAAa,qBAEtD,MAAO,YAAY;CAK3B,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/component.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,MAAM,CAAC;AAKd,OAAO,aAAa,CAAC;AAGrB,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC;AAGD,QAAA,MAAM,iBAAiB,GACrB,kCAA8C,aAAa,EAC3D,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,4CASvD,CAAC;AAUF,eAAO,MAAM,QAAQ,WANZ,aAAa,GAAG;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC;CAClE,KACE,UAAU,CAAC,OAAO,iBAAiB,CAAC;;CAKvC,CAAC"}
@@ -1,15 +1,15 @@
1
- import { Command, CommandProps } from '../cmdk';
1
+ import { Input } from '../input';
2
2
  export type ChoiceListOption = {
3
3
  label: React.ReactNode;
4
4
  value?: string;
5
5
  };
6
- export interface ChoiceListProps<M extends boolean = false> extends Omit<CommandProps, "value" | "onChange" | "defaultValue"> {
6
+ export interface ChoiceListProps<M extends boolean = false> {
7
7
  options: ChoiceListOption[];
8
8
  multiple?: M;
9
9
  value?: M extends true ? string[] : string;
10
10
  defaultValue?: M extends true ? string[] : string;
11
11
  onChange?: (value: M extends true ? string[] : string) => void;
12
- searchProps?: React.ComponentProps<typeof Command.Input>;
12
+ searchProps?: React.ComponentProps<typeof Input.Search>;
13
13
  /**
14
14
  * Show select all option when in multiple mode
15
15
  * @default false
@@ -30,6 +30,10 @@ export interface ChoiceListProps<M extends boolean = false> extends Omit<Command
30
30
  * @default (item) => [item.value, reactNodeToString(item.label)]
31
31
  */
32
32
  getItemKeywords?: (item: ChoiceListOption) => string[];
33
+ /**
34
+ * Additional CSS class name
35
+ */
36
+ className?: string;
33
37
  }
34
- export declare const ChoiceList: <M extends boolean = false>({ options, multiple, value, defaultValue, onChange, searchProps, showSelectAll, className, placeholder, disabled: disabledProp, status: statusProp, getItemKeywords, ...rest }: ChoiceListProps<M>) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const ChoiceList: <M extends boolean = false>({ options, multiple, value, defaultValue, onChange, searchProps, showSelectAll, className, placeholder, disabled: disabledProp, status: statusProp, }: ChoiceListProps<M>) => import("react/jsx-runtime").JSX.Element;
35
39
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/choice-list/component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,CACxD,SAAQ,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;IACjE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACzD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MA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