@digigov/css 1.3.0-rc.0 → 2.0.0-4be8f7cc

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 (77) hide show
  1. package/defaultTheme/accordion.json +8 -0
  2. package/defaultTheme/brandConfig.json +10 -0
  3. package/defaultTheme/button.json +9 -0
  4. package/defaultTheme/card.json +11 -0
  5. package/defaultTheme/form.json +15 -0
  6. package/defaultTheme/globals.json +11 -1
  7. package/defaultTheme/index.js +1 -1
  8. package/defaultTheme/layout.json +55 -0
  9. package/defaultTheme/misc.json +20 -0
  10. package/defaultTheme/panel.json +5 -0
  11. package/defaultTheme/typography.json +8 -8
  12. package/dist/base/index.css +1 -1
  13. package/dist/base.js +1 -1
  14. package/dist/components.js +1 -1
  15. package/dist/digigov.css +2 -2
  16. package/package.json +7 -3
  17. package/src/base/base.css +1 -1
  18. package/src/base/index.css +5 -5
  19. package/src/components/accordion.css +56 -53
  20. package/src/components/admin-header.css +6 -5
  21. package/src/components/admin-layout.css +10 -17
  22. package/src/components/autocomplete.css +89 -46
  23. package/src/components/back-to-top.css +3 -4
  24. package/src/components/bottom-info.css +2 -1
  25. package/src/components/breadcrumbs.css +8 -6
  26. package/src/components/button.css +49 -48
  27. package/src/components/card.css +56 -48
  28. package/src/components/checkboxes.css +20 -23
  29. package/src/components/chip.css +28 -29
  30. package/src/components/components.css +2 -2
  31. package/src/components/copy-to-clipboard.css +27 -26
  32. package/src/components/details.css +11 -9
  33. package/src/components/dev-theme.css +2 -3
  34. package/src/components/drawer.css +46 -47
  35. package/src/components/dropdown.css +57 -46
  36. package/src/components/experimental.css +12 -12
  37. package/src/components/fillable.css +4 -4
  38. package/src/components/filter.css +9 -14
  39. package/src/components/footer.css +35 -21
  40. package/src/components/form.css +33 -23
  41. package/src/components/full-page-background.css +1 -1
  42. package/src/components/header.css +27 -35
  43. package/src/components/hidden.css +6 -6
  44. package/src/components/index.css +47 -47
  45. package/src/components/kitchensink.css +33 -33
  46. package/src/components/layout.css +34 -36
  47. package/src/components/loader.css +28 -28
  48. package/src/components/masthead.css +56 -55
  49. package/src/components/misc.css +13 -15
  50. package/src/components/modal.css +10 -12
  51. package/src/components/nav.css +69 -65
  52. package/src/components/notification-banner.css +18 -16
  53. package/src/components/pagination.css +29 -30
  54. package/src/components/panel.css +9 -8
  55. package/src/components/phase-banner.css +5 -5
  56. package/src/components/radios.css +24 -21
  57. package/src/components/skeleton.css +68 -0
  58. package/src/components/skiplink.css +2 -2
  59. package/src/components/stack.css +63 -63
  60. package/src/components/stepnav.css +33 -29
  61. package/src/components/summary-list.css +16 -16
  62. package/src/components/svg-icons.css +78 -80
  63. package/src/components/table.css +154 -178
  64. package/src/components/tabs.css +40 -38
  65. package/src/components/task-list.css +18 -18
  66. package/src/components/timeline.css +4 -3
  67. package/src/components/typography.css +93 -102
  68. package/src/components/warning-text.css +7 -7
  69. package/src/pages/index.js +1 -1
  70. package/tailwind.config.js +1 -0
  71. package/defaultTheme/footer.json +0 -8
  72. package/src/pages/admin-filtering-data.js +0 -160
  73. package/src/pages/admin.js +0 -61
  74. package/src/pages/dropdown.js +0 -249
  75. package/src/pages/form.js +0 -400
  76. package/src/pages/pagination.js +0 -124
  77. package/src/pages/table.js +0 -308
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/css",
3
- "version": "1.3.0-rc.0",
3
+ "version": "2.0.0-4be8f7cc",
4
4
  "description": "Digigov CSS - Tailwind CSS Components",
