@agnos-ui/core 0.9.3 → 0.10.0-next.0

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 (108) hide show
  1. package/{accordion-CoM4efp-.js → accordion-CcirvrjR.js} +10 -15
  2. package/{accordion-cR5JqWJ8.cjs → accordion-yD-czBna.cjs} +10 -15
  3. package/{alert-DtDozJal.cjs → alert-B-jQDQcB.cjs} +1 -1
  4. package/{alert-YIlqdEPO.js → alert-gGz2CDS9.js} +1 -1
  5. package/{collapse-DwXz2kNw.js → collapse-BV4kD3j9.js} +2 -2
  6. package/{collapse-DRp53EuG.cjs → collapse-gLiT080Y.cjs} +2 -2
  7. package/{common-BToNPUDq.cjs → common-D3QcdJ6S.cjs} +1 -1
  8. package/{common-BqUjUBPy.js → common-DK0ADNTX.js} +1 -1
  9. package/components/accordion/index.cjs +1 -1
  10. package/components/accordion/index.js +1 -1
  11. package/components/alert/index.cjs +1 -1
  12. package/components/alert/index.js +1 -1
  13. package/components/carousel/index.cjs +10 -23
  14. package/components/carousel/index.js +10 -23
  15. package/components/collapse/index.cjs +1 -1
  16. package/components/collapse/index.js +1 -1
  17. package/components/drawer/drawer.d.ts +222 -0
  18. package/components/drawer/index.cjs +5 -0
  19. package/components/drawer/index.d.ts +1 -0
  20. package/components/drawer/index.js +5 -0
  21. package/components/modal/index.cjs +2 -1
  22. package/components/modal/index.js +2 -1
  23. package/components/modal/modal.d.ts +5 -0
  24. package/components/pagination/index.cjs +1 -1
  25. package/components/pagination/index.js +1 -1
  26. package/components/progressbar/index.cjs +1 -1
  27. package/components/progressbar/index.js +1 -1
  28. package/components/rating/index.cjs +1 -1
  29. package/components/rating/index.js +1 -1
  30. package/components/select/index.cjs +1 -1
  31. package/components/select/index.js +1 -1
  32. package/components/slider/index.cjs +1 -1
  33. package/components/slider/index.js +1 -1
  34. package/components/toast/index.cjs +1 -1
  35. package/components/toast/index.js +1 -1
  36. package/components/tree/index.cjs +1 -1
  37. package/components/tree/index.js +1 -1
  38. package/config.cjs +2 -2
  39. package/config.d.ts +5 -0
  40. package/config.js +2 -2
  41. package/{dom-gfxqXJpK.js → dom-Bcg9ORcA.js} +64 -54
  42. package/{dom-CuBx1JPZ.cjs → dom-C2gi9OCP.cjs} +47 -37
  43. package/drawer-D5SO73ew.js +251 -0
  44. package/drawer-DP7UPojk.cjs +250 -0
  45. package/index.cjs +19 -13
  46. package/index.d.ts +1 -0
  47. package/index.js +36 -30
  48. package/isFocusable-Ckwus82R.js +32 -0
  49. package/isFocusable-DfzDLeAN.cjs +31 -0
  50. package/{modal-D3wGIDlj.js → modal-CAvQW-vo.js} +26 -32
  51. package/{modal-BEnQ6c5M.cjs → modal-DiXZXYjR.cjs} +27 -33
  52. package/package.json +1 -1
  53. package/{pagination-B97wBLok.js → pagination-BKbMROV6.js} +4 -4
  54. package/{pagination-C1TT-oea.cjs → pagination-DvZ2rLsz.cjs} +4 -4
  55. package/{progressbar-BWBlRk_Y.js → progressbar-D8zIcm9n.js} +2 -2
  56. package/{progressbar-CRvhNB5R.cjs → progressbar-i9xfAxb7.cjs} +2 -2
  57. package/{promise-XSP94FjG.js → promise-Y53vc4Ia.js} +5 -5
  58. package/{rating-BXvy9kXq.js → rating-DEXTGWCU.js} +2 -2
  59. package/{rating-DAb6nR67.cjs → rating-DmG4oUkr.cjs} +2 -2
  60. package/scrollbars-CT87iv_6.cjs +30 -0
  61. package/scrollbars-CcxSrnCx.js +31 -0
  62. package/{select-BdjpnE7_.js → select-Bw68Xdu5.js} +4 -5
  63. package/{select-C0rJJQfl.cjs → select-MFjAnIt7.cjs} +4 -5
  64. package/services/extendWidget.cjs +2 -2
  65. package/services/extendWidget.js +2 -2
  66. package/services/floatingUI.cjs +8 -29
  67. package/services/floatingUI.js +9 -30
  68. package/services/focusElement.cjs +46 -0
  69. package/services/focusElement.d.ts +9 -0
  70. package/services/focusElement.js +46 -0
  71. package/services/focustrack.cjs +1 -1
  72. package/services/focustrack.js +1 -1
  73. package/services/matchMedia.cjs +1 -1
  74. package/services/matchMedia.js +1 -1
  75. package/services/navManager.cjs +7 -37
  76. package/services/navManager.js +6 -36
  77. package/services/portal.cjs +7 -10
  78. package/services/portal.js +7 -10
  79. package/services/resizeObserver.cjs +2 -2
  80. package/services/resizeObserver.js +2 -2
  81. package/services/siblingsInert.cjs +9 -8
  82. package/services/siblingsInert.d.ts +13 -3
  83. package/services/siblingsInert.js +9 -8
  84. package/services/transitions/baseTransitions.cjs +9 -10
  85. package/services/transitions/baseTransitions.js +10 -11
  86. package/services/transitions/collapse.cjs +1 -1
  87. package/services/transitions/collapse.js +1 -1
  88. package/services/transitions/cssTransitions.cjs +1 -1
  89. package/services/transitions/cssTransitions.js +2 -2
  90. package/services/transitions/simpleClassTransition.cjs +1 -1
  91. package/services/transitions/simpleClassTransition.js +1 -1
  92. package/{slider-BmxQ3A_u.js → slider-Cx50Eghd.js} +14 -24
  93. package/{slider-DSx5CAce.cjs → slider-Dl4Trh32.cjs} +14 -24
  94. package/toaster-UDglac7x.cjs +187 -0
  95. package/toaster-_p1GTtHI.js +188 -0
  96. package/{tree-BFrXdJox.js → tree-DV0tfPlZ.js} +7 -11
  97. package/{tree-Pvr2rZ-D.cjs → tree-rGHtmCnS.cjs} +7 -11
  98. package/utils/directive.cjs +3 -1
  99. package/utils/directive.d.ts +47 -0
  100. package/utils/directive.js +14 -12
  101. package/utils/stores.cjs +8 -9
  102. package/utils/stores.js +8 -9
  103. package/utils/writables.cjs +1 -1
  104. package/utils/writables.js +1 -1
  105. package/{writables-Bn3uhKEG.cjs → writables-DcGT98a7.cjs} +1 -1
  106. package/{writables-CgpOQ4hA.js → writables-e0tyaQpe.js} +1 -1
  107. package/toaster-Cayg6Lbq.cjs +0 -209
  108. package/toaster-XfzHDqz_.js +0 -210
