@digigov/css 2.0.0-rc.5 → 2.0.0-rc.7

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 (70) 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 +8 -8
  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 +55 -49
  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 -49
  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 +34 -24
  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 +46 -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/skiplink.css +2 -2
  58. package/src/components/stack.css +63 -63
  59. package/src/components/stepnav.css +33 -29
  60. package/src/components/summary-list.css +16 -13
  61. package/src/components/svg-icons.css +78 -80
  62. package/src/components/table.css +154 -178
  63. package/src/components/tabs.css +40 -38
  64. package/src/components/task-list.css +18 -18
  65. package/src/components/timeline.css +4 -3
  66. package/src/components/typography.css +80 -108
  67. package/src/components/warning-text.css +7 -7
  68. package/src/pages/index.js +1 -1
  69. package/tailwind.config.js +1 -0
  70. package/defaultTheme/footer.json +0 -8
@@ -1,72 +1,78 @@
1
1
  .ds-card {
2
2
  @apply mb-7 text-base-content;
3
- &.ds-card--dense, .gov-dense & {
3
+ border-radius: var(--card-border-radius);
4
+ &.ds-card--dense,
5
+ .ds-dense & {
4
6
  @apply mb-5;
5
7
  .ds-card__body {
6
8
  @apply gap-2 md:gap-3;
7
9
  }
8
10
  }
9
- }
10
- .ds-card--border {
11
- @apply border-2 border-base-content p-6;
12
- &.ds-card--border-light {
13
- @apply border;
14
- }
15
- &.ds-card--dense, .ds-dense & {
16
- @apply p-4 pt-3;
11
+ &.ds-card--border {
12
+ @apply border-2 border-base-content p-6;
13
+ &.ds-card--border-light {
14
+ @apply border;
15
+ }
16
+ &.ds-card--dense,
17
+ .ds-dense & {
18
+ @apply p-4 pt-3;
19
+ }
17
20
  }
18
- }
19
- .ds-card--border-top {
20
- @apply border-t border-base-300 pt-4;
21
- &.ds-card--border-dark {
22
- @apply border-t-3;
21
+ &.ds-card--border-top {
22
+ @apply border-t border-base-300 pt-4;
23
+ &.ds-card--border-dark {
24
+ @apply border-t-3;
25
+ }
26
+ &.ds-card--dense,
27
+ .ds-dense & {
28
+ @apply p-3;
29
+ }
23
30
  }
24
- &.ds-card--dense, .ds-dense & {
25
- @apply p-3;
31
+ &.ds-card--divider {
32
+ --card-border-radius: 0;
33
+ @apply border-b border-base-300 pb-4 mb-4;
26
34
  }
27
- }
28
- .ds-card--divider {
29
- @apply border-b border-base-300 pb-4 mb-4;
30
- }
31
- .ds-card--cta {
32
- .ds-card__body {
33
- @apply pr-8 relative;
34
- &:after {
35
- content: "";
36
- transition: all 0.1s ease;
37
- @apply w-5 h-5 bg-contain bg-no-repeat bg-center absolute right-2 top-2;
38
- 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>");
39
- }
40
- &:hover {
41
- &:after {
42
- @apply right-1;
35
+ &.ds-card--cta {
36
+ .ds-card__body {
37
+ @apply pr-8 relative;
38
+ &::after {
39
+ @apply w-5 h-5 bg-contain bg-no-repeat bg-center absolute right-2 top-2;
40
+ content: '';
41
+ transition: all 0.1s ease;
42
+ 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>");
43
43
  }
44
+ &:hover {
45
+ &::after {
46
+ @apply right-1;
47
+ }
48
+ }
49
+ }
50
+
51
+ .ds-card__heading {
52
+ @apply md:text-xl text-lg tracking-wide;
53
+ @apply leading-8 !important;
44
54
  }
45
55
  }
46
- .ds-card__heading {
47
- @apply md:text-xl text-lg tracking-wide;
48
- @apply leading-8 !important;
56
+ &.ds-card--border-light {
57
+ @apply border-base-300;
58
+ }
59
+ &.ds-card--border-dark {
60
+ @apply border-base-content;
61
+ }
62
+ &.ds-card--full-height {
63
+ @apply h-full;
49
64
  }
50
- }
51
- .ds-card--border-light {
52
- @apply border-base-300;
53
- }
54
- .ds-card--border-dark {
55
- @apply border-base-content;
56
- }
57
- .ds-card--full-height {
58
- @apply h-full;
59
65
  }
60
66
  .ds-card__body {
61
67
  @apply flex flex-col gap-3 md:gap-4 h-full;
62
68
  }
63
69
  .ds-card__heading {
64
- word-break: break-word;
65
70
  @apply md:text-2xl text-xl font-bold;
71
+ word-break: break-word;
66
72
  }
67
73
  .ds-card__content {
68
- word-break: break-word;
69
74
  @apply text-base;
75
+ word-break: break-word;
70
76
  font-size: var(--card__text-font-size);
71
77
  line-height: var(--card__text-line-height);
72
78
  }
@@ -75,8 +81,8 @@
75
81
  }
76
82
  @media print {
77
83
  /* When ds-card__action is empty at print, content at :after limits its height. */
78
- .ds-card__action:after {
79
- content: "";
84
+ .ds-card__action::after {
85
+ content: '';
80
86
  }
81
87
  }
82
88
 
@@ -87,8 +93,8 @@
87
93
  .ds-link {
88
94
  /* Clickable area will be at all the card with 'after' */
89
95
  &::after {
90
- content: "";
91
96
  @apply block absolute top-0 bottom-0 right-0 left-0;
97
+ content: '';
92
98
  }
93
99
  }
94
100
  }
@@ -9,18 +9,18 @@
9
9
  }
10
10
  .ds-checkboxes__input {
11
11
  @apply w-8 h-8 left-0.5 md:top-0.5;
12
- &:before {
12
+ &::before {
13
13
  @apply w-8 h-8;
14
14
  }
15
- &:after {
15
+ &::after {
16
+ @apply border-b-4 border-l-4;
16
17
  top: 10px;
17
18
  left: 7px;
18
19
  width: 19px;
19
20
  height: 10px;
20
- @apply border-b-4 border-l-4;
21
21
  }
22
22
  &:focus {
23
- &:before {
23
+ &::before {
24
24
  @apply border-3;
25
25
  }
26
26
  }
@@ -29,9 +29,9 @@
29
29
  @apply mb-4 md:mb-6;
30
30
  }
31
31
  }
32
- }
33
- .ds-checkboxes--horizontal {
34
- @apply inline-flex flex-wrap items-baseline gap-4 md:gap-6;
32
+ &.ds-checkboxes--horizontal {
33
+ @apply inline-flex flex-wrap items-baseline gap-4 md:gap-6;
34
+ }
35
35
  }
36
36
  .ds-checkboxes__item {
37
37
  @apply block relative mb-4 pl-12 min-h-10;
@@ -45,27 +45,24 @@
45
45
  .ds-checkboxes__input {
46
46
  @apply absolute z-1 left-0.5 -top-0.5 m-0 opacity-100
47
47
  w-10 h-10 cursor-pointer;
48
- &:before {
49
- content: "";
50
- -webkit-box-sizing: border-box;
51
- box-sizing: border-box;
48
+ &::before {
52
49
  @apply absolute top-0 left-0 w-10 h-10
53
50
  border-solid border-base-content border-2 bg-base-100 opacity-100;
51
+ content: '';
52
+ box-sizing: border-box;
54
53
  }
55
- &:after {
56
- content: "";
54
+ &::after {
57
55
  @apply absolute bg-transparent opacity-0 box-border
58
56
  border-accent border-b-5 border-l-5 border-t-0 border-r-0;
57
+ content: '';
59
58
  top: 11px;
60
59
  left: 9px;
61
60
  width: 23px;
62
61
  height: 12px;
63
- -webkit-transform: rotate(-45deg);
64
- -ms-transform: rotate(-45deg);
65
62
  transform: rotate(-45deg);
66
63
  }
67
64
  &:checked {
68
- &:after {
65
+ &::after {
69
66
  @apply opacity-100;
70
67
  }
71
68
  }
@@ -73,7 +70,7 @@
73
70
  outline: 3px solid transparent;
74
71
  outline-offset: 1px;
75
72
  box-shadow: 0 0 0 4px var(--color-focus);
76
- &:before {
73
+ &::before {
77
74
  @apply border-4;
78
75
  }
79
76
  }
@@ -83,12 +80,6 @@
83
80
  }
84
81
 
85
82
  /* overrides */
86
-
87
- .ds-checkboxes--horizontal {
88
- .ds-choice-divider-text {
89
- @apply min-w-max mx-2;
90
- }
91
- }
92
83
  .ds-checkboxes {
93
84
  &.ds-checkboxes--dense,
94
85
  .ds-dense & {
@@ -96,4 +87,10 @@
96
87
  @apply mb-4 md:mb-6;
97
88
  }
98
89
  }
90
+
91
+ &.ds-checkboxes--horizontal {
92
+ .ds-choice-divider-text {
93
+ @apply min-w-max mx-2;
94
+ }
95
+ }
99
96
  }
@@ -1,41 +1,40 @@
1
1
  .ds-chips {
2
- @apply flex flex-wrap list-none gap-2;
2
+ @apply flex flex-wrap list-none gap-2 items-center;
3
+ &.ds-chips--horizontal {
4
+ @apply md:flex md:flex-row md:flex-wrap;
5
+ }
3
6
  .ds-chip:last-child .ds-chip__content {
4
7
  @apply mr-0;
5
8
  }
6
9
  }
7
- .ds-chips--horizontal {
8
- @apply md:flex md:flex-row md:flex-wrap;
9
- }
10
10
  .ds-chip {
11
11
  @apply list-none;
12
+ &:last-child {
13
+ .ds-chip__content {
14
+ @apply mr-0;
15
+ }
16
+ }
17
+ &.ds-chip--deletable {
18
+ .ds-chip__content {
19
+ &:hover {
20
+ @apply shadow-lg transition;
21
+ }
22
+ }
23
+ }
12
24
  .ds-chip__content {
13
25
  @apply bg-base-100 text-base-content lg:text-base text-sm border-2 border-base-content
14
26
  inline-flex items-center px-2 py-1 rounded shadow;
15
- &[role="button"] {
27
+ &[role='button'] {
16
28
  &:hover {
17
29
  @apply shadow-lg text-base-content-invert bg-base-900 border-base-900 transition;
18
30
  }
19
31
  &:focus {
20
32
  outline: 3px solid var(--color-focus);
21
33
  outline-offset: 0;
22
- -webkit-box-shadow: inset 0 0 0 2px;
23
34
  box-shadow: inset 0 0 0 2px;
24
35
  }
25
36
  }
26
37
  }
27
- &:last-child {
28
- .ds-chip__content {
29
- @apply mr-0;
30
- }
31
- }
32
- }
33
- .ds-chip--deletable {
34
- .ds-chip__content {
35
- &:hover {
36
- @apply shadow-lg transition;
37
- }
38
- }
39
38
  }
40
39
  .ds-chip__key-value {
41
40
  @apply font-bold mr-2;
@@ -44,25 +43,25 @@
44
43
  /* overrides */
45
44
 
46
45
  .ds-chip {
47
- .ds-chip__content {
48
- .ds-svg-icon--close {
49
- @apply w-4 h-4 ml-3;
46
+ &.ds-chip--deletable {
47
+ .ds-chip__content {
48
+ .ds-svg-icon--close {
49
+ &:hover {
50
+ @apply cursor-pointer;
51
+ }
52
+ }
50
53
  }
51
- &[role="button"] {
54
+ }
55
+ .ds-chip__content {
56
+ &[role='button'] {
52
57
  &:hover {
53
58
  .ds-svg-icon--close {
54
59
  fill: var(--color-base-content-invert);
55
60
  }
56
61
  }
57
62
  }
58
- }
59
- }
60
- .ds-chip--deletable {
61
- .ds-chip__content {
62
63
  .ds-svg-icon--close {
63
- &:hover {
64
- @apply cursor-pointer;
65
- }
64
+ @apply w-4 h-4 ml-3;
66
65
  }
67
66
  }
68
67
  }
@@ -1,2 +1,2 @@
1
- @import "tailwindcss/components";
2
- @import "./index.css";
1
+ @import 'tailwindcss/components';
2
+ @import './index.css';
@@ -1,41 +1,46 @@
1
1
  .ds-copy-to-clipboard {
2
2
  @apply flex w-fit;
3
+
4
+ &.ds-copy-to-clipboard--hidden {
5
+ @apply invisible w-0 h-0;
6
+ }
3
7
  }
4
8
  .ds-copy-to-clipboard__tooltip {
5
9
  @apply relative;
6
- .ds-copy-to-clipboard__message {
7
- @apply bg-success py-4 px-6 absolute mt-4 text-center z-50 w-fit md:w-max;
10
+ &.ds-copy-to-clipboard__tooltip--dense,
11
+ .ds-dense & {
8
12
  &::before {
9
- content: "";
10
- @apply w-4 h-4 border-t-8 border-l-8 border-success transform rotate-45
11
- absolute -top-1;
12
- transform: rotate(45deg);
13
+ @apply w-2 h-2;
13
14
  }
14
- }
15
- &.ds-copy-to-clipboard__tooltip--dense, .ds-dense & {
16
15
  .ds-copy-to-clipboard__message {
17
16
  @apply py-2 px-4;
18
17
  }
19
- &::before {
20
- @apply w-2 h-2;
18
+ }
19
+ &.ds-copy-to-clipboard__tooltip--right {
20
+ .ds-copy-to-clipboard__message {
21
+ @apply right-0;
22
+ &::before {
23
+ @apply right-4;
24
+ content: '';
25
+ }
21
26
  }
22
27
  }
23
- }
24
- .ds-copy-to-clipboard__tooltip--right {
25
- .ds-copy-to-clipboard__message {
26
- @apply right-0;
27
- &::before {
28
- content: "";
29
- @apply right-4;
28
+ &.ds-copy-to-clipboard__tooltip--left {
29
+ .ds-copy-to-clipboard__message {
30
+ @apply left-0;
31
+ &::before {
32
+ @apply left-4;
33
+ content: '';
34
+ }
30
35
  }
31
36
  }
32
- }
33
- .ds-copy-to-clipboard__tooltip--left {
34
37
  .ds-copy-to-clipboard__message {
35
- @apply left-0;
38
+ @apply bg-success py-4 px-6 absolute mt-4 text-center z-50 w-fit md:w-max;
36
39
  &::before {
37
- content: "";
38
- @apply left-4;
40
+ @apply w-4 h-4 border-t-8 border-l-8 border-success transform rotate-45
41
+ absolute -top-1;
42
+ content: '';
43
+ transform: rotate(45deg);
39
44
  }
40
45
  }
41
46
  }
@@ -45,10 +50,6 @@
45
50
  }
46
51
  }
47
52
 
48
- .ds-copy-to-clipboard--hidden {
49
- @apply invisible w-0 h-0;
50
- }
51
-
52
53
  /* overrides */
53
54
 
54
55
  .ds-copy-to-clipboard__tooltip {
@@ -11,21 +11,23 @@
11
11
  }
12
12
  &:focus {
13
13
  background-color: var(--color-focus);
14
- box-shadow: 0 -2px var(--color-focus), 0 4px var(--color-base-content);
15
- text-decoration:none;
14
+ box-shadow:
15
+ 0 -2px var(--color-focus),
16
+ 0 4px var(--color-base-content);
17
+ text-decoration: none;
16
18
  }
17
19
  &:focus-within {
18
20
  @apply outline-none;
19
21
  }
20
- }
21
- .ds-details__summary--lg {
22
- @apply font-semibold;
23
- font-size: var(--details__summary--lg-font-size);
24
- line-height: var(--details__summary--lg-line-height);
22
+ &.ds-details__summary--lg {
23
+ @apply font-semibold;
24
+ font-size: var(--details__summary--lg-font-size);
25
+ line-height: var(--details__summary--lg-line-height);
26
+ }
25
27
  }
26
28
  .ds-details__content {
27
29
  @apply border-l-2 border-base-500 py-2 px-4 mt-4;
28
- >*:last-child {
30
+ > *:last-child {
29
31
  @apply mb-0;
30
32
  }
31
- }
33
+ }
@@ -1,10 +1,9 @@
1
1
  /* Experimental css file. */
2
2
 
3
3
  .dark {
4
- /*
4
+ /*
5
5
  Here we can experiment with dark theme.
6
6
  Storybook does not need restart when writing here.
7
7
  Final styling should then go to themes/ds-dark/overrides/index.css
8
8
  */
9
-
10
- }
9
+ }
@@ -3,36 +3,36 @@
3
3
  h-full max-h-screen min-h-screen overflow-y-scroll w-4/5 max-w-md flex flex-col
4
4
  fixed top-0 bottom-0 z-40;
5
5
  @apply shadow-thick !important;
6
- }
7
- .ds-drawer--relative-sm {
8
- @apply sm:relative sm:w-full max-h-full shadow-thick sm:shadow-none !important;
9
- }
10
- .ds-drawer--relative-md {
11
- @apply md:relative md:w-full max-h-full shadow-thick md:shadow-none !important;
12
- }
13
- .ds-drawer--relative-lg {
14
- @apply lg:relative lg:w-full max-h-full shadow-thick lg:shadow-none !important;
15
- }
16
- .ds-drawer--right {
17
- @apply right-0;
18
- }
19
- .ds-drawer--left {
20
- @apply left-0;
21
- }
22
- .ds-drawer--bg-secondary {
23
- @apply bg-base-200 border-0;
24
- @apply shadow-xl !important;
25
- }
26
- .ds-drawer--closed {
27
- @apply hidden;
28
6
  &.ds-drawer--relative-sm {
29
- @apply hidden sm:flex;
7
+ @apply sm:relative sm:w-full max-h-full shadow-thick sm:shadow-none !important;
30
8
  }
31
9
  &.ds-drawer--relative-md {
32
- @apply hidden md:flex;
10
+ @apply md:relative md:w-full max-h-full shadow-thick md:shadow-none !important;
33
11
  }
34
12
  &.ds-drawer--relative-lg {
35
- @apply hidden lg:flex;
13
+ @apply lg:relative lg:w-full max-h-full shadow-thick lg:shadow-none !important;
14
+ }
15
+ &.ds-drawer--right {
16
+ @apply right-0;
17
+ }
18
+ &.ds-drawer--left {
19
+ @apply left-0;
20
+ }
21
+ &.ds-drawer--bg-secondary {
22
+ @apply bg-base-200 border-0;
23
+ @apply shadow-xl !important;
24
+ }
25
+ &.ds-drawer--closed {
26
+ @apply hidden;
27
+ &.ds-drawer--relative-sm {
28
+ @apply hidden sm:flex;
29
+ }
30
+ &.ds-drawer--relative-md {
31
+ @apply hidden md:flex;
32
+ }
33
+ &.ds-drawer--relative-lg {
34
+ @apply hidden lg:flex;
35
+ }
36
36
  }
37
37
  }
38
38
  .ds-drawer__heading {
@@ -45,6 +45,27 @@
45
45
  /* overrides */
46
46
 
47
47
  .ds-drawer {
48
+ &.ds-drawer--relative-sm {
49
+ .ds-drawer__heading {
50
+ > .ds-close-btn {
51
+ @apply sm:hidden;
52
+ }
53
+ }
54
+ }
55
+ &.ds-drawer--relative-md {
56
+ .ds-drawer__heading {
57
+ > .ds-close-btn {
58
+ @apply md:hidden;
59
+ }
60
+ }
61
+ }
62
+ &.ds-drawer--relative-lg {
63
+ .ds-drawer__heading {
64
+ > .ds-close-btn {
65
+ @apply lg:hidden;
66
+ }
67
+ }
68
+ }
48
69
  > .ds-container {
49
70
  @apply p-0;
50
71
  }
@@ -58,25 +79,3 @@
58
79
  @apply m-0;
59
80
  }
60
81
  }
61
- .ds-drawer--relative-sm {
62
- .ds-drawer__heading {
63
- >.ds-close-btn {
64
- @apply sm:hidden;
65
- }
66
- }
67
- }
68
- .ds-drawer--relative-md {
69
- .ds-drawer__heading {
70
- >.ds-close-btn {
71
- @apply md:hidden;
72
- }
73
- }
74
- }
75
- .ds-drawer--relative-lg {
76
- .ds-drawer__heading {
77
- >.ds-close-btn {
78
- @apply lg:hidden;
79
- }
80
- }
81
- }
82
-