@digigov/react-core 1.0.0-8ae63a77 → 1.0.0-8bbf3ef2

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 (222) hide show
  1. package/AccessibilityMenuHeaderButton/index.d.ts +1 -1
  2. package/BottomInfo/__snapshots__/index.test.tsx.snap +7 -2
  3. package/BottomInfoContainer/__snapshots__/index.test.tsx.snap +7 -2
  4. package/Button/__snapshots__/index.test.tsx.snap +18 -0
  5. package/Button/index.d.ts +8 -1
  6. package/Button/index.js +3 -2
  7. package/Button/index.test.js +17 -9
  8. package/Checkbox/__snapshots__/index.test.tsx.snap +76 -0
  9. package/Checkbox/index.d.ts +8 -1
  10. package/Checkbox/index.js +3 -2
  11. package/Checkbox/index.test.js +8 -0
  12. package/CloseButton/__snapshots__/index.test.tsx.snap +53 -0
  13. package/CloseButton/index.d.ts +7 -1
  14. package/CloseButton/index.js +4 -3
  15. package/CloseButton/index.test.js +8 -0
  16. package/Container/__snapshots__/index.test.tsx.snap +14 -4
  17. package/CopyToClipboardContainer/__snapshots__/index.spec.tsx.snap +21 -0
  18. package/CopyToClipboardContainer/index.d.ts +9 -1
  19. package/CopyToClipboardContainer/index.js +3 -2
  20. package/CopyToClipboardContainer/index.spec.js +8 -0
  21. package/DateInputContainer/__snapshots__/index.test.tsx.snap +17 -0
  22. package/DateInputContainer/index.d.ts +8 -1
  23. package/DateInputContainer/index.js +4 -3
  24. package/DateInputContainer/index.test.js +8 -0
  25. package/ErrorSummary/__snapshots__/index.test.tsx.snap +39 -0
  26. package/ErrorSummary/index.d.ts +8 -1
  27. package/ErrorSummary/index.js +4 -2
  28. package/ErrorSummary/index.test.js +8 -0
  29. package/ImageLogo/__snapshots__/index.test.tsx.snap +5 -3
  30. package/ModalContainer/index.d.ts +8 -1
  31. package/ModalContainer/index.js +3 -2
  32. package/Nav/__snapshots__/index.test.tsx.snap +91 -4
  33. package/Nav/index.d.ts +30 -15
  34. package/Nav/index.js +18 -9
  35. package/Nav/index.test.js +42 -0
  36. package/NavListItemAction/index.d.ts +1 -1
  37. package/NavListItemButton/index.d.ts +1 -1
  38. package/NavMenuContainer/__snapshots__/index.test.tsx.snap +104 -0
  39. package/NavMenuContainer/index.test.js +24 -0
  40. package/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +23 -0
  41. package/NotificationBannerContainer/index.d.ts +8 -1
  42. package/NotificationBannerContainer/index.js +3 -2
  43. package/NotificationBannerContainer/index.test.js +8 -0
  44. package/RadioContainer/__snapshots__/index.test.tsx.snap +17 -0
  45. package/RadioContainer/index.d.ts +8 -1
  46. package/RadioContainer/index.js +5 -4
  47. package/RadioContainer/index.test.js +8 -0
  48. package/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  49. package/SearchButton/index.d.ts +1 -1
  50. package/SelectContainer/__snapshots__/index.test.tsx.snap +17 -0
  51. package/SelectContainer/index.d.ts +8 -1
  52. package/SelectContainer/index.js +4 -3
  53. package/SelectContainer/index.test.js +9 -1
  54. package/SingleCharacterInput/index.d.ts +1 -1
  55. package/StepNav/__snapshots__/index.test.tsx.snap +2 -2
  56. package/Tabs/index.d.ts +2 -1
  57. package/Tabs/index.js +4 -3
  58. package/TaskList/__snapshots__/index.test.tsx.snap +2 -2
  59. package/TextArea/__snapshots__/index.test.tsx.snap +19 -0
  60. package/TextArea/index.d.ts +8 -1
  61. package/TextArea/index.js +6 -5
  62. package/TextArea/index.test.js +8 -0
  63. package/TextInput/__snapshots__/index.test.tsx.snap +17 -0
  64. package/TextInput/index.d.ts +8 -1
  65. package/TextInput/index.js +3 -2
  66. package/TextInput/index.test.js +91 -83
  67. package/WarningText/__snapshots__/index.test.tsx.snap +31 -0
  68. package/WarningText/index.d.ts +8 -1
  69. package/WarningText/index.js +3 -2
  70. package/WarningText/index.test.js +8 -0
  71. package/es/BottomInfo/__snapshots__/index.test.tsx.snap +7 -2
  72. package/es/BottomInfoContainer/__snapshots__/index.test.tsx.snap +7 -2
  73. package/es/Button/__snapshots__/index.test.tsx.snap +18 -0
  74. package/es/Button/index.js +3 -2
  75. package/es/Button/index.test.js +17 -9
  76. package/es/Checkbox/__snapshots__/index.test.tsx.snap +76 -0
  77. package/es/Checkbox/index.js +3 -2
  78. package/es/Checkbox/index.test.js +8 -0
  79. package/es/CloseButton/__snapshots__/index.test.tsx.snap +53 -0
  80. package/es/CloseButton/index.js +4 -3
  81. package/es/CloseButton/index.test.js +8 -0
  82. package/es/Container/__snapshots__/index.test.tsx.snap +14 -4
  83. package/es/CopyToClipboardContainer/__snapshots__/index.spec.tsx.snap +21 -0
  84. package/es/CopyToClipboardContainer/index.js +3 -2
  85. package/es/CopyToClipboardContainer/index.spec.js +8 -0
  86. package/es/DateInputContainer/__snapshots__/index.test.tsx.snap +17 -0
  87. package/es/DateInputContainer/index.js +4 -3
  88. package/es/DateInputContainer/index.test.js +8 -0
  89. package/es/ErrorSummary/__snapshots__/index.test.tsx.snap +39 -0
  90. package/es/ErrorSummary/index.js +4 -2
  91. package/es/ErrorSummary/index.test.js +8 -0
  92. package/es/ImageLogo/__snapshots__/index.test.tsx.snap +5 -3
  93. package/es/ModalContainer/index.js +3 -2
  94. package/es/Nav/__snapshots__/index.test.tsx.snap +91 -4
  95. package/es/Nav/index.js +17 -9
  96. package/es/Nav/index.test.js +42 -0
  97. package/es/NavMenuContainer/__snapshots__/index.test.tsx.snap +104 -0
  98. package/es/NavMenuContainer/index.test.js +24 -0
  99. package/es/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +23 -0
  100. package/es/NotificationBannerContainer/index.js +3 -2
  101. package/es/NotificationBannerContainer/index.test.js +8 -0
  102. package/es/RadioContainer/__snapshots__/index.test.tsx.snap +17 -0
  103. package/es/RadioContainer/index.js +5 -4
  104. package/es/RadioContainer/index.test.js +8 -0
  105. package/es/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  106. package/es/SelectContainer/__snapshots__/index.test.tsx.snap +17 -0
  107. package/es/SelectContainer/index.js +4 -3
  108. package/es/SelectContainer/index.test.js +9 -1
  109. package/es/StepNav/__snapshots__/index.test.tsx.snap +2 -2
  110. package/es/Tabs/index.js +4 -3
  111. package/es/TaskList/__snapshots__/index.test.tsx.snap +2 -2
  112. package/es/TextArea/__snapshots__/index.test.tsx.snap +19 -0
  113. package/es/TextArea/index.js +6 -5
  114. package/es/TextArea/index.test.js +8 -0
  115. package/es/TextInput/__snapshots__/index.test.tsx.snap +17 -0
  116. package/es/TextInput/index.js +3 -2
  117. package/es/TextInput/index.test.js +91 -83
  118. package/es/WarningText/__snapshots__/index.test.tsx.snap +31 -0
  119. package/es/WarningText/index.js +3 -2
  120. package/es/WarningText/index.test.js +8 -0
  121. package/esm/BottomInfo/__snapshots__/index.test.tsx.snap +7 -2
  122. package/esm/BottomInfoContainer/__snapshots__/index.test.tsx.snap +7 -2
  123. package/esm/Button/__snapshots__/index.test.tsx.snap +18 -0
  124. package/esm/Button/index.js +3 -2
  125. package/esm/Button/index.test.js +17 -9
  126. package/esm/Checkbox/__snapshots__/index.test.tsx.snap +76 -0
  127. package/esm/Checkbox/index.js +3 -2
  128. package/esm/Checkbox/index.test.js +8 -0
  129. package/esm/CloseButton/__snapshots__/index.test.tsx.snap +53 -0
  130. package/esm/CloseButton/index.js +4 -3
  131. package/esm/CloseButton/index.test.js +8 -0
  132. package/esm/Container/__snapshots__/index.test.tsx.snap +14 -4
  133. package/esm/CopyToClipboardContainer/__snapshots__/index.spec.tsx.snap +21 -0
  134. package/esm/CopyToClipboardContainer/index.js +3 -2
  135. package/esm/CopyToClipboardContainer/index.spec.js +8 -0
  136. package/esm/DateInputContainer/__snapshots__/index.test.tsx.snap +17 -0
  137. package/esm/DateInputContainer/index.js +4 -3
  138. package/esm/DateInputContainer/index.test.js +8 -0
  139. package/esm/ErrorSummary/__snapshots__/index.test.tsx.snap +39 -0
  140. package/esm/ErrorSummary/index.js +4 -2
  141. package/esm/ErrorSummary/index.test.js +8 -0
  142. package/esm/ImageLogo/__snapshots__/index.test.tsx.snap +5 -3
  143. package/esm/ModalContainer/index.js +3 -2
  144. package/esm/Nav/__snapshots__/index.test.tsx.snap +91 -4
  145. package/esm/Nav/index.js +17 -9
  146. package/esm/Nav/index.test.js +42 -0
  147. package/esm/NavMenuContainer/__snapshots__/index.test.tsx.snap +104 -0
  148. package/esm/NavMenuContainer/index.test.js +24 -0
  149. package/esm/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +23 -0
  150. package/esm/NotificationBannerContainer/index.js +3 -2
  151. package/esm/NotificationBannerContainer/index.test.js +8 -0
  152. package/esm/RadioContainer/__snapshots__/index.test.tsx.snap +17 -0
  153. package/esm/RadioContainer/index.js +5 -4
  154. package/esm/RadioContainer/index.test.js +8 -0
  155. package/esm/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  156. package/esm/SelectContainer/__snapshots__/index.test.tsx.snap +17 -0
  157. package/esm/SelectContainer/index.js +4 -3
  158. package/esm/SelectContainer/index.test.js +9 -1
  159. package/esm/StepNav/__snapshots__/index.test.tsx.snap +2 -2
  160. package/esm/Tabs/index.js +4 -3
  161. package/esm/TaskList/__snapshots__/index.test.tsx.snap +2 -2
  162. package/esm/TextArea/__snapshots__/index.test.tsx.snap +19 -0
  163. package/esm/TextArea/index.js +6 -5
  164. package/esm/TextArea/index.test.js +8 -0
  165. package/esm/TextInput/__snapshots__/index.test.tsx.snap +17 -0
  166. package/esm/TextInput/index.js +3 -2
  167. package/esm/TextInput/index.test.js +91 -83
  168. package/esm/WarningText/__snapshots__/index.test.tsx.snap +31 -0
  169. package/esm/WarningText/index.js +3 -2
  170. package/esm/WarningText/index.test.js +8 -0
  171. package/esm/index.js +1 -1
  172. package/package.json +3 -3
  173. package/src/BottomInfo/__snapshots__/index.test.tsx.snap +7 -2
  174. package/src/BottomInfoContainer/__snapshots__/index.test.tsx.snap +7 -2
  175. package/src/Button/__snapshots__/index.test.tsx.snap +18 -0
  176. package/src/Button/index.test.tsx +3 -0
  177. package/src/Button/index.tsx +9 -0
  178. package/src/Checkbox/__snapshots__/index.test.tsx.snap +76 -0
  179. package/src/Checkbox/index.test.tsx +10 -0
  180. package/src/Checkbox/index.tsx +9 -1
  181. package/src/CloseButton/__snapshots__/index.test.tsx.snap +53 -0
  182. package/src/CloseButton/index.test.tsx +3 -0
  183. package/src/CloseButton/index.tsx +10 -3
  184. package/src/Container/__snapshots__/index.test.tsx.snap +14 -4
  185. package/src/CopyToClipboardContainer/__snapshots__/index.spec.tsx.snap +21 -0
  186. package/src/CopyToClipboardContainer/index.spec.tsx +8 -2
  187. package/src/CopyToClipboardContainer/index.tsx +10 -1
  188. package/src/DateInputContainer/__snapshots__/index.test.tsx.snap +17 -0
  189. package/src/DateInputContainer/index.test.tsx +5 -0
  190. package/src/DateInputContainer/index.tsx +11 -2
  191. package/src/ErrorSummary/__snapshots__/index.test.tsx.snap +39 -0
  192. package/src/ErrorSummary/index.test.tsx +4 -0
  193. package/src/ErrorSummary/index.tsx +12 -5
  194. package/src/ImageLogo/__snapshots__/index.test.tsx.snap +5 -3
  195. package/src/ModalContainer/index.tsx +9 -1
  196. package/src/Nav/__snapshots__/index.test.tsx.snap +91 -4
  197. package/src/Nav/index.test.tsx +15 -0
  198. package/src/Nav/index.tsx +53 -20
  199. package/src/NavMenuContainer/__snapshots__/index.test.tsx.snap +104 -0
  200. package/src/NavMenuContainer/index.test.tsx +9 -0
  201. package/src/NotificationBannerContainer/__snapshots__/index.test.tsx.snap +23 -0
  202. package/src/NotificationBannerContainer/index.test.tsx +7 -0
  203. package/src/NotificationBannerContainer/index.tsx +9 -1
  204. package/src/RadioContainer/__snapshots__/index.test.tsx.snap +17 -0
  205. package/src/RadioContainer/index.test.tsx +3 -0
  206. package/src/RadioContainer/index.tsx +9 -1
  207. package/src/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  208. package/src/SelectContainer/__snapshots__/index.test.tsx.snap +17 -0
  209. package/src/SelectContainer/index.test.tsx +5 -0
  210. package/src/SelectContainer/index.tsx +11 -2
  211. package/src/StepNav/__snapshots__/index.test.tsx.snap +2 -2
  212. package/src/Tabs/index.tsx +5 -2
  213. package/src/TaskList/__snapshots__/index.test.tsx.snap +2 -2
  214. package/src/TextArea/__snapshots__/index.test.tsx.snap +19 -0
  215. package/src/TextArea/index.test.tsx +3 -0
  216. package/src/TextArea/index.tsx +11 -2
  217. package/src/TextInput/__snapshots__/index.test.tsx.snap +17 -0
  218. package/src/TextInput/index.test.tsx +3 -0
  219. package/src/TextInput/index.tsx +9 -0
  220. package/src/WarningText/__snapshots__/index.test.tsx.snap +31 -0
  221. package/src/WarningText/index.test.tsx +3 -0
  222. package/src/WarningText/index.tsx +9 -1
