@base-framework/ui 1.2.6 → 1.2.7

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/copilot.md CHANGED
@@ -267,7 +267,19 @@ const ChildAtom = Atom((props) => (
267
267
  ## Working with Icons (READ THIS - Most Common Mistake Area)
268
268
 
269
269
  ### Icon Basics
270
- Icons come from [src/components/icons/icons.js](../src/components/icons/icons.js) (Heroicons library). They're SVG strings organized hierarchically. See [base.wiki/02-Icons.md](../base.wiki/02-Icons.md) for complete guide.
270
+ Icons come from [src/components/icons/icons.js](../src/components/icons/icons.js) (Heroicons library). They're SVG strings organized hierarchically. See [ui.wiki/02-Icons.md](../ui.wiki/02-Icons.md) for complete guide.
271
+
272
+ ### Universal Icon Support
273
+ **ALL** icon-accepting components (Button, Alert, Modal, Dialog, etc.) now support BOTH icon systems automatically via `UniversalIcon`. You can pass either Heroicons (SVG) or Material Symbols - the system detects and renders accordingly.
274
+
275
+ ```javascript
276
+ // Both work in any component
277
+ Button({ variant: 'withIcon', icon: Icons.plus }, 'Add')
278
+ Button({ variant: 'withIcon', icon: MaterialSymbols.add }, 'Add')
279
+
280
+ Alert({ icon: Icons.check, title: 'Success' })
281
+ Alert({ icon: 'check_circle', title: 'Success' })
282
+ ```
271
283
 
272
284
  ### Three Ways to Use Icons
273
285
 
@@ -313,6 +325,82 @@ Button({ variant: 'withIcon', icon: Icons.arrows.right, position: 'right' }, 'Ne
313
325
  ✅ `I({ html: Icons.home })`
314
326
  ✅ `Button({ icon: Icons.plus }, 'Text')`
315
327
 
328
+ ## Working with Material Symbols (NEW)
329
+
330
+ ### Material Symbols Basics
331
+ Material Symbols are font-based icons from Google (11,000+ icons). They complement Heroicons. See [ui.wiki/09-Material-Symbols.md](../ui.wiki/09-Material-Symbols.md) for complete guide.
332
+
333
+ ### Using Material Symbols
334
+
335
+ **Basic usage:**
336
+ ```javascript
337
+ import { MaterialIcon } from '@base-framework/ui/atoms';
338
+ import { MaterialSymbols } from '@base-framework/ui/icons';
339
+
340
+ // Using MaterialSymbols object
341
+ MaterialIcon({ name: MaterialSymbols.home, size: 'md' })
342
+
343
+ // Using icon name directly
344
+ MaterialIcon({ name: 'home', size: 'sm' })
345
+
346
+ // With variant
347
+ MaterialIcon({ name: MaterialSymbols.favorite, variant: 'filled', size: 'lg' })
348
+
349
+ // With styling
350
+ MaterialIcon({
351
+ name: MaterialSymbols.star,
352
+ variant: 'filled',
353
+ class: 'text-yellow-500'
354
+ })
355
+ ```
356
+
357
+ ### MaterialIcon Props
358
+ - **name** (required): Icon ligature name (string)
359
+ - **size** (optional): xs | sm | md | lg | xl | 2xl | 3xl (default: 'sm')
360
+ - **variant** (optional): outlined | filled | rounded | sharp (default: 'outlined')
361
+ - **class** (optional): Additional CSS classes
362
+
363
+ ### Common Material Symbols
364
+ ```javascript
365
+ // Simple access
366
+ MaterialSymbols.home
367
+ MaterialSymbols.search
368
+ MaterialSymbols.settings
369
+ MaterialSymbols.favorite
370
+
371
+ // Nested categories
372
+ MaterialSymbols.actions.add
373
+ MaterialSymbols.actions.edit
374
+ MaterialSymbols.arrows.left
375
+ MaterialSymbols.status.success
376
+ MaterialSymbols.social.favorite
377
+ ```
378
+
379
+ ### Material Symbols in Buttons
380
+ ```javascript
381
+ Button({ class: 'flex items-center gap-2' }, [
382
+ MaterialIcon({ name: MaterialSymbols.add, size: 'sm' }),
383
+ 'Add Item'
384
+ ])
385
+
386
+ Button({ class: 'flex items-center gap-2 bg-primary text-white px-4 py-2 rounded' }, [
387
+ MaterialIcon({ name: 'save', size: 'sm' }),
388
+ 'Save'
389
+ ])
390
+ ```
391
+
392
+ ### When to Use Which Icon System
393
+
394
+ **Use Heroicons (Icon) when:**
395
+ - Need SVG precision
396
+ - Prefer curated, smaller set
397
+ - Already using Heroicons
398
+
399
+ **Use Material Symbols (MaterialIcon) when:**
400
+ - Need vast icon library (11,000+)
401
+ - Want filled/outlined/rounded/sharp variants
402
+ - Building Material Design interface
403
+
316
404
  ## Patterns by example
317
405
 
318
406
  ### Alert Component (Functional Atom)
@@ -412,10 +500,14 @@ import { router, NavLink } from '@base-framework/base';
412
500
 
413
501
  ### From This Library
414
502
  ```javascript
415
- // Icons (ALWAYS import both)
503
+ // Icons - Heroicons (ALWAYS import both)
416
504
  import { Icons } from '@base-framework/ui/icons';
417
505
  import { Icon } from '@base-framework/ui/atoms';
418
506
 
507
+ // Icons - Material Symbols (ALWAYS import both)
508
+ import { MaterialSymbols } from '@base-framework/ui/icons';
509
+ import { MaterialIcon } from '@base-framework/ui/atoms';
510
+
419
511
  // Atoms
420
512
  import { Button, Badge, Alert } from '@base-framework/ui/atoms';
421
513
 
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const RangeSlider: import("@base-framework/base").Component;
8
+ export const RangeSlider: new (...args: any[]) => import("@base-framework/base").Component;
9
9
  export default RangeSlider;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const ProgressBar: import("@base-framework/base").Component;
8
+ export const ProgressBar: new (...args: any[]) => import("@base-framework/base").Component;
@@ -17,5 +17,7 @@ export class Veil extends Component {
17
17
  */
18
18
  setContext(context: object | null): object | null;
19
19
  }
20
- export function VeilJot(props: any): Component;
20
+ export function VeilJot(props: any): {
21
+ new (...args: any[]): Component;
22
+ };
21
23
  import { Component } from "@base-framework/base";
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const Counter: import("@base-framework/base").Component;
8
+ export const Counter: new (...args: any[]) => import("@base-framework/base").Component;
9
9
  export default Counter;
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const DatePicker: import("@base-framework/base").Component;
8
+ export const DatePicker: new (...args: any[]) => import("@base-framework/base").Component;
9
9
  export default DatePicker;
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const DateRangePicker: import("@base-framework/base").Component;
8
+ export const DateRangePicker: new (...args: any[]) => import("@base-framework/base").Component;
9
9
  export default DateRangePicker;
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @returns {Component}
7
7
  */
8
- export const TimePicker: import("@base-framework/base").Component;
8
+ export const TimePicker: new (...args: any[]) => import("@base-framework/base").Component;
9
9
  export default TimePicker;
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Handles controlled form fields with accessibility.
5
5
  */
6
- export const FormField: import("@base-framework/base").Component;
6
+ export const FormField: new (...args: any[]) => import("@base-framework/base").Component;
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * This will create a toggle switch component.
5
5
  */
6
- export const Toggle: import("@base-framework/base").Component;
6
+ export const Toggle: new (...args: any[]) => import("@base-framework/base").Component;
7
7
  export default Toggle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.",
5
5
  "main": "./dist/index.es.js",
6
6
  "scripts": {