@digigov/css 2.0.0-60d81ed8 → 2.0.0-6452adf3

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 (53) hide show
  1. package/dist/base/index.css +1 -1
  2. package/dist/base.js +1 -1
  3. package/dist/components.js +1 -1
  4. package/dist/digigov.css +3 -3
  5. package/dist/utilities/index.css +1 -1
  6. package/dist/utilities.js +1 -1
  7. package/index.js +99 -69
  8. package/package.json +11 -11
  9. package/postcss.config.js +4 -4
  10. package/src/base/index.css +1 -0
  11. package/src/base/postcss.config.js +11 -10
  12. package/src/base/tailwind.config.js +4 -11
  13. package/src/components/button.common.css +1 -1
  14. package/src/components/button.css +1 -1
  15. package/src/components/button.native.css +2 -3
  16. package/src/components/copy-to-clipboard.css +1 -1
  17. package/src/components/drawer.css +23 -3
  18. package/src/components/filter.css +71 -22
  19. package/src/components/kitchensink.css +2 -2
  20. package/src/components/loader.common.css +7 -0
  21. package/src/components/loader.css +3 -1
  22. package/src/components/loader.native.css +5 -0
  23. package/src/components/modal.common.css +2 -2
  24. package/src/components/modal.css +9 -9
  25. package/src/components/modal.native.css +3 -3
  26. package/src/components/pagination.css +19 -3
  27. package/src/components/postcss.config.js +7 -6
  28. package/src/components/stack.common.css +67 -0
  29. package/src/components/stack.css +23 -21
  30. package/src/components/stack.native.css +68 -0
  31. package/src/components/typography.common.css +1 -4
  32. package/src/components/typography.css +5 -1
  33. package/src/index.native.css +2 -0
  34. package/src/utilities/postcss.config.js +7 -6
  35. package/tailwind.config.js +102 -106
  36. package/theming.js +121 -0
  37. package/defaultTheme/accordion.json +0 -16
  38. package/defaultTheme/back-to-top.json +0 -27
  39. package/defaultTheme/brandConfig.json +0 -147
  40. package/defaultTheme/breadcrumbs.json +0 -8
  41. package/defaultTheme/button.json +0 -94
  42. package/defaultTheme/card.json +0 -23
  43. package/defaultTheme/form.json +0 -132
  44. package/defaultTheme/globals.json +0 -81
  45. package/defaultTheme/index.js +0 -27
  46. package/defaultTheme/layout.json +0 -55
  47. package/defaultTheme/misc.json +0 -68
  48. package/defaultTheme/panel.json +0 -48
  49. package/defaultTheme/phase-banner.json +0 -8
  50. package/defaultTheme/radios.json +0 -8
  51. package/defaultTheme/summary-list.json +0 -8
  52. package/defaultTheme/typography.json +0 -295
  53. package/themes.plugin.js +0 -148
@@ -1,13 +1,13 @@
1
1
  @import './modal.common.css';
2
2
 