@@ -8,13 +8,18 @@ exports[`renders the BottomInfo with no props 1`] = `
8
8
  <ForwardRef(Grid)
9
9
  className="govgr-bottom-info govgr-container"
10
10
  container={true}
11
+ spacing={
12
+ Object {
13
+ "sm": 12,
14
+ }
15
+ }
11
16
  >
12
17
  <ForwardRef(Base)
13
18
  as="div"
14
- className="govgr-bottom-info govgr-container govgr-grid"
19
+ className="govgr-bottom-info govgr-container govgr-gap-sm-12 govgr-grid"
15
20
  >
16
21
  <div
17
- className="govgr-bottom-info govgr-container govgr-grid"
22
+ className="govgr-bottom-info govgr-container govgr-gap-sm-12 govgr-grid"
18
23
  >
19
24
  hello
20
25
  </div>
@@ -8,13 +8,18 @@ exports[`renders the BottomInfoContainer with no props 1`] = `
8
8
  <ForwardRef(Grid)
9
9
  className="govgr-bottom-info__container govgr-container"
10
10
  container={true}
11
+ spacing={
12
+ Object {
13
+ "sm": 12,
14
+ }
15
+ }
11
16
  >
12
17
  <ForwardRef(Base)
13
18
  as="div"
14
- className="govgr-bottom-info__container govgr-container govgr-grid"
19
+ className="govgr-bottom-info__container govgr-container govgr-gap-sm-12 govgr-grid"
15
20
  >
