@lion/ui 0.0.8 → 0.0.10

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 (147) hide show
  1. package/components/core/src/SlotMixin.js +2 -1
  2. package/components/dialog/test/lion-dialog.test.js +3 -7
  3. package/components/form-integrations/test/form-group-methods.test.js +6 -4
  4. package/components/form-integrations/test/form-integrations.test.js +10 -5
  5. package/components/form-integrations/test/helpers/umbrella-form.js +10 -0
  6. package/components/form-integrations/test/model-value-consistency.test.js +29 -20
  7. package/components/input-datepicker/src/LionInputDatepicker.js +64 -100
  8. package/components/input-datepicker/src/localizeNamespaceLoader.js +188 -0
  9. package/components/input-datepicker/test/lion-input-datepicker.test.js +15 -20
  10. package/components/input-datepicker/test-helpers/DatepickerInputObject.js +3 -3
  11. package/components/input-tel/src/parsers.js +1 -1
  12. package/components/listbox/test-suites/ListboxMixin.suite.js +3 -3
  13. package/components/localize/test/number/formatNumber.test.js +2 -6
  14. package/components/overlays/src/OverlayController.js +236 -289
  15. package/components/overlays/src/OverlayMixin.js +17 -18
  16. package/components/overlays/src/OverlaysManager.js +28 -53
  17. package/components/overlays/src/overlayDocumentStyle.js +24 -0
  18. package/components/overlays/src/overlayShadowDomStyle.js +138 -0
  19. package/components/overlays/src/singleton.js +3 -1
  20. package/components/overlays/test/ArrowMixin.test.js +0 -1
  21. package/components/overlays/test/OverlayController.test.js +306 -273
  22. package/components/overlays/test/OverlaysManager.test.js +23 -32
  23. package/components/overlays/test/global-positioning.test.js +4 -15
  24. package/components/overlays/test/local-positioning.test.js +65 -38
  25. package/components/overlays/test-suites/OverlayMixin.suite.js +18 -26
  26. package/components/overlays/types/OverlayConfig.ts +32 -11
  27. package/components/overlays/types/OverlayMixinTypes.ts +2 -2
  28. package/components/select-rich/src/LionSelectInvoker.js +2 -3
  29. package/components/select-rich/src/LionSelectRich.js +22 -20
  30. package/components/select-rich/test/lion-select-rich.test.js +5 -7
  31. package/components/validate-messages/src/loadDefaultFeedbackMessages.js +2 -181
  32. package/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.js +194 -0
  33. package/components/validate-messages/test/loadDefaultFeedbackMessages.test.js +1 -18
  34. package/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.js +49 -0
  35. package/custom-elements.json +370 -362
  36. package/dist-types/components/core/src/SlotMixin.d.ts.map +1 -1
  37. package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts +4 -0
  38. package/dist-types/components/form-integrations/test/helpers/umbrella-form.d.ts.map +1 -1
  39. package/dist-types/components/form-integrations/test/model-value-consistency.test.d.ts.map +1 -1
  40. package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts +3 -3
  41. package/dist-types/components/input-datepicker/src/LionInputDatepicker.d.ts.map +1 -1
  42. package/dist-types/components/input-datepicker/src/localizeNamespaceLoader.d.ts +4 -0
  43. package/dist-types/components/input-datepicker/src/localizeNamespaceLoader.d.ts.map +1 -0
  44. package/dist-types/components/overlays/src/OverlayController.d.ts +46 -101
  45. package/dist-types/components/overlays/src/OverlayController.d.ts.map +1 -1
  46. package/dist-types/components/overlays/src/OverlayMixin.d.ts.map +1 -1
  47. package/dist-types/components/overlays/src/OverlaysManager.d.ts +0 -7
  48. package/dist-types/components/overlays/src/OverlaysManager.d.ts.map +1 -1
  49. package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts +2 -0
  50. package/dist-types/components/overlays/src/overlayDocumentStyle.d.ts.map +1 -0
  51. package/dist-types/components/overlays/src/overlayShadowDomStyle.d.ts +2 -0
  52. package/dist-types/components/overlays/src/overlayShadowDomStyle.d.ts.map +1 -0
  53. package/dist-types/components/overlays/src/singleton.d.ts +2 -1
  54. package/dist-types/components/overlays/src/singleton.d.ts.map +1 -1
  55. package/dist-types/components/overlays/test-suites/OverlayMixin.suite.d.ts.map +1 -1
  56. package/dist-types/components/overlays/types/OverlayConfig.d.ts +14 -10
  57. package/dist-types/components/overlays/types/OverlayConfig.d.ts.map +1 -1
  58. package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts +2 -2
  59. package/dist-types/components/overlays/types/OverlayMixinTypes.d.ts.map +1 -1
  60. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts +3 -27
  61. package/dist-types/components/select-rich/src/LionSelectInvoker.d.ts.map +1 -1
  62. package/dist-types/components/select-rich/src/LionSelectRich.d.ts.map +1 -1
  63. package/dist-types/components/select-rich/test/lion-select-rich.test.d.ts.map +1 -1
  64. package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessages.d.ts +3 -0
  65. package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessages.d.ts.map +1 -1
  66. package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.d.ts +10 -0
  67. package/dist-types/components/validate-messages/src/loadDefaultFeedbackMessagesNoSideEffects.d.ts.map +1 -0
  68. package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessages.test.d.ts.map +1 -1
  69. package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts +2 -0
  70. package/dist-types/components/validate-messages/test/loadDefaultFeedbackMessagesNoSideEffects.d.ts.map +1 -0
  71. package/dist-types/exports/input-datepicker.d.ts +0 -1
  72. package/dist-types/exports/overlays.d.ts +0 -1
  73. package/dist-types/exports/types/overlays.d.ts +1 -0
  74. package/dist-types/exports/types/overlays.d.ts.map +1 -1
  75. package/dist-types/exports/validate-messages-no-side-effects.d.ts +2 -0
  76. package/dist-types/exports/validate-messages-no-side-effects.d.ts.map +1 -0
  77. package/dist-types/tsconfig.tsbuildinfo +1 -1
  78. package/docs/components/checkbox-group/overview.md +2 -2
  79. package/docs/components/collapsible/overview.md +1 -1
  80. package/docs/components/combobox/overview.md +1 -1
  81. package/docs/components/combobox/use-cases.md +1 -1
  82. package/docs/components/dialog/overview.md +5 -9
  83. package/docs/components/dialog/use-cases.md +43 -87
  84. package/docs/components/fieldset/overview.md +5 -5
  85. package/docs/components/form/overview.md +3 -3
  86. package/docs/components/icon/use-cases.md +1 -1
  87. package/docs/components/input/overview.md +1 -1
  88. package/docs/components/input-amount/overview.md +3 -3
  89. package/docs/components/input-date/overview.md +3 -3
  90. package/docs/components/input-datepicker/overview.md +5 -5
  91. package/docs/components/input-email/overview.md +2 -2
  92. package/docs/components/input-iban/overview.md +2 -2
  93. package/docs/components/input-range/overview.md +2 -2
  94. package/docs/components/input-stepper/overview.md +1 -1
  95. package/docs/components/input-tel/overview.md +1 -1
  96. package/docs/components/input-tel/use-cases.md +6 -6
  97. package/docs/components/input-tel-dropdown/overview.md +1 -1
  98. package/docs/components/radio-group/overview.md +3 -3
  99. package/docs/components/select-rich/use-cases.md +1 -1
  100. package/docs/components/tabs/examples.md +1 -1
  101. package/docs/fundamentals/index.md +4 -4
  102. package/docs/fundamentals/node-tools/providence-analytics/LocalConfiguration.md +1 -1
  103. package/docs/fundamentals/node-tools/providence-analytics/QueryResult.md +1 -1
  104. package/docs/fundamentals/node-tools/providence-analytics/analyzer.md +1 -1
  105. package/docs/fundamentals/node-tools/providence-analytics/dashboard.md +1 -1
  106. package/docs/fundamentals/node-tools/providence-analytics/overview.md +3 -3
  107. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  108. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  109. package/docs/fundamentals/systems/core/overview.md +1 -1
  110. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  111. package/docs/fundamentals/systems/form/model-value.md +1 -1
  112. package/docs/fundamentals/systems/form/overview.md +28 -28
  113. package/docs/fundamentals/systems/form/use-cases.md +4 -0
  114. package/docs/fundamentals/systems/form/validate.md +1 -1
  115. package/docs/fundamentals/systems/localize/overview.md +4 -4
  116. package/docs/fundamentals/systems/overlays/assets/{applyDemoOverlayStyles.js → applyDemoOverlayStyles.mjs} +2 -1
  117. package/docs/fundamentals/systems/overlays/assets/demo-el-using-overlaymixin.mjs +119 -0
  118. package/docs/fundamentals/systems/overlays/assets/{demo-overlay-backdrop.js → demo-overlay-backdrop.mjs} +3 -4
  119. package/docs/fundamentals/systems/overlays/assets/demo-overlay-positioning.mjs +537 -0
  120. package/docs/fundamentals/systems/overlays/assets/umbrella-form.js +9 -2
  121. package/docs/fundamentals/systems/overlays/configuration.md +56 -54
  122. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  123. package/docs/fundamentals/systems/overlays/use-cases.md +83 -77
  124. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  125. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  126. package/docs/guides/how-to/create-a-custom-field.md +6 -6
  127. package/docs/guides/how-to/extend-a-native-input.md +3 -3
  128. package/docs/guides/index.md +8 -8
  129. package/docs/guides/principles/index.md +5 -5
  130. package/docs/guides/principles/styling.md +1 -1
  131. package/exports/input-datepicker.js +0 -1
  132. package/exports/overlays.js +0 -1
  133. package/exports/types/overlays.ts +1 -0
  134. package/exports/validate-messages-no-side-effects.js +1 -0
  135. package/package.json +2 -1
  136. package/components/input-datepicker/src/LionCalendarOverlayFrame.js +0 -125
  137. package/components/overlays/src/globalOverlaysStyle.js +0 -139
  138. package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts +0 -10
  139. package/dist-types/components/input-datepicker/src/LionCalendarOverlayFrame.d.ts.map +0 -1
  140. package/dist-types/components/overlays/src/globalOverlaysStyle.d.ts +0 -2
  141. package/dist-types/components/overlays/src/globalOverlaysStyle.d.ts.map +0 -1
  142. package/dist-types/exports/define/lion-calendar-overlay-frame.d.ts +0 -2
  143. package/dist-types/exports/define/lion-calendar-overlay-frame.d.ts.map +0 -1
  144. package/docs/fundamentals/systems/overlays/assets/demo-overlay-system.js +0 -42
  145. package/docs/fundamentals/systems/overlays/form-integration.md +0 -65
  146. package/docs/fundamentals/systems/overlays/scope.md +0 -176
  147. package/exports/define/lion-calendar-overlay-frame.js +0 -3
