@agnos-ui/core 0.10.0-next.2 → 0.10.0-next.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.
Files changed (101) hide show
  1. package/{accordion-DqnKGmbS.js → accordion-47EpOD36.js} +2 -2
  2. package/{accordion-DRIm0xHf.cjs → accordion-nxveC0GZ.cjs} +2 -2
  3. package/{alert-B-jQDQcB.cjs → alert-AhaliJ17.cjs} +1 -1
  4. package/{alert-gGz2CDS9.js → alert-anMaigvi.js} +1 -1
  5. package/{collapse-BV4kD3j9.js → collapse-CrfvGo_T.js} +2 -2
  6. package/{collapse-gLiT080Y.cjs → collapse-Da_27YUU.cjs} +2 -2
  7. package/{common-D3QcdJ6S.cjs → common-B5jS-Ih_.cjs} +1 -1
  8. package/{common-DK0ADNTX.js → common-CCxNtFNM.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 +2 -2
  14. package/components/carousel/index.js +2 -2
  15. package/components/collapse/index.cjs +1 -1
  16. package/components/collapse/index.js +1 -1
  17. package/components/drawer/drawer.d.ts +32 -25
  18. package/components/drawer/index.cjs +1 -1
  19. package/components/drawer/index.js +1 -1
  20. package/components/modal/index.cjs +1 -1
  21. package/components/modal/index.js +1 -1
  22. package/components/pagination/index.cjs +1 -1
  23. package/components/pagination/index.js +1 -1
  24. package/components/progressbar/index.cjs +1 -1
  25. package/components/progressbar/index.js +1 -1
  26. package/components/rating/index.cjs +1 -1
  27. package/components/rating/index.js +1 -1
  28. package/components/select/index.cjs +1 -1
  29. package/components/select/index.js +1 -1
  30. package/components/slider/index.cjs +1 -1
  31. package/components/slider/index.js +1 -1
  32. package/components/toast/index.cjs +1 -1
  33. package/components/toast/index.js +1 -1
  34. package/components/tree/index.cjs +1 -1
  35. package/components/tree/index.js +1 -1
  36. package/{dom-C2gi9OCP.cjs → dom-Cm9_uROp.cjs} +76 -6
  37. package/{dom-Bcg9ORcA.js → dom-DD1hAVZy.js} +76 -6
  38. package/drawer-Caz4Uypu.js +291 -0
  39. package/{drawer-DP7UPojk.cjs → drawer-DOi0TqZC.cjs} +131 -91
  40. package/index.cjs +16 -14
  41. package/index.js +21 -19
  42. package/{modal-DiXZXYjR.cjs → modal-B_3Uxplo.cjs} +5 -5
  43. package/{modal-CAvQW-vo.js → modal-cKd3qUn1.js} +5 -5
  44. package/package.json +1 -1
  45. package/{pagination-DvZ2rLsz.cjs → pagination-2Vor6JPZ.cjs} +2 -2
  46. package/{pagination-BKbMROV6.js → pagination-DlOyP_2C.js} +2 -2
  47. package/{progressbar-D8zIcm9n.js → progressbar-B5g76eMV.js} +2 -2
  48. package/{progressbar-i9xfAxb7.cjs → progressbar-DyBRINco.cjs} +2 -2
  49. package/{rating-DmG4oUkr.cjs → rating-C0y1j4SC.cjs} +2 -2
  50. package/{rating-DEXTGWCU.js → rating-C7C4-p4B.js} +2 -2
  51. package/{select-MFjAnIt7.cjs → select-Dhsb9msC.cjs} +1 -1
  52. package/{select-Bw68Xdu5.js → select-nnl00UWY.js} +1 -1
  53. package/services/floatingUI.cjs +1 -1
  54. package/services/floatingUI.js +1 -1
  55. package/services/focusElement.cjs +1 -1
  56. package/services/focusElement.js +1 -1
  57. package/services/focustrack.cjs +1 -1
  58. package/services/focustrack.js +1 -1
  59. package/services/matchMedia.cjs +1 -1
  60. package/services/matchMedia.js +1 -1
  61. package/services/navManager.cjs +1 -1
  62. package/services/navManager.js +1 -1
  63. package/services/pointerdownPosition.cjs +60 -0
  64. package/services/pointerdownPosition.d.ts +42 -0
  65. package/services/pointerdownPosition.js +60 -0
  66. package/services/portal.cjs +1 -1
  67. package/services/portal.js +1 -1
  68. package/services/resizeObserver.cjs +40 -20
  69. package/services/resizeObserver.d.ts +10 -2
  70. package/services/resizeObserver.js +41 -21
  71. package/services/siblingsInert.cjs +1 -1
  72. package/services/siblingsInert.js +1 -1
  73. package/services/transitions/baseTransitions.cjs +2 -2
  74. package/services/transitions/baseTransitions.js +2 -2
  75. package/services/transitions/collapse.cjs +11 -15
  76. package/services/transitions/collapse.js +11 -15
  77. package/services/transitions/cssTransitions.cjs +1 -1
  78. package/services/transitions/cssTransitions.js +1 -1
  79. package/services/transitions/simpleClassTransition.cjs +1 -1
  80. package/services/transitions/simpleClassTransition.js +1 -1
  81. package/{slider-Cx50Eghd.js → slider-B4WrdTeE.js} +121 -170
  82. package/{slider-Dl4Trh32.cjs → slider-DTO58syz.cjs} +120 -169
  83. package/{toaster-_p1GTtHI.js → toaster-CRPErgI2.js} +3 -3
  84. package/{toaster-UDglac7x.cjs → toaster-CT148JSJ.cjs} +3 -3
  85. package/{tree-rGHtmCnS.cjs → tree-C4l2Wqny.cjs} +2 -2
  86. package/{tree-DV0tfPlZ.js → tree-CHpFqJPx.js} +2 -2
  87. package/types.cjs +2 -2
  88. package/types.d.ts +22 -3
  89. package/types.js +2 -2
  90. package/utils/directive.cjs +1 -1
  91. package/utils/directive.d.ts +2 -2
  92. package/utils/directive.js +1 -1
  93. package/utils/internal/ssrHTMLElement.d.ts +7 -1
  94. package/utils/stores.cjs +1 -1
  95. package/utils/stores.js +1 -1
  96. package/utils/writables.cjs +2 -1
  97. package/utils/writables.d.ts +7 -0
  98. package/utils/writables.js +6 -5
  99. package/{writables-DcGT98a7.cjs → writables-Dt68gADJ.cjs} +4 -0
  100. package/{writables-e0tyaQpe.js → writables-Is1bF1Vt.js} +10 -6
  101. package/drawer-D5SO73ew.js +0 -251
@@ -1,15 +1,16 @@
1
- import { j, t, i, c, d, g, h, a, b, e, f } from "../writables-e0tyaQpe.js";
1
+ import { k, t, j, c, d, h, i, a, b, g, e, f } from "../writables-Is1bF1Vt.js";
2
2
  import "../types.js";
3
3
  export {
4
- j as createTypeEnum,
4
+ k as createTypeEnum,
5
5
  t as testToNormalizeValue,
6
- i as typeArray,
6
+ j as typeArray,
7
7
  c as typeBoolean,
8
8
  d as typeBooleanOrNull,
9
- g as typeFunction,
10
- h as typeHTMLElementOrNull,
9
+ h as typeFunction,
10
+ i as typeHTMLElementOrNull,
11
11
  a as typeNumber,
12
12
  b as typeNumberInRangeFactory,
13
+ g as typeNumberOrNull,
13
14
  e as typeString,
14
15
  f as typeStringOrNull
15
16
  };
@@ -57,6 +57,9 @@ const typeString = {
57
57
  const typeStringOrNull = {
58
58
  normalizeValue: testToNormalizeValue(allowNull(isString))
59
59
  };
60
+ const typeNumberOrNull = {
61
+ normalizeValue: testToNormalizeValue(allowNull(isNumber))
62
+ };
60
63
  const typeFunction = {
61
64
  normalizeValue: testToNormalizeValue(isFunction),
62
65
  equal: Object.is
@@ -94,5 +97,6 @@ exports.typeFunction = typeFunction;
94
97
  exports.typeHTMLElementOrNull = typeHTMLElementOrNull;
95
98
  exports.typeNumber = typeNumber;
96
99
  exports.typeNumberInRangeFactory = typeNumberInRangeFactory;
100
+ exports.typeNumberOrNull = typeNumberOrNull;
97
101
  exports.typeString = typeString;
98
102
  exports.typeStringOrNull = typeStringOrNull;
@@ -56,6 +56,9 @@ const typeString = {
56
56
  const typeStringOrNull = {
57
57
  normalizeValue: testToNormalizeValue(allowNull(isString))
58
58
  };
59
+ const typeNumberOrNull = {
60
+ normalizeValue: testToNormalizeValue(allowNull(isNumber))
61
+ };
59
62
  const typeFunction = {
60
63
  normalizeValue: testToNormalizeValue(isFunction),
61
64
  equal: Object.is
@@ -89,11 +92,12 @@ export {
89
92
  typeBooleanOrNull as d,
90
93
  typeString as e,
91
94
  typeStringOrNull as f,
92
- typeFunction as g,
93
- typeHTMLElementOrNull as h,
94
- typeArray as i,
95
- createTypeEnum as j,
96
- clamp as k,
97
- isNumber as l,
95
+ typeNumberOrNull as g,
96
+ typeFunction as h,
97
+ typeHTMLElementOrNull as i,
98
+ typeArray as j,
99
+ createTypeEnum as k,
100
+ clamp as l,
101
+ isNumber as m,
98
102
  testToNormalizeValue as t
99
103
  };
@@ -1,251 +0,0 @@
1
- import { computed, asWritable, writable, readable } from "@amadeus-it-group/tansu";
2
- import { portal } from "./services/portal.js";
3
- import { siblingsInert } from "./services/siblingsInert.js";
4
- import { createTransition } from "./services/transitions/baseTransitions.js";
5
- import { a as bindDirective, n as mergeDirectives, p as createAttributesDirective } from "./dom-Bcg9ORcA.js";
6
- import { noop } from "./utils/func.js";
7
- import { r as removeScrollbars, a as revertScrollbars } from "./scrollbars-CcxSrnCx.js";
8
- import { writablesForProps, bindableProp, stateStores, true$ } from "./utils/stores.js";
9
- import { createWidgetFactory } from "./utils/widget.js";
10
- import { c as typeBoolean, g as typeFunction, b as typeNumberInRangeFactory, h as typeHTMLElementOrNull, e as typeString } from "./writables-e0tyaQpe.js";
11
- import { focusElement } from "./services/focusElement.js";
12
- function getDrawerDefaultConfig() {
13
- return {
14
- ...defaultDrawerConfig
15
- };
16
- }
17
- const defaultDrawerConfig = {
18
- animated: true,
19
- ariaDescribedBy: "",
20
- ariaLabelledBy: "",
21
- backdropClass: "",
22
- backdropTransition: noop,
23
- className: "w-full",
24
- visible: false,
25
- container: typeof window !== "undefined" ? document.body : null,
26
- transition: noop,
27
- verticalTransition: noop,
28
- onHidden: noop,
29
- onShown: noop,
30
- width: 200,
31
- height: 200,
32
- onWidthChange: noop,
33
- onHeightChange: noop,
34
- onVisibleChange: noop,
35
- resizable: false,
36
- backdrop: true,
37
- bodyScroll: false
38
- };
39
- const configValidator = {
40
- animated: typeBoolean,
41
- ariaDescribedBy: typeString,
42
- ariaLabelledBy: typeString,
43
- backdropClass: typeString,
44
- backdropTransition: typeFunction,
45
- className: typeString,
46
- visible: typeBoolean,
47
- transition: typeFunction,
48
- verticalTransition: typeFunction,
49
- container: typeHTMLElementOrNull,
50
- onHidden: typeFunction,
51
- onShown: typeFunction,
52
- width: typeNumberInRangeFactory(0, Infinity),
53
- height: typeNumberInRangeFactory(0, Infinity),
54
- onWidthChange: typeFunction,
55
- onHeightChange: typeFunction,
56
- onVisibleChange: typeFunction,
57
- resizable: typeBoolean,
58
- backdrop: typeBoolean,
59
- bodyScroll: typeBoolean
60
- };
61
- const createDrawer = createWidgetFactory("drawer", (config) => {
62
- const [
63
- {
64
- backdrop$,
65
- backdropTransition$,
66
- backdropClass$,
67
- bodyScroll$,
68
- transition$,
69
- verticalTransition$,
70
- visible$: requestedVisible$,
71
- container$,
72
- className$,
73
- animated$,
74
- ariaDescribedBy$,
75
- ariaLabelledBy$,
76
- onHidden$,
77
- onShown$,
78
- width$: _dirtyWidth$,
79
- height$: _dirtyHeight$,
80
- onWidthChange$,
81
- onHeightChange$,
82
- onVisibleChange$,
83
- ...stateProps
84
- },
85
- patch
86
- ] = writablesForProps(defaultDrawerConfig, config, configValidator);
87
- const isVertical = computed(() => {
88
- const isVertical2 = ["block-start", "block-end"].some((placement) => className$().includes(placement));
89
- return isVertical2;
90
- });
91
- const transition = createTransition({
92
- props: {
93
- animated: animated$,
94
- animatedOnInit: animated$,
95
- transition: asWritable(computed(() => isVertical() ? verticalTransition$() : transition$())),
96
- visible: requestedVisible$,
97
- onVisibleChange: onVisibleChange$,
98
- onHidden: onHidden$,
99
- onShown: onShown$
100
- }
101
- });
102
- const width$ = bindableProp(_dirtyWidth$, onWidthChange$);
103
- const height$ = bindableProp(_dirtyHeight$, onHeightChange$);
104
- const drawerPortalDirective = bindDirective(
105
- portal,
106
- computed(() => ({ container: container$() }))
107
- );
108
- const drawerAttributeDirective = createAttributesDirective(() => ({
109
- attributes: {
110
- class: className$,
111
- role: readable("dialog"),
112
- "aria-describedby": ariaDescribedBy$,
113
- "aria-labelledby": ariaLabelledBy$,
114
- "aria-modal": readable("true"),
115
- tabIndex: readable("-1")
116
- },
117
- styles: {
118
- width: computed(() => isVertical() ? "100%" : `${width$()}px`),
119
- height: computed(() => isVertical() ? `${height$()}px` : "100%"),
120
- position: computed(() => container$() !== document.body && container$() !== null ? "relative" : "fixed"),
121
- outline: readable("none")
122
- },
123
- events: {
124
- keydown: async (e) => {
125
- const { key } = e;
126
- if (key === "Escape") {
127
- await transition.api.hide();
128
- }
129
- }
130
- }
131
- }));
132
- const containerDirective = createAttributesDirective(() => ({
133
- styles: {
134
- width: computed(() => isVertical() ? "100%" : `${width$()}px`),
135
- height: computed(() => isVertical() ? `${height$()}px` : "100%")
136
- }
137
- }));
138
- const backdropTransition = createTransition({
139
- props: {
140
- animated: animated$,
141
- transition: backdropTransition$
142
- }
143
- });
144
- const backdropPortalDirective = bindDirective(
145
- portal,
146
- computed(() => {
147
- const container = container$();
148
- const element = container ? transition.stores.element$() : void 0;
149
- return {
150
- container,
151
- insertBefore: element?.parentElement === container ? element : void 0
152
- };
153
- })
154
- );
155
- const backdropHidden$ = computed(() => {
156
- if (!bodyScroll$()) {
157
- if (hidden$()) {
158
- revertScrollbars();
159
- } else {
160
- removeScrollbars();
161
- }
162
- }
163
- return !backdrop$() || hidden$();
164
- });
165
- const backdropAttributeDirective = createAttributesDirective(() => ({
166
- attributes: {
167
- class: backdropClass$,
168
- "data-agnos-ignore-inert": true$
169
- },
170
- events: {
171
- click: async () => {
172
- await transition.api.hide();
173
- }
174
- }
175
- }));
176
- const direction = computed(() => ["inline-start", "block-start"].some((placement) => className$().includes(placement)) ? 1 : -1);
177
- const startDimension = writable(0);
178
- const startPos = writable(0);
179
- const dimension = writable(0);
180
- const splitterDirective = createAttributesDirective(() => ({
181
- attributes: {
182
- draggable: readable("true")
183
- },
184
- events: {
185
- dragstart: (e) => {
186
- startPos.set(isVertical() ? e.clientY : e.clientX);
187
- startDimension.set(isVertical() ? height$() : width$());
188
- e.dataTransfer?.setDragImage(new Image(), 0, 0);
189
- },
190
- dragend: (e) => {
191
- document.body.style.cursor = "";
192
- updateDimension(e);
193
- },
194
- dragover: (event) => {
195
- event.preventDefault();
196
- },
197
- drag: (e) => {
198
- updateDimension(e);
199
- }
200
- }
201
- }));
202
- const updateDimension = (e) => {
203
- if (!isVertical() && e.clientX > 0) {
204
- dimension.set(startDimension() + direction() * (e.clientX - startPos()));
205
- width$.set(dimension());
206
- } else if (isVertical() && e.clientY > 0) {
207
- dimension.set(startDimension() + direction() * (e.clientY - startPos()));
208
- height$.set(dimension());
209
- }
210
- };
211
- const visible$ = transition.stores.visible$;
212
- const transitioning$ = computed(() => transition.stores.transitioning$() || backdropTransition.stores.transitioning$());
213
- const hidden$ = computed(() => !transitioning$() && !visible$());
214
- const widget = {
215
- ...stateStores({
216
- ...stateProps,
217
- backdropClass$,
218
- className$,
219
- container$,
220
- visible$,
221
- backdropHidden$,
222
- hidden$
223
- }),
224
- patch,
225
- api: {
226
- open: transition.api.show,
227
- close: transition.api.hide
228
- },
229
- directives: {
230
- containerDirective,
231
- drawerPortalDirective,
232
- drawerDirective: mergeDirectives(
233
- transition.directives.directive,
234
- bindDirective(
235
- siblingsInert,
236
- computed(() => !bodyScroll$())
237
- ),
238
- drawerAttributeDirective,
239
- focusElement
240
- ),
241
- backdropPortalDirective,
242
- backdropDirective: mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
243
- splitterDirective
244
- }
245
- };
246
- return widget;
247
- });
248
- export {
249
- createDrawer as c,
250
- getDrawerDefaultConfig as g
251
- };