@wonderflow/react-components 3.0.0-next.9 → 3.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/autocomplete/autocomplete-option.d.ts +39 -0
- package/autocomplete/autocomplete-option.js +11 -0
- package/autocomplete/autocomplete.d.ts +24 -0
- package/autocomplete/autocomplete.js +82 -0
- package/autocomplete/autocomplete.module.css +1 -0
- package/autocomplete/index.d.ts +2 -0
- package/autocomplete/index.js +1 -0
- package/avatar/avatar.d.ts +15 -3
- package/avatar/avatar.js +3 -6
- package/button/button.d.ts +35 -0
- package/button/button.js +7 -10
- package/button/button.module.css +1 -1
- package/card/card.d.ts +24 -0
- package/card/card.js +3 -6
- package/card/card.module.css +1 -1
- package/chip/chip.d.ts +28 -4
- package/chip/chip.js +3 -5
- package/circular-progress/circular-progress.d.ts +33 -3
- package/circular-progress/circular-progress.js +3 -2
- package/clamp-text/clamp-text.d.ts +6 -0
- package/clamp-text/clamp-text.js +3 -2
- package/container/container.d.ts +6 -0
- package/container/container.js +3 -2
- package/core/typography.css +1 -1
- package/core/utils/media.css +19 -1
- package/core/utils/vibrancy.css +0 -24
- package/core.css +1 -1
- package/datetime/datetime.d.ts +7 -0
- package/datetime/datetime.js +16 -0
- package/datetime/index.d.ts +2 -0
- package/datetime/index.js +1 -0
- package/disclosure/disclosure.d.ts +55 -3
- package/disclosure/disclosure.js +4 -7
- package/drawer/drawer.d.ts +85 -0
- package/drawer/drawer.js +34 -0
- package/drawer/drawer.module.css +1 -0
- package/drawer/index.d.ts +2 -0
- package/drawer/index.js +1 -0
- package/dropdown/dropdown.d.ts +43 -10
- package/dropdown/dropdown.js +45 -34
- package/dropdown/dropdown.module.css +1 -1
- package/dropdown/index.d.ts +0 -1
- package/elevator/elevator.d.ts +11 -0
- package/elevator/elevator.js +6 -5
- package/grid/grid.d.ts +32 -2
- package/grid/grid.js +4 -3
- package/grid/grid.module.css +1 -1
- package/grid/index.d.ts +1 -1
- package/grid/item/grid-item.d.ts +41 -0
- package/grid/item/grid-item.js +12 -0
- package/grid/item/grid-item.module.css +1 -0
- package/icon/icon.d.ts +30 -4
- package/icon/icon.js +3 -3
- package/icon-button/icon-button.js +3 -2
- package/index.d.ts +86 -40
- package/index.js +6 -3
- package/info-state/info-state.d.ts +50 -6
- package/info-state/info-state.js +3 -9
- package/input-group/input-group.d.ts +33 -3
- package/input-group/input-group.js +11 -15
- package/linear-progress/linear-progress.d.ts +33 -3
- package/linear-progress/linear-progress.js +6 -7
- package/list/list.d.ts +13 -0
- package/list/list.js +4 -5
- package/list/list.module.css +1 -1
- package/masonry/masonry.d.ts +22 -0
- package/masonry/masonry.js +5 -4
- package/menu/index.d.ts +6 -0
- package/menu/index.js +3 -0
- package/menu/menu-item/menu-item-checkbox.d.ts +11 -0
- package/menu/menu-item/menu-item-checkbox.js +5 -0
- package/menu/menu-item/menu-item.d.ts +60 -0
- package/menu/menu-item/menu-item.js +23 -0
- package/menu/menu-item/menu-item.module.css +1 -0
- package/menu/menu.d.ts +16 -0
- package/menu/menu.js +15 -0
- package/menu/menu.module.css +1 -0
- package/modal/content/modal-content.d.ts +19 -3
- package/modal/content/modal-content.js +6 -9
- package/modal/content/modal-content.module.css +1 -1
- package/modal/index.d.ts +0 -1
- package/modal/index.js +0 -1
- package/modal/modal.d.ts +6 -3
- package/modal/modal.js +25 -11
- 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 +27 -1
- package/overlay-container/overlay-container.js +9 -5
- 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 +74 -30
- package/pagination/pagination.d.ts +26 -2
- package/pagination/pagination.js +5 -4
- package/polymorphic/polymorphic.d.ts +26 -1
- package/prose/prose.js +3 -2
- package/select/select.d.ts +45 -3
- package/select/select.js +4 -7
- package/select/select.module.css +1 -1
- package/selection-controls/checkbox.d.ts +31 -3
- package/selection-controls/checkbox.js +3 -2
- package/selection-controls/radio.d.ts +23 -3
- package/selection-controls/radio.js +3 -2
- package/selection-controls/selection-controls.module.css +1 -1
- package/selection-controls/toggle.d.ts +23 -3
- package/selection-controls/toggle.js +3 -2
- package/separator/separator.d.ts +2 -2
- package/separator/separator.js +3 -2
- package/skeleton-block/skeleton-block.d.ts +4 -0
- package/skeleton-block/skeleton-block.js +2 -2
- package/slider/slider.d.ts +65 -3
- package/slider/slider.js +3 -7
- package/snackbar/snackbar.d.ts +28 -2
- package/snackbar/snackbar.js +4 -11
- package/snackbar/snackbar.module.css +1 -1
- package/spinner/spinner.d.ts +15 -3
- package/spinner/spinner.js +4 -7
- package/split-button/split-button.d.ts +4 -2
- package/split-button/split-button.js +4 -5
- package/split-button/split-button.module.css +1 -1
- package/stack/stack.d.ts +35 -1
- package/stack/stack.js +3 -2
- package/stack/stack.module.css +1 -1
- package/star-meter/star-meter.d.ts +25 -0
- package/star-meter/star-meter.js +9 -16
- package/tab/primitive-tab.d.ts +1 -1
- package/tab/primitive-tab.js +3 -3
- package/tab/tab-item.d.ts +17 -3
- package/tab/tab-item.js +3 -4
- package/tab/tab-list.d.ts +6 -2
- package/tab/tab-list.js +3 -3
- package/tab/tab-panel.d.ts +25 -3
- package/tab/tab-panel.js +3 -2
- package/tab/tab.d.ts +18 -1
- package/tab/tab.js +6 -8
- package/table/table.d.ts +13 -0
- package/table/table.js +7 -9
- package/text/text.d.ts +31 -0
- package/text/text.js +4 -3
- package/text/text.module.css +1 -1
- package/textfield/base-field/base-field.d.ts +10 -1
- package/textfield/base-field/base-field.js +3 -2
- package/textfield/base-field/base-field.module.css +1 -1
- package/textfield/textfield.d.ts +76 -6
- package/textfield/textfield.js +10 -13
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/title/title.d.ts +20 -0
- package/title/title.js +3 -2
- package/title/title.module.css +1 -1
- package/toggle-button/toggle-button.d.ts +10 -0
- package/toggle-button/toggle-button.js +6 -5
- package/tooltip/tooltip.d.ts +33 -1
- package/tooltip/tooltip.js +24 -27
- package/tooltip/tooltip.module.css +1 -1
- package/dropdown/dropdown-item.d.ts +0 -21
- package/dropdown/dropdown-item.js +0 -26
- package/dropdown/dropdown-item.module.css +0 -1
- package/dropdown/dropdown-menu.d.ts +0 -7
- package/dropdown/dropdown-menu.js +0 -17
- package/dropdown/dropdown-menu.module.css +0 -1
- package/grid/grid-item.d.ts +0 -11
- package/grid/grid-item.js +0 -11
- package/modal/modal-context.d.ts +0 -9
- package/modal/modal-context.js +0 -22
- package/theme-switch/index.d.ts +0 -2
- package/theme-switch/index.js +0 -1
- package/theme-switch/theme-switch.d.ts +0 -9
- package/theme-switch/theme-switch.js +0 -14
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polymorphic types aretaken from https://github.com/radix-ui/primitives/blob/main/packages/react/polymorphic/src/polymorphic.ts
|
|
3
|
+
* Due the deprecation, we decided to include these types inside Wanda's react-components.
|
|
4
|
+
*
|
|
5
|
+
* All the references and liceses are own by the team Radix
|
|
6
|
+
*/
|
|
1
7
|
import * as React from 'react';
|
|
2
8
|
declare type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
|
|
9
|
+
/**
|
|
10
|
+
* Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
|
|
11
|
+
*/
|
|
3
12
|
declare type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
|
|
13
|
+
/**
|
|
14
|
+
* Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
15
|
+
*/
|
|
4
16
|
declare type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any> ? I : never;
|
|
5
17
|
declare type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
|
|
6
18
|
as?: E;
|
|
7
19
|
}>>;
|
|
8
|
-
interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}
|
|
20
|
+
interface ForwardRefComponent<IntrinsicElementString, OwnProps = {}
|
|
21
|
+
/**
|
|
22
|
+
* Extends original type to ensure built in React types play nice
|
|
23
|
+
* with polymorphic components still e.g. `React.ElementRef` etc.
|
|
24
|
+
*/
|
|
25
|
+
> extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
|
|
26
|
+
/**
|
|
27
|
+
* When `as` prop is passed, use this overload.
|
|
28
|
+
* Merges original own props (without DOM props) and the inferred props
|
|
29
|
+
* from `as` element with the own props taking precendence.
|
|
30
|
+
*
|
|
31
|
+
* We explicitly avoid `React.ElementType` and manually narrow the prop types
|
|
32
|
+
* so that events are typed when using JSX.IntrinsicElements.
|
|
33
|
+
*/
|
|
9
34
|
<As = IntrinsicElementString>(props: As extends '' ? {
|
|
10
35
|
as: keyof JSX.IntrinsicElements;
|
|
11
36
|
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
package/prose/prose.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Prose as ProseClass } from './prose.module.css';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
export const Prose = forwardRef(({ children, className, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(ProseClass, className), ...otherProps, children: children }, void 0));
|
|
6
7
|
});
|
package/select/select.d.ts
CHANGED
|
@@ -1,20 +1,62 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChangeEvent, SelectHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
export declare type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
|
|
4
|
+
/**
|
|
5
|
+
* Pass the children `option` elements. This is required.
|
|
6
|
+
*/
|
|
4
7
|
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Change the default icon displayed on the side of the select.
|
|
10
|
+
*/
|
|
5
11
|
icon?: IconNames;
|
|
12
|
+
/**
|
|
13
|
+
* Set the accessible label for the select.
|
|
14
|
+
*/
|
|
6
15
|
label?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Set how many options can be selected at once.
|
|
18
|
+
*/
|
|
7
19
|
kind?: 'single' | 'multiple';
|
|
20
|
+
/**
|
|
21
|
+
* Set the size of the select. This affects alsosize and style of the icon.
|
|
22
|
+
*/
|
|
8
23
|
dimension?: 'regular' | 'small' | 'big';
|
|
24
|
+
/**
|
|
25
|
+
* Set disabled state. The select is not interactive and grayed out.
|
|
26
|
+
*/
|
|
9
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function to be called when a new value is selected.
|
|
30
|
+
*/
|
|
10
31
|
onChange?(event: ChangeEvent<HTMLSelectElement>): void;
|
|
11
32
|
};
|
|
12
|
-
export declare const Select:
|
|
33
|
+
export declare const Select: import("react").ForwardRefExoticComponent<SelectHTMLAttributes<HTMLSelectElement> & {
|
|
34
|
+
/**
|
|
35
|
+
* Pass the children `option` elements. This is required.
|
|
36
|
+
*/
|
|
13
37
|
children: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Change the default icon displayed on the side of the select.
|
|
40
|
+
*/
|
|
14
41
|
icon?: IconNames | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Set the accessible label for the select.
|
|
44
|
+
*/
|
|
15
45
|
label?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Set how many options can be selected at once.
|
|
48
|
+
*/
|
|
16
49
|
kind?: "multiple" | "single" | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Set the size of the select. This affects alsosize and style of the icon.
|
|
52
|
+
*/
|
|
17
53
|
dimension?: "big" | "small" | "regular" | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Set disabled state. The select is not interactive and grayed out.
|
|
56
|
+
*/
|
|
18
57
|
disabled?: boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Callback function to be called when a new value is selected.
|
|
60
|
+
*/
|
|
19
61
|
onChange?(event: ChangeEvent<HTMLSelectElement>): void;
|
|
20
|
-
} &
|
|
62
|
+
} & import("react").RefAttributes<HTMLSelectElement>>;
|
package/select/select.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Text, Stack, Icon } from '../';
|
|
3
4
|
import { Select as SelectClass, FieldContainer, Icon as IconClass, Field } from './select.module.css';
|
|
4
5
|
import clsx from 'clsx';
|
|
5
6
|
import { useUIDSeed } from 'react-uid';
|
|
6
7
|
export const Select = forwardRef(({ children, className, disabled = false, icon = 'sort-alt', label, kind = 'single', dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
7
|
-
const
|
|
8
|
+
const seedID = useUIDSeed();
|
|
8
9
|
const iconSizes = {
|
|
9
10
|
small: 14,
|
|
10
11
|
regular: 16,
|
|
11
12
|
big: 24
|
|
12
13
|
};
|
|
13
|
-
return (
|
|
14
|
-
label && React.createElement(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('select') }, label),
|
|
15
|
-
React.createElement("div", { className: FieldContainer },
|
|
16
|
-
React.createElement("select", { disabled: disabled, className: Field, id: uid('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps }, children),
|
|
17
|
-
kind === 'single' && (React.createElement(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] })))));
|
|
14
|
+
return (_jsxs(Stack, { as: "fieldset", rowGap: 4, className: clsx(SelectClass, className), "data-select-is-multiple": kind === 'multiple', "data-select-has-label": Boolean(label), "data-select-dimension": dimension, "aria-disabled": disabled, horizontalAlign: "start", verticalAlign: "start", inline: true, tabIndex: disabled ? 0 : undefined, children: [label && _jsx(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: seedID('select'), children: label }, void 0), _jsxs("div", { className: FieldContainer, children: [_jsx("select", { disabled: disabled, className: Field, id: seedID('select'), multiple: kind === 'multiple', onChange: onChange, ref: forwardedRef, ...otherProps, children: children }, void 0), kind === 'single' && (_jsx(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] }, void 0))] }, void 0)] }, void 0));
|
|
18
15
|
});
|
|
19
16
|
Select.displayName = 'Select';
|
package/select/select.module.css
CHANGED
|
@@ -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;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%;
|
|
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-padding) - var(--field-padding)/4)}
|
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
2
|
export declare type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
/**
|
|
4
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
5
|
+
*/
|
|
3
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Set the indeterminate state. This state is used to indicate that the checkbox is partially checked.
|
|
9
|
+
* Is used when a subset of the options are selected but not all of them.
|
|
10
|
+
*/
|
|
4
11
|
indeterminate?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Set the size of the toggle.
|
|
14
|
+
*/
|
|
5
15
|
dimension?: 'regular' | 'small';
|
|
16
|
+
/**
|
|
17
|
+
* Callback function to be called when is toggled.
|
|
18
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
19
|
+
*/
|
|
6
20
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
7
21
|
};
|
|
8
|
-
export declare const Checkbox:
|
|
22
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
23
|
+
/**
|
|
24
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
25
|
+
*/
|
|
9
26
|
disabled?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Set the indeterminate state. This state is used to indicate that the checkbox is partially checked.
|
|
29
|
+
* Is used when a subset of the options are selected but not all of them.
|
|
30
|
+
*/
|
|
10
31
|
indeterminate?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Set the size of the toggle.
|
|
34
|
+
*/
|
|
11
35
|
dimension?: "small" | "regular" | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Callback function to be called when is toggled.
|
|
38
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
39
|
+
*/
|
|
12
40
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
13
|
-
} &
|
|
41
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { Checkbox as CheckboxClass } from './selection-controls.module.css';
|
|
4
5
|
export const Checkbox = forwardRef(({ className, disabled, dimension = 'regular', onChange, indeterminate, ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, "data-control-indeterminate": indeterminate, onChange: onChange, className: clsx(CheckboxClass, className), ref: forwardedRef, ...otherProps }, void 0));
|
|
6
7
|
});
|
|
7
8
|
Checkbox.displayName = 'Checkbox';
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
2
|
export declare type RadioProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
/**
|
|
4
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
5
|
+
*/
|
|
3
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Set the size of the toggle.
|
|
9
|
+
*/
|
|
4
10
|
dimension?: 'regular' | 'small';
|
|
11
|
+
/**
|
|
12
|
+
* Callback function to be called when is toggled.
|
|
13
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
14
|
+
*/
|
|
5
15
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
6
16
|
};
|
|
7
|
-
export declare const Radio:
|
|
17
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
18
|
+
/**
|
|
19
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
20
|
+
*/
|
|
8
21
|
disabled?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Set the size of the toggle.
|
|
24
|
+
*/
|
|
9
25
|
dimension?: "small" | "regular" | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function to be called when is toggled.
|
|
28
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
29
|
+
*/
|
|
10
30
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
} &
|
|
31
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { Radio as RadioClass } from './selection-controls.module.css';
|
|
4
5
|
export const Radio = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx("input", { type: "radio", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(RadioClass, className), ref: forwardedRef, ...otherProps }, void 0));
|
|
6
7
|
});
|
|
7
8
|
Radio.displayName = 'Radio';
|
|
@@ -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:
|
|
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-color: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{background-color: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,11 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
2
|
export declare type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
/**
|
|
4
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
5
|
+
*/
|
|
3
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Set the size of the toggle.
|
|
9
|
+
*/
|
|
4
10
|
dimension?: 'regular' | 'small';
|
|
11
|
+
/**
|
|
12
|
+
* Callback function to be called when is toggled.
|
|
13
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
14
|
+
*/
|
|
5
15
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
6
16
|
};
|
|
7
|
-
export declare const Toggle:
|
|
17
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
18
|
+
/**
|
|
19
|
+
* Set disabled state. The component is not interactive and grayed out.
|
|
20
|
+
*/
|
|
8
21
|
disabled?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Set the size of the toggle.
|
|
24
|
+
*/
|
|
9
25
|
dimension?: "small" | "regular" | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function to be called when is toggled.
|
|
28
|
+
* A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
|
|
29
|
+
*/
|
|
10
30
|
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
} &
|
|
31
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { Toggle as ToggleClass } from './selection-controls.module.css';
|
|
4
5
|
export const Toggle = forwardRef(({ className, disabled, dimension = 'regular', onChange, ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx("input", { type: "checkbox", disabled: disabled, "aria-disabled": disabled, "data-control-dimension": dimension, onChange: onChange, className: clsx(ToggleClass, className), ref: forwardedRef, ...otherProps }, void 0));
|
|
6
7
|
});
|
|
7
8
|
Toggle.displayName = 'Toggle';
|
package/separator/separator.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
export declare type SeparatorProps = HTMLAttributes<HTMLHRElement>;
|
|
3
|
-
export declare const Separator:
|
|
3
|
+
export declare const Separator: import("react").ForwardRefExoticComponent<SeparatorProps & import("react").RefAttributes<HTMLHRElement>>;
|
package/separator/separator.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { Separator as SeparatorClass } from './separator.module.css';
|
|
4
5
|
export const Separator = forwardRef(({ className, ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx("hr", { ref: forwardedRef, className: clsx(SeparatorClass, className), ...otherProps }, void 0));
|
|
6
7
|
});
|
|
7
8
|
Separator.displayName = 'Separator';
|
|
@@ -3,6 +3,10 @@ import { SkeletonProps } from 'react-loading-skeleton';
|
|
|
3
3
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
4
4
|
import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
|
|
5
5
|
export declare type SkeletonBlockProps = SkeletonProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Set the edge radius of each skeleton block.
|
|
8
|
+
* This value must be one of the available `radius` tokens
|
|
9
|
+
*/
|
|
6
10
|
borderRadius?: TokensTypes['radius'];
|
|
7
11
|
};
|
|
8
12
|
export declare const SkeletonBlock: ({ className, borderRadius, ...otherProps }: SkeletonBlockProps) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Skeleton from 'react-loading-skeleton';
|
|
3
3
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
4
4
|
export const SkeletonBlock = ({ className, borderRadius = 4, ...otherProps }) => {
|
|
5
|
-
return (
|
|
5
|
+
return (_jsx(Skeleton, { className: className, borderRadius: borderRadius, baseColor: "var(--dimmed-1)", highlightColor: "var(--dimmed-0)", ...otherProps }, void 0));
|
|
6
6
|
};
|
package/slider/slider.d.ts
CHANGED
|
@@ -1,24 +1,86 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
export declare type SliderProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
/**
|
|
5
|
+
* Set the minimum value of the slider. This value must be lower than `max`.
|
|
6
|
+
*/
|
|
4
7
|
min?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Set the maximum value of the slider. This value must be higher than `min`.
|
|
10
|
+
*/
|
|
5
11
|
max?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Set the step value of the slider.
|
|
14
|
+
* This allows the user to select a value in increments of `step`.
|
|
15
|
+
*/
|
|
6
16
|
step?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Callback function to be called when the value is changed.
|
|
19
|
+
* A parameter `number` is passed to get the new value.
|
|
20
|
+
*/
|
|
7
21
|
onInput?(value: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Set the initial value of the slider.
|
|
24
|
+
*/
|
|
8
25
|
defaultValue?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Show or hide the `max` value and the current value.
|
|
28
|
+
*/
|
|
9
29
|
showValues?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Add an icon representing the minimum value.
|
|
32
|
+
* This is only available when `showValues` is `false`.
|
|
33
|
+
*/
|
|
10
34
|
iconMin?: IconNames;
|
|
35
|
+
/**
|
|
36
|
+
* Add an icon representing the maximum value.
|
|
37
|
+
* This is only available when `showValues` is `false`.
|
|
38
|
+
*/
|
|
11
39
|
iconMax?: IconNames;
|
|
40
|
+
/**
|
|
41
|
+
* Set the size of the slider.
|
|
42
|
+
*/
|
|
12
43
|
dimension?: 'small' | 'regular';
|
|
13
44
|
};
|
|
14
|
-
export declare const Slider:
|
|
45
|
+
export declare const Slider: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
46
|
+
/**
|
|
47
|
+
* Set the minimum value of the slider. This value must be lower than `max`.
|
|
48
|
+
*/
|
|
15
49
|
min?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Set the maximum value of the slider. This value must be higher than `min`.
|
|
52
|
+
*/
|
|
16
53
|
max?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Set the step value of the slider.
|
|
56
|
+
* This allows the user to select a value in increments of `step`.
|
|
57
|
+
*/
|
|
17
58
|
step?: number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Callback function to be called when the value is changed.
|
|
61
|
+
* A parameter `number` is passed to get the new value.
|
|
62
|
+
*/
|
|
18
63
|
onInput?(value: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* Set the initial value of the slider.
|
|
66
|
+
*/
|
|
19
67
|
defaultValue?: number | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Show or hide the `max` value and the current value.
|
|
70
|
+
*/
|
|
20
71
|
showValues?: boolean | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Add an icon representing the minimum value.
|
|
74
|
+
* This is only available when `showValues` is `false`.
|
|
75
|
+
*/
|
|
21
76
|
iconMin?: IconNames | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Add an icon representing the maximum value.
|
|
79
|
+
* This is only available when `showValues` is `false`.
|
|
80
|
+
*/
|
|
22
81
|
iconMax?: IconNames | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Set the size of the slider.
|
|
84
|
+
*/
|
|
23
85
|
dimension?: "small" | "regular" | undefined;
|
|
24
|
-
} &
|
|
86
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
package/slider/slider.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useState } from 'react';
|
|
2
3
|
import { Stack, Text, Icon } from '..';
|
|
3
4
|
import { Slider as SliderClass, Input, Value } from './slider.module.css';
|
|
4
5
|
import clsx from 'clsx';
|
|
@@ -9,11 +10,6 @@ export const Slider = forwardRef(({ min = 0, max = 100, step, onInput, className
|
|
|
9
10
|
onInput && onInput(currentTarget.valueAsNumber);
|
|
10
11
|
setValue(currentTarget.valueAsNumber);
|
|
11
12
|
}, [onInput]);
|
|
12
|
-
return (
|
|
13
|
-
showValues && React.createElement(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: Value }, value),
|
|
14
|
-
(iconMin && !showValues) && React.createElement(Icon, { name: iconMin, dimension: isSmall ? 16 : 24 }),
|
|
15
|
-
React.createElement("input", { ref: forwardedRef, className: Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }),
|
|
16
|
-
showValues && React.createElement(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: Value }, max),
|
|
17
|
-
(iconMax && !showValues) && React.createElement(Icon, { name: iconMax, dimension: isSmall ? 16 : 24 })));
|
|
13
|
+
return (_jsxs(Stack, { direction: "row", verticalAlign: "center", columnGap: 8, className: clsx(SliderClass, className), "data-slider-dimension": dimension, children: [showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", textAlign: "end", className: Value, children: value }, void 0), (iconMin && !showValues) && _jsx(Icon, { name: iconMin, dimension: isSmall ? 16 : 24 }, void 0), _jsx("input", { ref: forwardedRef, className: Input, type: "range", min: min, max: max, defaultValue: value, "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, step: step, onInput: handleInput, ...otherProps }, void 0), showValues && _jsx(Text, { as: "span", size: isSmall ? 14 : 16, weight: "bold", className: Value, children: max }, void 0), (iconMax && !showValues) && _jsx(Icon, { name: iconMax, dimension: isSmall ? 16 : 24 }, void 0)] }, void 0));
|
|
18
14
|
});
|
|
19
15
|
Slider.displayName = 'Slider';
|
package/snackbar/snackbar.d.ts
CHANGED
|
@@ -2,14 +2,40 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
import { Polymorphic } from '../';
|
|
4
4
|
export declare type SnackbarProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The message to display. Describes the action that the snackbar takes
|
|
7
|
+
* or the feedback that the user has received.
|
|
8
|
+
*/
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Set the icon to be displaye alongside the title.
|
|
12
|
+
* This icon have to enforce the message in a not misleading way.
|
|
13
|
+
*/
|
|
5
14
|
icon?: IconNames;
|
|
15
|
+
/**
|
|
16
|
+
* Set the title of the snackbar. This must concisely describe the message.
|
|
17
|
+
*/
|
|
6
18
|
title?: string;
|
|
7
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Set the color and the sentiment of the snackbar.
|
|
21
|
+
* This affects the the color of all the elements inside and should be defined
|
|
22
|
+
* according to the message.
|
|
23
|
+
*/
|
|
8
24
|
kind?: 'info' | 'warning' | 'neutral' | 'positive' | 'danger';
|
|
25
|
+
/**
|
|
26
|
+
* Define if the snackbar can be dismissed by user interaction.
|
|
27
|
+
* If `true` a button will be displayed.
|
|
28
|
+
*/
|
|
9
29
|
dismissable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Set the label of the dismiss button.
|
|
32
|
+
*/
|
|
10
33
|
dismissLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Callback function to be called when the dismiss button is clicked.
|
|
36
|
+
*/
|
|
11
37
|
onDismiss?(): void;
|
|
12
38
|
};
|
|
13
|
-
declare type PolymorphicSnackbar = Polymorphic.ForwardRefComponent<'
|
|
39
|
+
declare type PolymorphicSnackbar = Polymorphic.ForwardRefComponent<'output', SnackbarProps>;
|
|
14
40
|
export declare const Snackbar: PolymorphicSnackbar;
|
|
15
41
|
export {};
|
package/snackbar/snackbar.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Snackbar as SnackbarClass, Icon as IconClass, Action } from './snackbar.module.css';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import { Title, Stack, Icon, Button } from '../';
|
|
5
|
-
export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = '
|
|
6
|
+
export const Snackbar = forwardRef(({ children, className, title, icon, kind = 'neutral', as: Wrapper = 'output', dismissable, dismissLabel = 'Dismiss', onDismiss, ...otherProps }, forwardedRef) => {
|
|
6
7
|
const defaultIcons = {
|
|
7
8
|
info: 'circle-info',
|
|
8
9
|
warning: 'triangle-exclamation',
|
|
@@ -10,13 +11,5 @@ export const Snackbar = forwardRef(({ children, className, title, icon, kind = '
|
|
|
10
11
|
positive: 'check',
|
|
11
12
|
danger: 'circle-x'
|
|
12
13
|
};
|
|
13
|
-
return (
|
|
14
|
-
React.createElement(Stack, { verticalAlign: "start", horizontalAlign: "start", direction: "row", columnGap: 16, fill: false },
|
|
15
|
-
React.createElement(Icon, { className: IconClass, name: icon || defaultIcons[kind], dimension: 24 }),
|
|
16
|
-
React.createElement(Stack, { rowGap: 16 },
|
|
17
|
-
React.createElement(Stack, { rowGap: 8 },
|
|
18
|
-
title && React.createElement(Title, { level: "5" }, title),
|
|
19
|
-
React.createElement("p", null, children)),
|
|
20
|
-
dismissable && (React.createElement(Stack, { horizontalAlign: "end" },
|
|
21
|
-
React.createElement(Button, { onClick: onDismiss, className: Action }, dismissLabel)))))));
|
|
14
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(SnackbarClass, className), "data-snackbar-kind": kind, role: "status", ...otherProps, children: _jsxs(Stack, { verticalAlign: "start", horizontalAlign: "start", direction: "row", columnGap: 16, fill: false, children: [_jsx(Icon, { className: IconClass, name: icon || defaultIcons[kind], dimension: 24 }, void 0), _jsxs(Stack, { rowGap: 16, children: [_jsxs(Stack, { rowGap: 8, children: [title && _jsx(Title, { level: "5", children: title }, void 0), _jsx("p", { children: children }, void 0)] }, void 0), dismissable && (_jsx(Stack, { horizontalAlign: "end", children: _jsx(Button, { onClick: onDismiss, className: Action, children: dismissLabel }, void 0) }, void 0))] }, void 0)] }, void 0) }, void 0));
|
|
22
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Snackbar{background:linear-gradient(to right,var(--snackbar-fg) 4px,var(--snackbar-bg) 4px);border-radius:.22rem;color:var(--snackbar-fg);overflow:hidden;padding:.89rem 1.33rem}.Snackbar p{font-size:.89rem}.Snackbar[data-snackbar-kind=neutral]{--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{flex-shrink:0}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}
|
|
1
|
+
.Snackbar{background:linear-gradient(to right,var(--snackbar-fg) 4px,var(--snackbar-bg) 4px);border-radius:.22rem;color:var(--snackbar-fg);display:block;overflow:hidden;padding:.89rem 1.33rem}.Snackbar p{font-size:.89rem}.Snackbar[data-snackbar-kind=neutral]{--snackbar-bg:var(--highlight-gray-background);--snackbar-fg:var(--highlight-gray-foreground)}.Snackbar[data-snackbar-kind=positive]{--snackbar-bg:var(--highlight-green-background);--snackbar-fg:var(--highlight-green-foreground)}.Snackbar[data-snackbar-kind=warning]{--snackbar-bg:var(--highlight-yellow-background);--snackbar-fg:var(--highlight-yellow-foreground)}.Snackbar[data-snackbar-kind=info]{--snackbar-bg:var(--highlight-blue-background);--snackbar-fg:var(--highlight-blue-foreground)}.Snackbar[data-snackbar-kind=danger]{--snackbar-bg:var(--highlight-red-background);--snackbar-fg:var(--highlight-red-foreground)}.Icon{flex-shrink:0}.Action:is(.Action.Action){background-color:var(--snackbar-fg);color:var(--snackbar-bg)}
|
package/spinner/spinner.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SVGAttributes } from 'react';
|
|
2
2
|
export declare type SpinnerProps = SVGAttributes<SVGElement> & {
|
|
3
|
+
/**
|
|
4
|
+
* Set the size of the spinner
|
|
5
|
+
*/
|
|
3
6
|
dimension?: 'small' | 'regular' | 'big';
|
|
7
|
+
/**
|
|
8
|
+
* Override the color of the spinner
|
|
9
|
+
*/
|
|
4
10
|
color?: string;
|
|
5
11
|
};
|
|
6
|
-
export declare const Spinner:
|
|
12
|
+
export declare const Spinner: import("react").ForwardRefExoticComponent<SVGAttributes<SVGElement> & {
|
|
13
|
+
/**
|
|
14
|
+
* Set the size of the spinner
|
|
15
|
+
*/
|
|
7
16
|
dimension?: "big" | "small" | "regular" | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Override the color of the spinner
|
|
19
|
+
*/
|
|
8
20
|
color?: string | undefined;
|
|
9
|
-
} &
|
|
21
|
+
} & import("react").RefAttributes<SVGSVGElement>>;
|
package/spinner/spinner.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { motion } from 'framer-motion';
|
|
4
5
|
export const Spinner = forwardRef(({ className, style, color, dimension = 'big' }, forwardedRef) => {
|
|
@@ -13,14 +14,10 @@ export const Spinner = forwardRef(({ className, style, color, dimension = 'big'
|
|
|
13
14
|
size: 30
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
|
-
return (
|
|
17
|
+
return (_jsx(motion.svg, { ref: forwardedRef, className: clsx(className), animate: { rotate: '2turn' }, transition: {
|
|
17
18
|
duration: 2,
|
|
18
19
|
repeat: Infinity,
|
|
19
20
|
repeatDelay: 2
|
|
20
|
-
}, 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" },
|
|
21
|
-
React.createElement("g", { transform: "translate(1 1)", strokeWidth: 2, fill: "none", fillRule: "evenodd" },
|
|
22
|
-
React.createElement("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }),
|
|
23
|
-
React.createElement("path", { d: "M36 18c0-9.94-8.06-18-18-18" },
|
|
24
|
-
React.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "1s", repeatCount: "indefinite" })))));
|
|
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 }, void 0), _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" }, void 0) }, void 0)] }, void 0) }, void 0));
|
|
25
22
|
});
|
|
26
23
|
Spinner.displayName = 'Spinner';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Button, DropdownProps, Polymorphic } from '..';
|
|
2
|
-
export declare type SplitButtonProps = Pick<DropdownProps, 'placement'> & {
|
|
2
|
+
export declare type SplitButtonProps = Pick<DropdownProps, 'placement' | 'offset'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Set the label of the action associated to the dropdown.
|
|
5
|
+
*/
|
|
3
6
|
label: string;
|
|
4
|
-
dropdownOffset?: DropdownProps['offset'];
|
|
5
7
|
};
|
|
6
8
|
declare type PolymorphicSplitButton = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Button>, Polymorphic.OwnProps<typeof Button> & SplitButtonProps>;
|
|
7
9
|
export declare const SplitButton: PolymorphicSplitButton;
|