xmlui 0.10.19 → 0.10.21

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 (118) hide show
  1. package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
  2. package/dist/lib/{index-cuh97e2e.mjs → index-BiS4wEuu.mjs} +1486 -1211
  3. package/dist/lib/index.css +1 -1
  4. package/dist/{metadata/initMock-C-cnv--V.mjs → lib/initMock-CB_cMi6U.mjs} +25 -15
  5. package/dist/lib/language-server-web-worker.mjs +1 -1
  6. package/dist/lib/language-server.mjs +1 -1
  7. package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
  8. package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
  9. package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
  10. package/dist/lib/xmlui-parser.mjs +2 -2
  11. package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
  12. package/dist/lib/xmlui.d.ts +11 -3
  13. package/dist/lib/xmlui.mjs +2 -2
  14. package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
  15. package/dist/metadata/{collectedComponentMetadata-Cp-9lpnG.mjs → collectedComponentMetadata-MFUg6aSX.mjs} +1655 -1390
  16. package/dist/{lib/initMock-BMxsanHc.mjs → metadata/initMock-Dw9wrVkQ.mjs} +25 -15
  17. package/dist/metadata/style.css +1 -1
  18. package/dist/metadata/xmlui-metadata.mjs +1 -1
  19. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  20. package/dist/scripts/package.json +3 -6
  21. package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
  22. package/dist/scripts/src/components/App/App.js +4 -4
  23. package/dist/scripts/src/components/App/App.spec.js +17 -17
  24. package/dist/scripts/src/components/App/AppNative.js +1 -1
  25. package/dist/scripts/src/components/AppState/AppState.js +3 -2
  26. package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
  27. package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
  28. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
  29. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
  30. package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
  31. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
  32. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
  33. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
  34. package/dist/scripts/src/components/DateInput/DateInput.spec.js +6 -6
  35. package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -1
  36. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
  37. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
  38. package/dist/scripts/src/components/Form/Form.spec.js +25 -9
  39. package/dist/scripts/src/components/Form/FormNative.js +7 -5
  40. package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
  41. package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
  42. package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
  43. package/dist/scripts/src/components/FormItem/Validations.js +2 -2
  44. package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -2
  45. package/dist/scripts/src/components/IconRegistryContext.js +1 -1
  46. package/dist/scripts/src/components/List/ListNative.js +2 -2
  47. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
  48. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
  49. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
  50. package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
  51. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
  52. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +2 -2
  53. package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
  54. package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
  55. package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
  56. package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
  57. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +5 -5
  58. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
  59. package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
  60. package/dist/scripts/src/components/Select/Select.js +3 -3
  61. package/dist/scripts/src/components/Select/SelectContext.js +8 -1
  62. package/dist/scripts/src/components/Select/SelectNative.js +134 -142
  63. package/dist/scripts/src/components/Select/SelectOption.js +34 -0
  64. package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
  65. package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
  66. package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
  67. package/dist/scripts/src/components/Text/Text.js +5 -1
  68. package/dist/scripts/src/components/Text/Text.spec.js +317 -0
  69. package/dist/scripts/src/components/Text/TextNative.js +112 -1
  70. package/dist/scripts/src/components/TextArea/TextArea.spec.js +8 -8
  71. package/dist/scripts/src/components/Theme/Theme.js +2 -1
  72. package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
  73. package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
  74. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +3 -3
  75. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -1
  76. package/dist/scripts/src/components/Timer/TimerNative.js +0 -1
  77. package/dist/scripts/src/components/Tree/TreeNative.js +16 -23
  78. package/dist/scripts/src/components-core/InspectorContext.js +1 -1
  79. package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
  80. package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
  81. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
  82. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
  83. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
  84. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
  85. package/dist/scripts/src/components-core/interception/Backend.js +1 -1
  86. package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
  87. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
  88. package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
  89. package/dist/scripts/src/components-core/loader/Loader.js +11 -11
  90. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
  91. package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
  92. package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
  93. package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
  94. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
  95. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
  96. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
  97. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
  98. package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
  99. package/dist/scripts/src/components-core/utils/hooks.js +1 -1
  100. package/dist/scripts/src/components-core/utils/misc.js +4 -4
  101. package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
  102. package/dist/scripts/src/language-server/server-common.js +25 -24
  103. package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
  104. package/dist/scripts/src/language-server/services/completion.js +20 -2
  105. package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
  106. package/dist/scripts/src/language-server/services/hover.js +2 -2
  107. package/dist/scripts/src/parsers/common/utils.js +2 -2
  108. package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
  109. package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
  110. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
  111. package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
  112. package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
  113. package/dist/scripts/src/testing/component-test-helpers.js +34 -50
  114. package/dist/scripts/src/testing/fixtures.js +114 -113
  115. package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
  116. package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
  117. package/dist/standalone/xmlui-standalone.umd.js +35 -35
  118. package/package.json +3 -6
