inferred-types 0.55.18 → 0.55.20

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.
@@ -281,6 +281,15 @@ declare const US_STATE_LOOKUP: readonly [{
281
281
  readonly abbrev: "GU";
282
282
  }];
283
283
 
284
+ /**
285
+ * An array of all valid HTML tags that have both opening and closing tags.
286
+ */
287
+ declare const HTML_BLOCK_TAGS: readonly ["a", "abbr", "address", "article", "aside", "b", "bdi", "bdo", "blockquote", "body", "button", "canvas", "caption", "cite", "code", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "html", "i", "iframe", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video"];
288
+ /**
289
+ * An array of all valid HTML tags that are self-closing (do not have closing tags).
290
+ */
291
+ declare const HTML_ATOMIC_TAGS: readonly ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"];
292
+
284
293
  /**
285
294
  * All country codes (name, alpha-2, country-code)
286
295
  */
@@ -3002,17 +3011,17 @@ declare const TW_HUE: {
3002
3011
  readonly stone: 273;
3003
3012
  };
3004
3013
  declare const TW_LUMINOSITY: {
3005
- readonly 50: 97.78;
3006
- readonly 100: 93.56;
3007
- readonly 200: 88.11;
3008
- readonly 300: 82.67;
3009
- readonly 400: 74.22;
3010
- readonly 500: 64.78;
3011
- readonly 600: 57.33;
3012
- readonly 700: 46.89;
3013
- readonly 800: 39.44;
3014
- readonly 900: 32;
3015
- readonly 950: 23.78;
3014
+ readonly "50": 97.78;
3015
+ readonly "100": 93.56;
3016
+ readonly "200": 88.11;
3017
+ readonly "300": 82.67;
3018
+ readonly "400": 74.22;
3019
+ readonly "500": 64.78;
3020
+ readonly "600": 57.33;
3021
+ readonly "700": 46.89;
3022
+ readonly "800": 39.44;
3023
+ readonly "900": 32;
3024
+ readonly "950": 23.78;
3016
3025
  };
3017
3026
  /**
3018
3027
  * **TW_CHROMA**
@@ -3023,17 +3032,17 @@ declare const TW_LUMINOSITY: {
3023
3032
  * **Related:** `TW_CHROMA_50`, `TW_CHROMA_100`, ...
3024
3033
  */
3025
3034
  declare const TW_CHROMA: {
3026
- readonly 50: 0.0108;
3027
- readonly 100: 0.0321;
3028
- readonly 200: 0.0609;
3029
- readonly 300: 0.0908;
3030
- readonly 400: 0.1398;
3031
- readonly 500: 0.1472;
3032
- readonly 600: 0.1299;
3033
- readonly 700: 0.1067;
3034
- readonly 800: 0.0898;
3035
- readonly 900: 0.0726;
3036
- readonly 950: 0.054;
3035
+ readonly "50": 0.0108;
3036
+ readonly "100": 0.0321;
3037
+ readonly "200": 0.0609;
3038
+ readonly "300": 0.0908;
3039
+ readonly "400": 0.1398;
3040
+ readonly "500": 0.1472;
3041
+ readonly "600": 0.1299;
3042
+ readonly "700": 0.1067;
3043
+ readonly "800": 0.0898;
3044
+ readonly "900": 0.0726;
3045
+ readonly "950": 0.054;
3037
3046
  };
3038
3047
  /**
3039
3048
  * The list of "targets" where Tailwind color string references
@@ -4503,6 +4512,15 @@ type _Validate<T extends object> = "value" extends keyof T ? true : false;
4503
4512
  */
4504
4513
  type IsVueRef<T> = T extends object ? If<IsEqual<_Len<T>, 0>, false, Retain<_Keys$6<T>, string>["length"] extends 1 ? _Validate<T> : false> : false;
4505
4514
 
4515
+ /**
4516
+ * **IsWideString**`<T>`
4517
+ *
4518
+ * Boolean operator which returns `true` when a _wide_ string
4519
+ * is passed in as `T`. It reports `false` on all other values
4520
+ * including _literal strings_.
4521
+ */
4522
+ type IsWideString<T> = IsEqual<T, string>;
4523
+
4506
4524
  /**
4507
4525
  * **IsWideScalar**`<T>`
4508
4526
  *
@@ -6949,6 +6967,52 @@ type GenList<TContainer, IsRoot extends boolean = true, K extends keyof TContain
6949
6967
  */
6950
6968
  type DotPathFor<TContainer> = TContainer extends Container ? "" | GenList<TContainer, true> : "";
6951
6969
 
6970
+ /**
6971
+ * a valid HTML "block tag" (aka, a tag which requires
6972
+ * an openning and closing tag pair to be valid HTML)
6973
+ */
6974
+ type Html__BlockTag = typeof HTML_BLOCK_TAGS[number];
6975
+ /**
6976
+ * a valid HTML "atomic tag" (aka, a tag which does
6977
+ * NOT have a closing tag)
6978
+ */
6979
+ type Html__AtomicTag = typeof HTML_ATOMIC_TAGS[number];
6980
+ /**
6981
+ * A union of valid _openning_ HTML Block Tags.
6982
+ *
6983
+ * - You can use the generic `T` to isolate down to a subset
6984
+ */
6985
+ type HtmlTagOpen<T extends Html__BlockTag = Html__BlockTag> = `<${T}${string}>`;
6986
+ /**
6987
+ * A union of valid _closing_ HTML Block Tags.
6988
+ *
6989
+ * - You can use the generic `T` to isolate down to a subset
6990
+ */
6991
+ type HtmlTagClose<T extends Html__BlockTag = Html__BlockTag> = `</${T}>`;
6992
+ /**
6993
+ * A union type of valid _atomic_ tags.
6994
+ *
6995
+ * - you can use the generic `T` to isolate down to a subset
6996
+ * of Atomic Tags
6997
+ */
6998
+ type HtmlTagAtomic<T extends Html__AtomicTag = Html__AtomicTag> = `<${T}${string}>`;
6999
+ /**
7000
+ * Allows for any valid HTML tag: openning, closing and atomic.
7001
+ */
7002
+ type HtmlTag = HtmlTagOpen | HtmlTagClose | HtmlTagAtomic;
7003
+ /**
7004
+ * A narrowing utility which takes an input and ensures it's type
7005
+ * is within the _scope_ of the tags provided in `TScope`.
7006
+ */
7007
+ type AsHtmlTag<TInput, TScope extends Html__AtomicTag | Html__BlockTag> = TInput extends HtmlTagAtomic ? TInput : TInput extends HtmlTagOpen ? TInput : TInput extends HtmlTagClose ? TInput : TInput extends `</${string}>` ? HtmlTagClose<Exclude<TScope, Html__AtomicTag>> : TInput extends `<${string}` ? HtmlTagOpen<Exclude<TScope, Html__AtomicTag>> | HtmlTagAtomic extends TInput ? HtmlTagOpen<Exclude<TScope, Html__AtomicTag>> | HtmlTagAtomic : never : IsWideString<TInput> extends true ? HtmlTag : never;
7008
+ /**
7009
+ * **AsHtmlComponentTag**`<T>`
7010
+ *
7011
+ * A type utility that narrows the input type to valid HTML component tags
7012
+ * (`kebab-case` or `PascalCase`) and ensures valid attributes.
7013
+ */
7014
+ type AsHtmlComponentTag<T> = T extends `<${infer Name} ${infer Attr}/>` ? T & (`<${PascalCase<Name>} ${Attr}/>` | `<${KebabCase<Name>} ${Attr}/>`) : T extends `<${infer Name} ${infer Attr}>` ? T & (`<${PascalCase<Name>} ${Attr}>` | `<${KebabCase<Name>} ${Attr}>`) : T extends `<${infer Name}/>` ? T & (`<${PascalCase<Name>}/>` | `<${KebabCase<Name>}/>`) : T extends `<${infer Name}>` ? T & (`<${PascalCase<Name>}` | `<${KebabCase<Name>}`) : T extends string ? IsWideString<T> extends true ? T & `<${PascalCase<StripSurround<T, "<" | ">">>}${string}>` : never : never;
7015
+
6952
7016
  /**
6953
7017
  * **InlineSvg**`<[T]>`
6954
7018
  *
@@ -12898,11 +12962,15 @@ declare function capitalize<T extends string>(str: T): Capitalize<T>;
12898
12962
  */
12899
12963
  declare function cssColor<TColorSpace extends CssColorSpace, TV1 extends ColorFnValue, TV2 extends ColorFnValue, TV3 extends ColorFnValue, TOp extends undefined | ColorFnOptOpacity>(color: TColorSpace, v1: TV1, v2: TV2, v3: TV3, opacity?: TOp): CssColorFn<TColorSpace, TV1, TV2, TV3, TOp extends ` / ${number}` ? TOp : "">;
12900
12964
 
12901
- type Rtn$1<TColor extends TwColor, TLum extends TwLuminosity> = TLum extends keyof TwLuminosityLookup ? TLum extends keyof TwChromaLookup ? TColor extends keyof TwHue ? `oklch(${TwLuminosityLookup[TLum]} ${TwChromaLookup[TLum]} ${TwHue[TColor]}) ` : never : never : never;
12965
+ type Rtn$1<TColor extends TwColor, TLum extends TwLuminosity> = TLum extends keyof TwLuminosityLookup ? TLum extends keyof TwChromaLookup ? TColor extends keyof TwHue ? `oklch(${TwLuminosityLookup[TLum]} ${TwChromaLookup[TLum]} ${TwHue[TColor]})` : never : never : never;
12902
12966
  /**
12967
+ * **twColor**`(color, luminosity)` => `oklch(...)`
12968
+ *
12903
12969
  * Provides a Tailwind Color using the `oklch` color
12904
12970
  * specification. The output is intended to put into
12905
12971
  * a CSS property.
12972
+ *
12973
+ * **Related:** `twColorRgb()`
12906
12974
  */
12907
12975
  declare function twColor<TColor extends TwColor, TLum extends TwLuminosity>(color: TColor, luminosity: TLum): Rtn$1<TColor, TLum>;
12908
12976
 
@@ -14530,6 +14598,16 @@ type StartingWithTypeGuard<TStartsWith extends string> = <TValue extends Narrowa
14530
14598
  */
14531
14599
  declare function startsWith<TStartsWith extends string>(startingWith: TStartsWith): StartingWithTypeGuard<TStartsWith>;
14532
14600
 
14601
+ /**
14602
+ * **isHtmlComponentTag**`(...names)`
14603
+ *
14604
+ * A type guard that validates if a value matches a valid HTML component tag.
14605
+ * Supports both `kebab-case` and `PascalCase` component names.
14606
+ *
14607
+ * Attributes are validated using `areAttributesValid()`.
14608
+ */
14609
+ declare function isHtmlComponentTag<T extends readonly string[]>(...names: T): <V>(val: V) => val is V & AsHtmlComponentTag<T[number]>;
14610
+
14533
14611
  /**
14534
14612
  * Tests whether the passed in `val` contains some HTML-like tags in it.
14535
14613
  *
@@ -14545,15 +14623,31 @@ declare function hasHtml(val: unknown): val is string;
14545
14623
  declare function hasValidHtml(val: unknown): val is string;
14546
14624
 
14547
14625
  /**
14548
- * tests whether the `val` passed in is the name of a valid
14626
+ * tests whether the `val` passed in is the **name** of a valid
14549
14627
  * HTML block tag (e.g., "div", "span", etc.)
14628
+ *
14629
+ * **Note:** this will _not_ match with leading or trailing whitespace
14550
14630
  */
14551
14631
  declare function isValidBlockTag(val: unknown): val is string;
14552
14632
  /**
14553
- * test whetehr the `val` pass in is a the name of a valid HTML
14633
+ * test whetehr the `val` pass in is a the **name** of a valid HTML
14554
14634
  * atomic tag (e.g., "br", "meta", etc.)
14635
+ *
14636
+ * **Note:** this will _not_ match with leading or trailing whitespace
14555
14637
  */
14556
14638
  declare function isValidAtomicTag(val: unknown): val is string;
14639
+ /**
14640
+ * **isValidHtmlTag**`(...tags)(val)`
14641
+ *
14642
+ * A higher order type guard which tests that the `val` passed in
14643
+ * is a valid HTML tag (block or atomic) or the types specified.
14644
+ *
14645
+ * - if it's an openning or atomic tag then the tag name is validated
14646
+ * but so are the characters between the tag name and the close.
14647
+ * - if it's a closing tag then NO characters are allowed beyond
14648
+ * that of the tag and the brackets.
14649
+ */
14650
+ declare function isValidHtmlTag<T extends readonly (Html__BlockTag | Html__AtomicTag)[]>(...tags: T): <V>(val: V) => val is V & AsHtmlTag<V, T[number]>;
14557
14651
 
14558
14652
  /**
14559
14653
  * **isHtml**`(val)`
@@ -14582,6 +14676,12 @@ declare function isValidHtml(val: unknown): val is string;
14582
14676
  */
14583
14677
  declare function isHtmlElement(val: unknown): val is HTMLElement;
14584
14678
 
14679
+ /**
14680
+ * type guard which validates that `val` is a string which could represent
14681
+ * the attributes in an HTML tag.
14682
+ */
14683
+ declare function validHtmlAttributes(val: unknown): val is string;
14684
+
14585
14685
  /**
14586
14686
  * **isAlpha**(value)
14587
14687
  *
@@ -15850,4 +15950,4 @@ declare function isVueRef(val: unknown): val is VueRef;
15850
15950
  */
15851
15951
  declare function asVueRef<T extends Narrowable>(value: T): VueRef<T>;
15852
15952
 
15853
- export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type ConfigRestApi, type CssFromDefnOption, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type DictionaryWithValueFilter, type DictionaryWithoutValueFilter, type DoesExtendTypeguard, type EndingWithTypeGuard, type EndpointGenerator, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetInferenceProps, type GetOptions, type Joiner, type KeyframeApi, type Mapper, type MetricTypeGuard, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type ToKeyValueSort, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UomTypeGuard, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, cardType, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createMapper, createObjectMap, createTypeToken, cssColor, cssFromDefinition, csv, defineCss, defineObj, defineObject, defineObjectApi, defineTuple, doesExtend, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, filterEmpty, filterUndefined, find, fnMeta, fromDefineObject, fromKeyValue, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasHtml, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMap, isMapToken, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMoment, isNarrowableObject, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetContainer, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeSubtype, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidHtml, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isVueRef, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, narrowObjectTo, narrowObjectToType, never, objectToApi, objectValues, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toKeyValue, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, valuesOf, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };
15953
+ export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type ConfigRestApi, type CssFromDefnOption, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type DictionaryWithValueFilter, type DictionaryWithoutValueFilter, type DoesExtendTypeguard, type EndingWithTypeGuard, type EndpointGenerator, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetInferenceProps, type GetOptions, type Joiner, type KeyframeApi, type Mapper, type MetricTypeGuard, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type ToKeyValueSort, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UomTypeGuard, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, cardType, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createMapper, createObjectMap, createTypeToken, cssColor, cssFromDefinition, csv, defineCss, defineObj, defineObject, defineObjectApi, defineTuple, doesExtend, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, filterEmpty, filterUndefined, find, fnMeta, fromDefineObject, fromKeyValue, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasHtml, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlComponentTag, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMap, isMapToken, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMoment, isNarrowableObject, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetContainer, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeSubtype, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidHtml, isValidHtmlTag, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isVueRef, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, narrowObjectTo, narrowObjectToType, never, objectToApi, objectValues, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toKeyValue, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, validHtmlAttributes, valuesOf, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };
@@ -1934,17 +1934,17 @@ var TW_HUE = {
1934
1934
  ...TW_HUE_STATIC
1935
1935
  };
