abrplus-ui-kit 1.0.6 → 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-DqFzpRuD.cjs → index-BRLLsEKX.js} +20169 -19477
  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 +3 -3
  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-Bknzi7oo.js +0 -266
  42. package/dist/index-BvegjQUf.js +0 -90
  43. package/dist/index-Bvu3tjZA.js +0 -37331
  44. package/dist/index-CCvWoynu.cjs +0 -12
  45. package/dist/index-CIBuPhXl.cjs +0 -1629
  46. package/dist/index-C_d8YZwK.js +0 -28
  47. package/dist/index-Ck1A1Vbk.js +0 -543
  48. package/dist/index-DKwKBp9E.cjs +0 -265
  49. package/dist/index-DLUd_0LP.js +0 -13
  50. package/dist/index-DTnBytzT.cjs +0 -89
  51. package/dist/index-DvjH6QYq.cjs +0 -542
  52. package/dist/index-ITeOhLPx.js +0 -1630
  53. package/dist/index-vJLaOgWn.cjs +0 -27
  54. package/dist/sortable.esm-CJ4hbOQu.js +0 -3873
  55. package/dist/sortable.esm-grhzbi7z.cjs +0 -3872
@@ -1,20 +0,0 @@
1
- function deepMerge(target, source) {
2
- const output = { ...target };
3
- if (target && typeof target === "object" && source && typeof source === "object") {
4
- for (const key in source) {
5
- if (Object.prototype.hasOwnProperty.call(source, key)) {
6
- const sourceValue = source[key];
7
- const targetValue = output[key];
8
- if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
9
- output[key] = deepMerge(targetValue, sourceValue);
10
- } else if (sourceValue !== void 0) {
11
- output[key] = sourceValue;
12
- }
13
- }
14
- }
15
- }
16
- return output;
17
- }
18
- export {
19
- deepMerge as d
20
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- function deepMerge(target, source) {
3
- const output = { ...target };
4
- if (target && typeof target === "object" && source && typeof source === "object") {
5
- for (const key in source) {
6
- if (Object.prototype.hasOwnProperty.call(source, key)) {
7
- const sourceValue = source[key];
8
- const targetValue = output[key];
9
- if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
10
- output[key] = deepMerge(targetValue, sourceValue);
11
- } else if (sourceValue !== void 0) {
12
- output[key] = sourceValue;
13
- }
14
- }
15
- }
16
- }
17
- return output;
18
- }
19
- exports.deepMerge = deepMerge;
@@ -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-Bvu3tjZA.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-Ck1A1Vbk.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
- };
@@ -1,90 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ConfigProvider, Dropdown as Dropdown$1, Image as Image$1 } from "antd";
3
- import { twMerge } from "tailwind-merge";
4
- import { useState, useEffect } from "react";
5
- import { F as Flex, L as Loading } from "./index-Bvu3tjZA.js";
6
- const SwitchThemeConfig = {
7
- components: {
8
- Dropdown: {}
9
- }
10
- };
11
- const Dropdown = ({ className, ...props }) => {
12
- return /* @__PURE__ */ jsx(ConfigProvider, { theme: SwitchThemeConfig, children: /* @__PURE__ */ jsx(Dropdown$1, { ...props, className: twMerge("bg-light-7", className) }) });
13
- };
14
- const Image = ({
15
- preview = false,
16
- width,
17
- height,
18
- fallback,
19
- onError,
20
- wrapperClassName,
21
- ...rest
22
- }) => {
23
- const [showFallBack, setShowFallBack] = useState(false);
24
- return /* @__PURE__ */ jsx(
25
- Flex,
26
- {
27
- style: { width, height },
28
- align: "center",
29
- justify: "center",
30
- className: wrapperClassName,
31
- children: showFallBack && fallback ? fallback : /* @__PURE__ */ jsx(
32
- Image$1,
33
- {
34
- preview,
35
- onError: (e) => {
36
- setShowFallBack(true);
37
- onError?.(e);
38
- },
39
- ...{ width, height },
40
- ...rest
41
- }
42
- )
43
- }
44
- );
45
- };
46
- const getScrollableNode = (scrollableNodeId) => {
47
- return document.getElementById(scrollableNodeId);
48
- };
49
- const debounce = (func, delay) => {
50
- let timeoutId;
51
- return function() {
52
- clearTimeout(timeoutId);
53
- timeoutId = setTimeout(func, delay);
54
- };
55
- };
56
- const InfiniteLoader = ({
57
- children,
58
- indicatorColor,
59
- indicatorSize,
60
- className,
61
- hasMore,
62
- scrollableNodeId,
63
- onNextPage
64
- }) => {
65
- useEffect(() => {
66
- const scrollableNode = getScrollableNode(scrollableNodeId);
67
- if (scrollableNode) {
68
- const onScroll = () => {
69
- if (hasMore) {
70
- const { scrollHeight, scrollTop, clientHeight } = scrollableNode;
71
- const isBottom = Math.ceil(scrollTop) + clientHeight === scrollHeight;
72
- isBottom && onNextPage();
73
- }
74
- };
75
- onScroll();
76
- const debouncedOnScroll = debounce(onScroll, 1500);
77
- scrollableNode.addEventListener("scroll", debouncedOnScroll);
78
- return () => scrollableNode.removeEventListener("scroll", debouncedOnScroll);
79
- }
80
- }, [hasMore, scrollableNodeId]);
81
- return /* @__PURE__ */ jsxs("div", { className: twMerge(className, "w-full"), onClick: (e) => e.stopPropagation(), children: [
82
- children,
83
- hasMore && /* @__PURE__ */ jsx(Flex, { className: "min-h-12", align: "center", justify: "center", children: /* @__PURE__ */ jsx(Loading, { isLoading: true, color: indicatorColor, size: indicatorSize }) })
84
- ] });
85
- };
86
- export {
87
- Dropdown as D,
88
- InfiniteLoader as I,
89
- Image as a
90
- };