@agnos-ui/core 0.4.0-next.0 → 0.4.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.
package/index.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import { INVALID_VALUE, toSlotContextWidget } from "./types.js";
2
2
  import { a, c, f, g } from "./accordion-BnaSamoQ.js";
3
- import { c as c2, a as a2, d, g as g2 } from "./common-BCEqowKw.js";
4
- import { c as c3, g as g3 } from "./alert-8ilqhLst.js";
5
- import { c as c4, g as g4, a as a3, m } from "./modal-CeTI4jxI.js";
6
- import { c as c5, g as g5 } from "./pagination-BpPHKQsH.js";
7
- import { c as c6, g as g6 } from "./progressbar-BybOg5FE.js";
8
- import { c as c7, g as g7 } from "./rating-D6Tv_4Vx.js";
9
- import { c as c8, d as d2, g as g8 } from "./select-BS0mh7Qk.js";
10
- import { c as c9, g as g9 } from "./slider-ByDkbyr1.js";
11
- import { c as c10, g as g10 } from "./toast-DN0HwUbs.js";
3
+ import { c as c2, g as g2 } from "./alert-DdGuK__c.js";
4
+ import { c as c3, g as g3, a as a2, m } from "./modal-CeTI4jxI.js";
5
+ import { c as c4, g as g4 } from "./pagination-BpPHKQsH.js";
6
+ import { c as c5, g as g5 } from "./progressbar-BybOg5FE.js";
7
+ import { c as c6, g as g6 } from "./rating-D6Tv_4Vx.js";
8
+ import { c as c7, g as g7 } from "./select-jUrt_lSn.js";
9
+ import { c as c8, g as g8 } from "./slider-ByDkbyr1.js";
10
+ import { c as c9, g as g9 } from "./toast-BzxextBQ.js";
12
11
  import { createWidgetsConfig, mergeInto } from "./config.js";
13
12
  import { extendWidgetProps } from "./services/extendWidget.js";
14
13
  import { createFloatingUI } from "./services/floatingUI.js";
@@ -19,71 +18,68 @@ import { createNavManager, getKeyName, isInternalInputNavigation } from "./servi
19
18
  import { portal } from "./services/portal.js";
20
19
  import { createResizeObserver } from "./services/resizeObserver.js";
21
20
  import { sliblingsInert } from "./services/siblingsInert.js";
21
+ import { hash$ } from "./services/hash.js";
22
22
  import { createTransition, noAnimation } from "./services/transitions/baseTransitions.js";
23
23
  import { createCSSTransition, getTransitionDurationMs, hasTransition } from "./services/transitions/cssTransitions.js";
24
24
  import { createSimpleClassTransition } from "./services/transitions/simpleClassTransition.js";
25
- import { o, a as a4, c as c11, b, p, n, g as g11, j, f as f2, h, q, d as d3, e, i, m as m2, k, l, r, s } from "./directive-3-8yr-ZK.js";
25
+ import { o, a as a3, c as c10, b, p, n, g as g10, j, f as f2, h, q, d, e, i, m as m2, k, l, r, s } from "./directive-3-8yr-ZK.js";
26
26
  import { bindableDerived, bindableProp, createPatch, findChangedProperties, isStore, mergeConfigStores, normalizeConfigStores, stateStores, toReadableStore, toWritableStore, writableWithDefault, writablesForProps, writablesWithDefault } from "./utils/stores.js";
