@digigov/react-core 2.0.0-e7d30530 → 2.0.0-eaf330f5
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.
- package/Accordion/index.native.d.ts +5 -1
- package/AccordionSection/index.native.d.ts +3 -1
- package/AutoCompleteInputTypeahead/index.d.ts +11 -0
- package/AutoCompleteInputTypeahead/index.js +25 -0
- package/AutoCompleteInputTypeahead/index.js.map +7 -0
- package/AutoCompleteInputTypeahead/package.json +6 -0
- package/Base/compat/Input/CheckboxInput.native.js.map +2 -2
- package/Base/compat/Input/RadioInput.native.js.map +2 -2
- package/Base/index.native.js.map +2 -2
- package/Base/index.web.js.map +1 -1
- package/Base/mapping.native.d.ts +1 -1
- package/Base/mapping.native.js.map +2 -2
- package/{CircularProgressBase → CircularProgress}/index.d.ts +5 -5
- package/{CircularProgressBase → CircularProgress}/index.js +4 -4
- package/CircularProgress/index.js.map +7 -0
- package/CircularProgress/index.test.d.ts +1 -0
- package/{CircularProgressBase → CircularProgress}/package.json +1 -1
- package/CopyToClipboardMessage/index.native.d.ts +3 -1
- package/DateInputItem/index.native.d.ts +3 -1
- package/Details/index.native.d.ts +3 -1
- package/LinkBase/index.js +1 -1
- package/LinkBase/index.js.map +2 -2
- package/NavListItemActionContainer/index.native.d.ts +2 -0
- package/NotificationBannerLink/index.native.d.ts +3 -1
- package/TextArea/index.native.d.ts +3 -1
- package/TextInput/index.native.d.ts +3 -1
- package/Typography/index.d.ts +1 -1
- package/Typography/index.js +17 -15
- package/Typography/index.js.map +2 -2
- package/cjs/AutoCompleteInputTypeahead/index.js +58 -0
- package/cjs/AutoCompleteInputTypeahead/index.js.map +7 -0
- package/cjs/Base/compat/Input/CheckboxInput.native.js.map +2 -2
- package/cjs/Base/compat/Input/RadioInput.native.js.map +2 -2
- package/cjs/Base/index.native.js.map +2 -2
- package/cjs/Base/index.web.js.map +1 -1
- package/cjs/Base/mapping.native.js.map +2 -2
- package/cjs/{CircularProgressBase → CircularProgress}/index.js +8 -8
- package/cjs/CircularProgress/index.js.map +7 -0
- package/cjs/LinkBase/index.js +1 -1
- package/cjs/LinkBase/index.js.map +2 -2
- package/cjs/Typography/index.js +17 -15
- package/cjs/Typography/index.js.map +2 -2
- package/cjs/index.js +4 -2
- package/cjs/index.js.map +2 -2
- package/cjs/lazy/index.js +2 -1
- package/cjs/lazy.js.map +2 -2
- package/cjs/registry/index.js +8 -6
- package/cjs/registry.js.map +2 -2
- package/cjs/utils/index.native/index.js +34 -32
- package/cjs/utils/index.native.js.map +2 -2
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/index.js.map +2 -2
- package/lazy/index.js +2 -1
- package/package.json +5 -5
- package/registry/index.js +8 -6
- package/src/AutoCompleteInputTypeahead/__snapshots__/index.test.tsx.snap +16 -0
- package/src/AutoCompleteInputTypeahead/index.test.tsx +8 -0
- package/src/AutoCompleteInputTypeahead/index.tsx +32 -0
- package/src/Base/compat/Input/CheckboxInput.native.tsx +6 -2
- package/src/Base/compat/Input/RadioInput.native.tsx +6 -2
- package/src/Base/index.native.tsx +2 -2
- package/src/Base/index.web.tsx +1 -1
- package/src/Base/mapping.native.tsx +1 -1
- package/src/Checkbox/__snapshots__/index.test.tsx.snap +5 -0
- package/src/CheckboxItem/__snapshots__/index.test.tsx.snap +4 -0
- package/src/{CircularProgressBase → CircularProgress}/__snapshots__/index.test.tsx.snap +6 -6
- package/src/CircularProgress/index.test.tsx +34 -0
- package/src/{CircularProgressBase → CircularProgress}/index.tsx +7 -7
- package/src/LinkBase/index.tsx +1 -1
- package/src/RadioItem/__snapshots__/index.test.tsx.snap +4 -0
- package/src/TableDataCell/__snapshots__/index.test.tsx.snap +2 -2
- package/src/Typography/index.tsx +20 -21
- package/src/index.ts +2 -1
- package/src/lazy.js +2 -1
- package/src/registry.js +8 -6
- package/src/utils/index.native.tsx +54 -56
- package/utils/index.native/index.js +34 -32
- package/utils/index.native.d.ts +6 -3
- package/utils/index.native.js.map +2 -2
- package/CircularProgressBase/index.js.map +0 -7
- package/cjs/CircularProgressBase/index.js.map +0 -7
- package/src/CircularProgressBase/index.test.tsx +0 -38
- /package/{CircularProgressBase → AutoCompleteInputTypeahead}/index.test.d.ts +0 -0
package/lazy/index.js
CHANGED
|
@@ -152,6 +152,7 @@ export default {
|
|
|
152
152
|
'AdminMain': lazy(() => import('@digigov/react-core/AdminMain').then((module) => ({ default: module['AdminMain'] }))),
|
|
153
153
|
'AdminTopSection': lazy(() => import('@digigov/react-core/AdminTopSection').then((module) => ({ default: module['AdminTopSection'] }))),
|
|
154
154
|
'AutoCompleteInputBase': lazy(() => import('@digigov/react-core/AutoCompleteInputBase').then((module) => ({ default: module['AutoCompleteInputBase'] }))),
|
|
155
|
+
'AutoCompleteInputTypeahead': lazy(() => import('@digigov/react-core/AutoCompleteInputTypeahead').then((module) => ({ default: module['AutoCompleteInputTypeahead'] }))),
|
|
155
156
|
'AutoCompleteResultList': lazy(() => import('@digigov/react-core/AutoCompleteResultList').then((module) => ({ default: module['AutoCompleteResultList'] }))),
|
|
156
157
|
'AutoCompleteResultListItem': lazy(() => import('@digigov/react-core/AutoCompleteResultListItem').then((module) => ({ default: module['AutoCompleteResultListItem'] }))),
|
|
157
158
|
'AutoCompleteContainer': lazy(() => import('@digigov/react-core/AutoCompleteContainer').then((module) => ({ default: module['AutoCompleteContainer'] }))),
|
|
@@ -191,7 +192,7 @@ export default {
|
|
|
191
192
|
'PaginationListItem': lazy(() => import('@digigov/react-core/PaginationListItem').then((module) => ({ default: module['PaginationListItem'] }))),
|
|
192
193
|
'PaginationLabelContainer': lazy(() => import('@digigov/react-core/PaginationLabelContainer').then((module) => ({ default: module['PaginationLabelContainer'] }))),
|
|
193
194
|
'LoaderContainer': lazy(() => import('@digigov/react-core/LoaderContainer').then((module) => ({ default: module['LoaderContainer'] }))),
|
|
194
|
-
'
|
|
195
|
+
'CircularProgress': lazy(() => import('@digigov/react-core/CircularProgress').then((module) => ({ default: module['CircularProgress'] }))),
|
|
195
196
|
'FullPageBackground': lazy(() => import('@digigov/react-core/FullPageBackground').then((module) => ({ default: module['FullPageBackground'] }))),
|
|
196
197
|
'StepNavCircleNumber': lazy(() => import('@digigov/react-core/StepNavCircleNumber').then((module) => ({ default: module['StepNavCircleNumber'] }))),
|
|
197
198
|
'StepNav': lazy(() => import('@digigov/react-core/StepNav').then((module) => ({ default: module['StepNav'] }))),
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-eaf330f5",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
7
7
|
"main": "./cjs/index.js",
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@digigov/css": "2.0.0-
|
|
11
|
-
"@digigov/react-icons": "2.0.0-
|
|
10
|
+
"@digigov/css": "2.0.0-eaf330f5",
|
|
11
|
+
"@digigov/react-icons": "2.0.0-eaf330f5",
|
|
12
12
|
"clsx": "1.1.1",
|
|
13
|
-
"react": "
|
|
14
|
-
"react-dom": "
|
|
13
|
+
"react": ">=16.8.0 <19.0.0",
|
|
14
|
+
"react-dom": ">=16.8.0 <19.0.0",
|
|
15
15
|
"react-native-svg": "^15.2.0",
|
|
16
16
|
"expo-router": "^3.5.14",
|
|
17
17
|
"nativewind": "^4.1.1"
|
package/registry/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import * as _digigov_react_core from "@digigov/react-core";
|
|
3
3
|
import * as _digigov_react_core_Accordion from "@digigov/react-core/Accordion";
|
|
4
4
|
import * as _digigov_react_core_Accordion_index_web from "@digigov/react-core/Accordion/index.web";
|
|
5
|
+
import * as _digigov_react_core_AccordionControls from "@digigov/react-core/AccordionControls";
|
|
5
6
|
import * as _digigov_react_core_AccordionSection from "@digigov/react-core/AccordionSection";
|
|
6
7
|
import * as _digigov_react_core_AccordionSection_index_web from "@digigov/react-core/AccordionSection/index.web";
|
|
7
|
-
import * as _digigov_react_core_AccordionControls from "@digigov/react-core/AccordionControls";
|
|
8
8
|
import * as _digigov_react_core_AccordionSectionContent from "@digigov/react-core/AccordionSectionContent";
|
|
9
9
|
import * as _digigov_react_core_AccordionSectionSummary from "@digigov/react-core/AccordionSectionSummary";
|
|
10
10
|
import * as _digigov_react_core_AccordionSectionSummaryHeading from "@digigov/react-core/AccordionSectionSummaryHeading";
|
|
11
|
-
import * as _digigov_react_core_AdminAside from "@digigov/react-core/AdminAside";
|
|
12
11
|
import * as _digigov_react_core_AdminContainer from "@digigov/react-core/AdminContainer";
|
|
12
|
+
import * as _digigov_react_core_AdminAside from "@digigov/react-core/AdminAside";
|
|
13
13
|
import * as _digigov_react_core_AdminHeader from "@digigov/react-core/AdminHeader";
|
|
14
14
|
import * as _digigov_react_core_AdminHeaderContent from "@digigov/react-core/AdminHeaderContent";
|
|
15
15
|
import * as _digigov_react_core_AdminLayout from "@digigov/react-core/AdminLayout";
|
|
@@ -19,6 +19,7 @@ import * as _digigov_react_core_Aside from "@digigov/react-core/Aside";
|
|
|
19
19
|
import * as _digigov_react_core_AutoCompleteAssistiveHint from "@digigov/react-core/AutoCompleteAssistiveHint";
|
|
20
20
|
import * as _digigov_react_core_AutoCompleteContainer from "@digigov/react-core/AutoCompleteContainer";
|
|
21
21
|
import * as _digigov_react_core_AutoCompleteInputBase from "@digigov/react-core/AutoCompleteInputBase";
|
|
22
|
+
import * as _digigov_react_core_AutoCompleteInputTypeahead from "@digigov/react-core/AutoCompleteInputTypeahead";
|
|
22
23
|
import * as _digigov_react_core_AutoCompleteMultipleInput from "@digigov/react-core/AutoCompleteMultipleInput";
|
|
23
24
|
import * as _digigov_react_core_AutoCompleteMultipleInputContainer from "@digigov/react-core/AutoCompleteMultipleInputContainer";
|
|
24
25
|
import * as _digigov_react_core_AutoCompleteResultList from "@digigov/react-core/AutoCompleteResultList";
|
|
@@ -60,7 +61,7 @@ import * as _digigov_react_core_ChipContainer from "@digigov/react-core/ChipCont
|
|
|
60
61
|
import * as _digigov_react_core_ChipHeading from "@digigov/react-core/ChipHeading";
|
|
61
62
|
import * as _digigov_react_core_ChipKeyValue from "@digigov/react-core/ChipKeyValue";
|
|
62
63
|
import * as _digigov_react_core_ChoiceDividerText from "@digigov/react-core/ChoiceDividerText";
|
|
63
|
-
import * as
|
|
64
|
+
import * as _digigov_react_core_CircularProgress from "@digigov/react-core/CircularProgress";
|
|
64
65
|
import * as _digigov_react_core_CloseButton from "@digigov/react-core/CloseButton";
|
|
65
66
|
import * as _digigov_react_core_Code from "@digigov/react-core/Code";
|
|
66
67
|
import * as _digigov_react_core_CodeBlockContainer from "@digigov/react-core/CodeBlockContainer";
|
|
@@ -285,14 +286,14 @@ export default {
|
|
|
285
286
|
'@digigov/react-core': lazyImport(_digigov_react_core),
|
|
286
287
|
'@digigov/react-core/Accordion': lazyImport(_digigov_react_core_Accordion),
|
|
287
288
|
'@digigov/react-core/Accordion/index.web': lazyImport(_digigov_react_core_Accordion_index_web),
|
|
289
|
+
'@digigov/react-core/AccordionControls': lazyImport(_digigov_react_core_AccordionControls),
|
|
288
290
|
'@digigov/react-core/AccordionSection': lazyImport(_digigov_react_core_AccordionSection),
|
|
289
291
|
'@digigov/react-core/AccordionSection/index.web': lazyImport(_digigov_react_core_AccordionSection_index_web),
|
|
290
|
-
'@digigov/react-core/AccordionControls': lazyImport(_digigov_react_core_AccordionControls),
|
|
291
292
|
'@digigov/react-core/AccordionSectionContent': lazyImport(_digigov_react_core_AccordionSectionContent),
|
|
292
293
|
'@digigov/react-core/AccordionSectionSummary': lazyImport(_digigov_react_core_AccordionSectionSummary),
|
|
293
294
|
'@digigov/react-core/AccordionSectionSummaryHeading': lazyImport(_digigov_react_core_AccordionSectionSummaryHeading),
|
|
294
|
-
'@digigov/react-core/AdminAside': lazyImport(_digigov_react_core_AdminAside),
|
|
295
295
|
'@digigov/react-core/AdminContainer': lazyImport(_digigov_react_core_AdminContainer),
|
|
296
|
+
'@digigov/react-core/AdminAside': lazyImport(_digigov_react_core_AdminAside),
|
|
296
297
|
'@digigov/react-core/AdminHeader': lazyImport(_digigov_react_core_AdminHeader),
|
|
297
298
|
'@digigov/react-core/AdminHeaderContent': lazyImport(_digigov_react_core_AdminHeaderContent),
|
|
298
299
|
'@digigov/react-core/AdminLayout': lazyImport(_digigov_react_core_AdminLayout),
|
|
@@ -302,6 +303,7 @@ export default {
|
|
|
302
303
|
'@digigov/react-core/AutoCompleteAssistiveHint': lazyImport(_digigov_react_core_AutoCompleteAssistiveHint),
|
|
303
304
|
'@digigov/react-core/AutoCompleteContainer': lazyImport(_digigov_react_core_AutoCompleteContainer),
|
|
304
305
|
'@digigov/react-core/AutoCompleteInputBase': lazyImport(_digigov_react_core_AutoCompleteInputBase),
|
|
306
|
+
'@digigov/react-core/AutoCompleteInputTypeahead': lazyImport(_digigov_react_core_AutoCompleteInputTypeahead),
|
|
305
307
|
'@digigov/react-core/AutoCompleteMultipleInput': lazyImport(_digigov_react_core_AutoCompleteMultipleInput),
|
|
306
308
|
'@digigov/react-core/AutoCompleteMultipleInputContainer': lazyImport(_digigov_react_core_AutoCompleteMultipleInputContainer),
|
|
307
309
|
'@digigov/react-core/AutoCompleteResultList': lazyImport(_digigov_react_core_AutoCompleteResultList),
|
|
@@ -343,7 +345,7 @@ export default {
|
|
|
343
345
|
'@digigov/react-core/ChipHeading': lazyImport(_digigov_react_core_ChipHeading),
|
|
344
346
|
'@digigov/react-core/ChipKeyValue': lazyImport(_digigov_react_core_ChipKeyValue),
|
|
345
347
|
'@digigov/react-core/ChoiceDividerText': lazyImport(_digigov_react_core_ChoiceDividerText),
|
|
346
|
-
'@digigov/react-core/
|
|
348
|
+
'@digigov/react-core/CircularProgress': lazyImport(_digigov_react_core_CircularProgress),
|
|
347
349
|
'@digigov/react-core/CloseButton': lazyImport(_digigov_react_core_CloseButton),
|
|
348
350
|
'@digigov/react-core/Code': lazyImport(_digigov_react_core_Code),
|
|
349
351
|
'@digigov/react-core/CodeBlockContainer': lazyImport(_digigov_react_core_CodeBlockContainer),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`renders the AutoCompleteInputTypeahead with no props 1`] = `
|
|
4
|
+
<body>
|
|
5
|
+
<div>
|
|
6
|
+
<span>
|
|
7
|
+
<input
|
|
8
|
+
class="ds-autocomplete__hint"
|
|
9
|
+
readonly=""
|
|
10
|
+
tabindex="-1"
|
|
11
|
+
type="text"
|
|
12
|
+
/>
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
</body>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import AutoCompleteInputTypeahead from '@digigov/react-core/AutoCompleteInputTypeahead';
|
|
5
|
+
|
|
6
|
+
it('renders the AutoCompleteInputTypeahead with no props', () => {
|
|
7
|
+
expect(render(<AutoCompleteInputTypeahead />).baseElement).toMatchSnapshot();
|
|
8
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
|
+
|
|
5
|
+
export interface AutoCompleteInputTypeaheadProps extends BaseProps<'input'> {}
|
|
6
|
+
/**
|
|
7
|
+
* AutoCompleteInputTypeahead component is used to display the hole search value
|
|
8
|
+
* in the background.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export const AutoCompleteInputTypeahead = React.forwardRef<
|
|
12
|
+
HTMLInputElement,
|
|
13
|
+
AutoCompleteInputTypeaheadProps
|
|
14
|
+
>(function AutoCompleteInputTypeahead({ className, ...props }, ref) {
|
|
15
|
+
return (
|
|
16
|
+
<span>
|
|
17
|
+
<Base
|
|
18
|
+
as="input"
|
|
19
|
+
type="text"
|
|
20
|
+
readOnly
|
|
21
|
+
ref={ref}
|
|
22
|
+
tabIndex={-1}
|
|
23
|
+
className={clsx(className, {
|
|
24
|
+
'ds-autocomplete__hint': true,
|
|
25
|
+
})}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
</span>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export default AutoCompleteInputTypeahead;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
DetailedHTMLProps,
|
|
3
|
+
InputHTMLAttributes,
|
|
4
|
+
LegacyRef,
|
|
5
|
+
} from 'react';
|
|
2
6
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
7
|
|
|
4
8
|
export type CheckboxInputProps = Omit<
|
|
@@ -24,7 +28,7 @@ export const CheckboxInput = React.forwardRef<
|
|
|
24
28
|
return (
|
|
25
29
|
// @ts-ignore
|
|
26
30
|
<TouchableOpacity
|
|
27
|
-
ref={ref as
|
|
31
|
+
ref={ref as LegacyRef<TouchableOpacity>}
|
|
28
32
|
onPress={handlePress}
|
|
29
33
|
{...props}
|
|
30
34
|
>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
DetailedHTMLProps,
|
|
3
|
+
InputHTMLAttributes,
|
|
4
|
+
LegacyRef,
|
|
5
|
+
} from 'react';
|
|
2
6
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
7
|
|
|
4
8
|
export type RadioInputProps = Omit<
|
|
@@ -22,7 +26,7 @@ export const RadioInput = React.forwardRef<HTMLInputElement, RadioInputProps>(
|
|
|
22
26
|
|
|
23
27
|
return (
|
|
24
28
|
<TouchableOpacity
|
|
25
|
-
ref={ref as
|
|
29
|
+
ref={ref as LegacyRef<typeof TouchableOpacity>}
|
|
26
30
|
onPress={handlePress}
|
|
27
31
|
{...(props as any)}
|
|
28
32
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { Text, View, ViewProps } from 'react-native';
|
|
3
3
|
import { BaseProps as CoreBaseProps } from '@digigov/react-core/Base/index.web';
|
|
4
4
|
import { mapping } from '@digigov/react-core/Base/mapping.native';
|
|
@@ -22,7 +22,7 @@ const BooleanMapper = {
|
|
|
22
22
|
const textHtmlTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'p', 'span'];
|
|
23
23
|
|
|
24
24
|
export const Base: BaseComponent = React.forwardRef(function Base<
|
|
25
|
-
C extends React.ElementType,
|
|
25
|
+
C extends React.ElementType = 'span',
|
|
26
26
|
>(
|
|
27
27
|
{
|
|
28
28
|
as,
|
package/src/Base/index.web.tsx
CHANGED
|
@@ -162,7 +162,7 @@ type BaseComponent = <C extends React.ElementType = 'span'>(
|
|
|
162
162
|
) => React.ReactNode | null;
|
|
163
163
|
|
|
164
164
|
export const Base: BaseComponent = React.forwardRef(function Base<
|
|
165
|
-
C extends React.ElementType,
|
|
165
|
+
C extends React.ElementType = 'span',
|
|
166
166
|
>(
|
|
167
167
|
{
|
|
168
168
|
as,
|
|
@@ -16,6 +16,7 @@ exports[`renders the Checkbox with dense prop and CheckboxItems 1`] = `
|
|
|
16
16
|
<input
|
|
17
17
|
class="ds-checkboxes__input"
|
|
18
18
|
type="checkbox"
|
|
19
|
+
value=""
|
|
19
20
|
/>
|
|
20
21
|
</label>
|
|
21
22
|
</div>
|
|
@@ -29,6 +30,7 @@ exports[`renders the Checkbox with dense prop and CheckboxItems 1`] = `
|
|
|
29
30
|
<input
|
|
30
31
|
class="ds-checkboxes__input"
|
|
31
32
|
type="checkbox"
|
|
33
|
+
value=""
|
|
32
34
|
/>
|
|
33
35
|
</label>
|
|
34
36
|
</div>
|
|
@@ -53,6 +55,7 @@ exports[`renders the Checkbox with layout=horizontal and CheckboxItems 1`] = `
|
|
|
53
55
|
<input
|
|
54
56
|
class="ds-checkboxes__input"
|
|
55
57
|
type="checkbox"
|
|
58
|
+
value=""
|
|
56
59
|
/>
|
|
57
60
|
</label>
|
|
58
61
|
</div>
|
|
@@ -66,6 +69,7 @@ exports[`renders the Checkbox with layout=horizontal and CheckboxItems 1`] = `
|
|
|
66
69
|
<input
|
|
67
70
|
class="ds-checkboxes__input"
|
|
68
71
|
type="checkbox"
|
|
72
|
+
value=""
|
|
69
73
|
/>
|
|
70
74
|
</label>
|
|
71
75
|
</div>
|
|
@@ -102,6 +106,7 @@ exports[`renders the Checkbox with no props and CheckboxItem 1`] = `
|
|
|
102
106
|
<input
|
|
103
107
|
class="ds-checkboxes__input"
|
|
104
108
|
type="checkbox"
|
|
109
|
+
value=""
|
|
105
110
|
/>
|
|
106
111
|
</label>
|
|
107
112
|
</div>
|
|
@@ -14,6 +14,7 @@ exports[`renders the CheckboxItem with \`disabled\` prop 1`] = `
|
|
|
14
14
|
class="ds-checkboxes__input"
|
|
15
15
|
disabled=""
|
|
16
16
|
type="checkbox"
|
|
17
|
+
value=""
|
|
17
18
|
/>
|
|
18
19
|
</label>
|
|
19
20
|
</div>
|
|
@@ -39,6 +40,7 @@ exports[`renders the CheckboxItem with \`divider\` prop 1`] = `
|
|
|
39
40
|
<input
|
|
40
41
|
class="ds-checkboxes__input"
|
|
41
42
|
type="checkbox"
|
|
43
|
+
value=""
|
|
42
44
|
/>
|
|
43
45
|
</label>
|
|
44
46
|
</div>
|
|
@@ -60,6 +62,7 @@ exports[`renders the CheckboxItem with \`name\` prop 1`] = `
|
|
|
60
62
|
class="ds-checkboxes__input"
|
|
61
63
|
name="example"
|
|
62
64
|
type="checkbox"
|
|
65
|
+
value=""
|
|
63
66
|
/>
|
|
64
67
|
</label>
|
|
65
68
|
</div>
|
|
@@ -152,6 +155,7 @@ exports[`renders the CheckboxItem with no props 1`] = `
|
|
|
152
155
|
<input
|
|
153
156
|
class="ds-checkboxes__input"
|
|
154
157
|
type="checkbox"
|
|
158
|
+
value=""
|
|
155
159
|
/>
|
|
156
160
|
</label>
|
|
157
161
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`renders the
|
|
3
|
+
exports[`renders the CircularProgress 1`] = `
|
|
4
4
|
<body>
|
|
5
5
|
<div>
|
|
6
6
|
<svg
|
|
@@ -22,7 +22,7 @@ exports[`renders the CircularProgressBase 1`] = `
|
|
|
22
22
|
</body>
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
-
exports[`renders the
|
|
25
|
+
exports[`renders the CircularProgress with color=secondary and size lg props 1`] = `
|
|
26
26
|
<body>
|
|
27
27
|
<div>
|
|
28
28
|
<svg
|
|
@@ -44,7 +44,7 @@ exports[`renders the CircularProgressBase with color=secondary and size lg props
|
|
|
44
44
|
</body>
|
|
45
45
|
`;
|
|
46
46
|
|
|
47
|
-
exports[`renders the
|
|
47
|
+
exports[`renders the CircularProgress with color=secondary and size sm props 1`] = `
|
|
48
48
|
<body>
|
|
49
49
|
<div>
|
|
50
50
|
<svg
|
|
@@ -66,7 +66,7 @@ exports[`renders the CircularProgressBase with color=secondary and size sm props
|
|
|
66
66
|
</body>
|
|
67
67
|
`;
|
|
68
68
|
|
|
69
|
-
exports[`renders the
|
|
69
|
+
exports[`renders the CircularProgress with color=secondary prop 1`] = `
|
|
70
70
|
<body>
|
|
71
71
|
<div>
|
|
72
72
|
<svg
|
|
@@ -88,7 +88,7 @@ exports[`renders the CircularProgressBase with color=secondary prop 1`] = `
|
|
|
88
88
|
</body>
|
|
89
89
|
`;
|
|
90
90
|
|
|
91
|
-
exports[`renders the
|
|
91
|
+
exports[`renders the CircularProgress with size lg 1`] = `
|
|
92
92
|
<body>
|
|
93
93
|
<div>
|
|
94
94
|
<svg
|
|
@@ -110,7 +110,7 @@ exports[`renders the CircularProgressBase with size lg 1`] = `
|
|
|
110
110
|
</body>
|
|
111
111
|
`;
|
|
112
112
|
|
|
113
|
-
exports[`renders the
|
|
113
|
+
exports[`renders the CircularProgress with size sm 1`] = `
|
|
114
114
|
<body>
|
|
115
115
|
<div>
|
|
116
116
|
<svg
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import CircularProgress from '@digigov/react-core/CircularProgress';
|
|
5
|
+
|
|
6
|
+
it('renders the CircularProgress', () => {
|
|
7
|
+
expect(render(<CircularProgress />).baseElement).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('renders the CircularProgress with size sm', () => {
|
|
11
|
+
expect(render(<CircularProgress size="sm" />).baseElement).toMatchSnapshot();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('renders the CircularProgress with size lg', () => {
|
|
15
|
+
expect(render(<CircularProgress size="lg" />).baseElement).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders the CircularProgress with color=secondary prop', () => {
|
|
19
|
+
expect(
|
|
20
|
+
render(<CircularProgress color={'secondary'} />).baseElement
|
|
21
|
+
).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('renders the CircularProgress with color=secondary and size sm props', () => {
|
|
25
|
+
expect(
|
|
26
|
+
render(<CircularProgress color={'secondary'} size="sm" />).baseElement
|
|
27
|
+
).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders the CircularProgress with color=secondary and size lg props', () => {
|
|
31
|
+
expect(
|
|
32
|
+
render(<CircularProgress color={'secondary'} size="lg" />).baseElement
|
|
33
|
+
).toMatchSnapshot();
|
|
34
|
+
});
|
|
@@ -2,7 +2,7 @@ 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
|
|
5
|
+
export interface CircularProgressProps extends BaseProps<'svg'> {
|
|
6
6
|
/**
|
|
7
7
|
* color prop is optional.
|
|
8
8
|
* color prop is used to change the color of the loader.
|
|
@@ -22,12 +22,12 @@ export interface CircularProgressBaseProps extends BaseProps<'svg'> {
|
|
|
22
22
|
size?: 'sm' | 'md' | 'lg';
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Use
|
|
26
|
-
*
|
|
25
|
+
* Use CircularProgress component as an animated loader.
|
|
26
|
+
* CircularProgress can be used inside LoaderContainer component.
|
|
27
27
|
*/
|
|
28
|
-
export const
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export const CircularProgress = React.forwardRef<
|
|
29
|
+
SVGSVGElement,
|
|
30
|
+
CircularProgressProps
|
|
31
31
|
>(function CircularProgress(
|
|
32
32
|
{ color = 'primary', size = 'md', className, ...props },
|
|
33
33
|
ref
|
|
@@ -60,4 +60,4 @@ export const CircularProgressBase = React.forwardRef<
|
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
export default
|
|
63
|
+
export default CircularProgress;
|
package/src/LinkBase/index.tsx
CHANGED
|
@@ -35,7 +35,7 @@ export const LinkBase = React.forwardRef<HTMLAnchorElement, LinkBaseProps>(
|
|
|
35
35
|
'ds-link': defaultStyle,
|
|
36
36
|
'ds-link--no-underline': !underline,
|
|
37
37
|
})}
|
|
38
|
-
{
|
|
38
|
+
defaultStyle={defaultStyle}
|
|
39
39
|
{...props}
|
|
40
40
|
>
|
|
41
41
|
{children}
|
|
@@ -18,6 +18,7 @@ exports[`renders the RadioItem \`dividerText\` props 1`] = `
|
|
|
18
18
|
<input
|
|
19
19
|
class="ds-radios__input"
|
|
20
20
|
type="radio"
|
|
21
|
+
value=""
|
|
21
22
|
/>
|
|
22
23
|
</label>
|
|
23
24
|
</div>
|
|
@@ -88,6 +89,7 @@ exports[`renders the RadioItem with disabled prop 1`] = `
|
|
|
88
89
|
class="ds-radios__input"
|
|
89
90
|
disabled=""
|
|
90
91
|
type="radio"
|
|
92
|
+
value=""
|
|
91
93
|
/>
|
|
92
94
|
</label>
|
|
93
95
|
</div>
|
|
@@ -109,6 +111,7 @@ exports[`renders the RadioItem with name props 1`] = `
|
|
|
109
111
|
class="ds-radios__input"
|
|
110
112
|
name="name"
|
|
111
113
|
type="radio"
|
|
114
|
+
value=""
|
|
112
115
|
/>
|
|
113
116
|
</label>
|
|
114
117
|
</div>
|
|
@@ -174,6 +177,7 @@ exports[`renders the RadioItem with no props 1`] = `
|
|
|
174
177
|
<input
|
|
175
178
|
class="ds-radios__input"
|
|
176
179
|
type="radio"
|
|
180
|
+
value=""
|
|
177
181
|
/>
|
|
178
182
|
</label>
|
|
179
183
|
</div>
|
|
@@ -13,7 +13,7 @@ exports[`renders the Table with dataType numeric prop 1`] = `
|
|
|
13
13
|
class="ds-table__row"
|
|
14
14
|
>
|
|
15
15
|
<td
|
|
16
|
-
class="ds-table__cell ds-table__cell--
|
|
16
|
+
class="ds-table__cell ds-table__cell--numeric"
|
|
17
17
|
>
|
|
18
18
|
hello
|
|
19
19
|
</td>
|
|
@@ -37,7 +37,7 @@ exports[`renders the Table with no props 1`] = `
|
|
|
37
37
|
class="ds-table__row"
|
|
38
38
|
>
|
|
39
39
|
<td
|
|
40
|
-
class="ds-table__cell
|
|
40
|
+
class="ds-table__cell"
|
|
41
41
|
>
|
|
42
42
|
hello
|
|
43
43
|
</td>
|
package/src/Typography/index.tsx
CHANGED
|
@@ -29,26 +29,25 @@ export interface TypographyProps
|
|
|
29
29
|
* Typography component is used as generic component for typography.
|
|
30
30
|
* Use Typography component to extend components such as Heading, NormalText Paragraph etc.
|
|
31
31
|
*/
|
|
32
|
-
export const Typography = React.forwardRef<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
32
|
+
export const Typography = React.forwardRef<HTMLHeadingElement, TypographyProps>(
|
|
33
|
+
function Typography(
|
|
34
|
+
{ as, fontSize, fontWeight, className, children, ...props },
|
|
35
|
+
ref
|
|
36
|
+
) {
|
|
37
|
+
return (
|
|
38
|
+
<Base
|
|
39
|
+
as={as}
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={clsx(className, {
|
|
42
|
+
[`ds-!-font-size-${fontSize}`]: fontSize !== undefined,
|
|
43
|
+
[`ds-!-font-weight-${fontWeight}`]: fontWeight !== undefined,
|
|
44
|
+
})}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</Base>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
53
52
|
|
|
54
53
|
export default Typography;
|
package/src/index.ts
CHANGED
|
@@ -151,6 +151,7 @@ export * from '@digigov/react-core/AdminLayout';
|
|
|
151
151
|
export * from '@digigov/react-core/AdminMain';
|
|
152
152
|
export * from '@digigov/react-core/AdminTopSection';
|
|
153
153
|
export * from '@digigov/react-core/AutoCompleteInputBase';
|
|
154
|
+
export * from '@digigov/react-core/AutoCompleteInputTypeahead';
|
|
154
155
|
export * from '@digigov/react-core/AutoCompleteResultList';
|
|
155
156
|
export * from '@digigov/react-core/AutoCompleteResultListItem';
|
|
156
157
|
export * from '@digigov/react-core/AutoCompleteContainer';
|
|
@@ -190,7 +191,7 @@ export * from '@digigov/react-core/PaginationList';
|
|
|
190
191
|
export * from '@digigov/react-core/PaginationListItem';
|
|
191
192
|
export * from '@digigov/react-core/PaginationLabelContainer';
|
|
192
193
|
export * from '@digigov/react-core/LoaderContainer';
|
|
193
|
-
export * from '@digigov/react-core/
|
|
194
|
+
export * from '@digigov/react-core/CircularProgress';
|
|
194
195
|
export * from '@digigov/react-core/FullPageBackground';
|
|
195
196
|
export * from '@digigov/react-core/StepNavCircleNumber';
|
|
196
197
|
export * from '@digigov/react-core/StepNav';
|
package/src/lazy.js
CHANGED
|
@@ -152,6 +152,7 @@ export default {
|
|
|
152
152
|
'AdminMain': lazy(() => import('@digigov/react-core/AdminMain').then((module) => ({ default: module['AdminMain'] }))),
|
|
153
153
|
'AdminTopSection': lazy(() => import('@digigov/react-core/AdminTopSection').then((module) => ({ default: module['AdminTopSection'] }))),
|
|
154
154
|
'AutoCompleteInputBase': lazy(() => import('@digigov/react-core/AutoCompleteInputBase').then((module) => ({ default: module['AutoCompleteInputBase'] }))),
|
|
155
|
+
'AutoCompleteInputTypeahead': lazy(() => import('@digigov/react-core/AutoCompleteInputTypeahead').then((module) => ({ default: module['AutoCompleteInputTypeahead'] }))),
|
|
155
156
|
'AutoCompleteResultList': lazy(() => import('@digigov/react-core/AutoCompleteResultList').then((module) => ({ default: module['AutoCompleteResultList'] }))),
|
|
156
157
|
'AutoCompleteResultListItem': lazy(() => import('@digigov/react-core/AutoCompleteResultListItem').then((module) => ({ default: module['AutoCompleteResultListItem'] }))),
|
|
157
158
|
'AutoCompleteContainer': lazy(() => import('@digigov/react-core/AutoCompleteContainer').then((module) => ({ default: module['AutoCompleteContainer'] }))),
|
|
@@ -191,7 +192,7 @@ export default {
|
|
|
191
192
|
'PaginationListItem': lazy(() => import('@digigov/react-core/PaginationListItem').then((module) => ({ default: module['PaginationListItem'] }))),
|
|
192
193
|
'PaginationLabelContainer': lazy(() => import('@digigov/react-core/PaginationLabelContainer').then((module) => ({ default: module['PaginationLabelContainer'] }))),
|
|
193
194
|
'LoaderContainer': lazy(() => import('@digigov/react-core/LoaderContainer').then((module) => ({ default: module['LoaderContainer'] }))),
|
|
194
|
-
'
|
|
195
|
+
'CircularProgress': lazy(() => import('@digigov/react-core/CircularProgress').then((module) => ({ default: module['CircularProgress'] }))),
|
|
195
196
|
'FullPageBackground': lazy(() => import('@digigov/react-core/FullPageBackground').then((module) => ({ default: module['FullPageBackground'] }))),
|
|
196
197
|
'StepNavCircleNumber': lazy(() => import('@digigov/react-core/StepNavCircleNumber').then((module) => ({ default: module['StepNavCircleNumber'] }))),
|
|
197
198
|
'StepNav': lazy(() => import('@digigov/react-core/StepNav').then((module) => ({ default: module['StepNav'] }))),
|