@osdk/react-components 0.2.0-beta.17 → 0.2.0-beta.18

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 (123) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +86 -0
  3. package/build/browser/action-form/ActionForm.js +109 -0
  4. package/build/browser/action-form/ActionForm.js.map +1 -0
  5. package/build/browser/action-form/ActionFormApi.js.map +1 -1
  6. package/build/browser/action-form/BaseForm.js +74 -0
  7. package/build/browser/action-form/BaseForm.js.map +1 -0
  8. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  9. package/build/browser/action-form/fields/FieldBridge.js +45 -0
  10. package/build/browser/action-form/fields/FieldBridge.js.map +1 -0
  11. package/build/browser/action-form/fields/FormFieldRenderer.js +68 -0
  12. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -0
  13. package/build/browser/action-form/fields/TextInputField.js +38 -0
  14. package/build/browser/action-form/fields/TextInputField.js.map +1 -0
  15. package/build/browser/action-form/utils/coerceFieldValue.js +93 -0
  16. package/build/browser/action-form/utils/coerceFieldValue.js.map +1 -0
  17. package/build/browser/action-form/utils/getDefaultFieldComponent.js +56 -0
  18. package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +1 -0
  19. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +33 -0
  20. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
  21. package/build/browser/filter-list/base/BaseFilterList.js +23 -11
  22. package/build/browser/filter-list/base/BaseFilterList.js.map +1 -1
  23. package/build/browser/filter-list/base/FilterIcons.js +48 -13
  24. package/build/browser/filter-list/base/FilterIcons.js.map +1 -1
  25. package/build/browser/filter-list/base/FilterList.module.css +57 -13
  26. package/build/browser/filter-list/base/FilterList.module.css.js +5 -2
  27. package/build/browser/filter-list/base/FilterListHeader.js +10 -15
  28. package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
  29. package/build/browser/filter-list/base/FilterListHeader.module.css +13 -41
  30. package/build/browser/filter-list/base/FilterListHeader.module.css.js +1 -4
  31. package/build/browser/filter-list/hooks/useFilterListState.js +29 -10
  32. package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
  33. package/build/browser/filter-list/utils/assertUnreachable.js +1 -8
  34. package/build/browser/filter-list/utils/assertUnreachable.js.map +1 -1
  35. package/build/browser/filter-list/utils/filterStateToWhereClause.js +119 -104
  36. package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  37. package/build/browser/object-table/TableHeader.js +4 -1
  38. package/build/browser/object-table/TableHeader.js.map +1 -1
  39. package/build/browser/object-table/TableHeader.module.css +2 -1
  40. package/build/browser/object-table/TableHeader.module.css.js +1 -0
  41. package/build/browser/shared/assertUnreachable.js +25 -0
  42. package/build/browser/shared/assertUnreachable.js.map +1 -0
  43. package/build/browser/shared/typedMemo.js +25 -0
  44. package/build/browser/shared/typedMemo.js.map +1 -0
  45. package/build/browser/styles.css +72 -55
  46. package/build/cjs/public/experimental.cjs +289 -240
  47. package/build/cjs/public/experimental.cjs.map +1 -1
  48. package/build/cjs/public/experimental.css +64 -47
  49. package/build/cjs/public/experimental.css.map +1 -1
  50. package/build/esm/action-form/ActionForm.js +109 -0
  51. package/build/esm/action-form/ActionForm.js.map +1 -0
  52. package/build/esm/action-form/ActionFormApi.js.map +1 -1
  53. package/build/esm/action-form/BaseForm.js +74 -0
  54. package/build/esm/action-form/BaseForm.js.map +1 -0
  55. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  56. package/build/esm/action-form/fields/FieldBridge.js +45 -0
  57. package/build/esm/action-form/fields/FieldBridge.js.map +1 -0
  58. package/build/esm/action-form/fields/FormFieldRenderer.js +68 -0
  59. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -0
  60. package/build/esm/action-form/fields/TextInputField.js +38 -0
  61. package/build/esm/action-form/fields/TextInputField.js.map +1 -0
  62. package/build/esm/action-form/utils/coerceFieldValue.js +93 -0
  63. package/build/esm/action-form/utils/coerceFieldValue.js.map +1 -0
  64. package/build/esm/action-form/utils/getDefaultFieldComponent.js +56 -0
  65. package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +1 -0
  66. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +33 -0
  67. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -0
  68. package/build/esm/filter-list/base/BaseFilterList.js +23 -11
  69. package/build/esm/filter-list/base/BaseFilterList.js.map +1 -1
  70. package/build/esm/filter-list/base/FilterIcons.js +48 -13
  71. package/build/esm/filter-list/base/FilterIcons.js.map +1 -1
  72. package/build/esm/filter-list/base/FilterList.module.css +57 -13
  73. package/build/esm/filter-list/base/FilterListHeader.js +10 -15
  74. package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
  75. package/build/esm/filter-list/base/FilterListHeader.module.css +13 -41
  76. package/build/esm/filter-list/hooks/useFilterListState.js +29 -10
  77. package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
  78. package/build/esm/filter-list/utils/assertUnreachable.js +1 -8
  79. package/build/esm/filter-list/utils/assertUnreachable.js.map +1 -1
  80. package/build/esm/filter-list/utils/filterStateToWhereClause.js +119 -104
  81. package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
  82. package/build/esm/object-table/TableHeader.js +4 -1
  83. package/build/esm/object-table/TableHeader.js.map +1 -1
  84. package/build/esm/object-table/TableHeader.module.css +2 -1
  85. package/build/esm/shared/assertUnreachable.js +25 -0
  86. package/build/esm/shared/assertUnreachable.js.map +1 -0
  87. package/build/esm/shared/typedMemo.js +25 -0
  88. package/build/esm/shared/typedMemo.js.map +1 -0
  89. package/build/types/action-form/ActionForm.d.ts +4 -0
  90. package/build/types/action-form/ActionForm.d.ts.map +1 -0
  91. package/build/types/action-form/ActionFormApi.d.ts +48 -32
  92. package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
  93. package/build/types/action-form/BaseForm.d.ts +3 -0
  94. package/build/types/action-form/BaseForm.d.ts.map +1 -0
  95. package/build/types/action-form/FormFieldApi.d.ts +58 -18
  96. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  97. package/build/types/action-form/fields/FieldBridge.d.ts +9 -0
  98. package/build/types/action-form/fields/FieldBridge.d.ts.map +1 -0
  99. package/build/types/action-form/fields/FormFieldRenderer.d.ts +8 -0
  100. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -0
  101. package/build/types/action-form/fields/TextInputField.d.ts +3 -0
  102. package/build/types/action-form/fields/TextInputField.d.ts.map +1 -0
  103. package/build/types/action-form/utils/coerceFieldValue.d.ts +10 -0
  104. package/build/types/action-form/utils/coerceFieldValue.d.ts.map +1 -0
  105. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +6 -0
  106. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +1 -0
  107. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +6 -0
  108. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -0
  109. package/build/types/filter-list/base/BaseFilterList.d.ts.map +1 -1
  110. package/build/types/filter-list/base/FilterIcons.d.ts +7 -0
  111. package/build/types/filter-list/base/FilterIcons.d.ts.map +1 -1
  112. package/build/types/filter-list/base/FilterListHeader.d.ts.map +1 -1
  113. package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -1
  114. package/build/types/filter-list/utils/assertUnreachable.d.ts +1 -6
  115. package/build/types/filter-list/utils/assertUnreachable.d.ts.map +1 -1
  116. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +5 -1
  117. package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -1
  118. package/build/types/object-table/TableHeader.d.ts.map +1 -1
  119. package/build/types/shared/assertUnreachable.d.ts +6 -0
  120. package/build/types/shared/assertUnreachable.d.ts.map +1 -0
  121. package/build/types/shared/typedMemo.d.ts +6 -0
  122. package/build/types/shared/typedMemo.d.ts.map +1 -0
  123. package/package.json +7 -6
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * Coerces a raw form field value to match the expected type for the given
19
+ * field type. Returns `undefined` when coercion fails
20
+ * (e.g. non-numeric string for a number field).
21
+ *
22
+ * Complex types (object, objectSet, struct, interface) are passed through
23
+ * unchanged since they cannot be meaningfully coerced.
24
+ */
25
+ export function coerceFieldValue(parameterType, rawValue) {
26
+ if (rawValue == null) {
27
+ return undefined;
28
+ }
29
+ if (parameterType == null) {
30
+ return rawValue;
31
+ }
32
+
33
+ // TODO: Handle complex object types later
34
+ if (typeof parameterType === "object") {
35
+ return rawValue;
36
+ }
37
+ switch (parameterType) {
38
+ case "string":
39
+ case "marking":
40
+ case "geohash":
41
+ case "geoshape":
42
+ case "objectType":
43
+ return typeof rawValue === "string" ? rawValue : String(rawValue);
44
+ case "integer":
45
+ case "long":
46
+ {
47
+ const maybeNumber = extractNumber(rawValue);
48
+ return maybeNumber != null ? Math.trunc(maybeNumber) : undefined;
49
+ }
50
+ case "double":
51
+ {
52
+ return extractNumber(rawValue);
53
+ }
54
+ case "boolean":
55
+ {
56
+ if (typeof rawValue === "boolean") {
57
+ return rawValue;
58
+ }
59
+ if (rawValue === "true") return true;
60
+ if (rawValue === "false") return false;
61
+ return undefined;
62
+ }
63
+ case "datetime":
64
+ case "timestamp":
65
+ {
66
+ if (typeof rawValue === "string") {
67
+ return Number.isNaN(Date.parse(rawValue)) ? undefined : rawValue;
68
+ }
69
+ if (rawValue instanceof Date) {
70
+ return rawValue.toISOString();
71
+ }
72
+ return undefined;
73
+ }
74
+ case "attachment":
75
+ case "mediaReference":
76
+ return rawValue;
77
+ default:
78
+ return rawValue;
79
+ }
80
+ }
81
+ function extractNumber(rawValue) {
82
+ if (typeof rawValue === "number") {
83
+ return rawValue;
84
+ }
85
+ if (typeof rawValue === "string") {
86
+ const trimmed = rawValue.trim();
87
+ if (trimmed === "") return undefined;
88
+ const parsed = Number(trimmed);
89
+ return Number.isNaN(parsed) ? undefined : parsed;
90
+ }
91
+ return undefined;
92
+ }
93
+ //# sourceMappingURL=coerceFieldValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerceFieldValue.js","names":["coerceFieldValue","parameterType","rawValue","undefined","String","maybeNumber","extractNumber","Math","trunc","Number","isNaN","Date","parse","toISOString","trimmed","trim","parsed"],"sources":["coerceFieldValue.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 { FieldType } from \"../FormFieldApi.js\";\n\n/**\n * Coerces a raw form field value to match the expected type for the given\n * field type. Returns `undefined` when coercion fails\n * (e.g. non-numeric string for a number field).\n *\n * Complex types (object, objectSet, struct, interface) are passed through\n * unchanged since they cannot be meaningfully coerced.\n */\nexport function coerceFieldValue(\n parameterType: FieldType | undefined,\n rawValue: unknown,\n): unknown {\n if (rawValue == null) {\n return undefined;\n }\n\n if (parameterType == null) {\n return rawValue;\n }\n\n // TODO: Handle complex object types later\n if (typeof parameterType === \"object\") {\n return rawValue;\n }\n\n switch (parameterType) {\n case \"string\":\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n return typeof rawValue === \"string\" ? rawValue : String(rawValue);\n\n case \"integer\":\n case \"long\": {\n const maybeNumber = extractNumber(rawValue);\n return maybeNumber != null ? Math.trunc(maybeNumber) : undefined;\n }\n\n case \"double\": {\n return extractNumber(rawValue);\n }\n\n case \"boolean\": {\n if (typeof rawValue === \"boolean\") {\n return rawValue;\n }\n if (rawValue === \"true\") return true;\n if (rawValue === \"false\") return false;\n return undefined;\n }\n\n case \"datetime\":\n case \"timestamp\": {\n if (typeof rawValue === \"string\") {\n return Number.isNaN(Date.parse(rawValue)) ? undefined : rawValue;\n }\n if (rawValue instanceof Date) {\n return rawValue.toISOString();\n }\n return undefined;\n }\n\n case \"attachment\":\n case \"mediaReference\":\n return rawValue;\n\n default:\n return rawValue;\n }\n}\n\nfunction extractNumber(rawValue: unknown): number | undefined {\n if (typeof rawValue === \"number\") {\n return rawValue;\n }\n if (typeof rawValue === \"string\") {\n const trimmed = rawValue.trim();\n if (trimmed === \"\") return undefined;\n const parsed = Number(trimmed);\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n return undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAC9BC,aAAoC,EACpCC,QAAiB,EACR;EACT,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAOC,SAAS;EAClB;EAEA,IAAIF,aAAa,IAAI,IAAI,EAAE;IACzB,OAAOC,QAAQ;EACjB;;EAEA;EACA,IAAI,OAAOD,aAAa,KAAK,QAAQ,EAAE;IACrC,OAAOC,QAAQ;EACjB;EAEA,QAAQD,aAAa;IACnB,KAAK,QAAQ;IACb,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,YAAY;MACf,OAAO,OAAOC,QAAQ,KAAK,QAAQ,G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AAM,CAACK,OAAO,CAAC;IAC9B,OAAOL,MAAM,CAACC,KAAK,CAACM,MAAM,CAAC,GAAGb,SAAS,GAAGa,MAAM;EAClD;EACA,OAAOb,SAAS;AAClB","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { assertUnreachable } from "../../shared/assertUnreachable.js";
18
+ /**
19
+ * Maps an ActionMetadata parameter type to the default FieldComponent.
20
+ */
21
+ export function getDefaultFieldComponent(paramType) {
22
+ if (typeof paramType === "object") {
23
+ switch (paramType.type) {
24
+ case "objectSet":
25
+ return "OBJECT_SET";
26
+ case "object":
27
+ case "interface":
28
+ return "DROPDOWN";
29
+ case "struct":
30
+ return "TEXT_INPUT";
31
+ }
32
+ }
33
+ switch (paramType) {
34
+ case "string":
35
+ case "marking":
36
+ case "geohash":
37
+ case "geoshape":
38
+ case "objectType":
39
+ return "TEXT_INPUT";
40
+ case "boolean":
41
+ return "DROPDOWN";
42
+ case "integer":
43
+ case "double":
44
+ case "long":
45
+ return "NUMBER_INPUT";
46
+ case "datetime":
47
+ case "timestamp":
48
+ return "DATETIME_PICKER";
49
+ case "attachment":
50
+ case "mediaReference":
51
+ return "FILE_PICKER";
52
+ default:
53
+ return assertUnreachable(paramType);
54
+ }
55
+ }
56
+ //# sourceMappingURL=getDefaultFieldComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultFieldComponent.js","names":["assertUnreachable","getDefaultFieldComponent","paramType","type"],"sources":["getDefaultFieldComponent.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 { ActionMetadata } from \"@osdk/api\";\nimport { assertUnreachable } from \"../../shared/assertUnreachable.js\";\nimport type { FieldComponent } from \"../FormFieldApi.js\";\n\n/**\n * Maps an ActionMetadata parameter type to the default FieldComponent.\n */\nexport function getDefaultFieldComponent(\n paramType: ActionMetadata.Parameter[\"type\"],\n): FieldComponent {\n if (typeof paramType === \"object\") {\n switch (paramType.type) {\n case \"objectSet\":\n return \"OBJECT_SET\";\n case \"object\":\n case \"interface\":\n return \"DROPDOWN\";\n case \"struct\":\n return \"TEXT_INPUT\";\n }\n }\n\n switch (paramType) {\n case \"string\":\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n return \"TEXT_INPUT\";\n case \"boolean\":\n return \"DROPDOWN\";\n case \"integer\":\n case \"double\":\n case \"long\":\n return \"NUMBER_INPUT\";\n case \"datetime\":\n case \"timestamp\":\n return \"DATETIME_PICKER\";\n case \"attachment\":\n case \"mediaReference\":\n return \"FILE_PICKER\";\n default:\n return assertUnreachable(paramType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,mCAAmC;AAGrE;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CACtCC,SAA2C,EAC3B;EAChB,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IACjC,QAAQA,SAAS,CAACC,IAAI;MACpB,KAAK,WAAW;QACd,OAAO,YAAY;MACrB,KAAK,QAAQ;MACb,KAAK,WAAW;QACd,OAAO,UAAU;MACnB,KAAK,QAAQ;QACX,OAAO,YAAY;IACvB;EACF;EAEA,QAAQD,SAAS;IACf,KAAK,QAAQ;IACb,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,UAAU;IACf,KAAK,YAAY;MACf,OAAO,YAAY;IACrB,KAAK,SAAS;MACZ,OAAO,UAAU;IACnB,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAO,cAAc;IACvB,KAAK,UAAU;IACf,KAAK,WAAW;MACd,OAAO,iBAAiB;IAC1B,KAAK,YAAY;IACjB,KAAK,gBAAgB;MACnB,OAAO,aAAa;IACtB;MACE,OAAOF,iBAAiB,CAACE,SAAS,CAAC;EACvC;AACF","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { getDefaultFieldComponent } from "./getDefaultFieldComponent.js";
18
+
19
+ /**
20
+ * Derives default field definitions from fetched ActionMetadata.
21
+ */
22
+ export function getDefaultFieldDefinitions(metadata) {
23
+ return Object.entries(metadata.parameters).map(([key, param]) => ({
24
+ // Object.entries erases key types; assertion bridges runtime string to FieldKey<Q>
25
+ fieldKey: key,
26
+ label: key,
27
+ // getDefaultFieldComponent returns FieldComponent (full union); TS can't verify
28
+ // it matches ValidFormFieldForPropertyType for a deferred generic Q
29
+ fieldComponent: getDefaultFieldComponent(param.type),
30
+ isRequired: !param.nullable
31
+ }));
32
+ }
33
+ //# sourceMappingURL=getDefaultFieldDefinitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultFieldDefinitions.js","names":["getDefaultFieldComponent","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","fieldKey","label","fieldComponent","type","isRequired","nullable"],"sources":["getDefaultFieldDefinitions.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 { ActionDefinition, ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameters,\n FieldDescriptorType,\n FieldKey,\n FormFieldDefinition,\n ValidFormFieldForPropertyType,\n} from \"../FormFieldApi.js\";\nimport { getDefaultFieldComponent } from \"./getDefaultFieldComponent.js\";\n\n/**\n * Derives default field definitions from fetched ActionMetadata.\n */\nexport function getDefaultFieldDefinitions<\n Q extends ActionDefinition<unknown>,\n>(metadata: ActionMetadata): ReadonlyArray<FormFieldDefinition<Q>> {\n return Object.entries(metadata.parameters).map(([key, param]) => ({\n // Object.entries erases key types; assertion bridges runtime string to FieldKey<Q>\n fieldKey: key as FieldKey<Q>,\n label: key,\n // getDefaultFieldComponent returns FieldComponent (full union); TS can't verify\n // it matches ValidFormFieldForPropertyType for a deferred generic Q\n fieldComponent: getDefaultFieldComponent(\n param.type,\n ) as ValidFormFieldForPropertyType<\n FieldDescriptorType<Q, keyof ActionParameters<Q>>\n >,\n isRequired: !param.nullable,\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,wBAAwB,QAAQ,+BAA+B;;AAExE;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAExCC,QAAwB,EAAyC;EACjE,OAAOC,MAAM,CAACC,OAAO,CAACF,QAAQ,CAACG,UAAU,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,MAAM;IAChE;IACAC,QAAQ,EAAEF,GAAkB;IAC5BG,KAAK,EAAEH,GAAG;IACV;IACA;IACAI,cAAc,EAAEX,wBAAwB,CACtCQ,KAAK,CAACI,IACR,CAEC;IACDC,UAAU,EAAE,CAACL,KAAK,CAACM;EACrB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
@@ -16,7 +16,8 @@
16
16
 
