@osdk/react-components 0.2.0-beta.26 → 0.2.0-beta.28

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +58 -3
  3. package/build/browser/base-components/checkbox/Checkbox.js +6 -2
  4. package/build/browser/base-components/checkbox/Checkbox.js.map +1 -1
  5. package/build/browser/base-components/checkbox/Checkbox.module.css +7 -2
  6. package/build/browser/filter-list/FilterListApi.js.map +1 -1
  7. package/build/browser/filter-list/FilterListItemApi.js.map +1 -1
  8. package/build/browser/filter-list/base/ExcludeDropdown.js +4 -3
  9. package/build/browser/filter-list/base/ExcludeDropdown.js.map +1 -1
  10. package/build/browser/filter-list/base/FilterIcons.js +7 -1
  11. package/build/browser/filter-list/base/FilterIcons.js.map +1 -1
  12. package/build/browser/filter-list/base/FilterList.module.css +0 -3
  13. package/build/browser/filter-list/base/FilterListContent.js +38 -17
  14. package/build/browser/filter-list/base/FilterListContent.js.map +1 -1
  15. package/build/browser/filter-list/base/FilterListItem.js +33 -1
  16. package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
  17. package/build/browser/filter-list/base/FilterListItem.module.css +9 -6
  18. package/build/browser/filter-list/base/FilterListItem.module.css.js +1 -1
  19. package/build/browser/filter-list/base/SortableFilterListItem.js +3 -2
  20. package/build/browser/filter-list/base/SortableFilterListItem.js.map +1 -1
  21. package/build/browser/filter-list/base/inputs/ListogramInput.js +25 -10
  22. package/build/browser/filter-list/base/inputs/ListogramInput.js.map +1 -1
  23. package/build/browser/filter-list/base/inputs/ListogramInput.module.css +8 -0
  24. package/build/browser/filter-list/base/inputs/ListogramInput.module.css.js +1 -0
  25. package/build/browser/filter-list/base/inputs/NullValueWrapper.js +1 -1
  26. package/build/browser/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  27. package/build/browser/filter-list/base/inputs/RangeInput.js +5 -3
  28. package/build/browser/filter-list/base/inputs/RangeInput.js.map +1 -1
  29. package/build/browser/filter-list/base/inputs/RangeInput.module.css +0 -6
  30. package/build/browser/filter-list/base/inputs/index.js +0 -1
  31. package/build/browser/filter-list/base/inputs/index.js.map +1 -1
  32. package/build/browser/filter-list/hooks/useFilterListState.js +7 -11
  33. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
  34. package/build/browser/filter-list/hooks/usePropertyAggregation.js +7 -2
  35. package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -1
  36. package/build/browser/filter-list/inputs/LinkedPropertyInput.js +0 -35
  37. package/build/browser/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
  38. package/build/browser/filter-list/inputs/ListogramFilterInput.js +5 -2
  39. package/build/browser/filter-list/inputs/ListogramFilterInput.js.map +1 -1
  40. package/build/browser/filter-list/inputs/PropertyFilterInput.js +0 -13
  41. package/build/browser/filter-list/inputs/PropertyFilterInput.js.map +1 -1
  42. package/build/browser/filter-list/utils/filterStateToWhereClause.js +2 -7
  43. package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  44. package/build/browser/styles.css +24 -120
  45. package/build/cjs/public/experimental.cjs +1353 -1457
  46. package/build/cjs/public/experimental.cjs.map +1 -1
  47. package/build/cjs/public/experimental.css +133 -189
  48. package/build/cjs/public/experimental.css.map +1 -1
  49. package/build/cjs/public/experimental.d.cts +6 -14
  50. package/build/esm/base-components/checkbox/Checkbox.js +6 -2
  51. package/build/esm/base-components/checkbox/Checkbox.js.map +1 -1
  52. package/build/esm/base-components/checkbox/Checkbox.module.css +7 -2
  53. package/build/esm/filter-list/FilterListApi.js.map +1 -1
  54. package/build/esm/filter-list/FilterListItemApi.js.map +1 -1
  55. package/build/esm/filter-list/base/ExcludeDropdown.js +4 -3
  56. package/build/esm/filter-list/base/ExcludeDropdown.js.map +1 -1
  57. package/build/esm/filter-list/base/FilterIcons.js +7 -1
  58. package/build/esm/filter-list/base/FilterIcons.js.map +1 -1
  59. package/build/esm/filter-list/base/FilterList.module.css +0 -3
  60. package/build/esm/filter-list/base/FilterListContent.js +38 -17
  61. package/build/esm/filter-list/base/FilterListContent.js.map +1 -1
  62. package/build/esm/filter-list/base/FilterListItem.js +33 -1
  63. package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
  64. package/build/esm/filter-list/base/FilterListItem.module.css +9 -6
  65. package/build/esm/filter-list/base/SortableFilterListItem.js +3 -2
  66. package/build/esm/filter-list/base/SortableFilterListItem.js.map +1 -1
  67. package/build/esm/filter-list/base/inputs/ListogramInput.js +25 -10
  68. package/build/esm/filter-list/base/inputs/ListogramInput.js.map +1 -1
  69. package/build/esm/filter-list/base/inputs/ListogramInput.module.css +8 -0
  70. package/build/esm/filter-list/base/inputs/NullValueWrapper.js +1 -1
  71. package/build/esm/filter-list/base/inputs/NullValueWrapper.js.map +1 -1
  72. package/build/esm/filter-list/base/inputs/RangeInput.js +5 -3
  73. package/build/esm/filter-list/base/inputs/RangeInput.js.map +1 -1
  74. package/build/esm/filter-list/base/inputs/RangeInput.module.css +0 -6
  75. package/build/esm/filter-list/base/inputs/index.js +0 -1
  76. package/build/esm/filter-list/base/inputs/index.js.map +1 -1
  77. package/build/esm/filter-list/hooks/useFilterListState.js +7 -11
  78. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
  79. package/build/esm/filter-list/hooks/usePropertyAggregation.js +7 -2
  80. package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -1
  81. package/build/esm/filter-list/inputs/LinkedPropertyInput.js +0 -35
  82. package/build/esm/filter-list/inputs/LinkedPropertyInput.js.map +1 -1
  83. package/build/esm/filter-list/inputs/ListogramFilterInput.js +5 -2
  84. package/build/esm/filter-list/inputs/ListogramFilterInput.js.map +1 -1
  85. package/build/esm/filter-list/inputs/PropertyFilterInput.js +0 -13
  86. package/build/esm/filter-list/inputs/PropertyFilterInput.js.map +1 -1
  87. package/build/esm/filter-list/utils/filterStateToWhereClause.js +2 -7
  88. package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  89. package/build/types/base-components/checkbox/Checkbox.d.ts +2 -1
  90. package/build/types/base-components/checkbox/Checkbox.d.ts.map +1 -1
  91. package/build/types/filter-list/FilterListApi.d.ts +0 -7
  92. package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
  93. package/build/types/filter-list/FilterListItemApi.d.ts +6 -7
  94. package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
  95. package/build/types/filter-list/base/ExcludeDropdown.d.ts.map +1 -1
  96. package/build/types/filter-list/base/FilterIcons.d.ts +1 -0
  97. package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -1
  98. package/build/types/filter-list/base/FilterListContent.d.ts.map +1 -1
  99. package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
  100. package/build/types/filter-list/base/SortableFilterListItem.d.ts +2 -1
  101. package/build/types/filter-list/base/SortableFilterListItem.d.ts.map +1 -1
  102. package/build/types/filter-list/base/inputs/ListogramInput.d.ts +2 -1
  103. package/build/types/filter-list/base/inputs/ListogramInput.d.ts.map +1 -1
  104. package/build/types/filter-list/base/inputs/RangeInput.d.ts.map +1 -1
  105. package/build/types/filter-list/base/inputs/index.d.ts +0 -1
  106. package/build/types/filter-list/base/inputs/index.d.ts.map +1 -1
  107. package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +1 -0
  108. package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -1
  109. package/build/types/filter-list/inputs/LinkedPropertyInput.d.ts.map +1 -1
  110. package/build/types/filter-list/inputs/ListogramFilterInput.d.ts.map +1 -1
  111. package/build/types/filter-list/inputs/PropertyFilterInput.d.ts.map +1 -1
  112. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +1 -1
  113. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -1
  114. package/package.json +7 -7
  115. package/build/browser/filter-list/base/inputs/CheckboxListInput.js +0 -83
  116. package/build/browser/filter-list/base/inputs/CheckboxListInput.js.map +0 -1
  117. package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css +0 -65
  118. package/build/browser/filter-list/base/inputs/CheckboxListInput.module.css.js +0 -10
  119. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js +0 -46
  120. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.js.map +0 -1
  121. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css +0 -32
  122. package/build/browser/filter-list/base/inputs/CheckboxListSkeleton.module.css.js +0 -8
  123. package/build/browser/filter-list/inputs/CheckboxListFilterInput.js +0 -66
  124. package/build/browser/filter-list/inputs/CheckboxListFilterInput.js.map +0 -1
  125. package/build/esm/filter-list/base/inputs/CheckboxListInput.js +0 -83
  126. package/build/esm/filter-list/base/inputs/CheckboxListInput.js.map +0 -1
  127. package/build/esm/filter-list/base/inputs/CheckboxListInput.module.css +0 -65
  128. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js +0 -46
  129. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.js.map +0 -1
  130. package/build/esm/filter-list/base/inputs/CheckboxListSkeleton.module.css +0 -32
  131. package/build/esm/filter-list/inputs/CheckboxListFilterInput.js +0 -66
  132. package/build/esm/filter-list/inputs/CheckboxListFilterInput.js.map +0 -1
  133. package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts +0 -16
  134. package/build/types/filter-list/base/inputs/CheckboxListInput.d.ts.map +0 -1
  135. package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts +0 -2
  136. package/build/types/filter-list/base/inputs/CheckboxListSkeleton.d.ts.map +0 -1
  137. package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts +0 -17
  138. package/build/types/filter-list/inputs/CheckboxListFilterInput.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @osdk/react-components
2
2
 
