@maropost-ui/liquidsky-ui 0.1.77 → 0.1.79

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 (40) hide show
  1. package/README.md +18 -0
  2. package/dist/components/AppStepper/useStepper.d.ts +4 -4
  3. package/dist/components/index.d.ts +1 -0
  4. package/dist/components/vuetify-wrappers/index.d.ts +37 -0
  5. package/dist/components/vuetify-wrappers/wrapWithMpTest.d.ts +9 -0
  6. package/dist/composables/useMpTestId.d.ts +9 -13
  7. package/dist/directives/MpTest.d.ts +36 -14
  8. package/dist/directives/index.d.ts +1 -0
  9. package/dist/directives/mpTestComponentDefaults.d.ts +546 -0
  10. package/dist/directives/mpTestConfig.d.ts +30 -0
  11. package/dist/index.css +1 -1
  12. package/dist/index.d.ts +3 -1
  13. package/dist/index.js +20428 -19274
  14. package/dist/types/AlertModalProps.d.ts +1 -2
  15. package/dist/types/AppClipboardProps.d.ts +1 -2
  16. package/dist/types/AppConfirmationDialogProps.d.ts +1 -2
  17. package/dist/types/AppDataTableProps.d.ts +1 -2
  18. package/dist/types/AppDialogWrapperProps.d.ts +1 -2
  19. package/dist/types/AppDrawerWrapperProps.d.ts +1 -2
  20. package/dist/types/AppDropdownProps.d.ts +1 -2
  21. package/dist/types/AppMultiCellValueProps.d.ts +1 -2
  22. package/dist/types/AppSnackbarProps.d.ts +1 -2
  23. package/dist/types/AppSplitButtonProps.d.ts +1 -2
  24. package/dist/types/AppStepperProps.d.ts +1 -2
  25. package/dist/types/AppTableActionMenuProps.d.ts +1 -2
  26. package/dist/types/AppsDropdownProps.d.ts +1 -2
  27. package/dist/types/MpTestIdProps.d.ts +6 -2
  28. package/dist/types/NotificationIconProps.d.ts +1 -2
  29. package/dist/types/SearchBarProps.d.ts +1 -2
  30. package/dist/types/SlVueTreeNextProps.d.ts +1 -2
  31. package/dist/types/TheNavigationProps.d.ts +1 -2
  32. package/dist/types/TheNotificationDrawerProps.d.ts +1 -2
  33. package/dist/types/TheOnboardingScreenChecklistsProps.d.ts +1 -2
  34. package/dist/types/TheTimezoneProps.d.ts +1 -2
  35. package/dist/types/TheUserDropdownProps.d.ts +1 -2
  36. package/dist/types/UnifiedNavigationProps.d.ts +1 -2
  37. package/dist/types/router.d.ts +1 -2
  38. package/dist/utils/index.d.ts +1 -0
  39. package/dist/utils/mpTestAttrs.d.ts +22 -0
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -38,6 +38,24 @@ npm install @maropost-ui/liquidsky-ui
38
38
  import { AppBreadcrumb } from '@maropost-ui/liquidsky-ui'
