@digigov/react-core 0.20.1 → 0.21.1

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 (48) hide show
  1. package/AccordionSection/index.d.ts +6 -1
  2. package/AccordionSection/index.js +4 -2
  3. package/CHANGELOG.md +15 -1
  4. package/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  5. package/CheckboxItem/index.d.ts +5 -0
  6. package/CheckboxItem/index.js +6 -3
  7. package/CheckboxItem/index.test.js +18 -0
  8. package/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  9. package/RadioItem/index.d.ts +5 -0
  10. package/RadioItem/index.js +6 -3
  11. package/RadioItem/index.test.js +18 -0
  12. package/TableBody/index.d.ts +6 -1
  13. package/TableBody/index.js +5 -3
  14. package/TableRow/index.d.ts +6 -1
  15. package/TableRow/index.js +5 -3
  16. package/Unpurge/index.js +1 -1
  17. package/es/AccordionSection/index.js +4 -2
  18. package/es/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  19. package/es/CheckboxItem/index.js +6 -3
  20. package/es/CheckboxItem/index.test.js +18 -0
  21. package/es/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  22. package/es/RadioItem/index.js +6 -3
  23. package/es/RadioItem/index.test.js +18 -0
  24. package/es/TableBody/index.js +5 -3
  25. package/es/TableRow/index.js +5 -3
  26. package/es/Unpurge/index.js +1 -1
  27. package/esm/AccordionSection/index.js +4 -2
  28. package/esm/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  29. package/esm/CheckboxItem/index.js +6 -3
  30. package/esm/CheckboxItem/index.test.js +18 -0
  31. package/esm/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  32. package/esm/RadioItem/index.js +6 -3
  33. package/esm/RadioItem/index.test.js +18 -0
  34. package/esm/TableBody/index.js +5 -3
  35. package/esm/TableRow/index.js +5 -3
  36. package/esm/Unpurge/index.js +1 -1
  37. package/esm/index.js +1 -1
  38. package/package.json +2 -2
  39. package/src/AccordionSection/index.tsx +11 -1
  40. package/src/CheckboxItem/__snapshots__/index.test.tsx.snap +68 -0
  41. package/src/CheckboxItem/index.test.tsx +14 -0
  42. package/src/CheckboxItem/index.tsx +11 -1
  43. package/src/RadioItem/__snapshots__/index.test.tsx.snap +70 -0
  44. package/src/RadioItem/index.test.tsx +14 -0
  45. package/src/RadioItem/index.tsx +11 -1
  46. package/src/TableBody/index.tsx +13 -2
  47. package/src/TableRow/index.tsx +9 -2
  48. package/src/Unpurge/index.tsx +35 -5
@@ -2,20 +2,31 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface TableBodyProps extends BaseProps<'tbody'> {}
5
+ export interface TableBodyProps extends BaseProps<'tbody'> {
6
+ /**
7
+ * verticalAlign is optional. Default value is 'middle'.
8
+ * This prop set the vertical align of the body's content.
9
+ */
10
+ verticalAlign?: 'middle' | 'top' | 'bottom';
11
+ }
6
12
  /**
7
13
  * Use TableBody inside the Table component to provide for the table data.
8
14
  */
9
15
  export const TableBody = React.forwardRef<
10
16
  HTMLTableSectionElement,
11
17
  TableBodyProps
12
- >(function TableBody({ className, children, ...props }, ref) {
18
+ >(function TableBody(
19
+ { verticalAlign = 'middle', className, children, ...props },
20
+ ref
21
+ ) {
13
22
  return (
14
23
  <Base
15
24
  as="tbody"
16
25
  ref={ref}
17
26
  className={clsx(className, {
18
27
  'govgr-table__body': true,
28
+ 'govgr-table__body--vertical-top': verticalAlign === 'top',
29
+ 'govgr-table__body--vertical-bottom': verticalAlign === 'bottom',
19
30
  })}
20
31
  {...props}
21
32
  >
@@ -2,18 +2,25 @@ import React from 'react';
2
2
  import Base, { BaseProps } from '@digigov/react-core/Base';
3
3
  import clsx from 'clsx';
4
4
 
5
- export interface TableRowProps extends BaseProps<'tr'> {}
5
+ export interface TableRowProps extends BaseProps<'tr'> {
6
+ /**
7
+ * warning is optional. Default value is false.
8
+ * Add the warning prop to add a warning line on the left of the row.
9
+ */
10
+ warning?: boolean;
11
+ }
6
12
  /**
7
13
  * Use TableRow inside the Table component to provide a new row to the table.
8
14
  */
9
15
  export const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
10
- function TableRow({ className, children, ...props }, ref) {
16
+ function TableRow({ warning=false, className, children, ...props }, ref) {
11
17
  return (
12
18
  <Base
13
19
  as="tr"
14
20
  ref={ref}
15
21
  className={clsx(className, {
16
22
  'govgr-table__row': true,
23
+ 'govgr-table__row--warning': warning,
17
24
  })}
18
25
  {...props}
19
26
  >
@@ -89,21 +89,51 @@ function Unpurge() {
89
89
  govgr-mb-8
90
90
  govgr-mr-8
91
91
  govgr-ml-8
92
- govgr-p-8
93
- govgr-pt-8
94
- govgr-pb-8
95
- govgr-pr-8
96
- govgr-pl-8
97
92
  govgr-m-9
98
93
  govgr-mt-9
99
94
  govgr-mb-9
100
95
  govgr-mr-9
101
96
  govgr-ml-9
97
+ govgr-m-10
98
+ govgr-mt-10
99
+ govgr-mb-10
100
+ govgr-mr-10
101
+ govgr-ml-10
102
+ govgr-m-11
103
+ govgr-mt-11
104
+ govgr-mb-11
105
+ govgr-mr-11
106
+ govgr-ml-11
107
+ govgr-m-12
108
+ govgr-mt-12
109
+ govgr-mb-12
110
+ govgr-mr-12
111
+ govgr-ml-12
112
+ govgr-p-8
113
+ govgr-pt-8
114
+ govgr-pb-8
115
+ govgr-pr-8
116
+ govgr-pl-8
102
117
  govgr-p-9
103
118
  govgr-pt-9
104
119
  govgr-pb-9
105
120
  govgr-pr-9
106
121
  govgr-pl-9
122
+ govgr-p-10
123
+ govgr-pt-10
124
+ govgr-pb-10
125
+ govgr-pr-10
126
+ govgr-pl-10
127
+ govgr-p-11
128
+ govgr-pt-11
129
+ govgr-pb-11
130
+ govgr-pr-11
131
+ govgr-pl-11
132
+ govgr-p-12
133
+ govgr-pt-12
134
+ govgr-pb-12
135
+ govgr-pr-12
136
+ govgr-pl-12
107
137
  govgr-print-hidden
108
138
  `}
109
139
  ></div>