@@ -1,125 +0,0 @@
1
- import { css, html, LitElement } from 'lit';
2
- import { LocalizeMixin } from '@lion/ui/localize.js';
3
-
4
- export class LionCalendarOverlayFrame extends LocalizeMixin(LitElement) {
5
- static get styles() {
6
- return [
7
- css`
8
- :host {
9
- display: inline-block;
10
- background: white;
11
- position: relative;
12
- }
13
-
14
- :host([hidden]) {
15
- display: none;
16
- }
17
-
18
- .calendar-overlay__header {
19
- display: flex;
20
- }
21
-
22
- .calendar-overlay__heading {
23
- padding: 16px 16px 8px;
24
- flex: 1;
25
- }
26
-
27
- .calendar-overlay__heading > .calendar-overlay__close-button {
28
- flex: none;
29
- }
30
-
31
- .calendar-overlay__close-button {
32
- min-width: 40px;
33
- min-height: 32px;
34
- border-width: 0;
35
- padding: 0;
36
- font-size: 24px;
37
- }
38
- `,
39
- ];
40
- }
41
-
42
- static get localizeNamespaces() {
43
- return [
44
- {
45
- 'lion-calendar-overlay-frame': /** @param {string} locale */ locale => {
46
- switch (locale) {
47
- case 'bg-BG':
48
- return import('@lion/ui/overlays-translations/bg-BG.js');
49
- case 'cs-CZ':
50
- return import('@lion/ui/overlays-translations/cs-CZ.js');
51
- case 'de-DE':
52
- return import('@lion/ui/overlays-translations/de-DE.js');
53
- case 'en-AU':
54
- return import('@lion/ui/overlays-translations/en-AU.js');
55
- case 'en-GB':
56
- return import('@lion/ui/overlays-translations/en-GB.js');
57
- case 'en-US':
58
- return import('@lion/ui/overlays-translations/en-US.js');
59
- case 'en-PH':
60
- return import('@lion/ui/overlays-translations/en.js');
61
- case 'es-ES':
62
- return import('@lion/ui/overlays-translations/es-ES.js');
63
- case 'fr-FR':
64
- return import('@lion/ui/overlays-translations/fr-FR.js');
65
- case 'fr-BE':
66
- return import('@lion/ui/overlays-translations/fr-BE.js');
67
- case 'hu-HU':
68
- return import('@lion/ui/overlays-translations/hu-HU.js');
69
- case 'it-IT':
70
- return import('@lion/ui/overlays-translations/it-IT.js');
71
- case 'nl-BE':
72
- return import('@lion/ui/overlays-translations/nl-BE.js');
73
- case 'nl-NL':
74
- return import('@lion/ui/overlays-translations/nl-NL.js');
75
- case 'pl-PL':
76
- return import('@lion/ui/overlays-translations/pl-PL.js');
77
- case 'ro-RO':
78
- return import('@lion/ui/overlays-translations/ro-RO.js');
79
- case 'ru-RU':
80
- return import('@lion/ui/overlays-translations/ru-RU.js');
81
- case 'sk-SK':
82
- return import('@lion/ui/overlays-translations/sk-SK.js');
83
- case 'uk-UA':
84
- return import('@lion/ui/overlays-translations/uk-UA.js');
85
- case 'zh-CN':
86
- return import('@lion/ui/overlays-translations/zh.js');
87
- default:
88
- return import('@lion/ui/overlays-translations/en.js');
89
- }
90
- },
91
- },
92
- ...super.localizeNamespaces,
93
- ];
94
- }
95
-
96
- /** @private */
97
- __dispatchCloseEvent() {
98
- this.dispatchEvent(new Event('close-overlay'));
99
- }
100
-
101
- render() {
102
- // eslint-disable-line class-methods-use-this
103
- return html`
104
- <div class="calendar-overlay">
105
- <div class="calendar-overlay__header">
106
- <h1 class="calendar-overlay__heading">
107
- <slot name="heading"></slot>
108
- </h1>
109
- <button
110
- @click="${this.__dispatchCloseEvent}"
111
- id="close-button"
112
- title="${this.msgLit('lion-calendar-overlay-frame:close')}"
113
- aria-label="${this.msgLit('lion-calendar-overlay-frame:close')}"
114
- class="calendar-overlay__close-button"
115
- >
116
- <slot name="close-icon">&times;</slot>
117
- </button>
118
- </div>
119
- <div id="overlay-content-node-wrapper">
120
- <slot name="content"></slot>
121
- </div>
122
- </div>
123
- `;
124
- }
125
- }
@@ -1,139 +0,0 @@
1
- import { css } from 'lit';
2
-
3
- export const globalOverlaysStyle = css`
4
- .global-overlays {
5
- position: fixed;
6
- z-index: 200;
7
- }
8
-
9
- .global-overlays__overlay {
10
- pointer-events: auto;
11
- }
12
-
13
- .global-overlays__overlay-container {
14
- display: flex;
15
- position: fixed;
16
- top: 0;
17
- left: 0;
18
- width: 100%;
19
- height: 100%;
20
- pointer-events: none;
21
- }
22
-
23
- .global-overlays__overlay-container--top-left {
24
- justify-content: flex-start;
25
- align-items: flex-start;
26
- }
27
-
28
- .global-overlays__overlay-container--top {
29
- justify-content: center;
30
- align-items: flex-start;
31
- }
32
-
33
- .global-overlays__overlay-container--top-right {
34
- justify-content: flex-end;
35
- align-items: flex-start;
36
- }
37
-
38
- .global-overlays__overlay-container--right {
39
- justify-content: flex-end;
40
- align-items: center;
41
- }
42
-
43
- .global-overlays__overlay-container--bottom-left {
44
- justify-content: flex-start;
45
- align-items: flex-end;
46
- }
47
-
48
- .global-overlays__overlay-container--bottom {
49
- justify-content: center;
50
- align-items: flex-end;
51
- }
52
-
53
- .global-overlays__overlay-container--bottom-right {
54
- justify-content: flex-end;
55
- align-items: flex-end;
56
- }
57
- .global-overlays__overlay-container--left {
58
- justify-content: flex-start;
59
- align-items: center;
60
- }
61
-
62
- .global-overlays__overlay-container--center {
63
- justify-content: center;
64
- align-items: center;
65
- }
66
-
67
- .global-overlays__overlay--bottom-sheet {
68
- width: 100%;
69
- }
70
-
71
- .global-overlays .global-overlays__backdrop {
72
- content: '';
73
- position: fixed;
74
- top: 0;
75
- left: 0;
76
- width: 100%;
77
- height: 100%;
78
- z-index: -1;
79
- background-color: #333333;
80
- filter: opacity(30%);
81
- display: none;
82
- }
83
-
84
- .global-overlays .global-overlays__backdrop--visible {
85
- display: block;
86
- }
87
-
88
- .global-overlays .global-overlays__backdrop--animation-in {
89
- animation: global-overlays-backdrop-fade-in 300ms;
90
- }
91
-
92
- .global-overlays .global-overlays__backdrop--animation-out {
93
- animation: global-overlays-backdrop-fade-out 300ms;
94
- opacity: 0;
95
- }
96
-
97
- @keyframes global-overlays-backdrop-fade-in {
98
- from {
99
- opacity: 0;
100
- }
101
- }
102
-
103
- @keyframes global-overlays-backdrop-fade-out {
104
- from {
105
- opacity: 0.3;
106
- }
107
- }
108
-
109
- body > *[inert] {
110
- -webkit-user-select: none;
111
- -moz-user-select: none;
112
- -ms-user-select: none;
113
- user-select: none;
114
- pointer-events: none;
115
- }
116
-
117
- body.global-overlays-scroll-lock {
118
- overflow: hidden;
119
- }
120
-
121
- body.global-overlays-scroll-lock-ios-fix {
122
- position: fixed;
123
- width: 100%;
124
- }
125
-
126
- html.global-overlays-scroll-lock-ios-fix {
127
- height: 100vh;
128
- }
129
-
130
- @media screen and (prefers-reduced-motion: reduce) {
131
- .global-overlays .global-overlays__backdrop--animation-in {
132
- animation: global-overlays-backdrop-fade-in 1ms;
133
- }
134
-
135
- .global-overlays .global-overlays__backdrop--animation-out {
136
- animation: global-overlays-backdrop-fade-out 1ms;
137
- }
138
- }
139
- `;
@@ -1,10 +0,0 @@
1
- declare const LionCalendarOverlayFrame_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("../../localize/types/LocalizeMixinTypes.js").LocalizeMixinHost> & Pick<typeof import("../../localize/types/LocalizeMixinTypes.js").LocalizeMixinHost, "prototype" | "localizeNamespaces" | "waitForLocalizeNamespaces"> & Pick<typeof LitElement, "prototype" | "_$litElement$" | "enabledWarnings" | "enableWarning" | "disableWarning" | "addInitializer" | "_initializers" | "elementProperties" | "properties" | "elementStyles" | "styles" | "observedAttributes" | "createProperty" | "getPropertyOptions" | "shadowRootOptions">;
2
- export class LionCalendarOverlayFrame extends LionCalendarOverlayFrame_base {
3
- static get styles(): import("lit").CSSResult[];
4
- /** @private */
5
- private __dispatchCloseEvent;
6
- render(): import("lit-html").TemplateResult<1>;
7
- }
8
- import { LitElement } from "lit";
9
- export {};
10
- //# sourceMappingURL=LionCalendarOverlayFrame.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LionCalendarOverlayFrame.d.ts","sourceRoot":"","sources":["../../../../components/input-datepicker/src/LionCalendarOverlayFrame.js"],"names":[],"mappings":";AAGA;IACE,+CAmCC;IAwDD,eAAe;IACf,6BAEC;IAED,+CAuBC;CACF"}
@@ -1,2 +0,0 @@
1
- export const globalOverlaysStyle: import("lit").CSSResult;
2
- //# sourceMappingURL=globalOverlaysStyle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globalOverlaysStyle.d.ts","sourceRoot":"","sources":["../../../../components/overlays/src/globalOverlaysStyle.js"],"names":[],"mappings":"AAEA,0DAwIE"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=lion-calendar-overlay-frame.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lion-calendar-overlay-frame.d.ts","sourceRoot":"","sources":["../../../exports/define/lion-calendar-overlay-frame.js"],"names":[],"mappings":""}
@@ -1,42 +0,0 @@
1
- import { html, LitElement } from 'lit';
2
- import { OverlayMixin } from '@lion/ui/overlays.js';
3
-
4
- /**
5
- * @typedef {import('../types/OverlayConfig').OverlayConfig} OverlayConfig
6
- */
7
- class DemoOverlaySystem extends OverlayMixin(LitElement) {
8
- // eslint-disable-next-line class-methods-use-this
9
- _defineOverlayConfig() {
10
- return /** @type {OverlayConfig} */ ({
11
- placementMode: 'global',
12
- });
13
- }
14
-
15
- _setupOpenCloseListeners() {
16
- super._setupOpenCloseListeners();
17
-
18
- if (this._overlayInvokerNode) {
19
- this._overlayInvokerNode.addEventListener('click', this.toggle);
20
- }
21
- }
22
-
23
- _teardownOpenCloseListeners() {
24
- super._teardownOpenCloseListeners();
25
-
26
- if (this._overlayInvokerNode) {
27
- this._overlayInvokerNode.removeEventListener('click', this.toggle);
28
- }
29
- }
30
-
31
- render() {
32
- return html`
33
- <slot name="invoker"></slot>
34
- <slot name="backdrop"></slot>
35
- <div id="overlay-content-node-wrapper">
36
- <slot name="content"></slot>
37
- </div>
38
- <div>popup is ${this.opened ? 'opened' : 'closed'}</div>
39
- `;
40
- }
41
- }
42
- customElements.define('demo-overlay-system', DemoOverlaySystem);
@@ -1,65 +0,0 @@
1
- # Systems >> Overlays >> Form Integrations ||60
2
-
3
- ```js script
4
- import { html } from '@mdjs/mdjs-preview';
5
- import '@lion/ui/define/lion-input-datepicker.js';
6
- import '@lion/ui/define/lion-listbox.js';
7
- import '@lion/ui/define/lion-listbox.js';
8
- import '@lion/ui/define/lion-select-rich.js';
9
- import './assets/demo-overlay-system.js';
10
- import './assets/applyDemoOverlayStyles.js';
11
- ```
12
-
13
- ## Select Rich
14
-
15
- Opening a Rich Select inside a dialog.
16
-
17
- ```js preview-story
18
- export const selectRich = () => html`
19
- <demo-overlay-system>
20
- <button slot="invoker">Open Dialog</button>
21
- <div slot="content" class="demo-overlay">
22
- <h1>Select Rick example</h1>
23
- <lion-select-rich name="favoriteColor" label="Favorite color">
24
- <lion-option .choiceValue=${'red'}>Red</lion-option>
25
- <lion-option .choiceValue=${'hotpink'} checked>Hotpink</lion-option>
26
- <lion-option .choiceValue=${'teal'}>Teal</lion-option>
27
- </lion-select-rich>
28
- <p>
29
- You can close this dialog here:
30
- <button
31
- class="close-button"
32
- @click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
33
- >
34
- ⨯
35
- </button>
36
- </p>
37
- </div>
38
- </demo-overlay-system>
39
- `;
40
- ```
41
-
42
- ## Input Datepicker
43
-
44
- Opening an Input Datepicker inside a dialog.
45
-
46
- ```js preview-story
47
- export const inputDatepicker = () => html`
48
- <demo-overlay-system>
49
- <button slot="invoker">Open Dialog</button>
50
- <div slot="content" class="demo-overlay">
51
- <h1>Input Datepicker example</h1>
52
- <lion-input-datepicker name="date" label="Date"></lion-input-datepicker>
53
- <p>
54
- You can close this dialog here:
55
- <button
56
- class="close-button"
57
- @click=${e => e.target.dispatchEvent(new Event('close-overlay', { bubbles: true }))}
58
- >
59
- ⨯
60
- </button>
61
- </p>
62
- </div>
63
- </demo-overlay-system>
64
- `;
65
- ```
@@ -1,176 +0,0 @@
1
- # Systems >> Overlays >> Scope ||50
2
-
3
- The goal of this document is to specify the goal and duties of the overlay system, mainly by
4
- identifying all different appearances and types of overlays.
5
-
6
- ## What is an overlay manager?
7
-
8
- An overlay is a visual element that is painted on top of a page, breaking out of the regular
9
- document flow. An overlay manager is a global repository keeping track of all different types of overlays. The need for a global housekeeping mainly arises when multiple overlays are opened simultaneously. As opposed to a single overlay, the overlay manager stores knowledge about:
10
-
11
- - Whether the scroll behaviour of the body element can be manipulated.
12
- - What space is available in the window for drawing new overlays.
13
-
14
- The manager is in charge of rendering an overlay to the DOM. Therefore, a developer should be able to control:
15
-
16
- - Its ‘physical position’ (where the dialog is attached). This can either be:
17
- - globally: at root level of the DOM. This guarantees a total control over its painting, since the stacking context can be controlled from here and interfering parents (that set overflow values or transforms) can’t be apparent. Additionally, making a modal dialog requiring all surroundings to have aria-hidden="true", will be easier when the overlay is attached on body level.
18
- - locally: next to the invoking element. This gives advantages for accessibility and(performant) rendering of an overlay next to its invoker on scroll and window resizes
19
- - Toggling of the ‘shown’ state of the overlay
20
- - Positioning preferences(for instance ‘bottom-left’) and strategies (ordered fallback preferences)
21
-
22
- Presentation/styling of the overlay is out of the scope of the manager, except for its positioning in its context.
23
-
24
- Accessibility is usually dependent on the type of overlay, its specific implementation and its browser/screen reader support (aria 1.0 vs 1.1). We strive for an optimum here by supporting 1.0 as a bare minimum and add 1.1 enrichments on top.
25
-
26
- For every overlay, the manager has access to the overlay element and the invoker (and possible other elements that are needed for focus delegation as described in <https://www.w3.org/TR/wai-aria-practices/#dialog_modal> (notes).
27
-
28
- ## Defining different types of overlays
29
-
30
- When browsing through the average ui library, one can encounter multiple names for occurrences of overlays. Here is a list of names encountered throughout the years:
31
-
32
- - dialog
33
- - modal
34
- - popover
35
- - popup
36
- - popdown
37
- - popper
38
- - bubble
39
- - balloon
40
- - dropdown
41
- - dropup
42
- - tooltip
43
- - layover
44
- - overlay
45
- - toast
46
- - snackbar
47
- - sheet (bottom, top, left, right)
48
- - etc..
49
-
50
- The problem with most of those terms is their lack of clear definition: what might be considered a tooltip in UI framework A, can be considered a popover in framework B. What can be called a modal in framework C, might actually be just a dialog. Etc etc…
51
-
52
- ### Official specifications
53
-
54
- In order to avoid confusion and be as specification compliant as possible, it’s always a good idea to consult the W3C. This website shows a full list with specifications of accessible web widgets: <https://www.w3.org/TR/wai-aria-practices/>.
55
- A great overview of all widget-, structure- and role relations can be found in the ontology diagram below:
56
-
57
- <https://www.w3.org/WAI/PF/aria-1.1/rdf_model.svg>
58
-
59
- Out of all the overlay names mentioned above, we can only identify the dialog and the tooltip as official roles. Let’s take a closer look at their definitions...
60
-
61
- ### Dialog
62
-
63
- The dialog is described as follows by the W3C:
64
-
65
- > “A dialog is a window overlaid on either the primary window or another dialog window. Windows
66
- > under a modal dialog are inert. That is, users cannot interact with content outside an active
67
- > dialog window. Inert content outside an active dialog is typically visually obscured or dimmed so
68
- > it is difficult to discern, and in some implementations, attempts to interact with the inert
69
- > content cause the dialog to close.
70
- > Like non-modal dialogs, modal dialogs contain their tab sequence. That is, Tab and Shift + Tab do
71
- > not move focus outside the dialog. However, unlike most non-modal dialogs, modal dialogs do not
72
- > provide means for moving keyboard focus outside the dialog window without closing the dialog.”
73
-
74
- - specification: <https://www.w3.org/TR/wai-aria-1.1/#dialog>
75
- - widget description: <https://www.w3.org/TR/wai-aria-practices/#dialog_modal>
76
-
77
- ### Tooltip
78
-
79
- According to W3C, a tooltip is described by the following:
80
-
81
- > “A tooltip is a popup that displays information related to an element when the element receives.
82
- > keyboard focus or the mouse hovers over it. It typically appears after a small delay and disappears.
83
- > when Escape is pressed or on mouse out.
84
- > Tooltip widgets do not receive focus. A hover that contains focusable elements can be made using.
85
- > a non-modal dialog.”
86
-
87
- - specification: <https://www.w3.org/TR/wai-aria-1.1/#tooltip>
88
- - widget description: <https://www.w3.org/TR/wai-aria-practices/#tooltip>
89
-
90
- What needs to be mentioned is that the W3C taskforce didn’t reach consensus yet about the above tooltip description. A good alternative resource:
91
- <https://inclusive-components.design/tooltips-toggletips/>
92
-
93
- ### Dialog vs tooltip
94
-
95
- Summarizing, the main differences between dialogs and tooltips are:
96
-
97
- - Dialogs have a modal option, tooltips don’t
98
- - Dialogs have interactive content, tooltips don’t
99
- - Dialogs are opened via regular buttons (click/space/enter), tooltips act on focus/mouseover
100
-
101
- ### Other roles and concepts
102
-
103
- Other roles worth mentioning are _alertdialog_ (a specific instance of the dialog for system alerts), select (an abstract role), _combobox_ and _menu_.
104
-
105
- Also, the W3C document often refers to _popup_. This term is mentioned in the context of _combobox_, _listbox_, _grid_, _tree_, _dialog_ and _tooltip_. Therefore, one could say it could be a term
106
-
107
- _aria-haspopup_ attribute needs to be mentioned: it can have values ‘menu’, ‘listbox’, ‘grid’, ’tree’ and ‘dialog’.
108
-
109
- ## Common Overlay Components
110
-
111
- In our component library, we want to have the following overlay ‘child’ components:
112
-
113
- - Dialog
114
- - Tooltip
115
- - Popover
116
- - Dropdown
117
- - Toast
118
- - Sheet (bottom, top, left, right)
119
- - Select
120
- - Combobox/autocomplete
121
- - Application menu
122
-
123
- ### Dialog Component
124
-
125
- The dialog is pretty much the dialog as described in the W3C spec, having the modal option applied by default. The flexibility in focus delegation (see <https://www.w3.org/TR/wai-aria-practices/#dialog_modal> notes) is not implemented, however.
126
- Addressing these:
127
-
128
- - The first focusable element in the content: although delegate this focus management to the
129
- implementing developer is highly preferred, since this is highly dependent on the moment the dialog content has finished rendering. This is something the overlay manager or dialog widget should not be aware of in order to provide.a clean and reliable component.
130
- - The focusable element after a close: by default, this is the invoker. For different
131
- behaviour, a reference should be supplied to a more logical element in the particular workflow.
132
-
133
- ### Tooltip Component
134
-
135
- The tooltip is always invoked on hover and has no interactive content. See <https://inclusive-components.design/tooltips-toggletips/> (the tooltip example, not the toggle tip).
136
-
137
- ### Popover Component
138
-
139
- The popover looks like a crossover between the dialog and the tooltip. Popovers are invoked on click. For non interactive content, the <https://inclusive-components.design/tooltips-toggletips/> toggletip could be applied. Whenever there would be a close button present, the ‘non interactiveness’ wouldn’t apply.
140
-
141
- An alternative implementation: <https://whatsock.com/tsg/Coding%20Arena/Popups/Popup%20(Internal%20Content)/demo.htm>
142
- This looks more like a small dialog, except that the page flow is respected (no rotating tab).
143
-
144
- ### Dropdown Component
145
-
146
- The dropdown is not an official aria-widget and thus can’t be tied to a specific role. It exists in a lot of UI libraries and most of them share these properties:
147
-
148
- - Preferred position is ‘down’.
149
- - When no space at bottom, they show ‘up’ (in which. Case it behaves a as a dropup).
150
- - Unlike popovers and tooltips, it will never be positioned horizontally.
151
-
152
- Aliases are ‘popdown’, ‘pulldown’ and many others.
153
-
154
- ### Select Component
155
-
156
- Implemented as a dropdown listbox with invoker button. Depending on the content of the options, the child list can either be of type listbox or grid.
157
- See: <https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html>
158
-
159
- ### Combobox Component
160
-
161
- Implemented as a dropdown combobox with invoker input. Input is used as search filter and can contain autocomplete or autosuggest functionality:
162
- See: <https://www.w3.org/TR/wai-aria-practices/#combobox>
163
-
164
- ### (Application) menu Component
165
-
166
- Or sometimes called context-menu. Uses a dropdown to position its content.
167
- See: <https://www.w3.org/WAI/tutorials/menus/flyout/>
168
- Be aware not to use role=“menu”: <https://www.w3.org/WAI/tutorials/menus/application-menus/>
169
-
170
- ### Toast Component
171
-
172
- See: <https://www.webcomponents.org/element/@polymer/paper-toast>. Should probably be implemented as an alertdialog.
173
-
174
- ### Sheet Component
175
-
176
- See: <https://material.io/design/components/sheets-bottom.html>. Should probably be a global(modal) dialog.
@@ -1,3 +0,0 @@
1
- import { LionCalendarOverlayFrame } from '../input-datepicker.js';
2
-
3
- customElements.define('lion-calendar-overlay-frame', LionCalendarOverlayFrame);