@rivet-health/design-system 40.12.2 → 40.14.0

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.
@@ -2140,6 +2140,7 @@ var RivSelect;
2140
2140
  }
2141
2141
  RivSelect.OptionSet = OptionSet;
2142
2142
  const MIN_OPTIONS_FOR_CONTROLS = 5;
2143
+ const DEFAULT_DISPLAY_LIMIT = 100;
2143
2144
  function createManager(source, options) {
2144
2145
  const defaultState = {
2145
2146
  query: {
@@ -2187,15 +2188,18 @@ var RivSelect;
2187
2188
  const sortedOptionGroups = options?.allowMultiSelect
2188
2189
  ? sortOptionsByPreviouslySelectedState(allOptionGroups, selectionAtOpen)
2189
2190
  : allOptionGroups;
2190
- const displayLimitedOptionGroups = applyDisplayLimit(sortedOptionGroups, options?.displayLimit ?? 100);
2191
+ const displayLimit = options?.displayLimit ?? DEFAULT_DISPLAY_LIMIT;
2192
+ const displayLimitedOptionGroups = applyDisplayLimit(sortedOptionGroups, displayLimit);
2191
2193
  const fullOptionGroups = applySelectedOptionLimit(s, displayLimitedOptionGroups, topLevelOptions, options);
2192
2194
  return {
2193
2195
  ...s,
2194
2196
  query: {
2195
2197
  ...s.query,
2196
- showSearch: !!options?.allowSearch &&
2197
- (!!s.query.search ||
2198
- countAllOptions(allOptionGroups) > MIN_OPTIONS_FOR_CONTROLS),
2198
+ showSearch: !!s.query.search ||
2199
+ (!!options?.allowSearch &&
2200
+ countAllOptions(allOptionGroups) >
2201
+ MIN_OPTIONS_FOR_CONTROLS) ||
2202
+ countAllOptions(allOptionGroups) > displayLimit,
2199
2203
  searchPlaceholder: options?.searchPlaceholder ?? 'Search',
2200
2204
  showOrder: !!options?.allowOrder &&
2201
2205
  !s.query.search &&
@@ -4399,6 +4403,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4399
4403
  DateComponent.isValidDate = isValidDate;
4400
4404
  })(DateComponent || (DateComponent = {}));
4401
4405
 
4406
+ class FilterChipComponent {
4407
+ constructor() {
4408
+ this.selected$ = new BehaviorSubject(false);
4409
+ this.chipClicked = new EventEmitter();
4410
+ }
4411
+ set selected(v) {
4412
+ if (v !== this.selected$.getValue()) {
4413
+ this.selected$.next(v);
4414
+ }
4415
+ }
4416
+ get selected() {
4417
+ return this.selected$.getValue();
4418
+ }
4419
+ get classes() {
4420
+ return Object.entries({
4421
+ selected: this.selected,
4422
+ })
4423
+ .filter(([_, v]) => v)
4424
+ .map(([k]) => k)
4425
+ .join(' ');
4426
+ }
4427
+ onClick(e) {
4428
+ this.chipClicked.emit(!this.selected);
4429
+ }
4430
+ }
4431
+ FilterChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4432
+ FilterChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FilterChipComponent, selector: "riv-filter-chip", inputs: { selected: "selected" }, outputs: { chipClicked: "chipClicked" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class": "this.classes" } }, ngImport: i0, template: "<riv-icon\n *ngIf=\"selected\"\n class=\"checkmark\"\n [name]=\"'Check'\"\n [size]=\"12\"\n></riv-icon>\n<ng-content></ng-content>\n", styles: [":host{--badge-multiplier: 4;display:inline-flex;align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-1);font-weight:var(--font-weight-heavy);white-space:nowrap;border-radius:calc(var(--base-grid-size) * var(--badge-multiplier));min-width:calc(var(--base-grid-size) * var(--badge-multiplier));min-height:calc(var(--base-grid-size) * var(--badge-multiplier));max-width:100%;background-color:var(--badge-background-color);border:var(--border-width) solid var(--border-light-blend);padding:var(--size-xsmall) var(--size-medium)}:host:not(.selected){--badge-background-color: var(--surface-light-0)}:host.selected{--badge-background-color: var(--baloo-05)}.checkmark{padding-right:var(--size-xsmall)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "riv-icon", inputs: ["name", "fillColor", "size", "customSize", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4433
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterChipComponent, decorators: [{
4434
+ type: Component,
4435
+ args: [{ selector: 'riv-filter-chip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<riv-icon\n *ngIf=\"selected\"\n class=\"checkmark\"\n [name]=\"'Check'\"\n [size]=\"12\"\n></riv-icon>\n<ng-content></ng-content>\n", styles: [":host{--badge-multiplier: 4;display:inline-flex;align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-1);font-weight:var(--font-weight-heavy);white-space:nowrap;border-radius:calc(var(--base-grid-size) * var(--badge-multiplier));min-width:calc(var(--base-grid-size) * var(--badge-multiplier));min-height:calc(var(--base-grid-size) * var(--badge-multiplier));max-width:100%;background-color:var(--badge-background-color);border:var(--border-width) solid var(--border-light-blend);padding:var(--size-xsmall) var(--size-medium)}:host:not(.selected){--badge-background-color: var(--surface-light-0)}:host.selected{--badge-background-color: var(--baloo-05)}.checkmark{padding-right:var(--size-xsmall)}\n"] }]
4436
+ }], ctorParameters: function () { return []; }, propDecorators: { selected: [{
4437
+ type: Input
4438
+ }], chipClicked: [{
4439
+ type: Output
4440
+ }], classes: [{
4441
+ type: HostBinding,
4442
+ args: ['class']
4443
+ }], onClick: [{
4444
+ type: HostListener,
4445
+ args: ['click', ['$event']]
4446
+ }] } });
4447
+
4402
4448
  const ZWS = '​';
4403
4449
  const ZWS_REGEX = /​/g;
4404
4450
  /**
@@ -15036,54 +15082,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
15036
15082
  DonutComponent.Sizes = ['xsmall', 'small', 'medium', 'large'];
15037
15083
  })(DonutComponent || (DonutComponent = {}));
15038
15084
 
15039
- class MiniPieComponent {
15040
- constructor() {
15041
- this.value = 0;
15042
- this.size = 'small';
15043
- this.colorToken = '--purp-60';
15044
- }
15045
- get classes() {
15046
- return this.size;
15047
- }
15048
- get clampedValue() {
15049
- return Math.max(0, Math.min(100, this.value));
15050
- }
15051
- get fillColor() {
15052
- return `var(${this.colorToken})`;
15053
- }
15054
- get isFull() {
15055
- return this.clampedValue >= 100;
15056
- }
15057
- get wedgePath() {
15058
- const pct = this.clampedValue / 100;
15059
- if (pct <= 0 || pct >= 1)
15060
- return '';
15061
- const angle = pct * 2 * Math.PI;
15062
- const x = Math.sin(angle) * 8;
15063
- const y = -Math.cos(angle) * 8;
15064
- const largeArc = pct > 0.5 ? 1 : 0;
15065
- return `M 0 0 L 0 -8 A 8 8 0 ${largeArc} 1 ${x} ${y} Z`;
15066
- }
15067
- }
15068
- MiniPieComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MiniPieComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
15069
- MiniPieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MiniPieComponent, selector: "riv-mini-pie", inputs: { value: "value", size: "size", colorToken: "colorToken" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 20 20\">\n <circle cx=\"0\" cy=\"0\" r=\"8\" class=\"track\" />\n <circle *ngIf=\"isFull\" cx=\"0\" cy=\"0\" r=\"8\" [attr.fill]=\"fillColor\" />\n <path\n *ngIf=\"clampedValue > 0 && !isFull\"\n [attr.d]=\"wedgePath\"\n [attr.fill]=\"fillColor\"\n />\n</svg>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}:host.small{width:20px;height:20px}:host.medium{width:24px;height:24px}:host.large{width:32px;height:32px}svg{width:100%;height:100%}.track{fill:var(--border-light)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
15070
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MiniPieComponent, decorators: [{
15071
- type: Component,
15072
- args: [{ selector: 'riv-mini-pie', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 20 20\">\n <circle cx=\"0\" cy=\"0\" r=\"8\" class=\"track\" />\n <circle *ngIf=\"isFull\" cx=\"0\" cy=\"0\" r=\"8\" [attr.fill]=\"fillColor\" />\n <path\n *ngIf=\"clampedValue > 0 && !isFull\"\n [attr.d]=\"wedgePath\"\n [attr.fill]=\"fillColor\"\n />\n</svg>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}:host.small{width:20px;height:20px}:host.medium{width:24px;height:24px}:host.large{width:32px;height:32px}svg{width:100%;height:100%}.track{fill:var(--border-light)}\n"] }]
15073
- }], propDecorators: { value: [{
15074
- type: Input
15075
- }], size: [{
15076
- type: Input
15077
- }], colorToken: [{
15078
- type: Input
15079
- }], classes: [{
15080
- type: HostBinding,
15081
- args: ['class']
15082
- }] } });
15083
- (function (MiniPieComponent) {
15084
- MiniPieComponent.Sizes = ['small', 'medium', 'large'];
15085
- })(MiniPieComponent || (MiniPieComponent = {}));
15086
-
15087
15085
  function aggregateValues(values) {
15088
15086
  return values.map((v, ix) => v + values.slice(ix + 1).reduce((acc, n) => acc + n, 0));
15089
15087
  }
@@ -15278,6 +15276,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
15278
15276
  type: Input
15279
15277
  }] } });
15280
15278
 
15279
+ class MiniPieComponent {
15280
+ constructor() {
15281
+ this.value = 0;
15282
+ this.size = 'small';
15283
+ this.colorToken = '--purp-60';
15284
+ }
15285
+ get classes() {
15286
+ return this.size;
15287
+ }
15288
+ get clampedValue() {
15289
+ return Math.max(0, Math.min(100, this.value));
15290
+ }
15291
+ get fillColor() {
15292
+ return `var(${this.colorToken})`;
15293
+ }
15294
+ get isFull() {
15295
+ return this.clampedValue >= 100;
15296
+ }
15297
+ get wedgePath() {
15298
+ const pct = this.clampedValue / 100;
15299
+ if (pct <= 0 || pct >= 1)
15300
+ return '';
15301
+ const angle = pct * 2 * Math.PI;
15302
+ const x = Math.sin(angle) * 8;
15303
+ const y = -Math.cos(angle) * 8;
15304
+ const largeArc = pct > 0.5 ? 1 : 0;
15305
+ return `M 0 0 L 0 -8 A 8 8 0 ${largeArc} 1 ${x} ${y} Z`;
15306
+ }
15307
+ }
15308
+ MiniPieComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MiniPieComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
15309
+ MiniPieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MiniPieComponent, selector: "riv-mini-pie", inputs: { value: "value", size: "size", colorToken: "colorToken" }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 20 20\">\n <circle cx=\"0\" cy=\"0\" r=\"8\" class=\"track\" />\n <circle *ngIf=\"isFull\" cx=\"0\" cy=\"0\" r=\"8\" [attr.fill]=\"fillColor\" />\n <path\n *ngIf=\"clampedValue > 0 && !isFull\"\n [attr.d]=\"wedgePath\"\n [attr.fill]=\"fillColor\"\n />\n</svg>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}:host.small{width:20px;height:20px}:host.medium{width:24px;height:24px}:host.large{width:32px;height:32px}svg{width:100%;height:100%}.track{fill:var(--border-light)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
15310
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MiniPieComponent, decorators: [{
15311
+ type: Component,
15312
+ args: [{ selector: 'riv-mini-pie', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 20 20\">\n <circle cx=\"0\" cy=\"0\" r=\"8\" class=\"track\" />\n <circle *ngIf=\"isFull\" cx=\"0\" cy=\"0\" r=\"8\" [attr.fill]=\"fillColor\" />\n <path\n *ngIf=\"clampedValue > 0 && !isFull\"\n [attr.d]=\"wedgePath\"\n [attr.fill]=\"fillColor\"\n />\n</svg>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}:host.small{width:20px;height:20px}:host.medium{width:24px;height:24px}:host.large{width:32px;height:32px}svg{width:100%;height:100%}.track{fill:var(--border-light)}\n"] }]
15313
+ }], propDecorators: { value: [{
15314
+ type: Input
15315
+ }], size: [{
15316
+ type: Input
15317
+ }], colorToken: [{
15318
+ type: Input
15319
+ }], classes: [{
15320
+ type: HostBinding,
15321
+ args: ['class']
15322
+ }] } });
15323
+ (function (MiniPieComponent) {
15324
+ MiniPieComponent.Sizes = ['small', 'medium', 'large'];
15325
+ })(MiniPieComponent || (MiniPieComponent = {}));
15326
+
15281
15327
  class ProgressComponent {
15282
15328
  constructor() {
15283
15329
  this.value = 0;
@@ -16478,6 +16524,7 @@ RivModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
16478
16524
  DonutComponent,
16479
16525
  EditableHeadingComponent,
16480
16526
  EditViewComponent,
16527
+ FilterChipComponent,
16481
16528
  FunnelChartComponent,
16482
16529
  HelpComponent,
16483
16530
  HighlightComponent,
@@ -16582,6 +16629,7 @@ RivModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
16582
16629
  DonutComponent,
16583
16630
  EditableHeadingComponent,
16584
16631
  EditViewComponent,
16632
+ FilterChipComponent,
16585
16633
  FunnelChartComponent,
16586
16634
  HelpComponent,
16587
16635
  HighlightComponent,
@@ -16690,6 +16738,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
16690
16738
  DonutComponent,
16691
16739
  EditableHeadingComponent,
16692
16740
  EditViewComponent,
16741
+ FilterChipComponent,
16693
16742
  FunnelChartComponent,
16694
16743
  HelpComponent,
16695
16744
  HighlightComponent,
@@ -16797,6 +16846,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
16797
16846
  DonutComponent,
16798
16847
  EditableHeadingComponent,
16799
16848
  EditViewComponent,
16849
+ FilterChipComponent,
16800
16850
  FunnelChartComponent,
16801
16851
  HelpComponent,
16802
16852
  HighlightComponent,
@@ -16876,5 +16926,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
16876
16926
  * Generated bundle index. Do not edit.
16877
16927
  */
16878
16928
 
16879
- 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, 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, SideSheetComponent, SimpleSelectComponent, SimpleTableCellComponent, SimpleTableComponent, SimpleTableHeaderCellComponent, SimpleTableRowComponent, SizeDirective, SmallCurrencyPipe, SrOnlyComponent, StackedColumnComponent, StackedRowComponent, SwitchCheckboxComponent, TabComponent, TableColumnSettingsComponent, TableColumnSettingsSideSheetComponent, TableComponent, TableCsvExportComponent, TableSearchColumnsComponent, TableSearchComponent, TabsComponent, TextFieldComponent, TextareaFieldComponent, TimeSeriesComponent, ToastActionComponent, ToastComponent, TooltipComponent, TooltipDirective, TrendComponent, TruncateComponent, ValidationMessageComponent, ViewMenuComponent, ViewsComponent, VisibilityDirective, ZeroStateComponent, toSentenceCase };
16929
+ 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, FilterChipComponent, 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, SideSheetComponent, SimpleSelectComponent, SimpleTableCellComponent, SimpleTableComponent, SimpleTableHeaderCellComponent, SimpleTableRowComponent, SizeDirective, SmallCurrencyPipe, SrOnlyComponent, StackedColumnComponent, StackedRowComponent, SwitchCheckboxComponent, TabComponent, TableColumnSettingsComponent, TableColumnSettingsSideSheetComponent, TableComponent, TableCsvExportComponent, TableSearchColumnsComponent, TableSearchComponent, TabsComponent, TextFieldComponent, TextareaFieldComponent, TimeSeriesComponent, ToastActionComponent, ToastComponent, TooltipComponent, TooltipDirective, TrendComponent, TruncateComponent, ValidationMessageComponent, ViewMenuComponent, ViewsComponent, VisibilityDirective, ZeroStateComponent, toSentenceCase };
16880
16930
  //# sourceMappingURL=rivet-health-design-system.mjs.map