@rivet-health/design-system 42.0.4 → 42.1.0-beta.1

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.
@@ -1645,6 +1645,7 @@ const icons = {
1645
1645
  TrendingDown: `<svg data-icon="TrendingDown" aria-label="trending down icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.51-5.511-3.181" /></svg>`,
1646
1646
  TrendingUp: `<svg data-icon="TrendingUp" aria-label="trending up icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941" /></svg>`,
1647
1647
  Type: `<svg data-icon="Type" aria-label="type icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 8V5H19V8" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 20H15" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 5V19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
1648
+ Upload: `<svg data-icon="Upload" aria-label="upload icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5" /></svg>`,
1648
1649
  UploadCloud: `<svg data-icon="UploadCloud" aria-label="upload cloud icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z" /></svg>`,
1649
1650
  User: `<svg data-icon="User" aria-label="user icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" /></svg>`,
1650
1651
  UserCheck: `<svg data-icon="UserCheck" aria-label="user check icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.75 6C13.75 6.99456 13.3549 7.94839 12.6516 8.65165C11.9484 9.35491 10.9946 9.75 10 9.75C9.00544 9.75 8.05161 9.35491 7.34835 8.65165C6.64509 7.94839 6.25 6.99456 6.25 6C6.25 5.00544 6.64509 4.05161 7.34835 3.34835C8.05161 2.64509 9.00544 2.25 10 2.25C10.9946 2.25 11.9484 2.64509 12.6516 3.34835C13.3549 4.05161 13.75 5.00544 13.75 6ZM2.501 20.118C2.53313 18.1504 3.33734 16.2742 4.74018 14.894C6.14302 13.5139 8.03209 12.7405 10 12.7405C11.9679 12.7405 13.857 13.5139 15.2598 14.894C16.6627 16.2742 17.4669 18.1504 17.499 20.118C15.1464 21.1968 12.5881 21.7535 10 21.75C7.324 21.75 4.784 21.166 2.501 20.118Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 10L17.25 12.25L21 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
@@ -6392,6 +6393,503 @@ i0.ɵɵngDeclareClassMetadata({
6392
6393
  }
6393
6394
  ];
6394
6395
  })(DateRangeComponent || (DateRangeComponent = {}));
