@tylertech/forge 3.12.1 → 3.13.1

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 (55) hide show
  1. package/custom-elements.json +1788 -231
  2. package/dist/lib.js +90 -22
  3. package/dist/lib.js.map +4 -4
  4. package/dist/vscode.css-custom-data.json +2 -1
  5. package/dist/vscode.html-custom-data.json +85 -1
  6. package/esm/autocomplete/autocomplete-constants.d.ts +1 -0
  7. package/esm/autocomplete/autocomplete-constants.js +1 -0
  8. package/esm/autocomplete/autocomplete-core.d.ts +6 -0
  9. package/esm/autocomplete/autocomplete-core.js +49 -12
  10. package/esm/autocomplete/autocomplete.d.ts +7 -0
  11. package/esm/autocomplete/autocomplete.js +7 -0
  12. package/esm/calendar/calendar-core.d.ts +2 -0
  13. package/esm/calendar/calendar-core.js +20 -14
  14. package/esm/core/utils/index.d.ts +1 -0
  15. package/esm/core/utils/index.js +1 -0
  16. package/esm/core/utils/key-action.d.ts +102 -0
  17. package/esm/core/utils/key-action.js +109 -0
  18. package/esm/expansion-panel/expansion-panel-adapter.d.ts +9 -0
  19. package/esm/expansion-panel/expansion-panel-adapter.js +31 -3
  20. package/esm/expansion-panel/expansion-panel-constants.d.ts +2 -0
  21. package/esm/expansion-panel/expansion-panel-constants.js +2 -1
  22. package/esm/expansion-panel/expansion-panel-core.d.ts +7 -0
  23. package/esm/expansion-panel/expansion-panel-core.js +30 -0
  24. package/esm/expansion-panel/expansion-panel.d.ts +11 -3
  25. package/esm/expansion-panel/expansion-panel.js +16 -3
  26. package/esm/index.d.ts +1 -0
  27. package/esm/index.js +4 -0
  28. package/esm/paginator/paginator-adapter.d.ts +1 -0
  29. package/esm/paginator/paginator-adapter.js +15 -4
  30. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  31. package/esm/tree/index.d.ts +7 -0
  32. package/esm/tree/index.js +7 -0
  33. package/esm/tree/tree/index.d.ts +7 -0
  34. package/esm/tree/tree/index.js +11 -0
  35. package/esm/tree/tree/tree-selection-controller.d.ts +104 -0
  36. package/esm/tree/tree/tree-selection-controller.js +375 -0
  37. package/esm/tree/tree/tree.d.ts +141 -0
  38. package/esm/tree/tree/tree.js +488 -0
  39. package/esm/tree/tree-item/index.d.ts +7 -0
  40. package/esm/tree/tree-item/index.js +11 -0
  41. package/esm/tree/tree-item/tree-item.d.ts +112 -0
  42. package/esm/tree/tree-item/tree-item.js +378 -0
  43. package/esm/tree/tree-utils.d.ts +154 -0
  44. package/esm/tree/tree-utils.js +315 -0
  45. package/package.json +2 -1
  46. package/sass/core/styles/tokens/tree/tree/_tokens.scss +24 -0
  47. package/sass/core/styles/tokens/tree/tree-item/_tokens.scss +39 -0
  48. package/sass/tree/tree/_core.scss +31 -0
  49. package/sass/tree/tree/_token-utils.scss +30 -0
  50. package/sass/tree/tree/index.scss +6 -0
  51. package/sass/tree/tree/tree.scss +44 -0
  52. package/sass/tree/tree-item/_core.scss +121 -0
  53. package/sass/tree/tree-item/_token-utils.scss +30 -0
  54. package/sass/tree/tree-item/index.scss +6 -0
  55. package/sass/tree/tree-item/tree-item.scss +199 -0
@@ -0,0 +1,315 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ /**
7
+ * A symbol property to represent the indeterminate state of a tree item.
8
+ */
9
+ export const indeterminate = Symbol('indeterminate');
10
+ //
11
+ // Identity
12
+ //
13
+ /**
14
+ * Checks if the given element is a tree component.
15
+ *
16
+ * @param el - The element to check.
17
+ * @returns True if the element is a tree component, false otherwise.
18
+ */
19
+ export function isTree(el) {
20
+ return el.tagName.toLowerCase() === 'forge-tree';
21
+ }
22
+ /**
23
+ * Checks if an element is a tree item component.
24
+ *
25
+ * @param el - The element to check.
26
+ * @returns True if the element is a tree item component, false otherwise.
27
+ */
28
+ export function isTreeItem(el) {
29
+ return el.tagName.toLowerCase() === 'forge-tree-item';
30
+ }
31
+ //
32
+ // Events
33
+ //
34
+ /**
35
+ * Returns whether an event originates from within a tree item.
36
+ *
37
+ * @param evt An event dispatched from a tree item.
38
+ * @returns Whether the event includes a tree item.
39
+ */
40
+ export function getTreeItemFromEvent(evt) {
41
+ return evt.target.closest('forge-tree-item');
42
+ }
43
+ /**
44
+ * Gets all tree item components in an event path.
45
+ *
46
+ * @param evt An event dispatched from a tree item.
47
+ * @returns The dispatching tree item and all tree item ancestors.
48
+ */
49
+ export function getTreeItemsInEventPath(evt) {
50
+ const path = evt.composedPath();
51
+ return path.filter((el) => el instanceof HTMLElement && isTreeItem(el));
52
+ }
53
+ /**
54
+ * Returns whether an event includes a tree item header.
55
+ *
56
+ * @param evt An event dispatched from a tree item.
57
+ * @returns Whether the event includes a header element within a tree item.
58
+ */
59
+ export function eventPathIncludesTreeItemHeader(evt) {
60
+ const path = evt.composedPath();
61
+ const treeItemIndex = path.findIndex((el) => el instanceof HTMLElement && isTreeItem(el));
62
+ const headerIndex = path.findIndex((el) => el instanceof HTMLElement && el.matches('.header'));
63
+ return treeItemIndex >= 0 && headerIndex >= 0 && headerIndex < treeItemIndex;
64
+ }
65
+ /**
66
+ * Returns whether an event includes a tree item expand icon.
67
+ *
68
+ * @param evt An event dispatched from a tree item.
69
+ * @returns Whether the event includes an expand icon element within a tree item.
70
+ */
71
+ export function eventPathIncludesTreeItemExpandIcon(evt) {
72
+ const path = evt.composedPath();
73
+ const treeItemIndex = path.findIndex((el) => el instanceof HTMLElement && isTreeItem(el));
74
+ const expandIconIndex = path.findIndex((el) => el instanceof HTMLElement && el.matches('.expand-icon'));
75
+ return treeItemIndex >= 0 && expandIconIndex >= 0 && expandIconIndex < treeItemIndex;
76
+ }
77
+ /**
78
+ * Gets the target tree item component from an event.
79
+ *
80
+ * @param evt An event dispatched from the target item.
81
+ * @returns The tree item component or null if not found.
82
+ */
83
+ export function getTreeItemTarget(evt) {
84
+ const target = evt.target;
85
+ return target.closest('forge-tree-item');
86
+ }
87
+ //
88
+ // DOM
89
+ //
90
+ /**
91
+ * Returns the level of the given tree item component.
92
+ * The level represents the depth of the item in the tree hierarchy.
93
+ *
94
+ * @param el - The tree item component.
95
+ * @returns The level of the tree item component.
96
+ */
97
+ export function getLevel(el) {
98
+ let level = 0;
99
+ let parent = getParentItem(el);
100
+ while (parent) {
101
+ level++;
102
+ parent = getParentItem(parent);
103
+ }
104
+ return level;
105
+ }
106
+ /**
107
+ * Returns the parent tree component of the given tree item component.
108
+ *
109
+ * @param el - The tree item component.
110
+ * @returns The parent tree component or null if not found.
111
+ */
112
+ export function getParentTree(el) {
113
+ return el.closest('forge-tree');
114
+ }
115
+ /**
116
+ * Retrieves the parent item of a given tree item component.
117
+ *
118
+ * @param el - The tree item component for which to find the parent item.
119
+ * @returns The parent item of the given tree item component, or `null` if the parent item is not found.
120
+ */
121
+ export function getParentItem(el) {
122
+ if (!el.parentElement) {
123
+ return null;
124
+ }
125
+ return isTreeItem(el.parentElement) ? el.parentElement : null;
126
+ }
127
+ /**
128
+ * Retrieves the child items of a tree component or tree item component.
129
+ *
130
+ * @param el The tree component or tree item component.
131
+ * @param flatten - If `true`, the function will return all child items recursively.
132
+ * @returns An array of child tree item components.
133
+ */
134
+ export function getChildItems(el, flatten = false) {
135
+ if (!flatten) {
136
+ return Array.from(el.children).filter(child => isTreeItem(child));
137
+ }
138
+ return Array.from(el.querySelectorAll('forge-tree-item'));
139
+ }
140
+ /**
141
+ * Returns the first child item of a tree component or tree item component.
142
+ *
143
+ * @param el - The tree component or tree item component.
144
+ * @returns The first child item if found, or `null` if no child item exists.
145
+ */
146
+ export function getFirstChildItem(el) {
147
+ return Array.from(el.children).find(child => isTreeItem(child)) ?? null;
148
+ }
149
+ /**
150
+ * Returns the last child item of a tree component or tree item component.
151
+ *
152
+ * @param el - The tree component or tree item component.
153
+ * @returns The last child item, or `null` if there are no child items.
154
+ */
155
+ export function getLastChildItem(el) {
156
+ // TODO: use `findLast()`
157
+ const children = Array.from(el.children).filter(child => isTreeItem(child));
158
+ return children[children.length - 1] ?? null;
159
+ }
160
+ /**
161
+ * Retrieves the sibling items of a given tree item.
162
+ *
163
+ * @param el - The tree item for which to retrieve the sibling items.
164
+ * @param includeSelf - Optional parameter to include the given tree item itself in the result.
165
+ * @returns An array of sibling tree items.
166
+ */
167
+ export function getSiblingItems(el, includeSelf = false) {
168
+ const parent = getParentItem(el) ?? getParentTree(el);
169
+ return parent ? getChildItems(parent).filter(item => includeSelf || item !== el) : [];
170
+ }
171
+ /**
172
+ * Retrieves the next tree item component in the tree hierarchy.
173
+ *
174
+ * @param el - The current tree item component.
175
+ * @returns The next tree item component, or `null` if there is no next item.
176
+ */
177
+ export function getNextItem(el, includeChildren = true) {
178
+ // If the item is open and has children, return the first child
179
+ if (includeChildren && el.open && !!getFirstChildItem(el)) {
180
+ return getFirstChildItem(el);
181
+ }
182
+ // Next search for the next tree item sibling
183
+ let nextElement = el.nextElementSibling;
184
+ while (nextElement && !isTreeItem(nextElement)) {
185
+ nextElement = nextElement.nextElementSibling;
186
+ }
187
+ if (nextElement) {
188
+ return nextElement;
189
+ }
190
+ // Repeat the process on the parent item until the next item is found
191
+ const parentItem = getParentItem(el);
192
+ if (!parentItem) {
193
+ return null;
194
+ }
195
+ return getNextItem(parentItem, false);
196
+ }
197
+ /**
198
+ * Retrieves the previous sibling tree item component of the given element.
199
+ * If there are no previous sibling items, it returns the parent item.
200
+ *
201
+ * @param el - The current tree item component.
202
+ * @returns The previous sibling tree item component or the parent item if there are no previous siblings.
203
+ */
204
+ export function getPreviousItem(el) {
205
+ // Get the previous sibling item
206
+ let previousElement = el.previousElementSibling;
207
+ while (previousElement && !isTreeItem(previousElement)) {
208
+ previousElement = previousElement.previousElementSibling;
209
+ }
210
+ // There's no previous sibling, return the parent item or null
211
+ if (!previousElement) {
212
+ return getParentItem(el);
213
+ }
214
+ // If the previous sibling is closed or a leaf, return it
215
+ if (!previousElement.open || previousElement.leaf) {
216
+ return previousElement;
217
+ }
218
+ // If it's open, recursively check the last child item until we find a closed or leaf item
219
+ let lastChild = getLastChildItem(previousElement);
220
+ while (lastChild && lastChild.open) {
221
+ lastChild = getLastChildItem(lastChild);
222
+ }
223
+ return lastChild;
224
+ }
225
+ /**
226
+ * Searches for an item in a tree based on a query string, starting from the position of a given item and wrapping around the
227
+ * beginning of the tree if necessary.
228
+ *
229
+ * @param from The starting item to search from.
230
+ * @param query The query string to search for.
231
+ * @returns The matching item if found, otherwise null.
232
+ */
233
+ export function searchItems(from, query) {
234
+ // Check if the item matches the query
235
+ const matchesQuery = (item) => item.textContent?.trim().toLowerCase().startsWith(query) ?? false;
236
+ // Recursively search the children of an item
237
+ const searchChildren = (item) => {
238
+ const children = getChildItems(item);
239
+ for (const child of children) {
240
+ if (matchesQuery(child)) {
241
+ return child;
242
+ }
243
+ if (!child.open) {
244
+ continue;
245
+ }
246
+ result = searchChildren(child);
247
+ if (result) {
248
+ return result;
249
+ }
250
+ }
251
+ return null;
252
+ };
253
+ // Search the siblings of an item and their children
254
+ const searchSiblings = (item, skipFirst = true) => {
255
+ const siblings = getSiblingItems(item, true);
256
+ const startIndex = siblings.indexOf(item) + (skipFirst ? 1 : 0);
257
+ for (let i = startIndex; i < siblings.length; i++) {
258
+ if (matchesQuery(siblings[i])) {
259
+ return siblings[i];
260
+ }
261
+ if (!siblings[i].open) {
262
+ continue;
263
+ }
264
+ result = searchChildren(siblings[i]);
265
+ if (result) {
266
+ return result;
267
+ }
268
+ }
269
+ return null;
270
+ };
271
+ query = query.toLowerCase();
272
+ let result = null;
273
+ let current = from;
274
+ let didSearchStart = false;
275
+ while (!result && current) {
276
+ result = searchSiblings(current, didSearchStart);
277
+ if (!result) {
278
+ didSearchStart = true;
279
+ current = getParentItem(current);
280
+ }
281
+ }
282
+ if (result) {
283
+ return result;
284
+ }
285
+ // All of the tree after the starting item has been searched, now start from the beginning
286
+ // TODO: stop the search if it wraps around to the starting point
287
+ const tree = getParentTree(from);
288
+ if (!tree) {
289
+ return null;
290
+ }
291
+ current = getFirstChildItem(tree);
292
+ if (!current) {
293
+ return null;
294
+ }
295
+ return searchSiblings(current, false);
296
+ }
297
+ //
298
+ // State
299
+ //
300
+ /**
301
+ * Checks if an item in a tree is indeterminate.
302
+ *
303
+ * @param el - The tree item component to check.
304
+ * @returns True if any child items are indeterminate or if the selected states of the child items are not all the same, false otherwise.
305
+ */
306
+ export function isIndeterminate(el) {
307
+ return getChildItems(el).some((child, _, children) => child.indeterminate || child.selected !== children[0].selected);
308
+ }
309
+ /**
310
+ * Closes all descendant items of a tree or tree item component.
311
+ * @param el The tree or tree item component to close the descendants of.
312
+ */
313
+ export function closeDescendants(el) {
314
+ getChildItems(el, true).forEach(item => (item.open = false));
315
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tylertech/forge",
3
3
  "description": "Tyler Forge™ Web Components library",
4
- "version": "3.12.1",
4
+ "version": "3.13.1",
5
5
  "author": "Tyler Technologies, Inc.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -14,6 +14,7 @@
14
14
  "sideEffects": false,
15
15
  "dependencies": {
16
16
  "@floating-ui/dom": "^1.7.4",
17
+ "@lit/context": "^1.1.3",
17
18
  "@tylertech/forge-core": "^3.2.1",
18
19
  "@tylertech/tyler-icons": "^2.0.4",
19
20
  "imask": "^7.6.1",
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use 'sass:map';
7
+ @use '../../../animation';
8
+ @use '../../../shape';
9
+ @use '../../../spacing';
10
+ @use '../../../theme';
11
+ @use '../../../utils';
12
+
13
+ $tokens: (
14
+ background: utils.module-val(tree, background, theme.variable(primary-container)),
15
+ color: utils.module-val(tree, color, theme.variable(on-primary-container)),
16
+ transition-duration: utils.module-val(tree, transition-duration, animation.variable(duration-short4)),
17
+ transition-timing: utils.module-val(tree, transition-timing, animation.variable(easing-standard)),
18
+ shape: utils.module-val(tree, shape, shape.variable(medium)),
19
+ padding: utils.module-val(tree, padding, spacing.variable(medium))
20
+ ) !default;
21
+
22
+ @function get($key) {
23
+ @return map.get($tokens, $key);
24
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use 'sass:map';
7
+ @use '../../../animation';
8
+ @use '../../../border';
9
+ @use '../../../shape';
10
+ @use '../../../spacing';
11
+ @use '../../../theme';
12
+ @use '../../../utils';
13
+
14
+ $tokens: (
15
+ // Color
16
+ selected-background: utils.module-val(tree-item, selected-background, theme.variable(primary-container-low)),
17
+ // Size and shape
18
+ min-block-size: utils.module-val(tree-item, min-block-size, spacing.variable(xlarge)),
19
+ shape: utils.module-val(tree-item, shape, shape.variable(medium)),
20
+ expand-icon-inline-size: utils.module-val(tree-item, expand-icon-inline-size, spacing.variable(large)),
21
+ // Spacing
22
+ padding-inline: utils.module-val(tree-item, padding-inline, spacing.variable(xxsmall)),
23
+ padding-inline-start: utils.module-ref(tree-item, padding-inline-start, padding-inline),
24
+ padding-inline-end: utils.module-ref(tree-item, padding-inline-end, padding-inline),
25
+ gap: utils.module-val(tree-item, gap, spacing.variable(xxxsmall)),
26
+ header-inline-gap: utils.module-val(tree-item, header-inline-gap, spacing.variable(xsmall)),
27
+ indent-size: utils.module-val(tree-item, indent-size, spacing.variable(medium)),
28
+ // Indent lines
29
+ indent-line-style: utils.module-val(tree-item, indent-line-style, solid),
30
+ indent-line-width: utils.module-val(tree-item, indent-line-width, border.variable(thin)),
31
+ indent-line-color: utils.module-val(tree-item, indent-line-color, theme.variable(outline)),
32
+ indent-line-offset: utils.module-val(tree-item, indent-line-offset, 11.5px),
33
+ // Disabled
34
+ disabled-opacity: utils.module-val(tree-item, disabled-opacity, theme.emphasis(medium-low))
35
+ ) !default;
36
+
37
+ @function get($key) {
38
+ @return map.get($tokens, $key);
39
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use './token-utils' as *;
7
+ @use '../tree-item/token-utils' as tree-item-token-utils;
8
+
9
+ @forward './token-utils';
10
+
11
+ @mixin host() {
12
+ display: block;
13
+ }
14
+
15
+ @mixin base() {
16
+ @include tree-item-token-utils.override(check-display, none, value);
17
+ @include tree-item-token-utils.override(indent-line-display, none, value);
18
+
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: #{tree-item-token-utils.token(gap)};
22
+ }
23
+
24
+ @mixin multiple {
25
+ @include tree-item-token-utils.override(check-display, block, value);
26
+ --forge-tree-item-selected-background: transparent;
27
+ }
28
+
29
+ @mixin with-indent-lines() {
30
+ @include tree-item-token-utils.override(indent-line-display, block, value);
31
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use '../../core/styles/tokens/tree/tree/tokens';
7
+ @use '../../core/styles/tokens/token-utils';
8
+
9
+ $_module: tree;
10
+ $_tokens: tokens.$tokens;
11
+
12
+ @mixin provide-theme($theme) {
13
+ @include token-utils.provide-theme($_module, $_tokens, $theme);
14
+ }
15
+
16
+ @function token($name, $type: token) {
17
+ @return token-utils.token($_module, $_tokens, $name, $type);
18
+ }
19
+
20
+ @function declare($token) {
21
+ @return token-utils.declare($_module, $token);
22
+ }
23
+
24
+ @mixin override($token, $token-or-value, $type: token) {
25
+ @include token-utils.override($_module, $_tokens, $token, $token-or-value, $type);
26
+ }
27
+
28
+ @mixin tokens($includes: null, $excludes: null) {
29
+ @include token-utils.tokens($_module, $_tokens, $includes, $excludes);
30
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @forward './core';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use './core';
7
+ @use '../tree-item/token-utils' as tree-item-token-utils;
8
+
9
+ //
10
+ // Host
11
+ //
12
+
13
+ :host {
14
+ @include core.host;
15
+ }
16
+
17
+ //
18
+ // Base
19
+ //
20
+
21
+ .forge-tree {
22
+ @include core.tokens;
23
+ @include tree-item-token-utils.tokens(
24
+ $includes: (
25
+ gap
26
+ )
27
+ );
28
+ }
29
+
30
+ .forge-tree {
31
+ @include core.base;
32
+
33
+ &.indent-lines {
34
+ @include core.with-indent-lines;
35
+ }
36
+
37
+ &.multiple {
38
+ @include core.multiple;
39
+ }
40
+
41
+ .icons {
42
+ display: none;
43
+ }
44
+ }
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use './token-utils' as *;
7
+ @use '../../core/styles/typography';
8
+
9
+ @forward './token-utils';
10
+
11
+ @mixin host {
12
+ display: block;
13
+ outline: none;
14
+ }
15
+
16
+ @mixin base {
17
+ @include override(checkbox-color, var(--forge-theme-text-low), value);
18
+ }
19
+
20
+ @mixin header {
21
+ @include typography.style(body2);
22
+
23
+ display: flex;
24
+ align-items: center;
25
+ gap: #{token(header-inline-gap)};
26
+ position: relative;
27
+
28
+ border-radius: #{token(shape)};
29
+ min-block-size: #{token(min-block-size)};
30
+ padding-inline-start: calc(#{token(indent-size)} * #{token(level, custom)} + #{token(padding-inline-start)});
31
+ padding-inline-end: #{token(padding-inline-end)};
32
+ }
33
+
34
+ @mixin children-header-footer {
35
+ position: relative;
36
+
37
+ padding-inline-start: calc(
38
+ #{token(indent-size)} * (#{token(level, custom)} + 1) + #{token(padding-inline-start)} + #{token(expand-icon-inline-size)} + #{token(header-inline-gap)} * 2
39
+ );
40
+ padding-inline-end: calc(#{token(padding-inline-end)} + #{token(header-inline-gap)});
41
+ }
42
+
43
+ @mixin interactive-header {
44
+ cursor: pointer;
45
+ }
46
+
47
+ @mixin content {
48
+ overflow: hidden;
49
+ margin-inline-end: auto;
50
+
51
+ white-space: nowrap;
52
+ text-overflow: ellipsis;
53
+ }
54
+
55
+ @mixin expand-icon {
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ position: relative;
60
+
61
+ border-radius: #{token(shape)};
62
+ inline-size: #{token(expand-icon-inline-size)};
63
+ min-block-size: #{token(min-block-size)};
64
+ }
65
+
66
+ @mixin disabled-expand-icon {
67
+ opacity: #{token(disabled-opacity)};
68
+ }
69
+
70
+ @mixin leaf-spacer {
71
+ inline-size: #{token(expand-icon-inline-size)};
72
+ }
73
+
74
+ @mixin checkbox {
75
+ --forge-icon-color: #{token(checkbox-color, custom)};
76
+
77
+ display: #{token(check-display, custom)};
78
+ }
79
+
80
+ @mixin selected {
81
+ @include override(checkbox-color, var(--forge-theme-tertiary), value);
82
+
83
+ background: #{token(selected-background)};
84
+ }
85
+
86
+ @mixin indeterminate {
87
+ @include override(checkbox-color, var(--forge-theme-tertiary), value);
88
+ }
89
+
90
+ @mixin children {
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: #{token(gap)};
94
+ position: relative;
95
+
96
+ margin-block-start: #{token(gap)};
97
+ }
98
+
99
+ @mixin indent-line {
100
+ display: #{token(indent-line-display, custom)};
101
+ position: absolute;
102
+ left: calc(#{token(indent-size)} * #{token(level, custom)} + #{token(indent-line-offset)} + #{token(padding-inline-start)});
103
+
104
+ block-size: 100%;
105
+ inline-size: #{token(indent-line-width)};
106
+ border-inline-start-style: #{token(indent-line-style)};
107
+ border-inline-start-width: #{token(indent-line-width)};
108
+ border-inline-start-color: #{token(indent-line-color)};
109
+ pointer-events: none;
110
+
111
+ content: '';
112
+ }
113
+
114
+ // Use this in conjunction with disabled-header to apply the pointer only to the expand icon
115
+ @mixin enabled-expand-icon {
116
+ cursor: pointer;
117
+ }
118
+
119
+ @mixin disabled-header-content {
120
+ opacity: #{token(disabled-opacity)};
121
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @use '../../core/styles/tokens/tree/tree-item/tokens';
7
+ @use '../../core/styles/tokens/token-utils';
8
+
9
+ $_module: tree-item;
10
+ $_tokens: tokens.$tokens;
11
+
12
+ @mixin provide-theme($theme) {
13
+ @include token-utils.provide-theme($_module, $_tokens, $theme);
14
+ }
15
+
16
+ @function token($name, $type: token) {
17
+ @return token-utils.token($_module, $_tokens, $name, $type);
18
+ }
19
+
20
+ @function declare($token) {
21
+ @return token-utils.declare($_module, $token);
22
+ }
23
+
24
+ @mixin override($token, $token-or-value, $type: token) {
25
+ @include token-utils.override($_module, $_tokens, $token, $token-or-value, $type);
26
+ }
27
+
28
+ @mixin tokens($includes: null, $excludes: null) {
29
+ @include token-utils.tokens($_module, $_tokens, $includes, $excludes);
30
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ @forward './core';