@beeq/tailwindcss 1.8.0 → 1.8.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 (49) hide show
  1. package/index.cjs.d.ts +2 -0
  2. package/index.cjs.default.js +1 -0
  3. package/index.cjs.js +1443 -0
  4. package/index.cjs.mjs +2 -0
  5. package/index.esm.d.ts +2 -0
  6. package/index.esm.js +1429 -0
  7. package/package.json +11 -2
  8. package/src/helpers/blend-color.d.ts +10 -0
  9. package/src/index.d.ts +402 -0
  10. package/src/plugins/color-mix.d.ts +2 -0
  11. package/src/plugins/logical-properties.d.ts +2 -0
  12. package/src/theme/colors/base.d.ts +200 -0
  13. package/src/theme/colors/declarative.d.ts +78 -0
  14. package/src/theme/colors/primitive.d.ts +212 -0
  15. package/src/theme/default/dark.d.ts +54 -0
  16. package/src/theme/default/light.d.ts +54 -0
  17. package/src/theme/default/root.d.ts +92 -0
  18. package/src/theme/endava/dark.d.ts +55 -0
  19. package/src/theme/endava/light.d.ts +55 -0
  20. package/src/theme/endava/root.d.ts +48 -0
  21. package/src/theme/reset.d.ts +2 -0
  22. package/src/theme/typography/default.d.ts +2 -0
  23. package/.babelrc +0 -10
  24. package/eslint.config.js +0 -72
  25. package/project.json +0 -37
  26. package/src/helpers/blend-color.ts +0 -18
  27. package/src/index.ts +0 -211
  28. package/src/plugins/color-mix.ts +0 -64
  29. package/src/plugins/logical-properties.ts +0 -84
  30. package/src/theme/colors/base.ts +0 -230
  31. package/src/theme/colors/declarative.ts +0 -87
  32. package/src/theme/colors/primitive.ts +0 -216
  33. package/src/theme/default/dark.ts +0 -105
  34. package/src/theme/default/light.ts +0 -104
  35. package/src/theme/default/root.ts +0 -106
  36. package/src/theme/endava/dark.ts +0 -106
  37. package/src/theme/endava/light.ts +0 -106
  38. package/src/theme/endava/root.ts +0 -58
  39. package/src/theme/reset.ts +0 -68
  40. package/src/theme/typography/default.ts +0 -74
  41. package/tsconfig.json +0 -22
  42. package/tsconfig.lib.json +0 -10
  43. /package/src/helpers/{index.ts → index.d.ts} +0 -0
  44. /package/src/plugins/{index.ts → index.d.ts} +0 -0
  45. /package/src/theme/colors/{index.ts → index.d.ts} +0 -0
  46. /package/src/theme/default/{index.ts → index.d.ts} +0 -0
  47. /package/src/theme/endava/{index.ts → index.d.ts} +0 -0
  48. /package/src/theme/{index.ts → index.d.ts} +0 -0
  49. /package/src/theme/typography/{index.ts → index.d.ts} +0 -0