6396
+ var FileDropDirective = class FileDropDirective {
6397
+ constructor() {
6398
+ this.disabled = false;
6399
+ this.filesDropped = new EventEmitter();
6400
+ this.dragging = false;
6401
+ this.depth = 0;
6402
+ }
6403
+ onDragEnter(event) {
6404
+ if (!carriesFiles(event)) return;
6405
+ event.preventDefault();
6406
+ this.depth++;
6407
+ this.dragging = !this.disabled;
6408
+ }
6409
+ onDragOver(event) {
6410
+ if (!carriesFiles(event) || event.defaultPrevented) return;
6411
+ event.preventDefault();
6412
+ event.dataTransfer.dropEffect = this.disabled ? "none" : "copy";
6413
+ }
6414
+ onDragLeave(event) {
6415
+ if (!carriesFiles(event)) return;
6416
+ this.depth = Math.max(0, this.depth - 1);
6417
+ this.dragging = this.dragging && this.depth > 0;
6418
+ }
6419
+ onDrop(event) {
6420
+ if (!carriesFiles(event)) return;
6421
+ const handledInside = event.defaultPrevented;
6422
+ event.preventDefault();
6423
+ this.depth = 0;
6424
+ this.dragging = false;
6425
+ const files = Array.from(event.dataTransfer.files);
6426
+ if (!handledInside && !this.disabled && files.length) this.filesDropped.emit(files);
6427
+ }
6428
+ static {
6429
+ this.ɵfac = i0.ɵɵngDeclareFactory({
6430
+ minVersion: "12.0.0",
6431
+ version: "22.2.4",
6432
+ ngImport: i0,
6433
+ type: FileDropDirective,
6434
+ deps: [],
6435
+ target: i0.ɵɵFactoryTarget.Directive
6436
+ });
6437
+ }
6438
+ static {
6439
+ this.ɵdir = i0.ɵɵngDeclareDirective({
6440
+ minVersion: "14.0.0",
6441
+ version: "22.2.4",
6442
+ type: FileDropDirective,
6443
+ isStandalone: false,
6444
+ selector: "[rivFileDrop]",
6445
+ inputs: { disabled: "disabled" },
6446
+ outputs: { filesDropped: "filesDropped" },
6447
+ host: {
6448
+ listeners: {
6449
+ "dragenter": "onDragEnter($event)",
6450
+ "dragover": "onDragOver($event)",
6451
+ "dragleave": "onDragLeave($event)",
6452
+ "drop": "onDrop($event)"
6453
+ },
6454
+ properties: { "class.dragging": "this.dragging" }
6455
+ },
6456
+ exportAs: ["rivFileDrop"],
6457
+ ngImport: i0
6458
+ });
6459
+ }
6460
+ };
6461
+ i0.ɵɵngDeclareClassMetadata({
6462
+ minVersion: "12.0.0",
6463
+ version: "22.2.4",
6464
+ ngImport: i0,
6465
+ type: FileDropDirective,
6466
+ decorators: [{
6467
+ type: Directive,
6468
+ args: [{
6469
+ selector: "[rivFileDrop]",
6470
+ exportAs: "rivFileDrop",
6471
+ standalone: false
6472
+ }]
6473
+ }],
6474
+ propDecorators: {
6475
+ disabled: [{ type: Input }],
6476
+ filesDropped: [{ type: Output }],
6477
+ dragging: [{
6478
+ type: HostBinding,
6479
+ args: ["class.dragging"]
6480
+ }],
6481
+ onDragEnter: [{
6482
+ type: HostListener,
6483
+ args: ["dragenter", ["$event"]]
6484
+ }],
6485
+ onDragOver: [{
6486
+ type: HostListener,
6487
+ args: ["dragover", ["$event"]]
6488
+ }],
6489
+ onDragLeave: [{
6490
+ type: HostListener,
6491
+ args: ["dragleave", ["$event"]]
6492
+ }],
6493
+ onDrop: [{
6494
+ type: HostListener,
6495
+ args: ["drop", ["$event"]]
6496
+ }]
6497
+ }
6498
+ });
6499
+ function carriesFiles(event) {
6500
+ return !!event.dataTransfer?.types.includes("Files");
6501
+ }
6502
+ var FilePickerDirective = class FilePickerDirective {
6503
+ constructor(el, renderer) {
6504
+ this.el = el;
6505
+ this.renderer = renderer;
6506
+ this.accept = "";
6507
+ this.multiple = false;
6508
+ this.filesSelected = new EventEmitter();
6509
+ this.input = renderer.createElement("input");
6510
+ renderer.setAttribute(this.input, "type", "file");
6511
+ renderer.setAttribute(this.input, "hidden", "");
6512
+ this.unlisteners = [renderer.listen(this.input, "click", (event) => event.stopPropagation()), renderer.listen(this.input, "change", () => {
6513
+ const files = Array.from(this.input.files ?? []);
6514
+ this.input.value = "";
6515
+ if (files.length) this.filesSelected.emit(files);
6516
+ })];
6517
+ }
6518
+ ngOnInit() {
6519
+ const host = this.el.nativeElement;
6520
+ if (host instanceof HTMLButtonElement && !host.hasAttribute("type")) this.renderer.setAttribute(host, "type", "button");
6521
+ this.renderer.appendChild(host, this.input);
6522
+ }
6523
+ ngOnChanges() {
6524
+ this.input.accept = this.accept;
6525
+ this.input.multiple = this.multiple;
6526
+ }
6527
+ open() {
6528
+ if (this.el.nativeElement.getAttribute("aria-disabled") === "true") return;
6529
+ this.input.click();
6530
+ }
6531
+ ngOnDestroy() {
6532
+ this.unlisteners.forEach((unlisten) => unlisten());
6533
+ this.input.remove();
6534
+ }
6535
+ static {
6536
+ this.ɵfac = i0.ɵɵngDeclareFactory({
6537
+ minVersion: "12.0.0",
6538
+ version: "22.2.4",
6539
+ ngImport: i0,
6540
+ type: FilePickerDirective,
6541
+ deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }],
6542
+ target: i0.ɵɵFactoryTarget.Directive
6543
+ });
6544
+ }
6545
+ static {
6546
+ this.ɵdir = i0.ɵɵngDeclareDirective({
6547
+ minVersion: "14.0.0",
6548
+ version: "22.2.4",
6549
+ type: FilePickerDirective,
6550
+ isStandalone: false,
6551
+ selector: "[rivFilePicker]",
6552
+ inputs: {
6553
+ accept: "accept",
6554
+ multiple: "multiple"
6555
+ },
6556
+ outputs: { filesSelected: "filesSelected" },
6557
+ host: { listeners: { "click": "open()" } },
6558
+ usesOnChanges: true,
6559
+ ngImport: i0
6560
+ });
6561
+ }
6562
+ };
6563
+ i0.ɵɵngDeclareClassMetadata({
6564
+ minVersion: "12.0.0",
6565
+ version: "22.2.4",
6566
+ ngImport: i0,
6567
+ type: FilePickerDirective,
6568
+ decorators: [{
6569
+ type: Directive,
6570
+ args: [{
6571
+ selector: "[rivFilePicker]",
6572
+ standalone: false
6573
+ }]
6574
+ }],
6575
+ ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }],
6576
+ propDecorators: {
6577
+ accept: [{ type: Input }],
6578
+ multiple: [{ type: Input }],
6579
+ filesSelected: [{ type: Output }],
6580
+ open: [{
6581
+ type: HostListener,
6582
+ args: ["click"]
6583
+ }]
6584
+ }
6585
+ });
6586
+ var DropzoneComponent = class DropzoneComponent {
6587
+ constructor() {
6588
+ this.accept = "";
6589
+ this.multiple = false;
6590
+ this.disabled = false;
6591
+ this.size = "large";
6592
+ this.browseLabel = "Browse files";
6593
+ this.filesSelected = new EventEmitter();
6594
+ this.filesRejected = new EventEmitter();
6595
+ }
6596
+ get resolvedPrompt() {
6597
+ return this.prompt ?? (this.multiple ? "Drag and drop files here" : "Drag and drop file here");
6598
+ }
6599
+ add(files) {
6600
+ const results = (this.multiple ? files : files.slice(0, 1)).map((file) => ({
6601
+ file,
6602
+ reason: DropzoneComponent.rejectionFor(file, this.accept, this.maxFileSize)
6603
+ }));
6604
+ const accepted = results.filter((r) => !r.reason).map((r) => r.file);
6605
+ const rejected = results.filter((r) => !!r.reason);
6606
+ if (accepted.length) this.filesSelected.emit(accepted);
6607
+ if (rejected.length) this.filesRejected.emit(rejected);
6608
+ }
6609
+ static {
6610
+ this.ɵfac = i0.ɵɵngDeclareFactory({
6611
+ minVersion: "12.0.0",
6612
+ version: "22.2.4",
6613
+ ngImport: i0,
6614
+ type: DropzoneComponent,
6615
+ deps: [],
6616
+ target: i0.ɵɵFactoryTarget.Component
6617
+ });
6618
+ }
6619
+ static {
6620
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
6621
+ minVersion: "17.0.0",
6622
+ version: "22.2.4",
6623
+ type: DropzoneComponent,
6624
+ isStandalone: false,
6625
+ selector: "riv-dropzone",
6626
+ inputs: {
6627
+ accept: "accept",
6628
+ multiple: "multiple",
6629
+ maxFileSize: "maxFileSize",
6630
+ disabled: "disabled",
6631
+ size: "size",
6632
+ prompt: "prompt",
6633
+ browseLabel: "browseLabel",
6634
+ instructions: "instructions"
6635
+ },
6636
+ outputs: {
6637
+ filesSelected: "filesSelected",
6638
+ filesRejected: "filesRejected"
6639
+ },
6640
+ host: { properties: { "class": "this.size" } },
6641
+ ngImport: i0,
6642
+ template: "<div\n class=\"zone\"\n rivFileDrop\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (filesDropped)=\"add($event)\"\n>\n @if (size === 'large') {\n <div class=\"intro\">\n @if (instructions) {\n <p class=\"instructions\">{{ instructions }}</p>\n }\n <span class=\"badge\">\n <!-- The design's 40px arrow, with a 1.5px stroke. -->\n <riv-icon\n [name]=\"'Upload'\"\n [customSize]=\"53\"\n [strokeWidth]=\"0.68\"\n ></riv-icon>\n </span>\n </div>\n <div class=\"action\">\n <p class=\"prompt\">\n <span>{{ resolvedPrompt }}</span>\n <span>-or-</span>\n </p>\n <ng-container *ngTemplateOutlet=\"browse\"></ng-container>\n </div>\n } @else {\n <riv-icon class=\"small-icon\" [name]=\"'Upload'\" [size]=\"20\"></riv-icon>\n <p class=\"prompt\">{{ resolvedPrompt }}</p>\n <p class=\"prompt\">or</p>\n <ng-container *ngTemplateOutlet=\"browse\"></ng-container>\n @if (instructions) {\n <p class=\"instructions\">{{ instructions }}</p>\n }\n }\n</div>\n\n<ng-template #browse>\n <button\n rivButton\n rivFilePicker\n type=\"button\"\n [variant]=\"'basic'\"\n [size]=\"'xsmall'\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n (filesSelected)=\"add($event)\"\n >\n {{ browseLabel }}\n </button>\n</ng-template>\n",
6643
+ styles: [":host{display:block}.zone{display:flex;flex-direction:column;align-items:center;gap:var(--size-xlarge);padding:var(--size-xlarge) var(--size-large);border:var(--border-width) dashed var(--gray-60);border-radius:var(--border-radius-large);background-color:var(--surface-light-0);color:var(--type-light-high-contrast);text-align:center;transition:background-color var(--short-transition),border-color var(--short-transition)}.zone.dragging{border-color:var(--brand);background-color:var(--purp-10)}.zone.disabled{border-color:var(--border-light);color:var(--type-light-disabled)}p{margin:0}.intro{display:flex;flex-direction:column;align-items:center;gap:var(--size-large)}.action{display:flex;flex-direction:column;align-items:center;gap:var(--size-small)}.instructions{font:var(--body-medium)}.badge{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--base-grid-size) * 22.5);height:calc(var(--base-grid-size) * 22.5);border-radius:50%;background-color:var(--purp-10);color:var(--gray-70)}.prompt{display:flex;flex-direction:column;font:var(--title-03)}:host(.small) .zone{flex-flow:row wrap;justify-content:center;gap:var(--size-small);padding:var(--size-medium) var(--size-large)}:host(.small) .small-icon{color:var(--gray-70)}:host(.small) .prompt{font:var(--body-medium)}:host(.small) .instructions{flex-basis:100%;color:var(--type-light-low-contrast);font:var(--body-small)}\n"],
6644
+ dependencies: [
6645
+ {
6646
+ kind: "directive",
6647
+ type: i1.NgTemplateOutlet,
6648
+ selector: "[ngTemplateOutlet]",
6649
+ inputs: [
6650
+ "ngTemplateOutletContext",
6651
+ "ngTemplateOutlet",
6652
+ "ngTemplateOutletInjector"
6653
+ ]
6654
+ },
6655
+ {
6656
+ kind: "component",
6657
+ type: ButtonComponent,
6658
+ selector: "[rivButton]",
6659
+ inputs: [
6660
+ "locked",
6661
+ "disabled",
6662
+ "loading",
6663
+ "full",
6664
+ "size",
6665
+ "variant",
6666
+ "icon",
6667
+ "iconPosition",
6668
+ "current"
6669
+ ]
6670
+ },
6671
+ {
6672
+ kind: "directive",
6673
+ type: FileDropDirective,
6674
+ selector: "[rivFileDrop]",
6675
+ inputs: ["disabled"],
6676
+ outputs: ["filesDropped"],
6677
+ exportAs: ["rivFileDrop"]
6678
+ },
6679
+ {
6680
+ kind: "directive",
6681
+ type: FilePickerDirective,
6682
+ selector: "[rivFilePicker]",
6683
+ inputs: ["accept", "multiple"],
6684
+ outputs: ["filesSelected"]
6685
+ },
6686
+ {
6687
+ kind: "component",
6688
+ type: IconComponent,
6689
+ selector: "riv-icon",
6690
+ inputs: [
6691
+ "name",
6692
+ "fillColor",
6693
+ "size",
6694
+ "customSize",
6695
+ "strokeWidth"
6696
+ ]
6697
+ }
6698
+ ],
6699
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
6700
+ });
6701
+ }
6702
+ };
6703
+ i0.ɵɵngDeclareClassMetadata({
6704
+ minVersion: "12.0.0",
6705
+ version: "22.2.4",
6706
+ ngImport: i0,
6707
+ type: DropzoneComponent,
6708
+ decorators: [{
6709
+ type: Component,
6710
+ args: [{
6711
+ selector: "riv-dropzone",
6712
+ changeDetection: ChangeDetectionStrategy.OnPush,
6713
+ standalone: false,
6714
+ template: "<div\n class=\"zone\"\n rivFileDrop\n [class.disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (filesDropped)=\"add($event)\"\n>\n @if (size === 'large') {\n <div class=\"intro\">\n @if (instructions) {\n <p class=\"instructions\">{{ instructions }}</p>\n }\n <span class=\"badge\">\n <!-- The design's 40px arrow, with a 1.5px stroke. -->\n <riv-icon\n [name]=\"'Upload'\"\n [customSize]=\"53\"\n [strokeWidth]=\"0.68\"\n ></riv-icon>\n </span>\n </div>\n <div class=\"action\">\n <p class=\"prompt\">\n <span>{{ resolvedPrompt }}</span>\n <span>-or-</span>\n </p>\n <ng-container *ngTemplateOutlet=\"browse\"></ng-container>\n </div>\n } @else {\n <riv-icon class=\"small-icon\" [name]=\"'Upload'\" [size]=\"20\"></riv-icon>\n <p class=\"prompt\">{{ resolvedPrompt }}</p>\n <p class=\"prompt\">or</p>\n <ng-container *ngTemplateOutlet=\"browse\"></ng-container>\n @if (instructions) {\n <p class=\"instructions\">{{ instructions }}</p>\n }\n }\n</div>\n\n<ng-template #browse>\n <button\n rivButton\n rivFilePicker\n type=\"button\"\n [variant]=\"'basic'\"\n [size]=\"'xsmall'\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\"\n (filesSelected)=\"add($event)\"\n >\n {{ browseLabel }}\n </button>\n</ng-template>\n",
6715
+ styles: [":host{display:block}.zone{display:flex;flex-direction:column;align-items:center;gap:var(--size-xlarge);padding:var(--size-xlarge) var(--size-large);border:var(--border-width) dashed var(--gray-60);border-radius:var(--border-radius-large);background-color:var(--surface-light-0);color:var(--type-light-high-contrast);text-align:center;transition:background-color var(--short-transition),border-color var(--short-transition)}.zone.dragging{border-color:var(--brand);background-color:var(--purp-10)}.zone.disabled{border-color:var(--border-light);color:var(--type-light-disabled)}p{margin:0}.intro{display:flex;flex-direction:column;align-items:center;gap:var(--size-large)}.action{display:flex;flex-direction:column;align-items:center;gap:var(--size-small)}.instructions{font:var(--body-medium)}.badge{display:inline-flex;align-items:center;justify-content:center;width:calc(var(--base-grid-size) * 22.5);height:calc(var(--base-grid-size) * 22.5);border-radius:50%;background-color:var(--purp-10);color:var(--gray-70)}.prompt{display:flex;flex-direction:column;font:var(--title-03)}:host(.small) .zone{flex-flow:row wrap;justify-content:center;gap:var(--size-small);padding:var(--size-medium) var(--size-large)}:host(.small) .small-icon{color:var(--gray-70)}:host(.small) .prompt{font:var(--body-medium)}:host(.small) .instructions{flex-basis:100%;color:var(--type-light-low-contrast);font:var(--body-small)}\n"]
6716
+ }]
6717
+ }],
6718
+ propDecorators: {
6719
+ accept: [{ type: Input }],
6720
+ multiple: [{ type: Input }],
6721
+ maxFileSize: [{ type: Input }],
6722
+ disabled: [{ type: Input }],
6723
+ size: [{ type: Input }, {
6724
+ type: HostBinding,
6725
+ args: ["class"]
6726
+ }],
6727
+ prompt: [{ type: Input }],
6728
+ browseLabel: [{ type: Input }],
6729
+ instructions: [{ type: Input }],
6730
+ filesSelected: [{ type: Output }],
6731
+ filesRejected: [{ type: Output }]
6732
+ }
6733
+ });
6734
+ (function(DropzoneComponent) {
6735
+ DropzoneComponent.Sizes = ["large", "small"];
6736
+ DropzoneComponent.RejectionReasons = ["format", "size"];
6737
+ function rejectionFor(file, accept, maxFileSize) {
6738
+ if (!accepts(file, accept)) return "format";
6739
+ if (maxFileSize !== void 0 && file.size > maxFileSize) return "size";
6740
+ return null;
6741
+ }
6742
+ DropzoneComponent.rejectionFor = rejectionFor;
6743
+ function accepts(file, accept) {
6744
+ const tokens = accept.split(",").map((token) => token.trim().toLowerCase()).filter(Boolean);
6745
+ const name = file.name.toLowerCase();
6746
+ const type = file.type.toLowerCase();
6747
+ return !tokens.length || tokens.some((token) => {
6748
+ if (token === "*" || token === "*/*") return true;
6749
+ if (token.endsWith("/*")) return type.startsWith(token.slice(0, -1));
6750
+ if (token.includes("/")) return type === token;
6751
+ return name.endsWith(token);
6752
+ });
6753
+ }
6754
+ DropzoneComponent.accepts = accepts;
6755
+ })(DropzoneComponent || (DropzoneComponent = {}));
6756
+ var FileItemComponent = class FileItemComponent {
6757
+ constructor() {
6758
+ this.name = "";
6759
+ this.status = "idle";
6760
+ this.variant = "detailed";
6761
+ this.removable = true;
6762
+ this.disabled = false;
6763
+ this.remove = new EventEmitter();
6764
+ }
6765
+ get classes() {
6766
+ return `${this.variant} status-${this.status}`;
6767
+ }
6768
+ get resolvedIcon() {
6769
+ return this.icon ?? (this.variant === "compact" ? "Paperclip" : "FileText");
6770
+ }
6771
+ get meta() {
6772
+ if (this.status === "error" && this.error) return this.error;
6773
+ if (this.variant === "compact") return "";
6774
+ return [this.size === void 0 ? void 0 : FileItemComponent.formatSize(this.size), this.detail].filter(Boolean).join(", ");
6775
+ }
6776
+ static {
6777
+ this.ɵfac = i0.ɵɵngDeclareFactory({
6778
+ minVersion: "12.0.0",
6779
+ version: "22.2.4",
6780
+ ngImport: i0,
6781
+ type: FileItemComponent,
6782
+ deps: [],
6783
+ target: i0.ɵɵFactoryTarget.Component
6784
+ });
6785
+ }
6786
+ static {
6787
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
6788
+ minVersion: "17.0.0",
6789
+ version: "22.2.4",
6790
+ type: FileItemComponent,
6791
+ isStandalone: false,
6792
+ selector: "riv-file-item",
6793
+ inputs: {
6794
+ name: "name",
6795
+ size: "size",
6796
+ detail: "detail",
6797
+ status: "status",
6798
+ error: "error",
6799
+ variant: "variant",
6800
+ icon: "icon",
6801
+ removable: "removable",
6802
+ disabled: "disabled"
6803
+ },
6804
+ outputs: { remove: "remove" },
6805
+ host: { properties: { "class": "this.classes" } },
6806
+ ngImport: i0,
6807
+ template: "<riv-icon\n class=\"file-icon\"\n [name]=\"resolvedIcon\"\n [customSize]=\"variant === 'compact' ? 16 : 36\"\n></riv-icon>\n<div class=\"text\">\n <span class=\"name\" [attr.title]=\"name\">{{ name }}</span>\n <!-- Rendered even when empty: screen readers skip text inserted together\n with its live region. -->\n <span class=\"meta-line\" aria-live=\"polite\" [class.empty]=\"!meta\">\n @if (meta) {\n @if (status === 'error' && error) {\n <riv-icon\n class=\"meta-icon\"\n [name]=\"'AlertCircle'\"\n [size]=\"16\"\n ></riv-icon>\n }\n <span class=\"meta\">{{ meta }}</span>\n }\n </span>\n</div>\n@if (variant === 'detailed') {\n @switch (status) {\n @case ('loading') {\n <span\n class=\"progress\"\n role=\"progressbar\"\n [attr.aria-label]=\"'Loading ' + name\"\n >\n <span class=\"progress-fill\"></span>\n </span>\n }\n @case ('success') {\n <riv-icon class=\"status-icon\" [name]=\"'Check'\" [size]=\"24\"></riv-icon>\n }\n }\n}\n@if (removable) {\n <button\n rivButton\n type=\"button\"\n class=\"remove\"\n [variant]=\"'ghost'\"\n [size]=\"'small'\"\n [icon]=\"'X'\"\n [loading]=\"variant === 'compact' && status === 'loading'\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"'Remove ' + name\"\n (click)=\"remove.emit()\"\n ></button>\n}\n",
6808
+ styles: [":host{display:flex;align-items:center;gap:var(--size-small);min-width:0;color:var(--type-light-high-contrast)}:host(.detailed){padding:var(--size-small) var(--size-large) var(--size-small) var(--size-medium);border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-medium);background-color:var(--surface-light-0)}:host(.compact){padding-left:var(--size-small);border-radius:var(--border-radius-medium);background-color:var(--surface-light-1);font:var(--body-small)}.file-icon,.status-icon,.progress,.remove{flex:0 0 auto}.text{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.detailed) .name{font:var(--input-medium)}.meta-line{display:flex;align-items:center;gap:var(--size-xxsmall);padding-top:var(--size-xsmall)}.meta-line.empty{padding-top:0}.meta{color:var(--type-light-low-contrast);font:var(--overline)}.meta-icon{flex:0 0 auto}.progress{position:relative;box-sizing:border-box;width:calc(var(--base-grid-size) * 53);height:calc(var(--base-grid-size) * 2);overflow:hidden;border:var(--border-width) solid var(--border-light);border-radius:var(--base-grid-size);background-color:var(--surface-light-0)}.progress-fill{position:absolute;inset:var(--border-width) auto;width:40%;border-radius:inherit;background-color:var(--brand);animation:progress-sweep 1.4s ease-in-out infinite}@keyframes progress-sweep{0%{transform:translate(-100%)}to{transform:translate(250%)}}@media(prefers-reduced-motion:reduce){.progress-fill{left:30%;animation:none}}:host(.status-success) .file-icon,:host(.status-success) .status-icon{color:var(--baja-blast-70)}:host(.status-error) .file-icon,:host(.status-error) .meta-icon,:host(.status-error) .meta{color:var(--danger-main)}\n"],
6809
+ dependencies: [{
6810
+ kind: "component",
6811
+ type: ButtonComponent,
6812
+ selector: "[rivButton]",
6813
+ inputs: [
6814
+ "locked",
6815
+ "disabled",
6816
+ "loading",
6817
+ "full",
6818
+ "size",
6819
+ "variant",
6820
+ "icon",
6821
+ "iconPosition",
6822
+ "current"
6823
+ ]
6824
+ }, {
6825
+ kind: "component",
6826
+ type: IconComponent,
6827
+ selector: "riv-icon",
6828
+ inputs: [
6829
+ "name",
6830
+ "fillColor",
6831
+ "size",
6832
+ "customSize",
6833
+ "strokeWidth"
6834
+ ]
6835
+ }],
6836
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
6837
+ });
6838
+ }
6839
+ };
6840
+ i0.ɵɵngDeclareClassMetadata({
6841
+ minVersion: "12.0.0",
6842
+ version: "22.2.4",
6843
+ ngImport: i0,
6844
+ type: FileItemComponent,
6845
+ decorators: [{
6846
+ type: Component,
6847
+ args: [{
6848
+ selector: "riv-file-item",
6849
+ changeDetection: ChangeDetectionStrategy.OnPush,
6850
+ standalone: false,
6851
+ template: "<riv-icon\n class=\"file-icon\"\n [name]=\"resolvedIcon\"\n [customSize]=\"variant === 'compact' ? 16 : 36\"\n></riv-icon>\n<div class=\"text\">\n <span class=\"name\" [attr.title]=\"name\">{{ name }}</span>\n <!-- Rendered even when empty: screen readers skip text inserted together\n with its live region. -->\n <span class=\"meta-line\" aria-live=\"polite\" [class.empty]=\"!meta\">\n @if (meta) {\n @if (status === 'error' && error) {\n <riv-icon\n class=\"meta-icon\"\n [name]=\"'AlertCircle'\"\n [size]=\"16\"\n ></riv-icon>\n }\n <span class=\"meta\">{{ meta }}</span>\n }\n </span>\n</div>\n@if (variant === 'detailed') {\n @switch (status) {\n @case ('loading') {\n <span\n class=\"progress\"\n role=\"progressbar\"\n [attr.aria-label]=\"'Loading ' + name\"\n >\n <span class=\"progress-fill\"></span>\n </span>\n }\n @case ('success') {\n <riv-icon class=\"status-icon\" [name]=\"'Check'\" [size]=\"24\"></riv-icon>\n }\n }\n}\n@if (removable) {\n <button\n rivButton\n type=\"button\"\n class=\"remove\"\n [variant]=\"'ghost'\"\n [size]=\"'small'\"\n [icon]=\"'X'\"\n [loading]=\"variant === 'compact' && status === 'loading'\"\n [disabled]=\"disabled\"\n [attr.aria-label]=\"'Remove ' + name\"\n (click)=\"remove.emit()\"\n ></button>\n}\n",
6852
+ styles: [":host{display:flex;align-items:center;gap:var(--size-small);min-width:0;color:var(--type-light-high-contrast)}:host(.detailed){padding:var(--size-small) var(--size-large) var(--size-small) var(--size-medium);border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-medium);background-color:var(--surface-light-0)}:host(.compact){padding-left:var(--size-small);border-radius:var(--border-radius-medium);background-color:var(--surface-light-1);font:var(--body-small)}.file-icon,.status-icon,.progress,.remove{flex:0 0 auto}.text{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.detailed) .name{font:var(--input-medium)}.meta-line{display:flex;align-items:center;gap:var(--size-xxsmall);padding-top:var(--size-xsmall)}.meta-line.empty{padding-top:0}.meta{color:var(--type-light-low-contrast);font:var(--overline)}.meta-icon{flex:0 0 auto}.progress{position:relative;box-sizing:border-box;width:calc(var(--base-grid-size) * 53);height:calc(var(--base-grid-size) * 2);overflow:hidden;border:var(--border-width) solid var(--border-light);border-radius:var(--base-grid-size);background-color:var(--surface-light-0)}.progress-fill{position:absolute;inset:var(--border-width) auto;width:40%;border-radius:inherit;background-color:var(--brand);animation:progress-sweep 1.4s ease-in-out infinite}@keyframes progress-sweep{0%{transform:translate(-100%)}to{transform:translate(250%)}}@media(prefers-reduced-motion:reduce){.progress-fill{left:30%;animation:none}}:host(.status-success) .file-icon,:host(.status-success) .status-icon{color:var(--baja-blast-70)}:host(.status-error) .file-icon,:host(.status-error) .meta-icon,:host(.status-error) .meta{color:var(--danger-main)}\n"]
6853
+ }]
6854
+ }],
6855
+ propDecorators: {
6856
+ name: [{ type: Input }],
6857
+ size: [{ type: Input }],
6858
+ detail: [{ type: Input }],
6859
+ status: [{ type: Input }],
6860
+ error: [{ type: Input }],
6861
+ variant: [{ type: Input }],
6862
+ icon: [{ type: Input }],
6863
+ removable: [{ type: Input }],
6864
+ disabled: [{ type: Input }],
6865
+ remove: [{ type: Output }],
6866
+ classes: [{
6867
+ type: HostBinding,
6868
+ args: ["class"]
6869
+ }]
6870
+ }
6871
+ });
6872
+ (function(FileItemComponent) {
6873
+ FileItemComponent.Statuses = [
6874
+ "idle",
6875
+ "loading",
6876
+ "success",
6877
+ "error"
6878
+ ];
6879
+ FileItemComponent.Variants = ["detailed", "compact"];
6880
+ const units = [
6881
+ "B",
6882
+ "KB",
6883
+ "MB",
6884
+ "GB",
6885
+ "TB"
6886
+ ];
6887
+ function formatSize(bytes) {
6888
+ const exponent = bytes < 1 ? 0 : Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
6889
+ return `${Math.round(bytes / 1024 ** exponent)} ${units[exponent]}`;
6890
+ }
6891
+ FileItemComponent.formatSize = formatSize;
6892
+ })(FileItemComponent || (FileItemComponent = {}));
6395
6893
  var FilterChipComponent = class FilterChipComponent {
6396
6894
  constructor() {
6397
6895
  this.selected$ = new BehaviorSubject(false);
@@ -22315,9 +22813,13 @@ var RivModule = class RivModule {
22315
22813
  DialogComponent,
22316
22814
  DollarsPipe,
22317
22815
  DonutComponent,
22816
+ DropzoneComponent,
22318
22817
  EditableHeadingComponent,
22319
22818
  EditViewComponent,
22320
22819
  ErrorPageComponent,
22820
+ FileDropDirective,
22821
+ FileItemComponent,
22822
+ FilePickerDirective,
22321
22823
  FilterChipComponent,
22322
22824
  FilterDropdownComponent,
22323
22825
  FormDialogComponent,
@@ -22432,9 +22934,13 @@ var RivModule = class RivModule {
22432
22934
  DialogComponent,
22433
22935
  DollarsPipe,
22434
22936
  DonutComponent,
22937
+ DropzoneComponent,
22435
22938
  EditableHeadingComponent,
22436
22939
  EditViewComponent,
22437
22940
  ErrorPageComponent,
22941
+ FileDropDirective,
22942
+ FileItemComponent,
22943
+ FilePickerDirective,
22438
22944
  FilterChipComponent,
22439
22945
  FilterDropdownComponent,
22440
22946
  FormDialogComponent,
@@ -22566,9 +23072,13 @@ i0.ɵɵngDeclareClassMetadata({
22566
23072
  DialogComponent,
22567
23073
  DollarsPipe,
22568
23074
  DonutComponent,
23075
+ DropzoneComponent,
22569
23076
  EditableHeadingComponent,
22570
23077
  EditViewComponent,
22571
23078
  ErrorPageComponent,
23079
+ FileDropDirective,
23080
+ FileItemComponent,
23081
+ FilePickerDirective,
22572
23082
  FilterChipComponent,
22573
23083
  FilterDropdownComponent,
22574
23084
  FormDialogComponent,
@@ -22682,9 +23192,13 @@ i0.ɵɵngDeclareClassMetadata({
22682
23192
  DialogComponent,
22683
23193
  DollarsPipe,
22684
23194
  DonutComponent,
23195
+ DropzoneComponent,
22685
23196
  EditableHeadingComponent,
22686
23197
  EditViewComponent,
22687
23198
  ErrorPageComponent,
23199
+ FileDropDirective,
23200
+ FileItemComponent,
23201
+ FilePickerDirective,
22688
23202
  FilterChipComponent,
22689
23203
  FilterDropdownComponent,
22690
23204
  FormDialogComponent,
@@ -22768,6 +23282,6 @@ i0.ɵɵngDeclareClassMetadata({
22768
23282
  }]
22769
23283
  }]
22770
23284
  });
22771
- export { ANIMATION_CONSTANTS, AllViewsModalComponent, AlphabeticFieldComponent, AutoFocusDirective, BadgeComponent, BannerActionComponent, BannerComponent, ButtonComponent, ButtonGroupComponent, CalloutComponent, CardActionsComponent, CardCheckboxComponent, CardComponent, CardContentComponent, CardHeaderComponent, CardLinkComponent, CardMediaComponent, Chart, ChartComponent, CheckboxComponent, CurrencyFieldComponent, DataTableCellComponent, DataTableComponent, DataTableHeaderCellComponent, DataTableRowComponent, DateComponent, DatePipe, DateRangeComponent, DaysPipe, DialogComponent, DollarsPipe, DonutComponent, DownloadService, EditViewComponent, EditableHeadingComponent, ErrorPageComponent, FilterChipComponent, FilterDropdownComponent, FormDialogComponent, FunnelChartComponent, HelpComponent, HighlightComponent, IconComponent, InputLabelComponent, IssueComponent, LegendItemComponent, LinkComponent, LoadingComponent, LoadingCoverComponent, LockedTooltipDirective, MapIndicatorComponent, MentionsInputComponent, MenuComponent, MenuItemComponent, MetricComponent, MiniPieComponent, ModalComponent, NotificationBadgeComponent, NumberFieldComponent, NumberPipe, OptionGroupPipe, OverlayDirective, OverlayOutletComponent, PageHeaderComponent, PercentageFieldComponent, PercentagePipe, PermissionPickerComponent, PhoneFieldComponent, ProgressComponent, RadioComponent, RivModule, RivSelect, RivTable, RivViews, SVGTextTruncateDirective, SearchComponent, SearchSelectComponent, SelectComponent, SelectNodeComponent, SentenceCasePipe, SettingRowComponent, SideSheetComponent, SimpleSelectComponent, SimpleTabComponent, SimpleTableCellComponent, SimpleTableComponent, SimpleTableHeaderCellComponent, SimpleTableRowComponent, SimpleTabsComponent, SizeDirective, SmallCurrencyPipe, SmallNumberPipe, SrOnlyComponent, StackedColumnComponent, StackedRowComponent, SwitchCheckboxComponent, TabComponent, TableCollapseAllComponent, TableColumnSettingsComponent, TableColumnSettingsSideSheetComponent, TableComponent, TableCsvExportComponent, TableSearchColumnsComponent, TableSearchComponent, TabsComponent, TextFieldComponent, TextareaFieldComponent, TimeSeriesComponent, ToastActionComponent, ToastComponent, TooltipComponent, TooltipDirective, TrendComponent, TruncateComponent, ValidationMessageComponent, ViewMenuComponent, ViewsComponent, VisibilityDirective, ZeroStateComponent, toSentenceCase };
23285
+ export { ANIMATION_CONSTANTS, AllViewsModalComponent, AlphabeticFieldComponent, AutoFocusDirective, BadgeComponent, BannerActionComponent, BannerComponent, ButtonComponent, ButtonGroupComponent, CalloutComponent, CardActionsComponent, CardCheckboxComponent, CardComponent, CardContentComponent, CardHeaderComponent, CardLinkComponent, CardMediaComponent, Chart, ChartComponent, CheckboxComponent, CurrencyFieldComponent, DataTableCellComponent, DataTableComponent, DataTableHeaderCellComponent, DataTableRowComponent, DateComponent, DatePipe, DateRangeComponent, DaysPipe, DialogComponent, DollarsPipe, DonutComponent, DownloadService, DropzoneComponent, EditViewComponent, EditableHeadingComponent, ErrorPageComponent, FileDropDirective, FileItemComponent, FilePickerDirective, FilterChipComponent, FilterDropdownComponent, FormDialogComponent, FunnelChartComponent, HelpComponent, HighlightComponent, IconComponent, InputLabelComponent, IssueComponent, LegendItemComponent, LinkComponent, LoadingComponent, LoadingCoverComponent, LockedTooltipDirective, MapIndicatorComponent, MentionsInputComponent, MenuComponent, MenuItemComponent, MetricComponent, MiniPieComponent, ModalComponent, NotificationBadgeComponent, NumberFieldComponent, NumberPipe, OptionGroupPipe, OverlayDirective, OverlayOutletComponent, PageHeaderComponent, PercentageFieldComponent, PercentagePipe, PermissionPickerComponent, PhoneFieldComponent, ProgressComponent, RadioComponent, RivModule, RivSelect, RivTable, RivViews, SVGTextTruncateDirective, SearchComponent, SearchSelectComponent, SelectComponent, SelectNodeComponent, SentenceCasePipe, SettingRowComponent, SideSheetComponent, SimpleSelectComponent, SimpleTabComponent, SimpleTableCellComponent, SimpleTableComponent, SimpleTableHeaderCellComponent, SimpleTableRowComponent, SimpleTabsComponent, SizeDirective, SmallCurrencyPipe, SmallNumberPipe, SrOnlyComponent, StackedColumnComponent, StackedRowComponent, SwitchCheckboxComponent, TabComponent, TableCollapseAllComponent, TableColumnSettingsComponent, TableColumnSettingsSideSheetComponent, TableComponent, TableCsvExportComponent, TableSearchColumnsComponent, TableSearchComponent, TabsComponent, TextFieldComponent, TextareaFieldComponent, TimeSeriesComponent, ToastActionComponent, ToastComponent, TooltipComponent, TooltipDirective, TrendComponent, TruncateComponent, ValidationMessageComponent, ViewMenuComponent, ViewsComponent, VisibilityDirective, ZeroStateComponent, toSentenceCase };
22772
23286
 
22773
23287
  //# sourceMappingURL=rivet-health-design-system.mjs.map