@cjlapao/ui-kit 0.2.20 → 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/index.cjs +373 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +377 -77
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +25 -7
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +26 -8
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/markdown.cjs
CHANGED
|
@@ -3772,7 +3772,7 @@ function createI18n(config) {
|
|
|
3772
3772
|
if (!available.has(locale)) locale = "en";
|
|
3773
3773
|
let isRTL = isRTLLocale(locale);
|
|
3774
3774
|
let version = 0;
|
|
3775
|
-
const
|
|
3775
|
+
const listeners2 = /* @__PURE__ */ new Set();
|
|
3776
3776
|
const messageCache = /* @__PURE__ */ new Map();
|
|
3777
3777
|
const renderMessage = (key, source, values) => {
|
|
3778
3778
|
const cacheKey = `${locale}\0${source}`;
|
|
@@ -3836,7 +3836,7 @@ function createI18n(config) {
|
|
|
3836
3836
|
locale = resolved;
|
|
3837
3837
|
isRTL = isRTLLocale(locale);
|
|
3838
3838
|
version += 1;
|
|
3839
|
-
for (const listener of [...
|
|
3839
|
+
for (const listener of [...listeners2]) listener();
|
|
3840
3840
|
},
|
|
3841
3841
|
formatNumber(value, options) {
|
|
3842
3842
|
try {
|
|
@@ -3873,9 +3873,9 @@ function createI18n(config) {
|
|
|
3873
3873
|
return isRTL;
|
|
3874
3874
|
},
|
|
3875
3875
|
subscribe(listener) {
|
|
3876
|
-
|
|
3876
|
+
listeners2.add(listener);
|
|
3877
3877
|
return () => {
|
|
3878
|
-
|
|
3878
|
+
listeners2.delete(listener);
|
|
3879
3879
|
};
|
|
3880
3880
|
},
|
|
3881
3881
|
getVersion() {
|
|
@@ -8625,6 +8625,23 @@ var iconRegistry = {
|
|
|
8625
8625
|
Windows
|
|
8626
8626
|
};
|
|
8627
8627
|
|
|
8628
|
+
// src/icons/customRegistry.ts
|
|
8629
|
+
var customIcons = /* @__PURE__ */ new Map();
|
|
8630
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
8631
|
+
var revision = 0;
|
|
8632
|
+
var subscribeIcons = (listener) => {
|
|
8633
|
+
listeners.add(listener);
|
|
8634
|
+
return () => {
|
|
8635
|
+
listeners.delete(listener);
|
|
8636
|
+
};
|
|
8637
|
+
};
|
|
8638
|
+
var getIconRevision = () => revision;
|
|
8639
|
+
var getServerIconRevision = () => 0;
|
|
8640
|
+
function resolveIcon(name) {
|
|
8641
|
+
const registrations = customIcons.get(name);
|
|
8642
|
+
return registrations?.[registrations.length - 1]?.component ?? (Object.prototype.hasOwnProperty.call(iconRegistry, name) ? iconRegistry[name] : void 0);
|
|
8643
|
+
}
|
|
8644
|
+
|
|
8628
8645
|
// src/components/CustomIcon.tsx
|
|
8629
8646
|
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
8630
8647
|
var SIZE_CLASS_MAP = {
|
|
@@ -8651,7 +8668,8 @@ var CustomIcon = ({
|
|
|
8651
8668
|
style,
|
|
8652
8669
|
...rest
|
|
8653
8670
|
}) => {
|
|
8654
|
-
|
|
8671
|
+
(0, import_react148.useSyncExternalStore)(subscribeIcons, getIconRevision, getServerIconRevision);
|
|
8672
|
+
const IconComponent = typeof icon === "string" ? resolveIcon(icon) : icon;
|
|
8655
8673
|
const dimension = (0, import_react148.useMemo)(() => {
|
|
8656
8674
|
if (!customSize) return void 0;
|
|
8657
8675
|
return typeof customSize === "number" ? `${customSize}px` : customSize;
|
|
@@ -8689,9 +8707,9 @@ var CustomIcon = ({
|
|
|
8689
8707
|
// The fallback used to drop every computed class, so a missing icon had no
|
|
8690
8708
|
// size at all unless `customSize` was given — it collapsed the layout
|
|
8691
8709
|
// around it.
|
|
8692
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("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
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("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) || "?" : "?" })
|
|
8693
8711
|
);
|
|
8694
|
-
if (!IconComponent && icon && !warned3.has(icon)) {
|
|
8712
|
+
if (!IconComponent && typeof icon === "string" && icon && !warned3.has(icon)) {
|
|
8695
8713
|
warned3.add(icon);
|
|
8696
8714
|
console.warn(`Icon not found in registry: ${icon}`);
|
|
8697
8715
|
}
|