1936
1936
  var TW_LUMINOSITY = {
1937
- 50: 97.78,
1938
- 100: 93.56,
1939
- 200: 88.11,
1940
- 300: 82.67,
1941
- 400: 74.22,
1942
- 500: 64.78,
1943
- 600: 57.33,
1944
- 700: 46.89,
1945
- 800: 39.44,
1946
- 900: 32,
1947
- 950: 23.78
1937
+ "50": 97.78,
1938
+ "100": 93.56,
1939
+ "200": 88.11,
1940
+ "300": 82.67,
1941
+ "400": 74.22,
1942
+ "500": 64.78,
1943
+ "600": 57.33,
1944
+ "700": 46.89,
1945
+ "800": 39.44,
1946
+ "900": 32,
1947
+ "950": 23.78
1948
1948
  };
1949
1949
  var TW_LUMIN_50 = TW_LUMINOSITY["50"];
1950
1950
  var TW_LUMIN_100 = TW_LUMINOSITY["100"];
@@ -1958,17 +1958,17 @@ var TW_LUMIN_800 = TW_LUMINOSITY["800"];
1958
1958
  var TW_LUMIN_900 = TW_LUMINOSITY["900"];
1959
1959
  var TW_LUMIN_950 = TW_LUMINOSITY["950"];
