File tree 4 files changed +15
-9
lines changed
4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @viamrobotics/prime-core" ,
3
- "version" : " 0.0.173 " ,
3
+ "version" : " 0.0.174 " ,
4
4
"repository" : {
5
5
"type" : " git" ,
6
6
"url" : " https://github.com/viamrobotics/prime.git" ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const sizes: Record<Size, string> = {
30
30
31
31
<script lang =" ts" >
32
32
import cx from ' classnames' ;
33
- import { paths , type IconName , type CustomIcon } from ' ./icons' ;
33
+ import { IconPathsByName , type IconName , type CustomIcon } from ' ./icons' ;
34
34
35
35
/** The name of the icon. */
36
36
export let name: IconName ;
@@ -45,7 +45,7 @@ export { extraClasses as cx };
45
45
let allPaths: CustomIcon [] = [];
46
46
47
47
$ : {
48
- const pathValue = paths [name ];
48
+ const pathValue = IconPathsByName [name ];
49
49
50
50
if (typeof pathValue === ' string' ) {
51
51
allPaths = [{ path: pathValue }];
Original file line number Diff line number Diff line change 1
1
import * as MDI from '@mdi/js' ;
2
2
3
- type Path = string ;
3
+ export type SimpleIconPath = string ;
4
4
5
5
export interface CustomIcon {
6
6
path : string ;
7
7
opacity ?: number | undefined ;
8
8
}
9
9
10
- export type IconPath = Path | CustomIcon [ ] ;
10
+ export type IconPath = SimpleIconPath | CustomIcon [ ] ;
11
11
12
12
/**
13
13
* Keys should match MDI name
14
14
* e.g. 'account-multiple' for MDI.mdiAccountMultiple
15
15
*/
16
- export const paths = {
16
+ export const IconPathsByName = {
17
17
'account-group-outline' : MDI . mdiAccountGroupOutline ,
18
18
'account-multiple' : MDI . mdiAccountMultiple ,
19
19
'alert-circle-outline' : MDI . mdiAlertCircleOutline ,
@@ -179,9 +179,9 @@ export const paths = {
179
179
'view-dashboard-outline' : MDI . mdiViewDashboardOutline ,
180
180
webhook : MDI . mdiWebhook ,
181
181
windows : MDI . mdiMicrosoftWindows ,
182
- } as const ;
182
+ } satisfies Record < string , IconPath > ;
183
183
184
184
/**
185
185
* The possible icon names that can be rendered. This is good for typing props.
186
186
*/
187
- export type IconName = keyof typeof paths ;
187
+ export type IconName = keyof typeof IconPathsByName ;
Original file line number Diff line number Diff line change 1
1
export { default as Icon } from './icon.svelte' ;
2
- export type { IconName } from './icons' ;
2
+ export {
3
+ IconPathsByName ,
4
+ type IconName ,
5
+ type IconPath ,
6
+ type SimpleIconPath ,
7
+ type CustomIcon ,
8
+ } from './icons' ;
You can’t perform that action at this time.
0 commit comments