17
17
  import { Button } from "@base-ui/react/button";
18
18
  import classnames from "classnames";
19
- import React from "react";
19
+ import React, { useCallback } from "react";
20
+ import { ExpandIcon } from "./FilterIcons.js";
20
21
  import styles from "./FilterList.module.css.js";
21
22
  import { FilterListContent } from "./FilterListContent.js";
22
23
  import { FilterListHeader } from "./FilterListHeader.js";
@@ -42,8 +43,23 @@ export function BaseFilterList(props) {
42
43
  className,
43
44
  renderAddFilterButton
44
45
  } = props;
46
+ const handleExpand = useCallback(() => {
47
+ onCollapsedChange?.(false);
48
+ }, [onCollapsedChange]);
49
+ const isCollapsed = collapsed && onCollapsedChange != null;
45
50
  return /*#__PURE__*/React.createElement("div", {
46
- className: classnames(styles.filterList, className),
51
+ className: classnames(styles.filterList, className)
52
+ }, isCollapsed && /*#__PURE__*/React.createElement("div", {
53
+ className: styles.filterListCollapsed,
54
+ "data-collapsed": "true"
55
+ }, /*#__PURE__*/React.createElement(Button, {
56
+ className: styles.expandButton,
57
+ onClick: handleExpand,
58
+ "aria-label": "Expand filters"
59
+ }, /*#__PURE__*/React.createElement(ExpandIcon, null)), /*#__PURE__*/React.createElement("span", {
60
+ className: styles.collapsedLabel
61
+ }, title ?? "Filters")), /*#__PURE__*/React.createElement("div", {
62
+ className: classnames(styles.expandedContent, isCollapsed && styles.hiddenContent),
47
63
  "data-active-count": activeFilterCount
48
64
  }, (title || titleIcon || showResetButton || showActiveFilterCount || onCollapsedChange) && /*#__PURE__*/React.createElement(FilterListHeader, {
49
65
  title: title,
@@ -54,12 +70,7 @@ export function BaseFilterList(props) {
54
70
  onReset: onReset,
55
71
  showActiveFilterCount: showActiveFilterCount,
56
72
  activeFilterCount: activeFilterCount
57
- }), /*#__PURE__*/React.createElement("div", {
58
- className: styles.contentWrapper,
59
- "data-collapsed": collapsed
60
- }, /*#__PURE__*/React.createElement("div", {
61
- className: styles.contentInner
62
- }, /*#__PURE__*/React.createElement(FilterListContent, {
73
+ }), /*#__PURE__*/React.createElement(FilterListContent, {
63
74
  filterDefinitions: filterDefinitions,
64
75
  filterStates: filterStates,
65
76
  onFilterStateChanged: onFilterStateChanged,
@@ -68,11 +79,12 @@ export function BaseFilterList(props) {
68
79
  getFilterKey: getFilterKey,
69
80
  getFilterLabel: getFilterLabel,
70
81
  enableSorting: enableSorting
71
- }))), !collapsed && (renderAddFilterButton != null || onFilterAdded != null) && /*#__PURE__*/React.createElement("div", {
82
+ }), (renderAddFilterButton != null || onFilterAdded != null) && /*#__PURE__*/React.createElement("div", {
72
83
  className: styles.addButtonContainer
73
84
  }, renderAddFilterButton ? renderAddFilterButton() : /*#__PURE__*/React.createElement(Button, {
74
85
  type: "button",
75
- className: styles.addButton
76
- }, "+ Add filter")));
86
+ className: styles.addButton,
87
+ onClick: onFilterAdded
88
+ }, "+ Add filter"))));
77
89
  }