16
21
  <div
17
- className="govgr-bottom-info__container govgr-container govgr-grid"
22
+ className="govgr-bottom-info__container govgr-container govgr-gap-sm-12 govgr-grid"
18
23
  >
19
24
  hello
20
25
  </div>
@@ -137,6 +137,24 @@ exports[`renders the Button with color=warning with disabled=true 1`] = `
137
137
  </ForwardRef(Button)>
138
138
  `;
139
139
 
140
+ exports[`renders the Button with dense=true 1`] = `
141
+ <ForwardRef(Button)
142
+ dense={true}
143
+ >
144
+ <ForwardRef(Base)
145
+ as="button"
146
+ className="govgr-btn-primary govgr-btn govgr-btn--dense"
147
+ printHidden={true}
148
+ >
149
+ <button
150
+ className="govgr-btn-primary govgr-btn govgr-btn--dense govgr-print-hidden"
151
+ >
152
+ hello
153
+ </button>
154
+ </ForwardRef(Base)>
155
+ </ForwardRef(Button)>
156
+ `;
157
+
140
158
  exports[`renders the Button with disabled=false 1`] = `
141
159
  <ForwardRef(Button)
142
160
  disabled={false}
@@ -21,6 +21,9 @@ it('renders the Button with disabled=true', () => {
21
21
  it('renders the Button with disabled=false', () => {
22
22
  expect(mount(<Button disabled={false}>hello</Button>)).toMatchSnapshot();
23
23
  });
24
+ it('renders the Button with dense=true', () => {
25
+ expect(mount(<Button dense={true}>hello</Button>)).toMatchSnapshot();
26
+ });
24
27
  it('renders the Button with color=primary with disabled=true', () => {
25
28
  expect(
26
29
  mount(
@@ -22,6 +22,13 @@ export interface ButtonProps extends BaseProps<'button'> {
22
22
  * @default 'button'
23
23
  */
24
24
  variant?: 'link' | 'button';
25
+ /**
26
+ * dense is optional.
27
+ * @value true Button will be dense.
28
+ * @value false
29
+ * @default false
30
+ */
31
+ dense?: boolean;
25
32
  }
26
33
  /**
27
34
  * Use the Button component to help users carry out an action.
@@ -31,6 +38,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
31
38
  {
32
39
  color = 'primary',
33
40
  variant = 'button',
41
+ dense,
34
42
  disabled,
35
43
  printHidden = true,
36
44
  className,
@@ -48,6 +56,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
48
56
  className={clsx(className, {
49
57
  'govgr-link': variant === 'link',
50
58
  'govgr-btn': variant === 'button',
59
+ 'govgr-btn--dense': dense,
51
60
  'govgr-btn-primary': variant === 'button' && color === 'primary',
52
61
  'govgr-btn-secondary': variant === 'button' && color === 'secondary',
53
62
  'govgr-btn-warning': variant === 'button' && color === 'warning',
@@ -1,5 +1,81 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the Checkbox with dense prop and CheckboxItems 1`] = `
4
+ <ForwardRef(Checkbox)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="div"
9
+ className="govgr-checkboxes--dense govgr-checkboxes"
10
+ >
11
+ <div
12
+ className="govgr-checkboxes--dense govgr-checkboxes"
13
+ >
14
+ <ForwardRef(CheckboxItem)>
15
+ <div
16
+ className="govgr-checkboxes__item"
17
+ >
18
+ <ForwardRef(LabelContainer)
19
+ className="govgr-checkboxes__label"
20
+ >
21
+ <ForwardRef(Base)
22
+ as="label"
23
+ className="govgr-checkboxes__label govgr-label"
24
+ >
25
+ <label
26
+ className="govgr-checkboxes__label govgr-label"
27
+ >
28
+ This is item 1
29
+ <ForwardRef(Base)
30
+ as="input"
31
+ className="govgr-checkboxes__input"
32
+ type="checkbox"
33
+ >
34
+ <input
35
+ className="govgr-checkboxes__input"
36
+ type="checkbox"
37
+ />
38
+ </ForwardRef(Base)>
39
+ </label>
40
+ </ForwardRef(Base)>
41
+ </ForwardRef(LabelContainer)>
42
+ </div>
43
+ </ForwardRef(CheckboxItem)>
44
+ <ForwardRef(CheckboxItem)>
45
+ <div
46
+ className="govgr-checkboxes__item"
47
+ >
48
+ <ForwardRef(LabelContainer)
49
+ className="govgr-checkboxes__label"
50
+ >
51
+ <ForwardRef(Base)
52
+ as="label"
53
+ className="govgr-checkboxes__label govgr-label"
54
+ >
55
+ <label
56
+ className="govgr-checkboxes__label govgr-label"
57
+ >
58
+ This is item 2
59
+ <ForwardRef(Base)
60
+ as="input"
61
+ className="govgr-checkboxes__input"
62
+ type="checkbox"
63
+ >
64
+ <input
65
+ className="govgr-checkboxes__input"
66
+ type="checkbox"
67
+ />
68
+ </ForwardRef(Base)>
69
+ </label>
70
+ </ForwardRef(Base)>
71
+ </ForwardRef(LabelContainer)>
72
+ </div>
73
+ </ForwardRef(CheckboxItem)>
74
+ </div>
75
+ </ForwardRef(Base)>
76
+ </ForwardRef(Checkbox)>
77
+ `;
78
+
3
79
  exports[`renders the Checkbox with layout=horizontal and CheckboxItems 1`] = `
4
80
  <ForwardRef(Checkbox)
5
81
  layout="horizontal"
@@ -27,3 +27,13 @@ it('renders the Checkbox with layout=horizontal and CheckboxItems', () => {
27
27
  )
28
28
  ).toMatchSnapshot();
29
29
  });
30
+ it('renders the Checkbox with dense prop and CheckboxItems', () => {
31
+ expect(
32
+ mount(
33
+ <Checkbox dense>
34
+ <CheckboxItem>This is item 1</CheckboxItem>
35
+ <CheckboxItem>This is item 2</CheckboxItem>
36
+ </Checkbox>
37
+ )
38
+ ).toMatchSnapshot();
39
+ });
@@ -12,6 +12,13 @@ export interface CheckboxProps extends BaseProps<'div'> {
12
12
  * @default 'vertical'
13
13
  */
14
14
  layout?: 'horizontal' | 'vertical';
15
+ /**
16
+ * dense is optional.
17
+ * @value true Checkboxes will be dense.
18
+ * @value false
19
+ * @default false
20
+ */
21
+ dense?: boolean;
15
22
  }
16
23
  /**
17
24
  * Details for the Checkbox.
@@ -19,7 +26,7 @@ export interface CheckboxProps extends BaseProps<'div'> {
19
26
  * It takes CheckboxItem as children
20
27
  */
21
28
  export const Checkbox = React.forwardRef<HTMLDivElement, CheckboxProps>(
22
- function Checkbox({ layout, className, children, ...props }, ref) {
29
+ function Checkbox({ layout, dense, className, children, ...props }, ref) {
23
30
  return (
24
31
  <Base
25
32
  as="div"
@@ -27,6 +34,7 @@ export const Checkbox = React.forwardRef<HTMLDivElement, CheckboxProps>(
27
34
  className={clsx(className, {
28
35
  'govgr-checkboxes': true,
29
36
  'govgr-checkboxes--horizontal': layout=== 'horizontal',
37
+ 'govgr-checkboxes--dense': dense,
30
38
  })}
31
39
  {...props}
32
40
  >
@@ -49,3 +49,56 @@ exports[`renders the CloseButton 1`] = `
49
49
  </ForwardRef(Button)>
