abrplus-ui-kit 1.0.7 → 1.0.8

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 (55) hide show
  1. package/dist/antOverrides.cjs.js +1 -127
  2. package/dist/antOverrides.es.js +70 -98
  3. package/dist/atoms.cjs.js +1 -391
  4. package/dist/atoms.es.js +252 -306
  5. package/dist/colors-BDQwGpaB.cjs +5 -0
  6. package/dist/{colors-CztsZ6e_.js → colors-BW-NR0oP.js} +30 -34
  7. package/dist/deepMerge-2zqLIrFM.cjs +1 -0
  8. package/dist/deepMerge-Dm_AZi0Z.js +14 -0
  9. package/dist/index-B1HRk2-g.cjs +1 -0
  10. package/dist/index-BCH1vT85.js +8 -0
  11. package/dist/index-BJmt8SSx.cjs +1 -0
  12. package/dist/index-BPqX2Hsu.js +75 -0
  13. package/dist/{index-B02Mlfa4.js → index-BRLLsEKX.js} +19905 -19821
  14. package/dist/index-BeP9-mrf.js +200 -0
  15. package/dist/index-Bpx-uyOR.cjs +1 -0
  16. package/dist/index-CpGdrWps.js +19 -0
  17. package/dist/index-CwKyw6uN.cjs +1 -0
  18. package/dist/index-CzPs2mPX.js +478 -0
  19. package/dist/index-QraJKad8.cjs +1 -0
  20. package/dist/index-R9oQ5kp6.js +1569 -0
  21. package/dist/index-bNh4-ggT.cjs +1 -0
  22. package/dist/index-lDQ4dr86.cjs +1 -0
  23. package/dist/index.cjs.js +1 -109
  24. package/dist/index.css +1 -1519
  25. package/dist/index.es.js +5 -5
  26. package/dist/index2.css +1 -3
  27. package/dist/molecules.cjs.js +8 -7826
  28. package/dist/molecules.es.js +4270 -6306
  29. package/dist/organisms.cjs.js +1 -940
  30. package/dist/organisms.es.js +651 -758
  31. package/dist/provider.cjs.js +1 -48
  32. package/dist/provider.es.js +29 -34
  33. package/dist/sortable.esm-BSCvBWLi.js +2943 -0
  34. package/dist/sortable.esm-CA8VbUF-.cjs +5 -0
  35. package/dist/theme.css +1 -102
  36. package/dist/types/components/atoms/icon/constants/iconNames.d.ts +1 -1
  37. package/package.json +4 -4
  38. package/dist/colors-TPZkyKI4.cjs +0 -2212
  39. package/dist/deepMerge-CG1he8ZD.js +0 -20
  40. package/dist/deepMerge-Cn27K7-s.cjs +0 -19
  41. package/dist/index-B1Z0XlNV.cjs +0 -542
  42. package/dist/index-CCvWoynu.cjs +0 -12
  43. package/dist/index-CVNEow23.js +0 -543
  44. package/dist/index-Cbtrrxcv.js +0 -90
  45. package/dist/index-CiSH4Pqy.js +0 -266
  46. package/dist/index-Crz4ws0L.js +0 -1630
  47. package/dist/index-D-q_-bu0.cjs +0 -1629
  48. package/dist/index-DLUd_0LP.js +0 -13
  49. package/dist/index-DM-zAoQS.cjs +0 -89
  50. package/dist/index-DPvG_H_Y.cjs +0 -27
  51. package/dist/index-DdzyIn4u.js +0 -28
  52. package/dist/index-DsPAgC23.cjs +0 -37937
  53. package/dist/index-PyheoujP.cjs +0 -265
  54. package/dist/sortable.esm-BPjdpL-J.cjs +0 -3872
  55. package/dist/sortable.esm-C7oRJuPU.js +0 -3873
