@agnos-ui/react-headless 0.9.1 → 0.9.3

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.
package/config.cjs CHANGED
@@ -5,7 +5,7 @@ const types = require("@agnos-ui/core/types");
5
5
  const config = require("@agnos-ui/core/config");
6
6
  const tansu = require("@amadeus-it-group/tansu");
7
7
  const react = require("react");
8
- const widget = require("./widget-CHGwSEgq.cjs");
8
+ const widget = require("./widget-BkLUvh4T.cjs");
9
9
  const stores = require("./stores-DD819q-h.cjs");
10
10
  const widgetsConfigFactory = (WidgetsConfigContext2 = react.createContext(void 0)) => {
11
11
  const useWidgetContext2 = (widgetName, defaultConfig) => {
package/config.js CHANGED
@@ -4,7 +4,7 @@ import { createWidgetsConfig } from "@agnos-ui/core/config";
4
4
  export * from "@agnos-ui/core/config";
5
5
  import { computed } from "@amadeus-it-group/tansu";
6
6
  import { createContext, useContext, useMemo } from "react";
7
- import { u as useWidgetWithConfig } from "./widget-BiWY_QJE.js";
7
+ import { u as useWidgetWithConfig } from "./widget-DLB7vGCY.js";
8
8
  import { b as usePropsAsStore } from "./stores-DZalyTTa.js";
9
9
  const widgetsConfigFactory = (WidgetsConfigContext2 = createContext(void 0)) => {
10
10
  const useWidgetContext2 = (widgetName, defaultConfig) => {
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const collapse = require("@agnos-ui/core/components/collapse");
4
+ Object.keys(collapse).forEach((k) => {
5
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: () => collapse[k]
8
+ });
9
+ });
@@ -0,0 +1 @@
1
+ export * from '@agnos-ui/core/components/collapse';
@@ -0,0 +1 @@
1
+ export * from "@agnos-ui/core/components/collapse";
@@ -1,3 +1,13 @@
1
+ export * from './services/siblingsInert';
2
+ export * from './services/resizeObserver';
3
+ export * from './services/portal';
4
+ export * from './services/navManager';
5
+ export * from './services/matchMedia';
6
+ export * from './services/intersection';
7
+ export * from './services/hash';
8
+ export * from './services/focustrack';
9
+ export * from './services/floatingUI';
10
+ export * from './services/extendWidget';
1
11
  export * from './services/transitions/simpleClassTransition';
2
12
  export * from './services/transitions/cssTransitions';
3
13
  export * from './services/transitions/collapse';
@@ -9,16 +19,6 @@ export * from './utils/func';
9
19
  export * from './utils/directive';
10
20
  export * from './types';
11
21
  export * from './config';
12
- export * from './services/siblingsInert';
13
- export * from './services/resizeObserver';
14
- export * from './services/portal';
15
- export * from './services/navManager';
16
- export * from './services/matchMedia';
17
- export * from './services/intersection';
18
- export * from './services/hash';
19
- export * from './services/focustrack';
20
- export * from './services/floatingUI';
21
- export * from './services/extendWidget';
22
22
  export * from './components/tree/index';
23
23
  export * from './components/toast/index';
24
24
  export * from './components/slider/index';
@@ -28,6 +28,7 @@ export * from './components/progressbar/index';
28
28
  export * from './components/pagination/index';
29
29
  export * from './components/modal/index';
30
30
  export * from './components/carousel/index';
31
+ export * from './components/collapse/index';
31
32
  export * from './components/alert/index';
32
33
  export * from './components/accordion/index';
33
34
  export * from './utils/portal';
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const widget = require("../../widget-CHGwSEgq.cjs");
3
+ const widget = require("../../widget-BkLUvh4T.cjs");
4
+ const widget$1 = require("@agnos-ui/core/utils/widget");
4
5
  exports.useWidgetWithConfig = widget.useWidgetWithConfig;
6
+ Object.keys(widget$1).forEach((k) => {
7
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
8
+ enumerable: true,
9
+ get: () => widget$1[k]
10
+ });
11
+ });
@@ -1,4 +1,5 @@
1
- import { u } from "../../widget-BiWY_QJE.js";
1
+ import { u } from "../../widget-DLB7vGCY.js";
2
+ export * from "@agnos-ui/core/utils/widget";
2
3
  export {
3
4
  u as useWidgetWithConfig
4
5
  };
package/index.cjs CHANGED
@@ -1,11 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const siblingsInert = require("@agnos-ui/core/services/siblingsInert");
4
+ const resizeObserver = require("@agnos-ui/core/services/resizeObserver");
5
+ const portal = require("@agnos-ui/core/services/portal");
6
+ const navManager = require("@agnos-ui/core/services/navManager");
7
+ const matchMedia = require("@agnos-ui/core/services/matchMedia");
8
+ const intersection = require("@agnos-ui/core/services/intersection");
9
+ const hash = require("@agnos-ui/core/services/hash");
10
+ const focustrack = require("@agnos-ui/core/services/focustrack");
11
+ const floatingUI = require("@agnos-ui/core/services/floatingUI");
12
+ const extendWidget = require("@agnos-ui/core/services/extendWidget");
3
13
  const simpleClassTransition = require("@agnos-ui/core/services/transitions/simpleClassTransition");
4
14
  const cssTransitions = require("@agnos-ui/core/services/transitions/cssTransitions");
5
15
  const collapse = require("@agnos-ui/core/services/transitions/collapse");
6
16
  const baseTransitions = require("@agnos-ui/core/services/transitions/baseTransitions");
7
17
  const writables = require("@agnos-ui/core/utils/writables");
8
- const widget = require("./widget-CHGwSEgq.cjs");
18
+ const widget$1 = require("@agnos-ui/core/utils/widget");
19
+ const widget = require("./widget-BkLUvh4T.cjs");
9
20
  const stores$1 = require("@agnos-ui/core/utils/stores");
10
21
  const stores = require("./stores-DD819q-h.cjs");
11
22
  const func = require("@agnos-ui/core/utils/func");
@@ -14,16 +25,6 @@ const directive = require("./directive-3diaW3tS.cjs");
14
25
  const types = require("@agnos-ui/core/types");
15
26
  const config$1 = require("@agnos-ui/core/config");
16
27
  const config = require("./config.cjs");
17
- const siblingsInert = require("@agnos-ui/core/services/siblingsInert");
18
- const resizeObserver = require("@agnos-ui/core/services/resizeObserver");
19
- const portal = require("@agnos-ui/core/services/portal");
20
- const navManager = require("@agnos-ui/core/services/navManager");
21
- const matchMedia = require("@agnos-ui/core/services/matchMedia");
22
- const intersection = require("@agnos-ui/core/services/intersection");
23
- const hash = require("@agnos-ui/core/services/hash");
24
- const focustrack = require("@agnos-ui/core/services/focustrack");
25
- const floatingUI = require("@agnos-ui/core/services/floatingUI");
26
- const extendWidget = require("@agnos-ui/core/services/extendWidget");
27
28
  const tree = require("@agnos-ui/core/components/tree");
28
29
  const toasterProvider = require("./toasterProvider-BtIHSdiL.cjs");
29
30
  const toast = require("@agnos-ui/core/components/toast");
@@ -34,6 +35,7 @@ const progressbar = require("@agnos-ui/core/components/progressbar");
34
35
  const pagination = require("@agnos-ui/core/components/pagination");
35
36
  const modal = require("@agnos-ui/core/components/modal");
36
37
  const carousel = require("@agnos-ui/core/components/carousel");
38
+ const collapse$1 = require("@agnos-ui/core/components/collapse");
37
39
  const alert = require("@agnos-ui/core/components/alert");
38
40
  const accordion = require("@agnos-ui/core/components/accordion");
