@nkey-ui/theme
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -154,2 +154,16 @@ "use strict"; | ||
// src/variants/compoundVariants/colors.ts | ||
var colors = ["default", "primary", "secondary", "success", "warning", "danger", "info", "foreground"]; | ||
function generateColorCompoundVariants(variants = {}, type) { | ||
return colors.map((color) => ({ | ||
...variants, | ||
color, | ||
class: colorVariants[type][color] | ||
})); | ||
} | ||
var outlined = (variants = {}) => generateColorCompoundVariants(variants, "bordered"); | ||
var colorCompoundVariants = { | ||
outlined | ||
}; | ||
// src/components/button.ts | ||
@@ -181,43 +195,4 @@ var buttonBase = (0, import_tailwind_variants.tv)({ | ||
compoundVariants: [ | ||
...colorCompoundVariants.outlined({ variant: "outlined" }), | ||
{ | ||
variant: "outlined", | ||
color: "default", | ||
class: colorVariants.bordered.default | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "primary", | ||
class: colorVariants.bordered.primary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "secondary", | ||
class: colorVariants.bordered.secondary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "success", | ||
class: colorVariants.bordered.success | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "warning", | ||
class: colorVariants.bordered.warning | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "danger", | ||
class: colorVariants.bordered.danger | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "info", | ||
class: colorVariants.bordered.info | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "foreground", | ||
class: colorVariants.bordered.foreground | ||
}, | ||
{ | ||
readOnly: true, | ||
@@ -224,0 +199,0 @@ variant: ["outlined", "text"], |
@@ -175,2 +175,16 @@ "use strict"; | ||
// src/variants/compoundVariants/colors.ts | ||
var colors = ["default", "primary", "secondary", "success", "warning", "danger", "info", "foreground"]; | ||
function generateColorCompoundVariants(variants = {}, type) { | ||
return colors.map((color) => ({ | ||
...variants, | ||
color, | ||
class: colorVariants[type][color] | ||
})); | ||
} | ||
var outlined = (variants = {}) => generateColorCompoundVariants(variants, "bordered"); | ||
var colorCompoundVariants = { | ||
outlined | ||
}; | ||
// src/components/accordion.ts | ||
@@ -297,43 +311,4 @@ var accordion = (0, import_tailwind_variants.tv)({ | ||
compoundVariants: [ | ||
...colorCompoundVariants.outlined({ variant: "outlined" }), | ||
{ | ||
variant: "outlined", | ||
color: "default", | ||
class: colorVariants.bordered.default | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "primary", | ||
class: colorVariants.bordered.primary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "secondary", | ||
class: colorVariants.bordered.secondary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "success", | ||
class: colorVariants.bordered.success | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "warning", | ||
class: colorVariants.bordered.warning | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "danger", | ||
class: colorVariants.bordered.danger | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "info", | ||
class: colorVariants.bordered.info | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "foreground", | ||
class: colorVariants.bordered.foreground | ||
}, | ||
{ | ||
readOnly: true, | ||
@@ -340,0 +315,0 @@ variant: ["outlined", "text"], |
@@ -113,3 +113,3 @@ "use strict"; | ||
collapse: () => collapse, | ||
colors: () => colors, | ||
colors: () => colors2, | ||
commonColors: () => commonColors, | ||
@@ -258,2 +258,16 @@ highlightWrapper: () => highlightWrapper, | ||
// src/variants/compoundVariants/colors.ts | ||
var colors = ["default", "primary", "secondary", "success", "warning", "danger", "info", "foreground"]; | ||
function generateColorCompoundVariants(variants = {}, type) { | ||
return colors.map((color) => ({ | ||
...variants, | ||
color, | ||
class: colorVariants[type][color] | ||
})); | ||
} | ||
var outlined = (variants = {}) => generateColorCompoundVariants(variants, "bordered"); | ||
var colorCompoundVariants = { | ||
outlined | ||
}; | ||
// src/components/accordion.ts | ||
@@ -380,43 +394,4 @@ var accordion = (0, import_tailwind_variants.tv)({ | ||
compoundVariants: [ | ||
...colorCompoundVariants.outlined({ variant: "outlined" }), | ||
{ | ||
variant: "outlined", | ||
color: "default", | ||
class: colorVariants.bordered.default | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "primary", | ||
class: colorVariants.bordered.primary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "secondary", | ||
class: colorVariants.bordered.secondary | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "success", | ||
class: colorVariants.bordered.success | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "warning", | ||
class: colorVariants.bordered.warning | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "danger", | ||
class: colorVariants.bordered.danger | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "info", | ||
class: colorVariants.bordered.info | ||
}, | ||
{ | ||
variant: "outlined", | ||
color: "foreground", | ||
class: colorVariants.bordered.foreground | ||
}, | ||
{ | ||
readOnly: true, | ||
@@ -751,5 +726,5 @@ variant: ["outlined", "text"], | ||
var import_flat = __toESM(require("flat")); | ||
function swapColorValues(colors2) { | ||
function swapColorValues(colors3) { | ||
const swappedColors = {}; | ||
const keys = Object.keys(colors2); | ||
const keys = Object.keys(colors3); | ||
const length = keys.length; | ||
@@ -759,8 +734,8 @@ for (let i = 0; i < length / 2; i++) { | ||
const key2 = keys[length - 1 - i]; | ||
swappedColors[key1] = colors2[key2]; | ||
swappedColors[key2] = colors2[key1]; | ||
swappedColors[key1] = colors3[key2]; | ||
swappedColors[key2] = colors3[key1]; | ||
} | ||
if (length % 2 !== 0) { | ||
const middleKey = keys[Math.floor(length / 2)]; | ||
swappedColors[middleKey] = colors2[middleKey]; | ||
swappedColors[middleKey] = colors3[middleKey]; | ||
} | ||
@@ -940,3 +915,3 @@ return swappedColors; | ||
// src/colors/index.ts | ||
var colors = { | ||
var colors2 = { | ||
...commonColors, | ||
@@ -1033,3 +1008,3 @@ ...semanticColors | ||
}; | ||
(0, import_lodash.default)(themes, ({ extend, layout, colors: colors2 }, themeName) => { | ||
(0, import_lodash.default)(themes, ({ extend, layout, colors: colors3 }, themeName) => { | ||
let cssSelector = `.${themeName},[data-theme="${themeName}"]`; | ||
@@ -1047,3 +1022,3 @@ if (themeName === defaultTheme) { | ||
}); | ||
const flatColors = flattenThemeObject(colors2); | ||
const flatColors = flattenThemeObject(colors3); | ||
const flatLayout = layout ? (0, import_lodash4.default)(layout, (value, key) => (0, import_lodash3.default)(key)) : {}; | ||
@@ -1179,6 +1154,6 @@ (0, import_lodash.default)(flatColors, (colorValue, colorName) => { | ||
let otherThemes = (0, import_lodash5.default)(themeObject, ["light", "dark"]) || {}; | ||
(0, import_lodash.default)(otherThemes, ({ extend, colors: colors2, layout }, themeName) => { | ||
(0, import_lodash.default)(otherThemes, ({ extend, colors: colors3, layout }, themeName) => { | ||
const baseTheme = extend && isBaseTheme(extend) ? extend : defaultExtendTheme; | ||
if (colors2 && typeof colors2 === "object") { | ||
otherThemes[themeName].colors = (0, import_deepmerge.default)(semanticColors[baseTheme], colors2); | ||
if (colors3 && typeof colors3 === "object") { | ||
otherThemes[themeName].colors = (0, import_deepmerge.default)(semanticColors[baseTheme], colors3); | ||
} | ||
@@ -1185,0 +1160,0 @@ if (layout && typeof layout === "object") { |
export { colorVariants } from './colors.js'; | ||
export { layoutVariants } from './layout.js'; | ||
export { colorCompoundVariants } from './compoundVariants/colors.js'; |
@@ -23,2 +23,3 @@ "use strict"; | ||
__export(variants_exports, { | ||
colorCompoundVariants: () => colorCompoundVariants, | ||
colorVariants: () => colorVariants, | ||
@@ -150,6 +151,21 @@ layoutVariants: () => layoutVariants | ||
}; | ||
// src/variants/compoundVariants/colors.ts | ||
var colors = ["default", "primary", "secondary", "success", "warning", "danger", "info", "foreground"]; | ||
function generateColorCompoundVariants(variants = {}, type) { | ||
return colors.map((color) => ({ | ||
...variants, | ||
color, | ||
class: colorVariants[type][color] | ||
})); | ||
} | ||
var outlined = (variants = {}) => generateColorCompoundVariants(variants, "bordered"); | ||
var colorCompoundVariants = { | ||
outlined | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
colorCompoundVariants, | ||
colorVariants, | ||
layoutVariants | ||
}); |
{ | ||
"name": "@nkey-ui/theme", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"description": "The default theme for NkeyUI components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
Sorry, the diff of this file is not supported yet
291543
148
9719