@brickclay-org/ui 0.0.14 → 0.0.16

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 CHANGED
@@ -30,12 +30,36 @@ A fully accessible checkbox component with Angular forms integration. Features c
30
30
 
31
31
  A fully accessible radio button component with Angular forms integration. Features two visual variants (dot and tick), customizable styling, disabled state, keyboard navigation, and seamless integration with both template-driven and reactive forms.
32
32
 
33
+ ### Pill Component
34
+
35
+ A versatile pill component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
36
+
37
+ ### Badge Component
38
+
39
+ A flexible badge component for displaying labels, tags, or status indicators. Features multiple variants (Light, Solid, Outline, Transparent), color options, size variants, optional dot indicators, and removable functionality with click events.
40
+
41
+ ### Button Component
42
+
43
+ A versatile button component with support for text labels, icons, loading states, and multiple variants. Features seven size options, two variants (primary/secondary), optional left/right icons, loading spinner, and full customization support.
44
+
45
+ ### Icon Button Component
46
+
47
+ A compact icon-only button component perfect for toolbars and action buttons. Features seven size options, two variants (primary/secondary), and customizable styling.
48
+
49
+ ### Button Group Component
50
+
51
+ A button group component for creating toggleable button sets. Supports single and multiple selection modes, with automatic state management and value change events.
52
+
53
+ ### Spinner Component
54
+
55
+ A loading spinner component for indicating asynchronous operations. Features five size variants, customizable colors, and show/hide control.
56
+
33
57
  _More components coming soon..._
34
58
 
35
59
  ## Installation
36
60
 
37
61
  ```bash
38
- npm i @brickclay-org/ui@0.0.14
62
+ npm i @brickclay-org/ui@0.0.16
39
63
  ```
40
64
 
41
65
  ### Peer Dependencies
@@ -1182,6 +1206,478 @@ The radio button component includes:
1182
1206
 
1183
1207
  Radio buttons are automatically grouped when they share the same `ngModel` binding. Only one radio button in a group can be selected at a time. When a radio button is selected, the previously selected one in the same group is automatically deselected.
1184
1208
 