50
50
  </ForwardRef(CloseButton)>
51
51
  `;
52
+
53
+ exports[`renders the CloseButton with label prop 1`] = `
54
+ <ForwardRef(CloseButton)
55
+ label="Κλείσιμο"
56
+ >
57
+ <ForwardRef(Button)
58
+ className="govgr-close-btn"
59
+ variant="link"
60
+ >
61
+ <ForwardRef(Base)
62
+ as="button"
63
+ className="govgr-close-btn govgr-link"
64
+ printHidden={true}
65
+ >
66
+ <button
67
+ className="govgr-close-btn govgr-link govgr-print-hidden"
68
+ >
69
+ Κλείσιμο
70
+ <CloseIcon>
71
+ <ForwardRef(Icon)
72
+ icon="close"
73
+ >
74
+ <ForwardRef(SvgIcon)
75
+ className="govgr-svg-icon--close"
76
+ >
77
+ <ForwardRef(Base)
78
+ aria-hidden="true"
79
+ as="svg"
80
+ className="govgr-svg-icon--close govgr-svg-icon"
81
+ focusable="false"
82
+ viewBox="0 0 24 24"
83
+ >
84
+ <svg
85
+ aria-hidden="true"
86
+ className="govgr-svg-icon--close govgr-svg-icon"
87
+ focusable="false"
88
+ viewBox="0 0 24 24"
89
+ >
90
+ <close>
91
+ <polygon
92
+ points="14.4,11.8 22,4.2 19.7,1.8 12,9.4 4.4,1.8 2,4.2 9.7,11.9 2.1,19.5 4.4,21.9 12.1,14.3 19.7,21.9 22.1,19.5 "
93
+ />
94
+ </close>
95
+ </svg>
96
+ </ForwardRef(Base)>
97
+ </ForwardRef(SvgIcon)>
98
+ </ForwardRef(Icon)>
99
+ </CloseIcon>
100
+ </button>
101
+ </ForwardRef(Base)>
102
+ </ForwardRef(Button)>
103
+ </ForwardRef(CloseButton)>
104
+ `;
@@ -6,3 +6,6 @@ import CloseButton from '@digigov/react-core/CloseButton';
6
6
  it('renders the CloseButton', () => {
7
7
  expect(mount(<CloseButton />)).toMatchSnapshot();
8
8
  });
9
+ it('renders the CloseButton with label prop', () => {
10
+ expect(mount(<CloseButton label="Κλείσιμο"/>)).toMatchSnapshot();
11
+ });
@@ -3,14 +3,21 @@ import clsx from 'clsx';
3
3
  import Button, { ButtonProps } from '@digigov/react-core/Button';
4
4
  import { CloseIcon } from '@digigov/react-icons/CloseIcon';
5
5
 
6
- export interface CloseButtonProps extends ButtonProps {}
6
+ export interface CloseButtonProps extends ButtonProps {
7
+ /**
8
+ * label is optional.
9
+ * If empty, the CloseButton will only have a close icon.
10
+ * Use this prop to add text beside the close icon. For example: 'Κλείσιμο'.
11
+ */
12
+ label?: string;
13
+ }
7
14
  /**
8
15
  * CloseButton is an <button> element. It can be used be inside the FilterSection component.
9
16
  */
10
17
  export const CloseButton = React.forwardRef<
11
18
  HTMLButtonElement,
12
19
  CloseButtonProps
13
- >(function CloseButton({ className, children, ...props }, ref) {
20
+ >(function CloseButton({ label, className, children, ...props }, ref) {
14
21
  return (
15
22
  <Button
16
23
  variant="link"
@@ -20,7 +27,7 @@ export const CloseButton = React.forwardRef<
20
27
  ref={ref}
21
28
  {...props}
22
29
  >
23
- {children}
30
+ {label || children}
24
31
  <CloseIcon />
25
32
  </Button>
26
33
  );
@@ -30,13 +30,18 @@ exports[`renders the Container with fullWidth prop 1`] = `
30
30
  <ForwardRef(Grid)
