@konstructio/ui 0.1.0-alpha.16 → 0.1.0-alpha.17

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.
@@ -1,23 +1,23 @@
1
- import { useId as C, useRef as S, useState as m, useEffect as f, useCallback as r, useMemo as w } from "react";
2
- import { FilterEvent as E, sendOpenFilterEvent as L } from "../../events/index.js";
1
+ import { useId as C, useRef as w, useState as m, useEffect as f, useCallback as d, useMemo as S } from "react";
2
+ import { FilterEvent as v, sendOpenFilterEvent as L } from "../../events/index.js";
3
3
  const I = ({
4
4
  onApply: t
5
5
  }) => {
6
- const a = C(), c = S(null), [g, l] = m(!1), [n, d] = m([]);
6
+ const a = C(), o = w(null), [E, c] = m(!1), [n, r] = m([]);
7
7
  f(() => {
8
8
  const e = new AbortController();
9
9
  return document.addEventListener(
10
- E.OPEN,
10
+ v.OPEN,
11
11
  (s) => {
12
- s.detail !== a && l(!1);
12
+ s.detail !== a && c(!1);
13
13
  },
14
14
  {
15
15
  signal: e.signal
16
16
  }
17
17
  ), document.addEventListener(
18
- E.RESET,
18
+ v.RESET,
19
19
  () => {
20
- d([]), t == null || t([]);
20
+ r([]), t == null || t([]);
21
21
  },
22
22
  {
23
23
  signal: e.signal
@@ -26,44 +26,43 @@ const I = ({
26
26
  e.abort();
27
27
  };
28
28
  }, [a, t]);
29
- const O = r(
30
- () => l((e) => (e || (L(a), d(
29
+ const g = d(
30
+ () => c((e) => (e || (L(a), r(
31
31
  (s) => s.filter((i) => i.isApplied)
32
32
  )), !e)),
33
- [a, l]
34
- ), o = r(() => l(!1), []), h = r(
33
+ [a, c]
34
+ ), u = d(() => c(!1), []), O = d(
35
35
  (e, s) => {
36
- d(s ? [
36
+ r(s ? [
37
37
  ...n,
38
38
  { ...e, isApplied: !1 }
39
39
  ] : n.map((i) => i.id === e.id ? { ...i, isRemoved: !0 } : i));
40
40
  },
41
- [d, n]
42
- ), v = r(() => {
43
- d([]), t == null || t([]);
44
- }, [t]), R = r(() => {
45
- d(
46
- (e) => e == null ? void 0 : e.filter((s) => !s.isRemoved).map((s) => ({ ...s, isApplied: !0 }))
47
- ), t == null || t(
48
- n.map(
49
- ({ isApplied: e, isRemoved: s, ...i }) => i
41
+ [r, n]
42
+ ), h = d(() => {
43
+ r([]), t == null || t([]);
44
+ }, [t]), R = d(() => {
45
+ const e = n == null ? void 0 : n.filter((s) => !s.isRemoved).map((s) => ({ ...s, isApplied: !0 }));
46
+ r(e), t == null || t(
47
+ e.map(
48
+ ({ isApplied: s, isRemoved: i, ...l }) => l
50
49
  )
51
50
  );
52
- }, [t, n, d]), b = w(
51
+ }, [t, n, r]), b = S(
53
52
  () => n.filter((e) => e.isApplied),
54
53
  [n]
55
54
  );
56
55
  return f(() => {
57
56
  const e = new AbortController(), s = (i) => {
58
- var u;
59
- (u = c.current) != null && u.contains(i.target) || o();
57
+ var l;
58
+ (l = o.current) != null && l.contains(i.target) || u();
60
59
  };
61
60
  return document.addEventListener("mousedown", s, {
62
61
  signal: e.signal
63
62
  }), document.addEventListener(
64
63
  "visibilitychange",
65
64
  () => {
66
- document.hidden && o();
65
+ document.hidden && u();
67
66
  },
68
67
  {
69
68
  signal: e.signal
@@ -71,15 +70,15 @@ const I = ({
71
70
  ), () => {
72
71
  e.abort();
73
72
  };
74
- }, [o, c]), {
75
- isOpen: g,
73
+ }, [u, o]), {
74
+ isOpen: E,
76
75
  selectedCount: b,
77
76
  selectedOptions: n,
78
- wrapperRef: c,
77
+ wrapperRef: o,
79
78
  handleApplyOptions: R,
80
- handleOpen: O,
81
- handleResetOptions: v,
82
- handleSelectOption: h
79
+ handleOpen: g,
80
+ handleResetOptions: h,
81
+ handleSelectOption: O
83
82
  };
84
83
  };
85
84
  export {
package/dist/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.0-alpha.15",
5
+ "version": "0.1.0-alpha.16",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -106,9 +106,9 @@
106
106
  },
107
107
  "devDependencies": {
108
108
  "@rollup/plugin-alias": "^5.1.1",
109
- "@storybook/addon-docs": "^9.1.0-alpha.6",
110
- "@storybook/addon-links": "^9.1.0-alpha.6",
111
- "@storybook/react-vite": "^9.1.0-alpha.6",
109
+ "@storybook/addon-docs": "^9.1.0-alpha.9",
110
+ "@storybook/addon-links": "^9.1.0-alpha.9",
111
+ "@storybook/react-vite": "^9.1.0-alpha.9",
112
112
  "@tailwindcss/vite": "^4.1.11",
113
113
  "@testing-library/jest-dom": "^6.6.3",
114
114
  "@testing-library/react": "^16.3.0",
@@ -118,15 +118,15 @@
118
118
  "@types/lodash": "^4.17.20",
119
119
  "@types/react": "^19.1.8",
120
120
  "@types/react-dom": "^19.1.6",
121
- "@typescript-eslint/eslint-plugin": "^8.35.1",
122
- "@typescript-eslint/parser": "^8.35.1",
123
- "@vitejs/plugin-react": "^4.6.0",
121
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
122
+ "@typescript-eslint/parser": "^8.38.0",
123
+ "@vitejs/plugin-react": "^4.7.0",
124
124
  "@vitest/coverage-v8": "^3.2.4",
125
125
  "autoprefixer": "^10.4.21",
126
126
  "eslint": "^8.57.0",
127
127
  "eslint-plugin-react-hooks": "^4.6.2",
128
128
  "eslint-plugin-react-refresh": "^0.4.7",
129
- "eslint-plugin-storybook": "^9.1.0-alpha.6",
129
+ "eslint-plugin-storybook": "^9.1.0-alpha.9",
130
130
  "glob": "^11.0.3",
131
131
  "husky": "^9.1.7",
132
132
  "jest-axe": "^10.0.0",
@@ -135,7 +135,7 @@
135
135
  "postcss": "^8.5.6",
136
136
  "prettier": "^3.6.2",
137
137
  "rimraf": "^6.0.1",
138
- "storybook": "^9.1.0-alpha.6",
138
+ "storybook": "^9.1.0-alpha.9",
139
139
  "tailwindcss": "^4.1.11",
140
140
  "ts-node": "^10.9.2",
141
141
  "typescript": "^5.8.3",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.0-alpha.16",
5
+ "version": "0.1.0-alpha.17",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -106,9 +106,9 @@
106
106
  },
107
107
  "devDependencies": {
108
108
  "@rollup/plugin-alias": "^5.1.1",
109
- "@storybook/addon-docs": "^9.1.0-alpha.6",
110
- "@storybook/addon-links": "^9.1.0-alpha.6",
111
- "@storybook/react-vite": "^9.1.0-alpha.6",
109
+ "@storybook/addon-docs": "^9.1.0-alpha.9",
110
+ "@storybook/addon-links": "^9.1.0-alpha.9",
111
+ "@storybook/react-vite": "^9.1.0-alpha.9",
112
112
  "@tailwindcss/vite": "^4.1.11",
113
113
  "@testing-library/jest-dom": "^6.6.3",
114
114
  "@testing-library/react": "^16.3.0",
@@ -118,15 +118,15 @@
118
118
  "@types/lodash": "^4.17.20",
119
119
  "@types/react": "^19.1.8",
120
120
  "@types/react-dom": "^19.1.6",
121
- "@typescript-eslint/eslint-plugin": "^8.35.1",
122
- "@typescript-eslint/parser": "^8.35.1",
123
- "@vitejs/plugin-react": "^4.6.0",
121
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
122
+ "@typescript-eslint/parser": "^8.38.0",
123
+ "@vitejs/plugin-react": "^4.7.0",
124
124
  "@vitest/coverage-v8": "^3.2.4",
125
125
  "autoprefixer": "^10.4.21",
126
126
  "eslint": "^8.57.0",
127
127
  "eslint-plugin-react-hooks": "^4.6.2",
128
128
  "eslint-plugin-react-refresh": "^0.4.7",
129
- "eslint-plugin-storybook": "^9.1.0-alpha.6",
129
+ "eslint-plugin-storybook": "^9.1.0-alpha.9",
130
130
  "glob": "^11.0.3",
131
131
  "husky": "^9.1.7",
132
132
  "jest-axe": "^10.0.0",
@@ -135,7 +135,7 @@
135
135
  "postcss": "^8.5.6",
136
136
  "prettier": "^3.6.2",
137
137
  "rimraf": "^6.0.1",
138
- "storybook": "^9.1.0-alpha.6",
138
+ "storybook": "^9.1.0-alpha.9",
139
139
  "tailwindcss": "^4.1.11",
140
140
  "ts-node": "^10.9.2",
141
141
  "typescript": "^5.8.3",