@digigov/react-core 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.
- package/{src/AutoCompleteWrapper → AutoCompleteContainer}/__snapshots__/index.test.tsx.snap +4 -4
- package/AutoCompleteContainer/index.d.ts +22 -0
- package/{AutoCompleteWrapper → AutoCompleteContainer}/index.js +5 -5
- package/AutoCompleteContainer/index.test/index.js +7 -0
- package/{AutoCompleteStatusWrapper → AutoCompleteContainer}/index.test/package.json +1 -1
- package/{AutoCompleteWrapper → AutoCompleteContainer}/package.json +1 -1
- package/AutoCompleteInput/index.d.ts +1 -9
- package/AutoCompleteInput/index.js +2 -4
- package/AutoCompleteInput/index.test/index.js +5 -19
- package/AutoCompleteMultipleInput/index.d.ts +9 -0
- package/AutoCompleteMultipleInput/index.js +21 -0
- package/{AutoCompleteStatusWrapper → AutoCompleteMultipleInput}/package.json +1 -1
- package/AutoCompleteMultipleInputContainer/index.d.ts +12 -0
- package/AutoCompleteMultipleInputContainer/index.js +24 -0
- package/AutoCompleteMultipleInputContainer/package.json +6 -0
- package/AutoCompleteResultList/index.d.ts +1 -10
- package/AutoCompleteResultList/index.js +2 -3
- package/AutoCompleteResultList/index.test/index.js +0 -14
- package/AutoCompleteStatus/__snapshots__/index.test.tsx.snap +2 -2
- package/AutoCompleteStatus/index.d.ts +1 -1
- package/AutoCompleteStatus/index.js +2 -2
- package/{AutoCompleteStatusWrapper → AutoCompleteStatusContainer}/__snapshots__/index.test.tsx.snap +4 -4
- package/AutoCompleteStatusContainer/index.d.ts +10 -0
- package/{AutoCompleteStatusWrapper → AutoCompleteStatusContainer}/index.js +5 -5
- package/AutoCompleteStatusContainer/index.test/index.js +7 -0
- package/AutoCompleteStatusContainer/index.test/package.json +6 -0
- package/{AutoCompleteWrapper/index.test → AutoCompleteStatusContainer}/package.json +1 -1
- package/Base/index.js +1 -1
- package/DropdownContent/index.d.ts +9 -1
- package/DropdownContent/index.js +6 -5
- package/FooterContentLogos/__snapshots__/index.test.tsx.snap +2 -2
- package/FooterContentLogos/index.js +1 -1
- package/Hidden/__snapshots__/index.test.tsx.snap +5 -5
- package/Hint/index.js +1 -1
- package/ImageLogo/__snapshots__/index.test.tsx.snap +2 -2
- package/ImageLogo/index.js +1 -2
- package/ImageLogoSet/__snapshots__/index.test.tsx.snap +10 -10
- package/NormalText/__snapshots__/index.test.tsx.snap +60 -60
- package/NormalText/index.js +1 -1
- package/Paragraph/__snapshots__/index.test.tsx.snap +54 -54
- package/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +2 -2
- package/PhaseBannerHeaderContainer/index.js +1 -1
- package/TabsHeading/__snapshots__/index.test.tsx.snap +3 -3
- package/Unpurge/index.js +1 -1
- package/{AutoCompleteWrapper → cjs/AutoCompleteContainer}/__snapshots__/index.test.tsx.snap +4 -4
- package/cjs/{AutoCompleteWrapper → AutoCompleteContainer}/index.js +6 -6
- package/cjs/{AutoCompleteWrapper → AutoCompleteContainer}/index.test/index.js +2 -2
- package/cjs/AutoCompleteInput/index.js +2 -4
- package/cjs/AutoCompleteInput/index.test/index.js +5 -19
- package/cjs/AutoCompleteMultipleInput/index.js +28 -0
- package/cjs/AutoCompleteMultipleInputContainer/index.js +31 -0
- package/cjs/AutoCompleteResultList/index.js +2 -3
- package/cjs/AutoCompleteResultList/index.test/index.js +0 -14
- package/cjs/AutoCompleteStatus/__snapshots__/index.test.tsx.snap +2 -2
- package/cjs/AutoCompleteStatus/index.js +2 -2
- package/cjs/{AutoCompleteStatusWrapper → AutoCompleteStatusContainer}/__snapshots__/index.test.tsx.snap +4 -4
- package/cjs/{AutoCompleteStatusWrapper → AutoCompleteStatusContainer}/index.js +6 -6
- package/cjs/{AutoCompleteStatusWrapper → AutoCompleteStatusContainer}/index.test/index.js +2 -2
- package/cjs/Base/index.js +1 -1
- package/cjs/DropdownContent/index.js +6 -5
- package/cjs/FooterContentLogos/__snapshots__/index.test.tsx.snap +2 -2
- package/cjs/FooterContentLogos/index.js +1 -1
- package/cjs/Hidden/__snapshots__/index.test.tsx.snap +5 -5
- package/cjs/Hint/index.js +1 -1
- package/cjs/ImageLogo/__snapshots__/index.test.tsx.snap +2 -2
- package/cjs/ImageLogo/index.js +1 -2
- package/cjs/ImageLogoSet/__snapshots__/index.test.tsx.snap +10 -10
- package/cjs/NormalText/__snapshots__/index.test.tsx.snap +60 -60
- package/cjs/NormalText/index.js +1 -1
- package/cjs/Paragraph/__snapshots__/index.test.tsx.snap +54 -54
- package/cjs/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +2 -2
- package/cjs/PhaseBannerHeaderContainer/index.js +1 -1
- package/cjs/TabsHeading/__snapshots__/index.test.tsx.snap +3 -3
- package/cjs/Unpurge/index.js +1 -1
- package/cjs/index.js +26 -4
- package/cjs/lazy/index.js +30 -12
- package/cjs/registry/index.js +8 -4
- package/index.d.ts +3 -1
- package/index.js +4 -2
- package/lazy/index.js +24 -10
- package/lazy.d.ts +7 -5
- package/package.json +3 -3
- package/registry/index.js +8 -4
- package/registry.d.ts +4 -2
- package/{cjs/AutoCompleteWrapper → src/AutoCompleteContainer}/__snapshots__/index.test.tsx.snap +4 -4
- package/src/{AutoCompleteWrapper → AutoCompleteContainer}/index.test.tsx +2 -2
- package/src/{AutoCompleteWrapper → AutoCompleteContainer}/index.tsx +8 -8
- package/src/AutoCompleteInput/index.test.tsx +4 -12
- package/src/AutoCompleteInput/index.tsx +2 -11
- package/src/AutoCompleteMultipleInput/index.tsx +28 -0
- package/src/AutoCompleteMultipleInputContainer/index.tsx +38 -0
- package/src/AutoCompleteResultList/index.test.tsx +0 -20
- package/src/AutoCompleteResultList/index.tsx +1 -13
- package/src/AutoCompleteStatus/__snapshots__/index.test.tsx.snap +2 -2
- package/src/AutoCompleteStatus/index.tsx +2 -2
- package/src/AutoCompleteStatusContainer/__snapshots__/index.test.tsx.snap +16 -0
- package/src/AutoCompleteStatusContainer/index.test.tsx +10 -0
- package/src/AutoCompleteStatusContainer/index.tsx +28 -0
- package/src/Base/index.tsx +5 -5
- package/src/DropdownContent/index.tsx +10 -1
- package/src/FooterContentLogos/__snapshots__/index.test.tsx.snap +2 -2
- package/src/FooterContentLogos/index.tsx +1 -1
- package/src/Hidden/__snapshots__/index.test.tsx.snap +5 -5
- package/src/Hint/index.tsx +2 -2
- package/src/ImageLogo/__snapshots__/index.test.tsx.snap +2 -2
- package/src/ImageLogo/index.tsx +1 -2
- package/src/ImageLogoSet/__snapshots__/index.test.tsx.snap +10 -10
- package/src/NormalText/__snapshots__/index.test.tsx.snap +60 -60
- package/src/NormalText/index.tsx +2 -2
- package/src/Paragraph/__snapshots__/index.test.tsx.snap +54 -54
- package/src/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +2 -2
- package/src/PhaseBannerHeaderContainer/index.tsx +1 -1
- package/src/TabsHeading/__snapshots__/index.test.tsx.snap +3 -3
- package/src/Unpurge/index.tsx +5 -2
- package/src/index.ts +3 -1
- package/src/lazy.js +4 -2
- package/src/registry.js +8 -4
- package/AutoCompleteStatusWrapper/index.d.ts +0 -10
- package/AutoCompleteStatusWrapper/index.test/index.js +0 -7
- package/AutoCompleteWrapper/index.d.ts +0 -22
- package/AutoCompleteWrapper/index.test/index.js +0 -7
- package/src/AutoCompleteStatusWrapper/__snapshots__/index.test.tsx.snap +0 -16
- package/src/AutoCompleteStatusWrapper/index.test.tsx +0 -10
- package/src/AutoCompleteStatusWrapper/index.tsx +0 -28
- /package/{AutoCompleteStatusWrapper → AutoCompleteContainer}/index.test.d.ts +0 -0
- /package/{AutoCompleteWrapper → AutoCompleteStatusContainer}/index.test.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.7",
|
|
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-rc.
|
|
11
|
-
"@digigov/react-icons": "2.0.0-rc.
|
|
10
|
+
"@digigov/css": "2.0.0-rc.7",
|
|
11
|
+
"@digigov/react-icons": "2.0.0-rc.7",
|
|
12
12
|
"clsx": "1.1.1",
|
|
13
13
|
"react": "^16.8.0 || ^17.0.0",
|
|
14
14
|
"react-dom": "^16.8.0 || ^17.0.0"
|
package/registry/index.js
CHANGED
|
@@ -13,13 +13,15 @@ import * as _digigov_react_core_AdminMain from '@digigov/react-core/AdminMain';
|
|
|
13
13
|
import * as _digigov_react_core_AdminTopSection from '@digigov/react-core/AdminTopSection';
|
|
14
14
|
import * as _digigov_react_core_Aside from '@digigov/react-core/Aside';
|
|
15
15
|
import * as _digigov_react_core_AutoCompleteAssistiveHint from '@digigov/react-core/AutoCompleteAssistiveHint';
|
|
16
|
+
import * as _digigov_react_core_AutoCompleteContainer from '@digigov/react-core/AutoCompleteContainer';
|
|
16
17
|
import * as _digigov_react_core_AutoCompleteInput from '@digigov/react-core/AutoCompleteInput';
|
|
17
18
|
import * as _digigov_react_core_AutoCompleteInputTypeahead from '@digigov/react-core/AutoCompleteInputTypeahead';
|
|
19
|
+
import * as _digigov_react_core_AutoCompleteMultipleInput from '@digigov/react-core/AutoCompleteMultipleInput';
|
|
20
|
+
import * as _digigov_react_core_AutoCompleteMultipleInputContainer from '@digigov/react-core/AutoCompleteMultipleInputContainer';
|
|
18
21
|
import * as _digigov_react_core_AutoCompleteResultList from '@digigov/react-core/AutoCompleteResultList';
|
|
19
22
|
import * as _digigov_react_core_AutoCompleteResultListItem from '@digigov/react-core/AutoCompleteResultListItem';
|
|
20
23
|
import * as _digigov_react_core_AutoCompleteStatus from '@digigov/react-core/AutoCompleteStatus';
|
|
21
|
-
import * as
|
|
22
|
-
import * as _digigov_react_core_AutoCompleteWrapper from '@digigov/react-core/AutoCompleteWrapper';
|
|
24
|
+
import * as _digigov_react_core_AutoCompleteStatusContainer from '@digigov/react-core/AutoCompleteStatusContainer';
|
|
23
25
|
import * as _digigov_react_core_BackLink from '@digigov/react-core/BackLink';
|
|
24
26
|
import * as _digigov_react_core_BackToTopContainer from '@digigov/react-core/BackToTopContainer';
|
|
25
27
|
import * as _digigov_react_core_BackToTopLimit from '@digigov/react-core/BackToTopLimit';
|
|
@@ -271,13 +273,15 @@ export default {
|
|
|
271
273
|
'@digigov/react-core/AdminTopSection': lazyImport(_digigov_react_core_AdminTopSection),
|
|
272
274
|
'@digigov/react-core/Aside': lazyImport(_digigov_react_core_Aside),
|
|
273
275
|
'@digigov/react-core/AutoCompleteAssistiveHint': lazyImport(_digigov_react_core_AutoCompleteAssistiveHint),
|
|
276
|
+
'@digigov/react-core/AutoCompleteContainer': lazyImport(_digigov_react_core_AutoCompleteContainer),
|
|
274
277
|
'@digigov/react-core/AutoCompleteInput': lazyImport(_digigov_react_core_AutoCompleteInput),
|
|
275
278
|
'@digigov/react-core/AutoCompleteInputTypeahead': lazyImport(_digigov_react_core_AutoCompleteInputTypeahead),
|
|
279
|
+
'@digigov/react-core/AutoCompleteMultipleInput': lazyImport(_digigov_react_core_AutoCompleteMultipleInput),
|
|
280
|
+
'@digigov/react-core/AutoCompleteMultipleInputContainer': lazyImport(_digigov_react_core_AutoCompleteMultipleInputContainer),
|
|
276
281
|
'@digigov/react-core/AutoCompleteResultList': lazyImport(_digigov_react_core_AutoCompleteResultList),
|
|
277
282
|
'@digigov/react-core/AutoCompleteResultListItem': lazyImport(_digigov_react_core_AutoCompleteResultListItem),
|
|
278
283
|
'@digigov/react-core/AutoCompleteStatus': lazyImport(_digigov_react_core_AutoCompleteStatus),
|
|
279
|
-
'@digigov/react-core/
|
|
280
|
-
'@digigov/react-core/AutoCompleteWrapper': lazyImport(_digigov_react_core_AutoCompleteWrapper),
|
|
284
|
+
'@digigov/react-core/AutoCompleteStatusContainer': lazyImport(_digigov_react_core_AutoCompleteStatusContainer),
|
|
281
285
|
'@digigov/react-core/BackLink': lazyImport(_digigov_react_core_BackLink),
|
|
282
286
|
'@digigov/react-core/BackToTopContainer': lazyImport(_digigov_react_core_BackToTopContainer),
|
|
283
287
|
'@digigov/react-core/BackToTopLimit': lazyImport(_digigov_react_core_BackToTopLimit),
|
package/registry.d.ts
CHANGED
|
@@ -14,13 +14,15 @@ declare const _default: {
|
|
|
14
14
|
'@digigov/react-core/AdminTopSection': {};
|
|
15
15
|
'@digigov/react-core/Aside': {};
|
|
16
16
|
'@digigov/react-core/AutoCompleteAssistiveHint': {};
|
|
17
|
+
'@digigov/react-core/AutoCompleteContainer': {};
|
|
17
18
|
'@digigov/react-core/AutoCompleteInput': {};
|
|
18
19
|
'@digigov/react-core/AutoCompleteInputTypeahead': {};
|
|
20
|
+
'@digigov/react-core/AutoCompleteMultipleInput': {};
|
|
21
|
+
'@digigov/react-core/AutoCompleteMultipleInputContainer': {};
|
|
19
22
|
'@digigov/react-core/AutoCompleteResultList': {};
|
|
20
23
|
'@digigov/react-core/AutoCompleteResultListItem': {};
|
|
21
24
|
'@digigov/react-core/AutoCompleteStatus': {};
|
|
22
|
-
'@digigov/react-core/
|
|
23
|
-
'@digigov/react-core/AutoCompleteWrapper': {};
|
|
25
|
+
'@digigov/react-core/AutoCompleteStatusContainer': {};
|
|
24
26
|
'@digigov/react-core/BackLink': {};
|
|
25
27
|
'@digigov/react-core/BackToTopContainer': {};
|
|
26
28
|
'@digigov/react-core/BackToTopLimit': {};
|
package/{cjs/AutoCompleteWrapper → src/AutoCompleteContainer}/__snapshots__/index.test.tsx.snap
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`renders the AdminContainer with no props 1`] = `
|
|
4
|
-
<ForwardRef(
|
|
4
|
+
<ForwardRef(AutoCompleteContainer)>
|
|
5
5
|
<ForwardRef(Base)
|
|
6
6
|
as="div"
|
|
7
|
-
className="ds-
|
|
7
|
+
className="ds-autocomplete__container"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
|
-
className="ds-
|
|
10
|
+
className="ds-autocomplete__container"
|
|
11
11
|
>
|
|
12
12
|
hello
|
|
13
13
|
</div>
|
|
14
14
|
</ForwardRef(Base)>
|
|
15
|
-
</ForwardRef(
|
|
15
|
+
</ForwardRef(AutoCompleteContainer)>
|
|
16
16
|
`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import AutoCompleteContainer from '@digigov/react-core/AutoCompleteContainer';
|
|
5
5
|
|
|
6
6
|
it('renders the AdminContainer with no props', () => {
|
|
7
7
|
expect(
|
|
8
|
-
mount(<
|
|
8
|
+
mount(<AutoCompleteContainer>hello</AutoCompleteContainer>)
|
|
9
9
|
).toMatchSnapshot();
|
|
10
10
|
});
|
|
@@ -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 AutoCompleteContainerProps extends BaseProps<'div'> {
|
|
6
6
|
/**
|
|
7
7
|
* width is optional.
|
|
8
8
|
* Use width prop to define a custom width in your component.
|
|
@@ -17,19 +17,19 @@ export interface AutoCompleteWrapperProps extends BaseProps<'div'> {
|
|
|
17
17
|
width?: '25%' | '33.3%' | '50%' | '66.6%' | '75%' | '100%' | 'full';
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* Use
|
|
20
|
+
* AutoCompleteContainer is a wrapper for autocomplete element.
|
|
21
|
+
* Use AutoCompleteContainer to wrap autocomplete elements.
|
|
22
22
|
*/
|
|
23
|
-
export const
|
|
23
|
+
export const AutoCompleteContainer = React.forwardRef<
|
|
24
24
|
HTMLDivElement,
|
|
25
|
-
|
|
26
|
-
>(function
|
|
25
|
+
AutoCompleteContainerProps
|
|
26
|
+
>(function AutoCompleteContainer({ className, width, children, ...props }, ref) {
|
|
27
27
|
return (
|
|
28
28
|
<Base
|
|
29
29
|
as="div"
|
|
30
30
|
ref={ref}
|
|
31
31
|
className={clsx(className, {
|
|
32
|
-
'ds-
|
|
32
|
+
'ds-autocomplete__container': true,
|
|
33
33
|
'ds-!-width-one-quarter': width === '25%',
|
|
34
34
|
'ds-!-width-one-third': width === '33.3%',
|
|
35
35
|
'ds-!-width-one-half': width === '50%',
|
|
@@ -44,4 +44,4 @@ export const AutoCompleteWrapper = React.forwardRef<
|
|
|
44
44
|
);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
export default
|
|
47
|
+
export default AutoCompleteContainer;
|
|
@@ -7,22 +7,14 @@ it('renders the AutoCompleteInput with no props', () => {
|
|
|
7
7
|
expect(mount(<AutoCompleteInput />)).toMatchSnapshot();
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
it('renders the AutoCompleteInput with
|
|
11
|
-
expect(mount(<AutoCompleteInput showAllValues />)).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('renders the AutoCompleteInput with showAllValues', () => {
|
|
15
|
-
expect(mount(<AutoCompleteInput showAllValues />)).toMatchSnapshot();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('renders the AutoCompleteInput with showAllValues isFocused', () => {
|
|
10
|
+
it('renders the AutoCompleteInput with isFocused', () => {
|
|
19
11
|
expect(
|
|
20
|
-
mount(<AutoCompleteInput isFocused
|
|
12
|
+
mount(<AutoCompleteInput isFocused />)
|
|
21
13
|
).toMatchSnapshot();
|
|
22
14
|
});
|
|
23
15
|
|
|
24
|
-
it('renders the AutoCompleteInput with
|
|
16
|
+
it('renders the AutoCompleteInput with isFocused and name props', () => {
|
|
25
17
|
expect(
|
|
26
|
-
mount(<AutoCompleteInput name="some-name" isFocused
|
|
18
|
+
mount(<AutoCompleteInput name="some-name" isFocused />)
|
|
27
19
|
).toMatchSnapshot();
|
|
28
20
|
});
|
|
@@ -9,14 +9,7 @@ export interface AutoCompleteInputProps extends BaseProps<'input'> {
|
|
|
9
9
|
* @value false
|
|
10
10
|
*/
|
|
11
11
|
isFocused?: boolean;
|
|
12
|
-
|
|
13
|
-
* showAllValues is optional. The default value is false.
|
|
14
|
-
* showAllValues prop is used to change the css input.
|
|
15
|
-
* @value true
|
|
16
|
-
* @value false
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
showAllValues?: boolean;
|
|
12
|
+
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
15
|
* AutoCompleteInput component is used to display the value that the user is typing.
|
|
@@ -26,7 +19,7 @@ export const AutoCompleteInput = React.forwardRef<
|
|
|
26
19
|
HTMLInputElement,
|
|
27
20
|
AutoCompleteInputProps
|
|
28
21
|
>(function AutoCompleteInput(
|
|
29
|
-
{ name, isFocused,
|
|
22
|
+
{ name, isFocused, className, ...props },
|
|
30
23
|
ref
|
|
31
24
|
) {
|
|
32
25
|
return (
|
|
@@ -37,8 +30,6 @@ export const AutoCompleteInput = React.forwardRef<
|
|
|
37
30
|
ref={ref}
|
|
38
31
|
className={clsx(className, {
|
|
39
32
|
'ds-autocomplete__input': true,
|
|
40
|
-
'ds-autocomplete__input--default': showAllValues === false,
|
|
41
|
-
'ds-autocomplete__input--show-all-values': showAllValues,
|
|
42
33
|
'ds-autocomplete__input--focused': isFocused,
|
|
43
34
|
})}
|
|
44
35
|
{...props}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
|
+
|
|
5
|
+
export interface AutoCompleteMultipleInputProps extends BaseProps<'input'> {}
|
|
6
|
+
/**
|
|
7
|
+
* AutoCompleteMultipleInput is used inside AutoCompleteMultipleInputContainer for multiple values input.
|
|
8
|
+
*/
|
|
9
|
+
export const AutoCompleteMultipleInput = React.forwardRef<
|
|
10
|
+
HTMLInputElement,
|
|
11
|
+
AutoCompleteMultipleInputProps
|
|
12
|
+
>(function AutoCompleteMultipleInput({ children, className, ...props }, ref) {
|
|
13
|
+
return (
|
|
14
|
+
<Base
|
|
15
|
+
as="input"
|
|
16
|
+
type="text"
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={clsx(className, {
|
|
19
|
+
'ds-autocomplete__multi-input': true,
|
|
20
|
+
})}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</Base>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default AutoCompleteMultipleInput;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
|
+
|
|
5
|
+
export interface AutoCompleteMultipleInputContainerProps
|
|
6
|
+
extends BaseProps<'div'> {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
isFocused?: boolean;
|
|
9
|
+
numberOfSelected?: 1 | 2 | 3 | 'all';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Use AutoCompleteMultipleInputContainer to accept multiple values input.
|
|
13
|
+
*/
|
|
14
|
+
export const AutoCompleteMultipleInputContainer = React.forwardRef<
|
|
15
|
+
HTMLDivElement,
|
|
16
|
+
AutoCompleteMultipleInputContainerProps
|
|
17
|
+
>(function AutoCompleteMultipleInputContainer(
|
|
18
|
+
{ numberOfSelected = 'all', open, children, isFocused, className, ...props },
|
|
19
|
+
ref
|
|
20
|
+
) {
|
|
21
|
+
return (
|
|
22
|
+
<Base
|
|
23
|
+
as="div"
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={clsx(className, {
|
|
26
|
+
'ds-autocomplete__multi-input-container': true,
|
|
27
|
+
'ds-autocomplete__multi-input-container--focused': isFocused,
|
|
28
|
+
[`ds-autocomplete__multi-input-container--${numberOfSelected}`]: typeof(numberOfSelected) === 'number'
|
|
29
|
+
|
|
30
|
+
})}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</Base>
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export default AutoCompleteMultipleInputContainer;
|
|
@@ -14,23 +14,3 @@ it('renders the AutoCompleteResultList with isVisible props', () => {
|
|
|
14
14
|
mount(<AutoCompleteResultList isVisible>Hello</AutoCompleteResultList>)
|
|
15
15
|
).toMatchSnapshot();
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
it('renders the AutoCompleteResultList with isVisible displayMenu="inline props', () => {
|
|
19
|
-
expect(
|
|
20
|
-
mount(
|
|
21
|
-
<AutoCompleteResultList isVisible displayMenu="inline">
|
|
22
|
-
Hello
|
|
23
|
-
</AutoCompleteResultList>
|
|
24
|
-
)
|
|
25
|
-
).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders the AutoCompleteResultList with isVisible displayMenu="overlay props', () => {
|
|
29
|
-
expect(
|
|
30
|
-
mount(
|
|
31
|
-
<AutoCompleteResultList isVisible displayMenu="overlay">
|
|
32
|
-
Hello
|
|
33
|
-
</AutoCompleteResultList>
|
|
34
|
-
)
|
|
35
|
-
).toMatchSnapshot();
|
|
36
|
-
});
|
|
@@ -13,15 +13,6 @@ export interface AutoCompleteResultListProps extends BaseProps<'ul'> {
|
|
|
13
13
|
* @default false
|
|
14
14
|
*/
|
|
15
15
|
isVisible?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* displayMenu is optional.
|
|
18
|
-
* Use displayMenu to choose the display of the manue
|
|
19
|
-
* default value is inline.
|
|
20
|
-
*
|
|
21
|
-
* @value 'inline'
|
|
22
|
-
* @value 'overlay'
|
|
23
|
-
*/
|
|
24
|
-
displayMenu?: 'inline' | 'overlay';
|
|
25
16
|
}
|
|
26
17
|
/**
|
|
27
18
|
* AutoCompleteResultList component is used for listing items.
|
|
@@ -31,7 +22,7 @@ export const AutoCompleteResultList = React.forwardRef<
|
|
|
31
22
|
HTMLUListElement,
|
|
32
23
|
AutoCompleteResultListProps
|
|
33
24
|
>(function List(
|
|
34
|
-
{ isVisible = false,
|
|
25
|
+
{ isVisible = false, className, children, ...props },
|
|
35
26
|
ref
|
|
36
27
|
) {
|
|
37
28
|
return (
|
|
@@ -40,9 +31,6 @@ export const AutoCompleteResultList = React.forwardRef<
|
|
|
40
31
|
ref={ref}
|
|
41
32
|
className={clsx(className, {
|
|
42
33
|
'ds-autocomplete__menu': true,
|
|
43
|
-
'ds-autocomplete__menu--inline': displayMenu === 'inline',
|
|
44
|
-
'ds-autocomplete__menu--overlay': displayMenu === 'overlay',
|
|
45
|
-
'ds-autocomplete__menu--visible': isVisible,
|
|
46
34
|
'ds-autocomplete__menu--hidden': isVisible === false,
|
|
47
35
|
})}
|
|
48
36
|
{...props}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`renders the AdminContainer with no props 1`] = `
|
|
4
|
-
<ForwardRef(
|
|
4
|
+
<ForwardRef(AutoCompleteStatusContainer)>
|
|
5
5
|
<ForwardRef(Base)
|
|
6
6
|
aria-atomic="true"
|
|
7
7
|
aria-live="polite"
|
|
@@ -18,5 +18,5 @@ exports[`renders the AdminContainer with no props 1`] = `
|
|
|
18
18
|
hello
|
|
19
19
|
</div>
|
|
20
20
|
</ForwardRef(Base)>
|
|
21
|
-
</ForwardRef(
|
|
21
|
+
</ForwardRef(AutoCompleteStatusContainer)>
|
|
22
22
|
`;
|
|
@@ -5,12 +5,12 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
|
5
5
|
export interface AutoCompleteStatusProps extends BaseProps<'div'> { }
|
|
6
6
|
/**
|
|
7
7
|
* AutoCompleteStatus is a div element for displaying the autocomplete status.
|
|
8
|
-
* Use AutoCompleteStatus inside
|
|
8
|
+
* Use AutoCompleteStatus inside AutoCompleteStatusContainer wrapper.
|
|
9
9
|
*/
|
|
10
10
|
export const AutoCompleteStatus = React.forwardRef<
|
|
11
11
|
HTMLDivElement,
|
|
12
12
|
AutoCompleteStatusProps
|
|
13
|
-
>(function
|
|
13
|
+
>(function AutoCompleteStatusContainer({ className, children, ...props }, ref) {
|
|
14
14
|
return (
|
|
15
15
|
<Base
|
|
16
16
|
as="div"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AdminContainer with no props 1`] = `
|
|
4
|
+
<ForwardRef(AutoCompleteStatusContainer)>
|
|
5
|
+
<ForwardRef(Base)
|
|
6
|
+
as="div"
|
|
7
|
+
className="ds-autocomplete__status__container"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
className="ds-autocomplete__status__container"
|
|
11
|
+
>
|
|
12
|
+
hello
|
|
13
|
+
</div>
|
|
14
|
+
</ForwardRef(Base)>
|
|
15
|
+
</ForwardRef(AutoCompleteStatusContainer)>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import AutoCompleteStatusContainer from '@digigov/react-core/AutoCompleteStatusContainer';
|
|
5
|
+
|
|
6
|
+
it('renders the AdminContainer with no props', () => {
|
|
7
|
+
expect(
|
|
8
|
+
mount(<AutoCompleteStatusContainer>hello</AutoCompleteStatusContainer>)
|
|
9
|
+
).toMatchSnapshot();
|
|
10
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
|
+
|
|
5
|
+
export interface AutoCompleteStatusContainerProps extends BaseProps<'div'> {}
|
|
6
|
+
/**
|
|
7
|
+
* AutoCompleteStatusContainer is a wrapper for autocomplete element.
|
|
8
|
+
* Use AutoCompleteStatusContainer to wrap autocomplete elements.
|
|
9
|
+
*/
|
|
10
|
+
export const AutoCompleteStatusContainer = React.forwardRef<
|
|
11
|
+
HTMLDivElement,
|
|
12
|
+
AutoCompleteStatusContainerProps
|
|
13
|
+
>(function AutoCompleteStatusContainer({ className, children, ...props }, ref) {
|
|
14
|
+
return (
|
|
15
|
+
<Base
|
|
16
|
+
as="div"
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={clsx(className, {
|
|
19
|
+
'ds-autocomplete__status__container': true,
|
|
20
|
+
})}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</Base>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default AutoCompleteStatusContainer;
|
package/src/Base/index.tsx
CHANGED
|
@@ -235,11 +235,11 @@ export const Base: BaseComponent = React.forwardRef(function Base<
|
|
|
235
235
|
'ds-print-visible-block': printVisible === 'block',
|
|
236
236
|
'ds-print-visible-inline': printVisible === 'inline',
|
|
237
237
|
'ds-hidden': !!hidden,
|
|
238
|
-
'ds-hidden-xs
|
|
239
|
-
'ds-hidden-sm
|
|
240
|
-
'ds-hidden-md
|
|
241
|
-
'ds-hidden-lg
|
|
242
|
-
'ds-hidden-xl
|
|
238
|
+
'ds-hidden-xs-up': !!xsUpHidden,
|
|
239
|
+
'ds-hidden-sm-up': !!smUpHidden,
|
|
240
|
+
'ds-hidden-md-up': !!mdUpHidden,
|
|
241
|
+
'ds-hidden-lg-up': !!lgUpHidden,
|
|
242
|
+
'ds-hidden-xl-up': !!xlUpHidden,
|
|
243
243
|
'ds-hidden-xs': !!xsHidden,
|
|
244
244
|
'ds-hidden-sm': !!smHidden,
|
|
245
245
|
'ds-hidden-md': !!mdHidden,
|
|
@@ -11,6 +11,14 @@ export interface DropdownContentProps extends BaseProps<'div'> {
|
|
|
11
11
|
* @default true
|
|
12
12
|
*/
|
|
13
13
|
fullWidth?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* scrollable prop is optional.
|
|
16
|
+
* If true, the dropdown content will have limited scrollable height.
|
|
17
|
+
* @value true
|
|
18
|
+
* @value false
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
scrollable?: boolean;
|
|
14
22
|
}
|
|
15
23
|
/**
|
|
16
24
|
* You should use DropdownContent component inside Dropdown component.
|
|
@@ -19,7 +27,7 @@ export const DropdownContent = React.forwardRef<
|
|
|
19
27
|
HTMLDivElement,
|
|
20
28
|
DropdownContentProps
|
|
21
29
|
>(function DropdownContent(
|
|
22
|
-
{
|
|
30
|
+
{fullWidth = true, scrollable, className, children, ...props },
|
|
23
31
|
ref
|
|
24
32
|
) {
|
|
25
33
|
return (
|
|
@@ -29,6 +37,7 @@ export const DropdownContent = React.forwardRef<
|
|
|
29
37
|
className={clsx(className, {
|
|
30
38
|
'ds-dropdown__content': true,
|
|
31
39
|
'ds-dropdown__content--full-width': fullWidth,
|
|
40
|
+
'ds-dropdown__content--scrollable': scrollable,
|
|
32
41
|
})}
|
|
33
42
|
{...props}
|
|
34
43
|
>
|
|
@@ -4,10 +4,10 @@ exports[`renders the FooterContentLogos with no props 1`] = `
|
|
|
4
4
|
<ForwardRef(FooterContentLogos)>
|
|
5
5
|
<ForwardRef(Base)
|
|
6
6
|
as="div"
|
|
7
|
-
className="ds-
|
|
7
|
+
className="ds-footer__content__logos"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
|
-
className="ds-
|
|
10
|
+
className="ds-footer__content__logos"
|
|
11
11
|
>
|
|
12
12
|
hello
|
|
13
13
|
</div>
|
|
@@ -10,7 +10,7 @@ exports[`renders the Hidden with \`lgUp\` props 1`] = `
|
|
|
10
10
|
xsUpHidden={false}
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
13
|
-
className="ds-hidden-lg
|
|
13
|
+
className="ds-hidden-lg-up"
|
|
14
14
|
>
|
|
15
15
|
<div>
|
|
16
16
|
hello
|
|
@@ -30,7 +30,7 @@ exports[`renders the Hidden with \`mdUp\` props 1`] = `
|
|
|
30
30
|
xsUpHidden={false}
|
|
31
31
|
>
|
|
32
32
|
<div
|
|
33
|
-
className="ds-hidden-md
|
|
33
|
+
className="ds-hidden-md-up"
|
|
34
34
|
>
|
|
35
35
|
<div>
|
|
36
36
|
hello
|
|
@@ -50,7 +50,7 @@ exports[`renders the Hidden with \`smUp\` props 1`] = `
|
|
|
50
50
|
xsUpHidden={false}
|
|
51
51
|
>
|
|
52
52
|
<div
|
|
53
|
-
className="ds-hidden-sm
|
|
53
|
+
className="ds-hidden-sm-up"
|
|
54
54
|
>
|
|
55
55
|
<div>
|
|
56
56
|
hello
|
|
@@ -70,7 +70,7 @@ exports[`renders the Hidden with \`xlUp\` props 1`] = `
|
|
|
70
70
|
xsUpHidden={false}
|
|
71
71
|
>
|
|
72
72
|
<div
|
|
73
|
-
className="ds-hidden-xl
|
|
73
|
+
className="ds-hidden-xl-up"
|
|
74
74
|
>
|
|
75
75
|
<div>
|
|
76
76
|
hello
|
|
@@ -89,7 +89,7 @@ exports[`renders the Hidden with \`xsUp\` props 1`] = `
|
|
|
89
89
|
xsUpHidden={true}
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
|
-
className="ds-hidden-xs
|
|
92
|
+
className="ds-hidden-xs-up"
|
|
93
93
|
>
|
|
94
94
|
<div>
|
|
95
95
|
hello
|
package/src/Hint/index.tsx
CHANGED
|
@@ -29,8 +29,8 @@ export const Hint = React.forwardRef<HTMLParagraphElement, HintProps>(
|
|
|
29
29
|
className={clsx(className, {
|
|
30
30
|
'ds-hint': true,
|
|
31
31
|
'ds-hint--break-words': breakWords,
|
|
32
|
-
'ds-hint
|
|
33
|
-
'ds-hint
|
|
32
|
+
'ds-hint--lg': size === 'lg',
|
|
33
|
+
'ds-hint--sm': size === 'sm',
|
|
34
34
|
})}
|
|
35
35
|
{...props}
|
|
36
36
|
>
|
|
@@ -7,12 +7,12 @@ exports[`renders the Hint with variant and src props 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<ForwardRef(Base)
|
|
9
9
|
as="img"
|
|
10
|
-
className="ds-image-logo
|
|
10
|
+
className="ds-image-logo-dark"
|
|
11
11
|
printHidden={true}
|
|
12
12
|
src="logo.png"
|
|
13
13
|
>
|
|
14
14
|
<img
|
|
15
|
-
className="ds-image-logo
|
|
15
|
+
className="ds-image-logo-dark ds-print-hidden"
|
|
16
16
|
src="logo.png"
|
|
17
17
|
/>
|
|
18
18
|
</ForwardRef(Base)>
|
package/src/ImageLogo/index.tsx
CHANGED
|
@@ -23,7 +23,6 @@ export const ImageLogo = React.forwardRef<HTMLImageElement, ImageLogoProps>(
|
|
|
23
23
|
{ lang, src, variant, className, children, ...props },
|
|
24
24
|
ref
|
|
25
25
|
) {
|
|
26
|
-
console.log('src is', src);
|
|
27
26
|
return (
|
|
28
27
|
<>
|
|
29
28
|
<Base
|
|
@@ -33,7 +32,7 @@ export const ImageLogo = React.forwardRef<HTMLImageElement, ImageLogoProps>(
|
|
|
33
32
|
printHidden
|
|
34
33
|
className={clsx(className, {
|
|
35
34
|
'ds-image-logo': variant === undefined,
|
|
36
|
-
[`ds-image-logo
|
|
35
|
+
[`ds-image-logo-${variant}`]: variant !== undefined,
|
|
37
36
|
})}
|
|
38
37
|
{...props}
|
|
39
38
|
/>
|