@udixio/theme 1.0.0-beta.17 → 1.0.0-beta.19
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/index.d.ts +1 -0
- package/dist/plugins/font/index.d.ts +1 -0
- package/dist/plugins/tailwind/tailwind.plugin.d.ts +2 -2
- package/dist/theme.cjs.development.js +107 -101
- package/dist/theme.cjs.development.js.map +1 -1
- package/dist/theme.cjs.production.min.js +1 -1
- package/dist/theme.cjs.production.min.js.map +1 -1
- package/dist/theme.esm.js +90 -85
- package/dist/theme.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/plugins/font/index.ts +1 -0
- package/src/plugins/tailwind/tailwind.plugin.ts +8 -4
package/dist/theme.esm.js
CHANGED
|
@@ -1646,90 +1646,6 @@ function bootstrapFromConfig(path) {
|
|
|
1646
1646
|
var PluginAbstract = function PluginAbstract() {};
|
|
1647
1647
|
PluginAbstract.dependencies = [];
|
|
1648
1648
|
|
|
1649
|
-
var state = function state(colorkeys) {
|
|
1650
|
-
return plugin(function (pluginArgs) {
|
|
1651
|
-
addAllNewComponents(pluginArgs, {
|
|
1652
|
-
statePrefix: 'state',
|
|
1653
|
-
disabledStyles: {
|
|
1654
|
-
textOpacity: 0.38,
|
|
1655
|
-
backgroundOpacity: 0.12
|
|
1656
|
-
},
|
|
1657
|
-
transition: {
|
|
1658
|
-
duration: 150
|
|
1659
|
-
}
|
|
1660
|
-
}, colorkeys);
|
|
1661
|
-
}, {});
|
|
1662
|
-
};
|
|
1663
|
-
var addAllNewComponents = function addAllNewComponents(_ref, _ref2, colorKeys) {
|
|
1664
|
-
var addComponents = _ref.addComponents;
|
|
1665
|
-
var statePrefix = _ref2.statePrefix,
|
|
1666
|
-
disabledStyles = _ref2.disabledStyles,
|
|
1667
|
-
transition = _ref2.transition;
|
|
1668
|
-
var newComponents = {};
|
|
1669
|
-
for (var _i = 0, _arr = [false, true]; _i < _arr.length; _i++) {
|
|
1670
|
-
var isGroup = _arr[_i];
|
|
1671
|
-
var group = isGroup ? 'group-' : '';
|
|
1672
|
-
for (var _iterator = _createForOfIteratorHelperLoose(colorKeys), _step; !(_step = _iterator()).done;) {
|
|
1673
|
-
var _newComponents$classN;
|
|
1674
|
-
var colorName = _step.value;
|
|
1675
|
-
var className = "." + group + statePrefix + "-" + colorName;
|
|
1676
|
-
newComponents[className] = (_newComponents$classN = {}, _newComponents$classN["@apply " + group + "hover:bg-" + colorName + "/[0.08]"] = {}, _newComponents$classN["@apply " + group + "active:bg-" + colorName + "/[0.12]"] = {}, _newComponents$classN["@apply " + group + "focus-visible:bg-" + colorName + "/[0.12]"] = {}, _newComponents$classN);
|
|
1677
|
-
if (transition) {
|
|
1678
|
-
newComponents[className]["@apply transition-colors"] = {};
|
|
1679
|
-
newComponents[className]["@apply duration-" + transition.duration] = {};
|
|
1680
|
-
}
|
|
1681
|
-
if (disabledStyles) {
|
|
1682
|
-
newComponents[className]["@apply " + group + "disabled:text-on-surface/[" + disabledStyles.textOpacity + "]"] = {};
|
|
1683
|
-
newComponents[className]["@apply " + group + "disabled:bg-on-surface/[" + disabledStyles.backgroundOpacity + "]"] = {};
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
for (var _iterator2 = _createForOfIteratorHelperLoose(colorKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
1688
|
-
var _colorName = _step2.value;
|
|
1689
|
-
for (var _i2 = 0, _arr2 = ['hover', 'active', 'focus', 'disabled']; _i2 < _arr2.length; _i2++) {
|
|
1690
|
-
var stateName = _arr2[_i2];
|
|
1691
|
-
var _className = "." + stateName + "-" + statePrefix + "-" + _colorName;
|
|
1692
|
-
if (stateName === 'active' || stateName === 'focus') {
|
|
1693
|
-
var _newComponents$_class;
|
|
1694
|
-
newComponents[_className] = (_newComponents$_class = {}, _newComponents$_class["@apply bg-" + _colorName + "/[0.12]"] = {}, _newComponents$_class);
|
|
1695
|
-
} else if (stateName === 'hover') {
|
|
1696
|
-
var _newComponents$_class2;
|
|
1697
|
-
newComponents[_className] = (_newComponents$_class2 = {}, _newComponents$_class2["@apply bg-" + _colorName + "/[0.08]"] = {}, _newComponents$_class2);
|
|
1698
|
-
} else if (stateName === 'disabled') {
|
|
1699
|
-
var _newComponents$_class3, _newComponents$_class4;
|
|
1700
|
-
newComponents[_className] = (_newComponents$_class3 = {}, _newComponents$_class3["@apply text-on-surface/[" + disabledStyles.textOpacity + "]"] = {}, _newComponents$_class3);
|
|
1701
|
-
newComponents[_className] = (_newComponents$_class4 = {}, _newComponents$_class4["@apply bg-on-surface/[" + disabledStyles.backgroundOpacity + "]"] = {}, _newComponents$_class4);
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
addComponents(newComponents);
|
|
1706
|
-
};
|
|
1707
|
-
|
|
1708
|
-
var themer = function themer(colors, darkMode) {
|
|
1709
|
-
var options = {
|
|
1710
|
-
defaultTheme: {
|
|
1711
|
-
extend: {
|
|
1712
|
-
colors: {}
|
|
1713
|
-
}
|
|
1714
|
-
},
|
|
1715
|
-
themes: [{
|
|
1716
|
-
name: 'darkTheme',
|
|
1717
|
-
extend: {
|
|
1718
|
-
colors: {}
|
|
1719
|
-
}
|
|
1720
|
-
}]
|
|
1721
|
-
};
|
|
1722
|
-
Object.entries(colors).forEach(function (_ref) {
|
|
1723
|
-
var key = _ref[0],
|
|
1724
|
-
value = _ref[1];
|
|
1725
|
-
options.defaultTheme.extend.colors[key] = value.light;
|
|
1726
|
-
options.themes[0].extend.colors[key] = value.dark;
|
|
1727
|
-
});
|
|
1728
|
-
options.themes[0].selectors = darkMode === 'class' ? ['.dark-mode', '[data-theme="dark"]'] : undefined;
|
|
1729
|
-
options.themes[0].mediaQuery = darkMode === 'media' ? '@media (prefers-color-scheme: dark)' : undefined;
|
|
1730
|
-
return require('tailwindcss-themer')(options);
|
|
1731
|
-
};
|
|
1732
|
-
|
|
1733
1649
|
var FontFamily;
|
|
1734
1650
|
(function (FontFamily) {
|
|
1735
1651
|
FontFamily["Expressive"] = "expressive";
|
|
@@ -1890,6 +1806,90 @@ var FontPlugin = /*#__PURE__*/function (_PluginAbstract) {
|
|
|
1890
1806
|
return FontPlugin;
|
|
1891
1807
|
}(PluginAbstract);
|
|
1892
1808
|
|
|
1809
|
+
var state = function state(colorkeys) {
|
|
1810
|
+
return plugin(function (pluginArgs) {
|
|
1811
|
+
addAllNewComponents(pluginArgs, {
|
|
1812
|
+
statePrefix: 'state',
|
|
1813
|
+
disabledStyles: {
|
|
1814
|
+
textOpacity: 0.38,
|
|
1815
|
+
backgroundOpacity: 0.12
|
|
1816
|
+
},
|
|
1817
|
+
transition: {
|
|
1818
|
+
duration: 150
|
|
1819
|
+
}
|
|
1820
|
+
}, colorkeys);
|
|
1821
|
+
}, {});
|
|
1822
|
+
};
|
|
1823
|
+
var addAllNewComponents = function addAllNewComponents(_ref, _ref2, colorKeys) {
|
|
1824
|
+
var addComponents = _ref.addComponents;
|
|
1825
|
+
var statePrefix = _ref2.statePrefix,
|
|
1826
|
+
disabledStyles = _ref2.disabledStyles,
|
|
1827
|
+
transition = _ref2.transition;
|
|
1828
|
+
var newComponents = {};
|
|
1829
|
+
for (var _i = 0, _arr = [false, true]; _i < _arr.length; _i++) {
|
|
1830
|
+
var isGroup = _arr[_i];
|
|
1831
|
+
var group = isGroup ? 'group-' : '';
|
|
1832
|
+
for (var _iterator = _createForOfIteratorHelperLoose(colorKeys), _step; !(_step = _iterator()).done;) {
|
|
1833
|
+
var _newComponents$classN;
|
|
1834
|
+
var colorName = _step.value;
|
|
1835
|
+
var className = "." + group + statePrefix + "-" + colorName;
|
|
1836
|
+
newComponents[className] = (_newComponents$classN = {}, _newComponents$classN["@apply " + group + "hover:bg-" + colorName + "/[0.08]"] = {}, _newComponents$classN["@apply " + group + "active:bg-" + colorName + "/[0.12]"] = {}, _newComponents$classN["@apply " + group + "focus-visible:bg-" + colorName + "/[0.12]"] = {}, _newComponents$classN);
|
|
1837
|
+
if (transition) {
|
|
1838
|
+
newComponents[className]["@apply transition-colors"] = {};
|
|
1839
|
+
newComponents[className]["@apply duration-" + transition.duration] = {};
|
|
1840
|
+
}
|
|
1841
|
+
if (disabledStyles) {
|
|
1842
|
+
newComponents[className]["@apply " + group + "disabled:text-on-surface/[" + disabledStyles.textOpacity + "]"] = {};
|
|
1843
|
+
newComponents[className]["@apply " + group + "disabled:bg-on-surface/[" + disabledStyles.backgroundOpacity + "]"] = {};
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(colorKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
1848
|
+
var _colorName = _step2.value;
|
|
1849
|
+
for (var _i2 = 0, _arr2 = ['hover', 'active', 'focus', 'disabled']; _i2 < _arr2.length; _i2++) {
|
|
1850
|
+
var stateName = _arr2[_i2];
|
|
1851
|
+
var _className = "." + stateName + "-" + statePrefix + "-" + _colorName;
|
|
1852
|
+
if (stateName === 'active' || stateName === 'focus') {
|
|
1853
|
+
var _newComponents$_class;
|
|
1854
|
+
newComponents[_className] = (_newComponents$_class = {}, _newComponents$_class["@apply bg-" + _colorName + "/[0.12]"] = {}, _newComponents$_class);
|
|
1855
|
+
} else if (stateName === 'hover') {
|
|
1856
|
+
var _newComponents$_class2;
|
|
1857
|
+
newComponents[_className] = (_newComponents$_class2 = {}, _newComponents$_class2["@apply bg-" + _colorName + "/[0.08]"] = {}, _newComponents$_class2);
|
|
1858
|
+
} else if (stateName === 'disabled') {
|
|
1859
|
+
var _newComponents$_class3, _newComponents$_class4;
|
|
1860
|
+
newComponents[_className] = (_newComponents$_class3 = {}, _newComponents$_class3["@apply text-on-surface/[" + disabledStyles.textOpacity + "]"] = {}, _newComponents$_class3);
|
|
1861
|
+
newComponents[_className] = (_newComponents$_class4 = {}, _newComponents$_class4["@apply bg-on-surface/[" + disabledStyles.backgroundOpacity + "]"] = {}, _newComponents$_class4);
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
addComponents(newComponents);
|
|
1866
|
+
};
|
|
1867
|
+
|
|
1868
|
+
var themer = function themer(colors, darkMode) {
|
|
1869
|
+
var options = {
|
|
1870
|
+
defaultTheme: {
|
|
1871
|
+
extend: {
|
|
1872
|
+
colors: {}
|
|
1873
|
+
}
|
|
1874
|
+
},
|
|
1875
|
+
themes: [{
|
|
1876
|
+
name: 'darkTheme',
|
|
1877
|
+
extend: {
|
|
1878
|
+
colors: {}
|
|
1879
|
+
}
|
|
1880
|
+
}]
|
|
1881
|
+
};
|
|
1882
|
+
Object.entries(colors).forEach(function (_ref) {
|
|
1883
|
+
var key = _ref[0],
|
|
1884
|
+
value = _ref[1];
|
|
1885
|
+
options.defaultTheme.extend.colors[key] = value.light;
|
|
1886
|
+
options.themes[0].extend.colors[key] = value.dark;
|
|
1887
|
+
});
|
|
1888
|
+
options.themes[0].selectors = darkMode === 'class' ? ['.dark-mode', '[data-theme="dark"]'] : undefined;
|
|
1889
|
+
options.themes[0].mediaQuery = darkMode === 'media' ? '@media (prefers-color-scheme: dark)' : undefined;
|
|
1890
|
+
return require('tailwindcss-themer')(options);
|
|
1891
|
+
};
|
|
1892
|
+
|
|
1893
1893
|
var font = function font(fontStyles, responsiveBreakPoints) {
|
|
1894
1894
|
var createUtilities = function createUtilities(_ref) {
|
|
1895
1895
|
var theme = _ref.theme;
|
|
@@ -1944,7 +1944,12 @@ var font = function font(fontStyles, responsiveBreakPoints) {
|
|
|
1944
1944
|
|
|
1945
1945
|
var TailwindPlugin = /*#__PURE__*/function (_PluginAbstract) {
|
|
1946
1946
|
function TailwindPlugin(appService, options) {
|
|
1947
|
+
var _options$darkMode, _options$responsiveBr;
|
|
1947
1948
|
var _this;
|
|
1949
|
+
(_options$darkMode = options.darkMode) != null ? _options$darkMode : options.darkMode = 'class';
|
|
1950
|
+
(_options$responsiveBr = options.responsiveBreakPoints) != null ? _options$responsiveBr : options.responsiveBreakPoints = {
|
|
1951
|
+
lg: 1.125
|
|
1952
|
+
};
|
|
1948
1953
|
_this = _PluginAbstract.call(this) || this;
|
|
1949
1954
|
_this.appService = void 0;
|
|
1950
1955
|
_this.options = void 0;
|
|
@@ -1999,5 +2004,5 @@ var createTheme = function createTheme() {
|
|
|
1999
2004
|
return plugin.getTheme();
|
|
2000
2005
|
};
|
|
2001
2006
|
|
|
2002
|
-
export { AppContainer, AppModule, AppService, ColorEntity, ColorManagerService, ColorModule, ColorService, ConfigModule, ConfigService, ContrastCurve, DynamicColor, PluginAbstract, PluginModule, PluginService, SchemeEntity, SchemeService, TailwindPlugin, ThemeModule, ThemeService, ToneDeltaPair, VariantEntity, VariantModel, VariantService, bootstrap, bootstrapFromConfig, createTheme, defaultColors, defineConfig, getRotatedHue, highestSurface, importContainer, state, themer };
|
|
2007
|
+
export { AppContainer, AppModule, AppService, ColorEntity, ColorManagerService, ColorModule, ColorService, ConfigModule, ConfigService, ContrastCurve, DynamicColor, FontFamily, FontPlugin, PluginAbstract, PluginModule, PluginService, SchemeEntity, SchemeService, TailwindPlugin, ThemeModule, ThemeService, ToneDeltaPair, VariantEntity, VariantModel, VariantService, bootstrap, bootstrapFromConfig, createTheme, defaultColors, defineConfig, getRotatedHue, highestSurface, importContainer, state, themer };
|
|
2003
2008
|
//# sourceMappingURL=theme.esm.js.map
|