Theming API: Refactor on dt helper

pull/5806/head
Mert Sincan 2024-05-24 18:23:29 +01:00
parent 4677385e6d
commit 7ab480303d
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ export const dt = (...args) => {
export const dtwt = (theme = {}, tokenPath, fallback, type = 'variable') => { export const dtwt = (theme = {}, tokenPath, fallback, type = 'variable') => {
if (tokenPath) { if (tokenPath) {
const VARIABLE = Theme.defaults.variable; const { variable: VARIABLE, options: OPTIONS } = Theme.defaults || {};
const { prefix, transform } = theme?.options || {}; const { prefix, transform } = theme?.options || OPTIONS || {};
const regex = /{([^}]*)}/g; const regex = /{([^}]*)}/g;
const token = SharedUtils.object.test(regex, tokenPath) ? tokenPath : `{${tokenPath}}`; const token = SharedUtils.object.test(regex, tokenPath) ? tokenPath : `{${tokenPath}}`;
const isStrictTransform = type === 'value' || transform === 'strict'; // @todo - TRANSFORM: strict | lenient(default) const isStrictTransform = type === 'value' || transform === 'strict'; // @todo - TRANSFORM: strict | lenient(default)