39
41
  const portal$1 = require("./portal-B0Q5KLrA.cjs");
@@ -56,124 +58,130 @@ exports.useCreateToaster = toasterProvider.useCreateToaster;
56
58
  exports.useToaster = toasterProvider.useToaster;
57
59
  exports.Portal = portal$1.Portal;
58
60
  exports.Slot = slot.Slot;
59
- Object.keys(simpleClassTransition).forEach((k) => {
61
+ Object.keys(siblingsInert).forEach((k) => {
60
62
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
61
63
  enumerable: true,
62
- get: () => simpleClassTransition[k]
64
+ get: () => siblingsInert[k]
63
65
  });
64
66
  });
65
- Object.keys(cssTransitions).forEach((k) => {
67
+ Object.keys(resizeObserver).forEach((k) => {
66
68
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
67
69
  enumerable: true,
68
- get: () => cssTransitions[k]
70
+ get: () => resizeObserver[k]
69
71
  });
70
72
  });
71
- Object.keys(collapse).forEach((k) => {
73
+ Object.keys(portal).forEach((k) => {
72
74
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
73
75
  enumerable: true,
74
- get: () => collapse[k]
76
+ get: () => portal[k]
75
77
  });
76
78
  });
77
- Object.keys(baseTransitions).forEach((k) => {
79
+ Object.keys(navManager).forEach((k) => {
78
80
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
79
81
  enumerable: true,
80
- get: () => baseTransitions[k]
82
+ get: () => navManager[k]
81
83
  });
82
84
  });
83
- Object.keys(writables).forEach((k) => {
85
+ Object.keys(matchMedia).forEach((k) => {
84
86
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
85
87
  enumerable: true,
86
- get: () => writables[k]
88
+ get: () => matchMedia[k]
87
89
  });
88
90
  });
89
- Object.keys(stores$1).forEach((k) => {
91
+ Object.keys(intersection).forEach((k) => {
90
92
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
91
93
  enumerable: true,
92
- get: () => stores$1[k]
94
+ get: () => intersection[k]
93
95
  });
94
96
  });
95
- Object.keys(func).forEach((k) => {
97
+ Object.keys(hash).forEach((k) => {
96
98
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
97
99
  enumerable: true,
98
- get: () => func[k]
100
+ get: () => hash[k]
99
101
  });
100
102
  });
101
- Object.keys(directive$1).forEach((k) => {
103
+ Object.keys(focustrack).forEach((k) => {
102
104
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
103
105
  enumerable: true,
104
- get: () => directive$1[k]
106
+ get: () => focustrack[k]
105
107
  });
106
108
  });
107
- Object.keys(types).forEach((k) => {
109
+ Object.keys(floatingUI).forEach((k) => {
108
110
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
109
111
  enumerable: true,
110
- get: () => types[k]
112
+ get: () => floatingUI[k]
111
113
  });
112
114
  });
113
- Object.keys(config$1).forEach((k) => {
115
+ Object.keys(extendWidget).forEach((k) => {
114
116
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
115
117
  enumerable: true,
116
- get: () => config$1[k]
118
+ get: () => extendWidget[k]
117
119
  });
118
120
  });
119
- Object.keys(siblingsInert).forEach((k) => {
121
+ Object.keys(simpleClassTransition).forEach((k) => {
120
122
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
121
123
  enumerable: true,
122
- get: () => siblingsInert[k]
124
+ get: () => simpleClassTransition[k]
123
125
  });
124
126
  });
125
- Object.keys(resizeObserver).forEach((k) => {
127
+ Object.keys(cssTransitions).forEach((k) => {
126
128
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
127
129
  enumerable: true,
128
- get: () => resizeObserver[k]
130
+ get: () => cssTransitions[k]
129
131
  });
130
132
  });
131
- Object.keys(portal).forEach((k) => {
133
+ Object.keys(collapse).forEach((k) => {
132
134
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
133
135
  enumerable: true,
134
- get: () => portal[k]
136
+ get: () => collapse[k]
135
137
  });
136
138
  });
