@flipdish/ui-library 0.31.3 → 0.31.5
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/dist/components/molecules/CodeSnippet/index.cjs.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.d.ts.map +1 -1
- package/dist/components/molecules/CodeSnippet/index.js.map +1 -1
- package/dist/components/molecules/Pagination/index.cjs.map +1 -1
- package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
- package/dist/components/molecules/Pagination/index.js.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.cjs +4 -5
- package/dist/components/organisms/ApplicationHeader/index.cjs.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.d.ts +4 -5
- package/dist/components/organisms/ApplicationHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/ApplicationHeader/index.js +4 -5
- package/dist/components/organisms/ApplicationHeader/index.js.map +1 -1
- package/dist/components/organisms/Charts/components/PieChart.cjs +2 -4
- package/dist/components/organisms/Charts/components/PieChart.cjs.map +1 -1
- package/dist/components/organisms/Charts/components/PieChart.d.ts +2 -4
- package/dist/components/organisms/Charts/components/PieChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/components/PieChart.js +2 -4
- package/dist/components/organisms/Charts/components/PieChart.js.map +1 -1
- package/dist/components/organisms/Charts/index.d.ts +0 -2
- package/dist/components/organisms/Charts/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.cjs +3 -2
- package/dist/components/organisms/ColorPicker/index.cjs.map +1 -1
- package/dist/components/organisms/ColorPicker/index.d.ts +3 -2
- package/dist/components/organisms/ColorPicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ColorPicker/index.js +3 -2
- package/dist/components/organisms/ColorPicker/index.js.map +1 -1
- package/dist/components/organisms/ImagePicker/index.cjs +3 -2
- package/dist/components/organisms/ImagePicker/index.cjs.map +1 -1
- package/dist/components/organisms/ImagePicker/index.d.ts +3 -2
- package/dist/components/organisms/ImagePicker/index.d.ts.map +1 -1
- package/dist/components/organisms/ImagePicker/index.js +3 -2
- package/dist/components/organisms/ImagePicker/index.js.map +1 -1
- package/dist/components/organisms/PageHeader/index.cjs +4 -6
- package/dist/components/organisms/PageHeader/index.cjs.map +1 -1
- package/dist/components/organisms/PageHeader/index.d.ts +4 -6
- package/dist/components/organisms/PageHeader/index.d.ts.map +1 -1
- package/dist/components/organisms/PageHeader/index.js +4 -6
- package/dist/components/organisms/PageHeader/index.js.map +1 -1
- package/dist/components/organisms/SidePanel/index.cjs +5 -7
- package/dist/components/organisms/SidePanel/index.cjs.map +1 -1
- package/dist/components/organisms/SidePanel/index.d.ts +5 -7
- package/dist/components/organisms/SidePanel/index.d.ts.map +1 -1
- package/dist/components/organisms/SidePanel/index.js +5 -7
- package/dist/components/organisms/SidePanel/index.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.cjs +7 -4
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.d.ts +7 -4
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.js +7 -4
- package/dist/components/organisms/SidebarNavigation/components/SidebarMenuButton.js.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.cjs +4 -8
- package/dist/components/organisms/SidebarNavigation/index.cjs.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.d.ts +4 -8
- package/dist/components/organisms/SidebarNavigation/index.d.ts.map +1 -1
- package/dist/components/organisms/SidebarNavigation/index.js +4 -8
- package/dist/components/organisms/SidebarNavigation/index.js.map +1 -1
- package/dist/components/templates/AppShell/index.cjs +5 -7
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +5 -7
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +5 -7
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/components/templates/NotFoundPage/index.cjs +3 -9
- package/dist/components/templates/NotFoundPage/index.cjs.map +1 -1
- package/dist/components/templates/NotFoundPage/index.d.ts +3 -9
- package/dist/components/templates/NotFoundPage/index.d.ts.map +1 -1
- package/dist/components/templates/NotFoundPage/index.js +3 -9
- package/dist/components/templates/NotFoundPage/index.js.map +1 -1
- package/dist/components/templates/PageLayout/index.cjs +5 -12
- package/dist/components/templates/PageLayout/index.cjs.map +1 -1
- package/dist/components/templates/PageLayout/index.d.ts +5 -12
- package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
- package/dist/components/templates/PageLayout/index.js +5 -12
- package/dist/components/templates/PageLayout/index.js.map +1 -1
- package/dist/hooks/useBreakpoints/index.cjs +5 -5
- package/dist/hooks/useBreakpoints/index.d.ts +5 -5
- package/dist/hooks/useBreakpoints/index.js +5 -5
- package/dist/hooks/useClipboard/index.cjs +5 -2
- package/dist/hooks/useClipboard/index.cjs.map +1 -1
- package/dist/hooks/useClipboard/index.d.ts +5 -2
- package/dist/hooks/useClipboard/index.d.ts.map +1 -1
- package/dist/hooks/useClipboard/index.js +5 -2
- package/dist/hooks/useClipboard/index.js.map +1 -1
- package/dist/hooks/usePlatform/index.cjs +4 -5
- package/dist/hooks/usePlatform/index.cjs.map +1 -1
- package/dist/hooks/usePlatform/index.d.ts +4 -5
- package/dist/hooks/usePlatform/index.d.ts.map +1 -1
- package/dist/hooks/usePlatform/index.js +4 -5
- package/dist/hooks/usePlatform/index.js.map +1 -1
- package/dist/hooks/useResizeObserver/index.cjs +7 -2
- package/dist/hooks/useResizeObserver/index.cjs.map +1 -1
- package/dist/hooks/useResizeObserver/index.d.ts +7 -2
- package/dist/hooks/useResizeObserver/index.d.ts.map +1 -1
- package/dist/hooks/useResizeObserver/index.js +7 -2
- package/dist/hooks/useResizeObserver/index.js.map +1 -1
- package/dist/hooks/useSidePanel/index.cjs +7 -5
- package/dist/hooks/useSidePanel/index.cjs.map +1 -1
- package/dist/hooks/useSidePanel/index.d.ts +7 -5
- package/dist/hooks/useSidePanel/index.d.ts.map +1 -1
- package/dist/hooks/useSidePanel/index.js +7 -5
- package/dist/hooks/useSidePanel/index.js.map +1 -1
- package/dist/native/utilities/cx/index.d.ts +9 -9
- package/dist/native/utilities/cx/index.d.ts.map +1 -1
- package/dist/native/utilities/cx/index.js +9 -9
- package/dist/native/utilities/cx/index.js.map +1 -1
- package/dist/native/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/native/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/native/utilities/testIdUtils/index.js +44 -10
- package/dist/native/utilities/testIdUtils/index.js.map +1 -1
- package/dist/providers/ErrorBoundary/index.cjs +5 -7
- package/dist/providers/ErrorBoundary/index.cjs.map +1 -1
- package/dist/providers/ErrorBoundary/index.d.ts +4 -7
- package/dist/providers/ErrorBoundary/index.d.ts.map +1 -1
- package/dist/providers/ErrorBoundary/index.js +5 -7
- package/dist/providers/ErrorBoundary/index.js.map +1 -1
- package/dist/providers/RouteProvider/index.cjs +5 -1
- package/dist/providers/RouteProvider/index.cjs.map +1 -1
- package/dist/providers/RouteProvider/index.d.ts +5 -1
- package/dist/providers/RouteProvider/index.d.ts.map +1 -1
- package/dist/providers/RouteProvider/index.js +5 -1
- package/dist/providers/RouteProvider/index.js.map +1 -1
- package/dist/providers/ThemeProvider/index.cjs +11 -1
- package/dist/providers/ThemeProvider/index.cjs.map +1 -1
- package/dist/providers/ThemeProvider/index.d.ts +11 -1
- package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
- package/dist/providers/ThemeProvider/index.js +11 -1
- package/dist/providers/ThemeProvider/index.js.map +1 -1
- package/dist/providers/UIProvider/index.cjs +5 -1
- package/dist/providers/UIProvider/index.cjs.map +1 -1
- package/dist/providers/UIProvider/index.d.ts +5 -1
- package/dist/providers/UIProvider/index.d.ts.map +1 -1
- package/dist/providers/UIProvider/index.js +5 -1
- package/dist/providers/UIProvider/index.js.map +1 -1
- package/dist/utilities/cssScopeUtils/index.cjs +6 -5
- package/dist/utilities/cssScopeUtils/index.cjs.map +1 -1
- package/dist/utilities/cssScopeUtils/index.d.ts +6 -5
- package/dist/utilities/cssScopeUtils/index.d.ts.map +1 -1
- package/dist/utilities/cssScopeUtils/index.js +6 -5
- package/dist/utilities/cssScopeUtils/index.js.map +1 -1
- package/dist/utilities/cx/index.cjs +9 -9
- package/dist/utilities/cx/index.cjs.map +1 -1
- package/dist/utilities/cx/index.d.ts +9 -9
- package/dist/utilities/cx/index.d.ts.map +1 -1
- package/dist/utilities/cx/index.js +9 -9
- package/dist/utilities/cx/index.js.map +1 -1
- package/dist/utilities/hrefUtils/index.cjs +10 -11
- package/dist/utilities/hrefUtils/index.cjs.map +1 -1
- package/dist/utilities/hrefUtils/index.d.ts +10 -11
- package/dist/utilities/hrefUtils/index.d.ts.map +1 -1
- package/dist/utilities/hrefUtils/index.js +10 -11
- package/dist/utilities/hrefUtils/index.js.map +1 -1
- package/dist/utilities/localStorageUtils/index.cjs +8 -5
- package/dist/utilities/localStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/localStorageUtils/index.d.ts +8 -5
- package/dist/utilities/localStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/localStorageUtils/index.js +8 -5
- package/dist/utilities/localStorageUtils/index.js.map +1 -1
- package/dist/utilities/renderUtils/index.cjs +31 -30
- package/dist/utilities/renderUtils/index.cjs.map +1 -1
- package/dist/utilities/renderUtils/index.d.ts +31 -30
- package/dist/utilities/renderUtils/index.d.ts.map +1 -1
- package/dist/utilities/renderUtils/index.js +31 -30
- package/dist/utilities/renderUtils/index.js.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.cjs +8 -5
- package/dist/utilities/sessionStorageUtils/index.cjs.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.d.ts +8 -5
- package/dist/utilities/sessionStorageUtils/index.d.ts.map +1 -1
- package/dist/utilities/sessionStorageUtils/index.js +8 -5
- package/dist/utilities/sessionStorageUtils/index.js.map +1 -1
- package/dist/utilities/testIdUtils/index.cjs +44 -10
- package/dist/utilities/testIdUtils/index.cjs.map +1 -1
- package/dist/utilities/testIdUtils/index.d.ts +44 -10
- package/dist/utilities/testIdUtils/index.d.ts.map +1 -1
- package/dist/utilities/testIdUtils/index.js +44 -10
- package/dist/utilities/testIdUtils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -18,19 +18,45 @@
|
|
|
18
18
|
export declare const TEST_ID_PREFIX = "fd";
|
|
19
19
|
/** Separator placed between hierarchy levels (within a segment, use single `-`). */
|
|
20
20
|
export declare const TEST_ID_SEPARATOR = "--";
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Converts an arbitrary string into a kebab-case, testid-safe segment.
|
|
23
|
+
*
|
|
24
|
+
* @param value A label or id, in any case or punctuation.
|
|
25
|
+
* @returns Lower-case text with runs of non-alphanumerics collapsed to single hyphens.
|
|
26
|
+
*/
|
|
22
27
|
export declare const slugifyTestId: (value: string) => string;
|
|
23
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Builds a root-level testid, e.g. `rootTestId('sidebar-navigation')` ->
|
|
30
|
+
* `fd-sidebar-navigation`.
|
|
31
|
+
*
|
|
32
|
+
* @param kebabName The component's kebab-case name.
|
|
33
|
+
* @returns The name prefixed with `fd-`.
|
|
34
|
+
*/
|
|
24
35
|
export declare const rootTestId: (kebabName: string) => string;
|
|
25
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Appends a child segment to a parent testid, e.g. `joinTestId('fd-x', 'nav-item-orders')` ->
|
|
38
|
+
* `fd-x--nav-item-orders`.
|
|
39
|
+
*
|
|
40
|
+
* @param prefix The ancestor's resolved testid.
|
|
41
|
+
* @param segment The child's own segment, already slugified.
|
|
42
|
+
* @returns The two joined with `--`.
|
|
43
|
+
*/
|
|
26
44
|
export declare const joinTestId: (prefix: string, segment: string) => string;
|
|
27
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Returns the override when provided, otherwise the fallback (explicit-child case).
|
|
47
|
+
*
|
|
48
|
+
* @param override A consumer-provided `data-testid`, if any.
|
|
49
|
+
* @param fallback The derived default to use without one.
|
|
50
|
+
* @returns Whichever applies.
|
|
51
|
+
*/
|
|
28
52
|
export declare const resolveTestId: (override: string | undefined, fallback: string) => string;
|
|
29
53
|
/**
|
|
30
|
-
* Spread helper for
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
54
|
+
* Spread helper for a resolved test id: `{ 'data-testid': value }` when present, else an empty
|
|
55
|
+
* object. Centralising it keeps the attribute name in one place so a React Native sibling can
|
|
56
|
+
* map it to `testID`.
|
|
57
|
+
*
|
|
58
|
+
* @param testId The resolved id, or `undefined` to emit nothing.
|
|
59
|
+
* @returns Props to spread onto the rendered element.
|
|
34
60
|
*/
|
|
35
61
|
export declare const testIdProps: (testId: string | undefined) => {
|
|
36
62
|
"data-testid"?: string;
|
|
@@ -39,7 +65,11 @@ export declare const testIdProps: (testId: string | undefined) => {
|
|
|
39
65
|
export declare const TestIdContext: import("react").Context<string | undefined>;
|
|
40
66
|
/** Provides a resolved testid as the prefix for descendant library components. */
|
|
41
67
|
export declare const TestIdProvider: import("react").Provider<string | undefined>;
|
|
42
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Reads the testid prefix contributed by an ancestor component.
|
|
70
|
+
*
|
|
71
|
+
* @returns The ancestor's resolved testid, or `undefined` at the root.
|
|
72
|
+
*/
|
|
43
73
|
export declare const useTestIdPrefix: () => string | undefined;
|
|
44
74
|
export interface UseResolvedTestIdOptions {
|
|
45
75
|
/** Consumer-provided override; wins over any derived value. */
|
|
@@ -50,8 +80,12 @@ export interface UseResolvedTestIdOptions {
|
|
|
50
80
|
rootName: string;
|
|
51
81
|
}
|
|
52
82
|
/**
|
|
53
|
-
*
|
|
83
|
+
* Resolves a component's testid: an explicit override wins; otherwise derive
|
|
54
84
|
* `<ancestorPrefix>--<segment>` when nested, or `fd-<rootName>` at the root.
|
|
85
|
+
*
|
|
86
|
+
* @param options The consumer `testId` override, the component's `segment`, and its
|
|
87
|
+
* `rootName`.
|
|
88
|
+
* @returns The id to render as `data-testid`.
|
|
55
89
|
*/
|
|
56
90
|
export declare const useResolvedTestId: ({ testId, segment, rootName }: UseResolvedTestIdOptions) => string;
|
|
57
91
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/testIdUtils/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,sDAAsD;AACtD,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/testIdUtils/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,sDAAsD;AACtD,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,MAKlB,CAAC;AAE7B;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,MAA0C,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,MAAmD,CAAC;AAEjH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,MAA8B,CAAC;AAE9G;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAA+C,CAAC;AAEjI,kGAAkG;AAClG,eAAO,MAAM,aAAa,6CAA+C,CAAC;AAE1E,kFAAkF;AAClF,eAAO,MAAM,cAAc,8CAAyB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,MAAM,GAAG,SAAsC,CAAC;AAEnF,MAAM,WAAW,wBAAwB;IACvC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,+BAA+B,wBAAwB,KAAG,MAG3F,CAAC"}
|
|
@@ -20,34 +20,68 @@ import { createContext, useContext } from 'react';
|
|
|
20
20
|
const TEST_ID_PREFIX = 'fd';
|
|
21
21
|
/** Separator placed between hierarchy levels (within a segment, use single `-`). */
|
|
22
22
|
const TEST_ID_SEPARATOR = '--';
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Converts an arbitrary string into a kebab-case, testid-safe segment.
|
|
25
|
+
*
|
|
26
|
+
* @param value A label or id, in any case or punctuation.
|
|
27
|
+
* @returns Lower-case text with runs of non-alphanumerics collapsed to single hyphens.
|
|
28
|
+
*/
|
|
24
29
|
const slugifyTestId = (value) => value
|
|
25
30
|
.toLowerCase()
|
|
26
31
|
.trim()
|
|
27
32
|
.replace(/[^a-z0-9]+/g, '-')
|
|
28
33
|
.replace(/^-+|-+$/g, '');
|
|
29
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Builds a root-level testid, e.g. `rootTestId('sidebar-navigation')` ->
|
|
36
|
+
* `fd-sidebar-navigation`.
|
|
37
|
+
*
|
|
38
|
+
* @param kebabName The component's kebab-case name.
|
|
39
|
+
* @returns The name prefixed with `fd-`.
|
|
40
|
+
*/
|
|
30
41
|
const rootTestId = (kebabName) => `${TEST_ID_PREFIX}-${kebabName}`;
|
|
31
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Appends a child segment to a parent testid, e.g. `joinTestId('fd-x', 'nav-item-orders')` ->
|
|
44
|
+
* `fd-x--nav-item-orders`.
|
|
45
|
+
*
|
|
46
|
+
* @param prefix The ancestor's resolved testid.
|
|
47
|
+
* @param segment The child's own segment, already slugified.
|
|
48
|
+
* @returns The two joined with `--`.
|
|
49
|
+
*/
|
|
32
50
|
const joinTestId = (prefix, segment) => `${prefix}${TEST_ID_SEPARATOR}${segment}`;
|
|
33
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Returns the override when provided, otherwise the fallback (explicit-child case).
|
|
53
|
+
*
|
|
54
|
+
* @param override A consumer-provided `data-testid`, if any.
|
|
55
|
+
* @param fallback The derived default to use without one.
|
|
56
|
+
* @returns Whichever applies.
|
|
57
|
+
*/
|
|
34
58
|
const resolveTestId = (override, fallback) => override ?? fallback;
|
|
35
59
|
/**
|
|
36
|
-
* Spread helper for
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
60
|
+
* Spread helper for a resolved test id: `{ 'data-testid': value }` when present, else an empty
|
|
61
|
+
* object. Centralising it keeps the attribute name in one place so a React Native sibling can
|
|
62
|
+
* map it to `testID`.
|
|
63
|
+
*
|
|
64
|
+
* @param testId The resolved id, or `undefined` to emit nothing.
|
|
65
|
+
* @returns Props to spread onto the rendered element.
|
|
40
66
|
*/
|
|
41
67
|
const testIdProps = (testId) => (testId ? { 'data-testid': testId } : {});
|
|
42
68
|
/** Context carrying the current resolved testid, used as the prefix for descendant components. */
|
|
43
69
|
const TestIdContext = createContext(undefined);
|
|
44
70
|
/** Provides a resolved testid as the prefix for descendant library components. */
|
|
45
71
|
const TestIdProvider = TestIdContext.Provider;
|
|
46
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Reads the testid prefix contributed by an ancestor component.
|
|
74
|
+
*
|
|
75
|
+
* @returns The ancestor's resolved testid, or `undefined` at the root.
|
|
76
|
+
*/
|
|
47
77
|
const useTestIdPrefix = () => useContext(TestIdContext);
|
|
48
78
|
/**
|
|
49
|
-
*
|
|
79
|
+
* Resolves a component's testid: an explicit override wins; otherwise derive
|
|
50
80
|
* `<ancestorPrefix>--<segment>` when nested, or `fd-<rootName>` at the root.
|
|
81
|
+
*
|
|
82
|
+
* @param options The consumer `testId` override, the component's `segment`, and its
|
|
83
|
+
* `rootName`.
|
|
84
|
+
* @returns The id to render as `data-testid`.
|
|
51
85
|
*/
|
|
52
86
|
const useResolvedTestId = ({ testId, segment, rootName }) => {
|
|
53
87
|
const prefix = useTestIdPrefix();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utilities/testIdUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;AAeG;AAEH;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,iBAAiB,GAAG;AAEjC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/utilities/testIdUtils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;AAeG;AAEH;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,iBAAiB,GAAG;AAEjC;;;;;AAKG;MACU,aAAa,GAAG,CAAC,KAAa,KACzC;AACG,KAAA,WAAW;AACX,KAAA,IAAI;AACJ,KAAA,OAAO,CAAC,aAAa,EAAE,GAAG;AAC1B,KAAA,OAAO,CAAC,UAAU,EAAE,EAAE;AAE3B;;;;;;AAMG;AACI,MAAM,UAAU,GAAG,CAAC,SAAiB,KAAa,CAAA,EAAG,cAAc,CAAA,CAAA,EAAI,SAAS;AAEvF;;;;;;;AAOG;AACI,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,OAAe,KAAa,GAAG,MAAM,CAAA,EAAG,iBAAiB,CAAA,EAAG,OAAO;AAE9G;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAC,QAA4B,EAAE,QAAgB,KAAa,QAAQ,IAAI;AAErG;;;;;;;AAOG;AACI,MAAM,WAAW,GAAG,CAAC,MAA0B,MAAkC,MAAM,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE;AAE/H;MACa,aAAa,GAAG,aAAa,CAAqB,SAAS;AAExE;AACO,MAAM,cAAc,GAAG,aAAa,CAAC;AAE5C;;;;AAIG;AACI,MAAM,eAAe,GAAG,MAA0B,UAAU,CAAC,aAAa;AAWjF;;;;;;;AAOG;AACI,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAA4B,KAAY;AACnG,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;IAChC,OAAO,MAAM,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAChF;;"}
|