@wonderflow/react-components 10.2.0 → 10.5.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/button/button.js +1 -1
- package/dist/components/button/button.module.css +1 -1
- package/dist/components/card/card.module.css +1 -1
- package/dist/components/drawer/drawer.module.css +1 -1
- package/dist/components/info-state/info-state.js +1 -1
- package/dist/components/popover/popover.d.ts +1 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +2 -3
- package/package.json +3 -3
|
@@ -15,7 +15,7 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
|
|
|
15
15
|
regular: 16,
|
|
16
16
|
small: 12,
|
|
17
17
|
};
|
|
18
|
-
return (_jsxs(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(styles.Button, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed":
|
|
18
|
+
return (_jsxs(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(styles.Button, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": pressed, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps, children: [icon && (_jsx(Symbol, { source: icon, fill: iconColor, weight: "solid", dimension: iconSize[dimension] })), (children && busy) ? _jsx("span", { children: children }) : children, busy && (_jsx("span", { className: styles.SpinnerIndicator, children: _jsx(Spinner, { dimension: dimension }) }))] }));
|
|
19
19
|
});
|
|
20
20
|
export const ButtonsGroup = ({ children, className, kind, dimension = 'regular', }) => (_jsx("div", { className: clsx(styles.ButtonsGroup, className), children: Children.map(children, child => isValidElement(child) && cloneElement(child, {
|
|
21
21
|
kind,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.Button){-webkit-touch-callout:none;grid-gap:.5rem;align-items:center;appearance:none;background:none;border:0;border-radius:.25rem;box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:inherit;font-weight:600;justify-content:center;margin:0;min-inline-size:min-content;overflow:hidden;position:relative;text-decoration:none;transition:all .1s cubic-bezier(.3,.07,.34,1);-webkit-user-select:none;user-select:none;white-space:nowrap}:where(.Button):not([aria-pressed=true],[aria-disabled=true],[aria-busy=true]):active{transform:scale(.98);transform-origin:center}[data-button-dimension=big]:where(.Button){block-size:3rem;font-size:1.13rem;padding:.55rem 1.5rem .66rem}[data-button-dimension=regular]:where(.Button){block-size:2.5rem;font-size:1rem;padding:.33rem 1rem .5rem}[data-button-dimension=small]:where(.Button){grid-gap:.25rem;block-size:1.5rem;font-size:.88rem;padding:0 .5rem .11rem}[data-button-kind=primary]:where(.Button){background:var(--cta-default);color:var(--cta-foreground)}[data-button-kind=primary]:where(.Button):
|
|
1
|
+
:where(.Button){-webkit-touch-callout:none;grid-gap:.5rem;align-items:center;appearance:none;background:none;border:0;border-radius:.25rem;box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:inherit;font-weight:600;justify-content:center;margin:0;min-inline-size:min-content;overflow:hidden;position:relative;text-decoration:none;transition:all .1s cubic-bezier(.3,.07,.34,1);-webkit-user-select:none;user-select:none;white-space:nowrap}:where(.Button):not([aria-pressed=true],[aria-disabled=true],[aria-busy=true]):active{transform:scale(.98);transform-origin:center}[data-button-dimension=big]:where(.Button){block-size:3rem;font-size:1.13rem;padding:.55rem 1.5rem .66rem}[data-button-dimension=regular]:where(.Button){block-size:2.5rem;font-size:1rem;padding:.33rem 1rem .5rem}[data-button-dimension=small]:where(.Button){grid-gap:.25rem;block-size:1.5rem;font-size:.88rem;padding:0 .5rem .11rem}[data-button-kind=primary]:where(.Button){background:var(--cta-default);color:var(--cta-foreground)}[data-button-kind=primary]:where(.Button):where([aria-pressed=true]),[data-button-kind=primary]:where(.Button):where([aria-pressed=true]:hover){background:#9e0018;color:#fff}[data-button-kind=primary]:where(.Button):not([aria-pressed=true],[aria-disabled=true],[aria-busy=true]):is(:hover){background:var(--cta-dark)}[data-button-kind=secondary]:where(.Button){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);color:var(--global-vibrancy-foreground)}[data-button-kind=secondary]:where(.Button):where([aria-pressed=true]),[data-button-kind=secondary]:where(.Button):where([aria-pressed=true]:hover){background:var(--dimmed-7);color:var(--dimmed-0)}[data-button-kind=secondary]:where(.Button):not([aria-pressed=true],[aria-disabled=true],[aria-busy=true]):is(:hover){background-color:var(--global-vibrancy-background-hard);color:var(--global-vibrancy-foreground)}[data-button-kind=flat]:where(.Button){color:var(--global-vibrancy-foreground)}[data-button-kind=flat]:where(.Button):where([aria-pressed=true]),[data-button-kind=flat]:where(.Button):where([aria-pressed=true]:is(:active,:focus)){background:var(--dimmed-7);color:var(--dimmed-0)}[data-button-kind=flat]:where(.Button):is(:hover,:focus){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);color:var(--global-vibrancy-foreground)}[data-button-kind=flat]:where(.Button):not([aria-pressed=true],[aria-disabled=true],[aria-busy=true]):is(:hover){background-color:var(--global-vibrancy-background)}[data-button-fullwidth=true]:where(.Button){inline-size:100%}[data-button-icon-position=right]:where(.Button){flex-direction:row-reverse}[aria-disabled=true]:where(.Button),[aria-disabled=true]:where(.Button):is(:hover,:focus,:active){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed;pointer-events:none}[aria-busy=true]:where(.Button){pointer-events:none}[aria-busy=true]:where(.Button)>:not(.SpinnerIndicator){visibility:hidden}.SpinnerIndicator{bottom:0;display:grid;left:0;place-content:center;position:absolute;right:0;top:0}.ButtonsGroup{display:inline-flex}.ButtonsGroup>*+*{box-shadow:inset 1px 0 0 hsla(0,0%,40%,.2)}.ButtonsGroup>:not(:first-child,:last-child,:only-of-type){border-radius:0}.ButtonsGroup>:first-child:not(:only-of-type){border-bottom-right-radius:0;border-top-right-radius:0}.ButtonsGroup>:last-child:not(:only-of-type){border-bottom-left-radius:0;border-top-left-radius:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.Card){background-color:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}[data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-0)}[data-card-dimmed="0"]:where(.Card){background-color:var(--dimmed-0)}[data-card-dimmed="0"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-background)}[data-card-dimmed="1"]:where(.Card){background-color:var(--dimmed-1)}[data-card-dimmed="1"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-0)}[data-card-dimmed="2"]:where(.Card){background-color:var(--dimmed-2)}[data-card-dimmed="2"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-1)}[data-card-vibrant=true]:where(.Card){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background)}[data-card-vibrant=true][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="0"]:where(.Card){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="0"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-background)}[data-card-vibrant=true][data-card-dimmed="1"]:where(.Card){background-color:var(--global-vibrancy-background)}[data-card-vibrant=true][data-card-dimmed="1"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="2"]:where(.Card){background-color:var(--global-vibrancy-background-hard)}[data-card-vibrant=true][data-card-dimmed="2"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background)}
|
|
1
|
+
:where(.Card){background-color:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}[data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-0)}[data-card-dimmed="0"]:where(.Card){background-color:var(--dimmed-0)}[data-card-dimmed="0"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-background)}[data-card-dimmed="0"][data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-1)}[data-card-dimmed="1"]:where(.Card){background-color:var(--dimmed-1)}[data-card-dimmed="1"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-0)}[data-card-dimmed="1"][data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-2)}[data-card-dimmed="2"]:where(.Card){background-color:var(--dimmed-2)}[data-card-dimmed="2"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--dimmed-1)}[data-card-dimmed="2"][data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-3)}[data-card-vibrant=true]:where(.Card){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background)}[data-card-vibrant=true][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="0"]:where(.Card){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="0"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-background)}[data-card-vibrant=true][data-card-dimmed="1"]:where(.Card){background-color:var(--global-vibrancy-background)}[data-card-vibrant=true][data-card-dimmed="1"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background-soft)}[data-card-vibrant=true][data-card-dimmed="2"]:where(.Card){background-color:var(--global-vibrancy-background-hard)}[data-card-vibrant=true][data-card-dimmed="2"][data-card-highlight-hover=true]:where(.Card):is(:hover,:focus-visible){background-color:var(--global-vibrancy-background)}.Left{flex-shrink:0}.Content{flex-grow:1}.Right{flex-shrink:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Drawer{display:contents}.Container{align-items:stretch;bottom:0;display:grid;left:0;pointer-events:none;position:absolute;right:0;top:0}.Container[data-drawer-side=right]{justify-content:flex-end}.Container[data-drawer-side=left]{justify-content:flex-start}
|
|
1
|
+
.Drawer{display:contents}.Container{align-items:stretch;bottom:0;display:grid;left:0;pointer-events:none;position:absolute;right:0;top:0}.Container[data-drawer-side=right]{justify-content:flex-end}.Container[data-drawer-side=left]{justify-content:flex-start}.Container>*{pointer-events:auto}.Content{-webkit-overflow-scrolling:touch;background-color:var(--global-background);inline-size:100vw;max-inline-size:var(--max-w);overflow:auto;overscroll-behavior:contain}.Header{background-color:inherit;border-bottom:1px solid var(--dimmed-1);padding:1rem 1rem 1.5rem 1.5rem;position:sticky;top:0;z-index:1}.CloseButton.CloseButton{flex-grow:0}
|
|
@@ -13,6 +13,6 @@ export const InfoState = forwardRef(({ className, children, title, icon, image,
|
|
|
13
13
|
repeatDelay: 5.2,
|
|
14
14
|
repeatType: 'reverse',
|
|
15
15
|
type: 'spring',
|
|
16
|
-
}, 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, { 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 }))] })] }) }));
|
|
16
|
+
}, 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 }))] })] }) }));
|
|
17
17
|
});
|
|
18
18
|
InfoState.displayName = 'InfoState';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAAE,aAAa,EAAY,kBAAkB,EAC3D,MAAM,gBAAgB,CAAC;AAOxB,OAAO,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAAE,aAAa,EAAY,kBAAkB,EAC3D,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EAML,SAAS,EAKV,MAAM,OAAO,CAAC;AAOf,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAA;AA0BD,eAAO,MAAM,OAAO;;;iEA6HlB,CAAC"}
|
|
@@ -64,7 +64,6 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
|
|
|
64
64
|
},
|
|
65
65
|
}, {
|
|
66
66
|
placement,
|
|
67
|
-
strategy: 'fixed',
|
|
68
67
|
modifiers: [
|
|
69
68
|
sameWidth,
|
|
70
69
|
{
|
|
@@ -87,7 +86,7 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
|
|
|
87
86
|
if (open !== undefined)
|
|
88
87
|
setIsOpen(open);
|
|
89
88
|
}, [open]);
|
|
90
|
-
return (_jsxs("div", { ref: mergeRefs([popoverContainerRef, forwardedRef]), className: clsx(styles.Popover, className), "data-popover-has-focus": isFocusWithin, children: [
|
|
89
|
+
return (_jsxs("div", { ref: mergeRefs([popoverContainerRef, forwardedRef]), className: clsx(styles.Popover, className), "data-popover-has-focus": isFocusWithin, children: [isValidElement(trigger) && cloneElement(trigger, {
|
|
91
90
|
ref: setTriggerRef,
|
|
92
91
|
id: seedID('popover-trigger'),
|
|
93
92
|
key: seedID('popover-trigger'),
|
|
@@ -95,7 +94,7 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
|
|
|
95
94
|
'aria-controls': seedID('popover-dialog'),
|
|
96
95
|
'aria-expanded': isOpen,
|
|
97
96
|
...otherProps,
|
|
98
|
-
})
|
|
97
|
+
}), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), children: _jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { variants: PopoverAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: Children.map(children, child => isValidElement(child) && cloneElement(child, {
|
|
99
98
|
id: seedID('popover-dialog'),
|
|
100
99
|
'aria-labelledby': seedID('popover-trigger'),
|
|
101
100
|
})) }) }) }, seedID('tooltip-content'))) })] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@types/react": "17.0.43",
|
|
71
71
|
"@types/react-dom": "17.0.14",
|
|
72
72
|
"@types/react-table": "7.7.12",
|
|
73
|
-
"@wonderflow/config": "10.
|
|
74
|
-
"@wonderflow/tokens": "10.
|
|
73
|
+
"@wonderflow/config": "10.5.0",
|
|
74
|
+
"@wonderflow/tokens": "10.5.0",
|
|
75
75
|
"babel-loader": "8.2.5",
|
|
76
76
|
"cpy-cli": "3.1.1",
|
|
77
77
|
"postcss": "8.4.14",
|