package/eslint.config.js DELETED
@@ -1,72 +0,0 @@
1
- const nxESLint = require('@nx/eslint-plugin');
2
- const importXPlugin = require('eslint-plugin-import-x');
3
- const prettierRecommended = require('eslint-plugin-prettier/recommended');
4
- const jsoncParser = require('jsonc-eslint-parser');
5
- const tsESLint = require('typescript-eslint');
6
-
7
- /** @type { import("eslint").Linter.Config[] } */
8
- module.exports = [
9
- ...tsESLint.configs.recommended,
10
- prettierRecommended,
11
- importXPlugin.flatConfigs.recommended,
12
- importXPlugin.flatConfigs.typescript,
13
- {
14
- files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
15
- },
16
- {
17
- languageOptions: {
18
- sourceType: 'module',
19
- },
20
- },
21
- {
22
- rules: {
23
- '@typescript-eslint/no-inferrable-types': 'off',
24
- 'import-x/consistent-type-specifier-style': 'error',
25
- 'import-x/no-named-as-default': 'off',
26
- 'import-x/no-named-as-default-member': 'off',
27
- 'import-x/namespace': [
28
- // @see https://github.com/import-js/eslint-plugin-import/blob/v2.27.5/docs/rules/namespace.md
29
- 'error',
30
- {
31
- allowComputed: true,
32
- },
33
- ],
34
- 'import-x/order': [
35
- 'error',
36
- {
37
- groups: ['builtin', 'external', ['parent', 'sibling'], 'index'],
38
- 'newlines-between': 'always',
39
- alphabetize: {
40
- order: 'asc',
41
- caseInsensitive: true,
42
- },
43
- },
44
- ],
45
- 'sort-imports': [
46
- 'error',
47
- {
48
- ignoreCase: true,
49
- ignoreDeclarationSort: true,
50
- },
51
- ],
52
- },
53
- },
54
- {
55
- files: ['**/package.json', '**/project.json'],
56
- languageOptions: {
57
- parser: jsoncParser,
58
- },
59
- plugins: {
60
- '@nx': nxESLint,
61
- },
62
- rules: {
63
- '@nx/dependency-checks': 'error',
64
- },
65
- },
66
- {
67
- files: ['**/*.js'],
68
- rules: {
69
- '@typescript-eslint/no-require-imports': 'off',
70
- },
71
- },
72
- ];
package/project.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "name": "beeq-tailwindcss",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/beeq-tailwindcss/src",
5
- "projectType": "library",
6
- "tags": ["publishable", "preset", "tailwindcss"],
7
- "targets": {
8
- "build": {
9
- "executor": "@nx/rollup:rollup",
10
- "outputs": ["{options.outputPath}"],
11
- "options": {
12
- "format": ["esm", "cjs"],
13
- "deleteOutputPath": true,
14
- "generateExportsField": true,
15
- "outputPath": "dist/beeq-tailwindcss",
16
- "main": "packages/beeq-tailwindcss/src/index.ts",
17
- "tsConfig": "packages/beeq-tailwindcss/tsconfig.lib.json",
18
- "project": "packages/beeq-tailwindcss/package.json",
19
- "external": ["tailwindcss", "tailwindcss-theme-swapper"],
20
- "assets": [
21
- {
22
- "glob": "packages/beeq-tailwindcss/README.md",
23
- "input": ".",
24
- "output": "."
25
- }
26
- ]
27
- }
28
- },
29
- "lint": {
30
- "executor": "@nx/eslint:lint",
31
- "dependsOn": ["build"],
32
- "options": {
33
- "lintFilePatterns": ["{projectRoot}/**/*.ts", "{projectRoot}/package.json", "{projectRoot}/project.json"]
34
- }
35
- }
36
- }
37
- }
@@ -1,18 +0,0 @@
1
- type blendOptions = {
2
- color: string;
3
- base: string;
4
- percentage?: number;
5
- property?: string;
6
- };
7
- /**
8
- * Blend color with base color and percentage
9
- *
10
- * @param {Object} opt - The blendColor options object
11
- * @param {string} opt.color - The color to blend
12
- * @param {string} opt.base - The base color layer to blend with
13
- * @param {number} opt.percentage - The percentage to blend
14
- * @param {string} [opt.property ='background-color'] - The CSS property to blend (e.g: 'background-color', 'color')
15
- */
16
- export const blendColor = ({ color, base, percentage = 20, property = 'background-color' }: blendOptions) => ({
17
- [property]: `color-mix(in srgb, ${color}, ${base} ${percentage}%)`,
18
- });
package/src/index.ts DELETED
@@ -1,211 +0,0 @@
1
- import type { Config } from 'tailwindcss';
2
- import plugin from 'tailwindcss/plugin';
3
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
- // @ts-ignore
5
- import ThemeSwapper from 'tailwindcss-theme-swapper';
6
-
7
- import { ColorMix, LogicalProperties } from './plugins';
8
- import {
9
- CSS_COLORS,
10
- DECLARATIVE_COLORS,
11
- DefaultDarkTheme,
12
- DefaultLightTheme,
13
- DefaultRootTheme,
14
- EndavaDarkTheme,
15
- EndavaLightTheme,
16
- EndavaRootTheme,
17
- PRIMITIVE_COLORS,
18
- reset,
19
- TYPOGRAPHY_DEFAULT,
20
- } from './theme';
21
-
22
- const inherit: string = 'inherit';
23
-
24
- export default {
25
- theme: {
26
- colors: {
27
- inherit,
28
- current: 'currentColor',
29
- transparent: 'transparent',
30
- /* ------------------- Extended palette color (Primitive) ------------------- */
31
- ...PRIMITIVE_COLORS,
32
- /* ------------------- Specific Theme Colors (Declarative) ------------------ */
33
- focus: DECLARATIVE_COLORS.focus,
34
- data: { ...DECLARATIVE_COLORS.data },
35
- icon: { ...DECLARATIVE_COLORS.icon },
36
- ui: { ...DECLARATIVE_COLORS.ui },
37
- },
38
- borderRadius: {
39
- none: 'var(--bq-radius--none)',
40
- xs2: 'var(--bq-radius--xs2)',
41
- xs: 'var(--bq-radius--xs)',
42
- s: 'var(--bq-radius--s)',
43
- m: 'var(--bq-radius--m)',
44
- l: 'var(--bq-radius--l)',
45
- full: 'var(--bq-radius--full)',
46
- },
47
- borderWidth: {
48
- 0: '0',
49
- s: 'var(--bq-stroke-s)',
50
- m: 'var(--bq-stroke-m)',
51
- l: 'var(--bq-stroke-l)',
52
- },
53
- boxShadow: {
54
- xs: 'var(--bq-box-shadow--xs)',
55
- s: 'var(--bq-box-shadow--s)',
56
- m: 'var(--bq-box-shadow--m)',
57
- l: 'var(--bq-box-shadow--l)',
58
- },
59
- fontFamily: {
60
- inherit,
61
- default: 'var(--bq-font-family)',
62
- outfit: 'var(--bq-font-family--outfit)',
63
- poppins: 'var(--bq-font-family--poppins)',
64
- },
65
- fontSize: {
66
- xs: 'var(--bq-font-size--xs)',
67
- s: 'var(--bq-font-size--s)',
68
- m: 'var(--bq-font-size--m)',
69
- l: 'var(--bq-font-size--l)',
70
- xl: 'var(--bq-font-size--xl)',
71
- xxl: 'var(--bq-font-size--xxl)',
72
- xxl2: 'var(--bq-font-size--xxl2)',
73
- xxl3: 'var(--bq-font-size--xxl3)',
74
- xxl4: 'var(--bq-font-size--xxl4)',
75
- xxl5: 'var(--bq-font-size--xxl5)',
76
- },
77
- fontWeight: {
78
- thin: 'var(--bq-font-weight--thin)',
79
- light: 'var(--bq-font-weight--light)',
80
- regular: 'var(--bq-font-weight--regular)',
81
- medium: 'var(--bq-font-weight--medium)',
82
- semibold: 'var(--bq-font-weight--semibold)',
83
- bold: 'var(--bq-font-weight--bold)',
84
- },
85
- lineHeight: {
86
- inherit,
87
- small: 'var(--bq-font-line-height--small)',
88
- regular: 'var(--bq-font-line-height--regular)',
89
- large: 'var(--bq-font-line-height--large)',
90
- },
91
- strokeWidth: {
92
- inherit,
93
- none: '0',
94
- s: 'var(--bq-stroke-s)',
95
- m: 'var(--bq-stroke-m)',
96
- l: 'var(--bq-stroke-l)',
97
- },
98
- extend: {
99
- /* ------------------ Extend colors with declarative colors ----------------- */
100
- backgroundColor: { ...DECLARATIVE_COLORS.bg },
101
- borderColor: { ...DECLARATIVE_COLORS.stroke },
102
- stroke: { ...DECLARATIVE_COLORS.stroke },
103
- textColor: { ...DECLARATIVE_COLORS.text },
104
- fill: { ...DECLARATIVE_COLORS.icon },
105
- /* --------------------------- End: Extend colors --------------------------- */
106
- content: {
107
- empty: "''",
108
- },
109
- cursor: {
110
- inherit,
111
- },
112
- height: {
113
- inherit,
114
- // Details: https://web.dev/viewport-units/#the-need-for-new-viewport-units
115
- 'dynamic-vh': '100dvh',
116
- },
117
- spacing: {
118
- xs3: 'var(--bq-spacing-xs3)',
119
- xs2: 'var(--bq-spacing-xs2)',
120
- xs: 'var(--bq-spacing-xs)',
121
- s: 'var(--bq-spacing-s)',
122
- m: 'var(--bq-spacing-m)',
123
- l: 'var(--bq-spacing-l)',
124
- xl: 'var(--bq-spacing-xl)',
125
- xxl: 'var(--bq-spacing-xxl)',
126
- xxl2: 'var(--bq-spacing-xxl2)',
127
- xxl3: 'var(--bq-spacing-xxl3)',
128
- xxl4: 'var(--bq-spacing-xxl4)',
129
- },
130
- },
131
- },
132
- plugins: [
133
- plugin(function ({ addBase, addComponents, theme }) {
134
- addBase({
135
- // CSS variables
136
- ':root, ::backdrop': { ...CSS_COLORS },
137
- // CSS reset
138
- ...reset,
139
- });
140
- addComponents({
141
- /**
142
- * Common `FOCUS` state that should be used within `focus-visible` Tailwind CSS utility
143
- * Examples of usage:
144
- *
145
- * class="focus-visible:focus"
146
- *
147
- * @apply focus-visible:focus
148
- *
149
- * &:focus-visible {
150
- * @apply focus;
151
- * }
152
- */
153
- '.focus': {
154
- outline: `var(--bq-ring-width, 2px) solid var(--bq-ring-color-focus, ${String(theme('colors.focus'))})`,
155
- outlineOffset: 'var(--bq-ring-offset-width, 1px)',
156
- },
157
- });
158
- }),
159
- // Local Custom Plugins
160
- ColorMix,
161
- LogicalProperties,
162
- // Tailwind CSS Theme Swapper
163
- ThemeSwapper({
164
- themes: [
165
- {
166
- name: 'root',
167
- selectors: [':root'],
168
- theme: { ...DefaultRootTheme },
169
- },
170
- {
171
- name: 'light',
172
- selectors: [':root', '.light', '.beeq.light', '[bq-mode="light"]'],
173
- theme: { ...DefaultLightTheme },
174
- },
175
- {
176
- name: 'dark',
177
- selectors: ['.dark', '.beeq.dark', '[bq-mode="dark"]'],
178
- theme: { ...DefaultDarkTheme },
179
- },
180
- {
181
- name: 'endava',
182
- selectors: ['.endava', '[bq-theme="endava"]'],
183
- theme: { ...EndavaRootTheme },
184
- },
185
- {
186
- name: 'endava-light',
187
- selectors: ['.endava.light', '[bq-theme="endava"][bq-mode="light"]'],
188
- theme: { ...EndavaLightTheme },
189
- },
190
- {
191
- name: 'endava-dark',
192
- selectors: ['.endava.dark', '[bq-theme="endava"][bq-mode="dark"]'],
193
- theme: { ...EndavaDarkTheme },
194
- },
195
- ],
196
- }),
197
- ],
198
- } satisfies Partial<Config>;
199
-
200
- export {
201
- CSS_COLORS,
202
- DECLARATIVE_COLORS,
203
- DefaultDarkTheme,
204
- DefaultLightTheme,
205
- DefaultRootTheme,
206
- EndavaDarkTheme,
207
- EndavaLightTheme,
208
- EndavaRootTheme,
209
- PRIMITIVE_COLORS,
210
- TYPOGRAPHY_DEFAULT,
211
- };
@@ -1,64 +0,0 @@
1
- import type { Config } from 'tailwindcss';
2
- import plugin from 'tailwindcss/plugin';
3
-
4
- import { blendColor } from '../helpers';
5
-
6
- // NOTE: https://github.com/tailwindlabs/tailwindcss/discussions/6925#discussioncomment-1919382
7
- // eslint-disable-next-line @typescript-eslint/no-require-imports
8
- const { default: flattenColorPalette } = require('tailwindcss/lib/util/flattenColorPalette');
9
-
10
- export const ColorMix: Partial<Config> = plugin(function ({ matchUtilities, theme }) {
11
- matchUtilities(
12
- {
13
- // Background `hover` state blend color
14
- 'bg-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)' }),
15
- // Background `active` state blend color
16
- 'bg-active': (value) => blendColor({ color: value, base: 'var(--bq-active)' }),
17
- // Border `hover` state blend color
18
- 'border-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)', property: 'border-color' }),
19
- // Border `active` state blend color
20
- 'border-active': (value) => blendColor({ color: value, base: 'var(--bq-active)', property: 'border-color' }),
21
- // Text `hover` state blend color
22
- 'text-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)', property: 'color' }),
23
- // Text `active` state blend color
24
- 'text-active': (value) => blendColor({ color: value, base: 'var(--bq-active)', property: 'color' }),
25
- },
26
- { values: flattenColorPalette(theme('colors')) },
27
- );
28
- matchUtilities(
29
- {
30
- // Background `hover` state blend color
31
- 'bg-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)' }),
32
- // Background `active` state blend color
33
- 'bg-active': (value) => blendColor({ color: value, base: 'var(--bq-active)' }),
34
- },
35
- { values: flattenColorPalette(theme('backgroundColor')) },
36
- );
37
- matchUtilities(
38
- {
39
- // Border `hover` state blend color
40
- 'border-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)', property: 'border-color' }),
41
- // Border `active` state blend color
42
- 'border-active': (value) => blendColor({ color: value, base: 'var(--bq-active)', property: 'border-color' }),
43
- },
44
- { values: flattenColorPalette(theme('borderColor')) },
45
- );
46
- matchUtilities(
47
- {
48
- // Text `hover` state blend color
49
- 'text-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)', property: 'color' }),
50
- // Text `active` state blend color
51
- 'text-active': (value) => blendColor({ color: value, base: 'var(--bq-active)', property: 'color' }),
52
- },
53
- { values: flattenColorPalette(theme('textColor')) },
54
- );
55
- matchUtilities(
56
- {
57
- // Stroke `hover` state blend color
58
- 'stroke-hover': (value) => blendColor({ color: value, base: 'var(--bq-hover)', property: 'color' }),
59
- // Stroke `active` state blend color
60
- 'stroke-active': (value) => blendColor({ color: value, base: 'var(--bq-active)', property: 'color' }),
61
- },
62
- { values: flattenColorPalette(theme('stroke')) },
63
- );
64
- });
@@ -1,84 +0,0 @@
1
- import type { Config } from 'tailwindcss';
2
- import plugin from 'tailwindcss/plugin';
3
-
4
- // NOTE: https://github.com/tailwindlabs/tailwindcss/discussions/6925#discussioncomment-1919382
5
- // eslint-disable-next-line @typescript-eslint/no-require-imports
6
- const { default: flattenColorPalette } = require('tailwindcss/lib/util/flattenColorPalette');
7
-
8
- export const LogicalProperties: Partial<Config> = plugin(function ({ matchUtilities, theme }) {
9
- matchUtilities(
10
- {
11
- // Logical Border Width properties
12
- 'border-bl': (value) => ({ 'border-block-width': value }),
13
- 'border-bs': (value) => ({ 'border-block-start-width': value }),
14
- 'border-be': (value) => ({ 'border-block-end-width': value }),
15
- 'border-i': (value) => ({ 'border-inline-width': value }),
16
- 'border-is': (value) => ({ 'border-inline-start-width': value }),
17
- 'border-ie': (value) => ({ 'border-inline-end-width': value }),
18
- },
19
- { values: theme('borderWidth') },
20
- );
21
- matchUtilities(
22
- {
23
- // Logical Border Color properties
24
- 'border-bl': (value) => ({ 'border-block-color': value }),
25
- 'border-bs': (value) => ({ 'border-block-start-color': value }),
26
- 'border-be': (value) => ({ 'border-block-end-color': value }),
27
- 'border-i': (value) => ({ 'border-inline-color': value }),
28
- 'border-is': (value) => ({ 'border-inline-start-color': value }),
29
- 'border-ie': (value) => ({ 'border-inline-end-color': value }),
30
- },
31
- { values: flattenColorPalette(theme('colors')) },
32
- );
33
- matchUtilities(
34
- {
35
- // Logical Height and Width properties
36
- bs: (value) => ({ 'block-size': value }),
37
- 'max-bs': (value) => ({ 'max-block-size': value }),
38
- 'min-bs': (value) => ({ 'min-block-size': value }),
39
- is: (value) => ({ 'inline-size': value }),
40
- 'max-is': (value) => ({ 'max-inline-size': value }),
41
- 'min-is': (value) => ({ 'min-inline-size': value }),
42
- },
43
- { values: theme('width') },
44
- );
45
- matchUtilities(
46
- {
47
- // Logical Border properties
48
- 'border-bl': (value) => ({ 'border-block': value }),
49
- 'border-bs': (value) => ({ 'border-block-start': value }),
50
- 'border-be': (value) => ({ 'border-block-end': value }),
51
- 'border-i': (value) => ({ 'border-inline': value }),
52
- 'border-is': (value) => ({ 'border-inline-start': value }),
53
- 'border-ie': (value) => ({ 'border-inline-end': value }),
54
- // Logical Padding properties (only those not covered by Tailwind CSS)
55
- 'p-b': (value) => ({ 'padding-block': value }),
56
- 'p-bs': (value) => ({ 'padding-block-start': value }),
57
- 'p-be': (value) => ({ 'padding-block-end': value }),
58
- 'p-i': (value) => ({ 'padding-inline': value }),
59
- },
60
- {
61
- values: theme('spacing'),
62
- },
63
- );
64
- matchUtilities(
65
- {
66
- // Logical Top, Right, Bottom, and Left properties
67
- 'inset-b': (value) => ({ 'inset-block': value }),
68
- 'inset-bs': (value) => ({ 'inset-block-start': value }),
69
- 'inset-be': (value) => ({ 'inset-block-end': value }),
70
- 'inset-i': (value) => ({ 'inset-inline': value }),
71
- 'inset-is': (value) => ({ 'inset-inline-start': value }),
72
- 'inset-ie': (value) => ({ 'inset-inline-end': value }),
73
- // Logical Margin properties (only those not covered by Tailwind CSS)
74
- 'm-b': (value) => ({ 'margin-block': value }),
75
- 'm-bs': (value) => ({ 'margin-block-start': value }),
76
- 'm-be': (value) => ({ 'margin-block-end': value }),
77
- 'm-i': (value) => ({ 'margin-inline': value }),
78
- },
79
- {
80
- values: theme('spacing'),
81
- supportsNegativeValues: true,
82
- },
83
- );
84
- });