bem-wind 0.1.0
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/README.md +215 -0
- package/bin/bem-wind.js +106 -0
- package/dist/generate/index.d.ts +6 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +49 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/templates.d.ts +3 -0
- package/dist/generate/templates.d.ts.map +1 -0
- package/dist/generate/templates.js +80 -0
- package/dist/generate/templates.js.map +1 -0
- package/dist/generate/utils.d.ts +2 -0
- package/dist/generate/utils.d.ts.map +1 -0
- package/dist/generate/utils.js +24 -0
- package/dist/generate/utils.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/index.d.ts +5 -0
- package/dist/lint/index.d.ts.map +1 -0
- package/dist/lint/index.js +38 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/setup/generators.d.ts +11 -0
- package/dist/setup/generators.d.ts.map +1 -0
- package/dist/setup/generators.js +101 -0
- package/dist/setup/generators.js.map +1 -0
- package/dist/setup/index.d.ts +8 -0
- package/dist/setup/index.d.ts.map +1 -0
- package/dist/setup/index.js +100 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup/templates.d.ts +10 -0
- package/dist/setup/templates.d.ts.map +1 -0
- package/dist/setup/templates.js +370 -0
- package/dist/setup/templates.js.map +1 -0
- package/package.json +65 -0
- package/scripts/sync-skill.js +22 -0
- package/skill/bem-wind/SKILL.md +106 -0
- package/skill/bem-wind/reference/examples.md +206 -0
- package/skill/bem-wind/reference/tokens.css +134 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateTailwindConfig = generateTailwindConfig;
|
|
7
|
+
exports.generatePostCSSConfig = generatePostCSSConfig;
|
|
8
|
+
exports.generateStylelintConfig = generateStylelintConfig;
|
|
9
|
+
exports.generateESLintConfig = generateESLintConfig;
|
|
10
|
+
exports.generateCoreTokens = generateCoreTokens;
|
|
11
|
+
exports.generateBaseComponents = generateBaseComponents;
|
|
12
|
+
exports.generateTheme = generateTheme;
|
|
13
|
+
exports.generateMainScss = generateMainScss;
|
|
14
|
+
exports.generateComponentConfig = generateComponentConfig;
|
|
15
|
+
exports.generateReadme = generateReadme;
|
|
16
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
|
+
const path_1 = __importDefault(require("path"));
|
|
18
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
19
|
+
const templates_1 = require("./templates");
|
|
20
|
+
async function generateTailwindConfig(projectPath, _prefix) {
|
|
21
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, 'tailwind.config.js'), templates_1.TAILWIND_CONFIG);
|
|
22
|
+
}
|
|
23
|
+
async function generatePostCSSConfig(projectPath) {
|
|
24
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, 'postcss.config.js'), templates_1.POSTCSS_CONFIG);
|
|
25
|
+
}
|
|
26
|
+
async function generateStylelintConfig(projectPath, prefix) {
|
|
27
|
+
const config = {
|
|
28
|
+
extends: ['stylelint-config-standard-scss'],
|
|
29
|
+
plugins: ['stylelint-scss'],
|
|
30
|
+
rules: {
|
|
31
|
+
'selector-class-pattern': [
|
|
32
|
+
`^(${prefix}-[a-z][a-z0-9]*(-[a-z0-9]+)*((__[a-z][a-z0-9]*(-[a-z0-9]+)*)|(--[a-z][a-z0-9]*(-[a-z0-9]+)*))*)$`,
|
|
33
|
+
{
|
|
34
|
+
message: `Class names must follow BEM pattern with ${prefix}- prefix`,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'declaration-property-value-disallowed-list': {
|
|
38
|
+
'/^(margin|padding|top|right|bottom|left|width|height|transform)$/': [
|
|
39
|
+
'/\\b\\d+\\.\\d+(?!.*\\[.*\\])/',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
'at-rule-allowed-list': [
|
|
43
|
+
'apply',
|
|
44
|
+
'import',
|
|
45
|
+
'media',
|
|
46
|
+
'keyframes',
|
|
47
|
+
'supports',
|
|
48
|
+
'layer',
|
|
49
|
+
],
|
|
50
|
+
'scss/at-rule-no-unknown': true,
|
|
51
|
+
'scss/dollar-variable-pattern': `^${prefix}-[a-z][a-z0-9]*(-[a-z0-9]+)*$`,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, '.stylelintrc.json'), JSON.stringify(config, null, 2));
|
|
55
|
+
}
|
|
56
|
+
async function generateESLintConfig(projectPath, prefix) {
|
|
57
|
+
const rendered = mustache_1.default.render(templates_1.ESLINT_ADDITIONS, { prefix });
|
|
58
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, '.eslintrc.bem-wind.js'), rendered);
|
|
59
|
+
}
|
|
60
|
+
async function generateCoreTokens(bemWindPath, prefix) {
|
|
61
|
+
const rendered = mustache_1.default.render(templates_1.CORE_TOKENS, { prefix });
|
|
62
|
+
await fs_extra_1.default.writeFile(path_1.default.join(bemWindPath, 'core/tokens.css'), rendered);
|
|
63
|
+
}
|
|
64
|
+
async function generateBaseComponents(bemWindPath, prefix) {
|
|
65
|
+
const buttonRendered = mustache_1.default.render(templates_1.BUTTON_COMPONENT, {
|
|
66
|
+
prefix,
|
|
67
|
+
name: 'button',
|
|
68
|
+
className: `${prefix}-button`,
|
|
69
|
+
blockName: 'Button',
|
|
70
|
+
});
|
|
71
|
+
await fs_extra_1.default.writeFile(path_1.default.join(bemWindPath, 'primitives/elements/button.scss'), buttonRendered);
|
|
72
|
+
const cardRendered = mustache_1.default.render(templates_1.CARD_COMPONENT, {
|
|
73
|
+
prefix,
|
|
74
|
+
name: 'card',
|
|
75
|
+
className: `${prefix}-card`,
|
|
76
|
+
blockName: 'Card',
|
|
77
|
+
});
|
|
78
|
+
await fs_extra_1.default.writeFile(path_1.default.join(bemWindPath, 'primitives/elements/card.scss'), cardRendered);
|
|
79
|
+
}
|
|
80
|
+
async function generateTheme(bemWindPath, prefix, theme) {
|
|
81
|
+
const rendered = mustache_1.default.render(templates_1.THEME_TEMPLATE, { prefix, theme });
|
|
82
|
+
await fs_extra_1.default.writeFile(path_1.default.join(bemWindPath, 'themes', `${theme}.scss`), rendered);
|
|
83
|
+
}
|
|
84
|
+
async function generateMainScss(bemWindPath, prefix) {
|
|
85
|
+
const rendered = mustache_1.default.render(templates_1.MAIN_SCSS, { prefix });
|
|
86
|
+
await fs_extra_1.default.writeFile(path_1.default.join(bemWindPath, 'main.scss'), rendered);
|
|
87
|
+
}
|
|
88
|
+
async function generateComponentConfig(projectPath, prefix) {
|
|
89
|
+
const config = {
|
|
90
|
+
prefix,
|
|
91
|
+
framework: 'react',
|
|
92
|
+
componentPath: 'src/styles/bem-wind/primitives',
|
|
93
|
+
version: '1.0.0',
|
|
94
|
+
};
|
|
95
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, '.bem-wind.json'), JSON.stringify(config, null, 2));
|
|
96
|
+
}
|
|
97
|
+
async function generateReadme(projectPath, prefix) {
|
|
98
|
+
const rendered = mustache_1.default.render(templates_1.README_TEMPLATE, { prefix });
|
|
99
|
+
await fs_extra_1.default.writeFile(path_1.default.join(projectPath, 'BEM-WIND-README.md'), rendered);
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=generators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../../src/setup/generators.ts"],"names":[],"mappings":";;;;;AAeA,wDAEC;AAED,sDAEC;AAED,0DAiCC;AAED,oDAMC;AAED,gDAGC;AAED,wDAsBC;AAED,sCAUC;AAED,4CAGC;AAED,0DAYC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ChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,iBAwG5E"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupProject = setupProject;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const ora_1 = __importDefault(require("ora"));
|
|
10
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const child_process_1 = require("child_process");
|
|
13
|
+
const generators_1 = require("./generators");
|
|
14
|
+
async function setupProject(projectPath, options) {
|
|
15
|
+
const spinner = (0, ora_1.default)('Setting up BEM-Wind...').start();
|
|
16
|
+
try {
|
|
17
|
+
const packageJsonPath = path_1.default.join(projectPath, 'package.json');
|
|
18
|
+
let packageJson = {};
|
|
19
|
+
if (await fs_extra_1.default.pathExists(packageJsonPath)) {
|
|
20
|
+
packageJson = await fs_extra_1.default.readJSON(packageJsonPath);
|
|
21
|
+
}
|
|
22
|
+
const projectName = packageJson.name || path_1.default.basename(projectPath);
|
|
23
|
+
let prefix = options.prefix || '';
|
|
24
|
+
if (!prefix) {
|
|
25
|
+
const prefixPrompt = await inquirer_1.default.prompt([
|
|
26
|
+
{
|
|
27
|
+
type: 'input',
|
|
28
|
+
name: 'prefix',
|
|
29
|
+
message: 'Component prefix (e.g., "bw" for bem-wind, "myapp" for custom):',
|
|
30
|
+
default: projectName.split('-')[0] || 'bw',
|
|
31
|
+
validate: (input) => {
|
|
32
|
+
if (!/^[a-z][a-z0-9]*$/i.test(input)) {
|
|
33
|
+
return 'Prefix must start with a letter and contain only alphanumeric characters';
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
39
|
+
prefix = prefixPrompt.prefix;
|
|
40
|
+
}
|
|
41
|
+
spinner.text = 'Creating directory structure...';
|
|
42
|
+
const bemWindPath = path_1.default.join(projectPath, 'src/styles/bem-wind');
|
|
43
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'core'));
|
|
44
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'primitives/elements'));
|
|
45
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'primitives/patterns'));
|
|
46
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'primitives/layouts'));
|
|
47
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'themes'));
|
|
48
|
+
await fs_extra_1.default.ensureDir(path_1.default.join(bemWindPath, 'utilities'));
|
|
49
|
+
spinner.text = 'Installing dependencies...';
|
|
50
|
+
if (!options.skipInstall) {
|
|
51
|
+
const dependencies = ['tailwindcss', 'autoprefixer', 'postcss', 'sass'];
|
|
52
|
+
const devDependencies = [
|
|
53
|
+
'stylelint',
|
|
54
|
+
'stylelint-config-standard-scss',
|
|
55
|
+
'stylelint-scss',
|
|
56
|
+
'@stylelint/postcss-css-in-js',
|
|
57
|
+
'eslint-plugin-bem-wind',
|
|
58
|
+
];
|
|
59
|
+
try {
|
|
60
|
+
(0, child_process_1.execSync)(`npm install ${dependencies.join(' ')}`, {
|
|
61
|
+
stdio: 'pipe',
|
|
62
|
+
cwd: projectPath,
|
|
63
|
+
});
|
|
64
|
+
(0, child_process_1.execSync)(`npm install -D ${devDependencies.join(' ')}`, {
|
|
65
|
+
stdio: 'pipe',
|
|
66
|
+
cwd: projectPath,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
spinner.warn('Some dependencies failed to install. You may need to install them manually.');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
spinner.text = 'Generating configuration files...';
|
|
74
|
+
await (0, generators_1.generateTailwindConfig)(projectPath, prefix);
|
|
75
|
+
await (0, generators_1.generatePostCSSConfig)(projectPath);
|
|
76
|
+
await (0, generators_1.generateStylelintConfig)(projectPath, prefix);
|
|
77
|
+
await (0, generators_1.generateESLintConfig)(projectPath, prefix);
|
|
78
|
+
spinner.text = 'Creating core design tokens...';
|
|
79
|
+
await (0, generators_1.generateCoreTokens)(bemWindPath, prefix);
|
|
80
|
+
await (0, generators_1.generateBaseComponents)(bemWindPath, prefix);
|
|
81
|
+
await (0, generators_1.generateTheme)(bemWindPath, prefix, options.theme || 'default');
|
|
82
|
+
await (0, generators_1.generateMainScss)(bemWindPath, prefix);
|
|
83
|
+
await (0, generators_1.generateComponentConfig)(projectPath, prefix);
|
|
84
|
+
spinner.text = 'Creating documentation...';
|
|
85
|
+
await (0, generators_1.generateReadme)(projectPath, prefix);
|
|
86
|
+
spinner.succeed(chalk_1.default.green('BEM-Wind setup complete! 🎉'));
|
|
87
|
+
console.log(chalk_1.default.cyan('\nNext steps:'));
|
|
88
|
+
console.log(chalk_1.default.white('1. Import styles in your main CSS/SCSS file:'));
|
|
89
|
+
console.log(chalk_1.default.gray(` @import './styles/bem-wind/main.scss';`));
|
|
90
|
+
console.log(chalk_1.default.white('2. Generate your first component:'));
|
|
91
|
+
console.log(chalk_1.default.gray(` npx bem-wind component button`));
|
|
92
|
+
console.log(chalk_1.default.white('3. Run linting:'));
|
|
93
|
+
console.log(chalk_1.default.gray(` npx bem-wind lint`));
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
spinner.fail(chalk_1.default.red('Setup failed'));
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=index.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CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QACxC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const TAILWIND_CONFIG = "/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n content: [\n \"./src/**/*.{js,jsx,ts,tsx,html,astro,vue}\",\n \"./public/**/*.html\"\n ],\n theme: {\n extend: {\n // BEM-Wind custom design tokens will extend Tailwind\n spacing: {\n // Custom spacing will be defined in CSS variables\n },\n colors: {\n // Custom colors will be defined in CSS variables\n },\n fontFamily: {\n // Custom fonts will be defined in CSS variables\n }\n },\n },\n plugins: [],\n // Prevent Tailwind from interfering with BEM-Wind classes\n corePlugins: {\n preflight: false,\n }\n}";
|
|
2
|
+
export declare const POSTCSS_CONFIG = "module.exports = {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n}";
|
|
3
|
+
export declare const ESLINT_ADDITIONS = "// Add to your .eslintrc.js or eslint.config.js\nmodule.exports = {\n // ... your existing config\n plugins: ['bem-wind'],\n rules: {\n // BEM-Wind specific rules\n 'bem-wind/no-decimal-arbitrary': 'error',\n 'bem-wind/prefer-semantic-spacing': 'warn',\n 'bem-wind/require-bem-structure': 'error',\n },\n settings: {\n 'bem-wind': {\n prefix: '{{prefix}}',\n },\n },\n};";
|
|
4
|
+
export declare const CORE_TOKENS = "/**\n * {{prefix}}-Wind Core Design Tokens\n *\n * Universal design tokens that work across all projects.\n * Project themes override these values as needed.\n */\n\n:root {\n /* ==============================================\n SPACING SCALE\n Maps directly to Figma spacing tokens\n ============================================== */\n\n --{{prefix}}-space-0: 0;\n --{{prefix}}-space-1: 0.25rem; /* 4px - tiny details */\n --{{prefix}}-space-2: 0.5rem; /* 8px - tight spacing */\n --{{prefix}}-space-3: 0.75rem; /* 12px - small gaps */\n --{{prefix}}-space-4: 1rem; /* 16px - base unit */\n --{{prefix}}-space-6: 1.5rem; /* 24px - comfortable spacing */\n --{{prefix}}-space-8: 2rem; /* 32px - large spacing */\n --{{prefix}}-space-12: 3rem; /* 48px - section spacing */\n --{{prefix}}-space-16: 4rem; /* 64px - major sections */\n --{{prefix}}-space-20: 5rem; /* 80px - page sections */\n\n /* Semantic spacing aliases */\n --{{prefix}}-space-tiny: var(--{{prefix}}-space-1);\n --{{prefix}}-space-small: var(--{{prefix}}-space-2);\n --{{prefix}}-space-medium: var(--{{prefix}}-space-4);\n --{{prefix}}-space-large: var(--{{prefix}}-space-6);\n --{{prefix}}-space-xlarge: var(--{{prefix}}-space-8);\n\n /* ==============================================\n TYPOGRAPHY SCALE\n ============================================== */\n\n --{{prefix}}-text-xs: 0.75rem; /* 12px */\n --{{prefix}}-text-sm: 0.875rem; /* 14px */\n --{{prefix}}-text-base: 1rem; /* 16px */\n --{{prefix}}-text-lg: 1.125rem; /* 18px */\n --{{prefix}}-text-xl: 1.25rem; /* 20px */\n --{{prefix}}-text-2xl: 1.5rem; /* 24px */\n --{{prefix}}-text-3xl: 1.875rem; /* 30px */\n --{{prefix}}-text-4xl: 2.25rem; /* 36px */\n --{{prefix}}-text-5xl: 3rem; /* 48px */\n\n /* ==============================================\n LAYOUT & CONTAINERS\n ============================================== */\n\n --{{prefix}}-container-sm: 24rem; /* 384px */\n --{{prefix}}-container-md: 28rem; /* 448px */\n --{{prefix}}-container-lg: 32rem; /* 512px */\n --{{prefix}}-container-xl: 36rem; /* 576px */\n --{{prefix}}-container-2xl: 42rem; /* 672px */\n --{{prefix}}-container-3xl: 48rem; /* 768px */\n --{{prefix}}-container-4xl: 56rem; /* 896px */\n --{{prefix}}-container-5xl: 64rem; /* 1024px */\n --{{prefix}}-container-6xl: 72rem; /* 1152px */\n --{{prefix}}-container-7xl: 80rem; /* 1280px */\n\n /* Semantic container aliases */\n --{{prefix}}-container-narrow: var(--{{prefix}}-container-2xl);\n --{{prefix}}-container-content: var(--{{prefix}}-container-4xl);\n --{{prefix}}-container-wide: var(--{{prefix}}-container-6xl);\n\n /* ==============================================\n TRANSITIONS & ANIMATIONS\n ============================================== */\n\n --{{prefix}}-duration-fast: 150ms;\n --{{prefix}}-duration-normal: 300ms;\n --{{prefix}}-duration-slow: 500ms;\n\n --{{prefix}}-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --{{prefix}}-ease-out: cubic-bezier(0, 0, 0.2, 1);\n --{{prefix}}-ease-in: cubic-bezier(0.4, 0, 1, 1);\n}";
|
|
5
|
+
export declare const BUTTON_COMPONENT = "/**\n * {{blockName}} Component\n *\n * {{prefix}}-{{name}} provides button structure and behavior\n * without any visual styling.\n */\n\n.{{className}} {\n @apply inline-flex items-center justify-center cursor-pointer;\n @apply border-0 bg-transparent outline-none;\n font-family: inherit;\n @apply transition-all duration-300 ease-in-out select-none;\n\n &:focus-visible {\n @apply outline outline-2 outline-current outline-offset-2;\n }\n\n &:disabled,\n &--disabled {\n @apply cursor-not-allowed opacity-60;\n\n &:hover {\n @apply transform-none;\n }\n }\n\n /* Size variants */\n &--small {\n @apply py-2 px-3 text-sm gap-2;\n }\n\n &--medium {\n @apply py-3 px-4 text-base gap-2;\n }\n\n &--large {\n @apply py-4 px-6 text-lg gap-3;\n }\n\n /* Shape variants */\n &--full-width {\n @apply w-full;\n }\n\n /* Content elements */\n &__icon {\n @apply flex items-center justify-center flex-shrink-0;\n }\n\n &__text {\n @apply whitespace-nowrap;\n\n &--truncate {\n @apply overflow-hidden text-ellipsis;\n }\n }\n}";
|
|
6
|
+
export declare const CARD_COMPONENT = "/**\n * {{blockName}} Component\n *\n * {{prefix}}-{{name}} provides card structure and layout\n * without any visual styling.\n */\n\n.{{className}} {\n @apply flex flex-col;\n @apply transition-all duration-300 ease-in-out;\n\n &--interactive {\n @apply cursor-pointer;\n }\n\n &__content {\n @apply flex flex-col flex-1;\n\n &--padded-small {\n @apply p-3;\n }\n\n &--padded-medium {\n @apply p-4;\n }\n\n &--padded-large {\n @apply p-6;\n }\n }\n\n &__header {\n @apply mb-4;\n }\n\n &__title {\n @apply font-medium leading-tight;\n }\n\n &__subtitle {\n @apply text-gray-600 mt-1;\n }\n\n &__body {\n @apply flex-1;\n }\n\n &__footer {\n @apply mt-4 pt-4;\n }\n}";
|
|
7
|
+
export declare const THEME_TEMPLATE = "/**\n * {{prefix}}-Wind {{theme}} Theme\n *\n * Overrides core design tokens for project-specific styling.\n */\n\n:root {\n /* ==============================================\n PROJECT COLORS\n ============================================== */\n\n /* Primary colors */\n --{{prefix}}-color-primary: #1f2937;\n --{{prefix}}-color-primary-light: #4b5563;\n --{{prefix}}-color-primary-dark: #111827;\n\n /* Secondary colors */\n --{{prefix}}-color-secondary: #6b7280;\n --{{prefix}}-color-secondary-light: #9ca3af;\n --{{prefix}}-color-secondary-dark: #374151;\n\n /* Text colors */\n --{{prefix}}-color-text-primary: #111827;\n --{{prefix}}-color-text-secondary: #6b7280;\n --{{prefix}}-color-text-muted: #9ca3af;\n\n /* Background colors */\n --{{prefix}}-color-bg-primary: #ffffff;\n --{{prefix}}-color-bg-secondary: #f9fafb;\n --{{prefix}}-color-bg-muted: #f3f4f6;\n\n /* ==============================================\n PROJECT TYPOGRAPHY\n ============================================== */\n\n --{{prefix}}-font-sans: ui-sans-serif, system-ui, sans-serif;\n --{{prefix}}-font-serif: ui-serif, Georgia, serif;\n --{{prefix}}-font-mono: ui-monospace, 'SF Mono', monospace;\n\n /* Semantic font aliases */\n --{{prefix}}-font-display: var(--{{prefix}}-font-serif);\n --{{prefix}}-font-body: var(--{{prefix}}-font-sans);\n --{{prefix}}-font-ui: var(--{{prefix}}-font-sans);\n}\n\n/* ==============================================\n COMPONENT STYLING\n ============================================== */\n\n.{{prefix}}-button {\n border-radius: 0.5rem;\n font-family: var(--{{prefix}}-font-body);\n\n &--primary {\n @apply bg-gray-900 text-white;\n\n &:hover {\n @apply bg-gray-800;\n }\n }\n\n &--secondary {\n @apply bg-gray-200 text-gray-900;\n\n &:hover {\n @apply bg-gray-300;\n }\n }\n}\n\n.{{prefix}}-card {\n @apply bg-white border border-gray-200 rounded-lg shadow-sm;\n\n &--interactive:hover {\n @apply shadow-md;\n }\n}";
|
|
8
|
+
export declare const MAIN_SCSS = "/**\n * {{prefix}}-Wind Main Entry Point\n *\n * Import this file in your main CSS/SCSS file\n */\n\n/* Core design tokens */\n@import './core/tokens.css';\n\n/* Primitive components */\n@import './primitives/elements/button.scss';\n@import './primitives/elements/card.scss';\n\n/* Theme styling */\n@import './themes/default.scss';\n\n/* Tailwind base (optional - only if needed) */\n/* @tailwind base; */\n@tailwind components;\n@tailwind utilities;";
|
|
9
|
+
export declare const README_TEMPLATE = "# {{prefix}}-Wind Setup\n\nThis project uses **{{prefix}}-Wind**, a semantic design system framework.\n\n## Usage\n\n### Import Styles\n```scss\n// In your main CSS/SCSS file\n@import './styles/bem-wind/main.scss';\n```\n\n### Use Components\n```html\n<button class=\"{{prefix}}-button {{prefix}}-button--primary {{prefix}}-button--large\">\n <span class=\"{{prefix}}-button__text\">Click Me</span>\n</button>\n```\n\n## Commands\n\n- `npx bem-wind component <name>` - Generate new component\n- `npx bem-wind lint` - Run linting rules\n- `npx bem-wind lint --fix` - Auto-fix issues\n\n## Conventions\n\n- Use semantic spacing: `{{prefix}}-space-large` instead of arbitrary values\n- Follow BEM naming: `{{prefix}}-block__element--modifier`\n- Use @apply in component SCSS files\n- Avoid decimal arbitrary values: use `translate-y-1` not `translate-y-0.5`\n\n## Documentation\n\n- [BEM-Wind Manual](./src/styles/bem-wind/BEM-WIND-MANUAL.md)\n- [Component Examples](./src/styles/bem-wind/examples/)";
|
|
10
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/setup/templates.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mpBAyB1B,CAAC;AAEH,eAAO,MAAM,cAAc,2FAKzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,oZAe1B,CAAC;AAEJ,eAAO,MAAM,WAAW,moGA4EtB,CAAC;AAEH,eAAO,MAAM,gBAAgB,qkCAwD3B,CAAC;AAEH,eAAO,MAAM,cAAc,suBAkDzB,CAAC;AAEH,eAAO,MAAM,cAAc,k+DA4EzB,CAAC;AAEH,eAAO,MAAM,SAAS,wcAmBD,CAAC;AAEtB,eAAO,MAAM,eAAe,0+BAmC4B,CAAC"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.README_TEMPLATE = exports.MAIN_SCSS = exports.THEME_TEMPLATE = exports.CARD_COMPONENT = exports.BUTTON_COMPONENT = exports.CORE_TOKENS = exports.ESLINT_ADDITIONS = exports.POSTCSS_CONFIG = exports.TAILWIND_CONFIG = void 0;
|
|
4
|
+
exports.TAILWIND_CONFIG = `/** @type {import('tailwindcss').Config} */
|
|
5
|
+
module.exports = {
|
|
6
|
+
content: [
|
|
7
|
+
"./src/**/*.{js,jsx,ts,tsx,html,astro,vue}",
|
|
8
|
+
"./public/**/*.html"
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {
|
|
12
|
+
// BEM-Wind custom design tokens will extend Tailwind
|
|
13
|
+
spacing: {
|
|
14
|
+
// Custom spacing will be defined in CSS variables
|
|
15
|
+
},
|
|
16
|
+
colors: {
|
|
17
|
+
// Custom colors will be defined in CSS variables
|
|
18
|
+
},
|
|
19
|
+
fontFamily: {
|
|
20
|
+
// Custom fonts will be defined in CSS variables
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
plugins: [],
|
|
25
|
+
// Prevent Tailwind from interfering with BEM-Wind classes
|
|
26
|
+
corePlugins: {
|
|
27
|
+
preflight: false,
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
30
|
+
exports.POSTCSS_CONFIG = `module.exports = {
|
|
31
|
+
plugins: {
|
|
32
|
+
tailwindcss: {},
|
|
33
|
+
autoprefixer: {},
|
|
34
|
+
},
|
|
35
|
+
}`;
|
|
36
|
+
exports.ESLINT_ADDITIONS = `// Add to your .eslintrc.js or eslint.config.js
|
|
37
|
+
module.exports = {
|
|
38
|
+
// ... your existing config
|
|
39
|
+
plugins: ['bem-wind'],
|
|
40
|
+
rules: {
|
|
41
|
+
// BEM-Wind specific rules
|
|
42
|
+
'bem-wind/no-decimal-arbitrary': 'error',
|
|
43
|
+
'bem-wind/prefer-semantic-spacing': 'warn',
|
|
44
|
+
'bem-wind/require-bem-structure': 'error',
|
|
45
|
+
},
|
|
46
|
+
settings: {
|
|
47
|
+
'bem-wind': {
|
|
48
|
+
prefix: '{{prefix}}',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};`;
|
|
52
|
+
exports.CORE_TOKENS = `/**
|
|
53
|
+
* {{prefix}}-Wind Core Design Tokens
|
|
54
|
+
*
|
|
55
|
+
* Universal design tokens that work across all projects.
|
|
56
|
+
* Project themes override these values as needed.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
:root {
|
|
60
|
+
/* ==============================================
|
|
61
|
+
SPACING SCALE
|
|
62
|
+
Maps directly to Figma spacing tokens
|
|
63
|
+
============================================== */
|
|
64
|
+
|
|
65
|
+
--{{prefix}}-space-0: 0;
|
|
66
|
+
--{{prefix}}-space-1: 0.25rem; /* 4px - tiny details */
|
|
67
|
+
--{{prefix}}-space-2: 0.5rem; /* 8px - tight spacing */
|
|
68
|
+
--{{prefix}}-space-3: 0.75rem; /* 12px - small gaps */
|
|
69
|
+
--{{prefix}}-space-4: 1rem; /* 16px - base unit */
|
|
70
|
+
--{{prefix}}-space-6: 1.5rem; /* 24px - comfortable spacing */
|
|
71
|
+
--{{prefix}}-space-8: 2rem; /* 32px - large spacing */
|
|
72
|
+
--{{prefix}}-space-12: 3rem; /* 48px - section spacing */
|
|
73
|
+
--{{prefix}}-space-16: 4rem; /* 64px - major sections */
|
|
74
|
+
--{{prefix}}-space-20: 5rem; /* 80px - page sections */
|
|
75
|
+
|
|
76
|
+
/* Semantic spacing aliases */
|
|
77
|
+
--{{prefix}}-space-tiny: var(--{{prefix}}-space-1);
|
|
78
|
+
--{{prefix}}-space-small: var(--{{prefix}}-space-2);
|
|
79
|
+
--{{prefix}}-space-medium: var(--{{prefix}}-space-4);
|
|
80
|
+
--{{prefix}}-space-large: var(--{{prefix}}-space-6);
|
|
81
|
+
--{{prefix}}-space-xlarge: var(--{{prefix}}-space-8);
|
|
82
|
+
|
|
83
|
+
/* ==============================================
|
|
84
|
+
TYPOGRAPHY SCALE
|
|
85
|
+
============================================== */
|
|
86
|
+
|
|
87
|
+
--{{prefix}}-text-xs: 0.75rem; /* 12px */
|
|
88
|
+
--{{prefix}}-text-sm: 0.875rem; /* 14px */
|
|
89
|
+
--{{prefix}}-text-base: 1rem; /* 16px */
|
|
90
|
+
--{{prefix}}-text-lg: 1.125rem; /* 18px */
|
|
91
|
+
--{{prefix}}-text-xl: 1.25rem; /* 20px */
|
|
92
|
+
--{{prefix}}-text-2xl: 1.5rem; /* 24px */
|
|
93
|
+
--{{prefix}}-text-3xl: 1.875rem; /* 30px */
|
|
94
|
+
--{{prefix}}-text-4xl: 2.25rem; /* 36px */
|
|
95
|
+
--{{prefix}}-text-5xl: 3rem; /* 48px */
|
|
96
|
+
|
|
97
|
+
/* ==============================================
|
|
98
|
+
LAYOUT & CONTAINERS
|
|
99
|
+
============================================== */
|
|
100
|
+
|
|
101
|
+
--{{prefix}}-container-sm: 24rem; /* 384px */
|
|
102
|
+
--{{prefix}}-container-md: 28rem; /* 448px */
|
|
103
|
+
--{{prefix}}-container-lg: 32rem; /* 512px */
|
|
104
|
+
--{{prefix}}-container-xl: 36rem; /* 576px */
|
|
105
|
+
--{{prefix}}-container-2xl: 42rem; /* 672px */
|
|
106
|
+
--{{prefix}}-container-3xl: 48rem; /* 768px */
|
|
107
|
+
--{{prefix}}-container-4xl: 56rem; /* 896px */
|
|
108
|
+
--{{prefix}}-container-5xl: 64rem; /* 1024px */
|
|
109
|
+
--{{prefix}}-container-6xl: 72rem; /* 1152px */
|
|
110
|
+
--{{prefix}}-container-7xl: 80rem; /* 1280px */
|
|
111
|
+
|
|
112
|
+
/* Semantic container aliases */
|
|
113
|
+
--{{prefix}}-container-narrow: var(--{{prefix}}-container-2xl);
|
|
114
|
+
--{{prefix}}-container-content: var(--{{prefix}}-container-4xl);
|
|
115
|
+
--{{prefix}}-container-wide: var(--{{prefix}}-container-6xl);
|
|
116
|
+
|
|
117
|
+
/* ==============================================
|
|
118
|
+
TRANSITIONS & ANIMATIONS
|
|
119
|
+
============================================== */
|
|
120
|
+
|
|
121
|
+
--{{prefix}}-duration-fast: 150ms;
|
|
122
|
+
--{{prefix}}-duration-normal: 300ms;
|
|
123
|
+
--{{prefix}}-duration-slow: 500ms;
|
|
124
|
+
|
|
125
|
+
--{{prefix}}-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
126
|
+
--{{prefix}}-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
127
|
+
--{{prefix}}-ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
128
|
+
}`;
|
|
129
|
+
exports.BUTTON_COMPONENT = `/**
|
|
130
|
+
* {{blockName}} Component
|
|
131
|
+
*
|
|
132
|
+
* {{prefix}}-{{name}} provides button structure and behavior
|
|
133
|
+
* without any visual styling.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
.{{className}} {
|
|
137
|
+
@apply inline-flex items-center justify-center cursor-pointer;
|
|
138
|
+
@apply border-0 bg-transparent outline-none;
|
|
139
|
+
font-family: inherit;
|
|
140
|
+
@apply transition-all duration-300 ease-in-out select-none;
|
|
141
|
+
|
|
142
|
+
&:focus-visible {
|
|
143
|
+
@apply outline outline-2 outline-current outline-offset-2;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&:disabled,
|
|
147
|
+
&--disabled {
|
|
148
|
+
@apply cursor-not-allowed opacity-60;
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
@apply transform-none;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Size variants */
|
|
156
|
+
&--small {
|
|
157
|
+
@apply py-2 px-3 text-sm gap-2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&--medium {
|
|
161
|
+
@apply py-3 px-4 text-base gap-2;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&--large {
|
|
165
|
+
@apply py-4 px-6 text-lg gap-3;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Shape variants */
|
|
169
|
+
&--full-width {
|
|
170
|
+
@apply w-full;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Content elements */
|
|
174
|
+
&__icon {
|
|
175
|
+
@apply flex items-center justify-center flex-shrink-0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&__text {
|
|
179
|
+
@apply whitespace-nowrap;
|
|
180
|
+
|
|
181
|
+
&--truncate {
|
|
182
|
+
@apply overflow-hidden text-ellipsis;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}`;
|
|
186
|
+
exports.CARD_COMPONENT = `/**
|
|
187
|
+
* {{blockName}} Component
|
|
188
|
+
*
|
|
189
|
+
* {{prefix}}-{{name}} provides card structure and layout
|
|
190
|
+
* without any visual styling.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
.{{className}} {
|
|
194
|
+
@apply flex flex-col;
|
|
195
|
+
@apply transition-all duration-300 ease-in-out;
|
|
196
|
+
|
|
197
|
+
&--interactive {
|
|
198
|
+
@apply cursor-pointer;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&__content {
|
|
202
|
+
@apply flex flex-col flex-1;
|
|
203
|
+
|
|
204
|
+
&--padded-small {
|
|
205
|
+
@apply p-3;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&--padded-medium {
|
|
209
|
+
@apply p-4;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&--padded-large {
|
|
213
|
+
@apply p-6;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&__header {
|
|
218
|
+
@apply mb-4;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&__title {
|
|
222
|
+
@apply font-medium leading-tight;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&__subtitle {
|
|
226
|
+
@apply text-gray-600 mt-1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&__body {
|
|
230
|
+
@apply flex-1;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&__footer {
|
|
234
|
+
@apply mt-4 pt-4;
|
|
235
|
+
}
|
|
236
|
+
}`;
|
|
237
|
+
exports.THEME_TEMPLATE = `/**
|
|
238
|
+
* {{prefix}}-Wind {{theme}} Theme
|
|
239
|
+
*
|
|
240
|
+
* Overrides core design tokens for project-specific styling.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
:root {
|
|
244
|
+
/* ==============================================
|
|
245
|
+
PROJECT COLORS
|
|
246
|
+
============================================== */
|
|
247
|
+
|
|
248
|
+
/* Primary colors */
|
|
249
|
+
--{{prefix}}-color-primary: #1f2937;
|
|
250
|
+
--{{prefix}}-color-primary-light: #4b5563;
|
|
251
|
+
--{{prefix}}-color-primary-dark: #111827;
|
|
252
|
+
|
|
253
|
+
/* Secondary colors */
|
|
254
|
+
--{{prefix}}-color-secondary: #6b7280;
|
|
255
|
+
--{{prefix}}-color-secondary-light: #9ca3af;
|
|
256
|
+
--{{prefix}}-color-secondary-dark: #374151;
|
|
257
|
+
|
|
258
|
+
/* Text colors */
|
|
259
|
+
--{{prefix}}-color-text-primary: #111827;
|
|
260
|
+
--{{prefix}}-color-text-secondary: #6b7280;
|
|
261
|
+
--{{prefix}}-color-text-muted: #9ca3af;
|
|
262
|
+
|
|
263
|
+
/* Background colors */
|
|
264
|
+
--{{prefix}}-color-bg-primary: #ffffff;
|
|
265
|
+
--{{prefix}}-color-bg-secondary: #f9fafb;
|
|
266
|
+
--{{prefix}}-color-bg-muted: #f3f4f6;
|
|
267
|
+
|
|
268
|
+
/* ==============================================
|
|
269
|
+
PROJECT TYPOGRAPHY
|
|
270
|
+
============================================== */
|
|
271
|
+
|
|
272
|
+
--{{prefix}}-font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
273
|
+
--{{prefix}}-font-serif: ui-serif, Georgia, serif;
|
|
274
|
+
--{{prefix}}-font-mono: ui-monospace, 'SF Mono', monospace;
|
|
275
|
+
|
|
276
|
+
/* Semantic font aliases */
|
|
277
|
+
--{{prefix}}-font-display: var(--{{prefix}}-font-serif);
|
|
278
|
+
--{{prefix}}-font-body: var(--{{prefix}}-font-sans);
|
|
279
|
+
--{{prefix}}-font-ui: var(--{{prefix}}-font-sans);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* ==============================================
|
|
283
|
+
COMPONENT STYLING
|
|
284
|
+
============================================== */
|
|
285
|
+
|
|
286
|
+
.{{prefix}}-button {
|
|
287
|
+
border-radius: 0.5rem;
|
|
288
|
+
font-family: var(--{{prefix}}-font-body);
|
|
289
|
+
|
|
290
|
+
&--primary {
|
|
291
|
+
@apply bg-gray-900 text-white;
|
|
292
|
+
|
|
293
|
+
&:hover {
|
|
294
|
+
@apply bg-gray-800;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&--secondary {
|
|
299
|
+
@apply bg-gray-200 text-gray-900;
|
|
300
|
+
|
|
301
|
+
&:hover {
|
|
302
|
+
@apply bg-gray-300;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.{{prefix}}-card {
|
|
308
|
+
@apply bg-white border border-gray-200 rounded-lg shadow-sm;
|
|
309
|
+
|
|
310
|
+
&--interactive:hover {
|
|
311
|
+
@apply shadow-md;
|
|
312
|
+
}
|
|
313
|
+
}`;
|
|
314
|
+
exports.MAIN_SCSS = `/**
|
|
315
|
+
* {{prefix}}-Wind Main Entry Point
|
|
316
|
+
*
|
|
317
|
+
* Import this file in your main CSS/SCSS file
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
/* Core design tokens */
|
|
321
|
+
@import './core/tokens.css';
|
|
322
|
+
|
|
323
|
+
/* Primitive components */
|
|
324
|
+
@import './primitives/elements/button.scss';
|
|
325
|
+
@import './primitives/elements/card.scss';
|
|
326
|
+
|
|
327
|
+
/* Theme styling */
|
|
328
|
+
@import './themes/default.scss';
|
|
329
|
+
|
|
330
|
+
/* Tailwind base (optional - only if needed) */
|
|
331
|
+
/* @tailwind base; */
|
|
332
|
+
@tailwind components;
|
|
333
|
+
@tailwind utilities;`;
|
|
334
|
+
exports.README_TEMPLATE = `# {{prefix}}-Wind Setup
|
|
335
|
+
|
|
336
|
+
This project uses **{{prefix}}-Wind**, a semantic design system framework.
|
|
337
|
+
|
|
338
|
+
## Usage
|
|
339
|
+
|
|
340
|
+
### Import Styles
|
|
341
|
+
\`\`\`scss
|
|
342
|
+
// In your main CSS/SCSS file
|
|
343
|
+
@import './styles/bem-wind/main.scss';
|
|
344
|
+
\`\`\`
|
|
345
|
+
|
|
346
|
+
### Use Components
|
|
347
|
+
\`\`\`html
|
|
348
|
+
<button class="{{prefix}}-button {{prefix}}-button--primary {{prefix}}-button--large">
|
|
349
|
+
<span class="{{prefix}}-button__text">Click Me</span>
|
|
350
|
+
</button>
|
|
351
|
+
\`\`\`
|
|
352
|
+
|
|
353
|
+
## Commands
|
|
354
|
+
|
|
355
|
+
- \`npx bem-wind component <name>\` - Generate new component
|
|
356
|
+
- \`npx bem-wind lint\` - Run linting rules
|
|
357
|
+
- \`npx bem-wind lint --fix\` - Auto-fix issues
|
|
358
|
+
|
|
359
|
+
## Conventions
|
|
360
|
+
|
|
361
|
+
- Use semantic spacing: \`{{prefix}}-space-large\` instead of arbitrary values
|
|
362
|
+
- Follow BEM naming: \`{{prefix}}-block__element--modifier\`
|
|
363
|
+
- Use @apply in component SCSS files
|
|
364
|
+
- Avoid decimal arbitrary values: use \`translate-y-1\` not \`translate-y-0.5\`
|
|
365
|
+
|
|
366
|
+
## Documentation
|
|
367
|
+
|
|
368
|
+
- [BEM-Wind Manual](./src/styles/bem-wind/BEM-WIND-MANUAL.md)
|
|
369
|
+
- [Component Examples](./src/styles/bem-wind/examples/)`;
|
|
370
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/setup/templates.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;EAyB7B,CAAC;AAEU,QAAA,cAAc,GAAG;;;;;EAK5B,CAAC;AAEU,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;GAe7B,CAAC;AAES,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EzB,CAAC;AAEU,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwD9B,CAAC;AAEU,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkD5B,CAAC;AAEU,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4E5B,CAAC;AAEU,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;;;;;qBAmBJ,CAAC;AAET,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAmCyB,CAAC"}
|