@plusscommunities/pluss-icons 1.0.1 → 1.0.3-beta.0
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.js +9 -97
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -21,46 +21,6 @@ var getIconList = pack => Object.keys(pack).filter(key => key.startsWith("fa") &
|
|
|
21
21
|
// Add all icon packs to the library
|
|
22
22
|
library.add(...getIconList(solidIcons), ...getIconList(regularIcons), ...getIconList(lightIcons), ...getIconList(duotoneIcons));
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* FontAwesome icon type/style.
|
|
26
|
-
*
|
|
27
|
-
* @typedef {'solid' | 'regular' | 'light' | 'duotone'} IconType
|
|
28
|
-
*
|
|
29
|
-
* @property {string} solid - Filled icons (default) - prefix: `fas`
|
|
30
|
-
* @property {string} regular - Outlined icons - prefix: `far`
|
|
31
|
-
* @property {string} light - Thinner outlined icons - prefix: `fal`
|
|
32
|
-
* @property {string} duotone - Two-color icons - prefix: `fad`
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Solid (default - filled style)
|
|
36
|
-
* <Icon icon="house" type="solid" />
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Regular (outline style)
|
|
40
|
-
* <Icon icon="user" type="regular" />
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* // Light (thinner outline)
|
|
44
|
-
* <Icon icon="heart" type="light" />
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* // Duotone (two-color)
|
|
48
|
-
* <Icon icon="star" type="duotone" />
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Props for the Icon component.
|
|
53
|
-
*
|
|
54
|
-
* @typedef {Object} IconProps
|
|
55
|
-
* @property {string} icon - The icon name (e.g., "house", "spinner", "user")
|
|
56
|
-
* @property {IconType} [type='solid'] - The icon type: "solid", "regular", "light", or "duotone"
|
|
57
|
-
* @property {boolean} [pulse] - Whether the icon should pulse (animate)
|
|
58
|
-
* @property {boolean} [fixedWidth] - Whether the icon should have fixed width
|
|
59
|
-
* @property {boolean} [spin] - Whether the icon should spin
|
|
60
|
-
* @property {string} [className] - Additional CSS classes
|
|
61
|
-
* @property {Object} [rest] - Additional props passed to FontAwesomeIcon
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
24
|
/**
|
|
65
25
|
* Type to prefix mapping for FontAwesome
|
|
66
26
|
* @type {Object.<string, string>}
|
|
@@ -72,68 +32,23 @@ var TYPE_TO_PREFIX = {
|
|
|
72
32
|
duotone: "fad"
|
|
73
33
|
};
|
|
74
34
|
|
|
75
|
-
/**
|
|
76
|
-
* Mapping of custom Pluss icon names to FontAwesome icon names
|
|
77
|
-
* @type {Object.<string, string>}
|
|
78
|
-
*/
|
|
79
|
-
var PLUSS_ICON_MAP = {
|
|
80
|
-
// Navigation & UI
|
|
81
|
-
dashboard: "house",
|
|
82
|
-
settings: "gear",
|
|
83
|
-
"triangle-exclamation": "triangle-exclamation",
|
|
84
|
-
"folder-image": "folder-open",
|
|
85
|
-
lock: "lock",
|
|
86
|
-
people: "users",
|
|
87
|
-
bolt: "bolt",
|
|
88
|
-
"pie-chart": "chart-pie",
|
|
89
|
-
stethoscope: "stethoscope",
|
|
90
|
-
// Features
|
|
91
|
-
news: "newspaper",
|
|
92
|
-
event: "calendar-days",
|
|
93
|
-
facility: "building",
|
|
94
|
-
maintenance: "screwdriver-wrench",
|
|
95
|
-
form: "file-lines",
|
|
96
|
-
tool: "screwdriver-wrench",
|
|
97
|
-
signin: "right-to-bracket",
|
|
98
|
-
// Common aliases
|
|
99
|
-
cog: "gear",
|
|
100
|
-
calendar: "calendar-days",
|
|
101
|
-
// Legacy Pluss icon mappings
|
|
102
|
-
audience: "users-rectangle",
|
|
103
|
-
"pencil-o": "pen-to-square",
|
|
104
|
-
"user-card": "address-card",
|
|
105
|
-
attachments: "paperclip"
|
|
106
|
-
};
|
|
107
|
-
|
|
108
35
|
/**
|
|
109
36
|
* Universal icon component for the Pluss Communities platform.
|
|
110
37
|
* Uses FontAwesome Pro icons.
|
|
111
38
|
*
|
|
112
|
-
* @param {
|
|
39
|
+
* @param {Object} props - The properties passed to the Icon component
|
|
40
|
+
* @param {string} props.icon - The icon name (e.g., "house", "spinner", "user")
|
|
41
|
+
* @param {string} [props.type='solid'] - The icon type: "solid", "regular", "light", or "duotone"
|
|
42
|
+
* @param {boolean} [props.pulse] - Whether the icon should pulse (animate)
|
|
43
|
+
* @param {boolean} [props.fixedWidth] - Whether the icon should have fixed width
|
|
44
|
+
* @param {boolean} [props.spin] - Whether the icon should spin
|
|
45
|
+
* @param {string} [props.className] - Additional CSS classes
|
|
113
46
|
* @returns {JSX.Element} The rendered icon
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* // Basic usage with solid icon (default)
|
|
117
|
-
* <Icon icon="house" />
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* // Different icon types
|
|
121
|
-
* <Icon icon="user" type="regular" />
|
|
122
|
-
* <Icon icon="facebook" type="brands" />
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* // With animations
|
|
126
|
-
* <Icon icon="spinner" spin />
|
|
127
|
-
* <Icon icon="heart" pulse />
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* // With custom styling
|
|
131
|
-
* <Icon icon="star" style={{ color: 'gold' }} className="large-icon" />
|
|
132
47
|
*/
|
|
133
48
|
function Icon(_ref) {
|
|
134
49
|
var {
|
|
135
50
|
icon,
|
|
136
|
-
type = "
|
|
51
|
+
type = "regular",
|
|
137
52
|
pulse,
|
|
138
53
|
fixedWidth,
|
|
139
54
|
spin,
|
|
@@ -148,11 +63,8 @@ function Icon(_ref) {
|
|
|
148
63
|
// Convert type to prefix
|
|
149
64
|
var prefix = TYPE_TO_PREFIX[type] || TYPE_TO_PREFIX.solid;
|
|
150
65
|
|
|
151
|
-
// Map custom Pluss icon names to FontAwesome names
|
|
152
|
-
var mappedIcon = PLUSS_ICON_MAP[icon] || icon;
|
|
153
|
-
|
|
154
66
|
// Build the icon definition for FontAwesome
|
|
155
|
-
var iconDef = [prefix,
|
|
67
|
+
var iconDef = [prefix, icon];
|
|
156
68
|
return /*#__PURE__*/jsx(FontAwesomeIcon, _objectSpread({
|
|
157
69
|
icon: iconDef,
|
|
158
70
|
pulse: pulse,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/Icon.js"],"sourcesContent":["/**\n * @fileoverview Universal icon component for Pluss Communities platform.\n * Uses FontAwesome Pro icons with support for multiple icon styles.\n *\n * @module @plusscommunities/pluss-icons\n * @author Pluss Communities\n * @version 1.0.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Icon.js"],"sourcesContent":["/**\n * @fileoverview Universal icon component for Pluss Communities platform.\n * Uses FontAwesome Pro 7 icons with support for multiple icon styles.\n *\n * @module @plusscommunities/pluss-icons\n * @author Pluss Communities\n * @version 1.0.1\n *\n * @requires @fortawesome/react-fontawesome\n * @requires @fortawesome/fontawesome-svg-core\n * @requires @fortawesome/pro-solid-svg-icons\n * @requires @fortawesome/pro-regular-svg-icons\n * @requires @fortawesome/pro-light-svg-icons\n * @requires @fortawesome/pro-duotone-svg-icons\n */\n\nimport React from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { library, config } from \"@fortawesome/fontawesome-svg-core\";\nimport \"@fortawesome/fontawesome-svg-core/styles.css\";\n\n// Disable auto-adding CSS - we import it manually above\nconfig.autoAddCss = false;\n\n// ============================================================================\n// ICON LIBRARY SETUP\n// ============================================================================\nimport * as solidIcons from \"@fortawesome/pro-solid-svg-icons\";\nimport * as regularIcons from \"@fortawesome/pro-regular-svg-icons\";\nimport * as lightIcons from \"@fortawesome/pro-light-svg-icons\";\nimport * as duotoneIcons from \"@fortawesome/pro-duotone-svg-icons\";\n\n// Helper to extract icon definitions from a pack\nconst getIconList = (pack) =>\n\tObject.keys(pack)\n\t\t.filter((key) => key.startsWith(\"fa\") && typeof pack[key] === \"object\")\n\t\t.map((key) => pack[key]);\n\n// Add all icon packs to the library\nlibrary.add(\n\t...getIconList(solidIcons),\n\t...getIconList(regularIcons),\n\t...getIconList(lightIcons),\n\t...getIconList(duotoneIcons),\n);\n\n/**\n * Type to prefix mapping for FontAwesome\n * @type {Object.<string, string>}\n */\nconst TYPE_TO_PREFIX = {\n\tsolid: \"fas\",\n\tregular: \"far\",\n\tlight: \"fal\",\n\tduotone: \"fad\",\n};\n\n/**\n * Universal icon component for the Pluss Communities platform.\n * Uses FontAwesome Pro icons.\n *\n * @param {Object} props - The properties passed to the Icon component\n * @param {string} props.icon - The icon name (e.g., \"house\", \"spinner\", \"user\")\n * @param {string} [props.type='solid'] - The icon type: \"solid\", \"regular\", \"light\", or \"duotone\"\n * @param {boolean} [props.pulse] - Whether the icon should pulse (animate)\n * @param {boolean} [props.fixedWidth] - Whether the icon should have fixed width\n * @param {boolean} [props.spin] - Whether the icon should spin\n * @param {string} [props.className] - Additional CSS classes\n * @returns {JSX.Element} The rendered icon\n */\nfunction Icon({\n\ticon,\n\ttype = \"regular\",\n\tpulse,\n\tfixedWidth,\n\tspin,\n\tclassName,\n\t...rest\n}) {\n\t// Return null if icon is undefined or null\n\tif (!icon) {\n\t\treturn null;\n\t}\n\n\t// Convert type to prefix\n\tconst prefix = TYPE_TO_PREFIX[type] || TYPE_TO_PREFIX.solid;\n\n\t// Build the icon definition for FontAwesome\n\tconst iconDef = [prefix, icon];\n\n\treturn (\n\t\t<FontAwesomeIcon\n\t\t\ticon={iconDef}\n\t\t\tpulse={pulse}\n\t\t\tfixedWidth={fixedWidth}\n\t\t\tspin={spin}\n\t\t\tclassName={className}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport { Icon };\n"],"names":["config","autoAddCss","getIconList","pack","Object","keys","filter","key","startsWith","map","library","add","solidIcons","regularIcons","lightIcons","duotoneIcons","TYPE_TO_PREFIX","solid","regular","light","duotone","Icon","_ref","icon","type","pulse","fixedWidth","spin","className","rest","_objectWithoutProperties","_excluded","prefix","iconDef","_jsx","FontAwesomeIcon","_objectSpread"],"mappings":";;;;;;;;;;;;;;;;AAqBA;AACAA,MAAM,CAACC,UAAU,GAAG,KAAK,CAAA;AAWzB,IAAMC,WAAW,GAAIC,IAAI,IACxBC,MAAM,CAACC,IAAI,CAACF,IAAI,CAAC,CACfG,MAAM,CAAEC,GAAG,IAAKA,GAAG,CAACC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAOL,IAAI,CAACI,GAAG,CAAC,KAAK,QAAQ,CAAC,CACtEE,GAAG,CAAEF,GAAG,IAAKJ,IAAI,CAACI,GAAG,CAAC,CAAC,CAAA;;AAE1B;AACAG,OAAO,CAACC,GAAG,CACV,GAAGT,WAAW,CAACU,UAAU,CAAC,EAC1B,GAAGV,WAAW,CAACW,YAAY,CAAC,EAC5B,GAAGX,WAAW,CAACY,UAAU,CAAC,EAC1B,GAAGZ,WAAW,CAACa,YAAY,CAC5B,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA,IAAMC,cAAc,GAAG;AACtBC,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAK;AACdC,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAA;AACV,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAAAC,IAAA,EAQV;EAAA,IARW;MACbC,IAAI;AACJC,MAAAA,IAAI,GAAG,SAAS;MAChBC,KAAK;MACLC,UAAU;MACVC,IAAI;AACJC,MAAAA,SAAAA;AAED,KAAC,GAAAN,IAAA;AADGO,IAAAA,IAAI,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA,CAAA;AAEP;EACA,IAAI,CAACR,IAAI,EAAE;AACV,IAAA,OAAO,IAAI,CAAA;AACZ,GAAA;;AAEA;EACA,IAAMS,MAAM,GAAGhB,cAAc,CAACQ,IAAI,CAAC,IAAIR,cAAc,CAACC,KAAK,CAAA;;AAE3D;AACA,EAAA,IAAMgB,OAAO,GAAG,CAACD,MAAM,EAAET,IAAI,CAAC,CAAA;AAE9B,EAAA,oBACCW,GAAA,CAACC,eAAe,EAAAC,aAAA,CAAA;AACfb,IAAAA,IAAI,EAAEU,OAAQ;AACdR,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,SAAS,EAAEA,SAAAA;GACPC,EAAAA,IAAI,CACR,CAAC,CAAA;AAEJ;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-icons",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3-beta.0",
|
|
4
4
|
"description": "Universal icon component for Pluss Communities platform using FontAwesome Pro",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"author": "Phillip Suh",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.14.0",
|
|
25
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
26
|
-
"@fortawesome/pro-solid-svg-icons": "^
|
|
27
|
-
"@fortawesome/pro-regular-svg-icons": "^
|
|
28
|
-
"@fortawesome/pro-light-svg-icons": "^
|
|
29
|
-
"@fortawesome/pro-duotone-svg-icons": "^
|
|
25
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
26
|
+
"@fortawesome/pro-solid-svg-icons": "^7.2.0",
|
|
27
|
+
"@fortawesome/pro-regular-svg-icons": "^7.2.0",
|
|
28
|
+
"@fortawesome/pro-light-svg-icons": "^7.2.0",
|
|
29
|
+
"@fortawesome/pro-duotone-svg-icons": "^7.2.0",
|
|
30
30
|
"@fortawesome/react-fontawesome": "^3.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|