78
90
  //# sourceMappingURL=BaseFilterList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseFilterList.js","names":["Button","classnames","React","styles","FilterListContent","FilterListHeader","BaseFilterList","props","title","titleIcon","collapsed","onCollapsedChange","filterDefinitions","filterStates","onFilterStateChanged","renderInput","getFilterKey","getFilterLabel","activeFilterCount","onReset","onFilterAdded","onFilterRemoved","showResetButton","showActiveFilterCount","enableSorting","className","renderAddFilterButton","createElement","filterList","contentWrapper","contentInner","addButtonContainer","type","addButton"],"sources":["BaseFilterList.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 { Button } from \"@base-ui/react/button\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport type { BaseFilterListProps } from \"./BaseFilterListApi.js\";\nimport styles from \"./FilterList.module.css\";\nimport { FilterListContent } from \"./FilterListContent.js\";\nimport { FilterListHeader } from \"./FilterListHeader.js\";\n\nexport function BaseFilterList<D>(\n props: BaseFilterListProps<D>,\n): React.ReactElement {\n const {\n title,\n titleIcon,\n collapsed = false,\n onCollapsedChange,\n filterDefinitions,\n filterStates,\n onFilterStateChanged,\n renderInput,\n getFilterKey,\n getFilterLabel,\n activeFilterCount,\n onReset,\n onFilterAdded,\n onFilterRemoved,\n showResetButton = false,\n showActiveFilterCount = false,\n enableSorting,\n className,\n renderAddFilterButton,\n } = props;\n\n const showHeader = title || titleIcon || showResetButton\n || showActiveFilterCount || onCollapsedChange;\n\n const showAddButton = renderAddFilterButton != null || onFilterAdded != null;\n\n return (\n <div\n className={classnames(styles.filterList, className)}\n data-active-count={activeFilterCount}\n >\n {showHeader && (\n <FilterListHeader\n title={title}\n titleIcon={titleIcon}\n collapsed={collapsed}\n onCollapsedChange={onCollapsedChange}\n showResetButton={showResetButton}\n onReset={onReset}\n showActiveFilterCount={showActiveFilterCount}\n activeFilterCount={activeFilterCount}\n />\n )}\n\n <div\n className={styles.contentWrapper}\n data-collapsed={collapsed}\n >\n <div className={styles.contentInner}>\n <FilterListContent\n filterDefinitions={filterDefinitions}\n filterStates={filterStates}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n getFilterKey={getFilterKey}\n getFilterLabel={getFilterLabel}\n enableSorting={enableSorting}\n />\n </div>\n </div>\n\n {!collapsed && showAddButton && (\n <div className={styles.addButtonContainer}>\n {renderAddFilterButton\n ? renderAddFilterButton()\n : (\n <Button type=\"button\" className={styles.addButton}>\n + Add filter\n </Button>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,cAAcA,CAC5BC,KAA6B,EACT;EACpB,MAAM;IACJC,KAAK;IACLC,SAAS;IACTC,SAAS,GAAG,KAAK;IACjBC,iBAAiB;IACjBC,iBAAiB;IACjBC,YAAY;IACZC,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC,cAAc;IACdC,iBAAiB;IACjBC,OAAO;IACPC,aAAa;IACbC,eAAe;IACfC,eAAe,GAAG,KAAK;IACvBC,qBAAqB,GAAG,KAAK;IAC7BC,aAAa;IACbC,SAAS;IACTC;EACF,CAAC,GAAGnB,KAAK;EAOT,oBACEL,KAAA,CAAAyB,aAAA;IACEF,SAAS,EAAExB,UAAU,CAACE,MAAM,CAACyB,UAAU,EAAEH,SAAS,CAAE;IACpD,qBAAmBP;EAAkB,GAEpC,CAVcV,KAAK,IAAIC,SAAS,IAAIa,eAAe,IACnDC,qBAAqB,IAAIZ,iBAAiB,kBAUzCT,KAAA,CAAAyB,aAAA,CAACtB,gBAAgB;IACfG,KAAK,EAAEA,KAAM;IACbC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBC,iBAAiB,EAAEA,iBAAkB;IACrCW,eAAe,EAAEA,eAAgB;IACjCH,OAAO,EAAEA,OAAQ;IACjBI,qBAAqB,EAAEA,qBAAsB;IAC7CL,iBAAiB,EAAEA;EAAkB,CACtC,CACF,eAEDhB,KAAA,CAAAyB,aAAA;IACEF,SAAS,EAAEtB,MAAM,CAAC0B,cAAe;IACjC,kBAAgBnB;EAAU,gBAE1BR,KAAA,CAAAyB,aAAA;IAAKF,SAAS,EAAEtB,MAAM,CAAC2B;EAAa,gBAClC5B,KAAA,CAAAyB,aAAA,CAACvB,iBAAiB;IAChBQ,iBAAiB,EAAEA,iBAAkB;IACrCC,YAAY,EAAEA,YAAa;IAC3BC,oBAAoB,EAAEA,oBAAqB;IAC3CO,eAAe,EAAEA,eAAgB;IACjCN,WAAW,EAAEA,WAAY;IACzBC,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/BO,aAAa,EAAEA;EAAc,CAC9B,CACE,CACF,CAAC,EAEL,CAACd,SAAS,KAtCOgB,qBAAqB,IAAI,IAAI,IAAIN,aAAa,IAAI,IAAI,CAsC5C,iBAC1BlB,KAAA,CAAAyB,aAAA;IAAKF,SAAS,EAAEtB,MAAM,CAAC4B;EAAmB,GACvCL,qBAAqB,GAClBA,qBAAqB,CAAC,CAAC,gBAEvBxB,KAAA,CAAAyB,aAAA,CAAC3B,MAAM;IAACgC,IAAI,EAAC,QAAQ;IAACP,SAAS,EAAEtB,MAAM,CAAC8B;EAAU,GAAC,cAE3C,CAET,CAEJ,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"BaseFilterList.js","names":["Button","classnames","React","useCallback","ExpandIcon","styles","FilterListContent","FilterListHeader","BaseFilterList","props","title","titleIcon","collapsed","onCollapsedChange","filterDefinitions","filterStates","onFilterStateChanged","renderInput","getFilterKey","getFilterLabel","activeFilterCount","onReset","onFilterAdded","onFilterRemoved","showResetButton","showActiveFilterCount","enableSorting","className","renderAddFilterButton","handleExpand","isCollapsed","createElement","filterList","filterListCollapsed","expandButton","onClick","collapsedLabel","expandedContent","hiddenContent","addButtonContainer","type","addButton"],"sources":["BaseFilterList.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 { Button } from \"@base-ui/react/button\";\nimport classnames from \"classnames\";\nimport React, { useCallback } from \"react\";\nimport type { BaseFilterListProps } from \"./BaseFilterListApi.js\";\nimport { ExpandIcon } from \"./FilterIcons.js\";\nimport styles from \"./FilterList.module.css\";\nimport { FilterListContent } from \"./FilterListContent.js\";\nimport { FilterListHeader } from \"./FilterListHeader.js\";\n\nexport function BaseFilterList<D>(\n props: BaseFilterListProps<D>,\n): React.ReactElement {\n const {\n title,\n titleIcon,\n collapsed = false,\n onCollapsedChange,\n filterDefinitions,\n filterStates,\n onFilterStateChanged,\n renderInput,\n getFilterKey,\n getFilterLabel,\n activeFilterCount,\n onReset,\n onFilterAdded,\n onFilterRemoved,\n showResetButton = false,\n showActiveFilterCount = false,\n enableSorting,\n className,\n renderAddFilterButton,\n } = props;\n\n const showHeader = title || titleIcon || showResetButton\n || showActiveFilterCount || onCollapsedChange;\n\n const showAddButton = renderAddFilterButton != null || onFilterAdded != null;\n\n const handleExpand = useCallback(() => {\n onCollapsedChange?.(false);\n }, [onCollapsedChange]);\n\n const isCollapsed = collapsed && onCollapsedChange != null;\n\n return (\n <div className={classnames(styles.filterList, className)}>\n {isCollapsed && (\n <div\n className={styles.filterListCollapsed}\n data-collapsed=\"true\"\n >\n <Button\n className={styles.expandButton}\n onClick={handleExpand}\n aria-label=\"Expand filters\"\n >\n <ExpandIcon />\n </Button>\n <span className={styles.collapsedLabel}>{title ?? \"Filters\"}</span>\n </div>\n )}\n <div\n className={classnames(\n styles.expandedContent,\n isCollapsed && styles.hiddenContent,\n )}\n data-active-count={activeFilterCount}\n >\n {showHeader && (\n <FilterListHeader\n title={title}\n titleIcon={titleIcon}\n collapsed={collapsed}\n onCollapsedChange={onCollapsedChange}\n showResetButton={showResetButton}\n onReset={onReset}\n showActiveFilterCount={showActiveFilterCount}\n activeFilterCount={activeFilterCount}\n />\n )}\n\n <FilterListContent\n filterDefinitions={filterDefinitions}\n filterStates={filterStates}\n onFilterStateChanged={onFilterStateChanged}\n onFilterRemoved={onFilterRemoved}\n renderInput={renderInput}\n getFilterKey={getFilterKey}\n getFilterLabel={getFilterLabel}\n enableSorting={enableSorting}\n />\n\n {showAddButton && (\n <div className={styles.addButtonContainer}>\n {renderAddFilterButton\n ? renderAddFilterButton()\n : (\n <Button\n type=\"button\"\n className={styles.addButton}\n onClick={onFilterAdded}\n >\n + Add filter\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAE1C,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,cAAcA,CAC5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AIa,eAAe,IACnDC,qBAAqB,IAAIZ,iBAAiB,kBAmCvCX,KAAA,CAAA6B,aAAA,CAACxB,gBAAgB;IACfG,KAAK,EAAEA,KAAM;IACbC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBC,iBAAiB,EAAEA,iBAAkB;IACrCW,eAAe,EAAEA,eAAgB;IACjCH,OAAO,EAAEA,OAAQ;IACjBI,qBAAqB,EAAEA,qBAAsB;IAC7CL,iBAAiB,EAAEA;EAAkB,CACtC,CACF,eAEDlB,KAAA,CAAA6B,aAAA,CAACzB,iBAAiB;IAChBQ,iBAAiB,EAAEA,iBAAkB;IACrCC,YAAY,EAAEA,YAAa;IAC3BC,oBAAoB,EAAEA,oBAAqB;IAC3CO,eAAe,EAAEA,eAAgB;IACjCN,WAAW,EAAEA,WAAY;IACzBC,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/BO,aAAa,EAAEA;EAAc,CAC9B,CAAC,EAED,CAxDeE,qBAAqB,IAAI,IAAI,IAAIN,aAAa,IAAI,IAAI,kBAyDpEpB,KAAA,CAAA6B,aAAA;IAAKJ,SAAS,EAAEtB,MAAM,CAACkC;EAAmB,GACvCX,qBAAqB,GAClBA,qBAAqB,CAAC,CAAC,gBAEvB1B,KAAA,CAAA6B,aAAA,CAAC/B,MAAM;IACLwC,IAAI,EAAC,QAAQ;IACbb,SAAS,EAAEtB,MAAM,CAACoC,SAAU;IAC5BN,OAAO,EAAEb;EAAc,GACxB,cAEO,CAET,CAEJ,CACF,CAAC;AAEV","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,6 +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
