@agility/plenum-ui 2.0.0-rc24 → 2.0.0-rc26
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/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +2 -2
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +2 -2
- package/package.json +1 -1
- package/stories/atoms/icons/DynamicIcon.stories.ts +1 -1
- package/stories/atoms/icons/DynamicIcon.tsx +24 -15
- package/stories/atoms/icons/IconWithShadow.stories.ts +1 -1
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +4 -3
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +3 -2
- package/stories/organisms/DropdownComponent/dropdownItems.ts +3 -3
|
@@ -6,10 +6,10 @@ import { TablerIconName } from "./tablerIconNames";
|
|
|
6
6
|
import { ClassNameWithAutocomplete } from "@/utils/types";
|
|
7
7
|
export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons;
|
|
8
8
|
export type FAIconName = keyof typeof FA;
|
|
9
|
-
export type UnifiedIconName = IconName | TablerIconName
|
|
9
|
+
export type UnifiedIconName = IconName | TablerIconName;
|
|
10
10
|
export declare function isHeroIcon(name: UnifiedIconName): name is keyof typeof SolidIcons | keyof typeof OutlineIcons;
|
|
11
11
|
export declare function isTablerIcon(name: UnifiedIconName): name is TablerIconName;
|
|
12
|
-
export declare function isFAIcon(name: UnifiedIconName):
|
|
12
|
+
export declare function isFAIcon(name: UnifiedIconName): boolean;
|
|
13
13
|
export declare function isUnifiedIconName(name: UnifiedIconName): name is UnifiedIconName;
|
|
14
14
|
export interface IDynamicIconProps {
|
|
15
15
|
icon: UnifiedIconName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Placement } from "@floating-ui/react";
|
|
3
3
|
import { ClassNameWithAutocomplete } from "utils/types";
|
|
4
4
|
import { IDynamicIconProps } from "@/stories/atoms/icons";
|
|
@@ -10,7 +10,7 @@ export interface IItemProp {
|
|
|
10
10
|
isEmphasized?: boolean;
|
|
11
11
|
key: React.Key;
|
|
12
12
|
}
|
|
13
|
-
export interface IDropdownProps
|
|
13
|
+
export interface IDropdownProps {
|
|
14
14
|
items: IItemProp[][];
|
|
15
15
|
label: string;
|
|
16
16
|
CustomDropdownTrigger?: React.ReactNode;
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons
|
|
|
14
14
|
|
|
15
15
|
export type FAIconName = keyof typeof FA
|
|
16
16
|
|
|
17
|
-
export type UnifiedIconName = IconName | TablerIconName | FAIconName
|
|
17
|
+
export type UnifiedIconName = IconName | TablerIconName //HACK to eliminate some icons... | FAIconName
|
|
18
18
|
|
|
19
19
|
export function isHeroIcon(name: UnifiedIconName): name is keyof typeof SolidIcons | keyof typeof OutlineIcons {
|
|
20
20
|
return name in SolidIcons || name in OutlineIcons
|
|
@@ -24,9 +24,15 @@ export function isTablerIcon(name: UnifiedIconName): name is TablerIconName {
|
|
|
24
24
|
return tablerIconNames.includes(name as TablerIconName)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export function isFAIcon(name: UnifiedIconName): name is keyof typeof FA {
|
|
28
|
-
|
|
27
|
+
// export function isFAIcon(name: UnifiedIconName): name is keyof typeof FA {
|
|
28
|
+
// return name in FA
|
|
29
|
+
// }
|
|
30
|
+
|
|
31
|
+
//HACK
|
|
32
|
+
export function isFAIcon(name: UnifiedIconName) {
|
|
33
|
+
return false
|
|
29
34
|
}
|
|
35
|
+
|
|
30
36
|
export function isUnifiedIconName(name: UnifiedIconName): name is UnifiedIconName {
|
|
31
37
|
return isTablerIcon(name) || isFAIcon(name)
|
|
32
38
|
}
|
|
@@ -50,6 +56,8 @@ export const DynamicIcon = ({
|
|
|
50
56
|
return <i {...{ ...props, className: "flex items-center justify-center" }}>{CustomSVG}</i>
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
const iconStr = icon as string
|
|
60
|
+
|
|
53
61
|
if (isTablerIcon(icon)) {
|
|
54
62
|
return (
|
|
55
63
|
<TablerIcon
|
|
@@ -63,18 +71,19 @@ export const DynamicIcon = ({
|
|
|
63
71
|
/>
|
|
64
72
|
)
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
//HACK
|
|
75
|
+
// if (isFAIcon(icon)) {
|
|
76
|
+
// const Icon = FA[icon]
|
|
77
|
+
// return (
|
|
78
|
+
// <i {...{ ...props, className: "flex items-center justify-center" }}>
|
|
79
|
+
// <Icon
|
|
80
|
+
// className={cn(className, {
|
|
81
|
+
// "h-5 w-5 text-gray-600": !className
|
|
82
|
+
// })}
|
|
83
|
+
// />
|
|
84
|
+
// </i>
|
|
85
|
+
// )
|
|
86
|
+
// }
|
|
78
87
|
if (isHeroIcon(icon)) {
|
|
79
88
|
const Icon = outline ? OutlineIcons[icon] : SolidIcons[icon]
|
|
80
89
|
return (
|
|
@@ -12,13 +12,14 @@ const dropdownDataWithIcons: IItemProp[][] = [
|
|
|
12
12
|
[
|
|
13
13
|
{
|
|
14
14
|
icon: {
|
|
15
|
-
icon: "
|
|
15
|
+
icon: "IconCopy"
|
|
16
16
|
|
|
17
17
|
// className: "h-5 w-5",
|
|
18
18
|
// outline: false
|
|
19
19
|
},
|
|
20
|
+
iconPosition: "leading",
|
|
20
21
|
key: "Copy",
|
|
21
|
-
label: "Copy",
|
|
22
|
+
label: "Copy The Thing",
|
|
22
23
|
onClick: () => {
|
|
23
24
|
console.log("Copy action")
|
|
24
25
|
}
|
|
@@ -45,7 +46,7 @@ const dropdownDataWithIcons: IItemProp[][] = [
|
|
|
45
46
|
className: "h-5 w-5",
|
|
46
47
|
outline: false
|
|
47
48
|
},
|
|
48
|
-
iconPosition: "
|
|
49
|
+
iconPosition: "leading",
|
|
49
50
|
key: "View Batch",
|
|
50
51
|
label: "View Batch",
|
|
51
52
|
onClick: () => {
|
|
@@ -20,7 +20,7 @@ import { ClassNameWithAutocomplete } from "utils/types"
|
|
|
20
20
|
import { DynamicIcon, IDynamicIconProps, UnifiedIconName } from "@/stories/atoms/icons"
|
|
21
21
|
|
|
22
22
|
export interface IItemProp {
|
|
23
|
-
//Don't think this needs to
|
|
23
|
+
//Don't think this needs to extend HtmlButton... extends HTMLAttributes<HTMLButtonElement> {
|
|
24
24
|
icon?: IDynamicIconProps
|
|
25
25
|
iconPosition?: "trailing" | "leading"
|
|
26
26
|
label: string
|
|
@@ -29,7 +29,8 @@ export interface IItemProp {
|
|
|
29
29
|
key: React.Key
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export interface IDropdownProps
|
|
32
|
+
export interface IDropdownProps {
|
|
33
|
+
//this doesn't need to extend div... extends HTMLAttributes<HTMLDivElement> {
|
|
33
34
|
items: IItemProp[][]
|
|
34
35
|
label: string
|
|
35
36
|
CustomDropdownTrigger?: React.ReactNode
|
|
@@ -10,7 +10,7 @@ export const dropdownDataBase: IItemProp[][] = [
|
|
|
10
10
|
// outline: false
|
|
11
11
|
},
|
|
12
12
|
key: "Copy",
|
|
13
|
-
label: "Copy",
|
|
13
|
+
label: "Copy to Clipboard",
|
|
14
14
|
onClick: () => {
|
|
15
15
|
console.log("Copy action")
|
|
16
16
|
}
|
|
@@ -66,13 +66,13 @@ export const dropdownDataWithIcons: IItemProp[][] = [
|
|
|
66
66
|
[
|
|
67
67
|
{
|
|
68
68
|
icon: {
|
|
69
|
-
icon: "
|
|
69
|
+
icon: "IconCopy",
|
|
70
70
|
className: "h-5 w-5",
|
|
71
71
|
outline: false
|
|
72
72
|
},
|
|
73
73
|
iconPosition: "leading",
|
|
74
74
|
key: "Copy",
|
|
75
|
-
label: "Copy",
|
|
75
|
+
label: "Copy Item",
|
|
76
76
|
onClick: () => {
|
|
77
77
|
console.log("Copy action")
|
|
78
78
|
}
|