@wonderflow/react-components 3.0.0-beta.3 → 3.0.0-beta.4
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/card/card.module.css +1 -1
- package/dropdown/dropdown.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useFocusWithin.d.ts +20 -0
- package/hooks/useFocusWithin.js +37 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/modal/content/modal-content.js +2 -2
- package/modal/index.d.ts +0 -1
- package/modal/index.js +0 -1
- package/modal/modal.d.ts +0 -10
- package/modal/modal.js +6 -5
- package/modal/modal.module.css +1 -1
- package/overlay-container/index.d.ts +1 -0
- package/overlay-container/index.js +1 -0
- package/overlay-container/overlay-container.d.ts +10 -0
- package/overlay-container/overlay-container.js +8 -4
- package/overlay-container/overlay-container.module.css +1 -0
- package/overlay-container/overlay-context.d.ts +9 -0
- package/overlay-container/overlay-context.js +23 -0
- package/package.json +46 -7
- package/selection-controls/selection-controls.module.css +1 -1
- package/split-button/split-button.module.css +1 -1
- package/stack/stack.module.css +1 -1
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/title/title.module.css +1 -1
- package/tooltip/tooltip.js +1 -1
- package/modal/modal-context.d.ts +0 -9
- package/modal/modal-context.js +0 -23
package/card/card.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.Card){background:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}
|
|
1
|
+
:where(.Card){background:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}[data-card-dimmed="1"]:where(.Card){background:var(--dimmed-0)}[data-card-dimmed="2"]:where(.Card){background:var(--dimmed-1)}[data-card-dimmed="3"]:where(.Card){background:var(--dimmed-2)}[data-card-vibrant=true]:where(.Card){-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))}[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card).focus-visible,[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):hover{background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover))}[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):focus-visible,[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):hover{background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover))}[data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-1)}[data-card-vibrant=true][data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-2)}.Left{flex-shrink:0}.Content{flex-grow:1}.Right{flex-shrink:0}
|
package/dropdown/dropdown.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useState, Children, cloneElement, useRef, forwardRef } from 'react';
|
|
|
4
4
|
import { useKeyPress, useClickAway } from 'ahooks';
|
|
5
5
|
import { Dropdown as DropdownClass, PopUp } from './dropdown.module.css';
|
|
6
6
|
import { useUIDSeed } from 'react-uid';
|
|
7
|
-
import { useFocusWithin } from '
|
|
7
|
+
import { useFocusWithin } from '../hooks';
|
|
8
8
|
import { DropdownMenu } from './menu/dropdown-menu';
|
|
9
9
|
import { DropdownItem } from './item/dropdown-item';
|
|
10
10
|
import { DropdownItemCheckbox } from './item-checkbox/dropdown-item-checkbox';
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocusWithin } from './useFocusWithin';
|
package/hooks/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocusWithin } from './useFocusWithin';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FocusEvent, HTMLAttributes } from 'react';
|
|
2
|
+
interface FocusWithinProps {
|
|
3
|
+
/** Whether the focus within events should be disabled. */
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
/** Handler that is called when the target element or a descendant receives focus. */
|
|
6
|
+
onFocusWithin?: (e: FocusEvent) => void;
|
|
7
|
+
/** Handler that is called when the target element and all descendants lose focus. */
|
|
8
|
+
onBlurWithin?: (e: FocusEvent) => void;
|
|
9
|
+
/** Handler that is called when the the focus within state changes. */
|
|
10
|
+
onFocusWithinChange?: (isFocusWithin: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
interface FocusWithinResult {
|
|
13
|
+
/** Props to spread onto the target element. */
|
|
14
|
+
focusWithinProps: HTMLAttributes<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Handles focus events for the target and its descendants.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useFocusWithin(props: FocusWithinProps): FocusWithinResult;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
export function useFocusWithin(props) {
|
|
3
|
+
const state = useRef({
|
|
4
|
+
isFocusWithin: false
|
|
5
|
+
}).current;
|
|
6
|
+
if (props.isDisabled) {
|
|
7
|
+
return { focusWithinProps: {} };
|
|
8
|
+
}
|
|
9
|
+
const onFocus = (e) => {
|
|
10
|
+
if (!state.isFocusWithin) {
|
|
11
|
+
if (props.onFocusWithin) {
|
|
12
|
+
props.onFocusWithin(e);
|
|
13
|
+
}
|
|
14
|
+
if (props.onFocusWithinChange) {
|
|
15
|
+
props.onFocusWithinChange(true);
|
|
16
|
+
}
|
|
17
|
+
state.isFocusWithin = true;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const onBlur = (e) => {
|
|
21
|
+
if (state.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
|
|
22
|
+
if (props.onBlurWithin) {
|
|
23
|
+
props.onBlurWithin(e);
|
|
24
|
+
}
|
|
25
|
+
if (props.onFocusWithinChange) {
|
|
26
|
+
props.onFocusWithinChange(false);
|
|
27
|
+
}
|
|
28
|
+
state.isFocusWithin = false;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
focusWithinProps: {
|
|
33
|
+
onFocus: onFocus,
|
|
34
|
+
onBlur: onBlur
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -36,11 +36,11 @@ export { List } from './list';
|
|
|
36
36
|
export type { ListProps } from './list';
|
|
37
37
|
export { SplitButton } from './split-button';
|
|
38
38
|
export type { SplitButtonProps } from './split-button';
|
|
39
|
-
export { Modal
|
|
39
|
+
export { Modal } from './modal';
|
|
40
40
|
export type { ModalProps } from './modal';
|
|
41
41
|
export { LinearProgress } from './linear-progress';
|
|
42
42
|
export type { LinearProgressProps } from './linear-progress';
|
|
43
|
-
export { OverlayContainer } from './overlay-container';
|
|
43
|
+
export { OverlayContainer, useOverlayContext, OverlayProvider } from './overlay-container';
|
|
44
44
|
export type { OverlayContainerProps } from './overlay-container';
|
|
45
45
|
export { Prose } from './prose';
|
|
46
46
|
export type { ProseProps } from './prose';
|
package/index.js
CHANGED
|
@@ -18,9 +18,9 @@ export { InfoState } from './info-state';
|
|
|
18
18
|
export { InputGroup } from './input-group';
|
|
19
19
|
export { List } from './list';
|
|
20
20
|
export { SplitButton } from './split-button';
|
|
21
|
-
export { Modal
|
|
21
|
+
export { Modal } from './modal';
|
|
22
22
|
export { LinearProgress } from './linear-progress';
|
|
23
|
-
export { OverlayContainer } from './overlay-container';
|
|
23
|
+
export { OverlayContainer, useOverlayContext, OverlayProvider } from './overlay-container';
|
|
24
24
|
export { Prose } from './prose';
|
|
25
25
|
export { Pagination } from './pagination';
|
|
26
26
|
export { Select } from './select';
|
|
@@ -3,9 +3,9 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Content, Header, CloseButton } from './modal-content.module.css';
|
|
5
5
|
import { Title, Elevator, IconButton, Stack } from '../../';
|
|
6
|
-
import {
|
|
6
|
+
import { useOverlayContext } from '../../overlay-container';
|
|
7
7
|
export const ModalContent = forwardRef(({ children, className, title, theme = 'light', ...otherProps }, forwardedRef) => {
|
|
8
|
-
const { onClose, titleId } =
|
|
8
|
+
const { onClose, titleId } = useOverlayContext();
|
|
9
9
|
return (_jsx(Elevator, { resting: 4, children: _jsxs("div", { className: clsx(Content, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: [_jsxs(Stack, { verticalAlign: "center", fill: false, horizontalAlign: "space-between", direction: "row", className: Header, children: [_jsx(Title, { level: "5", id: titleId, children: title }, void 0), onClose && _jsx(IconButton, { onClick: onClose, className: CloseButton, icon: "xmark", kind: "flat" }, void 0)] }, void 0), children] }, void 0) }, void 0));
|
|
10
10
|
});
|
|
11
11
|
ModalContent.displayName = 'Modal.Content';
|
package/modal/index.d.ts
CHANGED
package/modal/index.js
CHANGED
package/modal/modal.d.ts
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { ModalContentProps } from './content/modal-content';
|
|
3
3
|
export declare type ModalProps = PropsWithChildren<PropsWithClass> & {
|
|
4
|
-
/**
|
|
5
|
-
* Set the overlay style. This is used to obscure the page content
|
|
6
|
-
* behind the modal while it is open. If set to `auto`, the overlay
|
|
7
|
-
* color is determined by the global active theme (light or dark).
|
|
8
|
-
*/
|
|
9
|
-
overlayColor?: 'light' | 'dark' | 'auto';
|
|
10
4
|
/**
|
|
11
5
|
* This enable the modal to be closed by clicking on the overlay.
|
|
12
6
|
* Even if this can be set to `false` we strongly recommend to leave
|
|
13
7
|
* it to `true` as it ensures the accessibility of the modal.
|
|
14
8
|
*/
|
|
15
9
|
closeOnClickOutside?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The callback function that is called when the modal is closed.
|
|
18
|
-
*/
|
|
19
|
-
onClose(): void;
|
|
20
10
|
};
|
|
21
11
|
declare type ModalComponent = React.ForwardRefExoticComponent<ModalProps> & {
|
|
22
12
|
Content: React.ForwardRefExoticComponent<ModalContentProps>;
|
package/modal/modal.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useUIDSeed } from 'react-uid';
|
|
4
4
|
import { motion } from 'framer-motion';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { FocusOn } from 'react-focus-on';
|
|
7
7
|
import { ModalContent } from './content/modal-content';
|
|
8
|
-
import { Modal as ModalClass,
|
|
9
|
-
import {
|
|
10
|
-
export const Modal = forwardRef(({ children, className,
|
|
8
|
+
import { Modal as ModalClass, Container } from './modal.module.css';
|
|
9
|
+
import { useOverlayContext } from '../overlay-container';
|
|
10
|
+
export const Modal = forwardRef(({ children, className, closeOnClickOutside = true, ...otherProps }, forwardedRef) => {
|
|
11
11
|
const seedID = useUIDSeed();
|
|
12
|
-
|
|
12
|
+
const { titleId, onClose } = useOverlayContext();
|
|
13
|
+
return (_jsx("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: clsx(ModalClass, className), ref: forwardedRef, ...otherProps, children: _jsx(FocusOn, { onClickOutside: onClose, onEscapeKey: onClose, children: _jsx(motion.div, { initial: { scale: 0.98, opacity: 0 }, animate: { scale: 1, opacity: 1 }, transition: { ease: 'easeOut', duration: 0.1 }, exit: { scale: 0.98, opacity: 0 }, className: Container, children: children }, seedID('modal-container')) }, void 0) }, void 0));
|
|
13
14
|
});
|
|
14
15
|
Modal.displayName = 'Modal';
|
|
15
16
|
Modal.Content = ModalContent;
|
package/modal/modal.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Modal{position:fixed;z-index:20}.
|
|
1
|
+
.Modal{position:fixed;z-index:20}.Container,.Modal{bottom:0;left:0;right:0;top:0}.Container{align-items:center;display:grid;justify-content:center;pointer-events:none;position:absolute;z-index:1}@media (min-width:30em){.Container{overflow:auto;padding:0 1.33rem}}.Container>*{pointer-events:auto}
|
|
@@ -15,5 +15,15 @@ export declare type OverlayContainerProps = {
|
|
|
15
15
|
* if necessary.
|
|
16
16
|
*/
|
|
17
17
|
index?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Set the overlay style. This is used to obscure the page content
|
|
20
|
+
* behind the content of the overlay, while it is open. If set to `auto`, the overlay
|
|
21
|
+
* color is determined by the global active theme (light or dark).
|
|
22
|
+
*/
|
|
23
|
+
overlayColor?: 'light' | 'dark' | 'auto';
|
|
24
|
+
/**
|
|
25
|
+
* The callback function that is called when the overlay is closed.
|
|
26
|
+
*/
|
|
27
|
+
onClose?(): void;
|
|
18
28
|
};
|
|
19
29
|
export declare const OverlayContainer: React.FC<OverlayContainerProps>;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
2
3
|
import { useEffect } from 'react';
|
|
3
|
-
import { ModalProvider } from '../modal';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
|
|
5
|
+
import { useUIDSeed } from 'react-uid';
|
|
6
|
+
import { OverlayProvider } from './overlay-context';
|
|
7
|
+
import { Backdrop } from './overlay-container.module.css';
|
|
8
|
+
export const OverlayContainer = ({ children, root = document.body, overlayColor = 'dark', index = 4, onClose }) => {
|
|
9
|
+
const seedID = useUIDSeed();
|
|
6
10
|
useEffect(() => {
|
|
7
11
|
if (root.closest('[data-overlay-container]')) {
|
|
8
12
|
throw new Error('An OverlayContainer must not be inside another container. Please change the root prop.');
|
|
9
13
|
}
|
|
10
14
|
}, [root]);
|
|
11
|
-
const content = (_jsx(
|
|
15
|
+
const content = (_jsx(OverlayProvider, { onClose: onClose, children: _jsx(AnimatePresence, { children: children && (_jsxs(_Fragment, { children: [_jsx(motion.span, { className: Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, transition: { duration: 0.2 } }, seedID('modal-backdrop')), _jsx("div", { "data-overlay-container": true, style: { position: 'relative', zIndex: index }, children: children }, void 0)] }, void 0)) }, void 0) }, void 0));
|
|
12
16
|
return createPortal(content, root);
|
|
13
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Backdrop{background-color:var(--dimmed-0);bottom:0;display:block;left:0;position:fixed;right:0;top:0;z-index:1}.Backdrop[data-overlay-color=light]{background-color:#f9fafb}.Backdrop[data-overlay-color=dark]{background-color:#202328}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { OverlayContainerProps } from './overlay-container';
|
|
3
|
+
declare type OverlayContextProps = Partial<OverlayContainerProps> & {
|
|
4
|
+
titleId?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const OverlayContext: import("react").Context<OverlayContextProps>;
|
|
7
|
+
export declare const OverlayProvider: (props: PropsWithChildren<OverlayContextProps>) => JSX.Element;
|
|
8
|
+
export declare const useOverlayContext: () => OverlayContextProps;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
import { useUIDSeed } from 'react-uid';
|
|
4
|
+
export const OverlayContext = createContext({
|
|
5
|
+
titleId: '',
|
|
6
|
+
onClose: () => { }
|
|
7
|
+
});
|
|
8
|
+
OverlayContext.displayName = 'OverlayContext';
|
|
9
|
+
export const OverlayProvider = (props) => {
|
|
10
|
+
const seedID = useUIDSeed();
|
|
11
|
+
const { children, titleId = seedID('overlay-title'), onClose } = props;
|
|
12
|
+
return (_jsx(OverlayContext.Provider, { value: {
|
|
13
|
+
titleId,
|
|
14
|
+
onClose
|
|
15
|
+
}, children: children }, void 0));
|
|
16
|
+
};
|
|
17
|
+
export const useOverlayContext = () => {
|
|
18
|
+
const context = useContext(OverlayContext);
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error('OverlayContainer component must be used inside OverlayContext to access context data.');
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderflow/react-components",
|
|
3
3
|
"description": "UI components from Wonderflow's Wanda design system",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.4",
|
|
5
5
|
"author": "Wonderflow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"start": "run-s build:themes build:icons storybook",
|
|
37
37
|
"storybook": "start-storybook --quiet -p 6006",
|
|
38
|
+
"commit": "cz",
|
|
38
39
|
"lint": "run-s lint:scripts && run-s lint:styles",
|
|
39
40
|
"lint:scripts": "eslint \"src/**/*.{tsx,ts}\"",
|
|
40
41
|
"lint:styles": "stylelint src/**/*.css",
|
|
@@ -96,13 +97,15 @@
|
|
|
96
97
|
"@semantic-release/github": "8.0.2",
|
|
97
98
|
"@semantic-release/npm": "8.0.3",
|
|
98
99
|
"@semantic-release/release-notes-generator": "10.0.3",
|
|
99
|
-
"@storybook/addon-actions": "6.4
|
|
100
|
-
"@storybook/addon-essentials": "6.4
|
|
101
|
-
"@storybook/addon-links": "6.4
|
|
100
|
+
"@storybook/addon-actions": "6.5.0-alpha.4",
|
|
101
|
+
"@storybook/addon-essentials": "6.5.0-alpha.4",
|
|
102
|
+
"@storybook/addon-links": "6.5.0-alpha.4",
|
|
102
103
|
"@storybook/addon-postcss": "2.0.0",
|
|
103
|
-
"@storybook/addons": "6.4
|
|
104
|
-
"@storybook/
|
|
105
|
-
"@storybook/
|
|
104
|
+
"@storybook/addons": "6.5.0-alpha.4",
|
|
105
|
+
"@storybook/builder-webpack5": "6.5.0-alpha.4",
|
|
106
|
+
"@storybook/manager-webpack5": "6.5.0-alpha.4",
|
|
107
|
+
"@storybook/react": "6.5.0-alpha.4",
|
|
108
|
+
"@storybook/theming": "6.5.0-alpha.4",
|
|
106
109
|
"@types/react-dom": "17.0.11",
|
|
107
110
|
"@typescript-eslint/eslint-plugin": "5.7.0",
|
|
108
111
|
"@typescript-eslint/parser": "5.7.0",
|
|
@@ -117,6 +120,7 @@
|
|
|
117
120
|
"directory-tree": "3.0.1",
|
|
118
121
|
"eslint": "7.32.0",
|
|
119
122
|
"eslint-plugin-react": "7.27.1",
|
|
123
|
+
"eslint-plugin-storybook": "0.5.5",
|
|
120
124
|
"fs-extra": "10.0.0",
|
|
121
125
|
"husky": "7.0.4",
|
|
122
126
|
"is-ci": "3.0.1",
|
|
@@ -130,14 +134,49 @@
|
|
|
130
134
|
"storybook-addon-themes": "6.1.0",
|
|
131
135
|
"storybook-css-modules-preset": "1.1.1",
|
|
132
136
|
"style-dictionary": "3.0.3",
|
|
137
|
+
"styled-components": "5.3.3",
|
|
133
138
|
"stylelint": "14.1.0",
|
|
134
139
|
"svgo": "2.8.0",
|
|
135
140
|
"svgstore": "3.0.1",
|
|
136
141
|
"typescript": "4.5.4",
|
|
137
142
|
"typescript-plugin-css-modules": "3.4.0",
|
|
143
|
+
"webpack": "5.65.0",
|
|
138
144
|
"yargs": "17.3.0"
|
|
139
145
|
},
|
|
140
146
|
"resolutions": {
|
|
141
147
|
"rc": "1.2.8"
|
|
148
|
+
},
|
|
149
|
+
"config": {
|
|
150
|
+
"commitizen": {
|
|
151
|
+
"path": "cz-conventional-changelog"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"release": {
|
|
155
|
+
"branches": [
|
|
156
|
+
"main",
|
|
157
|
+
{
|
|
158
|
+
"name": "beta",
|
|
159
|
+
"channel": "beta",
|
|
160
|
+
"prerelease": true
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"plugins": [
|
|
164
|
+
"commit-analyzer-fail-on-no-release",
|
|
165
|
+
"@semantic-release/release-notes-generator",
|
|
166
|
+
"@semantic-release/github",
|
|
167
|
+
[
|
|
168
|
+
"@semantic-release/npm",
|
|
169
|
+
{
|
|
170
|
+
"pkgRoot": "dist"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
"@semantic-release/exec",
|
|
175
|
+
{
|
|
176
|
+
"prepareCmd": "npx replace-json-property package.json version ${nextRelease.version}"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"@semantic-release/git"
|
|
180
|
+
]
|
|
142
181
|
}
|
|
143
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Checkbox{--w:24px;--h:24px;-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(--h);border-radius:.22rem;color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.Checkbox: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)}.Checkbox:active{background-color:var(--global-vibrancy-background-hover)}.Checkbox:checked,.Checkbox[data-control-indeterminate=true]{background:var(--dimmed-7)}
|
|
1
|
+
.Checkbox{--w:24px;--h:24px;-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(--h);border-radius:.22rem;color:var(--global-background);inline-size:var(--w);max-block-size:var(--h);max-inline-size:var(--w);position:relative}.Checkbox: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)}.Checkbox:active{background-color:var(--global-vibrancy-background-hover)}.Checkbox:checked,.Checkbox[data-control-indeterminate=true]{background:var(--dimmed-7)}.Checkbox:checked:after,.Checkbox[data-control-indeterminate=true]:after{display:block}.Checkbox:disabled{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));color:var(--global-disabled-foreground);cursor:not-allowed}.Checkbox[data-control-dimension=small]{--w:16px;--h:16px}.Checkbox[data-control-indeterminate=true]:after{block-size:2px;border-left:0;transform:translate(-50%,-50%)}.Radio{composes:Checkbox;border-radius:100%}.Radio: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:Radio;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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SplitButton>:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.SplitButton
|
|
1
|
+
.SplitButton>:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.SplitButton>[data-button-dimension=big]:first-child{padding-left:.89rem;padding-right:.89rem}.SplitButton>*>button{--separator-color:#6666;border-bottom-left-radius:0;border-top-left-radius:0;box-shadow:inset 1px 0 0 0 var(--separator-color)}.SplitButton>*>button[data-button-kind=primary]{--separator-color:#ffffff4d}.SplitButton>*>button:is([data-button-dimension=big],[data-button-dimension=regular]){padding-left:.44rem;padding-right:.44rem}
|
package/stack/stack.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}
|
|
1
|
+
:where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}[data-stack-fill=true]:where(.Stack)>*{flex-grow:1}[data-stack-direction=row]:where(.Stack){align-items:var(--vAlign);flex-direction:row;justify-content:var(--hAlign)}[data-stack-inline=true]:where(.Stack){display:inline-flex;flex-grow:0}[data-stack-wrap=true]:where(.Stack){flex-wrap:wrap}
|
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
package/title/title.module.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:0.3;color:var(--heading-foreground);display:block;font-size:var(--fs-max);line-height:1.2;max-inline-size:var(--maxW,initial);min-block-size:.01vh;overflow-wrap:break-word;text-align:var(--tAlign)}.Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display)
|
|
1
|
+
.Title:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:0.3;color:var(--heading-foreground);display:block;font-size:var(--fs-max);line-height:1.2;max-inline-size:var(--maxW,initial);min-block-size:.01vh;overflow-wrap:break-word;text-align:var(--tAlign)}.Title[data-title-line-height=small]:is(.H1,.H2,.H3,.H4,.H5,.H6,.Display){--lh:1.33}.Title:is(.H6){--fs-min:0.78rem;--fs-max:1.00rem;font-weight:700}.Title:is(.H5){--fs-min:1rem;--fs-max:1.33rem;font-weight:700}.Title:is(.H4){--fs-min:1.33rem;--fs-max:1.77rem;font-weight:700}.Title:is(.H3){--fs-min:1.77rem;--fs-max:2.37rem;font-weight:800}.Title:is(.H3):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H2){--fs-min:2.37rem;--fs-max:3.16rem;font-weight:800}.Title:is(.H2):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title:is(.H1){--fs-min:3.16rem;--fs-max:4.2rem;font-weight:800}.Title:is(.H1):before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title.Display{--fs-min:4.2rem;--fs-max:5.6rem;font-weight:800}.Title.Display:before{content:"";display:block;height:0;margin-top:calc((1 - var(--lh))*.6em);width:0}.Title[data-title-responsive=true]{font-size:var(--fs-min)}@media (min-width:48em){.Title[data-title-responsive=true]{font-size:var(--fs-max)}}
|
package/tooltip/tooltip.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Children, cloneElement, useState } from 'react';
|
|
|
3
3
|
import { useUIDSeed } from 'react-uid';
|
|
4
4
|
import { useKeyPress } from 'ahooks';
|
|
5
5
|
import { Elevator } from '../';
|
|
6
|
-
import { useFocusWithin } from '
|
|
6
|
+
import { useFocusWithin } from '../hooks';
|
|
7
7
|
import { Tooltip as TooltipClass, Arrow, Trigger } from './tooltip.module.css';
|
|
8
8
|
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
9
9
|
export const Tooltip = ({ children, trigger, placement = 'bottom-start', show, style, maxWidth = '40ch', fill = false, interactive = false, delay = 500 }) => {
|
package/modal/modal-context.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { ModalProps } from '../modal';
|
|
3
|
-
declare type ModalContextProps = Partial<ModalProps> & {
|
|
4
|
-
titleId?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const ModalContext: import("react").Context<ModalContextProps>;
|
|
7
|
-
export declare const ModalProvider: (props: PropsWithChildren<ModalContextProps>) => JSX.Element;
|
|
8
|
-
export declare const useModalContext: () => ModalContextProps;
|
|
9
|
-
export {};
|
package/modal/modal-context.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
import { useUIDSeed } from 'react-uid';
|
|
4
|
-
export const ModalContext = createContext({
|
|
5
|
-
titleId: '',
|
|
6
|
-
onClose: () => { }
|
|
7
|
-
});
|
|
8
|
-
ModalContext.displayName = 'ModalContext';
|
|
9
|
-
export const ModalProvider = (props) => {
|
|
10
|
-
const seedID = useUIDSeed();
|
|
11
|
-
const { children, titleId = seedID('modal-title'), onClose } = props;
|
|
12
|
-
return (_jsx(ModalContext.Provider, { value: {
|
|
13
|
-
titleId,
|
|
14
|
-
onClose
|
|
15
|
-
}, children: children }, void 0));
|
|
16
|
-
};
|
|
17
|
-
export const useModalContext = () => {
|
|
18
|
-
const context = useContext(ModalContext);
|
|
19
|
-
if (!context) {
|
|
20
|
-
throw new Error('Modal component must be used inside ModalContext to access context data.');
|
|
21
|
-
}
|
|
22
|
-
return context;
|
|
23
|
-
};
|