@vev/silke 1.1.6 → 1.1.7

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.
Files changed (157) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +35 -35
  3. package/dist/index.js.LEGAL.txt +12 -12
  4. package/dist/styles.css +4416 -4020
  5. package/dist/types/components/index.d.ts +3 -2
  6. package/dist/types/components/silke-button/silke-dropdown-button.d.ts +8 -13
  7. package/dist/types/components/silke-card/silke-card-grid.d.ts +33 -1
  8. package/dist/types/components/silke-command-text-field/image-utils.d.ts +20 -0
  9. package/dist/types/components/silke-command-text-field/index.d.ts +4 -0
  10. package/dist/types/components/silke-command-text-field/silke-command-parser.d.ts +3 -0
  11. package/dist/types/components/silke-command-text-field/silke-command-parser.spec.d.ts +1 -0
  12. package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +46 -0
  13. package/dist/types/components/silke-command-text-field/utils.d.ts +61 -0
  14. package/dist/types/components/silke-command-text-field/utils.spec.d.ts +1 -0
  15. package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +1 -0
  16. package/dist/types/components/silke-image/silke-image.d.ts +2 -1
  17. package/dist/types/components/silke-list/index.d.ts +1 -0
  18. package/dist/types/components/silke-list/silke-list-item.d.ts +24 -6
  19. package/dist/types/components/silke-list/silke-list.d.ts +9 -9
  20. package/dist/types/components/silke-list/types.d.ts +19 -0
  21. package/dist/types/components/silke-list/utils.d.ts +3 -0
  22. package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +1 -0
  23. package/dist/types/components/silke-overflow-menu/silke-overflow-menu.d.ts +6 -1
  24. package/dist/types/components/silke-popover-native/silke-popover-native.d.ts +3 -1
  25. package/dist/types/components/silke-shortcut-button/index.d.ts +1 -0
  26. package/dist/types/components/silke-shortcut-button/silke-shortcut-button.d.ts +15 -0
  27. package/dist/types/components/silke-tag/silke-tag.d.ts +1 -1
  28. package/dist/types/icons.d.ts +30 -0
  29. package/jest.config.js +2 -3
  30. package/package.json +7 -2
  31. package/src/_variables.scss +125 -129
  32. package/src/components/index.ts +3 -2
  33. package/src/components/silke-action-box/silke-action-box.scss +2 -3
  34. package/src/components/silke-alert-banner/silke-alert-banner.scss +9 -10
  35. package/src/components/silke-autocomplete-field/autocomplete-item.tsx +2 -2
  36. package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -12
  37. package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +3 -2
  38. package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +63 -44
  39. package/src/components/silke-box/silke-box.mdx +321 -21
  40. package/src/components/silke-box/silke-box.scss +5 -5
  41. package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +147 -9
  42. package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
  43. package/src/components/silke-button/silke-big-button.scss +1 -1
  44. package/src/components/silke-button/silke-button.scss +24 -15
  45. package/src/components/silke-button/silke-dropdown-button.mdx +67 -0
  46. package/src/components/silke-button/silke-dropdown-button.tsx +40 -122
  47. package/src/components/silke-card/silke-card-grid.tsx +5 -3
  48. package/src/components/silke-card/silke-card.scss +8 -7
  49. package/src/components/silke-card/silke-card.tsx +7 -1
  50. package/src/components/silke-checkbox/silke-checkbox.mdx +139 -14
  51. package/src/components/silke-checkbox/silke-checkbox.scss +11 -11
  52. package/src/components/silke-color-picker/color-picker.scss +8 -8
  53. package/src/components/silke-color-swatches/silke-color-swatches.mdx +130 -0
  54. package/src/components/silke-command-text-field/image-utils.ts +71 -0
  55. package/src/components/silke-command-text-field/index.ts +12 -0
  56. package/src/components/silke-command-text-field/silke-command-parser.spec.ts +89 -0
  57. package/src/components/silke-command-text-field/silke-command-parser.ts +47 -0
  58. package/src/components/silke-command-text-field/silke-command-text-field.mdx +301 -0
  59. package/src/components/silke-command-text-field/silke-command-text-field.module.scss +119 -0
  60. package/src/components/silke-command-text-field/silke-command-text-field.tsx +665 -0
  61. package/src/components/silke-command-text-field/utils.spec.ts +366 -0
  62. package/src/components/silke-command-text-field/utils.ts +287 -0
  63. package/src/components/silke-conditions-input/silke-conditions-input.scss +4 -4
  64. package/src/components/silke-content-column/silke-content-column.scss +1 -1
  65. package/src/components/silke-context-menu/silke-context-menu.scss +3 -4
  66. package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
  67. package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -12
  68. package/src/components/silke-divider/silke-divider.mdx +154 -32
  69. package/src/components/silke-divider/silke-divider.scss +3 -2
  70. package/src/components/silke-drawer/silke-drawer.scss +6 -2
  71. package/src/components/silke-form/silke-form.mdx +254 -27
  72. package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -0
  73. package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -0
  74. package/src/components/silke-form-schema/fields/styles.scss +34 -35
  75. package/src/components/silke-form-schema/silke-schema-fields.tsx +4 -3
  76. package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +2 -2
  77. package/src/components/silke-icon/silke-icon.mdx +212 -8
  78. package/src/components/silke-icon/silke-icon.scss +10 -2
  79. package/src/components/silke-icon/silke-icon.tsx +1 -0
  80. package/src/components/silke-icon/silke-stacked-icon.scss +42 -45
  81. package/src/components/silke-icon-browser/silke-icon-browser.mdx +143 -0
  82. package/src/components/silke-image/silke-image-color-backdrop.scss +6 -6
  83. package/src/components/silke-image/silke-image.mdx +189 -41
  84. package/src/components/silke-image/silke-image.scss +3 -3
  85. package/src/components/silke-image/silke-image.tsx +14 -1
  86. package/src/components/silke-link/silke-link.scss +3 -5
  87. package/src/components/silke-list/index.ts +1 -0
  88. package/src/components/silke-list/silke-list-item.mdx +83 -0
  89. package/src/components/silke-list/silke-list-item.scss +119 -0
  90. package/src/components/silke-list/silke-list-item.tsx +137 -12
  91. package/src/components/silke-list/silke-list.mdx +108 -13
  92. package/src/components/silke-list/silke-list.scss +8 -15
  93. package/src/components/silke-list/silke-list.tsx +63 -9
  94. package/src/components/silke-list/types.ts +22 -0
  95. package/src/components/silke-list/utils.ts +24 -0
  96. package/src/components/silke-loader/silke-loader.mdx +139 -5
  97. package/src/components/silke-loader/silke-loader.scss +1 -1
  98. package/src/components/silke-modal/silke-modal.scss +9 -9
  99. package/src/components/silke-navigation-link/silke-navigation-link.mdx +27 -2
  100. package/src/components/silke-navigation-link/silke-navigation-link.scss +34 -40
  101. package/src/components/silke-navigation-link/silke-navigation-link.tsx +7 -6
  102. package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +228 -31
  103. package/src/components/silke-overflow-menu/silke-overflow-menu.scss +8 -8
  104. package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +14 -8
  105. package/src/components/silke-popover/silke-popover.scss +5 -5
  106. package/src/components/silke-popover-native/silke-popover-native.scss +93 -78
  107. package/src/components/silke-popover-native/silke-popover-native.tsx +4 -0
  108. package/src/components/silke-popover-native/use-popover-positioning.ts +1 -3
  109. package/src/components/silke-progress-indicator/silke-progress-indicator.scss +1 -1
  110. package/src/components/silke-radio-button/silke-radio-button.scss +18 -11
  111. package/src/components/silke-search-field/silke-search-field.mdx +161 -7
  112. package/src/components/silke-shortcut-button/index.ts +1 -0
  113. package/src/components/silke-shortcut-button/silke-shortcut-button.mdx +89 -0
  114. package/src/components/silke-shortcut-button/silke-shortcut-button.scss +145 -0
  115. package/src/components/silke-shortcut-button/silke-shortcut-button.tsx +55 -0
  116. package/src/components/silke-skeleton/silke-skeleton.mdx +109 -0
  117. package/src/components/silke-skeleton/silke-skeleton.scss +1 -1
  118. package/src/components/silke-slider/silke-slider.module.scss +19 -19
  119. package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +3 -3
  120. package/src/components/silke-sortable-list/silke-sortable-list.scss +4 -5
  121. package/src/components/silke-table/silke-table.scss +1 -1
  122. package/src/components/silke-tabs/silke-tabs.scss +3 -3
  123. package/src/components/silke-tag/silke-tag.mdx +179 -43
  124. package/src/components/silke-tag/silke-tag.scss +49 -12
  125. package/src/components/silke-tag/silke-tag.tsx +17 -7
  126. package/src/components/silke-text/silke-text.scss +6 -4
  127. package/src/components/silke-text/silke-title.scss +7 -14
  128. package/src/components/silke-text-field/silke-text-field.scss +9 -9
  129. package/src/components/silke-text-field/silke-text-field.tsx +1 -1
  130. package/src/components/silke-tile/silke-tile.scss +7 -3
  131. package/src/components/silke-toast-notification/silke-toast-notification.scss +4 -5
  132. package/src/components/silke-toggle/silke-toggle.mdx +163 -33
  133. package/src/components/silke-toggle/silke-toggle.scss +4 -4
  134. package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
  135. package/src/components/silke-tooltip/silke-shortcuts.tsx +3 -3
  136. package/src/components/silke-tooltip/silke-tooltip.scss +11 -16
  137. package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +9 -7
  138. package/src/components/silke-virtual/silke-virtual.mdx +161 -0
  139. package/src/components/silke-virtual/silke-virtual.scss +8 -8
  140. package/src/icons.tsx +43 -1
  141. package/src/styles/core.scss +42 -45
  142. package/src/styles/math.scss +66 -66
  143. package/tsconfig.build.json +2 -6
  144. package/tsconfig.build.tsbuildinfo +1 -1
  145. package/tsconfig.json +3 -14
  146. package/dist/types/components/silke-action-list/index.d.ts +0 -1
  147. package/dist/types/components/silke-action-list/silke-action-list.d.ts +0 -11
  148. package/dist/types/components/silke-list-card/index.d.ts +0 -1
  149. package/dist/types/components/silke-list-card/silke-list-card.d.ts +0 -14
  150. package/src/components/silke-action-list/index.ts +0 -1
  151. package/src/components/silke-action-list/silke-action-list.mdx +0 -48
  152. package/src/components/silke-action-list/silke-action-list.scss +0 -21
  153. package/src/components/silke-action-list/silke-action-list.tsx +0 -85
  154. package/src/components/silke-list-card/index.ts +0 -1
  155. package/src/components/silke-list-card/silke-list-card.mdx +0 -46
  156. package/src/components/silke-list-card/silke-list-card.scss +0 -57
  157. package/src/components/silke-list-card/silke-list-card.tsx +0 -63
