@digigov/css 2.0.13 → 2.0.14-platform-201.01-04-26-11-49

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 (50) hide show
  1. package/README.md +73 -4
  2. package/dist/digigov-base.css +1 -0
  3. package/dist/digigov-plain.css +1 -0
  4. package/dist/digigov.css +1 -9
  5. package/package.json +14 -47
  6. package/src/base/index.css +0 -2
  7. package/src/components/accordion.common.css +0 -1
  8. package/src/components/blockquote.common.css +0 -1
  9. package/src/components/button.common.css +0 -1
  10. package/src/components/card.common.css +0 -1
  11. package/src/components/checkboxes.common.css +0 -1
  12. package/src/components/chip.common.css +0 -1
  13. package/src/components/components.css +0 -1
  14. package/src/components/details.common.css +0 -1
  15. package/src/components/dropdown.common.css +0 -1
  16. package/src/components/form.common.css +0 -1
  17. package/src/components/header.common.css +0 -1
  18. package/src/components/layout.common.css +0 -1
  19. package/src/components/loader.common.css +0 -1
  20. package/src/components/modal.common.css +0 -1
  21. package/src/components/nav.common.css +0 -1
  22. package/src/components/notification-banner.common.css +0 -1
  23. package/src/components/panel.common.css +0 -1
  24. package/src/components/phase-banner.common.css +0 -1
  25. package/src/components/radios.common.css +0 -1
  26. package/src/components/skeleton.common.css +0 -1
  27. package/src/components/stack.common.css +0 -1
  28. package/src/components/summary-list.common.css +0 -1
  29. package/src/components/svg-icons.common.css +0 -1
  30. package/src/components/typography.common.css +0 -1
  31. package/src/components/warning-text.common.css +0 -1
  32. package/src/index.css +6 -3
  33. package/tailwind.config.js +1 -1
  34. package/dist/base/index.css +0 -7
  35. package/dist/base.js +0 -1
  36. package/dist/components.js +0 -1
  37. package/dist/utilities/index.css +0 -1
  38. package/dist/utilities.js +0 -1
  39. package/index.js +0 -127
  40. package/postcss.config.js +0 -20
  41. package/src/base/postcss.config.js +0 -33
  42. package/src/base/tailwind.config.js +0 -14
  43. package/src/components/postcss.config.js +0 -20
  44. package/src/components/tailwind.config.js +0 -16
  45. package/src/pages/_app.js +0 -5
  46. package/src/pages/headings/service-heading.js +0 -20
  47. package/src/pages/index.js +0 -417
  48. package/src/utilities/postcss.config.js +0 -20
  49. package/src/utilities/tailwind.config.js +0 -10
  50. package/theming.js +0 -121
