@wonderflow/react-components 10.20.0 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/basic.css +1 -1
- package/core.css +1 -1
- package/dist/components/accordion/accordion.test.js +0 -15
- package/dist/components/aspect-ratio/aspect-ratio.test.js +0 -15
- package/dist/components/autocomplete/autocomplete.d.ts +4 -0
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +2 -4
- package/dist/components/autocomplete/autocomplete.module.css +1 -1
- package/dist/components/autocomplete/autocomplete.test.js +0 -15
- package/dist/components/avatar/avatar.module.css +1 -1
- package/dist/components/avatar/avatar.test.js +0 -15
- package/dist/components/button/button.d.ts +1 -2
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.module.css +1 -1
- package/dist/components/button/button.stories.d.ts +4 -4
- package/dist/components/button/button.stories.d.ts.map +1 -1
- package/dist/components/button/button.test.js +0 -15
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/card.module.css +1 -1
- package/dist/components/card/card.test.js +0 -15
- package/dist/components/chip/chip.module.css +1 -1
- package/dist/components/chip/chip.test.js +0 -15
- package/dist/components/circular-progress/circular-progress.test.js +0 -15
- package/dist/components/clamp-text/clamp-text.test.js +0 -15
- package/dist/components/container/container.d.ts +1 -1
- package/dist/components/container/container.d.ts.map +1 -1
- package/dist/components/container/container.module.css +1 -1
- package/dist/components/container/container.stories.d.ts +4 -5
- package/dist/components/container/container.stories.d.ts.map +1 -1
- package/dist/components/container/container.stories.js +11 -14
- package/dist/components/container/container.test.js +0 -15
- package/dist/components/datetime/datetime.test.js +0 -15
- package/dist/components/disclosure/disclosure.module.css +1 -1
- package/dist/components/disclosure/disclosure.test.d.ts.map +1 -1
- package/dist/components/disclosure/disclosure.test.js +0 -15
- package/dist/components/elevator/elevator.test.js +0 -15
- package/dist/components/expander/expander.test.js +0 -15
- package/dist/components/grid/grid.test.js +0 -15
- package/dist/components/info-state/info-state.d.ts.map +1 -1
- package/dist/components/info-state/info-state.js +1 -9
- package/dist/components/info-state/info-state.module.css +1 -1
- package/dist/components/info-state/info-state.stories.d.ts +31 -31
- package/dist/components/info-state/info-state.stories.d.ts.map +1 -1
- package/dist/components/info-state/info-state.stories.js +5 -5
- package/dist/components/info-state/info-state.test.js +0 -15
- package/dist/components/input-group/input-group.test.js +0 -15
- package/dist/components/linear-progress/linear-progress.module.css +1 -1
- package/dist/components/linear-progress/linear-progress.test.js +0 -15
- package/dist/components/list/list.module.css +1 -1
- package/dist/components/list/list.test.js +0 -15
- package/dist/components/masonry/masonry.test.js +0 -15
- package/dist/components/menu/menu-item/menu-item.d.ts.map +1 -1
- package/dist/components/menu/menu-item/menu-item.js +3 -1
- package/dist/components/menu/menu-item/menu-item.module.css +1 -1
- package/dist/components/menu/menu-item/menu-item.stories.d.ts.map +1 -1
- package/dist/components/menu/menu-item/menu-item.stories.js +1 -0
- package/dist/components/menu/menu.test.js +0 -15
- package/dist/components/modal/content/modal-content.d.ts +7 -8
- package/dist/components/modal/content/modal-content.d.ts.map +1 -1
- package/dist/components/modal/content/modal-content.js +3 -7
- package/dist/components/modal/content/modal-content.module.css +1 -1
- package/dist/components/modal/footer/modal-footer.d.ts +32 -0
- package/dist/components/modal/footer/modal-footer.d.ts.map +1 -0
- package/dist/components/modal/footer/modal-footer.js +22 -0
- package/dist/components/modal/footer/modal-footer.module.css +1 -0
- package/dist/components/modal/header/modal-header.d.ts +20 -0
- package/dist/components/modal/header/modal-header.d.ts.map +1 -0
- package/dist/components/modal/header/modal-header.js +26 -0
- package/dist/components/modal/header/modal-header.module.css +1 -0
- package/dist/components/modal/modal.d.ts +79 -7
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +16 -6
- package/dist/components/modal/modal.module.css +1 -1
- package/dist/components/modal/modal.stories.d.ts +69 -5
- package/dist/components/modal/modal.stories.d.ts.map +1 -1
- package/dist/components/modal/modal.stories.js +145 -10
- package/dist/components/modal/modal.test.d.ts +2 -0
- package/dist/components/modal/modal.test.d.ts.map +1 -0
- package/dist/components/modal/modal.test.js +60 -0
- package/dist/components/overlay-container/overlay-container.test.d.ts +2 -0
- package/dist/components/overlay-container/overlay-container.test.d.ts.map +1 -0
- package/dist/components/overlay-container/overlay-container.test.js +19 -0
- package/dist/components/pagination/pagination.test.js +0 -15
- package/dist/components/popover/popover.d.ts +4 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +6 -8
- package/dist/components/popover/popover.module.css +1 -1
- package/dist/components/popover/popover.stories.d.ts +13 -9
- package/dist/components/popover/popover.stories.d.ts.map +1 -1
- package/dist/components/popover/popover.stories.js +8 -2
- package/dist/components/popover/popover.test.js +0 -15
- package/dist/components/prose/prose.test.js +0 -15
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.module.css +1 -1
- package/dist/components/select/select.test.js +0 -15
- package/dist/components/selection-controls/selection-controls.test.js +0 -15
- package/dist/components/separator/separator.test.js +0 -15
- package/dist/components/skeleton/skeleton.test.js +0 -15
- package/dist/components/slider/slider.test.js +0 -15
- package/dist/components/snackbar/snackbar.test.js +0 -15
- package/dist/components/spinner/spinner.test.js +0 -15
- package/dist/components/split-button/split-button.test.js +0 -15
- package/dist/components/stack/stack.test.js +0 -15
- package/dist/components/star-meter/star-meter.module.css +1 -1
- package/dist/components/star-meter/star-meter.test.js +0 -15
- package/dist/components/symbol/symbol.test.js +0 -15
- package/dist/components/tab/tab.js +1 -1
- package/dist/components/tab/tab.module.css +1 -1
- package/dist/components/tab/tab.stories.d.ts +1 -0
- package/dist/components/tab/tab.stories.d.ts.map +1 -1
- package/dist/components/tab/tab.stories.js +4 -17
- package/dist/components/tab/tab.test.js +0 -15
- package/dist/components/table/table-cell/table-cell.test.js +0 -15
- package/dist/components/table/table-checkbox/table-checkbox.test.js +0 -15
- package/dist/components/table/table-controls/table-controls.test.js +0 -15
- package/dist/components/table/table-header/table-header.test.js +0 -15
- package/dist/components/table/table-pagination/table-pagination.test.js +0 -15
- package/dist/components/table/table-row/table-row.test.js +0 -15
- package/dist/components/table/table.module.css +1 -1
- package/dist/components/table/table.stories.d.ts.map +1 -1
- package/dist/components/table/table.stories.js +1 -0
- package/dist/components/table/table.test.js +0 -15
- package/dist/components/text/text.module.css +1 -1
- package/dist/components/text/text.test.js +0 -15
- package/dist/components/textfield/textfield.module.css +1 -1
- package/dist/components/textfield/textfield.test.js +0 -15
- package/dist/components/title/title.module.css +1 -1
- package/dist/components/title/title.test.js +0 -15
- package/dist/components/toggle-button/toggle-button.test.js +0 -15
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +2 -4
- package/dist/components/tooltip/tooltip.module.css +1 -1
- package/dist/components/tooltip/tooltip.stories.d.ts +1 -1
- package/dist/components/tooltip/tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.stories.js +4 -3
- package/dist/components/tooltip/tooltip.test.js +0 -15
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/useBreakpoints.d.ts +11 -0
- package/dist/hooks/useBreakpoints.d.ts.map +1 -0
- package/dist/hooks/useBreakpoints.js +84 -0
- package/dist/hooks/useBreakpoints.test.d.ts +2 -0
- package/dist/hooks/useBreakpoints.test.d.ts.map +1 -0
- package/dist/hooks/useBreakpoints.test.js +35 -0
- package/dist/hooks/useBreakpointsConfig.d.ts +12 -0
- package/dist/hooks/useBreakpointsConfig.d.ts.map +1 -0
- package/dist/hooks/useBreakpointsConfig.js +31 -0
- package/dist/hooks/useBreakpointsConfig.test.d.ts +2 -0
- package/dist/hooks/useBreakpointsConfig.test.d.ts.map +1 -0
- package/dist/hooks/useBreakpointsConfig.test.js +16 -0
- package/dist/hooks/useSSR.d.ts +5 -0
- package/dist/hooks/useSSR.d.ts.map +1 -0
- package/dist/hooks/useSSR.js +24 -0
- package/dist/hooks/useSSR.test.d.ts +2 -0
- package/dist/hooks/useSSR.test.d.ts.map +1 -0
- package/dist/hooks/useSSR.test.js +11 -0
- package/dist/providers/providers.test.js +11 -17
- package/package.json +5 -4
- package/dist/hooks/usePopupWrapper.d.ts +0 -4
- package/dist/hooks/usePopupWrapper.d.ts.map +0 -1
- package/dist/hooks/usePopupWrapper.js +0 -42
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { Grid } from './grid';
|
|
19
4
|
describe('<Grid>', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-state.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EACE,UAAU,EAAU,WAAW,EACvC,MAAM,cAAc,CAAC;AAItB,oBAAY,cAAc,GAAG,cAAc,CAAC;IAC1C;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7E;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC,CAAA;AAEF,eAAO,MAAM,SAAS;;;;IA9BpB;;;OAGG;WACI,SAAS;IAChB;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;gBACS,UAAU,CAAC,WAAW,CAAC;IACnC;;;OAGG;cACO,SAAS;;;
|
|
1
|
+
{"version":3,"file":"info-state.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EACE,UAAU,EAAU,WAAW,EACvC,MAAM,cAAc,CAAC;AAItB,oBAAY,cAAc,GAAG,cAAc,CAAC;IAC1C;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7E;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC,CAAA;AAEF,eAAO,MAAM,SAAS;;;;IA9BpB;;;OAGG;WACI,SAAS;IAChB;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;gBACS,UAAU,CAAC,WAAW,CAAC;IACnC;;;OAGG;cACO,SAAS;;;kDA0DnB,CAAC"}
|
|
@@ -20,14 +20,6 @@ import { Stack, Symbol, Text, Title, } from '../..';
|
|
|
20
20
|
import * as styles from './info-state.module.css';
|
|
21
21
|
export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...otherProps }, forwardedRef) => {
|
|
22
22
|
const isHorizontal = direction === 'row';
|
|
23
|
-
return (_jsx(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, hAlign: isHorizontal ? 'start' : 'center', vAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps, children: _jsxs(LazyMotion, { features: domMax, children: [(!image && icon) && (_jsx(m.span, { "data-info-state-icon-color": iconColor, className: styles.IconWrapper,
|
|
24
|
-
scale: [1, 0.8, 1],
|
|
25
|
-
}, transition: {
|
|
26
|
-
duration: 0.8,
|
|
27
|
-
repeat: Infinity,
|
|
28
|
-
repeatDelay: 5.2,
|
|
29
|
-
repeatType: 'reverse',
|
|
30
|
-
type: 'spring',
|
|
31
|
-
}, children: _jsx(Symbol, { source: icon, dimension: 48 }) })), (image && !icon) && _jsx("img", { className: styles.Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }), _jsxs(Stack, { rowGap: 16, hAlign: isHorizontal ? 'start' : 'center', vAlign: "center", fill: false, children: [_jsx(Title, { maxWidth: "20ch", textAlign: isHorizontal ? 'start' : 'center', level: "4", children: title }), _jsx(Text, { as: "div", maxWidth: "60ch", dimmed: 6, textAlign: isHorizontal ? 'start' : 'center', children: children }), actions && (_jsx(Stack, { vPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true, children: actions }))] })] }) }));
|
|
23
|
+
return (_jsx(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, hAlign: isHorizontal ? 'start' : 'center', vAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps, children: _jsxs(LazyMotion, { features: domMax, children: [(!image && icon) && (_jsx(m.span, { "data-info-state-icon-color": iconColor, className: styles.IconWrapper, children: _jsx(Symbol, { source: icon, dimension: 48 }) })), (image && !icon) && _jsx("img", { className: styles.Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }), _jsxs(Stack, { rowGap: 16, hAlign: isHorizontal ? 'start' : 'center', vAlign: "center", fill: false, children: [_jsx(Title, { maxWidth: "20ch", textAlign: isHorizontal ? 'start' : 'center', level: "4", children: title }), _jsx(Text, { as: "div", maxWidth: "60ch", dimmed: 6, textAlign: isHorizontal ? 'start' : 'center', children: children }), actions && (_jsx(Stack, { vPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true, children: actions }))] })] }) }));
|
|
32
24
|
});
|
|
33
25
|
InfoState.displayName = 'InfoState';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.IconWrapper{background-color:var(--bg);border-radius:.5rem;color:var(--fg);display:block;padding:.5rem;position:relative}.IconWrapper:before{
|
|
1
|
+
@layer components{.IconWrapper{background-color:var(--bg);border:8px solid hsla(0,0%,100%,.6);border-radius:.5rem;color:var(--fg);display:block;padding:.5rem;position:relative}.IconWrapper:before{background-color:var(--bg,currentColor);border-radius:inherit;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:-1}.IconWrapper svg{display:block}.IconWrapper[data-info-state-icon-color=cyan]{--bg:var(--highlight-cyan-background);--fg:var(--highlight-cyan-foreground)}.IconWrapper[data-info-state-icon-color=gray]{--bg:var(--highlight-gray-background);--fg:var(--highlight-gray-foreground)}.IconWrapper[data-info-state-icon-color=green]{--bg:var(--highlight-green-background);--fg:var(--highlight-green-foreground)}.IconWrapper[data-info-state-icon-color=purple]{--bg:var(--highlight-purple-background);--fg:var(--highlight-purple-foreground)}.IconWrapper[data-info-state-icon-color=yellow]{--bg:var(--highlight-yellow-background);--fg:var(--highlight-yellow-foreground)}.IconWrapper[data-info-state-icon-color=red]{--bg:var(--highlight-red-background);--fg:var(--highlight-red-foreground)}.IconWrapper[data-info-state-icon-color=blue]{--bg:var(--highlight-blue-background);--fg:var(--highlight-blue-foreground)}.Image{max-block-size:22rem;max-inline-size:22rem}}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { InfoState } from './info-state';
|
|
4
4
|
declare const story: ComponentMeta<typeof InfoState>;
|
|
5
5
|
export default story;
|
|
6
|
-
export declare const Default: ComponentStory<
|
|
6
|
+
export declare const Default: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
7
7
|
style?: Record<string, any> | undefined;
|
|
8
8
|
className?: string | undefined;
|
|
9
9
|
} & {
|
|
10
|
-
title:
|
|
11
|
-
icon?: import("packages/symbols/dist").SymbolNames |
|
|
10
|
+
title: import("react").ReactNode;
|
|
11
|
+
icon?: import("packages/symbols/dist").SymbolNames | import("react").ReactElement<HTMLOrSVGElement, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
12
12
|
iconColor?: "gray" | "blue" | "cyan" | "green" | "purple" | "red" | "yellow" | undefined;
|
|
13
13
|
image?: string | undefined;
|
|
14
14
|
direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
15
|
-
actions?:
|
|
15
|
+
actions?: import("react").ReactNode;
|
|
16
16
|
} & {
|
|
17
|
-
children?:
|
|
18
|
-
} &
|
|
19
|
-
export declare const Horizontal: ComponentStory<
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
19
|
+
export declare const Horizontal: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
20
20
|
style?: Record<string, any> | undefined;
|
|
21
21
|
className?: string | undefined;
|
|
22
22
|
} & {
|
|
23
|
-
title:
|
|
24
|
-
icon?: import("packages/symbols/dist").SymbolNames |
|
|
23
|
+
title: import("react").ReactNode;
|
|
24
|
+
icon?: import("packages/symbols/dist").SymbolNames | import("react").ReactElement<HTMLOrSVGElement, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
25
25
|
iconColor?: "gray" | "blue" | "cyan" | "green" | "purple" | "red" | "yellow" | undefined;
|
|
26
26
|
image?: string | undefined;
|
|
27
27
|
direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
28
|
-
actions?:
|
|
28
|
+
actions?: import("react").ReactNode;
|
|
29
29
|
} & {
|
|
30
|
-
children?:
|
|
31
|
-
} &
|
|
32
|
-
export declare const WithImage: ComponentStory<
|
|
30
|
+
children?: import("react").ReactNode;
|
|
31
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
32
|
+
export declare const WithImage: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
33
33
|
style?: Record<string, any> | undefined;
|
|
34
34
|
className?: string | undefined;
|
|
35
35
|
} & {
|
|
36
|
-
title:
|
|
37
|
-
icon?: import("packages/symbols/dist").SymbolNames |
|
|
36
|
+
title: import("react").ReactNode;
|
|
37
|
+
icon?: import("packages/symbols/dist").SymbolNames | import("react").ReactElement<HTMLOrSVGElement, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
38
38
|
iconColor?: "gray" | "blue" | "cyan" | "green" | "purple" | "red" | "yellow" | undefined;
|
|
39
39
|
image?: string | undefined;
|
|
40
40
|
direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
41
|
-
actions?:
|
|
41
|
+
actions?: import("react").ReactNode;
|
|
42
42
|
} & {
|
|
43
|
-
children?:
|
|
44
|
-
} &
|
|
45
|
-
export declare const WithImageHorizontal: ComponentStory<
|
|
43
|
+
children?: import("react").ReactNode;
|
|
44
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
45
|
+
export declare const WithImageHorizontal: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
46
46
|
style?: Record<string, any> | undefined;
|
|
47
47
|
className?: string | undefined;
|
|
48
48
|
} & {
|
|
49
|
-
title:
|
|
50
|
-
icon?: import("packages/symbols/dist").SymbolNames |
|
|
49
|
+
title: import("react").ReactNode;
|
|
50
|
+
icon?: import("packages/symbols/dist").SymbolNames | import("react").ReactElement<HTMLOrSVGElement, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
51
51
|
iconColor?: "gray" | "blue" | "cyan" | "green" | "purple" | "red" | "yellow" | undefined;
|
|
52
52
|
image?: string | undefined;
|
|
53
53
|
direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
54
|
-
actions?:
|
|
54
|
+
actions?: import("react").ReactNode;
|
|
55
55
|
} & {
|
|
56
|
-
children?:
|
|
57
|
-
} &
|
|
58
|
-
export declare const WithActions: ComponentStory<
|
|
56
|
+
children?: import("react").ReactNode;
|
|
57
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
58
|
+
export declare const WithActions: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
59
59
|
style?: Record<string, any> | undefined;
|
|
60
60
|
className?: string | undefined;
|
|
61
61
|
} & {
|
|
62
|
-
title:
|
|
63
|
-
icon?: import("packages/symbols/dist").SymbolNames |
|
|
62
|
+
title: import("react").ReactNode;
|
|
63
|
+
icon?: import("packages/symbols/dist").SymbolNames | import("react").ReactElement<HTMLOrSVGElement, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
64
64
|
iconColor?: "gray" | "blue" | "cyan" | "green" | "purple" | "red" | "yellow" | undefined;
|
|
65
65
|
image?: string | undefined;
|
|
66
66
|
direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
67
|
-
actions?:
|
|
67
|
+
actions?: import("react").ReactNode;
|
|
68
68
|
} & {
|
|
69
|
-
children?:
|
|
70
|
-
} &
|
|
69
|
+
children?: import("react").ReactNode;
|
|
70
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
71
71
|
//# sourceMappingURL=info-state.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-state.stories.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"info-state.stories.d.ts","sourceRoot":"","sources":["../../../src/components/info-state/info-state.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CAY1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAWrB,eAAO,MAAM,OAAO;;;;;;;;;;;;mDAAoB,CAAC;AAKzC,eAAO,MAAM,UAAU;;;;;;;;;;;;mDAAoB,CAAC;AAM5C,eAAO,MAAM,SAAS;;;;;;;;;;;;mDAAoB,CAAC;AAK3C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;mDAAoB,CAAC;AAMrD,eAAO,MAAM,WAAW;;;;;;;;;;;;mDAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import { Button,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Stack } from '../..';
|
|
3
3
|
import { InfoState } from './info-state';
|
|
4
4
|
const story = {
|
|
5
5
|
title: 'Dialogs/InfoState',
|
|
@@ -15,7 +15,7 @@ const story = {
|
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
export default story;
|
|
18
|
-
const Template = args => (_jsx(InfoState, { ...args, children:
|
|
18
|
+
const Template = args => (_jsx(InfoState, { ...args, children: _jsx(Stack, { hAlign: "center", fill: false, children: "Cras ultricies, elit sit amet cursus consectetur, risus felis ullamcorper nulla, ut scelerisque sapien lorem non sem." }) }));
|
|
19
19
|
export const Default = Template.bind({});
|
|
20
20
|
Default.args = {
|
|
21
21
|
icon: 'compass',
|
|
@@ -27,12 +27,12 @@ Horizontal.args = {
|
|
|
27
27
|
};
|
|
28
28
|
export const WithImage = Template.bind({});
|
|
29
29
|
WithImage.args = {
|
|
30
|
-
image: 'https://
|
|
30
|
+
image: 'https://wonderimages.gumlet.io/placeholders/illustration.png?format=webp&q=100',
|
|
31
31
|
};
|
|
32
32
|
export const WithImageHorizontal = Template.bind({});
|
|
33
33
|
WithImageHorizontal.args = {
|
|
34
34
|
direction: 'row',
|
|
35
|
-
image: 'https://
|
|
35
|
+
image: 'https://wonderimages.gumlet.io/placeholders/illustration.png?format=webp&q=100',
|
|
36
36
|
};
|
|
37
37
|
export const WithActions = Template.bind({});
|
|
38
38
|
WithActions.args = {
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { Button } from '../button';
|
|
19
4
|
import { InfoState } from './info-state';
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { Select } from '../select';
|
|
19
4
|
import { Textfield } from '../textfield';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.LinearProgress,.Progress{position:relative}.Progress{--progress-height:0.
|
|
1
|
+
@layer components{.LinearProgress,.Progress{position:relative}.Progress{--progress-height:0.250rem;--track-color:var(--dimmed-1);--fill-color:var(--cta-default);appearance:none;background:var(--track-color);border:none;display:block;height:var(--progress-height);overflow:hidden;vertical-align:baseline;width:100%}.Progress[data-progress-dimension=big]{--progress-height:0.500rem}.Progress::-webkit-progress-bar{background-color:transparent}.Progress::-webkit-progress-value{background:var(--fill-color);-webkit-transition:width .2s cubic-bezier(0,0,.34,1);transition:width .2s cubic-bezier(0,0,.34,1)}.Progress::-moz-progress-bar{background:var(--fill-color)}.Progress:not([value])::-moz-progress-bar{background:transparent}.Progress:indeterminate{animation:progress-stripes 2s linear infinite;background-image:linear-gradient(to right,transparent 50%,var(--fill-color) 50%,var(--fill-color) 60%,transparent 60%,transparent 71.5%,var(--fill-color) 71.5%,var(--fill-color) 84%,transparent 84%);background-size:200% 100%}.Percentage{left:var(--offset);position:absolute;transform:translateX(var(--translation));transition:left .2s cubic-bezier(0,0,.34,1)}}@keyframes progress-stripes{0%{background-position:left -31.25% top 0;background-size:200% 100%}50%{background-position:left -49% top 0;background-size:800% 100%}to{background-position:left -102% top 0;background-size:400% 100%}}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { LinearProgress } from './linear-progress';
|
|
19
4
|
describe('<LinearProgress>', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.List{--marker-size:1.
|
|
1
|
+
@layer components{.List{--marker-size:1.000rem;--marker-gap:0.500rem}.List[data-list-ordered=false]{list-style:none;padding:0}.List[data-list-size=small]{--marker-size:0.750rem;--marker-gap:0.500rem}.List[data-list-size=big]{--marker-size:1.125rem;--marker-gap:1.000rem}.List[data-list-no-marker=true]{--marker-size:0;--marker-gap:0;list-style:none;padding:0}.Marker{block-size:var(--marker-size);flex-shrink:0;inline-size:var(--marker-size);margin-block-start:calc(var(--marker-size)/2.5)}.List[data-list-size=big] .Marker{margin-block-start:calc(var(--marker-size)/2.8)}}@layer overrides{.ListItem{gap:var(--marker-gap)}[data-list-ordered=true] .ListItem{display:list-item}[data-list-ordered=true] .ListItem::marker{color:var(--dimmed-5)}}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { List } from './list';
|
|
19
4
|
describe('<List>', () => {
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { render } from '@testing-library/react';
|
|
18
3
|
import { Masonry } from './masonry';
|
|
19
4
|
describe('<Masonry>', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.tsx"],"names":[],"mappings":"AAkBA,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,qBAqGI,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { useHover } from 'ahooks';
|
|
17
18
|
import clsx from 'clsx';
|
|
18
19
|
import { forwardRef, useCallback, useMemo, useRef, } from 'react';
|
|
19
20
|
import { useFocusEffect, useRovingTabIndex } from 'react-roving-tabindex';
|
|
@@ -24,6 +25,7 @@ export const MenuItem = forwardRef(({ className, children, subtext, onClick, ico
|
|
|
24
25
|
const [tabIndex, isFocused, handleKeyDown, handleClick] = useRovingTabIndex(itemRef, disabled);
|
|
25
26
|
const isIconRight = iconPosition === 'right';
|
|
26
27
|
useFocusEffect(isFocused, itemRef);
|
|
28
|
+
const isHovering = useHover(itemRef);
|
|
27
29
|
const triggerClick = useCallback((e) => {
|
|
28
30
|
if (onClick) {
|
|
29
31
|
handleClick();
|
|
@@ -32,7 +34,7 @@ export const MenuItem = forwardRef(({ className, children, subtext, onClick, ico
|
|
|
32
34
|
}, [handleClick, onClick, value]);
|
|
33
35
|
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
36
|
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
|
-
? (_jsx(Tooltip, { fill: true, open: isFocused, placement: "
|
|
37
|
+
? (_jsx(Tooltip, { fill: true, open: isFocused || isHovering, placement: "auto", interactive: true, trigger: InnerContent, children: description }))
|
|
36
38
|
: InnerContent }) }));
|
|
37
39
|
});
|
|
38
40
|
MenuItem.displayName = 'Menu.Item';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.MenuItem{--padding:2.
|
|
1
|
+
@layer components{.MenuItem{--padding:2.500rem;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:.875rem}.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
|
-
{"version":3,"file":"menu-item.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIjE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"menu-item.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu-item/menu-item.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIjE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,IAAI,CAAC,IAAI,CAoB1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAsBrB,eAAO,MAAM,WAAW,yHAAwB,CAAC;AA+BjD,eAAO,MAAM,cAAc;;GAAgC,CAAC;AAW5D,eAAO,MAAM,eAAe,yHAAkC,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
import { fireEvent, render } from '@testing-library/react';
|
|
18
3
|
import { Menu } from './menu';
|
|
19
4
|
describe('<Menu>', () => {
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { PropsWithChildren
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
export declare type ModalContentProps = PropsWithChildren<PropsWithClass<{
|
|
3
3
|
/**
|
|
4
|
-
* Set
|
|
5
|
-
* announce the title of the modal when opened.
|
|
4
|
+
* Set Modal content vertically in the center on a mobile screen.
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
alignContentCenter?: boolean;
|
|
8
7
|
/**
|
|
9
8
|
* Set the theme of the content card. To ensure contrast with the default overlay color (dark),
|
|
10
9
|
* this is set to `light` by default.
|
|
11
10
|
*/
|
|
12
11
|
theme?: 'dark' | 'light' | 'auto';
|
|
13
12
|
}>>;
|
|
13
|
+
export declare type ModalContentComponent = React.ForwardRefExoticComponent<ModalContentProps>;
|
|
14
14
|
export declare const ModalContent: import("react").ForwardRefExoticComponent<{
|
|
15
15
|
style?: Record<string, any> | undefined;
|
|
16
16
|
className?: string | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
/**
|
|
19
|
-
* Set
|
|
20
|
-
* announce the title of the modal when opened.
|
|
19
|
+
* Set Modal content vertically in the center on a mobile screen.
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
alignContentCenter?: boolean | undefined;
|
|
23
22
|
/**
|
|
24
23
|
* Set the theme of the content card. To ensure contrast with the default overlay color (dark),
|
|
25
24
|
* this is set to `light` by default.
|
|
26
25
|
*/
|
|
27
26
|
theme?: "auto" | "dark" | "light" | undefined;
|
|
28
27
|
} & {
|
|
29
|
-
children?: ReactNode;
|
|
28
|
+
children?: import("react").ReactNode;
|
|
30
29
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
30
|
//# sourceMappingURL=modal-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/content/modal-content.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/content/modal-content.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKtD,oBAAY,iBAAiB,GAAG,iBAAiB,CAAC,cAAc,CAAC;IAC/D;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CACnC,CAAC,CAAC,CAAA;AAEH,oBAAY,qBAAqB,GAAG,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,CAAA;AAEtF,eAAO,MAAM,YAAY;;;;IAbvB;;OAEG;;IAEH;;;OAGG;;;;kDAyBH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 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.
|
|
@@ -17,10 +17,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import clsx from 'clsx';
|
|
18
18
|
import { forwardRef } from 'react';
|
|
19
19
|
import { AutoFocusInside } from 'react-focus-on';
|
|
20
|
-
import { Elevator, IconButton, Stack, Title, useOverlayContext, } from '../../..';
|
|
21
20
|
import * as styles from './modal-content.module.css';
|
|
22
|
-
export const ModalContent = forwardRef(({ children, className,
|
|
23
|
-
const { onClose, titleId } = useOverlayContext();
|
|
24
|
-
return (_jsx(Elevator, { resting: 4, children: _jsxs("div", { className: clsx(styles.Content, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: [_jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, children: [_jsx(Title, { responsive: false, level: "5", id: titleId, children: title }), onClose && _jsx(IconButton, { onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" })] }), _jsx(AutoFocusInside, { children: children })] }) }));
|
|
25
|
-
});
|
|
21
|
+
export const ModalContent = forwardRef(({ children, className, alignContentCenter = false, theme = 'light', ...otherProps }, forwardedRef) => (_jsx("div", { "aria-label": "Content", className: clsx(styles.Content, className), ref: forwardedRef, "data-theme": theme, "data-center-vertically": alignContentCenter, ...otherProps, children: _jsx(AutoFocusInside, { children: children }) })));
|
|
26
22
|
ModalContent.displayName = 'Modal.Content';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.Content{-webkit-overflow-scrolling:touch;
|
|
1
|
+
@layer components{.Content{-webkit-overflow-scrolling:touch;background-color:var(--global-background);overflow:auto;overscroll-behavior:contain;padding:1.5rem}.Content[data-center-vertically=true]{margin:auto}@media (min-width:48em){.Content{margin:0;min-height:auto}}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare type ModalFooterProps = PropsWithChildren<PropsWithClass<{
|
|
3
|
+
/**
|
|
4
|
+
* Hide the border at the top of the footer. This will be automatically dismissed
|
|
5
|
+
* if no actions are provided.
|
|
6
|
+
*/
|
|
7
|
+
hideBorder?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Set the theme of the content card. To ensure contrast with the default overlay color (dark),
|
|
10
|
+
* this is set to `light` by default.
|
|
11
|
+
*/
|
|
12
|
+
theme?: 'dark' | 'light' | 'auto';
|
|
13
|
+
}>>;
|
|
14
|
+
export declare type ModalFooterComponent = React.ForwardRefExoticComponent<ModalFooterProps>;
|
|
15
|
+
export declare const ModalFooter: import("react").ForwardRefExoticComponent<{
|
|
16
|
+
style?: Record<string, any> | undefined;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
/**
|
|
20
|
+
* Hide the border at the top of the footer. This will be automatically dismissed
|
|
21
|
+
* if no actions are provided.
|
|
22
|
+
*/
|
|
23
|
+
hideBorder?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Set the theme of the content card. To ensure contrast with the default overlay color (dark),
|
|
26
|
+
* this is set to `light` by default.
|
|
27
|
+
*/
|
|
28
|
+
theme?: "auto" | "dark" | "light" | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
children?: import("react").ReactNode;
|
|
31
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
//# sourceMappingURL=modal-footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/footer/modal-footer.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKtD,oBAAY,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC;IAC9D;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CACnC,CAAC,CAAC,CAAA;AAEH,oBAAY,oBAAoB,GAAG,KAAK,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;AAEpF,eAAO,MAAM,WAAW;;;;IAdtB;;;OAGG;;IAEH;;;OAGG;;;;kDAyBH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 clsx from 'clsx';
|
|
18
|
+
import { forwardRef } from 'react';
|
|
19
|
+
import { AutoFocusInside } from 'react-focus-on';
|
|
20
|
+
import * as styles from './modal-footer.module.css';
|
|
21
|
+
export const ModalFooter = forwardRef(({ children, className, hideBorder = false, theme = 'light', ...otherProps }, forwardedRef) => (_jsx("div", { "aria-label": "Footer", className: clsx(styles.Footer, className), ref: forwardedRef, "data-theme": theme, "data-border-hidden": hideBorder || !children, ...otherProps, children: _jsx(AutoFocusInside, { children: children }) })));
|
|
22
|
+
ModalFooter.displayName = 'Modal.Footer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.Footer{align-self:end;background-color:var(--global-background);border-top:1px solid var(--dimmed-1);bottom:0;margin-top:.5rem;min-height:56px;padding:1rem 1.5rem;position:sticky}.Footer[data-border-hidden=true]{border-top:0;padding-top:.5rem}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare type ModalHeaderProps = PropsWithChildren<PropsWithClass<{
|
|
3
|
+
/**
|
|
4
|
+
* Hide the Close icon Button.
|
|
5
|
+
*/
|
|
6
|
+
hideCloseButton?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Hide the border at the bottom of the header. This will be automatically dismissed
|
|
9
|
+
* if no content is provided.
|
|
10
|
+
*/
|
|
11
|
+
hideBorder?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Set the theme of the content card. To ensure contrast with the default overlay color (dark),
|
|
14
|
+
* this is set to `light` by default.
|
|
15
|
+
*/
|
|
16
|
+
theme?: 'dark' | 'light' | 'auto';
|
|
17
|
+
}>>;
|
|
18
|
+
export declare type ModalHeaderComponent = React.ForwardRefExoticComponent<ModalHeaderProps>;
|
|
19
|
+
export declare const ModalHeader: ModalHeaderComponent;
|
|
20
|
+
//# sourceMappingURL=modal-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-header.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/header/modal-header.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAM/D,oBAAY,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC;IAC9D;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CACnC,CAAC,CAAC,CAAA;AAEH,oBAAY,oBAAoB,GAAG,KAAK,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;AAEpF,eAAO,MAAM,WAAW,sBA4BE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2022-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 clsx from 'clsx';
|
|
18
|
+
import { forwardRef, useMemo } from 'react';
|
|
19
|
+
import { IconButton, Stack, useOverlayContext } from '../../..';
|
|
20
|
+
import * as styles from './modal-header.module.css';
|
|
21
|
+
export const ModalHeader = forwardRef(({ children, className, hideCloseButton = false, hideBorder = false, theme = 'light', ...otherProps }, forwardedRef) => {
|
|
22
|
+
const { onClose } = useOverlayContext();
|
|
23
|
+
const isBorderHidden = useMemo(() => hideBorder || !children, [hideBorder, children]);
|
|
24
|
+
return (_jsx("div", { "aria-label": "Header", className: clsx(styles.HeaderWrapper, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: _jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, "data-border-hidden": isBorderHidden, children: [_jsx("div", { children: children }), (onClose && !hideCloseButton) && (_jsx(IconButton, { "aria-label": "Close Button", onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }))] }) }));
|
|
25
|
+
});
|
|
26
|
+
ModalHeader.displayName = 'Modal.Header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.HeaderWrapper{background-color:var(--global-background);height:max-content}.Header{background-color:inherit;border-bottom:1px solid var(--dimmed-1);min-height:56px;padding:1rem 5rem 1rem 1.5rem;position:sticky;top:0}.Header[data-border-hidden=true]{border-bottom:0}}@layer overrides{.CloseButton{position:absolute;right:.5rem;top:.5rem}}
|