@@ -2,8 +2,8 @@ import { writablesForProps, idWithDefault, stateStores, true$, mergeConfigStores
2
2
  import { createTransition } from "./services/transitions/baseTransitions.js";
3
3
  import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
4
4
  import { noop } from "./utils/func.js";
5
- import { e as typeString, g as typeFunction, c as typeBoolean } from "./writables-CgpOQ4hA.js";
6
- import { k as mergeDirectives, n as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-gfxqXJpK.js";
5
+ import { e as typeString, g as typeFunction, c as typeBoolean } from "./writables-e0tyaQpe.js";
6
+ import { n as mergeDirectives, p as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-Bcg9ORcA.js";
7
7
  import { createWidgetFactory } from "./utils/widget.js";
8
8
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
9
9
  let keepOpen;
@@ -236,16 +236,13 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
236
236
  patch,
237
237
  api: {
238
238
  expand: (id) => {
239
- var _a;
240
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.expand();
239
+ getItem(itemWidgets$(), id)?.api.expand();
241
240
  },
242
241
  collapse: (id) => {
243
- var _a;
244
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.collapse();
242
+ getItem(itemWidgets$(), id)?.api.collapse();
245
243
  },
246
244
  toggle: (id) => {
247
- var _a;
248
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.toggle();
245
+ getItem(itemWidgets$(), id)?.api.toggle();
249
246
  },
250
247
  expandAll: () => {
251
248
  itemWidgets$().forEach((i) => i.api.expand());
@@ -255,23 +252,22 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
255
252
  },
256
253
  registerItem: (propsConfig) => {
257
254
  const itemProps = accordionItemProps;
258
- const config2 = mergeConfigStores(itemProps, normalizeConfigStores(itemProps, propsConfig == null ? void 0 : propsConfig.config), accordionItemConfig);
255
+ const config2 = mergeConfigStores(itemProps, normalizeConfigStores(itemProps, propsConfig?.config), accordionItemConfig);
259
256
  const [{ onHidden$, onShown$ }] = writablesForProps(
260
257
  {
261
258
  onHidden: defaultItemConfig.onHidden,
262
259
  onShown: defaultItemConfig.onShown
263
260
  },
264
- { config: config2, props: propsConfig == null ? void 0 : propsConfig.props }
261
+ { config: config2, props: propsConfig?.props }
265
262
  );
266
263
  const item = itemFactory({
267
264
  config: config2,
268
265
  props: {
269
- ...propsConfig == null ? void 0 : propsConfig.props,
266
+ ...propsConfig?.props,
270
267
  onHidden: asWritable(
271
268
  readable(() => {
272
- var _a;
273
269
  onItemHidden$()(item.stores.id$());
274
- (_a = onHidden$()) == null ? void 0 : _a();
270
+ onHidden$()?.();
275
271
  }),
276
272
  (val) => {
277
273
  onItemHidden$.set(val);
@@ -279,9 +275,8 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
279
275
  ),
280
276
  onShown: asWritable(
281
277
  readable(() => {
282
- var _a;
283
278
  onItemShown$()(item.stores.id$());
284
- (_a = onShown$()) == null ? void 0 : _a();
279
+ onShown$()?.();
285
280
  }),
286
281
  (val) => {
287
282
  onItemShown$.set(val);
@@ -3,8 +3,8 @@ const utils_stores = require("./utils/stores.cjs");
3
3
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
4
4
  const tansu = require("@amadeus-it-group/tansu");
5
5
  const utils_func = require("./utils/func.cjs");
6
- const utils_writables = require("./writables-Bn3uhKEG.cjs");
7
- const utils_directive = require("./dom-CuBx1JPZ.cjs");
6
+ const utils_writables = require("./writables-DcGT98a7.cjs");
7
+ const utils_directive = require("./dom-C2gi9OCP.cjs");
8
8
  const utils_widget = require("./utils/widget.cjs");
9
9
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
10
10
  let keepOpen;
@@ -237,16 +237,13 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
237
237
  patch,
238
238
  api: {
239
239
  expand: (id) => {
240
- var _a;
241
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.expand();
240
+ getItem(itemWidgets$(), id)?.api.expand();
242
241
  },
243
242
  collapse: (id) => {
244
- var _a;
245
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.collapse();
243
+ getItem(itemWidgets$(), id)?.api.collapse();
246
244
  },
247
245
  toggle: (id) => {
248
- var _a;
249
- (_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.toggle();
246
+ getItem(itemWidgets$(), id)?.api.toggle();
250
247
  },
251
248
  expandAll: () => {
252
249
  itemWidgets$().forEach((i) => i.api.expand());
@@ -256,23 +253,22 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
256
253
  },
257
254
  registerItem: (propsConfig) => {
258
255
  const itemProps = accordionItemProps;
259
- const config2 = utils_stores.mergeConfigStores(itemProps, utils_stores.normalizeConfigStores(itemProps, propsConfig == null ? void 0 : propsConfig.config), accordionItemConfig);
256
+ const config2 = utils_stores.mergeConfigStores(itemProps, utils_stores.normalizeConfigStores(itemProps, propsConfig?.config), accordionItemConfig);
260
257
  const [{ onHidden$, onShown$ }] = utils_stores.writablesForProps(
261
258
  {
262
259
  onHidden: defaultItemConfig.onHidden,
263
260
  onShown: defaultItemConfig.onShown
264
261
  },
265
- { config: config2, props: propsConfig == null ? void 0 : propsConfig.props }
262
+ { config: config2, props: propsConfig?.props }
266
263
  );
267
264
  const item = itemFactory({
268
265
  config: config2,
269
266
  props: {
270
- ...propsConfig == null ? void 0 : propsConfig.props,
267
+ ...propsConfig?.props,
271
268
  onHidden: tansu.asWritable(
272
269
  tansu.readable(() => {
273
- var _a;
274
270
  onItemHidden$()(item.stores.id$());
275
- (_a = onHidden$()) == null ? void 0 : _a();
271
+ onHidden$()?.();
276
272
  }),
277
273
  (val) => {
278
274
  onItemHidden$.set(val);
@@ -280,9 +276,8 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
280
276
  ),
281
277
  onShown: tansu.asWritable(
282
278
  tansu.readable(() => {
283
- var _a;
284
279
  onItemShown$()(item.stores.id$());
285
- (_a = onShown$()) == null ? void 0 : _a();
280
+ onShown$()?.();
286
281
  }),
287
282
  (val) => {
288
283
  onItemShown$.set(val);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const common = require("./common-BToNPUDq.cjs");
2
+ const common = require("./common-D3QcdJ6S.cjs");
3
3
  const utils_widget = require("./utils/widget.cjs");
4
4
  function getAlertDefaultConfig() {
5
5
  return { ...common.getCommonAlertDefaultConfig() };
@@ -1,4 +1,4 @@
1
- import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-BqUjUBPy.js";
1
+ import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-DK0ADNTX.js";
2
2
  import { createWidgetFactory } from "./utils/widget.js";
3
3
  function getAlertDefaultConfig() {
4
4
  return { ...getCommonAlertDefaultConfig() };
@@ -1,7 +1,7 @@
1
1
  import { createTransition } from "./services/transitions/baseTransitions.js";
2
2
  import { writablesForProps, idWithDefault, stateStores } from "./utils/stores.js";
3
- import { n as createAttributesDirective, k as mergeDirectives } from "./dom-gfxqXJpK.js";
4
- import { g as typeFunction, e as typeString, c as typeBoolean } from "./writables-CgpOQ4hA.js";
3
+ import { p as createAttributesDirective, n as mergeDirectives } from "./dom-Bcg9ORcA.js";
4
+ import { g as typeFunction, e as typeString, c as typeBoolean } from "./writables-e0tyaQpe.js";
5
5
  import { computed } from "@amadeus-it-group/tansu";
6
6
  import { noop } from "./utils/func.js";
7
7
  import { createWidgetFactory } from "./utils/widget.js";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
3
3
  const utils_stores = require("./utils/stores.cjs");
4
- const utils_directive = require("./dom-CuBx1JPZ.cjs");
5
- const utils_writables = require("./writables-Bn3uhKEG.cjs");
4
+ const utils_directive = require("./dom-C2gi9OCP.cjs");
5
+ const utils_writables = require("./writables-DcGT98a7.cjs");
6
6
  const tansu = require("@amadeus-it-group/tansu");
7
7
  const utils_func = require("./utils/func.cjs");
8
8
  const utils_widget = require("./utils/widget.cjs");
@@ -2,7 +2,7 @@
2
2
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
3
3
  const utils_func = require("./utils/func.cjs");
4
4
  const utils_stores = require("./utils/stores.cjs");
5
- const utils_writables = require("./writables-Bn3uhKEG.cjs");
5
+ const utils_writables = require("./writables-DcGT98a7.cjs");
6
6
  const defaultCommonAlertConfig = {
7
7
  visible: true,
8
8
  dismissible: true,
@@ -1,7 +1,7 @@
1
1
  import { createTransition } from "./services/transitions/baseTransitions.js";
2
2
  import { noop } from "./utils/func.js";
3
3
  import { writablesForProps, stateStores } from "./utils/stores.js";
4
- import { e as typeString, c as typeBoolean, g as typeFunction } from "./writables-CgpOQ4hA.js";
4
+ import { e as typeString, c as typeBoolean, g as typeFunction } from "./writables-e0tyaQpe.js";
5
5
  const defaultCommonAlertConfig = {
6
6
  visible: true,
7
7
  dismissible: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("../../accordion-cR5JqWJ8.cjs");
3
+ const accordion = require("../../accordion-yD-czBna.cjs");
4
4
  exports.createAccordion = accordion.createAccordion;
5
5
  exports.createAccordionItem = accordion.createAccordionItem;
6
6
  exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
@@ -1,4 +1,4 @@
1
- import { a, c, f, g } from "../../accordion-CoM4efp-.js";
1
+ import { a, c, f, g } from "../../accordion-CcirvrjR.js";
2
2
  export {
3
3
  a as createAccordion,
4
4
  c as createAccordionItem,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const alert = require("../../alert-DtDozJal.cjs");
3
+ const alert = require("../../alert-B-jQDQcB.cjs");
4
4
  exports.createAlert = alert.createAlert;
5
5
  exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../alert-YIlqdEPO.js";
1
+ import { c, g } from "../../alert-gGz2CDS9.js";
2
2
  export {
3
3
  c as createAlert,
4
4
  g as getAlertDefaultConfig
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const utils_stores = require("../../utils/stores.cjs");
4
- const utils_directive = require("../../dom-CuBx1JPZ.cjs");
4
+ const utils_directive = require("../../dom-C2gi9OCP.cjs");
5
5
  const EmblaCarousel = require("embla-carousel");
6
6
  const tansu = require("@amadeus-it-group/tansu");
7
- const utils_writables = require("../../writables-Bn3uhKEG.cjs");
7
+ const utils_writables = require("../../writables-DcGT98a7.cjs");
8
8
  const services_navManager = require("../../services/navManager.cjs");
9
9
  const utils_widget = require("../../utils/widget.cjs");
10
10
  const defaultConfig = {
@@ -94,7 +94,7 @@ function createEmblaCarousel(options$, plugins$) {
94
94
  emblaApi.reInit(options2, plugins2);
95
95
  },
96
96
  destroy: () => {
97
- emblaApi == null ? void 0 : emblaApi.destroy();
97
+ emblaApi?.destroy();
98
98
  emblaApi = void 0;
99
99
  initialized$.set(false);
100
100
  scrolling$.set(false);
@@ -176,21 +176,15 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
176
176
  patch,
177
177
  api: {
178
178
  scrollPrev: (jump) => {
179
- var _a, _b;
180
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev) == null ? void 0 : _b.call(_a, jump);
179
+ emblaCarousel.api?.scrollPrev?.(jump);
181
180
  },
182
181
  scrollNext: (jump) => {
183
- var _a, _b;
184
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext) == null ? void 0 : _b.call(_a, jump);
182
+ emblaCarousel.api?.scrollNext?.(jump);
185
183
  },
186
184
  scrollTo: (index, jump) => {
187
- var _a, _b;
188
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, index, jump);
189
- },
190
- plugins: () => {
191
- var _a, _b;
192
- return (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.plugins) == null ? void 0 : _b.call(_a);
185
+ emblaCarousel.api?.scrollTo?.(index, jump);
193
186
  },
187
+ plugins: () => emblaCarousel.api?.plugins?.(),
194
188
  emblaApi: () => emblaCarousel.api
195
189
  },
196
190
  directives: {
@@ -213,10 +207,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
213
207
  disabled: tansu.computed(() => !emblaCarousel.stores.canScrollPrev$() || void 0)
214
208
  },
215
209
  events: {
216
- click: () => {
217
- var _a;
218
- return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev();
219
- },
210
+ click: () => emblaCarousel.api?.scrollPrev(),
220
211
  pointerdown: (event) => event.preventDefault(),
221
212
  touchstart: (event) => event.stopPropagation()
222
213
  }
@@ -227,10 +218,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
227
218
  disabled: tansu.computed(() => !emblaCarousel.stores.canScrollNext$() || void 0)
228
219
  },
229
220
  events: {
230
- click: () => {
231
- var _a;
232
- return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext();
233
- },
221
+ click: () => emblaCarousel.api?.scrollNext(),
234
222
  pointerdown: (event) => event.preventDefault(),
235
223
  touchstart: (event) => event.stopPropagation()
236
224
  }
@@ -254,8 +242,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
254
242
  tabIndicator: utils_directive.createAttributesDirective((slide$) => ({
255
243
  events: {
256
244
  click: () => {
257
- var _a;
258
- (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo(slide$().index, slide$().jump ?? true);
245
+ emblaCarousel.api?.scrollTo(slide$().index, slide$().jump ?? true);
259
246
  }
260
247
  },
261
248
  attributes: {
@@ -1,8 +1,8 @@
1
1
  import { writablesForProps, stateStores, true$ } from "../../utils/stores.js";
2
- import { a as bindDirective, b as browserDirective, n as createAttributesDirective, k as mergeDirectives } from "../../dom-gfxqXJpK.js";
2
+ import { a as bindDirective, b as browserDirective, p as createAttributesDirective, n as mergeDirectives } from "../../dom-Bcg9ORcA.js";
3
3
  import EmblaCarousel from "embla-carousel";
4
4
  import { writable, computed, asReadable, readable } from "@amadeus-it-group/tansu";
5
- import { g as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, j as createTypeEnum, f as typeStringOrNull, i as typeArray } from "../../writables-CgpOQ4hA.js";
5
+ import { g as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, j as createTypeEnum, f as typeStringOrNull, i as typeArray } from "../../writables-e0tyaQpe.js";
6
6
  import { createNavManager } from "../../services/navManager.js";
7
7
  import { createWidgetFactory } from "../../utils/widget.js";
8
8
  const defaultConfig = {
@@ -92,7 +92,7 @@ function createEmblaCarousel(options$, plugins$) {
92
92
  emblaApi.reInit(options2, plugins2);
93
93
  },
94
94
  destroy: () => {
95
- emblaApi == null ? void 0 : emblaApi.destroy();
95
+ emblaApi?.destroy();
96
96
  emblaApi = void 0;
97
97
  initialized$.set(false);
98
98
  scrolling$.set(false);
@@ -174,21 +174,15 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
174
174
  patch,
175
175
  api: {
176
176
  scrollPrev: (jump) => {
177
- var _a, _b;
178
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev) == null ? void 0 : _b.call(_a, jump);
177
+ emblaCarousel.api?.scrollPrev?.(jump);
179
178
  },
180
179
  scrollNext: (jump) => {
181
- var _a, _b;
182
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext) == null ? void 0 : _b.call(_a, jump);
180
+ emblaCarousel.api?.scrollNext?.(jump);
183
181
  },
184
182
  scrollTo: (index, jump) => {
185
- var _a, _b;
186
- (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, index, jump);
187
- },
188
- plugins: () => {
189
- var _a, _b;
190
- return (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.plugins) == null ? void 0 : _b.call(_a);
183
+ emblaCarousel.api?.scrollTo?.(index, jump);
191
184
  },
185
+ plugins: () => emblaCarousel.api?.plugins?.(),
192
186
  emblaApi: () => emblaCarousel.api
193
187
  },
194
188
  directives: {
@@ -211,10 +205,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
211
205
  disabled: computed(() => !emblaCarousel.stores.canScrollPrev$() || void 0)
212
206
  },
213
207
  events: {
214
- click: () => {
215
- var _a;
216
- return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev();
217
- },
208
+ click: () => emblaCarousel.api?.scrollPrev(),
218
209
  pointerdown: (event) => event.preventDefault(),
219
210
  touchstart: (event) => event.stopPropagation()
220
211
  }
@@ -225,10 +216,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
225
216
  disabled: computed(() => !emblaCarousel.stores.canScrollNext$() || void 0)
226
217
  },
227
218
  events: {
228
- click: () => {
229
- var _a;
230
- return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext();
231
- },
219
+ click: () => emblaCarousel.api?.scrollNext(),
232
220
  pointerdown: (event) => event.preventDefault(),
233
221
  touchstart: (event) => event.stopPropagation()
234
222
  }
@@ -252,8 +240,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
252
240
  tabIndicator: createAttributesDirective((slide$) => ({
253
241
  events: {
254
242
  click: () => {
255
- var _a;
256
- (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo(slide$().index, slide$().jump ?? true);
243
+ emblaCarousel.api?.scrollTo(slide$().index, slide$().jump ?? true);
257
244
  }
258
245
  },
259
246
  attributes: {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const collapse = require("../../collapse-DRp53EuG.cjs");
3
+ const collapse = require("../../collapse-gLiT080Y.cjs");
4
4
  exports.createCollapse = collapse.createCollapse;
5
5
  exports.getCollapseDefaultConfig = collapse.getCollapseDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../collapse-DwXz2kNw.js";
1
+ import { c, g } from "../../collapse-BV4kD3j9.js";
2
2
  export {
3
3
  c as createCollapse,
4
4
  g as getCollapseDefaultConfig
@@ -0,0 +1,222 @@
1
+ import type { TransitionFn } from '../../services/transitions/baseTransitions';
2
+ import type { Directive, WidgetFactory } from '../../types';
3
+ import { type Widget } from '../../types';
4
+ import type { WidgetsCommonPropsAndState } from '../commonProps';
5
+ /**
6
+ * Possible values for the drawer positions
7
+ */
8
+ export type DrawerPositions = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
9
+ interface DrawerCommonPropsAndState extends WidgetsCommonPropsAndState {
10
+ /**
11
+ * Which element should contain the drawer and backdrop DOM elements.
12
+ * If it is not null, the drawer and backdrop DOM elements are moved to the specified container.
13
+ * Otherwise, they stay where the widget is located.
14
+ *
15
+ * @defaultValue
16
+ * ```ts
17
+ * typeof window !== 'undefined' ? document.body : null
18
+ * ```
19
+ */
20
+ container: HTMLElement | null;
21
+ /**
22
+ * Classes to add on the backdrop DOM element.
23
+ *
24
+ * @defaultValue `''`
25
+ */
26
+ backdropClass: string;
27
+ /**
28
+ * If `true`, the drawer is shown; otherwise, it is hidden.
29
+ *
30
+ * @defaultValue `false`
31
+ */
32
+ visible: boolean;
33
+ /**
34
+ * If `true`, the drawer can be resized by the user.
35
+ *
36
+ * @defaultValue `false`
37
+ */
38
+ resizable: boolean;
39
+ }
40
+ /**
41
+ * Interface representing the properties for the Drawer component.
42
+ */
43
+ export interface DrawerProps extends DrawerCommonPropsAndState {
44
+ /**
45
+ * The transition function will be executed when the drawer is displayed or hidden.
46
+ *
47
+ * @defaultValue
48
+ * ```ts
49
+ * () => {}
50
+ * ```
51
+ */
52
+ transition: TransitionFn;
53
+ /**
54
+ * The transition function for vertically positioned drawer (top, bottom) that will be executed when the drawer is displayed or hidden.
55
+ *
56
+ * @defaultValue
57
+ * ```ts
58
+ * () => {}
59
+ * ```
60
+ */
61
+ verticalTransition: TransitionFn;
62
+ /**
63
+ * The transition to use for the backdrop behind the drawer (if present).
64
+ *
65
+ * @defaultValue
66
+ * ```ts
67
+ * () => {}
68
+ * ```
69
+ */
70
+ backdropTransition: TransitionFn;
71
+ /**
72
+ * If `true` opening and closing will be animated.
73
+ */
74
+ animated: boolean;
75
+ /**
76
+ * aria-labelledby attribute to use for the drawer element.
77
+ */
78
+ ariaLabelledBy: string;
79
+ /**
80
+ * aria-describedby attribute to use for the drawer element.
81
+ */
82
+ ariaDescribedBy: string;
83
+ /**
84
+ * The width of the drawer in pixels.
85
+ */
86
+ width: number;
87
+ /**
88
+ * The height of the drawer in pixels.
89
+ */
90
+ height: number;
91
+ /**
92
+ * If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
93
+ */
94
+ backdrop: boolean;
95
+ /**
96
+ * If `true` allows body scrolling when the drawer is open.
97
+ */
98
+ bodyScroll: boolean;
99
+ /**
100
+ * Event to be triggered when the transition is completed and the drawer is not visible.
101
+ *
102
+ * @defaultValue
103
+ * ```ts
104
+ * () => {}
105
+ * ```
106
+ */
107
+ onHidden: () => void;
108
+ /**
109
+ * Event to be triggered when the transition is completed and the drawer is visible.
110
+ *
111
+ * @defaultValue
112
+ * ```ts
113
+ * () => {}
114
+ * ```
115
+ */
116
+ onShown: () => void;
117
+ /**
118
+ * An event emitted when the width is changed.
119
+ *
120
+ * Event payload is equal to the newly selected width.
121
+ *
122
+ * @defaultValue
123
+ * ```ts
124
+ * () => {}
125
+ * ```
126
+ */
127
+ onWidthChange: (width: number) => void;
128
+ /**
129
+ * An event emitted when the height is changed.
130
+ *
131
+ * Event payload is equal to the newly selected height.
132
+ *
133
+ * @defaultValue
134
+ * ```ts
135
+ * () => {}
136
+ * ```
137
+ */
138
+ onHeightChange: (width: number) => void;
139
+ /**
140
+ * Event to be triggered when the visible property changes.
141
+ *
142
+ * @param visible - new value of the visible propery
143
+ *
144
+ * @defaultValue
145
+ * ```ts
146
+ * () => {}
147
+ * ```
148
+ */
149
+ onVisibleChange: (visible: boolean) => void;
150
+ }
151
+ /**
152
+ * Represents the state of a Drawer component.
153
+ */
154
+ export interface DrawerState extends DrawerCommonPropsAndState {
155
+ /**
156
+ * Whether the backdrop is fully hidden. This can be true either because {@link DrawerProps.backdrop|backdrop} is false or
157
+ * because {@link DrawerProps.visible|visible} is false and there is no current transition.
158
+ */
159
+ backdropHidden: boolean;
160
+ /**
161
+ * Flag to show whether the drawer is fully hidden.
162
+ */
163
+ hidden: boolean;
164
+ }
165
+ /**
166
+ * Interface representing the API for a Drawer component.
167
+ */
168
+ export interface DrawerApi {
169
+ /**
170
+ * Trigger the opening of the drawer.
171
+ */
172
+ open: () => void;
173
+ /**
174
+ * Trigger the closing of the drawer.
175
+ */
176
+ close: () => void;
177
+ }
178
+ /**
179
+ * Interface representing various directives used in the Drawer component.
180
+ */
181
+ export interface DrawerDirectives {
182
+ /**
183
+ * Directive to put on the drawer DOM element.
184
+ */
185
+ drawerDirective: Directive;
186
+ /**
187
+ * Portal directive to put on the drawer DOM element.
188
+ */
189
+ drawerPortalDirective: Directive;
190
+ /**
191
+ * Directive to put on the backdrop DOM element.
192
+ */
193
+ backdropDirective: Directive;
194
+ /**
195
+ * Portal directive to put on the backdrop DOM element.
196
+ */
197
+ backdropPortalDirective: Directive;
198
+ /**
199
+ * Directive to put on the splitter DOM element.
200
+ */
201
+ splitterDirective: Directive;
202
+ /**
203
+ * Directive to put on the container DOM element in order for the drawer to size correctly.
204
+ */
205
+ containerDirective: Directive;
206
+ }
207
+ /**
208
+ * Represents a Drawer widget component.
209
+ */
210
+ export type DrawerWidget = Widget<DrawerProps, DrawerState, DrawerApi, DrawerDirectives>;
211
+ /**
212
+ * Retrieve a shallow copy of the default Drawer config
213
+ * @returns the default Drawer config
214
+ */
215
+ export declare function getDrawerDefaultConfig(): DrawerProps;
216
+ /**
217
+ * Create a Drawer widget with given config props
218
+ * @param config - an optional Drawer config
219
+ * @returns a DrawerWidget
220
+ */
221
+ export declare const createDrawer: WidgetFactory<DrawerWidget>;
222
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const drawer = require("../../drawer-DP7UPojk.cjs");
4
+ exports.createDrawer = drawer.createDrawer;
5
+ exports.getDrawerDefaultConfig = drawer.getDrawerDefaultConfig;
@@ -0,0 +1 @@
1
+ export * from './drawer';
@@ -0,0 +1,5 @@
1
+ import { c, g } from "../../drawer-D5SO73ew.js";
2
+ export {
3
+ c as createDrawer,
4
+ g as getDrawerDefaultConfig
5
+ };
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const modal = require("../../modal-BEnQ6c5M.cjs");
3
+ const modal = require("../../modal-DiXZXYjR.cjs");
4
4
  exports.createModal = modal.createModal;
5
5
  exports.getModalDefaultConfig = modal.getModalDefaultConfig;
6
6
  exports.modalCloseButtonClick = modal.modalCloseButtonClick;
7
+ exports.modalCloseEscape = modal.modalCloseEscape;
7
8
  exports.modalOutsideClick = modal.modalOutsideClick;
@@ -1,7 +1,8 @@
1
- import { c, g, a, m } from "../../modal-D3wGIDlj.js";
1
+ import { c, g, a, b, m } from "../../modal-CAvQW-vo.js";
2
2
  export {
3
3
  c as createModal,
4
4
  g as getModalDefaultConfig,
5
5
  a as modalCloseButtonClick,
6
+ b as modalCloseEscape,
6
7
  m as modalOutsideClick
7
8
  };