@veeqo/ui 5.0.0 → 5.1.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.
@@ -5,7 +5,7 @@ interface ButtonDisplayProps {
5
5
  hasDropdown: boolean;
6
6
  }
7
7
  export declare const MainContent: import("styled-components").StyledComponent<"span", any, {
8
- loading?: boolean | undefined;
8
+ $loading?: boolean | undefined;
9
9
  hasText: boolean;
10
10
  size: 'base' | 'md';
11
11
  }, never>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { ShortcutKeysProps } from './types';
3
+ /**
4
+ * ShortcutKeys UI component
5
+ *
6
+ * Renders a keyboard shortcut string by splitting it on "+" and rendering each
7
+ * key to a <kbd> component.
8
+ *
9
+ * Criteria for `shortcut` prop:
10
+ * - ValidModifierKeys MUST always come before other keys e.g. `shift+a` is valid, `a+shift` is invalid
11
+ * - If it's not a modifier key it must be a singular key e.g. `a`, `2` is valid and `a2` or `abcde` is invalid etc.
12
+ * - A limit of 3 key combinations separated between the '+' symbol e.g. `shift+ctrl+a` is valid, `shift+ctrl+a+b` is invalid
13
+ *
14
+ */
15
+ export declare const ShortcutKeys: ({ shortcut, label, inverse, displayLabel, ...props }: ShortcutKeysProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { ShortcutKeys } from './ShortcutKeys';
@@ -0,0 +1,3 @@
1
+ import { ShortcutKeysContainerProps } from './types';
2
+ export declare const ShortcutKeysContainer: import("styled-components").StyledComponent<"div", any, ShortcutKeysContainerProps, never>;
3
+ export declare const Kbd: import("styled-components").StyledComponent<"kbd", any, {}, never>;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export type ShortcutKeysContainerProps = {
3
+ $inverse?: boolean;
4
+ };
5
+ export type ValidKeys = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '!' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '(' | ')' | '`' | '-' | '=' | '[' | ']' | '{' | '}' | '?';
6
+ export type ValidModifierKeys = 'command' | 'windows' | 'shift' | 'ctrl' | 'option' | 'alt' | 'enter' | 'delete' | 'escape' | 'up' | 'right' | 'down' | 'left' | 'space';
7
+ export type ShortcutPatterns = `${ValidKeys}` | `${ValidModifierKeys}` | `${ValidKeys}+${ValidKeys}` | `${ValidModifierKeys}+${ValidKeys}` | `${ValidModifierKeys}+${ValidKeys}+${ValidKeys}` | `${ValidModifierKeys}+${ValidModifierKeys}` | `${ValidModifierKeys}+${ValidModifierKeys}+${ValidKeys}`;
8
+ export interface ShortcutKeysProps extends React.HtmlHTMLAttributes<HTMLElement> {
9
+ shortcut: ShortcutPatterns;
10
+ label: string;
11
+ inverse?: boolean;
12
+ displayLabel?: boolean;
13
+ }
14
+ export type ShortcutAction = {
15
+ label: string;
16
+ mac: ShortcutPatterns;
17
+ windows: ShortcutPatterns;
18
+ };
@@ -0,0 +1,4 @@
1
+ import { ValidModifierKeys, ShortcutAction } from './types';
2
+ export declare const ValidModifierKeysMap: Record<ValidModifierKeys, string>;
3
+ export declare const ValidModifierKeyssLabelMap: Record<ValidModifierKeys, string>;
4
+ export declare const exampleStorybookShortcutActions: ShortcutAction[];
@@ -36,6 +36,7 @@ export { Radio } from './Radio';
36
36
  export { Search } from './Search';
37
37
  export { SegmentedControl } from './SegmentedControl';
38
38
  export { Select } from './Select';
39
+ export { ShortcutKeys } from './ShortcutKeys';
39
40
  export { SimpleTable } from './SimpleTable';
40
41
  export { Slider } from './Slider';
41
42
  export { Stack } from './Stack';