From 7ab480303dabfc6d4baa271076be002fbfc36d4a Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Fri, 24 May 2024 18:23:29 +0100 Subject: [PATCH] Theming API: Refactor on dt helper --- components/lib/themes/helpers/dt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/themes/helpers/dt.js b/components/lib/themes/helpers/dt.js index 1e5d1eebc..22cecb955 100644 --- a/components/lib/themes/helpers/dt.js +++ b/components/lib/themes/helpers/dt.js @@ -20,8 +20,8 @@ export const dt = (...args) => { export const dtwt = (theme = {}, tokenPath, fallback, type = 'variable') => { if (tokenPath) { - const VARIABLE = Theme.defaults.variable; - const { prefix, transform } = theme?.options || {}; + const { variable: VARIABLE, options: OPTIONS } = Theme.defaults || {}; + const { prefix, transform } = theme?.options || OPTIONS || {}; const regex = /{([^}]*)}/g; const token = SharedUtils.object.test(regex, tokenPath) ? tokenPath : `{${tokenPath}}`; const isStrictTransform = type === 'value' || transform === 'strict'; // @todo - TRANSFORM: strict | lenient(default)