@base-framework/ui 1.2.5 → 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 +94 -2
- package/dist/types/components/atoms/form/inputs/range-slider.d.ts +1 -1
- package/dist/types/components/atoms/progress/progress-bar.d.ts +1 -1
- package/dist/types/components/atoms/veil.d.ts +3 -1
- package/dist/types/components/molecules/counters/counter.d.ts +1 -1
- package/dist/types/components/molecules/date-time/date-picker.d.ts +1 -1
- package/dist/types/components/molecules/date-time/date-range-picker.d.ts +1 -1
- package/dist/types/components/molecules/date-time/time-picker.d.ts +1 -1
- package/dist/types/components/molecules/form/form-field.d.ts +1 -1
- package/dist/types/components/molecules/toggle/toggle.d.ts +1 -1
- package/package.json +9 -1
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 [
|
|
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
|
|
|
@@ -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):
|
|
20
|
+
export function VeilJot(props: any): {
|
|
21
|
+
new (...args: any[]): Component;
|
|
22
|
+
};
|
|
21
23
|
import { Component } from "@base-framework/base";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@base-framework/ui",
|
|
3
|
-
"version": "1.2.
|
|
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": {
|
|
@@ -48,34 +48,42 @@
|
|
|
48
48
|
"exports": {
|
|
49
49
|
"./package.json": "./package.json",
|
|
50
50
|
".": {
|
|
51
|
+
"types": "./dist/types/**/*.d.ts",
|
|
51
52
|
"import": "./dist/index.es.js",
|
|
52
53
|
"require": "./dist/index.cjs"
|
|
53
54
|
},
|
|
54
55
|
"./atoms": {
|
|
56
|
+
"types": "./dist/types/atoms/**/*.d.ts",
|
|
55
57
|
"import": "./dist/atoms.es.js",
|
|
56
58
|
"require": "./dist/atoms.cjs"
|
|
57
59
|
},
|
|
58
60
|
"./icons": {
|
|
61
|
+
"types": "./dist/types/icons/**/*.d.ts",
|
|
59
62
|
"import": "./dist/icons.es.js",
|
|
60
63
|
"require": "./dist/icons.cjs"
|
|
61
64
|
},
|
|
62
65
|
"./molecules": {
|
|
66
|
+
"types": "./dist/types/molecules/**/*.d.ts",
|
|
63
67
|
"import": "./dist/molecules.es.js",
|
|
64
68
|
"require": "./dist/molecules.cjs"
|
|
65
69
|
},
|
|
66
70
|
"./organisms": {
|
|
71
|
+
"types": "./dist/types/organisms/**/*.d.ts",
|
|
67
72
|
"import": "./dist/organisms.es.js",
|
|
68
73
|
"require": "./dist/organisms.cjs"
|
|
69
74
|
},
|
|
70
75
|
"./utils": {
|
|
76
|
+
"types": "./dist/types/utils/**/*.d.ts",
|
|
71
77
|
"import": "./dist/utils.es.js",
|
|
72
78
|
"require": "./dist/utils.cjs"
|
|
73
79
|
},
|
|
74
80
|
"./pages": {
|
|
81
|
+
"types": "./dist/types/pages/**/*.d.ts",
|
|
75
82
|
"import": "./dist/pages.es.js",
|
|
76
83
|
"require": "./dist/pages.cjs"
|
|
77
84
|
},
|
|
78
85
|
"./templates": {
|
|
86
|
+
"types": "./dist/types/templates/**/*.d.ts",
|
|
79
87
|
"import": "./dist/templates.es.js",
|
|
80
88
|
"require": "./dist/templates.cjs"
|
|
81
89
|
},
|