@contember/utilities 1.2.7 → 1.3.0-alpha.11
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/development/assert-types/AssertionError.cjs +9 -0
- package/dist/development/assert-types/AssertionError.cjs.map +1 -0
- package/dist/development/assert-types/AssertionError.js.map +1 -1
- package/dist/development/assert-types/Predicates.cjs +7 -0
- package/dist/development/assert-types/Predicates.cjs.map +1 -0
- package/dist/development/assert-types/Predicates.js +2 -103
- package/dist/development/assert-types/Predicates.js.map +1 -1
- package/dist/development/assert-types/assert.cjs +10 -0
- package/dist/development/assert-types/assert.cjs.map +1 -0
- package/dist/development/assert-types/assertNever.cjs +7 -0
- package/dist/development/assert-types/assertNever.cjs.map +1 -0
- package/dist/development/class-name/colorSchemeClassName.cjs +12 -0
- package/dist/development/class-name/colorSchemeClassName.cjs.map +1 -0
- package/dist/development/class-name/colorSchemeClassName.js +1 -5
- package/dist/development/class-name/colorSchemeClassName.js.map +1 -1
- package/dist/development/class-name/constants.cjs +7 -0
- package/dist/development/class-name/constants.cjs.map +1 -0
- package/dist/development/class-name/constants.js +1 -1
- package/dist/development/class-name/constants.js.map +1 -1
- package/dist/development/class-name/deduplicateClassName.cjs +7 -0
- package/dist/development/class-name/deduplicateClassName.cjs.map +1 -0
- package/dist/development/class-name/filterThemedClassName.cjs +46 -0
- package/dist/development/class-name/filterThemedClassName.cjs.map +1 -0
- package/dist/development/class-name/filterThemedClassName.js +8 -30
- package/dist/development/class-name/filterThemedClassName.js.map +1 -1
- package/dist/development/class-name/flatClassNameList.cjs +16 -0
- package/dist/development/class-name/flatClassNameList.cjs.map +1 -0
- package/dist/development/class-name/listClassName.cjs +9 -0
- package/dist/development/class-name/listClassName.cjs.map +1 -0
- package/dist/development/class-name/themeClassName.cjs +18 -0
- package/dist/development/class-name/themeClassName.cjs.map +1 -0
- package/dist/development/class-name/themeClassName.js +7 -7
- package/dist/development/class-name/themeClassName.js.map +1 -1
- package/dist/development/css-utilities/px.cjs +7 -0
- package/dist/development/css-utilities/px.cjs.map +1 -0
- package/dist/development/css-utilities/px.js.map +1 -1
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs +20 -0
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs.map +1 -0
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js +20 -0
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js.map +1 -0
- package/dist/development/deprecate/deprecate.cjs +6 -0
- package/dist/development/deprecate/deprecate.cjs.map +1 -0
- package/dist/development/deprecate/deprecate.js.map +1 -1
- package/dist/development/dom/dataAttribute.cjs +13 -0
- package/dist/development/dom/dataAttribute.cjs.map +1 -0
- package/dist/development/dom/getElementDimensions.cjs +22 -0
- package/dist/development/dom/getElementDimensions.cjs.map +1 -0
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs +24 -0
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs.map +1 -0
- package/dist/development/dom/shouldCancelStart.cjs +29 -0
- package/dist/development/dom/shouldCancelStart.cjs.map +1 -0
- package/dist/development/dom/shouldCancelStart.js +29 -0
- package/dist/development/dom/shouldCancelStart.js.map +1 -0
- package/dist/development/dom/stateDataAttributes.cjs +11 -0
- package/dist/development/dom/stateDataAttributes.cjs.map +1 -0
- package/dist/development/dom/stateDataAttributes.js.map +1 -1
- package/dist/development/dom/svgSizeProps.cjs +15 -0
- package/dist/development/dom/svgSizeProps.cjs.map +1 -0
- package/dist/development/dom/svgSizeProps.js.map +1 -1
- package/dist/development/functional/omit.cjs +15 -0
- package/dist/development/functional/omit.cjs.map +1 -0
- package/dist/development/functional/omit.js.map +1 -1
- package/dist/development/functional/pick.cjs +15 -0
- package/dist/development/functional/pick.cjs.map +1 -0
- package/dist/development/functional/pick.js.map +1 -1
- package/dist/development/functional/range.cjs +7 -0
- package/dist/development/functional/range.cjs.map +1 -0
- package/dist/development/index.cjs +56 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +6 -44
- package/dist/development/index.js.map +1 -1
- package/dist/development/string-utilities/kebabCase.cjs +8 -0
- package/dist/development/string-utilities/kebabCase.cjs.map +1 -0
- package/dist/production/assert-types/AssertionError.cjs +9 -0
- package/dist/production/assert-types/AssertionError.cjs.map +1 -0
- package/dist/production/assert-types/AssertionError.js.map +1 -1
- package/dist/production/assert-types/Predicates.cjs +7 -0
- package/dist/production/assert-types/Predicates.cjs.map +1 -0
- package/dist/production/assert-types/Predicates.js +2 -103
- package/dist/production/assert-types/Predicates.js.map +1 -1
- package/dist/production/assert-types/assert.cjs +10 -0
- package/dist/production/assert-types/assert.cjs.map +1 -0
- package/dist/production/assert-types/assertNever.cjs +7 -0
- package/dist/production/assert-types/assertNever.cjs.map +1 -0
- package/dist/production/class-name/colorSchemeClassName.cjs +12 -0
- package/dist/production/class-name/colorSchemeClassName.cjs.map +1 -0
- package/dist/production/class-name/colorSchemeClassName.js +1 -5
- package/dist/production/class-name/colorSchemeClassName.js.map +1 -1
- package/dist/production/class-name/constants.cjs +7 -0
- package/dist/production/class-name/constants.cjs.map +1 -0
- package/dist/production/class-name/constants.js +1 -1
- package/dist/production/class-name/constants.js.map +1 -1
- package/dist/production/class-name/deduplicateClassName.cjs +7 -0
- package/dist/production/class-name/deduplicateClassName.cjs.map +1 -0
- package/dist/production/class-name/filterThemedClassName.cjs +46 -0
- package/dist/production/class-name/filterThemedClassName.cjs.map +1 -0
- package/dist/production/class-name/filterThemedClassName.js +8 -30
- package/dist/production/class-name/filterThemedClassName.js.map +1 -1
- package/dist/production/class-name/flatClassNameList.cjs +16 -0
- package/dist/production/class-name/flatClassNameList.cjs.map +1 -0
- package/dist/production/class-name/listClassName.cjs +9 -0
- package/dist/production/class-name/listClassName.cjs.map +1 -0
- package/dist/production/class-name/themeClassName.cjs +18 -0
- package/dist/production/class-name/themeClassName.cjs.map +1 -0
- package/dist/production/class-name/themeClassName.js +7 -7
- package/dist/production/class-name/themeClassName.js.map +1 -1
- package/dist/production/css-utilities/px.cjs +7 -0
- package/dist/production/css-utilities/px.cjs.map +1 -0
- package/dist/production/css-utilities/px.js.map +1 -1
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs +20 -0
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs.map +1 -0
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js +20 -0
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js.map +1 -0
- package/dist/production/deprecate/deprecate.cjs +6 -0
- package/dist/production/deprecate/deprecate.cjs.map +1 -0
- package/dist/production/deprecate/deprecate.js.map +1 -1
- package/dist/production/dom/dataAttribute.cjs +13 -0
- package/dist/production/dom/dataAttribute.cjs.map +1 -0
- package/dist/production/dom/getElementDimensions.cjs +22 -0
- package/dist/production/dom/getElementDimensions.cjs.map +1 -0
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs +24 -0
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs.map +1 -0
- package/dist/production/dom/shouldCancelStart.cjs +29 -0
- package/dist/production/dom/shouldCancelStart.cjs.map +1 -0
- package/dist/production/dom/shouldCancelStart.js +29 -0
- package/dist/production/dom/shouldCancelStart.js.map +1 -0
- package/dist/production/dom/stateDataAttributes.cjs +11 -0
- package/dist/production/dom/stateDataAttributes.cjs.map +1 -0
- package/dist/production/dom/stateDataAttributes.js.map +1 -1
- package/dist/production/dom/svgSizeProps.cjs +15 -0
- package/dist/production/dom/svgSizeProps.cjs.map +1 -0
- package/dist/production/dom/svgSizeProps.js.map +1 -1
- package/dist/production/functional/omit.cjs +15 -0
- package/dist/production/functional/omit.cjs.map +1 -0
- package/dist/production/functional/omit.js.map +1 -1
- package/dist/production/functional/pick.cjs +15 -0
- package/dist/production/functional/pick.cjs.map +1 -0
- package/dist/production/functional/pick.js.map +1 -1
- package/dist/production/functional/range.cjs +7 -0
- package/dist/production/functional/range.cjs.map +1 -0
- package/dist/production/index.cjs +56 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +6 -44
- package/dist/production/index.js.map +1 -1
- package/dist/production/string-utilities/kebabCase.cjs +8 -0
- package/dist/production/string-utilities/kebabCase.cjs.map +1 -0
- package/dist/types/assert-types/Predicates.d.ts +0 -25
- package/dist/types/assert-types/Predicates.d.ts.map +1 -1
- package/dist/types/assert-types/types.d.ts +0 -3
- package/dist/types/assert-types/types.d.ts.map +1 -1
- package/dist/types/class-name/colorSchemeClassName.d.ts +3 -6
- package/dist/types/class-name/colorSchemeClassName.d.ts.map +1 -1
- package/dist/types/class-name/constants.d.ts +0 -18
- package/dist/types/class-name/constants.d.ts.map +1 -1
- package/dist/types/class-name/filterThemedClassName.d.ts +2 -2
- package/dist/types/class-name/filterThemedClassName.d.ts.map +1 -1
- package/dist/types/class-name/index.d.ts +0 -1
- package/dist/types/class-name/index.d.ts.map +1 -1
- package/dist/types/class-name/themeClassName.d.ts +6 -15
- package/dist/types/class-name/themeClassName.d.ts.map +1 -1
- package/dist/types/class-name/types.d.ts +0 -4
- package/dist/types/class-name/types.d.ts.map +1 -1
- package/dist/types/css-utilities/px.d.ts +6 -4
- package/dist/types/css-utilities/px.d.ts.map +1 -1
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts +4 -0
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts.map +1 -0
- package/dist/types/data-utilities/index.d.ts +2 -0
- package/dist/types/data-utilities/index.d.ts.map +1 -0
- package/dist/types/deprecate/index.d.ts +0 -1
- package/dist/types/deprecate/index.d.ts.map +1 -1
- package/dist/types/dom/index.d.ts +1 -3
- package/dist/types/dom/index.d.ts.map +1 -1
- package/dist/types/dom/shouldCancelStart.d.ts +4 -0
- package/dist/types/dom/shouldCancelStart.d.ts.map +1 -0
- package/dist/types/functional/index.d.ts +0 -2
- package/dist/types/functional/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/string-utilities/index.d.ts +0 -2
- package/dist/types/string-utilities/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/Narrow.d.ts +1 -2
- package/dist/types/types/Narrow.d.ts.map +1 -1
- package/dist/types/types/PolymorphicRefs.d.ts +2 -1
- package/dist/types/types/PolymorphicRefs.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +0 -9
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/assert-types/Predicates.ts +1 -86
- package/src/assert-types/types.ts +0 -4
- package/src/class-name/colorSchemeClassName.ts +5 -12
- package/src/class-name/constants.ts +1 -19
- package/src/class-name/filterThemedClassName.ts +14 -41
- package/src/class-name/index.ts +0 -1
- package/src/class-name/themeClassName.ts +11 -37
- package/src/class-name/types.ts +0 -10
- package/src/css-utilities/px.ts +0 -7
- package/src/data-utilities/dateToStringWithoutTimezone.ts +18 -0
- package/src/data-utilities/index.ts +1 -0
- package/src/deprecate/deprecate.ts +1 -1
- package/src/deprecate/index.ts +0 -1
- package/src/dom/index.ts +1 -3
- package/src/dom/shouldCancelStart.ts +32 -0
- package/src/functional/index.ts +0 -2
- package/src/index.ts +1 -0
- package/src/string-utilities/index.ts +0 -2
- package/src/types/Narrow.ts +1 -3
- package/src/types/PolymorphicRefs.ts +3 -1
- package/src/types/index.ts +0 -21
- package/dist/development/class-name/stateClassName.js +0 -11
- package/dist/development/class-name/stateClassName.js.map +0 -1
- package/dist/development/deprecate/fallback.js +0 -11
- package/dist/development/deprecate/fallback.js.map +0 -1
- package/dist/development/dom/getMatchingParentElement.js +0 -17
- package/dist/development/dom/getMatchingParentElement.js.map +0 -1
- package/dist/development/dom/isScrollable.js +0 -22
- package/dist/development/dom/isScrollable.js.map +0 -1
- package/dist/development/dom/parseTransformMatrix.js +0 -29
- package/dist/development/dom/parseTransformMatrix.js.map +0 -1
- package/dist/development/functional/extend.js +0 -33
- package/dist/development/functional/extend.js.map +0 -1
- package/dist/development/functional/setHasOneOf.js +0 -7
- package/dist/development/functional/setHasOneOf.js.map +0 -1
- package/dist/development/string-utilities/capitalize.js +0 -7
- package/dist/development/string-utilities/capitalize.js.map +0 -1
- package/dist/development/string-utilities/trimString.js +0 -8
- package/dist/development/string-utilities/trimString.js.map +0 -1
- package/dist/production/class-name/stateClassName.js +0 -11
- package/dist/production/class-name/stateClassName.js.map +0 -1
- package/dist/production/deprecate/fallback.js +0 -11
- package/dist/production/deprecate/fallback.js.map +0 -1
- package/dist/production/dom/getMatchingParentElement.js +0 -17
- package/dist/production/dom/getMatchingParentElement.js.map +0 -1
- package/dist/production/dom/isScrollable.js +0 -22
- package/dist/production/dom/isScrollable.js.map +0 -1
- package/dist/production/dom/parseTransformMatrix.js +0 -29
- package/dist/production/dom/parseTransformMatrix.js.map +0 -1
- package/dist/production/functional/extend.js +0 -33
- package/dist/production/functional/extend.js.map +0 -1
- package/dist/production/functional/setHasOneOf.js +0 -7
- package/dist/production/functional/setHasOneOf.js.map +0 -1
- package/dist/production/string-utilities/capitalize.js +0 -7
- package/dist/production/string-utilities/capitalize.js.map +0 -1
- package/dist/production/string-utilities/trimString.js +0 -8
- package/dist/production/string-utilities/trimString.js.map +0 -1
- package/dist/types/class-name/stateClassName.d.ts +0 -19
- package/dist/types/class-name/stateClassName.d.ts.map +0 -1
- package/dist/types/deprecate/fallback.d.ts +0 -2
- package/dist/types/deprecate/fallback.d.ts.map +0 -1
- package/dist/types/dom/getMatchingParentElement.d.ts +0 -2
- package/dist/types/dom/getMatchingParentElement.d.ts.map +0 -1
- package/dist/types/dom/isScrollable.d.ts +0 -7
- package/dist/types/dom/isScrollable.d.ts.map +0 -1
- package/dist/types/dom/parseTransformMatrix.d.ts +0 -15
- package/dist/types/dom/parseTransformMatrix.d.ts.map +0 -1
- package/dist/types/functional/extend.d.ts +0 -5
- package/dist/types/functional/extend.d.ts.map +0 -1
- package/dist/types/functional/setHasOneOf.d.ts +0 -2
- package/dist/types/functional/setHasOneOf.d.ts.map +0 -1
- package/dist/types/string-utilities/capitalize.d.ts +0 -2
- package/dist/types/string-utilities/capitalize.d.ts.map +0 -1
- package/dist/types/string-utilities/trimString.d.ts +0 -9
- package/dist/types/string-utilities/trimString.d.ts.map +0 -1
- package/dist/types/types/Any.d.ts +0 -4
- package/dist/types/types/Any.d.ts.map +0 -1
- package/dist/types/types/DeepPartial.d.ts +0 -4
- package/dist/types/types/DeepPartial.d.ts.map +0 -1
- package/dist/types/types/NonNullableRequired.d.ts +0 -4
- package/dist/types/types/NonNullableRequired.d.ts.map +0 -1
- package/dist/types/types/ObjectKeyValue.d.ts +0 -4
- package/dist/types/types/ObjectKeyValue.d.ts.map +0 -1
- package/dist/types/types/Primitive.d.ts +0 -2
- package/dist/types/types/Primitive.d.ts.map +0 -1
- package/dist/types/types/RequiredDeepPlainObject.d.ts +0 -4
- package/dist/types/types/RequiredDeepPlainObject.d.ts.map +0 -1
- package/dist/types/types/Try.d.ts +0 -2
- package/dist/types/types/Try.d.ts.map +0 -1
- package/dist/types/types/TypeofStringLiteral.d.ts +0 -2
- package/dist/types/types/TypeofStringLiteral.d.ts.map +0 -1
- package/src/class-name/stateClassName.ts +0 -32
- package/src/deprecate/fallback.ts +0 -7
- package/src/dom/getMatchingParentElement.ts +0 -13
- package/src/dom/isScrollable.ts +0 -24
- package/src/dom/parseTransformMatrix.ts +0 -35
- package/src/functional/extend.ts +0 -37
- package/src/functional/setHasOneOf.ts +0 -3
- package/src/string-utilities/capitalize.ts +0 -3
- package/src/string-utilities/trimString.ts +0 -12
- package/src/types/Any.ts +0 -3
- package/src/types/DeepPartial.ts +0 -7
- package/src/types/NonNullableRequired.ts +0 -1
- package/src/types/ObjectKeyValue.ts +0 -1
- package/src/types/Primitive.ts +0 -1
- package/src/types/RequiredDeepPlainObject.ts +0 -3
- package/src/types/Try.ts +0 -4
- package/src/types/TypeofStringLiteral.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldCancelStart.cjs","sources":["../../../src/dom/shouldCancelStart.ts"],"sourcesContent":["const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])\n\n// This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.\n// We just needed to add support for slate void elements as well as some additional checks.\nexport const shouldCancelStart = (event: {target?: unknown}): boolean => {\n\t// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`\n\tif (!(event.target instanceof Element)) {\n\t\treturn true\n\t}\n\n\tlet el: Node | null = event.target\n\n\twhile (el) {\n\t\tif (el instanceof Element) {\n\t\t\tif (interactiveElements.has(el.tagName)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif ((el as any).sortableHandle === true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el.getAttribute('data-slate-void') === 'true') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el instanceof HTMLElement && el.contentEditable === 'true') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tel = el.parentNode\n\t}\n\n\treturn false\n}\n"],"names":[],"mappings":";;AAAA,MAAM,0CAA0B,IAAI,CAAC,SAAS,YAAY,UAAU,UAAU,QAAQ,CAAC;AAI1E,MAAA,oBAAoB,CAAC,UAAuC;AAEpE,MAAA,EAAE,MAAM,kBAAkB,UAAU;AAChC,WAAA;AAAA,EACR;AAEA,MAAI,KAAkB,MAAM;AAE5B,SAAO,IAAI;AACV,QAAI,cAAc,SAAS;AAC1B,UAAI,oBAAoB,IAAI,GAAG,OAAO,GAAG;AACjC,eAAA;AAAA,MACR;AACK,UAAA,GAAW,mBAAmB,MAAM;AACjC,eAAA;AAAA,MACR;AACA,UAAI,GAAG,aAAa,iBAAiB,MAAM,QAAQ;AAC3C,eAAA;AAAA,MACR;AACA,UAAI,cAAc,eAAe,GAAG,oBAAoB,QAAQ;AACxD,eAAA;AAAA,MACR;AAAA,IACD;AACA,SAAK,GAAG;AAAA,EACT;AAEO,SAAA;AACR;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const interactiveElements = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT", "OPTION", "BUTTON"]);
|
|
2
|
+
const shouldCancelStart = (event) => {
|
|
3
|
+
if (!(event.target instanceof Element)) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
let el = event.target;
|
|
7
|
+
while (el) {
|
|
8
|
+
if (el instanceof Element) {
|
|
9
|
+
if (interactiveElements.has(el.tagName)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (el.sortableHandle === true) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (el.getAttribute("data-slate-void") === "true") {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (el instanceof HTMLElement && el.contentEditable === "true") {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
el = el.parentNode;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
shouldCancelStart
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=shouldCancelStart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldCancelStart.js","sources":["../../../src/dom/shouldCancelStart.ts"],"sourcesContent":["const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])\n\n// This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.\n// We just needed to add support for slate void elements as well as some additional checks.\nexport const shouldCancelStart = (event: {target?: unknown}): boolean => {\n\t// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`\n\tif (!(event.target instanceof Element)) {\n\t\treturn true\n\t}\n\n\tlet el: Node | null = event.target\n\n\twhile (el) {\n\t\tif (el instanceof Element) {\n\t\t\tif (interactiveElements.has(el.tagName)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif ((el as any).sortableHandle === true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el.getAttribute('data-slate-void') === 'true') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el instanceof HTMLElement && el.contentEditable === 'true') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tel = el.parentNode\n\t}\n\n\treturn false\n}\n"],"names":[],"mappings":"AAAA,MAAM,0CAA0B,IAAI,CAAC,SAAS,YAAY,UAAU,UAAU,QAAQ,CAAC;AAI1E,MAAA,oBAAoB,CAAC,UAAuC;AAEpE,MAAA,EAAE,MAAM,kBAAkB,UAAU;AAChC,WAAA;AAAA,EACR;AAEA,MAAI,KAAkB,MAAM;AAE5B,SAAO,IAAI;AACV,QAAI,cAAc,SAAS;AAC1B,UAAI,oBAAoB,IAAI,GAAG,OAAO,GAAG;AACjC,eAAA;AAAA,MACR;AACK,UAAA,GAAW,mBAAmB,MAAM;AACjC,eAAA;AAAA,MACR;AACA,UAAI,GAAG,aAAa,iBAAiB,MAAM,QAAQ;AAC3C,eAAA;AAAA,MACR;AACA,UAAI,cAAc,eAAe,GAAG,oBAAoB,QAAQ;AACxD,eAAA;AAAA,MACR;AAAA,IACD;AACA,SAAK,GAAG;AAAA,EACT;AAEO,SAAA;AACR;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const dataAttribute = require("./dataAttribute.cjs");
|
|
4
|
+
const kebabCase = require("../string-utilities/kebabCase.cjs");
|
|
5
|
+
function stateDataAttributes(state) {
|
|
6
|
+
return Object.fromEntries(Object.entries(state).map(
|
|
7
|
+
([key, value]) => [`data-${kebabCase.toKebabCase(key).toLowerCase()}`, dataAttribute.dataAttribute(value)]
|
|
8
|
+
));
|
|
9
|
+
}
|
|
10
|
+
exports.stateDataAttributes = stateDataAttributes;
|
|
11
|
+
//# sourceMappingURL=stateDataAttributes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateDataAttributes.cjs","sources":["../../../src/dom/stateDataAttributes.ts"],"sourcesContent":["import { toKebabCase } from '../string-utilities'\nimport { dataAttribute } from './dataAttribute'\n\nexport function stateDataAttributes(state: Record<string, unknown>) {\n\treturn Object.fromEntries(Object.entries(state).map(\n\t\t([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],\n\t))\n}\n"],"names":["toKebabCase","dataAttribute"],"mappings":";;;;AAGO,SAAS,oBAAoB,OAAgC;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC/C,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQA,UAAAA,YAAY,GAAG,EAAE,YAAa,CAAA,IAAIC,cAAA,cAAc,KAAK,CAAC;AAAA,EAAA,CACjF;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateDataAttributes.js","sources":["../../../src/dom/stateDataAttributes.ts"],"sourcesContent":["import { toKebabCase } from '../string-utilities'\nimport { dataAttribute } from './dataAttribute'\n\nexport function stateDataAttributes(state: Record<string, unknown>) {\n\treturn Object.fromEntries(Object.entries(state).map(\n\t\t([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],\n\t))\n}\n"],"names":[],"mappings":";;AAGO,SAAS,oBAAoB,OAAgC;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC/C,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,YAAY,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"stateDataAttributes.js","sources":["../../../src/dom/stateDataAttributes.ts"],"sourcesContent":["import { toKebabCase } from '../string-utilities'\nimport { dataAttribute } from './dataAttribute'\n\nexport function stateDataAttributes(state: Record<string, unknown>) {\n\treturn Object.fromEntries(Object.entries(state).map(\n\t\t([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],\n\t))\n}\n"],"names":[],"mappings":";;AAGO,SAAS,oBAAoB,OAAgC;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC/C,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,YAAY,GAAG,EAAE,YAAa,CAAA,IAAI,cAAc,KAAK,CAAC;AAAA,EAAA,CACjF;AACF;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function svgSizeProps(width, height, crop = 0) {
|
|
4
|
+
const viewBoxWidth = width - crop * 2;
|
|
5
|
+
const viewBoxHeight = (height ?? width) - crop * 2;
|
|
6
|
+
const viewBoxX = crop;
|
|
7
|
+
const viewBoxY = crop;
|
|
8
|
+
return {
|
|
9
|
+
width: viewBoxWidth,
|
|
10
|
+
height: viewBoxHeight,
|
|
11
|
+
viewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.svgSizeProps = svgSizeProps;
|
|
15
|
+
//# sourceMappingURL=svgSizeProps.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svgSizeProps.cjs","sources":["../../../src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number;\n\theight: number;\n\tviewBox: string;\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":";;AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgSizeProps.js","sources":["../../../src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number;\n\theight: number;\n\tviewBox: string;\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"svgSizeProps.js","sources":["../../../src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number;\n\theight: number;\n\tviewBox: string;\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function omit(object, properties, strict = false) {
|
|
4
|
+
const next = { ...object };
|
|
5
|
+
for (let key of properties) {
|
|
6
|
+
if (key in object) {
|
|
7
|
+
delete next[key];
|
|
8
|
+
} else if (strict) {
|
|
9
|
+
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return next;
|
|
13
|
+
}
|
|
14
|
+
exports.omit = omit;
|
|
15
|
+
//# sourceMappingURL=omit.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit.cjs","sources":["../../../src/functional/omit.ts"],"sourcesContent":["export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {\n const next: Partial<T> = { ...object }\n\n for (let key of properties) {\n if (key in object) {\n delete next[key]\n } else if (strict) {\n throw new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n }\n }\n\n return next as Omit<T, K>\n}\n"],"names":[],"mappings":";;AAAO,SAAS,KAA0C,QAAW,YAA8B,SAAkB,OAAmB;AAChI,QAAA,OAAmB,EAAE,GAAG;AAE9B,WAAS,OAAO,YAAY;AAC1B,QAAI,OAAO,QAAQ;AACjB,aAAO,KAAK,GAAG;AAAA,eACN,QAAQ;AACX,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAEO,SAAA;AACT;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omit.js","sources":["../../../src/functional/omit.ts"],"sourcesContent":["export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {\n const next: Partial<T> = { ...object }\n\n for (let key of properties) {\n if (key in object) {\n delete next[key]\n } else if (strict) {\n throw new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n }\n }\n\n return next as Omit<T, K>\n}\n"],"names":[],"mappings":"AAAO,SAAS,KAA0C,QAAW,YAA8B,SAAkB,OAAmB;AAChI,QAAA,OAAmB,EAAE,GAAG;AAE9B,WAAS,OAAO,YAAY;AAC1B,QAAI,OAAO,QAAQ;AACjB,aAAO,KAAK,GAAG;AAAA,eACN,QAAQ;AACX,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"omit.js","sources":["../../../src/functional/omit.ts"],"sourcesContent":["export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {\n const next: Partial<T> = { ...object }\n\n for (let key of properties) {\n if (key in object) {\n delete next[key]\n } else if (strict) {\n throw new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n }\n }\n\n return next as Omit<T, K>\n}\n"],"names":[],"mappings":"AAAO,SAAS,KAA0C,QAAW,YAA8B,SAAkB,OAAmB;AAChI,QAAA,OAAmB,EAAE,GAAG;AAE9B,WAAS,OAAO,YAAY;AAC1B,QAAI,OAAO,QAAQ;AACjB,aAAO,KAAK,GAAG;AAAA,eACN,QAAQ;AACX,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAEO,SAAA;AACT;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function pick(object, properties) {
|
|
4
|
+
const next = {};
|
|
5
|
+
for (let key of properties) {
|
|
6
|
+
if (key in object) {
|
|
7
|
+
next[key] = object[key];
|
|
8
|
+
} else {
|
|
9
|
+
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return next;
|
|
13
|
+
}
|
|
14
|
+
exports.pick = pick;
|
|
15
|
+
//# sourceMappingURL=pick.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pick.cjs","sources":["../../../src/functional/pick.ts"],"sourcesContent":["export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {\n\tconst next: Partial<Pick<T, K>> = {}\n\n\tfor (let key of properties) {\n\t\tif (key in object) {\n\t\t\tnext[key] = object[key]\n\t\t} else {\n\t\t\tthrow new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n\t\t}\n\t}\n\n\treturn next as Pick<T, K>\n}\n"],"names":[],"mappings":";;AAAgB,SAAA,KAA0C,QAAW,YAA0C;AAC9G,QAAM,OAA4B,CAAA;AAElC,WAAS,OAAO,YAAY;AAC3B,QAAI,OAAO,QAAQ;AACb,WAAA,GAAG,IAAI,OAAO,GAAG;AAAA,IAAA,OAChB;AACA,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC1F;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick.js","sources":["../../../src/functional/pick.ts"],"sourcesContent":["export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {\n\tconst next: Partial<Pick<T, K>> = {}\n\n\tfor (let key of properties) {\n\t\tif (key in object) {\n\t\t\tnext[key] = object[key]\n\t\t} else {\n\t\t\tthrow new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n\t\t}\n\t}\n\n\treturn next as Pick<T, K>\n}\n"],"names":[],"mappings":"AAAgB,SAAA,KAA0C,QAAW,YAA0C;AAC9G,QAAM,OAA4B,CAAA;AAElC,WAAS,OAAO,YAAY;AAC3B,QAAI,OAAO,QAAQ;AACb,WAAA,GAAG,IAAI,OAAO,GAAG;AAAA,IAAA,OAChB;AACA,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"pick.js","sources":["../../../src/functional/pick.ts"],"sourcesContent":["export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {\n\tconst next: Partial<Pick<T, K>> = {}\n\n\tfor (let key of properties) {\n\t\tif (key in object) {\n\t\t\tnext[key] = object[key]\n\t\t} else {\n\t\t\tthrow new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n\t\t}\n\t}\n\n\treturn next as Pick<T, K>\n}\n"],"names":[],"mappings":"AAAgB,SAAA,KAA0C,QAAW,YAA0C;AAC9G,QAAM,OAA4B,CAAA;AAElC,WAAS,OAAO,YAAY;AAC3B,QAAI,OAAO,QAAQ;AACb,WAAA,GAAG,IAAI,OAAO,GAAG;AAAA,IAAA,OAChB;AACA,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC1F;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function range(start, end, step = 1) {
|
|
4
|
+
return Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step));
|
|
5
|
+
}
|
|
6
|
+
exports.range = range;
|
|
7
|
+
//# sourceMappingURL=range.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.cjs","sources":["../../../src/functional/range.ts"],"sourcesContent":["\n/**\n * Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n * @param start - The starting number.\n * @param end - The ending number.\n * @param step - The step size, optional, defaults to 1.\n * @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n */\nexport function range(start: number, end: number, step = 1): number[] {\n\treturn Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step))\n}\n"],"names":[],"mappings":";;AAQO,SAAS,MAAM,OAAe,KAAa,OAAO,GAAa;AAC9D,SAAA,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,GAAG,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC;AAC1I;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const AssertionError = require("./assert-types/AssertionError.cjs");
|
|
4
|
+
const Predicates = require("./assert-types/Predicates.cjs");
|
|
5
|
+
const assert = require("./assert-types/assert.cjs");
|
|
6
|
+
const assertNever = require("./assert-types/assertNever.cjs");
|
|
7
|
+
const colorSchemeClassName = require("./class-name/colorSchemeClassName.cjs");
|
|
8
|
+
const constants = require("./class-name/constants.cjs");
|
|
9
|
+
const deduplicateClassName = require("./class-name/deduplicateClassName.cjs");
|
|
10
|
+
const filterThemedClassName = require("./class-name/filterThemedClassName.cjs");
|
|
11
|
+
const flatClassNameList = require("./class-name/flatClassNameList.cjs");
|
|
12
|
+
const listClassName = require("./class-name/listClassName.cjs");
|
|
13
|
+
const themeClassName = require("./class-name/themeClassName.cjs");
|
|
14
|
+
const px = require("./css-utilities/px.cjs");
|
|
15
|
+
const dateToStringWithoutTimezone = require("./data-utilities/dateToStringWithoutTimezone.cjs");
|
|
16
|
+
const deprecate = require("./deprecate/deprecate.cjs");
|
|
17
|
+
const dataAttribute = require("./dom/dataAttribute.cjs");
|
|
18
|
+
const getElementDimensions = require("./dom/getElementDimensions.cjs");
|
|
19
|
+
const getSizeFromResizeObserverEntry = require("./dom/getSizeFromResizeObserverEntry.cjs");
|
|
20
|
+
const shouldCancelStart = require("./dom/shouldCancelStart.cjs");
|
|
21
|
+
const stateDataAttributes = require("./dom/stateDataAttributes.cjs");
|
|
22
|
+
const svgSizeProps = require("./dom/svgSizeProps.cjs");
|
|
23
|
+
const omit = require("./functional/omit.cjs");
|
|
24
|
+
const pick = require("./functional/pick.cjs");
|
|
25
|
+
const range = require("./functional/range.cjs");
|
|
26
|
+
const kebabCase = require("./string-utilities/kebabCase.cjs");
|
|
27
|
+
exports.AssertionError = AssertionError.AssertionError;
|
|
28
|
+
exports.isNonNegativeNumber = Predicates.isNonNegativeNumber;
|
|
29
|
+
exports.assert = assert.assert;
|
|
30
|
+
exports.assertNever = assertNever.assertNever;
|
|
31
|
+
exports.colorSchemeClassName = colorSchemeClassName.colorSchemeClassName;
|
|
32
|
+
exports.isColorSchemeClassName = colorSchemeClassName.isColorSchemeClassName;
|
|
33
|
+
exports.COLOR_SCHEME_CLASS_NAME_REG_EXP = constants.COLOR_SCHEME_CLASS_NAME_REG_EXP;
|
|
34
|
+
exports.THEME_CLASS_NAME_REG_EXP = constants.THEME_CLASS_NAME_REG_EXP;
|
|
35
|
+
exports.deduplicateClassName = deduplicateClassName.deduplicateClassName;
|
|
36
|
+
exports.filterThemedClassName = filterThemedClassName.filterThemedClassName;
|
|
37
|
+
exports.flatClassNameList = flatClassNameList.flatClassNameList;
|
|
38
|
+
exports.listClassName = listClassName.listClassName;
|
|
39
|
+
exports.contentThemeClassName = themeClassName.contentThemeClassName;
|
|
40
|
+
exports.controlsThemeClassName = themeClassName.controlsThemeClassName;
|
|
41
|
+
exports.themeClassName = themeClassName.themeClassName;
|
|
42
|
+
exports.px = px.px;
|
|
43
|
+
exports.dateToStringWithoutTimezone = dateToStringWithoutTimezone.dateToStringWithoutTimezone;
|
|
44
|
+
exports.deprecate = deprecate.deprecate;
|
|
45
|
+
exports.dataAttribute = dataAttribute.dataAttribute;
|
|
46
|
+
exports.getElementDimensions = getElementDimensions.getElementDimensions;
|
|
47
|
+
exports.getElementDimensionsCallback = getElementDimensions.getElementDimensionsCallback;
|
|
48
|
+
exports.getSizeFromResizeObserverEntryFactory = getSizeFromResizeObserverEntry.getSizeFromResizeObserverEntryFactory;
|
|
49
|
+
exports.shouldCancelStart = shouldCancelStart.shouldCancelStart;
|
|
50
|
+
exports.stateDataAttributes = stateDataAttributes.stateDataAttributes;
|
|
51
|
+
exports.svgSizeProps = svgSizeProps.svgSizeProps;
|
|
52
|
+
exports.omit = omit.omit;
|
|
53
|
+
exports.pick = pick.pick;
|
|
54
|
+
exports.range = range.range;
|
|
55
|
+
exports.toKebabCase = kebabCase.toKebabCase;
|
|
56
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/production/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AssertionError } from "./assert-types/AssertionError.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isNonNegativeNumber } from "./assert-types/Predicates.js";
|
|
3
3
|
import { assert } from "./assert-types/assert.js";
|
|
4
4
|
import { assertNever } from "./assert-types/assertNever.js";
|
|
5
5
|
import { colorSchemeClassName, isColorSchemeClassName } from "./class-name/colorSchemeClassName.js";
|
|
@@ -8,87 +8,49 @@ import { deduplicateClassName } from "./class-name/deduplicateClassName.js";
|
|
|
8
8
|
import { filterThemedClassName } from "./class-name/filterThemedClassName.js";
|
|
9
9
|
import { flatClassNameList } from "./class-name/flatClassNameList.js";
|
|
10
10
|
import { listClassName } from "./class-name/listClassName.js";
|
|
11
|
-
import { stateClassName } from "./class-name/stateClassName.js";
|
|
12
11
|
import { contentThemeClassName, controlsThemeClassName, themeClassName } from "./class-name/themeClassName.js";
|
|
13
12
|
import { px } from "./css-utilities/px.js";
|
|
13
|
+
import { dateToStringWithoutTimezone } from "./data-utilities/dateToStringWithoutTimezone.js";
|
|
14
14
|
import { deprecate } from "./deprecate/deprecate.js";
|
|
15
|
-
import { fallback } from "./deprecate/fallback.js";
|
|
16
15
|
import { dataAttribute } from "./dom/dataAttribute.js";
|
|
17
16
|
import { getElementDimensions, getElementDimensionsCallback } from "./dom/getElementDimensions.js";
|
|
18
|
-
import { getMatchingParentElement } from "./dom/getMatchingParentElement.js";
|
|
19
17
|
import { getSizeFromResizeObserverEntryFactory } from "./dom/getSizeFromResizeObserverEntry.js";
|
|
20
|
-
import {
|
|
21
|
-
import { parseTransformMatrix } from "./dom/parseTransformMatrix.js";
|
|
18
|
+
import { shouldCancelStart } from "./dom/shouldCancelStart.js";
|
|
22
19
|
import { stateDataAttributes } from "./dom/stateDataAttributes.js";
|
|
23
20
|
import { svgSizeProps } from "./dom/svgSizeProps.js";
|
|
24
|
-
import { extend } from "./functional/extend.js";
|
|
25
21
|
import { omit } from "./functional/omit.js";
|
|
26
22
|
import { pick } from "./functional/pick.js";
|
|
27
23
|
import { range } from "./functional/range.js";
|
|
28
|
-
import { setHasOneOf } from "./functional/setHasOneOf.js";
|
|
29
|
-
import { capitalize } from "./string-utilities/capitalize.js";
|
|
30
24
|
import { toKebabCase } from "./string-utilities/kebabCase.js";
|
|
31
|
-
import { trimString } from "./string-utilities/trimString.js";
|
|
32
25
|
export {
|
|
33
26
|
AssertionError,
|
|
34
27
|
COLOR_SCHEME_CLASS_NAME_REG_EXP,
|
|
35
28
|
THEME_CLASS_NAME_REG_EXP,
|
|
36
29
|
assert,
|
|
37
30
|
assertNever,
|
|
38
|
-
capitalize,
|
|
39
31
|
colorSchemeClassName,
|
|
40
32
|
contentThemeClassName,
|
|
41
33
|
controlsThemeClassName,
|
|
42
34
|
dataAttribute,
|
|
35
|
+
dateToStringWithoutTimezone,
|
|
43
36
|
deduplicateClassName,
|
|
44
37
|
deprecate,
|
|
45
|
-
extend,
|
|
46
|
-
fallback,
|
|
47
38
|
filterThemedClassName,
|
|
48
39
|
flatClassNameList,
|
|
49
40
|
getElementDimensions,
|
|
50
41
|
getElementDimensionsCallback,
|
|
51
|
-
getMatchingParentElement,
|
|
52
42
|
getSizeFromResizeObserverEntryFactory,
|
|
53
|
-
isArrayOfMembersSatisfyingFactory,
|
|
54
|
-
isBoolean,
|
|
55
43
|
isColorSchemeClassName,
|
|
56
|
-
isDefined,
|
|
57
|
-
isFalse,
|
|
58
|
-
isHTMLElement,
|
|
59
|
-
isNonEmptyArray,
|
|
60
|
-
isNonEmptyString,
|
|
61
|
-
isNonEmptyTrimmedEndString,
|
|
62
|
-
isNonEmptyTrimmedStartString,
|
|
63
|
-
isNonEmptyTrimmedString,
|
|
64
44
|
isNonNegativeNumber,
|
|
65
|
-
isNotNull,
|
|
66
|
-
isNotNullish,
|
|
67
|
-
isNull,
|
|
68
|
-
isNumber,
|
|
69
|
-
isNumericString,
|
|
70
|
-
isObject,
|
|
71
|
-
isOneOfFactory,
|
|
72
|
-
isPlainObject,
|
|
73
|
-
isScrollable,
|
|
74
|
-
isSingleWordString,
|
|
75
|
-
isSlugString,
|
|
76
|
-
isString,
|
|
77
|
-
isTrue,
|
|
78
|
-
isUndefined,
|
|
79
45
|
listClassName,
|
|
80
46
|
omit,
|
|
81
|
-
parseTransformMatrix,
|
|
82
47
|
pick,
|
|
83
48
|
px,
|
|
84
49
|
range,
|
|
85
|
-
|
|
86
|
-
setHasOneOf,
|
|
87
|
-
stateClassName,
|
|
50
|
+
shouldCancelStart,
|
|
88
51
|
stateDataAttributes,
|
|
89
52
|
svgSizeProps,
|
|
90
53
|
themeClassName,
|
|
91
|
-
toKebabCase
|
|
92
|
-
trimString
|
|
54
|
+
toKebabCase
|
|
93
55
|
};
|
|
94
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const UPPER_CASE_REG_EXP = /([A-Z])/g;
|
|
4
|
+
function toKebabCase(value) {
|
|
5
|
+
return value.replace(UPPER_CASE_REG_EXP, "-$1").toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
exports.toKebabCase = toKebabCase;
|
|
8
|
+
//# sourceMappingURL=kebabCase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebabCase.cjs","sources":["../../../src/string-utilities/kebabCase.ts"],"sourcesContent":["const UPPER_CASE_REG_EXP = /([A-Z])/g\n\nexport function toKebabCase(value: string) {\n\treturn value.replace(UPPER_CASE_REG_EXP, '-$1').toLowerCase()\n}\n"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB;AAEpB,SAAS,YAAY,OAAe;AAC1C,SAAO,MAAM,QAAQ,oBAAoB,KAAK,EAAE,YAAY;AAC7D;;"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import { Predicate, SlugString, UnionOfPredicateTypes } from './types';
|
|
2
|
-
export declare function isNull(value: unknown): value is null;
|
|
3
|
-
export declare function isNotNull<T>(value: unknown): value is T;
|
|
4
|
-
export declare function isUndefined(value: unknown): value is undefined;
|
|
5
|
-
export declare function isDefined<T>(value: unknown): value is Exclude<T, undefined>;
|
|
6
|
-
export declare function isNotNullish<T>(value: T): value is Exclude<T, null | undefined>;
|
|
7
|
-
export declare function isBoolean(value: unknown): value is boolean;
|
|
8
|
-
export declare function isTrue(value: unknown): value is true;
|
|
9
|
-
export declare function isFalse(value: unknown): value is false;
|
|
10
|
-
export declare function isString(value: unknown): value is string;
|
|
11
|
-
export declare function isSlugString(value: unknown): value is SlugString;
|
|
12
|
-
export declare function isSingleWordString(value: unknown): value is string;
|
|
13
|
-
export declare function isNonEmptyString(value: unknown): value is string;
|
|
14
|
-
export declare const isNonEmptyTrimmedString: (value: unknown) => value is string;
|
|
15
|
-
export declare const isNonEmptyTrimmedStartString: (value: unknown) => value is string;
|
|
16
|
-
export declare const isNonEmptyTrimmedEndString: (value: unknown) => value is string;
|
|
17
|
-
export declare function isNumber(value: unknown): value is number;
|
|
18
1
|
export declare function isNonNegativeNumber(value: unknown): value is number;
|
|
19
|
-
export declare function isNumericString(value: string): value is string;
|
|
20
|
-
export declare function isOneOfFactory<U, T = any>(members: T extends Array<U> | ReadonlyArray<U> ? T : never): (value: unknown) => value is U;
|
|
21
|
-
export declare function satisfiesOneOfFactory<T extends Array<Predicate<any, any>>>(...predicates: T): Predicate<unknown, UnionOfPredicateTypes<T>>;
|
|
22
|
-
export declare function isArrayOfMembersSatisfyingFactory<T>(predicate: (value: unknown) => value is T): (value: unknown) => value is Array<T>;
|
|
23
|
-
export declare function isNonEmptyArray<T>(value: unknown): value is [T, ...T[]];
|
|
24
|
-
export declare function isHTMLElement(value: unknown): value is HTMLElement;
|
|
25
|
-
export declare function isObject(value: unknown): value is Object;
|
|
26
|
-
export declare function isPlainObject<T extends Record<string, unknown>>(value: unknown): value is T;
|
|
27
2
|
//# sourceMappingURL=Predicates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Predicates.d.ts","sourceRoot":"","sources":["../../../src/assert-types/Predicates.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Predicates.d.ts","sourceRoot":"","sources":["../../../src/assert-types/Predicates.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEnE"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { Opaque } from 'type-fest';
|
|
2
1
|
export type Predicate<T, U extends T> = (value: T) => value is U;
|
|
3
|
-
export type UnionOfPredicateTypes<T> = T extends Array<(value: any) => value is infer U> ? U : never;
|
|
4
|
-
export type SlugString = Opaque<string, 'SlugString'>;
|
|
5
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/assert-types/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/assert-types/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { KebabCase } from 'type-fest';
|
|
2
|
-
import { ColorSchemeClassName } from './types';
|
|
3
1
|
/**
|
|
4
2
|
* Returns a string with a color scheme class name, prefixed with `scheme-`
|
|
5
3
|
*
|
|
@@ -22,14 +20,13 @@ import { ColorSchemeClassName } from './types';
|
|
|
22
20
|
* // </div>
|
|
23
21
|
* ```
|
|
24
22
|
*/
|
|
25
|
-
export declare function colorSchemeClassName
|
|
26
|
-
export declare function colorSchemeClassName
|
|
27
|
-
export declare function colorSchemeClassName<S extends KebabCase<string> = KebabCase<string>>(scheme: S | null | undefined): ColorSchemeClassName<S> | undefined;
|
|
23
|
+
export declare function colorSchemeClassName(scheme: string): string;
|
|
24
|
+
export declare function colorSchemeClassName(scheme: string | null | undefined): string | undefined;
|
|
28
25
|
/**
|
|
29
26
|
* Tests if a string is a color scheme CSS class
|
|
30
27
|
* @param value - String to test
|
|
31
28
|
* @returns `true` if the string is a color scheme CSS class
|
|
32
29
|
* @internal
|
|
33
30
|
*/
|
|
34
|
-
export declare function isColorSchemeClassName
|
|
31
|
+
export declare function isColorSchemeClassName(value: string): boolean;
|
|
35
32
|
//# sourceMappingURL=colorSchemeClassName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorSchemeClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/colorSchemeClassName.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colorSchemeClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/colorSchemeClassName.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;AAC5D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;AAK3F;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,WAEnD"}
|
|
@@ -6,32 +6,14 @@
|
|
|
6
6
|
* If theme is `default` then it will match:
|
|
7
7
|
*
|
|
8
8
|
* - theme-default
|
|
9
|
-
* - theme-default:hover
|
|
10
|
-
* - theme-default:active
|
|
11
|
-
* - theme-default:focus
|
|
12
9
|
* - theme-default-content
|
|
13
|
-
* - theme-default-content:hover
|
|
14
|
-
* - theme-default-content:active
|
|
15
|
-
* - theme-default-content:focus
|
|
16
10
|
* - theme-default-controls
|
|
17
|
-
* - theme-default-controls:hover
|
|
18
|
-
* - theme-default-controls:active
|
|
19
|
-
* - theme-default-controls:focus
|
|
20
11
|
*
|
|
21
12
|
* If theme is `brand-color` then it will match:
|
|
22
13
|
*
|
|
23
14
|
* - theme-brand-color
|
|
24
|
-
* - theme-brand-color:hover
|
|
25
|
-
* - theme-brand-color:active
|
|
26
|
-
* - theme-brand-color:focus
|
|
27
15
|
* - theme-brand-color-content
|
|
28
|
-
* - theme-brand-color-content:hover
|
|
29
|
-
* - theme-brand-color-content:active
|
|
30
|
-
* - theme-brand-color-content:focus
|
|
31
16
|
* - theme-brand-color-controls
|
|
32
|
-
* - theme-brand-color-controls:hover
|
|
33
|
-
* - theme-brand-color-controls:active
|
|
34
|
-
* - theme-brand-color-controls:focus
|
|
35
17
|
*/
|
|
36
18
|
export declare const THEME_CLASS_NAME_REG_EXP: RegExp;
|
|
37
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/class-name/constants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/class-name/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,wBAAwB,QAA6D,CAAA;AAElG;;;GAGG;AACH,eAAO,MAAM,+BAA+B,QAA4D,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NestedClassName } from './types';
|
|
2
2
|
export type ThemeConfig = {
|
|
3
3
|
content: string | undefined;
|
|
4
4
|
controls: string | undefined;
|
|
5
5
|
};
|
|
6
|
-
export declare function filterThemedClassName(nestedClassName: NestedClassName, defaultColorSchemeContext:
|
|
6
|
+
export declare function filterThemedClassName(nestedClassName: NestedClassName, defaultColorSchemeContext: string): string[];
|
|
7
7
|
//# sourceMappingURL=filterThemedClassName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterThemedClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/filterThemedClassName.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filterThemedClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/filterThemedClassName.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAEvF,wBAAgB,qBAAqB,CACpC,eAAe,EAAE,eAAe,EAChC,yBAAyB,EAAE,MAAM,YAgDjC"}
|
|
@@ -4,7 +4,6 @@ export * from './deduplicateClassName';
|
|
|
4
4
|
export * from './filterThemedClassName';
|
|
5
5
|
export * from './flatClassNameList';
|
|
6
6
|
export * from './listClassName';
|
|
7
|
-
export * from './stateClassName';
|
|
8
7
|
export * from './themeClassName';
|
|
9
8
|
export * from './types';
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/class-name/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/class-name/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { KebabCase } from 'type-fest';
|
|
2
|
-
import { ThemeContentClassName, ThemeControlsClassName } from './types';
|
|
3
1
|
/**
|
|
4
2
|
* Returns a string with a content theme class name, prefixed with `theme-` and suffixed with `-content`
|
|
5
3
|
*
|
|
6
4
|
* IMPORTANT: Make sure to use color scheme class in combination with theme class names.
|
|
7
5
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param state - State of the theme starting with a ":", e.g. `":hover"`, `":focus"`, `":active"`, `":focus-visible"`
|
|
6
|
+
* @param theme - Theme name basis for content
|
|
10
7
|
* @returns A content theme class name
|
|
11
8
|
*
|
|
12
9
|
* @see {@link controlsThemeClassName}
|
|
@@ -17,9 +14,7 @@ import { ThemeContentClassName, ThemeControlsClassName } from './types';
|
|
|
17
14
|
* const colorScheme = colorSchemeClassName('system')
|
|
18
15
|
* // ^ 'scheme-system'
|
|
19
16
|
* const contentThemeClassName = contentThemeClassName('default')
|
|
20
|
-
* // ^ 'theme-default-content
|
|
21
|
-
* const dangerOnMouseOverTheme = controlsThemeClassName('danger', ':hover')
|
|
22
|
-
* // ^ 'theme-danger-controls:hover'
|
|
17
|
+
* // ^ 'theme-default-content'
|
|
23
18
|
*
|
|
24
19
|
* return (
|
|
25
20
|
* <div className={`${colorScheme} ${contentThemeClassName}`}>
|
|
@@ -28,14 +23,13 @@ import { ThemeContentClassName, ThemeControlsClassName } from './types';
|
|
|
28
23
|
* )
|
|
29
24
|
* ```
|
|
30
25
|
*/
|
|
31
|
-
export declare function contentThemeClassName
|
|
26
|
+
export declare function contentThemeClassName(theme: string | null | undefined): string | undefined;
|
|
32
27
|
/**
|
|
33
28
|
* Returns a string with a controls theme class name, prefixed with `theme-` and suffixed with `-controls`
|
|
34
29
|
*
|
|
35
30
|
* IMPORTANT: Make sure to use color scheme class in combination with theme class names.
|
|
36
31
|
*
|
|
37
32
|
* @param theme - Theme name basis for controls
|
|
38
|
-
* @param state - State of the theme starting with a ":", e.g. `":hover"`, `":focus"`, `":active"`, `":focus-visible"`
|
|
39
33
|
* @returns A controls theme class name
|
|
40
34
|
*
|
|
41
35
|
* @see {@link contentThemeClassName}
|
|
@@ -46,9 +40,7 @@ export declare function contentThemeClassName<ContentTheme extends KebabCase<str
|
|
|
46
40
|
* const colorScheme = colorSchemeClassName('system')
|
|
47
41
|
* // ^ 'scheme-system'
|
|
48
42
|
* const contentThemeClassName = contentThemeClassName('default')
|
|
49
|
-
* // ^ 'theme-default-content
|
|
50
|
-
* const dangerOnMouseOverTheme = controlsThemeClassName('danger', ':hover')
|
|
51
|
-
* // ^ 'theme-danger-controls:hover'
|
|
43
|
+
* // ^ 'theme-default-content'
|
|
52
44
|
*
|
|
53
45
|
* return (
|
|
54
46
|
* <div className={`${colorScheme} ${contentThemeClassName}`}>
|
|
@@ -57,14 +49,13 @@ export declare function contentThemeClassName<ContentTheme extends KebabCase<str
|
|
|
57
49
|
* )
|
|
58
50
|
* ```
|
|
59
51
|
*/
|
|
60
|
-
export declare function controlsThemeClassName
|
|
52
|
+
export declare function controlsThemeClassName(theme: string | null | undefined): string | undefined;
|
|
61
53
|
/**
|
|
62
54
|
* Returns a tuple with a content theme class name and a controls theme class name, prefixed with `theme-` and suffixed with `-content` and `-controls` respectively
|
|
63
55
|
*
|
|
64
56
|
* IMPORTANT: Make sure to use color scheme class in combination with theme class names.
|
|
65
57
|
*
|
|
66
58
|
* @param theme - Theme name basis for content and controls
|
|
67
|
-
* @param state - State of the theme starting with a ":", e.g. `":hover"`, `":focus"`, `":active"`, `":focus-visible"`
|
|
68
59
|
* @returns A tuple with a content theme class name and a controls theme class name
|
|
69
60
|
*
|
|
70
61
|
* @see {@link contentThemeClassName}
|
|
@@ -83,5 +74,5 @@ export declare function controlsThemeClassName<ControlsTheme extends KebabCase<s
|
|
|
83
74
|
* )
|
|
84
75
|
* ```
|
|
85
76
|
*/
|
|
86
|
-
export declare function themeClassName
|
|
77
|
+
export declare function themeClassName(theme: string | null | undefined): readonly [string | undefined, string | undefined];
|
|
87
78
|
//# sourceMappingURL=themeClassName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/themeClassName.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"themeClassName.d.ts","sourceRoot":"","sources":["../../../src/class-name/themeClassName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1F;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE3F;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,qDAMhC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { KebabCase } from 'type-fest';
|
|
2
1
|
export type NestedClassName = string | false | null | undefined | (string | false | null | undefined)[] | NestedClassName[];
|
|
3
2
|
export type ClassNameStateMap = {
|
|
4
3
|
[key: string]: string | number | boolean | null | undefined;
|
|
@@ -7,7 +6,4 @@ export interface ComponentClassNameProps {
|
|
|
7
6
|
className?: NestedClassName;
|
|
8
7
|
componentClassName?: string | string[];
|
|
9
8
|
}
|
|
10
|
-
export type ColorSchemeClassName<T extends KebabCase<string> = KebabCase<string>> = `scheme-${T}`;
|
|
11
|
-
export type ThemeContentClassName<T extends KebabCase<string> = KebabCase<string>, S extends `:${KebabCase<string>}` | null | undefined = undefined> = S extends string ? `theme-${T}-content${S}` : `theme-${T}-content`;
|
|
12
|
-
export type ThemeControlsClassName<T extends KebabCase<string> = KebabCase<string>, S extends `:${KebabCase<string>}` | null | undefined = undefined> = S extends string ? `theme-${T}-controls${S}` : `theme-${T}-controls`;
|
|
13
9
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/class-name/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/class-name/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,eAAe,EAAE,CAAA;AAC3H,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,CAAA;AAE/F,MAAM,WAAW,uBAAuB;IACvC,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACvC"}
|