31
31
  className="govgr-container--full-width govgr-container"
32
32
  container={true}
33
+ spacing={
34
+ Object {
35
+ "sm": 12,
36
+ }
37
+ }
33
38
  >
34
39
  <ForwardRef(Base)
35
40
  as="div"
36
- className="govgr-container--full-width govgr-container govgr-grid"
41
+ className="govgr-container--full-width govgr-container govgr-gap-sm-12 govgr-grid"
37
42
  >
38
43
  <div
39
- className="govgr-container--full-width govgr-container govgr-grid"
44
+ className="govgr-container--full-width govgr-container govgr-gap-sm-12 govgr-grid"
40
45
  >
41
46
  hello
42
47
  </div>
@@ -50,13 +55,18 @@ exports[`renders the Container with no props 1`] = `
50
55
  <ForwardRef(Grid)
51
56
  className="govgr-container"
52
57
  container={true}
58
+ spacing={
59
+ Object {
60
+ "sm": 12,
61
+ }
62
+ }
53
63
  >
54
64
  <ForwardRef(Base)
55
65
  as="div"
56
- className="govgr-container govgr-grid"
66
+ className="govgr-container govgr-gap-sm-12 govgr-grid"
57
67
  >
58
68
  <div
59
- className="govgr-container govgr-grid"
69
+ className="govgr-container govgr-gap-sm-12 govgr-grid"
60
70
  >
61
71
  hello
62
72
  </div>
@@ -1,5 +1,26 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the CopyToClipboardContainer with dense=true 1`] = `
4
+ <ForwardRef(CopyToClipboardContainer)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="div"
9
+ className="govgr-copy-to-clipboard"
10
+ >
11
+ <div
12
+ className="govgr-copy-to-clipboard"
13
+ >
14
+ <div
15
+ className="govgr-copy-to-clipboard__tooltip--right govgr-copy-to-clipboard__tooltip--dense govgr-copy-to-clipboard__tooltip"
16
+ >
17
+ Text copied!
18
+ </div>
19
+ </div>
20
+ </ForwardRef(Base)>
21
+ </ForwardRef(CopyToClipboardContainer)>
22
+ `;
23
+
3
24
  exports[`renders the CopyToClipboardContainer with no props 1`] = `
4
25
  <ForwardRef(CopyToClipboardContainer)>
5
26
  <ForwardRef(Base)
@@ -11,8 +11,7 @@ it('renders the CopyToClipboardContainer with no props', () => {
11
11
  it('renders the CopyToClipboardContainer with variant=tooltip', () => {
12
12
  expect(
13
13
  mount(
14
- <CopyToClipboardContainer variant="tooltip"
15
- tooltipAlign="right">
14
+ <CopyToClipboardContainer variant="tooltip" tooltipAlign="right">
16
15
  Text copied!
17
16
  </CopyToClipboardContainer>
18
17
  )
@@ -27,3 +26,10 @@ it('renders the CopyToClipboardContainer with variant=banner', () => {
27
26
  )
28
27
  ).toMatchSnapshot();
29
28
  });
29
+ it('renders the CopyToClipboardContainer with dense=true', () => {
30
+ expect(
31
+ mount(
32
+ <CopyToClipboardContainer dense>Text copied!</CopyToClipboardContainer>
33
+ )
34
+ ).toMatchSnapshot();
35
+ });
@@ -17,6 +17,14 @@ export interface CopyToClipboardContainerProps extends BaseProps<'div'> {
17
17
  * @default 'right'
18
18
  */
19
19
  tooltipAlign?: 'right' | 'left';
20
+ /**
21
+ * dense is optional.
22
+ * affects only the density of the tooltip.
23
+ * @value true tooltip will be dense.
24
+ * @value false
25
+ * @default false
26
+ * */
27
+ dense?: boolean;
20
28
  }
21
29
  /**
22
30
  * CopyToClipboardContainer is a wrapper component for CopyToClipboardMessage
@@ -25,7 +33,7 @@ export const CopyToClipboardContainer = React.forwardRef<
25
33
  HTMLDivElement,
26
34
  CopyToClipboardContainerProps
27
35
  >(function CopyToClipboardContainer(
28
- { variant = 'tooltip', tooltipAlign = 'right', className, children, ...props },
36
+ { variant = 'tooltip', tooltipAlign = 'right', className, dense, children, ...props },
29
37
  ref
30
38
  ) {
31
39
  return (
@@ -41,6 +49,7 @@ export const CopyToClipboardContainer = React.forwardRef<
41
49
  <div
42
50
  className={clsx(className, {
43
51
  'govgr-copy-to-clipboard__tooltip': variant === 'tooltip',
52
+ 'govgr-copy-to-clipboard__tooltip--dense': variant === 'tooltip' && dense,
44
53
  'govgr-copy-to-clipboard__tooltip--left': variant === 'tooltip' && tooltipAlign === 'left',
45
54
  'govgr-copy-to-clipboard__tooltip--right': variant === 'tooltip' && tooltipAlign === 'right',
46
55
  'govgr-copy-to-clipboard__banner': variant === 'banner',
@@ -1,5 +1,22 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the DateInputContainer with dense prop 1`] = `
4
+ <ForwardRef(DateInputContainer)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(Base)
8
+ as="div"
9
+ className="govgr-date-input--dense govgr-date-input"
10
+ >
11
+ <div
12
+ className="govgr-date-input--dense govgr-date-input"
13
+ >
14
+ hello
15
+ </div>
16
+ </ForwardRef(Base)>
17
+ </ForwardRef(DateInputContainer)>
18
+ `;
19
+
3
20
  exports[`renders the DateInputContainer with no props 1`] = `
4
21
  <ForwardRef(DateInputContainer)>
5
22
  <ForwardRef(Base)
@@ -8,3 +8,8 @@ it('renders the DateInputContainer with no props', () => {
8
8
  mount(<DateInputContainer>hello</DateInputContainer>)
9
9
  ).toMatchSnapshot();
10
10
  });
11
+ it('renders the DateInputContainer with dense prop', () => {
12
+ expect(
13
+ mount(<DateInputContainer dense>hello</DateInputContainer>)
14
+ ).toMatchSnapshot();
15
+ });
@@ -2,7 +2,15 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import Base, { BaseProps } from '@digigov/react-core/Base';
4
4
 
5
- export interface DateInputContainerProps extends BaseProps<'div'> {}
5
+ export interface DateInputContainerProps extends BaseProps<'div'> {
6
+ /**
7
+ * dense is optional.
8
+ * @value true DateInputs will be dense.
9
+ * @value false
10
+ * @default false
11
+ */
12
+ dense?: boolean;
13
+ }
6
14
  /**
7
15
  * Details for the DateInputContainer.
8
16
  * DateInputContainer component is used for helping users enter a memorable date or one they can easily look up
@@ -12,13 +20,14 @@ export interface DateInputContainerProps extends BaseProps<'div'> {}
12
20
  export const DateInputContainer = React.forwardRef<
13
21
  HTMLDivElement,
14
22
  DateInputContainerProps
15
- >(function DateInputContainer({ className, children, ...props }, ref) {
23
+ >(function DateInputContainer({ dense, className, children, ...props }, ref) {
16
24
  return (
17
25
  <Base
18
26
  as="div"
19
27
  ref={ref}
20
28
  className={clsx(className, {
21
29
  'govgr-date-input': true,
30
+ 'govgr-date-input--dense': dense,
22
31
  })}
23
32
  {...props}
24
33
  >
@@ -1,5 +1,44 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`renders the ErrorSummary with dense=true 1`] = `
4
+ <ForwardRef(ErrorSummary)
5
+ dense={true}
6
+ >
7
+ <ForwardRef(NotificationBannerContainer)
8
+ dense={true}
9
+ variant="error"
10
+ >
11
+ <ForwardRef(Base)
12
+ aria-labelledby="govgr-notification-banner-title"
13
+ as="div"
14
+ className="govgr-notification-banner--error govgr-notification-banner--dense govgr-notification-banner"
15
+ data-module="govgr-notification-banner"
16
+ role="region"
17
+ >
18
+ <div
19
+ aria-labelledby="govgr-notification-banner-title"
20
+ className="govgr-notification-banner--error govgr-notification-banner--dense govgr-notification-banner"
21
+ data-module="govgr-notification-banner"
22
+ role="region"
23
+ >
24
+ <ForwardRef(NotificationBannerContent)>
25
+ <ForwardRef(Base)
26
+ as="div"
27
+ className="govgr-notification-banner__content"
28
+ >
29
+ <div
30
+ className="govgr-notification-banner__content"
31
+ >
32
+ hello
33
+ </div>
34
+ </ForwardRef(Base)>
35
+ </ForwardRef(NotificationBannerContent)>
36
+ </div>
37
+ </ForwardRef(Base)>
38
+ </ForwardRef(NotificationBannerContainer)>
39
+ </ForwardRef(ErrorSummary)>
40
+ `;
41
+
3
42
  exports[`renders the ErrorSummary with no props 1`] = `
