@caspeco/casper-ui-library 8.0.1 → 8.0.3
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/README.md +25 -1
- package/dist/components/accordion/accordion.visual.test.d.ts +2 -0
- package/dist/components/accordion/accordion.visual.test.d.ts.map +1 -0
- package/dist/components/alert/alert.visual.test.d.ts +2 -0
- package/dist/components/alert/alert.visual.test.d.ts.map +1 -0
- package/dist/components/badge/badge.visual.test.d.ts +2 -0
- package/dist/components/badge/badge.visual.test.d.ts.map +1 -0
- package/dist/components/box/box.visual.test.d.ts +2 -0
- package/dist/components/box/box.visual.test.d.ts.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.visual.test.d.ts +2 -0
- package/dist/components/breadcrumbs/breadcrumbs.visual.test.d.ts.map +1 -0
- package/dist/components/button/button.visual.test.d.ts +2 -0
- package/dist/components/button/button.visual.test.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.visual.test.d.ts +2 -0
- package/dist/components/checkbox/checkbox.visual.test.d.ts.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.visual.test.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.visual.test.d.ts.map +1 -0
- package/dist/components/combobox/combobox.visual.test.d.ts +2 -0
- package/dist/components/combobox/combobox.visual.test.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.composition.d.ts +6 -2
- package/dist/components/date-picker/date-picker.composition.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.visual.test.d.ts +2 -0
- package/dist/components/date-picker/date-picker.visual.test.d.ts.map +1 -0
- package/dist/components/divider/divider.visual.test.d.ts +2 -0
- package/dist/components/divider/divider.visual.test.d.ts.map +1 -0
- package/dist/components/drawer/drawer.composition.d.ts +0 -1
- package/dist/components/drawer/drawer.composition.d.ts.map +1 -1
- package/dist/components/drawer/drawer.visual.test.d.ts +2 -0
- package/dist/components/drawer/drawer.visual.test.d.ts.map +1 -0
- package/dist/components/flex/flex.visual.test.d.ts +2 -0
- package/dist/components/flex/flex.visual.test.d.ts.map +1 -0
- package/dist/components/form-control/form-control.visual.test.d.ts +2 -0
- package/dist/components/form-control/form-control.visual.test.d.ts.map +1 -0
- package/dist/components/grid/grid.composition.d.ts +3 -0
- package/dist/components/grid/grid.composition.d.ts.map +1 -0
- package/dist/components/grid/grid.visual.test.d.ts +2 -0
- package/dist/components/grid/grid.visual.test.d.ts.map +1 -0
- package/dist/components/heading/heading.visual.test.d.ts +2 -0
- package/dist/components/heading/heading.visual.test.d.ts.map +1 -0
- package/dist/components/highlight/highlight.composition.d.ts +3 -0
- package/dist/components/highlight/highlight.composition.d.ts.map +1 -0
- package/dist/components/highlight/highlight.d.ts +5 -0
- package/dist/components/highlight/highlight.d.ts.map +1 -1
- package/dist/components/highlight/highlight.visual.test.d.ts +2 -0
- package/dist/components/highlight/highlight.visual.test.d.ts.map +1 -0
- package/dist/components/icon/icon.composition.d.ts +1 -1
- package/dist/components/icon/icon.composition.d.ts.map +1 -1
- package/dist/components/icon/icon.visual.test.d.ts +2 -0
- package/dist/components/icon/icon.visual.test.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.visual.test.d.ts +2 -0
- package/dist/components/icon-button/icon-button.visual.test.d.ts.map +1 -0
- package/dist/components/image/image.composition.d.ts.map +1 -1
- package/dist/components/image/image.visual.test.d.ts +2 -0
- package/dist/components/image/image.visual.test.d.ts.map +1 -0
- package/dist/components/image-upload/image-upload.composition.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload.visual.test.d.ts +2 -0
- package/dist/components/image-upload/image-upload.visual.test.d.ts.map +1 -0
- package/dist/components/input/input.visual.test.d.ts +2 -0
- package/dist/components/input/input.visual.test.d.ts.map +1 -0
- package/dist/components/link/link.visual.test.d.ts +2 -0
- package/dist/components/link/link.visual.test.d.ts.map +1 -0
- package/dist/components/list/list.visual.test.d.ts +2 -0
- package/dist/components/list/list.visual.test.d.ts.map +1 -0
- package/dist/components/menu/menu.visual.test.d.ts +2 -0
- package/dist/components/menu/menu.visual.test.d.ts.map +1 -0
- package/dist/components/message/message.visual.test.d.ts +2 -0
- package/dist/components/message/message.visual.test.d.ts.map +1 -0
- package/dist/components/modal/modal.composition.d.ts.map +1 -1
- package/dist/components/modal/modal.visual.test.d.ts +2 -0
- package/dist/components/modal/modal.visual.test.d.ts.map +1 -0
- package/dist/components/navigation-list/navigation-list.visual.test.d.ts +2 -0
- package/dist/components/navigation-list/navigation-list.visual.test.d.ts.map +1 -0
- package/dist/components/paginator/paginator.visual.test.d.ts +2 -0
- package/dist/components/paginator/paginator.visual.test.d.ts.map +1 -0
- package/dist/components/quantity-button/quantity-button.composition.d.ts.map +1 -1
- package/dist/components/quantity-button/quantity-button.visual.test.d.ts +2 -0
- package/dist/components/quantity-button/quantity-button.visual.test.d.ts.map +1 -0
- package/dist/components/radio/radio.visual.test.d.ts +2 -0
- package/dist/components/radio/radio.visual.test.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.visual.test.d.ts +2 -0
- package/dist/components/radio-group/radio-group.visual.test.d.ts.map +1 -0
- package/dist/components/segmented-control/segmented-control.visual.test.d.ts +2 -0
- package/dist/components/segmented-control/segmented-control.visual.test.d.ts.map +1 -0
- package/dist/components/select/select.visual.test.d.ts +2 -0
- package/dist/components/select/select.visual.test.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.visual.test.d.ts +2 -0
- package/dist/components/skeleton/skeleton.visual.test.d.ts.map +1 -0
- package/dist/components/stack/stack.visual.test.d.ts +2 -0
- package/dist/components/stack/stack.visual.test.d.ts.map +1 -0
- package/dist/components/stepper/stepper.visual.test.d.ts +2 -0
- package/dist/components/stepper/stepper.visual.test.d.ts.map +1 -0
- package/dist/components/switch/switch.visual.test.d.ts +2 -0
- package/dist/components/switch/switch.visual.test.d.ts.map +1 -0
- package/dist/components/table/table.visual.test.d.ts +2 -0
- package/dist/components/table/table.visual.test.d.ts.map +1 -0
- package/dist/components/tabs/tabs.composition.d.ts.map +1 -1
- package/dist/components/tabs/tabs.visual.test.d.ts +2 -0
- package/dist/components/tabs/tabs.visual.test.d.ts.map +1 -0
- package/dist/components/tag/tag.visual.test.d.ts +2 -0
- package/dist/components/tag/tag.visual.test.d.ts.map +1 -0
- package/dist/components/text/text.visual.test.d.ts +2 -0
- package/dist/components/text/text.visual.test.d.ts.map +1 -0
- package/dist/components/textarea/textarea.visual.test.d.ts +2 -0
- package/dist/components/textarea/textarea.visual.test.d.ts.map +1 -0
- package/dist/components/toast/toast.visual.test.d.ts +2 -0
- package/dist/components/toast/toast.visual.test.d.ts.map +1 -0
- package/dist/components/toggle-button/toggle-button.visual.test.d.ts +2 -0
- package/dist/components/toggle-button/toggle-button.visual.test.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.composition.d.ts +4 -1
- package/dist/components/tooltip/tooltip.composition.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.visual.test.d.ts +2 -0
- package/dist/components/tooltip/tooltip.visual.test.d.ts.map +1 -0
- package/dist/test-utils/create-visual-tests.d.ts +21 -0
- package/dist/test-utils/create-visual-tests.d.ts.map +1 -0
- package/dist/test-utils/render-for-visual-test.d.ts +8 -0
- package/dist/test-utils/render-for-visual-test.d.ts.map +1 -0
- package/dist/theme/theme-config/components/date-cell-theme.d.ts +1 -0
- package/dist/theme/theme-config/components/date-cell-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/date-cell-theme.js +1 -0
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -21,7 +21,10 @@ All commands are run from the root of the project, from a terminal.
|
|
|
21
21
|
| `npm run dev` | Build a local development version of the entire library, compiled into a single .js file for improved HMR. Automatically rebuilds when the file contents change. |
|
|
22
22
|
| `npm run build` | Build the library as it will be shipped on npm. Does not automatically rebuild when files change, but you can still use this build output to verify your changes in the documentation website or in another project. |
|
|
23
23
|
| `cd ../docs && npm run dev` | Starts the documentation website. Usually you want to run this alongside the library in dev mode, so open a new terminal for this. See [/docs](../docs) for more info. |
|
|
24
|
-
| `npm run test` | Run tests. |
|
|
24
|
+
| `npm run test` | Run unit tests. |
|
|
25
|
+
| `npm run test:visual` | Run visual regression tests using Playwright in Docker. Automatically starts/stops Docker container. |
|
|
26
|
+
| `npm run test:visual:ui` | Opens the HTML report viewer for visual test results. |
|
|
27
|
+
| `npm run test:visual:update` | Update visual regression baseline screenshots. Run this after intentional UI changes. |
|
|
25
28
|
| `npm run lint` | Run linting with [@caspeco/eslint-config](https://github.com/Caspeco/eslint-config). If you use the recommended [ESLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) you can see your eslint errors directly in your editor without having to run this. |
|
|
26
29
|
| `npm run prettier:fix` | Reformat all files with [@caspeco/prettier-config](https://github.com/Caspeco/prettier-config). If you use the recommended [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) you can have your files automatically formatted on file save. |
|
|
27
30
|
|
|
@@ -50,6 +53,27 @@ export default defineConfig({
|
|
|
50
53
|
});
|
|
51
54
|
```
|
|
52
55
|
|
|
56
|
+
### Visual Regression Tests
|
|
57
|
+
|
|
58
|
+
Visual regression tests catch unintended UI changes by comparing screenshots of component variants to committed baselines in `__screenshots__/`. They run with Playwright in Docker to ensure consistent rendering across different development environments and CI.
|
|
59
|
+
|
|
60
|
+
**Requirements**: Docker must be installed and running.
|
|
61
|
+
|
|
62
|
+
**Running tests**:
|
|
63
|
+
|
|
64
|
+
- `npm run test:visual` - Runs all visual tests
|
|
65
|
+
- `npm run test:visual:ui` - Opens the HTML report viewer
|
|
66
|
+
- `npm run test:visual:update` - Updates baseline screenshots after intentional UI changes
|
|
67
|
+
|
|
68
|
+
> [!TIP]
|
|
69
|
+
> CI fails but local passes?
|
|
70
|
+
>
|
|
71
|
+
> 1. Go to the `visual-tests` job in GitHub Actions
|
|
72
|
+
> 2. Download and extract the HTML artifact under the `Upload visual test report` step
|
|
73
|
+
> 3. Run `npx vite preview --outDir .` in the extracted directory to see diff report from CI
|
|
74
|
+
|
|
75
|
+
You may need to tweak the [pixelmatch comparator options](https://vitest.dev/api/browser/assertions.html#pixelmatch-comparator-options) if you see false positives due to anti-aliasing or sub-pixel rendering differences. See existing tests for examples.
|
|
76
|
+
|
|
53
77
|
## Contributing
|
|
54
78
|
|
|
55
79
|
1. Make sure your repository is up to date.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/accordion/accordion.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/alert/alert.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/badge/badge.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/box/box.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumbs.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/button/button.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/checkbox/checkbox.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-group.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/checkbox-group/checkbox-group.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export declare const BasicDatepicker: (
|
|
1
|
+
export declare const BasicDatepicker: ({ date }: {
|
|
2
|
+
date?: Date;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
2
4
|
export declare const BasicDateRangePicker: () => import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
export declare const BasicMinimizedDateRangePicker: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const BasicWeekNumberDatePicker: (
|
|
6
|
+
export declare const BasicWeekNumberDatePicker: ({ date }: {
|
|
7
|
+
date?: Date;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
//# sourceMappingURL=date-picker.composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker.composition.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"date-picker.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker.composition.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CAmDxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAqBhC,CAAC;AAEF,eAAO,MAAM,6BAA6B,+CAoBzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CA8ClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/divider/divider.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -2,6 +2,5 @@ export declare const RightDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
|
2
2
|
export declare const LeftDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const TopDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const BottomDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare const Sizes: () => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export declare const InlineDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=drawer.composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/drawer/drawer.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drawer.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/drawer/drawer.composition.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,+CAavB,CAAC;AACF,eAAO,MAAM,UAAU,+CAatB,CAAC;AACF,eAAO,MAAM,SAAS,+CAarB,CAAC;AACF,eAAO,MAAM,YAAY,+CAaxB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAoBxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/drawer/drawer.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flex.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/flex/flex.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/form-control/form-control.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/grid/grid.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,+CAczB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAoB1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/grid/grid.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/heading/heading.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/highlight/highlight.composition.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,+CAEtB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAMzB,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { HighlightProps as ChakraHighlightProps } from '@chakra-ui/react';
|
|
2
2
|
export type HighlightProps = Pick<ChakraHighlightProps, "query" | "children">;
|
|
3
|
+
/**
|
|
4
|
+
* Highlight component to emphasize specific words or phrases within text.
|
|
5
|
+
*
|
|
6
|
+
* @see Docs https://caspeco.github.io/casper-ui-library/components/highlight/
|
|
7
|
+
*/
|
|
3
8
|
export declare function Highlight(props: HighlightProps): import("react/jsx-runtime").JSX.Element;
|
|
4
9
|
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../lib/components/highlight/highlight.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,cAAc,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAS9C"}
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../lib/components/highlight/highlight.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,cAAc,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAS9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/highlight/highlight.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const SmileIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=icon.composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/icon/icon.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"icon.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/icon/icon.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,+CAAuE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/icon/icon.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/icon-button/icon-button.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/image/image.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/image/image.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,+CAAqE,CAAC;AAC7F,eAAO,MAAM,iBAAiB,+CAE7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/image/image.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-upload.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-upload.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,+CAY7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,+CAYlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,+CAWpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-upload.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/image-upload/image-upload.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/input/input.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/link/link.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/list/list.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/menu/menu.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/message/message.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modal.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.composition.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,WAAW,+CA+BvB,CAAC;AA8BF,eAAO,MAAM,SAAS,+CAarB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAatB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAarB,CAAC;AACF,eAAO,MAAM,cAAc,+CAa1B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAapB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAiE1B,CAAC;AAEF,eAAO,MAAM,YAAY,+CAqExB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAsEzB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAwExB,CAAC;AAEF,eAAO,MAAM,2BAA2B,+CAkDvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-list.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/navigation-list/navigation-list.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginator.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/paginator/paginator.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-button.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/quantity-button/quantity-button.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quantity-button.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/quantity-button/quantity-button.composition.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,+CAiBrB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAiBrB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAyC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quantity-button.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/quantity-button/quantity-button.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/radio/radio.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/radio-group/radio-group.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented-control.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/segmented-control.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/select/select.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/skeleton/skeleton.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/stack/stack.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/stepper/stepper.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/switch/switch.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/tabs/tabs.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/tabs/tabs.composition.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB,+CAqBlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,+CAqBlC,CAAC;AAEF,eAAO,MAAM,WAAW,+CAqBvB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAuBpB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAiDtB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAuBvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/tabs/tabs.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/tag/tag.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/text/text.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/textarea/textarea.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/toast/toast.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-button.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/toggle-button/toggle-button.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const PositionTop: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const PositionRight: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const PositionBottom: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const PositionLeft: () => import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
//# sourceMappingURL=tooltip.composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/tooltip/tooltip.composition.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/tooltip/tooltip.composition.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,+CAMvB,CAAC;AAEF,eAAO,MAAM,aAAa,+CAMzB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAM1B,CAAC;AAEF,eAAO,MAAM,YAAY,+CAMxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/tooltip/tooltip.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ScreenshotMatcherOptions } from '@vitest/browser/context';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { VisualTestRenderOptions } from './render-for-visual-test.js';
|
|
4
|
+
type VisualTestOptions = (VisualTestRenderOptions & ScreenshotMatcherOptions<"pixelmatch">) | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Creates visual tests for all compositions of a component.
|
|
7
|
+
* @param componentName The name of the component.
|
|
8
|
+
* @param compositions A record of composition names to React components.
|
|
9
|
+
* @example
|
|
10
|
+
* import * as Compositions from "./button.composition";
|
|
11
|
+
* createVisualTests("Button", Compositions);
|
|
12
|
+
*/
|
|
13
|
+
export declare function createVisualTests(componentName: string, compositions: Record<string, ComponentType>, options?: VisualTestOptions): void;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a visual test that renders the given component and compares it to a screenshot.
|
|
16
|
+
* @param Component The React component to render.
|
|
17
|
+
* @param options Options for the visual test (e.g., width, height).
|
|
18
|
+
*/
|
|
19
|
+
export declare function createVisualTest(Component: ComponentType, options?: VisualTestOptions): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=create-visual-tests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-visual-tests.d.ts","sourceRoot":"","sources":["../../lib/test-utils/create-visual-tests.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,0BAA0B,CAAC;AAElC,KAAK,iBAAiB,GAAG,CAAC,uBAAuB,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC;AAExG;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3C,OAAO,CAAC,EAAE,iBAAiB,QAc3B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,QAUrF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, ReactElement } from 'react';
|
|
2
|
+
export declare const VISUAL_TEST_CONTAINER_ID = "visual-root";
|
|
3
|
+
export type VisualTestRenderOptions = {
|
|
4
|
+
width?: CSSProperties["width"];
|
|
5
|
+
height?: CSSProperties["height"];
|
|
6
|
+
};
|
|
7
|
+
export declare function renderForVisualTest(ui: ReactElement, options?: VisualTestRenderOptions): import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
8
|
+
//# sourceMappingURL=render-for-visual-test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-for-visual-test.d.ts","sourceRoot":"","sources":["../../lib/test-utils/render-for-visual-test.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACjC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,uBAAuB,gIAiBtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-cell-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/date-cell-theme.ts"],"names":[],"mappings":"AACA,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"date-cell-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/date-cell-theme.ts"],"names":[],"mappings":"AACA,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"build": "vite build --mode prod",
|
|
21
21
|
"tsc": "tsc --project tsconfig.app.json",
|
|
22
22
|
"test": "vitest run",
|
|
23
|
+
"test:visual:server:start": "docker compose -f docker-compose.visual.yml up -d --wait playwright-server",
|
|
24
|
+
"test:visual:server:stop": "docker compose -f docker-compose.visual.yml down",
|
|
25
|
+
"test:visual": "node ./scripts/run-visual-tests.js",
|
|
26
|
+
"test:visual:ui": "vite preview --outDir html",
|
|
27
|
+
"test:visual:update": "rimraf __screenshots__ && npm run test:visual:server:start && (vitest --config vitest.visual.config.ts --run --update || true) && npm run test:visual:server:stop",
|
|
23
28
|
"prettier": "prettier --check .",
|
|
24
29
|
"prettier:fix": "prettier --write .",
|
|
25
30
|
"check:types": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
|
|
@@ -32,25 +37,28 @@
|
|
|
32
37
|
"@caspeco/prettier-config": "^1.0.7",
|
|
33
38
|
"@eslint/js": "^9.39.2",
|
|
34
39
|
"@testing-library/jest-dom": "^6.9.1",
|
|
35
|
-
"@testing-library/react": "^16.3.
|
|
40
|
+
"@testing-library/react": "^16.3.2",
|
|
36
41
|
"@testing-library/user-event": "^14.6.1",
|
|
37
42
|
"@types/jest": "^30.0.0",
|
|
38
43
|
"@types/node": "^24.10.9",
|
|
39
44
|
"@types/react": "^18.3.12",
|
|
40
45
|
"@types/react-dom": "^18.3.1",
|
|
41
46
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
47
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
48
|
+
"@vitest/ui": "^4.0.18",
|
|
42
49
|
"eslint": "^9.39.2",
|
|
43
50
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
44
51
|
"eslint-plugin-react-refresh": "^0.4.26",
|
|
45
|
-
"globals": "^17.
|
|
52
|
+
"globals": "^17.1.0",
|
|
46
53
|
"jsdom": "^27.4.0",
|
|
54
|
+
"rimraf": "^6.1.2",
|
|
47
55
|
"tsc-alias": "^1.8.16",
|
|
48
56
|
"typescript": "~5.9.3",
|
|
49
57
|
"typescript-eslint": "^8.53.0",
|
|
50
58
|
"vite": "^7.3.1",
|
|
51
59
|
"vite-plugin-dts": "^4.5.4",
|
|
52
60
|
"vite-tsconfig-paths": "^6.0.4",
|
|
53
|
-
"vitest": "^4.0.
|
|
61
|
+
"vitest": "^4.0.18"
|
|
54
62
|
},
|
|
55
63
|
"peerDependencies": {
|
|
56
64
|
"@chakra-ui/react": "^2.8.2",
|