@odx/addon-ag-grid 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright (c) 2023 Drägerwerk AG & Co.KGaA, all rights reserved.
2
+
3
+ The use of the associated software is only permitted within the scope of a usage permit. For customers of Dräger, this right of use and its scope is derived from the contracts concluded with Dräger. Service providers/suppliers of Dräger may use the associated software for the provision of services to Dräger to the extent resulting from the contracts concluded with Dräger. Use by other third parties is expressly not permitted.
4
+
5
+ Die Nutzung der zugehörigen Software ist nur im Rahmen einer Nutzungserlaubnis gestattet. Für Kunden von Dräger ergibt sich dieses Nutzungsrecht und sein Umfang aus den mit Dräger geschlossenen Verträgen. Dienstleister/Lieferanten von Dräger dürfen die zugehörige Software zur Leistungserbringung gegenüber Dräger in dem Umfang verwenden, wie es sich aus den mit Dräger abgeschlossenen Verträgen ergibt. Eine Nutzung durch sonstige Dritte ist ausdrücklich nicht gestattet.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # @odx/addon-ag-grid
2
+
3
+ The `@odx/addon-ag-grid` package ships an ODX-branded theme for AG Grid. It gives you a turn-key way to align data grids with the ODX Design System while keeping access to every AG Grid capability.
4
+
5
+ ### Features
6
+
7
+ - **ODX visual language**: Applies typography, spacing, color, and elevation tokens from the ODX Design System out of the box.
8
+ - **Composable parts**: Start from the base `themeOdx` and opt into button, checkbox, input, and tab refinements as needed.
9
+ - **Icon bundle included**: Ships with `iconSetOdx`, so grid controls pick up the full ODX iconography set without extra wiring.
10
+ - **AG Grid ready**: Works with `ag-grid-community` v34+ and respects the new Theme API for smooth integration.
11
+
12
+ ### Install
13
+
14
+ [<img alt="NPM Version (with dist tag)" src="https://img.shields.io/npm/v/%40odx%2Faddon-ag-grid/latest?style=flat-square">](https://npmjs.org/package/@odx/addon-ag-grid)
15
+
16
+ ```bash
17
+ npm install @odx/addon-ag-grid --save
18
+ ```
19
+
20
+ ### Requirements
21
+
22
+ - `@odx/design-tokens` (peer dependency for tokens)
23
+ - `@odx/icons` (peer dependency for icon glyphs)
24
+ - `ag-grid-community` v34 or newer
25
+
26
+ ### Usage
27
+
28
+ Import the theme and optional parts you want to enable. The base theme already registers the full icon bundle, so you only need to opt into extra controls when you are ready to style them.
29
+
30
+ ```ts
31
+ import {
32
+ buttonStyleOdx,
33
+ checkboxStyleOdx,
34
+ inputStyleOdx,
35
+ tabStyleOdx,
36
+ themeOdx,
37
+ } from '@odx/addon-ag-grid';
38
+ import type { GridOptions } from 'ag-grid-community';
39
+
40
+ const odxTheme = themeOdx
41
+ .withPart(buttonStyleOdx)
42
+ .withPart(checkboxStyleOdx)
43
+ .withPart(inputStyleOdx)
44
+ .withPart(tabStyleOdx);
45
+
46
+ export const gridOptions: GridOptions = {
47
+ // your existing grid configuration
48
+ columnDefs: [],
49
+ rowData: [],
50
+ theme: odxTheme,
51
+ };
52
+ ```
53
+
54
+ Add or remove parts to match the AG Grid features you are using. Each part maps to an AG Grid Theme API feature, so you only pay the CSS cost for controls you adopt.
55
+
56
+ ### Theme Parts
57
+
58
+ - `themeOdx` - Registers the core ODX theme tokens, layout primitives, ODX typography, and density.
59
+ - `iconSetOdx` - Supplies the ODX icon bundle for grid controls out of the box.
60
+ - `buttonStyleOdx` - Gives grid buttons the ODX look, spacing, and interaction states.
61
+ - `checkboxStyleOdx` - Aligns selection checkboxes with ODX shapes and color tokens.
62
+ - `inputStyleOdx` - Matches filter and inline inputs to the ODX form pattern.
63
+ - `tabStyleOdx` - Styles grid tabs (in development for AG Grid Enterprise tab support).
64
+
65
+ ### Custom Parts
66
+
67
+ Extend the theme with your own part when you need bespoke styling:
68
+
69
+ ```ts
70
+ import { createPart } from 'ag-grid-community';
71
+
72
+ const myCustomAddon = createPart({
73
+ feature: 'myCustomAddon',
74
+ css: `
75
+ /* write styles inline or import from a CSS module */
76
+ `,
77
+ });
78
+
79
+ const odxTheme = themeOdx
80
+ .withPart(buttonStyleOdx)
81
+ .withPart(checkboxStyleOdx)
82
+ .withPart(inputStyleOdx)
83
+ .withPart(tabStyleOdx)
84
+ // last part
85
+ .withPart(myCustomAddon);
86
+ ```
87
+
88
+ ### Documentation
89
+
90
+ For advanced usage, customization strategies, and best practices, refer to our <a href="https://odx.draeger.com" target="_blank" rel="noopener">documentation</a>.
91
+
92
+ ### Contact
93
+
94
+ For questions, feedback, or support, please reach out via our <a href="https://odx.draeger.com/contact" target="_blank" rel="noopener">contact page</a>.
@@ -0,0 +1,19 @@
1
+ export declare const buttonStyleOdx: import('ag-grid-community').Part<{
2
+ buttonTextColor: import('ag-grid-community').ColorValue;
3
+ buttonFontWeight: import('ag-grid-community').FontWeightValue;
4
+ buttonBackgroundColor: import('ag-grid-community').ColorValue;
5
+ buttonBorder: import('ag-grid-community').BorderValue;
6
+ buttonBorderRadius: import('ag-grid-community').LengthValue;
7
+ buttonHorizontalPadding: import('ag-grid-community').LengthValue;
8
+ buttonVerticalPadding: import('ag-grid-community').LengthValue;
9
+ buttonHoverTextColor: import('ag-grid-community').ColorValue;
10
+ buttonHoverBackgroundColor: import('ag-grid-community').ColorValue;
11
+ buttonHoverBorder: import('ag-grid-community').BorderValue;
12
+ buttonActiveTextColor: import('ag-grid-community').ColorValue;
13
+ buttonActiveBackgroundColor: import('ag-grid-community').ColorValue;
14
+ buttonActiveBorder: import('ag-grid-community').BorderValue;
15
+ buttonDisabledTextColor: import('ag-grid-community').ColorValue;
16
+ buttonDisabledBackgroundColor: import('ag-grid-community').ColorValue;
17
+ buttonDisabledBorder: import('ag-grid-community').BorderValue;
18
+ }>;
19
+ //# sourceMappingURL=button-style.d.ts.map
@@ -0,0 +1,16 @@
1
+ export declare const checkboxStyleOdx: import('ag-grid-community').Part<{
2
+ checkboxBorderRadius: import('ag-grid-community').LengthValue;
3
+ checkboxBorderWidth: import('ag-grid-community').LengthValue;
4
+ checkboxCheckedBackgroundColor: import('ag-grid-community').ColorValue;
5
+ checkboxCheckedBorderColor: import('ag-grid-community').ColorValue;
6
+ checkboxCheckedShapeColor: import('ag-grid-community').ColorValue;
7
+ checkboxCheckedShapeImage: import('ag-grid-community').ImageValue;
8
+ checkboxIndeterminateBackgroundColor: import('ag-grid-community').ColorValue;
9
+ checkboxIndeterminateBorderColor: import('ag-grid-community').ColorValue;
10
+ checkboxIndeterminateShapeColor: import('ag-grid-community').ColorValue;
11
+ checkboxIndeterminateShapeImage: import('ag-grid-community').ImageValue;
12
+ checkboxUncheckedBackgroundColor: import('ag-grid-community').ColorValue;
13
+ checkboxUncheckedBorderColor: import('ag-grid-community').ColorValue;
14
+ radioCheckedShapeImage: import('ag-grid-community').ImageValue;
15
+ }>;
16
+ //# sourceMappingURL=checkbox-style.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Part } from 'ag-grid-community';
2
+ export declare const coreStylesOdx: Part;
3
+ //# sourceMappingURL=core-style.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { AggregationIcon } from '@odx/icons/core';
2
+ export declare function getIconContent(icon: typeof AggregationIcon): {
3
+ svg: string;
4
+ };
5
+ export declare const iconSetOdx: import('ag-grid-community').Part<{}>;
6
+ //# sourceMappingURL=icon-set.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Part } from 'ag-grid-community';
2
+ export declare const inputStyleOdx: Part;
3
+ //# sourceMappingURL=input-style.d.ts.map
@@ -0,0 +1,22 @@
1
+ export declare const tabStyleOdx: import('ag-grid-community').Part<{
2
+ tabBackgroundColor: import('ag-grid-community').ColorValue;
3
+ tabBarBackgroundColor: import('ag-grid-community').ColorValue;
4
+ tabBarBorder: import('ag-grid-community').BorderValue;
5
+ tabBarHorizontalPadding: import('ag-grid-community').LengthValue;
6
+ tabBarTopPadding: import('ag-grid-community').LengthValue;
7
+ tabBottomPadding: import('ag-grid-community').LengthValue;
8
+ tabHorizontalPadding: import('ag-grid-community').LengthValue;
9
+ tabHoverBackgroundColor: import('ag-grid-community').ColorValue;
10
+ tabHoverTextColor: import('ag-grid-community').ColorValue;
11
+ tabSelectedBackgroundColor: import('ag-grid-community').ColorValue;
12
+ tabSelectedBorderColor: import('ag-grid-community').ColorValue;
13
+ tabSelectedBorderWidth: import('ag-grid-community').LengthValue;
14
+ tabSelectedTextColor: import('ag-grid-community').ColorValue;
15
+ tabSelectedUnderlineColor: import('ag-grid-community').ColorValue;
16
+ tabSelectedUnderlineTransitionDuration: import('ag-grid-community').DurationValue;
17
+ tabSelectedUnderlineWidth: import('ag-grid-community').LengthValue;
18
+ tabSpacing: import('ag-grid-community').LengthValue;
19
+ tabTextColor: import('ag-grid-community').ColorValue;
20
+ tabTopPadding: import('ag-grid-community').LengthValue;
21
+ }>;
22
+ //# sourceMappingURL=tab-style.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Theme, ThemeDefaultParams } from 'ag-grid-community';
2
+ export declare const themeOdx: Theme<ThemeDefaultParams>;
3
+ //# sourceMappingURL=theme.d.ts.map
package/dist/main.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './lib/parts/button-style.js';
2
+ export * from './lib/parts/checkbox-style.js';
3
+ export * from './lib/parts/icon-set.js';
4
+ export * from './lib/parts/input-style.js';
5
+ export * from './lib/parts/tab-style.js';
6
+ export * from './lib/theme.js';
7
+ //# sourceMappingURL=main.d.ts.map
package/dist/main.js ADDED
@@ -0,0 +1,251 @@
1
+ import { token } from '@odx/design-tokens';
2
+ import { createPart, iconOverrides, createTheme } from 'ag-grid-community';
3
+ import { ArrowUpIcon, LinkOffIcon, ChevronDownIcon, MinusIcon, ChevronRightIcon, CheckIcon, ChevronUpIcon, ChevronLeftIcon, SaveIcon, ArrowRightIcon, PlusIcon, TableIcon, PinIcon, PasteIcon, ErrorIcon, SortableIcon, MinimizeIcon, MoreIcon, MenuIcon, MaximizeIcon, LoadingIcon, LinkIcon, ArrowLeftIcon, ChevronRightEndIcon, GroupIcon, RearrangeIcon, ChevronLeftEndIcon, FilterIcon, ViewIcon, ViewOffIcon, FileExcelIcon, EditIcon, ArrowDownIcon, DescendingIcon, FileCsvIcon, CloseIcon, CutIcon, CopyContentIcon, ColumnIcon, ColorpickerIcon, BarChartIcon, CancelIcon, AscendingIcon, ChevronsIcon, AggregationIcon } from '@odx/icons/core';
4
+
5
+ const styles$4 = ":where(.ag-button){transition:var(--odx-transition-reduced);cursor:pointer;text-indent:inherit;text-transform:inherit;text-shadow:inherit;line-height:inherit;word-spacing:inherit;letter-spacing:inherit;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;background:0 0;border:none;margin:0;padding:0;transition-property:background-color,border-color,color;&:disabled{cursor:default}&:focus-visible{outline:var(--odx-focus-ring-outer);box-shadow:var(--odx-focus-ring-inner)}}.ag-standard-button{appearance:none;border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);background-color:var(--ag-button-background-color);cursor:pointer;padding:var(--ag-button-vertical-padding)var(--ag-button-horizontal-padding);color:var(--ag-button-text-color);font-weight:var(--ag-button-font-weight);&:hover{border:var(--ag-button-hover-border);background-color:var(--ag-button-hover-background-color);color:var(--ag-button-hover-text-color)}&:active{border:var(--ag-button-active-border);background-color:var(--ag-button-active-background-color);color:var(--ag-button-active-text-color)}&:disabled{border:var(--ag-button-disabled-border);background-color:var(--ag-button-disabled-background-color);color:var(--ag-button-disabled-text-color)}}";
6
+
7
+ const buttonStyleOdx = createPart({
8
+ feature: "buttonStyle",
9
+ params: {
10
+ buttonActiveBackgroundColor: token("color.background.primary.pressed"),
11
+ buttonActiveBorder: false,
12
+ buttonActiveTextColor: token("color.foreground.inverse"),
13
+ buttonBackgroundColor: token("color.background.primary.rest"),
14
+ buttonBorder: false,
15
+ buttonBorderRadius: token("control.border-radius"),
16
+ buttonDisabledBackgroundColor: token("color.background.disabled.rest"),
17
+ buttonDisabledBorder: false,
18
+ buttonDisabledTextColor: token("color.foreground.disabled.rest"),
19
+ buttonFontWeight: token("typography.font-weight.medium"),
20
+ buttonHorizontalPadding: { calc: `${token("control.spacing-inline-md")} * 2` },
21
+ buttonHoverBackgroundColor: token("color.background.primary.hover"),
22
+ buttonHoverBorder: false,
23
+ buttonHoverTextColor: token("color.foreground.inverse"),
24
+ buttonTextColor: token("color.foreground.inverse"),
25
+ buttonVerticalPadding: token("control.spacing-md")
26
+ },
27
+ css: styles$4
28
+ });
29
+
30
+ const styles$3 = ".ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{transition:var(--odx-transition-reduced);border:solid var(--ag-checkbox-border-width)var(--ag-checkbox-unchecked-border-color);background-color:var(--ag-checkbox-unchecked-background-color);width:var(--ag-icon-size);height:var(--ag-icon-size);flex:none;transition-property:background-color,border-color;position:relative;&:after{content:\"\";pointer-events:none;display:block;position:absolute;inset:0;mask-position:50%;mask-repeat:no-repeat}&:where(.ag-checked){border-color:var(--ag-checkbox-checked-border-color);background-color:var(--ag-checkbox-checked-background-color);&:after{background-color:var(--ag-checkbox-checked-shape-color)}}&:where(:focus-within){outline:var(--odx-focus-ring-outer);outline-offset:var(--odx-focus-ring-offset-sm)}&:where(.ag-disabled){filter:grayscale();opacity:.5}:where(input){appearance:none;opacity:0;cursor:pointer;width:var(--ag-icon-size);height:var(--ag-icon-size);margin:0;display:block}}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){border-color:var(--ag-checkbox-indeterminate-border-color);background-color:var(--ag-checkbox-indeterminate-background-color);&:after{background-color:var(--ag-checkbox-indeterminate-shape-color);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{outline:var(--odx-border-width-thick)solid var(--odx-color-stroke-danger-rest);outline-offset:var(--odx-focus-ring-offset-sm)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{mask-image:var(--ag-radio-checked-shape-image)}}";
31
+
32
+ function getIconContent(icon) {
33
+ return { svg: icon.content || "" };
34
+ }
35
+ const iconSetOdx = iconOverrides({
36
+ type: "image",
37
+ mask: true,
38
+ icons: {
39
+ aggregation: getIconContent(AggregationIcon),
40
+ arrows: getIconContent(ChevronsIcon),
41
+ asc: getIconContent(AscendingIcon),
42
+ cancel: getIconContent(CancelIcon),
43
+ chart: getIconContent(BarChartIcon),
44
+ "chevron-up": getIconContent(ChevronUpIcon),
45
+ "chevron-down": getIconContent(ChevronDownIcon),
46
+ "chevron-left": getIconContent(ChevronLeftIcon),
47
+ "chevron-right": getIconContent(ChevronRightIcon),
48
+ "color-picker": getIconContent(ColorpickerIcon),
49
+ columns: getIconContent(ColumnIcon),
50
+ contracted: getIconContent(ChevronRightIcon),
51
+ copy: getIconContent(CopyContentIcon),
52
+ cut: getIconContent(CutIcon),
53
+ cross: getIconContent(CloseIcon),
54
+ csv: getIconContent(FileCsvIcon),
55
+ desc: getIconContent(DescendingIcon),
56
+ down: getIconContent(ArrowDownIcon),
57
+ edit: getIconContent(EditIcon),
58
+ excel: getIconContent(FileExcelIcon),
59
+ expanded: getIconContent(ChevronLeftIcon),
60
+ "eye-slash": getIconContent(ViewOffIcon),
61
+ eye: getIconContent(ViewIcon),
62
+ filter: getIconContent(FilterIcon),
63
+ // 'filter-add': '',
64
+ first: getIconContent(ChevronLeftEndIcon),
65
+ grip: getIconContent(RearrangeIcon),
66
+ group: getIconContent(GroupIcon),
67
+ last: getIconContent(ChevronRightEndIcon),
68
+ left: getIconContent(ArrowLeftIcon),
69
+ linked: getIconContent(LinkIcon),
70
+ loading: getIconContent(LoadingIcon),
71
+ maximize: getIconContent(MaximizeIcon),
72
+ menu: getIconContent(MenuIcon),
73
+ "menu-alt": getIconContent(MoreIcon),
74
+ minimize: getIconContent(MinimizeIcon),
75
+ minus: getIconContent(MinusIcon),
76
+ next: getIconContent(ChevronRightIcon),
77
+ none: getIconContent(SortableIcon),
78
+ "not-allowed": getIconContent(ErrorIcon),
79
+ paste: getIconContent(PasteIcon),
80
+ pin: getIconContent(PinIcon),
81
+ // 'pinned-bottom': '',
82
+ // 'pinned-top': '',
83
+ pivot: getIconContent(TableIcon),
84
+ plus: getIconContent(PlusIcon),
85
+ previous: getIconContent(ChevronLeftIcon),
86
+ right: getIconContent(ArrowRightIcon),
87
+ save: getIconContent(SaveIcon),
88
+ "small-down": getIconContent(ChevronDownIcon),
89
+ "small-left": getIconContent(ChevronLeftIcon),
90
+ "small-right": getIconContent(ChevronRightIcon),
91
+ "small-up": getIconContent(ChevronUpIcon),
92
+ tick: getIconContent(CheckIcon),
93
+ "tree-closed": getIconContent(ChevronRightIcon),
94
+ "tree-indeterminate": getIconContent(MinusIcon),
95
+ "tree-open": getIconContent(ChevronDownIcon),
96
+ unlinked: getIconContent(LinkOffIcon),
97
+ up: getIconContent(ArrowUpIcon)
98
+ }
99
+ });
100
+
101
+ const checkboxStyleOdx = createPart({
102
+ feature: "checkboxStyle",
103
+ params: {
104
+ checkboxBorderRadius: token("control.border-radius"),
105
+ checkboxBorderWidth: token("control.border-width"),
106
+ checkboxUncheckedBackgroundColor: token("control.color.background.rest"),
107
+ checkboxUncheckedBorderColor: token("control.color.stroke.rest"),
108
+ checkboxCheckedBackgroundColor: token("control.color.background.selected"),
109
+ checkboxCheckedBorderColor: token("control.color.stroke.selected"),
110
+ checkboxCheckedShapeColor: token("color.foreground.inverse-static"),
111
+ checkboxCheckedShapeImage: {
112
+ svg: getIconContent(CheckIcon).svg
113
+ },
114
+ checkboxIndeterminateBackgroundColor: token("control.color.background.selected"),
115
+ checkboxIndeterminateBorderColor: token("control.color.stroke.selected"),
116
+ checkboxIndeterminateShapeColor: token("color.foreground.inverse-static"),
117
+ checkboxIndeterminateShapeImage: {
118
+ svg: getIconContent(MinusIcon).svg
119
+ },
120
+ radioCheckedShapeImage: {
121
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="4" /></svg>`
122
+ }
123
+ },
124
+ css: styles$3
125
+ });
126
+
127
+ const styles$2 = ":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){appearance:textfield;&::-webkit-inner-spin-button{appearance:none;margin:0}&::-webkit-outer-spin-button{appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){--_color-background:var(--odx-control-color-background-rest);--_color-background-hover:var(--odx-control-color-background-hover);--_color-stroke:var(--odx-control-color-stroke-rest);--_color-stroke-hover:var(--odx-control-color-stroke-hover);border-bottom:var(--odx-control-border-width)solid var(--odx-control-color-stroke-rest);border-radius:var(--odx-control-border-radius);background-color:var(--_color-background);padding-block:calc(var(--odx-control-spacing-md) - var(--odx-control-border-width));padding-inline:calc(var(--odx-control-spacing-inline-md) - var(--odx-control-border-width));min-width:var(--odx-control-width-lg);min-height:var(--odx-control-height-md);line-height:inherit;color:inherit;font-family:inherit;font-size:inherit;margin:0;&::placeholder{color:var(--odx-color-foreground-rest-subtle);font-weight:var(--odx-typography-font-weight-normal)}&:where(:disabled){--_color-foreground:var(--odx-color-foreground-disabled-rest);--_color-background:var(--odx-color-background-disabled-rest);--_color-stroke:var(--odx-color-stroke-disabled-rest)}&:where(:focus){outline:var(--odx-focus-ring-outer);box-shadow:var(--odx-focus-ring-inner)}&:where(:invalid),&:where(.invalid){--_color-background:var(--odx-color-background-danger-subtle);--_color-stroke:var(--odx-color-foreground-danger-rest)}}";
128
+
129
+ const inputStyleOdx = createPart({
130
+ feature: "inputStyle",
131
+ css: styles$2
132
+ });
133
+
134
+ const styles$1 = ".ag-tabs-header{gap:var(--ag-tab-spacing);border-bottom:var(--ag-tab-bar-border);background-color:var(--ag-tab-bar-background-color);padding:var(--ag-tab-bar-top-padding)var(--ag-tab-bar-horizontal-padding)0;flex:1;display:flex}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{padding:var(--ag-spacing);border:0;align-items:center;display:flex}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width)var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width)var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;cursor:pointer;border:0;padding:0}.ag-tab{border-right:var(--ag-tab-selected-border-width)solid transparent;border-left:var(--ag-tab-selected-border-width)solid transparent;background-color:var(--ag-tab-background-color);cursor:pointer;padding:var(--ag-tab-top-padding)var(--ag-tab-horizontal-padding)var(--ag-tab-bottom-padding);color:var(--ag-tab-text-color);flex:1;justify-content:center;align-items:center;display:flex;position:relative;&:after{transition:opacity var(--ag-tab-selected-underline-transition-duration);opacity:0;background-color:var(--ag-tab-selected-underline-color);height:var(--ag-tab-selected-underline-width);content:\"\";display:block;position:absolute;bottom:0;left:0;right:0}&:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}&.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}&.ag-tab-selected:after{opacity:1}}:where(.ag-ltr) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}}}:where(.ag-rtl) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}}}";
135
+
136
+ const tabStyleOdx = createPart({
137
+ feature: "tabStyle",
138
+ params: {
139
+ tabBarBackgroundColor: "transparent",
140
+ tabBarHorizontalPadding: 0,
141
+ tabBarTopPadding: 0,
142
+ tabBackgroundColor: "transparent",
143
+ tabTextColor: {
144
+ ref: "textColor"
145
+ },
146
+ tabHorizontalPadding: {
147
+ ref: "spacing"
148
+ },
149
+ tabTopPadding: {
150
+ ref: "spacing"
151
+ },
152
+ tabBottomPadding: {
153
+ ref: "spacing"
154
+ },
155
+ tabSpacing: "0",
156
+ tabHoverBackgroundColor: {
157
+ ref: "tabBackgroundColor"
158
+ },
159
+ tabHoverTextColor: {
160
+ ref: "tabTextColor"
161
+ },
162
+ tabSelectedBackgroundColor: {
163
+ ref: "tabBackgroundColor"
164
+ },
165
+ tabSelectedTextColor: {
166
+ ref: "tabTextColor"
167
+ },
168
+ tabSelectedBorderWidth: {
169
+ ref: "borderWidth"
170
+ },
171
+ tabSelectedBorderColor: "transparent",
172
+ tabSelectedUnderlineColor: "transparent",
173
+ tabSelectedUnderlineWidth: 0,
174
+ tabSelectedUnderlineTransitionDuration: 0,
175
+ tabBarBorder: false
176
+ },
177
+ css: styles$1
178
+ });
179
+
180
+ const styles = ".ag-header-cell,.ag-picker-field-wrapper,.ag-select-list-item,.ag-select-list-item:after{transition:var(--odx-transition-reduced);transition-property:background-color}.ag-filter-apply-panel-button{line-height:1.5em}.ag-picker-field-wrapper{--ag-focus-shadow:var(--odx-focus-ring-inner);border-bottom:var(--odx-control-border-width)solid var(--odx-control-color-stroke-rest);border-radius:var(--odx-control-border-radius);background-color:var(--odx-control-color-background-rest);cursor:pointer;min-width:var(--odx-control-width-lg);&:focus-within{outline:var(--odx-focus-ring-outer)}}.ag-select-list{border-radius:var(--odx-control-border-radius);box-shadow:var(--odx-elevation-shadow-level-2);background-color:var(--odx-color-background-level-2);.ag-select-list-item{border:var(--odx-control-border-width)solid transparent;padding-block:calc(var(--odx-control-spacing-md) - var(--odx-control-border-width));padding-inline:calc(var(--odx-control-spacing-inline-md) - var(--odx-control-border-width));height:var(--odx-control-height-md);touch-action:manipulation;display:flex;&.ag-active-item{background-color:var(--odx-color-background-transparent-selected-hover)}}}.ag-header-cell-text{flex:1}.ag-paging-panel .ag-paging-row-summary-panel-number{font-weight:var(--odx-typography-font-weight-semibold)}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-focus:not(.ag-cell-range-selected).pseudo-focus-within,.pseudo-focus-within-all .ag-cell-focus:not(.ag-cell-range-selected),.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus.pseudo-focus .ag-cell-wrapper.ag-row-group,.pseudo-focus-all .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group{border-width:var(--odx-border-width-thick)}";
181
+
182
+ const coreStylesOdx = createPart({
183
+ feature: "coreStyles",
184
+ css: styles
185
+ });
186
+
187
+ const themeOdx = createTheme().withPart(iconSetOdx).withParams({
188
+ accentColor: token("color.foreground.rest"),
189
+ wrapperBorder: false,
190
+ wrapperBorderRadius: token("border-radius.md"),
191
+ borderRadius: token("border-radius.md"),
192
+ foregroundColor: token("color.foreground.rest"),
193
+ borderColor: token("color.stroke.neutral.subtle"),
194
+ backgroundColor: token("color.background.level-1"),
195
+ headerBackgroundColor: token("color.background.transparent.rest"),
196
+ headerColumnResizeHandleColor: token("control.color.stroke.rest"),
197
+ headerRowBorder: {
198
+ style: "solid",
199
+ color: token("control.color.stroke.rest"),
200
+ width: token("control.border-width")
201
+ },
202
+ fontFamily: token("typography.font-family.base"),
203
+ fontSize: token("typography.font-size.base"),
204
+ headerFontWeight: token("typography.font-weight.semibold"),
205
+ rowBorder: {
206
+ style: "solid",
207
+ color: token("color.stroke.neutral.subtle"),
208
+ width: token("control.border-width")
209
+ },
210
+ rowHeight: token("size.300"),
211
+ rowHoverColor: token("color.background.transparent.hover"),
212
+ oddRowBackgroundColor: token("color.background.transparent.hover"),
213
+ selectedRowBackgroundColor: token("color.background.transparent.selected"),
214
+ cellHorizontalPadding: token("spacing.75"),
215
+ pinnedColumnBorder: {
216
+ width: token("control.border-width"),
217
+ style: "solid",
218
+ color: token("control.color.stroke.rest")
219
+ },
220
+ rangeSelectionBorderColor: token("color.stroke.focus.outer"),
221
+ iconSize: token("control.addon-size-sm"),
222
+ iconButtonActiveColor: token("color.foreground.rest"),
223
+ iconButtonActiveBackgroundColor: token("color.background.transparent.hover"),
224
+ iconButtonColor: token("color.foreground.rest"),
225
+ iconButtonBackgroundColor: token("color.background.transparent.rest"),
226
+ iconButtonActiveIndicatorColor: token("color.foreground.rest"),
227
+ iconButtonHoverBackgroundColor: token("color.background.transparent.hover"),
228
+ iconColor: token("color.foreground.rest"),
229
+ invalidColor: token("color.background.warning.rest"),
230
+ browserColorScheme: "inherit",
231
+ menuBackgroundColor: token("color.background.level-2"),
232
+ menuBorder: "none",
233
+ menuShadow: token("elevation.shadow.level-2"),
234
+ menuTextColor: token("color.foreground.rest"),
235
+ widgetVerticalSpacing: token("spacing.100"),
236
+ footerRowBorder: {
237
+ style: "solid",
238
+ color: token("control.color.stroke.rest"),
239
+ width: token("control.border-width")
240
+ },
241
+ focusShadow: {
242
+ color: token("color.stroke.focus.outer"),
243
+ offsetX: 0,
244
+ offsetY: 0,
245
+ spread: {
246
+ calc: "var(--odx-focus-ring-offset) * -1"
247
+ }
248
+ }
249
+ }).withPart(coreStylesOdx);
250
+
251
+ export { buttonStyleOdx, checkboxStyleOdx, getIconContent, iconSetOdx, inputStyleOdx, tabStyleOdx, themeOdx };
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@odx/addon-ag-grid",
3
+ "displayName": "ODX AG Grid Theming Addon",
4
+ "description": "A package providing integration and enhancements for ag-Grid within the ODX Foundation project",
5
+ "version": "1.0.0",
6
+ "author": "Drägerwerk AG & Co.KGaA",
7
+ "license": "SEE LICENSE IN LICENSE",
8
+ "homepage": "https://odx.draeger.com",
9
+ "files": [
10
+ "dist",
11
+ "LICENSE",
12
+ "!dist/**/*.map",
13
+ "!dist/**/*.stories.d.ts"
14
+ ],
15
+ "type": "module",
16
+ "dependencies": {
17
+ "ag-grid-community": "^34.2.0",
18
+ "lit": "3.3.1"
19
+ },
20
+ "peerDependencies": {
21
+ "@odx/icons": "^4.0.0-rc.49",
22
+ "@odx/design-tokens": "^2.2.0"
23
+ },
24
+ "devDependencies": {
25
+ "@odx/icons": "4.0.0-rc.49",
26
+ "stylelint": "16.25.0",
27
+ "@odx/design-tokens": "2.2.0",
28
+ "@odx-internal/config-stylelint": "0.0.0",
29
+ "@odx-internal/config-typescript": "0.0.0",
30
+ "@odx-internal/config-vite": "0.0.0",
31
+ "@odx-internal/utils-storybook": "0.0.0"
32
+ },
33
+ "sideEffects": [
34
+ "dist/main.js"
35
+ ],
36
+ "exports": {
37
+ ".": {
38
+ "import": "./dist/main.js",
39
+ "types": "./dist/main.d.ts"
40
+ }
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "stylelint": {
46
+ "extends": "@odx-internal/config-stylelint"
47
+ },
48
+ "scripts": {
49
+ "build": "vite build",
50
+ "dev": "vite build --watch --mode=development",
51
+ "dev:tsc": "tsc --build tsconfig.lib.json --noEmit --watch",
52
+ "lint": "biome lint src",
53
+ "generate:manifest": "cem analyze"
54
+ }
55
+ }