@aivenio/aquarium 1.71.0 → 1.73.0-rc1
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/dist/_variables.scss +255 -244
- package/dist/atoms.cjs +1101 -947
- package/dist/atoms.mjs +1101 -947
- package/dist/src/atoms/Banner/Banner.js +3 -7
- package/dist/src/atoms/DataList/DataList.js +2 -2
- package/dist/src/atoms/Select/Select.js +2 -2
- package/dist/src/atoms/Toast/Toast.js +2 -2
- package/dist/src/atoms/Typography/Typography.js +3 -3
- package/dist/src/icons/award.d.ts +9 -0
- package/dist/src/icons/award.js +11 -0
- package/dist/src/icons/governance.d.ts +9 -0
- package/dist/src/icons/governance.js +11 -0
- package/dist/src/icons/index.d.ts +2 -0
- package/dist/src/icons/index.js +3 -1
- package/dist/src/molecules/Box/Box.d.ts +5 -6
- package/dist/src/molecules/Box/Box.js +13 -7
- package/dist/src/molecules/Grid/Grid.js +4 -4
- package/dist/src/molecules/Section/Section.js +3 -3
- package/dist/src/molecules/Tailwindify/Tailwindify.d.ts +2 -1
- package/dist/src/molecules/Tailwindify/Tailwindify.js +1 -1
- package/dist/src/system.d.ts +1 -6
- package/dist/src/system.js +2 -11
- package/dist/src/tokens/tokens.json +647 -0
- package/dist/src/utils/breakpoints.js +3 -3
- package/dist/src/utils/useStyle.js +6 -2
- package/dist/styles.css +2074 -1473
- package/dist/system.cjs +1120 -971
- package/dist/system.mjs +1120 -973
- package/dist/tailwind.config.js +73 -161
- package/dist/tailwind.theme.json +383 -331
- package/dist/tokens.json +644 -562
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/designTokens.d.ts +12 -11
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +11 -9
- package/dist/src/js/resolveTheme.d.ts +0 -8
- package/dist/src/js/resolveTheme.js +0 -10
package/dist/tailwind.config.js
CHANGED
@@ -1,159 +1,74 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
2
2
|
const plugin = require('tailwindcss/plugin');
|
3
|
-
const defaultTheme = require('tailwindcss/defaultTheme');
|
4
|
-
const _ = require('lodash');
|
5
|
-
const { theme } = require('./src/js/resolveTheme');
|
6
|
-
const { themeTransformer } = require('./themeTransformer');
|
7
|
-
/*
|
8
|
-
* Shortens a given spacing key to a minimal differentiable string
|
9
|
-
* example for resulting classnames with/without the shortening:
|
10
|
-
* h-l1 / h-layout01; m-1 / m-spacing01
|
11
|
-
*/
|
12
|
-
const shortenSpacingKey = (key) => key.replace('ayout0', '').replace('spacing0', '');
|
13
|
-
|
14
|
-
const spacing = _.reduce(theme.spacing, (acc, { px }, key) => ({ ...acc, [shortenSpacingKey(key)]: `${px}px` }), {
|
15
|
-
'0': '0',
|
16
|
-
'1px': '1px',
|
17
|
-
});
|
18
|
-
|
19
|
-
const originalTheme = {
|
20
|
-
extend: {
|
21
|
-
zIndex: {
|
22
|
-
modal: '100',
|
23
|
-
},
|
24
|
-
borderColor: {
|
25
|
-
'muted': 'var(--aquarium-colors-grey-5)',
|
26
|
-
'default': 'var(--aquarium-colors-grey-20)',
|
27
|
-
'intense': 'var(--aquarium-colors-grey-50)',
|
28
|
-
'primary-muted': 'var(--aquarium-colors-primary-60)',
|
29
|
-
'primary-default': 'var(--aquarium-colors-primary-80)',
|
30
|
-
'primary-intense': 'var(--aquarium-colors-primary-100)',
|
31
|
-
'info-muted': 'var(--aquarium-colors-info-50)',
|
32
|
-
'info-default': 'var(--aquarium-colors-info-70)',
|
33
|
-
'info-intense': 'var(--aquarium-colors-info-90)',
|
34
|
-
'success-muted': 'var(--aquarium-colors-success-10)',
|
35
|
-
'success-default': 'var(--aquarium-colors-success-40)',
|
36
|
-
'success-intense': 'var(--aquarium-colors-success-70)',
|
37
|
-
'warning-muted': 'var(--aquarium-colors-warning-20)',
|
38
|
-
'warning-default': 'var(--aquarium-colors-warning-70)',
|
39
|
-
'warning-intense': 'var(--aquarium-colors-warning-90)',
|
40
|
-
'danger-muted': 'var(--aquarium-colors-error-10)',
|
41
|
-
'danger-default': 'var(--aquarium-colors-error-50)',
|
42
|
-
'danger-intense': 'var(--aquarium-colors-error-80)',
|
43
|
-
},
|
44
|
-
backgroundColor: {
|
45
|
-
'body': 'var(--aquarium-colors-white)',
|
46
|
-
'body-intense': 'var(--aquarium-colors-grey-80)',
|
47
|
-
'popover-content': 'var(--aquarium-colors-white)',
|
48
|
-
'muted': 'var(--aquarium-colors-grey-0)',
|
49
|
-
'default': 'var(--aquarium-colors-grey-5)',
|
50
|
-
'intense': 'var(--aquarium-colors-grey-20)',
|
51
|
-
'primary-muted': 'var(--aquarium-colors-primary-40)',
|
52
|
-
'primary-default': 'var(--aquarium-colors-primary-80)',
|
53
|
-
'primary-intense': 'var(--aquarium-colors-primary-90)',
|
54
|
-
'primary-active': 'var(--aquarium-colors-primary-5)',
|
55
|
-
'primary-hover': 'var(--aquarium-colors-primary-5)',
|
56
|
-
'info-muted': 'var(--aquarium-colors-info-10)',
|
57
|
-
'info-default': 'var(--aquarium-colors-info-70)',
|
58
|
-
'info-intense': 'var(--aquarium-colors-info-90)',
|
59
|
-
'success-muted': 'var(--aquarium-colors-success-5)',
|
60
|
-
'success-default': 'var(--aquarium-colors-success-70)',
|
61
|
-
'success-intense': 'var(--aquarium-colors-success-90)',
|
62
|
-
'warning-muted': 'var(--aquarium-colors-warning-5)',
|
63
|
-
'warning-default': 'var(--aquarium-colors-warning-70)',
|
64
|
-
'warning-intense': 'var(--aquarium-colors-warning-90)',
|
65
|
-
'danger-muted': 'var(--aquarium-colors-error-10)',
|
66
|
-
'danger-default': 'var(--aquarium-colors-error-20)',
|
67
|
-
'danger-intense': 'var(--aquarium-colors-error-50)',
|
68
|
-
'status-announcement': 'var(--aquarium-colors-primary-5)',
|
69
|
-
'status-info': 'var(--aquarium-colors-info-10)',
|
70
|
-
'status-warning': 'var(--aquarium-colors-warning-5)',
|
71
|
-
'status-danger': 'var(--aquarium-colors-error-5)',
|
72
|
-
'status-success': 'var(--aquarium-colors-success-5)',
|
73
|
-
'icon-button-hover': 'rgba(25,25,29,.05)', // rgb value is from grey-100
|
74
|
-
},
|
75
|
-
textColor: {
|
76
|
-
'inactive': 'var(--aquarium-colors-grey-40)',
|
77
|
-
'muted': 'var(--aquarium-colors-grey-50)',
|
78
|
-
'default': 'var(--aquarium-colors-grey-70)',
|
79
|
-
'intense': 'var(--aquarium-colors-grey-90)',
|
80
|
-
'primary-inactive': 'var(--aquarium-colors-primary-40)',
|
81
|
-
'primary-active': 'var(--aquarium-colors-primary-90)',
|
82
|
-
'primary-muted': 'var(--aquarium-colors-primary-60)',
|
83
|
-
'primary-default': 'var(--aquarium-colors-primary-70)',
|
84
|
-
'primary-intense': 'var(--aquarium-colors-primary-80)',
|
85
|
-
'info-inactive': 'var(--aquarium-colors-info-20)',
|
86
|
-
'info-muted': 'var(--aquarium-colors-info-40)',
|
87
|
-
'info-default': 'var(--aquarium-colors-info-70)',
|
88
|
-
'info-intense': 'var(--aquarium-colors-info-90)',
|
89
|
-
'success-inactive': 'var(--aquarium-colors-success-10)',
|
90
|
-
'success-muted': 'var(--aquarium-colors-success-30)',
|
91
|
-
'success-default': 'var(--aquarium-colors-success-70)',
|
92
|
-
'success-intense': 'var(--aquarium-colors-success-90)',
|
93
|
-
'warning-inactive': 'var(--aquarium-colors-warning-20)',
|
94
|
-
'warning-muted': 'var(--aquarium-colors-warning-40)',
|
95
|
-
'warning-default': 'var(--aquarium-colors-warning-80)',
|
96
|
-
'warning-intense': 'var(--aquarium-colors-warning-100)',
|
97
|
-
'danger-inactive': 'var(--aquarium-colors-error-10)',
|
98
|
-
'danger-muted': 'var(--aquarium-colors-error-20)',
|
99
|
-
'danger-default': 'var(--aquarium-colors-error-50)',
|
100
|
-
'danger-intense': 'var(--aquarium-colors-error-80)',
|
101
|
-
},
|
102
|
-
ringWidth: {
|
103
|
-
DEFAULT: '2px',
|
104
|
-
1: '1px',
|
105
|
-
2: '2px',
|
106
|
-
},
|
107
|
-
},
|
108
|
-
borderRadius: {
|
109
|
-
...defaultTheme.borderRadius,
|
110
|
-
DEFAULT: '4px',
|
111
|
-
},
|
112
|
-
colors: {
|
113
|
-
...theme.colors,
|
114
|
-
transparent: 'transparent',
|
115
|
-
current: 'currentColor',
|
116
|
-
white: 'white',
|
117
|
-
black: 'black',
|
118
|
-
},
|
119
|
-
spacing,
|
120
|
-
margin: {
|
121
|
-
...spacing,
|
122
|
-
auto: 'auto',
|
123
|
-
..._.reduce(spacing, (acc, value, key) => ({ ...acc, [`-${key}`]: `-${value}` })),
|
124
|
-
},
|
125
|
-
boxShadow: {
|
126
|
-
...theme.elevations,
|
127
|
-
whiteInset: 'inset 0 0 0 3px rgba(255,255,255,1)',
|
128
|
-
},
|
129
|
-
screens: {
|
130
|
-
// "default" here means the width from 0px to "xs"
|
131
|
-
default: '0px',
|
132
|
-
xs: '320px',
|
133
|
-
sm: '672px',
|
134
|
-
md: '1056px',
|
135
|
-
lg: '1312px',
|
136
|
-
xl: '1536px',
|
137
|
-
},
|
138
|
-
animation: {
|
139
|
-
...defaultTheme.animation,
|
140
|
-
'positioner-fade-in': 'positioner-fade-in 300ms ease-in-out',
|
141
|
-
},
|
142
|
-
keyframes: {
|
143
|
-
...defaultTheme.keyframes,
|
144
|
-
'positioner-fade-in': {
|
145
|
-
from: { opacity: '0' },
|
146
|
-
to: { opacity: '1' },
|
147
|
-
},
|
148
|
-
},
|
149
|
-
};
|
150
3
|
|
151
|
-
const
|
4
|
+
const backgroundColor = require('./tailwind/tailwind.backgroundColor');
|
5
|
+
const borderColor = require('./tailwind/tailwind.borderColor');
|
6
|
+
const borderRadius = require('./tailwind/tailwind.borderRadius');
|
7
|
+
const borderWidth = require('./tailwind/tailwind.borderWidth');
|
8
|
+
const boxShadow = require('./tailwind/tailwind.boxShadow');
|
9
|
+
const colors = require('./tailwind/tailwind.colors');
|
10
|
+
const elevations = require('./tailwind/tailwind.elevations');
|
11
|
+
const margin = require('./tailwind/tailwind.margin');
|
12
|
+
const screens = require('./tailwind/tailwind.screens');
|
13
|
+
const spacing = require('./tailwind/tailwind.spacing');
|
14
|
+
const textColor = require('./tailwind/tailwind.textColor');
|
15
|
+
const typography = require('./tailwind/tailwind.typography');
|
16
|
+
|
17
|
+
// Convert the typography object into a format that tailwind can understand
|
18
|
+
const typographyComponents = Object.fromEntries(Object.entries(typography).map(([key, font]) => [`.${key}`, { font }]));
|
19
|
+
|
20
|
+
// Utility function used to collect all the keys from an object that can be used in the safelist.
|
21
|
+
const collectKeys = (obj, prefix = '') =>
|
22
|
+
Object.entries(obj).reduce((acc, [key, value]) => {
|
23
|
+
if (typeof value === 'object') {
|
24
|
+
return acc.concat(collectKeys(value, `${prefix}${key}-`));
|
25
|
+
}
|
26
|
+
|
27
|
+
return acc.concat(`${prefix}${key}`);
|
28
|
+
}, []);
|
29
|
+
|
30
|
+
// Generate negative margin values
|
31
|
+
const negativeMargin = Object.entries(margin).reduce((acc, [key, value]) => {
|
32
|
+
if (!['auto', '0'].includes(key)) {
|
33
|
+
acc[`-${key}`] = `-${value}`;
|
34
|
+
}
|
35
|
+
|
36
|
+
return acc;
|
37
|
+
}, {});
|
152
38
|
|
153
39
|
/** @type {import('tailwindcss').Config} */
|
154
40
|
module.exports = {
|
155
|
-
|
156
|
-
|
41
|
+
theme: {
|
42
|
+
boxShadow,
|
43
|
+
colors,
|
44
|
+
elevations,
|
45
|
+
margin: {
|
46
|
+
auto: 'auto',
|
47
|
+
...margin,
|
48
|
+
...negativeMargin,
|
49
|
+
},
|
50
|
+
screens,
|
51
|
+
spacing,
|
52
|
+
borderWidth,
|
53
|
+
extend: {
|
54
|
+
backgroundColor,
|
55
|
+
borderColor,
|
56
|
+
borderRadius,
|
57
|
+
textColor,
|
58
|
+
zIndex: {
|
59
|
+
modal: '100',
|
60
|
+
},
|
61
|
+
animation: {
|
62
|
+
'positioner-fade-in': 'positioner-fade-in 300ms ease-in-out',
|
63
|
+
},
|
64
|
+
keyframes: {
|
65
|
+
'positioner-fade-in': {
|
66
|
+
from: { opacity: '0' },
|
67
|
+
to: { opacity: '1' },
|
68
|
+
},
|
69
|
+
},
|
70
|
+
},
|
71
|
+
},
|
157
72
|
// https://tailwindcss.com/docs/configuring-variants#ordering-variants
|
158
73
|
variants: {
|
159
74
|
backgroundColor: ['odd', 'even', 'hover', 'group-hover', 'active', 'disabled', 'focus'],
|
@@ -169,9 +84,13 @@ module.exports = {
|
|
169
84
|
},
|
170
85
|
content: ['./src/**/*.tsx', './src/**/*.ts'],
|
171
86
|
safelist: [
|
172
|
-
...
|
173
|
-
...
|
174
|
-
...
|
87
|
+
...Object.keys(typographyComponents),
|
88
|
+
...collectKeys(colors, 'text-'),
|
89
|
+
...collectKeys(colors, 'bg-'),
|
90
|
+
...collectKeys(colors, 'border-'),
|
91
|
+
...collectKeys(textColor, 'text-'),
|
92
|
+
...collectKeys(backgroundColor, 'bg-'),
|
93
|
+
...collectKeys(borderColor, 'border-'),
|
175
94
|
'line-clamp-1',
|
176
95
|
'line-clamp-2',
|
177
96
|
'line-clamp-3',
|
@@ -192,14 +111,7 @@ module.exports = {
|
|
192
111
|
}),
|
193
112
|
|
194
113
|
plugin(({ addComponents, variants }) => {
|
195
|
-
|
196
|
-
(acc, { className, style }) => ({
|
197
|
-
...acc,
|
198
|
-
[`.${className}`]: style,
|
199
|
-
}),
|
200
|
-
{},
|
201
|
-
);
|
202
|
-
return addComponents(typography, variants('aivenTypographyComponent'));
|
114
|
+
return addComponents(typographyComponents, variants('aivenTypographyComponent'));
|
203
115
|
}),
|
204
116
|
|
205
117
|
plugin(({ addVariant, e }) => {
|