@wonderflow/react-components 10.18.2 → 10.20.0
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/dist/components/accordion/accordion.test.d.ts +2 -0
- package/dist/components/accordion/accordion.test.d.ts.map +1 -0
- package/dist/components/accordion/accordion.test.js +35 -0
- package/dist/components/aspect-ratio/aspect-ratio.test.d.ts +2 -0
- package/dist/components/aspect-ratio/aspect-ratio.test.d.ts.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.test.js +24 -0
- package/dist/components/autocomplete/autocomplete-option.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-option.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +10 -5
- package/dist/components/autocomplete/autocomplete.test.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete.test.d.ts.map +1 -0
- package/dist/components/autocomplete/autocomplete.test.js +42 -0
- package/dist/components/avatar/avatar.test.d.ts +2 -0
- package/dist/components/avatar/avatar.test.d.ts.map +1 -0
- package/dist/components/avatar/avatar.test.js +28 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.test.d.ts +2 -0
- package/dist/components/button/button.test.d.ts.map +1 -0
- package/dist/components/button/button.test.js +56 -0
- package/dist/components/card/card.test.d.ts +2 -0
- package/dist/components/card/card.test.d.ts.map +1 -0
- package/dist/components/card/card.test.js +41 -0
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/chip.test.d.ts +2 -0
- package/dist/components/chip/chip.test.d.ts.map +1 -0
- package/dist/components/chip/chip.test.js +29 -0
- package/dist/components/circular-progress/circular-progress.test.d.ts +2 -0
- package/dist/components/circular-progress/circular-progress.test.d.ts.map +1 -0
- package/dist/components/circular-progress/circular-progress.test.js +28 -0
- package/dist/components/clamp-text/clamp-text.d.ts.map +1 -1
- package/dist/components/clamp-text/clamp-text.js +1 -1
- package/dist/components/clamp-text/clamp-text.test.d.ts +2 -0
- package/dist/components/clamp-text/clamp-text.test.d.ts.map +1 -0
- package/dist/components/clamp-text/clamp-text.test.js +37 -0
- package/dist/components/container/container.test.d.ts +2 -0
- package/dist/components/container/container.test.d.ts.map +1 -0
- package/dist/components/container/container.test.js +28 -0
- package/dist/components/datetime/datetime.test.d.ts +2 -0
- package/dist/components/datetime/datetime.test.d.ts.map +1 -0
- package/dist/components/datetime/datetime.test.js +41 -0
- package/dist/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.js +1 -1
- package/dist/components/disclosure/disclosure.stories.d.ts +7 -7
- package/dist/components/disclosure/disclosure.stories.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.stories.js +7 -2
- package/dist/components/disclosure/disclosure.test.d.ts +2 -0
- package/dist/components/disclosure/disclosure.test.d.ts.map +1 -0
- package/dist/components/disclosure/disclosure.test.js +38 -0
- package/dist/components/elevator/elevator.test.d.ts +2 -0
- package/dist/components/elevator/elevator.test.d.ts.map +1 -0
- package/dist/components/elevator/elevator.test.js +25 -0
- package/dist/components/expander/expander.d.ts.map +1 -1
- package/dist/components/expander/expander.js +1 -1
- package/dist/components/expander/expander.test.d.ts +2 -0
- package/dist/components/expander/expander.test.d.ts.map +1 -0
- package/dist/components/expander/expander.test.js +32 -0
- package/dist/components/grid/grid.test.d.ts +2 -0
- package/dist/components/grid/grid.test.d.ts.map +1 -0
- package/dist/components/grid/grid.test.js +28 -0
- package/dist/components/info-state/info-state.test.d.ts +2 -0
- package/dist/components/info-state/info-state.test.d.ts.map +1 -0
- package/dist/components/info-state/info-state.test.js +33 -0
- package/dist/components/input-group/input-group.test.d.ts +2 -0
- package/dist/components/input-group/input-group.test.d.ts.map +1 -0
- package/dist/components/input-group/input-group.test.js +30 -0
- package/dist/components/linear-progress/linear-progress.test.d.ts +2 -0
- package/dist/components/linear-progress/linear-progress.test.d.ts.map +1 -0
- package/dist/components/linear-progress/linear-progress.test.js +32 -0
- package/dist/components/list/list.test.d.ts +2 -0
- package/dist/components/list/list.test.d.ts.map +1 -0
- package/dist/components/list/list.test.js +28 -0
- package/dist/components/masonry/masonry.test.d.ts +2 -0
- package/dist/components/masonry/masonry.test.d.ts.map +1 -0
- package/dist/components/masonry/masonry.test.js +28 -0
- package/dist/components/menu/menu-item/menu-item.d.ts +0 -2
- package/dist/components/menu/menu-item/menu-item.d.ts.map +1 -1
- package/dist/components/menu/menu-item/menu-item.js +1 -1
- package/dist/components/menu/menu-item/menu-item.module.css +1 -1
- package/dist/components/menu/menu.module.css +1 -1
- package/dist/components/menu/menu.stories.d.ts.map +1 -1
- package/dist/components/menu/menu.stories.js +2 -2
- package/dist/components/menu/menu.test.d.ts +2 -0
- package/dist/components/menu/menu.test.d.ts.map +1 -0
- package/dist/components/menu/menu.test.js +25 -0
- package/dist/components/overlay-container/overlay-container.stories.js +2 -2
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/pagination/pagination.test.d.ts +2 -0
- package/dist/components/pagination/pagination.test.d.ts.map +1 -0
- package/dist/components/pagination/pagination.test.js +29 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +6 -3
- package/dist/components/popover/popover.stories.d.ts.map +1 -1
- package/dist/components/popover/popover.stories.js +17 -4
- package/dist/components/popover/popover.test.d.ts +2 -0
- package/dist/components/popover/popover.test.d.ts.map +1 -0
- package/dist/components/popover/popover.test.js +41 -0
- package/dist/components/prose/prose.test.d.ts +2 -0
- package/dist/components/prose/prose.test.d.ts.map +1 -0
- package/dist/components/prose/prose.test.js +26 -0
- package/dist/components/select/select.test.d.ts +2 -0
- package/dist/components/select/select.test.d.ts.map +1 -0
- package/dist/components/select/select.test.js +28 -0
- package/dist/components/selection-controls/selection-controls.module.css +1 -1
- package/dist/components/selection-controls/selection-controls.test.d.ts +2 -0
- package/dist/components/selection-controls/selection-controls.test.d.ts.map +1 -0
- package/dist/components/selection-controls/selection-controls.test.js +30 -0
- package/dist/components/separator/separator.test.d.ts +2 -0
- package/dist/components/separator/separator.test.d.ts.map +1 -0
- package/dist/components/separator/separator.test.js +24 -0
- package/dist/components/skeleton/skeleton.test.d.ts +2 -0
- package/dist/components/skeleton/skeleton.test.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.test.js +28 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/slider.test.d.ts +2 -0
- package/dist/components/slider/slider.test.d.ts.map +1 -0
- package/dist/components/slider/slider.test.js +30 -0
- package/dist/components/snackbar/snackbar.test.d.ts +2 -0
- package/dist/components/snackbar/snackbar.test.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.test.js +28 -0
- package/dist/components/spinner/spinner.test.d.ts +2 -0
- package/dist/components/spinner/spinner.test.d.ts.map +1 -0
- package/dist/components/spinner/spinner.test.js +28 -0
- package/dist/components/split-button/split-button.test.d.ts +2 -0
- package/dist/components/split-button/split-button.test.d.ts.map +1 -0
- package/dist/components/split-button/split-button.test.js +24 -0
- package/dist/components/stack/stack.test.d.ts +2 -0
- package/dist/components/stack/stack.test.d.ts.map +1 -0
- package/dist/components/stack/stack.test.js +28 -0
- package/dist/components/star-meter/star-meter.d.ts.map +1 -1
- package/dist/components/star-meter/star-meter.js +1 -4
- package/dist/components/star-meter/star-meter.test.d.ts +2 -0
- package/dist/components/star-meter/star-meter.test.d.ts.map +1 -0
- package/dist/components/star-meter/star-meter.test.js +36 -0
- package/dist/components/symbol/symbol.test.d.ts +2 -0
- package/dist/components/symbol/symbol.test.d.ts.map +1 -0
- package/dist/components/symbol/symbol.test.js +29 -0
- package/dist/components/tab/tab.d.ts.map +1 -1
- package/dist/components/tab/tab.js +1 -1
- package/dist/components/tab/tab.test.d.ts +2 -0
- package/dist/components/tab/tab.test.d.ts.map +1 -0
- package/dist/components/tab/tab.test.js +30 -0
- package/dist/components/table/table-cell/table-cell.test.d.ts +2 -0
- package/dist/components/table/table-cell/table-cell.test.d.ts.map +1 -0
- package/dist/components/table/table-cell/table-cell.test.js +28 -0
- package/dist/components/table/table-checkbox/table-checkbox.test.d.ts +2 -0
- package/dist/components/table/table-checkbox/table-checkbox.test.d.ts.map +1 -0
- package/dist/components/table/table-checkbox/table-checkbox.test.js +24 -0
- package/dist/components/table/table-controls/table-controls.test.d.ts +2 -0
- package/dist/components/table/table-controls/table-controls.test.d.ts.map +1 -0
- package/dist/components/table/table-controls/table-controls.test.js +35 -0
- package/dist/components/table/table-controls/toggle-columns.d.ts.map +1 -1
- package/dist/components/table/table-controls/toggle-columns.js +1 -1
- package/dist/components/table/table-header/table-header.test.d.ts +2 -0
- package/dist/components/table/table-header/table-header.test.d.ts.map +1 -0
- package/dist/components/table/table-header/table-header.test.js +24 -0
- package/dist/components/table/table-pagination/table-pagination.test.d.ts +2 -0
- package/dist/components/table/table-pagination/table-pagination.test.d.ts.map +1 -0
- package/dist/components/table/table-pagination/table-pagination.test.js +28 -0
- package/dist/components/table/table-row/table-row.test.d.ts +2 -0
- package/dist/components/table/table-row/table-row.test.d.ts.map +1 -0
- package/dist/components/table/table-row/table-row.test.js +24 -0
- package/dist/components/table/table.test.d.ts +2 -0
- package/dist/components/table/table.test.d.ts.map +1 -0
- package/dist/components/table/table.test.js +62 -0
- package/dist/components/text/text.test.d.ts +2 -0
- package/dist/components/text/text.test.d.ts.map +1 -0
- package/dist/components/text/text.test.js +24 -0
- package/dist/components/textfield/textfield.d.ts.map +1 -1
- package/dist/components/textfield/textfield.js +2 -2
- package/dist/components/textfield/textfield.test.d.ts +2 -0
- package/dist/components/textfield/textfield.test.d.ts.map +1 -0
- package/dist/components/textfield/textfield.test.js +37 -0
- package/dist/components/title/title.test.d.ts +2 -0
- package/dist/components/title/title.test.d.ts.map +1 -0
- package/dist/components/title/title.test.js +33 -0
- package/dist/components/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/toggle-button/toggle-button.test.d.ts +2 -0
- package/dist/components/toggle-button/toggle-button.test.d.ts.map +1 -0
- package/dist/components/toggle-button/toggle-button.test.js +30 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +7 -3
- package/dist/components/tooltip/tooltip.stories.d.ts +3 -1
- package/dist/components/tooltip/tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.stories.js +33 -5
- package/dist/components/tooltip/tooltip.test.d.ts +2 -0
- package/dist/components/tooltip/tooltip.test.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.test.js +29 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +16 -0
- package/dist/hooks/usePopupWrapper.d.ts +4 -0
- package/dist/hooks/usePopupWrapper.d.ts.map +1 -0
- package/dist/hooks/usePopupWrapper.js +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/providers/providers.test.d.ts +2 -0
- package/dist/providers/providers.test.d.ts.map +1 -0
- package/dist/providers/providers.test.js +34 -0
- package/package.json +17 -15
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { Datetime } from './datetime';
|
|
19
|
+
describe('<DateTime>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const dt = '2021-12-15T16:00:32.507981+00:00';
|
|
22
|
+
const edt = 'December 15, 2021';
|
|
23
|
+
const { container, getByText } = render(_jsx(Datetime, { date: dt }));
|
|
24
|
+
expect(getByText(edt)).toBeDefined();
|
|
25
|
+
expect(container).not.toBeNull();
|
|
26
|
+
});
|
|
27
|
+
test(' it should render properly with local ""it-IT', () => {
|
|
28
|
+
const dt = '2021-12-15T16:00:32.507981+00:00';
|
|
29
|
+
const edt = '15 dicembre 2021';
|
|
30
|
+
const { container, getByText } = render(_jsx(Datetime, { date: dt, locale: "it-IT" }));
|
|
31
|
+
expect(getByText(edt)).toBeDefined();
|
|
32
|
+
expect(container).not.toBeNull();
|
|
33
|
+
});
|
|
34
|
+
test(' it should render properly with local ""it-IT and options', () => {
|
|
35
|
+
const dt = '2021-12-15T16:00:32.507981+00:00';
|
|
36
|
+
const edt = '15 dicembre 21';
|
|
37
|
+
const { container, getByText } = render(_jsx(Datetime, { date: dt, locale: "it-IT", options: { year: '2-digit' } }));
|
|
38
|
+
expect(getByText(edt)).toBeDefined();
|
|
39
|
+
expect(container).not.toBeNull();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAC;AASf,oBAAY,eAAe,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,GAAG;IACxE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU;IAnCrB;;OAEG;;IAEH;;;OAGG;aACM,SAAS;IAClB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;
|
|
1
|
+
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAEL,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAC;AASf,oBAAY,eAAe,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,GAAG;IACxE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU;IAnCrB;;OAEG;;IAEH;;;OAGG;aACM,SAAS;IAClB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;sDAuGH,CAAC"}
|
|
@@ -52,7 +52,7 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
|
|
|
52
52
|
icon: 24,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
-
return (_jsxs("details", { style: { ...dynamicStyle, ...style }, className: clsx(styles.Disclosure, className), "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, onToggle: handleOpen(), ref: ref, open: isOpen, ...otherProps, children: [_jsxs(Text, { as: "summary", responsive: false, className: styles.Summary, id: seedID('disclosure'), size:
|
|
55
|
+
return (_jsxs("details", { style: { ...dynamicStyle, ...style }, className: clsx(styles.Disclosure, className), "data-testid": "Disclosure", "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, onToggle: handleOpen(), ref: ref, open: isOpen, ...otherProps, children: [_jsxs(Text, { as: "summary", responsive: false, className: styles.Summary, id: seedID('disclosure'), size: sizes[dimension].summary, weight: "bold", children: [summary, expandable && (_jsx(Symbol, { className: styles.ExpandIcon, source: "chevron-right", dimension: sizes[dimension].icon }))] }), _jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { className: styles.Content, "data-disclosure-padding": padding, "data-disclosure-height": Boolean(contentMaxHeight), animate: isOpen ? { y: 5, opacity: 1, height: 'auto' } : {
|
|
56
56
|
y: 0, opacity: 0, height: 0, overflow: 'hidden',
|
|
57
57
|
}, transition: { ease: 'easeOut', duration: 0.2, delay: 0 }, initial: false, role: "region", "aria-labelledby": seedID('disclosure'), children: children }) })] }));
|
|
58
58
|
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Disclosure } from './disclosure';
|
|
4
4
|
declare const story: ComponentMeta<typeof Disclosure>;
|
|
5
5
|
export default story;
|
|
6
|
-
export declare const Default: ComponentStory<
|
|
6
|
+
export declare const Default: ComponentStory<import("react").ForwardRefExoticComponent<import("react").DetailsHTMLAttributes<HTMLDetailsElement> & {
|
|
7
7
|
open?: boolean | undefined;
|
|
8
|
-
summary:
|
|
8
|
+
summary: import("react").ReactNode;
|
|
9
9
|
padding?: boolean | undefined;
|
|
10
10
|
contentMaxHeight?: string | undefined;
|
|
11
11
|
dimension?: "small" | "regular" | "big" | undefined;
|
|
12
12
|
iconPosition?: "left" | "right" | undefined;
|
|
13
13
|
expandable?: boolean | undefined;
|
|
14
|
-
} &
|
|
15
|
-
export declare const Nested: ComponentStory<
|
|
14
|
+
} & import("react").RefAttributes<HTMLDetailsElement>>>;
|
|
15
|
+
export declare const Nested: ComponentStory<import("react").ForwardRefExoticComponent<import("react").DetailsHTMLAttributes<HTMLDetailsElement> & {
|
|
16
16
|
open?: boolean | undefined;
|
|
17
|
-
summary:
|
|
17
|
+
summary: import("react").ReactNode;
|
|
18
18
|
padding?: boolean | undefined;
|
|
19
19
|
contentMaxHeight?: string | undefined;
|
|
20
20
|
dimension?: "small" | "regular" | "big" | undefined;
|
|
21
21
|
iconPosition?: "left" | "right" | undefined;
|
|
22
22
|
expandable?: boolean | undefined;
|
|
23
|
-
} &
|
|
23
|
+
} & import("react").RefAttributes<HTMLDetailsElement>>>;
|
|
24
24
|
//# sourceMappingURL=disclosure.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disclosure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"disclosure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,UAAU,CAwB3C,CAAC;AAEF,eAAe,KAAK,CAAC;AA0CrB,eAAO,MAAM,OAAO;;;;;;;;uDAAoB,CAAC;AAkCzC,eAAO,MAAM,MAAM;;;;;;;;uDAA0B,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Autocomplete } from '../autocomplete';
|
|
3
|
+
import { Chip } from '../chip';
|
|
4
|
+
import { IconButton } from '../icon-button';
|
|
5
|
+
import { Menu, MenuItem } from '../menu';
|
|
6
|
+
import { Popover } from '../popover';
|
|
2
7
|
import { Disclosure } from './disclosure';
|
|
3
8
|
const story = {
|
|
4
9
|
title: 'Actions/Disclosure',
|
|
@@ -26,7 +31,7 @@ const story = {
|
|
|
26
31
|
},
|
|
27
32
|
};
|
|
28
33
|
export default story;
|
|
29
|
-
const Template = args => (
|
|
34
|
+
const Template = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", children: [_jsx(Autocomplete.Option, { value: "apple", children: "Apple" }), _jsx(Autocomplete.Option, { value: "banana", decoration: _jsx(Chip, { dimension: "small", color: "green", children: "110 Cal" }), children: "Banana" }), _jsx(Autocomplete.Option, { value: "cherry", children: "Cherry" })] }), _jsxs("p", { children: ["Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!", ' ', _jsx(Popover, { trigger: _jsx(IconButton, { icon: "circle-info", dimension: "small", kind: "flat" }), children: _jsx(Menu, { style: { maxWidth: '300px' }, children: _jsx(MenuItem, { value: "1", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!" }) }) })] })] }));
|
|
30
35
|
export const Default = Template.bind({});
|
|
31
|
-
const NestedTemplate = args => (_jsxs(Disclosure, { ...args, children: ["Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!", _jsx(Disclosure, { summary: "Nested", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!" })] }));
|
|
36
|
+
const NestedTemplate = args => (_jsxs(Disclosure, { ...args, children: [_jsxs(Autocomplete, { style: { maxWidth: '300px', padding: '0.5rem 0' }, icon: "magnifying-glass", children: [_jsx(Autocomplete.Option, { value: "apple", children: "Apple" }), _jsx(Autocomplete.Option, { value: "banana", decoration: _jsx(Chip, { dimension: "small", color: "green", children: "110 Cal" }), children: "Banana" }), _jsx(Autocomplete.Option, { value: "cherry", children: "Cherry" })] }), "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!", _jsx(Disclosure, { summary: "Nested", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus corporis nobis ipsum natus laudantium dolorem sapiente, sint adipisci at asperiores quia ex voluptatum veniam! Quos rerum natus eos excepturi atque!" })] }));
|
|
32
37
|
export const Nested = NestedTemplate.bind({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure.test.d.ts","sourceRoot":"","sources":["../../../src/components/disclosure/disclosure.test.tsx"],"names":[],"mappings":"AAgBA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import '@testing-library/jest-dom';
|
|
18
|
+
import { fireEvent, render, screen, waitFor, } from '@testing-library/react';
|
|
19
|
+
import { Disclosure } from './disclosure';
|
|
20
|
+
describe('<Disclosure>', () => {
|
|
21
|
+
it('should render properly open', async () => {
|
|
22
|
+
render(_jsx(Disclosure, { open: true, expandable: true, summary: "Click to expand", children: "Text inside" }));
|
|
23
|
+
const disclosure = screen.getByText(/click to expand/i);
|
|
24
|
+
const el = screen.getByText(/text inside/i);
|
|
25
|
+
expect(el).toBeDefined();
|
|
26
|
+
fireEvent.click(disclosure);
|
|
27
|
+
await waitFor(() => {
|
|
28
|
+
expect(disclosure.getAttribute('open')).toBeFalsy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('should render properly close', async () => {
|
|
32
|
+
render(_jsx(Disclosure, { expandable: true, summary: "Click to expand", children: "Text inside" }));
|
|
33
|
+
const disclosure = screen.getByText(/click to expand/i);
|
|
34
|
+
const el = screen.getByText(/text inside/i);
|
|
35
|
+
expect(disclosure).toBeDefined();
|
|
36
|
+
expect(el).toBeDefined();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevator.test.d.ts","sourceRoot":"","sources":["../../../src/components/elevator/elevator.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/* eslint-disable max-len */
|
|
18
|
+
import { render } from '@testing-library/react';
|
|
19
|
+
import { Elevator } from './elevator';
|
|
20
|
+
describe('<Elevator>', () => {
|
|
21
|
+
test(' it should render properly', () => {
|
|
22
|
+
const { container } = render(_jsx(Elevator, { resting: 1, hover: 1, children: _jsx("div", { children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel dolore hic nisi voluptates quam error! At quod alias architecto? Qui tenetur odio molestias cupiditate quisquam!" }) }));
|
|
23
|
+
expect(container).not.toBeNull();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expander.d.ts","sourceRoot":"","sources":["../../../src/components/expander/expander.tsx"],"names":[],"mappings":"AA2BA,oBAAY,aAAa,GAAG;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"expander.d.ts","sourceRoot":"","sources":["../../../src/components/expander/expander.tsx"],"names":[],"mappings":"AA2BA,oBAAY,aAAa,GAAG;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,aAAa,CA2DnD,CAAC"}
|
|
@@ -31,5 +31,5 @@ export const Expander = ({ expandLabel = 'Show more', collapseLabel = 'Show less
|
|
|
31
31
|
}, []);
|
|
32
32
|
return (_jsxs("div", { style: { ...dynamicStyle, style }, className: clsx(styles.Expander, className), "data-expander-collapsed": isCollapsed, ...otherProps, children: [_jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { className: styles.Content, id: uid('expander-content'), animate: !isCollapsed ? { height: 'auto' } : {
|
|
33
33
|
height: 'calc(var(--visibleArea) + var(--threshold))', overflow: 'hidden',
|
|
34
|
-
}, transition: { ease: 'easeOut', duration: 0.2 }, initial: false, children: children }) }), _jsx(Stack, { className: styles.Action, hAlign: "center", vAlign: "center", fill: false, children: _jsx(Elevator, { resting: isCollapsed ? 4 : 0, children: _jsx(Button, { iconPosition: "right", "aria-expanded": !isCollapsed, "aria-controls": uid('expander-content'), onClick: handleCollapse, children: isCollapsed ? expandLabel : collapseLabel }) }) })] }));
|
|
34
|
+
}, transition: { ease: 'easeOut', duration: 0.2 }, initial: false, children: children }) }), _jsx(Stack, { className: styles.Action, hAlign: "center", vAlign: "center", fill: false, children: _jsx(Elevator, { resting: isCollapsed ? 4 : 0, children: _jsx(Button, { iconPosition: "right", "data-testid": "ExpanderButton", "aria-expanded": !isCollapsed, "aria-controls": uid('expander-content'), onClick: handleCollapse, children: isCollapsed ? expandLabel : collapseLabel }) }) })] }));
|
|
35
35
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expander.test.d.ts","sourceRoot":"","sources":["../../../src/components/expander/expander.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/* eslint-disable max-len */
|
|
18
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
19
|
+
import { Expander } from './expander';
|
|
20
|
+
const innerText = 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sed fugiat numquam ea, blanditiis consequatur rem, rerum corrupti soluta asperiores cupiditate a eaque voluptates? Natus ullam vero incidunt in, adipisci nobis iusto eveniet error neque. Sed in dolor temporibus magni inventore laboriosam esse quas ab. Nulla ipsa dolores error dolore corrupti libero optio beatae ex veritatis assumenda, officia voluptatibus aperiam rerum at officiis nostrum ipsam facere, dignissimos doloremque ad laboriosam voluptatem. Eum officiis dolorum nemo. Voluptatibus iure suscipit sequi libero, quasi doloribus consequatur. Architecto facilis libero qui, numquam saepe labore fugiat. Magni laborum voluptas sapiente harum labore mollitia, cupiditate exercitationem tempore?';
|
|
21
|
+
describe('<Expander>', () => {
|
|
22
|
+
test(' it should render properly', () => {
|
|
23
|
+
const { container } = render(_jsx(Expander, { children: innerText }));
|
|
24
|
+
expect(container).not.toBeNull();
|
|
25
|
+
});
|
|
26
|
+
test(' it should expand properly', () => {
|
|
27
|
+
const { container, getByTestId } = render(_jsx(Expander, { children: innerText }));
|
|
28
|
+
const btn = getByTestId('ExpanderButton');
|
|
29
|
+
fireEvent.click(btn);
|
|
30
|
+
expect(container).not.toBeNull();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.test.d.ts","sourceRoot":"","sources":["../../../src/components/grid/grid.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { Grid } from './grid';
|
|
19
|
+
describe('<Grid>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const { container } = render(_jsxs(Grid, { children: [_jsx(Grid.Item, { children: "1" }), _jsx(Grid.Item, { children: "2" }), _jsx(Grid.Item, { children: "3" })] }));
|
|
22
|
+
expect(container).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
test(' it should render properly with props', () => {
|
|
25
|
+
const { container } = render(_jsxs(Grid, { rowGap: 2, columnGap: 2, children: [_jsx(Grid.Item, { children: "1" }), _jsx(Grid.Item, { children: "2" }), _jsx(Grid.Item, { children: "3" })] }));
|
|
26
|
+
expect(container).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-state.test.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { Button } from '../button';
|
|
19
|
+
import { InfoState } from './info-state';
|
|
20
|
+
describe('<InfoState>', () => {
|
|
21
|
+
test(' it should render properly', () => {
|
|
22
|
+
const { container } = render(_jsx(InfoState, { title: "My title", icon: "compass", children: "Content" }));
|
|
23
|
+
expect(container).not.toBeNull();
|
|
24
|
+
});
|
|
25
|
+
test(' it should render properly with props', () => {
|
|
26
|
+
const { container } = render(_jsx(InfoState, { title: "My title", direction: "column", image: "https://svgshare.com/i/b5f.svg", actions: _jsx(Button, { children: "Click" }), children: "Content" }));
|
|
27
|
+
expect(container).not.toBeNull();
|
|
28
|
+
});
|
|
29
|
+
test(' it should render properly with image row', () => {
|
|
30
|
+
const { container } = render(_jsx(InfoState, { title: "My title", direction: "row", image: "https://svgshare.com/i/b5f.svg", actions: _jsx(Button, { children: "Click" }), children: "Content" }));
|
|
31
|
+
expect(container).not.toBeNull();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group.test.d.ts","sourceRoot":"","sources":["../../../src/components/input-group/input-group.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { Select } from '../select';
|
|
19
|
+
import { Textfield } from '../textfield';
|
|
20
|
+
import { InputGroup } from './input-group';
|
|
21
|
+
describe('<InputGroup>', () => {
|
|
22
|
+
test(' it should render properly', () => {
|
|
23
|
+
const { container } = render(_jsx(InputGroup, { label: "Sample label", prefix: _jsx(Textfield, { readOnly: true, size: 6, value: "https://" }), input: _jsx(Textfield, { type: "text", defaultValue: "sample-domain" }), suffix: (_jsxs(Select, { defaultValue: 1, children: [_jsx("option", { value: "1", children: ".com" }), _jsx("option", { value: "2", children: ".it" }), _jsx("option", { value: "3", children: ".org" }), _jsx("option", { value: "4", children: ".dev" }), _jsx("option", { value: "5", children: ".io" })] })) }));
|
|
24
|
+
expect(container).not.toBeNull();
|
|
25
|
+
});
|
|
26
|
+
test(' it should render properly', () => {
|
|
27
|
+
const { container } = render(_jsx(InputGroup, { label: "Sample label", dimension: "small", prefix: _jsx(Textfield, { readOnly: true, size: 6, value: "https://" }), input: _jsx(Textfield, { type: "text", defaultValue: "sample-domain" }), suffix: (_jsxs(Select, { defaultValue: 1, children: [_jsx("option", { value: "1", children: ".com" }), _jsx("option", { value: "2", children: ".it" }), _jsx("option", { value: "3", children: ".org" }), _jsx("option", { value: "4", children: ".dev" }), _jsx("option", { value: "5", children: ".io" })] })) }));
|
|
28
|
+
expect(container).not.toBeNull();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-progress.test.d.ts","sourceRoot":"","sources":["../../../src/components/linear-progress/linear-progress.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { LinearProgress } from './linear-progress';
|
|
19
|
+
describe('<LinearProgress>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const { container } = render(_jsx(LinearProgress, {}));
|
|
22
|
+
expect(container).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
test(' it should render properly with pros', () => {
|
|
25
|
+
const { container } = render(_jsx(LinearProgress, { value: 50, max: 99, dimension: "big", showProgress: true }));
|
|
26
|
+
expect(container).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
test(' it should render properly with value 0', () => {
|
|
29
|
+
const { container } = render(_jsx(LinearProgress, { value: 0, max: 99, dimension: "regular", showProgress: true }));
|
|
30
|
+
expect(container).not.toBeNull();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.test.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { List } from './list';
|
|
19
|
+
describe('<List>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const { container } = render(_jsxs(List, { children: [_jsx(List.Li, { marker: "circle-check", markerColor: "var(--highlight-green-foreground)", children: "List item text" }), _jsx(List.Li, { dimension: "small", children: "List item text no props" })] }));
|
|
22
|
+
expect(container).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
test(' it should render properly with no marker as "ol"', () => {
|
|
25
|
+
const { container } = render(_jsxs(List, { hideMarker: true, as: "ol", children: [_jsx(List.Li, { marker: "circle-check", markerColor: "var(--highlight-green-foreground)", children: "List item text" }), _jsx(List.Li, { dimension: "small", children: "List item text no props" })] }));
|
|
26
|
+
expect(container).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masonry.test.d.ts","sourceRoot":"","sources":["../../../src/components/masonry/masonry.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 Wonderflow Design Team
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { render } from '@testing-library/react';
|
|
18
|
+
import { Masonry } from './masonry';
|
|
19
|
+
describe('<Masonry>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const { container } = render(_jsxs(Masonry, { children: [_jsx("div", { children: "1" }), _jsx("div", { children: "2" }), _jsx("div", { children: "3" }), _jsx("div", { children: "4" }), _jsx("div", { children: "5" })] }));
|
|
22
|
+
expect(container).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
test(' it should render properly with props', () => {
|
|
25
|
+
const { container } = render(_jsxs(Masonry, { columns: { default: 1, small: 3 }, children: [_jsx("div", { children: "1" }), _jsx("div", { children: "2" }), _jsx("div", { children: "3" }), _jsx("div", { children: "4" }), _jsx("div", { children: "5" })] }));
|
|
26
|
+
expect(container).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -40,8 +40,6 @@ export declare type MenuItemProps = {
|
|
|
40
40
|
* This space is used to keep the content aligned across items with or without icons.
|
|
41
41
|
* We suggest to not remove the padding if you have items with icons in the same menu to
|
|
42
42
|
* keep a good readability.
|
|
43
|
-
*
|
|
44
|
-
* Read more: https://design.wonderflow.ai/design/recipes/menu/#items-with-icons
|
|
45
43
|
*/
|
|
46
44
|
padding?: boolean;
|
|
47
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACO,SAAS,EACtB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,WAAW,EAAiB,WAAW,EAExC,MAAM,cAAc,CAAC;AAItB,oBAAY,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACO,SAAS,EACtB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,WAAW,EAAiB,WAAW,EAExC,MAAM,cAAc,CAAC;AAItB,oBAAY,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,aAAK,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAEpF,eAAO,MAAM,QAAQ,qBAmGI,CAAC"}
|
|
@@ -31,7 +31,7 @@ export const MenuItem = forwardRef(({ className, children, subtext, onClick, ico
|
|
|
31
31
|
}
|
|
32
32
|
}, [handleClick, onClick, value]);
|
|
33
33
|
const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", fill: false, className: styles.ItemContent, hAlign: isIconRight ? 'space-between' : 'start', vAlign: "center", columnGap: 8, hPadding: 16, vPadding: 8, "data-menu-item-icon-right": isIconRight, "data-menu-item-has-icon": Boolean(icon), "data-menu-item-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Symbol, { className: styles.Icon, source: icon, dimension: dimension === 'small' ? 12 : 16 })), _jsxs(Stack, { className: styles.DecorationContent, columnGap: 16, fill: false, direction: "row", hAlign: "space-between", children: [_jsxs(Stack, { direction: "column", children: [children, subtext && _jsx(Text, { size: 14, style: { fontWeight: '400' }, children: subtext })] }), decoration] })] })), [children, subtext, dimension, icon, isIconRight, decoration, padding]);
|
|
34
|
-
return (_jsx(Stack, { as: "li", role: "none", children: _jsx(Wrapper, { autoFocus: autoFocus, ref: itemRef, role: "menuitem", className: clsx(styles.MenuItem, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-menu-item-dimension": dimension, ...otherProps, children: description
|
|
34
|
+
return (_jsx(Stack, { as: "li", role: "none", children: _jsx(Wrapper, { autoFocus: autoFocus, ref: itemRef, role: "menuitem", className: clsx(styles.MenuItem, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-menu-item-dimension": dimension, "data-testid": "MenuItem", ...otherProps, children: description
|
|
35
35
|
? (_jsx(Tooltip, { fill: true, open: isFocused, placement: "right-start", interactive: true, trigger: InnerContent, children: description }))
|
|
36
36
|
: InnerContent }) }));
|
|
37
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.MenuItem{--padding:2.50rem;background:none;border:0;box-sizing:border-box;color:var(--dimmed-6);cursor:pointer;font:inherit;font-size:1rem;font-weight:600;inline-size:100%;padding:0;position:relative;text-align:start}.MenuItem:hover{color:var(--global-foreground)}.MenuItem[aria-checked=true]{color:var(--global-interactive-text)}.MenuItem:before{border-radius
|
|
1
|
+
@layer components{.MenuItem{--padding:2.50rem;background:none;border:0;box-sizing:border-box;color:var(--dimmed-6);cursor:pointer;font:inherit;font-size:1rem;font-weight:600;inline-size:100%;padding:0;position:relative;text-align:start}.MenuItem:hover{color:var(--global-foreground)}.MenuItem[aria-checked=true]{color:var(--global-interactive-text)}.MenuItem:before{border-radius:0;bottom:0;content:"";left:0;opacity:.6;position:absolute;right:0;top:0;z-index:0}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]){outline:none}.MenuItem:is(:hover,:focus-visible,[aria-pressed=true]):not([aria-disabled=true]):before{background-color:var(--dimmed-1)}.MenuItem[data-menu-item-dimension=small]{--padding:2.25rem;font-size:.88rem}.MenuItem>*{position:relative}.MenuItem[aria-disabled=true]{color:var(--global-disabled-foreground);cursor:not-allowed}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=false]{padding-left:var(--padding)}.MenuItem [data-menu-item-padding=true][data-menu-item-has-icon=false][data-menu-item-icon-right=true]{padding-right:var(--padding)}.ItemContent{position:relative}.DecorationContent{flex-grow:1}.Icon{align-self:flex-start;flex-grow:0;flex-shrink:0;margin-top:4px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.Menu{background-color:var(--global-background);border:1px solid var(--dimmed-1);border-radius:.5rem;list-style-type:none;overflow:hidden;position:relative}.Menu hr{margin:0
|
|
1
|
+
@layer components{.Menu{background-color:var(--global-background);border:1px solid var(--dimmed-1);border-radius:.5rem;list-style-type:none;overflow:hidden;position:relative}.Menu hr{margin:0}.Menu[data-menu-should-scroll=true]{-webkit-overflow-scrolling:touch;max-height:var(--max-height);overflow:auto;overscroll-behavior:contain}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.stories.d.ts","sourceRoot":"","sources":["../../../src/components/menu/menu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,IAAI,CAGrC,CAAC;AAEF,eAAe,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.stories.d.ts","sourceRoot":"","sources":["../../../src/components/menu/menu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,IAAI,CAGrC,CAAC;AAEF,eAAe,KAAK,CAAC;AAoBrB,eAAO,MAAM,OAAO;;;;;;EAAoB,CAAC;AAEzC,eAAO,MAAM,aAAa;;;;;;EAAoB,CAAC;AAe/C,eAAO,MAAM,SAAS;;;;;;EAA6B,CAAC;AA0BpD,eAAO,MAAM,cAAc;;;;;;EAAgC,CAAC;AAY5D,eAAO,MAAM,MAAM;;;;;;EAAyB,CAAC"}
|
|
@@ -7,7 +7,7 @@ const story = {
|
|
|
7
7
|
component: Menu,
|
|
8
8
|
};
|
|
9
9
|
export default story;
|
|
10
|
-
const Template = args => (_jsxs(Menu, { ...args, children: [_jsx(Menu.Item, { value: "1", padding: false, children: "List item text" }), _jsx(Menu.Item, { value: "2", padding: false, children: "List item text" }), _jsx(Menu.Item, { value: "3", padding: false, children: "List item text List item
|
|
10
|
+
const Template = args => (_jsxs(Menu, { ...args, children: [_jsx(Menu.Item, { value: "1", padding: false, children: "List item text" }), _jsx(Menu.Item, { value: "2", padding: false, children: "List item text" }), _jsx(Menu.Item, { value: "3", padding: false, children: "List item text List item text List item text List item text List item text" }), _jsx(Menu.Separator, {}), _jsx(Menu.Item, { value: "4", padding: false, children: "List item text" }), _jsx(Menu.Item, { value: "5", padding: false, subtext: "Hint text", children: "List item text with subtext" }), _jsx(Menu.Separator, {}), _jsx(Menu.Item, { value: "6", padding: false, children: _jsxs("span", { children: [_jsx(Title, { level: "6", children: "Cutom item" }), _jsx(Text, { size: 14, dimmed: 5, children: "Custom sub text example" })] }) })] }));
|
|
11
11
|
export const Default = Template.bind({});
|
|
12
12
|
export const WithMaxHeight = Template.bind({});
|
|
13
13
|
WithMaxHeight.args = {
|
|
@@ -20,5 +20,5 @@ const WithCheckboxTemplate = (args) => {
|
|
|
20
20
|
return (_jsxs(Menu, { ...args, children: [_jsx(Menu.ItemCheckbox, { value: "1", checked: isChecked, icon: isChecked ? 'check' : undefined, onClick: () => setIsChecked(val => !val), children: "Checkable item" }), _jsx(Menu.Item, { value: "2", icon: "compass", decoration: _jsx(Chip, { dimension: "small", color: "blue", children: "Decoration" }), children: "List item text" })] }));
|
|
21
21
|
};
|
|
22
22
|
export const WithCheckboxes = WithCheckboxTemplate.bind({});
|
|
23
|
-
const LinksTemplate = args => (_jsxs(Menu, { ...args, children: [_jsx(Menu.Item, { value: "1", as: "a", href: "https://design.wonderflow.ai", icon: "user", children: "List item text" }), _jsx(Menu.Item, { value: "2", icon: "message", children: "List item text
|
|
23
|
+
const LinksTemplate = args => (_jsxs(Menu, { ...args, children: [_jsx(Menu.Item, { value: "1", as: "a", href: "https://design.wonderflow.ai", target: "_blank", icon: "user", children: "List item text as Link in new Tab" }), _jsx(Menu.Item, { value: "2", icon: "message", children: "List item text" }), _jsx(Menu.Separator, {}), _jsx(Menu.Item, { value: "3", children: "List item text" }), _jsx(Menu.Item, { value: "4", as: "a", href: "https://design.wonderflow.ai", icon: "bell", children: "List item text as Link" })] }));
|
|
24
24
|
export const AsLink = LinksTemplate.bind({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.test.d.ts","sourceRoot":"","sources":["../../../src/components/menu/menu.test.tsx"],"names":[],"mappings":""}
|