1960
1960
  var TW_CHROMA = {
1961
- 50: 0.0108,
1962
- 100: 0.0321,
1963
- 200: 0.0609,
1964
- 300: 0.0908,
1965
- 400: 0.1398,
1966
- 500: 0.1472,
1967
- 600: 0.1299,
1968
- 700: 0.1067,
1969
- 800: 0.0898,
1970
- 900: 0.0726,
1971
- 950: 0.054
1961
+ "50": 0.0108,
1962
+ "100": 0.0321,
1963
+ "200": 0.0609,
1964
+ "300": 0.0908,
1965
+ "400": 0.1398,
1966
+ "500": 0.1472,
1967
+ "600": 0.1299,
1968
+ "700": 0.1067,
1969
+ "800": 0.0898,
1970
+ "900": 0.0726,
1971
+ "950": 0.054
1972
1972
  };
1973
1973
  var TW_CHROMA_50 = TW_CHROMA["50"];
1974
1974
  var TW_CHROMA_100 = TW_CHROMA["100"];
@@ -3491,6 +3491,36 @@ function startsWith(startingWith) {
3491
3491
  };
3492
3492
  }
3493
3493
 
3494
+ // src/type-guards/html/component-tags.ts
3495
+ function isHtmlComponentTag(...names) {
3496
+ return (val) => {
3497
+ if (typeof val !== "string")
3498
+ return false;
3499
+ const trimmedVal = val.trim();
3500
+ const tagRegex = /^<\/?([\w-]+)(.*?)>$/;
3501
+ const match = tagRegex.exec(trimmedVal);
3502
+ if (!match) {
3503
+ return false;
3504
+ }
3505
+ const [, tagName, attributes] = match;
3506
+ const isClosingTag = trimmedVal.startsWith("</");
3507
+ const isKebabCase = /^[a-z][a-z0-9-]*$/.test(tagName);
3508
+ const isPascalCase = /^[A-Z][a-zA-Z0-9]*$/.test(tagName);
3509
+ const normalizedKebabCase = toKebabCase(tagName);
3510
+ const normalizedPascalCase = toPascalCase(tagName);
3511
+ const isValidName = names.some(
3512
+ (name) => isKebabCase && normalizedKebabCase === toKebabCase(name) || isPascalCase && normalizedPascalCase === toPascalCase(name)
3513
+ );
3514
+ if (!isValidName) {
3515
+ return false;
3516
+ }
3517
+ if (isClosingTag) {
3518
+ return attributes.trim() === "";
3519
+ }
3520
+ return validHtmlAttributes(attributes);
3521
+ };
3522
+ }
3523
+
3494
3524
  // src/type-guards/html/hasHtml.ts
