@wonderflow/react-components 10.18.1 → 10.19.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-context.js +1 -1
- package/dist/components/accordion/accordion-item.js +1 -1
- package/dist/components/accordion/accordion.js +1 -1
- 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/accordion/index.js +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.js +1 -1
- 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/aspect-ratio/index.js +1 -1
- package/dist/components/autocomplete/autocomplete-option.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-option.js +2 -2
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +7 -4
- 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/autocomplete/index.js +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- 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/avatar/index.js +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +2 -2
- 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/button/index.js +1 -1
- 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/card/index.js +1 -1
- 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/chip/index.js +1 -1
- package/dist/components/circular-progress/circular-progress.js +1 -1
- 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/circular-progress/index.js +1 -1
- package/dist/components/clamp-text/clamp-text.d.ts.map +1 -1
- package/dist/components/clamp-text/clamp-text.js +2 -2
- 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/clamp-text/index.js +1 -1
- package/dist/components/container/container.js +1 -1
- 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/container/index.js +1 -1
- package/dist/components/datetime/datetime.js +1 -1
- 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/datetime/index.js +1 -1
- package/dist/components/disclosure/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.js +2 -2
- 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/disclosure/index.js +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/elevator/elevator.js +1 -1
- 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/elevator/index.js +1 -1
- package/dist/components/expander/expander.d.ts.map +1 -1
- package/dist/components/expander/expander.js +2 -2
- 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/expander/index.js +1 -1
- 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/grid/index.js +1 -1
- package/dist/components/grid/item/grid-item.js +1 -1
- package/dist/components/icon-button/icon-button.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/info-state/index.js +1 -1
- package/dist/components/info-state/info-state.js +1 -1
- 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/index.js +1 -1
- package/dist/components/input-group/input-group.js +1 -1
- 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/index.js +1 -1
- package/dist/components/linear-progress/linear-progress.js +1 -1
- 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/index.js +1 -1
- package/dist/components/list/list-item.js +1 -1
- package/dist/components/list/list.js +1 -1
- 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/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/menu/menu-item/menu-item-checkbox.js +1 -1
- 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 +2 -2
- package/dist/components/menu/menu-separator/menu-separator.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- 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/modal/content/modal-content.js +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/overlay-container/index.js +1 -1
- package/dist/components/overlay-container/overlay-container.js +1 -1
- package/dist/components/overlay-container/overlay-container.stories.js +2 -2
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination.js +2 -2
- 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/index.js +1 -1
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +5 -2
- package/dist/components/popover/popover.stories.d.ts.map +1 -1
- package/dist/components/popover/popover.stories.js +1 -1
- 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/index.js +1 -1
- package/dist/components/prose/prose.js +1 -1
- 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/index.js +1 -1
- package/dist/components/select/select.js +1 -1
- 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/checkbox.js +1 -1
- package/dist/components/selection-controls/index.js +1 -1
- package/dist/components/selection-controls/radio.js +1 -1
- 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/selection-controls/toggle.js +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/separator/separator.js +1 -1
- 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/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +2 -2
- 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/index.js +1 -1
- package/dist/components/snackbar/snackbar.js +1 -1
- 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/index.js +1 -1
- package/dist/components/spinner/spinner.js +1 -1
- 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/index.js +1 -1
- package/dist/components/split-button/split-button.js +1 -1
- 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/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/star-meter/star-meter.d.ts.map +1 -1
- package/dist/components/star-meter/star-meter.js +2 -5
- 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/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/tab/tab.d.ts.map +1 -1
- package/dist/components/tab/tab.js +2 -2
- 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/tab/tabs-panel.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table-cell/index.js +1 -1
- package/dist/components/table/table-cell/table-cell.js +1 -1
- 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/index.js +1 -1
- package/dist/components/table/table-checkbox/table-checkbox.js +1 -1
- 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/index.js +1 -1
- 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 +2 -2
- package/dist/components/table/table-expand/index.js +1 -1
- package/dist/components/table/table-header/index.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/index.js +1 -1
- package/dist/components/table/table-pagination/table-pagination.js +1 -1
- 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/index.js +1 -1
- package/dist/components/table/table-row/table-row.js +1 -1
- 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.js +1 -1
- 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/table/types.js +1 -1
- package/dist/components/text/index.js +1 -1
- 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/base-field/index.js +1 -1
- package/dist/components/textfield/index.js +1 -1
- 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/index.js +1 -1
- package/dist/components/title/title.js +1 -1
- 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/index.js +1 -1
- package/dist/components/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/toggle-button/toggle-button.js +2 -2
- 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/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +7 -3
- 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 +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/providers/index.js +1 -1
- package/dist/providers/overlay.js +1 -1
- 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/dist/providers/responsive.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/polymorphic/index.js +1 -1
- package/package.json +18 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -24,5 +24,5 @@ export const ClampText = forwardRef(({ className, children, rows = 1, style, exp
|
|
|
24
24
|
'--r': rows,
|
|
25
25
|
'--padding': expandable && '2rem',
|
|
26
26
|
};
|
|
27
|
-
return (_jsxs(Wrapper, { ref: forwardedRef, className: clsx(styles.ClampText, className), ...otherProps, children: [_jsx("span", { className: styles.Content, "data-clamp-text-expanded": isExpanded, style: { ...dynamicStyle, ...style }, children: children }), expandable && (_jsx(Tooltip, { trigger: (_jsx(ToggleButton, { className: styles.Trigger, pressed: isExpanded, onClick: () => setIsExpandend(state => !state), restingIcon: "plus", pressedIcon: "minus", dimension: "small", kind: "secondary" })), children: `${isExpanded ? 'Collapse' : 'Expand'} text` }))] }));
|
|
27
|
+
return (_jsxs(Wrapper, { ref: forwardedRef, className: clsx(styles.ClampText, className), ...otherProps, children: [_jsx("span", { className: styles.Content, "data-clamp-text-expanded": isExpanded, style: { ...dynamicStyle, ...style }, children: children }), expandable && (_jsx(Tooltip, { trigger: (_jsx(ToggleButton, { "data-testid": "ExpandableButton", className: styles.Trigger, pressed: isExpanded, onClick: () => setIsExpandend(state => !state), restingIcon: "plus", pressedIcon: "minus", dimension: "small", kind: "secondary" })), children: `${isExpanded ? 'Collapse' : 'Expand'} text` }))] }));
|
|
28
28
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp-text.test.d.ts","sourceRoot":"","sources":["../../../src/components/clamp-text/clamp-text.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { ClampText } from './clamp-text';
|
|
20
|
+
const innerText = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Tenetur fugit odit neque mollitia voluptate? Natus quibusdam dicta minus! Officiis velit ex facere, repudiandae cum maiores excepturi porro recusandae necessitatibus voluptatum veniam, unde voluptates fugiat labore voluptas eius tempore, facilis animi ut ipsum quo? Placeat, atque fuga pariatur hic obcaecati, nam accusamus dolor natus nostrum odit rerum iusto suscipit ducimus nobis eos? Voluptas accusamus repellat sit deleniti adipisci eum dolorem repudiandae mollitia, obcaecati rem eius vitae sint expedita cum rerum quos voluptatibus fugit ipsa impedit aliquid voluptates officia. Veniam, beatae laboriosam at quia error harum, adipisci commodi exercitationem cumque repellat doloribus cum aut tenetur animi recusandae. Neque reiciendis dolores, fugiat unde delectus incidunt dolorum temporibus rerum repellendus nemo iusto expedita placeat!';
|
|
21
|
+
describe('<ClampText>', () => {
|
|
22
|
+
test(' it should render properly', () => {
|
|
23
|
+
const { container } = render(_jsx(ClampText, { rows: 3, children: innerText }));
|
|
24
|
+
expect(container).not.toBeNull();
|
|
25
|
+
});
|
|
26
|
+
test(' it should render properly w/o # of rows', () => {
|
|
27
|
+
const { container } = render(_jsx(ClampText, { children: innerText }));
|
|
28
|
+
expect(container).not.toBeNull();
|
|
29
|
+
});
|
|
30
|
+
test(' it should expand properly', () => {
|
|
31
|
+
const { container, getByTestId } = render(_jsx(ClampText, { expandable: true, rows: 1, children: innerText }));
|
|
32
|
+
const btn = getByTestId('ExpandableButton');
|
|
33
|
+
expect(btn).toBeDefined();
|
|
34
|
+
fireEvent.click(btn);
|
|
35
|
+
expect(container).not.toBeNull();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.test.d.ts","sourceRoot":"","sources":["../../../src/components/container/container.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { Container } from './container';
|
|
19
|
+
describe('<Container>', () => {
|
|
20
|
+
test(' it should render properly', () => {
|
|
21
|
+
const { container } = render(_jsx(Container, { children: "Content" }));
|
|
22
|
+
expect(container).not.toBeNull();
|
|
23
|
+
});
|
|
24
|
+
test(' it should render properly with props', () => {
|
|
25
|
+
const { container } = render(_jsx(Container, { dimension: "medium", padding: true, children: "Content" }));
|
|
26
|
+
expect(container).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.test.d.ts","sourceRoot":"","sources":["../../../src/components/datetime/datetime.test.tsx"],"names":[],"mappings":""}
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -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
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -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
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright 2022 Wonderflow
|
|
3
|
+
* Copyright 2022-2023 Wonderflow Design Team
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-state.test.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.test.tsx"],"names":[],"mappings":""}
|