3
- .ds-modal {
3
+ .ds-modal-container {
4
4
  @apply absolute justify-center items-center top-0 left-0 right-0 bottom-0;
5
5
  background-color: rgba(var(--color-black-rgb), 0.5);
6
6
  }
7
- .ds-modal__body {
7
+ .ds-modal {
8
8
  @apply util-modal__body;
9
9
  }
10
- .ds-modal__container {
10
+ .ds-modal__body {
11
11
  @apply util-modal__container;
12
12
  }
13
13
  .ds-modal__content__text {
@@ -1,5 +1,6 @@
1
1
  .ds-pagination {
2
- @apply flex flex-wrap items-center justify-items-center justify-between mb-4 md:mb-8;
2
+ @apply flex flex-wrap items-center justify-items-center justify-between
3
+ gap-y-2 md:gap-y-4 gap-x-6 mb-4 md:mb-8;
3
4
  &.ds-pagination--sm {
4
5
  .ds-pagination__label,
5
6
  .ds-pagination__item--current {
@@ -17,7 +18,7 @@
17
18
  @apply text-base-content md:leading-normal;
18
19
  }
19
20
  .ds-pagination__list {
20
- @apply flex items-center;
21
+ @apply flex items-center flex-wrap;
21
22
  }
22
23
  .ds-pagination__item {
23
24
  @apply inline-block p-2 m-0;
@@ -32,6 +33,14 @@
32
33
  @apply font-bold;
33
34
  }
34
35
  }
36
+ @media (max-width: 639.9px) {
37
+ .ds-pagination__item {
38
+ @apply py-0;
39
+ &.ds-pagination__item--current {
40
+ @apply flex items-center justify-center min-h-12 min-w-12;
41
+ }
42
+ }
43
+ }
35
44
 
36
45
  /* overrides */
37
46
 
@@ -69,6 +78,13 @@
69
78
  }
70
79
  }
71
80
  .ds-link {
72
- @apply flex items-center no-underline;
81
+ @apply flex items-center justify-center no-underline;
82
+ }
83
+ }
84
+ @media (max-width: 639.9px) {
85
+ .ds-pagination__item {
86
+ .ds-link {
87
+ @apply min-h-12 min-w-12;
88
+ }
73
89
  }
74
90
  }
@@ -1,13 +1,14 @@
1
1
  /** @type {import('postcss-load-config').Config} */
2
2
  const config = {
3
3
  plugins: [
4
- require("postcss-import"),
5
- require("tailwindcss/nesting"),
6
- require("tailwindcss")("./src/components/tailwind.config.js"),
7
- require("autoprefixer"),
8
- require("cssnano")({
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')({
9
10
  preset: [
10
- "default",
11
+ 'default',
11
12
  {
12
13
  mergeRules: false,
13
14
  },
@@ -0,0 +1,67 @@
1
+ @tailwind utilities;
2
+
3
+ @layer utilities {
4
+ .util-stack {
5
+ @apply flex flex-col flex-wrap;
6
+ }
7
+ .util-stack--row {
8
+ @apply flex-row;
9
+ }
10
+ .util-stack--reverse-row {
11
+ @apply flex-row-reverse;
12
+ }
13
+ .util-stack--col-reverse {
14
+ @apply flex-col-reverse;
15
+ }
16
+ .util-stack--nowrap {
17
+ @apply flex-nowrap;
18
+ }
19
+ .util-stack--justify-flex-start {
20
+ @apply justify-start;
21
+ }
22
+ .util-stack--justify-flex-end {
23
+ @apply justify-end;
24
+ }
25
+ .util-stack--justify-center {
26
+ @apply justify-center;
27
+ }
28
+ .util-stack--justify-space-between {
29
+ @apply justify-between;
30
+ }
31
+ .util-stack--justify-space-around {
32
+ @apply justify-around;
33
+ }
34
+ .util-stack--justify-space-evenly {
35
+ @apply justify-evenly;
36
+ }
37
+ .util-stack--align-stretch {
38
+ @apply items-stretch;
39
+ }
40
+ .util-stack--align-flex-start {
41
+ @apply items-start;
42
+ }
43
+ .util-stack--align-flex-end {
44
+ @apply items-end;
45
+ }
46
+ .util-stack--align-center {
47
+ @apply items-center;
48
+ }
49
+ .util-stack--align-baseline {
50
+ @apply items-baseline;
51
+ }
52
+ .util-stack--content-flex-start {
53
+ @apply content-start;
54
+ }
55
+ .util-stack--content-flex-end {
56
+ @apply content-end;
57
+ }
58
+ .util-stack--content-center {
59
+ @apply content-center;
60
+ }
61
+ .util-stack--content-space-between {
62
+ @apply content-between;
63
+ }
64
+ .util-stack--content-space-around {
65
+ @apply content-around;
66
+ }
67
+ }
@@ -1,64 +1,66 @@
1
+ @import './stack.common.css';
2
+
1
3
  .ds-stack {
2
- @apply flex flex-col flex-wrap;
4
+ @apply util-stack;
3
5
  &.ds-stack--row {
4
- @apply flex-row;
6
+ @apply util-stack--row;
5
7
  }
6
8
  &.ds-stack--reverse-row {
7
- @apply flex-row-reverse;
9
+ @apply util-stack--reverse-row;
8
10
  }
9
11
  &.ds-stack--col-reverse {
10
- @apply flex-col-reverse;
12
+ @apply util-stack--col-reverse;
11
13
  }
12
14
  &.ds-stack--nowrap {
13
- @apply flex-nowrap;
15
+ @apply util-stack--nowrap;
14
16
  }
15
17
  &.ds-stack--justify-flex-start {
16
- @apply justify-start;
18
+ @apply util-stack--justify-flex-start;
17
19
  }
18
20
  &.ds-stack--justify-flex-end {
19
- @apply justify-end;
21
+ @apply util-stack--justify-flex-end;
20
22
  }
21
23
  &.ds-stack--justify-center {
22
- @apply justify-center;
24
+ @apply util-stack--justify-center;
23
25
  }
24
26
  &.ds-stack--justify-space-between {
25
- @apply justify-between;
27
+ @apply util-stack--justify-space-between;
26
28
  }
27
29
  &.ds-stack--justify-space-around {
28
- @apply justify-around;
30
+ @apply util-stack--justify-space-around;
29
31
  }
30
32
  &.ds-stack--justify-space-evenly {
31
- @apply justify-evenly;
33
+ @apply util-stack--justify-space-evenly;
32
34
  }
33
35
  &.ds-stack--align-stretch {
34
- @apply items-stretch;
36
+ @apply util-stack--align-stretch;
35
37
  }
36
38
  &.ds-stack--align-flex-start {
37
- @apply items-start;
39
+ @apply util-stack--align-flex-start;
38
40
  }
39
41
  &.ds-stack--align-flex-end {
40
- @apply items-end;
42
+ @apply util-stack--align-flex-end;
41
43
  }
42
44
  &.ds-stack--align-center {
43
- @apply items-center;
45
+ @apply util-stack--align-center;
44
46
  }
45
47
  &.ds-stack--align-baseline {
46
- @apply items-baseline;
48
+ @apply util-stack--align-baseline;
47
49
  }
48
50
  &.ds-stack--content-flex-start {
49
- @apply content-start;
51
+ @apply util-stack--content-flex-start;
50
52
  }
51
53
  &.ds-stack--content-flex-end {
52
- @apply content-end;
54
+ @apply util-stack--content-flex-end;
53
55
  }
54
56
  &.ds-stack--content-center {
55
- @apply content-center;
57
+ @apply util-stack--content-center;
56
58
  }
57
59
  &.ds-stack--content-space-between {
58
- @apply content-between;
60
+ @apply util-stack--content-space-between;
59
61
  }
60
62
  &.ds-stack--content-space-around {
61
- @apply content-around;
63
+ @apply util-stack--content-space-around;
62
64
  }
63
65
  &.ds-stack--content-space-evenly {
64
66
  @apply content-evenly;
@@ -0,0 +1,68 @@
1
+ @import './stack.common.css';
2
+
3
+ .ds-stack {
4
+ @apply util-stack;
5
+ }
6
+ .ds-stack--row {
7
+ @apply util-stack--row;
8
+ }
9
+ .ds-stack--reverse-row {
10
+ @apply util-stack--reverse-row;
11
+ }
12
+ .ds-stack--col-reverse {
13
+ @apply util-stack--col-reverse;
14
+ }
15
+ .ds-stack--nowrap {
16
+ @apply util-stack--nowrap;
17
+ }
18
+ .ds-stack--justify-flex-start {
19
+ @apply util-stack--justify-flex-start;
20
+ }
21
+ .ds-stack--justify-flex-end {
22
+ @apply util-stack--justify-flex-end;
23
+ }
24
+ .ds-stack--justify-center {
25
+ @apply util-stack--justify-center;
26
+ }
27
+ .ds-stack--justify-space-between {
28
+ @apply util-stack--justify-space-between;
29
+ }
30
+ .ds-stack--justify-space-around {
31
+ @apply util-stack--justify-space-around;
32
+ }
33
+ .ds-stack--justify-space-evenly {
34
+ @apply util-stack--justify-space-evenly;
35
+ }
36
+ .ds-stack--align-stretch {
37
+ @apply util-stack--align-stretch;
38
+ }
39
+ .ds-stack--align-flex-start {
40
+ @apply util-stack--align-flex-start;
41
+ }
42
+ .ds-stack--align-flex-end {
43
+ @apply util-stack--align-flex-end;
44
+ }
45
+ .ds-stack--align-center {
46
+ @apply util-stack--align-center;
47
+ }
48
+ .ds-stack--align-baseline {
49
+ @apply util-stack--align-baseline;
50
+ }
51
+ .ds-stack--content-flex-start {
52
+ @apply util-stack--content-flex-start;
53
+ }
54
+ .ds-stack--content-flex-end {
55
+ @apply util-stack--content-flex-end;
56
+ }
57
+ .ds-stack--content-center {
58
+ @apply util-stack--content-center;
59
+ }
60
+ .ds-stack--content-space-between {
61
+ @apply util-stack--content-space-between;
62
+ }
63
+ .ds-stack--content-space-around {
64
+ @apply util-stack--content-space-around;
65
+ }
66
+ .ds-stack--content-space-evenly {
67
+ justify-content: 'space-evenly';
68
+ }
@@ -51,7 +51,7 @@
51
51
  }
52
52
  .util-link {
53
53
  @apply focus:bg-focus;
54
- padding: var(--link-padding);
54
+ padding: var(--link-padding-y) var(--link-padding-x);
55
55
  }
56
56
  .util-link-text {
57
57
  /* @apply focus:text-link-active underline; */
@@ -59,9 +59,6 @@
59
59
  color: var(--link-color);
60
60
  font-size: var(--link-font-size);
61
61
  line-height: var(--link-line-height);
62
- /* &:focus {
63
- text-decoration: none !important;
64
- } */
65
62
  }
66
63
 
67
64
  .util-caption-xl {
@@ -129,6 +129,9 @@
129
129
  &:last-child {
130
130
  @apply mb-0;
131
131
  }
132
+ > button.ds-link:only-child {
133
+ display: inline-flex;
134
+ }
132
135
  }
133
136
  }
134
137
  .ds-list__item > .ds-list--bullet:nth-child(1) {
@@ -174,7 +177,7 @@
174
177
  }
175
178
 
176
179
  .ds-link {
177
- @apply focus:text-link-active util-link util-link-text cursor-pointer;
180
+ @apply focus:text-link-active util-link util-link-text cursor-pointer text-left;
178
181
  letter-spacing: var(--link-letter-spacing);
179
182
  &:hover {
180
183
  text-decoration-thickness: 2px;
@@ -278,6 +281,7 @@
278
281
  }
279
282
  }
280
283
  button.ds-link {
284
+ @apply text-left;
281
285
  .ds-svg-icon {
282
286
  @apply ml-1;
283
287
  }
@@ -19,3 +19,5 @@
19
19
  @import './components/checkboxes.native';
20
20
  @import './components/radios.native';
21
21
  @import './components/modal.native';
22
+ @import './components/loader.native';
23
+ @import './components/stack.native';
@@ -1,13 +1,14 @@
1
1
  /** @type {import('postcss-load-config').Config} */
2
2
  const config = {
3
3
  plugins: [
4
- require("postcss-import"),
5
- require("tailwindcss/nesting"),
6
- require("tailwindcss")("./src/utilities/tailwind.config.js"),
7
- require("autoprefixer"),
8
- require("cssnano")({
4
+ require('postcss-import'),
5
+ require('tailwindcss/nesting'),
6
+ require('tailwindcss')('./src/utilities/tailwind.config.js'),
7
+ require('autoprefixer'),
8
+ require('postcss-sort-media-queries'),
9
+ require('cssnano')({
9
10
  preset: [
10
- "default",
11
+ 'default',
11
12
  {
12
13
  mergeRules: false,
13
14
  },
@@ -1,72 +1,70 @@
1
- const plugin = require("tailwindcss/plugin");
2
- const defaultTheme = require("tailwindcss/defaultTheme");
3
- const themesPlugin = require("./themes.plugin");
1
+ const defaultTheme = require('tailwindcss/defaultTheme');
4
2
 
5
3
  const allColors = [
6
- "transparent",
7
- "current",
8
- "primary",
9
- "primary-100",
10
- "primary-200",
11
- "primary-300",
12
- "secondary",
13
- "secondary-100",
14
- "secondary-200",
15
- "secondary-300",
16
- "tertiary",
17
- "tertiary-100",
18
- "tertiary-200",
19
- "tertiary-300",
20
- "accent",
21
- "accent-focus",
22
- "accent-content",
23
- "base-100",
24
- "base-200",
25
- "base-300",
26
- "base-400",
27
- "base-500",
28
- "base-600",
29
- "base-700",
30
- "base-800",
31
- "base-900",
32
- "base-1000",
33
- "base-11000",
34
- "base-content",
35
- "base-content-secondary",
36
- "base-content-invert",
37
- "info",
38
- "info-hover",
39
- "success",
40
- "success-hover",
41
- "warning",
42
- "error",
43
- "error-hover",
44
- "error-text",
45
- "focus",
46
- "link",
47
- "link-hover",
48
- "link-visited",
49
- "link-active",
50
- "white",
51
- "gray-100",
52
- "gray-200",
53
- "gray-300",
54
- "gray-400",
55
- "gray-500",
56
- "gray-600",
57
- "gray-700",
58
- "gray-800",
59
- "gray-900",
60
- "gray-1000",
61
- "gray-1100",
62
- "gray-1200",
63
- "black",
64
- "shadow200",
65
- "shadow600",
4
+ 'transparent',
5
+ 'current',
6
+ 'primary',
7
+ 'primary-100',
8
+ 'primary-200',
9
+ 'primary-300',
10
+ 'secondary',
11
+ 'secondary-100',
12
+ 'secondary-200',
13
+ 'secondary-300',
14
+ 'tertiary',
15
+ 'tertiary-100',
16
+ 'tertiary-200',
17
+ 'tertiary-300',
18
+ 'accent',
19
+ 'accent-focus',
20
+ 'accent-content',
21
+ 'base-100',
22
+ 'base-200',
23
+ 'base-300',
24
+ 'base-400',
25
+ 'base-500',
26
+ 'base-600',
27
+ 'base-700',
28
+ 'base-800',
29
+ 'base-900',
30
+ 'base-1000',
31
+ 'base-11000',
32
+ 'base-content',
33
+ 'base-content-secondary',
34
+ 'base-content-invert',
35
+ 'info',
36
+ 'info-hover',
37
+ 'success',
38
+ 'success-hover',
39
+ 'warning',
40
+ 'error',
41
+ 'error-hover',
42
+ 'error-text',
43
+ 'focus',
44
+ 'link',
45
+ 'link-hover',
46
+ 'link-visited',
47
+ 'link-active',
48
+ 'white',
49
+ 'gray-100',
50
+ 'gray-200',
51
+ 'gray-300',
52
+ 'gray-400',
53
+ 'gray-500',
54
+ 'gray-600',
55
+ 'gray-700',
56
+ 'gray-800',
57
+ 'gray-900',
58
+ 'gray-1000',
59
+ 'gray-1100',
60
+ 'gray-1200',
61
+ 'black',
62
+ 'shadow200',
63
+ 'shadow600',
66
64
  ];
67
65
 
68
66
  const colorVariables = allColors.reduce((colorVars, color) => {
69
- if (["transparent", "currentColor"].includes(color)) {
67
+ if (['transparent', 'currentColor'].includes(color)) {
70
68
  colorVars[color] = color;
71
69
  } else {
72
70
  colorVars[color] = ({ opacityVariable, opacityValue }) => {
@@ -81,94 +79,92 @@ const colorVariables = allColors.reduce((colorVars, color) => {
81
79
  }
82
80
  return colorVars;
83
81
  }, {});
82
+
84
83
  const screens = require('./screens.json');
85
84
  const screensWithPixels = Object.keys(screens).reduce((screenVars, screen) => {
86
85
  screenVars[screen] = `${screens[screen]}px`;
87
86
  return screenVars;
88
- },{})
87
+ }, {});
88
+
89
89
  /** @type {import('tailwindcss').Config} */
90
90
  module.exports = {
91
- darkMode: "class",
91
+ darkMode: 'class',
92
92
  content: {
93
- files: ["./src/*.css"],
93
+ files: ['./src/*.css'],
94
94
  relative: true,
95
95
  },
96
- themes: {
97
- light: require.resolve("./defaultTheme"),
98
- },
99
- defaultTheme: "light",
100
96
  theme: {
101
97
  colors: colorVariables,
98
+ screens: {
99
+ ...screensWithPixels,
100
+ print: { raw: 'print' },
101
+ xsOnly: { min: '0px', max: '639.98px' },
102
+ smOnly: { min: '640px', max: '767.98px' },
103
+ mdOnly: { min: '768px', max: '1023.98px' },
104
+ lgOnly: { min: '1024px', max: '1279.98px' },
105
+ xlOnly: { min: '1280px', max: '1535.98px' },
106
+ },
102
107
  container: {
103
108
  center: true,
104
109
  },
105
110
  fontSize: {
106
111
  ...defaultTheme.fontSize,
107
- lg: "1.1875rem",
108
- },
109
- screens: {
110
- ...screensWithPixels,
111
- print: { raw: "print" },
112
- xsOnly: { min: "0px", max: "639.98px" },
113
- smOnly: { min: "640px", max: "767.98px" },
114
- mdOnly: { min: "768px", max: "1023.98px" },
115
- lgOnly: { min: "1024px", max: "1279.98px" },
116
- xlOnly: { min: "1280px", max: "1535.98px" },
112
+ lg: '1.1875rem',
117
113
  },
118
114
  fontFamily: {
119
- sans: ["Roboto", ...defaultTheme.fontFamily.sans],
115
+ sans: ['Roboto', ...defaultTheme.fontFamily.sans],
120
116
  },
121
117
  extend: {
122
118
  height: {
123
- fit: "fit-content",
119
+ fit: 'fit-content',
124
120
  },
125
121
  width: {
126
- fit: "fit-content",
127
- "2xl": "42rem",
128
- "4xl": "56rem",
122
+ fit: 'fit-content',
123
+ '2xl': '42rem',
124
+ '4xl': '56rem',
129
125
  },
130
126
  maxWidth: {
131
- fit: "fit-content",
127
+ fit: 'fit-content',
132
128
  },
133
129
  minWidth: {
134
- 4: "1rem",
135
- 10: "2.5rem",
136
- 32: "8rem",
137
- 52: "13rem",
130
+ 4: '1rem',
131
+ 10: '2.5rem',
132
+ 12: '3rem',
133
+ 32: '8rem',
134
+ 52: '13rem',
138
135
  },
139
136
  minHeight: {
140
- 4: "1rem",
141
- 6: "1.5rem",
142
- 8: "2rem",
143
- 10: "2.5rem",
144
- 12: "3rem",
145
- 14: "3.5rem",
137
+ 4: '1rem',
138
+ 6: '1.5rem',
139
+ 8: '2rem',
140
+ 10: '2.5rem',
141
+ 12: '3rem',
142
+ 14: '3.5rem',
146
143
  },
147
144
  borderWidth: {
148
- 3: "3px",
149
- 5: "5px",
150
- 6: "6px",
145
+ 3: '3px',
146
+ 5: '5px',
147
+ 6: '6px',
151
148
  },
152
149
  flexGrow: {
153
- 2: "2",
150
+ 2: '2',
154
151
  },
155
152
  zIndex: {
156
- "/1": -1,
153
+ '/1': -1,
157
154
  1: 1,
158
155
  2: 2,
159
156
  3: 3,
160
157
  5: 5,
161
158
  },
162
159
  opacity: {
163
- 85: "0.85",
160
+ 85: '0.85',
164
161
  },
165
162
  margin: {
166
- 15: "3.75rem",
163
+ 15: '3.75rem',
167
164
  },
168
165
  boxShadow: {
169
- thick: "0 0 30px rgba(0, 0, 0, 0.6)",
166
+ thick: '0 0 30px rgba(0, 0, 0, 0.6)',
170
167
  },
171
168
  },
172
169
  },
173
- plugins: [plugin(themesPlugin)],
174
170
  };