@@ -9,6 +9,7 @@ export * from './silke-color-palettes';
9
9
  export * from './silke-color-swatches';
10
10
  export * from './silke-content-column';
11
11
  export * from './silke-context-menu';
12
+ export * from './silke-command-text-field';
12
13
  export * from './silke-divider';
13
14
  export * from './silke-drawer';
14
15
  export * from './silke-form-schema';
@@ -17,7 +18,6 @@ export * from './silke-iframe-portal';
17
18
  export * from './silke-image';
18
19
  export * from './silke-link';
19
20
  export * from './silke-list';
20
- export * from './silke-list-card';
21
21
  export * from './silke-loader';
22
22
  export * from './silke-modal';
23
23
  export * from './silke-navigation-link';
@@ -39,8 +39,9 @@ export * from './silke-tile';
39
39
  export * from './silke-toolbar';
40
40
  export * from './silke-tooltip';
41
41
  export * from './silke-action-box';
42
+ export * from './silke-shortcut-button';
42
43
  export * from './silke-popover-native';
43
- export * from './silke-action-list';
44
+ export * from './silke-list';
44
45
  export * from './silke-autocomplete-field';
45
46
  export * from './silke-checkbox';
46
47
  export * from './silke-color-picker';
@@ -1,18 +1,13 @@
1
- import React from 'react';
2
1
  import { SilkeButtonProps } from './silke-button';