package/index.js DELETED
@@ -1,127 +0,0 @@
1
- const path = require('path');
2
-
3
- var digigovCssInfo = require(path.join(__dirname, './package.json'));
4
- const digigovTailwindConfig = require(
5
- path.join(__dirname, './tailwind.config.js')
6
- );
7
-
8
- const getThemeBaseStyle = require(path.join(__dirname, './theming.js'));
9
-
10
- const base = require(path.join(__dirname, './dist/base'));
11
- const utilities = require(path.join(__dirname, './dist/utilities'));
12
- const components = require(path.join(__dirname, './dist/components'));
13
-
14
- /**
15
- * Load Digigov CSS styles and add them to the base tailwindcss styles.
16
- *
17
- * Optionally, you can provide additional options for loading a custom theme.
18
- *
19
- * @param {object} [options={}]
20
- * @param {string} [options.customTheme] - Custom theme package name or file path.
21
- * @param {boolean} [options.eject] - Whether to ignore the default Digigov CSS base styles.
22
- */
23
- function mainFunction(options = {}) {
24
- return function ({ addBase, addComponents, addUtilities, config }) {
25
- let digigovCssIncludedItems = [];
26
- let logs = false;
27
- if (config('digigovCss.logs') != false) {
28
- logs = true;
29
- }
30
- if (logs) {
31
- console.log();
32
- console.log(
33
- '\x1b[35m%s\x1b[0m',
34
- '🌼 Digigov CSS components ' + digigovCssInfo.version,
35
- '\x1b[0m',
36
- digigovCssInfo.homepage
37
- );
38
- console.group();
39
- }
40
-
41
- // inject @base style
42
- if (config('digigovCss.base') != false) {
43
- const themeBaseStyle = getThemeBaseStyle({
44
- eject: options.eject,
45
- theme: options.customTheme,
46
- debug: logs,
47
- });
48
- addBase({ ...base, ...themeBaseStyle });
49
- digigovCssIncludedItems.push('base');
50
- }
51
-
52
- // inject components
53
- let classNames = [];
54
- let mediaQueries = [];
55
- // split compiled components in two different sectors
56
- // to load them in the correct order, since media queries
57
- // should be always after the main CSS rules
58
- Object.keys(components).forEach((selector) => {
59
- // checking if selectors are media queries
60
- if (selector.startsWith('@media')) {
61
- mediaQueries.push({ [selector]: components[selector] });
62
- // ... or just regular css rules
63
- } else {
64
- classNames.push({ [selector]: components[selector] });
65
- }
66
- });
67
- if (config('digigovCss.components') != false) {
68
- // this order is important for loading CSS rules and media queries
69
- // consistently, since the keys in js objects are not ordered and
70
- // sometimes order can be different. By spreading them in sequence
71
- // we fix this bug
72
- addComponents([...classNames, ...mediaQueries]);
73
- digigovCssIncludedItems.push('components');
74
- }
75
-
76
- // inject @utilities style needed by components
77
- if (config('digigovCss.utils') != false) {
78
- addUtilities(utilities);
79
- digigovCssIncludedItems.push('utilities');
80
- }
81
- if (logs) {
82
- console.log(
83
- '\x1b[32m%s\x1b[0m',
84
- '🛠️ Including functions:',
85
- '\x1b[0m',
86
- '' + digigovCssIncludedItems.join(', ')
87
- );
88
- if (isTailwindInstalled === false) {
89
- console.log(`\n\x1b[33;1m! warning\x1b[0m - unable to require \x1b[36mtailwindcss/plugin\x1b[0m
90
- Digigov CSS color are now only available for Digigov CSS components.
91
- If you want to use DigigovCSS color as utility classes (like 'bg-primary')
92
- you need to add this to your \x1b[36mtailwind.config.js\x1b[0m file:
93
- ───────────────────────────────────────
94
- \x1b[36mmodule.exports = {
95
- \x1b[32mtheme: {
96
- extend: {
97
- colors: require('@digigov/css/colors'),
98
- },
99
- },\x1b[0m
100
- \x1b[36m}\x1b[0m
101
- ───────────────────────────────────────
102
- `);
103
- }
104
- console.log();
105
- console.groupEnd();
106
- }
107
- };
108
- }
109
-
110
- // check if tailwindcss package exists
111
- let isTailwindInstalled = false;
112
- try {
113
- require.resolve('tailwindcss/plugin');
114
- isTailwindInstalled = true;
115
- } catch (er) {
116
- isTailwindInstalled = false;
117
- }
118
- if (isTailwindInstalled !== false) {
119
- module.exports = require('tailwindcss/plugin').withOptions(
120
- mainFunction,
121
- function (options) {
122
- return { ...digigovTailwindConfig, ...options };
123
- }
124
- );
125
- } else {
126
- module.exports = mainFunction;
127
- }
package/postcss.config.js DELETED
@@ -1,20 +0,0 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: {
4
- 'postcss-import': {},
5
- 'tailwindcss/nesting': {},
6
- tailwindcss: {},
7
- autoprefixer: {},
8
- 'postcss-sort-media-queries': {},
9
- cssnano: {
10
- preset: [
11
- 'default',
12
- {
13
- mergeRules: false,
14
- },
15
- ],
16
- },
17
- },
18
- };
19
-
20
- module.exports = config;
@@ -1,33 +0,0 @@
1
- const changeLog = require('../../CHANGELOG.json');
2
- const entries = changeLog.entries.sort(
3
- (a, b) => new Date(b.date) - new Date(a.date)
4
- );
5
- const version = entries[0].version;
6
- const date = entries[0].date;
7
- const cssDate = new Date(date).toLocaleDateString('si-LK'); //yyyy-MM-dd
8
-
9
- /** @type {import('postcss-load-config').Config} */
10
- const config = {
11
- plugins: [
12
- require('postcss-import'),
13
- require('tailwindcss/nesting'),
14
- require('tailwindcss')('./src/base/tailwind.config.js'),
15
- require('autoprefixer'),
16
- require('postcss-sort-media-queries'),
17
- require('cssnano')({
18
- preset: [
19
- 'default',
20
- {
21
- mergeRules: false,
22
- },
23
- ],
24
- }),
25
- require('@digigov/postcss-banner')({
26
- banner: `@digigov/css: ${version}\n\nAuthor: grnet-devs\nDate: ${cssDate}`,
27
- inline: false,
28
- important: true,
29
- }),
30
- ],
31
- };
32
-
33
- module.exports = config;
@@ -1,14 +0,0 @@
1
- const tailwindConfig = require('../../tailwind.config');
2
-
3
- /** @type {import('tailwindcss').Config} */
4
- module.exports = {
5
- ...tailwindConfig,
6
- content: {
7
- files: [
8
- './*.css',
9
- '../../dist/components/*.css',
10
- '../../dist/utilities/*.css',
11
- ],
12
- relative: true,
13
- },
14
- };
@@ -1,20 +0,0 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: [
4
- require('postcss-import'),
5
- require('tailwindcss/nesting'),
6
- require('tailwindcss')('./src/components/tailwind.config.js'),
7
- require('autoprefixer'),
8
- require('postcss-sort-media-queries'),
9
- require('cssnano')({
10
- preset: [
11
- 'default',
12
- {
13
- mergeRules: false,
14
- },
15
- ],
16
- }),
17
- ],
18
- };
19
-
20
- module.exports = config;
@@ -1,16 +0,0 @@
1
- const plugin = require("tailwindcss/plugin");
2
- const tailwindConfig = require("../../tailwind.config");
3
-
4
- /** @type {import('tailwindcss').Config} */
5
- module.exports = {
6
- ...tailwindConfig,
7
- content: {
8
- files: ["./*.css"],
9
- relative: true,
10
- },
11
- plugins: [
12
- plugin(function ({ addUtilities }) {
13
- addUtilities(require("../../dist/utilities"));
14
- }),
15
- ],
16
- };
package/src/pages/_app.js DELETED
@@ -1,5 +0,0 @@
1
- import '../index.css'
2
- // import "tailwindcss/dist/tailwind.css"
3
- // import '../../dist/digigov.css'
4
- import App from 'next/app'
5
- export default App
@@ -1,20 +0,0 @@
1
- import Head from 'next/head';
2
- import Image from 'next/image';
3
-
4
-
5
-
6
- export default function Home() {
7
- return (
8
- <div>
9
- <span className="ds-caption-xl"> Caption for h1 </span>
10
- <h1 className="ds-heading-xl">Heading 1 - Κεντρικός τίτλος</h1>
11
- <span className="ds-caption-lg"> Caption for h2 </span>
12
- <h2 className="ds-heading-lg">Heading 2</h2>
13
- <span className="ds-caption-md"> Caption for h3 </span>
14
- <h3 className="ds-heading-md">Heading 3</h3>
15
- <h4 className="ds-heading-sm">Heading 4</h4>
16
- <h5 className="ds-heading-sm">Heading 5</h5>
17
- <h6 className="ds-heading-sm">Heading 6</h6>
18
- </div>
19
- );
20
- }