Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contember/react-utils

Package Overview
Dependencies
Maintainers
5
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/react-utils - npm Package Compare versions

Comparing version 1.2.0-rc.15 to 1.2.0-rc.16

6

dist/development/theming/useClassNameFactory.js
import { flatClassNameList, deduplicateClassName } from "@contember/utilities";
import { useContext } from "react";
import { GlobalClassNamePrefixContext } from "./GlobalClassNamePrefixContext.js";
import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
function useClassNameFactory(componentClassName, glue = "-", prefixOverride) {

@@ -10,3 +11,3 @@ const contextPrefix = useContext(GlobalClassNamePrefixContext);

);
return function componentClassNameFor(suffix = null, additionalClassName = null) {
function componentClassNameFor(suffix = null, additionalClassName = null) {
const classNameSuffix = suffix ?? "";

@@ -16,3 +17,4 @@ return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(

)).join(" ");
};
}
return useReferentiallyStableCallback(componentClassNameFor);
}

@@ -19,0 +21,0 @@ export {

@@ -5,2 +5,3 @@ import { flatClassNameList, colorSchemeClassName, deduplicateClassName, filterThemedClassName } from "@contember/utilities";

import { useColorScheme } from "./contexts.js";
import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
function useThemedClassNameFactory(componentClassName, glue = "-", prefixOverride) {

@@ -13,3 +14,3 @@ const contextPrefix = useContext(GlobalClassNamePrefixContext);

const colorScheme = colorSchemeClassName(useColorScheme());
return function componentClassNameFor(suffix = null, additionalClassName = null) {
function componentClassNameFor(suffix = null, additionalClassName = null) {
const classNameSuffix = suffix ?? "";

@@ -24,3 +25,4 @@ return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(

)).join(" ");
};
}
return useReferentiallyStableCallback(componentClassNameFor);
}

@@ -27,0 +29,0 @@ export {

import { flatClassNameList, deduplicateClassName } from "@contember/utilities";
import { useContext } from "react";
import { GlobalClassNamePrefixContext } from "./GlobalClassNamePrefixContext.js";
import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
function useClassNameFactory(componentClassName, glue = "-", prefixOverride) {

@@ -10,3 +11,3 @@ const contextPrefix = useContext(GlobalClassNamePrefixContext);

);
return function componentClassNameFor(suffix = null, additionalClassName = null) {
function componentClassNameFor(suffix = null, additionalClassName = null) {
const classNameSuffix = suffix ?? "";

@@ -16,3 +17,4 @@ return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(

)).join(" ");
};
}
return useReferentiallyStableCallback(componentClassNameFor);
}

@@ -19,0 +21,0 @@ export {

@@ -5,2 +5,3 @@ import { flatClassNameList, colorSchemeClassName, deduplicateClassName, filterThemedClassName } from "@contember/utilities";

import { useColorScheme } from "./contexts.js";
import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
function useThemedClassNameFactory(componentClassName, glue = "-", prefixOverride) {

@@ -13,3 +14,3 @@ const contextPrefix = useContext(GlobalClassNamePrefixContext);

const colorScheme = colorSchemeClassName(useColorScheme());
return function componentClassNameFor(suffix = null, additionalClassName = null) {
function componentClassNameFor(suffix = null, additionalClassName = null) {
const classNameSuffix = suffix ?? "";

@@ -24,3 +25,4 @@ return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(

)).join(" ");
};
}
return useReferentiallyStableCallback(componentClassNameFor);
}

@@ -27,0 +29,0 @@ export {

{
"name": "@contember/react-utils",
"license": "Apache-2.0",
"version": "1.2.0-rc.15",
"version": "1.2.0-rc.16",
"type": "module",

@@ -33,3 +33,3 @@ "sideEffects": false,

"dependencies": {
"@contember/utilities": "1.2.0-rc.15",
"@contember/utilities": "1.2.0-rc.16",
"deep-equal": "^2.2.0"

@@ -36,0 +36,0 @@ },

import { NestedClassName, deduplicateClassName, flatClassNameList } from '@contember/utilities'
import { useContext } from 'react'
import { useReferentiallyStableCallback } from '../referentiallyStable'
import { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'

@@ -31,3 +32,3 @@

return function componentClassNameFor(
function componentClassNameFor(
suffix: string | null | undefined = null,

@@ -48,2 +49,4 @@ additionalClassName: NestedClassName = null,

}
return useReferentiallyStableCallback(componentClassNameFor)
}
import { NestedClassName, colorSchemeClassName, deduplicateClassName, filterThemedClassName, flatClassNameList } from '@contember/utilities'
import { useContext } from 'react'
import { useReferentiallyStableCallback } from '../referentiallyStable'
import { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'

@@ -20,3 +21,3 @@ import { useColorScheme } from './contexts'

return function componentClassNameFor(
function componentClassNameFor(
suffix: string | null | undefined = null,

@@ -42,2 +43,4 @@ additionalClassName: NestedClassName = null,

}
return useReferentiallyStableCallback(componentClassNameFor)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc