@stndrds/constants 1.0.0-alpha.265 → 1.0.0-alpha.266
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.d.mts +1 -15
- package/dist/index.d.ts +1 -15
- package/dist/index.js +17 -12
- package/dist/index.mjs +17 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1485,20 +1485,6 @@ declare const RECOMMENDED_MAX_SIZES: {
|
|
|
1485
1485
|
/** Large archives: 1 GB */
|
|
1486
1486
|
readonly ARCHIVE: number;
|
|
1487
1487
|
};
|
|
1488
|
-
/**
|
|
1489
|
-
* Format a byte count into a human-readable string
|
|
1490
|
-
*
|
|
1491
|
-
* @param bytes - Number of bytes
|
|
1492
|
-
* @param decimals - Number of decimal places (default: 2)
|
|
1493
|
-
* @returns Formatted string, e.g. "1.5 MB"
|
|
1494
|
-
*
|
|
1495
|
-
* @example
|
|
1496
|
-
* ```typescript
|
|
1497
|
-
* formatBytes(1048576) // "1 MB"
|
|
1498
|
-
* formatBytes(1500, 1) // "1.5 KB"
|
|
1499
|
-
* ```
|
|
1500
|
-
*/
|
|
1501
|
-
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
1502
1488
|
/**
|
|
1503
1489
|
* Convert megabytes to bytes
|
|
1504
1490
|
*
|
|
@@ -1779,4 +1765,4 @@ type FormatPreset = {
|
|
|
1779
1765
|
};
|
|
1780
1766
|
declare const TEXT_FORMAT_PRESETS: readonly FormatPreset[];
|
|
1781
1767
|
|
|
1782
|
-
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DEFAULT_TENANT_ID, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, type FormatPreset, type FormatPresetGroup, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, MEMORY_DESCRIPTION_MAX_LENGTH, MEMORY_NAME_MAX_LENGTH, type MimeType, OFFICE_DOCUMENTS, RECOMMENDED_MAX_SIZES, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, STATUS_COLORS, type StatusColorGroup, TEXT_FORMAT_PRESETS, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn,
|
|
1768
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DEFAULT_TENANT_ID, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, type FormatPreset, type FormatPresetGroup, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, MEMORY_DESCRIPTION_MAX_LENGTH, MEMORY_NAME_MAX_LENGTH, type MimeType, OFFICE_DOCUMENTS, RECOMMENDED_MAX_SIZES, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, STATUS_COLORS, type StatusColorGroup, TEXT_FORMAT_PRESETS, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.d.ts
CHANGED
|
@@ -1485,20 +1485,6 @@ declare const RECOMMENDED_MAX_SIZES: {
|
|
|
1485
1485
|
/** Large archives: 1 GB */
|
|
1486
1486
|
readonly ARCHIVE: number;
|
|
1487
1487
|
};
|
|
1488
|
-
/**
|
|
1489
|
-
* Format a byte count into a human-readable string
|
|
1490
|
-
*
|
|
1491
|
-
* @param bytes - Number of bytes
|
|
1492
|
-
* @param decimals - Number of decimal places (default: 2)
|
|
1493
|
-
* @returns Formatted string, e.g. "1.5 MB"
|
|
1494
|
-
*
|
|
1495
|
-
* @example
|
|
1496
|
-
* ```typescript
|
|
1497
|
-
* formatBytes(1048576) // "1 MB"
|
|
1498
|
-
* formatBytes(1500, 1) // "1.5 KB"
|
|
1499
|
-
* ```
|
|
1500
|
-
*/
|
|
1501
|
-
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
1502
1488
|
/**
|
|
1503
1489
|
* Convert megabytes to bytes
|
|
1504
1490
|
*
|
|
@@ -1779,4 +1765,4 @@ type FormatPreset = {
|
|
|
1779
1765
|
};
|
|
1780
1766
|
declare const TEXT_FORMAT_PRESETS: readonly FormatPreset[];
|
|
1781
1767
|
|
|
1782
|
-
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DEFAULT_TENANT_ID, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, type FormatPreset, type FormatPresetGroup, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, MEMORY_DESCRIPTION_MAX_LENGTH, MEMORY_NAME_MAX_LENGTH, type MimeType, OFFICE_DOCUMENTS, RECOMMENDED_MAX_SIZES, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, STATUS_COLORS, type StatusColorGroup, TEXT_FORMAT_PRESETS, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn,
|
|
1768
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DEFAULT_TENANT_ID, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, type FormatPreset, type FormatPresetGroup, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, MEMORY_DESCRIPTION_MAX_LENGTH, MEMORY_NAME_MAX_LENGTH, type MimeType, OFFICE_DOCUMENTS, RECOMMENDED_MAX_SIZES, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, STATUS_COLORS, type StatusColorGroup, TEXT_FORMAT_PRESETS, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,6 @@ __export(index_exports, {
|
|
|
73
73
|
bytesToGb: () => bytesToGb,
|
|
74
74
|
bytesToMb: () => bytesToMb,
|
|
75
75
|
cn: () => cn,
|
|
76
|
-
formatBytes: () => formatBytes,
|
|
77
76
|
gbToBytes: () => gbToBytes,
|
|
78
77
|
getAllColors: () => getAllColors,
|
|
79
78
|
getAllCountries: () => getAllCountries,
|
|
@@ -319,9 +318,23 @@ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
|
319
318
|
"text-row-lg",
|
|
320
319
|
"text-metric"
|
|
321
320
|
],
|
|
322
|
-
h: [
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
h: [
|
|
322
|
+
"h-control-sm",
|
|
323
|
+
"h-control-default",
|
|
324
|
+
"h-control-lg",
|
|
325
|
+
"h-row-sm",
|
|
326
|
+
"h-row-default",
|
|
327
|
+
"h-row-lg"
|
|
328
|
+
],
|
|
329
|
+
w: ["w-control-sm", "w-control-default", "w-control-lg", "w-query-popover"],
|
|
330
|
+
size: ["size-control-sm", "size-control-default", "size-control-lg"],
|
|
331
|
+
/* `@stndrds/ds`'s `SURFACE_PADDING` rungs (`packages/ds/src/variants/surface.ts`).
|
|
332
|
+
`PopoverContent` bakes in `p-4`; a caller setting `p-surface-sm` on it
|
|
333
|
+
(e.g. `relation-filter-popover.tsx`) needs tailwind-merge to drop the
|
|
334
|
+
built-in `p-4` rather than keep both. All three rungs registered, not
|
|
335
|
+
just the one in use today, so the next call site doesn't rediscover
|
|
336
|
+
this. */
|
|
337
|
+
p: ["p-surface-sm", "p-surface-default", "p-surface-lg"]
|
|
325
338
|
}
|
|
326
339
|
}
|
|
327
340
|
});
|
|
@@ -1405,13 +1418,6 @@ var RECOMMENDED_MAX_SIZES = {
|
|
|
1405
1418
|
/** Large archives: 1 GB */
|
|
1406
1419
|
ARCHIVE: FILE_SIZE.GB_1
|
|
1407
1420
|
};
|
|
1408
|
-
function formatBytes(bytes, decimals = 2) {
|
|
1409
|
-
if (bytes === 0) return "0 Bytes";
|
|
1410
|
-
const k = 1024;
|
|
1411
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
1412
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1413
|
-
return `${Number.parseFloat((bytes / k ** i).toFixed(decimals))} ${sizes[i]}`;
|
|
1414
|
-
}
|
|
1415
1421
|
var mbToBytes = (mb) => {
|
|
1416
1422
|
return mb * 1024 * 1024;
|
|
1417
1423
|
};
|
|
@@ -2854,7 +2860,6 @@ var TEXT_FORMAT_PRESETS = [
|
|
|
2854
2860
|
bytesToGb,
|
|
2855
2861
|
bytesToMb,
|
|
2856
2862
|
cn,
|
|
2857
|
-
formatBytes,
|
|
2858
2863
|
gbToBytes,
|
|
2859
2864
|
getAllColors,
|
|
2860
2865
|
getAllCountries,
|
package/dist/index.mjs
CHANGED
|
@@ -210,9 +210,23 @@ var twMerge = extendTailwindMerge({
|
|
|
210
210
|
"text-row-lg",
|
|
211
211
|
"text-metric"
|
|
212
212
|
],
|
|
213
|
-
h: [
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
h: [
|
|
214
|
+
"h-control-sm",
|
|
215
|
+
"h-control-default",
|
|
216
|
+
"h-control-lg",
|
|
217
|
+
"h-row-sm",
|
|
218
|
+
"h-row-default",
|
|
219
|
+
"h-row-lg"
|
|
220
|
+
],
|
|
221
|
+
w: ["w-control-sm", "w-control-default", "w-control-lg", "w-query-popover"],
|
|
222
|
+
size: ["size-control-sm", "size-control-default", "size-control-lg"],
|
|
223
|
+
/* `@stndrds/ds`'s `SURFACE_PADDING` rungs (`packages/ds/src/variants/surface.ts`).
|
|
224
|
+
`PopoverContent` bakes in `p-4`; a caller setting `p-surface-sm` on it
|
|
225
|
+
(e.g. `relation-filter-popover.tsx`) needs tailwind-merge to drop the
|
|
226
|
+
built-in `p-4` rather than keep both. All three rungs registered, not
|
|
227
|
+
just the one in use today, so the next call site doesn't rediscover
|
|
228
|
+
this. */
|
|
229
|
+
p: ["p-surface-sm", "p-surface-default", "p-surface-lg"]
|
|
216
230
|
}
|
|
217
231
|
}
|
|
218
232
|
});
|
|
@@ -1296,13 +1310,6 @@ var RECOMMENDED_MAX_SIZES = {
|
|
|
1296
1310
|
/** Large archives: 1 GB */
|
|
1297
1311
|
ARCHIVE: FILE_SIZE.GB_1
|
|
1298
1312
|
};
|
|
1299
|
-
function formatBytes(bytes, decimals = 2) {
|
|
1300
|
-
if (bytes === 0) return "0 Bytes";
|
|
1301
|
-
const k = 1024;
|
|
1302
|
-
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
1303
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1304
|
-
return `${Number.parseFloat((bytes / k ** i).toFixed(decimals))} ${sizes[i]}`;
|
|
1305
|
-
}
|
|
1306
1313
|
var mbToBytes = (mb) => {
|
|
1307
1314
|
return mb * 1024 * 1024;
|
|
1308
1315
|
};
|
|
@@ -2744,7 +2751,6 @@ export {
|
|
|
2744
2751
|
bytesToGb,
|
|
2745
2752
|
bytesToMb,
|
|
2746
2753
|
cn,
|
|
2747
|
-
formatBytes,
|
|
2748
2754
|
gbToBytes,
|
|
2749
2755
|
getAllColors,
|
|
2750
2756
|
getAllCountries,
|