Files
metabuilder/qml/hybrid/utils/classNames.js
johndoe6345789 c406b8df96 refactor: Reorganize FakeMUI by implementation type
Move FakeMUI content to appropriate root-level folders by implementation:

**React Components → components/fakemui/**
- 537 components (inputs, surfaces, layout, data-display, feedback,
  navigation, utils, atoms, lab, x, email, workflows)
- 416 SVG icons
- Full barrel exports in components/fakemui/index.ts

**QML Components → qml/**
- 104 Material Design 3 components (11 categories)
- 7 hybrid application views
- 8 desktop widgets
- qmldir module registration

**Python Bindings → python/fakemui/**
- 15 PyQt6 modules (120+ components)
- Full Python package structure with pyproject.toml

**SCSS/Styles → fakemui/** (renamed purpose)
- scss/ - Material Design 3 stylesheets
- styles/ - Component SCSS modules
- src/utils/ - Accessibility utilities
- index.ts now re-exports from components/fakemui/

This separation allows:
- React: import { Button } from '@metabuilder/components/fakemui'
- QML: import QmlComponents 1.0
- Python: from fakemui import Button, Card
- Backward compat: import { Button } from '@metabuilder/fakemui'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:59:24 +00:00

36 lines
980 B
JavaScript

/**
* Utility for constructing className strings conditionally.
* Similar to the popular 'classnames' npm package but minimal.
*
* @param {...(string|object|array|undefined|null|false)} args
* @returns {string} Combined class names
*
* @example
* classNames('foo', 'bar') // => 'foo bar'
* classNames('foo', { bar: true, baz: false }) // => 'foo bar'
* classNames(['foo', 'bar']) // => 'foo bar'
* classNames('foo', undefined, null, false, 'bar') // => 'foo bar'
*/
export function classNames(...args) {
const classes = [];
for (const arg of args) {
if (!arg) continue;
if (typeof arg === 'string') {
classes.push(arg);
} else if (Array.isArray(arg)) {
const inner = classNames(...arg);
if (inner) classes.push(inner);
} else if (typeof arg === 'object') {
for (const [key, value] of Object.entries(arg)) {
if (value) classes.push(key);
}
}
}
return classes.join(' ');
}
export default classNames;