5
5
  "author": "GRNET Devs <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
@@ -39,6 +39,7 @@
39
39
  ]
40
40
  },
41
41
  "devDependencies": {
42
+ "@digigov/cli": "1.1.0",
42
43
  "autoprefixer": "10.4.16",
43
44
  "cssnano": "4.1.10",
44
45
  "postcss": "8.4.4",
@@ -53,7 +54,9 @@
53
54
  "@digigov/cli-build-tailwind": "1.0.1",
54
55
  "rimraf": "3.0.2",
55
56
  "publint": "0.1.8",
56
- "@digigov/cli": "1.1.0"
57
+ "stylelint": "15.11.0",
58
+ "stylelint-plugin-digigov": "1.1.0-4be8f7cc",
59
+ "prettier": "3.2.5"
57
60
  },
58
61
  "dependencies": {
59
62
  "@fontsource/roboto": "4.4.0",
@@ -77,6 +80,7 @@
77
80
  "start": "next dev",
78
81
  "build": "rimraf dist && npm run build-tailwind",
79
82
  "publint": "publint",
80
- "build-tailwind": "digigov build-tailwind --bundle digigov"
83
+ "build-tailwind": "digigov build-tailwind --bundle digigov",
84
+ "lint": "stylelint --fix src/**/*.css; prettier --write src/**/*.css --log-level error"
81
85
  }
82
86
  }
package/src/base/base.css CHANGED
@@ -1 +1 @@
1
- @import "./index.css";
1
+ @import './index.css';
@@ -1,15 +1,15 @@
1
- @import "tailwindcss/base";
2
-  
1
+ @import 'tailwindcss/base';
3
2
  :root {
4
3
  accent-color: var(--color-accent);
5
4
  }
6
- html{
5
+ html {
7
6
  -webkit-tap-highlight-color: transparent;
8
7
  scroll-behavior: smooth;
9
8
  }
10
9
  body {
11
10
  @apply font-sans text-base-content bg-base-100;
12
11
  }
13
- .light, .dark {
12
+ .light,
13
+ .dark {
14
14
  @apply font-sans text-base-content bg-base-100;
15
- }
15
+ }
@@ -1,4 +1,52 @@
1
1
  .ds-accordion {
2
+ &.ds-accordion--no-border {
3
+ .ds-accordion__section {
4
+ @apply border-0 !important;
5
+ }
6
+ }
7
+ &.ds-accordion--border-top {
8
+ .ds-accordion__section {
9
+ .ds-accordion__section-summary {
10
+ @apply border-b-0;
11
+ }
12
+ }
13
+ }
14
+ &.ds-accordion--border-bottom {
15
+ .ds-accordion__section {
16
+ @apply border-0;
17
+ &:first-child {
18
+ @apply border-0;
19
+ }
20
+ .ds-accordion__section-summary {
21
+ @apply border-b border-base-400;
22
+ }
23
+ }
24
+ }
25
+ &.ds-accordion--secondary {
26
+ .ds-accordion__section {
27
+ .ds-accordion__section-summary {
28
+ @apply px-4 bg-base-200;
29
+ }
30
+ .ds-accordion__section-content {
31
+ @apply px-4;
32
+ }
33
+ }
34
+ .ds-accordion__section-button {
35
+ &::after {
36
+ @apply right-0;
37
+ }
38
+ }
39
+ }
40
+ &.ds-accordion--dense {
41
+ .ds-accordion__section {
42
+ .ds-accordion__section-summary {
43
+ @apply py-2;
44
+ }
45
+ .ds-accordion__section-content {
46
+ @apply py-2 my-0;
47
+ }
48
+ }
49
+ }
2
50
  .ds-accordion__controls {
3
51
  @apply text-right;
4
52
  }
@@ -9,9 +57,12 @@
9
57
  }
10
58
  }
