huspy-icons 0.1.2 → 0.1.4

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.
Binary file
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/native/index.ts","../../src/native/Icon.tsx","../../src/native/glyphMap.ts"],"sourcesContent":["/**\n * Huspy Icons - React Native (Font-based)\n * \n * This package provides icon components for React Native using a custom font.\n * \n * @example\n * ```tsx\n * import { Icon } from 'huspy-icons/native';\n * \n * function MyComponent() {\n * return <Icon name=\"arrow-left\" size={24} color=\"#000\" />;\n * }\n * ```\n */\n\nexport { default as Icon } from './Icon';\nexport type { IconProps, IconName } from './Icon';\nexport { glyphMap, fontFamily } from './glyphMap';\n","import * as React from 'react';\nimport { Text, TextProps, Platform } from 'react-native';\nimport { glyphMap, fontFamily, IconName } from './glyphMap';\n\n/**\n * Props for the Icon component (React Native)\n */\nexport interface IconProps extends Omit<TextProps, 'children'> {\n /**\n * Name of the icon to display\n */\n name: IconName;\n \n /**\n * Size of the icon (default: 16)\n */\n size?: number;\n \n /**\n * Color of the icon (default: inherits from parent or 'black')\n */\n color?: string;\n}\n\n/**\n * Icon component for React Native\n * \n * Renders icons using a custom font (HuspyIcons)\n * \n * @example\n * ```tsx\n * <Icon name=\"arrow-left\" size={24} color=\"#000\" />\n * ```\n */\nconst Icon = ({ name, size = 16, color = '#000', style, ...props }: IconProps) => {\n const codepoint = glyphMap[name];\n \n if (!codepoint) {\n if (__DEV__) {\n console.warn(`Icon \"${name}\" not found in HuspyIcons font`);\n }\n return null;\n }\n \n // Convert codepoint to character\n const glyph = String.fromCharCode(codepoint);\n \n return (\n <Text\n {...props}\n style={[\n {\n fontFamily: fontFamily,\n fontSize: size,\n color: color,\n // Ensure icon doesn't inherit text styles\n fontWeight: 'normal',\n fontStyle: 'normal',\n },\n style,\n ]}\n // Accessibility\n accessible\n accessibilityLabel={props.accessibilityLabel || name}\n accessibilityRole=\"image\"\n >\n {glyph}\n </Text>\n );\n};\n\nexport default Icon;\nexport type { IconName };\n","// Auto-generated by generate-font.js - do not edit manually\n// Source: icons-src/*.svg → dist/fonts/HuspyIcons.*\n\n/**\n * Available icon names in the HuspyIcons font\n */\nexport type IconName = 'icon-slot' | 'arrow-up-right' | 'arrow-left';\n\n/**\n * Mapping of icon names to unicode codepoints\n * Used by the Icon component to render the correct glyph\n */\nexport const glyphMap: Record<IconName, number> = {\n \"icon-slot\": 61697,\n \"arrow-up-right\": 61698,\n \"arrow-left\": 61699\n};\n\n/**\n * Font family name for React Native\n */\nexport const fontFamily = 'HuspyIcons';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,0BAA0C;;;ACWnC,IAAM,WAAqC;AAAA,EAChD,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAKO,IAAM,aAAa;;;ADa1B,IAAM,OAAO,CAAC,EAAE,MAAM,OAAO,IAAI,QAAQ,QAAQ,OAAO,GAAG,MAAM,MAAiB;AAChF,QAAM,YAAY,SAAS,IAAI;AAE/B,MAAI,CAAC,WAAW;AACd,QAAI,SAAS;AACX,cAAQ,KAAK,SAAS,IAAI,gCAAgC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAGA,QAAM,QAAQ,OAAO,aAAa,SAAS;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL;AAAA,UACE;AAAA,UACA,UAAU;AAAA,UACV;AAAA;AAAA,UAEA,YAAY;AAAA,UACZ,WAAW;AAAA,QACb;AAAA,QACA;AAAA,MACF;AAAA,MAEA,YAAU;AAAA,MACV,oBAAoB,MAAM,sBAAsB;AAAA,MAChD,mBAAkB;AAAA;AAAA,IAEjB;AAAA,EACH;AAEJ;AAEA,IAAO,eAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/native/index.ts","../../src/native/Icon.tsx","../../src/native/glyphMap.ts"],"sourcesContent":["/**\n * Huspy Icons - React Native (Font-based)\n * \n * This package provides icon components for React Native using a custom font.\n * \n * @example\n * ```tsx\n * import { Icon } from 'huspy-icons/native';\n * \n * function MyComponent() {\n * return <Icon name=\"arrow-left\" size={24} color=\"#000\" />;\n * }\n * ```\n */\n\nexport { default as Icon } from './Icon';\nexport type { IconProps, IconName } from './Icon';\nexport { glyphMap, fontFamily } from './glyphMap';\n\n","import * as React from 'react';\nimport { Text, TextProps, Platform } from 'react-native';\nimport { glyphMap, fontFamily, IconName } from './glyphMap';\n\n/**\n * Props for the Icon component (React Native)\n */\nexport interface IconProps extends Omit<TextProps, 'children'> {\n /**\n * Name of the icon to display\n */\n name: IconName;\n \n /**\n * Size of the icon (default: 16)\n */\n size?: number;\n \n /**\n * Color of the icon (default: inherits from parent or 'black')\n */\n color?: string;\n}\n\n/**\n * Icon component for React Native\n * \n * Renders icons using a custom font (HuspyIcons)\n * \n * @example\n * ```tsx\n * <Icon name=\"arrow-left\" size={24} color=\"#000\" />\n * ```\n */\nconst Icon = ({ name, size = 16, color = '#000', style, ...props }: IconProps) => {\n const codepoint = glyphMap[name];\n \n if (!codepoint) {\n if (__DEV__) {\n console.warn(`Icon \"${name}\" not found in HuspyIcons font`);\n }\n return null;\n }\n \n // Convert codepoint to character\n const glyph = String.fromCharCode(codepoint);\n \n return (\n <Text\n {...props}\n style={[\n {\n fontFamily: fontFamily,\n fontSize: size,\n color: color,\n // Ensure icon doesn't inherit text styles\n fontWeight: 'normal',\n fontStyle: 'normal',\n },\n style,\n ]}\n // Accessibility\n accessible\n accessibilityLabel={props.accessibilityLabel || name}\n accessibilityRole=\"image\"\n >\n {glyph}\n </Text>\n );\n};\n\nexport default Icon;\nexport type { IconName };\n\n","// Auto-generated by generate-font.js - do not edit manually\n// Source: icons-src/*.svg → dist/fonts/HuspyIcons.*\n\n/**\n * Available icon names in the HuspyIcons font\n */\nexport type IconName = 'icon-slot' | 'arrow-up-right' | 'arrow-left';\n\n/**\n * Mapping of icon names to unicode codepoints\n * Used by the Icon component to render the correct glyph\n */\nexport const glyphMap: Record<IconName, number> = {\n \"icon-slot\": 61697,\n \"arrow-up-right\": 61698,\n \"arrow-left\": 61699\n};\n\n/**\n * Font family name for React Native\n */\nexport const fontFamily = 'HuspyIcons';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,0BAA0C;;;ACWnC,IAAM,WAAqC;AAAA,EAChD,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAKO,IAAM,aAAa;;;ADa1B,IAAM,OAAO,CAAC,EAAE,MAAM,OAAO,IAAI,QAAQ,QAAQ,OAAO,GAAG,MAAM,MAAiB;AAChF,QAAM,YAAY,SAAS,IAAI;AAE/B,MAAI,CAAC,WAAW;AACd,QAAI,SAAS;AACX,cAAQ,KAAK,SAAS,IAAI,gCAAgC;AAAA,IAC5D;AACA,WAAO;AAAA,EACT;AAGA,QAAM,QAAQ,OAAO,aAAa,SAAS;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL;AAAA,UACE;AAAA,UACA,UAAU;AAAA,UACV;AAAA;AAAA,UAEA,YAAY;AAAA,UACZ,WAAW;AAAA,QACb;AAAA,QACA;AAAA,MACF;AAAA,MAEA,YAAU;AAAA,MACV,oBAAoB,MAAM,sBAAsB;AAAA,MAChD,mBAAkB;AAAA;AAAA,IAEjB;AAAA,EACH;AAEJ;AAEA,IAAO,eAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huspy-icons",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Cross-platform icon package for Huspy - React and React Native compatible",
5
5
  "author": "Huspy",
6
6
  "license": "MIT",
@@ -28,7 +28,9 @@
28
28
  "types": "./dist/native/index.d.ts",
29
29
  "require": "./dist/native/index.js",
30
30
  "default": "./dist/native/index.js"
31
- }
31
+ },
32
+ "./dist/fonts/*": "./dist/fonts/*",
33
+ "./fonts/*": "./dist/fonts/*"
32
34
  },