4
43
  <ForwardRef(ErrorSummary)>
5
44
  <ForwardRef(NotificationBannerContainer)
@@ -6,3 +6,7 @@ import ErrorSummary from '@digigov/react-core/ErrorSummary';
6
6
  it('renders the ErrorSummary with no props', () => {
7
7
  expect(mount(<ErrorSummary>hello</ErrorSummary>)).toMatchSnapshot();
8
8
  });
9
+
10
+ it('renders the ErrorSummary with dense=true', () => {
11
+ expect(mount(<ErrorSummary dense>hello</ErrorSummary>)).toMatchSnapshot();
12
+ });
@@ -3,22 +3,29 @@ import { BaseProps } from '@digigov/react-core/Base';
3
3
  import NotificationBannerContainer from '@digigov/react-core/NotificationBannerContainer';
4
4
  import NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';
5
5
 
6
- export interface ErrorSummaryProps extends BaseProps<'div'> { }
6
+ export interface ErrorSummaryProps extends BaseProps<'div'> {
7
+ /**
8
+ * dense is optional.
9
+ * @value true ErrorSummary will be dense.
10
+ * @value false
11
+ * @default false
12
+ * */
13
+ dense?: boolean;
14
+ }
7
15
  /**
8
16
  * Use this component at the top of a page to summarize any errors a user has made.
9
17
  */
