@visitwonders/assembly 0.8.0 → 0.9.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/declarations/action/link.d.ts +11 -1
- package/declarations/action/link.d.ts.map +1 -1
- package/declarations/overlay/drawer.d.ts.map +1 -1
- package/declarations/overlay/modal.d.ts.map +1 -1
- package/declarations/overlay/popover.d.ts +14 -19
- package/declarations/overlay/popover.d.ts.map +1 -1
- package/declarations/overlay/tooltip.d.ts +13 -9
- package/declarations/overlay/tooltip.d.ts.map +1 -1
- package/dist/action/{link-css-3dee8e26ccdbd8e9a887e46971642cca.css → link-css-7e63c457aec3ba475c3c05aac8b1e83d.css} +2 -2
- package/dist/action/link.js +40 -9
- package/dist/overlay/drawer.js +2 -2
- package/dist/overlay/modal.js +2 -2
- package/dist/overlay/popover.css +21 -1
- package/dist/overlay/popover.js +88 -70
- package/dist/overlay/tooltip.css +21 -0
- package/dist/overlay/tooltip.js +91 -68
- package/package.json +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import type RouterService from '@ember/routing/router-service';
|
|
2
3
|
export interface LinkSignature {
|
|
3
4
|
Element: HTMLAnchorElement;
|
|
4
5
|
Args: {
|
|
@@ -19,7 +20,16 @@ export interface LinkSignature {
|
|
|
19
20
|
default: [];
|
|
20
21
|
};
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Link renders a styled anchor. When `@href` is supplied it's used directly;
|
|
25
|
+
* otherwise `@route` (with optional `@model`, `@models`, `@query`) is resolved
|
|
26
|
+
* to a URL via `router.urlFor`. In both cases the rendered element is a plain
|
|
27
|
+
* `<a href>` — the consuming app's Router must apply the `@properLinks`
|
|
28
|
+
* decorator from `ember-primitives/proper-links` so same-origin route links
|
|
29
|
+
* are routed through Ember instead of triggering a full-page navigation.
|
|
30
|
+
*/
|
|
22
31
|
export default class Link extends Component<LinkSignature> {
|
|
23
|
-
|
|
32
|
+
router: RouterService;
|
|
33
|
+
get href(): string | undefined;
|
|
24
34
|
}
|
|
25
35
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/action/link.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/action/link.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QAC1B,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;QACjC,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;KACzC,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC;IAEvC,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAyB7B;CA4BF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/overlay/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/overlay/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUrD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtE,UAAU,aAAa;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,4BAA4B;QAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;QAEf,wCAAwC;QACxC,WAAW,CAAC,EAAE,OAAO,CAAC;QAEtB,uCAAuC;QACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;QAEvC,yCAAyC;QACzC,IAAI,CAAC,E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AAI,IAAI,UAAU,CAErB;IAED,IAAI,OAAO,IAAI,aAAa,CAE3B;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,oBAAoB,IAAI,OAAO,CAGlC;IAED,IAAI,aAAa,IAAI,OAAO,CAG3B;IAED,IAAI,kBAAkB,IAAI,WAAW,CAEpC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,QAAQ,CAEjC;IAMD,OAAO,UAAW,OAAO,KAAG,IAAI,CAK9B;IAEF,WAAW,QAAO,IAAI,CAEpB;IAEF,mBAAmB,QAAO,IAAI,CAI5B;IAMF,eAAe;;;;yBAIO,OAAO;;;;OAW3B;IAEF,WAAW;;;;;;OA+FR;IAEH,kBAAkB,QAAO,IAAI,CAI3B;IAMF,IAAI,OAAO,IAAI,aAAa,CAM3B;CAmEF;AAED,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/overlay/modal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/overlay/modal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUrD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,SAAS,GAAG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mBAAmB,CAAS;IAE7C,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,qBAAqB,CAA4B;IAEzD,OAAO,SAA+B;IAMtC,IAAI,cAAc,IAAI,OAAO,CAK5B;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,EAEhC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,IAAI,IAAI,SAAS,CAEpB;IAED,IAAI,IAAI,IAAI,SAAS,CAEpB;IAED,IAAI,oBAAoB,IAAI,OAAO,CAGlC;IAED,IAAI,aAAa,IAAI,OAAO,CAG3B;IAED,IAAI,kBAAkB,IAAI,WAAW,CAEpC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,QAAQ,CAEjC;IAMD,OAAO,UAAW,OAAO,KAAG,IAAI,CAK9B;IAEF,SAAS,QAAO,IAAI,CAElB;IAEF,UAAU,QAAO,IAAI,CAEnB;IAEF,mBAAmB,QAAO,IAAI,CAI5B;IAMF,eAAe;;;;yBAIO,OAAO;;;;OAW3B;IAEF,UAAU;;;;;;OAwFP;IAEH,kBAAkB,QAAO,IAAI,CAI3B;IAMF,IAAI,OAAO,IAAI,YAAY,CAM1B;CA+DF;AAED,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import type { WithBoundArgs } from '@glint/template';
|
|
3
|
-
import { type Placement, type OffsetOptions, type FlipOptions, type ShiftOptions } from '@floating-ui/dom';
|
|
3
|
+
import { type Placement, type OffsetOptions, type FlipOptions, type ShiftOptions, type Middleware } from '@floating-ui/dom';
|
|
4
4
|
export type PopoverSide = 'top' | 'right' | 'bottom' | 'left';
|
|
5
5
|
export type PopoverAlign = 'start' | 'center' | 'end';
|
|
6
6
|
export type PopoverTriggerMode = 'click' | 'hover' | 'focus' | 'manual';
|
|
@@ -103,6 +103,7 @@ export interface PopoverCloseSignature {
|
|
|
103
103
|
}
|
|
104
104
|
declare class PopoverTrigger extends Component<PopoverTriggerSignature> {
|
|
105
105
|
get ctx(): PopoverContext;
|
|
106
|
+
private readonly register;
|
|
106
107
|
registerElement: import("ember-modifier").FunctionBasedModifier<{
|
|
107
108
|
Args: {
|
|
108
109
|
Positional: unknown[];
|
|
@@ -120,16 +121,9 @@ declare class PopoverTrigger extends Component<PopoverTriggerSignature> {
|
|
|
120
121
|
get ariaControls(): string | undefined;
|
|
121
122
|
}
|
|
122
123
|
declare class PopoverContent extends Component<PopoverContentSignature> {
|
|
123
|
-
arrowElement: HTMLElement | null;
|
|
124
|
-
registerArrow: import("ember-modifier").FunctionBasedModifier<{
|
|
125
|
-
Args: {
|
|
126
|
-
Positional: unknown[];
|
|
127
|
-
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
128
|
-
};
|
|
129
|
-
Element: HTMLElement;
|
|
130
|
-
}>;
|
|
131
124
|
get destinationElement(): HTMLElement;
|
|
132
125
|
get ctx(): PopoverContext;
|
|
126
|
+
get triggerElement(): HTMLElement;
|
|
133
127
|
get side(): PopoverSide;
|
|
134
128
|
get align(): PopoverAlign;
|
|
135
129
|
get sideOffset(): number;
|
|
@@ -143,21 +137,22 @@ declare class PopoverContent extends Component<PopoverContentSignature> {
|
|
|
143
137
|
get flipOptions(): FlipOptions | undefined;
|
|
144
138
|
get shiftOptions(): ShiftOptions | undefined;
|
|
145
139
|
get dataState(): string;
|
|
146
|
-
|
|
140
|
+
private arrowElement;
|
|
141
|
+
registerArrow: import("ember-modifier").FunctionBasedModifier<{
|
|
147
142
|
Args: {
|
|
148
143
|
Positional: unknown[];
|
|
149
|
-
Named:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
};
|
|
144
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
145
|
+
};
|
|
146
|
+
Element: HTMLElement;
|
|
147
|
+
}>;
|
|
148
|
+
registerContentElement: import("ember-modifier").FunctionBasedModifier<{
|
|
149
|
+
Args: {
|
|
150
|
+
Positional: unknown[];
|
|
151
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
158
152
|
};
|
|
159
153
|
Element: HTMLElement;
|
|
160
154
|
}>;
|
|
155
|
+
get middleware(): Middleware[];
|
|
161
156
|
handleMouseEnter: () => void;
|
|
162
157
|
handleMouseLeave: () => void;
|
|
163
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/overlay/popover.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/overlay/popover.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACtD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,UAAU,cAA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AG,IAAI,CAS1C;IAEF,sBAAsB,YAAa,WAAW,GAAG,IAAI,KAAG,IAAI,CAE1D;IAEF,IAAI,OAAO,IAAI,cAAc,CAa5B;CAuBF;AAED,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { type Placement, type OffsetOptions, type FlipOptions, type ShiftOptions } from '@floating-ui/dom';
|
|
2
|
+
import { type Placement, type OffsetOptions, type FlipOptions, type ShiftOptions, type Middleware } from '@floating-ui/dom';
|
|
3
3
|
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
4
|
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
5
5
|
export interface TooltipProviderSignature {
|
|
@@ -102,6 +102,16 @@ export default class Tooltip extends Component<TooltipSignature> {
|
|
|
102
102
|
get offsetOptions(): OffsetOptions;
|
|
103
103
|
get flipOptions(): FlipOptions;
|
|
104
104
|
get shiftOptions(): ShiftOptions;
|
|
105
|
+
get triggerAnchor(): HTMLElement;
|
|
106
|
+
private arrowElement;
|
|
107
|
+
registerArrow: import("ember-modifier").FunctionBasedModifier<{
|
|
108
|
+
Args: {
|
|
109
|
+
Positional: unknown[];
|
|
110
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
111
|
+
};
|
|
112
|
+
Element: HTMLElement;
|
|
113
|
+
}>;
|
|
114
|
+
get middleware(): Middleware[];
|
|
105
115
|
setOpen: (value: boolean) => void;
|
|
106
116
|
/**
|
|
107
117
|
* Calculate the actual delay to use based on skip delay logic.
|
|
@@ -127,16 +137,10 @@ export default class Tooltip extends Component<TooltipSignature> {
|
|
|
127
137
|
};
|
|
128
138
|
Element: HTMLElement;
|
|
129
139
|
}>;
|
|
130
|
-
|
|
140
|
+
registerContentElement: import("ember-modifier").FunctionBasedModifier<{
|
|
131
141
|
Args: {
|
|
132
142
|
Positional: unknown[];
|
|
133
|
-
Named:
|
|
134
|
-
trigger: HTMLElement | null;
|
|
135
|
-
placement: Placement;
|
|
136
|
-
offsetOptions: OffsetOptions;
|
|
137
|
-
flipOptions: FlipOptions;
|
|
138
|
-
shiftOptions: ShiftOptions;
|
|
139
|
-
};
|
|
143
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
140
144
|
};
|
|
141
145
|
Element: HTMLElement;
|
|
142
146
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/overlay/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/overlay/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAiBtD,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,iDAAiD;QACjD,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,8CAA8C;QAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,4CAA4C;QAC5C,uBAAuB,CAAC,EAAE,OAAO,CAAC;KACnC,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IAC7D,aAAa,SAAK;IAE3B,IAAI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qBAAqB,QAAO,IAAI,CAG9B;IAEF,OAAO,CAAC,aAAa;IAerB,mBAAmB;;;;;;OAOhB;IAEH,eAAe;;;;;;OAKZ;IAKH,sBAAsB;;;;;;OAKnB;IAMH,gBAAgB,QAAO,IAAI,CAEzB;IAEF,gBAAgB,QAAO,IAAI,CAEzB;IAEF,aAAa,QAAO,IAAI,CAGtB;IAEF,cAAc,UAAW,UAAU,KAAG,IAAI,CAmBxC;IAEF,uBAAuB,QAAO,IAAI,CAIhC;IAEF,uBAAuB,QAAO,IAAI,CAEhC;IAEF,aAAa,UAAW,aAAa,KAAG,IAAI,CAO1C;IAMF,IAAI,kBAAkB,IAAI,WAAW,CAEpC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;CAoEF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* <inline>/src/action/link-css-
|
|
1
|
+
/* <inline>/src/action/link-css-7e63c457aec3ba475c3c05aac8b1e83d.css */
|
|
2
2
|
|
|
3
3
|
.link_e4aeb20a2 {
|
|
4
4
|
color: var(--color-text-link);
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.link_e4aeb20a2[data-color="neutral"]:hover {
|
|
73
|
-
color: var(--color-text-
|
|
73
|
+
color: var(--color-text-link-hover);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.link_e4aeb20a2[data-color="neutral"]:visited {
|
package/dist/action/link.js
CHANGED
|
@@ -1,21 +1,52 @@
|
|
|
1
|
-
import "./link-css-
|
|
1
|
+
import "./link-css-7e63c457aec3ba475c3c05aac8b1e83d.css"
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
|
-
import {
|
|
3
|
+
import { service } from '@ember/service';
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
|
+
import { g, i } from 'decorator-transforms/runtime';
|
|
6
7
|
|
|
7
8
|
;
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Link renders a styled anchor. When `@href` is supplied it's used directly;
|
|
12
|
+
* otherwise `@route` (with optional `@model`, `@models`, `@query`) is resolved
|
|
13
|
+
* to a URL via `router.urlFor`. In both cases the rendered element is a plain
|
|
14
|
+
* `<a href>` — the consuming app's Router must apply the `@properLinks`
|
|
15
|
+
* decorator from `ember-primitives/proper-links` so same-origin route links
|
|
16
|
+
* are routed through Ember instead of triggering a full-page navigation.
|
|
17
|
+
*/
|
|
9
18
|
class Link extends Component {
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
static {
|
|
20
|
+
g(this.prototype, "router", [service]);
|
|
21
|
+
}
|
|
22
|
+
#router = (i(this, "router"), void 0);
|
|
23
|
+
get href() {
|
|
24
|
+
if (this.args.href !== undefined) {
|
|
25
|
+
return this.args.href;
|
|
26
|
+
}
|
|
27
|
+
const {
|
|
28
|
+
route,
|
|
29
|
+
model,
|
|
30
|
+
models,
|
|
31
|
+
query
|
|
32
|
+
} = this.args;
|
|
33
|
+
if (route === undefined) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const options = query ? {
|
|
37
|
+
queryParams: query
|
|
38
|
+
} : undefined;
|
|
39
|
+
if (models) {
|
|
40
|
+
return options ? this.router.urlFor(route, ...models, options) : this.router.urlFor(route, ...models);
|
|
41
|
+
}
|
|
42
|
+
if (model !== undefined) {
|
|
43
|
+
return options ? this.router.urlFor(route, model, options) : this.router.urlFor(route, model);
|
|
44
|
+
}
|
|
45
|
+
return options ? this.router.urlFor(route, options) : this.router.urlFor(route);
|
|
12
46
|
}
|
|
13
47
|
static {
|
|
14
|
-
setComponentTemplate(precompileTemplate("\n
|
|
15
|
-
strictMode: true
|
|
16
|
-
scope: () => ({
|
|
17
|
-
LinkTo
|
|
18
|
-
})
|
|
48
|
+
setComponentTemplate(precompileTemplate("\n<a href={{this.href}} target={{if @external \"_blank\"}} rel={{if @external \"noopener noreferrer\"}} class=\"link_e4aeb20a2\" data-size={{@size}} data-weight={{@weight}} data-color={{@color}} data-block={{if @isBlock \"true\"}} data-variant={{@variant}} data-underline={{@underline}} ...attributes>\n {{yield}}\n</a>", {
|
|
49
|
+
strictMode: true
|
|
19
50
|
}), this);
|
|
20
51
|
}
|
|
21
52
|
}
|
package/dist/overlay/drawer.js
CHANGED
|
@@ -4,6 +4,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
4
4
|
import { on } from '@ember/modifier';
|
|
5
5
|
import { modifier } from 'ember-modifier';
|
|
6
6
|
import { hash } from '@ember/helper';
|
|
7
|
+
import { uniqueId } from 'ember-primitives/utils';
|
|
7
8
|
import Blanket from './blanket.js';
|
|
8
9
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
10
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -68,7 +69,6 @@ class DrawerClose extends Component {
|
|
|
68
69
|
// ============================================================================
|
|
69
70
|
// Main Component
|
|
70
71
|
// ============================================================================
|
|
71
|
-
let drawerIdCounter = 0;
|
|
72
72
|
class Drawer extends Component {
|
|
73
73
|
static {
|
|
74
74
|
g(this.prototype, "_isOpenInternal", [tracked], function () {
|
|
@@ -85,7 +85,7 @@ class Drawer extends Component {
|
|
|
85
85
|
previousVisible = undefined;
|
|
86
86
|
contentElement = null;
|
|
87
87
|
previousActiveElement = null;
|
|
88
|
-
titleId = `drawer-title-${
|
|
88
|
+
titleId = `drawer-title-${uniqueId()}`;
|
|
89
89
|
// ============================================================================
|
|
90
90
|
// Getters
|
|
91
91
|
// ============================================================================
|
package/dist/overlay/modal.js
CHANGED
|
@@ -4,6 +4,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
4
4
|
import { on } from '@ember/modifier';
|
|
5
5
|
import { modifier } from 'ember-modifier';
|
|
6
6
|
import { hash } from '@ember/helper';
|
|
7
|
+
import { uniqueId } from 'ember-primitives/utils';
|
|
7
8
|
import Blanket from './blanket.js';
|
|
8
9
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
10
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -68,7 +69,6 @@ class ModalClose extends Component {
|
|
|
68
69
|
// ============================================================================
|
|
69
70
|
// Main Component
|
|
70
71
|
// ============================================================================
|
|
71
|
-
let modalIdCounter = 0;
|
|
72
72
|
class Modal extends Component {
|
|
73
73
|
static {
|
|
74
74
|
g(this.prototype, "_isOpenInternal", [tracked], function () {
|
|
@@ -85,7 +85,7 @@ class Modal extends Component {
|
|
|
85
85
|
previousVisible = undefined;
|
|
86
86
|
contentElement = null;
|
|
87
87
|
previousActiveElement = null;
|
|
88
|
-
titleId = `modal-title-${
|
|
88
|
+
titleId = `modal-title-${uniqueId()}`;
|
|
89
89
|
// ============================================================================
|
|
90
90
|
// Getters
|
|
91
91
|
// ============================================================================
|
package/dist/overlay/popover.css
CHANGED
|
@@ -154,23 +154,43 @@
|
|
|
154
154
|
z-index: -1;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
/*
|
|
157
|
+
/*
|
|
158
|
+
* Cross-axis position comes from Floating UI via the --arrow-x / --arrow-y
|
|
159
|
+
* custom properties, which the positionPopoverArrow middleware sets after
|
|
160
|
+
* each computePosition. The main-axis offset (-5px) peeks the rotated 10×10
|
|
161
|
+
* square half-way out of the content edge; the negative borders below give
|
|
162
|
+
* the visible half its hairline edge.
|
|
163
|
+
*/
|
|
164
|
+
.popover-arrow_ee9248ac0[data-side="top"],
|
|
165
|
+
.popover-arrow_ee9248ac0[data-side="bottom"] {
|
|
166
|
+
left: var(--arrow-x);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.popover-arrow_ee9248ac0[data-side="left"],
|
|
170
|
+
.popover-arrow_ee9248ac0[data-side="right"] {
|
|
171
|
+
top: var(--arrow-y);
|
|
172
|
+
}
|
|
173
|
+
|
|
158
174
|
.popover-arrow_ee9248ac0[data-side="top"] {
|
|
175
|
+
bottom: -5px;
|
|
159
176
|
border-top: none;
|
|
160
177
|
border-left: none;
|
|
161
178
|
}
|
|
162
179
|
|
|
163
180
|
.popover-arrow_ee9248ac0[data-side="bottom"] {
|
|
181
|
+
top: -5px;
|
|
164
182
|
border-bottom: none;
|
|
165
183
|
border-right: none;
|
|
166
184
|
}
|
|
167
185
|
|
|
168
186
|
.popover-arrow_ee9248ac0[data-side="left"] {
|
|
187
|
+
right: -5px;
|
|
169
188
|
border-bottom: none;
|
|
170
189
|
border-left: none;
|
|
171
190
|
}
|
|
172
191
|
|
|
173
192
|
.popover-arrow_ee9248ac0[data-side="right"] {
|
|
193
|
+
left: -5px;
|
|
174
194
|
border-top: none;
|
|
175
195
|
border-right: none;
|
|
176
196
|
}
|
package/dist/overlay/popover.js
CHANGED
|
@@ -4,7 +4,9 @@ import { tracked } from '@glimmer/tracking';
|
|
|
4
4
|
import { on } from '@ember/modifier';
|
|
5
5
|
import { modifier } from 'ember-modifier';
|
|
6
6
|
import { hash } from '@ember/helper';
|
|
7
|
-
import {
|
|
7
|
+
import { arrow } from '@floating-ui/dom';
|
|
8
|
+
import { anchorTo } from 'ember-primitives/floating-ui';
|
|
9
|
+
import { uniqueId } from 'ember-primitives/utils';
|
|
8
10
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
11
|
import { setComponentTemplate } from '@ember/component';
|
|
10
12
|
import { g, i } from 'decorator-transforms/runtime';
|
|
@@ -18,9 +20,16 @@ class PopoverTrigger extends Component {
|
|
|
18
20
|
get ctx() {
|
|
19
21
|
return this.args.ctx;
|
|
20
22
|
}
|
|
23
|
+
// Captured once at construction. Popover.registerTrigger is a stable class
|
|
24
|
+
// field, so this reference never goes stale — reading it here instead of
|
|
25
|
+
// `this.ctx.registerTrigger` inside the modifier keeps the modifier body
|
|
26
|
+
// free of tracked reads. Without this, the tracked ctx getter on Popover
|
|
27
|
+
// would invalidate ctx on every triggerElement write, causing the modifier
|
|
28
|
+
// to re-run, call register again, and loop forever.
|
|
29
|
+
register = this.args.ctx.registerTrigger;
|
|
21
30
|
// Modifier to register this element with the parent
|
|
22
31
|
registerElement = modifier(element => {
|
|
23
|
-
this.
|
|
32
|
+
this.register(element);
|
|
24
33
|
return () => {
|
|
25
34
|
// Cleanup handled by parent
|
|
26
35
|
};
|
|
@@ -80,19 +89,20 @@ class PopoverTrigger extends Component {
|
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
91
|
class PopoverContent extends Component {
|
|
83
|
-
arrowElement = null;
|
|
84
|
-
registerArrow = modifier(element => {
|
|
85
|
-
this.arrowElement = element;
|
|
86
|
-
return () => {
|
|
87
|
-
this.arrowElement = null;
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
92
|
get destinationElement() {
|
|
91
93
|
return document.body;
|
|
92
94
|
}
|
|
93
95
|
get ctx() {
|
|
94
96
|
return this.args.ctx;
|
|
95
97
|
}
|
|
98
|
+
// Reference element for {{anchorTo}}. Falls back to document.body when no
|
|
99
|
+
// trigger has been registered — this preserves the legacy behaviour where
|
|
100
|
+
// consumers can yield popover.open/popover.close to custom buttons instead
|
|
101
|
+
// of wrapping one in popover.Trigger. In that case the popover still
|
|
102
|
+
// renders (it just isn't anchored anywhere meaningful).
|
|
103
|
+
get triggerElement() {
|
|
104
|
+
return this.ctx.triggerElement ?? document.body;
|
|
105
|
+
}
|
|
96
106
|
get side() {
|
|
97
107
|
return this.args.side ?? 'bottom';
|
|
98
108
|
}
|
|
@@ -142,63 +152,56 @@ class PopoverContent extends Component {
|
|
|
142
152
|
get dataState() {
|
|
143
153
|
return this.ctx.isOpen ? 'open' : 'closed';
|
|
144
154
|
}
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}).then(result => {
|
|
160
|
-
const {
|
|
161
|
-
x,
|
|
162
|
-
y,
|
|
163
|
-
middlewareData,
|
|
164
|
-
placement
|
|
165
|
-
} = result;
|
|
166
|
-
Object.assign(element.style, {
|
|
167
|
-
left: `${x}px`,
|
|
168
|
-
top: `${y}px`
|
|
169
|
-
});
|
|
170
|
-
// Position the arrow if present
|
|
171
|
-
if (named.arrowElement && middlewareData.arrow) {
|
|
172
|
-
const {
|
|
173
|
-
x: arrowX,
|
|
174
|
-
y: arrowY
|
|
175
|
-
} = middlewareData.arrow;
|
|
176
|
-
const side = placement.split('-')[0];
|
|
177
|
-
// Position arrow on the opposite side of the popover
|
|
178
|
-
const staticSide = {
|
|
179
|
-
top: 'bottom',
|
|
180
|
-
right: 'left',
|
|
181
|
-
bottom: 'top',
|
|
182
|
-
left: 'right'
|
|
183
|
-
}[side];
|
|
184
|
-
Object.assign(named.arrowElement.style, {
|
|
185
|
-
left: arrowX != null ? `${arrowX}px` : '',
|
|
186
|
-
top: arrowY != null ? `${arrowY}px` : '',
|
|
187
|
-
right: '',
|
|
188
|
-
bottom: '',
|
|
189
|
-
[staticSide]: '-5px'
|
|
190
|
-
});
|
|
191
|
-
// Update data-side attribute for correct border styling
|
|
192
|
-
named.arrowElement.setAttribute('data-side', side);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
155
|
+
// The arrow element is captured via {{this.registerArrow}} in the template.
|
|
156
|
+
// Tracked so the {{anchorTo}} modifier re-runs (with the arrow middleware
|
|
157
|
+
// now in play) as soon as the arrow mounts, instead of snapshotting a null
|
|
158
|
+
// ref at install time.
|
|
159
|
+
static {
|
|
160
|
+
g(this.prototype, "arrowElement", [tracked], function () {
|
|
161
|
+
return null;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
#arrowElement = (i(this, "arrowElement"), void 0);
|
|
165
|
+
registerArrow = modifier(element => {
|
|
166
|
+
this.arrowElement = element;
|
|
167
|
+
return () => {
|
|
168
|
+
this.arrowElement = null;
|
|
195
169
|
};
|
|
196
|
-
|
|
170
|
+
});
|
|
171
|
+
// Register the content element with the parent for click-outside detection.
|
|
172
|
+
// Positioning itself is handled by {{anchorTo}} from ember-primitives.
|
|
173
|
+
registerContentElement = modifier(element => {
|
|
174
|
+
this.ctx.registerContent(element);
|
|
197
175
|
return () => {
|
|
198
|
-
|
|
199
|
-
named.onRegister?.(null);
|
|
176
|
+
this.ctx.registerContent(null);
|
|
200
177
|
};
|
|
201
178
|
});
|
|
179
|
+
// Middleware chain applied via {{anchorTo}}'s @middleware arg. The arrow
|
|
180
|
+
// middleware lets Floating UI compute the cross-axis offset; we publish it
|
|
181
|
+
// as --arrow-x / --arrow-y custom properties on the arrow element so the
|
|
182
|
+
// CSS rules in popover.css can position and offset the arrow per side.
|
|
183
|
+
get middleware() {
|
|
184
|
+
const arrowEl = this.arrowElement;
|
|
185
|
+
if (!arrowEl) {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
return [arrow({
|
|
189
|
+
element: arrowEl
|
|
190
|
+
}), {
|
|
191
|
+
name: 'positionPopoverArrow',
|
|
192
|
+
fn: state => {
|
|
193
|
+
const arrowData = state.middlewareData['arrow'];
|
|
194
|
+
if (!arrowData) {
|
|
195
|
+
return {};
|
|
196
|
+
}
|
|
197
|
+
arrowEl.style.setProperty('--arrow-x', arrowData.x != null ? `${arrowData.x}px` : '');
|
|
198
|
+
arrowEl.style.setProperty('--arrow-y', arrowData.y != null ? `${arrowData.y}px` : '');
|
|
199
|
+
const side = state.placement.split('-')[0];
|
|
200
|
+
arrowEl.setAttribute('data-side', side);
|
|
201
|
+
return {};
|
|
202
|
+
}
|
|
203
|
+
}];
|
|
204
|
+
}
|
|
202
205
|
handleMouseEnter = () => {
|
|
203
206
|
if (this.ctx.triggerMode === 'hover') {
|
|
204
207
|
this.ctx.openPopover();
|
|
@@ -210,10 +213,11 @@ class PopoverContent extends Component {
|
|
|
210
213
|
}
|
|
211
214
|
};
|
|
212
215
|
static {
|
|
213
|
-
setComponentTemplate(precompileTemplate("{{#if this.ctx.isOpen}}\n {{#in-element this.destinationElement insertBefore=null}}\n <div id={{this.ctx.contentId}} class=\"popover-content_ee9248ac0\" role=\"dialog\" aria-label={{@aria-label}} aria-labelledby={{@aria-labelledby}} data-state={{this.dataState}} data-side={{this.side}} data-animation={{this.animation}} {{on \"mouseenter\" this.handleMouseEnter}} {{on \"mouseleave\" this.handleMouseLeave}} {{
|
|
216
|
+
setComponentTemplate(precompileTemplate("{{#if this.ctx.isOpen}}\n {{#in-element this.destinationElement insertBefore=null}}\n <div id={{this.ctx.contentId}} class=\"popover-content_ee9248ac0\" role=\"dialog\" aria-label={{@aria-label}} aria-labelledby={{@aria-labelledby}} data-state={{this.dataState}} data-side={{this.side}} data-animation={{this.animation}} {{on \"mouseenter\" this.handleMouseEnter}} {{on \"mouseleave\" this.handleMouseLeave}} {{anchorTo this.triggerElement strategy=\"absolute\" placement=this.placement offsetOptions=this.offsetOptions flipOptions=this.flipOptions shiftOptions=this.shiftOptions middleware=this.middleware}} {{this.registerContentElement}} data-test-popover-content ...attributes>\n {{yield}}\n {{#if this.showArrow}}\n <div class=\"popover-arrow_ee9248ac0\" data-side={{this.side}} {{this.registerArrow}} data-test-popover-arrow></div>\n {{/if}}\n </div>\n {{/in-element}}\n{{/if}}", {
|
|
214
217
|
strictMode: true,
|
|
215
218
|
scope: () => ({
|
|
216
|
-
on
|
|
219
|
+
on,
|
|
220
|
+
anchorTo
|
|
217
221
|
})
|
|
218
222
|
}), this);
|
|
219
223
|
}
|
|
@@ -238,8 +242,6 @@ class PopoverClose extends Component {
|
|
|
238
242
|
// ============================================================================
|
|
239
243
|
// Main Component
|
|
240
244
|
// ============================================================================
|
|
241
|
-
// Unique ID counter for generating content IDs
|
|
242
|
-
let popoverIdCounter = 0;
|
|
243
245
|
class Popover extends Component {
|
|
244
246
|
static {
|
|
245
247
|
g(this.prototype, "_isOpenInternal", [tracked], function () {
|
|
@@ -247,10 +249,15 @@ class Popover extends Component {
|
|
|
247
249
|
});
|
|
248
250
|
}
|
|
249
251
|
#_isOpenInternal = (i(this, "_isOpenInternal"), void 0);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
static {
|
|
253
|
+
g(this.prototype, "triggerElement", [tracked], function () {
|
|
254
|
+
return null;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
#triggerElement = (i(this, "triggerElement"), void 0); // Tracked so that the content block only renders once the trigger has been
|
|
258
|
+
// registered — {{anchorTo}} asserts that its reference element is non-null.
|
|
252
259
|
// Unique ID for linking trigger to content via aria-controls
|
|
253
|
-
contentId = `popover-content-${
|
|
260
|
+
contentId = `popover-content-${uniqueId()}`;
|
|
254
261
|
// Element references for click outside detection
|
|
255
262
|
rootElement = null;
|
|
256
263
|
contentElement = null;
|
|
@@ -268,7 +275,18 @@ class Popover extends Component {
|
|
|
268
275
|
};
|
|
269
276
|
});
|
|
270
277
|
registerTrigger = element => {
|
|
271
|
-
|
|
278
|
+
// Defer the tracked write to a microtask so it lands in a separate
|
|
279
|
+
// computation from the template render that reads this.triggerElement
|
|
280
|
+
// (via the context getter). Writing during the same render trips
|
|
281
|
+
// Glimmer's "updated after being used in the same computation" error.
|
|
282
|
+
// The equality guard keeps redundant writes from invalidating ctx on
|
|
283
|
+
// re-renders that pass the same element back through.
|
|
284
|
+
void Promise.resolve().then(() => {
|
|
285
|
+
if (this.triggerElement === element) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
this.triggerElement = element;
|
|
289
|
+
});
|
|
272
290
|
};
|
|
273
291
|
get isOpenInternal() {
|
|
274
292
|
if (this._isOpenInternal === undefined) {
|
package/dist/overlay/tooltip.css
CHANGED
|
@@ -108,26 +108,47 @@
|
|
|
108
108
|
border-style: solid;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/*
|
|
112
|
+
* Cross-axis position comes from Floating UI via the --arrow-x / --arrow-y
|
|
113
|
+
* custom properties, which the positionTooltipArrow middleware sets after
|
|
114
|
+
* each computePosition. The main-axis offset (-6px) tucks the 0×0 box up
|
|
115
|
+
* against the content edge so its 6px borders form a triangle that meets
|
|
116
|
+
* the trigger flush.
|
|
117
|
+
*/
|
|
118
|
+
.tooltip-arrow_e1d3ad271[data-side="top"],
|
|
119
|
+
.tooltip-arrow_e1d3ad271[data-side="bottom"] {
|
|
120
|
+
left: var(--arrow-x);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tooltip-arrow_e1d3ad271[data-side="left"],
|
|
124
|
+
.tooltip-arrow_e1d3ad271[data-side="right"] {
|
|
125
|
+
top: var(--arrow-y);
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
/* Arrow pointing down (tooltip on top) */
|
|
112
129
|
.tooltip-arrow_e1d3ad271[data-side="top"] {
|
|
130
|
+
bottom: -6px;
|
|
113
131
|
border-width: 6px 6px 0 6px;
|
|
114
132
|
border-color: var(--gray-900, #161a2e) transparent transparent transparent;
|
|
115
133
|
}
|
|
116
134
|
|
|
117
135
|
/* Arrow pointing up (tooltip on bottom) */
|
|
118
136
|
.tooltip-arrow_e1d3ad271[data-side="bottom"] {
|
|
137
|
+
top: -6px;
|
|
119
138
|
border-width: 0 6px 6px 6px;
|
|
120
139
|
border-color: transparent transparent var(--gray-900, #161a2e) transparent;
|
|
121
140
|
}
|
|
122
141
|
|
|
123
142
|
/* Arrow pointing right (tooltip on left) */
|
|
124
143
|
.tooltip-arrow_e1d3ad271[data-side="left"] {
|
|
144
|
+
right: -6px;
|
|
125
145
|
border-width: 6px 0 6px 6px;
|
|
126
146
|
border-color: transparent transparent transparent var(--gray-900, #161a2e);
|
|
127
147
|
}
|
|
128
148
|
|
|
129
149
|
/* Arrow pointing left (tooltip on right) */
|
|
130
150
|
.tooltip-arrow_e1d3ad271[data-side="right"] {
|
|
151
|
+
left: -6px;
|
|
131
152
|
border-width: 6px 6px 6px 0;
|
|
132
153
|
border-color: transparent var(--gray-900, #161a2e) transparent transparent;
|
|
133
154
|
}
|
package/dist/overlay/tooltip.js
CHANGED
|
@@ -3,7 +3,9 @@ import Component from '@glimmer/component';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { on } from '@ember/modifier';
|
|
5
5
|
import { modifier } from 'ember-modifier';
|
|
6
|
-
import {
|
|
6
|
+
import { arrow } from '@floating-ui/dom';
|
|
7
|
+
import { anchorTo } from 'ember-primitives/floating-ui';
|
|
8
|
+
import { uniqueId } from 'ember-primitives/utils';
|
|
7
9
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
8
10
|
import { setComponentTemplate } from '@ember/component';
|
|
9
11
|
import { g, i } from 'decorator-transforms/runtime';
|
|
@@ -57,8 +59,6 @@ class TooltipProvider extends Component {
|
|
|
57
59
|
// Tooltip Component
|
|
58
60
|
// ============================================================================
|
|
59
61
|
|
|
60
|
-
// Unique ID counter for generating content IDs
|
|
61
|
-
let tooltipIdCounter = 0;
|
|
62
62
|
/**
|
|
63
63
|
* Tooltip displays brief contextual information on hover or focus.
|
|
64
64
|
* Uses dark styling optimized for short text.
|
|
@@ -76,9 +76,15 @@ class Tooltip extends Component {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
#actualSide = (i(this, "actualSide"), void 0);
|
|
79
|
-
|
|
79
|
+
static {
|
|
80
|
+
g(this.prototype, "triggerElement", [tracked], function () {
|
|
81
|
+
return null;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
#triggerElement = (i(this, "triggerElement"), void 0); // Tracked so the content block defers rendering until the trigger has
|
|
85
|
+
// mounted — {{anchorTo}} asserts a non-null reference element.
|
|
80
86
|
contentElement = null;
|
|
81
|
-
contentId = `tooltip-content-${
|
|
87
|
+
contentId = `tooltip-content-${uniqueId()}`;
|
|
82
88
|
openTimeout = null;
|
|
83
89
|
closeTimeout = null;
|
|
84
90
|
// ============================================================================
|
|
@@ -159,6 +165,79 @@ class Tooltip extends Component {
|
|
|
159
165
|
padding: 8
|
|
160
166
|
};
|
|
161
167
|
}
|
|
168
|
+
// Narrows the nullable triggerElement field so {{anchorTo}} can accept it.
|
|
169
|
+
//
|
|
170
|
+
// Invariant: Tooltip's trigger and content sit in the same template (the
|
|
171
|
+
// trigger span is always rendered before the {{#if this.isOpen}} block),
|
|
172
|
+
// so the registerTrigger modifier installs and sets triggerElement before
|
|
173
|
+
// the content block is ever entered. Combined with the @tracked field
|
|
174
|
+
// re-render, this getter is only invoked when triggerElement is non-null.
|
|
175
|
+
// Unlike Popover, consumers can't bypass tooltip.Trigger, so we don't
|
|
176
|
+
// need a document.body fallback here.
|
|
177
|
+
get triggerAnchor() {
|
|
178
|
+
// Non-null assertion is justified by the invariant above.
|
|
179
|
+
return this.triggerElement;
|
|
180
|
+
}
|
|
181
|
+
// The arrow element is captured via {{this.registerArrow}} in the template.
|
|
182
|
+
// Tracked so the {{anchorTo}} modifier re-runs (with the arrow middleware
|
|
183
|
+
// now in play) as soon as the arrow mounts, instead of snapshotting a
|
|
184
|
+
// null ref at install time.
|
|
185
|
+
static {
|
|
186
|
+
g(this.prototype, "arrowElement", [tracked], function () {
|
|
187
|
+
return null;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
#arrowElement = (i(this, "arrowElement"), void 0);
|
|
191
|
+
registerArrow = modifier(element => {
|
|
192
|
+
this.arrowElement = element;
|
|
193
|
+
return () => {
|
|
194
|
+
this.arrowElement = null;
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
// Middleware chain applied via {{anchorTo}}'s @middleware arg. The arrow
|
|
198
|
+
// middleware lets Floating UI compute the cross-axis offset; we publish it
|
|
199
|
+
// as --arrow-x / --arrow-y custom properties on the arrow element so the
|
|
200
|
+
// CSS rules in tooltip.css can position and offset the arrow per side.
|
|
201
|
+
// The trackActualSide middleware (below) keeps the content's data-side
|
|
202
|
+
// styling reactive after a collision flip.
|
|
203
|
+
get middleware() {
|
|
204
|
+
const chain = [];
|
|
205
|
+
const arrowEl = this.arrowElement;
|
|
206
|
+
if (arrowEl) {
|
|
207
|
+
chain.push(arrow({
|
|
208
|
+
element: arrowEl
|
|
209
|
+
}), {
|
|
210
|
+
name: 'positionTooltipArrow',
|
|
211
|
+
fn: state => {
|
|
212
|
+
const arrowData = state.middlewareData['arrow'];
|
|
213
|
+
if (!arrowData) {
|
|
214
|
+
return {};
|
|
215
|
+
}
|
|
216
|
+
arrowEl.style.setProperty('--arrow-x', arrowData.x != null ? `${arrowData.x}px` : '');
|
|
217
|
+
arrowEl.style.setProperty('--arrow-y', arrowData.y != null ? `${arrowData.y}px` : '');
|
|
218
|
+
const side = state.placement.split('-')[0];
|
|
219
|
+
arrowEl.setAttribute('data-side', side);
|
|
220
|
+
return {};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
// Tracks the resolved side for reactive data-side styling on the content
|
|
225
|
+
// element. The mutation happens inside the middleware's async `fn`
|
|
226
|
+
// callback (invoked by Floating UI during computePosition), not during
|
|
227
|
+
// getter evaluation — hence the targeted disable.
|
|
228
|
+
chain.push({
|
|
229
|
+
name: 'trackActualSide',
|
|
230
|
+
fn: state => {
|
|
231
|
+
const side = state.placement.split('-')[0];
|
|
232
|
+
if (this.actualSide !== side) {
|
|
233
|
+
// eslint-disable-next-line ember/no-side-effects
|
|
234
|
+
this.actualSide = side;
|
|
235
|
+
}
|
|
236
|
+
return {};
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return chain;
|
|
240
|
+
}
|
|
162
241
|
// ============================================================================
|
|
163
242
|
// State Management
|
|
164
243
|
// ============================================================================
|
|
@@ -239,69 +318,12 @@ class Tooltip extends Component {
|
|
|
239
318
|
this.triggerElement = null;
|
|
240
319
|
};
|
|
241
320
|
});
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
321
|
+
// Tracks the rendered content element so focus-out can detect when focus
|
|
322
|
+
// moves between trigger and content. Positioning itself is handled by
|
|
323
|
+
// {{anchorTo}} from ember-primitives.
|
|
324
|
+
registerContentElement = modifier(element => {
|
|
246
325
|
this.contentElement = element;
|
|
247
|
-
const updatePosition = () => {
|
|
248
|
-
// Query for the arrow element fresh each time to avoid stale references
|
|
249
|
-
const arrowEl = element.querySelector('.tooltip-arrow');
|
|
250
|
-
const middleware = [offset(named.offsetOptions), flip(named.flipOptions), shift(named.shiftOptions), ...(arrowEl ? [arrow({
|
|
251
|
-
element: arrowEl
|
|
252
|
-
})] : [])];
|
|
253
|
-
void computePosition(named.trigger, element, {
|
|
254
|
-
placement: named.placement,
|
|
255
|
-
middleware
|
|
256
|
-
}).then(result => {
|
|
257
|
-
const {
|
|
258
|
-
x,
|
|
259
|
-
y,
|
|
260
|
-
middlewareData,
|
|
261
|
-
placement
|
|
262
|
-
} = result;
|
|
263
|
-
Object.assign(element.style, {
|
|
264
|
-
left: `${x}px`,
|
|
265
|
-
top: `${y}px`
|
|
266
|
-
});
|
|
267
|
-
// Update actual side for styling
|
|
268
|
-
const side = placement.split('-')[0];
|
|
269
|
-
this.actualSide = side;
|
|
270
|
-
element.setAttribute('data-side', side);
|
|
271
|
-
// Position the arrow if present
|
|
272
|
-
if (arrowEl && middlewareData.arrow) {
|
|
273
|
-
const {
|
|
274
|
-
x: arrowX,
|
|
275
|
-
y: arrowY
|
|
276
|
-
} = middlewareData.arrow;
|
|
277
|
-
// Position arrow on the opposite side of the tooltip
|
|
278
|
-
const staticSide = {
|
|
279
|
-
top: 'bottom',
|
|
280
|
-
right: 'left',
|
|
281
|
-
bottom: 'top',
|
|
282
|
-
left: 'right'
|
|
283
|
-
}[side];
|
|
284
|
-
// Reset all position styles first, then set the new ones
|
|
285
|
-
// This prevents stale styles from previous positions
|
|
286
|
-
Object.assign(arrowEl.style, {
|
|
287
|
-
left: '',
|
|
288
|
-
top: '',
|
|
289
|
-
right: '',
|
|
290
|
-
bottom: ''
|
|
291
|
-
});
|
|
292
|
-
// Now apply the new position
|
|
293
|
-
Object.assign(arrowEl.style, {
|
|
294
|
-
left: arrowX != null ? `${arrowX}px` : '',
|
|
295
|
-
top: arrowY != null ? `${arrowY}px` : '',
|
|
296
|
-
[staticSide]: '-6px'
|
|
297
|
-
});
|
|
298
|
-
arrowEl.setAttribute('data-side', side);
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
const cleanup = autoUpdate(named.trigger, element, updatePosition);
|
|
303
326
|
return () => {
|
|
304
|
-
cleanup();
|
|
305
327
|
this.contentElement = null;
|
|
306
328
|
};
|
|
307
329
|
});
|
|
@@ -355,10 +377,11 @@ class Tooltip extends Component {
|
|
|
355
377
|
return this.isOpen ? this.contentId : undefined;
|
|
356
378
|
}
|
|
357
379
|
static {
|
|
358
|
-
setComponentTemplate(precompileTemplate("<span class=\"tooltip_e1d3ad271\" {{this.setupEventListeners}} data-test-tooltip ...attributes>\n <span class=\"tooltip-trigger_e1d3ad271\" aria-describedby={{this.ariaDescribedBy}} {{on \"mouseenter\" this.handleMouseEnter}} {{on \"mouseleave\" this.handleMouseLeave}} {{on \"focusin\" this.handleFocusIn}} {{on \"focusout\" this.handleFocusOut}} {{this.registerTrigger}} data-test-tooltip-trigger>\n {{yield}}\n </span>\n\n {{#if this.isOpen}}\n {{#in-element this.destinationElement insertBefore=null}}\n <div id={{this.contentId}} class=\"tooltip-content_e1d3ad271\" role=\"tooltip\" aria-label={{@aria-label}} data-side={{this.actualSide}} data-variant={{this.variant}} {{on \"mouseenter\" this.handleContentMouseEnter}} {{on \"mouseleave\" this.handleContentMouseLeave}} {{
|
|
380
|
+
setComponentTemplate(precompileTemplate("<span class=\"tooltip_e1d3ad271\" {{this.setupEventListeners}} data-test-tooltip ...attributes>\n <span class=\"tooltip-trigger_e1d3ad271\" aria-describedby={{this.ariaDescribedBy}} {{on \"mouseenter\" this.handleMouseEnter}} {{on \"mouseleave\" this.handleMouseLeave}} {{on \"focusin\" this.handleFocusIn}} {{on \"focusout\" this.handleFocusOut}} {{this.registerTrigger}} data-test-tooltip-trigger>\n {{yield}}\n </span>\n\n {{#if this.isOpen}}\n {{#in-element this.destinationElement insertBefore=null}}\n <div id={{this.contentId}} class=\"tooltip-content_e1d3ad271\" role=\"tooltip\" aria-label={{@aria-label}} data-side={{this.actualSide}} data-variant={{this.variant}} {{on \"mouseenter\" this.handleContentMouseEnter}} {{on \"mouseleave\" this.handleContentMouseLeave}} {{anchorTo this.triggerAnchor strategy=\"absolute\" placement=this.placement offsetOptions=this.offsetOptions flipOptions=this.flipOptions shiftOptions=this.shiftOptions middleware=this.middleware}} {{this.registerContentElement}} data-test-tooltip-content>\n {{#if (has-block \"content\")}}\n {{yield to=\"content\"}}\n {{else}}\n {{@content}}\n {{/if}}\n {{#if this.showArrow}}\n <div class=\"tooltip-arrow_e1d3ad271\" {{this.registerArrow}} data-test-tooltip-arrow></div>\n {{/if}}\n </div>\n {{/in-element}}\n {{/if}}\n</span>", {
|
|
359
381
|
strictMode: true,
|
|
360
382
|
scope: () => ({
|
|
361
|
-
on
|
|
383
|
+
on,
|
|
384
|
+
anchorTo
|
|
362
385
|
})
|
|
363
386
|
}), this);
|
|
364
387
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visitwonders/assembly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The default blueprint for Embroider v2 addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"decorator-transforms": "^2.2.2",
|
|
100
100
|
"ember-element-helper": "^0.8.6",
|
|
101
101
|
"ember-modifier": "^4.1.0",
|
|
102
|
+
"ember-primitives": "^0.55.1",
|
|
102
103
|
"ember-scoped-css": "^2.0.4",
|
|
103
104
|
"flagpack-core": "^2.1.0"
|
|
104
105
|
},
|