18
  import React from "react";
18
19
  export function IncludeIcon() {
19
20
  return /*#__PURE__*/React.createElement("svg", {
@@ -47,17 +48,51 @@ export function ExcludeIcon() {
47
48
  }));
48
49
  }
49
50
  export function RemoveIcon() {
50
- return /*#__PURE__*/React.createElement("svg", {
51
- width: "14",
52
- height: "14",
53
- viewBox: "0 0 16 16",
54
- fill: "none",
55
- stroke: "currentColor",
56
- strokeWidth: "1.5",
57
- "aria-hidden": "true"
58
- }, /*#__PURE__*/React.createElement("path", {
59
- d: "M4 4l8 8M12 4l-8 8",
60
- strokeLinecap: "round"
61
- }));
51
+ return /*#__PURE__*/React.createElement(Cross, {
52
+ color: "currentColor",
53
+ size: 14
54
+ });
55
+ }
56
+ export function SearchIcon() {
57
+ return /*#__PURE__*/React.createElement(Search, {
58
+ color: "currentColor",
59
+ size: 14
60
+ });
61
+ }
62
+ export function OverflowMenuIcon() {
63
+ return /*#__PURE__*/React.createElement(More, {
64
+ color: "currentColor",
65
+ size: 14
66
+ });
67
+ }
68
+ export function ChevronDownIcon() {
69
+ return /*#__PURE__*/React.createElement(ChevronDown, {
70
+ color: "currentColor",
71
+ size: 10
72
+ });
73
+ }
74
+ export function CollapseIcon() {
75
+ return /*#__PURE__*/React.createElement(DoubleChevronLeft, {
76
+ color: "currentColor",
77
+ size: 14
78
+ });
79
+ }
80
+ export function ExpandIcon() {
81
+ return /*#__PURE__*/React.createElement(DoubleChevronRight, {
82
+ color: "currentColor",
83
+ size: 14
84
+ });
85
+ }
86
+ export function ResetIcon() {
87
+ return /*#__PURE__*/React.createElement(Undo, {
88
+ color: "currentColor",
89
+ size: 14
90
+ });
91
+ }
92
+ export function CheckIcon() {
93
+ return /*#__PURE__*/React.createElement(Tick, {
94
+ color: "currentColor",
95
+ size: 12
96
+ });
62
97
  }