33
35
  "files": [
34
36
  "dist",
@@ -71,3 +71,4 @@ const Icon = ({ name, size = 16, color = '#000', style, ...props }: IconProps) =
71
71
 
72
72
  export default Icon;
73
73
  export type { IconName };
74
+
@@ -16,3 +16,4 @@
16
16
  export { default as Icon } from './Icon';
17
17
  export type { IconProps, IconName } from './Icon';
18
18
  export { glyphMap, fontFamily } from './glyphMap';
19
+
@@ -1,9 +0,0 @@
1
- export enum HuspyIcons {
2
- ArrowLeft = "HuspyIcons-arrow-left",
3
- ArrowUpRight = "HuspyIcons-arrow-up-right",
4
- IconSlot = "HuspyIcons-icon-slot"
5
- }
6
-
7
- export type HuspyIconsClassname = "HuspyIcons-arrow-left" | "HuspyIcons-arrow-up-right" | "HuspyIcons-icon-slot"
8
- export type HuspyIconsIcon = "arrow-left" | "arrow-up-right" | "icon-slot"
9
- export const HuspyIconsPrefix = "HuspyIcons-"
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <defs>
5
- <font id="HuspyIcons" horiz-adv-x="24">
6
- <font-face font-family="HuspyIcons"
7
- units-per-em="24" ascent="24"
8
- descent="0" />
9
- <missing-glyph horiz-adv-x="0" />
10
- <glyph glyph-name="arrow-left"
11
- unicode="&#xE000;"
12
- horiz-adv-x="24" d="M12.7071 19.70711C13.0976 19.31658 13.0976 18.68342 12.7071 18.29289L6.41421 12L12.7071 5.7071C13.0976 5.3166 13.0976 4.6834 12.7071 4.2929C12.3166 3.9024 11.6834 3.9024 11.2929 4.2929L4.29289 11.2929C3.90237 11.6834 3.90237 12.3166 4.29289 12.7071L11.2929 19.70711C11.6834 20.09763 12.3166 20.09763 12.7071 19.70711zM4 12C4 12.5523 4.44772 13 5 13H19C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11H5C4.44772 11 4 11.4477 4 12z" />
13
- <glyph glyph-name="arrow-up-right"
14
- unicode="&#xE001;"
15
- horiz-adv-x="24" d="M6 17C6 17.55228 6.44772 18 7 18H17C17.5523 18 18 17.55228 18 17V7C18 6.4477 17.5523 6 17 6C16.4477 6 16 6.4477 16 7V16H7C6.44772 16 6 16.44772 6 17zM17.7071 17.70711C18.0976 17.31658 18.0976 16.68342 17.7071 16.29289L7.70711 6.2929C7.31658 5.9024 6.68342 5.9024 6.29289 6.2929C5.90237 6.6834 5.90237 7.3166 6.29289 7.7071L16.2929 17.70711C16.6834 18.09763 17.3166 18.09763 17.7071 17.70711z" />
16
- <glyph glyph-name="icon-slot"
17
- unicode="&#xE002;"
18
- horiz-adv-x="15" d="M13.3333 7.66667C13.3333 10.98038 10.647 13.66667 7.33333 13.66667C4.01962 13.66667 1.33333 10.98038 1.33333 7.66667C1.33333 4.353 4.01962 1.6667 7.33333 1.6667C10.647 1.6667 13.3333 4.353 13.3333 7.66667zM14.6667 7.66667C14.6667 3.6166 11.3834 0.3333 7.33333 0.3333C3.28325 0.3333 0 3.6166 0 7.66667C0 11.71675 3.28325 15 7.33333 15C11.3834 15 14.6667 11.71675 14.6667 7.66667z" />
19
- </font>
20
- </defs>
21
- </svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"><symbol viewBox="0 0 24 24" id="HuspyIcons-arrow-left"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7071 4.29289C13.0976 4.68342 13.0976 5.31658 12.7071 5.70711L6.41421 12L12.7071 18.2929C13.0976 18.6834 13.0976 19.3166 12.7071 19.7071C12.3166 20.0976 11.6834 20.0976 11.2929 19.7071L4.29289 12.7071C3.90237 12.3166 3.90237 11.6834 4.29289 11.2929L11.2929 4.29289C11.6834 3.90237 12.3166 3.90237 12.7071 4.29289Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4 12C4 11.4477 4.44772 11 5 11H19C19.5523 11 20 11.4477 20 12C20 12.5523 19.5523 13 19 13H5C4.44772 13 4 12.5523 4 12Z" fill="currentColor"></path></symbol><symbol viewBox="0 0 24 24" id="HuspyIcons-arrow-up-right"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C6 6.44772 6.44772 6 7 6H17C17.5523 6 18 6.44772 18 7V17C18 17.5523 17.5523 18 17 18C16.4477 18 16 17.5523 16 17V8H7C6.44772 8 6 7.55228 6 7Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.7071 6.29289C18.0976 6.68342 18.0976 7.31658 17.7071 7.70711L7.70711 17.7071C7.31658 18.0976 6.68342 18.0976 6.29289 17.7071C5.90237 17.3166 5.90237 16.6834 6.29289 16.2929L16.2929 6.29289C16.6834 5.90237 17.3166 5.90237 17.7071 6.29289Z" fill="currentColor"></path></symbol><symbol viewBox="0 0 15 15" id="HuspyIcons-icon-slot"><path d="M13.3333 7.33333C13.3333 4.01962 10.647 1.33333 7.33333 1.33333C4.01962 1.33333 1.33333 4.01962 1.33333 7.33333C1.33333 10.647 4.01962 13.3333 7.33333 13.3333C10.647 13.3333 13.3333 10.647 13.3333 7.33333ZM14.6667 7.33333C14.6667 11.3834 11.3834 14.6667 7.33333 14.6667C3.28325 14.6667 0 11.3834 0 7.33333C0 3.28325 3.28325 0 7.33333 0C11.3834 0 14.6667 3.28325 14.6667 7.33333Z" fill="currentColor"></path></symbol></svg>