11
59
  .ds-accordion__section-summary {
12
- @apply py-4 pr-8 hover:bg-base-200 transition ease-in-out cursor-pointer;
13
- @apply mb-0;
60
+ @apply py-4 pr-8 mb-0 transition ease-in-out cursor-pointer;
61
+ background: var(--accordion__section-summary-background);
14
62
  list-style: none;
63
+ &:hover {
64
+ background: var(--accordion__section-summary-background-hover);
65
+ }
15
66
  &::-webkit-details-marker {
16
67
  @apply hidden;
17
68
  }
@@ -35,9 +86,9 @@
35
86
  .ds-accordion__section-header {
36
87
  }
37
88
  .ds-accordion__section-heading {
38
- font-size: var(--accordion__section-heading-font-size);
39
89
  @apply no-underline font-semibold
40
90
  mb-0 transition-all justify-between cursor-pointer;
91
+ font-size: var(--accordion__section-heading-font-size);
41
92
  &:active {
42
93
  @apply ring-link-visited;
43
94
  }
@@ -45,8 +96,8 @@
45
96
  .ds-accordion__section-button {
46
97
  @apply text-base-content focus:underline flex justify-between;
47
98
  &::after {
48
- content: "+";
49
99
  @apply text-2xl text-base-content float-right relative -right-8 ml-2;
100
+ content: '+';
50
101
  }
51
102
  }
52
103
  .ds-accordion__section[open] {
@@ -55,7 +106,7 @@
55
106
  }
56
107
  .ds-accordion__section-button {
57
108
  &::after {
58
- content: "\2013";
109
+ content: '\2013';
59
110
  }
60
111
  }
61
112
  }
@@ -66,54 +117,6 @@
66
117
  }
67
118
  }
68
119
  }
69
- .ds-accordion--no-border {
70
- .ds-accordion__section {
71
- @apply border-0 !important;
72
- }
73
- }
74
- .ds-accordion--border-top {
75
- .ds-accordion__section {
76
- .ds-accordion__section-summary {
77
- @apply border-b-0;
78
- }
79
- }
80
- }
81
- .ds-accordion--border-bottom {
82
- .ds-accordion__section {
83
- @apply border-0;
84
- &:first-child {
85
- @apply border-0;
86
- }
87
- .ds-accordion__section-summary {
88
- @apply border-b border-base-400;
89
- }
90
- }
91
- }
92
- .ds-accordion--secondary {
93
- .ds-accordion__section {
94
- .ds-accordion__section-summary {
95
- @apply px-4 bg-base-200;
96
- }
97
- .ds-accordion__section-content {
98
- @apply px-4;
99
- }
100
- }
101
- .ds-accordion__section-button {
102
- &::after {
103
- @apply right-0;
104
- }
105
- }
106
- }
107
- .ds-accordion--dense {
108
- .ds-accordion__section {
109
- .ds-accordion__section-summary {
110
- @apply py-2;
111
- }
112
- .ds-accordion__section-content {
113
- @apply py-2 my-0;
114
- }
115
- }
116
- }
117
120
 
118
121
  /* overrides */
119
122
 
@@ -3,7 +3,8 @@
3
3
  border-bottom-style: solid;
4
4
  }
5
5
  .ds-admin-header__content {
6
- @apply px-4 py-2 mx-auto max-w-full w-full flex justify-between items-center;
6
+ @apply px-4 py-2 mx-auto max-w-full w-full flex justify-between items-center
7
+ flex-wrap sm:flex-nowrap print:px-0 gap-3;
7
8
  }
8
9
 
9
10
  /* overrides */
@@ -13,12 +14,9 @@
13
14
  @apply print:hidden;
14
15
  }
15
16
  .ds-dropdown__button.ds-link {
16
- @apply text-lg text-white focus:text-base-content print:text-base-800;
17
+ @apply text-lg text-white focus:text-base-content print:text-base-800 text-right;
17
18
  }
