UNPKG

tailwindcss-signals

Version:
1 lines 4.06 kB
{"version":3,"file":"index.modern.js","sources":["../node_modules/tailwindcss/lib/util/createPlugin.js","../node_modules/tailwindcss/lib/public/create-plugin.js","../index.ts","../node_modules/tailwindcss/plugin.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","import plugin from 'tailwindcss/plugin.js';\n\nconst getStyleVarName = (modifier: string | null) => `--tw-signal${modifier ? `_${modifier}` : ''}`;\n// using empty values here so the compiler plays nice and generates the styles without values\nconst EMPTY_VALUES = { values: { DEFAULT: '' } };\n\nexport default plugin(({ matchUtilities, matchVariant }) => {\n matchUtilities(\n {\n signal: (_, { modifier }) => {\n return {\n [getStyleVarName(modifier)]: 'true',\n };\n },\n },\n {\n ...EMPTY_VALUES,\n modifiers: 'any',\n }\n );\n\n matchVariant(\n 'signal',\n (_, { modifier }) => {\n return `@container style(${getStyleVarName(modifier)}: true)`;\n },\n EMPTY_VALUES\n );\n});\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n"],"names":["createPlugin","plugin","config","handler","Object","defineProperty","exports","value","enumerable","get","_default","withOptions","pluginFunction","configFunction","optionsFunction","options","__options","__isOptionsFunction","__pluginFunction","__configFunction","_interop_require_default","obj","__esModule","default","require$$0","getStyleVarName","modifier","EMPTY_VALUES","values","DEFAULT","index","matchUtilities","matchVariant","signal","_","_extends","modifiers"],"mappings":"2TAUA,SAASA,EAAaC,EAAQC,GAC1B,MAAO,CACHC,QAASF,EACTC,SAER,CAdAE,OAAOC,eAAwBC,EAAA,aAAc,CACzCC,OAAO,IAEXH,OAAOC,eAAeC,EAAS,UAAW,CACtCE,YAAY,EACZC,IAAK,WACD,OAAOC,CACV,IAQLV,EAAaW,YAAc,SAASC,EAAgBC,EAAiB,MAAA,CAAO,KACxE,MAAMC,EAAkB,SAASC,GAC7B,MAAO,CACHC,UAAWD,EACXZ,QAASS,EAAeG,GACxBb,OAAQW,EAAeE,GAEnC,EAMI,OALAD,EAAgBG,qBAAsB,EAGtCH,EAAgBI,iBAAmBN,EACnCE,EAAgBK,iBAAmBN,EAC5BC,CACX,EACA,MAAMJ,EAAWV,sBCpBjB,SAASoB,EAAyBC,GAC9B,OAAOA,GAAOA,EAAIC,WAAaD,EAAM,CACjCE,QAASF,EAEjB,CAdAjB,OAAOC,eAAwBC,EAAA,aAAc,CACzCC,OAAO,IAEXH,OAAOC,eAAeC,EAAS,UAAW,CACtCE,YAAY,EACZC,IAAK,WACD,OAAOC,CACV,IAQL,MAAMA,eAN8BU,EAAyBI,GAM9BD,UCd/B,MAAME,EAAmBC,kBAA0CA,EAAW,IAAIA,IAAa,IAEzFC,EAAe,CAAEC,OAAQ,CAAEC,QAAS,KAE1C,IAAAC,GAAe7B,GCLGD,EAAasB,WAAatB,EAAe,CAAEuB,QAASvB,IAAgBuB,SDKhE,EAAGQ,iBAAgBC,mBACvCD,EACE,CACEE,OAAQA,CAACC,GAAKR,eACL,CACL,CAACD,EAAgBC,IAAY,UAGlCS,KAEIR,EAAY,CACfS,UAAW,SAIfJ,EACE,SACA,CAACE,GAAKR,kCACuBD,EAAgBC,YAE7CC,EAEJ"}