3
2
  import { SilkePopoverProps } from '../silke-popover';
4
- import { SilkeOverflowMenuItem } from '../silke-overflow-menu';
3
+ import type { SilkeListItemType } from '../silke-list/types';
4
+ import { PopoverPlacement } from '../silke-popover-native/types';
5
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')[]);
6
+ items?: SilkeListItemType[];
7
+ placement?: PopoverPlacement;
16
8
  matchWidth?: boolean;
9
+ animate?: boolean;
10
+ size?: 's' | 'base';
11
+ closeOnSelect?: boolean;
17
12
  } & SilkeButtonProps & Omit<SilkePopoverProps, 'anchor' | 'hide' | 'children' | 'kind'>;
18
- export declare function SilkeDropdownButton({ children, label, open: externalOpen, icon, items, offsetX, offsetY, trigger, targetOrigin, anchorOrigin, onClick, onMouseDown, onToggleOpen, matchWidth, ...rest }: SilkeDropdownButtonProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function SilkeDropdownButton({ label, icon, items, offsetX, offsetY, placement, matchWidth, size, animate, closeOnSelect, ...rest }: SilkeDropdownButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,37 @@ type SilkeCardGridProps = {
6
6
  loading?: boolean;
7
7
  } & Omit<BoxDivProps, 'tag' | 'gap' | 'size'>;
8
8
  export declare function SilkeCardGrid({ loading, children, small, className, style, ...rest }: SilkeCardGridProps): import("react/jsx-runtime").JSX.Element;
9
- export declare function SilkeSkeletonCard(): import("react/jsx-runtime").JSX.Element;
9
+ export declare const SilkeSkeletonCard: React.ForwardRefExoticComponent<{
10
+ tag?: "div";
11
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & {
12
+ column?: boolean;
13
+ fill?: boolean;
14
+ gap?: import("..").BoxSpace;
15
+ pad?: import("..").BoxSpace;
16
+ vPad?: import("..").BoxSpace;
17
+ hPad?: import("..").BoxSpace;
18
+ size?: import("..").BoxSize;
19
+ height?: import("..").BoxSize;
20
+ width?: import("..").BoxSize;
21
+ minHeight?: import("..").BoxSize;
22
+ minWidth?: import("..").BoxSize;
23
+ bg?: import("../..").SilkeColor | "blur";
24
+ bgHover?: import("../..").SilkeColor;
25
+ color?: import("../..").SilkeColor;
26
+ rounded?: boolean | "tiny" | "small" | "medium" | "full";
27
+ shadow?: "level1" | "level2" | "level3" | "level4";
28
+ overflow?: "hidden" | "scroll-y";
29
+ cursor?: "pointer" | "grab" | "text";
30
+ userSelect?: "none" | "text";
31
+ colorHover?: import("../..").SilkeColor;
32
+ aspectRatio?: "16:9" | "4:3" | "1:1";
33
+ flex?: boolean;
34
+ wrap?: boolean;
35
+ align?: import("..").BoxAlign | [import("..").BoxAlign, import("..").BoxAlign];
36
+ vAlign?: import("..").BoxAlign;
37
+ hAlign?: import("..").BoxAlign;
38
+ debug?: boolean;
39
+ scroll?: boolean | "show";
40
+ rel?: string;
41
+ } & React.RefAttributes<HTMLDivElement>>;
10
42
  export {};
@@ -0,0 +1,20 @@
1
+ import { SilkeImageValue } from './utils';
2
+ /**
3
+ * Reads a File and converts it to a SilkeImageValue with base64 data.
4
+ * Returns a promise that resolves with the image value or null if reading fails.
5
+ */
6
+ export declare function fileToImageValue(file: File): Promise<SilkeImageValue | null>;
7
+ /**
8
+ * Extracts the first image file from a ClipboardEvent.
9
+ * Returns the File or null if no image is found.
10
+ */
11
+ export declare function getImageFromClipboard(e: React.ClipboardEvent): File | null;
12
+ /**
13
+ * Extracts the first image file from a DragEvent.
14
+ * Returns the File or null if no image is found.
15
+ */
16
+ export declare function getImageFromDragEvent(e: DragEvent): File | null;
17
+ /**
18
+ * Generates a data URL from a SilkeImageValue for use in img src.
19
+ */
20
+ export declare function imageValueToDataUrl(img: SilkeImageValue): string;
@@ -0,0 +1,4 @@
1
+ export { fileToImageValue, imageValueToDataUrl } from './image-utils';
2
+ export { parseTextToSilkeCommands } from './silke-command-parser';
3
+ export * from './silke-command-text-field';
4
+ export { SilkeCommand, SilkeCommandTextFieldValue, SilkeCommandType, SilkeImageValue, SilkeTextValue, convertSilkeCommandsToString, isImage, } from './utils';
@@ -0,0 +1,3 @@
1
+ import { SilkeCommand, SilkeCommandTextFieldValue } from './utils';
2
+ /** Parse raw text into structured command values */
3
+ export declare function parseTextToSilkeCommands(text: string, availableCommands: SilkeCommand[]): SilkeCommandTextFieldValue[];
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { SilkeTextFieldOutlineProps } from '../silke-text-field/silke-text-field-outline';
3
+ import { SilkeCommand, SilkeCommandTextFieldValue } from './utils';
4
+ export type SilkeCommandTextFieldProps = Omit<SilkeTextFieldOutlineProps, 'children'> & {
5
+ autoFocus?: boolean;
6
+ availableCommands: SilkeCommand[];
7
+ disabled?: boolean;
8
+ /** When true, images cannot be added via paste or drag-and-drop */
9
+ disableImages?: boolean;
10
+ name?: string;
11
+ onChange: (value: SilkeCommandTextFieldValue[]) => void;
12
+ onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void;
13
+ onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
14
+ onSuggestions?: (suggestions: SilkeCommand[]) => void;
15
+ placeholder?: string;
16
+ value: SilkeCommandTextFieldValue[];
17
+ };
18
+ export type SilkeCommandTextFieldHandle = {
19
+ /** Remove focus from the input */
20
+ blur: () => void;
21
+ /** Focus the input */
22
+ focus: () => void;
23
+ /** Get the current value as a string */
24
+ toString: (value?: SilkeCommandTextFieldValue[]) => string;
25
+ /**
26
+ * Update command in the commands array.
27
+ * @param command - the command to update
28
+ * @param index - defaults to active index, use -1 to append
29
+ */
30
+ update: (command: SilkeCommand, index?: number) => void;
31
+ };
32
+ declare const SilkeCommandTextField: React.ForwardRefExoticComponent<Omit<SilkeTextFieldOutlineProps, "children"> & {
33
+ autoFocus?: boolean;
34
+ availableCommands: SilkeCommand[];
35
+ disabled?: boolean;
36
+ /** When true, images cannot be added via paste or drag-and-drop */
37
+ disableImages?: boolean;
38
+ name?: string;
39
+ onChange: (value: SilkeCommandTextFieldValue[]) => void;
40
+ onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void;
41
+ onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
42
+ onSuggestions?: (suggestions: SilkeCommand[]) => void;
43
+ placeholder?: string;
44
+ value: SilkeCommandTextFieldValue[];
45
+ } & React.RefAttributes<SilkeCommandTextFieldHandle>>;
46
+ export { SilkeCommandTextField };
@@ -0,0 +1,61 @@
1
+ export declare enum SilkeCommandType {
2
+ ACTION = "/",
3
+ MENTION = "@"
4
+ }
5
+ export type SilkeCommand = {
6
+ partialMatch?: boolean;
7
+ type: SilkeCommandType;
8
+ value: string;
9
+ };
10
+ export type SilkeTextValue = {
11
+ type: 'text';
12
+ value: string;
13
+ };
14
+ export type SilkeImageValue = {
15
+ type: 'image';
16
+ /** Base64-encoded image data */
17
+ data: string;
18
+ /** MIME type (e.g., 'image/png', 'image/jpeg') */
19
+ mimeType: string;
20
+ /** Optional filename */
21
+ name?: string;
22
+ };
23
+ export type SilkeCommandTextFieldValue = SilkeCommand | SilkeTextValue | SilkeImageValue;
24
+ /** Key direction mappings for navigation and editing */
25
+ export declare const KEY_DIRECTION: Record<string, number>;
26
+ /** Get the caret offset within a contentEditable element */
27
+ export declare function getCaretOffset(element: HTMLDivElement | null): number;
28
+ /** Check if there is a text selection with length > 0 */
29
+ export declare function hasSelectionLength(): boolean;
30
+ /** Set the caret to a specific character offset within a contentEditable element */
31
+ export declare function setCaretOffset(element: HTMLDivElement | null, offset: number): void;
32
+ /** Escape HTML special characters to prevent XSS */
33
+ export declare function escapeHtml(text: string): string;
34
+ /** Get the index of the command at a given caret position */
35
+ export declare function getActiveCommandIndex(caretPos: number, value: SilkeCommandTextFieldValue[]): number;
36
+ /** Calculate total text length up to a given index */
37
+ export declare function getTextLength(value: SilkeCommandTextFieldValue[], index?: number): number;
38
+ /** Get the rendered length of a single command/text value */
39
+ export declare function getItemLength(item: SilkeCommandTextFieldValue): number;
40
+ /** Convert command values to HTML for rendering (excludes images) */
41
+ export declare function valueToHtml(value: SilkeCommandTextFieldValue[], styles: Record<string, string>): string;
42
+ /** Convert command values to plain string (excludes images) */
43
+ export declare function convertSilkeCommandsToString(value: SilkeCommandTextFieldValue[]): string;
44
+ /** Check if a command value is a non-text, non-image command */
45
+ export declare function isSilkeCommand(value: SilkeCommandTextFieldValue | undefined): value is SilkeCommand;
46
+ /** Check if a command value is a text segment */
47
+ export declare function isText(value: SilkeCommandTextFieldValue | undefined): value is SilkeTextValue;
48
+ /** Check if a command value is an image */
49
+ export declare function isImage(value: SilkeCommandTextFieldValue | undefined): value is SilkeImageValue;
50
+ /**
51
+ * Calculate a match score for a command against a search query.
52
+ * Higher scores indicate better matches.
53
+ * Returns -1 if there's no match.
54
+ */
55
+ export declare function getCommandMatchScore(command: SilkeCommand, query: string): number;
56
+ /**
57
+ * Filter and sort commands based on partial matching against a query.
58
+ * Returns commands sorted by match quality (best matches first).
59
+ * If query is empty, returns all commands of the given type sorted alphabetically.
60
+ */
61
+ export declare function filterAndSortCommands(commands: SilkeCommand[], query: string, type: SilkeCommandType): SilkeCommand[];
@@ -8,6 +8,7 @@ type SilkeSchemaFieldsProps<T extends {
8
8
  row?: boolean;
9
9
  disabled?: boolean;
10
10
  readonly?: boolean;
11
+ itemIndex?: number;
11
12
  } & SilkeFormProps<T>;
12
13
  export declare function SilkeSchemaFields<T extends {
13
14
  [key: string]: any;
@@ -6,5 +6,6 @@ export type SilkeImageProps = {
6
6
  icon?: IEmojiIcon | SilkeIcons;
7
7
  alt?: string;
8
8
  avatar?: BoxSize | true;
9
+ bgColor?: string;
9
10
  } & BoxProps;
10
- export declare function SilkeImage({ src, alt, avatar, icon, draggable, ...rest }: SilkeImageProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function SilkeImage({ src, alt, avatar, icon, draggable, bgColor, ...rest }: SilkeImageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export * from './silke-list';
2
2
  export * from './silke-list-item';
3
+ export * from './types';
@@ -1,6 +1,24 @@
1
- import { SilkeButtonProps } from '../silke-button';
2
- export type SilkeListItemProps = {
3
- focus?: boolean;
4
- selected?: boolean;
5
- } & Omit<SilkeButtonProps, 'kind' | 'size'>;
6
- export declare function SilkeListItem({ label, ...rest }: SilkeListItemProps): import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ import type { SilkeListItemData } from './types';
3
+ import { IEmojiIcon } from '@vev/utils';
4
+ import { SilkeBox } from '../silke-box';
5
+ import { SilkeIcons } from '../silke-icon';
6
+ import { SilkeTagProps } from '../silke-tag';
7
+ type SilkeListItemProps = {
8
+ label: string | React.ReactNode;
9
+ subLabel?: string | React.ReactNode;
10
+ icon?: IEmojiIcon | SilkeIcons | React.ReactElement;
11
+ items?: SilkeListItemData[];
12
+ link?: string;
13
+ size?: 's' | 'base';
14
+ tag?: SilkeTagProps;
15
+ active?: boolean;
16
+ gap?: boolean;
17
+ maxHeight?: number;
18
+ children?: React.ReactNode;
19
+ alwaysShowChildren?: boolean;
20
+ onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
21
+ onSelect?: () => void;
22
+ } & Omit<React.ComponentProps<typeof SilkeBox>, 'children' | 'tag'>;
23
+ export declare const SilkeListItem: ({ label, subLabel, icon, items, link, tag, active, size, gap, maxHeight, children, alwaysShowChildren, onClick, onSelect, ...rest }: SilkeListItemProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- interface SilkeListProps {
3
- children: React.ReactNode;
4
- /** Show as a select list */
5
- select?: boolean;
6
- multiselect?: boolean;
7
- onChange?: (values: any[]) => void;
8
- }
9
- export declare function SilkeList({ children }: SilkeListProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { SilkeListItemType } from './types';
2
+ type SilkeListProps = {
3
+ items: SilkeListItemType[] | (() => SilkeListItemType[]);
4
+ size?: 's' | 'base';
5
+ gap?: boolean;
6
+ maxHeight?: number;
7
+ onSelect?: (item: SilkeListItemType) => void;
8
+ };
9
+ export declare function SilkeList({ items, size, gap, maxHeight, onSelect }: SilkeListProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { IEmojiIcon } from '@vev/utils';
3
+ import { SilkeIcons } from '../silke-icon';
4
+ import { SilkeTagProps } from '../silke-tag';
5
+ export type SilkeListItemData = {
6
+ label: string;
7
+ groupLabel?: string;
8
+ icon?: IEmojiIcon | SilkeIcons | React.ReactElement;
9
+ tag?: SilkeTagProps;
10
+ items?: SilkeListItemData[];
11
+ link?: string;
12
+ active?: boolean;
13
+ onClick?: () => void;
14
+ };
15
+ export type SilkeListItemType = SilkeListItemData | React.ReactElement | 'divider';
16
+ export type GroupedSilkeListItems = {
17
+ groupLabel?: string;
18
+ items: SilkeListItemType[];
19
+ };
@@ -0,0 +1,3 @@
1
+ import type { GroupedSilkeListItems, SilkeListItemData, SilkeListItemType } from './types';
2
+ export declare function isSilkeListItem(item: SilkeListItemType): item is SilkeListItemData;
3
+ export declare function groupSilkeListItems(items: SilkeListItemType[]): GroupedSilkeListItems[];
@@ -18,6 +18,7 @@ type SilkeNavigationLinkProps = {
18
18
  * Buttons/icons shown only on hover
19
19
  */
20
20
  rightButtons?: ReactNode;
21
+ expanded?: boolean;
21
22
  } & (({
22
23
  link: string;
23
24
  } & Omit<BoxLinkProps, 'to' | 'tag' | 'link'>) | ({
@@ -17,5 +17,10 @@ export declare function SilkeOverflowMenu({ children, label, open: externalOpen,
17
17
  export type SilkeOverflowMenuItem = {
18
18
  label: React.ReactNode;
19
19
  kind?: 'default' | 'danger' | 'selected';
20
+ groupLabel?: string;
20
21
  } & Omit<SilkeButtonProps, 'height' | 'width' | 'align' | 'vAlign' | 'hAlign' | 'kind'>;
21
- export declare const SilkeOverflowMenuItem: ({ label, kind, ...rest }: SilkeOverflowMenuItem) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const SilkeOverflowMenuItem: React.ForwardRefExoticComponent<{
23
+ label: React.ReactNode;
24
+ kind?: "default" | "danger" | "selected";
25
+ groupLabel?: string;
26
+ } & Omit<SilkeButtonProps, "align" | "height" | "width" | "vAlign" | "hAlign" | "kind"> & React.RefAttributes<HTMLButtonElement>>;
@@ -29,7 +29,9 @@ export interface SilkePopoverNativeProps {
29
29
  hint?: boolean;
30
30
  /** Should the popover be animated */
31
31
  animate?: boolean;
32
+ /** Shadow level of the popover */
33
+ shadow?: 'level1' | 'level2' | 'level3' | 'level4';
32
34
  /** Triggered when the popover is dismissed (via light dismiss or escape key) */
33
35
  onRequestClose?: () => void;
34
36
  }
35
- export declare function SilkePopoverNative({ anchor, children, hide, id, placement, anchorSlot, align, justify, offsetX, offsetY, hideBackdrop, matchWidth, hint, animate, onRequestClose, }: SilkePopoverNativeProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function SilkePopoverNative({ anchor, children, hide, id, placement, anchorSlot, align, justify, offsetX, offsetY, hideBackdrop, matchWidth, hint, animate, shadow, onRequestClose, }: SilkePopoverNativeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './silke-shortcut-button';
@@ -0,0 +1,15 @@
1
+ import { KeyboardEventCode } from '@vev/utils';
2
+ import React from 'react';
3
+ import { SilkeIcons } from '../silke-icon';
4
+ export type SilkeShortcutButtonProps = {
5
+ label: string;
6
+ icon: SilkeIcons;
7
+ shortcut?: KeyboardEventCode[];
8
+ compressed?: boolean;
9
+ centered?: boolean;
10
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
11
+ };
12
+ export declare function SilkeShortcutButton({ label, icon, shortcut, compressed, centered, onClick, }: SilkeShortcutButtonProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare namespace SilkeShortcutButton {
14
+ var displayName: string;
15
+ }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BoxProps, BoxSpace } from '../silke-box';
3
3
  import { SilkeIcons } from '../silke-icon';
4
4
  export type SilkeTagKind = 'primary' | 'secondary';
5
- export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark';
5
+ export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark' | 'ai';
6
6
  export type SilkeTagSize = 'tiny';
7
7
  export type SilkeTagProps = {
8
8
  disabled?: boolean;
@@ -8,7 +8,9 @@ export declare const SilkeIconDefinitions: {
8
8
  close: string;
9
9
  delete: string;
10
10
  edit: string;
11
+ 'edit.line': string;
11
12
  'edit.pen': string;
13
+ 'pen.swirl': string;
12
14
  error: string;
13
15
  help: string;
14
16
  community: string;
@@ -22,6 +24,13 @@ export declare const SilkeIconDefinitions: {
22
24
  'cloud.check': string;
23
25
  'cloud.slash': string;
24
26
  ai: string;
27
+ 'ai.sparkle': string;
28
+ 'ai.page': string;
29
+ 'ai.sparkels': string;
30
+ 'ai.gradient': typeof AiGradientIcon;
31
+ 'ai.image': string;
32
+ 'ai.text': string;
33
+ 'ai.file': string;
25
34
  sparkles: string;
26
35
  compare: string;
27
36
  menuMore: string;
@@ -69,6 +78,7 @@ export declare const SilkeIconDefinitions: {
69
78
  square: string;
70
79
  shapes: string;
71
80
  sharedStyle: string;
81
+ paintbrush: string;
72
82
  firefox: string;
73
83
  safari: string;
74
84
  'square.dashed': string;
@@ -83,14 +93,19 @@ export declare const SilkeIconDefinitions: {
83
93
  'dots.vertical': string;
84
94
  'dots.horizontal': string;
85
95
  star: string;
96
+ 'star.filled': string;
86
97
  eyeDropper: string;
87
98
  log: string;
88
99
  dashboard: string;
89
100
  test: string;
90
101
  guest: string;
102
+ cartoon: string;
91
103
  'network.on': string;
92
104
  'network.off': string;
93
105
  grid: string;
106
+ 'memo.circle.check': string;
107
+ 'bring.forward': string;
108
+ 'bring.backward': string;
94
109
  moon: string;
95
110
  sun: string;
96
111
  notification: string;
@@ -119,6 +134,7 @@ export declare const SilkeIconDefinitions: {
119
134
  'code.fork': string;
120
135
  'code.compare': string;
121
136
  'code.history': string;
137
+ 'code.rectangle': string;
122
138
  messages: string;
123
139
  'keyboard.command': string;
124
140
  'keyboard.option': string;
@@ -163,6 +179,8 @@ export declare const SilkeIconDefinitions: {
163
179
  'arrow.up.right.and.down.left': string;
164
180
  'arrows.left.right': string;
165
181
  'arrows.up.down': string;
182
+ 'arrows.from.dotted.line': string;
183
+ 'arrows.to.dotted.line': string;
166
184
  'padding.all': string;
167
185
  'padding.top.bottom': string;
168
186
  'padding.left.right': string;
@@ -191,6 +209,7 @@ export declare const SilkeIconDefinitions: {
191
209
  commentMarker: string;
192
210
  template: string;
193
211
  templates: string;
212
+ templatesLegacy: string;
194
213
  page: string;
195
214
  project: string;
196
215
  projects: string;
@@ -224,6 +243,7 @@ export declare const SilkeIconDefinitions: {
224
243
  'credit-card': string;
225
244
  money: string;
226
245
  dynamic: string;
246
+ slash: string;
227
247
  'geo.fence.disabled': string;
228
248
  'geo.fence.enabled': string;
229
249
  'editor.design': string;
@@ -233,6 +253,7 @@ export declare const SilkeIconDefinitions: {
233
253
  gradient: typeof GradientIcon;
234
254
  image: string;
235
255
  images: string;
256
+ camera: string;
236
257
  video: string;
237
258
  audio: string;
238
259
  fill: string;
@@ -267,6 +288,7 @@ export declare const SilkeIconDefinitions: {
267
288
  diamond: string;
268
289
  crosshair: string;
269
290
  clone: string;
291
+ 'clone-plus': string;
270
292
  'globe-pointer': string;
271
293
  globe: string;
272
294
  'align.text.right': string;
@@ -310,6 +332,9 @@ export declare const SilkeIconDefinitions: {
310
332
  'file.export': string;
311
333
  home: string;
312
334
  qr: string;
335
+ 'pin.on': string;
336
+ 'pin.off': string;
337
+ eraser: string;
313
338
  list: string;
314
339
  'list.ol': string;
315
340
  'list.check': string;
@@ -360,6 +385,9 @@ export declare const SilkeIconDefinitions: {
360
385
  sass: string;
361
386
  typescript: typeof TypescriptIcon;
362
387
  html5: string;
388
+ translate: string;
389
+ spell: string;
390
+ 'tone.of.voice': string;
363
391
  'American Express': string;
364
392
  Amex: string;
365
393
  'Diners Club': string;
@@ -375,6 +403,7 @@ export declare const SilkeIconDefinitions: {
375
403
  laptop: string;
376
404
  mobile: string;
377
405
  tablet: string;
406
+ devices: string;
378
407
  'device.custom': string;
379
408
  bar: string;
380
409
  line: string;
@@ -464,4 +493,5 @@ declare function ContentChildParent(): import("react/jsx-runtime").JSX.Element;
464
493
  declare function AnimationFillBackwards(): import("react/jsx-runtime").JSX.Element;
465
494
  declare function AnimationFillForwards(): import("react/jsx-runtime").JSX.Element;
466
495
  declare function AnimationFillBoth(): import("react/jsx-runtime").JSX.Element;
496
+ declare function AiGradientIcon(): import("react/jsx-runtime").JSX.Element;
467
497
  export {};
package/jest.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- const base = require('../../jest.config.base');
2
+ const base = require('../../jest.config.base');
3
3
  const package = require('./package.json');
4
4
 
5
5
  const packageName = package.name.split('@vev/').pop();
@@ -10,7 +10,7 @@ module.exports = {
10
10
  rootDir: '../..',
11
11
  roots: [`<rootDir>/packages/${packageName}`],
12
12
  testRegex: `(packages/${packageName}/.*/__tests__/.*|\\.(spec|test))\\.tsx?$`,
13
- testEnvironmentOptions: { url: 'http://localhost/', },
13
+ testEnvironmentOptions: { url: 'http://localhost/' },
14
14
  moduleDirectories: ['node_modules', 'src'],
15
15
  testEnvironment: 'jsdom',
16
16
  setupFiles: [
@@ -22,5 +22,4 @@ module.exports = {
22
22
  moduleNameMapper: {
23
23
  '^.+\\.(css|less|scss)$': '<rootDir>/jest/empty-file.js',
24
24
  },
25
- transformIgnorePatterns: ['node_modules/(?!(nanoid|nanoid\/non-secure)/)'],
26
25
  };
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@vev/silke",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/vev-design/vev.git",
8
+ "directory": "packages/silke"
9
+ },
5
10
  "main": "dist/index.js",
6
11
  "types": "dist/types/index.d.ts",
7
12
  "scripts": {
@@ -19,7 +24,7 @@
19
24
  "peerDependencies": {
20
25
  "react": ">=16.0.0",
21
26
  "react-dom": ">=16.0.0",
22
- "react-router-dom": "^7.6.3"
27
+ "react-router-dom": "^7.12.0"
23
28
  },
24
29
  "dependencies": {
25
30
  "@vev/interactions": "*",