10
18
  export const ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(
11
- function ErrorSummary({ className, children, ...props }, ref) {
19
+ function ErrorSummary({ className, dense, children, ...props }, ref) {
12
20
  return (
13
21
  <NotificationBannerContainer
14
22
  variant={'error'}
15
23
  className={className}
16
24
  ref={ref}
25
+ dense={dense}
17
26
  {...props}
18
27
  >
19
- <NotificationBannerContent>
20
- {children}
21
- </NotificationBannerContent>
28
+ <NotificationBannerContent>{children}</NotificationBannerContent>
22
29
  </NotificationBannerContainer>
23
30
  );
24
31
  }
@@ -8,10 +8,11 @@ exports[`renders the Hint with variant and src props 1`] = `
8
8
  <ForwardRef(Base)
9
9
  as="img"
10
10
  className="govgr-image-logo--dark"
11
+ printHidden={true}
11
12
  src="logo.png"
12
13
  >
13
14
  <img
14
- className="govgr-image-logo--dark"
15
+ className="govgr-image-logo--dark govgr-print-hidden"
15
16
  src="logo.png"
16
17
  />
17
18
  </ForwardRef(Base)>
@@ -24,11 +25,12 @@ exports[`renders the Hint with src prop 1`] = `
24
25
  >
25
26
  <ForwardRef(Base)
26
27
  as="img"
27
- className="govgr-image-logo--light"
28
+ className="govgr-image-logo"
29
+ printHidden={true}
28
30
  src="logo.png"
29
31
  >
30
32
  <img
31
- className="govgr-image-logo--light"
33
+ className="govgr-image-logo govgr-print-hidden"
32
34
  src="logo.png"
33
35
  />
34
36
  </ForwardRef(Base)>
@@ -8,6 +8,13 @@ export interface ModalContainerProps extends BaseProps<'div'> {
8
8
  * @value false
9
9
  */
10
10
  open?: boolean
11
+ /**
12
+ * dense is optional.
13
+ * @value true ModalContainer and its children will be dense.
14
+ * @value false
15
+ * @default false
16
+ */
17
+ dense?: boolean;
11
18
  }
12
19
  /**
13
20
  * Modals can be used to open a pop-up dialog box and provide critical information
@@ -18,7 +25,7 @@ export interface ModalContainerProps extends BaseProps<'div'> {
18
25
  export const ModalContainer = React.forwardRef<
19
26
  HTMLDivElement,
20
27
  ModalContainerProps
21
- >(function ModalContainer({ className, children, open, ...props }, ref) {
28
+ >(function ModalContainer({ className, children, open, dense, ...props }, ref) {
22
29
  return (
23
30
  <Base
24
31
  as="div"
@@ -26,6 +33,7 @@ export const ModalContainer = React.forwardRef<
26
33
  className={clsx(className, {
27
34
  'govgr-modal': true,
28
35
  'govgr-modal--open': open,
36
+ 'govgr-modal--dense': dense,
29
37
  })}
30
38
  {...props}
31
39
  >