1209
+ ## 💊 Pill
1210
+
1211
+ A versatile pill component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1212
+
1213
+ ### PillComponent
1214
+
1215
+ A standalone pill component that displays text labels with customizable styling and optional removal functionality.
1216
+
1217
+ #### Basic Example
1218
+
1219
+ ```typescript
1220
+ import { PillComponent } from '@brickclay/ui';
1221
+
1222
+ @Component({
1223
+ template: `
1224
+ <brickclay-pill
1225
+ [label]="'New Feature'"
1226
+ [variant]="'Solid'"
1227
+ [color]="'Primary'"
1228
+ [size]="'md'"
1229
+ (clicked)="onPillRemoved($event)"
1230
+ >
1231
+ </brickclay-pill>
1232
+ `,
1233
+ imports: [PillComponent],
1234
+ })
1235
+ export class MyComponent {
1236
+ onPillRemoved(label: string) {
1237
+ console.log('Pill removed:', label);
1238
+ }
1239
+ }
1240
+ ```
1241
+
1242
+ #### Component Selector
1243
+
1244
+ `<brickclay-pill>`
1245
+
1246
+ #### Inputs
1247
+
1248
+ | Input | Type | Default | Description |
1249
+ | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1250
+ | `label` | `string` | `''` | The text content displayed in the pill |
1251
+ | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1252
+ | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the pill |
1253
+ | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the pill |
1254
+ | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1255
+ | `removable` | `boolean` | `false` | Whether to show a remove button |
1256
+ | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1257
+
1258
+ #### Outputs
1259
+
1260
+ | Output | Type | Description |
1261
+ | -------- | ------------------------ | ----------------------------------------------------- |
1262
+ | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1263
+
1264
+ #### Features
1265
+
1266
+ - ✅ **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1267
+ - ✅ **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1268
+ - ✅ **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1269
+ - ✅ **Dot Indicators** - Optional dot indicator on left or right side
1270
+ - ✅ **Removable** - Optional remove button with click event
1271
+ - ✅ **Custom Styling** - Additional CSS classes for custom appearance
1272
+ - ✅ **Event Handling** - `clicked` event for remove button interactions
1273
+
1274
+ #### Usage Examples
1275
+
1276
+ **Basic Pill:**
1277
+
1278
+ ```typescript
1279
+ import { PillComponent } from '@brickclay/ui';
1280
+
1281
+ @Component({
1282
+ template: `
1283
+ <brickclay-pill [label]="'Status'" [color]="'Success'"> </brickclay-pill>
1284
+ `,
1285
+ imports: [PillComponent],
1286
+ })
1287
+ export class MyComponent {}
1288
+ ```
1289
+
1290
+ **Different Variants:**
1291
+
1292
+ ```typescript
1293
+ <!-- Light variant -->
1294
+ <brickclay-pill
1295
+ [label]="'Light Pill'"
1296
+ [variant]="'Light'"
1297
+ [color]="'Primary'">
1298
+ </brickclay-pill>
1299
+
1300
+ <!-- Solid variant -->
1301
+ <brickclay-pill
1302
+ [label]="'Solid Pill'"
1303
+ [variant]="'Solid'"
1304
+ [color]="'Primary'">
1305
+ </brickclay-pill>
1306
+
1307
+ <!-- Outline variant -->
1308
+ <brickclay-pill
1309
+ [label]="'Outline Pill'"
1310
+ [variant]="'Outline'"
1311
+ [color]="'Primary'">
1312
+ </brickclay-pill>
1313
+
1314
+ <!-- Transparent variant -->
1315
+ <brickclay-pill
1316
+ [label]="'Transparent Pill'"
1317
+ [variant]="'Transparent'"
1318
+ [color]="'Primary'">
1319
+ </brickclay-pill>
1320
+ ```
1321
+
1322
+ **Different Colors:**
1323
+
1324
+ ```typescript
1325
+ <brickclay-pill [label]="'Gray'" [color]="'Gray'"> </brickclay-pill>
1326
+ <brickclay-pill [label]="'Primary'" [color]="'Primary'"> </brickclay-pill>
1327
+ <brickclay-pill [label]="'Error'" [color]="'Error'"> </brickclay-pill>
1328
+ <brickclay-pill [label]="'Warning'" [color]="'Warning'"> </brickclay-pill>
1329
+ <brickclay-pill [label]="'Success'" [color]="'Success'"> </brickclay-pill>
1330
+ <brickclay-pill [label]="'Purple'" [color]="'Purple'"> </brickclay-pill>
1331
+ <brickclay-pill [label]="'Cyan'" [color]="'Cyan'"> </brickclay-pill>
1332
+ ```
1333
+
1334
+ **Different Sizes:**
1335
+
1336
+ ```typescript
1337
+ <!-- Extra Small -->
1338
+ <brickclay-pill [label]="'XSM'" [size]="'xsm'"> </brickclay-pill>
1339
+
1340
+ <!-- Small -->
1341
+ <brickclay-pill [label]="'SM'" [size]="'sm'"> </brickclay-pill>
1342
+
1343
+ <!-- Medium -->
1344
+ <brickclay-pill [label]="'MD'" [size]="'md'"> </brickclay-pill>
1345
+
1346
+ <!-- Large -->
1347
+ <brickclay-pill [label]="'LG'" [size]="'lg'"> </brickclay-pill>
1348
+ ```
1349
+
1350
+ **With Dot Indicators:**
1351
+
1352
+ ```typescript
1353
+ <!-- Dot on left -->
1354
+ <brickclay-pill
1355
+ [label]="'Active'"
1356
+ [dot]="'left'"
1357
+ [color]="'Success'">
1358
+ </brickclay-pill>
1359
+
1360
+ <!-- Dot on right -->
1361
+ <brickclay-pill
1362
+ [label]="'Pending'"
1363
+ [dot]="'right'"
1364
+ [color]="'Warning'">
1365
+ </brickclay-pill>
1366
+ ```
1367
+
1368
+ **Removable Pill:**
1369
+
1370
+ ```typescript
1371
+ @Component({
1372
+ template: `
1373
+ <brickclay-pill
1374
+ [label]="'Removable Tag'"
1375
+ [removable]="true"
1376
+ (clicked)="onRemoveTag($event)">
1377
+ </brickclay-pill>
1378
+ `,
1379
+ })
1380
+ export class MyComponent {
1381
+ onRemoveTag(label: string) {
1382
+ console.log('Removed:', label);
1383
+ // Remove from list, update state, etc.
1384
+ }
1385
+ }
1386
+ ```
1387
+
1388
+ **Dynamic Pill List:**
1389
+
1390
+ ```typescript
1391
+ @Component({
1392
+ template: `
1393
+ <div>
1394
+ <brickclay-pill
1395
+ *ngFor="let tag of tags"
1396
+ [label]="tag"
1397
+ [removable]="true"
1398
+ [color]="getTagColor(tag)"
1399
+ (clicked)="removeTag(tag)">
1400
+ </brickclay-pill>
1401
+ </div>
1402
+ `,
1403
+ })
1404
+ export class MyComponent {
1405
+ tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1406
+
1407
+ removeTag(tag: string) {
1408
+ this.tags = this.tags.filter((t) => t !== tag);
1409
+ }
1410
+
1411
+ getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1412
+ // Custom logic to determine color
1413
+ return 'Primary';
1414
+ }
1415
+ }
1416
+ ```
1417
+
1418
+ **With Custom Classes:**
1419
+
1420
+ ```typescript
1421
+ <brickclay-pill
1422
+ [label]="'Custom Styled'"
1423
+ [customClass]="'my-custom-class font-bold'">
1424
+ </brickclay-pill>
1425
+ ```
1426
+
1427
+ #### Styling
1428
+
1429
+ The pill component supports predefined size classes:
1430
+
1431
+ - **Extra Small**: `xsm`
1432
+ - **Small**: `sm`
1433
+ - **Medium**: `md` - Default
1434
+ - **Large**: `lg`
1435
+
1436
+ The component includes built-in styles for:
1437
+
1438
+ - All variant styles (Light, Solid, Outline, Transparent)
1439
+ - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1440
+ - Dot indicators (left and right positions)
1441
+ - Remove button styling
1442
+ - Hover states
1443
+ - Smooth transitions
1444
+
1445
+ ## 🏷️ Badge
1446
+
1447
+ A flexible badge component for displaying labels, tags, or status indicators. Perfect for categorizing content, showing status, or creating removable tag lists. Supports multiple visual variants, color schemes, sizes, and optional dot indicators.
1448
+
1449
+ ### BadgeComponent
1450
+
1451
+ A standalone badge component that displays text labels with customizable styling and optional removal functionality.
1452
+
1453
+ #### Basic Example
1454
+
1455
+ ```typescript
1456
+ import { BadgeComponent } from '@brickclay/ui';
1457
+
1458
+ @Component({
1459
+ template: `
1460
+ <brickclay-badge
1461
+ [label]="'New'"
1462
+ [variant]="'Solid'"
1463
+ [color]="'Primary'"
1464
+ [size]="'md'"
1465
+ (clicked)="onBadgeRemoved($event)"
1466
+ >
1467
+ </brickclay-badge>
1468
+ `,
1469
+ imports: [BadgeComponent],
1470
+ })
1471
+ export class MyComponent {
1472
+ onBadgeRemoved(label: string) {
1473
+ console.log('Badge removed:', label);
1474
+ }
1475
+ }
1476
+ ```
1477
+
1478
+ #### Component Selector
1479
+
1480
+ `<brickclay-badge>`
1481
+
1482
+ #### Inputs
1483
+
1484
+ | Input | Type | Default | Description |
1485
+ | ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------- |
1486
+ | `label` | `string` | `''` | The text content displayed in the badge |
1487
+ | `variant` | `'Light' \| 'Solid' \| 'Outline' \| 'Transparent'` | `'Light'` | Visual style variant |
1488
+ | `color` | `'Gray' \| 'Primary' \| 'Error' \| 'Warning' \| 'Success' \| 'Purple' \| 'Cyan'` | `'Gray'` | Color scheme for the badge |
1489
+ | `size` | `'xsm' \| 'sm' \| 'md' \| 'lg'` | `'md'` | Size variant of the badge |
1490
+ | `dot` | `'left' \| 'right' \| 'none'` | `'none'` | Position of optional dot indicator (left, right, or none) |
1491
+ | `removable` | `boolean` | `false` | Whether to show a remove button |
1492
+ | `customClass`| `string` | `''` | Additional CSS classes for custom styling |
1493
+
1494
+ #### Outputs
1495
+
1496
+ | Output | Type | Description |
1497
+ | -------- | ------------------------ | ----------------------------------------------------- |
1498
+ | `clicked`| `EventEmitter<string>` | Emitted when the remove button is clicked (returns label) |
1499
+
1500
+ #### Features
1501
+
1502
+ - ✅ **Multiple Variants** - Light, Solid, Outline, and Transparent styles
1503
+ - ✅ **Color Options** - Gray, Primary, Error, Warning, Success, Purple, and Cyan
1504
+ - ✅ **Size Variants** - Extra Small (`xsm`), Small (`sm`), Medium (`md`), Large (`lg`)
1505
+ - ✅ **Dot Indicators** - Optional dot indicator on left or right side
1506
+ - ✅ **Removable** - Optional remove button with click event
1507
+ - ✅ **Custom Styling** - Additional CSS classes for custom appearance
1508
+ - ✅ **Event Handling** - `clicked` event for remove button interactions
1509
+
1510
+ #### Usage Examples
1511
+
1512
+ **Basic Badge:**
1513
+
1514
+ ```typescript
1515
+ import { BadgeComponent } from '@brickclay/ui';
1516
+
1517
+ @Component({
1518
+ template: `
1519
+ <brickclay-badge [label]="'New'" [color]="'Success'"> </brickclay-badge>
1520
+ `,
1521
+ imports: [BadgeComponent],
1522
+ })
1523
+ export class MyComponent {}
1524
+ ```
1525
+
1526
+ **Different Variants:**
1527
+
1528
+ ```typescript
1529
+ <!-- Light variant -->
1530
+ <brickclay-badge
1531
+ [label]="'Light Badge'"
1532
+ [variant]="'Light'"
1533
+ [color]="'Primary'">
1534
+ </brickclay-badge>
1535
+
1536
+ <!-- Solid variant -->
1537
+ <brickclay-badge
1538
+ [label]="'Solid Badge'"
1539
+ [variant]="'Solid'"
1540
+ [color]="'Primary'">
1541
+ </brickclay-badge>
1542
+
1543
+ <!-- Outline variant -->
1544
+ <brickclay-badge
1545
+ [label]="'Outline Badge'"
1546
+ [variant]="'Outline'"
1547
+ [color]="'Primary'">
1548
+ </brickclay-badge>
1549
+
1550
+ <!-- Transparent variant -->
1551
+ <brickclay-badge
1552
+ [label]="'Transparent Badge'"
1553
+ [variant]="'Transparent'"
1554
+ [color]="'Primary'">
1555
+ </brickclay-badge>
1556
+ ```
1557
+
1558
+ **Different Colors:**
1559
+
1560
+ ```typescript
1561
+ <brickclay-badge [label]="'Gray'" [color]="'Gray'"> </brickclay-badge>
1562
+ <brickclay-badge [label]="'Primary'" [color]="'Primary'"> </brickclay-badge>
1563
+ <brickclay-badge [label]="'Error'" [color]="'Error'"> </brickclay-badge>
1564
+ <brickclay-badge [label]="'Warning'" [color]="'Warning'"> </brickclay-badge>
1565
+ <brickclay-badge [label]="'Success'" [color]="'Success'"> </brickclay-badge>
1566
+ <brickclay-badge [label]="'Purple'" [color]="'Purple'"> </brickclay-badge>
1567
+ <brickclay-badge [label]="'Cyan'" [color]="'Cyan'"> </brickclay-badge>
1568
+ ```
1569
+
1570
+ **Different Sizes:**
1571
+
1572
+ ```typescript
1573
+ <!-- Extra Small -->
1574
+ <brickclay-badge [label]="'XSM'" [size]="'xsm'"> </brickclay-badge>
1575
+
1576
+ <!-- Small -->
1577
+ <brickclay-badge [label]="'SM'" [size]="'sm'"> </brickclay-badge>
1578
+
1579
+ <!-- Medium -->
1580
+ <brickclay-badge [label]="'MD'" [size]="'md'"> </brickclay-badge>
1581
+
1582
+ <!-- Large -->
1583
+ <brickclay-badge [label]="'LG'" [size]="'lg'"> </brickclay-badge>
1584
+ ```
1585
+
1586
+ **With Dot Indicators:**
1587
+
1588
+ ```typescript
1589
+ <!-- Dot on left -->
1590
+ <brickclay-badge
1591
+ [label]="'Active'"
1592
+ [dot]="'left'"
1593
+ [color]="'Success'">
1594
+ </brickclay-badge>
1595
+
1596
+ <!-- Dot on right -->
1597
+ <brickclay-badge
1598
+ [label]="'Pending'"
1599
+ [dot]="'right'"
1600
+ [color]="'Warning'">
1601
+ </brickclay-badge>
1602
+ ```
1603
+
1604
+ **Removable Badge:**
1605
+
1606
+ ```typescript
1607
+ @Component({
1608
+ template: `
1609
+ <brickclay-badge
1610
+ [label]="'Removable Tag'"
1611
+ [removable]="true"
1612
+ (clicked)="onRemoveTag($event)">
1613
+ </brickclay-badge>
1614
+ `,
1615
+ })
1616
+ export class MyComponent {
1617
+ onRemoveTag(label: string) {
1618
+ console.log('Removed:', label);
1619
+ // Remove from list, update state, etc.
1620
+ }
1621
+ }
1622
+ ```
1623
+
1624
+ **Dynamic Badge List:**
1625
+
1626
+ ```typescript
1627
+ @Component({
1628
+ template: `
1629
+ <div>
1630
+ <brickclay-badge
1631
+ *ngFor="let tag of tags"
1632
+ [label]="tag"
1633
+ [removable]="true"
1634
+ [color]="getTagColor(tag)"
1635
+ (clicked)="removeTag(tag)">
1636
+ </brickclay-badge>
1637
+ </div>
1638
+ `,
1639
+ })
1640
+ export class MyComponent {
1641
+ tags = ['Angular', 'TypeScript', 'RxJS', 'NgRx'];
1642
+
1643
+ removeTag(tag: string) {
1644
+ this.tags = this.tags.filter((t) => t !== tag);
1645
+ }
1646
+
1647
+ getTagColor(tag: string): 'Primary' | 'Success' | 'Warning' {
1648
+ // Custom logic to determine color
1649
+ return 'Primary';
1650
+ }
1651
+ }
1652
+ ```
1653
+
1654
+ **With Custom Classes:**
1655
+
1656
+ ```typescript
1657
+ <brickclay-badge
1658
+ [label]="'Custom Styled'"
1659
+ [customClass]="'my-custom-class font-bold'">
1660
+ </brickclay-badge>
1661
+ ```
1662
+
1663
+ #### Styling
1664
+
1665
+ The badge component supports predefined size classes:
1666
+
1667
+ - **Extra Small**: `xsm`
1668
+ - **Small**: `sm`
1669
+ - **Medium**: `md` - Default
1670
+ - **Large**: `lg`
1671
+
1672
+ The component includes built-in styles for:
1673
+
1674
+ - All variant styles (Light, Solid, Outline, Transparent)
1675
+ - All color schemes (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1676
+ - Dot indicators (left and right positions)
1677
+ - Remove button styling
1678
+ - Hover states
1679
+ - Smooth transitions
1680
+
1185
1681
  ## 📐 TypeScript Interfaces
1186
1682
 
1187
1683
  ### CalendarRange
@@ -1393,6 +1889,20 @@ For issues, feature requests, or contributions, please visit our [GitHub reposit
1393
1889
  - Disabled state support
1394
1890
  - Full keyboard navigation support
1395
1891
  - Complete accessibility features
1892
+ - ✅ Pill component
1893
+ - Multiple visual variants (Light, Solid, Outline, Transparent)
1894
+ - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1895
+ - Four size variants (xsm, sm, md, lg)
1896
+ - Optional dot indicators (left, right, none)
1897
+ - Removable functionality with click events
1898
+ - Custom CSS class support
1899
+ - ✅ Badge component
1900
+ - Multiple visual variants (Light, Solid, Outline, Transparent)
1901
+ - Seven color options (Gray, Primary, Error, Warning, Success, Purple, Cyan)
1902
+ - Four size variants (xsm, sm, md, lg)
1903
+ - Optional dot indicators (left, right, none)
1904
+ - Removable functionality with click events
1905
+ - Custom CSS class support
1396
1906
  - ✅ TypeScript definitions
1397
1907
  - ✅ Comprehensive documentation
1398
1908