3
+ ## 0.2.0-beta.28
4
+
5
+ ### Minor Changes
6
+
7
+ - 3eaf3f5: Add CSS layers documentation and Tailwind CSS v4 setup instructions to READMEs
8
+ - 3f4fb81: Address design review and PR review feedback for filter list: exclude strikethrough only on selected items, remove hover-to-show exclude row, fix 3-dots toggle close behavior, remove OR filter operator mode, and various UI polish
9
+
10
+ ## 0.2.0-beta.27
11
+
12
+ ### Minor Changes
13
+
14
+ - 32c27d7: Added useOsdkFunctions to @osdk/react to execute multiple functions in parallel. This is used by ObjectTable to fetch function-backed columns
15
+ - 6019278: auto-compute peer dependency ranges from changelog history for react and react-components
16
+
3
17
  ## 0.2.0-beta.26
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -53,7 +53,49 @@ function App() {
53
53
 
54
54
  ### CSS Setup
55
55
 
56
- Add this to your application's entry css file (e.g., `index.css` or `index.scss`):
56
+ Add the OSDK style imports to your application's entry CSS file (e.g., `index.css`).
57
+
58
+ #### Understanding CSS Layers
59
+
60
+ OSDK uses CSS [`@layer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) to make theming predictable. If you're not familiar with `@layer`, here's what you need to know:
61
+
62
+ **What is `@layer`?** CSS `@layer` lets you group styles into named layers and control the order in which they apply. When two styles target the same element, the style in the _later_ layer always wins — regardless of selector specificity. This is what makes the theming system maintainable.
63
+
64
+ **OSDK's layers:**
65
+
66
+ | Layer | Purpose |
67
+ | ----------------- | ---------------------------------------------------------- |
68
+ | `osdk.tokens` | Design tokens (colors, spacing, typography) — the defaults |
69
+ | `osdk.components` | Component structural styles (layout, borders, sizing) |
70
+
71
+ Because `osdk.components` is declared after `osdk.tokens`, component styles take priority over token defaults when they overlap.
72
+
73
+ **Adding your own layer:** You can add a custom layer (e.g., `user.brand`) after the OSDK layers to override any token or component style. Later layers always win.
74
+
75
+ **When styles conflict, CSS resolves them in this order:**
76
+
77
+ 1. **Layer order** — Later layers always win (`user.brand` > `osdk.components` > `osdk.tokens`)
78
+ 2. **Selector specificity** — More specific selectors win _within the same layer_
79
+ 3. **Source order** — Later declarations win when specificity is equal
80
+
81
+ #### With Tailwind CSS v4
82
+
83
+ > **Important:** The `@layer` declaration defines the cascade order. Wrapping the Tailwind import in `layer(tailwind)` nests all of Tailwind's styles into a single named layer. By listing `tailwind` before the OSDK layers, OSDK styles take priority over Tailwind's resets and utilities.
84
+
85
+ ```css
86
+ /* index.css */
87
+ @layer tailwind, osdk.tokens, osdk.components, user.brand;
88
+
89
+ @import "tailwindcss" layer(tailwind);
90
+
91
+ @import "@osdk/react-components-styles" layer(osdk.tokens);
92
+ @import "@osdk/react-components/styles.css" layer(osdk.components);
93
+
94
+ /* To add your own brand overrides on top, append a custom layer: */
95
+ @import "./user-brand.css" layer(user.brand);
96
+ ```
97
+
98
+ #### Without Tailwind CSS
57
99
 
58
100
  ```css
59
101
  /* index.css */
@@ -61,7 +103,22 @@ Add this to your application's entry css file (e.g., `index.css` or `index.scss`
61
103
 
62
104
  @import "@osdk/react-components-styles" layer(osdk.tokens);
63
105
  @import "@osdk/react-components/styles.css" layer(osdk.components);
106
+ ```
107
+
108
+ To add your own brand overrides on top:
109
+
110
+ ```css
111
+ /* index.css */
112
+ @layer osdk.tokens, osdk.components, user.brand;
113
+
114
+ @import "@osdk/react-components-styles" layer(osdk.tokens);
115
+ @import "@osdk/react-components/styles.css" layer(osdk.components);
116
+ @import "./user-brand.css" layer(user.brand);
117
+ ```
118
+
119
+ #### Portal isolation (required)
64
120
 
121
+ ```css
65
122
  .root {
66
123
  isolation: isolate;
67
124
  }
@@ -69,8 +126,6 @@ Add this to your application's entry css file (e.g., `index.css` or `index.scss`
69
126
 
70
127
  The `.root` isolation is required for Base UI portals. See https://base-ui.com/react/overview/quick-start#portals
71
128
 
72
- Using `@layer` ensures proper CSS cascade ordering - component styles are loaded before token styles, allowing tokens to override component defaults when needed.
73
-
74
129
  ## Components
75
130
 
76
131
  > **Note:** This package is under active development. Not all components listed below are available yet.
@@ -16,23 +16,27 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
16
16
  */
17
17
 
18
18
  import { Checkbox as BaseUICheckbox } from "@base-ui/react/checkbox";
19
- import { Minus, Tick } from "@blueprintjs/icons";
19
+ import { Cross, Minus, Tick } from "@blueprintjs/icons";
20
20
  import classnames from "classnames";
21
21
  import React from "react";
22
22
  import styles from "./Checkbox.module.css.js";
23
23
  export function Checkbox({
24
24
  indeterminate,
25
25
  className,
26
+ isExcluding,
26
27
  indicatorProps,
27
28
  ...rest
28
29
  }) {
29
30
  return /*#__PURE__*/React.createElement(BaseUICheckbox.Root, _extends({
30
31
  className: classnames(styles.osdkCheckboxRoot, className),
31
- indeterminate: indeterminate
32
+ indeterminate: indeterminate,
33
+ "data-excluding": isExcluding || undefined
32
34
  }, rest), /*#__PURE__*/React.createElement(BaseUICheckbox.Indicator, _extends({}, indicatorProps, {
33
35
  className: classnames(styles.osdkCheckboxIndicator, indicatorProps?.className)
34
36
  }), indeterminate ? /*#__PURE__*/React.createElement(Minus, {
35
37
  size: 16
38
+ }) : isExcluding ? /*#__PURE__*/React.createElement(Cross, {
39
+ size: 16
36
40
  }) : /*#__PURE__*/React.createElement(Tick, {
37
41
  size: 16
38
42
  })));
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["Checkbox","BaseUICheckbox","Minus","Tick","classnames","React","styles","indeterminate","className","indicatorProps","rest","createElement","Root","_extends","osdkCheckboxRoot","Indicator","osdkCheckboxIndicator","size"],"sources":["Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Checkbox as BaseUICheckbox,\n type CheckboxIndicatorProps,\n type CheckboxRootProps,\n} from \"@base-ui/react/checkbox\";\nimport { Minus, Tick } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Checkbox.module.css\";\n\ninterface CheckboxProps extends Omit<CheckboxRootProps, \"className\"> {\n className?: string;\n indicatorProps?: Omit<CheckboxIndicatorProps, \"className\"> & {\n className?: string;\n };\n}\n\nexport function Checkbox(\n {\n indeterminate,\n className,\n indicatorProps,\n ...rest\n }: CheckboxProps,\n): React.ReactElement {\n return (\n <BaseUICheckbox.Root\n className={classnames(styles.osdkCheckboxRoot, className)}\n indeterminate={indeterminate}\n {...rest}\n >\n <BaseUICheckbox.Indicator\n {...indicatorProps}\n className={classnames(\n styles.osdkCheckboxIndicator,\n indicatorProps?.className,\n )}\n >\n {/* Color is used as the \"fill\" attribute on the svg */}\n {indeterminate\n ? (\n <Minus\n size={16}\n />\n )\n : <Tick size={16} />}\n </BaseUICheckbox.Indicator>\n </BaseUICheckbox.Root>\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,IAAIC,cAAc,QAGrB,yBAAyB;AAChC,SAASC,KAAK,EAAEC,IAAI,QAAQ,oBAAoB;AAChD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,uBAAuB;AAS1C,OAAO,SAASN,QAAQA,CACtB;EACEO,aAAa;EACbC,SAAS;EACTC,cAAc;EACd,GAAGC;AACU,CAAC,EACI;EACpB,oBACEL,KAAA,CAAAM,aAAA,CAACV,cAAc,CAACW,IAAI,EAAAC,QAAA;IAClBL,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACQ,gBAAgB,EAAEN,SAAS,CAAE;IAC1DD,aAAa,EAAEA;EAAc,GACzBG,IAAI,gBAERL,KAAA,CAAAM,aAAA,CAACV,cAAc,CAACc,SAAS,EAAAF,QAAA,KACnBJ,cAAc;IAClBD,SAAS,EAAEJ,UAAU,CACnBE,MAAM,CAACU,qBAAqB,EAC5BP,cAAc,EAAED,SAClB;EAAE,IAGDD,aAAa,gBAEVF,KAAA,CAAAM,aAAA,CAACT,KAAK;IACJe,IAAI,EAAE;EAAG,CACV,CAAC,gBAEFZ,KAAA,CAAAM,aAAA,CAACR,IAAI;IAACc,IAAI,EAAE;EAAG,CAAE,CACG,CACP,CAAC;AAE1B","ignoreList":[]}
1
+ {"version":3,"file":"Checkbox.js","names":["Checkbox","BaseUICheckbox","Cross","Minus","Tick","classnames","React","styles","indeterminate","className","isExcluding","indicatorProps","rest","createElement","Root","_extends","osdkCheckboxRoot","undefined","Indicator","osdkCheckboxIndicator","size"],"sources":["Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Checkbox as BaseUICheckbox,\n type CheckboxIndicatorProps,\n type CheckboxRootProps,\n} from \"@base-ui/react/checkbox\";\nimport { Cross, Minus, Tick } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Checkbox.module.css\";\n\ninterface CheckboxProps extends Omit<CheckboxRootProps, \"className\"> {\n className?: string;\n isExcluding?: boolean;\n indicatorProps?: Omit<CheckboxIndicatorProps, \"className\"> & {\n className?: string;\n };\n}\n\nexport function Checkbox(\n {\n indeterminate,\n className,\n isExcluding,\n indicatorProps,\n ...rest\n }: CheckboxProps,\n): React.ReactElement {\n return (\n <BaseUICheckbox.Root\n className={classnames(styles.osdkCheckboxRoot, className)}\n indeterminate={indeterminate}\n data-excluding={isExcluding || undefined}\n {...rest}\n >\n <BaseUICheckbox.Indicator\n {...indicatorProps}\n className={classnames(\n styles.osdkCheckboxIndicator,\n indicatorProps?.className,\n )}\n >\n {/* Color is used as the \"fill\" attribute on the svg */}\n {indeterminate\n ? <Minus size={16} />\n : isExcluding\n ? <Cross size={16} />\n : <Tick size={16} />}\n </BaseUICheckbox.Indicator>\n </BaseUICheckbox.Root>\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,QAAQ,IAAIC,cAAc,QAGrB,yBAAyB;AAChC,SAASC,KAAK,EAAEC,KAAK,EAAEC,IAAI,QAAQ,oBAAoB;AACvD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,uBAAuB;AAU1C,OAAO,SAASP,QAAQA,CACtB;EACEQ,aAAa;EACbC,SAAS;EACTC,WAAW;EACXC,cAAc;EACd,GAAGC;AACU,CAAC,EACI;EACpB,oBACEN,KAAA,CAAAO,aAAA,CAACZ,cAAc,CAACa,IAAI,EAAAC,QAAA;IAClBN,SAAS,EAAEJ,UAAU,CAACE,MAAM,CAACS,gBAAgB,EAAEP,SAAS,CAAE;IAC1DD,aAAa,EAAEA,aAAc;IAC7B,kBAAgBE,WAAW,IAAIO;EAAU,GACrCL,IAAI,gBAERN,KAAA,CAAAO,aAAA,CAACZ,cAAc,CAACiB,SAAS,EAAAH,QAAA,KACnBJ,cAAc;IAClBF,SAAS,EAAEJ,UAAU,CACnBE,MAAM,CAACY,qBAAqB,EAC5BR,cAAc,EAAEF,SAClB;EAAE,IAGDD,aAAa,gBACVF,KAAA,CAAAO,aAAA,CAACV,KAAK;IAACiB,IAAI,EAAE;EAAG,CAAE,CAAC,GACnBV,WAAW,gBACXJ,KAAA,CAAAO,aAAA,CAACX,KAAK;IAACkB,IAAI,EAAE;EAAG,CAAE,CAAC,gBACnBd,KAAA,CAAAO,aAAA,CAACT,IAAI;IAACgB,IAAI,EAAE;EAAG,CAAE,CACG,CACP,CAAC;AAE1B","ignoreList":[]}
@@ -18,12 +18,13 @@
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: center;
21
- min-width: calc(
21
+ width: calc(
22
22
  var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2
23
23
  );
24
- min-height: calc(
24
+ height: calc(
25
25
  var(--osdk-checkbox-icon-size) + var(--osdk-checkbox-padding) * 2
26
26
  );
27
+ flex-shrink: 0;
27
28
  padding: var(--osdk-checkbox-padding);
28
29
  cursor: pointer;
29
30
  border-radius: var(--osdk-surface-border-radius);
@@ -54,6 +55,10 @@
54
55
  }
55
56
  }
56
57
 
58
+ &[data-excluding][data-checked] {
59
+ background-color: var(--osdk-checkbox-bg-hover);
60
+ }
61
+
57
62
  &:focus-visible {
58
63
  outline: var(--osdk-focus-outline);
59
64
  outline-offset: calc(-1 * var(--osdk-focus-visible-outline-offset));
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListApi.js","names":[],"sources":["FilterListApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n WhereClause,\n} from \"@osdk/api\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\nimport type {\n FilterState as FilterStateType,\n PropertyFilterDefinition,\n} from \"./FilterListItemApi.js\";\nimport type { CustomFilterDefinition } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterDefinition } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterDefinition,\n LinkedPropertyFilterDefinition,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Union type of all filter definition types\n */\nexport type FilterDefinitionUnion<Q extends ObjectTypeDefinition> =\n | PropertyFilterDefinition<Q>\n | HasLinkFilterDefinition<Q>\n | LinkedPropertyFilterDefinition<Q, LinkNames<Q>>\n | KeywordSearchFilterDefinition<Q>\n | CustomFilterDefinition<Q>;\n\n/**\n * Extract the key from a filter definition union\n */\nexport type FilterKey<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D ? D extends { key: infer K } ? K\n : D extends { linkName: infer L } ? L\n : never\n : never;\n\n/**\n * Extract the filter state from a filter definition union\n */\nexport type FilterState<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D\n ? D extends { filterState: infer S } ? S\n : never\n : never;\n\n/**\n * Map from filter definition objects to their current state.\n * Uses object identity for keys, ensuring stable lookups across reorders.\n */\nexport type FilterStatesMap<Q extends ObjectTypeDefinition> = Map<\n FilterDefinitionUnion<Q>,\n FilterStateType\n>;\n\nexport interface FilterListProps<Q extends ObjectTypeDefinition> {\n /**\n * The set of objects to be filtered\n */\n objectSet: ObjectSet<Q>;\n\n /**\n * Optional title to display in the filter list header\n */\n title?: ReactNode;\n\n /**\n * Optional icon to display next to the title\n */\n titleIcon?: React.ReactNode;\n\n /**\n * The definition for all supported filter items in the list\n * If not supplied, all filterable properties will be available\n */\n filterDefinitions?: Array<FilterDefinitionUnion<Q>>;\n\n /**\n * The current where clause to filter the objectSet.\n * If provided, the filter clause is controlled.\n */\n filterClause?: WhereClause<Q>;\n\n /**\n * Called when the filter clause changes.\n * The filters are joined by the selected filterOperator.\n * Required in controlled mode.\n *\n * @param newClause The updated filter clause\n */\n onFilterClauseChanged?: (newClause: WhereClause<Q>) => void;\n\n /**\n * The logical operator to join multiple filters\n *\n * @default \"and\"\n */\n filterOperator?: \"and\" | \"or\";\n\n /**\n * Called when filter state changes\n *\n * @param definition The filter definition whose state changed\n * @param newState The updated filter state\n */\n onFilterStateChanged?: (\n definition: FilterDefinitionUnion<Q>,\n newState: FilterStateType,\n ) => void;\n\n /**\n * Controls how filter visibility (add/remove) is managed.\n *\n * - `\"uncontrolled\"` (default): FilterList manages visibility internally.\n * An \"Add filter\" popover is rendered for filters with `isVisible: false`,\n * and each visible filter shows a remove button.\n * - `\"controlled\"`: The consumer manages which filters are visible via\n * `filterDefinitions`. Filters with `isVisible: false` are excluded from\n * the rendered list.\n *\n * @default \"uncontrolled\"\n */\n addFilterMode?: \"controlled\" | \"uncontrolled\";\n\n /**\n * Called when a filter is added (shown).\n *\n * In uncontrolled mode, this fires when a user selects a hidden filter\n * from the \"Add filter\" popover.\n *\n * @param filterKey The key of the added filter\n * @param newDefinitions The current filter definitions array\n */\n onFilterAdded?: (\n filterKey: FilterKey<Q>,\n newDefinitions: Array<FilterDefinitionUnion<Q>>,\n ) => void;\n\n /**\n * Called when a filter is removed (hidden).\n *\n * In uncontrolled mode, this fires as a notification after the filter\n * is hidden internally.\n *\n * @param filterKey The key of the removed filter\n */\n onFilterRemoved?: (filterKey: FilterKey<Q>) => void;\n\n /**\n * Enable drag-and-drop reordering of filters.\n * When true, drag handles are rendered and filters can be reordered.\n * Reorder state is managed internally; consumers who need to track order\n * should use controlled filterDefinitions.\n */\n enableSorting?: boolean;\n\n /**\n * Whether the filter list panel is collapsed\n */\n collapsed?: boolean;\n\n /**\n * Called when the collapsed state changes\n */\n onCollapsedChange?: (collapsed: boolean) => void;\n\n /**\n * Initial filter states for hydrating from external storage.\n * These states are merged over definition defaults on mount.\n * Use onFilterStateChanged to persist state changes externally.\n */\n initialFilterStates?: Map<string, FilterStateType>;\n\n /**\n * Show reset filters button in header\n */\n showResetButton?: boolean;\n\n /**\n * Called when reset button is clicked\n */\n onReset?: () => void;\n\n /**\n * Show count of active filters in header\n */\n showActiveFilterCount?: boolean;\n\n /**\n * Additional CSS class name\n */\n className?: string;\n\n /**\n * Custom render function for the \"Add filter\" button.\n *\n * - In uncontrolled mode: customizes the trigger element for the built-in\n * add-filter popover. The popover behavior is handled automatically.\n * - In controlled mode: replaces the entire add-filter button area.\n * The consumer is responsible for all add-filter behavior.\n */\n renderAddFilterButton?: () => React.ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"FilterListApi.js","names":[],"sources":["FilterListApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n WhereClause,\n} from \"@osdk/api\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\nimport type {\n FilterState as FilterStateType,\n PropertyFilterDefinition,\n} from \"./FilterListItemApi.js\";\nimport type { CustomFilterDefinition } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterDefinition } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterDefinition,\n LinkedPropertyFilterDefinition,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Union type of all filter definition types\n */\nexport type FilterDefinitionUnion<Q extends ObjectTypeDefinition> =\n | PropertyFilterDefinition<Q>\n | HasLinkFilterDefinition<Q>\n | LinkedPropertyFilterDefinition<Q, LinkNames<Q>>\n | KeywordSearchFilterDefinition<Q>\n | CustomFilterDefinition<Q>;\n\n/**\n * Extract the key from a filter definition union\n */\nexport type FilterKey<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D ? D extends { key: infer K } ? K\n : D extends { linkName: infer L } ? L\n : never\n : never;\n\n/**\n * Extract the filter state from a filter definition union\n */\nexport type FilterState<Q extends ObjectTypeDefinition> =\n FilterDefinitionUnion<Q> extends infer D\n ? D extends { filterState: infer S } ? S\n : never\n : never;\n\n/**\n * Map from filter definition objects to their current state.\n * Uses object identity for keys, ensuring stable lookups across reorders.\n */\nexport type FilterStatesMap<Q extends ObjectTypeDefinition> = Map<\n FilterDefinitionUnion<Q>,\n FilterStateType\n>;\n\nexport interface FilterListProps<Q extends ObjectTypeDefinition> {\n /**\n * The set of objects to be filtered\n */\n objectSet: ObjectSet<Q>;\n\n /**\n * Optional title to display in the filter list header\n */\n title?: ReactNode;\n\n /**\n * Optional icon to display next to the title\n */\n titleIcon?: React.ReactNode;\n\n /**\n * The definition for all supported filter items in the list\n * If not supplied, all filterable properties will be available\n */\n filterDefinitions?: Array<FilterDefinitionUnion<Q>>;\n\n /**\n * The current where clause to filter the objectSet.\n * If provided, the filter clause is controlled.\n */\n filterClause?: WhereClause<Q>;\n\n /**\n * Called when the filter clause changes.\n * Required in controlled mode.\n *\n * @param newClause The updated filter clause\n */\n onFilterClauseChanged?: (newClause: WhereClause<Q>) => void;\n\n /**\n * Called when filter state changes\n *\n * @param definition The filter definition whose state changed\n * @param newState The updated filter state\n */\n onFilterStateChanged?: (\n definition: FilterDefinitionUnion<Q>,\n newState: FilterStateType,\n ) => void;\n\n /**\n * Controls how filter visibility (add/remove) is managed.\n *\n * - `\"uncontrolled\"` (default): FilterList manages visibility internally.\n * An \"Add filter\" popover is rendered for filters with `isVisible: false`,\n * and each visible filter shows a remove button.\n * - `\"controlled\"`: The consumer manages which filters are visible via\n * `filterDefinitions`. Filters with `isVisible: false` are excluded from\n * the rendered list.\n *\n * @default \"uncontrolled\"\n */\n addFilterMode?: \"controlled\" | \"uncontrolled\";\n\n /**\n * Called when a filter is added (shown).\n *\n * In uncontrolled mode, this fires when a user selects a hidden filter\n * from the \"Add filter\" popover.\n *\n * @param filterKey The key of the added filter\n * @param newDefinitions The current filter definitions array\n */\n onFilterAdded?: (\n filterKey: FilterKey<Q>,\n newDefinitions: Array<FilterDefinitionUnion<Q>>,\n ) => void;\n\n /**\n * Called when a filter is removed (hidden).\n *\n * In uncontrolled mode, this fires as a notification after the filter\n * is hidden internally.\n *\n * @param filterKey The key of the removed filter\n */\n onFilterRemoved?: (filterKey: FilterKey<Q>) => void;\n\n /**\n * Enable drag-and-drop reordering of filters.\n * When true, drag handles are rendered and filters can be reordered.\n * Reorder state is managed internally; consumers who need to track order\n * should use controlled filterDefinitions.\n */\n enableSorting?: boolean;\n\n /**\n * Whether the filter list panel is collapsed\n */\n collapsed?: boolean;\n\n /**\n * Called when the collapsed state changes\n */\n onCollapsedChange?: (collapsed: boolean) => void;\n\n /**\n * Initial filter states for hydrating from external storage.\n * These states are merged over definition defaults on mount.\n * Use onFilterStateChanged to persist state changes externally.\n */\n initialFilterStates?: Map<string, FilterStateType>;\n\n /**\n * Show reset filters button in header\n */\n showResetButton?: boolean;\n\n /**\n * Called when reset button is clicked\n */\n onReset?: () => void;\n\n /**\n * Show count of active filters in header\n */\n showActiveFilterCount?: boolean;\n\n /**\n * Additional CSS class name\n */\n className?: string;\n\n /**\n * Custom render function for the \"Add filter\" button.\n *\n * - In uncontrolled mode: customizes the trigger element for the built-in\n * add-filter popover. The popover behavior is handled automatically.\n * - In controlled mode: replaces the entire add-filter button area.\n * The consumer is responsible for all add-filter behavior.\n */\n renderAddFilterButton?: () => React.ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListItemApi.js","names":[],"sources":["FilterListItemApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n PropertyKeys,\n WirePropertyTypes,\n} from \"@osdk/api\";\nimport type { CustomFilterState } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterState } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterState,\n LinkedPropertyFilterState,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Helper type to extract the property type from an ObjectTypeDefinition given a property key\n */\nexport type PropertyTypeFromKey<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][K][\"type\"];\n\n/**\n * All available filter component types\n */\nexport type FilterComponentType =\n | \"LISTOGRAM\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n | \"SINGLE_DATE\"\n | \"MULTI_DATE\"\n | \"TIMELINE\"\n | \"CHECKBOX_LIST\"\n | \"TOGGLE\";\n\n/**\n * Gets valid component types for a given property type\n */\nexport type ValidComponentsForPropertyType<P extends WirePropertyTypes> =\n P extends \"boolean\"\n ? \"LISTOGRAM\" | \"CHECKBOX_LIST\" | \"SINGLE_SELECT\" | \"TOGGLE\"\n : P extends \"string\" ?\n | \"LISTOGRAM\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n | \"CHECKBOX_LIST\"\n : P extends \"datetime\" | \"timestamp\"\n ? \"DATE_RANGE\" | \"SINGLE_DATE\" | \"MULTI_DATE\" | \"TIMELINE\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_RANGE\" | \"SINGLE_SELECT\" | \"MULTI_SELECT\"\n : never;\n\n/**\n * Union of all possible filter states\n */\nexport type FilterState =\n | ExactMatchFilterState<string | boolean>\n | DateRangeFilterState\n | ContainsTextFilterState\n | NumberRangeFilterState\n | SelectFilterState<string | boolean | number>\n | SelectFilterState<Date>\n | TimelineFilterState\n | ToggleFilterState\n | HasLinkFilterState\n | LinkedPropertyFilterState\n | KeywordSearchFilterState\n | CustomFilterState;\n\n/**\n * Maps component types to their corresponding state types\n */\nexport interface FilterStateByComponentType {\n LISTOGRAM: ExactMatchFilterState<string | boolean>;\n DATE_RANGE: DateRangeFilterState;\n TEXT_TAGS: ExactMatchFilterState<string>;\n CONTAINS_TEXT: ContainsTextFilterState;\n NUMBER_RANGE: NumberRangeFilterState;\n SINGLE_SELECT: SelectFilterState<string | boolean | number>;\n MULTI_SELECT: SelectFilterState<string | boolean | number>;\n SINGLE_DATE: SelectFilterState<Date>;\n MULTI_DATE: SelectFilterState<Date>;\n TIMELINE: TimelineFilterState;\n CHECKBOX_LIST: SelectFilterState<string>;\n TOGGLE: ToggleFilterState;\n}\n\n/**\n * All filter state discriminator types\n */\nexport type FilterStateType =\n | \"EXACT_MATCH\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"CONTAINS_TEXT\"\n | \"SELECT\"\n | \"TIMELINE\"\n | \"TOGGLE\"\n | \"hasLink\"\n | \"linkedProperty\"\n | \"keywordSearch\"\n | \"custom\";\n\n/**\n * Base interface for all filter states\n * Contains common properties shared across all filter types\n */\nexport interface BaseFilterState {\n /**\n * The type of filter component\n */\n type: FilterStateType;\n\n /**\n * If true, the objects satisfying the filter are excluded\n * @default false\n */\n isExcluding?: boolean;\n\n /**\n * If true, include objects that have no value\n * @default false\n */\n includeNull?: boolean;\n}\n\nexport interface ExactMatchFilterState<T = string | boolean>\n extends BaseFilterState\n{\n type: \"EXACT_MATCH\";\n values: T[];\n}\n\nexport interface DateRangeFilterState extends BaseFilterState {\n type: \"DATE_RANGE\";\n /**\n * The earliest date the user can select\n */\n minValue?: Date;\n /**\n * The latest date the user can select\n */\n maxValue?: Date;\n}\n\nexport interface ContainsTextFilterState extends BaseFilterState {\n type: \"CONTAINS_TEXT\";\n value?: string;\n}\n\nexport interface NumberRangeFilterState extends BaseFilterState {\n type: \"NUMBER_RANGE\";\n /**\n * Minimum numeric value (inclusive)\n */\n minValue?: number;\n /**\n * Maximum numeric value (inclusive)\n */\n maxValue?: number;\n}\n\n/**\n * Consolidated state type for select-based filters.\n * Used by SINGLE_SELECT, MULTI_SELECT, SINGLE_DATE, MULTI_DATE, and CHECKBOX_LIST.\n */\nexport interface SelectFilterState<T = string | boolean | number | Date>\n extends BaseFilterState\n{\n type: \"SELECT\";\n selectedValues: T[];\n}\n\nexport interface TimelineFilterState extends BaseFilterState {\n type: \"TIMELINE\";\n startDate?: Date;\n endDate?: Date;\n granularity?: \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n}\n\nexport interface ToggleFilterState extends BaseFilterState {\n type: \"TOGGLE\";\n enabled: boolean;\n}\n\n/**\n * A property filter definition specifies configuration for filtering on a single property\n *\n * The component type C must be compatible with the property type derived from the key.\n * For example, boolean properties can only use LISTOGRAM, CHECKBOX_LIST, or SINGLE_SELECT,\n * while string properties can use LISTOGRAM, TEXT_TAGS, CONTAINS_TEXT, SINGLE_SELECT, MULTI_SELECT, or CHECKBOX_LIST.\n */\nexport interface PropertyFilterDefinition<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> {\n /**\n * Discriminator for filter definition type\n */\n type: \"PROPERTY\";\n\n /**\n * Optional unique identifier for stable keying across filter reorders.\n */\n id?: string;\n\n /**\n * The property key to filter on\n */\n key: K;\n\n /**\n * Display label for the filter\n */\n label?: string;\n\n /**\n * The filter component type to render\n * Must be compatible with the property type derived from the key, see ValidComponentsForPropertyType\n */\n filterComponent: C;\n\n /**\n * The current state of the filter.\n * If provided, the filter is controlled.\n */\n filterState: FilterStateByComponentType[C];\n\n /**\n * Maps filter values to colors for visual differentiation.\n * Used by CHECKBOX_LIST (color dots) and LISTOGRAM (per-row bar colors).\n */\n colorMap?: Record<string, string>;\n\n /**\n * Configuration for LISTOGRAM display mode.\n * Only applies when filterComponent is \"LISTOGRAM\".\n */\n listogramConfig?: {\n displayMode?: \"full\" | \"count\" | \"minimal\";\n maxVisibleItems?: number;\n };\n\n /**\n * Controls whether this filter is rendered.\n * When false, the filter is hidden but its state is preserved.\n * @default true\n */\n isVisible?: boolean;\n}\n\n/**\n * Props for a single filter list item component.\n * Extends PropertyFilterDefinition with runtime props for rendering.\n */\nexport interface FilterListItemProps<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> extends PropertyFilterDefinition<Q, K, C> {\n objectSet: ObjectSet<Q>;\n\n /**\n * Called when the state of the filter changes.\n * Required in controlled mode.\n */\n onFilterStateChanged: (state: FilterStateByComponentType[C]) => void;\n\n onFilterRemoved?: (key: PropertyKeys<Q>) => void;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"FilterListItemApi.js","names":[],"sources":["FilterListItemApi.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n PropertyKeys,\n WirePropertyTypes,\n} from \"@osdk/api\";\nimport type { CustomFilterState } from \"./types/CustomRendererTypes.js\";\nimport type { KeywordSearchFilterState } from \"./types/KeywordSearchTypes.js\";\nimport type {\n HasLinkFilterState,\n LinkedPropertyFilterState,\n} from \"./types/LinkedFilterTypes.js\";\n\n/**\n * Helper type to extract the property type from an ObjectTypeDefinition given a property key\n */\nexport type PropertyTypeFromKey<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][K][\"type\"];\n\n/**\n * All available filter component types\n */\nexport type FilterComponentType =\n | \"LISTOGRAM\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n | \"SINGLE_DATE\"\n | \"MULTI_DATE\"\n | \"TIMELINE\"\n | \"TOGGLE\";\n\n/**\n * Gets valid component types for a given property type\n */\nexport type ValidComponentsForPropertyType<P extends WirePropertyTypes> =\n P extends \"boolean\" ? \"LISTOGRAM\" | \"SINGLE_SELECT\" | \"TOGGLE\"\n : P extends \"string\" ?\n | \"LISTOGRAM\"\n | \"TEXT_TAGS\"\n | \"CONTAINS_TEXT\"\n | \"SINGLE_SELECT\"\n | \"MULTI_SELECT\"\n : P extends \"datetime\" | \"timestamp\"\n ? \"DATE_RANGE\" | \"SINGLE_DATE\" | \"MULTI_DATE\" | \"TIMELINE\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_RANGE\" | \"SINGLE_SELECT\" | \"MULTI_SELECT\"\n : never;\n\n/**\n * Union of all possible filter states\n */\nexport type FilterState =\n | ExactMatchFilterState<string | boolean>\n | DateRangeFilterState\n | ContainsTextFilterState\n | NumberRangeFilterState\n | SelectFilterState<string | boolean | number>\n | SelectFilterState<Date>\n | TimelineFilterState\n | ToggleFilterState\n | HasLinkFilterState\n | LinkedPropertyFilterState\n | KeywordSearchFilterState\n | CustomFilterState;\n\n/**\n * Maps component types to their corresponding state types\n */\nexport interface FilterStateByComponentType {\n LISTOGRAM: ExactMatchFilterState<string | boolean>;\n DATE_RANGE: DateRangeFilterState;\n TEXT_TAGS: ExactMatchFilterState<string>;\n CONTAINS_TEXT: ContainsTextFilterState;\n NUMBER_RANGE: NumberRangeFilterState;\n SINGLE_SELECT: SelectFilterState<string | boolean | number>;\n MULTI_SELECT: SelectFilterState<string | boolean | number>;\n SINGLE_DATE: SelectFilterState<Date>;\n MULTI_DATE: SelectFilterState<Date>;\n TIMELINE: TimelineFilterState;\n TOGGLE: ToggleFilterState;\n}\n\n/**\n * All filter state discriminator types\n */\nexport type FilterStateType =\n | \"EXACT_MATCH\"\n | \"DATE_RANGE\"\n | \"NUMBER_RANGE\"\n | \"CONTAINS_TEXT\"\n | \"SELECT\"\n | \"TIMELINE\"\n | \"TOGGLE\"\n | \"hasLink\"\n | \"linkedProperty\"\n | \"keywordSearch\"\n | \"custom\";\n\n/**\n * Base interface for all filter states\n * Contains common properties shared across all filter types\n */\nexport interface BaseFilterState {\n /**\n * The type of filter component\n */\n type: FilterStateType;\n\n /**\n * If true, the objects satisfying the filter are excluded\n * @default false\n */\n isExcluding?: boolean;\n\n /**\n * If true, include objects that have no value\n * @default false\n */\n includeNull?: boolean;\n}\n\nexport interface ExactMatchFilterState<T = string | boolean>\n extends BaseFilterState\n{\n type: \"EXACT_MATCH\";\n values: T[];\n}\n\nexport interface DateRangeFilterState extends BaseFilterState {\n type: \"DATE_RANGE\";\n /**\n * The earliest date the user can select\n */\n minValue?: Date;\n /**\n * The latest date the user can select\n */\n maxValue?: Date;\n}\n\nexport interface ContainsTextFilterState extends BaseFilterState {\n type: \"CONTAINS_TEXT\";\n value?: string;\n}\n\nexport interface NumberRangeFilterState extends BaseFilterState {\n type: \"NUMBER_RANGE\";\n /**\n * Minimum numeric value (inclusive)\n */\n minValue?: number;\n /**\n * Maximum numeric value (inclusive)\n */\n maxValue?: number;\n}\n\n/**\n * Consolidated state type for select-based filters.\n * Used by SINGLE_SELECT, MULTI_SELECT, SINGLE_DATE, and MULTI_DATE.\n */\nexport interface SelectFilterState<T = string | boolean | number | Date>\n extends BaseFilterState\n{\n type: \"SELECT\";\n selectedValues: T[];\n}\n\nexport interface TimelineFilterState extends BaseFilterState {\n type: \"TIMELINE\";\n startDate?: Date;\n endDate?: Date;\n granularity?: \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n}\n\nexport interface ToggleFilterState extends BaseFilterState {\n type: \"TOGGLE\";\n enabled: boolean;\n}\n\n/**\n * A property filter definition specifies configuration for filtering on a single property\n *\n * The component type C must be compatible with the property type derived from the key.\n * For example, boolean properties can only use LISTOGRAM or SINGLE_SELECT,\n * while string properties can use LISTOGRAM, TEXT_TAGS, CONTAINS_TEXT, SINGLE_SELECT, or MULTI_SELECT.\n */\nexport interface PropertyFilterDefinition<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> {\n /**\n * Discriminator for filter definition type\n */\n type: \"PROPERTY\";\n\n /**\n * Optional unique identifier for stable keying across filter reorders.\n */\n id?: string;\n\n /**\n * The property key to filter on\n */\n key: K;\n\n /**\n * Display label for the filter\n */\n label?: string;\n\n /**\n * The filter component type to render\n * Must be compatible with the property type derived from the key, see ValidComponentsForPropertyType\n */\n filterComponent: C;\n\n /**\n * The current state of the filter.\n * If provided, the filter is controlled.\n */\n filterState: FilterStateByComponentType[C];\n\n /**\n * Maps filter values to colors for visual differentiation.\n * Used by LISTOGRAM (per-row bar colors).\n */\n colorMap?: Record<string, string>;\n\n /**\n * Configuration for LISTOGRAM display mode.\n * Only applies when filterComponent is \"LISTOGRAM\".\n */\n listogramConfig?: {\n displayMode?: \"full\" | \"count\" | \"minimal\";\n maxVisibleItems?: number;\n };\n\n /**\n * Controls whether this filter is rendered.\n * When false, the filter is hidden but its state is preserved.\n * @default true\n */\n isVisible?: boolean;\n}\n\n/**\n * Props for a single filter list item component.\n * Extends PropertyFilterDefinition with runtime props for rendering.\n */\nexport interface FilterListItemProps<\n Q extends ObjectTypeDefinition,\n K extends PropertyKeys<Q> = PropertyKeys<Q>,\n C extends ValidComponentsForPropertyType<\n PropertyTypeFromKey<Q, K>\n > = ValidComponentsForPropertyType<PropertyTypeFromKey<Q, K>>,\n> extends PropertyFilterDefinition<Q, K, C> {\n objectSet: ObjectSet<Q>;\n\n /**\n * Called when the state of the filter changes.\n * Required in controlled mode.\n */\n onFilterStateChanged: (state: FilterStateByComponentType[C]) => void;\n\n onFilterRemoved?: (key: PropertyKeys<Q>) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -17,7 +17,7 @@
17
17
  import { Menu } from "@base-ui/react/menu";
18
18
  import React, { memo, useCallback } from "react";
19
19
  import styles from "./ExcludeDropdown.module.css.js";
20
- import { CheckIcon, ChevronDownIcon } from "./FilterIcons.js";
20
+ import { CheckIcon, ChevronDownIcon, ExcludeIcon } from "./FilterIcons.js";
21
21
  function ExcludeDropdownInner({
22
22
  isExcluding,
23
23
  onToggleExclude
@@ -37,8 +37,9 @@ function ExcludeDropdownInner({
37
37
  className: styles.excludeDropdownContainer
38
38
  }, /*#__PURE__*/React.createElement(Menu.Root, null, /*#__PURE__*/React.createElement(Menu.Trigger, {
39
39
  className: styles.trigger,
40
- "aria-label": label
41
- }, /*#__PURE__*/React.createElement("span", {
40
+ "aria-label": label,
41
+ "data-excluding": isExcluding || undefined
42
+ }, isExcluding && /*#__PURE__*/React.createElement(ExcludeIcon, null), /*#__PURE__*/React.createElement("span", {
42
43
  className: styles.triggerLabel
43
44
  }, label), /*#__PURE__*/React.createElement(ChevronDownIcon, null)), /*#__PURE__*/React.createElement(Menu.Portal, null, /*#__PURE__*/React.createElement(Menu.Positioner, {
44
45
  className: styles.positioner,
@@ -1 +1 @@
1
- {"version":3,"file":"ExcludeDropdown.js","names":["Menu","React","memo","useCallback","styles","CheckIcon","ChevronDownIcon","ExcludeDropdownInner","isExcluding","onToggleExclude","label","handleSelectKeeping","handleSelectExcluding","createElement","className","excludeDropdownContainer","Root","Trigger","trigger","triggerLabel","Portal","Positioner","positioner","sideOffset","Popup","popup","Item","menuItem","onClick","menuItemCheck","ExcludeDropdown"],"sources":["ExcludeDropdown.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Menu } from \"@base-ui/react/menu\";\nimport React, { memo, useCallback } from \"react\";\nimport styles from \"./ExcludeDropdown.module.css\";\nimport { CheckIcon, ChevronDownIcon } from \"./FilterIcons.js\";\n\ninterface ExcludeDropdownProps {\n isExcluding: boolean;\n onToggleExclude: () => void;\n}\n\nfunction ExcludeDropdownInner({\n isExcluding,\n onToggleExclude,\n}: ExcludeDropdownProps): React.ReactElement {\n const label = isExcluding ? \"Excluding\" : \"Keeping\";\n\n const handleSelectKeeping = useCallback(() => {\n if (isExcluding) {\n onToggleExclude();\n }\n }, [isExcluding, onToggleExclude]);\n\n const handleSelectExcluding = useCallback(() => {\n if (!isExcluding) {\n onToggleExclude();\n }\n }, [isExcluding, onToggleExclude]);\n\n return (\n <div className={styles.excludeDropdownContainer}>\n <Menu.Root>\n <Menu.Trigger\n className={styles.trigger}\n aria-label={label}\n >\n <span className={styles.triggerLabel}>\n {label}\n </span>\n <ChevronDownIcon />\n </Menu.Trigger>\n <Menu.Portal>\n <Menu.Positioner className={styles.positioner} sideOffset={4}>\n <Menu.Popup className={styles.popup}>\n <Menu.Item\n className={styles.menuItem}\n onClick={handleSelectKeeping}\n >\n <span className={styles.menuItemCheck}>\n {!isExcluding && <CheckIcon />}\n </span>\n Keeping\n </Menu.Item>\n <Menu.Item\n className={styles.menuItem}\n onClick={handleSelectExcluding}\n >\n <span className={styles.menuItemCheck}>\n {isExcluding && <CheckIcon />}\n </span>\n Excluding\n </Menu.Item>\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n </div>\n );\n}\n\nexport const ExcludeDropdown: React.MemoExoticComponent<\n typeof ExcludeDropdownInner\n> = memo(ExcludeDropdownInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAChD,OAAOC,MAAM,MAAM,8BAA8B;AACjD,SAASC,SAAS,EAAEC,eAAe,QAAQ,kBAAkB;AAO7D,SAASC,oBAAoBA,CAAC;EAC5BC,WAAW;EACXC;AACoB,CAAC,EAAsB;EAC3C,MAAMC,KAAK,GAAGF,WAAW,GAAG,WAAW,GAAG,SAAS;EAEnD,MAAMG,mBAAmB,GAAGR,WAAW,CAAC,MAAM;IAC5C,IAAIK,WAAW,EAAE;MACfC,eAAe,CAAC,CAAC;IACnB;EACF,CAAC,EAAE,CAACD,WAAW,EAAEC,eAAe,CAAC,CAAC;EAElC,MAAMG,qBAAqB,GAAGT,WAAW,CAAC,MAAM;IAC9C,IAAI,CAACK,WAAW,EAAE;MAChBC,eAAe,CAAC,CAAC;IACnB;EACF,CAAC,EAAE,CAACD,WAAW,EAAEC,eAAe,CAAC,CAAC;EAElC,oBACER,KAAA,CAAAY,aAAA;IAAKC,SAAS,EAAEV,MAAM,CA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reList":[]}
1
+ {"version":3,"file":"ExcludeDropdown.js","names":["Menu","React","memo","useCallback","styles","CheckIcon","ChevronDownIcon","ExcludeIcon","ExcludeDropdownInner","isExcluding","onToggleExclude","label","handleSelectKeeping","handleSelectExcluding","createElement","className","excludeDropdownContainer","Root","Trigger","trigger","undefined","triggerLabel","Portal","Positioner","positioner","sideOffset","Popup","popup","Item","menuItem","onClick","menuItemCheck","ExcludeDropdown"],"sources":["ExcludeDropdown.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Menu } from \"@base-ui/react/menu\";\nimport React, { memo, useCallback } from \"react\";\nimport styles from \"./ExcludeDropdown.module.css\";\nimport { CheckIcon, ChevronDownIcon, ExcludeIcon } from \"./FilterIcons.js\";\n\ninterface ExcludeDropdownProps {\n isExcluding: boolean;\n onToggleExclude: () => void;\n}\n\nfunction ExcludeDropdownInner({\n isExcluding,\n onToggleExclude,\n}: ExcludeDropdownProps): React.ReactElement {\n const label = isExcluding ? \"Excluding\" : \"Keeping\";\n\n const handleSelectKeeping = useCallback(() => {\n if (isExcluding) {\n onToggleExclude();\n }\n }, [isExcluding, onToggleExclude]);\n\n const handleSelectExcluding = useCallback(() => {\n if (!isExcluding) {\n onToggleExclude();\n }\n }, [isExcluding, onToggleExclude]);\n\n return (\n <div className={styles.excludeDropdownContainer}>\n <Menu.Root>\n <Menu.Trigger\n className={styles.trigger}\n aria-label={label}\n data-excluding={isExcluding || undefined}\n >\n {isExcluding && <ExcludeIcon />}\n <span className={styles.triggerLabel}>\n {label}\n </span>\n <ChevronDownIcon />\n </Menu.Trigger>\n <Menu.Portal>\n <Menu.Positioner className={styles.positioner} sideOffset={4}>\n <Menu.Popup className={styles.popup}>\n <Menu.Item\n className={styles.menuItem}\n onClick={handleSelectKeeping}\n >\n <span className={styles.menuItemCheck}>\n {!isExcluding && <CheckIcon />}\n </span>\n Keeping\n </Menu.Item>\n <Menu.Item\n className={styles.menuItem}\n onClick={handleSelectExcluding}\n >\n <span className={styles.menuItemCheck}>\n {isExcluding && <CheckIcon />}\n </span>\n Excluding\n </Menu.Item>\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n </div>\n );\n}\n\nexport const ExcludeDropdown: React.MemoExoticComponent<\n typeof ExcludeDropdownInner\n> = memo(ExcludeDropdownInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAChD,OAAOC,MAAM,MAAM,8BAA8B;AACjD,SAASC,SAAS,EAAEC,eAAe,EAAEC,WAAW,QAAQ,kBAAkB;AAO1E,SAASC,oBAAoBA,CAAC;EAC5BC,WAAW;EACXC;AACoB,CAAC,EAAsB;EAC3C,MAAMC,KAAK,GAAGF,WAAW,GAAG,WAAW,GAAG,SAAS;EAEnD,MAAMG,mBAAmB,GAAGT,WAAW,CAAC,MAAM;IAC5C,IAAIM,WAAW,EAAE;MACfC,eAAe,CAAC,CAAC;IACnB;EACF,CAAC,EAAE,CAACD,WAAW,EAAEC,eAAe,CAAC,CAAC;EAElC,MAAMG,qBAAqB,GAAGV,WAAW,CAAC,MAAM;IAC9C,IAAI,CAACM,WAAW,EAAE;MAChBC,eAAe,CAAC,CAAC;IACnB;EACF,CAAC,EAAE,CAACD,WAAW,EAAEC,eAAe,CAAC,CAAC;EAElC,oBACET,KAAA,CAAAa,a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T,SAAS,MAAE,CACxB,CAAC,aAEE,CACD,CACG,CACN,CACJ,CACR,CAAC;AAEV;AAEA,OAAO,MAAM2B,eAEZ,gBAAG9B,IAAI,CAACM,oBAAoB,CAAC","ignoreList":[]}
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { ChevronDown, Cross, DoubleChevronLeft, DoubleChevronRight, More, Search, Tick, Undo } from "@blueprintjs/icons";
17
+ import { ChevronDown, Cross, Disable, DoubleChevronLeft, DoubleChevronRight, More, Search, Tick, Undo } from "@blueprintjs/icons";
18
18
  import React from "react";
19
19
  export function RemoveIcon() {
20
20
  return /*#__PURE__*/React.createElement(Cross, {
@@ -56,4 +56,10 @@ export function CheckIcon() {
56
56
  size: 12
57
57
  });
58
58
  }
59
+ export function ExcludeIcon() {
60
+ return /*#__PURE__*/React.createElement(Disable, {
61
+ color: "currentColor",
62
+ size: 12
63
+ });
64
+ }
59
65
  //# sourceMappingURL=FilterIcons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterIcons.js","names":["ChevronDown","Cross","DoubleChevronLeft","DoubleChevronRight","More","Search","Tick","Undo","React","RemoveIcon","createElement","size","SearchIcon","OverflowMenuIcon","ChevronDownIcon","CollapseIcon","ExpandIcon","ResetIcon","CheckIcon"],"sources":["FilterIcons.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ChevronDown,\n Cross,\n DoubleChevronLeft,\n DoubleChevronRight,\n More,\n Search,\n Tick,\n Undo,\n} from \"@blueprintjs/icons\";\nimport React from \"react\";\n\nexport function RemoveIcon(): React.ReactElement {\n return <Cross size={14} />;\n}\n\nexport function SearchIcon(): React.ReactElement {\n return <Search size={14} />;\n}\n\nexport function OverflowMenuIcon(): React.ReactElement {\n return <More size={14} />;\n}\n\nexport function ChevronDownIcon(): React.ReactElement {\n return <ChevronDown size={10} />;\n}\n\nexport function CollapseIcon(): React.ReactElement {\n return <DoubleChevronLeft size={14} />;\n}\n\nexport function ExpandIcon(): React.ReactElement {\n return <DoubleChevronRight size={14} />;\n}\n\nexport function ResetIcon(): React.ReactElement {\n return <Undo size={14} />;\n}\n\nexport function CheckIcon(): React.ReactElement {\n return <Tick size={12} />;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,KAAK,EACLC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,IAAI,QACC,oBAAoB;AAC3B,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,SAASC,UAAUA,CAAA,EAAuB;EAC/C,oBAAOD,KAAA,CAAAE,aAAA,CAACT,KAAK;IAACU,IAAI,EAAE;EAAG,CAAE,CAAC;AAC5B;AAEA,OAAO,SAASC,UAAUA,CAAA,EAAuB;EAC/C,oBAAOJ,KAAA,CAAAE,aAAA,CAACL,MAAM;IAACM,IAAI,EAAE;EAAG,CAAE,CAAC;AAC7B;AAEA,OAAO,SAASE,gBAAgBA,CAAA,EAAuB;EACrD,oBAAOL,KAAA,CAAAE,aAAA,CAACN,IAAI;IAACO,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B;AAEA,OAAO,SAASG,eAAeA,CAAA,EAAuB;EACpD,oBAAON,KAAA,CAAAE,aAAA,CAACV,WAAW;IAACW,IAAI,EAAE;EAAG,CAAE,CAAC;AAClC;AAEA,OAAO,SAASI,YAAYA,CAAA,EAAuB;EACjD,oBAAOP,KAAA,CAAAE,aAAA,CAACR,iBAAiB;IAACS,IAAI,EAAE;EAAG,CAAE,CAAC;AACxC;AAEA,OAAO,SAASK,UAAUA,CAAA,EAAuB;EAC/C,oBAAOR,KAAA,CAAAE,aAAA,CAACP,kBAAkB;IAACQ,IAAI,EAAE;EAAG,CAAE,CAAC;AACzC;AAEA,OAAO,SAASM,SAASA,CAAA,EAAuB;EAC9C,oBAAOT,KAAA,CAAAE,aAAA,CAACH,IAAI;IAACI,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B;AAEA,OAAO,SAASO,SAASA,CAAA,EAAuB;EAC9C,oBAAOV,KAAA,CAAAE,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B","ignoreList":[]}
1
+ {"version":3,"file":"FilterIcons.js","names":["ChevronDown","Cross","Disable","DoubleChevronLeft","DoubleChevronRight","More","Search","Tick","Undo","React","RemoveIcon","createElement","size","SearchIcon","OverflowMenuIcon","ChevronDownIcon","CollapseIcon","ExpandIcon","ResetIcon","CheckIcon","ExcludeIcon","color"],"sources":["FilterIcons.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ChevronDown,\n Cross,\n Disable,\n DoubleChevronLeft,\n DoubleChevronRight,\n More,\n Search,\n Tick,\n Undo,\n} from \"@blueprintjs/icons\";\nimport React from \"react\";\n\nexport function RemoveIcon(): React.ReactElement {\n return <Cross size={14} />;\n}\n\nexport function SearchIcon(): React.ReactElement {\n return <Search size={14} />;\n}\n\nexport function OverflowMenuIcon(): React.ReactElement {\n return <More size={14} />;\n}\n\nexport function ChevronDownIcon(): React.ReactElement {\n return <ChevronDown size={10} />;\n}\n\nexport function CollapseIcon(): React.ReactElement {\n return <DoubleChevronLeft size={14} />;\n}\n\nexport function ExpandIcon(): React.ReactElement {\n return <DoubleChevronRight size={14} />;\n}\n\nexport function ResetIcon(): React.ReactElement {\n return <Undo size={14} />;\n}\n\nexport function CheckIcon(): React.ReactElement {\n return <Tick size={12} />;\n}\n\nexport function ExcludeIcon(): React.ReactElement {\n return <Disable color=\"currentColor\" size={12} />;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,KAAK,EACLC,OAAO,EACPC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,IAAI,QACC,oBAAoB;AAC3B,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,SAASC,UAAUA,CAAA,EAAuB;EAC/C,oBAAOD,KAAA,CAAAE,aAAA,CAACV,KAAK;IAACW,IAAI,EAAE;EAAG,CAAE,CAAC;AAC5B;AAEA,OAAO,SAASC,UAAUA,CAAA,EAAuB;EAC/C,oBAAOJ,KAAA,CAAAE,aAAA,CAACL,MAAM;IAACM,IAAI,EAAE;EAAG,CAAE,CAAC;AAC7B;AAEA,OAAO,SAASE,gBAAgBA,CAAA,EAAuB;EACrD,oBAAOL,KAAA,CAAAE,aAAA,CAACN,IAAI;IAACO,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B;AAEA,OAAO,SAASG,eAAeA,CAAA,EAAuB;EACpD,oBAAON,KAAA,CAAAE,aAAA,CAACX,WAAW;IAACY,IAAI,EAAE;EAAG,CAAE,CAAC;AAClC;AAEA,OAAO,SAASI,YAAYA,CAAA,EAAuB;EACjD,oBAAOP,KAAA,CAAAE,aAAA,CAACR,iBAAiB;IAACS,IAAI,EAAE;EAAG,CAAE,CAAC;AACxC;AAEA,OAAO,SAASK,UAAUA,CAAA,EAAuB;EAC/C,oBAAOR,KAAA,CAAAE,aAAA,CAACP,kBAAkB;IAACQ,IAAI,EAAE;EAAG,CAAE,CAAC;AACzC;AAEA,OAAO,SAASM,SAASA,CAAA,EAAuB;EAC9C,oBAAOT,KAAA,CAAAE,aAAA,CAACH,IAAI;IAACI,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B;AAEA,OAAO,SAASO,SAASA,CAAA,EAAuB;EAC9C,oBAAOV,KAAA,CAAAE,aAAA,CAACJ,IAAI;IAACK,IAAI,EAAE;EAAG,CAAE,CAAC;AAC3B;AAEA,OAAO,SAASQ,WAAWA,CAAA,EAAuB;EAChD,oBAAOX,KAAA,CAAAE,aAAA,CAACT,OAAO;IAACmB,KAAK,EAAC,cAAc;IAACT,IAAI,EAAE;EAAG,CAAE,CAAC;AACnD","ignoreList":[]}
@@ -92,10 +92,7 @@
92
92
  .addButtonContainer {
93
93
  display: flex;
94
94
  justify-content: center;
95
- position: sticky;
96
- bottom: 0;
97
95
  padding-top: var(--osdk-filter-list-addButton-padding-top);
98
- background: var(--osdk-filter-list-addButton-container-bg);
99
96
  }
100
97
 
101
98
  .addButtonContainer > * {
@@ -17,7 +17,7 @@
17
17
  import { closestCenter, DndContext, DragOverlay, KeyboardSensor, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
18
18
  import { arrayMove, SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
19
19
  import classnames from "classnames";
20
- import React, { useCallback, useEffect, useMemo, useState } from "react";
20
+ import React, { useCallback, useMemo, useState } from "react";
21
21
  import styles from "./FilterListContent.module.css.js";
22
22
  import { FilterListItem } from "./FilterListItem.js";
23
23
  import { SortableFilterListItem } from "./SortableFilterListItem.js";
@@ -31,6 +31,14 @@ const POINTER_ACTIVATION_CONSTRAINT = {
31
31
  distance: 8
32
32
  };
33
33
  const MODIFIERS = [restrictToVerticalAxis];
34
+ const DRAG_OVERLAY_HANDLE_ATTRIBUTES = {
35
+ role: "button",
36
+ tabIndex: -1,
37
+ "aria-disabled": true,
38
+ "aria-pressed": undefined,
39
+ "aria-roledescription": "sortable",
40
+ "aria-describedby": ""
41
+ };
34
42
  export function FilterListContent({
35
43
  filterDefinitions,
36
44
  filterStates,
@@ -43,15 +51,27 @@ export function FilterListContent({
43
51
  className,
44
52
  style
45
53
  }) {
46
- const [internalOrder, setInternalOrder] = useState(() => filterDefinitions ?? []);
54
+ const [dragOrder, setDragOrder] = useState(null);
47
55
  const [activeId, setActiveId] = useState(null);
48
- useEffect(() => {
49
- if (filterDefinitions) {
50
- setInternalOrder(filterDefinitions);
56
+ const renderDefinitions = useMemo(() => {
57
+ if (!enableSorting || !dragOrder || !filterDefinitions) {
58
+ return filterDefinitions;
59
+ }
60
+ const defsByKey = new Map(filterDefinitions.map(d => [getFilterKey(d), d]));
61
+ const ordered = [];
62
+ for (const key of dragOrder) {
63
+ const def = defsByKey.get(key);
64
+ if (def) {
65
+ ordered.push(def);
66
+ defsByKey.delete(key);
67
+ }
51
68
  }
52
- }, [filterDefinitions]);
53
- const renderDefinitions = enableSorting ? internalOrder : filterDefinitions;
54
- const sortableIds = useMemo(() => enableSorting ? internalOrder.map(def => getFilterKey(def)) : [], [enableSorting, internalOrder, getFilterKey]);
69
+ for (const def of defsByKey.values()) {
70
+ ordered.push(def);
71
+ }
72
+ return ordered;
73
+ }, [enableSorting, dragOrder, filterDefinitions, getFilterKey]);
74
+ const sortableIds = useMemo(() => enableSorting && renderDefinitions ? renderDefinitions.map(def => getFilterKey(def)) : [], [enableSorting, renderDefinitions, getFilterKey]);
55
75
  const pointerSensor = useSensor(PointerSensor, {
56
76
  activationConstraint: POINTER_ACTIVATION_CONSTRAINT
57
77
  });
@@ -60,7 +80,7 @@ export function FilterListContent({
60
80
  });
61
81
  const sensors = useSensors(pointerSensor, keyboardSensor);
62
82
  const activeIndex = activeId != null ? sortableIds.indexOf(String(activeId)) : -1;
63
- const activeDefinition = activeIndex >= 0 ? internalOrder[activeIndex] : undefined;
83
+ const activeDefinition = activeIndex >= 0 && renderDefinitions ? renderDefinitions[activeIndex] : undefined;
64
84
  const activeFilterKey = useMemo(() => activeDefinition ? getFilterKey(activeDefinition) : undefined, [activeDefinition, getFilterKey]);
65
85
  const handleDragStart = useCallback(event => {
66
86
  setActiveId(event.active.id);
@@ -77,9 +97,9 @@ export function FilterListContent({
77
97
  const oldIndex = sortableIds.indexOf(String(active.id));
78
98
  const newIndex = sortableIds.indexOf(String(over.id));
79
99
  if (oldIndex !== -1 && newIndex !== -1) {
80
- setInternalOrder(arrayMove(internalOrder, oldIndex, newIndex));
100
+ setDragOrder(arrayMove(sortableIds, oldIndex, newIndex));
81
101
  }
82
- }, [internalOrder, sortableIds]);
102
+ }, [sortableIds]);
83
103
  const handleDragCancel = useCallback(() => {
84
104
  setActiveId(null);
85
105
  }, []);
@@ -88,7 +108,7 @@ export function FilterListContent({
88
108
  active
89
109
  }) {
90
110
  const idx = sortableIds.indexOf(String(active.id));
91
- const def = idx >= 0 ? internalOrder[idx] : undefined;
111
+ const def = idx >= 0 && renderDefinitions ? renderDefinitions[idx] : undefined;
92
112
  const label = def ? getFilterLabel(def) : "filter";
93
113
  return `Picked up ${label} filter`;
94
114
  },
@@ -106,7 +126,7 @@ export function FilterListContent({
106
126
  over
107
127
  }) {
108
128
  const idx = sortableIds.indexOf(String(active.id));
109
- const def = idx >= 0 ? internalOrder[idx] : undefined;
129
+ const def = idx >= 0 && renderDefinitions ? renderDefinitions[idx] : undefined;
110
130
  const label = def ? getFilterLabel(def) : "filter";
111
131
  if (over && active.id !== over.id) {
112
132
  const overIdx = sortableIds.indexOf(String(over.id));
@@ -118,11 +138,11 @@ export function FilterListContent({
118
138
  active
119
139
  }) {
120
140
  const idx = sortableIds.indexOf(String(active.id));
121
- const def = idx >= 0 ? internalOrder[idx] : undefined;
141
+ const def = idx >= 0 && renderDefinitions ? renderDefinitions[idx] : undefined;
122
142
  const label = def ? getFilterLabel(def) : "filter";
123
143
  return `Cancelled dragging ${label} filter`;
124
144
  }
125
- }), [internalOrder, sortableIds, getFilterLabel]);
145
+ }), [renderDefinitions, sortableIds, getFilterLabel]);
126
146
  const accessibility = useMemo(() => ({
127
147
  announcements
128
148
  }), [announcements]);
@@ -148,7 +168,7 @@ export function FilterListContent({
148
168
  }, /*#__PURE__*/React.createElement(SortableContext, {
149
169
  items: sortableIds,
150
170
  strategy: verticalListSortingStrategy
151
- }, internalOrder.map((definition, index) => {
171
+ }, renderDefinitions.map((definition, index) => {
152
172
  const id = sortableIds[index];
153
173
  const filterKey = getFilterKey(definition);
154
174
  const label = getFilterLabel(definition);
@@ -174,7 +194,8 @@ export function FilterListContent({
174
194
  filterState: filterStates.get(activeFilterKey),
175
195
  onFilterStateChanged: onFilterStateChanged,
176
196
  onFilterRemoved: onFilterRemoved,
177
- renderInput: renderInput
197
+ renderInput: renderInput,
198
+ dragHandleAttributes: DRAG_OVERLAY_HANDLE_ATTRIBUTES
178
199
  }))));
179
200
  }
180
201
  return /*#__PURE__*/React.createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListContent.js","names":["closestCenter","DndContext","DragOverlay","KeyboardSensor","PointerSensor","useSensor","useSensors","arrayMove","SortableContext","sortableKeyboardCoordinates","verticalListSortingStrategy","classnames","React","useCallback","useEffect","useMemo","useState","styles","FilterListItem","SortableFilterListItem","restrictToVerticalAxis","transform","x","POINTER_ACTIVATION_CONSTRAINT","distance","MODIFIERS","FilterListContent","filterDefinitions","filterStates","onFilterStateChanged","onFilterRemoved","renderInput","getFilterKey","getFilterLabel","enableSorting","className","style","internalOrder","setInternalOrder","activeId","setActiveId","renderDefinitions","sortableIds","map","def","pointerSensor","activationConstraint","keyboardSensor","coordinateGetter","sensors","activeIndex","indexOf","String","activeDefinition","undefined","activeFilterKey","handleDragStart","event","active","id","handleDragEnd","over","oldIndex","newIndex","handleDragCancel","announcements","onDragStart","idx","label","onDragOver","overIdx","length","onDragEnd","onDragCancel","accessibility","createElement","content","collisionDetection","modifiers","items","strategy","definition","index","filterKey","state","get","key","filterState","dropAnimation","dragOverlay"],"sources":["FilterListContent.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n Announcements,\n DragEndEvent,\n DragStartEvent,\n Modifier,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport classnames from \"classnames\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { FilterState } from \"../FilterListItemApi.js\";\nimport type { RenderFilterInput } from \"./BaseFilterListApi.js\";\nimport styles from \"./FilterListContent.module.css\";\nimport { FilterListItem } from \"./FilterListItem.js\";\nimport { SortableFilterListItem } from \"./SortableFilterListItem.js\";\n\nconst restrictToVerticalAxis: Modifier = ({ transform }) => ({\n ...transform,\n x: 0,\n});\n\nconst POINTER_ACTIVATION_CONSTRAINT = { distance: 8 } as const;\nconst MODIFIERS: Modifier[] = [restrictToVerticalAxis];\n\ninterface FilterListContentProps<D> {\n filterDefinitions?: Array<D>;\n filterStates: Map<string, FilterState>;\n onFilterStateChanged: (\n filterKey: string,\n state: FilterState,\n ) => void;\n onFilterRemoved?: (filterKey: string) => void;\n renderInput: RenderFilterInput<D>;\n getFilterKey: (definition: D) => string;\n getFilterLabel: (definition: D) => string;\n enableSorting?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function FilterListContent<D>({\n filterDefinitions,\n filterStates,\n onFilterStateChanged,\n onFilterRemoved,\n renderInput,\n getFilterKey,\n getFilterLabel,\n enableSorting,\n className,\n style,\n}: FilterListContentProps<D>): React.ReactElement {\n const [internalOrder, setInternalOrder] = useState<Array<D>>(\n () => filterDefinitions ?? [],\n );\n const [activeId, setActiveId] = useState<UniqueIdentifier | null>(null);\n\n useEffect(() => {\n if (filterDefinitions) {\n setInternalOrder(filterDefinitions);\n }\n }, [filterDefinitions]);\n\n const renderDefinitions = enableSorting ? internalOrder : filterDefinitions;\n\n const sortableIds = useMemo(\n () =>\n enableSorting\n ? internalOrder.map((def) => getFilterKey(def))\n : [],\n [enableSorting, internalOrder, getFilterKey],\n );\n\n const pointerSensor = useSensor(PointerSensor, {\n activationConstraint: POINTER_ACTIVATION_CONSTRAINT,\n });\n const keyboardSensor = useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n });\n const sensors = useSensors(pointerSensor, keyboardSensor);\n\n const activeIndex = activeId != null\n ? sortableIds.indexOf(String(activeId))\n : -1;\n const activeDefinition = activeIndex >= 0\n ? internalOrder[activeIndex]\n : undefined;\n\n const activeFilterKey = useMemo(\n () => activeDefinition ? getFilterKey(activeDefinition) : undefined,\n [activeDefinition, getFilterKey],\n );\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n setActiveId(event.active.id);\n }, []);\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) {\n return;\n }\n const oldIndex = sortableIds.indexOf(String(active.id));\n const newIndex = sortableIds.indexOf(String(over.id));\n if (oldIndex !== -1 && newIndex !== -1) {\n setInternalOrder(arrayMove(internalOrder, oldIndex, newIndex));\n }\n },\n [internalOrder, sortableIds],\n );\n\n const handleDragCancel = useCallback(() => {\n setActiveId(null);\n }, []);\n\n const announcements = useMemo<Announcements>(\n () => ({\n onDragStart({ active }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 ? internalOrder[idx] : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n return `Picked up ${label} filter`;\n },\n onDragOver({ over }) {\n if (!over) {\n return \"Not over a droppable area\";\n }\n const overIdx = sortableIds.indexOf(String(over.id));\n return `Moved to position ${overIdx + 1} of ${sortableIds.length}`;\n },\n onDragEnd({ active, over }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 ? internalOrder[idx] : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n if (over && active.id !== over.id) {\n const overIdx = sortableIds.indexOf(String(over.id));\n return `Dropped ${label} filter at position ${overIdx + 1}`;\n }\n return `Dropped ${label} filter back in its original position`;\n },\n onDragCancel({ active }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 ? internalOrder[idx] : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n return `Cancelled dragging ${label} filter`;\n },\n }),\n [internalOrder, sortableIds, getFilterLabel],\n );\n\n const accessibility = useMemo(\n () => ({ announcements }),\n [announcements],\n );\n\n if (!renderDefinitions || renderDefinitions.length === 0) {\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n data-empty=\"true\"\n />\n );\n }\n\n if (enableSorting) {\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n >\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={MODIFIERS}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n onDragCancel={handleDragCancel}\n accessibility={accessibility}\n >\n <SortableContext\n items={sortableIds}\n strategy={verticalListSortingStrategy}\n >\n {internalOrder.map((definition, index) => {\n const id = sortableIds[index];\n const filterKey = getFilterKey(definition);\n const label = getFilterLabel(definition);\n const state = filterStates.get(filterKey);\n\n return (\n <SortableFilterListItem\n key={id}\n id={id}\n definition={definition}\n filterKey={filterKey}\n label={label}\n filterState={state}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n />\n );\n })}\n </SortableContext>\n\n <DragOverlay\n dropAnimation={null}\n className={styles.dragOverlay}\n >\n {activeDefinition && activeFilterKey && (\n <FilterListItem\n definition={activeDefinition}\n filterKey={activeFilterKey}\n label={getFilterLabel(activeDefinition)}\n filterState={filterStates.get(activeFilterKey)}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n />\n )}\n </DragOverlay>\n </DndContext>\n </div>\n );\n }\n\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n >\n {renderDefinitions.map((definition) => {\n const filterKey = getFilterKey(definition);\n const state = filterStates.get(filterKey);\n\n return (\n <FilterListItem\n key={filterKey}\n definition={definition}\n filterKey={filterKey}\n label={getFilterLabel(definition)}\n filterState={state}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SACEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,cAAc,EACdC,aAAa,EACbC,SAAS,EACTC,UAAU,QACL,eAAe;AACtB,SACEC,SAAS,EACTC,eAAe,EACfC,2BAA2B,EAC3BC,2BAA2B,QACtB,mBAAmB;AAC1B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAGxE,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,sBAAsB,QAAQ,6BAA6B;AAEpE,MAAMC,sBAAgC,GAAGA,CAAC;EAAEC;AAAU,CAAC,MAAM;EAC3D,GAAGA,SAAS;EACZC,CAA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EAAExB,UAAU,CAACM,MAAM,CAAC2D,OAAO,EAAEzC,SAAS,CAAE;IACjDC,KAAK,EAAEA;EAAM,GAEZK,iBAAiB,CAACE,GAAG,CAAEsC,UAAU,IAAK;IACrC,MAAME,SAAS,GAAGnD,YAAY,CAACiD,UAAU,CAAC;IAC1C,MAAMG,KAAK,GAAGxD,YAAY,CAACyD,GAAG,CAACF,SAAS,CAAC;IAEzC,oBACEvE,KAAA,CAAA+D,aAAA,CAACzD,cAAc;MACboE,GAAG,EAAEH,SAAU;MACfF,UAAU,EAAEA,UAAW;MACvBE,SAAS,EAAEA,SAAU;MACrBf,KAAK,EAAEnC,cAAc,CAACgD,UAAU,CAAE;MAClCM,WAAW,EAAEH,KAAM;MACnBvD,oBAAoB,EAAEA,oBAAqB;MAC3CC,eAAe,EAAEA,eAAgB;MACjCC,WAAW,EAAEA;IAAY,CAC1B,CAAC;EAEN,CAAC,CACE,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"FilterListContent.js","names":["closestCenter","DndContext","DragOverlay","KeyboardSensor","PointerSensor","useSensor","useSensors","arrayMove","SortableContext","sortableKeyboardCoordinates","verticalListSortingStrategy","classnames","React","useCallback","useMemo","useState","styles","FilterListItem","SortableFilterListItem","restrictToVerticalAxis","transform","x","POINTER_ACTIVATION_CONSTRAINT","distance","MODIFIERS","DRAG_OVERLAY_HANDLE_ATTRIBUTES","role","tabIndex","undefined","FilterListContent","filterDefinitions","filterStates","onFilterStateChanged","onFilterRemoved","renderInput","getFilterKey","getFilterLabel","enableSorting","className","style","dragOrder","setDragOrder","activeId","setActiveId","renderDefinitions","defsByKey","Map","map","d","ordered","key","def","get","push","delete","values","sortableIds","pointerSensor","activationConstraint","keyboardSensor","coordinateGetter","sensors","activeIndex","indexOf","String","activeDefinition","activeFilterKey","handleDragStart","event","active","id","handleDragEnd","over","oldIndex","newIndex","handleDragCancel","announcements","onDragStart","idx","label","onDragOver","overIdx","length","onDragEnd","onDragCancel","accessibility","createElement","content","collisionDetection","modifiers","items","strategy","definition","index","filterKey","state","filterState","dropAnimation","dragOverlay","dragHandleAttributes"],"sources":["FilterListContent.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n Announcements,\n DragEndEvent,\n DraggableAttributes,\n DragStartEvent,\n Modifier,\n UniqueIdentifier,\n} from \"@dnd-kit/core\";\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport classnames from \"classnames\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { FilterState } from \"../FilterListItemApi.js\";\nimport type { RenderFilterInput } from \"./BaseFilterListApi.js\";\nimport styles from \"./FilterListContent.module.css\";\nimport { FilterListItem } from \"./FilterListItem.js\";\nimport { SortableFilterListItem } from \"./SortableFilterListItem.js\";\n\nconst restrictToVerticalAxis: Modifier = ({ transform }) => ({\n ...transform,\n x: 0,\n});\n\nconst POINTER_ACTIVATION_CONSTRAINT = { distance: 8 } as const;\nconst MODIFIERS: Modifier[] = [restrictToVerticalAxis];\n\nconst DRAG_OVERLAY_HANDLE_ATTRIBUTES: DraggableAttributes = {\n role: \"button\",\n tabIndex: -1,\n \"aria-disabled\": true,\n \"aria-pressed\": undefined,\n \"aria-roledescription\": \"sortable\",\n \"aria-describedby\": \"\",\n};\n\ninterface FilterListContentProps<D> {\n filterDefinitions?: Array<D>;\n filterStates: Map<string, FilterState>;\n onFilterStateChanged: (\n filterKey: string,\n state: FilterState,\n ) => void;\n onFilterRemoved?: (filterKey: string) => void;\n renderInput: RenderFilterInput<D>;\n getFilterKey: (definition: D) => string;\n getFilterLabel: (definition: D) => string;\n enableSorting?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function FilterListContent<D>({\n filterDefinitions,\n filterStates,\n onFilterStateChanged,\n onFilterRemoved,\n renderInput,\n getFilterKey,\n getFilterLabel,\n enableSorting,\n className,\n style,\n}: FilterListContentProps<D>): React.ReactElement {\n const [dragOrder, setDragOrder] = useState<string[] | null>(null);\n const [activeId, setActiveId] = useState<UniqueIdentifier | null>(null);\n\n const renderDefinitions = useMemo(() => {\n if (!enableSorting || !dragOrder || !filterDefinitions) {\n return filterDefinitions;\n }\n const defsByKey = new Map(filterDefinitions.map(d => [getFilterKey(d), d]));\n const ordered: Array<D> = [];\n for (const key of dragOrder) {\n const def = defsByKey.get(key);\n if (def) {\n ordered.push(def);\n defsByKey.delete(key);\n }\n }\n for (const def of defsByKey.values()) {\n ordered.push(def);\n }\n return ordered;\n }, [enableSorting, dragOrder, filterDefinitions, getFilterKey]);\n\n const sortableIds = useMemo(\n () =>\n enableSorting && renderDefinitions\n ? renderDefinitions.map((def) => getFilterKey(def))\n : [],\n [enableSorting, renderDefinitions, getFilterKey],\n );\n\n const pointerSensor = useSensor(PointerSensor, {\n activationConstraint: POINTER_ACTIVATION_CONSTRAINT,\n });\n const keyboardSensor = useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n });\n const sensors = useSensors(pointerSensor, keyboardSensor);\n\n const activeIndex = activeId != null\n ? sortableIds.indexOf(String(activeId))\n : -1;\n const activeDefinition = activeIndex >= 0 && renderDefinitions\n ? renderDefinitions[activeIndex]\n : undefined;\n\n const activeFilterKey = useMemo(\n () => activeDefinition ? getFilterKey(activeDefinition) : undefined,\n [activeDefinition, getFilterKey],\n );\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n setActiveId(event.active.id);\n }, []);\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) {\n return;\n }\n const oldIndex = sortableIds.indexOf(String(active.id));\n const newIndex = sortableIds.indexOf(String(over.id));\n if (oldIndex !== -1 && newIndex !== -1) {\n setDragOrder(arrayMove(sortableIds, oldIndex, newIndex));\n }\n },\n [sortableIds],\n );\n\n const handleDragCancel = useCallback(() => {\n setActiveId(null);\n }, []);\n\n const announcements = useMemo<Announcements>(\n () => ({\n onDragStart({ active }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 && renderDefinitions\n ? renderDefinitions[idx]\n : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n return `Picked up ${label} filter`;\n },\n onDragOver({ over }) {\n if (!over) {\n return \"Not over a droppable area\";\n }\n const overIdx = sortableIds.indexOf(String(over.id));\n return `Moved to position ${overIdx + 1} of ${sortableIds.length}`;\n },\n onDragEnd({ active, over }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 && renderDefinitions\n ? renderDefinitions[idx]\n : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n if (over && active.id !== over.id) {\n const overIdx = sortableIds.indexOf(String(over.id));\n return `Dropped ${label} filter at position ${overIdx + 1}`;\n }\n return `Dropped ${label} filter back in its original position`;\n },\n onDragCancel({ active }) {\n const idx = sortableIds.indexOf(String(active.id));\n const def = idx >= 0 && renderDefinitions\n ? renderDefinitions[idx]\n : undefined;\n const label = def ? getFilterLabel(def) : \"filter\";\n return `Cancelled dragging ${label} filter`;\n },\n }),\n [renderDefinitions, sortableIds, getFilterLabel],\n );\n\n const accessibility = useMemo(\n () => ({ announcements }),\n [announcements],\n );\n\n if (!renderDefinitions || renderDefinitions.length === 0) {\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n data-empty=\"true\"\n />\n );\n }\n\n if (enableSorting) {\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n >\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={MODIFIERS}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n onDragCancel={handleDragCancel}\n accessibility={accessibility}\n >\n <SortableContext\n items={sortableIds}\n strategy={verticalListSortingStrategy}\n >\n {renderDefinitions.map((definition, index) => {\n const id = sortableIds[index];\n const filterKey = getFilterKey(definition);\n const label = getFilterLabel(definition);\n const state = filterStates.get(filterKey);\n\n return (\n <SortableFilterListItem\n key={id}\n id={id}\n definition={definition}\n filterKey={filterKey}\n label={label}\n filterState={state}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n />\n );\n })}\n </SortableContext>\n\n <DragOverlay\n dropAnimation={null}\n className={styles.dragOverlay}\n >\n {activeDefinition && activeFilterKey && (\n <FilterListItem\n definition={activeDefinition}\n filterKey={activeFilterKey}\n label={getFilterLabel(activeDefinition)}\n filterState={filterStates.get(activeFilterKey)}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n dragHandleAttributes={DRAG_OVERLAY_HANDLE_ATTRIBUTES}\n />\n )}\n </DragOverlay>\n </DndContext>\n </div>\n );\n }\n\n return (\n <div\n className={classnames(styles.content, className)}\n style={style}\n >\n {renderDefinitions.map((definition) => {\n const filterKey = getFilterKey(definition);\n const state = filterStates.get(filterKey);\n\n return (\n <FilterListItem\n key={filterKey}\n definition={definition}\n filterKey={filterKey}\n label={getFilterLabel(definition)}\n filterState={state}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SACEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,cAAc,EACdC,aAAa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