@@ -1,266 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Popover as Popover$1 } from "antd";
3
- import { twMerge } from "tailwind-merge";
4
- import { F as Flex, T as Text, I as Icon, L as Loading } from "./index-B02Mlfa4.js";
5
- import { c as colors } from "./colors-CztsZ6e_.js";
6
- import { useState, useEffect, forwardRef, useRef } from "react";
7
- import { useTranslation } from "react-i18next";
8
- import { B as Button } from "./index-CVNEow23.js";
9
- function getWindowDimensions() {
10
- const { innerWidth: width, innerHeight: height } = typeof window === "undefined" ? {
11
- innerWidth: 1024,
12
- innerHeight: 768
13
- } : window;
14
- return {
15
- width,
16
- height
17
- };
18
- }
19
- function useWindowDimensions() {
20
- const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
21
- const targetProps = [];
22
- const handleResize = () => {
23
- const { width, height } = getWindowDimensions();
24
- if (width !== windowDimensions.width && targetProps.includes("width") || height !== windowDimensions.height && targetProps.includes("height")) {
25
- setWindowDimensions({ width, height });
26
- }
27
- };
28
- useEffect(() => {
29
- window.addEventListener("resize", handleResize);
30
- return () => window.removeEventListener("resize", handleResize);
31
- }, []);
32
- return new Proxy(windowDimensions, {
33
- get(target, prop) {
34
- targetProps.push(prop);
35
- return target[prop];
36
- }
37
- });
38
- }
39
- const PopoverLink = ({ children, size, color, weight, className, ...rest }) => {
40
- return /* @__PURE__ */ jsx(
41
- Flex,
42
- {
43
- className: twMerge("border-secondary items-center border-b border-dashed", className),
44
- ...rest,
45
- children: /* @__PURE__ */ jsx(
46
- Text,
47
- {
48
- className: "cursor-pointer select-none",
49
- color: color || colors.secondary,
50
- size: size || 16,
51
- weight: weight || "medium",
52
- children
53
- }
54
- )
55
- }
56
- );
57
- };
58
- const Popover = ({
59
- overlayInnerStyle,
60
- overlayClassName,
61
- overlayInnerClassName,
62
- headerTitle,
63
- content,
64
- closeable = true,
65
- onClose,
66
- footer,
67
- ...rest
68
- }) => {
69
- return /* @__PURE__ */ jsx(
70
- Popover$1,
71
- {
72
- showArrow: false,
73
- arrow: false,
74
- overlayClassName: twMerge("[&_.ant-popover-inner]:p-0", overlayClassName),
75
- overlayInnerStyle: {
76
- boxShadow: `2px 3px 7px 0 rgba(67, 88, 121, 0.15)`
77
- },
78
- ...rest,
79
- content: /* @__PURE__ */ jsxs("div", { children: [
80
- headerTitle && /* @__PURE__ */ jsxs(Flex, { className: "border-light-7 bg-light-1 w-full items-center justify-between rounded-t border-b px-3 py-1", children: [
81
- typeof headerTitle === "string" ? /* @__PURE__ */ jsx(Text, { size: 12, weight: "medium", color: colors.primary, children: headerTitle }) : headerTitle,
82
- closeable && /* @__PURE__ */ jsx(
83
- Icon,
84
- {
85
- name: "Close",
86
- className: "cursor-pointer",
87
- onClick: onClose,
88
- color: colors.primary,
89
- size: 12
90
- }
91
- )
92
- ] }),
93
- /* @__PURE__ */ jsx("div", { className: twMerge("p-3", overlayInnerClassName), style: overlayInnerStyle, children: typeof content === "function" ? content() : content }),
94
- /* @__PURE__ */ jsx(Flex, { className: "border-light-7 bg-light-1 w-full items-center justify-between rounded-t border-t px-3 py-1", children: footer })
95
- ] })
96
- }
97
- );
98
- };
99
- Popover.Link = PopoverLink;
100
- function fillRef(ref, node) {
101
- if (typeof ref === "function") {
102
- ref(node);
103
- } else if (typeof ref === "object" && ref && "current" in ref) {
104
- ref.current = node;
105
- }
106
- }
107
- function composeRef(...refs) {
108
- return (node) => {
109
- refs.forEach((ref) => {
110
- fillRef(ref, node);
111
- });
112
- };
113
- }
114
- const canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
115
- const DOM_LAYOUT_HANDLER_NAME = "__reactLayoutHandler";
116
- let didWarn = false;
117
- let resizeObserver = null;
118
- function getResizeObserver() {
119
- if (canUseDOM && typeof window.ResizeObserver !== "undefined") {
120
- if (resizeObserver == null) {
121
- resizeObserver = new window.ResizeObserver(function(entries) {
122
- entries.forEach((entry) => {
123
- const node = entry.target;
124
- const onLayout = node[DOM_LAYOUT_HANDLER_NAME];
125
- if (typeof onLayout === "function") {
126
- measure(
127
- node,
128
- //@ts-ignore
129
- (x, y, width, height, left, top) => {
130
- const event = {
131
- // $FlowFixMe
132
- nativeEvent: {
133
- layout: { x, y, width, height, left, top }
134
- },
135
- timeStamp: Date.now()
136
- };
137
- Object.defineProperty(event.nativeEvent, "target", {
138
- enumerable: true,
139
- get: () => entry.target
140
- });
141
- onLayout(event);
142
- }
143
- );
144
- }
145
- });
146
- });
147
- }
148
- } else if (!didWarn) {
149
- if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") {
150
- didWarn = true;
151
- }
152
- }
153
- return resizeObserver;
154
- }
155
- function useElementLayout(ref, onLayout) {
156
- const { width, height } = useWindowDimensions();
157
- const observer = getResizeObserver();
158
- useEffect(() => {
159
- const node = ref.current;
160
- if (node != null) {
161
- node[DOM_LAYOUT_HANDLER_NAME] = onLayout;
162
- }
163
- }, [ref, onLayout]);
164
- useEffect(() => {
165
- const node = ref.current;
166
- if (node != null && observer != null) {
167
- if (typeof node[DOM_LAYOUT_HANDLER_NAME] === "function") {
168
- observer.observe(node);
169
- } else {
170
- observer.unobserve(node);
171
- }
172
- }
173
- return () => {
174
- if (node != null && observer != null) {
175
- observer.unobserve(node);
176
- }
177
- };
178
- }, [ref, observer, width, height]);
179
- }
180
- const getBoundingClientRect = (node) => {
181
- if (node != null) {
182
- const isElement = node.nodeType === 1;
183
- if (isElement && typeof node.getBoundingClientRect === "function") {
184
- return node.getBoundingClientRect();
185
- }
186
- }
187
- };
188
- const measureLayout = (node, relativeToNativeNode, callback) => {
189
- const relativeNode = node && node.parentNode;
190
- if (node && relativeNode) {
191
- setTimeout(() => {
192
- const relativeRect = getBoundingClientRect(relativeNode);
193
- const { height, left, top, width } = getRect(node);
194
- const x = left - relativeRect.left;
195
- const y = top - relativeRect.top;
196
- callback(x, y, width, height, left, top);
197
- }, 0);
198
- }
199
- };
200
- const getRect = (node) => {
201
- const { x, y, top, left } = getBoundingClientRect(node);
202
- const width = node.offsetWidth;
203
- const height = node.offsetHeight;
204
- return { x, y, width, height, top, left };
205
- };
206
- function measure(node, callback) {
207
- measureLayout(node, null, callback);
208
- }
209
- const View = forwardRef(
210
- ({
211
- children,
212
- isLoading,
213
- onRetry,
214
- error,
215
- loadingMinHeight,
216
- loadingSize,
217
- onLayout,
218
- ...rest
219
- }, ref) => {
220
- const contentLayoutRef = useRef(null);
221
- useElementLayout(contentLayoutRef, onLayout);
222
- const finalRef = composeRef(ref, contentLayoutRef);
223
- const { t } = useTranslation();
224
- if (isLoading) {
225
- return /* @__PURE__ */ jsx(
226
- Flex,
227
- {
228
- ref: finalRef,
229
- align: "center",
230
- justify: "center",
231
- className: "h-full w-full",
232
- style: {
233
- minHeight: loadingMinHeight
234
- },
235
- children: /* @__PURE__ */ jsx(Loading, { isLoading: true, size: loadingSize })
236
- }
237
- );
238
- }
239
- if (error) {
240
- return /* @__PURE__ */ jsxs(
241
- Flex,
242
- {
243
- ref: finalRef,
244
- align: "center",
245
- justify: "center",
246
- style: {
247
- minHeight: loadingMinHeight
248
- },
249
- gap: 8,
250
- vertical: true,
251
- className: "h-full w-full",
252
- children: [
253
- /* @__PURE__ */ jsx(Text, { size: 16, color: colors.negative, children: error }),
254
- onRetry && /* @__PURE__ */ jsx(Button.Primary, { onClick: onRetry, children: t("common.message.tryAgain") })
255
- ]
256
- }
257
- );
258
- }
259
- return /* @__PURE__ */ jsx(Flex, { ref: finalRef, ...rest, children });
260
- }
261
- );
262
- export {
263
- Popover as P,
264
- View as V,
265
- useWindowDimensions as u
266
- };