@lion/ui 0.7.9 → 0.8.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 (73) hide show
  1. package/components/accordion/src/LionAccordion.js +1 -1
  2. package/components/accordion/test/lion-accordion.test.js +9 -4
  3. package/components/calendar/src/LionCalendar.js +3 -1
  4. package/components/combobox/test/lion-combobox.test.js +124 -120
  5. package/components/combobox/test/validators.test.js +2 -2
  6. package/components/combobox/test-helpers/combobox-helpers.js +8 -9
  7. package/components/core/src/browserDetection.js +9 -1
  8. package/components/form-core/test-suites/NativeTextFieldMixin.suite.js +9 -10
  9. package/custom-elements.json +684 -2497
  10. package/dist-types/components/accordion/test/lion-accordion.test.d.ts.map +1 -1
  11. package/dist-types/components/calendar/src/LionCalendar.d.ts +0 -1
  12. package/dist-types/components/calendar/src/LionCalendar.d.ts.map +1 -1
  13. package/dist-types/components/combobox/test-helpers/combobox-helpers.d.ts +2 -2
  14. package/dist-types/components/combobox/test-helpers/combobox-helpers.d.ts.map +1 -1
  15. package/dist-types/components/form-core/test-suites/NativeTextFieldMixin.suite.d.ts.map +1 -1
  16. package/dist-types/components/icon/src/LionIcon.d.ts +2 -2
  17. package/dist-types/components/icon/src/LionIcon.d.ts.map +1 -1
  18. package/dist-types/tsconfig.tsbuildinfo +1 -1
  19. package/docs/components/checkbox-group/overview.md +2 -2
  20. package/docs/components/collapsible/overview.md +1 -1
  21. package/docs/components/combobox/overview.md +1 -1
  22. package/docs/components/combobox/use-cases.md +3 -4
  23. package/docs/components/dialog/overview.md +1 -1
  24. package/docs/components/fieldset/overview.md +5 -5
  25. package/docs/components/form/overview.md +3 -3
  26. package/docs/components/icon/use-cases.md +1 -1
  27. package/docs/components/input/overview.md +1 -1
  28. package/docs/components/input-amount/overview.md +3 -3
  29. package/docs/components/input-date/overview.md +3 -3
  30. package/docs/components/input-date/use-cases.md +2 -3
  31. package/docs/components/input-datepicker/overview.md +5 -5
  32. package/docs/components/input-datepicker/use-cases.md +2 -3
  33. package/docs/components/input-email/overview.md +2 -2
  34. package/docs/components/input-file/overview.md +1 -1
  35. package/docs/components/input-iban/overview.md +2 -2
  36. package/docs/components/input-range/overview.md +2 -2
  37. package/docs/components/input-stepper/overview.md +1 -1
  38. package/docs/components/input-tel/overview.md +1 -1
  39. package/docs/components/input-tel/use-cases.md +6 -6
  40. package/docs/components/input-tel-dropdown/overview.md +1 -1
  41. package/docs/components/listbox/use-cases.md +1 -1
  42. package/docs/components/radio-group/overview.md +3 -3
  43. package/docs/components/select/use-cases.md +1 -1
  44. package/docs/components/select-rich/use-cases.md +1 -1
  45. package/docs/components/tabs/examples.md +1 -1
  46. package/docs/fundamentals/index.md +4 -4
  47. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  48. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  49. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  50. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  51. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  52. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  53. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  54. package/docs/fundamentals/rationales/accessibility.md +1 -1
  55. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  56. package/docs/fundamentals/systems/core/overview.md +1 -1
  57. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  58. package/docs/fundamentals/systems/form/model-value.md +1 -1
  59. package/docs/fundamentals/systems/form/overview.md +28 -28
  60. package/docs/fundamentals/systems/form/validate.md +2 -2
  61. package/docs/fundamentals/systems/localize/overview.md +4 -4
  62. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  63. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  64. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  65. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  66. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  67. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  68. package/docs/guides/how-to/create-a-form.md +4 -4
  69. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  70. package/docs/guides/index.md +8 -8
  71. package/docs/guides/principles/index.md +5 -5
  72. package/docs/guides/principles/styling.md +1 -1
  73. package/package.json +1 -1
