lkd-web-kit 0.3.4 → 0.3.7

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 (113) hide show
  1. package/dist/index.cjs.js +118 -0
  2. package/dist/index.cjs10.js +16 -0
  3. package/dist/index.cjs11.js +16 -0
  4. package/dist/index.cjs12.js +16 -0
  5. package/dist/index.cjs13.js +16 -0
  6. package/dist/index.cjs14.js +118 -0
  7. package/dist/index.cjs15.js +16 -0
  8. package/dist/index.cjs16.js +18 -0
  9. package/dist/index.cjs17.js +70 -0
  10. package/dist/index.cjs18.js +14 -0
  11. package/dist/index.cjs19.js +66 -0
  12. package/dist/index.cjs2.js +43 -0
  13. package/dist/index.cjs20.js +21 -0
  14. package/dist/index.cjs21.js +30 -0
  15. package/dist/index.cjs22.js +23 -0
  16. package/dist/index.cjs23.js +15 -0
  17. package/dist/index.cjs24.js +16 -0
  18. package/dist/index.cjs25.js +16 -0
  19. package/dist/index.cjs26.js +18 -0
  20. package/dist/index.cjs27.js +17 -0
  21. package/dist/index.cjs28.js +17 -0
  22. package/dist/index.cjs29.js +17 -0
  23. package/dist/index.cjs3.js +12 -0
  24. package/dist/index.cjs30.js +17 -0
  25. package/dist/index.cjs31.js +17 -0
  26. package/dist/index.cjs32.js +17 -0
  27. package/dist/index.cjs33.js +17 -0
  28. package/dist/index.cjs34.js +17 -0
  29. package/dist/index.cjs35.js +29 -0
  30. package/dist/index.cjs36.js +17 -0
  31. package/dist/index.cjs37.js +17 -0
  32. package/dist/index.cjs38.js +51 -0
  33. package/dist/index.cjs39.js +38 -0
  34. package/dist/index.cjs4.js +40 -0
  35. package/dist/index.cjs40.js +15 -0
  36. package/dist/index.cjs41.js +23 -0
  37. package/dist/index.cjs42.js +39 -0
  38. package/dist/index.cjs43.js +24 -0
  39. package/dist/index.cjs44.js +14 -0
  40. package/dist/index.cjs45.js +19 -0
  41. package/dist/index.cjs46.js +43 -0
  42. package/dist/index.cjs47.js +14 -0
  43. package/dist/index.cjs48.js +20 -0
  44. package/dist/index.cjs49.js +11 -0
  45. package/dist/index.cjs5.js +54 -0
  46. package/dist/index.cjs50.js +45 -0
  47. package/dist/index.cjs51.js +19 -0
  48. package/dist/index.cjs52.js +24 -0
  49. package/dist/index.cjs53.js +7 -0
  50. package/dist/index.cjs54.js +65 -0
  51. package/dist/index.cjs6.js +18 -0
  52. package/dist/index.cjs7.js +18 -0
  53. package/dist/index.cjs8.js +17 -0
  54. package/dist/index.cjs9.js +16 -0
  55. package/dist/index.es.js +52 -0
  56. package/dist/index.es10.js +12 -0
  57. package/dist/index.es11.js +12 -0
  58. package/dist/index.es12.js +12 -0
  59. package/dist/index.es13.js +12 -0
  60. package/dist/index.es14.js +114 -0
  61. package/dist/index.es15.js +12 -0
  62. package/dist/index.es16.js +14 -0
  63. package/dist/index.es17.js +66 -0
  64. package/dist/index.es18.js +10 -0
  65. package/dist/index.es19.js +60 -0
  66. package/dist/index.es2.js +39 -0
  67. package/dist/index.es20.js +16 -0
  68. package/dist/index.es21.js +26 -0
  69. package/dist/index.es22.js +19 -0
  70. package/dist/index.es23.js +11 -0
  71. package/dist/index.es24.js +12 -0
  72. package/dist/index.es25.js +12 -0
  73. package/dist/index.es26.js +14 -0
  74. package/dist/index.es27.js +13 -0
  75. package/dist/index.es28.js +13 -0
  76. package/dist/index.es29.js +13 -0
  77. package/dist/index.es3.js +8 -0
  78. package/dist/index.es30.js +13 -0
  79. package/dist/index.es31.js +13 -0
  80. package/dist/index.es32.js +13 -0
  81. package/dist/index.es33.js +13 -0
  82. package/dist/index.es34.js +13 -0
  83. package/dist/index.es35.js +23 -0
  84. package/dist/index.es36.js +13 -0
  85. package/dist/index.es37.js +13 -0
  86. package/dist/index.es38.js +47 -0
  87. package/dist/index.es39.js +34 -0
  88. package/dist/index.es4.js +36 -0
  89. package/dist/index.es40.js +11 -0
  90. package/dist/index.es41.js +19 -0
  91. package/dist/index.es42.js +35 -0
  92. package/dist/index.es43.js +20 -0
  93. package/dist/index.es44.js +10 -0
  94. package/dist/index.es45.js +15 -0
  95. package/dist/index.es46.js +39 -0
  96. package/dist/index.es47.js +10 -0
  97. package/dist/index.es48.js +15 -0
  98. package/dist/index.es49.js +7 -0
  99. package/dist/index.es5.js +50 -0
  100. package/dist/index.es50.js +40 -0
  101. package/dist/index.es51.js +15 -0
  102. package/dist/index.es52.js +20 -0
  103. package/dist/index.es53.js +3 -0
  104. package/dist/index.es54.js +63 -0
  105. package/dist/index.es6.js +14 -0
  106. package/dist/index.es7.js +14 -0
  107. package/dist/index.es8.js +13 -0
  108. package/dist/index.es9.js +12 -0
  109. package/dist/node_modules/@mantine/notifications/styles.css +42 -0
  110. package/package.json +15 -5
  111. package/dist/lkd-web-kit.css +0 -1
  112. package/dist/main.js +0 -779
  113. /package/dist/{main.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,40 @@
1
+ function indexBy(arr, getKey, getValue) {
2
+ if (getValue)
3
+ return arr.reduce(
4
+ (acc, item) => {
5
+ const key = getKey(item);
6
+ if (key === void 0) return acc;
7
+ acc[key] = getValue(item);
8
+ return acc;
9
+ },
10
+ {}
11
+ );
12
+ return arr.reduce(
13
+ (acc, item) => {
14
+ const key = getKey(item);
15
+ if (key === void 0) return acc;
16
+ acc[key] = item;
17
+ return acc;
18
+ },
19
+ {}
20
+ );
21
+ }
22
+ const groupBy = (arr, getKey) => {
23
+ const groups = {};
24
+ arr?.forEach((item) => {
25
+ const key = getKey(item);
26
+ if (key === null) return;
27
+ if (Array.isArray(key)) {
28
+ key.forEach((k) => {
29
+ if (!groups[k]) groups[k] = [];
30
+ groups[k]?.push(item);
31
+ });
32
+ return;
33
+ }
34
+ if (!groups[key]) groups[key] = [];
35
+ groups[key]?.push(item);
36
+ });
37
+ return groups;
38
+ };
39
+
40
+ export { groupBy, indexBy };
@@ -0,0 +1,15 @@
1
+ const shuffleArray = (array) => {
2
+ const shuffledArray = [...array];
3
+ let currentIndex = shuffledArray.length, randomIndex;
4
+ while (currentIndex > 0) {
5
+ randomIndex = Math.floor(Math.random() * currentIndex);
6
+ currentIndex--;
7
+ [shuffledArray[currentIndex], shuffledArray[randomIndex]] = [
8
+ shuffledArray[randomIndex],
9
+ shuffledArray[currentIndex]
10
+ ];
11
+ }
12
+ return shuffledArray;
13
+ };
14
+
15
+ export { shuffleArray };
@@ -0,0 +1,20 @@
1
+ import queryString from 'query-string';
2
+
3
+ const newHref = (fn) => (args) => {
4
+ const href = typeof fn === "string" ? fn : fn(
5
+ args ?? {
6
+ params: {},
7
+ searchParams: {}
8
+ }
9
+ );
10
+ if (args?.searchParams) {
11
+ const qs = queryString.stringify(args.searchParams, {
12
+ skipEmptyString: true,
13
+ skipNull: true
14
+ });
15
+ return `${href}${qs ? `?${qs}` : ""}`;
16
+ }
17
+ return href;
18
+ };
19
+
20
+ export { newHref };
@@ -0,0 +1,3 @@
1
+ const isInfinityEmpty = (data) => data?.pages[0].data.length === 0;
2
+
3
+ export { isInfinityEmpty };
@@ -0,0 +1,63 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+
3
+ const CalendarIcon = ({ size = "sm", ...props }) => {
4
+ return /* @__PURE__ */ jsxs(
5
+ "svg",
6
+ {
7
+ viewBox: "0 0 24 24",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ width: size === "sm" ? 20 : 24,
11
+ height: size === "sm" ? 20 : 24,
12
+ children: [
13
+ /* @__PURE__ */ jsx(
14
+ "path",
15
+ {
16
+ fillRule: "evenodd",
17
+ clipRule: "evenodd",
18
+ d: "M6 5.5C5.66848 5.5 5.35054 5.6317 5.11612 5.86612C4.8817 6.10054 4.75 6.41848 4.75 6.75V18.75C4.75 19.0815 4.8817 19.3995 5.11612 19.6339C5.35054 19.8683 5.66848 20 6 20H18C18.3315 20 18.6495 19.8683 18.8839 19.6339C19.1183 19.3995 19.25 19.0815 19.25 18.75V6.75C19.25 6.41848 19.1183 6.10054 18.8839 5.86612C18.6495 5.6317 18.3315 5.5 18 5.5H6ZM4.05546 4.80546C4.57118 4.28973 5.27065 4 6 4H18C18.7293 4 19.4288 4.28973 19.9445 4.80546C20.4603 5.32118 20.75 6.02065 20.75 6.75V18.75C20.75 19.4793 20.4603 20.1788 19.9445 20.6945C19.4288 21.2103 18.7293 21.5 18 21.5H6C5.27065 21.5 4.57118 21.2103 4.05546 20.6945C3.53973 20.1788 3.25 19.4793 3.25 18.75V6.75C3.25 6.02065 3.53973 5.32118 4.05546 4.80546Z",
19
+ fill: "currentColor"
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsx(
23
+ "path",
24
+ {
25
+ fillRule: "evenodd",
26
+ clipRule: "evenodd",
27
+ d: "M16 2C16.4142 2 16.75 2.33579 16.75 2.75V6.75C16.75 7.16421 16.4142 7.5 16 7.5C15.5858 7.5 15.25 7.16421 15.25 6.75V2.75C15.25 2.33579 15.5858 2 16 2Z",
28
+ fill: "currentColor"
29
+ }
30
+ ),
31
+ /* @__PURE__ */ jsx(
32
+ "path",
33
+ {
34
+ fillRule: "evenodd",
35
+ clipRule: "evenodd",
36
+ d: "M8 2C8.41421 2 8.75 2.33579 8.75 2.75V6.75C8.75 7.16421 8.41421 7.5 8 7.5C7.58579 7.5 7.25 7.16421 7.25 6.75V2.75C7.25 2.33579 7.58579 2 8 2Z",
37
+ fill: "currentColor"
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsx(
41
+ "path",
42
+ {
43
+ fillRule: "evenodd",
44
+ clipRule: "evenodd",
45
+ d: "M3.25 10.75C3.25 10.3358 3.58579 10 4 10H20C20.4142 10 20.75 10.3358 20.75 10.75C20.75 11.1642 20.4142 11.5 20 11.5H4C3.58579 11.5 3.25 11.1642 3.25 10.75Z",
46
+ fill: "currentColor"
47
+ }
48
+ ),
49
+ /* @__PURE__ */ jsx(
50
+ "path",
51
+ {
52
+ fillRule: "evenodd",
53
+ clipRule: "evenodd",
54
+ d: "M7 14.3929C7 14.0378 7.28782 13.75 7.64286 13.75H9.35714C9.71218 13.75 10 14.0378 10 14.3929V16.1071C10 16.4622 9.71218 16.75 9.35714 16.75H7.64286C7.28782 16.75 7 16.4622 7 16.1071V14.3929Z",
55
+ fill: "currentColor"
56
+ }
57
+ )
58
+ ]
59
+ }
60
+ );
61
+ };
62
+
63
+ export { CalendarIcon as default };
@@ -0,0 +1,14 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DatePickerInput } from '@mantine/dates';
3
+ import CalendarIcon from './index.es54.js';
4
+
5
+ const MyDatePickerInput = (props) => /* @__PURE__ */ jsx(
6
+ DatePickerInput,
7
+ {
8
+ leftSection: /* @__PURE__ */ jsx(CalendarIcon, { size: props.size }),
9
+ variant: props.readOnly ? "filled" : "default",
10
+ ...props
11
+ }
12
+ );
13
+
14
+ export { MyDatePickerInput };
@@ -0,0 +1,14 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DateTimePicker } from '@mantine/dates';
3
+ import CalendarIcon from './index.es54.js';
4
+
5
+ const MyDateTimePicker = (props) => /* @__PURE__ */ jsx(
6
+ DateTimePicker,
7
+ {
8
+ leftSection: /* @__PURE__ */ jsx(CalendarIcon, { size: props.size }),
9
+ variant: props.readOnly ? "filled" : "default",
10
+ ...props
11
+ }
12
+ );
13
+
14
+ export { MyDateTimePicker };
@@ -0,0 +1,13 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Notifications } from '@mantine/notifications';
3
+ /* empty css */
4
+
5
+ const MyNotifications = (props) => /* @__PURE__ */ jsx(
6
+ Notifications,
7
+ {
8
+ position: "top-center",
9
+ ...props
10
+ }
11
+ );
12
+
13
+ export { MyNotifications };
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { NumberInput } from '@mantine/core';
3
+
4
+ const MyNumberInput = (props) => /* @__PURE__ */ jsx(
5
+ NumberInput,
6
+ {
7
+ variant: props.readOnly ? "filled" : "default",
8
+ ...props
9
+ }
10
+ );
11
+
12
+ export { MyNumberInput };
@@ -0,0 +1,42 @@
1
+ .m_b37d9ac7 {
2
+ width: calc(100% - var(--mantine-spacing-md) * 2);
3
+ position: fixed;
4
+ z-index: var(--notifications-z-index);
5
+ max-width: var(--notifications-container-width);
6
+ }
7
+
8
+ .m_b37d9ac7:where([data-position='top-center']) {
9
+ top: var(--mantine-spacing-md);
10
+ left: 50%;
11
+ transform: translateX(-50%);
12
+ }
13
+
14
+ .m_b37d9ac7:where([data-position='top-left']) {
15
+ top: var(--mantine-spacing-md);
16
+ left: var(--mantine-spacing-md);
17
+ }
18
+
19
+ .m_b37d9ac7:where([data-position='top-right']) {
20
+ top: var(--mantine-spacing-md);
21
+ right: var(--mantine-spacing-md);
22
+ }
23
+
24
+ .m_b37d9ac7:where([data-position='bottom-center']) {
25
+ bottom: var(--mantine-spacing-md);
26
+ left: 50%;
27
+ transform: translateX(-50%);
28
+ }
29
+
30
+ .m_b37d9ac7:where([data-position='bottom-left']) {
31
+ bottom: var(--mantine-spacing-md);
32
+ left: var(--mantine-spacing-md);
33
+ }
34
+
35
+ .m_b37d9ac7:where([data-position='bottom-right']) {
36
+ bottom: var(--mantine-spacing-md);
37
+ right: var(--mantine-spacing-md);
38
+ }
39
+
40
+ .m_5ed0edd0 + .m_5ed0edd0 {
41
+ margin-top: var(--mantine-spacing-md);
42
+ }
package/package.json CHANGED
@@ -1,14 +1,24 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
- "files": ["dist"],
9
- "exports": "./dist/main.js",
10
- "module": "./dist/main.js",
11
- "types": "./dist/main.d.ts",
8
+ "main": "./dist/index.cjs.js",
9
+ "module": "./dist/index.es.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.es.js",
15
+ "require": "./dist/index.cjs.js"
16
+ }
17
+ },
18
+ "sideEffects": false,
19
+ "files": [
20
+ "dist"
21
+ ],
12
22
  "scripts": {
13
23
  "test": "vitest run",
14
24
  "test:watch": "vitest",
@@ -1 +0,0 @@
1
- .m_b37d9ac7{width:calc(100% - var(--mantine-spacing-md) * 2);position:fixed;z-index:var(--notifications-z-index);max-width:var(--notifications-container-width)}.m_b37d9ac7:where([data-position=top-center]){top:var(--mantine-spacing-md);left:50%;transform:translate(-50%)}.m_b37d9ac7:where([data-position=top-left]){top:var(--mantine-spacing-md);left:var(--mantine-spacing-md)}.m_b37d9ac7:where([data-position=top-right]){top:var(--mantine-spacing-md);right:var(--mantine-spacing-md)}.m_b37d9ac7:where([data-position=bottom-center]){bottom:var(--mantine-spacing-md);left:50%;transform:translate(-50%)}.m_b37d9ac7:where([data-position=bottom-left]){bottom:var(--mantine-spacing-md);left:var(--mantine-spacing-md)}.m_b37d9ac7:where([data-position=bottom-right]){bottom:var(--mantine-spacing-md);right:var(--mantine-spacing-md)}.m_5ed0edd0+.m_5ed0edd0{margin-top:var(--mantine-spacing-md)}