@nori-ui/core 0.0.1
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/chunk-6NDARMPP.js +389 -0
- package/dist/chunk-6NDARMPP.js.map +1 -0
- package/dist/chunk-7QVYU63E.js +6 -0
- package/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/chunk-BRCCWMGJ.js +3 -0
- package/dist/chunk-BRCCWMGJ.js.map +1 -0
- package/dist/chunk-FXKIWONG.js +80 -0
- package/dist/chunk-FXKIWONG.js.map +1 -0
- package/dist/chunk-JGH6Z5LM.js +213 -0
- package/dist/chunk-JGH6Z5LM.js.map +1 -0
- package/dist/chunk-NDEDMCHT.js +40 -0
- package/dist/chunk-NDEDMCHT.js.map +1 -0
- package/dist/chunk-RX7UULY3.js +19 -0
- package/dist/chunk-RX7UULY3.js.map +1 -0
- package/dist/chunk-SSTXLK5I.js +66 -0
- package/dist/chunk-SSTXLK5I.js.map +1 -0
- package/dist/chunk-XGM2K4TT.js +31 -0
- package/dist/chunk-XGM2K4TT.js.map +1 -0
- package/dist/client.cjs +861 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +157 -0
- package/dist/client.d.ts +157 -0
- package/dist/client.js +50 -0
- package/dist/client.js.map +1 -0
- package/dist/i18n/index.cjs +70 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +60 -0
- package/dist/i18n/index.d.ts +60 -0
- package/dist/i18n/index.js +4 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +56 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +38 -0
- package/dist/icons/index.d.ts +38 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +820 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +187 -0
- package/dist/index.d.ts +187 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/slot/index.cjs +85 -0
- package/dist/slot/index.cjs.map +1 -0
- package/dist/slot/index.d.cts +13 -0
- package/dist/slot/index.d.ts +13 -0
- package/dist/slot/index.js +4 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/stories/story-registry.cjs +612 -0
- package/dist/stories/story-registry.cjs.map +1 -0
- package/dist/stories/story-registry.d.cts +13 -0
- package/dist/stories/story-registry.d.ts +13 -0
- package/dist/stories/story-registry.js +105 -0
- package/dist/stories/story-registry.js.map +1 -0
- package/dist/theme/index.cjs +216 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/utils/cn.cjs +34 -0
- package/dist/utils/cn.cjs.map +1 -0
- package/dist/utils/cn.d.cts +4 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.js +4 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Options accepted by the library's internal t() calls. Subset of i18next's TOptions. */
|
|
2
|
+
type I18nOptions = {
|
|
3
|
+
/** Used for pluralization (e.g. `items_one` vs `items_other`). */
|
|
4
|
+
count?: number;
|
|
5
|
+
/** Default text to render if the key is missing from the active dictionary. */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
/** Any other key is an interpolation value — consumed by {{var}} replacement. */
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
/** Shape-compatible with i18next's TFunction, narrowed for library usage. */
|
|
11
|
+
type TranslateFn = (key: string | string[], options?: I18nOptions) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Consumer-facing i18n input. One of:
|
|
14
|
+
* - undefined: use library defaults
|
|
15
|
+
* - TranslateFn: call it (this is the i18next drop-in path)
|
|
16
|
+
* - Dictionary: flat key → value map; value may contain `{{vars}}` and/or `_one|_other` plural suffixes
|
|
17
|
+
*/
|
|
18
|
+
type I18nInput = TranslateFn | Dictionary | undefined;
|
|
19
|
+
type Dictionary = Readonly<Record<string, string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Keys shipped by the library — augmentable by consumers via module augmentation:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* declare module 'nori-ui' {
|
|
25
|
+
* interface I18nKeys {
|
|
26
|
+
* 'myApp.customLabel': string;
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Plan 05 extends this interface as each component registers its keys.
|
|
32
|
+
*/
|
|
33
|
+
interface I18nKeys {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Default English strings used by library components.
|
|
38
|
+
*
|
|
39
|
+
* Key naming convention:
|
|
40
|
+
* <component>.<purpose>[_plural-form]
|
|
41
|
+
*
|
|
42
|
+
* Plural suffixes follow i18next: `_zero`, `_one`, `_two`, `_few`, `_many`, `_other`.
|
|
43
|
+
* Interpolation uses `{{name}}` — double braces, no spaces, by convention.
|
|
44
|
+
*/
|
|
45
|
+
declare const defaultDictionary: Dictionary;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Normalizes the consumer's i18n input (undefined | dictionary | function) into a
|
|
49
|
+
* uniform TranslateFn. Internal code only calls the returned function.
|
|
50
|
+
*
|
|
51
|
+
* Precedence for a given key lookup:
|
|
52
|
+
* 1. consumer function (if provided) — called verbatim, no further fallback
|
|
53
|
+
* 2. consumer dictionary (if provided)
|
|
54
|
+
* 3. library defaults
|
|
55
|
+
* 4. options.defaultValue
|
|
56
|
+
* 5. the key itself (so missing strings are visible in dev, not silent)
|
|
57
|
+
*/
|
|
58
|
+
declare function resolveI18n(input: I18nInput, defaults: Dictionary): TranslateFn;
|
|
59
|
+
|
|
60
|
+
export { type Dictionary, type I18nInput, type I18nKeys, type I18nOptions, type TranslateFn, defaultDictionary, resolveI18n };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Options accepted by the library's internal t() calls. Subset of i18next's TOptions. */
|
|
2
|
+
type I18nOptions = {
|
|
3
|
+
/** Used for pluralization (e.g. `items_one` vs `items_other`). */
|
|
4
|
+
count?: number;
|
|
5
|
+
/** Default text to render if the key is missing from the active dictionary. */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
/** Any other key is an interpolation value — consumed by {{var}} replacement. */
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
/** Shape-compatible with i18next's TFunction, narrowed for library usage. */
|
|
11
|
+
type TranslateFn = (key: string | string[], options?: I18nOptions) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Consumer-facing i18n input. One of:
|
|
14
|
+
* - undefined: use library defaults
|
|
15
|
+
* - TranslateFn: call it (this is the i18next drop-in path)
|
|
16
|
+
* - Dictionary: flat key → value map; value may contain `{{vars}}` and/or `_one|_other` plural suffixes
|
|
17
|
+
*/
|
|
18
|
+
type I18nInput = TranslateFn | Dictionary | undefined;
|
|
19
|
+
type Dictionary = Readonly<Record<string, string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Keys shipped by the library — augmentable by consumers via module augmentation:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* declare module 'nori-ui' {
|
|
25
|
+
* interface I18nKeys {
|
|
26
|
+
* 'myApp.customLabel': string;
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Plan 05 extends this interface as each component registers its keys.
|
|
32
|
+
*/
|
|
33
|
+
interface I18nKeys {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Default English strings used by library components.
|
|
38
|
+
*
|
|
39
|
+
* Key naming convention:
|
|
40
|
+
* <component>.<purpose>[_plural-form]
|
|
41
|
+
*
|
|
42
|
+
* Plural suffixes follow i18next: `_zero`, `_one`, `_two`, `_few`, `_many`, `_other`.
|
|
43
|
+
* Interpolation uses `{{name}}` — double braces, no spaces, by convention.
|
|
44
|
+
*/
|
|
45
|
+
declare const defaultDictionary: Dictionary;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Normalizes the consumer's i18n input (undefined | dictionary | function) into a
|
|
49
|
+
* uniform TranslateFn. Internal code only calls the returned function.
|
|
50
|
+
*
|
|
51
|
+
* Precedence for a given key lookup:
|
|
52
|
+
* 1. consumer function (if provided) — called verbatim, no further fallback
|
|
53
|
+
* 2. consumer dictionary (if provided)
|
|
54
|
+
* 3. library defaults
|
|
55
|
+
* 4. options.defaultValue
|
|
56
|
+
* 5. the key itself (so missing strings are visible in dev, not silent)
|
|
57
|
+
*/
|
|
58
|
+
declare function resolveI18n(input: I18nInput, defaults: Dictionary): TranslateFn;
|
|
59
|
+
|
|
60
|
+
export { type Dictionary, type I18nInput, type I18nKeys, type I18nOptions, type TranslateFn, defaultDictionary, resolveI18n };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var make = /* @__PURE__ */ __name((path) => /* @__PURE__ */ __name(function PlaceholderIcon({ size = 20, color = "currentColor" }) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
width: size,
|
|
12
|
+
height: size,
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
fill: "none",
|
|
15
|
+
stroke: color,
|
|
16
|
+
strokeWidth: "2",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: path })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}, "PlaceholderIcon"), "make");
|
|
24
|
+
var defaultSemanticIcons = {
|
|
25
|
+
checkmark: make("M20 6 9 17l-5-5"),
|
|
26
|
+
close: make("M18 6 6 18 M6 6l12 12"),
|
|
27
|
+
eye: make("M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"),
|
|
28
|
+
eyeOff: make("M17.94 17.94A10 10 0 0 1 2 12s3.5-7 10-7c2 0 3.8.6 5.4 1.5 M1 1l22 22"),
|
|
29
|
+
chevronDown: make("m6 9 6 6 6-6"),
|
|
30
|
+
chevronUp: make("m18 15-6-6-6 6"),
|
|
31
|
+
alertTriangle: make(
|
|
32
|
+
"M12 9v4 M12 17h.01 M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
|
|
33
|
+
),
|
|
34
|
+
info: make(
|
|
35
|
+
"M12 8h.01 M11 12h1v4h1 M12 22C6.48 22 2 17.52 2 12 2 6.48 6.48 2 12 2c5.52 0 10 4.48 10 10 0 5.52-4.48 10-10 10z"
|
|
36
|
+
),
|
|
37
|
+
check: make("M20 6 9 17l-5-5"),
|
|
38
|
+
x: make("M18 6 6 18 M6 6l12 12")
|
|
39
|
+
};
|
|
40
|
+
var SIZE_MAP = {
|
|
41
|
+
sm: 16,
|
|
42
|
+
md: 20,
|
|
43
|
+
lg: 24,
|
|
44
|
+
xl: 32
|
|
45
|
+
};
|
|
46
|
+
function Icon({ as: IconComponent, size = "md", color }) {
|
|
47
|
+
const numericSize = typeof size === "number" ? size : SIZE_MAP[size];
|
|
48
|
+
const colorProps = color === void 0 ? {} : { color };
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { size: numericSize, ...colorProps });
|
|
50
|
+
}
|
|
51
|
+
__name(Icon, "Icon");
|
|
52
|
+
|
|
53
|
+
exports.Icon = Icon;
|
|
54
|
+
exports.defaultSemanticIcons = defaultSemanticIcons;
|
|
55
|
+
//# sourceMappingURL=index.cjs.map
|
|
56
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/icons/default-semantic-icons.tsx","../../src/icons/icon.tsx"],"names":["jsx"],"mappings":";;;;;;AAcA,IAAM,IAAA,mBAAO,MAAA,CAAA,CAAC,IAAA,qBACV,MAAA,CAAA,SAAS,eAAA,CAAgB,EAAE,IAAA,GAAO,EAAA,EAAI,KAAA,GAAQ,cAAA,EAAe,EAAG;AAC5D,EAAA,uBACIA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACG,KAAA,EAAO,IAAA;AAAA,MACP,MAAA,EAAQ,IAAA;AAAA,MACR,OAAA,EAAQ,WAAA;AAAA,MACR,IAAA,EAAK,MAAA;AAAA,MACL,MAAA,EAAQ,KAAA;AAAA,MACR,WAAA,EAAY,GAAA;AAAA,MACZ,aAAA,EAAc,OAAA;AAAA,MACd,cAAA,EAAe,OAAA;AAAA,MACf,aAAA,EAAY,MAAA;AAAA,MAEZ,QAAA,kBAAAA,cAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAG,IAAA,EAAM;AAAA;AAAA,GACnB;AAER,CAAA,EAhBA,iBAAA,CAAA,EADS,MAAA,CAAA;AAgCN,IAAM,oBAAA,GAAsC;AAAA,EAC/C,SAAA,EAAW,KAAK,iBAAiB,CAAA;AAAA,EACjC,KAAA,EAAO,KAAK,uBAAuB,CAAA;AAAA,EACnC,GAAA,EAAK,KAAK,qFAAqF,CAAA;AAAA,EAC/F,MAAA,EAAQ,KAAK,uEAAuE,CAAA;AAAA,EACpF,WAAA,EAAa,KAAK,cAAc,CAAA;AAAA,EAChC,SAAA,EAAW,KAAK,gBAAgB,CAAA;AAAA,EAChC,aAAA,EAAe,IAAA;AAAA,IACX;AAAA,GACJ;AAAA,EACA,IAAA,EAAM,IAAA;AAAA,IACF;AAAA,GACJ;AAAA,EACA,KAAA,EAAO,KAAK,iBAAiB,CAAA;AAAA,EAC7B,CAAA,EAAG,KAAK,uBAAuB;AACnC;AC9CA,IAAM,QAAA,GAAsD;AAAA,EACxD,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AASO,SAAS,KAAK,EAAE,EAAA,EAAI,eAAe,IAAA,GAAO,IAAA,EAAM,OAAM,EAAc;AACvE,EAAA,MAAM,cAAc,OAAO,IAAA,KAAS,QAAA,GAAW,IAAA,GAAO,SAAS,IAAI,CAAA;AAGnE,EAAA,MAAM,aAAa,KAAA,KAAU,MAAA,GAAY,EAAC,GAAI,EAAE,KAAA,EAAM;AACtD,EAAA,uBAAOA,cAAAA,CAAC,aAAA,EAAA,EAAc,IAAA,EAAM,WAAA,EAAc,GAAG,UAAA,EAAY,CAAA;AAC7D;AANgB,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA","file":"index.cjs","sourcesContent":["// default-semantic-icons — minimal built-in SVG placeholders for internal\n// library glyphs. Consumers can swap each one via the provider:\n//\n// <NoriProvider icons={{ checkmark: MyCheck, close: MyX }}>\n//\n// These defaults exist so the library renders usable UI out of the box even when\n// lucide-react(-native) is not installed. They are NOT intended to compete with\n// Lucide on style — override them to match your design system.\n\nimport type { ComponentType } from 'react';\nimport type { IconComponentProps } from './icon';\n\ntype SemanticIcon = ComponentType<IconComponentProps>;\n\nconst make = (path: string): SemanticIcon =>\n function PlaceholderIcon({ size = 20, color = 'currentColor' }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d={path} />\n </svg>\n );\n };\n\nexport type SemanticIcons = {\n checkmark: SemanticIcon;\n close: SemanticIcon;\n eye: SemanticIcon;\n eyeOff: SemanticIcon;\n chevronDown: SemanticIcon;\n chevronUp: SemanticIcon;\n alertTriangle: SemanticIcon;\n info: SemanticIcon;\n check: SemanticIcon;\n x: SemanticIcon;\n};\n\nexport const defaultSemanticIcons: SemanticIcons = {\n checkmark: make('M20 6 9 17l-5-5'),\n close: make('M18 6 6 18 M6 6l12 12'),\n eye: make('M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'),\n eyeOff: make('M17.94 17.94A10 10 0 0 1 2 12s3.5-7 10-7c2 0 3.8.6 5.4 1.5 M1 1l22 22'),\n chevronDown: make('m6 9 6 6 6-6'),\n chevronUp: make('m18 15-6-6-6 6'),\n alertTriangle: make(\n 'M12 9v4 M12 17h.01 M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n ),\n info: make(\n 'M12 8h.01 M11 12h1v4h1 M12 22C6.48 22 2 17.52 2 12 2 6.48 6.48 2 12 2c5.52 0 10 4.48 10 10 0 5.52-4.48 10-10 10z'\n ),\n check: make('M20 6 9 17l-5-5'),\n x: make('M18 6 6 18 M6 6l12 12'),\n};\n","import type { ComponentType } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg' | 'xl' | number;\n\nexport type IconComponentProps = {\n size?: number;\n color?: string;\n};\n\nexport type IconProps = {\n as: ComponentType<IconComponentProps>;\n size?: IconSize;\n color?: string;\n};\n\nconst SIZE_MAP: Record<Exclude<IconSize, number>, number> = {\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n};\n\n/**\n * Thin wrapper around an icon component. Consumer imports the icon they want\n * from any library (e.g. lucide-react-native) and passes it as `as`. No registry,\n * no runtime lookup — tree-shaking is automatic.\n *\n * RSC-safe: pure render, no hooks, no refs.\n */\nexport function Icon({ as: IconComponent, size = 'md', color }: IconProps) {\n const numericSize = typeof size === 'number' ? size : SIZE_MAP[size];\n // Only spread color when defined — avoids passing `color: undefined` under\n // exactOptionalPropertyTypes.\n const colorProps = color === undefined ? {} : { color };\n return <IconComponent size={numericSize} {...colorProps} />;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
type IconSize = 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
5
|
+
type IconComponentProps = {
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
type IconProps = {
|
|
10
|
+
as: ComponentType<IconComponentProps>;
|
|
11
|
+
size?: IconSize;
|
|
12
|
+
color?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Thin wrapper around an icon component. Consumer imports the icon they want
|
|
16
|
+
* from any library (e.g. lucide-react-native) and passes it as `as`. No registry,
|
|
17
|
+
* no runtime lookup — tree-shaking is automatic.
|
|
18
|
+
*
|
|
19
|
+
* RSC-safe: pure render, no hooks, no refs.
|
|
20
|
+
*/
|
|
21
|
+
declare function Icon({ as: IconComponent, size, color }: IconProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
type SemanticIcon = ComponentType<IconComponentProps>;
|
|
24
|
+
type SemanticIcons = {
|
|
25
|
+
checkmark: SemanticIcon;
|
|
26
|
+
close: SemanticIcon;
|
|
27
|
+
eye: SemanticIcon;
|
|
28
|
+
eyeOff: SemanticIcon;
|
|
29
|
+
chevronDown: SemanticIcon;
|
|
30
|
+
chevronUp: SemanticIcon;
|
|
31
|
+
alertTriangle: SemanticIcon;
|
|
32
|
+
info: SemanticIcon;
|
|
33
|
+
check: SemanticIcon;
|
|
34
|
+
x: SemanticIcon;
|
|
35
|
+
};
|
|
36
|
+
declare const defaultSemanticIcons: SemanticIcons;
|
|
37
|
+
|
|
38
|
+
export { Icon, type IconComponentProps, type IconProps, type IconSize, type SemanticIcons, defaultSemanticIcons };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
type IconSize = 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
5
|
+
type IconComponentProps = {
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
type IconProps = {
|
|
10
|
+
as: ComponentType<IconComponentProps>;
|
|
11
|
+
size?: IconSize;
|
|
12
|
+
color?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Thin wrapper around an icon component. Consumer imports the icon they want
|
|
16
|
+
* from any library (e.g. lucide-react-native) and passes it as `as`. No registry,
|
|
17
|
+
* no runtime lookup — tree-shaking is automatic.
|
|
18
|
+
*
|
|
19
|
+
* RSC-safe: pure render, no hooks, no refs.
|
|
20
|
+
*/
|
|
21
|
+
declare function Icon({ as: IconComponent, size, color }: IconProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
type SemanticIcon = ComponentType<IconComponentProps>;
|
|
24
|
+
type SemanticIcons = {
|
|
25
|
+
checkmark: SemanticIcon;
|
|
26
|
+
close: SemanticIcon;
|
|
27
|
+
eye: SemanticIcon;
|
|
28
|
+
eyeOff: SemanticIcon;
|
|
29
|
+
chevronDown: SemanticIcon;
|
|
30
|
+
chevronUp: SemanticIcon;
|
|
31
|
+
alertTriangle: SemanticIcon;
|
|
32
|
+
info: SemanticIcon;
|
|
33
|
+
check: SemanticIcon;
|
|
34
|
+
x: SemanticIcon;
|
|
35
|
+
};
|
|
36
|
+
declare const defaultSemanticIcons: SemanticIcons;
|
|
37
|
+
|
|
38
|
+
export { Icon, type IconComponentProps, type IconProps, type IconSize, type SemanticIcons, defaultSemanticIcons };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|