@nectary/components 5.33.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.d.ts +3 -0
- package/bundle.js +772 -176
- package/bundle.ts +3 -0
- package/floating-panel/global/index.d.ts +1 -0
- package/floating-panel/global/index.js +2 -0
- package/floating-panel/index.d.ts +41 -0
- package/floating-panel/index.js +502 -0
- package/floating-panel/types.d.ts +80 -0
- package/floating-panel/types.js +1 -0
- package/floating-panel-button/index.d.ts +11 -0
- package/floating-panel-button/index.js +43 -0
- package/floating-panel-button/types.d.ts +35 -0
- package/floating-panel-button/types.js +1 -0
- package/floating-panel-icon-button/index.d.ts +12 -0
- package/floating-panel-icon-button/index.js +50 -0
- package/floating-panel-icon-button/types.d.ts +35 -0
- package/floating-panel-icon-button/types.js +1 -0
- package/icon/index.js +30 -4
- package/package.json +3 -3
- package/pop/index.js +1 -1
- package/standalone.d.ts +3 -0
- package/standalone.js +3 -0
- package/standalone.ts +3 -0
- package/tooltip/index.js +4 -4
- package/utils/component-names.d.ts +2 -2
- package/utils/component-names.js +3 -0
- package/utils/element.d.ts +3 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isAttrEqual, updateAttribute, getAttribute } from "../utils/dom.js";
|
|
2
|
+
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
3
|
+
import "../button/index.js";
|
|
4
|
+
const templateHTML = '<style>:host{display:flex;flex-shrink:0;height:100%;min-height:40px;color:var(--sinch-comp-floating-panel-color-text,var(--sinch-sys-color-primary-foreground))}sinch-button{height:100%;padding:0;white-space:nowrap;--sinch-button-shape-radius-base:0;--sinch-comp-button-color-subtle-secondary-default-border-initial:var(--sinch-sys-color-basic-transparent);--sinch-comp-button-color-subtle-secondary-disabled-border-initial:var(--sinch-sys-color-basic-transparent);--sinch-comp-button-spacing-padding-m:16px;--sinch-comp-button-color-subtle-secondary-default-text-initial:var(--sinch-comp-floating-panel-color-button-text-initial, var(--sinch-sys-color-primary-foreground));--sinch-comp-button-color-subtle-secondary-default-background-initial:var(--sinch-comp-floating-panel-color-button-background-initial, transparent);--sinch-comp-button-color-subtle-secondary-default-background-hover:var(--sinch-comp-floating-panel-color-button-background-hover);--sinch-comp-button-color-subtle-secondary-default-background-active:var(--sinch-comp-floating-panel-color-button-background-active);--sinch-comp-button-shadow-subtle-hover:none;--sinch-comp-button-shadow-subtle-active:none}sinch-button:focus-visible{--sinch-comp-button-color-subtle-secondary-default-background-initial:var(--sinch-comp-floating-panel-color-button-background-hover);--sinch-comp-button-shadow-subtle-focus:none}</style><sinch-button id="button" type="subtle-secondary"></sinch-button>';
|
|
5
|
+
const template = document.createElement("template");
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
class FloatingPanelButton extends NectaryElement {
|
|
8
|
+
#$button;
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
const shadowRoot = this.attachShadow();
|
|
12
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
13
|
+
this.#$button = shadowRoot.querySelector("#button");
|
|
14
|
+
}
|
|
15
|
+
static get observedAttributes() {
|
|
16
|
+
return ["text", "aria-label"];
|
|
17
|
+
}
|
|
18
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
19
|
+
if (isAttrEqual(oldVal, newVal)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (name === "text") {
|
|
23
|
+
this.#$button.setAttribute("text", newVal ?? "");
|
|
24
|
+
}
|
|
25
|
+
if (name === "aria-label") {
|
|
26
|
+
if (newVal !== null) {
|
|
27
|
+
this.#$button.setAttribute("aria-label", newVal);
|
|
28
|
+
} else {
|
|
29
|
+
this.#$button.removeAttribute("aria-label");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
set text(value) {
|
|
34
|
+
updateAttribute(this, "text", value);
|
|
35
|
+
}
|
|
36
|
+
get text() {
|
|
37
|
+
return getAttribute(this, "text");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
defineCustomElement("sinch-floating-panel-button", FloatingPanelButton);
|
|
41
|
+
export {
|
|
42
|
+
FloatingPanelButton
|
|
43
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NectaryComponentReact, NectaryComponentReactByType, NectaryComponentVanilla, NectaryComponentVanillaByType } from '../types';
|
|
2
|
+
export type TSinchFloatingPanelButtonProps = {
|
|
3
|
+
/** The button label text */
|
|
4
|
+
text?: string;
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
};
|
|
7
|
+
export type TSinchFloatingPanelButtonEvents = Record<string, never>;
|
|
8
|
+
export type TSinchFloatingPanelButtonStyle = Record<string, never>;
|
|
9
|
+
export type TSinchFloatingPanelButton = {
|
|
10
|
+
props: TSinchFloatingPanelButtonProps;
|
|
11
|
+
events: TSinchFloatingPanelButtonEvents;
|
|
12
|
+
style: TSinchFloatingPanelButtonStyle;
|
|
13
|
+
};
|
|
14
|
+
export type TSinchFloatingPanelButtonElement = NectaryComponentVanillaByType<TSinchFloatingPanelButton>;
|
|
15
|
+
export type TSinchFloatingPanelButtonReact = NectaryComponentReactByType<TSinchFloatingPanelButton>;
|
|
16
|
+
declare global {
|
|
17
|
+
interface NectaryComponentMap {
|
|
18
|
+
'sinch-floating-panel-button': TSinchFloatingPanelButton;
|
|
19
|
+
}
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'sinch-floating-panel-button': NectaryComponentVanilla<'sinch-floating-panel-button'>;
|
|
22
|
+
}
|
|
23
|
+
namespace JSX {
|
|
24
|
+
interface IntrinsicElements {
|
|
25
|
+
'sinch-floating-panel-button': NectaryComponentReact<'sinch-floating-panel-button'>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
declare module 'react' {
|
|
30
|
+
namespace JSX {
|
|
31
|
+
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
32
|
+
'sinch-floating-panel-button': NectaryComponentReact<'sinch-floating-panel-button'>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NectaryElement } from '../utils';
|
|
2
|
+
import '../button';
|
|
3
|
+
import '../icon';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export declare class FloatingPanelIconButton extends NectaryElement {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
|
|
10
|
+
set icon(value: string | null);
|
|
11
|
+
get icon(): string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isAttrEqual, updateAttribute, getAttribute } from "../utils/dom.js";
|
|
2
|
+
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
3
|
+
import "../button/index.js";
|
|
4
|
+
import "../icon/index.js";
|
|
5
|
+
const templateHTML = '<style>:host{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex-shrink:0;box-sizing:border-box;cursor:pointer}sinch-button{display:flex;align-items:center;justify-content:center;width:100%;height:100%;--sinch-button-shape-radius-base:0;--sinch-comp-button-color-subtle-secondary-default-border-initial:var(--sinch-sys-color-basic-transparent);--sinch-comp-button-color-subtle-secondary-disabled-border-initial:var(--sinch-sys-color-basic-transparent);--sinch-comp-button-color-subtle-secondary-default-background-initial:transparent;--sinch-comp-button-color-subtle-secondary-default-icon-initial:var(--sinch-comp-floating-panel-color-text, var(--sinch-sys-color-primary-foreground));--sinch-comp-button-color-subtle-secondary-default-text-initial:var(--sinch-comp-floating-panel-color-text, var(--sinch-sys-color-primary-foreground));--sinch-comp-button-color-subtle-secondary-default-background-hover:var(--sinch-comp-floating-panel-color-button-background-hover);--sinch-comp-button-color-subtle-secondary-default-background-active:var(--sinch-comp-floating-panel-color-button-background-active);--sinch-comp-button-shadow-subtle-hover:none;--sinch-comp-button-shadow-subtle-active:none}sinch-button:focus-visible{--sinch-comp-button-color-subtle-secondary-default-background-initial:var(--sinch-comp-floating-panel-color-button-background-hover);--sinch-comp-button-shadow-subtle-focus:none}:host(.edge-start:active) sinch-button,:host(.edge-start:focus) sinch-button,:host(.edge-start:hover) sinch-button{--sinch-button-shape-radius-top-left:var(--sinch-comp-floating-panel-shape-radius);--sinch-button-shape-radius-bottom-left:var(--sinch-comp-floating-panel-shape-radius)}:host(.edge-end:active) sinch-button,:host(.edge-end:focus) sinch-button,:host(.edge-end:hover) sinch-button{--sinch-button-shape-radius-top-right:var(--sinch-comp-floating-panel-shape-radius);--sinch-button-shape-radius-bottom-right:var(--sinch-comp-floating-panel-shape-radius)}sinch-icon{--sinch-global-color-icon:var(--sinch-comp-floating-panel-color-text, var(--sinch-sys-color-primary-foreground));--sinch-global-size-icon:var(--sinch-comp-floating-panel-size-button-icon)}</style><sinch-button id="button" type="subtle-secondary"><sinch-icon id="icon" icons-version="2" slot="icon"></sinch-icon></sinch-button>';
|
|
6
|
+
const template = document.createElement("template");
|
|
7
|
+
template.innerHTML = templateHTML;
|
|
8
|
+
class FloatingPanelIconButton extends NectaryElement {
|
|
9
|
+
#$icon;
|
|
10
|
+
#$button;
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
const shadowRoot = this.attachShadow();
|
|
14
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
15
|
+
this.#$icon = shadowRoot.querySelector("#icon");
|
|
16
|
+
this.#$button = shadowRoot.querySelector("#button");
|
|
17
|
+
}
|
|
18
|
+
static get observedAttributes() {
|
|
19
|
+
return ["icon", "aria-label"];
|
|
20
|
+
}
|
|
21
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
22
|
+
if (isAttrEqual(oldVal, newVal)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (name === "icon") {
|
|
26
|
+
if (newVal !== null) {
|
|
27
|
+
this.#$icon.setAttribute("name", newVal);
|
|
28
|
+
} else {
|
|
29
|
+
this.#$icon.removeAttribute("name");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (name === "aria-label") {
|
|
33
|
+
if (newVal !== null) {
|
|
34
|
+
this.#$button.setAttribute("aria-label", newVal);
|
|
35
|
+
} else {
|
|
36
|
+
this.#$button.removeAttribute("aria-label");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
set icon(value) {
|
|
41
|
+
updateAttribute(this, "icon", value);
|
|
42
|
+
}
|
|
43
|
+
get icon() {
|
|
44
|
+
return getAttribute(this, "icon");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
defineCustomElement("sinch-floating-panel-icon-button", FloatingPanelIconButton);
|
|
48
|
+
export {
|
|
49
|
+
FloatingPanelIconButton
|
|
50
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NectaryComponentReact, NectaryComponentReactByType, NectaryComponentVanilla, NectaryComponentVanillaByType } from '../types';
|
|
2
|
+
export type TSinchFloatingPanelIconButtonProps = {
|
|
3
|
+
/** The icon name */
|
|
4
|
+
icon?: string;
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
};
|
|
7
|
+
export type TSinchFloatingPanelIconButtonEvents = Record<string, never>;
|
|
8
|
+
export type TSinchFloatingPanelIconButtonStyle = Record<string, never>;
|
|
9
|
+
export type TSinchFloatingPanelIconButton = {
|
|
10
|
+
props: TSinchFloatingPanelIconButtonProps;
|
|
11
|
+
events: TSinchFloatingPanelIconButtonEvents;
|
|
12
|
+
style: TSinchFloatingPanelIconButtonStyle;
|
|
13
|
+
};
|
|
14
|
+
export type TSinchFloatingPanelIconButtonElement = NectaryComponentVanillaByType<TSinchFloatingPanelIconButton>;
|
|
15
|
+
export type TSinchFloatingPanelIconButtonReact = NectaryComponentReactByType<TSinchFloatingPanelIconButton>;
|
|
16
|
+
declare global {
|
|
17
|
+
interface NectaryComponentMap {
|
|
18
|
+
'sinch-floating-panel-icon-button': TSinchFloatingPanelIconButton;
|
|
19
|
+
}
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'sinch-floating-panel-icon-button': NectaryComponentVanilla<'sinch-floating-panel-icon-button'>;
|
|
22
|
+
}
|
|
23
|
+
namespace JSX {
|
|
24
|
+
interface IntrinsicElements {
|
|
25
|
+
'sinch-floating-panel-icon-button': NectaryComponentReact<'sinch-floating-panel-icon-button'>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
declare module 'react' {
|
|
30
|
+
namespace JSX {
|
|
31
|
+
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
32
|
+
'sinch-floating-panel-icon-button': NectaryComponentReact<'sinch-floating-panel-icon-button'>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/icon/index.js
CHANGED
|
@@ -14,13 +14,39 @@ class Icon extends NectaryElement {
|
|
|
14
14
|
static get observedAttributes() {
|
|
15
15
|
return ["name", "icons-version"];
|
|
16
16
|
}
|
|
17
|
+
/* Font class is now set before the text content. Covered by new regression tests.
|
|
18
|
+
|
|
19
|
+
Before:
|
|
20
|
+
1. textContent = "fa-clone" → Safari renders the text using the default font
|
|
21
|
+
(Material Icons)
|
|
22
|
+
2. _matchNameToFont() → switches font-family to Sinch Icons Zero To D via
|
|
23
|
+
class
|
|
24
|
+
|
|
25
|
+
After:
|
|
26
|
+
1. _matchNameToFont() → sets the correct font-family class first
|
|
27
|
+
2. textContent = "fa-clone" → Safari renders the text using the correct font
|
|
28
|
+
from the start
|
|
29
|
+
|
|
30
|
+
Reasoning:
|
|
31
|
+
* Safari caches the ligature layout from the first paint. When
|
|
32
|
+
the text was set in Material Icons (which doesn't have these ligatures),
|
|
33
|
+
Safari calculated glyph positions for individual characters. When the font
|
|
34
|
+
then switched to Sinch Icons, Safari reused some of that cached layout
|
|
35
|
+
instead of fully recalculating — shifting certain glyphs to the right.
|
|
36
|
+
* _matchNameToFont() reads this.name via getAttribute(this,
|
|
37
|
+
'name'), which reads the HTML attribute — not textContent. The attribute is
|
|
38
|
+
already set when the callback fires (that's what triggers the callback), so
|
|
39
|
+
the method gets the correct name regardless of when textContent is set.
|
|
40
|
+
*/
|
|
17
41
|
attributeChangedCallback(name, _, newVal) {
|
|
18
42
|
switch (name) {
|
|
19
43
|
case "name": {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this
|
|
44
|
+
{
|
|
45
|
+
this.#$icon.textContent = newVal;
|
|
46
|
+
updateAttribute(this.#$icon, "aria-label", newVal);
|
|
47
|
+
if (getAttribute(this, "icons-version", "1") !== "1") {
|
|
48
|
+
this._matchNameToFont();
|
|
49
|
+
}
|
|
24
50
|
}
|
|
25
51
|
break;
|
|
26
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nectary/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"**/*/*.css",
|
|
6
6
|
"**/*/*.json",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.22.15",
|
|
27
|
-
"@nectary/assets": "3.6.
|
|
27
|
+
"@nectary/assets": "3.6.10"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/cli": "^7.22.15",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"vite": "^7.0.6"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@nectary/theme-base": "1.
|
|
43
|
+
"@nectary/theme-base": "1.16.0"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/pop/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
|
8
8
|
import { isTargetEqual } from "../utils/event-target.js";
|
|
9
9
|
import { getPlacementContext, toLocalRect } from "../utils/placement.js";
|
|
10
10
|
import { orientationValues, disableOverscroll, enableOverscroll, getAnchorPosition, clampPosition } from "./utils.js";
|
|
11
|
-
const templateHTML = '<style>:host{display:contents;position:relative}dialog{position:fixed;left:0;top:0;transform:translate(var(--sinch-pop-offset-x),var(--sinch-pop-offset-y));margin:0;outline:0;padding:0;border:none;box-sizing:border-box;max-width:unset;max-height:unset;z-index:1;background:0 0;overflow:visible}dialog:not([open]){display:none}dialog::backdrop{background-color:transparent}#content{position:relative;z-index:1}#target-open{display:flex;flex-direction:column;position:absolute;left:0;top:0}#focus{display:none;position:absolute;width:0;height:0}</style><slot id="target" name="target" aria-haspopup="dialog" aria-expanded="false"></slot><div id="focus"></div><dialog id="dialog"><div id="target-open"><slot name="target-open"></slot></div><div id="content"><slot name="content"></slot></div></dialog>';
|
|
11
|
+
const templateHTML = '<style>:host{display:contents;position:relative}dialog{position:fixed;left:0;top:0;transform:translate(var(--sinch-pop-offset-x),var(--sinch-pop-offset-y));margin:0;outline:0;padding:0;border:none;box-sizing:border-box;max-width:unset;max-height:unset;z-index:var(--sinch-comp-pop-z-index,1);background:0 0;overflow:visible}dialog:not([open]){display:none}dialog::backdrop{background-color:transparent}#content{position:relative;z-index:var(--sinch-comp-pop-z-index,1)}#target-open{display:flex;flex-direction:column;position:absolute;left:0;top:0}#focus{display:none;position:absolute;width:0;height:0}</style><slot id="target" name="target" aria-haspopup="dialog" aria-expanded="false"></slot><div id="focus"></div><dialog id="dialog"><div id="target-open"><slot name="target-open"></slot></div><div id="content"><slot name="content"></slot></div></dialog>';
|
|
12
12
|
const template = document.createElement("template");
|
|
13
13
|
template.innerHTML = templateHTML;
|
|
14
14
|
class Pop extends NectaryElement {
|
package/standalone.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ import './file-drop/index.js';
|
|
|
27
27
|
import './file-picker/index.js';
|
|
28
28
|
import './file-status/index.js';
|
|
29
29
|
import './flag/index.js';
|
|
30
|
+
import './floating-panel/index.js';
|
|
31
|
+
import './floating-panel-button/index.js';
|
|
32
|
+
import './floating-panel-icon-button/index.js';
|
|
30
33
|
import './grid-item/index.js';
|
|
31
34
|
import './grid/index.js';
|
|
32
35
|
import './help-tooltip/index.js';
|
package/standalone.js
CHANGED
|
@@ -28,6 +28,9 @@ import "./file-drop/index.js";
|
|
|
28
28
|
import "./file-picker/index.js";
|
|
29
29
|
import "./file-status/index.js";
|
|
30
30
|
import "./flag/index.js";
|
|
31
|
+
import "./floating-panel/index.js";
|
|
32
|
+
import "./floating-panel-button/index.js";
|
|
33
|
+
import "./floating-panel-icon-button/index.js";
|
|
31
34
|
import "./grid-item/index.js";
|
|
32
35
|
import "./grid/index.js";
|
|
33
36
|
import "./help-tooltip/index.js";
|
package/standalone.ts
CHANGED
|
@@ -35,6 +35,9 @@ import './file-drop/index.js'
|
|
|
35
35
|
import './file-picker/index.js'
|
|
36
36
|
import './file-status/index.js'
|
|
37
37
|
import './flag/index.js'
|
|
38
|
+
import './floating-panel/index.js'
|
|
39
|
+
import './floating-panel-button/index.js'
|
|
40
|
+
import './floating-panel-icon-button/index.js'
|
|
38
41
|
import './grid-item/index.js'
|
|
39
42
|
import './grid/index.js'
|
|
40
43
|
import './help-tooltip/index.js'
|
package/tooltip/index.js
CHANGED
|
@@ -623,19 +623,19 @@ class Tooltip extends NectaryElement {
|
|
|
623
623
|
let offsetX = 0;
|
|
624
624
|
let offsetY = 0;
|
|
625
625
|
if (orientation.startsWith("top")) {
|
|
626
|
-
if (bottomEdge > targetRect.y + OVERLAP_TOLERANCE) {
|
|
626
|
+
if (bottomEdge > targetRect.y + OVERLAP_TOLERANCE && topEdge < targetBottom) {
|
|
627
627
|
offsetY = targetRect.y - bottomEdge;
|
|
628
628
|
}
|
|
629
629
|
} else if (orientation.startsWith("bottom")) {
|
|
630
|
-
if (topEdge < targetBottom - OVERLAP_TOLERANCE) {
|
|
630
|
+
if (topEdge < targetBottom - OVERLAP_TOLERANCE && bottomEdge > targetRect.y) {
|
|
631
631
|
offsetY = targetBottom - topEdge;
|
|
632
632
|
}
|
|
633
633
|
} else if (orientation === "left") {
|
|
634
|
-
if (rightEdge > targetRect.x + OVERLAP_TOLERANCE) {
|
|
634
|
+
if (rightEdge > targetRect.x + OVERLAP_TOLERANCE && leftEdge < targetRight) {
|
|
635
635
|
offsetX = targetRect.x - rightEdge;
|
|
636
636
|
}
|
|
637
637
|
} else if (orientation === "right") {
|
|
638
|
-
if (leftEdge < targetRight - OVERLAP_TOLERANCE) {
|
|
638
|
+
if (leftEdge < targetRight - OVERLAP_TOLERANCE && rightEdge > targetRect.x) {
|
|
639
639
|
offsetX = targetRight - leftEdge;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const BASE_COMPONENT_NAMES_LIST: readonly ["accordion-item", "accordion", "action-menu-option", "action-menu", "alert", "avatar", "badge", "button-group-item", "button-group", "button", "card-container", "card-v2-title", "card-v2", "checkbox", "chip", "code-tag", "color-menu-option", "color-menu", "color-swatch", "date-picker", "dialog", "emoji-picker", "emoji", "field", "field-v2", "file-drop", "file-picker", "file-status", "flag", "grid-item", "grid", "help-tooltip", "icon", "inline-alert", "input", "link", "list-item", "list", "pagination", "persistent-overlay", "pop", "popover", "progress-stepper-item", "progress-stepper", "progress", "radio-option", "radio", "rich-text", "rich-textarea", "rich-textarea-chip", "segment-collapse", "segmented-control-option", "segmented-control", "segmented-icon-control-option", "segmented-icon-control", "select-button", "select-menu-option", "select-menu", "sheet", "sheet-title", "skeleton-item", "skeleton", "spinner", "stop-events", "table-body", "table-cell", "table-head-cell", "table-head", "table-row", "table", "tabs-icon-option", "tabs-option", "tabs", "tag", "text", "textarea", "time-picker", "title", "toast-manager", "toast", "toggle", "tooltip"];
|
|
2
|
-
export declare const BASE_COMPONENT_NAMES: Set<"pop" | "button" | "dialog" | "input" | "link" | "progress" | "table" | "textarea" | "title" | "accordion-item" | "accordion" | "action-menu-option" | "action-menu" | "alert" | "avatar" | "badge" | "button-group-item" | "button-group" | "card-container" | "card-v2-title" | "card-v2" | "checkbox" | "chip" | "code-tag" | "color-menu-option" | "color-menu" | "color-swatch" | "date-picker" | "emoji-picker" | "emoji" | "field" | "field-v2" | "file-drop" | "file-picker" | "file-status" | "flag" | "grid-item" | "grid" | "help-tooltip" | "icon" | "inline-alert" | "list-item" | "list" | "pagination" | "persistent-overlay" | "popover" | "progress-stepper-item" | "progress-stepper" | "radio-option" | "radio" | "rich-text" | "rich-textarea" | "rich-textarea-chip" | "segment-collapse" | "segmented-control-option" | "segmented-control" | "segmented-icon-control-option" | "segmented-icon-control" | "select-button" | "select-menu-option" | "select-menu" | "sheet" | "sheet-title" | "skeleton-item" | "skeleton" | "spinner" | "stop-events" | "table-body" | "table-cell" | "table-head-cell" | "table-head" | "table-row" | "tabs-icon-option" | "tabs-option" | "tabs" | "tag" | "text" | "time-picker" | "toast-manager" | "toast" | "toggle" | "tooltip">;
|
|
1
|
+
export declare const BASE_COMPONENT_NAMES_LIST: readonly ["accordion-item", "accordion", "action-menu-option", "action-menu", "alert", "avatar", "badge", "button-group-item", "button-group", "button", "card-container", "card-v2-title", "card-v2", "checkbox", "chip", "code-tag", "color-menu-option", "color-menu", "color-swatch", "date-picker", "dialog", "emoji-picker", "emoji", "field", "field-v2", "file-drop", "file-picker", "file-status", "flag", "floating-panel", "floating-panel-button", "floating-panel-icon-button", "grid-item", "grid", "help-tooltip", "icon", "inline-alert", "input", "link", "list-item", "list", "pagination", "persistent-overlay", "pop", "popover", "progress-stepper-item", "progress-stepper", "progress", "radio-option", "radio", "rich-text", "rich-textarea", "rich-textarea-chip", "segment-collapse", "segmented-control-option", "segmented-control", "segmented-icon-control-option", "segmented-icon-control", "select-button", "select-menu-option", "select-menu", "sheet", "sheet-title", "skeleton-item", "skeleton", "spinner", "stop-events", "table-body", "table-cell", "table-head-cell", "table-head", "table-row", "table", "tabs-icon-option", "tabs-option", "tabs", "tag", "text", "textarea", "time-picker", "title", "toast-manager", "toast", "toggle", "tooltip"];
|
|
2
|
+
export declare const BASE_COMPONENT_NAMES: Set<"pop" | "button" | "dialog" | "input" | "link" | "progress" | "table" | "textarea" | "title" | "accordion-item" | "accordion" | "action-menu-option" | "action-menu" | "alert" | "avatar" | "badge" | "button-group-item" | "button-group" | "card-container" | "card-v2-title" | "card-v2" | "checkbox" | "chip" | "code-tag" | "color-menu-option" | "color-menu" | "color-swatch" | "date-picker" | "emoji-picker" | "emoji" | "field" | "field-v2" | "file-drop" | "file-picker" | "file-status" | "flag" | "floating-panel" | "floating-panel-button" | "floating-panel-icon-button" | "grid-item" | "grid" | "help-tooltip" | "icon" | "inline-alert" | "list-item" | "list" | "pagination" | "persistent-overlay" | "popover" | "progress-stepper-item" | "progress-stepper" | "radio-option" | "radio" | "rich-text" | "rich-textarea" | "rich-textarea-chip" | "segment-collapse" | "segmented-control-option" | "segmented-control" | "segmented-icon-control-option" | "segmented-icon-control" | "select-button" | "select-menu-option" | "select-menu" | "sheet" | "sheet-title" | "skeleton-item" | "skeleton" | "spinner" | "stop-events" | "table-body" | "table-cell" | "table-head-cell" | "table-head" | "table-row" | "tabs-icon-option" | "tabs-option" | "tabs" | "tag" | "text" | "time-picker" | "toast-manager" | "toast" | "toggle" | "tooltip">;
|
|
3
3
|
export type ComponentName = `sinch-${typeof BASE_COMPONENT_NAMES_LIST[number]}`;
|
package/utils/component-names.js
CHANGED
package/utils/element.d.ts
CHANGED