@cjlapao/ui-kit 0.2.19 → 0.2.21

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/markdown.js CHANGED
@@ -3742,7 +3742,7 @@ function createI18n(config) {
3742
3742
  if (!available.has(locale)) locale = "en";
3743
3743
  let isRTL = isRTLLocale(locale);
3744
3744
  let version = 0;
3745
- const listeners = /* @__PURE__ */ new Set();
3745
+ const listeners2 = /* @__PURE__ */ new Set();
3746
3746
  const messageCache = /* @__PURE__ */ new Map();
3747
3747
  const renderMessage = (key, source, values) => {
3748
3748
  const cacheKey = `${locale}\0${source}`;
@@ -3806,7 +3806,7 @@ function createI18n(config) {
3806
3806
  locale = resolved;
3807
3807
  isRTL = isRTLLocale(locale);
3808
3808
  version += 1;
3809
- for (const listener of [...listeners]) listener();
3809
+ for (const listener of [...listeners2]) listener();
3810
3810
  },
3811
3811
  formatNumber(value, options) {
3812
3812
  try {
@@ -3843,9 +3843,9 @@ function createI18n(config) {
3843
3843
  return isRTL;
3844
3844
  },
3845
3845
  subscribe(listener) {
3846
- listeners.add(listener);
3846
+ listeners2.add(listener);
3847
3847
  return () => {
3848
- listeners.delete(listener);
3848
+ listeners2.delete(listener);
3849
3849
  };
3850
3850
  },
3851
3851
  getVersion() {
@@ -4055,7 +4055,7 @@ var mergeClassTokens = (...groups) => {
4055
4055
  var hasExplicitSize = (value) => Boolean(value) && /\b(?:min-|max-)?(?:w|h)-/.test(value);
4056
4056
 
4057
4057
  // src/components/CustomIcon.tsx
4058
- import { useMemo as useMemo2 } from "react";
4058
+ import { useMemo as useMemo2, useSyncExternalStore as useSyncExternalStore2 } from "react";
4059
4059
 
4060
4060
  // src/icons/components/Accordion.tsx
4061
4061
  import { forwardRef } from "react";
@@ -8595,6 +8595,23 @@ var iconRegistry = {
8595
8595
  Windows
8596
8596
  };
8597
8597
 
8598
+ // src/icons/customRegistry.ts
8599
+ var customIcons = /* @__PURE__ */ new Map();
8600
+ var listeners = /* @__PURE__ */ new Set();
8601
+ var revision = 0;
8602
+ var subscribeIcons = (listener) => {
8603
+ listeners.add(listener);
8604
+ return () => {
8605
+ listeners.delete(listener);
8606
+ };
8607
+ };
8608
+ var getIconRevision = () => revision;
8609
+ var getServerIconRevision = () => 0;
8610
+ function resolveIcon(name) {
8611
+ const registrations = customIcons.get(name);
8612
+ return registrations?.[registrations.length - 1]?.component ?? (Object.prototype.hasOwnProperty.call(iconRegistry, name) ? iconRegistry[name] : void 0);
8613
+ }
8614
+
8598
8615
  // src/components/CustomIcon.tsx
8599
8616
  import { jsx as jsx148 } from "react/jsx-runtime";
8600
8617
  var SIZE_CLASS_MAP = {
@@ -8621,7 +8638,8 @@ var CustomIcon = ({
8621
8638
  style,
8622
8639
  ...rest
8623
8640
  }) => {
8624
- const IconComponent = iconRegistry[icon];
8641
+ useSyncExternalStore2(subscribeIcons, getIconRevision, getServerIconRevision);
8642
+ const IconComponent = typeof icon === "string" ? resolveIcon(icon) : icon;
8625
8643
  const dimension = useMemo2(() => {
8626
8644
  if (!customSize) return void 0;
8627
8645
  return typeof customSize === "number" ? `${customSize}px` : customSize;
@@ -8659,9 +8677,9 @@ var CustomIcon = ({
8659
8677
  // The fallback used to drop every computed class, so a missing icon had no
8660
8678
  // size at all unless `customSize` was given — it collapsed the layout
8661
8679
  // around it.
8662
- /* @__PURE__ */ jsx148("span", { className: "grid h-full w-full place-items-center rounded bg-neutral-100 text-[0.6em] font-bold uppercase text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400", children: icon?.charAt(0) || "?" })
8680
+ /* @__PURE__ */ jsx148("span", { className: "grid h-full w-full place-items-center rounded bg-neutral-100 text-[0.6em] font-bold uppercase text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400", children: typeof icon === "string" ? icon.charAt(0) || "?" : "?" })
8663
8681
  );
8664
- if (!IconComponent && icon && !warned3.has(icon)) {
8682
+ if (!IconComponent && typeof icon === "string" && icon && !warned3.has(icon)) {
8665
8683
  warned3.add(icon);
8666
8684
  console.warn(`Icon not found in registry: ${icon}`);
8667
8685
  }