@dyrected/react 2.5.52 → 2.5.53

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.
@@ -0,0 +1,29 @@
1
+ import { type LucideProps } from 'lucide-react';
2
+ import type { AdminIconName } from '@dyrected/core';
3
+ export interface DyrectedIconProps extends Omit<LucideProps, 'name'> {
4
+ /**
5
+ * The value of an `icon` field — a Lucide icon name such as
6
+ * `"ChartNoAxesCombined"` or `"BellRing"`.
7
+ */
8
+ name: AdminIconName | (string & {}) | null | undefined;
9
+ /**
10
+ * Icon name to render when `name` is missing or not a known icon.
11
+ * Renders nothing when omitted and `name` cannot be resolved.
12
+ */
13
+ fallback?: AdminIconName;
14
+ }
15
+ /**
16
+ * Renders a Dyrected `icon` field value as a Lucide icon.
17
+ *
18
+ * The `icon` field type stores the *name* of a Lucide icon (not SVG markup),
19
+ * so pass that value straight through:
20
+ *
21
+ * ```tsx
22
+ * <DyrectedIcon name={feature.icon} className="w-6 h-6" />
23
+ * ```
24
+ *
25
+ * Standard Lucide props (`size`, `color`, `strokeWidth`, `className`, …) are
26
+ * forwarded to the underlying icon.
27
+ */
28
+ export declare function DyrectedIcon({ name, fallback, ...props }: DyrectedIconProps): import("react/jsx-runtime").JSX.Element | null;
29
+ //# sourceMappingURL=DyrectedIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DyrectedIcon.d.ts","sourceRoot":"","sources":["../../src/components/DyrectedIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAClE;;;OAGG;IACH,IAAI,EAAE,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,kDAQ3E"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { icons } from 'lucide-react';
3
+ const iconMap = icons;
4
+ /**
5
+ * Renders a Dyrected `icon` field value as a Lucide icon.
6
+ *
7
+ * The `icon` field type stores the *name* of a Lucide icon (not SVG markup),
8
+ * so pass that value straight through:
9
+ *
10
+ * ```tsx
11
+ * <DyrectedIcon name={feature.icon} className="w-6 h-6" />
12
+ * ```
13
+ *
14
+ * Standard Lucide props (`size`, `color`, `strokeWidth`, `className`, …) are
15
+ * forwarded to the underlying icon.
16
+ */
17
+ export function DyrectedIcon({ name, fallback, ...props }) {
18
+ const Icon = (typeof name === 'string' ? iconMap[name] : undefined) ??
19
+ (fallback ? iconMap[fallback] : undefined);
20
+ if (!Icon)
21
+ return null;
22
+ return _jsx(Icon, { ...props });
23
+ }
24
+ //# sourceMappingURL=DyrectedIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DyrectedIcon.js","sourceRoot":"","sources":["../../src/components/DyrectedIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAoB,MAAM,cAAc,CAAC;AAgBvD,MAAM,OAAO,GAAG,KAAyD,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAqB;IAC1E,MAAM,IAAI,GACR,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtD,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,KAAC,IAAI,OAAK,KAAK,GAAI,CAAC;AAC7B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './providers/DyrectedProvider';
5
5
  export * from './providers/DyPathProvider';
6
6
  export * from './components/DyrectedImage';
7
7
  export * from './components/DyrectedMedia';
8
+ export * from './components/DyrectedIcon';
8
9
  export * from './components/Blocks';
9
10
  export { DyrectedClient, DyrectedError } from '@dyrected/sdk';
10
11
  export type { CollectionConfig, GlobalConfig } from '@dyrected/sdk';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export * from './providers/DyrectedProvider';
5
5
  export * from './providers/DyPathProvider';
6
6
  export * from './components/DyrectedImage';
7
7
  export * from './components/DyrectedMedia';
8
+ export * from './components/DyrectedIcon';
8
9
  export * from './components/Blocks';
9
10
  // Re-export core types and errors from SDK for convenience
10
11
  export { DyrectedClient, DyrectedError } from '@dyrected/sdk';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAEpC,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/react",
3
- "version": "2.5.52",
3
+ "version": "2.5.53",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -22,8 +22,10 @@
22
22
  "react-dom": ">=18.0.0"
23
23
  },
24
24
  "dependencies": {
25
- "@dyrected/admin": "2.5.52",
26
- "@dyrected/sdk": "2.5.52"
25
+ "lucide-react": "^1.14.0",
26
+ "@dyrected/admin": "2.5.53",
27
+ "@dyrected/sdk": "2.5.53",
28
+ "@dyrected/core": "2.5.53"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@types/node": "^20.12.12",