39
39
  ```
40
40
 
41
+
42
+ ## Test identifiers (`v-mp-test`)
43
+
44
+ Default `data-testid`s **per component** (root + built-in actions) live in source:
45
+
46
+ - [`src/directives/mpTestComponentDefaults.ts`](src/directives/mpTestComponentDefaults.ts) — `MP_TEST_COMPONENT_DEFAULTS`
47
+ - [`src/directives/mpTestConfig.ts`](src/directives/mpTestConfig.ts) — `MP_TEST_IDS` string constants
48
+
49
+ ```ts
50
+ import { MP_TEST_COMPONENT_DEFAULTS, MP_TEST_IDS } from '@maropost-ui/liquidsky-ui'
51
+
52
+ MP_TEST_COMPONENT_DEFAULTS.AppDialogWrapper.ids
53
+ // → [{ role: 'root', id: 'mp-dialog' }, { role: 'cancel', … }, { role: 'save', … }]
54
+ ```
55
+
56
+ Storybook: **Directives → MpTest** (catalog of defaults).
57
+
58
+
41
59
  ------------------------------------------------------------------------
42
60
 
43
61
  ------------------------------------------------------------------------
@@ -5,12 +5,12 @@ export declare function useStepper(steps: TStepItem[]): {
5
5
  name: string;
6
6
  order: number;
7
7
  id: number;
8
- component?: {
8
+ component?: import("vue").FunctionalComponent<any, {}, any, {}> | {
9
9
  new (...args: any[]): any;
10
10
  __isFragment?: never;
11
11
  __isTeleport?: never;
12
12
  __isSuspense?: never;
13
- } | import("vue").FunctionalComponent<any, {}, any, {}> | {
13
+ } | {
14
14
  [x: string]: any;
15
15
  setup?: ((this: void, props: import("@vue/shared").LooseRequired<any>, ctx: {
16
16
  attrs: import("vue").Attrs;
@@ -135,12 +135,12 @@ export declare function useStepper(steps: TStepItem[]): {
135
135
  name: string;
136
136
  order: number;
137
137
  id: number;
138
- component?: {
138
+ component?: import("vue").FunctionalComponent<any, {}, any, {}> | {
139
139
  new (...args: any[]): any;
140
140
  __isFragment?: never;
141
141
  __isTeleport?: never;
142
142
  __isSuspense?: never;
143
- } | import("vue").FunctionalComponent<any, {}, any, {}> | {
143
+ } | {
144
144
  [x: string]: any;
145
145
  setup?: ((this: void, props: import("@vue/shared").LooseRequired<any>, ctx: {
146
146
  attrs: import("vue").Attrs;
@@ -36,6 +36,7 @@ export { default as TheOnboardingBanner } from "./TheOnboardingBanner.vue";
36
36
  export { default as TheOnboardingScreenChecklists } from "./TheOnboardingScreenChecklists.vue";
37
37
  export { default as AppButton } from "./AppButton.vue";
38
38
  export { default as AppSplitButton } from "./AppSplitButton.vue";
39
+ export { MpVBtn, MpVTextField, MpVTextarea, MpVDateInput, MpVSelect, MpVAutocomplete, MpVCheckbox, MpVCheckboxBtn, MpVSwitch, MpVRadio, MpVRadioGroup, MpVForm, MpVChip, MpVStatusChip, MpVMenu, MpVDialog, MpVTabs, MpVTab, MpVCombobox, MpVFileInput, MpVBtnToggle, MpVList, MpVListItem, MpVAlert, MpVExpansionPanels, MpVExpansionPanel, MpVPagination, MpVTooltip, MpVSnackbar, MpVNavigationDrawer, MpVDataTable, MpVDataTableServer, MpVDataTableVirtual, MpVStepper, MpVDatePicker, MpVMaskInput, wrapWithMpTest, } from "./vuetify-wrappers";
39
40
  export { default as SlVueTreeNext } from "./SlVueTreeNext.vue";
40
41
  export { default as AppStepper } from "./AppStepper/AppStepper.vue";
41
42
  export { default as AppDatePicker } from "./AppDatePicker.vue";
@@ -0,0 +1,37 @@
1
+ export { default as MpVBtn } from './MpVBtn.vue';
2
+ export { default as MpVTextField } from './MpVTextField.vue';
3
+ export { default as MpVTextarea } from './MpVTextarea.vue';
4
+ export { default as MpVDateInput } from './MpVDateInput.vue';
5
+ export { default as MpVSelect } from './MpVSelect.vue';
6
+ export { default as MpVAutocomplete } from './MpVAutocomplete.vue';
7
+ export { default as MpVCheckbox } from './MpVCheckbox.vue';
8
+ export { default as MpVCheckboxBtn } from './MpVCheckboxBtn.vue';
9
+ export { default as MpVSwitch } from './MpVSwitch.vue';
10
+ export { default as MpVRadio } from './MpVRadio.vue';
11
+ export { default as MpVRadioGroup } from './MpVRadioGroup.vue';
12
+ export { default as MpVForm } from './MpVForm.vue';
13
+ export { default as MpVChip } from './MpVChip.vue';
14
+ export { default as MpVStatusChip } from './MpVStatusChip.vue';
15
+ export { default as MpVMenu } from './MpVMenu.vue';
16
+ export { default as MpVDialog } from './MpVDialog.vue';
17
+ export { default as MpVTabs } from './MpVTabs.vue';
18
+ export { default as MpVTab } from './MpVTab.vue';
19
+ export { default as MpVCombobox } from './MpVCombobox.vue';
20
+ export { default as MpVFileInput } from './MpVFileInput.vue';
21
+ export { default as MpVBtnToggle } from './MpVBtnToggle.vue';
22
+ export { default as MpVList } from './MpVList.vue';
23
+ export { default as MpVListItem } from './MpVListItem.vue';
24
+ export { default as MpVAlert } from './MpVAlert.vue';
25
+ export { default as MpVExpansionPanels } from './MpVExpansionPanels.vue';
26
+ export { default as MpVExpansionPanel } from './MpVExpansionPanel.vue';
27
+ export { default as MpVPagination } from './MpVPagination.vue';
28
+ export { default as MpVTooltip } from './MpVTooltip.vue';
29
+ export { default as MpVSnackbar } from './MpVSnackbar.vue';
30
+ export { default as MpVNavigationDrawer } from './MpVNavigationDrawer.vue';
31
+ export { default as MpVDataTable } from './MpVDataTable.vue';
32
+ export { default as MpVDataTableServer } from './MpVDataTableServer.vue';
33
+ export { default as MpVDataTableVirtual } from './MpVDataTableVirtual.vue';
34
+ export { default as MpVStepper } from './MpVStepper.vue';
35
+ export { default as MpVDatePicker } from './MpVDatePicker.vue';
36
+ export { default as MpVMaskInput } from './MpVMaskInput.vue';
37
+ export { wrapWithMpTest } from './wrapWithMpTest';
@@ -0,0 +1,9 @@
1
+ import { type Component } from 'vue';
2
+ /**
3
+ * Transparent HOC: apply a default `v-mp-test` base id to an app-provided
4
+ * Vuetify remap (e.g. Commerce `AppTextFieldInput`) without requiring the
5
+ * consuming app to import `MP_TEST_IDS` or change its wrapper.
6
+ */
7
+ export declare function wrapWithMpTest(Inner: Component, testId: string, name: string): import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
8
+ [key: string]: any;
9
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,17 +1,13 @@
1
- import { type ComputedRef, type MaybeRefOrGetter } from 'vue';
1
+ import { type MpTestBindingObject } from '../directives/MpTest';
2
2
  /**
3
- * Resolves a test identifier from a component default, optional override, and optional suffix.
4
- * Override (`testId`) wins over suffix (`testIdSuffix`).
3
+ * @deprecated Prefer `resolveMpTestBinding` / `v-mp-test`.
4
+ * Legacy `(defaultId, testId?, testIdSuffix?)` still supported.
5
5
  */
6
- export declare function resolveMpTestId(defaultId: string, testId?: string, testIdSuffix?: string): string;
6
+ export declare function resolveMpTestId(defaultIdOrBinding: string | MpTestBindingObject, testId?: string, testIdSuffix?: string): string;
7
7
  /**
8
- * @description
9
- * Reactive test identifier for `v-mp-test`. Pass a component default plus optional
10
- * `testId` (override) and `testIdSuffix` (extend) props.
11
- *
12
- * @example
13
- * ```ts
14
- * const mpTestId = useMpTestId(MP_TEST_IDS.button, () => props.testId, () => props.testIdSuffix)
15
- * ```
8
+ * @deprecated Use `v-mp-test="MP_TEST_IDS.*"` or
9
+ * `v-mp-test="{ action, module, suffix }"`.
16
10
  */
17
- export default function useMpTestId(defaultId: string, testId?: MaybeRefOrGetter<string | undefined>, testIdSuffix?: MaybeRefOrGetter<string | undefined>): ComputedRef<string>;
11
+ export default function useMpTestId(_defaultId: string, _testId?: unknown, _testIdSuffix?: unknown): {
12
+ readonly value: string;
13
+ };
@@ -1,23 +1,45 @@
1
1
  import type { ObjectDirective } from 'vue';
2
2
  /**
3
3
  * @description
4
- * A custom Vue directive (`v-mp-test`) that applies a test identifier to an element
5
- * for Playwright (`data-testid`) and Cypress (`data-cy` / `data-test-cy`).
6
- * Attribute names are defined once in `mpTestConfig.ts`; changing that list updates every usage.
7
- * Prefer `testId` / `testIdSuffix` props on Liquidsky components so defaults can be extended or overridden.
4
+ * `v-mp-test` applies Playwright/Cypress test ids (`data-testid`, `data-cy`, …).
8
5
  *
9
- * @example Basic usage in a Vue component:
10
- * ```vue
11
- * <template>
12
- * <div v-mp-test="'checkout-summary'">Summary</div>
13
- * <AppDataTable />
14
- * <AppDataTable test-id-suffix="inventory" />
15
- * <AppDataTable test-id="inventory-table" />
16
- * </template>
17
- * ```
6
+ * Final id shape: `mp-{component}[-{action}][-{module}][-{suffix}]`
7
+ * (omit empty optional segments).
8
+ *
9
+ * Binding:
10
+ * - Component string (`MP_TEST_IDS.breadcrumb`) → **base** (`mp-breadcrumb`)
11
+ * - Object `{ action?, module?, suffix? }` → segments merged onto base
12
+ * - Consumer string → **full replace** of the entire id
13
+ * - Directive arg (`v-mp-test:mp-button`) → base when no string base yet
14
+ *
15
+ * Merge (Liquidsky default on root + parent customization):
16
+ * - `<AppBreadcrumb />` → `mp-breadcrumb`
17
+ * - `<AppBreadcrumb v-mp-test="{ action: 'click', module: 'collection', suffix: 'test' }" />`
18
+ * → `mp-breadcrumb-click-collection-test`
19
+ * - `<AppBreadcrumb v-mp-test="'testing-collection-button-click'" />`
20
+ * → `testing-collection-button-click`
18
21
  */
22
+ export type MpTestBindingObject = {
23
+ action?: string;
24
+ module?: string;
25
+ suffix?: string;
26
+ };
27
+ export type MpTestBinding = string | MpTestBindingObject | null | undefined;
28
+ type MpTestContribution = {
29
+ base?: string;
30
+ action?: string;
31
+ module?: string;
32
+ suffix?: string;
33
+ /** Plain string that replaces the entire resolved id. */
34
+ fullReplace?: string;
35
+ /** True when this contribution came from a plain string binding. */
36
+ fromString?: boolean;
37
+ };
19
38
  interface MpTestHTMLElement extends HTMLElement {
20
39
  _vMpTestValue?: string;
40
+ _vMpTestContrib?: Map<string, MpTestContribution>;
21
41
  }
22
- export declare const vMpTest: ObjectDirective<MpTestHTMLElement, unknown>;
42
+ /** Build final id from a single binding (+ optional arg default as base). */
43
+ export declare function resolveMpTestBinding(bindingValue: unknown, argDefault?: string): string;
44
+ export declare const vMpTest: ObjectDirective<MpTestHTMLElement, MpTestBinding>;
23
45
  export default vMpTest;
@@ -2,3 +2,4 @@ export { default as tooltipOverflowCheck } from './TooltipOverflowCheck';
2
2
  export { default as Clipboard } from './Clipboard';
3
3
  export { default as MpTest, vMpTest } from './MpTest';
4
4
  export { MP_TEST_ATTRIBUTES, MP_TEST_IDS } from './mpTestConfig';
5
+ export { MP_TEST_COMPONENT_DEFAULTS, type MpTestComponentDefaultEntry, type MpTestComponentDefaultGroup, type MpTestComponentName } from './mpTestComponentDefaults';