Skip to content

Commit d2d7ab0

Browse files
committed
Re-export GlyphName instead of IconGlyph
1 parent 1cc3a42 commit d2d7ab0

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

packages/compass-components/src/components/workspace-tabs/tab.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
22
import { css, cx } from '@leafygreen-ui/emotion';
33
import { palette } from '@leafygreen-ui/palette';
44
import { spacing } from '@leafygreen-ui/tokens';
5-
import type { glyphs } from '@leafygreen-ui/icon';
5+
import type { GlyphName } from '@leafygreen-ui/icon';
66
import { useSortable } from '@dnd-kit/sortable';
77
import { CSS as cssDndKit } from '@dnd-kit/utilities';
88
import { useDarkMode } from '../../hooks/use-theme';
@@ -180,8 +180,6 @@ const closeButtonStyles = css({
180180
marginRight: spacing[100],
181181
});
182182

183-
type IconGlyph = Extract<keyof typeof glyphs, string>;
184-
185183
type TabProps = {
186184
connectionName?: string;
187185
type: string;
@@ -190,7 +188,7 @@ type TabProps = {
190188
isDragging: boolean;
191189
onSelect: () => void;
192190
onClose: () => void;
193-
iconGlyph: IconGlyph | 'Logo' | 'Server';
191+
iconGlyph: GlyphName | 'Logo' | 'Server';
194192
tabContentId: string;
195193
tooltip?: [string, string][];
196194
tabTheme?: Partial<TabTheme>;

packages/compass-components/src/components/workspace-tabs/workspace-tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, {
88
import { css, cx } from '@leafygreen-ui/emotion';
99
import { palette } from '@leafygreen-ui/palette';
1010
import { spacing } from '@leafygreen-ui/tokens';
11-
import type { glyphs } from '@leafygreen-ui/icon';
11+
import type { GlyphName } from '@leafygreen-ui/icon';
1212
import { rgba } from 'polished';
1313

1414
import {
@@ -174,7 +174,7 @@ export type TabProps = {
174174
title: string;
175175
tooltip?: [string, string][];
176176
connectionId?: string;
177-
iconGlyph: Extract<keyof typeof glyphs, string> | 'Logo' | 'Server';
177+
iconGlyph: GlyphName | 'Logo' | 'Server';
178178
} & Omit<React.HTMLProps<HTMLDivElement>, 'id' | 'title'>;
179179

180180
export function useRovingTabIndex<T extends HTMLElement = HTMLElement>({

packages/compass-components/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,13 @@ export {
143143
FadeInPlaceholder,
144144
} from './components/content-with-fallback';
145145
export { InlineDefinition } from './components/inline-definition';
146-
import type { glyphs } from '@leafygreen-ui/icon';
146+
export type { GlyphName } from '@leafygreen-ui/icon';
147147
export { createGlyphComponent, createIconComponent } from '@leafygreen-ui/icon';
148148
export {
149149
SignalPopover,
150150
SignalHooksProvider,
151151
} from './components/signal-popover';
152152
export type { Signal } from './components/signal-popover';
153-
export type IconGlyph = Extract<keyof typeof glyphs, string>;
154153

155154
export { EmptyContent } from './components/empty-content';
156155
export { ErrorBoundary } from './components/error-boundary';

packages/compass-editor/src/action-button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { cx } from '@mongodb-js/compass-components';
22
import { css } from '@mongodb-js/compass-components';
3-
import { Button, Icon, type IconGlyph } from '@mongodb-js/compass-components';
3+
import { Button, Icon, type GlyphName } from '@mongodb-js/compass-components';
44
import React, { useCallback, useEffect, useState } from 'react';
55
import type { EditorView } from '@codemirror/view';
66

77
export type Action = {
8-
icon: IconGlyph;
8+
icon: GlyphName;
99
label: string;
1010
action: (editor: EditorView) => boolean | void;
1111
};

packages/databases-collections-list/src/namespace-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from '@mongodb-js/compass-components';
2121
import type {
2222
BadgeVariant,
23-
IconGlyph,
23+
GlyphName,
2424
ItemAction,
2525
SignalPopover,
2626
} from '@mongodb-js/compass-components';
@@ -107,7 +107,7 @@ export type BadgeProp = {
107107
id: string;
108108
name: string;
109109
variant?: BadgeVariant;
110-
icon?: IconGlyph;
110+
icon?: GlyphName;
111111
hint?: React.ReactNode;
112112
};
113113

0 commit comments

Comments
 (0)