@@ -199,6 +199,22 @@ fixtures_1.test.describe("Accessibility", () => {
199
199
  // VISUAL STATE TESTS
200
200
  // =============================================================================
201
201
  fixtures_1.test.describe("Visual States", () => {
202
+ (0, fixtures_1.test)("component width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
203
+ yield initTestBed(`<Carousel width="500px">
204
+ <CarouselItem>Slide 1</CarouselItem>
205
+ <CarouselItem>Slide 2</CarouselItem>
206
+ </Carousel>`);
207
+ const carousel = page.getByRole("region");
208
+ yield (0, fixtures_1.expect)(carousel).toHaveCSS("width", "500px");
209
+ }));
210
+ (0, fixtures_1.test)("component height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
211
+ yield initTestBed(`<Carousel height="500px">
212
+ <CarouselItem>Slide 1</CarouselItem>
213
+ <CarouselItem>Slide 2</CarouselItem>
214
+ </Carousel>`);
215
+ const carousel = page.getByRole("region");
216
+ yield (0, fixtures_1.expect)(carousel).toHaveCSS("height", "500px");
217
+ }));
202
218
  (0, fixtures_1.test)("component control background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
203
219
  yield initTestBed(`<Carousel controls="true">
204
220
  <CarouselItem>Slide 1</CarouselItem>
@@ -235,6 +251,204 @@ fixtures_1.test.describe("Visual States", () => {
235
251
  const indicator = page.getByRole("tab", { name: "Go to slide 1" });
236
252
  yield (0, fixtures_1.expect)(indicator).toHaveCSS("width", "20px");
237
253
  }));
254
+ (0, fixtures_1.test)("component control height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
255
+ yield initTestBed(`<Carousel controls="true">
256
+ <CarouselItem>Slide 1</CarouselItem>
257
+ <CarouselItem>Slide 2</CarouselItem>
258
+ </Carousel>`, {
259
+ testThemeVars: {
260
+ "height-control-Carousel": "50px",
261
+ },
262
+ });
263
+ const control = page.getByRole("button", { name: "Next Slide" });
264
+ yield (0, fixtures_1.expect)(control).toHaveCSS("height", "50px");
265
+ }));
266
+ (0, fixtures_1.test)("component control width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
267
+ yield initTestBed(`<Carousel controls="true">
268
+ <CarouselItem>Slide 1</CarouselItem>
269
+ <CarouselItem>Slide 2</CarouselItem>
270
+ </Carousel>`, {
271
+ testThemeVars: {
272
+ "width-control-Carousel": "50px",
273
+ },
274
+ });
275
+ const control = page.getByRole("button", { name: "Next Slide" });
276
+ yield (0, fixtures_1.expect)(control).toHaveCSS("width", "50px");
277
+ }));
278
+ (0, fixtures_1.test)("component control border radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
279
+ yield initTestBed(`<Carousel controls="true">
280
+ <CarouselItem>Slide 1</CarouselItem>
281
+ <CarouselItem>Slide 2</CarouselItem>
282
+ </Carousel>`, {
283
+ testThemeVars: {
284
+ "borderRadius-control-Carousel": "10px",
285
+ },
286
+ });
287
+ const control = page.getByRole("button", { name: "Next Slide" });
288
+ yield (0, fixtures_1.expect)(control).toHaveCSS("border-radius", "10px");
289
+ }));
290
+ (0, fixtures_1.test)("component control hover background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
291
+ yield initTestBed(`<Carousel controls="true">
292
+ <CarouselItem>Slide 1</CarouselItem>
293
+ <CarouselItem>Slide 2</CarouselItem>
294
+ </Carousel>`, {
295
+ testThemeVars: {
296
+ "backgroundColor-control-hover-Carousel": "rgb(255, 165, 0)",
297
+ },
298
+ });
299
+ const control = page.getByRole("button", { name: "Next Slide" });
300
+ yield control.hover();
301
+ yield (0, fixtures_1.expect)(control).toHaveCSS("background-color", "rgb(255, 165, 0)");
302
+ }));
303
+ (0, fixtures_1.test)("component control hover text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
304
+ yield initTestBed(`<Carousel controls="true">
305
+ <CarouselItem>Slide 1</CarouselItem>
306
+ <CarouselItem>Slide 2</CarouselItem>
307
+ </Carousel>`, {
308
+ testThemeVars: {
309
+ "textColor-control-hover-Carousel": "rgb(255, 255, 255)",
310
+ },
311
+ });
312
+ const control = page.getByRole("button", { name: "Next Slide" });
313
+ yield control.hover();
314
+ yield (0, fixtures_1.expect)(control).toHaveCSS("color", "rgb(255, 255, 255)");
315
+ }));
316
+ (0, fixtures_1.test)("component control active background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
317
+ yield initTestBed(`<Carousel controls="true">
318
+ <CarouselItem>Slide 1</CarouselItem>
319
+ <CarouselItem>Slide 2</CarouselItem>
320
+ </Carousel>`, {
321
+ testThemeVars: {
322
+ "backgroundColor-control-active-Carousel": "rgb(0, 128, 0)",
323
+ },
324
+ });
325
+ const control = page.getByRole("button", { name: "Next Slide" });
326
+ yield control.hover();
327
+ yield page.mouse.down();
328
+ yield (0, fixtures_1.expect)(control).toHaveCSS("background-color", "rgb(0, 128, 0)");
329
+ }));
330
+ (0, fixtures_1.test)("component control active text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
331
+ yield initTestBed(`<Carousel controls="true">
332
+ <CarouselItem>Slide 1</CarouselItem>
333
+ <CarouselItem>Slide 2</CarouselItem>
334
+ </Carousel>`, {
335
+ testThemeVars: {
336
+ "textColor-control-active-Carousel": "rgb(255, 255, 0)",
337
+ },
338
+ });
339
+ const control = page.getByRole("button", { name: "Next Slide" });
340
+ yield control.hover();
341
+ yield page.mouse.down();
342
+ yield (0, fixtures_1.expect)(control).toHaveCSS("color", "rgb(255, 255, 0)");
343
+ }));
344
+ (0, fixtures_1.test)("component control disabled background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
345
+ yield initTestBed(`<Carousel controls="true" loop="false">
346
+ <CarouselItem>Slide 1</CarouselItem>
347
+ </Carousel>`, {
348
+ testThemeVars: {
349
+ "backgroundColor-control-disabled-Carousel": "rgb(200, 200, 200)",
350
+ },
351
+ });
352
+ const control = page.getByRole("button", { name: "Next Slide" });
353
+ yield (0, fixtures_1.expect)(control).toHaveCSS("background-color", "rgb(200, 200, 200)");
354
+ }));
355
+ (0, fixtures_1.test)("component control disabled text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
356
+ yield initTestBed(`<Carousel controls="true" loop="false">
357
+ <CarouselItem>Slide 1</CarouselItem>
358
+ </Carousel>`, {
359
+ testThemeVars: {
360
+ "textColor-control-disabled-Carousel": "rgb(150, 150, 150)",
361
+ },
362
+ });
363
+ const control = page.getByRole("button", { name: "Next Slide" });
364
+ yield (0, fixtures_1.expect)(control).toHaveCSS("color", "rgb(150, 150, 150)");
365
+ }));
366
+ (0, fixtures_1.test)("component indicator height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
367
+ yield initTestBed(`<Carousel indicators="true">
368
+ <CarouselItem>Slide 1</CarouselItem>
369
+ <CarouselItem>Slide 2</CarouselItem>
370
+ </Carousel>`, {
371
+ testThemeVars: {
372
+ "height-indicator-Carousel": "15px",
373
+ },
374
+ });
375
+ const indicator = page.getByRole("tab", { name: "Go to slide 1" });
376
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("height", "15px");
377
+ }));
378
+ (0, fixtures_1.test)("component indicator background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
379
+ yield initTestBed(`<Carousel indicators="true">
380
+ <CarouselItem>Slide 1</CarouselItem>
381
+ <CarouselItem>Slide 2</CarouselItem>
382
+ </Carousel>`, {
383
+ testThemeVars: {
384
+ "backgroundColor-indicator-Carousel": "rgb(100, 100, 100)",
385
+ },
386
+ });
387
+ const indicator = page.getByRole("tab", { name: "Go to slide 2" });
388
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("background-color", "rgb(100, 100, 100)");
389
+ }));
390
+ (0, fixtures_1.test)("component indicator text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
391
+ yield initTestBed(`<Carousel indicators="true">
392
+ <CarouselItem>Slide 1</CarouselItem>
393
+ <CarouselItem>Slide 2</CarouselItem>
394
+ </Carousel>`, {
395
+ testThemeVars: {
396
+ "textColor-indicator-Carousel": "rgb(50, 50, 50)",
397
+ },
398
+ });
399
+ const indicator = page.getByRole("tab", { name: "Go to slide 2" });
400
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("color", "rgb(50, 50, 50)");
401
+ }));
402
+ (0, fixtures_1.test)("component indicator hover background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
403
+ yield initTestBed(`<Carousel indicators="true">
404
+ <CarouselItem>Slide 1</CarouselItem>
405
+ <CarouselItem>Slide 2</CarouselItem>
406
+ </Carousel>`, {
407
+ testThemeVars: {
408
+ "backgroundColor-indicator-hover-Carousel": "rgb(150, 150, 255)",
409
+ },
410
+ });
411
+ const indicator = page.getByRole("tab", { name: "Go to slide 2" });
412
+ yield indicator.hover();
413
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("background-color", "rgb(150, 150, 255)");
414
+ }));
415
+ (0, fixtures_1.test)("component indicator hover text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
416
+ yield initTestBed(`<Carousel indicators="true">
417
+ <CarouselItem>Slide 1</CarouselItem>
418
+ <CarouselItem>Slide 2</CarouselItem>
419
+ </Carousel>`, {
420
+ testThemeVars: {
421
+ "textColor-indicator-hover-Carousel": "rgb(255, 100, 100)",
422
+ },
423
+ });
424
+ const indicator = page.getByRole("tab", { name: "Go to slide 2" });
425
+ yield indicator.hover();
426
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("color", "rgb(255, 100, 100)");
427
+ }));
428
+ (0, fixtures_1.test)("component indicator active background color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
429
+ yield initTestBed(`<Carousel indicators="true">
430
+ <CarouselItem>Slide 1</CarouselItem>
431
+ <CarouselItem>Slide 2</CarouselItem>
432
+ </Carousel>`, {
433
+ testThemeVars: {
434
+ "backgroundColor-indicator-active-Carousel": "rgb(0, 0, 255)",
435
+ },
436
+ });
437
+ const indicator = page.getByRole("tab", { name: "Go to slide 1" });
438
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("background-color", "rgb(0, 0, 255)");
439
+ }));
440
+ (0, fixtures_1.test)("component indicator active text color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
441
+ yield initTestBed(`<Carousel indicators="true">
442
+ <CarouselItem>Slide 1</CarouselItem>
443
+ <CarouselItem>Slide 2</CarouselItem>
444
+ </Carousel>`, {
445
+ testThemeVars: {
446
+ "textColor-indicator-active-Carousel": "rgb(255, 255, 255)",
447
+ },
448
+ });
449
+ const indicator = page.getByRole("tab", { name: "Go to slide 1" });
450
+ yield (0, fixtures_1.expect)(indicator).toHaveCSS("color", "rgb(255, 255, 255)");
451
+ }));
238
452
  });
239
453
  // =============================================================================
240
454
  // EDGE CASE TESTS
@@ -38,7 +38,7 @@ function CodeBlock(_a) {
38
38
  return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(CodeBlock_module_scss_1.default.codeBlock, "global-codeBlock"), style: style, children: [meta.filename && ((0, jsx_runtime_1.jsx)("div", { className: CodeBlock_module_scss_1.default.codeBlockHeader, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "em", children: meta.filename }) })), (0, jsx_runtime_1.jsxs)("div", { className: CodeBlock_module_scss_1.default.codeBlockContent, children: [children, meta.copy !== false && ((0, jsx_runtime_1.jsx)("div", { className: CodeBlock_module_scss_1.default.codeBlockCopyButton, children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "xs", className: CodeBlock_module_scss_1.default.copyButton, icon: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "copy", "aria-hidden": true }), onClick: () => {
39
39
  if (!textToCopy)
40
40
  return;
41
- navigator.clipboard.writeText(textToCopy);
41
+ void navigator.clipboard.writeText(textToCopy);
42
42
  react_hot_toast_1.default.success("Code copied!");
43
43
  } }) }))] })] }));
44
44
  }
@@ -36,6 +36,8 @@ exports.ContentSeparatorMd = (0, metadata_helpers_1.createMetadata)({
36
36
  defaultThemeVars: {
37
37
  [`backgroundColor-${COMP}`]: "$color-surface-200",
38
38
  [`size-${COMP}`]: "1px",
39
+ [`marginVertical-${COMP}`]: "0",
40
+ [`marginHorizontal-${COMP}`]: "0",
39
41
  light: {
40
42
  // --- No light-specific theme vars
41
43
  },
@@ -154,6 +154,199 @@ fixtures_1.test.describe("Visual States & Themes", () => {
154
154
  }));
155
155
  });
156
156
  // =============================================================================
157
+ // THEME VARIABLE TESTS
158
+ // =============================================================================
159
+ fixtures_1.test.describe("Theme Variables", () => {
160
+ (0, fixtures_1.test)("applies basic theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
161
+ yield initTestBed(`<ContentSeparator />`, {
162
+ testThemeVars: {
163
+ "backgroundColor-ContentSeparator": "rgb(255, 0, 0)",
164
+ "size-ContentSeparator": "5px",
165
+ },
166
+ });
167
+ const driver = yield createContentSeparatorDriver();
168
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("background-color", "rgb(255, 0, 0)");
169
+ const height = yield driver.getComputedHeight();
170
+ (0, fixtures_1.expect)(height).toBe('5px');
171
+ }));
172
+ (0, fixtures_1.test)("applies vertical margin theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
173
+ yield initTestBed(`<ContentSeparator />`, {
174
+ testThemeVars: {
175
+ "marginVertical-ContentSeparator": "10px",
176
+ },
177
+ });
178
+ const driver = yield createContentSeparatorDriver();
179
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "10px");
180
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "10px");
181
+ }));
182
+ (0, fixtures_1.test)("applies horizontal margin theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
183
+ yield initTestBed(`<ContentSeparator />`, {
184
+ testThemeVars: {
185
+ "marginHorizontal-ContentSeparator": "15px",
186
+ },
187
+ });
188
+ const driver = yield createContentSeparatorDriver();
189
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "15px");
190
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "15px");
191
+ }));
192
+ (0, fixtures_1.test)("specific margin-top overrides vertical margin", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
193
+ yield initTestBed(`<ContentSeparator />`, {
194
+ testThemeVars: {
195
+ "marginVertical-ContentSeparator": "10px",
196
+ "marginTop-ContentSeparator": "20px",
197
+ },
198
+ });
199
+ const driver = yield createContentSeparatorDriver();
200
+ // Specific margin-top should override vertical margin
201
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "20px");
202
+ // Bottom should still use vertical margin
203
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "10px");
204
+ }));
205
+ (0, fixtures_1.test)("specific margin-bottom overrides vertical margin", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
206
+ yield initTestBed(`<ContentSeparator />`, {
207
+ testThemeVars: {
208
+ "marginVertical-ContentSeparator": "10px",
209
+ "marginBottom-ContentSeparator": "25px",
210
+ },
211
+ });
212
+ const driver = yield createContentSeparatorDriver();
213
+ // Top should use vertical margin
214
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "10px");
215
+ // Specific margin-bottom should override vertical margin
216
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "25px");
217
+ }));
218
+ (0, fixtures_1.test)("specific margin-left overrides horizontal margin", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
219
+ yield initTestBed(`<ContentSeparator />`, {
220
+ testThemeVars: {
221
+ "marginHorizontal-ContentSeparator": "15px",
222
+ "marginLeft-ContentSeparator": "30px",
223
+ },
224
+ });
225
+ const driver = yield createContentSeparatorDriver();
226
+ // Specific margin-left should override horizontal margin
227
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "30px");
228
+ // Right should still use horizontal margin
229
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "15px");
230
+ }));
231
+ (0, fixtures_1.test)("specific margin-right overrides horizontal margin", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
232
+ yield initTestBed(`<ContentSeparator />`, {
233
+ testThemeVars: {
234
+ "marginHorizontal-ContentSeparator": "15px",
235
+ "marginRight-ContentSeparator": "35px",
236
+ },
237
+ });
238
+ const driver = yield createContentSeparatorDriver();
239
+ // Left should use horizontal margin
240
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "15px");
241
+ // Specific margin-right should override horizontal margin
242
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "35px");
243
+ }));
244
+ (0, fixtures_1.test)("all specific margins override general margins", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
245
+ yield initTestBed(`<ContentSeparator />`, {
246
+ testThemeVars: {
247
+ "marginVertical-ContentSeparator": "10px",
248
+ "marginHorizontal-ContentSeparator": "15px",
249
+ "marginTop-ContentSeparator": "5px",
250
+ "marginBottom-ContentSeparator": "8px",
251
+ "marginLeft-ContentSeparator": "12px",
252
+ "marginRight-ContentSeparator": "18px",
253
+ },
254
+ });
255
+ const driver = yield createContentSeparatorDriver();
256
+ // All specific margins should be used instead of general ones
257
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "5px");
258
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "8px");
259
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "12px");
260
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "18px");
261
+ }));
262
+ (0, fixtures_1.test)("fallback to vertical margin when specific margins not defined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
263
+ yield initTestBed(`<ContentSeparator />`, {
264
+ testThemeVars: {
265
+ "marginVertical-ContentSeparator": "20px",
266
+ // No specific marginTop or marginBottom defined
267
+ },
268
+ });
269
+ const driver = yield createContentSeparatorDriver();
270
+ // Should fall back to vertical margin values
271
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "20px");
272
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "20px");
273
+ }));
274
+ (0, fixtures_1.test)("fallback to horizontal margin when specific margins not defined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
275
+ yield initTestBed(`<ContentSeparator />`, {
276
+ testThemeVars: {
277
+ "marginHorizontal-ContentSeparator": "25px",
278
+ // No specific marginLeft or marginRight defined
279
+ },
280
+ });
281
+ const driver = yield createContentSeparatorDriver();
282
+ // Should fall back to horizontal margin values
283
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "25px");
284
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "25px");
285
+ }));
286
+ (0, fixtures_1.test)("handles zero margin values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
287
+ yield initTestBed(`<ContentSeparator />`, {
288
+ testThemeVars: {
289
+ "marginTop-ContentSeparator": "0px",
290
+ "marginBottom-ContentSeparator": "0px",
291
+ "marginLeft-ContentSeparator": "0px",
292
+ "marginRight-ContentSeparator": "0px",
293
+ },
294
+ });
295
+ const driver = yield createContentSeparatorDriver();
296
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "0px");
297
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "0px");
298
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "0px");
299
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "0px");
300
+ }));
301
+ (0, fixtures_1.test)("handles negative margin values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
302
+ yield initTestBed(`<ContentSeparator />`, {
303
+ testThemeVars: {
304
+ "marginTop-ContentSeparator": "-5px",
305
+ "marginLeft-ContentSeparator": "-10px",
306
+ },
307
+ });
308
+ const driver = yield createContentSeparatorDriver();
309
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "-5px");
310
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "-10px");
311
+ }));
312
+ (0, fixtures_1.test)("handles different unit types for margins", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
313
+ yield initTestBed(`<ContentSeparator />`, {
314
+ testThemeVars: {
315
+ "marginTop-ContentSeparator": "1rem",
316
+ "marginBottom-ContentSeparator": "2em",
317
+ "marginLeft-ContentSeparator": "10px",
318
+ "marginRight-ContentSeparator": "10px",
319
+ },
320
+ });
321
+ const driver = yield createContentSeparatorDriver();
322
+ // Browser computes rem/em to px values, so we check that margins are applied (not zero)
323
+ const marginTop = yield driver.separator.evaluate((el) => window.getComputedStyle(el).marginTop);
324
+ const marginBottom = yield driver.separator.evaluate((el) => window.getComputedStyle(el).marginBottom);
325
+ // rem and em should resolve to non-zero pixel values
326
+ (0, fixtures_1.expect)(parseFloat(marginTop)).toBeGreaterThan(0);
327
+ (0, fixtures_1.expect)(parseFloat(marginBottom)).toBeGreaterThan(0);
328
+ // px values should be exact
329
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "10px");
330
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "10px");
331
+ }));
332
+ (0, fixtures_1.test)("mixed general and specific margins work correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
333
+ yield initTestBed(`<ContentSeparator />`, {
334
+ testThemeVars: {
335
+ "marginVertical-ContentSeparator": "8px",
336
+ "marginHorizontal-ContentSeparator": "12px",
337
+ "marginTop-ContentSeparator": "16px", // Override top
338
+ "marginRight-ContentSeparator": "20px", // Override right
339
+ // marginBottom and marginLeft should use general values
340
+ },
341
+ });
342
+ const driver = yield createContentSeparatorDriver();
343
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-top", "16px"); // Specific
344
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-bottom", "8px"); // Fallback to vertical
345
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-left", "12px"); // Fallback to horizontal
346
+ yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("margin-right", "20px"); // Specific
347
+ }));
348
+ });
349
+ // =============================================================================
157
350
  // EDGE CASE TESTS
158
351
  // =============================================================================
159
352
  fixtures_1.test.describe("Edge Cases", () => {
@@ -492,7 +492,7 @@ fixtures_1.test.describe("User Interactions", () => {
492
492
  yield (0, fixtures_1.expect)(driver.monthInput).toHaveValue("05");
493
493
  yield (0, fixtures_1.expect)(driver.dayInput).toHaveValue("25");
494
494
  yield (0, fixtures_1.expect)(driver.yearInput).toHaveValue("2024");
495
- driver.dayInput.fill("18");
495
+ yield driver.dayInput.fill("18");
496
496
  yield driver.clearButton.click();
497
497
  yield (0, fixtures_1.expect)(driver.monthInput).toHaveValue("05");
498
498
  yield (0, fixtures_1.expect)(driver.dayInput).toHaveValue("25");
@@ -504,7 +504,7 @@ fixtures_1.test.describe("User Interactions", () => {
504
504
  yield (0, fixtures_1.expect)(driver.monthInput).toHaveValue("05");
505
505
  yield (0, fixtures_1.expect)(driver.dayInput).toHaveValue("25");
506
506
  yield (0, fixtures_1.expect)(driver.yearInput).toHaveValue("2024");
507
- driver.dayInput.fill("18");
507
+ yield driver.dayInput.fill("18");
508
508
  yield driver.clearButton.click();
509
509
  yield (0, fixtures_1.expect)(driver.monthInput).toHaveValue("");
510
510
  yield (0, fixtures_1.expect)(driver.dayInput).toHaveValue("");
@@ -805,8 +805,8 @@ fixtures_1.test.describe("Accessibility", () => {
805
805
  fixtures_1.test.describe("Theme Variables", () => {
806
806
  (0, fixtures_1.test)("component renders with theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createDateInputDriver }) {
807
807
  yield initTestBed(`
808
- <DateInput
809
- testId="dateInput"
808
+ <DateInput
809
+ testId="dateInput"
810
810
  style="--color-divider: red; --width-input: 100px; --backgroundColor-input-invalid: rgb(255, 200, 200);"
811
811
  />
812
812
  `);
@@ -818,8 +818,8 @@ fixtures_1.test.describe("Theme Variables", () => {
818
818
  }));
819
819
  (0, fixtures_1.test)("component renders with clearable and theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createDateInputDriver, }) {
820
820
  yield initTestBed(`
821
- <DateInput
822
- testId="dateInput"
821
+ <DateInput
822
+ testId="dateInput"
823
823
  clearable="{true}"
824
824
  style="--padding-button: 15px; --outlineColor-button--focused: green;"
825
825
  />
@@ -419,7 +419,6 @@ exports.DateInput = (0, react_2.forwardRef)(function DateInputNative(_a, ref) {
419
419
  }
420
420
  }, [day, month, year]);
421
421
  // Component API registration
422
- (0, react_2.useImperativeHandle)(ref, () => dateInputRef.current);
423
422
  (0, react_2.useEffect)(() => {
424
423
  if (registerComponentApi) {
425
424
  registerComponentApi({
@@ -141,7 +141,7 @@ const fixtures_1 = require("../../testing/fixtures");
141
141
  yield (0, fixtures_1.expect)(btn).toHaveAttribute("aria-haspopup", "menu");
142
142
  yield (0, fixtures_1.expect)(btn).toHaveAttribute("aria-expanded", "false");
143
143
  yield driver.open();
144
- page.getByRole("button", { includeHidden: true, expanded: true }).waitFor();
144
+ yield page.getByRole("button", { includeHidden: true, expanded: true }).waitFor();
145
145
  yield page.getByRole("menu").waitFor();
146
146
  }));
147
147
  (0, fixtures_1.test)("is keyboard accessible", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createDropdownMenuDriver, page }) {
@@ -151,10 +151,10 @@ const fixtures_1 = require("../../testing/fixtures");
151
151
  </DropdownMenu>
152
152
  `);
153
153
  const btn = page.getByRole("button");
154
- page.keyboard.press("Tab");
154
+ yield page.keyboard.press("Tab");
155
155
  yield (0, fixtures_1.expect)(btn).toBeFocused();
156
156
  // Open with Enter
157
- page.keyboard.press("Enter");
157
+ yield page.keyboard.press("Enter");
158
158
  yield (0, fixtures_1.expect)(page.getByRole("menuitem", { name: "Item 1" })).toBeVisible();
159
159
  // Navigate and select with keyboard
160
160
  yield page.keyboard.press("ArrowDown");
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  var __rest = (this && this.__rest) || function (s, e) {
45
36
  var t = {};
46
37
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -81,7 +72,7 @@ exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone
81
72
  const accept = acceptedFileTypes
82
73
  ? acceptedFileTypes.split(",").reduce((acc, type) => (Object.assign(Object.assign({}, acc), { [type.trim()]: [] })), {})
83
74
  : undefined;
84
- const onDrop = (0, react_1.useCallback)((acceptedFiles) => __awaiter(this, void 0, void 0, function* () {
75
+ const onDrop = (0, react_1.useCallback)((acceptedFiles) => {
85
76
  if (!acceptedFiles.length) {
86
77
  return;
87
78
  }
@@ -89,7 +80,7 @@ exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone
89
80
  value: acceptedFiles,
90
81
  });
91
82
  onUpload === null || onUpload === void 0 ? void 0 : onUpload(acceptedFiles);
92
- }), [onUpload, updateState]);
83
+ }, [onUpload, updateState]);
93
84
  const { getRootProps, getInputProps, isDragActive, open, inputRef, isDragAccept } = useDropzone({
94
85
  onDrop,
95
86
  noClick: true,
@@ -97,7 +88,7 @@ exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone
97
88
  noDragEventsBubbling: true,
98
89
  disabled,
99
90
  accept,
100
- maxFiles
91
+ maxFiles,
101
92
  });
102
93
  const doOpen = (0, misc_1.useEvent)(() => {
103
94
  open();
@@ -139,5 +130,5 @@ exports.FileUploadDropZone = (0, react_1.forwardRef)(function FileUploadDropZone
139
130
  }, [doOpen, registerComponentApi, uid]);
140
131
  const _b = getRootProps(Object.assign(Object.assign({}, rest), { style, className: (0, classnames_1.default)(FileUploadDropZone_module_scss_1.default.wrapper, className), onPaste: handleOnPaste })), { ref } = _b, rootProps = __rest(_b, ["ref"]);
141
132
  const rootRef = (0, component_utils_1.getComposedRef)(ref, forwardedRef);
142
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rootProps, { "data-drop-enabled": !disabled, ref: rootRef, children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, getInputProps())), children, (isDragActive && isDragAccept) && ((0, jsx_runtime_1.jsxs)("div", { className: FileUploadDropZone_module_scss_1.default.dropPlaceholder, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "upload" }), text] }))] })));
133
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rootProps, { "data-drop-enabled": !disabled, ref: rootRef, children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, getInputProps())), children, isDragActive && isDragAccept && ((0, jsx_runtime_1.jsxs)("div", { className: FileUploadDropZone_module_scss_1.default.dropPlaceholder, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "upload" }), text] }))] })));
143
134
  });