@limetech/lime-elements 39.16.4 → 39.17.1

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 (36) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-form.cjs.entry.js +128 -1
  4. package/dist/cjs/{limel-portal_3.cjs.entry.js → limel-hotkey_4.cjs.entry.js} +148 -13
  5. package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/form/fields/array-field.js +97 -1
  8. package/dist/collection/components/form/fields/field-helpers.js +15 -0
  9. package/dist/collection/components/form/fields/schema-field.js +19 -2
  10. package/dist/collection/components/form/form.test-schemas.js +118 -0
  11. package/dist/collection/components/icon-button/icon-button.js +1 -1
  12. package/dist/collection/components/tooltip/tooltip-content.css +21 -16
  13. package/dist/collection/components/tooltip/tooltip-content.js +40 -9
  14. package/dist/collection/components/tooltip/tooltip.js +26 -17
  15. package/dist/esm/lime-elements.js +1 -1
  16. package/dist/esm/limel-form.entry.js +128 -1
  17. package/dist/esm/{limel-portal_3.entry.js → limel-hotkey_4.entry.js} +149 -15
  18. package/dist/esm/limel-icon-button.entry.js +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/lime-elements/lime-elements.esm.js +1 -1
  21. package/dist/lime-elements/p-6b956d6d.entry.js +1 -0
  22. package/dist/lime-elements/p-cba72cd6.entry.js +1 -0
  23. package/dist/lime-elements/{p-1cb2d781.entry.js → p-e60ffc0a.entry.js} +4 -4
  24. package/dist/types/components/form/fields/array-field.d.ts +20 -0
  25. package/dist/types/components/form/fields/field-helpers.d.ts +10 -0
  26. package/dist/types/components/form/fields/schema-field.d.ts +10 -0
  27. package/dist/types/components/form/form.test-schemas.d.ts +4 -0
  28. package/dist/types/components/tooltip/tooltip-content.d.ts +7 -1
  29. package/dist/types/components/tooltip/tooltip.d.ts +9 -15
  30. package/dist/types/components.d.ts +28 -42
  31. package/package.json +1 -1
  32. package/dist/cjs/limel-hotkey.cjs.entry.js +0 -128
  33. package/dist/esm/limel-hotkey.entry.js +0 -126
  34. package/dist/lime-elements/p-173def13.entry.js +0 -1
  35. package/dist/lime-elements/p-7acd89d5.entry.js +0 -1
  36. package/dist/lime-elements/p-bd81d7bb.entry.js +0 -1
@@ -38,6 +38,26 @@ export declare class ArrayField extends React.Component<FieldProps> {
38
38
  private setWrapper;
39
39
  private handleReorder;
40
40
  private handleChange;
41
+ /**
42
+ * RJSF v6's built-in ArrayField shares one onChange handler across all
43
+ * descendants, so changes to leaves deep inside an array item bubble
44
+ * through here with the leaf value (not the full array) and a path that
45
+ * is deeper than this field's own path.
46
+ * @param path
47
+ */
48
+ private isDeepLeafChange;
49
+ /**
50
+ * Rebuild the affected item locally so we can (a) restore `undefined`
51
+ * when the leaf schema does not allow `null` — the built-in handler
52
+ * coerces `undefined` to `null`, which breaks field clearing for custom
53
+ * components — and (b) still run `resetDependentFields` at the item
54
+ * level so sibling fields that became obsolete for the new data are
55
+ * cleared.
56
+ * @param newData
57
+ * @param path
58
+ */
59
+ private handleDeepLeafChange;
60
+ private buildResetItem;
41
61
  render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
42
62
  }
43
63
  //# sourceMappingURL=array-field.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { JSONSchema7 } from 'json-schema';
1
2
  import { FormSchema } from '../form.types';
2
3
  /**
3
4
  * Given the data for the current SchemaField, detect if the changed data
@@ -18,4 +19,13 @@ export declare const resetDependentFields: (oldData: any, newData: any, schema:
18
19
  * @returns true if the schema is for a custom object
19
20
  */
20
21
  export declare function isCustomObjectSchema(schema: FormSchema): boolean;
22
+ /**
23
+ * Check whether a schema permits `null` as a valid value. Used to decide
24
+ * whether a cleared field value should be preserved as `null` or converted
25
+ * to `undefined` so the property can be removed from the form data.
26
+ *
27
+ * @param schema - the schema to check
28
+ * @returns true if the schema's type is `'null'` or includes `'null'`
29
+ */
30
+ export declare const schemaAllowsNull: (schema: JSONSchema7 | undefined) => boolean;
21
31
  //# sourceMappingURL=field-helpers.d.ts.map
