@wonderflow/react-components 5.6.0 → 7.0.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/core/utils/media.css +5 -5
- package/dist/components/autocomplete/autocomplete-option.js +1 -1
- package/dist/components/autocomplete/autocomplete.js +4 -4
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/button/button.module.css +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +2 -2
- package/dist/components/card/card.module.css +1 -1
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/chip.module.css +1 -1
- package/dist/components/circular-progress/circular-progress.js +3 -3
- package/dist/components/clamp-text/clamp-text.js +1 -1
- package/dist/components/container/container.js +1 -1
- package/dist/components/datetime/datetime.js +1 -1
- package/dist/components/disclosure/disclosure.js +3 -3
- package/dist/components/disclosure/disclosure.module.css +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/elevator/elevator.d.ts.map +1 -1
- package/dist/components/elevator/elevator.js +3 -3
- package/dist/components/grid/grid.js +4 -4
- package/dist/components/grid/grid.module.css +1 -1
- package/dist/components/grid/item/grid-item.js +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.js +2 -2
- package/dist/components/icon-button/icon-button.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/info-state/info-state.js +1 -1
- package/dist/components/input-group/input-group.d.ts.map +1 -1
- package/dist/components/input-group/input-group.js +5 -5
- package/dist/components/linear-progress/linear-progress.js +2 -2
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/index.d.ts.map +1 -1
- package/dist/components/list/list-item.d.ts +28 -0
- package/dist/components/list/list-item.d.ts.map +1 -0
- package/dist/components/list/list-item.js +31 -0
- package/dist/components/list/list.d.ts +6 -11
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.js +9 -19
- package/dist/components/list/list.module.css +1 -1
- package/dist/components/masonry/masonry.d.ts.map +1 -1
- package/dist/components/masonry/masonry.js +3 -3
- package/dist/components/menu/menu-item/menu-item-checkbox.js +1 -1
- package/dist/components/menu/menu-item/menu-item.js +3 -3
- package/dist/components/menu/menu.d.ts +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/modal/content/modal-content.js +1 -1
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/overlay-container/overlay-container.js +1 -1
- package/dist/components/overlay-container/overlay-context.js +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/popover/index.d.ts +4 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/popover/popover.d.ts +95 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.js +93 -0
- package/dist/components/popover/popover.module.css +1 -0
- package/dist/components/prose/prose.js +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.module.css +1 -1
- package/dist/components/selection-controls/checkbox.d.ts.map +1 -1
- package/dist/components/selection-controls/checkbox.js +2 -1
- package/dist/components/selection-controls/radio.d.ts.map +1 -1
- package/dist/components/selection-controls/radio.js +2 -1
- package/dist/components/selection-controls/selection-controls.module.css +1 -1
- package/dist/components/selection-controls/toggle.js +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/skeleton/skeleton.js +3 -3
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +2 -2
- package/dist/components/slider/slider.module.css +1 -1
- package/dist/components/snackbar/snackbar.js +1 -1
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/split-button/split-button.d.ts +2 -2
- package/dist/components/split-button/split-button.d.ts.map +1 -1
- package/dist/components/split-button/split-button.js +2 -2
- package/dist/components/stack/stack.d.ts +4 -4
- package/dist/components/stack/stack.d.ts.map +1 -1
- package/dist/components/stack/stack.js +6 -6
- package/dist/components/star-meter/star-meter.d.ts.map +1 -1
- package/dist/components/star-meter/star-meter.js +10 -10
- package/dist/components/star-meter/star-meter.module.css +1 -1
- package/dist/components/tab/primitive-tab.js +1 -1
- package/dist/components/tab/tab-item.d.ts.map +1 -1
- package/dist/components/tab/tab-item.js +3 -2
- package/dist/components/tab/tab-list.js +1 -1
- package/dist/components/tab/tab-panel.js +1 -1
- package/dist/components/tab/tab.d.ts.map +1 -1
- package/dist/components/tab/tab.js +5 -6
- package/dist/components/tab/tab.module.css +1 -1
- package/dist/components/table/table-cell/table-cell.d.ts +0 -4
- package/dist/components/table/table-cell/table-cell.d.ts.map +1 -1
- package/dist/components/table/table-cell/table-cell.js +10 -21
- package/dist/components/table/table-cell/table-cell.module.css +1 -1
- package/dist/components/table/table-checkbox/table-checkbox.js +1 -1
- package/dist/components/table/table-controls/toggle-columns.d.ts +4 -4
- package/dist/components/table/table-controls/toggle-columns.d.ts.map +1 -1
- package/dist/components/table/table-controls/toggle-columns.js +4 -4
- package/dist/components/table/table-expand/table-expand.js +1 -1
- package/dist/components/table/table-header/table-header.d.ts +1 -1
- package/dist/components/table/table-header/table-header.d.ts.map +1 -1
- package/dist/components/table/table-header/table-header.js +2 -2
- package/dist/components/table/table-pagination/table-pagination.d.ts +1 -1
- package/dist/components/table/table-pagination/table-pagination.d.ts.map +1 -1
- package/dist/components/table/table-pagination/table-pagination.js +5 -3
- package/dist/components/table/table-row/table-row.d.ts +8 -3
- package/dist/components/table/table-row/table-row.d.ts.map +1 -1
- package/dist/components/table/table-row/table-row.js +12 -3
- package/dist/components/table/table-row/table-row.module.css +1 -1
- package/dist/components/table/table.d.ts +10 -10
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +67 -49
- package/dist/components/table/types.d.ts +9 -5
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/text/text.js +3 -3
- package/dist/components/text/text.module.css +1 -1
- package/dist/components/textfield/base-field/base-field.js +1 -1
- package/dist/components/textfield/base-field/base-field.module.css +1 -1
- package/dist/components/textfield/textfield.d.ts.map +1 -1
- package/dist/components/textfield/textfield.js +3 -3
- package/dist/components/title/title.js +3 -3
- package/dist/components/title/title.module.css +1 -1
- package/dist/components/toggle-button/toggle-button.js +2 -2
- package/dist/components/toggle-button/toggle-button.module.css +1 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +6 -5
- package/dist/components/tooltip/tooltip.module.css +1 -1
- package/package.json +10 -11
- package/dist/components/dropdown/dropdown.d.ts +0 -59
- package/dist/components/dropdown/dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/dropdown.js +0 -64
- package/dist/components/dropdown/dropdown.module.css +0 -1
- package/dist/components/dropdown/index.d.ts +0 -3
- package/dist/components/dropdown/index.d.ts.map +0 -1
- package/dist/components/dropdown/index.js +0 -1
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { Children, forwardRef, useMemo } from 'react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement, forwardRef, isValidElement, useMemo } from 'react';
|
|
3
3
|
import styles from './list.module.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
6
|
-
export const List = forwardRef(({ as: Wrapper = 'ul', children,
|
|
7
|
-
const sizes = {
|
|
8
|
-
small: {
|
|
9
|
-
text: 16,
|
|
10
|
-
icon: 16
|
|
11
|
-
},
|
|
12
|
-
regular: {
|
|
13
|
-
text: 18,
|
|
14
|
-
icon: 16
|
|
15
|
-
},
|
|
16
|
-
big: {
|
|
17
|
-
text: 22,
|
|
18
|
-
icon: 24
|
|
19
|
-
}
|
|
20
|
-
};
|
|
5
|
+
import { ListItem } from './list-item';
|
|
6
|
+
export const List = forwardRef(({ as: Wrapper = 'ul', children, dimension = 'regular', className, hideMarker = false, ...otherProps }, forwardedRef) => {
|
|
21
7
|
const isUnordered = useMemo(() => Wrapper === 'ul', [Wrapper]);
|
|
22
|
-
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.List, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps, children: Children.map(children, (child) => (
|
|
8
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.List, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps, children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
|
|
9
|
+
hideMarker: !isUnordered && !hideMarker,
|
|
10
|
+
dimension
|
|
11
|
+
})) }));
|
|
23
12
|
});
|
|
13
|
+
List.Li = ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.List{--marker-size:0.89rem;--marker-gap:0.44rem}.List
|
|
1
|
+
.List{--marker-size:0.89rem;--marker-gap:0.44rem}.List[data-list-ordered=false]{list-style:none;padding:0}.List[data-list-size=small]{--marker-size:0.77rem;--marker-gap:0.44rem}.List[data-list-size=big]{--marker-size:1.11rem;--marker-gap:0.89rem}.List[data-list-no-marker=true]{--marker-size:0;--marker-gap:0;list-style:none;padding:0}.ListItem.ListItem{gap:var(--marker-gap)}[data-list-ordered=true] .ListItem.ListItem{display:list-item}[data-list-ordered=true] .ListItem.ListItem::marker{color:var(--dimmed-5)}.Marker{block-size:var(--marker-size);flex-shrink:0;inline-size:var(--marker-size);margin-block-start:calc(var(--marker-size)/2.5)}.Marker[data-list-default-marker=true]{transform:scale(.7)}.List[data-list-size=big] .Marker,.Marker[data-list-default-marker=true]{margin-block-start:calc(var(--marker-size)/3)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../../src/components/masonry/masonry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../../src/components/masonry/masonry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAA;AAGjF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAG9D,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B,CAAA;AAED,aAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA4CpC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { Children, cloneElement } from 'react';
|
|
3
|
+
import { Children, cloneElement, isValidElement } from 'react';
|
|
4
4
|
import MasonryLayout from 'react-masonry-css';
|
|
5
5
|
import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
6
6
|
import styles from './masonry.module.css';
|
|
@@ -20,7 +20,7 @@ export const Masonry = ({ className, children, columns = 3, gutter = 16, style,
|
|
|
20
20
|
default: columns.default,
|
|
21
21
|
[breakpoints[current]]: columns[current]
|
|
22
22
|
}), {});
|
|
23
|
-
return (_jsx(MasonryLayout, { role: "list", className: clsx(styles.Masonry, className), columnClassName: styles.Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...otherProps, children: Children.map(children, (child) => cloneElement(child, {
|
|
23
|
+
return (_jsx(MasonryLayout, { role: "list", className: clsx(styles.Masonry, className), columnClassName: styles.Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...otherProps, children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
|
|
24
24
|
role: 'listitem'
|
|
25
|
-
})) }
|
|
25
|
+
})) }));
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { MenuItem } from '../../..';
|
|
4
|
-
export const MenuItemCheckbox = forwardRef(({ children, checked, ...otherProps }, forwardedRef) => (_jsx(MenuItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...otherProps, children: children }
|
|
4
|
+
export const MenuItemCheckbox = forwardRef(({ children, checked, ...otherProps }, forwardedRef) => (_jsx(MenuItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...otherProps, children: children })));
|
|
5
5
|
MenuItemCheckbox.displayName = 'Menu.ItemCheckbox';
|
|
@@ -15,9 +15,9 @@ export const MenuItem = forwardRef(({ className, children, onClick, icon, dimens
|
|
|
15
15
|
onClick(e);
|
|
16
16
|
}
|
|
17
17
|
}, [handleClick, onClick]);
|
|
18
|
-
const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", fill: false, className: styles.ItemContent,
|
|
18
|
+
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(Icon, { className: styles.IconClass, source: icon, dimension: dimension === 'small' ? 12 : 16 })), _jsxs(Stack, { className: styles.DecorationContent, columnGap: 16, fill: false, direction: "row", hAlign: "space-between", children: [children, decoration] })] })), [children, dimension, icon, isIconRight, decoration, padding]);
|
|
19
19
|
return (_jsx(Wrapper, { autoFocus: autoFocus, ref: itemRef, role: "menuitem", className: clsx(styles.MenuItem, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-menu-item-dimension": dimension, ...otherProps, children: description
|
|
20
|
-
? (_jsx(Tooltip, { fill: true, open: focused, placement: "right-start", interactive: true, trigger: InnerContent, children: description }
|
|
21
|
-
: InnerContent }
|
|
20
|
+
? (_jsx(Tooltip, { fill: true, open: focused, placement: "right-start", interactive: true, trigger: InnerContent, children: description }))
|
|
21
|
+
: InnerContent }));
|
|
22
22
|
});
|
|
23
23
|
MenuItem.displayName = 'Menu.Item';
|
|
@@ -4,7 +4,7 @@ import { MenuItemCheckbox, MenuItemCheckboxProps } from './menu-item/menu-item-c
|
|
|
4
4
|
import { Polymorphic } from '../..';
|
|
5
5
|
export declare type MenuProps = HTMLAttributes<HTMLUListElement> & {
|
|
6
6
|
/**
|
|
7
|
-
* The items of the
|
|
7
|
+
* The items of the menu.
|
|
8
8
|
*/
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
};
|
|
@@ -8,7 +8,7 @@ import styles from './menu.module.css';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
export const Menu = forwardRef(({ className, children, ...otherProps }, forwardedRef) => {
|
|
10
10
|
const renderedChildren = Children.toArray(children).filter(Boolean);
|
|
11
|
-
return (_jsx(Elevator, { resting: 2, children: _jsx(Stack, { as: "ul", ref: forwardedRef, className: clsx(styles.Menu, className),
|
|
11
|
+
return (_jsx(Elevator, { resting: 2, children: _jsx(Stack, { as: "ul", ref: forwardedRef, className: clsx(styles.Menu, className), vPadding: 8, role: "menu", ...otherProps, children: _jsx(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true }, children: Children.map(renderedChildren, (child) => (_jsx(Stack, { as: "li", role: "none", vPadding: child.type?.displayName === 'Separator' ? 8 : undefined, children: child }))) }) }) }));
|
|
12
12
|
});
|
|
13
13
|
Menu.displayName = 'Menu';
|
|
14
14
|
Menu.Item = MenuItem;
|
|
@@ -6,6 +6,6 @@ import styles from './modal-content.module.css';
|
|
|
6
6
|
import { Title, Elevator, IconButton, Stack, useOverlayContext } from '../../..';
|
|
7
7
|
export const ModalContent = forwardRef(({ children, className, title, theme = 'light', ...otherProps }, forwardedRef) => {
|
|
8
8
|
const { onClose, titleId } = useOverlayContext();
|
|
9
|
-
return (_jsx(Elevator, { resting: 4, children: _jsxs("div", { className: clsx(styles.Content, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: [_jsxs(Stack, {
|
|
9
|
+
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 })] }) }));
|
|
10
10
|
});
|
|
11
11
|
ModalContent.displayName = 'Modal.Content';
|
|
@@ -26,7 +26,7 @@ const ModalAnimation = {
|
|
|
26
26
|
};
|
|
27
27
|
export const Modal = forwardRef(({ children, className, closeOnClickOutside = true, ...otherProps }, forwardedRef) => {
|
|
28
28
|
const { titleId, onClose } = useOverlayContext();
|
|
29
|
-
return (_jsx("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: clsx(styles.Modal, className), ref: forwardedRef, ...otherProps, children: _jsx(FocusOn, { onClickOutside: closeOnClickOutside ? onClose : undefined, onEscapeKey: onClose, children: _jsx(motion.div, { variants: ModalAnimation, initial: "hidden", animate: "visible", exit: "hidden", className: styles.Container, children: children }
|
|
29
|
+
return (_jsx("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: clsx(styles.Modal, className), ref: forwardedRef, ...otherProps, children: _jsx(FocusOn, { onClickOutside: closeOnClickOutside ? onClose : undefined, onEscapeKey: onClose, children: _jsx(motion.div, { variants: ModalAnimation, initial: "hidden", animate: "visible", exit: "hidden", className: styles.Container, children: children }) }) }));
|
|
30
30
|
});
|
|
31
31
|
Modal.displayName = 'Modal';
|
|
32
32
|
Modal.Content = ModalContent;
|
|
@@ -12,6 +12,6 @@ export const OverlayContainer = ({ children, root = document.body, overlayColor
|
|
|
12
12
|
throw new Error('An OverlayContainer must not be inside another container. Please change the root prop.');
|
|
13
13
|
}
|
|
14
14
|
}, [root]);
|
|
15
|
-
const content = (_jsx(OverlayProvider, { onClose: onClose, children: _jsx(AnimatePresence, { exitBeforeEnter: true, children: children && (_jsxs("div", { "data-overlay-container": true, "data-overlay-container-obfuscate": obfuscate, className: styles.OverlayContainer, style: { zIndex: index }, children: [obfuscate && (_jsx(motion.span, { className: styles.Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, transition: { duration: 0.2 }, exit: { opacity: 0 } }, seedID('modal-backdrop'))), children] }
|
|
15
|
+
const content = (_jsx(OverlayProvider, { onClose: onClose, children: _jsx(AnimatePresence, { exitBeforeEnter: true, children: children && (_jsxs("div", { "data-overlay-container": true, "data-overlay-container-obfuscate": obfuscate, className: styles.OverlayContainer, style: { zIndex: index }, children: [obfuscate && (_jsx(motion.span, { className: styles.Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, transition: { duration: 0.2 }, exit: { opacity: 0 } }, seedID('modal-backdrop'))), children] })) }) }));
|
|
16
16
|
return createPortal(content, root);
|
|
17
17
|
};
|
|
@@ -12,7 +12,7 @@ export const OverlayProvider = (props) => {
|
|
|
12
12
|
return (_jsx(OverlayContext.Provider, { value: {
|
|
13
13
|
titleId,
|
|
14
14
|
onClose
|
|
15
|
-
}, children: children }
|
|
15
|
+
}, children: children }));
|
|
16
16
|
};
|
|
17
17
|
export const useOverlayContext = () => {
|
|
18
18
|
const context = useContext(OverlayContext);
|
|
@@ -13,5 +13,5 @@ export const Pagination = ({ className, itemsCount, itemsPerPage = 10, onPageCli
|
|
|
13
13
|
const newOffset = (event.selected * itemsPerPage) % itemsCount;
|
|
14
14
|
onPageClick && onPageClick({ ...event, offset: newOffset });
|
|
15
15
|
};
|
|
16
|
-
return (_jsx(ReactPaginate, { containerClassName: clsx(styles.Pagination, className), breakLabel: "...", nextLabel: _jsx(Icon, { dimension: 16, source: "chevron-right" }
|
|
16
|
+
return (_jsx(ReactPaginate, { containerClassName: clsx(styles.Pagination, className), breakLabel: "...", nextLabel: _jsx(Icon, { dimension: 16, source: "chevron-right" }), previousLabel: _jsx(Icon, { dimension: 16, source: "chevron-left" }), onPageChange: handlePageClick, pageRangeDisplayed: pageRangeDisplayed, pageCount: pageCount || computedPageCount, marginPagesDisplayed: marginPagesDisplayed, ...otherProps }));
|
|
17
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AutoPlacement, BasePlacement, VariationPlacement } from '@popperjs/core';
|
|
3
|
+
export declare type PopoverProps = PropsWithClass & {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the popover to display when the popover is open.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The element to use as the trigger for the popover.
|
|
10
|
+
*/
|
|
11
|
+
trigger: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The distance from the trigger to the popover.
|
|
14
|
+
*/
|
|
15
|
+
offset?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The placement of the popover. This is automatically handled based on
|
|
18
|
+
* scroll and viewport edges. By default the popover is anchored at
|
|
19
|
+
* the beginning of the trigger.
|
|
20
|
+
*
|
|
21
|
+
* The first key refers to the X axis, the second key refers to the Y axis.
|
|
22
|
+
* Eg: `auto-start` means the popover will be placed automatically on left or right
|
|
23
|
+
* based on the available space, and anchored at the top (start) of the trigger.
|
|
24
|
+
*/
|
|
25
|
+
placement?: AutoPlacement | BasePlacement | VariationPlacement;
|
|
26
|
+
/**
|
|
27
|
+
* Enable or disable the itneraction on the trigger.
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Callback triggered when the popover state changes.
|
|
32
|
+
* It returns the new `boolean` state.
|
|
33
|
+
*/
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Programmatically open or close the popover. If set to `true`, the popover
|
|
37
|
+
* will be open when rendered. This make the popover a controlled component.
|
|
38
|
+
*/
|
|
39
|
+
open?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Enable or disable the auto close of the popover when clicking outside of it.
|
|
42
|
+
*/
|
|
43
|
+
closeOnOutsideClick?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Set the popover element the same with of the trigger element.
|
|
46
|
+
*/
|
|
47
|
+
matchTriggerWidth?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare const Popover: import("react").ForwardRefExoticComponent<PropsWithClass & {
|
|
50
|
+
/**
|
|
51
|
+
* The content of the popover to display when the popover is open.
|
|
52
|
+
*/
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* The element to use as the trigger for the popover.
|
|
56
|
+
*/
|
|
57
|
+
trigger: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* The distance from the trigger to the popover.
|
|
60
|
+
*/
|
|
61
|
+
offset?: number | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The placement of the popover. This is automatically handled based on
|
|
64
|
+
* scroll and viewport edges. By default the popover is anchored at
|
|
65
|
+
* the beginning of the trigger.
|
|
66
|
+
*
|
|
67
|
+
* The first key refers to the X axis, the second key refers to the Y axis.
|
|
68
|
+
* Eg: `auto-start` means the popover will be placed automatically on left or right
|
|
69
|
+
* based on the available space, and anchored at the top (start) of the trigger.
|
|
70
|
+
*/
|
|
71
|
+
placement?: AutoPlacement | BasePlacement | VariationPlacement | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Enable or disable the itneraction on the trigger.
|
|
74
|
+
*/
|
|
75
|
+
disabled?: boolean | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Callback triggered when the popover state changes.
|
|
78
|
+
* It returns the new `boolean` state.
|
|
79
|
+
*/
|
|
80
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Programmatically open or close the popover. If set to `true`, the popover
|
|
83
|
+
* will be open when rendered. This make the popover a controlled component.
|
|
84
|
+
*/
|
|
85
|
+
open?: boolean | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Enable or disable the auto close of the popover when clicking outside of it.
|
|
88
|
+
*/
|
|
89
|
+
closeOnOutsideClick?: boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Set the popover element the same with of the trigger element.
|
|
92
|
+
*/
|
|
93
|
+
matchTriggerWidth?: boolean | undefined;
|
|
94
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
95
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EASV,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAY,MAAM,gBAAgB,CAAA;AAK3F,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;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;AAqBD,eAAO,MAAM,OAAO;IAjElB;;OAEG;cACO,SAAS;IACnB;;OAEG;aACM,SAAS;IAClB;;OAEG;;IAEH;;;;;;;;OAQG;;IAEH;;OAEG;;IAEH;;;OAGG;2BACmB,OAAO,KAAK,IAAI;IACtC;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;kDAgJH,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, Children, cloneElement, useRef, forwardRef, isValidElement, useEffect, useMemo } from 'react';
|
|
3
|
+
import { useKeyPress, useFocusWithin } from 'ahooks';
|
|
4
|
+
import styles from './popover.module.css';
|
|
5
|
+
import { useUIDSeed } from 'react-uid';
|
|
6
|
+
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
7
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
const PopoverAnimation = {
|
|
10
|
+
visible: {
|
|
11
|
+
y: 0,
|
|
12
|
+
opacity: 1,
|
|
13
|
+
transition: {
|
|
14
|
+
ease: [0, 0, 0.34, 1],
|
|
15
|
+
duration: 0.1
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
hidden: {
|
|
19
|
+
y: -5,
|
|
20
|
+
opacity: 0,
|
|
21
|
+
transition: {
|
|
22
|
+
ease: [0.3, 0.07, 1, 1],
|
|
23
|
+
duration: 0.1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const Popover = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', open, disabled, closeOnOutsideClick = true, className, matchTriggerWidth, onOpenChange, ...otherProps }, forwardedRef) => {
|
|
28
|
+
const seedID = useUIDSeed();
|
|
29
|
+
const popoverRef = useRef(forwardedRef);
|
|
30
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
+
const sameWidth = useMemo(() => ({
|
|
32
|
+
name: 'sameWidth',
|
|
33
|
+
enabled: true,
|
|
34
|
+
phase: 'beforeWrite',
|
|
35
|
+
requires: ['computeStyles'],
|
|
36
|
+
fn: ({ state }) => {
|
|
37
|
+
if (matchTriggerWidth)
|
|
38
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
39
|
+
},
|
|
40
|
+
effect: ({ state }) => {
|
|
41
|
+
const referenceElement = state.elements.reference;
|
|
42
|
+
if (matchTriggerWidth)
|
|
43
|
+
state.elements.popper.style.width = `${referenceElement.offsetWidth}px`;
|
|
44
|
+
}
|
|
45
|
+
}), [matchTriggerWidth]);
|
|
46
|
+
const { getTooltipProps, setTooltipRef, setTriggerRef, visible } = usePopperTooltip({
|
|
47
|
+
delayShow: 0,
|
|
48
|
+
delayHide: 0,
|
|
49
|
+
trigger: !disabled ? ['click'] : null,
|
|
50
|
+
visible: isOpen,
|
|
51
|
+
closeOnTriggerHidden: true,
|
|
52
|
+
closeOnOutsideClick,
|
|
53
|
+
onVisibleChange: state => {
|
|
54
|
+
onOpenChange?.(state);
|
|
55
|
+
setIsOpen(state);
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
placement,
|
|
59
|
+
modifiers: [
|
|
60
|
+
sameWidth,
|
|
61
|
+
{
|
|
62
|
+
name: 'offset',
|
|
63
|
+
options: {
|
|
64
|
+
offset: [0, offset]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
const isFocusWithin = useFocusWithin(popoverRef, {
|
|
70
|
+
onBlur: (e) => {
|
|
71
|
+
if (e.relatedTarget && visible) {
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
useKeyPress('esc', () => setIsOpen(false));
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
open !== undefined && setIsOpen(open);
|
|
79
|
+
}, [open]);
|
|
80
|
+
return (_jsxs("div", { ref: popoverRef, className: clsx(styles.Popover, className), "data-popover-has-focus": isFocusWithin, children: [Children.map(trigger, (child) => isValidElement(child) && cloneElement(child, {
|
|
81
|
+
ref: setTriggerRef,
|
|
82
|
+
id: seedID('popover-trigger'),
|
|
83
|
+
key: seedID('popover-trigger'),
|
|
84
|
+
'aria-haspopup': 'true',
|
|
85
|
+
'aria-controls': seedID('popover-menu'),
|
|
86
|
+
'aria-expanded': isOpen,
|
|
87
|
+
...otherProps
|
|
88
|
+
})), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), children: _jsx(motion.div, { variants: PopoverAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: Children.map(children, (child) => isValidElement(child) && cloneElement(child, {
|
|
89
|
+
id: seedID('popover-menu'),
|
|
90
|
+
'aria-labelledby': seedID('popover-trigger')
|
|
91
|
+
})) }) }, seedID('tooltip-content'))) })] }));
|
|
92
|
+
});
|
|
93
|
+
Popover.displayName = 'Popover';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Popover{display:contents}.PopUp{inline-size:max-content;z-index:2}
|
|
@@ -3,5 +3,5 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import styles from './prose.module.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
export const Prose = forwardRef(({ children, className, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
|
|
6
|
-
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Prose, className), ...otherProps, children: children }
|
|
6
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Prose, className), ...otherProps, children: children }));
|
|
7
7
|
});
|
|
@@ -11,6 +11,6 @@ export const Select = forwardRef(({ children, className, disabled = false, icon
|
|
|
11
11
|
regular: 16,
|
|
12
12
|
big: 24
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Select, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled,
|
|
14
|
+
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(styles.Select, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, hAlign: "start", vAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }), _jsxs("div", { className: styles.FieldContainer, children: [_jsx("select", { disabled: disabled, className: styles.Field, id: seedID('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps, children: children }), kind === 'single' && (_jsx(Icon, { className: styles.Icon, source: icon, dimension: iconSizes[dimension] }))] })] }));
|
|
15
15
|
});
|
|
16
16
|
Select.displayName = 'Select';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Select{-webkit-appearance:none;appearance:none;padding:0;position:relative}.Select[data-select-dimension=small]{--field-height:1.33rem;--field-padding:0.33rem;--font-size:0.78rem}.Select[data-select-dimension=regular]{--field-height:2.22rem;--field-padding:0.89rem;--font-size:0.89rem}.Select[data-select-dimension=big]{--field-height:2.67rem;--field-padding:0.89rem;--font-size:1.00rem}.FieldContainer{color:var(--global-vibrancy-foreground);inline-size:100%;position:relative}.Select[aria-disabled=true] .FieldContainer{color:var(--global-disabled-foreground)}.Field{-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));block-size:var(--field-height);border:0;border-radius:.22rem;box-sizing:border-box;color:inherit;display:block;font-family:inherit;font-size:var(--font-size);inline-size:100%;margin:0;overflow:hidden;padding:0 calc(var(--field-padding)*3.5) 0 var(--field-padding);text-overflow:ellipsis}.Field:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));color:var(--global-disabled-foreground);cursor:not-allowed}.Field option{color:#000}.Field optgroup{color:initial}.Field[multiple]{block-size:auto;overflow:auto;padding:.44rem .89rem}.Field[multiple] option{color:
|
|
1
|
+
.Select{-webkit-appearance:none;appearance:none;padding:0;position:relative}.Select[data-select-dimension=small]{--field-height:1.33rem;--field-padding:0.33rem;--font-size:0.78rem}.Select[data-select-dimension=regular]{--field-height:2.22rem;--field-padding:0.89rem;--font-size:0.89rem}.Select[data-select-dimension=big]{--field-height:2.67rem;--field-padding:0.89rem;--font-size:1.00rem}.FieldContainer{color:var(--global-vibrancy-foreground);inline-size:100%;position:relative}.Select[aria-disabled=true] .FieldContainer{color:var(--global-disabled-foreground)}.Field{-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));block-size:var(--field-height);border:0;border-radius:.22rem;box-sizing:border-box;color:inherit;display:block;font-family:inherit;font-size:var(--font-size);inline-size:100%;margin:0;overflow:hidden;padding:0 calc(var(--field-padding)*3.5) 0 var(--field-padding);text-overflow:ellipsis}.Field:disabled{background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));color:var(--global-disabled-foreground);cursor:not-allowed}.Field option{color:#000}.Field optgroup{color:initial}.Field[multiple]{block-size:auto;overflow:auto;padding:.44rem .89rem}.Field[multiple] option{color:currentcolor;padding:calc(var(--field-padding)/2) var(--field-padding)}.Field[multiple] option:checked{background:var(--dimmed-4) linear-gradient(to bottom,var(--dimmed-4) 0,var(--dimmed-4) 100%);background-color:var(--dimmed-4);color:var(--dimmed-0)}.Field[multiple] optgroup{color:currentcolor;font-family:inherit;font-size:inherit;line-height:inherit;margin:0 0 1rem}.Icon{border-radius:.22rem;pointer-events:none;position:absolute;right:calc(var(--field-padding) - var(--field-padding)/3);top:calc(var(--field-height)/2);transform:translateY(-50%)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAqB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAqB,MAAM,OAAO,CAAA;AAIvF,oBAAY,aAAa,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CACvD,CAAA;AAED,eAAO,MAAM,QAAQ;IApBnB;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;;OAGG;qBACc,YAAY,gBAAgB,CAAC,GAAG,IAAI;oDAuCrD,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useEffect, useRef } from 'react';
|
|
4
4
|
import styles from './selection-controls.module.css';
|
|
5
|
+
import { domAnimation, LazyMotion, m } from 'framer-motion';
|
|
5
6
|
export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, indeterminate, ...otherProps }, forwardedRef) => {
|
|
6
7
|
const ref = useRef(forwardedRef);
|
|
7
8
|
useEffect(() => {
|
|
@@ -9,6 +10,6 @@ export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular'
|
|
|
9
10
|
ref.current.indeterminate = indeterminate;
|
|
10
11
|
}
|
|
11
12
|
}, [indeterminate]);
|
|
12
|
-
return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.
|
|
13
|
+
return (_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: styles.InputWrapper, whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, children: _jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.CheckboxInput, className), ref: ref, ...otherProps }) }) }));
|
|
13
14
|
});
|
|
14
15
|
Checkbox.displayName = 'Checkbox';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/radio.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/selection-controls/radio.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAIpE,oBAAY,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CACvD,CAAA;AAED,eAAO,MAAM,KAAK;IAfhB;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;qBACc,YAAY,gBAAgB,CAAC,GAAG,IAAI;oDA8BrD,CAAA"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styles from './selection-controls.module.css';
|
|
5
|
+
import { domAnimation, LazyMotion, m } from 'framer-motion';
|
|
5
6
|
export const Radio = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
6
|
-
return (_jsx("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.
|
|
7
|
+
return (_jsx(LazyMotion, { features: domAnimation, strict: true, children: _jsx(m.span, { className: styles.InputWrapper, whileTap: { scale: 1.15 }, transition: { duration: 0.3, ease: 'backOut' }, children: _jsx("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.RadioInput, className), ref: forwardedRef, ...otherProps }) }) }));
|
|
7
8
|
});
|
|
8
9
|
Radio.displayName = 'Radio';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.InputWrapper{display:inline-block;line-height:0}.CheckboxInput{--w:24px;--h:24px;-webkit-appearance:none;appearance:none;-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);block-size:var(--h);border-radius:.22rem;box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px var(--dimmed-2);color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.CheckboxInput:after{block-size:27%;border-bottom:2px solid;border-left:2px solid;content:"";display:none;inline-size:50%;left:50%;position:absolute;top:50%;transform:translate(-50%,-80%) rotate(-45deg)}.CheckboxInput:active{background-color:var(--global-vibrancy-background-hard)}.CheckboxInput:checked,.CheckboxInput:indeterminate{background:var(--dimmed-7);box-shadow:0 0 0 1px var(--global-background),inset 0 0 0 1px transparent}.CheckboxInput:checked:after,.CheckboxInput:indeterminate:after{display:block}.CheckboxInput:disabled{background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed}.CheckboxInput[data-control-dimension=small]{--w:16px;--h:16px}.CheckboxInput:indeterminate:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.RadioInput{composes:CheckboxInput;border-radius:100%}.RadioInput:after{background-color:currentcolor;block-size:50%;border:0;border-radius:100%;inline-size:50%;transform:translate(-50%,-50%)}.Toggle{--w:44px;--h:24px;--p:2px;composes:RadioInput;border-radius:200px;color:var(--dimmed-7)}.Toggle:checked{color:var(--global-background)}.Toggle:disabled{color:var(--global-disabled-foreground)}.Toggle:after{block-size:calc(var(--h) - var(--p)*2);bottom:var(--p);display:block;inline-size:calc(var(--h) - var(--p)*2);left:var(--p);top:var(--p);transform:none;transition:transform .1s cubic-bezier(.3,.07,.34,1),background-color .1s cubic-bezier(.3,.07,.34,1)}.Toggle:checked:after{display:block;transform:translateX(100%)}.Toggle[data-control-dimension=small]{--w:28px;--h:16px}
|
|
@@ -3,6 +3,6 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import styles from './selection-controls.module.css';
|
|
5
5
|
export const Toggle = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
6
|
-
return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Toggle, className), ref: forwardedRef, ...otherProps }
|
|
6
|
+
return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(styles.Toggle, className), ref: forwardedRef, ...otherProps }));
|
|
7
7
|
});
|
|
8
8
|
Toggle.displayName = 'Toggle';
|
|
@@ -3,6 +3,6 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import styles from './separator.module.css';
|
|
5
5
|
export const Separator = forwardRef(({ className, ...otherProps }, forwardedRef) => {
|
|
6
|
-
return (_jsx("hr", { ref: forwardedRef, className: clsx(styles.Separator, className), ...otherProps }
|
|
6
|
+
return (_jsx("hr", { ref: forwardedRef, className: clsx(styles.Separator, className), ...otherProps }));
|
|
7
7
|
});
|
|
8
8
|
Separator.displayName = 'Separator';
|
|
@@ -14,11 +14,11 @@ export const Skeleton = ({ className, borderRadius = 4, style, width, height, co
|
|
|
14
14
|
'--height': height && computedHeight,
|
|
15
15
|
'--gap': gap ? tkns.space[gap] : undefined
|
|
16
16
|
};
|
|
17
|
-
return (_jsx("span", { className: styles.SkeletonItem, "data-skeleton-circle": circle, "data-skeleton-animated": enableAnimation, style: { ...dynamicStyle, ...style }, children: "\u200C" }
|
|
17
|
+
return (_jsx("span", { className: styles.SkeletonItem, "data-skeleton-circle": circle, "data-skeleton-animated": enableAnimation, style: { ...dynamicStyle, ...style }, children: "\u200C" }));
|
|
18
18
|
}, [borderRadius, width, computedWidth, height, computedHeight, gap, circle, enableAnimation, style]);
|
|
19
19
|
return (_jsx("span", { className: className, "aria-live": "polite", "aria-busy": enableAnimation, ...otherProps, children: Array.from({ length: count }).map((_, i) => {
|
|
20
20
|
return inline
|
|
21
21
|
? _jsx(SkeletonItem, {}, uid(i))
|
|
22
|
-
: (_jsxs(Fragment, { children: [_jsx(SkeletonItem, {}
|
|
23
|
-
}) }
|
|
22
|
+
: (_jsxs(Fragment, { children: [_jsx(SkeletonItem, {}), _jsx("br", {})] }, uid(i)));
|
|
23
|
+
}) }));
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAyB,MAAM,OAAO,CAAA;AAC9E,OAAO,EAAqB,SAAS,
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAyB,MAAM,OAAO,CAAA;AAC9E,OAAO,EAAqB,SAAS,EAAa,MAAM,cAAc,CAAA;AAItE,oBAAY,WAAW,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAChE;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACjC,CAAA;AAED,eAAO,MAAM,MAAM;IA1CjB;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;oBACa,MAAM,GAAG,IAAI;IAC7B;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;oDA0DH,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useState } from 'react';
|
|
3
|
-
import { Stack, Text, Icon } from '../..';
|
|
3
|
+
import { Stack, Text, Icon, Textfield } from '../..';
|
|
4
4
|
import styles from './slider.module.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className, defaultValue = 0, dimension = 'regular', showValues, iconMin, iconMax, ...otherProps }, forwardedRef) => {
|
|
@@ -10,6 +10,6 @@ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className
|
|
|
10
10
|
onInput && onInput(currentTarget.valueAsNumber);
|
|
11
11
|
setValue(currentTarget.valueAsNumber);
|
|
12
12
|
}, [onInput]);
|
|
13
|
-
return (_jsxs(Stack, { direction: "row",
|
|
13
|
+
return (_jsxs(Stack, { direction: "row", vAlign: "center", columnGap: 8, className: clsx(styles.Slider, className), "data-slider-dimension": dimension, children: [showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: styles.Value, children: min }), (iconMin && !showValues) && _jsx(Icon, { source: iconMin, dimension: isSmall ? 16 : 24 }), _jsx("input", { ref: forwardedRef, className: styles.Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: styles.Value, children: max }), showValues && _jsx(Textfield, { readOnly: true, dimension: "small", size: String(max).length, value: value, className: styles.CurrentValue }), (iconMax && !showValues) && _jsx(Icon, { source: iconMax, dimension: isSmall ? 16 : 24 })] }));
|
|
14
14
|
});
|
|
15
15
|
Slider.displayName = 'Slider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Slider svg{flex-shrink:0}.Input{--track-color:var(--global-vibrancy-background);--progress-color:var(--dimmed-3);--thumb-size:24px;--progress-direction:calc(-9999px - var(--thumb-size)/2);-webkit-appearance:none;appearance:none;background:transparent;border-radius:100px;height:var(--thumb-size);overflow:hidden;width:100%}[dir=rtl] .Input{--progress-direction:calc(9999px + var(--thumb-size)/2)}.Slider[data-slider-dimension=small] .Input{--thumb-size:16px}.Input::-webkit-slider-runnable-track{background:var(--track-color);cursor:pointer;height:var(--thumb-size);-webkit-transition:background-color .2s ease-out;transition:background-color .2s ease-out;width:100%}.Input::-moz-range-track{background:var(--track-color);cursor:pointer;height:var(--thumb-size);-moz-transition:background-color .2s ease-out;transition:background-color .2s ease-out;width:100%}.Input::-moz-focus-outer{border:0}.Input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--dimmed-7);border:0;border-radius:100%;box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);height:var(--thumb-size);outline-offset:-2px;-webkit-transition:box-shadow .1s ease-out,background-color .1s ease-out;transition:box-shadow .1s ease-out,background-color .1s ease-out;width:var(--thumb-size)}.Input::-webkit-slider-thumb:active,.Input::-webkit-slider-thumb:focus{background-color:var(--dimmed-6)}.Input::-moz-range-thumb{appearance:none;background-color:var(--dimmed-7);border:0;border-radius:100%;box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);height:var(--thumb-size);outline-offset:-2px;-moz-transition:box-shadow .1s ease-out,background-color .1s ease-out;transition:box-shadow .1s ease-out,background-color .1s ease-out;width:var(--thumb-size)}.Input::-moz-range-thumb:active,.Input::-moz-range-thumb:focus{background-color:var(--dimmed-6)}.Input:active::-webkit-slider-thumb{background-color:var(--dimmed-7);box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);cursor:grabbing}.Input:active::-moz-range-thumb{background-color:var(--dimmed-7);box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);cursor:grabbing}.Input:disabled::-webkit-slider-runnable-track{background:var(--global-disabled-background);cursor:not-allowed}.Input:disabled::-moz-range-track{background:var(--global-disabled-background);cursor:not-allowed}.Input:disabled::-webkit-slider-thumb{background:none var(--global-disabled-foreground);box-shadow:var(--progress-direction) 0 0 9999px transparent;cursor:not-allowed}.Input:disabled::-moz-range-thumb{background:none var(--global-disabled-foreground);box-shadow:var(--progress-direction) 0 0 9999px transparent;cursor:not-allowed}.Value{
|
|
1
|
+
.Slider svg{flex-shrink:0}.Input{--track-color:var(--global-vibrancy-background);--progress-color:var(--dimmed-3);--thumb-size:24px;--progress-direction:calc(-9999px - var(--thumb-size)/2);-webkit-appearance:none;appearance:none;background:transparent;border-radius:100px;height:var(--thumb-size);overflow:hidden;width:100%}[dir=rtl] .Input{--progress-direction:calc(9999px + var(--thumb-size)/2)}.Slider[data-slider-dimension=small] .Input{--thumb-size:16px}.Input::-webkit-slider-runnable-track{background:var(--track-color);cursor:pointer;height:var(--thumb-size);-webkit-transition:background-color .2s ease-out;transition:background-color .2s ease-out;width:100%}.Input::-moz-range-track{background:var(--track-color);cursor:pointer;height:var(--thumb-size);-moz-transition:background-color .2s ease-out;transition:background-color .2s ease-out;width:100%}.Input::-moz-focus-outer{border:0}.Input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--dimmed-7);border:0;border-radius:100%;box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);height:var(--thumb-size);outline-offset:-2px;-webkit-transition:box-shadow .1s ease-out,background-color .1s ease-out;transition:box-shadow .1s ease-out,background-color .1s ease-out;width:var(--thumb-size)}.Input::-webkit-slider-thumb:active,.Input::-webkit-slider-thumb:focus{background-color:var(--dimmed-6)}.Input::-moz-range-thumb{appearance:none;background-color:var(--dimmed-7);border:0;border-radius:100%;box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);height:var(--thumb-size);outline-offset:-2px;-moz-transition:box-shadow .1s ease-out,background-color .1s ease-out;transition:box-shadow .1s ease-out,background-color .1s ease-out;width:var(--thumb-size)}.Input::-moz-range-thumb:active,.Input::-moz-range-thumb:focus{background-color:var(--dimmed-6)}.Input:active::-webkit-slider-thumb{background-color:var(--dimmed-7);box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);cursor:grabbing}.Input:active::-moz-range-thumb{background-color:var(--dimmed-7);box-shadow:var(--progress-direction) 0 0 9999px var(--progress-color);cursor:grabbing}.Input:disabled::-webkit-slider-runnable-track{background:var(--global-disabled-background);cursor:not-allowed}.Input:disabled::-moz-range-track{background:var(--global-disabled-background);cursor:not-allowed}.Input:disabled::-webkit-slider-thumb{background:none var(--global-disabled-foreground);box-shadow:var(--progress-direction) 0 0 9999px transparent;cursor:not-allowed}.Input:disabled::-moz-range-thumb{background:none var(--global-disabled-foreground);box-shadow:var(--progress-direction) 0 0 9999px transparent;cursor:not-allowed}.CurrentValue,.Value{flex-shrink:0}
|
|
@@ -11,5 +11,5 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
|
|
|
11
11
|
positive: 'check',
|
|
12
12
|
danger: 'circle-x'
|
|
13
13
|
};
|
|
14
|
-
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Snackbar, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, {
|
|
14
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(styles.Snackbar, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, { vAlign: "start", hAlign: "start", direction: "row", columnGap: 16, fill: false, children: [_jsx(Icon, { className: styles.Icon, weight: "duotone", source: icon || defaultIcons[kind], dimension: 24 }), _jsxs(Stack, { rowGap: 16, children: [_jsxs(Stack, { rowGap: 8, children: [title && _jsx(Title, { level: "5", children: title }), _jsx("p", { children: children })] }), dismissable && (_jsx(Stack, { hAlign: "end", children: _jsx(Button, { onClick: onDismiss, className: styles.Action, children: dismissLabel }) }))] })] }) }));
|
|
15
15
|
});
|
|
@@ -18,6 +18,6 @@ export const Spinner = forwardRef(({ className, style, color, dimension = 'big'
|
|
|
18
18
|
duration: 2,
|
|
19
19
|
repeat: Infinity,
|
|
20
20
|
repeatDelay: 2
|
|
21
|
-
}, style: { ...style, originX: '50%', originY: '50%' }, width: attributes[dimension].size, height: attributes[dimension].size, viewBox: "0 0 38 38", stroke: color || 'currentColor', xmlns: "http://www.w3.org/2000/svg", strokeLinecap: "round", children: _jsxs("g", { transform: "translate(1 1)", strokeWidth: 2, fill: "none", fillRule: "evenodd", children: [_jsx("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }
|
|
21
|
+
}, style: { ...style, originX: '50%', originY: '50%' }, width: attributes[dimension].size, height: attributes[dimension].size, viewBox: "0 0 38 38", stroke: color || 'currentColor', xmlns: "http://www.w3.org/2000/svg", strokeLinecap: "round", children: _jsxs("g", { transform: "translate(1 1)", strokeWidth: 2, fill: "none", fillRule: "evenodd", children: [_jsx("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }), _jsx("path", { d: "M36 18c0-9.94-8.06-18-18-18", children: _jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" }) })] }) }));
|
|
22
22
|
});
|
|
23
23
|
Spinner.displayName = 'Spinner';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button,
|
|
1
|
+
import { Button, PopoverProps, Polymorphic } from '../..';
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
|
-
export declare type SplitButtonProps = Pick<
|
|
3
|
+
export declare type SplitButtonProps = Pick<PopoverProps, 'placement' | 'offset'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Set the label of the action associated to the dropdown.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAW,YAAY,EAAS,WAAW,EAAE,MAAM,cAAc,CAAA;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,oBAAY,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,QAAQ,CAAC,GAAG;IAC1E;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,aAAK,sBAAsB,GAAG,WAAW,CAAC,mBAAmB,CAC3D,WAAW,CAAC,gBAAgB,CAAC,OAAO,MAAM,CAAC,EAC3C,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,MAAM,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,SAAS,CAAC,GAAG,gBAAgB,CACzG,CAAC;AAEF,eAAO,MAAM,WAAW,wBA+CI,CAAA"}
|