@@ -25,13 +25,13 @@ describe('MatchesOption validation', () => {
25
25
  config.node = el;
26
26
  const validator = new MatchesOption();
27
27
 
28
- mimicUserTyping(el, 'Artichoke');
28
+ await mimicUserTyping(el, 'Artichoke');
29
29
  await el.updateComplete;
30
30
 
31
31
  isEnabled = validator.execute('Artichoke', undefined, config);
32
32
  expect(isEnabled).to.be.false;
33
33
 
34
- mimicUserTyping(el, 'Foo');
34
+ await mimicUserTyping(el, 'Foo');
35
35
  await el.updateComplete;
36
36
 
37
37
  isEnabled = validator.execute('Foo', undefined, config);
@@ -1,4 +1,5 @@
1
1
  import { getListboxMembers } from '@lion/ui/listbox-test-helpers.js';
2
+ import { sendKeys } from '@web/test-runner-commands';
2
3
 
3
4
  /**
4
5
  * @typedef {import('@lion/ui/combobox.js').LionCombobox} LionCombobox
@@ -34,17 +35,15 @@ export function getComboboxMembers(el) {
34
35
 
35
36
  /**
36
37
  * @param {LionCombobox} el
37
- * @param {string} value
38
+ * @param {string} keys
38
39
  */
39
- // TODO: add keys that actually make sense...
40
- export function mimicUserTyping(el, value) {
40
+ export async function mimicUserTyping(el, keys) {
41
41
  const { _inputNode } = getComboboxMembers(el);
42
- _inputNode.dispatchEvent(new Event('focusin', { bubbles: true }));
43
- // eslint-disable-next-line no-param-reassign
44
- _inputNode.value = value;
45
- _inputNode.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
46
- _inputNode.dispatchEvent(new KeyboardEvent('keyup', { key: value }));
47
- _inputNode.dispatchEvent(new KeyboardEvent('keydown', { key: value }));
42
+ _inputNode.value = '';
43
+ _inputNode.focus();
44
+ await sendKeys({
45
+ type: keys,
46
+ });
48
47
  }
49
48
 
50
49
  /**
@@ -9,11 +9,19 @@ function checkChrome(flavor = 'google-chrome') {
9
9
  return flavor === 'google-chrome';
10
10
  }
11
11
 
12
- const isChromium = /** @type {window & { chrome?: boolean}} */ (globalThis).chrome;
12
+ // eslint-disable-next-line prefer-destructuring
13
+ const navigator = /** @type {Navigator & {userAgentData: {brands:{brand:string}[]}}} */ (
14
+ globalThis.navigator
15
+ );
16
+
17
+ const isChromium =
18
+ !!navigator.userAgentData &&
19
+ navigator.userAgentData.brands.some(data => data.brand === 'Chromium');
13
20
 
14
21
  if (flavor === 'chromium') {
15
22
  return isChromium;
16
23
  }
24
+
17
25
  const winNav = globalThis.navigator;
18
26
  const vendorName = winNav?.vendor;
19
27
  const isOpera =
@@ -4,11 +4,7 @@ import { defineCE, expect, fixture, html, triggerFocusFor, unsafeStatic } from '
4
4
  import { sendKeys } from '@web/test-runner-commands';
5
5
  import { spy } from 'sinon';
6
6
  import { NativeTextFieldMixin } from '@lion/ui/form-core.js';
7
-
8
- const isSafari = (() => {
9
- const ua = navigator.userAgent.toLowerCase();
10
- return ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1;
11
- })();
7
+ import { browserDetection } from '@lion/ui/core.js';
12
8
 
13
9
  /**
14
10
  * @typedef {import('../types/FormControlMixinTypes.js').FormControlHost} FormControlHost
@@ -54,10 +50,6 @@ export function runNativeTextFieldMixinSuite(customConfig) {
54
50
  });
55
51
 
56
52
  it('move focus to a next focusable element after writing some text', async () => {
57
- if (isSafari) {
58
- // TODO: This test is broken on Safari, to be fixed later
59
- return;
60
- }
61
53
  const el = /** @type {NativeTextFieldClass} */ (await fixture(html`<${tag}></${tag}>`));
62
54
  // @ts-ignore [allow-protected] in test
63
55
  const setValueAndPreserveCaretSpy = spy(el, '_setValueAndPreserveCaret');
@@ -71,8 +63,15 @@ export function runNativeTextFieldMixinSuite(customConfig) {
71
63
  await sendKeys({
72
64
  press: 'Tab',
73
65
  });
74
- expect(document.activeElement).to.not.equal(_inputNode);
66
+
75
67
  expect(setValueAndPreserveCaretSpy.calledOnce).to.be.false;
68
+
69
+ // TODO: This seems to work in practice, but not in the test. Investigate.
70
+ if (browserDetection.isMacSafari || browserDetection.isFirefox) {
71
+ return;
72
+ }
73
+
74
+ expect(document.activeElement).to.not.equal(_inputNode);
76
75
  });
77
76
  });
78
77
  }