137
- Object.keys(navManager).forEach((k) => {
139
+ Object.keys(baseTransitions).forEach((k) => {
138
140
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
139
141
  enumerable: true,
140
- get: () => navManager[k]
142
+ get: () => baseTransitions[k]
141
143
  });
142
144
  });
143
- Object.keys(matchMedia).forEach((k) => {
145
+ Object.keys(writables).forEach((k) => {
144
146
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
145
147
  enumerable: true,
146
- get: () => matchMedia[k]
148
+ get: () => writables[k]
147
149
  });
148
150
  });
149
- Object.keys(intersection).forEach((k) => {
151
+ Object.keys(widget$1).forEach((k) => {
150
152
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
151
153
  enumerable: true,
152
- get: () => intersection[k]
154
+ get: () => widget$1[k]
153
155
  });
154
156
  });
155
- Object.keys(hash).forEach((k) => {
157
+ Object.keys(stores$1).forEach((k) => {
156
158
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
157
159
  enumerable: true,
158
- get: () => hash[k]
160
+ get: () => stores$1[k]
159
161
  });
160
162
  });
161
- Object.keys(focustrack).forEach((k) => {
163
+ Object.keys(func).forEach((k) => {
162
164
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
163
165
  enumerable: true,
164
- get: () => focustrack[k]
166
+ get: () => func[k]
165
167
  });
166
168
  });
167
- Object.keys(floatingUI).forEach((k) => {
169
+ Object.keys(directive$1).forEach((k) => {
168
170
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
169
171
  enumerable: true,
170
- get: () => floatingUI[k]
172
+ get: () => directive$1[k]
171
173
  });
172
174
  });
173
- Object.keys(extendWidget).forEach((k) => {
175
+ Object.keys(types).forEach((k) => {
174
176
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
175
177
  enumerable: true,
176
- get: () => extendWidget[k]
178
+ get: () => types[k]
179
+ });
180
+ });
181
+ Object.keys(config$1).forEach((k) => {
182
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
183
+ enumerable: true,
184
+ get: () => config$1[k]
177
185
  });
178
186
  });
179
187
  Object.keys(tree).forEach((k) => {
@@ -230,6 +238,12 @@ Object.keys(carousel).forEach((k) => {
230
238
  get: () => carousel[k]
231
239
  });
232
240
  });