@@ -21,6 +21,16 @@ export declare class SchemaField extends React.Component<FieldProps> {
21
21
  private getHelperText;
22
22
  private handleCustomComponentChange;
23
23
  private handleChange;
24
+ /**
25
+ * RJSF v6's built-in ArrayField shares one onChange handler across all
26
+ * descendants, so changes to leaves deep inside an array item bubble
27
+ * through this SchemaField with a path that is deeper than its own.
28
+ * The enclosing ArrayField rebuilds the affected item and runs
29
+ * `resetDependentFields` at the item level (see array-field.ts), so we
30
+ * must pass the partial leaf data through untouched here.
31
+ * @param path
32
+ */
33
+ private isDeepLeafChange;
24
34
  private buildCustomComponentProps;
25
35
  private renderCustomComponent;
26
36
  render(): React.FunctionComponentElement<any> | React.ReactElement<FieldProps<any, import("@rjsf/utils").RJSFSchema, any>, string | React.JSXElementConstructor<any>>;
@@ -27,4 +27,8 @@ export declare const arrayItemControlsSchema: FormSchema;
27
27
  export declare const rowLayoutSchema: FormSchema;
28
28
  export declare const rowLayoutWithCustomComponentSchema: FormSchema;
29
29
  export declare const nestedArrayObjectSchema: FormSchema;
30
+ export declare const topLevelStringCustomComponentSchema: FormSchema;
31
+ export declare const arrayItemWithDependenciesSchema: FormSchema;
32
+ export declare const arrayItemWithDependenciesAndCustomConfigSchema: FormSchema;
33
+ export declare const nestedStringCustomComponentSchema: FormSchema;
30
34
  //# sourceMappingURL=form.test-schemas.d.ts.map
@@ -16,6 +16,12 @@ export declare class TooltipContent {
16
16
  * Read more in tooltip.tsx
17
17
  */
18
18
  maxlength?: number;
19
- render(): any[];
19
+ /**
20
+ * Read more in tooltip.tsx
21
+ */
22
+ hotkey?: string;
23
+ render(): any;
24
+ private renderHelperLabel;
25
+ private renderHotkey;
20
26
  }
21
27
  //# sourceMappingURL=tooltip-content.d.ts.map
@@ -14,18 +14,6 @@ import { OpenDirection } from '../menu/menu.types';
14
14
  * itself is interactive, it will remain interactible even with a tooltip bound
15
15
  * to it.
16
16
  *
17
- * :::note
18
- * In order to display the tooltip, the tooltip element and its trigger element
19
- * must be within the same document or document fragment (the same shadowRoot).
20
- * Often, it's easiest to just place them next to each other like in the example
21
- * below, but if you need to, you can place them differently.
22
- *
23
- * ```html
24
- * <limel-button icon="search" id="tooltip-example" />
25
- * <limel-tooltip label="Search" elementId="tooltip-example" />
26
- * ```
27
- * :::
28
- *
29
17
  * ## Usage
30
18
  * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.
31
19
  * Use them only when they add significant value.
@@ -42,6 +30,8 @@ import { OpenDirection } from '../menu/menu.types';
42
30
  *
43
31
  * @exampleComponent limel-example-tooltip-basic
44
32
  * @exampleComponent limel-example-tooltip-max-character
33
+ * @exampleComponent limel-example-tooltip-hotkey
34
+ * @exampleComponent limel-example-tooltip-accessibility
45
35
  * @exampleComponent limel-example-tooltip-composite
46
36
  */
47
37
  export declare class Tooltip {
@@ -57,10 +47,14 @@ export declare class Tooltip {
57
47
  label: string;
58
48
  /**
59
49
  * Additional helper text for the element.
60
- * Example usage can be a keyboard shortcut to activate the function of the
61
- * owner element.
62
50
  */
63
51
  helperLabel?: string;
52
+ /**
53
+ * Keyboard shortcut to visualize inside the tooltip, e.g. `"ctrl+f"`.
54
+ * Display-only: the tooltip does not listen for the keystroke.
55
+ * Catching the hotkey is the consumer's responsibility.
56
+ */
57
+ hotkey?: string;
64
58
  /**
65
59
  * The maximum amount of characters before rendering 'label' and
66
60
  * 'helperLabel' in two rows.
@@ -80,7 +74,7 @@ export declare class Tooltip {
80
74
  connectedCallback(): void;
81
75
  disconnectedCallback(): void;
82
76
  render(): JSX.Element;
83
- private setOwnerAriaLabel;
77
+ private setOwnerAriaDescribedby;
84
78
  private addListeners;
85
79
  private removeListeners;
86
80
  private showTooltip;
@@ -3844,16 +3844,6 @@ export namespace Components {
3844
3844
  * Therefore, users cannot interact with the tip, but if the trigger element
3845
3845
  * itself is interactive, it will remain interactible even with a tooltip bound
3846
3846
  * to it.
3847
- * :::note
3848
- * In order to display the tooltip, the tooltip element and its trigger element
3849
- * must be within the same document or document fragment (the same shadowRoot).
3850
- * Often, it's easiest to just place them next to each other like in the example
3851
- * below, but if you need to, you can place them differently.
3852
- * ```html
3853
- * <limel-button icon="search" id="tooltip-example" />
3854
- * <limel-tooltip label="Search" elementId="tooltip-example" />
3855
- * ```
3856
- * :::
3857
3847
  * ## Usage
3858
3848
  * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.
3859
3849
  * Use them only when they add significant value.
@@ -3869,6 +3859,8 @@ export namespace Components {
3869
3859
  * effortlessly recognize can be hovered.
3870
3860
  * @exampleComponent limel-example-tooltip-basic
3871
3861
  * @exampleComponent limel-example-tooltip-max-character
3862
+ * @exampleComponent limel-example-tooltip-hotkey
3863
+ * @exampleComponent limel-example-tooltip-accessibility
3872
3864
  * @exampleComponent limel-example-tooltip-composite
3873
3865
  */
3874
3866
  interface LimelTooltip {
@@ -3877,9 +3869,13 @@ export namespace Components {
3877
3869
  */
3878
3870
  "elementId": string;
3879
3871
  /**
3880
- * Additional helper text for the element. Example usage can be a keyboard shortcut to activate the function of the owner element.
3872
+ * Additional helper text for the element.
3881
3873
  */
3882
3874
  "helperLabel"?: string;
3875
+ /**
3876
+ * Keyboard shortcut to visualize inside the tooltip, e.g. `"ctrl+f"`. Display-only: the tooltip does not listen for the keystroke. Catching the hotkey is the consumer's responsibility.
3877
+ */
3878
+ "hotkey"?: string;
3883
3879
  /**
3884
3880
  * Short descriptive text of the owner element.
3885
3881
  */
@@ -3904,6 +3900,10 @@ export namespace Components {
3904
3900
  * Read more in tooltip.tsx
3905
3901
  */
3906
3902
  "helperLabel"?: string;
3903
+ /**
3904
+ * Read more in tooltip.tsx
3905
+ */
3906
+ "hotkey"?: string;
3907
3907
  /**
3908
3908
  * Read more in tooltip.tsx
3909
3909
  */
@@ -6370,16 +6370,6 @@ declare global {
6370
6370
  * Therefore, users cannot interact with the tip, but if the trigger element
6371
6371
  * itself is interactive, it will remain interactible even with a tooltip bound
6372
6372
  * to it.
6373
- * :::note
6374
- * In order to display the tooltip, the tooltip element and its trigger element
6375
- * must be within the same document or document fragment (the same shadowRoot).
6376
- * Often, it's easiest to just place them next to each other like in the example
6377
- * below, but if you need to, you can place them differently.
6378
- * ```html
6379
- * <limel-button icon="search" id="tooltip-example" />
6380
- * <limel-tooltip label="Search" elementId="tooltip-example" />
6381
- * ```
6382
- * :::
6383
6373
  * ## Usage
6384
6374
  * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.
6385
6375
  * Use them only when they add significant value.
@@ -6395,6 +6385,8 @@ declare global {
6395
6385
  * effortlessly recognize can be hovered.
6396
6386
  * @exampleComponent limel-example-tooltip-basic
6397
6387
  * @exampleComponent limel-example-tooltip-max-character
6388
+ * @exampleComponent limel-example-tooltip-hotkey
6389
+ * @exampleComponent limel-example-tooltip-accessibility
6398
6390
  * @exampleComponent limel-example-tooltip-composite
6399
6391
  */
6400
6392
  interface HTMLLimelTooltipElement extends Components.LimelTooltip, HTMLStencilElement {
@@ -10579,16 +10571,6 @@ declare namespace LocalJSX {
10579
10571
  * Therefore, users cannot interact with the tip, but if the trigger element
10580
10572
  * itself is interactive, it will remain interactible even with a tooltip bound
10581
10573
  * to it.
10582
- * :::note
10583
- * In order to display the tooltip, the tooltip element and its trigger element
10584
- * must be within the same document or document fragment (the same shadowRoot).
10585
- * Often, it's easiest to just place them next to each other like in the example
10586
- * below, but if you need to, you can place them differently.
10587
- * ```html
10588
- * <limel-button icon="search" id="tooltip-example" />
10589
- * <limel-tooltip label="Search" elementId="tooltip-example" />
10590
- * ```
10591
- * :::
10592
10574
  * ## Usage
10593
10575
  * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.
10594
10576
  * Use them only when they add significant value.
@@ -10604,6 +10586,8 @@ declare namespace LocalJSX {
10604
10586
  * effortlessly recognize can be hovered.
10605
10587
  * @exampleComponent limel-example-tooltip-basic
10606
10588
  * @exampleComponent limel-example-tooltip-max-character
10589
+ * @exampleComponent limel-example-tooltip-hotkey
10590
+ * @exampleComponent limel-example-tooltip-accessibility
10607
10591
  * @exampleComponent limel-example-tooltip-composite
10608
10592
  */
10609
10593
  interface LimelTooltip {
@@ -10612,9 +10596,13 @@ declare namespace LocalJSX {
10612
10596
  */
10613
10597
  "elementId": string;
10614
10598
  /**
10615
- * Additional helper text for the element. Example usage can be a keyboard shortcut to activate the function of the owner element.
10599
+ * Additional helper text for the element.
10616
10600
  */
10617
10601
  "helperLabel"?: string;
10602
+ /**
10603
+ * Keyboard shortcut to visualize inside the tooltip, e.g. `"ctrl+f"`. Display-only: the tooltip does not listen for the keystroke. Catching the hotkey is the consumer's responsibility.
10604
+ */
10605
+ "hotkey"?: string;
10618
10606
  /**
10619
10607
  * Short descriptive text of the owner element.
10620
10608
  */
@@ -10639,6 +10627,10 @@ declare namespace LocalJSX {
10639
10627
  * Read more in tooltip.tsx
10640
10628
  */
10641
10629
  "helperLabel"?: string;
10630
+ /**
10631
+ * Read more in tooltip.tsx
10632
+ */
10633
+ "hotkey"?: string;
10642
10634
  /**
10643
10635
  * Read more in tooltip.tsx
10644
10636
  */
@@ -11226,6 +11218,7 @@ declare namespace LocalJSX {
11226
11218
  "elementId": string;
11227
11219
  "label": string;
11228
11220
  "helperLabel": string;
11221
+ "hotkey": string;
11229
11222
  "maxlength": number;
11230
11223
  "openDirection": OpenDirection;
11231
11224
  }
@@ -11233,6 +11226,7 @@ declare namespace LocalJSX {
11233
11226
  "label": string;
11234
11227
  "helperLabel": string;
11235
11228
  "maxlength": number;
11229
+ "hotkey": string;
11236
11230
  }
11237
11231
 
11238
11232
  interface IntrinsicElements {
@@ -12635,16 +12629,6 @@ declare module "@stencil/core" {
12635
12629
  * Therefore, users cannot interact with the tip, but if the trigger element
12636
12630
  * itself is interactive, it will remain interactible even with a tooltip bound
12637
12631
  * to it.
12638
- * :::note
12639
- * In order to display the tooltip, the tooltip element and its trigger element
12640
- * must be within the same document or document fragment (the same shadowRoot).
12641
- * Often, it's easiest to just place them next to each other like in the example
12642
- * below, but if you need to, you can place them differently.
12643
- * ```html
12644
- * <limel-button icon="search" id="tooltip-example" />
12645
- * <limel-tooltip label="Search" elementId="tooltip-example" />
12646
- * ```
12647
- * :::
12648
12632
  * ## Usage
12649
12633
  * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.
12650
12634
  * Use them only when they add significant value.
@@ -12660,6 +12644,8 @@ declare module "@stencil/core" {
12660
12644
  * effortlessly recognize can be hovered.
12661
12645
  * @exampleComponent limel-example-tooltip-basic
12662
12646
  * @exampleComponent limel-example-tooltip-max-character
12647
+ * @exampleComponent limel-example-tooltip-hotkey
12648
+ * @exampleComponent limel-example-tooltip-accessibility
12663
12649
  * @exampleComponent limel-example-tooltip-composite
12664
12650
  */
12665
12651
  "limel-tooltip": LocalJSX.IntrinsicElements["limel-tooltip"] & JSXBase.HTMLAttributes<HTMLLimelTooltipElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.16.4",
3
+ "version": "39.17.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1,128 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-BjHIBY-I.js');
4
- var hotkeys = require('./hotkeys-BtR8uxvl.js');
5
- var device = require('./device-C9O7lYI9.js');
6
-
7
- // Note: this function handles the same key aliases as `KEY_ALIASES` in
8
- // `../../util/hotkeys.ts`, but maps them to display strings rather than
9
- // canonical names. Keep both in sync when adding new aliases.
10
- /**
11
- * Maps a single hotkey token to its display representation.
12
- *
13
- * @param token - A single token from `tokenizeHotkeyString` (e.g. `"meta"`, `"k"`, `"+"`).
14
- * @param isApple - Whether the current device is an Apple device.
15
- * @returns The display string, whether it is a glyph (for styling),
16
- * and a human-readable name for screen readers.
17
- */
18
- function formatDisplayToken(token, isApple) {
19
- const trimmed = (token !== null && token !== void 0 ? token : '').trim();
20
- if (!trimmed) {
21
- return { display: '', isGlyph: false, ariaName: '' };
22
- }
23
- if (trimmed === '+') {
24
- return { display: '+', isGlyph: false, ariaName: 'plus' };
25
- }
26
- const lower = trimmed.toLowerCase();
27
- switch (lower) {
28
- case 'meta':
29
- case 'win':
30
- case 'windows': {
31
- return isApple
32
- ? { display: '⌘', isGlyph: true, ariaName: 'Command' }
33
- : { display: '⊞ Win', isGlyph: false, ariaName: 'Windows' };
34
- }
35
- case 'cmd':
36
- case 'command': {
37
- return { display: '⌘', isGlyph: true, ariaName: 'Command' };
38
- }
39
- case 'alt':
40
- case 'option': {
41
- return isApple
42
- ? { display: '⌥', isGlyph: true, ariaName: 'Option' }
43
- : { display: 'Alt', isGlyph: false, ariaName: 'Alt' };
44
- }
45
- case 'shift': {
46
- return { display: '⇧', isGlyph: true, ariaName: 'Shift' };
47
- }
48
- case 'enter':
49
- case 'return': {
50
- return { display: '↩', isGlyph: true, ariaName: 'Enter' };
51
- }
52
- case 'tab': {
53
- return { display: '⇥', isGlyph: true, ariaName: 'Tab' };
54
- }
55
- case 'delete':
56
- case 'del':
57
- case 'backspace': {
58
- if (isApple) {
59
- return { display: '⌫', isGlyph: true, ariaName: 'Delete' };
60
- }
61
- return lower === 'backspace'
62
- ? {
63
- display: 'Backspace',
64
- isGlyph: false,
65
- ariaName: 'Backspace',
66
- }
67
- : { display: 'Del', isGlyph: false, ariaName: 'Delete' };
68
- }
69
- case 'ctrl':
70
- case 'control': {
71
- return isApple
72
- ? { display: '⌃', isGlyph: true, ariaName: 'Control' }
73
- : { display: 'Ctrl', isGlyph: false, ariaName: 'Control' };
74
- }
75
- case 'escape':
76
- case 'esc': {
77
- return { display: 'Esc', isGlyph: false, ariaName: 'Escape' };
78
- }
79
- case 'space':
80
- case 'spacebar': {
81
- return { display: '␣', isGlyph: true, ariaName: 'Space' };
82
- }
83
- case 'arrowup':
84
- case 'up': {
85
- return { display: '↑', isGlyph: true, ariaName: 'Up' };
86
- }
87
- case 'arrowdown':
88
- case 'down': {
89
- return { display: '↓', isGlyph: true, ariaName: 'Down' };
90
- }
91
- case 'arrowleft':
92
- case 'left': {
93
- return { display: '←', isGlyph: true, ariaName: 'Left' };
94
- }
95
- case 'arrowright':
96
- case 'right': {
97
- return { display: '→', isGlyph: true, ariaName: 'Right' };
98
- }
99
- }
100
- return { display: trimmed, isGlyph: false, ariaName: trimmed };
101
- }
102
-
103
- const hotkeyCss = () => `@charset "UTF-8";kbd{display:inline-block;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;border-radius:0.125rem;border-style:solid;border-color:rgb(var(--contrast-500));border-width:0 1px 0.1875rem 1px;padding:0.0625rem 0.375rem;margin:0 0.25rem;background-color:rgb(var(--contrast-200));box-shadow:var(--button-shadow-normal), 0 0.625rem 0.375rem -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}:host(limel-hotkey){display:flex;align-items:center;justify-content:center;gap:0.25rem}:host(limel-hotkey[disabled]:not([disabled=false])){opacity:0.5}kbd{text-transform:var(--hotkey-text-transform, uppercase);margin:0;font-size:0.75rem;box-shadow:var(--button-shadow-pressed), 0 0.625rem 0.375px -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}span{display:inline-block}kbd.is-glyph span{transform:scale(1.2)}`;
104
-
105
- const Hotkey = class {
106
- constructor(hostRef) {
107
- index.registerInstance(this, hostRef);
108
- /**
109
- * When `true`, the hotkey is rendered in a visually disabled state.
110
- */
111
- this.disabled = false;
112
- }
113
- componentWillLoad() {
114
- this.isApple = device.isAppleDevice();
115
- }
116
- render() {
117
- const parts = hotkeys.tokenizeHotkeyString(this.value);
118
- const displayParts = parts.map((part) => formatDisplayToken(part, this.isApple));
119
- const ariaLabel = displayParts
120
- .map((p) => p.ariaName)
121
- .filter(Boolean)
122
- .join(' ');
123
- return (index.h(index.Host, { key: 'ab1b9d31080740d19a4633c8c5bc92b02625c111', "aria-label": ariaLabel || undefined }, displayParts.map(({ display, isGlyph }, index$1) => (index.h("kbd", { key: `${parts[index$1]}-${index$1}`, class: isGlyph ? 'is-glyph' : undefined }, index.h("span", null, display))))));
124
- }
125
- };
126
- Hotkey.style = hotkeyCss();
127
-
128
- exports.limel_hotkey = Hotkey;
@@ -1,126 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-DBTJNfo7.js';
2
- import { t as tokenizeHotkeyString } from './hotkeys-BxrRWYts.js';
3
- import { c as isAppleDevice } from './device-B-tmXAXV.js';
4
-
5
- // Note: this function handles the same key aliases as `KEY_ALIASES` in
6
- // `../../util/hotkeys.ts`, but maps them to display strings rather than
7
- // canonical names. Keep both in sync when adding new aliases.
8
- /**
9
- * Maps a single hotkey token to its display representation.
10
- *
11
- * @param token - A single token from `tokenizeHotkeyString` (e.g. `"meta"`, `"k"`, `"+"`).
12
- * @param isApple - Whether the current device is an Apple device.
13
- * @returns The display string, whether it is a glyph (for styling),
14
- * and a human-readable name for screen readers.
15
- */
16
- function formatDisplayToken(token, isApple) {
17
- const trimmed = (token !== null && token !== void 0 ? token : '').trim();
18
- if (!trimmed) {
19
- return { display: '', isGlyph: false, ariaName: '' };
20
- }
21
- if (trimmed === '+') {
22
- return { display: '+', isGlyph: false, ariaName: 'plus' };
23
- }
24
- const lower = trimmed.toLowerCase();
25
- switch (lower) {
26
- case 'meta':
27
- case 'win':
28
- case 'windows': {
29
- return isApple
30
- ? { display: '⌘', isGlyph: true, ariaName: 'Command' }
31
- : { display: '⊞ Win', isGlyph: false, ariaName: 'Windows' };
32
- }
33
- case 'cmd':
34
- case 'command': {
35
- return { display: '⌘', isGlyph: true, ariaName: 'Command' };
36
- }
37
- case 'alt':
38
- case 'option': {
39
- return isApple
40
- ? { display: '⌥', isGlyph: true, ariaName: 'Option' }
41
- : { display: 'Alt', isGlyph: false, ariaName: 'Alt' };
42
- }
43
- case 'shift': {
44
- return { display: '⇧', isGlyph: true, ariaName: 'Shift' };
45
- }
46
- case 'enter':
47
- case 'return': {
48
- return { display: '↩', isGlyph: true, ariaName: 'Enter' };
49
- }
50
- case 'tab': {
51
- return { display: '⇥', isGlyph: true, ariaName: 'Tab' };
52
- }
53
- case 'delete':
54
- case 'del':
55
- case 'backspace': {
56
- if (isApple) {
57
- return { display: '⌫', isGlyph: true, ariaName: 'Delete' };
58
- }
59
- return lower === 'backspace'
60
- ? {
61
- display: 'Backspace',
62
- isGlyph: false,
63
- ariaName: 'Backspace',
64
- }
65
- : { display: 'Del', isGlyph: false, ariaName: 'Delete' };
66
- }
67
- case 'ctrl':
68
- case 'control': {
69
- return isApple
70
- ? { display: '⌃', isGlyph: true, ariaName: 'Control' }
71
- : { display: 'Ctrl', isGlyph: false, ariaName: 'Control' };
72
- }
73
- case 'escape':
74
- case 'esc': {
75
- return { display: 'Esc', isGlyph: false, ariaName: 'Escape' };
76
- }
77
- case 'space':
78
- case 'spacebar': {
79
- return { display: '␣', isGlyph: true, ariaName: 'Space' };
80
- }
81
- case 'arrowup':
82
- case 'up': {
83
- return { display: '↑', isGlyph: true, ariaName: 'Up' };
84
- }
85
- case 'arrowdown':
86
- case 'down': {
87
- return { display: '↓', isGlyph: true, ariaName: 'Down' };
88
- }
89
- case 'arrowleft':
90
- case 'left': {
91
- return { display: '←', isGlyph: true, ariaName: 'Left' };
92
- }
93
- case 'arrowright':
94
- case 'right': {
95
- return { display: '→', isGlyph: true, ariaName: 'Right' };
96
- }
97
- }
98
- return { display: trimmed, isGlyph: false, ariaName: trimmed };
99
- }
100
-
101
- const hotkeyCss = () => `@charset "UTF-8";kbd{display:inline-block;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;border-radius:0.125rem;border-style:solid;border-color:rgb(var(--contrast-500));border-width:0 1px 0.1875rem 1px;padding:0.0625rem 0.375rem;margin:0 0.25rem;background-color:rgb(var(--contrast-200));box-shadow:var(--button-shadow-normal), 0 0.625rem 0.375rem -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}:host(limel-hotkey){display:flex;align-items:center;justify-content:center;gap:0.25rem}:host(limel-hotkey[disabled]:not([disabled=false])){opacity:0.5}kbd{text-transform:var(--hotkey-text-transform, uppercase);margin:0;font-size:0.75rem;box-shadow:var(--button-shadow-pressed), 0 0.625rem 0.375px -0.5rem rgb(var(--color-black), 0.02), 0 0.025rem 0.5rem 0 rgb(var(--contrast-100)) inset}span{display:inline-block}kbd.is-glyph span{transform:scale(1.2)}`;
102
-
103
- const Hotkey = class {
104
- constructor(hostRef) {
105
- registerInstance(this, hostRef);
106
- /**
107
- * When `true`, the hotkey is rendered in a visually disabled state.
108
- */
109
- this.disabled = false;
110
- }
111
- componentWillLoad() {
112
- this.isApple = isAppleDevice();
113
- }
114
- render() {
115
- const parts = tokenizeHotkeyString(this.value);
116
- const displayParts = parts.map((part) => formatDisplayToken(part, this.isApple));
117
- const ariaLabel = displayParts
118
- .map((p) => p.ariaName)
119
- .filter(Boolean)
120
- .join(' ');
121
- return (h(Host, { key: 'ab1b9d31080740d19a4633c8c5bc92b02625c111', "aria-label": ariaLabel || undefined }, displayParts.map(({ display, isGlyph }, index) => (h("kbd", { key: `${parts[index]}-${index}`, class: isGlyph ? 'is-glyph' : undefined }, h("span", null, display))))));
122
- }
123
- };
124
- Hotkey.style = hotkeyCss();
125
-
126
- export { Hotkey as limel_hotkey };
@@ -1 +0,0 @@
1
- import{r as t,h as e,a as n}from"./p-DBTJNfo7.js";import{c as i}from"./p-JbKhhoXs.js";var r="top",o="bottom",a="right",s="left",u="auto",c=[r,o,a,s],l="start",f="end",h="viewport",d="popper",p=c.reduce((function(t,e){return t.concat([e+"-"+l,e+"-"+f])}),[]),v=[].concat(c,[u]).reduce((function(t,e){return t.concat([e,e+"-"+l,e+"-"+f])}),[]),b=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function m(t){return t?(t.nodeName||"").toLowerCase():null}function y(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function g(t){return t instanceof y(t).Element||t instanceof Element}function x(t){return t instanceof y(t).HTMLElement||t instanceof HTMLElement}function w(t){return"undefined"!=typeof ShadowRoot&&(t instanceof y(t).ShadowRoot||t instanceof ShadowRoot)}function O(t){return t.split("-")[0]}var j=Math.max,k=Math.min,C=Math.round;function M(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function P(){return!/^((?!chrome|android).)*safari/i.test(M())}function A(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&x(t)&&(r=t.offsetWidth>0&&C(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&C(i.height)/t.offsetHeight||1);var a=(g(t)?y(t):window).visualViewport,s=!P()&&n,u=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,l=i.width/r,f=i.height/o;return{width:l,height:f,top:c,right:u+l,bottom:c+f,left:u,x:u,y:c}}function L(t){var e=A(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function S(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&w(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function T(t){return y(t).getComputedStyle(t)}function W(t){return["table","td","th"].indexOf(m(t))>=0}function q(t){return((g(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===m(t)?t:t.assignedSlot||t.parentNode||(w(t)?t.host:null)||q(t)}function B(t){return x(t)&&"fixed"!==T(t).position?t.offsetParent:null}function E(t){for(var e=y(t),n=B(t);n&&W(n)&&"static"===T(n).position;)n=B(n);return n&&("html"===m(n)||"body"===m(n)&&"static"===T(n).position)?e:n||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&x(t)&&"fixed"===T(t).position)return null;var n=z(t);for(w(n)&&(n=n.host);x(n)&&["html","body"].indexOf(m(n))<0;){var i=T(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function R(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function H(t,e,n){return j(t,k(e,n))}function D(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function I(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function _(t){return t.split("-")[1]}var F={top:"auto",right:"auto",bottom:"auto",left:"auto"};function N(t){var e,n=t.popper,i=t.popperRect,u=t.placement,c=t.variation,l=t.offsets,h=t.position,d=t.gpuAcceleration,p=t.adaptive,v=t.roundOffsets,b=t.isFixed,m=l.x,g=void 0===m?0:m,x=l.y,w=void 0===x?0:x,O="function"==typeof v?v({x:g,y:w}):{x:g,y:w};g=O.x,w=O.y;var j=l.hasOwnProperty("x"),k=l.hasOwnProperty("y"),M=s,P=r,A=window;if(p){var L=E(n),S="clientHeight",W="clientWidth";L===y(n)&&"static"!==T(L=q(n)).position&&"absolute"===h&&(S="scrollHeight",W="scrollWidth"),(u===r||(u===s||u===a)&&c===f)&&(P=o,w-=(b&&L===A&&A.visualViewport?A.visualViewport.height:L[S])-i.height,w*=d?1:-1),u!==s&&(u!==r&&u!==o||c!==f)||(M=a,g-=(b&&L===A&&A.visualViewport?A.visualViewport.width:L[W])-i.width,g*=d?1:-1)}var z,B=Object.assign({position:h},p&&F),R=!0===v?function(t,e){var n=t.y,i=e.devicePixelRatio||1;return{x:C(t.x*i)/i||0,y:C(n*i)/i||0}}({x:g,y:w},y(n)):{x:g,y:w};return g=R.x,w=R.y,Object.assign({},B,d?((z={})[P]=k?"0":"",z[M]=j?"0":"",z.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+w+"px)":"translate3d("+g+"px, "+w+"px, 0)",z):((e={})[P]=k?w+"px":"",e[M]=j?g+"px":"",e.transform="",e))}var V={passive:!0},$={left:"right",right:"left",bottom:"top",top:"bottom"};function J(t){return t.replace(/left|right|bottom|top/g,(function(t){return $[t]}))}var K={start:"end",end:"start"};function U(t){return t.replace(/start|end/g,(function(t){return K[t]}))}function X(t){var e=y(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function G(t){return A(q(t)).left+X(t).scrollLeft}function Q(t){var e=T(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Y(t){return["html","body","#document"].indexOf(m(t))>=0?t.ownerDocument.body:x(t)&&Q(t)?t:Y(z(t))}function Z(t,e){var n;void 0===e&&(e=[]);var i=Y(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=y(i),a=r?[o].concat(o.visualViewport||[],Q(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(Z(z(a)))}function tt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function et(t,e,n){return e===h?tt(function(t,e){var n=y(t),i=q(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,u=0;if(r){o=r.width,a=r.height;var c=P();(c||!c&&"fixed"===e)&&(s=r.offsetLeft,u=r.offsetTop)}return{width:o,height:a,x:s+G(t),y:u}}(t,n)):g(e)?function(t,e){var n=A(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):tt(function(t){var e,n=q(t),i=X(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=j(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=j(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+G(t),u=-i.scrollTop;return"rtl"===T(r||n).direction&&(s+=j(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(q(t)))}function nt(t){var e,n=t.reference,i=t.element,u=t.placement,c=u?O(u):null,h=u?_(u):null,d=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2;switch(c){case r:e={x:d,y:n.y-i.height};break;case o:e={x:d,y:n.y+n.height};break;case a:e={x:n.x+n.width,y:p};break;case s:e={x:n.x-i.width,y:p};break;default:e={x:n.x,y:n.y}}var v=c?R(c):null;if(null!=v){var b="y"===v?"height":"width";switch(h){case l:e[v]=e[v]-(n[b]/2-i[b]/2);break;case f:e[v]=e[v]+(n[b]/2-i[b]/2)}}return e}function it(t,e){void 0===e&&(e={});var n=e.placement,i=void 0===n?t.placement:n,s=e.strategy,u=void 0===s?t.strategy:s,l=e.boundary,f=void 0===l?"clippingParents":l,p=e.rootBoundary,v=void 0===p?h:p,b=e.elementContext,y=void 0===b?d:b,w=e.altBoundary,O=void 0!==w&&w,C=e.padding,M=void 0===C?0:C,P=D("number"!=typeof M?M:I(M,c)),L=t.rects.popper,W=t.elements[O?y===d?"reference":d:y],B=function(t,e,n,i){var r="clippingParents"===e?function(t){var e=Z(z(t)),n=["absolute","fixed"].indexOf(T(t).position)>=0&&x(t)?E(t):t;return g(n)?e.filter((function(t){return g(t)&&S(t,n)&&"body"!==m(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),a=o.reduce((function(e,n){var r=et(t,n,i);return e.top=j(r.top,e.top),e.right=k(r.right,e.right),e.bottom=k(r.bottom,e.bottom),e.left=j(r.left,e.left),e}),et(t,o[0],i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(g(W)?W:W.contextElement||q(t.elements.popper),f,v,u),R=A(t.elements.reference),H=nt({reference:R,element:L,placement:i}),_=tt(Object.assign({},L,H)),F=y===d?_:R,N={top:B.top-F.top+P.top,bottom:F.bottom-B.bottom+P.bottom,left:B.left-F.left+P.left,right:F.right-B.right+P.right},V=t.modifiersData.offset;if(y===d&&V){var $=V[i];Object.keys(N).forEach((function(t){var e=[a,o].indexOf(t)>=0?1:-1,n=[r,o].indexOf(t)>=0?"y":"x";N[t]+=$[n]*e}))}return N}function rt(t,e){void 0===e&&(e={});var n=e.boundary,i=e.rootBoundary,r=e.padding,o=e.flipVariations,a=e.allowedAutoPlacements,s=void 0===a?v:a,u=_(e.placement),l=u?o?p:p.filter((function(t){return _(t)===u})):c,f=l.filter((function(t){return s.indexOf(t)>=0}));0===f.length&&(f=l);var h=f.reduce((function(e,o){return e[o]=it(t,{placement:o,boundary:n,rootBoundary:i,padding:r})[O(o)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}var ot={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var c=n.mainAxis,f=void 0===c||c,h=n.altAxis,d=void 0===h||h,p=n.fallbackPlacements,v=n.padding,b=n.boundary,m=n.rootBoundary,y=n.altBoundary,g=n.flipVariations,x=void 0===g||g,w=n.allowedAutoPlacements,j=e.options.placement,k=O(j),C=p||(k!==j&&x?function(t){if(O(t)===u)return[];var e=J(t);return[U(t),e,U(e)]}(j):[J(j)]),M=[j].concat(C).reduce((function(t,n){return t.concat(O(n)===u?rt(e,{placement:n,boundary:b,rootBoundary:m,padding:v,flipVariations:x,allowedAutoPlacements:w}):n)}),[]),P=e.rects.reference,A=e.rects.popper,L=new Map,S=!0,T=M[0],W=0;W<M.length;W++){var q=M[W],z=O(q),B=_(q)===l,E=[r,o].indexOf(z)>=0,R=E?"width":"height",H=it(e,{placement:q,boundary:b,rootBoundary:m,altBoundary:y,padding:v}),D=E?B?a:s:B?o:r;P[R]>A[R]&&(D=J(D));var I=J(D),F=[];if(f&&F.push(H[z]<=0),d&&F.push(H[D]<=0,H[I]<=0),F.every((function(t){return t}))){T=q,S=!1;break}L.set(q,F)}if(S)for(var N=function(t){var e=M.find((function(e){var n=L.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},V=x?3:1;V>0&&"break"!==N(V);V--);e.placement!==T&&(e.modifiersData[i]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function at(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function st(t){return[r,a,o,s].some((function(e){return t[e]>=0}))}function ut(t,e,n){void 0===n&&(n=!1);var i,r,o=x(e),a=x(e)&&function(t){var e=t.getBoundingClientRect(),n=C(e.width)/t.offsetWidth||1,i=C(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),s=q(e),u=A(t,a,n),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!n)&&(("body"!==m(e)||Q(s))&&(c=(i=e)!==y(i)&&x(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:X(i)),x(e)?((l=A(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=G(s))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function ct(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}var lt={placement:"bottom",modifiers:[],strategy:"absolute"};function ft(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function ht(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,i=t.defaultOptions,r=void 0===i?lt:i;return function(t,e,i){void 0===i&&(i=r);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},lt,r),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,l={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;f(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:g(t)?Z(t):t.contextElement?Z(t.contextElement):[],popper:Z(e)};var a,c,h=function(t){var e=ct(t);return b.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((a=[].concat(n,s.options.modifiers),c=a.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return s.orderedModifiers=h.filter((function(t){return t.enabled})),s.orderedModifiers.forEach((function(t){var e=t.options,n=t.effect;if("function"==typeof n){var i=n({state:s,name:t.name,instance:l,options:void 0===e?{}:e});u.push(i||function(){})}})),l.update()},forceUpdate:function(){if(!c){var t=s.elements,e=t.reference,n=t.popper;if(ft(e,n)){s.rects={reference:ut(e,E(n),"fixed"===s.options.strategy),popper:L(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(t){return s.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var r=s.orderedModifiers[i],o=r.fn,a=r.options;"function"==typeof o&&(s=o({state:s,options:void 0===a?{}:a,name:r.name,instance:l})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){l.forceUpdate(),t(s)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){f(),c=!0}};if(!ft(t,e))return l;function f(){u.forEach((function(t){return t()})),u=[]}return l.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),l}}var dt=ht({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,u=y(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",n.update,V)})),s&&u.addEventListener("resize",n.update,V),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",n.update,V)})),s&&u.removeEventListener("resize",n.update,V)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=nt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,u=void 0===s||s,c={placement:O(e.placement),variation:_(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,N(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,N(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];x(r)&&m(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});x(i)&&m(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,i=t.options.offset,o=void 0===i?[0,0]:i,u=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=O(t),o=[s,r].indexOf(i)>=0?-1:1,u="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=u[0],l=u[1];return c=c||0,l=(l||0)*o,[s,a].indexOf(i)>=0?{x:l,y:c}:{x:c,y:l}}(n,e.rects,o),t}),{}),c=u[e.placement],l=c.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c.x,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=u}},ot,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,u=n.mainAxis,c=void 0===u||u,f=n.altAxis,h=void 0!==f&&f,d=n.tether,p=void 0===d||d,v=n.tetherOffset,b=void 0===v?0:v,m=it(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),y=O(e.placement),g=_(e.placement),x=!g,w=R(y),C="x"===w?"y":"x",M=e.modifiersData.popperOffsets,P=e.rects.reference,A=e.rects.popper,S="function"==typeof b?b(Object.assign({},e.rects,{placement:e.placement})):b,T="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),W=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(M){if(c){var z,B="y"===w?r:s,D="y"===w?o:a,I="y"===w?"height":"width",F=M[w],N=F+m[B],V=F-m[D],$=p?-A[I]/2:0,J=g===l?P[I]:A[I],K=g===l?-A[I]:-P[I],U=e.elements.arrow,X=p&&U?L(U):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Q=G[B],Y=G[D],Z=H(0,P[I],X[I]),tt=x?P[I]/2-$-Z-Q-T.mainAxis:J-Z-Q-T.mainAxis,et=x?-P[I]/2+$+Z+Y+T.mainAxis:K+Z+Y+T.mainAxis,nt=e.elements.arrow&&E(e.elements.arrow),rt=null!=(z=null==W?void 0:W[w])?z:0,ot=F+et-rt,at=H(p?k(N,F+tt-rt-(nt?"y"===w?nt.clientTop||0:nt.clientLeft||0:0)):N,F,p?j(V,ot):V);M[w]=at,q[w]=at-F}if(h){var st,ut=M[C],ct="y"===C?"height":"width",lt=ut+m["x"===w?r:s],ft=ut-m["x"===w?o:a],ht=-1!==[r,s].indexOf(y),dt=null!=(st=null==W?void 0:W[C])?st:0,pt=ht?lt:ut-P[ct]-A[ct]-dt+T.altAxis,vt=ht?ut+P[ct]+A[ct]-dt-T.altAxis:ft,bt=p&&ht?function(t,e,n){var i=H(t,e,n);return i>n?n:i}(pt,ut,vt):H(p?pt:lt,ut,p?vt:ft);M[C]=bt,q[C]=bt-ut}e.modifiersData[i]=q}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,u=t.options,l=n.elements.arrow,f=n.modifiersData.popperOffsets,h=O(n.placement),d=R(h),p=[s,a].indexOf(h)>=0?"height":"width";if(l&&f){var v=function(t,e){return D("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:I(t,c))}(u.padding,n),b=L(l),m="y"===d?r:s,y="y"===d?o:a,g=n.rects.reference[p]+n.rects.reference[d]-f[d]-n.rects.popper[p],x=f[d]-n.rects.reference[d],w=E(l),j=w?"y"===d?w.clientHeight||0:w.clientWidth||0:0,k=j/2-b[p]/2+(g/2-x/2),C=H(v[m],k,j-b[p]-v[y]);n.modifiersData[i]=((e={})[d]=C,e.centerOffset=C-k,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&S(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,a=it(e,{elementContext:"reference"}),s=it(e,{altBoundary:!0}),u=at(a,i),c=at(s,r,o),l=st(u),f=st(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}}]});const pt="is-visible",vt="is-hiding",bt=class{constructor(e){t(this,e),this.openDirection="bottom",this.position="absolute",this.containerStyle={},this.inheritParentWidth=!1,this.visible=!1,this.anchor=null,this.loaded=!1,this.parents=new WeakMap}disconnectedCallback(){this.removeContainer(),this.destroyPopper(),this.observer&&this.container&&this.observer.unobserve(this.container),this.container=null}connectedCallback(){this.loaded&&this.visible&&this.init()}componentDidLoad(){this.loaded=!0,this.connectedCallback()}init(){this.host.isConnected&&(this.createContainer(),this.hideContainer(),this.attachContainer(),this.styleContainer(),this.visible&&(this.createPopper(),this.showContainer()),"ResizeObserver"in window&&(this.observer=new ResizeObserver((()=>{this.popperInstance&&(this.styleContainer(),this.popperInstance.update())})),this.observer.observe(this.container)))}render(){return e("slot",{key:"c8e7ba60cdab45dd239eae6c9123f673a48e8e22"})}onVisible(){this.container||!this.visible?this.visible?(this.styleContainer(),this.createPopper(),requestAnimationFrame((()=>{this.showContainer()}))):this.animateHideAndCleanup():this.init()}createContainer(){const t=this.host.shadowRoot.querySelector("slot"),e=t.assignedElements&&t.assignedElements()||[];this.container=document.createElement("div"),this.container.setAttribute("id",this.containerId),this.container.setAttribute("class","limel-portal--container"),Object.assign(this.container,{portalSource:this.host}),e.forEach((t=>{this.parents.set(t,t.parentElement),this.container.append(t)}))}attachContainer(){this.getParent().append(this.container)}removeContainer(){this.container&&([...this.container.children].forEach((t=>{const e=this.parents.get(t);e&&e.append(t)})),this.container.remove())}hideContainer(){this.container&&this.container.classList.remove(pt)}showContainer(){this.container.classList.add(pt)}animateHideAndCleanup(){this.container&&(this.container.classList.add(vt),this.styleContainer(),setTimeout((()=>{this.container&&(this.container.classList.remove(vt),this.visible||(this.container.classList.remove(pt),this.destroyPopper()))}),300))}styleContainer(){this.setContainerWidth(),this.setContainerHeight(),this.setContainerStyles()}setContainerWidth(){const t=this.host.getBoundingClientRect().width;if(this.inheritParentWidth){let e=this.getContentWidth(this.container);t>0&&(e=t),this.container.style.width=`${e}px`}}getContentWidth(t){if(!t)return null;const e=t.getBoundingClientRect().width;if(0!==e)return e;const n=t.querySelector("*");return this.getContentWidth(n)}setContainerStyles(){for(const t of Object.keys(this.containerStyle))this.container.style[t]=this.containerStyle[t]}createPopper(){const t=this.createPopperConfig();this.popperInstance=dt(this.anchor||this.host,this.container,t)}destroyPopper(){var t;null===(t=this.popperInstance)||void 0===t||t.destroy(),this.popperInstance=null}createPopperConfig(){const t=this.getPlacement(this.openDirection),e=this.getFlipPlacement(this.openDirection);return{strategy:this.position,placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:[e]}}]}}getPlacement(t){return{"left-start":"left-start",left:"left","left-end":"left-end","right-start":"right-start",right:"right","right-end":"right-end","top-start":"top-start",top:"top","top-end":"top-end","bottom-start":"bottom-start",bottom:"bottom","bottom-end":"bottom-end"}[t]}getFlipPlacement(t){return{"left-start":"right-start",left:"right","left-end":"right-end","right-start":"left-start",right:"left","right-end":"left-end","top-start":"bottom-start",top:"bottom","top-end":"bottom-end","bottom-start":"top-start",bottom:"top","bottom-end":"top-end"}[t]}setContainerHeight(){const t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),{top:e,bottom:n}=this.host.getBoundingClientRect(),i=Math.max(e,0),r=Math.max(t-n,0),o=Math.max(i,r)-16;this.container.style.maxHeight=`${o}px`}getParent(){let t=this.anchor||this.host;for(;t;){const e=t.closest(".limel-portal--parent");if(e)return e;t=t.getRootNode().host}return document.body}get host(){return n(this)}static get watchers(){return{visible:[{onVisible:0}]}}};bt.style=":host(limel-portal){display:block;position:absolute;top:0;bottom:0;width:100%;pointer-events:none}:host([hidden]){display:none}slot{display:none}";class mt{constructor(t,e,n=500){this.timerHandle=null,this.showCallback=t,this.hideCallback=e,this.delayForShowing=n}showAfterDelay(){this.timerHandle||(this.timerHandle=setTimeout(this.showCallback,this.delayForShowing))}hide(){clearTimeout(this.timerHandle),this.timerHandle=null,this.hideCallback()}}const yt=class{constructor(e){t(this,e),this.maxlength=50,this.openDirection="top",this.showTooltip=()=>{this.tooltipTimer.showAfterDelay()},this.hideTooltip=()=>{this.tooltipTimer.hide()},this.portalId=i(),this.tooltipId=i(),this.tooltipTimer=new mt((()=>this.open=!0),(()=>this.open=!1))}connectedCallback(){this.ownerElement=function(t,e){let n=e;do{n=n.parentNode}while(n&&n.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&n.nodeType!==Node.DOCUMENT_NODE);return null==n?void 0:n.getElementById(t)}(this.elementId,this.host),this.setOwnerAriaLabel(),this.addListeners()}disconnectedCallback(){this.removeListeners()}render(){const t=getComputedStyle(this.host).getPropertyValue("--tooltip-z-index");return e("div",{key:"41e07fbdde2814c108805286e919ac0da916c0f3",class:"trigger-anchor"},e("limel-portal",{key:"4bb06a6307a3ccb934cc30c76ebde152fb784beb",openDirection:this.openDirection,visible:this.open,containerId:this.portalId,containerStyle:{"z-index":t,"pointer-events":"none"},anchor:this.ownerElement},e("limel-tooltip-content",{key:"eb24b1a7df99ef054b4d0108275480568c22eede",label:this.label,helperLabel:this.helperLabel,maxlength:this.maxlength,role:"tooltip","aria-hidden":!this.open,id:this.tooltipId})))}setOwnerAriaLabel(){var t;null===(t=this.ownerElement)||void 0===t||t.setAttribute("aria-describedby",this.tooltipId)}addListeners(){var t,e,n,i;null===(t=this.ownerElement)||void 0===t||t.addEventListener("mouseover",this.showTooltip),null===(e=this.ownerElement)||void 0===e||e.addEventListener("mouseout",this.hideTooltip),null===(n=this.ownerElement)||void 0===n||n.addEventListener("focus",this.showTooltip),null===(i=this.ownerElement)||void 0===i||i.addEventListener("blur",this.hideTooltip)}removeListeners(){var t,e,n,i;null===(t=this.ownerElement)||void 0===t||t.removeEventListener("mouseover",this.showTooltip),null===(e=this.ownerElement)||void 0===e||e.removeEventListener("mouseout",this.hideTooltip),null===(n=this.ownerElement)||void 0===n||n.removeEventListener("focus",this.showTooltip),null===(i=this.ownerElement)||void 0===i||i.removeEventListener("blur",this.hideTooltip)}get host(){return n(this)}};yt.style=":host(limel-tooltip){position:absolute;pointer-events:none}";const gt=class{constructor(e){t(this,e)}render(){let t=!1;this.helperLabel&&this.maxlength&&(t=this.label.length+this.helperLabel.length>this.maxlength);const n={};return this.maxlength&&(n.style={"--tooltip-max-width-of-text":`${this.maxlength}ch`}),[e("text",Object.assign({key:"c19e656075b926d26447a5620a0a779686445129",class:{"has-column-layout":t}},n),e("div",{key:"3e6c1220fde6121d6da548c48c776cbfbb83f4cd",class:"label"},this.label),e("div",{key:"e0dd60dc54481586a4af70a6c133ded3b32bb688",class:"helper-label"},this.helperLabel))]}};gt.style=":host(limel-tooltip-content){display:flex;border-radius:0.25rem;padding:0.25rem 0.5rem;background-color:rgb(var(--contrast-1300));box-shadow:var(--shadow-depth-16)}text{font-size:var(--limel-theme-default-font-size);line-height:1.25;display:flex;column-gap:1rem}text.has-column-layout{display:table-cell;width:fit-content;max-width:min(var(--tooltip-max-width-of-text), 80vw)}text.has-column-layout .label{padding-bottom:0.5rem}text.has-column-layout .helper-label{padding-bottom:0.25rem}.label{color:rgb(var(--contrast-200))}.helper-label{color:rgb(var(--contrast-800))}.helper-label:empty{display:none}";export{bt as limel_portal,yt as limel_tooltip,gt as limel_tooltip_content}
@@ -1 +0,0 @@
1
- import{r as o,h as t,H as e,a as n}from"./p-DBTJNfo7.js";import{m as i,r as a}from"./p-BgTwPGeH.js";import{c as s}from"./p-JbKhhoXs.js";import{d as r,g as l}from"./p-CgNJbSP4.js";const d=class{constructor(t){o(this,t),this.elevated=!1,this.disabled=!1,this.tooltipId=s(),this.filterClickWhenDisabled=o=>{this.disabled&&o.preventDefault()}}connectedCallback(){this.initialize()}componentWillLoad(){i(this.host)}disconnectedCallback(){a(this.host)}componentDidLoad(){this.initialize()}initialize(){this.host.shadowRoot.querySelector(".mdc-icon-button")}render(){const o={};return this.host.hasAttribute("tabindex")&&(o.tabindex=this.host.getAttribute("tabindex")),t(e,{key:"0df3febef19dcdb72c7c7f3740090414b313be51",onClick:this.filterClickWhenDisabled},t("button",Object.assign({key:"fd0d61e30789619c52cd6a71269602efc7065f8e",disabled:this.disabled,id:this.tooltipId},o),this.renderIcon(),this.renderTooltip(this.tooltipId)))}renderIcon(){var o,e;const n=l(this.icon),i=r(this.icon);return t("limel-icon",{name:n,"aria-label":i,"aria-hidden":i?null:"true",style:{color:`${null===(o=this.icon)||void 0===o?void 0:o.color}`,"--icon-background-color":`${null===(e=this.icon)||void 0===e?void 0:e.backgroundColor}`}})}renderTooltip(o){if(this.label)return t("limel-tooltip",{elementId:o,label:this.label,helperLabel:this.helperLabel})}static get delegatesFocus(){return!0}get host(){return n(this)}};d.style='@charset "UTF-8";:host([hidden]){display:none}:host([aria-expanded=true]) button,:host([aria-expanded]:not([aria-expanded=false])) button{box-shadow:var(--button-shadow-inset-pressed) !important}button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit}button:not(:disabled){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--icon-background-color, transparent)}button:not(:disabled):hover,button:not(:disabled):focus,button:not(:disabled):focus-visible{will-change:color, background-color, box-shadow, transform}button:not(:disabled):hover,button:not(:disabled):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button:not(:disabled):hover{box-shadow:var(--button-shadow-hovered)}button:not(:disabled):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button:not(:disabled):hover,button:not(:disabled):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button:not(:disabled):focus{outline:none}button:not(:disabled):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button{display:inline-flex;align-items:center;justify-content:center;height:2.25rem;width:2.25rem;border-radius:50%}button:disabled{cursor:not-allowed;color:var(--limel-theme-text-disabled-on-background-color)}:host([elevated]) button:not(:hover):not(:active):not(:disabled):not(:focus-visible){box-shadow:var(--button-shadow-normal)}:host([elevated]) button:disabled{box-shadow:var(--button-shadow-normal)}limel-icon{padding:0.25rem;width:1.75rem}';export{d as limel_icon_button}