@7shifts/sous-chef 4.8.0 → 4.9.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.
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ /**
4
+ * 1, 2, or 3 key values. Use a named special key ('command', 'shift', 'escape', etc.)
5
+ * or a single character string for alphanumeric keys ('Z', '1', '/').
6
+ * Maximum of 3 keys.
7
+ */
8
+ keys: [string] | [string, string] | [string, string, string];
9
+ /** Override the default data-testid */
10
+ testId?: string;
11
+ };
12
+ /**
13
+ * ShortcutKey is a display-only component that communicates a keyboard shortcut
14
+ * associated with an action, tool, or command. It supports 1–3 key combinations.
15
+ *
16
+ * Use named special keys (e.g. 'command', 'shift', 'escape', 'arrow-left') or
17
+ * a single character for alphanumeric keys ('Z', '1', '/').
18
+ *
19
+ * Should always appear in context alongside the action it triggers — never standalone.
20
+ */
21
+ declare const ShortcutKey: ({ keys, testId }: Props) => React.JSX.Element;
22
+ export default ShortcutKey;
@@ -0,0 +1 @@
1
+ export { default } from './ShortcutKey';
@@ -2,4 +2,5 @@ import Badge from './Badge';
2
2
  import Avatar from './Avatar';
3
3
  import Chip from './Chip';
4
4
  import Pill from './Pill';
5
- export { Badge, Avatar, Chip, Pill };
5
+ import ShortcutKey from './ShortcutKey';
6
+ export { Badge, Avatar, Chip, Pill, ShortcutKey };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Use the `visualTest` story parameter to control snapshot behaviour.
3
+ *
4
+ * @example — click a trigger before snapshotting (e.g. open a modal):
5
+ * export const OpenModal: Story = {
6
+ * parameters: {
7
+ * visualTest: {
8
+ * clickToOpen: 'button', // Playwright locator string; first match is clicked
9
+ * },
10
+ * },
11
+ * };
12
+ *
13
+ * @example — other supported options:
14
+ * parameters: {
15
+ * visualTest: {
16
+ * delay: 500, // ms to wait before snapshotting (e.g. after an animation)
17
+ * diffThreshold: 0.005, // override the default 0.1% pixel-diff tolerance
18
+ * modes: true, // also snapshot at mobile viewport (320px wide)
19
+ * },
20
+ * },
21
+ */
22
+ export type VisualTestParameters = {
23
+ clickToOpen?: string;
24
+ delay?: number;
25
+ diffThreshold?: number;
26
+ modes?: boolean;
27
+ };
@@ -8,6 +8,8 @@ export declare const TEXT_TYPES: {
8
8
  H5: "h5";
9
9
  INSIGHT: "insight";
10
10
  SPAN: "span";
11
+ PARAGRAPH: "paragraph";
12
+ TAGLINE: "tagline";
11
13
  };
12
14
  export declare const FONT_EMPHASIS: {
13
15
  BOLD: "bold";
@@ -1,3 +1,3 @@
1
- export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'body' | 'insight' | 'caption' | 'span';
1
+ export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'body' | 'insight' | 'caption' | 'span' | 'paragraph' | 'tagline';
2
2
  export type Emphasis = 'bold' | 'italic' | 'underline' | 'dotted-underline' | 'monospace' | 'strikethrough';
3
3
  export type Alignment = 'left' | 'right' | 'center' | 'justify';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7shifts/sous-chef",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "7shifts component library",
5
5
  "author": "7shifts",
6
6
  "license": "MIT",
@@ -34,12 +34,12 @@
34
34
  "test:unit": "jest --runInBand",
35
35
  "test:unit:coverage": "jest --coverage",
36
36
  "test:watch": "jest --watch",
37
- "test:visual": "chromatic --project-token=9226d55e4d56 --exit-zero-on-changes --build-script-name=storybook:chromatic:build --only-changed --exitOnceUploaded",
37
+ "test:visual": "storybook build -o .storybook/dist && (lsof -ti:6007 | xargs kill -9 2>/dev/null || true) && concurrently -k --success command-1 \"http-server .storybook/dist -p 6007 -q\" \"wait-on http://localhost:6007 && test-storybook --url http://localhost:6007 --index-json\"",
38
+ "test:visual:update": "storybook build -o .storybook/dist && (lsof -ti:6007 | xargs kill -9 2>/dev/null || true) && concurrently -k --success command-1 \"http-server .storybook/dist -p 6007 -q\" \"wait-on http://localhost:6007 && test-storybook --url http://localhost:6007 --index-json --updateSnapshot\"",
39
+ "test:visual:dev": "test-storybook --url http://localhost:6006 --index-json",
38
40
  "start": "yarn storybook",
39
41
  "storybook": "storybook dev -p 6006 --loglevel info",
40
- "storybook:chromatic": "storybook dev -p 6006",
41
- "storybook:chromatic:build": "storybook build -o ./.storybook/dist --webpack-stats-json",
42
- "storybook:build": "storybook build -o ./.storybook/dist --loglevel info --webpack-stats-json",
42
+ "storybook:build": "storybook build -o ./.storybook/dist --loglevel info",
43
43
  "new:component": "node ./scripts/new-component.js",
44
44
  "changeset": "changeset",
45
45
  "version": "changeset version",
@@ -75,7 +75,13 @@
75
75
  "@typescript-eslint/parser": "^6.11.0",
76
76
  "@vitejs/plugin-react": "^4.7.0",
77
77
  "babel-jest": "^29.7.0",
78
- "chromatic": "^13.3.4",
78
+ "@playwright/test": "^1.54.0",
79
+ "@storybook/test-runner": "^0.24.4",
80
+ "@types/jest-image-snapshot": "^6.4.0",
81
+ "concurrently": "^9.1.0",
82
+ "http-server": "^14.1.1",
83
+ "jest-image-snapshot": "^6.5.2",
84
+ "wait-on": "^8.0.1",
79
85
  "cross-env": "^7.0.3",
80
86
  "eslint": "^8.53.0",
81
87
  "eslint-config-prettier": "^9.0.0",
@@ -107,7 +113,6 @@
107
113
  "ts-jest": "^29.1.2",
108
114
  "typescript": "^5.3.2",
109
115
  "vite": "^6.4.1",
110
- "vite-plugin-turbosnap": "^1.0.3",
111
116
  "yup": "^0.32.9"
112
117
  },
113
118
  "files": [