@ethlete/components 1.0.0-next.79 → 1.0.0-next.81
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/CHANGELOG.md +41 -0
- package/design/anchored-dialog.ts +98 -0
- package/design/button.ts +13 -1
- package/design/config.json +6 -1
- package/design/dialog.ts +5 -3
- package/design/form-field.ts +3 -0
- package/design/menu.ts +8 -4
- package/design/notification.ts +8 -4
- package/design/sdk/components/accordion/accordion.ts +5 -1
- package/design/sdk/components/anchored-dialog/anchored-dialog.css +63 -0
- package/design/sdk/components/anchored-dialog/anchored-dialog.ts +75 -0
- package/design/sdk/components/avatar/avatar.ts +3 -2
- package/design/sdk/components/badge/badge.ts +2 -1
- package/design/sdk/components/banner/banner.ts +2 -1
- package/design/sdk/components/bracket/bracket.ts +2 -1
- package/design/sdk/components/breadcrumb/breadcrumb.ts +2 -1
- package/design/sdk/components/button/button.css +11 -3
- package/design/sdk/components/button/button.ts +17 -4
- package/design/sdk/components/calendar/calendar.ts +2 -1
- package/design/sdk/components/card/card.ts +2 -1
- package/design/sdk/components/carousel/carousel.ts +2 -1
- package/design/sdk/components/chart/chart.ts +2 -1
- package/design/sdk/components/checkbox/checkbox.css +65 -0
- package/design/sdk/components/checkbox/checkbox.ts +180 -0
- package/design/sdk/components/chip/chip.ts +2 -1
- package/design/sdk/components/copy-button/copy-button.ts +2 -1
- package/design/sdk/components/description-list/description-list.ts +2 -1
- package/design/sdk/components/dialog/dialog.ts +2 -1
- package/design/sdk/components/divider/divider.ts +2 -1
- package/design/sdk/components/empty-state/empty-state.ts +2 -1
- package/design/sdk/components/grid/grid.ts +3 -2
- package/design/sdk/components/input/input.ts +2 -1
- package/design/sdk/components/kbd/kbd.ts +2 -1
- package/design/sdk/components/loader/loader.ts +2 -1
- package/design/sdk/components/masonry/masonry.ts +3 -2
- package/design/sdk/components/match/match.ts +2 -1
- package/design/sdk/components/menu/menu.ts +19 -7
- package/design/sdk/components/notification/notification.ts +2 -1
- package/design/sdk/components/otp-input/otp-input.ts +2 -1
- package/design/sdk/components/pagination/pagination.ts +2 -1
- package/design/sdk/components/picture/picture.ts +2 -1
- package/design/sdk/components/progress-steps/progress-steps.ts +2 -1
- package/design/sdk/components/query-error/query-error.ts +2 -1
- package/design/sdk/components/radio-group/radio-group.css +46 -0
- package/design/sdk/components/radio-group/radio-group.ts +167 -0
- package/design/sdk/components/scheduler/scheduler.ts +2 -1
- package/design/sdk/components/scrollable/scrollable.ts +2 -2
- package/design/sdk/components/scrollbar/scrollbar.ts +2 -1
- package/design/sdk/components/select/shared/select-part.ts +11 -2
- package/design/sdk/components/select-panel/select-panel.ts +2 -1
- package/design/sdk/components/skeleton/skeleton.ts +2 -1
- package/design/sdk/components/slider/slider.ts +2 -1
- package/design/sdk/components/standings/standings.ts +2 -1
- package/design/sdk/components/stat-tile/stat-tile.ts +2 -1
- package/design/sdk/components/stream/stream.ts +6 -1
- package/design/sdk/components/switch/switch.css +4 -2
- package/design/sdk/components/switch/switch.ts +2 -2
- package/design/sdk/components/table/table.ts +2 -1
- package/design/sdk/components/textarea/textarea.ts +4 -3
- package/design/sdk/components/timeline/timeline.ts +2 -2
- package/design/sdk/components/toolbar/toolbar.ts +2 -1
- package/design/sdk/foundations/colors/colors.css +16 -0
- package/design/sdk/foundations/colors/colors.ts +1 -1
- package/design/sdk/foundations/colors/shared/contrast.ts +1 -1
- package/design/sdk/lint-baseline.json +6 -0
- package/design/sdk/pictures.json +1195 -0
- package/design/sdk/ready.json +64 -0
- package/design/sdk/rule-baseline.json +104 -0
- package/design/select.ts +9 -5
- package/design/textarea.ts +2 -0
- package/design/tooltip.ts +5 -5
- package/fesm2022/ethlete-components.mjs +1190 -973
- package/fesm2022/ethlete-components.mjs.map +1 -1
- package/generators/generators.json +2 -0
- package/package.json +1 -1
- package/src/lib/button/button-properties-styles.component.css +6 -6
- package/src/lib/button/button.component.css +11 -7
- package/src/lib/button/button.types.ts +33 -0
- package/src/lib/button/icon-button.component.css +3 -3
- package/src/lib/button/window-control-button.component.css +70 -3
- package/src/lib/calendar/calendar.component.css +2 -2
- package/src/lib/chip/chip.component.css +4 -4
- package/src/lib/focus-ring/focus-ring-styles.component.css +20 -5
- package/src/lib/forms/switch/switch.component.css +1 -14
- package/src/lib/kbd/kbd.component.css +1 -1
- package/src/lib/menu/menu.component.css +2 -2
- package/src/lib/notification/notification.component.css +3 -3
- package/types/ethlete-components.d.ts +171 -139
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"foundations/colors": {
|
|
3
|
+
"hash": "90cda4cd58b51ef5",
|
|
4
|
+
"files": {
|
|
5
|
+
".ethlete/design/sdk/foundations/colors/colors.ts": "5f21e1f2948db378",
|
|
6
|
+
".ethlete/design/sdk/foundations/colors/overrides.json": "37529d9089744c64",
|
|
7
|
+
".ethlete/design/sdk/foundations/colors/shared/contrast.ts": "b93de9afab5a930e"
|
|
8
|
+
},
|
|
9
|
+
"at": "2026-11-08T14:57:09.725Z",
|
|
10
|
+
"by": "et design check",
|
|
11
|
+
"cmd": "design check",
|
|
12
|
+
"pid": 1454598
|
|
13
|
+
},
|
|
14
|
+
"foundations/elevation": {
|
|
15
|
+
"hash": "097c0586609d90ad",
|
|
16
|
+
"files": {
|
|
17
|
+
".ethlete/design/sdk/foundations/elevation/elevation.css": "f2f220dfb86a39c2",
|
|
18
|
+
".ethlete/design/sdk/foundations/elevation/elevation.ts": "db933f910ada1a89",
|
|
19
|
+
".ethlete/design/sdk/foundations/elevation/shared/elevation/scene.css": "1f8f38c213e70f13",
|
|
20
|
+
".ethlete/design/sdk/foundations/elevation/shared/elevation/scene.ts": "936205798eb8c95c",
|
|
21
|
+
"libs/components/design/form-field.ts": "6910b0bf23eb0f3c",
|
|
22
|
+
"libs/components/design/icon.ts": "829a95253b948ba9",
|
|
23
|
+
"libs/components/design/select.ts": "d9dba51f6cbeb2df",
|
|
24
|
+
"libs/components/src/lib/forms/form-field/form-field-control-suffix-styles.component.css": "cc2cea40f4a0f4ae",
|
|
25
|
+
"libs/components/src/lib/forms/form-field/form-field-suffix-overlap-styles.component.css": "74e1b9ee85a9cc51",
|
|
26
|
+
"libs/components/src/lib/forms/form-field/form-field-text-shell-styles.component.css": "2eac704dfac0a6aa",
|
|
27
|
+
"libs/components/src/lib/forms/form-field/form-field.component.css": "4063eb2012233778",
|
|
28
|
+
"libs/components/src/lib/forms/form-field/headless/label.directive.css": "c010d55fd205c6fa",
|
|
29
|
+
"libs/components/src/lib/forms/form-field/hint.component.css": "d2c4f0ec2ef6bac4",
|
|
30
|
+
"libs/components/src/lib/forms/input/input.component.css": "02a190d06c08aa88",
|
|
31
|
+
"libs/components/src/lib/forms/select/select-all-option.component.css": "79b5a2ae71dbd24b",
|
|
32
|
+
"libs/components/src/lib/forms/select/select-option-group.component.css": "b6451eacb9b026b3",
|
|
33
|
+
"libs/components/src/lib/forms/select/select-option-styles.component.css": "24a12532fc82fb09",
|
|
34
|
+
"libs/components/src/lib/forms/select/select-panel.component.css": "b85bb18bab2890e3",
|
|
35
|
+
"libs/components/src/lib/forms/select/select.component.css": "fa54cb1b79ba643b",
|
|
36
|
+
"libs/components/src/lib/forms/textarea/textarea-autosize-styles.component.css": "27aa7dd9c197e96d",
|
|
37
|
+
"libs/components/src/lib/forms/textarea/textarea.component.css": "e1e6b6061ab5c476",
|
|
38
|
+
"libs/components/src/lib/icon/headless/check-icon.ts": "6a14df4cc853b42d",
|
|
39
|
+
"libs/components/src/lib/icon/headless/chevron-icon.ts": "d2c88d30d687a8bf",
|
|
40
|
+
"libs/components/src/lib/icon/headless/icon-definition.ts": "180b7ea77305a404",
|
|
41
|
+
"libs/components/src/lib/icon/headless/icon-styles.component.css": "c137a7a10599dc3f",
|
|
42
|
+
"libs/components/src/lib/icon/headless/times-icon.ts": "52047c20b1cf421d",
|
|
43
|
+
"libs/core/design/interactive-styles.ts": "781528322bd34499",
|
|
44
|
+
"libs/core/src/lib/theming/color-interactive-styles.component.css": "8baece3a25375ed8",
|
|
45
|
+
"libs/core/src/lib/theming/surface-interactive-styles.component.css": "944cbb76b1d15611"
|
|
46
|
+
},
|
|
47
|
+
"at": "2026-11-08T14:57:09.841Z",
|
|
48
|
+
"by": "et design check",
|
|
49
|
+
"cmd": "design check",
|
|
50
|
+
"pid": 1454598
|
|
51
|
+
},
|
|
52
|
+
"foundations/icons": {
|
|
53
|
+
"hash": "8f54284f202642c8",
|
|
54
|
+
"files": {
|
|
55
|
+
".ethlete/design/sdk/foundations/icons/icons.ts": "92fe04df2b6735e5",
|
|
56
|
+
"libs/components/design/icon-set.ts": "2aab551c1dd9aedc",
|
|
57
|
+
"libs/components/src/lib/icon/headless/icon-definition.ts": "180b7ea77305a404"
|
|
58
|
+
},
|
|
59
|
+
"at": "2026-11-08T14:57:09.936Z",
|
|
60
|
+
"by": "et design check",
|
|
61
|
+
"cmd": "design check",
|
|
62
|
+
"pid": 1454598
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"OFF-CENTRE": {
|
|
3
|
+
"components/button: size-lg at fitted: button[data-et-part=components/button]": {
|
|
4
|
+
"finding": "628",
|
|
5
|
+
"sketch": "components/button@off-centre"
|
|
6
|
+
},
|
|
7
|
+
"components/button: size-xl at fitted: button[data-et-part=components/button]": {
|
|
8
|
+
"finding": "628",
|
|
9
|
+
"sketch": "components/button@off-centre"
|
|
10
|
+
},
|
|
11
|
+
"components/chart: pie-tooltip at 480px: div.et-tooltip-mock-frame > div.et-overlay > et-tooltip.et-tooltip > div.et-tooltip__surface": {
|
|
12
|
+
"finding": "631",
|
|
13
|
+
"sketch": "components/chart@off-centre"
|
|
14
|
+
},
|
|
15
|
+
"components/pagination: current at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
16
|
+
"finding": "629",
|
|
17
|
+
"sketch": "components/pagination@off-centre"
|
|
18
|
+
},
|
|
19
|
+
"components/pagination: current-active at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
20
|
+
"finding": "629",
|
|
21
|
+
"sketch": "components/pagination@off-centre"
|
|
22
|
+
},
|
|
23
|
+
"components/pagination: current-focus-visible at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
24
|
+
"finding": "629",
|
|
25
|
+
"sketch": "components/pagination@off-centre"
|
|
26
|
+
},
|
|
27
|
+
"components/pagination: current-hover at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
28
|
+
"finding": "629",
|
|
29
|
+
"sketch": "components/pagination@off-centre"
|
|
30
|
+
},
|
|
31
|
+
"components/pagination: few at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
32
|
+
"finding": "629",
|
|
33
|
+
"sketch": "components/pagination@off-centre"
|
|
34
|
+
},
|
|
35
|
+
"components/pagination: first at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
36
|
+
"finding": "629",
|
|
37
|
+
"sketch": "components/pagination@off-centre"
|
|
38
|
+
},
|
|
39
|
+
"components/pagination: last at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
40
|
+
"finding": "629",
|
|
41
|
+
"sketch": "components/pagination@off-centre"
|
|
42
|
+
},
|
|
43
|
+
"components/pagination: links at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > a.et-surface-interactive": {
|
|
44
|
+
"finding": "629",
|
|
45
|
+
"sketch": "components/pagination@off-centre"
|
|
46
|
+
},
|
|
47
|
+
"components/pagination: middle at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
48
|
+
"finding": "629",
|
|
49
|
+
"sketch": "components/pagination@off-centre"
|
|
50
|
+
},
|
|
51
|
+
"components/pagination: page at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
52
|
+
"finding": "629",
|
|
53
|
+
"sketch": "components/pagination@off-centre"
|
|
54
|
+
},
|
|
55
|
+
"components/pagination: page-active at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
56
|
+
"finding": "629",
|
|
57
|
+
"sketch": "components/pagination@off-centre"
|
|
58
|
+
},
|
|
59
|
+
"components/pagination: page-focus-visible at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
60
|
+
"finding": "629",
|
|
61
|
+
"sketch": "components/pagination@off-centre"
|
|
62
|
+
},
|
|
63
|
+
"components/pagination: page-hover at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
64
|
+
"finding": "629",
|
|
65
|
+
"sketch": "components/pagination@off-centre"
|
|
66
|
+
},
|
|
67
|
+
"components/pagination: range at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
68
|
+
"finding": "629",
|
|
69
|
+
"sketch": "components/pagination@off-centre"
|
|
70
|
+
},
|
|
71
|
+
"components/pagination: sm at 480px: et-pagination[data-et-part=components/pagination] > ul.et-pagination-list > li.et-pagination-item > button.et-surface-interactive": {
|
|
72
|
+
"finding": "629",
|
|
73
|
+
"sketch": "components/pagination@off-centre"
|
|
74
|
+
},
|
|
75
|
+
"components/scrollable: vertical-border-mask at 480px: et-scrollable.et-scrollable > div.et-scrollable-wrapper > div.et-scrollable-container > button.et-scrollable-item": {
|
|
76
|
+
"finding": "630",
|
|
77
|
+
"sketch": "components/scrollable@off-centre"
|
|
78
|
+
},
|
|
79
|
+
"components/scrollable: vertical-end at 480px: et-scrollable.et-scrollable > div.et-scrollable-wrapper > div.et-scrollable-container > button.et-scrollable-item": {
|
|
80
|
+
"finding": "630",
|
|
81
|
+
"sketch": "components/scrollable@off-centre"
|
|
82
|
+
},
|
|
83
|
+
"components/scrollable: vertical-middle at 480px: et-scrollable.et-scrollable > div.et-scrollable-wrapper > div.et-scrollable-container > button.et-scrollable-item": {
|
|
84
|
+
"finding": "630",
|
|
85
|
+
"sketch": "components/scrollable@off-centre"
|
|
86
|
+
},
|
|
87
|
+
"components/scrollable: vertical-navigation at 480px: et-scrollable.et-scrollable > div.et-scrollable-wrapper > div.et-scrollable-container > button.et-scrollable-item": {
|
|
88
|
+
"finding": "630",
|
|
89
|
+
"sketch": "components/scrollable@off-centre"
|
|
90
|
+
},
|
|
91
|
+
"components/scrollable: vertical-start at 480px: et-scrollable.et-scrollable > div.et-scrollable-wrapper > div.et-scrollable-container > button.et-scrollable-item": {
|
|
92
|
+
"finding": "630",
|
|
93
|
+
"sketch": "components/scrollable@off-centre"
|
|
94
|
+
},
|
|
95
|
+
"components/skeleton: in-text at 480px: div.skeleton-frame": {
|
|
96
|
+
"finding": "633",
|
|
97
|
+
"sketch": "components/skeleton@off-centre"
|
|
98
|
+
},
|
|
99
|
+
"components/table: group-header at 480px: et-table[data-et-part=components/table] > div.et-table > et-table-group-header-row.et-table-group-row > div.et-table-group-cell": {
|
|
100
|
+
"finding": "632",
|
|
101
|
+
"sketch": "components/table@off-centre"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
package/design/select.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type SelectPanelMockOptions = {
|
|
|
38
38
|
multiple?: boolean;
|
|
39
39
|
/** The app's default color theme name: the panel provides it to the options. */
|
|
40
40
|
color?: string;
|
|
41
|
-
/** A surface theme name the app registers, for the panel. */
|
|
41
|
+
/** A surface theme name the app registers, for the panel. Left out, the panel takes the surface one elevation above its parent. */
|
|
42
42
|
surface?: string;
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -54,8 +54,10 @@ export type SelectMockOptions = {
|
|
|
54
54
|
clearLabel?: string;
|
|
55
55
|
/** The app's default color theme name: the panel provides it to the options. */
|
|
56
56
|
panelColor?: string;
|
|
57
|
-
/** A surface theme name the app registers, for the panel. */
|
|
57
|
+
/** A surface theme name the app registers, for the panel. Left out, the panel takes the surface one elevation above its parent. */
|
|
58
58
|
panelSurface?: string;
|
|
59
|
+
/** The trigger's `aria-label`, for a select without a visible label. */
|
|
60
|
+
ariaLabel?: string;
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
/** The stylesheets `formField()` with a `select()` control draws with: the real `et-select` CSS. */
|
|
@@ -122,10 +124,11 @@ export const selectPanel = (options: SelectPanelMockOptions) => {
|
|
|
122
124
|
'et-select-panel',
|
|
123
125
|
'et-color--inherited',
|
|
124
126
|
options.color && `et-color--${options.color}`,
|
|
125
|
-
`et-surface--${options.surface
|
|
127
|
+
options.surface && `et-surface--${options.surface}`,
|
|
126
128
|
].filter(Boolean);
|
|
129
|
+
const autoSurface = options.surface ? '' : ' data-et-auto-surface';
|
|
127
130
|
|
|
128
|
-
return `<et-select-panel class="${classes.join(' ')}"><div class="et-select-panel-scroller et-scrollbar-host"><div class="et-select-panel-body"><div ${listbox.join(' ')}>${options.content}</div><div class="et-select-panel-extras"></div></div></div><et-scrollbar class="et-scrollbar" data-orientation="vertical"><div class="et-scrollbar-thumb"></div></et-scrollbar></et-select-panel>`;
|
|
131
|
+
return `<et-select-panel${autoSurface} class="${classes.join(' ')}"><div class="et-select-panel-scroller et-scrollbar-host"><div class="et-select-panel-body"><div ${listbox.join(' ')}>${options.content}</div><div class="et-select-panel-extras"></div></div></div><et-scrollbar class="et-scrollbar" data-orientation="vertical"><div class="et-scrollbar-thumb"></div></et-scrollbar></et-select-panel>`;
|
|
129
132
|
};
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -157,7 +160,8 @@ export const select = (options: SelectMockOptions): FormFieldControlMock => {
|
|
|
157
160
|
'role="combobox"',
|
|
158
161
|
'aria-haspopup="listbox"',
|
|
159
162
|
`aria-expanded="${state.open}"`,
|
|
160
|
-
`aria-
|
|
163
|
+
options.ariaLabel && `aria-label="${options.ariaLabel}"`,
|
|
164
|
+
state.labelId && `aria-labelledby="${state.labelId} ${triggerId}"`,
|
|
161
165
|
`tabindex="${state.disabled ? -1 : 0}"`,
|
|
162
166
|
state.disabled && 'aria-disabled="true" data-disabled="true"',
|
|
163
167
|
state.open && activeIndex >= 0 && `aria-activedescendant="et-select-option-${state.id}-${activeIndex}"`,
|
package/design/textarea.ts
CHANGED
|
@@ -37,6 +37,7 @@ export const textareaField = (options: TextareaFieldMockOptions = {}) => {
|
|
|
37
37
|
mixed,
|
|
38
38
|
mixedLabel = 'Mixed',
|
|
39
39
|
force,
|
|
40
|
+
ariaLabel,
|
|
40
41
|
...field
|
|
41
42
|
} = options;
|
|
42
43
|
const forced = forceList(force);
|
|
@@ -47,6 +48,7 @@ export const textareaField = (options: TextareaFieldMockOptions = {}) => {
|
|
|
47
48
|
rows,
|
|
48
49
|
autosize,
|
|
49
50
|
minRows,
|
|
51
|
+
ariaLabel,
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
let html = formField({
|
package/design/tooltip.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type TooltipMockOptions = {
|
|
|
11
11
|
content?: string;
|
|
12
12
|
/** The side the pane opened on; the arrow points back at the trigger. Defaults to `top`. */
|
|
13
13
|
placement?: Placement;
|
|
14
|
-
/** A surface theme name the app registers. */
|
|
14
|
+
/** A surface theme name the app registers. Left out, the pane takes the surface one elevation above its parent. */
|
|
15
15
|
surface?: string;
|
|
16
16
|
/** The tooltip id, which the trigger's `aria-describedby` points at. */
|
|
17
17
|
id?: string;
|
|
@@ -58,7 +58,7 @@ export const tooltipStyles = /* @__PURE__ */ [
|
|
|
58
58
|
*/
|
|
59
59
|
export const tooltip = (options: TooltipMockOptions = {}) => {
|
|
60
60
|
const { placement = 'top', id = 'et-tooltip-1' } = options;
|
|
61
|
-
const surface = `et-surface--${options.surface
|
|
61
|
+
const surface = options.surface && `et-surface--${options.surface}`;
|
|
62
62
|
const hasTemplate = options.content !== undefined;
|
|
63
63
|
|
|
64
64
|
const paneClasses = [
|
|
@@ -71,17 +71,17 @@ export const tooltip = (options: TooltipMockOptions = {}) => {
|
|
|
71
71
|
surface,
|
|
72
72
|
'et-with-default-animation',
|
|
73
73
|
'et-animation-enter-done',
|
|
74
|
-
];
|
|
74
|
+
].filter(Boolean);
|
|
75
75
|
|
|
76
76
|
const tooltipAttributes = [
|
|
77
77
|
options.attributes,
|
|
78
78
|
'role="tooltip"',
|
|
79
|
-
`class="et-tooltip et-color--inherited ${surface}"`,
|
|
79
|
+
`class="et-tooltip et-color--inherited ${surface ?? 'et-surface--inherited'}"`,
|
|
80
80
|
`id="${id}"`,
|
|
81
81
|
hasTemplate && 'data-has-template="true"',
|
|
82
82
|
].filter(Boolean);
|
|
83
83
|
|
|
84
84
|
const body = hasTemplate ? options.content : `<p class="et-tooltip__text">${options.text ?? ''}</p>`;
|
|
85
85
|
|
|
86
|
-
return `<div class="et-tooltip-mock-frame"><div class="${paneClasses.join(' ')}" data-overlay-placement="${placement}"><et-tooltip ${tooltipAttributes.join(' ')}><div class="et-tooltip__surface"><div class="et-tooltip__content">${body}</div></div></et-tooltip><div et-floating-arrow class="et-overlay-arrow"></div></div></div>`;
|
|
86
|
+
return `<div class="et-tooltip-mock-frame"><div class="${paneClasses.join(' ')}" data-overlay-placement="${placement}"${surface ? '' : ' data-et-auto-surface'}><et-tooltip ${tooltipAttributes.join(' ')}><div class="et-tooltip__surface"><div class="et-tooltip__content">${body}</div></div></et-tooltip><div et-floating-arrow class="et-overlay-arrow"></div></div></div>`;
|
|
87
87
|
};
|