63
98
  //# sourceMappingURL=FilterIcons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterIcons.js","names":["React","IncludeIcon","createElement","width","height","viewBox","fill","stroke","strokeWidth","d","strokeLinecap","ExcludeIcon","RemoveIcon"],"sources":["FilterIcons.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 React from \"react\";\n\nexport function IncludeIcon(): React.ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <path d=\"M2 3h12M5 8h6M7 13h2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nexport function ExcludeIcon(): React.ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <path d=\"M2 3h12M5 8h6M7 13h2\" strokeLinecap=\"round\" />\n <path d=\"M3 14L13 2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nexport function RemoveIcon(): React.ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <path d=\"M4 4l8 8M12 4l-8 8\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAO,SAASC,WAAWA,CAAA,EAAuB;EAChD,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,MAAM;IACXC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjB,eAAY;EAAM,gBAElBR,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,sBAAsB;IAACC,aAAa,EAAC;EAAO,CAAE,CACnD,CAAC;AAEV;AAEA,OAAO,SAASC,WAAWA,CAAA,EAAuB;EAChD,oBACEX,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,MAAM;IACXC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjB,eAAY;EAAM,gBAElBR,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,sBAAsB;IAACC,aAAa,EAAC;EAAO,CAAE,CAAC,eACvDV,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,YAAY;IAACC,aAAa,EAAC;EAAO,CAAE,CACzC,CAAC;AAEV;AAEA,OAAO,SAASE,UAAUA,CAAA,EAAuB;EAC/C,oBACEZ,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,MAAM;IACXC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjB,eAAY;EAAM,gBAElBR,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,oBAAoB;IAACC,aAAa,EAAC;EAAO,CAAE,CACjD,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"file":"FilterIcons.js","names":["ChevronDown","Cross","DoubleChevronLeft","DoubleChevronRight","More","Search","Tick","Undo","React","IncludeIcon","createElement","width","height","viewBox","fill","stroke","strokeWidth","d","strokeLinecap","ExcludeIcon","RemoveIcon","color","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 IncludeIcon(): React.ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <path d=\"M2 3h12M5 8h6M7 13h2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nexport function ExcludeIcon(): React.ReactElement {\n return (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n aria-hidden=\"true\"\n >\n <path d=\"M2 3h12M5 8h6M7 13h2\" strokeLinecap=\"round\" />\n <path d=\"M3 14L13 2\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nexport function RemoveIcon(): React.ReactElement {\n return <Cross color=\"currentColor\" size={14} />;\n}\n\nexport function SearchIcon(): React.ReactElement {\n return <Search color=\"currentColor\" size={14} />;\n}\n\nexport function OverflowMenuIcon(): React.ReactElement {\n return <More color=\"currentColor\" size={14} />;\n}\n\nexport function ChevronDownIcon(): React.ReactElement {\n return <ChevronDown color=\"currentColor\" size={10} />;\n}\n\nexport function CollapseIcon(): React.ReactElement {\n return <DoubleChevronLeft color=\"currentColor\" size={14} />;\n}\n\nexport function ExpandIcon(): React.ReactElement {\n return <DoubleChevronRight color=\"currentColor\" size={14} />;\n}\n\nexport function ResetIcon(): React.ReactElement {\n return <Undo color=\"currentColor\" size={14} />;\n}\n\nexport function CheckIcon(): React.ReactElement {\n return <Tick 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,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,IAAI,QACC,oBAAoB;AAC3B,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,SAASC,WAAWA,CAAA,EAAuB;EAChD,oBACED,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,MAAM;IACXC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjB,eAAY;EAAM,gBAElBR,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,sBAAsB;IAACC,aAAa,EAAC;EAAO,CAAE,CACnD,CAAC;AAEV;AAEA,OAAO,SAASC,WAAWA,CAAA,EAAuB;EAChD,oBACEX,KAAA,CAAAE,aAAA;IACEC,KAAK,EAAC,IAAI;IACVC,MAAM,EAAC,IAAI;IACXC,OAAO,EAAC,WAAW;IACnBC,IAAI,EAAC,MAAM;IACXC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjB,eAAY;EAAM,gBAElBR,KAAA,CAAAE,aAAA;IAAMO,CAAC,EAAC,sBAAsB;IAACC,aAAa,EAAC;EAAO,CAAE,CAAC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rB,KAAA,CAAAE,aAAA,CAACJ,IAAI;IAACe,KAAK,EAAC,cAAc;IAACC,IAAI,EAAE;EAAG,CAAE,CAAC;AAChD","ignoreList":[]}
