@cobre-npm/ds-v3 0.152.0 → 0.154.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.
@@ -1041,6 +1041,8 @@
1041
1041
  --cobre-checkbox-border: var(--cobre-border-stroke-M) solid var(--cobre-primary-20);
1042
1042
  --cobre-checkbox-icon-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
1043
1043
 
1044
+ --cobre-checkbox-indeterminate-icon-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M6 10h8'/%3e%3c/svg%3e");
1045
+
1044
1046
  --cobre-checkbox-input-checked-bg: var(--cobre-secondary-50);
1045
1047
  --cobre-checkbox-input-checked-hover-bg: var(--cobre-secondary-70);
1046
1048
 
@@ -1091,4 +1093,15 @@
1091
1093
  --cobre-segmented-tabs-active-bg: var(--cobre-secondary-5);
1092
1094
  --cobre-segmented-tabs-active-color: var(--cobre-primary-90);
1093
1095
  --cobre-segmented-tabs-active-border: var(--cobre-border-stroke-M) solid var(--cobre-secondary-50);
1096
+ }
1097
+
1098
+ /**
1099
+ * Filter option groups
1100
+ */
1101
+
1102
+ :root {
1103
+ --cobre-filter-option-groups-section-color: var(--cobre-primary-50);
1104
+ --cobre-filter-option-groups-label-fs: var(--cobre-label-small-fs);
1105
+ --cobre-filter-option-groups-label-lh: var(--cobre-label-small-lh);
1106
+ --cobre-filter-option-groups-label-fw: 500;
1094
1107
  }
@@ -11,6 +11,7 @@ interface Props {
11
11
  id?: string;
12
12
  description?: string;
13
13
  size?: 'sm' | 'md';
14
+ indeterminate?: boolean;
14
15
  }
15
16
  declare var __VLS_1: {};
16
17
  type __VLS_Slots = {} & {
@@ -25,6 +26,7 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
25
26
  }>, {
26
27
  disabled: boolean;
27
28
  size: "sm" | "md";
29
+ indeterminate: boolean;
28
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
31
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
30
32
  export default _default;
@@ -33,10 +33,10 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
33
33
  onClick?: (() => any) | undefined;
34
34
  }>, {
35
35
  isLoading: boolean;
36
+ idPrefix: string;
36
37
  placeholderIcon: string;
37
38
  selectedAccount: CobreSelectableItem | null;
38
39
  chevronIcon: string;
39
- idPrefix: string;
40
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
41
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
42
42
  export default _default;
@@ -2,7 +2,9 @@ import type { CheckboxFilter } from '../interfaces/filter.interface';
2
2
  /**
3
3
  * FilterCheckboxList — the checkbox-group control for CobreFilterPanel: renders
4
4
  * one checkbox per option and emits the updated array of selected values when
5
- * an option is toggled. Options may carry a `logoURL` for an inline icon.
5
+ * an option is toggled. Options may carry a `logoURL` for an inline icon and a
6
+ * `subtitle`; with `sections` they are grouped under non-selectable titles.
7
+ * An `indeterminate` option renders the mixed state and a click checks it.
6
8
  * Rendered internally by CobreFilterPanel for `checkbox` filters.
7
9
  */
8
10
  type __VLS_Props = {
@@ -0,0 +1,27 @@
1
+ import type { FilterOption, FilterSection } from '../interfaces/filter.interface';
2
+ type __VLS_Props = {
3
+ options: FilterOption[];
4
+ sections?: FilterSection[];
5
+ /** Prefix of each option's control id, as `${idPrefix}-${option.value}`. */
6
+ idPrefix: string;
7
+ disabled?: boolean;
8
+ };
9
+ declare var __VLS_1: {
10
+ id: string;
11
+ option: FilterOption;
12
+ label: string;
13
+ description: string | undefined;
14
+ sectioned: boolean;
15
+ disabled: boolean | undefined;
16
+ };
17
+ type __VLS_Slots = {} & {
18
+ option?: (props: typeof __VLS_1) => any;
19
+ };
20
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -2,7 +2,8 @@ import type { RadioFilter } from '../interfaces/filter.interface';
2
2
  /**
3
3
  * FilterRadioList — the single-select radio-group control for CobreFilterPanel:
4
4
  * renders one radio per option and emits the chosen value on selection.
5
- * Options may carry a `logoURL` for an inline icon.
5
+ * Options may carry a `logoURL` for an inline icon and a
6
+ * `subtitle`; with `sections` they are grouped under non-selectable titles.
6
7
  * Rendered internally by CobreFilterPanel for `radio` filters.
7
8
  */
8
9
  type __VLS_Props = {
@@ -7,6 +7,18 @@ export interface FilterOption {
7
7
  /** URL of a logo/icon image shown beside the option. */
8
8
  logoURL?: string;
9
9
  disabled?: boolean;
10
+ section?: string;
11
+ subtitle?: string;
12
+ tab?: string;
13
+ indeterminate?: boolean;
14
+ }
15
+ export interface FilterTab {
16
+ value: string;
17
+ label: string;
18
+ }
19
+ export interface FilterSection {
20
+ value: string;
21
+ label: string;
10
22
  }
11
23
  /** Lower/upper bounds of an amount-range filter; null means unbounded on that end. */
12
24
  export interface AmountRangeValue {
@@ -60,6 +72,8 @@ export interface CommonSearchProps {
60
72
  export interface CheckboxFilter extends BaseFilter<'checkbox'> {
61
73
  value: (string | number)[];
62
74
  options: FilterOption[];
75
+ sections?: FilterSection[];
76
+ tabs?: FilterTab[];
63
77
  props?: CommonDisabledProps & CommonSearchProps;
64
78
  validation?: CommonValidation;
65
79
  }
@@ -67,6 +81,8 @@ export interface CheckboxFilter extends BaseFilter<'checkbox'> {
67
81
  export interface RadioFilter extends BaseFilter<'radio'> {
68
82
  value: string | number | null;
69
83
  options: FilterOption[];
84
+ /** Section headings, in render order. Enables the two-column grouped layout. */
85
+ sections?: FilterSection[];
70
86
  props?: CommonDisabledProps & CommonSearchProps;
71
87
  validation?: CommonValidation;
72
88
  }
@@ -0,0 +1,4 @@
1
+ import type { FilterOption, FilterTab } from '../interfaces/filter.interface';
2
+ export declare const visibleTabs: (options: FilterOption[], tabs: FilterTab[]) => FilterTab[];
3
+ export declare const optionsInTab: (options: FilterOption[], activeTab: string | null) => FilterOption[];
4
+ export declare const initialTab: (options: FilterOption[], tabs: FilterTab[], selected: (string | number)[]) => string | null;
@@ -0,0 +1,6 @@
1
+ import type { FilterOption, FilterSection } from '../interfaces/filter.interface';
2
+ export interface OptionGroup {
3
+ section: FilterSection | null;
4
+ options: FilterOption[];
5
+ }
6
+ export declare const groupOptionsBySection: (options: FilterOption[], sections: FilterSection[]) => OptionGroup[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobre-npm/ds-v3",
3
- "version": "0.152.0",
3
+ "version": "0.154.0",
4
4
  "type": "module",
5
5
  "packageManager": "pnpm@11.0.4",
6
6
  "engines": {