241
+ Object.keys(collapse$1).forEach((k) => {
242
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
243
+ enumerable: true,
244
+ get: () => collapse$1[k]
245
+ });
246
+ });
233
247
  Object.keys(alert).forEach((k) => {
234
248
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
235
249
  enumerable: true,
package/index.js CHANGED
@@ -1,9 +1,20 @@
1
+ export * from "@agnos-ui/core/services/siblingsInert";
2
+ export * from "@agnos-ui/core/services/resizeObserver";
3
+ export * from "@agnos-ui/core/services/portal";
4
+ export * from "@agnos-ui/core/services/navManager";
5
+ export * from "@agnos-ui/core/services/matchMedia";
6
+ export * from "@agnos-ui/core/services/intersection";
7
+ export * from "@agnos-ui/core/services/hash";
8
+ export * from "@agnos-ui/core/services/focustrack";
9
+ export * from "@agnos-ui/core/services/floatingUI";
10
+ export * from "@agnos-ui/core/services/extendWidget";
1
11
  export * from "@agnos-ui/core/services/transitions/simpleClassTransition";
2
12
  export * from "@agnos-ui/core/services/transitions/cssTransitions";
3
13
  export * from "@agnos-ui/core/services/transitions/collapse";
4
14
  export * from "@agnos-ui/core/services/transitions/baseTransitions";
5
15
  export * from "@agnos-ui/core/utils/writables";
6
- import { u } from "./widget-BiWY_QJE.js";
16
+ export * from "@agnos-ui/core/utils/widget";
17
+ import { u } from "./widget-DLB7vGCY.js";
7
18
  export * from "@agnos-ui/core/utils/stores";
8
19
  import { u as u2, a, b } from "./stores-DZalyTTa.js";
9
20
  export * from "@agnos-ui/core/utils/func";
@@ -12,16 +23,6 @@ import { d, s, u as u3, a as a2 } from "./directive-CEErjM5c.js";
12
23
  export * from "@agnos-ui/core/types";
13
24
  export * from "@agnos-ui/core/config";
14
25
  import { WidgetsConfigContext, WidgetsDefaultConfig, useWidget, useWidgetContext, widgetsConfigFactory } from "./config.js";
15
- export * from "@agnos-ui/core/services/siblingsInert";
16
- export * from "@agnos-ui/core/services/resizeObserver";
17
- export * from "@agnos-ui/core/services/portal";
18
- export * from "@agnos-ui/core/services/navManager";
19
- export * from "@agnos-ui/core/services/matchMedia";
20
- export * from "@agnos-ui/core/services/intersection";
21
- export * from "@agnos-ui/core/services/hash";
22
- export * from "@agnos-ui/core/services/focustrack";
23
- export * from "@agnos-ui/core/services/floatingUI";
24
- export * from "@agnos-ui/core/services/extendWidget";
25
26
  export * from "@agnos-ui/core/components/tree";
26
27
  import { T, u as u4, a as a3 } from "./toasterProvider-lT-AfOoK.js";
27
28
  export * from "@agnos-ui/core/components/toast";
@@ -32,6 +33,7 @@ export * from "@agnos-ui/core/components/progressbar";
32
33
  export * from "@agnos-ui/core/components/pagination";
33
34
  export * from "@agnos-ui/core/components/modal";
34
35
  export * from "@agnos-ui/core/components/carousel";
36
+ export * from "@agnos-ui/core/components/collapse";
35
37
  export * from "@agnos-ui/core/components/alert";
36
38
  export * from "@agnos-ui/core/components/accordion";
37
39
  import { P } from "./portal-CX8X69NK.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/react-headless",
3
3
  "description": "Headless component library for React.",
4
- "version": "0.9.1",
4
+ "version": "0.9.3",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "module": "./index.js",
@@ -49,7 +49,7 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@agnos-ui/core": "0.9.1"
52
+ "@agnos-ui/core": "0.9.3"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@amadeus-it-group/tansu": "^2.0.0",
package/utils/widget.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { PropsConfig, Widget, WidgetFactory, WidgetProps, WidgetSlotContext } from '@agnos-ui/core/types';
2
+ export * from '@agnos-ui/core/utils/widget';
2
3
  /**
3
4
  * Create and attach an agnos-ui/core widget to the current react component.
4
5
  *
@@ -2,6 +2,7 @@
2
2
  const stores = require("@agnos-ui/core/utils/stores");
3
3
  const react = require("react");
4
4
  const stores$1 = require("./stores-DD819q-h.cjs");
5
+ require("@agnos-ui/core/utils/widget");
5
6
  function useWidgetWithConfig(factory, props = {}, propsConfig) {
6
7
  const coreWidget = react.useMemo(() => factory({ ...propsConfig, props: { ...propsConfig == null ? void 0 : propsConfig.props, ...props } }), []);
7
8
  const previousProps = react.useRef(props);
@@ -1,6 +1,7 @@
1
1
  import { findChangedProperties } from "@agnos-ui/core/utils/stores";
2
2
  import { useMemo, useRef } from "react";
3
3
  import { a as useObservablesProxy } from "./stores-DZalyTTa.js";
4
+ import "@agnos-ui/core/utils/widget";
4
5
  function useWidgetWithConfig(factory, props = {}, propsConfig) {
5
6
  const coreWidget = useMemo(() => factory({ ...propsConfig, props: { ...propsConfig == null ? void 0 : propsConfig.props, ...props } }), []);
6
7
  const previousProps = useRef(props);