3495
3525
  function hasHtml(val) {
3496
3526
  if (typeof val !== "string")
@@ -3537,6 +3567,39 @@ function isValidBlockTag(val) {
3537
3567
  function isValidAtomicTag(val) {
3538
3568
  return isString(val) && HTML_ATOMIC_TAGS.includes(val.toLowerCase());
3539
3569
  }
3570
+ function isValidHtmlTag(...tags) {
3571
+ return (val) => {
3572
+ if (typeof val !== "string")
3573
+ return false;
3574
+ const trimmedVal = val.trim();
3575
+ const tagRegex = /^<\/?(\w+)(.*?)>$/;
3576
+ const match = tagRegex.exec(trimmedVal);
3577
+ if (!match) {
3578
+ return false;
3579
+ }
3580
+ const [, tagName, attributes] = match;
3581
+ const normalizedTagName = tagName.toLowerCase();
3582
+ const isClosingTag = trimmedVal.startsWith("</");
3583
+ const isAtomicTag = HTML_ATOMIC_TAGS.includes(normalizedTagName);
3584
+ const isBlockTag = HTML_BLOCK_TAGS.includes(normalizedTagName);
3585
+ if (
3586
+ // Validate tag name is within the provided `tags` scope
3587
+ !tags.map((t) => t.toLowerCase()).includes(normalizedTagName)
3588
+ ) {
3589
+ return false;
3590
+ }
3591
+ if (isClosingTag) {
3592
+ return attributes.trim() === "" && !isAtomicTag;
3593
+ }
3594
+ if (isAtomicTag) {
3595
+ return attributes.trim() === "" || validHtmlAttributes(attributes);
3596
+ }
3597
+ if (isBlockTag) {
3598
+ return validHtmlAttributes(attributes);
3599
+ }
3600
+ return false;
3601
+ };
3602
+ }
3540
3603
 
3541
3604
  // src/type-guards/html/isHtml.ts
3542
3605
  function isHtml(val) {
@@ -3584,6 +3647,16 @@ function isHtmlElement(val) {
3584
3647
  return isObject(val) && "attributes" in val && "firstElementChild" in val && "innerHTML" in val;
3585
3648
  }
3586
3649
 
3650
+ // src/type-guards/html/validHtmlAttributes.ts
3651
+ function validHtmlAttributes(val) {
3652
+ if (typeof val !== "string")
3653
+ return false;
3654
+ const quoteRegex = /["']/g;
3655
+ const unmatchedQuotes = (val.match(quoteRegex)?.length || 0) % 2 !== 0;
3656
+ const invalidAssignment = /(\w+=)(?=\s|>|$)/.test(val);
3657
+ return !val.includes(">") && !unmatchedQuotes && !invalidAssignment;
3658
+ }
3659
+
3587
3660
  // src/type-guards/isAlpha.ts
3588
3661
  function isAlpha(value) {
3589
3662
  return isString(value) && split(value).every((v) => ALPHA_CHARS.includes(v));
@@ -6164,6 +6237,7 @@ export {
6164
6237
  isHmUrl,
6165
6238
  isHomeDepotUrl,
6166
6239
  isHtml,
6240
+ isHtmlComponentTag,
6167
6241
  isHtmlElement,
6168
6242
  isIkeaUrl,
6169
6243
  isIndexable,
@@ -6310,6 +6384,7 @@ export {
6310
6384
  isValidAtomicTag,
6311
6385
  isValidBlockTag,
6312
6386
  isValidHtml,
6387
+ isValidHtmlTag,
6313
6388
  isVariable,
6314
6389
  isVisa,
6315
6390
  isVisaMastercard,
@@ -6436,6 +6511,7 @@ export {
6436
6511
  unset,
6437
6512
  uppercase,
6438
6513
  urlMeta,
6514
+ validHtmlAttributes,
6439
6515
  valuesOf,
6440
6516
  widen,
6441
6517
  withDefaults,