@vev/silke 1.0.21 → 1.0.23
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/CHANGELOG.md +15 -0
- package/dist/index.js +22 -22
- package/dist/index.js.map +4 -4
- package/dist/silke/src/components/silke-autocomplete-field/silke-autocomplete-field.d.ts +4 -0
- package/dist/silke/src/components/silke-breadcrumbs/silke-breadcrumb.d.ts +2 -1
- package/dist/silke/src/components/silke-button/index.d.ts +1 -0
- package/dist/silke/src/components/silke-button/silke-button.d.ts +2 -0
- package/dist/silke/src/components/silke-button/silke-dropdown-button.d.ts +17 -0
- package/dist/silke/src/components/silke-card/silke-card.d.ts +1 -1
- package/dist/silke/src/components/silke-color-swatches/silke-swatches.d.ts +2 -1
- package/dist/silke/src/components/silke-context-menu/silke-context-menu.d.ts +3 -1
- package/dist/silke/src/components/silke-css-number-field/index.d.ts +1 -0
- package/dist/silke/src/components/silke-css-number-field/silke-css-context.d.ts +7 -0
- package/dist/silke/src/components/silke-css-number-field/silke-css-number-field.d.ts +3 -0
- package/dist/silke/src/components/silke-css-number-field/variable-picker.d.ts +17 -0
- package/dist/silke/src/components/silke-form-schema/fields/video-field.d.ts +4 -0
- package/dist/silke/src/components/silke-link/silke-link.d.ts +1 -0
- package/dist/silke/src/components/silke-navigation-link/silke-navigation-link.d.ts +6 -1
- package/dist/silke/src/components/silke-text/silke-text.d.ts +1 -4
- package/dist/silke/src/components/silke-text-field/silke-text-field-outline.d.ts +3 -0
- package/dist/silke/src/hooks/drag-and-drop/use-drop.d.ts +2 -1
- package/dist/silke/src/icons.d.ts +8 -0
- package/dist/silke-code-editor-LK4ESGQO.js +25 -0
- package/dist/silke-code-editor-LK4ESGQO.js.map +7 -0
- package/dist/styles.css +1028 -926
- package/dist/utils/src/events/condition-parser/lexer.d.ts +1 -0
- package/dist/utils/src/types/context.d.ts +3 -1
- package/dist/utils/src/types/interaction.d.ts +9 -4
- package/dist/utils/src/types/vev-plugin.d.ts +40 -23
- package/dist/utils/src/types/vev-props.d.ts +6 -0
- package/dist/utils/src/utils/index.d.ts +1 -0
- package/dist/utils/src/utils/main-components.d.ts +7 -0
- package/esbuild.config.mjs +2 -4
- package/package.json +3 -3
- package/public/index.html +1 -1
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +13 -4
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +32 -7
- package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +11 -4
- package/src/components/silke-breadcrumbs/silke-breadcrumb.tsx +26 -6
- package/src/components/silke-button/index.ts +1 -0
- package/src/components/silke-button/silke-button.scss +0 -4
- package/src/components/silke-button/silke-button.tsx +8 -0
- package/src/components/silke-button/silke-dropdown-button.tsx +148 -0
- package/src/components/silke-color-picker/silke-color-picker.tsx +1 -0
- package/src/components/silke-color-swatches/silke-swatches.tsx +38 -6
- package/src/components/silke-context-menu/silke-context-menu.mdx +32 -0
- package/src/components/silke-context-menu/silke-context-menu.scss +6 -0
- package/src/components/silke-context-menu/silke-context-menu.tsx +22 -0
- package/src/components/silke-css-number-field/index.ts +1 -0
- package/src/components/silke-css-number-field/silke-css-context.tsx +17 -1
- package/src/components/silke-css-number-field/silke-css-number-field.mdx +30 -0
- package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -2
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +113 -13
- package/src/components/silke-css-number-field/variable-picker.tsx +181 -0
- package/src/components/silke-form-schema/fields/video-field.tsx +52 -0
- package/src/components/silke-form-schema/silke-schema-field.tsx +3 -1
- package/src/components/silke-image/silke-image.scss +1 -0
- package/src/components/silke-link/silke-link.mdx +3 -0
- package/src/components/silke-link/silke-link.scss +5 -1
- package/src/components/silke-link/silke-link.tsx +15 -3
- package/src/components/silke-modal/silke-modal.tsx +2 -0
- package/src/components/silke-navigation-link/silke-navigation-link.scss +67 -11
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +171 -51
- package/src/components/silke-overflow-menu/silke-overflow-menu.scss +1 -1
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +1 -1
- package/src/components/silke-select-field/silke-select-field.mdx +12 -0
- package/src/components/silke-text-field/silke-text-field-outline.tsx +69 -47
- package/src/components/silke-text-field/silke-text-field.scss +63 -0
- package/src/components/silke-text-field/silke-text-field.tsx +6 -0
- package/src/hooks/drag-and-drop/use-drop.tsx +3 -1
- package/src/icons.tsx +12 -2
- package/dist/silke-code-editor-4TSQ5KJ3.js +0 -25
- package/dist/silke-code-editor-4TSQ5KJ3.js.map +0 -7
- /package/dist/{silke-code-editor-4TSQ5KJ3.js.LEGAL.txt → silke-code-editor-LK4ESGQO.js.LEGAL.txt} +0 -0
|
@@ -45,6 +45,10 @@ export type SilkeAutocompleteFieldProps<T = any, U extends Entry<T> = any> = (Mu
|
|
|
45
45
|
*/
|
|
46
46
|
sort?: (one: Entry<T>, other: Entry<T>) => number;
|
|
47
47
|
onSearch?: (value: string) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Called when dropdown closes for any reason
|
|
50
|
+
*/
|
|
51
|
+
onClose?: () => void;
|
|
48
52
|
};
|
|
49
53
|
export declare const useMatchingItemsOnTop: (filteredItems: Entry<any>[], searchString?: string, selectedLabel?: string) => Entry<any>[];
|
|
50
54
|
export declare function SilkeAutocompleteField<T>(props: SilkeAutocompleteFieldProps<T>): React.JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SilkeIcons } from '../silke-icon';
|
|
3
|
+
import { IEmojiIcon } from '@vev/utils';
|
|
3
4
|
type SilkeBreadcrumbProps = {
|
|
4
|
-
icon?: SilkeIcons;
|
|
5
|
+
icon?: IEmojiIcon | SilkeIcons;
|
|
5
6
|
label?: string;
|
|
6
7
|
noSlash?: boolean;
|
|
7
8
|
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
@@ -17,6 +17,7 @@ export type SilkeButtonProps = {
|
|
|
17
17
|
/** Show button as in hover state */
|
|
18
18
|
hover?: boolean;
|
|
19
19
|
icon?: SilkeIcons | React.ReactElement;
|
|
20
|
+
leftIcon?: SilkeIcons | React.ReactElement;
|
|
20
21
|
link?: string;
|
|
21
22
|
target?: string;
|
|
22
23
|
} & Omit<BoxButtonProps, 'children' | 'size'>;
|
|
@@ -34,6 +35,7 @@ export declare const SilkeButton: React.ForwardRefExoticComponent<{
|
|
|
34
35
|
/** Show button as in hover state */
|
|
35
36
|
hover?: boolean | undefined;
|
|
36
37
|
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | SilkeIcons | undefined;
|
|
38
|
+
leftIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | SilkeIcons | undefined;
|
|
37
39
|
link?: string | undefined;
|
|
38
40
|
target?: string | undefined;
|
|
39
41
|
} & Omit<BoxButtonProps, "children" | "size"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SilkeButtonProps } from './silke-button';
|
|
3
|
+
import { SilkePopoverProps } from '../silke-popover';
|
|
4
|
+
import { SilkeOverflowMenuItem } from '../silke-overflow-menu';
|
|
5
|
+
export type SilkeDropdownButtonProps = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* What triggers the opening of the overflow menu
|
|
10
|
+
* @default "click"
|
|
11
|
+
*/
|
|
12
|
+
trigger?: 'click' | 'right-click';
|
|
13
|
+
onToggleOpen?: (open: boolean) => void;
|
|
14
|
+
/** Pass items or children */
|
|
15
|
+
items?: (SilkeOverflowMenuItem | React.ReactElement | 'divider')[] | (() => (SilkeOverflowMenuItem | React.ReactElement | 'divider')[]);
|
|
16
|
+
} & SilkeButtonProps & Omit<SilkePopoverProps, 'anchor' | 'hide' | 'children' | 'kind'>;
|
|
17
|
+
export declare function SilkeDropdownButton({ children, label, open: externalOpen, icon, items, offsetX, offsetY, trigger, targetOrigin, anchorOrigin, onClick, onMouseDown, onToggleOpen, ...rest }: SilkeDropdownButtonProps): React.JSX.Element;
|
|
@@ -23,4 +23,4 @@ export declare const SilkeCard: React.ForwardRefExoticComponent<{
|
|
|
23
23
|
* Show overflow menu above menu button
|
|
24
24
|
*/
|
|
25
25
|
overflowMenuAbove?: boolean | undefined;
|
|
26
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
26
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "title"> & React.RefAttributes<unknown>>;
|
|
@@ -10,6 +10,7 @@ interface BaseProps<T extends string> {
|
|
|
10
10
|
selected: T;
|
|
11
11
|
hidePalettes?: boolean;
|
|
12
12
|
hideSwatches?: boolean;
|
|
13
|
+
hideVariables?: boolean;
|
|
13
14
|
type?: SilkeSwatchType;
|
|
14
15
|
mode?: 'swatches' | 'palettes';
|
|
15
16
|
onSelect: (color: T, type: 'color' | 'gradient' | 'variable') => void;
|
|
@@ -21,5 +22,5 @@ type StringSwatchesProps = {
|
|
|
21
22
|
gradient?: false | undefined;
|
|
22
23
|
} & BaseProps<string>;
|
|
23
24
|
type SilkeSwatchesProps = StringSwatchesProps | GradientSwatchesProps;
|
|
24
|
-
export declare function SilkeSwatches({ selected, hidePalettes, hideSwatches, gradient, mode: desiredMode, onSelect, ...rest }: SilkeSwatchesProps): React.JSX.Element;
|
|
25
|
+
export declare function SilkeSwatches({ selected, hidePalettes, hideSwatches, hideVariables, gradient, mode: desiredMode, onSelect, ...rest }: SilkeSwatchesProps): React.JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -11,5 +11,7 @@ export type SilkeContextMenuProps = {
|
|
|
11
11
|
/** Used internally to keep track of menu and closing */
|
|
12
12
|
subMenu?: boolean;
|
|
13
13
|
gap?: BoxSpace;
|
|
14
|
+
beta?: boolean;
|
|
15
|
+
title?: string;
|
|
14
16
|
} & Omit<SilkePopoverProps, 'children' | 'kind'>;
|
|
15
|
-
export declare function SilkeContextMenu({ items, target, trigger, anchor, width, subMenu, gap, onRequestClose, ...rest }: SilkeContextMenuProps): React.JSX.Element | null;
|
|
17
|
+
export declare function SilkeContextMenu({ items, target, trigger, anchor, width, subMenu, gap, onRequestClose, beta, title, ...rest }: SilkeContextMenuProps): React.JSX.Element | null;
|
|
@@ -19,6 +19,13 @@ export type SilkeCSSContextType = {
|
|
|
19
19
|
variables: {
|
|
20
20
|
[variableName: string]: string;
|
|
21
21
|
};
|
|
22
|
+
variablesv2: {
|
|
23
|
+
key: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
unit?: string;
|
|
28
|
+
}[];
|
|
22
29
|
readonly?: boolean;
|
|
23
30
|
onVariableAdd?: (color: string) => void;
|
|
24
31
|
onVariableDelete?: (color: string) => void;
|
|
@@ -7,9 +7,12 @@ export type SilkeCssNumberFieldProps = FormFieldProps<string> & SilkeTextFieldOu
|
|
|
7
7
|
max?: number;
|
|
8
8
|
autoFocus?: boolean;
|
|
9
9
|
allowAuto?: boolean;
|
|
10
|
+
disableVariables?: boolean;
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
/** Define witch axis the number belongs to (used when converting values for the CSSContext) */
|
|
12
13
|
axis?: 'x' | 'y';
|
|
13
14
|
onEnter?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
15
|
+
onVariableAdd?: (type: string) => void;
|
|
16
|
+
onVariableEdit?: (key: string) => void;
|
|
14
17
|
};
|
|
15
18
|
export declare function SilkeCssNumberField(props: SilkeCssNumberFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Variable = {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
unit?: string;
|
|
8
|
+
};
|
|
9
|
+
type VariablePickerProps = {
|
|
10
|
+
variables: Variable[];
|
|
11
|
+
type: 'color' | 'number' | 'font';
|
|
12
|
+
onAdd?: (type: string) => void;
|
|
13
|
+
onEdit?: (key: string) => void;
|
|
14
|
+
onSelect: (variableKey: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function VariablePicker(props: VariablePickerProps): React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -9,6 +9,7 @@ interface LinkChildProps {
|
|
|
9
9
|
}
|
|
10
10
|
interface SilkeLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'>, LinkChildProps {
|
|
11
11
|
standalone?: boolean;
|
|
12
|
+
kind?: 'primary' | 'secondary';
|
|
12
13
|
}
|
|
13
14
|
export declare const SilkeLink: React.FunctionComponent<SilkeLinkProps>;
|
|
14
15
|
interface SilkeRouterLinkProps extends Omit<LinkProps, 'children'>, LinkChildProps {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { IEmojiIcon } from '@vev/utils';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
|
-
import { SilkeColor } from '../../';
|
|
4
3
|
import { BoxButtonProps, BoxLinkProps } from '../silke-box';
|
|
5
4
|
import { SilkeIcons } from '../silke-icon';
|
|
5
|
+
import { SilkeColor } from '../../silke-theme-provider';
|
|
6
|
+
import { SilkeContextMenuItems } from '../silke-context-menu';
|
|
6
7
|
type SilkeNavigationLinkProps = {
|
|
7
8
|
active?: boolean;
|
|
8
9
|
icon?: IEmojiIcon | SilkeIcons | React.ReactElement;
|
|
9
10
|
label: ReactNode;
|
|
11
|
+
subLabel?: string;
|
|
10
12
|
linkClassName?: string;
|
|
13
|
+
draggable?: boolean;
|
|
11
14
|
color?: SilkeColor;
|
|
15
|
+
items?: React.ReactElement[];
|
|
16
|
+
menu?: SilkeContextMenuItems;
|
|
12
17
|
/**
|
|
13
18
|
* Buttons/icons shown only on hover
|
|
14
19
|
*/
|
|
@@ -19,7 +19,6 @@ export declare function SilkeText({ tag, color, weight, flex, overflow, brandFon
|
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
lang?: string | undefined;
|
|
21
21
|
nonce?: string | undefined;
|
|
22
|
-
placeholder?: string | undefined;
|
|
23
22
|
slot?: string | undefined;
|
|
24
23
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
25
24
|
style?: React.CSSProperties | undefined;
|
|
@@ -50,7 +49,7 @@ export declare function SilkeText({ tag, color, weight, flex, overflow, brandFon
|
|
|
50
49
|
results?: number | undefined;
|
|
51
50
|
security?: string | undefined;
|
|
52
51
|
unselectable?: "on" | "off" | undefined;
|
|
53
|
-
inputMode?: "search" | "
|
|
52
|
+
inputMode?: "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined;
|
|
54
53
|
is?: string | undefined;
|
|
55
54
|
"aria-activedescendant"?: string | undefined;
|
|
56
55
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -247,9 +246,7 @@ export declare function SilkeText({ tag, color, weight, flex, overflow, brandFon
|
|
|
247
246
|
onPointerCancel?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
248
247
|
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
249
248
|
onPointerEnter?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
250
|
-
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
251
249
|
onPointerLeave?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
252
|
-
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
253
250
|
onPointerOver?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
254
251
|
onPointerOverCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
255
252
|
onPointerOut?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
@@ -31,8 +31,11 @@ export type SilkeTextFieldOutlineProps = {
|
|
|
31
31
|
labelUsingAria?: boolean;
|
|
32
32
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
33
33
|
onMouseDown?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
34
|
+
onVariableClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
34
35
|
disabled?: boolean;
|
|
35
36
|
tooltip?: string;
|
|
37
|
+
showVariableDot?: boolean;
|
|
38
|
+
hasActiveVariable?: boolean;
|
|
36
39
|
};
|
|
37
40
|
export declare const SilkeTextFieldOutline: React.ForwardRefExoticComponent<SilkeTextFieldOutlineProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
41
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
export type SilkeDropState = 'none' | 'over' | 'drop';
|
|
3
|
-
export declare function useDrop<T>({ ref, onOver, onDrop, canDrop, }: {
|
|
3
|
+
export declare function useDrop<T>({ ref, onOver, onDrop, canDrop, disabled, }: {
|
|
4
4
|
ref: MutableRefObject<HTMLElement | undefined | null>;
|
|
5
5
|
onOver?: (item: T, e: DragEvent) => void;
|
|
6
6
|
onDrop?: (item: T, e: DragEvent) => void;
|
|
7
7
|
canDrop?: (item: T, e: DragEvent, state: SilkeDropState) => boolean;
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
}): SilkeDropState;
|
|
@@ -18,6 +18,8 @@ export declare const SilkeIconDefinitions: {
|
|
|
18
18
|
share: string;
|
|
19
19
|
'cloud.check': string;
|
|
20
20
|
'cloud.slash': string;
|
|
21
|
+
ai: string;
|
|
22
|
+
compare: string;
|
|
21
23
|
menuMore: string;
|
|
22
24
|
menu: string;
|
|
23
25
|
drag: string;
|
|
@@ -78,6 +80,8 @@ export declare const SilkeIconDefinitions: {
|
|
|
78
80
|
grid: string;
|
|
79
81
|
notification: string;
|
|
80
82
|
'notification.new': string;
|
|
83
|
+
tracking: string;
|
|
84
|
+
trackingEvent: string;
|
|
81
85
|
package: string;
|
|
82
86
|
'package.open': string;
|
|
83
87
|
'select.all': string;
|
|
@@ -145,10 +149,12 @@ export declare const SilkeIconDefinitions: {
|
|
|
145
149
|
'comment.new': typeof CommentNew;
|
|
146
150
|
commentMarker: string;
|
|
147
151
|
template: string;
|
|
152
|
+
templates: string;
|
|
148
153
|
page: string;
|
|
149
154
|
project: string;
|
|
150
155
|
projects: string;
|
|
151
156
|
draft: string;
|
|
157
|
+
drafts: string;
|
|
152
158
|
account: string;
|
|
153
159
|
user: string;
|
|
154
160
|
'user.add': string;
|
|
@@ -328,6 +334,8 @@ export declare const SilkeIconDefinitions: {
|
|
|
328
334
|
'interaction.mouse-enter': string;
|
|
329
335
|
'interaction.mouse-leave': string;
|
|
330
336
|
'interaction.timer': string;
|
|
337
|
+
'variable.icon': string;
|
|
338
|
+
'variable.color': string;
|
|
331
339
|
};
|
|
332
340
|
declare function CustomComponentIcon({ className }: {
|
|
333
341
|
className?: string;
|