27
- import { t, h as h2, c as c12, d as d4, f as f3, g as g12, a as a5, b as b2, e as e2 } from "./writables-DoU_XYTX.js";
27
+ import { t, h as h2, c as c11, d as d2, f as f3, g as g11, a as a4, b as b2, e as e2 } from "./writables-DoU_XYTX.js";
28
28
  export {
29
29
  INVALID_VALUE,
30
30
  activeElement$,
31
31
  o as attributesData,
32
- a4 as bindDirective,
33
- c11 as bindDirectiveNoArg,
32
+ a3 as bindDirective,
33
+ c10 as bindDirectiveNoArg,
34
34
  bindableDerived,
35
35
  bindableProp,
36
36
  b as browserDirective,
37
37
  p as classDirective,
38
- c2 as commonAlertConfigValidator,
39
38
  a as createAccordion,
40
39
  c as createAccordionItem,
41
- c3 as createAlert,
40
+ c2 as createAlert,
42
41
  n as createAttributesDirective,
43
- g11 as createBrowserStoreArrayDirective,
42
+ g10 as createBrowserStoreArrayDirective,
44
43
  j as createBrowserStoreDirective,
45
44
  createCSSTransition,
46
- a2 as createCommonAlert,
47
45
  createFloatingUI,
48
46
  createHasFocus,
49
47
  createIntersection,
50
48
  createMatchMedia,
51
- c4 as createModal,
49
+ c3 as createModal,
52
50
  createNavManager,
53
- c5 as createPagination,
51
+ c4 as createPagination,
54
52
  createPatch,
55
- c6 as createProgressbar,
56
- c7 as createRating,
53
+ c5 as createProgressbar,
54
+ c6 as createRating,
57
55
  createResizeObserver,
58
- c8 as createSelect,
56
+ c7 as createSelect,
59
57
  createSimpleClassTransition,
60
- c9 as createSlider,
58
+ c8 as createSlider,
61
59
  f2 as createStoreArrayDirective,
62
60
  h as createStoreDirective,
63
- c10 as createToast,
61
+ c9 as createToast,
64
62
  createTransition,
65
63
  createWidgetsConfig,
66
- d as defaultCommonAlertConfig,
67
- d2 as defaultConfig,
68
64
  q as directiveAttributes,
69
- d3 as directiveSubscribe,
65
+ d as directiveSubscribe,
70
66
  e as directiveUpdate,
71
67
  extendWidgetProps,
72
68
  f as factoryCreateAccordion,
73
69
  findChangedProperties,
74
70
  g as getAccordionDefaultConfig,
75
- g3 as getAlertDefaultConfig,
76
- g2 as getCommonAlertDefaultConfig,
71
+ g2 as getAlertDefaultConfig,
77
72
  getKeyName,
78
- g4 as getModalDefaultConfig,
79
- g5 as getPaginationDefaultConfig,
80
- g6 as getProgressbarDefaultConfig,
81
- g7 as getRatingDefaultConfig,
82
- g8 as getSelectDefaultConfig,
83
- g9 as getSliderDefaultConfig,
84
- g10 as getToastDefaultConfig,
73
+ g3 as getModalDefaultConfig,
74
+ g4 as getPaginationDefaultConfig,
75
+ g5 as getProgressbarDefaultConfig,
76
+ g6 as getRatingDefaultConfig,
77
+ g7 as getSelectDefaultConfig,
78
+ g8 as getSliderDefaultConfig,
79
+ g9 as getToastDefaultConfig,
85
80
  getTransitionDurationMs,
86
81
  hasTransition,
82
+ hash$,
87
83
  i as isBrowserHTMLElement,
88
84
  isInternalInputNavigation,
89
85
  isStore,
@@ -91,7 +87,7 @@ export {
91
87
  mergeConfigStores,
92
88
  k as mergeDirectives,
93
89
  mergeInto,
94
- a3 as modalCloseButtonClick,
90
+ a2 as modalCloseButtonClick,
95
91
  m as modalOutsideClick,
96
92
  l as multiDirective,
97
93
  noAnimation,
@@ -106,11 +102,11 @@ export {
106
102
  toSlotContextWidget,
107
103
  toWritableStore,
108
104
  h2 as typeArray,
109
- c12 as typeBoolean,
110
- d4 as typeBooleanOrNull,
105
+ c11 as typeBoolean,
106
+ d2 as typeBooleanOrNull,
111
107
  f3 as typeFunction,
112
- g12 as typeHTMLElementOrNull,
113
- a5 as typeNumber,
108
+ g11 as typeHTMLElementOrNull,
109
+ a4 as typeNumber,
114
110
  b2 as typeNumberInRangeFactory,
115
111
  e2 as typeString,
116
112
  writableWithDefault,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/core",
3
3
  "description": "Framework-agnostic headless widget library.",
4
- "version": "0.4.0-next.0",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "module": "./index.js",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@amadeus-it-group/tansu": "^1.0.0",
48
- "@floating-ui/dom": "^1.6.5",
48
+ "@floating-ui/dom": "^1.6.7",
49
49
  "esm-env": "^1.0.0"
50
50
  },
51
51
  "sideEffects": false,
@@ -353,5 +353,4 @@ function createSelect(config) {
353
353
  return widget;
354
354
  }
355
355
  exports.createSelect = createSelect;
356
- exports.defaultConfig = defaultConfig;
357
356
  exports.getSelectDefaultConfig = getSelectDefaultConfig;
@@ -353,6 +353,5 @@ function createSelect(config) {
353
353
  }
354
354
  export {
355
355
  createSelect as c,
356
- defaultConfig as d,
357
356
  getSelectDefaultConfig as g
358
357
  };
@@ -25,4 +25,4 @@ export type ExtendWidgetAdaptSlotWidgetProps<Props, ExtraProps extends object, E
25
25
  * @param overrideDefaults - object overriding some default props of the widget to extend
26
26
  * @returns widget factory with the extra props
27
27
  */
28
- export declare const extendWidgetProps: <W extends Widget<object, object, object, object, object>, ExtraProps extends object, ExtraDirectives extends object = object>(factory: WidgetFactory<W>, extraPropsDefaults: ExtraProps, extraPropsConfig?: ConfigValidator<ExtraProps>, overrideDefaults?: Partial<WidgetState<W>>) => WidgetFactory<ExtendWidgetProps<W, ExtraProps, ExtraDirectives>>;
28
+ export declare const extendWidgetProps: <W extends Widget, ExtraProps extends object, ExtraDirectives extends object = object>(factory: WidgetFactory<W>, extraPropsDefaults: ExtraProps, extraPropsConfig?: ConfigValidator<ExtraProps>, overrideDefaults?: Partial<WidgetState<W>>) => WidgetFactory<ExtendWidgetProps<W, ExtraProps, ExtraDirectives>>;
@@ -64,8 +64,8 @@ export interface NavManagerItemConfig<T = any> {
64
64
  export declare const createNavManager: () => {
65
65
  elementsInDomOrder$: import("@amadeus-it-group/tansu").ReadableSignal<HTMLElement[]>;
66
66
  directive: <T = any>(node: import("..").SSRHTMLElement, args: NavManagerItemConfig<T>) => void | {
67
- update?: ((args: NavManagerItemConfig<T>) => void) | undefined;
68
- destroy?: (() => void) | undefined;
67
+ update?: (args: NavManagerItemConfig<T>) => void;
68
+ destroy?: () => void;
69
69
  };
70
70
  focusIndex: (index: number, moveDirection?: -1 | 0 | 1) => HTMLElement | null;
71
71
  focusPrevious: ({ event, referenceElement, }?: {
@@ -80,21 +80,21 @@ export declare const createNavManager: () => {
80
80
  event?: Event;
81
81
  }) => HTMLElement | null;
82
82
  focusFirstLeft: (args_0?: {
83
- event?: Event | undefined;
83
+ event?: Event;
84
84
  } | undefined) => HTMLElement | null;
85
85
  focusFirstRight: (args_0?: {
86
- event?: Event | undefined;
86
+ event?: Event;
87
87
  } | undefined) => HTMLElement | null;
88
88
  focusLast: ({ event }?: {
89
89
  event?: Event;
90
90
  }) => HTMLElement | null;
91
91
  focusLeft: (args_0?: {
92
- event?: Event | undefined;
93
- referenceElement?: HTMLElement | null | undefined;
92
+ event?: Event;
93
+ referenceElement?: HTMLElement | null;
94
94
  } | undefined) => HTMLElement | null;
95
95
  focusRight: (args_0?: {
96
- event?: Event | undefined;
97
- referenceElement?: HTMLElement | null | undefined;
96
+ event?: Event;
97
+ referenceElement?: HTMLElement | null;
98
98
  } | undefined) => HTMLElement | null;
99
99
  refreshElements: (now?: boolean) => void;
100
100
  };
@@ -2,7 +2,7 @@ import { computed } from "@amadeus-it-group/tansu";
2
2
  import { extendWidgetProps } from "./services/extendWidget.js";
3
3
  import { d as directiveSubscribe, n as createAttributesDirective } from "./directive-3-8yr-ZK.js";
4
4
  import { c as typeBoolean, b as typeNumberInRangeFactory } from "./writables-DoU_XYTX.js";
5
- import { g as getCommonAlertDefaultConfig, a as createCommonAlert } from "./common-BCEqowKw.js";
5
+ import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-CO5b5G_J.js";
6
6
  const toastDefaultConfig = {
7
7
  autoHide: true,
8
8
  delay: 5e3
@@ -3,7 +3,7 @@ const tansu = require("@amadeus-it-group/tansu");
3
3
  const services_extendWidget = require("./services/extendWidget.cjs");
4
4
  const utils_directive = require("./directive-j-xRk-h3.cjs");
5
5
  const utils_writables = require("./writables-D46sFgGK.cjs");
6
- const common = require("./common-Kb96q7i4.cjs");
6
+ const common = require("./common-nxv_hKNE.cjs");
7
7
  const toastDefaultConfig = {
8
8
  autoHide: true,
9
9
  delay: 5e3
package/types.d.ts CHANGED
@@ -63,7 +63,7 @@ export interface WidgetSlotContext<W extends Widget> {
63
63
  * @param w - the widget
64
64
  * @returns the slot context
65
65
  */
66
- export declare const toSlotContextWidget: <W extends Widget<object, object, object, object, object>>(w: W) => ContextWidget<W>;
66
+ export declare const toSlotContextWidget: <W extends Widget>(w: W) => ContextWidget<W>;
67
67
  export type WidgetState<T extends {
68
68
  state$: SubscribableStore<any>;
69
69
  }> = T extends {
package/utils/stores.d.ts CHANGED
@@ -144,7 +144,7 @@ export declare const writablesWithDefault: <T extends object>(defConfig: T, prop
144
144
  * const [{propA$, propB$}, patch] = writablesForProps(defConfig, config, validation);
145
145
  * ```
146
146
  */
147
- export declare const writablesForProps: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T>, options?: { [K in keyof T]?: WritableWithDefaultOptions<T[K]> | undefined; } | undefined) => [ToWritableSignal<T>, ReturnType<typeof createPatch<T>>];
147
+ export declare const writablesForProps: <T extends object>(defConfig: T, propsConfig?: PropsConfig<T>, options?: { [K in keyof T]?: WritableWithDefaultOptions<T[K]>; }) => [ToWritableSignal<T>, ReturnType<typeof createPatch<T>>];
148
148
  /**
149
149
  * Using input stores, this function builds an object containing the stores as readable and a global state.
150
150
  *
@@ -153,7 +153,7 @@ export declare const writablesForProps: <T extends object>(defConfig: T, propsCo
153
153
  */
154
154
  export declare const stateStores: <A extends object>(inputStores: { [K in keyof A as `${K & string}$`]: ReadableSignal<any>; }) => {
155
155
  state$: ReadableSignal<A>;
156
- stores: { [K_1 in keyof A as `${K_1 & string}$`]: ReadableSignal<A[K_1]>; };
156
+ stores: { [K in keyof A as `${K & string}$`]: ReadableSignal<A[K]>; };
157
157
  };
158
158
  /**
159
159
  * Creates a derived store that binds to multiple stores and triggers a callback when the value changes for any reason.
@@ -163,7 +163,7 @@ export declare const stateStores: <A extends object>(inputStores: { [K in keyof
163
163
  * @param equal - A function to determine if two values are equal. Used to compare the ajusted value with the current one.
164
164
  * @returns The derived store that reflects the combined state of the input stores.
165
165
  */
166
- export declare const bindableDerived: <T, U extends [WritableSignal<T, T>, ...StoreInput<any>[]]>(onChange$: ReadableSignal<(value: T) => void>, stores: U, adjustValue?: (arg: StoresInputValues<U>) => T, equal?: (currentValue: T, newValue: T) => boolean) => WritableSignal<T, T>;
166
+ export declare const bindableDerived: <T, U extends [WritableSignal<T>, ...StoreInput<any>[]]>(onChange$: ReadableSignal<(value: T) => void>, stores: U, adjustValue?: (arg: StoresInputValues<U>) => T, equal?: (currentValue: T, newValue: T) => boolean) => WritableSignal<T, T>;
167
167
  /**
168
168
  * Creates a computed store that contains the adjusted value of the given store and that triggers a callback when the value changes from the set or update
169
169
  * method of the returned writable store.