@@ -17,6 +17,27 @@
17
17
  .filterList {
18
18
  display: flex;
19
19
  flex-direction: column;
20
+ height: 100%;
21
+ }
22
+
23
+ .filterListCollapsed {
24
+ display: flex;
25
+ flex-direction: column;
26
+ align-items: center;
27
+ width: var(--osdk-filter-list-collapsed-width);
28
+ height: 100%;
29
+ background: var(--osdk-filter-list-bg);
30
+ border: var(--osdk-filter-list-border);
31
+ border-radius: var(--osdk-filter-list-border-radius);
32
+ padding: var(--osdk-surface-spacing) 0;
33
+ gap: var(--osdk-surface-spacing);
34
+ }
35
+
36
+ .expandedContent {
37
+ display: flex;
38
+ flex-direction: column;
39
+ height: 100%;
40
+ overflow-y: auto;
20
41
  background: var(--osdk-filter-list-bg);
21
42
  border: var(--osdk-filter-list-border);
22
43
  border-radius: var(--osdk-filter-list-border-radius);
@@ -24,25 +45,48 @@
24
45
  gap: var(--osdk-filter-list-gap);
25
46
  }
26
47
 
27
- .contentWrapper {
28
- display: grid;
29
- grid-template-rows: 1fr;
30
- transition: grid-template-rows var(--osdk-filter-list-collapse-transition);
48
+ .hiddenContent {
49
+ display: none;
50
+ }
51
+
52
+ .expandButton {
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ padding: var(--osdk-filter-header-button-padding);
57
+ border: none;
58
+ background: var(--osdk-filter-header-button-bg);
59
+ cursor: pointer;
60
+ border-radius: var(--osdk-filter-header-button-border-radius);
61
+ color: var(--osdk-filter-header-collapse-icon-color);
62
+ transition: background-color var(--osdk-filter-header-button-transition);
63
+
64
+ &:hover {
65
+ background: var(--osdk-filter-header-button-bg-hover);
66
+ }
67
+
68
+ &:active {
69
+ background: var(--osdk-filter-header-button-bg-active);
70
+ }
71
+
72
+ &:focus-visible {
73
+ outline: var(--osdk-filter-input-focus-outline-width) solid var(--osdk-filter-input-focus-outline-color);
74
+ outline-offset: var(--osdk-filter-input-focus-outline-offset);
75
+ }
31
76
 
32
77
  @media (prefers-reduced-motion: reduce) {
33
78
  transition: none;
34
79
  }
35
80
  }
36
81
 
37
- .contentWrapper[data-collapsed="true"] {
38
- grid-template-rows: 0fr;
39
- }
40
-
41
- .contentInner {
42
- overflow: hidden;
43
- display: flex;
44
- flex-direction: column;
45
- gap: var(--osdk-filter-list-gap);
82
+ .collapsedLabel {
83
+ writing-mode: vertical-rl;
84
+ transform: rotate(180deg);
85
+ font-family: var(--osdk-filter-list-collapsed-label-font-family);
86
+ font-size: var(--osdk-filter-list-collapsed-label-font-size);
87
+ color: var(--osdk-filter-list-collapsed-label-color);
88
+ font-weight: var(--osdk-filter-header-font-weight);
89
+ user-select: none;
46
90
  }
47
91
 
48
92
  .addButtonContainer {
@@ -1,8 +1,11 @@
1
1
  // CSS Module proxy for FilterList.module.css
2
2
  const styles = {
3
3
  "filterList": "FilterList-module__filterList___wmzCNbkH",
4
- "contentWrapper": "FilterList-module__contentWrapper___Y8k76Dtw",
5
- "contentInner": "FilterList-module__contentInner___5St4fWIE",
4
+ "filterListCollapsed": "FilterList-module__filterListCollapsed___CGrK9txF",
5
+ "expandedContent": "FilterList-module__expandedContent___aEk2i2At",
6
+ "hiddenContent": "FilterList-module__hiddenContent___PHKe-yWc",
7
+ "expandButton": "FilterList-module__expandButton___-QlY8-ot",
8
+ "collapsedLabel": "FilterList-module__collapsedLabel___QA0UtRts",
6
9
  "addButtonContainer": "FilterList-module__addButtonContainer___kq300FEV",
7
10
  "addButton": "FilterList-module__addButton___oD4yvwyZ"
8
11
  };
@@ -15,8 +15,8 @@
15
15
  */
16
16
 
17
17
  import { Button } from "@base-ui/react/button";
18
- import classnames from "classnames";
19
18
  import React, { memo, useCallback } from "react";
19
+ import { CollapseIcon, ResetIcon } from "./FilterIcons.js";
20
20
  import styles from "./FilterListHeader.module.css.js";
21
21
  function FilterListHeaderInner({
22
22
  title,
@@ -33,18 +33,6 @@ function FilterListHeaderInner({
33
33
  }, [onCollapsedChange, collapsed]);
34
34
  return /*#__PURE__*/React.createElement("div", {
35
35
  className: styles.header
36
- }, onCollapsedChange != null && /*#__PURE__*/React.createElement(Button, {
37
- className: styles.collapseButton,
38
- onClick: handleCollapseClick,
39
- "aria-expanded": !collapsed,
40
- "aria-label": collapsed ? "Expand filters" : "Collapse filters"
41
- }, /*#__PURE__*/React.createElement("span", {
42
- className: classnames(styles.collapseIcon, collapsed && styles.collapsed)
43
- })), /*#__PURE__*/React.createElement("div", {
44
- className: styles.headerContentWrapper,
45
- "data-collapsed": collapsed
46
- }, /*#__PURE__*/React.createElement("div", {
47
- className: styles.headerContentInner
48
36
  }, /*#__PURE__*/React.createElement("div", {
49
37
  className: styles.titleContainer
50
38
  }, titleIcon && /*#__PURE__*/React.createElement("span", {
@@ -53,11 +41,18 @@ function FilterListHeaderInner({
53
41
  className: styles.title
54
42
  }, title), showActiveFilterCount && activeFilterCount > 0 && /*#__PURE__*/React.createElement("span", {
55
43
  className: styles.activeCount
56
- }, "(", activeFilterCount, ")")), showResetButton && /*#__PURE__*/React.createElement(Button, {
44
+ }, "(", activeFilterCount, ")")), /*#__PURE__*/React.createElement("div", {
45
+ className: styles.actions
46
+ }, showResetButton && /*#__PURE__*/React.createElement(Button, {
57
47
  className: styles.resetButton,
58
48
  onClick: onReset,
59
49
  disabled: activeFilterCount === 0
60
- }, "Reset"))));
50
+ }, /*#__PURE__*/React.createElement(ResetIcon, null), " Reset"), onCollapsedChange != null && /*#__PURE__*/React.createElement(Button, {
51
+ className: styles.collapseButton,
52
+ onClick: handleCollapseClick,
53
+ "aria-expanded": !collapsed,
54
+ "aria-label": collapsed ? "Expand filters" : "Collapse filters"
55
+ }, /*#__PURE__*/React.createElement(CollapseIcon, null))));
61
56
  }
62
57
  export const FilterListHeader = /*#__PURE__*/memo(FilterListHeaderInner);
63
58
  //# sourceMappingURL=FilterListHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListHeader.js","names":["Button","classnames","React","memo","useCallback","styles","FilterListHeaderInner","title","titleIcon","collapsed","onCollapsedChange","showResetButton","onReset","showActiveFilterCount","activeFilterCount","handleCollapseClick","createElement","className","header","collapseButton","onClick","collapseIcon","headerContentWrapper","headerContentInner","titleContainer","activeCount","resetButton","disabled","FilterListHeader"],"sources":["FilterListHeader.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 { Button } from \"@base-ui/react/button\";\nimport classnames from \"classnames\";\nimport React, { memo, type ReactNode, useCallback } from \"react\";\nimport styles from \"./FilterListHeader.module.css\";\n\ninterface FilterListHeaderProps {\n title?: string;\n titleIcon?: ReactNode;\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n showResetButton?: boolean;\n onReset?: () => void;\n showActiveFilterCount?: boolean;\n activeFilterCount?: number;\n}\n\nfunction FilterListHeaderInner({\n title,\n titleIcon,\n collapsed = false,\n onCollapsedChange,\n showResetButton,\n onReset,\n showActiveFilterCount,\n activeFilterCount = 0,\n}: FilterListHeaderProps): React.ReactElement {\n const showCollapseButton = onCollapsedChange != null;\n\n const handleCollapseClick = useCallback(() => {\n onCollapsedChange?.(!collapsed);\n }, [onCollapsedChange, collapsed]);\n\n return (\n <div className={styles.header}>\n {showCollapseButton && (\n <Button\n className={styles.collapseButton}\n onClick={handleCollapseClick}\n aria-expanded={!collapsed}\n aria-label={collapsed ? \"Expand filters\" : \"Collapse filters\"}\n >\n <span\n className={classnames(\n styles.collapseIcon,\n collapsed && styles.collapsed,\n )}\n />\n </Button>\n )}\n\n <div\n className={styles.headerContentWrapper}\n data-collapsed={collapsed}\n >\n <div className={styles.headerContentInner}>\n <div className={styles.titleContainer}>\n {titleIcon && (\n <span className={styles.titleIcon}>\n {titleIcon}\n </span>\n )}\n {title && (\n <span className={styles.title}>\n {title}\n </span>\n )}\n {showActiveFilterCount && activeFilterCount > 0 && (\n <span className={styles.activeCount}>\n ({activeFilterCount})\n </span>\n )}\n </div>\n\n {showResetButton && (\n <Button\n className={styles.resetButton}\n onClick={onReset}\n disabled={activeFilterCount === 0}\n >\n Reset\n </Button>\n )}\n </div>\n </div>\n </div>\n );\n}\n\nexport const FilterListHeader: React.MemoExoticComponent<\n typeof FilterListHeaderInner\n> = memo(FilterListHeaderInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,IAAI,EAAkBC,WAAW,QAAQ,OAAO;AAChE,OAAOC,MAAM,MAAM,+BAA+B;AAalD,SAASC,qBAAqBA,CAAC;EAC7BC,KAAK;EACLC,SAAS;EACTC,SAAS,GAAG,KAAK;EACjBC,iBAAiB;EACjBC,eAAe;EACfC,OAAO;EACPC,qBAAqB;EACrBC,iBAAiB,GAAG;AACC,CAAC,EAAsB;EAG5C,MAAMC,mBAAmB,GAAGX,WAAW,CAAC,MAAM;IAC5CM,iBAAiB,GAAG,CAACD,SAAS,CAAC;EACjC,CAAC,EAAE,CAACC,iBAAiB,EAAED,SAAS,CAAC,CAAC;EAElC,oBACEP,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAEZ,MAAM,CAACa;EAAO,GAPLR,iBAAiB,IAAI,IAAI,iBAS9CR,KAAA,CAAAc,aAAA,CAAChB,MAAM;IACLiB,SAAS,EAAEZ,MAAM,CAACc,cAAe;IACjCC,OAAO,EAAEL,mBAAoB;IAC7B,iBAAe,CAACN,SAAU;IAC1B,cAAYA,SAAS,GAAG,gBAAgB,GAAG;EAAmB,gBAE9DP,KAAA,CAAAc,aAAA;IACEC,SAAS,EAAEhB,UAAU,CACnBI,MAAM,CAACgB,YAAY,EACnBZ,SAAS,IAAIJ,MAAM,CAACI,SACtB;EAAE,CACH,CACK,CACT,eAEDP,KAAA,CAAAc,aAAA;IACEC,SAAS,EAAEZ,MAAM,CAACiB,oBAAqB;IACvC,kBAAgBb;EAAU,gBAE1BP,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAEZ,MAAM,CAACkB;EAAmB,gBACxCrB,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAEZ,MAAM,CAACmB;EAAe,GACnChB,SAAS,iBACRN,KAAA,CAAAc,aAAA;IAAMC,SAAS,EAAEZ,MAAM,CAACG;EAAU,GAC/BA,SACG,CACP,EACAD,KAAK,iBACJL,KAAA,CAAAc,aAAA;IAAMC,SAAS,EAAEZ,MAAM,CAACE;EAAM,GAC3BA,KACG,CACP,EACAM,qBAAqB,IAAIC,iBAAiB,GAAG,CAAC,iBAC7CZ,KAAA,CAAAc,aAAA;IAAMC,SAAS,EAAEZ,MAAM,CAACoB;EAAY,GAAC,GAClC,EAACX,iBAAiB,EAAC,GAChB,CAEL,CAAC,EAELH,eAAe,iBACdT,KAAA,CAAAc,aAAA,CAAChB,MAAM;IACLiB,SAAS,EAAEZ,MAAM,CAACqB,WAAY;IAC9BN,OAAO,EAAER,OAAQ;IACjBe,QAAQ,EAAEb,iBAAiB,KAAK;EAAE,GACnC,OAEO,CAEP,CACF,CACF,CAAC;AAEV;AAEA,OAAO,MAAMc,gBAEZ,gBAAGzB,IAAI,CAACG,qBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FilterListHeader.js","names":["Button","React","memo","useCallback","CollapseIcon","ResetIcon","styles","FilterListHeaderInner","title","titleIcon","collapsed","onCollapsedChange","showResetButton","onReset","showActiveFilterCount","activeFilterCount","handleCollapseClick","createElement","className","header","titleContainer","activeCount","actions","resetButton","onClick","disabled","collapseButton","FilterListHeader"],"sources":["FilterListHeader.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 { Button } from \"@base-ui/react/button\";\nimport React, { memo, type ReactNode, useCallback } from \"react\";\nimport { CollapseIcon, ResetIcon } from \"./FilterIcons.js\";\nimport styles from \"./FilterListHeader.module.css\";\n\ninterface FilterListHeaderProps {\n title?: string;\n titleIcon?: ReactNode;\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n showResetButton?: boolean;\n onReset?: () => void;\n showActiveFilterCount?: boolean;\n activeFilterCount?: number;\n}\n\nfunction FilterListHeaderInner({\n title,\n titleIcon,\n collapsed = false,\n onCollapsedChange,\n showResetButton,\n onReset,\n showActiveFilterCount,\n activeFilterCount = 0,\n}: FilterListHeaderProps): React.ReactElement {\n const showCollapseButton = onCollapsedChange != null;\n\n const handleCollapseClick = useCallback(() => {\n onCollapsedChange?.(!collapsed);\n }, [onCollapsedChange, collapsed]);\n\n return (\n <div className={styles.header}>\n <div className={styles.titleContainer}>\n {titleIcon && (\n <span className={styles.titleIcon}>\n {titleIcon}\n </span>\n )}\n {title && (\n <span className={styles.title}>\n {title}\n </span>\n )}\n {showActiveFilterCount && activeFilterCount > 0 && (\n <span className={styles.activeCount}>\n ({activeFilterCount})\n </span>\n )}\n </div>\n\n <div className={styles.actions}>\n {showResetButton && (\n <Button\n className={styles.resetButton}\n onClick={onReset}\n disabled={activeFilterCount === 0}\n >\n <ResetIcon /> Reset\n </Button>\n )}\n\n {showCollapseButton && (\n <Button\n className={styles.collapseButton}\n onClick={handleCollapseClick}\n aria-expanded={!collapsed}\n aria-label={collapsed ? \"Expand filters\" : \"Collapse filters\"}\n >\n <CollapseIcon />\n </Button>\n )}\n </div>\n </div>\n );\n}\n\nexport const FilterListHeader: React.MemoExoticComponent<\n typeof FilterListHeaderInner\n> = memo(FilterListHeaderInner);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,OAAOC,KAAK,IAAIC,IAAI,EAAkBC,WAAW,QAAQ,OAAO;AAChE,SAASC,YAAY,EAAEC,SAAS,QAAQ,kBAAkB;AAC1D,OAAOC,MAAM,MAAM,+BAA+B;AAalD,SAASC,qBAAqBA,CAAC;EAC7BC,KAAK;EACLC,SAAS;EACTC,SAAS,GAAG,KAAK;EACjBC,iBAAiB;EACjBC,eAAe;EACfC,OAAO;EACPC,qBAAqB;EACrBC,iBAAiB,GAAG;AACC,CAAC,EAAsB;EAG5C,MAAMC,mBAAmB,GAAGb,WAAW,CAAC,MAAM;IAC5CQ,iBAAiB,GAAG,CAACD,SAAS,CAAC;EACjC,CAAC,EAAE,CAACC,iBAAiB,EAAED,SAAS,CAAC,CAAC;EAElC,oBACET,KAAA,CAAAgB,aAAA;IAAKC,SAAS,EAAEZ,MAAM,CAACa;EAAO,gBAC5BlB,KAAA,CAAAgB,aAAA;IAAKC,SAAS,EAAEZ,MAAM,CAACc;EAAe,GACnCX,SAAS,iBACRR,KAAA,CAAAgB,aAAA;IAAMC,SAAS,EAAEZ,MAAM,CAACG;EAAU,GAC/BA,SACG,CACP,EACAD,KAAK,iBACJP,KAAA,CAAAgB,aAAA;IAAMC,SAAS,EAAEZ,MAAM,CAACE;EAAM,GAC3BA,KACG,CACP,EACAM,qBAAqB,IAAIC,iBAAiB,GAAG,CAAC,iBAC7C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