@osdk/cbac-components 0.1.0-beta.0 → 0.1.0-beta.2
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.
- package/CHANGELOG.md +32 -0
- package/build/browser/cbac-picker/base/CategoryMarkingGroup.js +80 -0
- package/build/browser/cbac-picker/base/CategoryMarkingGroup.js.map +1 -0
- package/build/browser/cbac-picker/base/CategoryMarkingGroup.module.css +44 -0
- package/build/browser/cbac-picker/base/CategoryMarkingGroup.module.css.js +9 -0
- package/build/browser/cbac-picker/base/InfoBanner.js +32 -0
- package/build/browser/cbac-picker/base/InfoBanner.js.map +1 -0
- package/build/browser/cbac-picker/base/InfoBanner.module.css +30 -0
- package/build/browser/cbac-picker/base/InfoBanner.module.css.js +7 -0
- package/build/browser/cbac-picker/base/MarkingButton.js +42 -0
- package/build/browser/cbac-picker/base/MarkingButton.js.map +1 -0
- package/build/browser/cbac-picker/base/MarkingButton.module.css +76 -0
- package/build/browser/cbac-picker/base/MarkingButton.module.css.js +10 -0
- package/build/browser/cbac-picker/base/OverflowButton.js +50 -0
- package/build/browser/cbac-picker/base/OverflowButton.js.map +1 -0
- package/build/browser/cbac-picker/base/OverflowButton.module.css +57 -0
- package/build/browser/cbac-picker/base/OverflowButton.module.css.js +8 -0
- package/build/browser/cbac-picker/base/OverflowItem.js +42 -0
- package/build/browser/cbac-picker/base/OverflowItem.js.map +1 -0
- package/build/browser/cbac-picker/base/OverflowItem.module.css +51 -0
- package/build/browser/cbac-picker/base/OverflowItem.module.css.js +8 -0
- package/build/browser/cbac-picker/base/ValidationWarning.js +44 -0
- package/build/browser/cbac-picker/base/ValidationWarning.js.map +1 -0
- package/build/browser/cbac-picker/base/ValidationWarning.module.css +71 -0
- package/build/browser/cbac-picker/base/ValidationWarning.module.css.js +12 -0
- package/build/browser/cbac-picker/base/selectionStateHelpers.js +26 -0
- package/build/browser/cbac-picker/base/selectionStateHelpers.js.map +1 -0
- package/build/browser/cbac-picker/types.js +2 -0
- package/build/browser/cbac-picker/types.js.map +1 -0
- package/build/browser/cbac-picker/utils/cbacPickerUtils.js +37 -0
- package/build/browser/cbac-picker/utils/cbacPickerUtils.js.map +1 -0
- package/build/browser/cbac-picker/utils/selectionLogic.js +91 -0
- package/build/browser/cbac-picker/utils/selectionLogic.js.map +1 -0
- package/build/browser/public/experimental.js +3 -1
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/styles.css +347 -0
- package/build/cjs/public/experimental.cjs +76 -0
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +32 -1
- package/build/esm/cbac-picker/base/CategoryMarkingGroup.js +80 -0
- package/build/esm/cbac-picker/base/CategoryMarkingGroup.js.map +1 -0
- package/build/esm/cbac-picker/base/CategoryMarkingGroup.module.css +44 -0
- package/build/esm/cbac-picker/base/InfoBanner.js +32 -0
- package/build/esm/cbac-picker/base/InfoBanner.js.map +1 -0
- package/build/esm/cbac-picker/base/InfoBanner.module.css +30 -0
- package/build/esm/cbac-picker/base/MarkingButton.js +42 -0
- package/build/esm/cbac-picker/base/MarkingButton.js.map +1 -0
- package/build/esm/cbac-picker/base/MarkingButton.module.css +76 -0
- package/build/esm/cbac-picker/base/OverflowButton.js +50 -0
- package/build/esm/cbac-picker/base/OverflowButton.js.map +1 -0
- package/build/esm/cbac-picker/base/OverflowButton.module.css +57 -0
- package/build/esm/cbac-picker/base/OverflowItem.js +42 -0
- package/build/esm/cbac-picker/base/OverflowItem.js.map +1 -0
- package/build/esm/cbac-picker/base/OverflowItem.module.css +51 -0
- package/build/esm/cbac-picker/base/ValidationWarning.js +44 -0
- package/build/esm/cbac-picker/base/ValidationWarning.js.map +1 -0
- package/build/esm/cbac-picker/base/ValidationWarning.module.css +71 -0
- package/build/esm/cbac-picker/base/selectionStateHelpers.js +26 -0
- package/build/esm/cbac-picker/base/selectionStateHelpers.js.map +1 -0
- package/build/esm/cbac-picker/types.js +2 -0
- package/build/esm/cbac-picker/types.js.map +1 -0
- package/build/esm/cbac-picker/utils/cbacPickerUtils.js +37 -0
- package/build/esm/cbac-picker/utils/cbacPickerUtils.js.map +1 -0
- package/build/esm/cbac-picker/utils/selectionLogic.js +91 -0
- package/build/esm/cbac-picker/utils/selectionLogic.js.map +1 -0
- package/build/esm/public/experimental.js +3 -1
- package/build/esm/public/experimental.js.map +1 -1
- package/build/types/cbac-picker/base/CategoryMarkingGroup.d.ts +13 -0
- package/build/types/cbac-picker/base/CategoryMarkingGroup.d.ts.map +1 -0
- package/build/types/cbac-picker/base/InfoBanner.d.ts +6 -0
- package/build/types/cbac-picker/base/InfoBanner.d.ts.map +1 -0
- package/build/types/cbac-picker/base/MarkingButton.d.ts +9 -0
- package/build/types/cbac-picker/base/MarkingButton.d.ts.map +1 -0
- package/build/types/cbac-picker/base/OverflowButton.d.ts +13 -0
- package/build/types/cbac-picker/base/OverflowButton.d.ts.map +1 -0
- package/build/types/cbac-picker/base/OverflowItem.d.ts +10 -0
- package/build/types/cbac-picker/base/OverflowItem.d.ts.map +1 -0
- package/build/types/cbac-picker/base/ValidationWarning.d.ts +7 -0
- package/build/types/cbac-picker/base/ValidationWarning.d.ts.map +1 -0
- package/build/types/cbac-picker/base/selectionStateHelpers.d.ts +4 -0
- package/build/types/cbac-picker/base/selectionStateHelpers.d.ts.map +1 -0
- package/build/types/cbac-picker/types.d.ts +27 -0
- package/build/types/cbac-picker/types.d.ts.map +1 -0
- package/build/types/cbac-picker/utils/cbacPickerUtils.d.ts +10 -0
- package/build/types/cbac-picker/utils/cbacPickerUtils.d.ts.map +1 -0
- package/build/types/cbac-picker/utils/selectionLogic.d.ts +4 -0
- package/build/types/cbac-picker/utils/selectionLogic.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +2 -1
- package/build/types/public/experimental.d.ts.map +1 -1
- package/package.json +3 -3
package/build/browser/styles.css
CHANGED
|
@@ -1,2 +1,349 @@
|
|
|
1
1
|
/* @osdk/cbac-components - Combined styles */
|
|
2
2
|
|
|
3
|
+
/* cbac-picker/base/CategoryMarkingGroup.module.css */
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
.CategoryMarkingGroup-module__categoryGroup___YLFH-t86 {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--osdk-cbac-marking-button-gap);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.CategoryMarkingGroup-module__categoryName___7n2BZ6EY {
|
|
27
|
+
font-size: var(--osdk-cbac-picker-category-title-font-size);
|
|
28
|
+
font-weight: var(--osdk-cbac-picker-category-title-font-weight);
|
|
29
|
+
color: var(--osdk-cbac-picker-category-title-color);
|
|
30
|
+
letter-spacing: var(--osdk-cbac-picker-category-title-letter-spacing);
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.CategoryMarkingGroup-module__markingGrid___1y6ahlKa {
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: repeat(
|
|
37
|
+
var(--osdk-cbac-picker-marking-grid-columns),
|
|
38
|
+
1fr
|
|
39
|
+
);
|
|
40
|
+
border-top: 1px solid var(--osdk-cbac-picker-marking-grid-border-color);
|
|
41
|
+
border-left: 1px solid var(--osdk-cbac-picker-marking-grid-border-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.CategoryMarkingGroup-module__emptyCell___ByBo51l5 {
|
|
45
|
+
border-right: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
46
|
+
border-bottom: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/* cbac-picker/base/InfoBanner.module.css */
|
|
51
|
+
/*
|
|
52
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
53
|
+
*
|
|
54
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
55
|
+
* you may not use this file except in compliance with the License.
|
|
56
|
+
* You may obtain a copy of the License at
|
|
57
|
+
*
|
|
58
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
59
|
+
*
|
|
60
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
61
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
62
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
63
|
+
* See the License for the specific language governing permissions and
|
|
64
|
+
* limitations under the License.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
.InfoBanner-module__infoBanner___UqeHvalP {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: calc(var(--osdk-surface-spacing) * 1.5);
|
|
71
|
+
padding: var(--osdk-cbac-info-banner-padding);
|
|
72
|
+
background: var(--osdk-cbac-info-banner-bg);
|
|
73
|
+
color: var(--osdk-cbac-info-banner-color);
|
|
74
|
+
font-size: var(--osdk-cbac-info-banner-font-size);
|
|
75
|
+
border-radius: var(--osdk-cbac-info-banner-border-radius);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.InfoBanner-module__icon___Pl0HKY0f {
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/* cbac-picker/base/MarkingButton.module.css */
|
|
84
|
+
/*
|
|
85
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
86
|
+
*
|
|
87
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
88
|
+
* you may not use this file except in compliance with the License.
|
|
89
|
+
* You may obtain a copy of the License at
|
|
90
|
+
*
|
|
91
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
92
|
+
*
|
|
93
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
94
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
95
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
96
|
+
* See the License for the specific language governing permissions and
|
|
97
|
+
* limitations under the License.
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
.MarkingButton-module__markingButton___Ra7r3hu1 {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
text-align: center;
|
|
105
|
+
padding: var(--osdk-cbac-marking-button-padding);
|
|
106
|
+
border-radius: var(--osdk-cbac-marking-button-border-radius);
|
|
107
|
+
font-size: var(--osdk-cbac-marking-button-font-size);
|
|
108
|
+
font-family: inherit;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
border: none;
|
|
111
|
+
border-right: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
112
|
+
border-bottom: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
113
|
+
color: var(--osdk-cbac-marking-button-color-default);
|
|
114
|
+
background: var(--osdk-cbac-marking-button-bg-default);
|
|
115
|
+
transition: background var(--osdk-emphasis-transition-duration)
|
|
116
|
+
var(--osdk-emphasis-ease-default),
|
|
117
|
+
border-color var(--osdk-emphasis-transition-duration)
|
|
118
|
+
var(--osdk-emphasis-ease-default),
|
|
119
|
+
color var(--osdk-emphasis-transition-duration)
|
|
120
|
+
var(--osdk-emphasis-ease-default);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.MarkingButton-module__markingButton___Ra7r3hu1:hover:not(:disabled):not(.MarkingButton-module__disallowed___gqq-bTvz):not(.MarkingButton-module__impliedDisallowed___cpzuUIxC) {
|
|
124
|
+
background: var(--osdk-surface-background-color-default-hover);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.MarkingButton-module__selected___HC8AEwJx {
|
|
128
|
+
color: var(--osdk-cbac-marking-button-color-selected);
|
|
129
|
+
background: var(--osdk-cbac-marking-button-bg-selected);
|
|
130
|
+
border-color: var(--osdk-cbac-marking-button-border-color-selected);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.MarkingButton-module__selected___HC8AEwJx:hover:not(:disabled) {
|
|
134
|
+
background: var(--osdk-intent-primary-hover);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.MarkingButton-module__implied___dIs7pIKM {
|
|
138
|
+
color: var(--osdk-cbac-marking-button-color-implied);
|
|
139
|
+
background: var(--osdk-cbac-marking-button-bg-implied);
|
|
140
|
+
border-color: var(--osdk-cbac-marking-button-border-color-implied);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.MarkingButton-module__disallowed___gqq-bTvz,
|
|
144
|
+
.MarkingButton-module__impliedDisallowed___cpzuUIxC {
|
|
145
|
+
color: var(--osdk-cbac-marking-button-color-disallowed);
|
|
146
|
+
background: var(--osdk-cbac-marking-button-bg-disallowed);
|
|
147
|
+
border-color: var(--osdk-cbac-marking-button-border-color-disallowed);
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
opacity: var(--osdk-cbac-disabled-opacity);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.MarkingButton-module__markingButton___Ra7r3hu1:focus-visible {
|
|
153
|
+
outline: var(--osdk-focus-outline);
|
|
154
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.MarkingButton-module__markingButton___Ra7r3hu1:disabled {
|
|
158
|
+
cursor: not-allowed;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
/* cbac-picker/base/OverflowButton.module.css */
|
|
163
|
+
/*
|
|
164
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
165
|
+
*
|
|
166
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
167
|
+
* you may not use this file except in compliance with the License.
|
|
168
|
+
* You may obtain a copy of the License at
|
|
169
|
+
*
|
|
170
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
171
|
+
*
|
|
172
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
173
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
174
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
175
|
+
* See the License for the specific language governing permissions and
|
|
176
|
+
* limitations under the License.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
.OverflowButton-module__moreButton___cpjbpYWQ {
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
text-align: center;
|
|
184
|
+
padding: var(--osdk-cbac-overflow-button-padding);
|
|
185
|
+
font-size: var(--osdk-cbac-overflow-button-font-size);
|
|
186
|
+
font-family: inherit;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
border: none;
|
|
189
|
+
border-right: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
190
|
+
border-bottom: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
191
|
+
color: var(--osdk-cbac-marking-button-color-default);
|
|
192
|
+
background: var(--osdk-cbac-marking-button-bg-default);
|
|
193
|
+
font-weight: var(--osdk-typography-weight-bold);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.OverflowButton-module__moreButton___cpjbpYWQ:hover {
|
|
197
|
+
background: var(--osdk-surface-background-color-default-hover);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.OverflowButton-module__moreButton___cpjbpYWQ:focus-visible {
|
|
201
|
+
outline: var(--osdk-focus-outline);
|
|
202
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.OverflowButton-module__moreButtonActive___zNMk3W-5 {
|
|
206
|
+
color: var(--osdk-intent-primary-rest);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.OverflowButton-module__overflowList___7llfP4BH {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
max-height: var(--osdk-cbac-overflow-list-max-height);
|
|
213
|
+
overflow-y: auto;
|
|
214
|
+
padding: calc(var(--osdk-surface-spacing) * 0.5);
|
|
215
|
+
background: var(--osdk-surface-background-color-default);
|
|
216
|
+
border: 1px solid var(--osdk-surface-border-color-default);
|
|
217
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
218
|
+
box-shadow: var(--osdk-surface-elevation-2);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/* cbac-picker/base/OverflowItem.module.css */
|
|
223
|
+
/*
|
|
224
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
225
|
+
*
|
|
226
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
227
|
+
* you may not use this file except in compliance with the License.
|
|
228
|
+
* You may obtain a copy of the License at
|
|
229
|
+
*
|
|
230
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
231
|
+
*
|
|
232
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
233
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
234
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
|
+
* See the License for the specific language governing permissions and
|
|
236
|
+
* limitations under the License.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
.OverflowItem-module__overflowItem___VAefeIsF {
|
|
240
|
+
display: flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
width: 100%;
|
|
243
|
+
text-align: left;
|
|
244
|
+
padding: var(--osdk-surface-spacing)
|
|
245
|
+
calc(var(--osdk-surface-spacing) * 1.5);
|
|
246
|
+
font-size: var(--osdk-cbac-overflow-button-font-size);
|
|
247
|
+
font-family: inherit;
|
|
248
|
+
cursor: pointer;
|
|
249
|
+
border: none;
|
|
250
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
251
|
+
color: var(--osdk-cbac-marking-button-color-default);
|
|
252
|
+
background: transparent;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.OverflowItem-module__overflowItem___VAefeIsF:hover:not(:disabled) {
|
|
256
|
+
background: var(--osdk-surface-background-color-default-hover);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.OverflowItem-module__overflowItem___VAefeIsF:focus-visible {
|
|
260
|
+
outline: var(--osdk-focus-outline);
|
|
261
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.OverflowItem-module__overflowItemSelected___5UNc9Ql9 {
|
|
265
|
+
color: var(--osdk-intent-primary-rest);
|
|
266
|
+
font-weight: var(--osdk-typography-weight-bold);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.OverflowItem-module__overflowItemDisabled___UKHy9SIU {
|
|
270
|
+
color: var(--osdk-cbac-marking-button-color-disallowed);
|
|
271
|
+
cursor: not-allowed;
|
|
272
|
+
opacity: var(--osdk-cbac-disabled-opacity);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
/* cbac-picker/base/ValidationWarning.module.css */
|
|
277
|
+
/*
|
|
278
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
279
|
+
*
|
|
280
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
281
|
+
* you may not use this file except in compliance with the License.
|
|
282
|
+
* You may obtain a copy of the License at
|
|
283
|
+
*
|
|
284
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
285
|
+
*
|
|
286
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
287
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
288
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
289
|
+
* See the License for the specific language governing permissions and
|
|
290
|
+
* limitations under the License.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
.ValidationWarning-module__validationWarning___oADBKhG- {
|
|
294
|
+
display: flex;
|
|
295
|
+
flex-direction: column;
|
|
296
|
+
gap: calc(var(--osdk-surface-spacing) * 1.5);
|
|
297
|
+
padding: var(--osdk-cbac-validation-warning-padding);
|
|
298
|
+
background: var(--osdk-cbac-validation-warning-bg);
|
|
299
|
+
color: var(--osdk-cbac-validation-warning-color);
|
|
300
|
+
font-size: var(--osdk-cbac-validation-warning-font-size);
|
|
301
|
+
border-radius: var(--osdk-cbac-validation-warning-border-radius);
|
|
302
|
+
max-height: var(--osdk-cbac-validation-warning-max-height);
|
|
303
|
+
overflow-y: auto;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.ValidationWarning-module__header___ylq-kIOW {
|
|
307
|
+
display: flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: calc(var(--osdk-surface-spacing) * 1.5);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.ValidationWarning-module__icon___PuGol1EB {
|
|
313
|
+
flex-shrink: 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.ValidationWarning-module__groupList___ua5t3Rm2 {
|
|
317
|
+
list-style: none;
|
|
318
|
+
margin: 0;
|
|
319
|
+
padding: 0;
|
|
320
|
+
padding-left: calc(var(--osdk-surface-spacing) * 3);
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: column;
|
|
323
|
+
gap: var(--osdk-surface-spacing);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.ValidationWarning-module__groupItem___0BGH5HxZ {
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
gap: var(--osdk-surface-spacing);
|
|
330
|
+
flex-wrap: wrap;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.ValidationWarning-module__groupNumber___rTdfnH3f {
|
|
334
|
+
font-weight: var(--osdk-typography-weight-bold);
|
|
335
|
+
flex-shrink: 0;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.ValidationWarning-module__chip___3EH1UeL0 {
|
|
339
|
+
display: inline-flex;
|
|
340
|
+
align-items: center;
|
|
341
|
+
padding: 0 var(--osdk-surface-spacing);
|
|
342
|
+
border: 1px solid var(--osdk-cbac-validation-warning-chip-border-color);
|
|
343
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
344
|
+
background: var(--osdk-cbac-validation-warning-chip-bg);
|
|
345
|
+
font-size: var(--osdk-cbac-validation-warning-font-size);
|
|
346
|
+
color: var(--osdk-typography-color-default-rest);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
|
|
@@ -1,4 +1,80 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/cbac-picker/utils/selectionLogic.ts
|
|
4
|
+
function toggleMarking(markingId, currentSelection, categories) {
|
|
5
|
+
const isSelected = currentSelection.includes(markingId);
|
|
6
|
+
let ownerGroup;
|
|
7
|
+
for (const group of categories) {
|
|
8
|
+
for (const marking of group.markings) {
|
|
9
|
+
if (marking.id === markingId) {
|
|
10
|
+
ownerGroup = group;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (ownerGroup !== void 0) {
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (ownerGroup === void 0) {
|
|
19
|
+
return currentSelection;
|
|
20
|
+
}
|
|
21
|
+
if (isSelected) {
|
|
22
|
+
return currentSelection.filter((id) => id !== markingId);
|
|
23
|
+
}
|
|
24
|
+
if (ownerGroup.category.categoryType === "DISJUNCTIVE") {
|
|
25
|
+
const sameCategoryMarkingIds = new Set(ownerGroup.markings.map((m) => m.id));
|
|
26
|
+
const withoutSameCategory = currentSelection.filter((id) => !sameCategoryMarkingIds.has(id));
|
|
27
|
+
return [...withoutSameCategory, markingId];
|
|
28
|
+
}
|
|
29
|
+
return [...currentSelection, markingId];
|
|
30
|
+
}
|
|
31
|
+
function computeMarkingStates(selectedIds, impliedIds, disallowedIds) {
|
|
32
|
+
const states = /* @__PURE__ */ new Map();
|
|
33
|
+
const selectedSet = new Set(selectedIds);
|
|
34
|
+
const impliedSet = new Set(impliedIds);
|
|
35
|
+
const disallowedSet = new Set(disallowedIds);
|
|
36
|
+
const allIds = /* @__PURE__ */ new Set([...selectedIds, ...impliedIds, ...disallowedIds]);
|
|
37
|
+
for (const id of allIds) {
|
|
38
|
+
const isImplied = impliedSet.has(id);
|
|
39
|
+
const isDisallowed = disallowedSet.has(id);
|
|
40
|
+
const isSelected = selectedSet.has(id);
|
|
41
|
+
if (isSelected) {
|
|
42
|
+
states.set(id, "SELECTED");
|
|
43
|
+
} else if (isImplied && isDisallowed) {
|
|
44
|
+
states.set(id, "IMPLIED_DISALLOWED");
|
|
45
|
+
} else if (isImplied) {
|
|
46
|
+
states.set(id, "IMPLIED");
|
|
47
|
+
} else if (isDisallowed) {
|
|
48
|
+
states.set(id, "DISALLOWED");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return states;
|
|
52
|
+
}
|
|
53
|
+
function groupMarkingsByCategory(markings, categories) {
|
|
54
|
+
const markingsByCategoryId = /* @__PURE__ */ new Map();
|
|
55
|
+
for (const marking of markings) {
|
|
56
|
+
const existing = markingsByCategoryId.get(marking.categoryId);
|
|
57
|
+
if (existing !== void 0) {
|
|
58
|
+
existing.push(marking);
|
|
59
|
+
} else {
|
|
60
|
+
markingsByCategoryId.set(marking.categoryId, [marking]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const groups = [];
|
|
64
|
+
for (const category of categories) {
|
|
65
|
+
const categoryMarkings = markingsByCategoryId.get(category.id);
|
|
66
|
+
if (categoryMarkings !== void 0 && categoryMarkings.length > 0) {
|
|
67
|
+
groups.push({
|
|
68
|
+
category,
|
|
69
|
+
markings: categoryMarkings
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return groups;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
exports.computeMarkingStates = computeMarkingStates;
|
|
77
|
+
exports.groupMarkingsByCategory = groupMarkingsByCategory;
|
|
78
|
+
exports.toggleMarking = toggleMarking;
|
|
3
79
|
//# sourceMappingURL=experimental.cjs.map
|
|
4
80
|
//# sourceMappingURL=experimental.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"experimental.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../../src/cbac-picker/utils/selectionLogic.ts"],"names":[],"mappings":";;;AAgBO,SAAS,aAAA,CAAc,SAAW,EAAA,gBAAA,EAAkB,UAAY,EAAA;AACrE,EAAM,MAAA,UAAA,GAAa,gBAAiB,CAAA,QAAA,CAAS,SAAS,CAAA;AACtD,EAAI,IAAA,UAAA;AACJ,EAAA,KAAA,MAAW,SAAS,UAAY,EAAA;AAC9B,IAAW,KAAA,MAAA,OAAA,IAAW,MAAM,QAAU,EAAA;AACpC,MAAI,IAAA,OAAA,CAAQ,OAAO,SAAW,EAAA;AAC5B,QAAa,UAAA,GAAA,KAAA;AACb,QAAA;AAAA;AACF;AAEF,IAAA,IAAI,eAAe,MAAW,EAAA;AAC5B,MAAA;AAAA;AACF;AAEF,EAAA,IAAI,eAAe,MAAW,EAAA;AAC5B,IAAO,OAAA,gBAAA;AAAA;AAET,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,OAAO,gBAAiB,CAAA,MAAA,CAAO,CAAM,EAAA,KAAA,EAAA,KAAO,SAAS,CAAA;AAAA;AAKvD,EAAI,IAAA,UAAA,CAAW,QAAS,CAAA,YAAA,KAAiB,aAAe,EAAA;AACtD,IAAM,MAAA,sBAAA,GAAyB,IAAI,GAAI,CAAA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AA,eACf,YAAc,EAAA;AACvB,MAAO,MAAA,CAAA,GAAA,CAAI,IAAI,YAAY,CAAA;AAAA;AAC7B;AAEF,EAAO,OAAA,MAAA;AACT;AACO,SAAS,uBAAA,CAAwB,UAAU,UAAY,EAAA;AAC5D,EAAM,MAAA,oBAAA,uBAA2B,GAAI,EAAA;AACrC,EAAA,KAAA,MAAW,WAAW,QAAU,EAAA;AAC9B,IAAA,MAAM,QAAW,GAAA,oBAAA,CAAqB,GAAI,CAAA,OAAA,CAAQ,UAAU,CAAA;AAC5D,IAAA,IAAI,aAAa,MAAW,EAAA;AAC1B,MAAA,QAAA,CAAS,KAAK,OAAO,CAAA;AAAA,KAChB,MAAA;AACL,MAAA,oBAAA,CAAqB,GAAI,CAAA,OAAA,CAAQ,UAAY,EAAA,CAAC,OAAO,CAAC,CAAA;AAAA;AACxD;AAEF,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,KAAA,MAAW,YAAY,UAAY,EAAA;AACjC,IAAA,MAAM,gBAAmB,GAAA,oBAAA,CAAqB,GAAI,CAAA,QAAA,CAAS,EAAE,CAAA;AAC7D,IAAA,IAAI,gBAAqB,KAAA,MAAA,IAAa,gBAAiB,CAAA,MAAA,GAAS,CAAG,EAAA;AACjE,MAAA,MAAA,CAAO,IAAK,CAAA;AAAA,QACV,QAAA;AAAA,QACA,QAAU,EAAA;AAAA,OACX,CAAA;AAAA;AACH;AAEF,EAAO,OAAA,MAAA;AACT","file":"experimental.cjs","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\nexport function toggleMarking(markingId, currentSelection, categories) {\n const isSelected = currentSelection.includes(markingId);\n let ownerGroup;\n for (const group of categories) {\n for (const marking of group.markings) {\n if (marking.id === markingId) {\n ownerGroup = group;\n break;\n }\n }\n if (ownerGroup !== undefined) {\n break;\n }\n }\n if (ownerGroup === undefined) {\n return currentSelection;\n }\n if (isSelected) {\n return currentSelection.filter(id => id !== markingId);\n }\n\n // Disjunctive categories allow only one marking selected at a time (radio-style).\n // Conjunctive categories allow multiple markings (checkbox-style).\n if (ownerGroup.category.categoryType === \"DISJUNCTIVE\") {\n const sameCategoryMarkingIds = new Set(ownerGroup.markings.map(m => m.id));\n const withoutSameCategory = currentSelection.filter(id => !sameCategoryMarkingIds.has(id));\n return [...withoutSameCategory, markingId];\n }\n return [...currentSelection, markingId];\n}\nexport function computeMarkingStates(selectedIds, impliedIds, disallowedIds) {\n const states = new Map();\n const selectedSet = new Set(selectedIds);\n const impliedSet = new Set(impliedIds);\n const disallowedSet = new Set(disallowedIds);\n const allIds = new Set([...selectedIds, ...impliedIds, ...disallowedIds]);\n for (const id of allIds) {\n const isImplied = impliedSet.has(id);\n const isDisallowed = disallowedSet.has(id);\n const isSelected = selectedSet.has(id);\n if (isSelected) {\n states.set(id, \"SELECTED\");\n } else if (isImplied && isDisallowed) {\n states.set(id, \"IMPLIED_DISALLOWED\");\n } else if (isImplied) {\n states.set(id, \"IMPLIED\");\n } else if (isDisallowed) {\n states.set(id, \"DISALLOWED\");\n }\n }\n return states;\n}\nexport function groupMarkingsByCategory(markings, categories) {\n const markingsByCategoryId = new Map();\n for (const marking of markings) {\n const existing = markingsByCategoryId.get(marking.categoryId);\n if (existing !== undefined) {\n existing.push(marking);\n } else {\n markingsByCategoryId.set(marking.categoryId, [marking]);\n }\n }\n const groups = [];\n for (const category of categories) {\n const categoryMarkings = markingsByCategoryId.get(category.id);\n if (categoryMarkings !== undefined && categoryMarkings.length > 0) {\n groups.push({\n category,\n markings: categoryMarkings\n });\n }\n }\n return groups;\n}"]}
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
+
type MarkingSelectionState = "NONE" | "SELECTED" | "IMPLIED" | "DISALLOWED" | "IMPLIED_DISALLOWED";
|
|
2
|
+
interface CbacBannerData {
|
|
3
|
+
classificationString: string;
|
|
4
|
+
textColor: string;
|
|
5
|
+
backgroundColors: string[];
|
|
6
|
+
markingIds: string[];
|
|
7
|
+
}
|
|
8
|
+
interface PickerMarkingCategory {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
categoryType: "CONJUNCTIVE" | "DISJUNCTIVE";
|
|
13
|
+
markingType: "MANDATORY" | "CBAC";
|
|
14
|
+
}
|
|
15
|
+
interface PickerMarking {
|
|
16
|
+
id: string;
|
|
17
|
+
categoryId: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
21
|
+
interface CategoryMarkingGroup {
|
|
22
|
+
category: PickerMarkingCategory;
|
|
23
|
+
markings: PickerMarking[];
|
|
24
|
+
}
|
|
25
|
+
interface RequiredMarkingGroup {
|
|
26
|
+
markingNames: string[];
|
|
27
|
+
}
|
|
1
28
|
|
|
2
|
-
|
|
29
|
+
declare function toggleMarking(markingId: string, currentSelection: string[], categories: CategoryMarkingGroup[]): string[];
|
|
30
|
+
declare function computeMarkingStates(selectedIds: string[], impliedIds: string[], disallowedIds: string[]): Map<string, MarkingSelectionState>;
|
|
31
|
+
declare function groupMarkingsByCategory(markings: PickerMarking[], categories: PickerMarkingCategory[]): CategoryMarkingGroup[];
|
|
32
|
+
|
|
33
|
+
export { type CategoryMarkingGroup, type CbacBannerData, type MarkingSelectionState, type PickerMarking, type PickerMarkingCategory, type RequiredMarkingGroup, computeMarkingStates, groupMarkingsByCategory, toggleMarking };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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 React from "react";
|
|
18
|
+
import styles from "./CategoryMarkingGroup.module.css";
|
|
19
|
+
import { MarkingButton } from "./MarkingButton.js";
|
|
20
|
+
import { OverflowButton } from "./OverflowButton.js";
|
|
21
|
+
import { isImplied } from "./selectionStateHelpers.js";
|
|
22
|
+
const GRID_COLUMNS = 4;
|
|
23
|
+
const VISIBLE_ROWS = 3;
|
|
24
|
+
export const CategoryMarkingGroup = /*#__PURE__*/React.memo(function ({
|
|
25
|
+
categoryName,
|
|
26
|
+
markings,
|
|
27
|
+
onMarkingToggle
|
|
28
|
+
}) {
|
|
29
|
+
const headingId = React.useId();
|
|
30
|
+
const maxVisible = GRID_COLUMNS * VISIBLE_ROWS;
|
|
31
|
+
const hasOverflow = markings.length > maxVisible;
|
|
32
|
+
const visibleMarkings = hasOverflow ? markings.slice(0, maxVisible - 1) : markings;
|
|
33
|
+
const overflowMarkings = hasOverflow ? markings.slice(maxVisible - 1) : [];
|
|
34
|
+
const gridItemCount = hasOverflow ? visibleMarkings.length + 1 : visibleMarkings.length;
|
|
35
|
+
const hasActiveOverflow = overflowMarkings.some(m => m.selectionState === "SELECTED" || isImplied(m.selectionState));
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: styles.categoryGroup,
|
|
38
|
+
role: "group",
|
|
39
|
+
"aria-labelledby": headingId
|
|
40
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
41
|
+
id: headingId,
|
|
42
|
+
className: styles.categoryName
|
|
43
|
+
}, categoryName), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: styles.markingGrid
|
|
45
|
+
}, visibleMarkings.map(marking => /*#__PURE__*/React.createElement(MarkingButtonItem, {
|
|
46
|
+
key: marking.id,
|
|
47
|
+
id: marking.id,
|
|
48
|
+
label: marking.label,
|
|
49
|
+
selectionState: marking.selectionState,
|
|
50
|
+
disabled: marking.disabled,
|
|
51
|
+
onToggle: onMarkingToggle
|
|
52
|
+
})), hasOverflow && /*#__PURE__*/React.createElement(OverflowButton, {
|
|
53
|
+
overflowMarkings: overflowMarkings,
|
|
54
|
+
hasActiveOverflow: hasActiveOverflow,
|
|
55
|
+
onMarkingToggle: onMarkingToggle
|
|
56
|
+
}), Array.from({
|
|
57
|
+
length: (GRID_COLUMNS - gridItemCount % GRID_COLUMNS) % GRID_COLUMNS
|
|
58
|
+
}, (_, i) => /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
key: `empty-${i}`,
|
|
60
|
+
className: styles.emptyCell
|
|
61
|
+
}))));
|
|
62
|
+
});
|
|
63
|
+
const MarkingButtonItem = /*#__PURE__*/React.memo(function ({
|
|
64
|
+
id,
|
|
65
|
+
label,
|
|
66
|
+
selectionState,
|
|
67
|
+
disabled,
|
|
68
|
+
onToggle
|
|
69
|
+
}) {
|
|
70
|
+
const handleToggle = React.useCallback(() => {
|
|
71
|
+
onToggle(id);
|
|
72
|
+
}, [onToggle, id]);
|
|
73
|
+
return /*#__PURE__*/React.createElement(MarkingButton, {
|
|
74
|
+
label: label,
|
|
75
|
+
selectionState: selectionState,
|
|
76
|
+
onToggle: handleToggle,
|
|
77
|
+
disabled: disabled
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=CategoryMarkingGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CategoryMarkingGroup.js","names":["React","styles","MarkingButton","OverflowButton","isImplied","GRID_COLUMNS","VISIBLE_ROWS","CategoryMarkingGroup","memo","categoryName","markings","onMarkingToggle","headingId","useId","maxVisible","hasOverflow","length","visibleMarkings","slice","overflowMarkings","gridItemCount","hasActiveOverflow","some","m","selectionState","createElement","className","categoryGroup","role","id","markingGrid","map","marking","MarkingButtonItem","key","label","disabled","onToggle","Array","from","_","i","emptyCell","handleToggle","useCallback"],"sources":["CategoryMarkingGroup.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 React from \"react\";\nimport type { MarkingSelectionState } from \"../types.js\";\nimport styles from \"./CategoryMarkingGroup.module.css\";\nimport { MarkingButton } from \"./MarkingButton.js\";\nimport { OverflowButton } from \"./OverflowButton.js\";\nimport { isImplied } from \"./selectionStateHelpers.js\";\n\nconst GRID_COLUMNS = 4;\nconst VISIBLE_ROWS = 3;\n\nexport interface CategoryMarkingGroupProps {\n categoryName: string;\n markings: ReadonlyArray<{\n id: string;\n label: string;\n selectionState: MarkingSelectionState;\n disabled?: boolean;\n }>;\n onMarkingToggle: (markingId: string) => void;\n}\n\nexport const CategoryMarkingGroup: React.MemoExoticComponent<\n (props: CategoryMarkingGroupProps) => React.ReactElement\n> = React.memo(function CategoryMarkingGroup({\n categoryName,\n markings,\n onMarkingToggle,\n}: CategoryMarkingGroupProps): React.ReactElement {\n const headingId = React.useId();\n\n const maxVisible = GRID_COLUMNS * VISIBLE_ROWS;\n const hasOverflow = markings.length > maxVisible;\n const visibleMarkings = hasOverflow\n ? markings.slice(0, maxVisible - 1)\n : markings;\n const overflowMarkings = hasOverflow\n ? markings.slice(maxVisible - 1)\n : [];\n\n const gridItemCount = hasOverflow\n ? visibleMarkings.length + 1\n : visibleMarkings.length;\n const emptyCellCount = (GRID_COLUMNS - (gridItemCount % GRID_COLUMNS))\n % GRID_COLUMNS;\n\n const hasActiveOverflow = overflowMarkings.some(\n (m) => m.selectionState === \"SELECTED\" || isImplied(m.selectionState),\n );\n\n return (\n <div\n className={styles.categoryGroup}\n role=\"group\"\n aria-labelledby={headingId}\n >\n <h3 id={headingId} className={styles.categoryName}>{categoryName}</h3>\n <div className={styles.markingGrid}>\n {visibleMarkings.map((marking) => (\n <MarkingButtonItem\n key={marking.id}\n id={marking.id}\n label={marking.label}\n selectionState={marking.selectionState}\n disabled={marking.disabled}\n onToggle={onMarkingToggle}\n />\n ))}\n {hasOverflow && (\n <OverflowButton\n overflowMarkings={overflowMarkings}\n hasActiveOverflow={hasActiveOverflow}\n onMarkingToggle={onMarkingToggle}\n />\n )}\n {Array.from({ length: emptyCellCount }, (_, i) => (\n <div\n key={`empty-${i}`}\n className={styles.emptyCell}\n />\n ))}\n </div>\n </div>\n );\n});\n\ninterface MarkingButtonItemProps {\n id: string;\n label: string;\n selectionState: MarkingSelectionState;\n disabled?: boolean;\n onToggle: (markingId: string) => void;\n}\n\nconst MarkingButtonItem = React.memo(function MarkingButtonItem({\n id,\n label,\n selectionState,\n disabled,\n onToggle,\n}: MarkingButtonItemProps): React.ReactElement {\n const handleToggle = React.useCallback(() => {\n onToggle(id);\n }, [onToggle, id]);\n\n return (\n <MarkingButton\n label={label}\n selectionState={selectionState}\n onToggle={handleToggle}\n disabled={disabled}\n />\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,OAAOC,MAAM,MAAM,mCAAmC;AACtD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,S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oreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
.categoryGroup {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--osdk-cbac-marking-button-gap);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.categoryName {
|
|
24
|
+
font-size: var(--osdk-cbac-picker-category-title-font-size);
|
|
25
|
+
font-weight: var(--osdk-cbac-picker-category-title-font-weight);
|
|
26
|
+
color: var(--osdk-cbac-picker-category-title-color);
|
|
27
|
+
letter-spacing: var(--osdk-cbac-picker-category-title-letter-spacing);
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.markingGrid {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-columns: repeat(
|
|
34
|
+
var(--osdk-cbac-picker-marking-grid-columns),
|
|
35
|
+
1fr
|
|
36
|
+
);
|
|
37
|
+
border-top: 1px solid var(--osdk-cbac-picker-marking-grid-border-color);
|
|
38
|
+
border-left: 1px solid var(--osdk-cbac-picker-marking-grid-border-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.emptyCell {
|
|
42
|
+
border-right: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
43
|
+
border-bottom: 1px solid var(--osdk-cbac-marking-button-border-color-default);
|
|
44
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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 { InfoSign } from "@blueprintjs/icons";
|
|
18
|
+
import classnames from "classnames";
|
|
19
|
+
import React from "react";
|
|
20
|
+
import styles from "./InfoBanner.module.css";
|
|
21
|
+
export function InfoBanner({
|
|
22
|
+
message,
|
|
23
|
+
className
|
|
24
|
+
}) {
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: classnames(styles.infoBanner, className)
|
|
27
|
+
}, /*#__PURE__*/React.createElement(InfoSign, {
|
|
28
|
+
className: styles.icon,
|
|
29
|
+
size: 14
|
|
30
|
+
}), /*#__PURE__*/React.createElement("span", null, message));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=InfoBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBanner.js","names":["InfoSign","classnames","React","styles","InfoBanner","message","className","createElement","infoBanner","icon","size"],"sources":["InfoBanner.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 { InfoSign } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./InfoBanner.module.css\";\n\nexport interface InfoBannerProps {\n message: string;\n className?: string;\n}\n\nexport function InfoBanner({\n message,\n className,\n}: InfoBannerProps): React.ReactElement {\n return (\n <div className={classnames(styles.infoBanner, className)}>\n <InfoSign className={styles.icon} size={14} />\n <span>{message}</span>\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,yBAAyB;AAO5C,OAAO,SAASC,UAAUA,CAAC;EACzBC,OAAO;EACPC;AACe,CAAC,EAAsB;EACtC,oBACEJ,KAAA,CAAAK,aAAA;IAAKD,SAAS,EAAEL,UAAU,CAACE,MAAM,CAACK,UAAU,EAAEF,SAAS;EAAE,gBACvDJ,KAAA,CAAAK,aAAA,CAACP,QAAQ;IAACM,SAAS,EAAEH,MAAM,CAACM,IAAK;IAACC,IAAI,EAAE;EAAG,CAAE,CAAC,eAC9CR,KAAA,CAAAK,aAAA,eAAOF,OAAc,CAClB,CAAC;AAEV","ignoreList":[]}
|