18
19
  .ds-link {
19
- .ds-svg-icon {
20
- fill: var(--color-white);
21
- }
22
20
  &:hover {
23
21
  .ds-svg-icon {
24
22
  fill: var(--color-white);
@@ -29,5 +27,8 @@
29
27
  fill: var(--color-link-active);
30
28
  }
31
29
  }
30
+ .ds-svg-icon {
31
+ fill: var(--color-white);
32
+ }
32
33
  }
33
34
  }
@@ -1,26 +1,19 @@
1
1
  .ds-admin-layout-wrapper {
2
2
  display: flex;
3
- flex-direction: column;
4
- flex-wrap: wrap;
3
+ flex-flow: column wrap;
5
4
  min-height: 100vh;
6
5
  }
7
- .ds-admin-top-section {}
8
- .ds-admin-top-section--secondary {
9
- @apply bg-base-200 px-4 py-2;
6
+ .ds-admin-top-section {
7
+ &.ds-admin-top-section--secondary {
8
+ @apply bg-base-200 px-4 py-2;
9
+ }
10
+ &.ds-admin-top-section--border {
11
+ @apply border border-base-300 px-4 py-2;
12
+ }
10
13
  }
11
- .ds-admin-top-section--border {
12
- @apply border border-base-300 px-4 py-2;
13
- }
14
- .ds-admin-width-container {
15
- @apply px-4 py-8 m-0 w-full mx-auto;
16
- flex: 1 1 0%;
17
- }
18
- .ds-admin-main-wrapper {
19
- @apply grid p-4 md:grid-cols-12 gap-x-8 md:gap-x-10 gap-y-4 grid-cols-1 print:grid-cols-1;
20
- }
21
- .ds-admin-main-content {
14
+ .ds-admin-main {
22
15
  @apply lg:col-span-8 md:col-span-7;
23
16
  }
24
- .ds-admin-side-content {
17
+ .ds-admin-aside {
25
18
  @apply lg:col-span-4 md:col-span-5 print:order-1;
26
19
  }
@@ -1,12 +1,11 @@
1
- .ds-autocomplete__wrapper {
1
+ .ds-autocomplete__container {
2
2
  @apply relative;
3
3
  }
4
- .ds-autocomplete__status {}
5
- .ds-autocomplete__status__wrapper {
6
- @apply border-0 h-px overflow-hidden absolute whitespace-nowrap p-0 w-px;
4
+ .ds-autocomplete__status {
5
+ }
6
+ .ds-autocomplete__status__container {
7
+ @apply border-0 h-px overflow-hidden absolute whitespace-nowrap p-0 w-px -mb-px -mr-px;
7
8
  clip: "rect(0 0 0 0)";
8
- margin-bottom: "-1px";
9
- margin-right: "-1px";
10
9
  }
11
10
  .ds-autocomplete__hint {
12
11
  @apply absolute text-base-400;
@@ -15,57 +14,104 @@
15
14
  .ds-autocomplete__input {
16
15
  @apply md:text-lg text-base p-2 w-full border-2 border-base-content;
17
16
  appearance: none;
18
- -webkit-appearance: none;
19
17
  box-sizing: border-box;
20
- -moz-box-sizing: border-box;
21
- -webkit-box-sizing: border-box;
22
18
  }
23
19
  .ds-autocomplete__input {
24
- @apply relative bg-transparent;
25
- }
26
- .ds-autocomplete__input--default {
27
- @apply p-2;
28
- }
29
- .ds-autocomplete__input--focused {
30
- outline: 4px solid var(--color-focus);
31
- outline-offset: 0;
32
- -webkit-box-shadow: inset 0 0 0 2px;
33
- box-shadow: inset 0 0 0 2px;
34
- }
35
- .ds-autocomplete__input--show-all-values {
36
- @apply cursor-text;
20
+ @apply relative bg-transparent cursor-pointer pr-8;
21
+ &.ds-autocomplete__input--focused {
22
+ outline: 4px solid var(--color-focus);
23
+ outline-offset: 0;
24
+ -webkit-box-shadow: inset 0 0 0 2px;
25
+ box-shadow: inset 0 0 0 2px;
26
+ }
37
27
  }
38
- .ds-autocomplete__dropdown-arrow-down {
39
- @apply inline-block absolute right-2 top-4 w-6 h-6 cursor-pointer;
28
+ .ds-autocomplete__container > .ds-svg-icon {
29
+ @apply inline-block absolute right-2 top-3;
30
+ pointer-events: none;
40
31
  }
41
- .ds-autocomplete__menu {
42
- @apply bg-base-100 m-0 max-h-96 overflow-x-hidden w-full p-0 border-2 border-t-0 border-base-content /* border-t-0 border-x-2 border-l-2 border-base-content */;
32
+ .ds-autocomplete__multi-input-container > .ds-link {
33
+ @apply inline-block absolute right-2 top-4;
34
+ .ds-svg-icon {
35
+ @apply ml-0 fill-base-content;
36
+ }
43
37
  }
44
- .ds-autocomplete__menu--inline {
45
- @apply relative;
38
+ .ds-autocomplete__multi-input-container {
39
+ @apply w-full p-2 pr-8 border-2 border-base-content bg-base-100
40
+ flex gap-2 flex-wrap items-center;
41
+ min-height: 52px;
42
+ text-indent: 2px;
43
+ &:focus,
44
+ &.ds-autocomplete__multi-input-container--focused {
45
+ outline: 4px solid var(--color-focus);
46
+ outline-offset: 0;
47
+ -webkit-box-shadow: inset 0 0 0 2px;
48
+ box-shadow: inset 0 0 0 2px;
49
+ }
50
+ &:not(.ds-autocomplete__multi-input-container--focused) {
51
+ &.ds-autocomplete__multi-input-container--1 {
52
+ .ds-chip + .ds-chip {
53
+ @apply hidden;
54
+ }
55
+ }
56
+ &.ds-autocomplete__multi-input-container--2 {
57
+ .ds-chip + .ds-chip + .ds-chip {
58
+ @apply hidden;
59
+ }
60
+ }
61
+ &.ds-autocomplete__multi-input-container--3 {
62
+ .ds-chip + .ds-chip + .ds-chip + .ds-chip {
63
+ @apply hidden;
64
+ }
65
+ }
66
+ }
46
67
  }
47
- .ds-autocomplete__menu--overlay {
48
- @apply absolute w-full left-0 top-full z-50 shadow-xl;
68
+ .ds-autocomplete__multi-input {
69
+ @apply flex-1 w-full focus:border-0 focus:outline-0 bg-base-100;
49
70
  }
50
- .ds-autocomplete__menu--visible {
51
- @apply block;
71
+ .ds-autocomplete__multi-btn {
72
+ @apply absolute bottom-0 right-0 m-2;
73
+ margin: 4px 2px;
74
+ height: 44px;
75
+ .ds-svg-icon {
76
+ @apply mx-2 !important;
77
+ }
52
78
  }
53
- .ds-autocomplete__menu--hidden {
54
- @apply hidden;
79
+
80
+ .ds-autocomplete__menu {
81
+ @apply block max-h-96 w-full m-0 p-0 overflow-x-hidden
82
+ border-2 border-t-0 border-base-content bg-base-100
83
+ absolute left-0 top-full z-50 shadow-xl;
84
+ &.ds-autocomplete__menu--hidden {
85
+ @apply hidden;
86
+ }
55
87
  }
56
88
  .ds-autocomplete__option {
57
- @apply cursor-pointer block relative p-2;
58
- border-bottom: solid var(--color-base-400);
89
+ @apply cursor-pointer block relative p-2 border-b-base-400;
59
90
  border-width: 1px 0;
91
+ &.ds-autocomplete__option--odd {
92
+ @apply bg-base-300;
93
+ }
94
+ &.ds-autocomplete__option--focused,
95
+ &.ds-autocomplete__option:hover {
96
+ @apply bg-info text-white outline-none border-tertiary;
97
+ }
98
+ &.ds-autocomplete__option--no-results {
99
+ @apply text-current cursor-not-allowed;
100
+ }
101
+ &.ds-autocomplete__option--empty {
102
+ @apply cursor-default;
103
+ @apply bg-base-100 text-base-content !important;
104
+ &:hover {
105
+ border-color: var(--color-base-400);
106
+ }
107
+ }
60
108
  }
61
109
  .ds-autocomplete__option > * {
62
110
  @apply pointer-events-none;
63
- }
64
- .ds-autocomplete__option:first-of-type {
65
- @apply border-t-0;
66
- }
67
- .ds-autocomplete__option:last-of-type {
68
- @apply border-t-0;
111
+ &:first-of-type,
112
+ &:last-of-type {
113
+ @apply border-t-0;
114
+ }
69
115
  }
70
116
  .ds-autocomplete__option--odd {
71
117
  @apply bg-base-300;
@@ -78,11 +124,8 @@
78
124
  @apply text-current cursor-not-allowed;
79
125
  }
80
126
  .ds-autocomplete__option--empty {
81
- @apply cursor-default;
127
+ @apply cursor-default hover:border-base-400;
82
128
  @apply bg-base-100 text-base-content !important;
83
- &:hover {
84
- border-color: var(--color-base-400);
85
- }
86
129
  }
87
130
  .ds-autocomplete__hint,
88
131
  .ds-autocomplete__option {
@@ -1,12 +1,11 @@
1
1
  .ds-back-to-top-content {
2
-
3
2
  }
4
-
3
+
5
4
  .ds-back-to-top-link {
5
+ @apply w-fit underline flex mb-4 cursor-pointer items-baseline;
6
6
  font-size: var(--back-to-top-link-font-size);
7
7
  letter-spacing: var(--back-to-top-link-letter-spacing);
8
8
  color: var(--back-to-top-link-color);
9
- @apply w-fit underline flex mb-4 cursor-pointer items-baseline;
10
9
  &:hover {
11
10
  text-decoration-thickness: 2px;
12
11
  }
@@ -26,4 +25,4 @@
26
25
  .ds-svg-icon {
27
26
  fill: var(--back-to-top-link-color);
28
27
  }
29
- }
28
+ }
@@ -2,4 +2,5 @@
2
2
  @apply w-full bg-base-200 border-t border-base-400;
3
3
  @apply md:py-6 !important;
4
4
  }
5
- .ds-bottom-info__content {}
5
+ .ds-bottom-info__content {
6
+ }
@@ -3,18 +3,18 @@
3
3
  }
4
4
  .ds-breadcrumbs__list {
5
5
  @apply block m-0 p-0 list-none;
6
- &:after {
7
- content: "";
6
+ &::after {
7
+ content: '';
8
8
  display: block;
9
9
  clear: both;
10
10
  }
11
11
  }
12
12
  .ds-breadcrumbs__list-item {
13
- font-size: var(--breadcrumbs__list-item-font-size);
14
13
  @apply inline-block relative mb-1 ml-2 pl-4 float-left;
14
+ font-size: var(--breadcrumbs__list-item-font-size);
15
15
  &::before {
16
- content: "";
17
16
  @apply block absolute top-2 bottom-0 left-0 md:w-3 md:h-3 w-2 h-2 mx-auto my-0 bg-contain bg-no-repeat bg-center;
17
+ content: '';
18
18
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true'> <path d='M8.5,2L6.1,4.3l7.6,7.7l-7.6,7.6L8.5,22l10-10L8.5,2z' /> </svg>");
19
19
  }
20
20
  &:first-child {
@@ -29,7 +29,7 @@
29
29
  &::before {
30
30
  background-image: none;
31
31
  top: 2px;
32
- left: 0px;
32
+ left: 0;
33
33
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true'> <path d='M8.5,2L6.1,4.3l7.6,7.7l-7.6,7.6L8.5,22l10-10L8.5,2z' /> </svg>");
34
34
  }
35
35
  }
@@ -41,7 +41,9 @@
41
41
  }
42
42
  &:focus {
43
43
  background-color: var(--color-focus);
44
- box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-base-content);
44
+ box-shadow:
45
+ 0 -2px var(--color-focus),
46
+ 0 4px var(--color-base-content);
45
47
  text-decoration: none;
46
48
  outline: none;
47
49
  }