@dynatrace/strato-components 0.84.31 → 0.84.42
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/core/components/app-root/AppRoot.d.ts +2 -2
- package/core/hooks/useFontsUpdated.d.ts +9 -0
- package/core/hooks/useFontsUpdated.js +51 -0
- package/core/hooks/useMergeRefs.d.ts +7 -0
- package/core/hooks/useMergeRefs.js +34 -0
- package/core/index.d.ts +4 -0
- package/core/styles/focusRing.css +88 -0
- package/core/styles/focusRing.sty.d.ts +96 -0
- package/core/styles/focusRing.sty.js +27 -0
- package/core/styles/useFocusRing.d.ts +49 -0
- package/core/styles/useFocusRing.js +83 -0
- package/core/types/a11y-props.d.ts +19 -0
- package/core/types/a11y-props.js +15 -0
- package/core/types/dom.d.ts +19 -0
- package/core/types/dom.js +15 -0
- package/core/types/focusable-element.d.ts +5 -0
- package/core/types/focusable-element.js +15 -0
- package/core/types/heading.d.ts +9 -0
- package/core/types/heading.js +15 -0
- package/core/types/polymorph.d.ts +25 -0
- package/core/types/polymorph.js +15 -0
- package/core/utils/colorUtils.css +80 -0
- package/core/utils/colorUtils.sty.d.ts +48 -0
- package/core/utils/colorUtils.sty.js +27 -0
- package/esm/core/hooks/useFontsUpdated.js +33 -0
- package/esm/core/hooks/useFontsUpdated.js.map +7 -0
- package/esm/core/hooks/useMergeRefs.js +16 -0
- package/esm/core/hooks/useMergeRefs.js.map +7 -0
- package/esm/core/index.js.map +1 -1
- package/esm/core/styles/focusRing.css +88 -0
- package/esm/core/styles/focusRing.sty.js +9 -0
- package/esm/core/styles/focusRing.sty.js.map +7 -0
- package/esm/core/styles/useFocusRing.js +69 -0
- package/esm/core/styles/useFocusRing.js.map +7 -0
- package/esm/core/types/a11y-props.js +1 -0
- package/esm/core/types/a11y-props.js.map +7 -0
- package/esm/core/types/dom.js +1 -0
- package/esm/core/types/dom.js.map +7 -0
- package/esm/core/types/focusable-element.js +1 -0
- package/esm/core/types/focusable-element.js.map +7 -0
- package/esm/core/types/heading.js +1 -0
- package/esm/core/types/heading.js.map +7 -0
- package/esm/core/types/polymorph.js +1 -0
- package/esm/core/types/polymorph.js.map +7 -0
- package/esm/core/utils/colorUtils.css +80 -0
- package/esm/core/utils/colorUtils.sty.js +9 -0
- package/esm/core/utils/colorUtils.sty.js.map +7 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +2 -2
- package/esm/layouts/Divider/Divider.css +23 -0
- package/esm/layouts/Divider/Divider.js +39 -0
- package/esm/layouts/Divider/Divider.js.map +7 -0
- package/esm/layouts/Divider/Divider.sty.js +8 -0
- package/esm/layouts/Divider/Divider.sty.js.map +7 -0
- package/esm/layouts/index.js +5 -0
- package/esm/layouts/index.js.map +7 -0
- package/esm/styles/textStyle.css +64 -0
- package/esm/styles/textStyle.sty.js +7 -0
- package/esm/styles/textStyle.sty.js.map +7 -0
- package/esm/typography/BlockQuote/Blockquote.css +17 -0
- package/esm/typography/BlockQuote/Blockquote.js +34 -0
- package/esm/typography/BlockQuote/Blockquote.js.map +7 -0
- package/esm/typography/BlockQuote/Blockquote.sty.js +6 -0
- package/esm/typography/BlockQuote/Blockquote.sty.js.map +7 -0
- package/esm/typography/Code/Code.css +16 -0
- package/esm/typography/Code/Code.js +34 -0
- package/esm/typography/Code/Code.js.map +7 -0
- package/esm/typography/Code/Code.sty.js +6 -0
- package/esm/typography/Code/Code.sty.js.map +7 -0
- package/esm/typography/Emphasis/Emphasis.css +4 -0
- package/esm/typography/Emphasis/Emphasis.js +34 -0
- package/esm/typography/Emphasis/Emphasis.js.map +7 -0
- package/esm/typography/Emphasis/Emphasis.sty.js +6 -0
- package/esm/typography/Emphasis/Emphasis.sty.js.map +7 -0
- package/esm/typography/ExternalLink/ExternalLink.css +28 -0
- package/esm/typography/ExternalLink/ExternalLink.js +56 -0
- package/esm/typography/ExternalLink/ExternalLink.js.map +7 -0
- package/esm/typography/ExternalLink/ExternalLink.sty.js +6 -0
- package/esm/typography/ExternalLink/ExternalLink.sty.js.map +7 -0
- package/esm/typography/Heading/Heading.css +54 -0
- package/esm/typography/Heading/Heading.js +36 -0
- package/esm/typography/Heading/Heading.js.map +7 -0
- package/esm/typography/Heading/Heading.sty.js +7 -0
- package/esm/typography/Heading/Heading.sty.js.map +7 -0
- package/esm/typography/Highlight/Highlight.css +4 -0
- package/esm/typography/Highlight/Highlight.js +111 -0
- package/esm/typography/Highlight/Highlight.js.map +7 -0
- package/esm/typography/Highlight/Highlight.sty.js +6 -0
- package/esm/typography/Highlight/Highlight.sty.js.map +7 -0
- package/esm/typography/Link/Link.css +15 -0
- package/esm/typography/Link/Link.js +49 -0
- package/esm/typography/Link/Link.js.map +7 -0
- package/esm/typography/Link/Link.sty.js +6 -0
- package/esm/typography/Link/Link.sty.js.map +7 -0
- package/esm/typography/List/List.css +16 -0
- package/esm/typography/List/List.js +81 -0
- package/esm/typography/List/List.js.map +7 -0
- package/esm/typography/List/List.sty.js +8 -0
- package/esm/typography/List/List.sty.js.map +7 -0
- package/esm/typography/Paragraph/Paragraph.css +19 -0
- package/esm/typography/Paragraph/Paragraph.js +49 -0
- package/esm/typography/Paragraph/Paragraph.js.map +7 -0
- package/esm/typography/Paragraph/Paragraph.sty.js +7 -0
- package/esm/typography/Paragraph/Paragraph.sty.js.map +7 -0
- package/esm/typography/Strikethrough/Strikethrough.css +5 -0
- package/esm/typography/Strikethrough/Strikethrough.js +32 -0
- package/esm/typography/Strikethrough/Strikethrough.js.map +7 -0
- package/esm/typography/Strikethrough/Strikethrough.sty.js +6 -0
- package/esm/typography/Strikethrough/Strikethrough.sty.js.map +7 -0
- package/esm/typography/Strong/Strong.css +4 -0
- package/esm/typography/Strong/Strong.js +34 -0
- package/esm/typography/Strong/Strong.js.map +7 -0
- package/esm/typography/Strong/Strong.sty.js +6 -0
- package/esm/typography/Strong/Strong.sty.js.map +7 -0
- package/esm/typography/Text/Text.css +18 -0
- package/esm/typography/Text/Text.js +43 -0
- package/esm/typography/Text/Text.js.map +7 -0
- package/esm/typography/Text/Text.sty.js +7 -0
- package/esm/typography/Text/Text.sty.js.map +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.css +22 -0
- package/esm/typography/TextEllipsis/TextEllipsis.js +143 -0
- package/esm/typography/TextEllipsis/TextEllipsis.js.map +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.sty.js +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.sty.js.map +7 -0
- package/esm/typography/index.js +43 -0
- package/esm/typography/index.js.map +7 -0
- package/esm/typography/utils.js +101 -0
- package/esm/typography/utils.js.map +7 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/lang/en.json +6 -0
- package/lang/uncompiled/en.json +6 -1
- package/layouts/Divider/Divider.css +23 -0
- package/layouts/Divider/Divider.d.ts +39 -0
- package/layouts/Divider/Divider.js +67 -0
- package/layouts/Divider/Divider.sty.d.ts +16 -0
- package/layouts/Divider/Divider.sty.js +26 -0
- package/layouts/index.d.ts +2 -0
- package/layouts/index.js +23 -0
- package/package.json +17 -2
- package/styles/textStyle.css +64 -0
- package/styles/textStyle.sty.d.ts +12 -0
- package/styles/textStyle.sty.js +25 -0
- package/testing/mocks/text-ellipsis-mock.d.ts +1 -1
- package/testing/mocks/text-ellipsis-mock.js +8 -3
- package/typography/BlockQuote/Blockquote.css +17 -0
- package/typography/BlockQuote/Blockquote.d.ts +19 -0
- package/typography/BlockQuote/Blockquote.js +62 -0
- package/typography/BlockQuote/Blockquote.sty.d.ts +1 -0
- package/typography/BlockQuote/Blockquote.sty.js +24 -0
- package/typography/Code/Code.css +16 -0
- package/typography/Code/Code.d.ts +17 -0
- package/typography/Code/Code.js +62 -0
- package/typography/Code/Code.sty.d.ts +1 -0
- package/typography/Code/Code.sty.js +24 -0
- package/typography/Emphasis/Emphasis.css +4 -0
- package/typography/Emphasis/Emphasis.d.ts +14 -0
- package/typography/Emphasis/Emphasis.js +62 -0
- package/typography/Emphasis/Emphasis.sty.d.ts +1 -0
- package/typography/Emphasis/Emphasis.sty.js +24 -0
- package/typography/ExternalLink/ExternalLink.css +28 -0
- package/typography/ExternalLink/ExternalLink.d.ts +21 -0
- package/typography/ExternalLink/ExternalLink.js +82 -0
- package/typography/ExternalLink/ExternalLink.sty.d.ts +1 -0
- package/typography/ExternalLink/ExternalLink.sty.js +24 -0
- package/typography/Heading/Heading.css +54 -0
- package/typography/Heading/Heading.d.ts +24 -0
- package/typography/Heading/Heading.js +64 -0
- package/typography/Heading/Heading.sty.d.ts +52 -0
- package/typography/Heading/Heading.sty.js +25 -0
- package/typography/Highlight/Highlight.css +4 -0
- package/typography/Highlight/Highlight.d.ts +27 -0
- package/typography/Highlight/Highlight.js +139 -0
- package/typography/Highlight/Highlight.sty.d.ts +1 -0
- package/typography/Highlight/Highlight.sty.js +24 -0
- package/typography/Link/Link.css +15 -0
- package/typography/Link/Link.d.ts +17 -0
- package/typography/Link/Link.js +75 -0
- package/typography/Link/Link.sty.d.ts +1 -0
- package/typography/Link/Link.sty.js +24 -0
- package/typography/List/List.css +16 -0
- package/typography/List/List.d.ts +39 -0
- package/typography/List/List.js +109 -0
- package/typography/List/List.sty.d.ts +2 -0
- package/typography/List/List.sty.js +26 -0
- package/typography/Paragraph/Paragraph.css +19 -0
- package/typography/Paragraph/Paragraph.d.ts +19 -0
- package/typography/Paragraph/Paragraph.js +77 -0
- package/typography/Paragraph/Paragraph.sty.d.ts +16 -0
- package/typography/Paragraph/Paragraph.sty.js +25 -0
- package/typography/Strikethrough/Strikethrough.css +5 -0
- package/typography/Strikethrough/Strikethrough.d.ts +15 -0
- package/typography/Strikethrough/Strikethrough.js +60 -0
- package/typography/Strikethrough/Strikethrough.sty.d.ts +1 -0
- package/typography/Strikethrough/Strikethrough.sty.js +24 -0
- package/typography/Strong/Strong.css +4 -0
- package/typography/Strong/Strong.d.ts +14 -0
- package/typography/Strong/Strong.js +62 -0
- package/typography/Strong/Strong.sty.d.ts +1 -0
- package/typography/Strong/Strong.sty.js +24 -0
- package/typography/Text/Text.css +18 -0
- package/typography/Text/Text.d.ts +26 -0
- package/typography/Text/Text.js +71 -0
- package/typography/Text/Text.sty.d.ts +16 -0
- package/typography/Text/Text.sty.js +25 -0
- package/typography/TextEllipsis/TextEllipsis.css +22 -0
- package/typography/TextEllipsis/TextEllipsis.d.ts +32 -0
- package/typography/TextEllipsis/TextEllipsis.js +167 -0
- package/typography/TextEllipsis/TextEllipsis.sty.d.ts +15 -0
- package/typography/TextEllipsis/TextEllipsis.sty.js +25 -0
- package/typography/index.d.ts +28 -0
- package/typography/index.js +54 -0
- package/typography/utils.d.ts +52 -0
- package/typography/utils.js +119 -0
|
@@ -17,6 +17,6 @@ export type AppRootProps = PropsWithChildren<DataTestId & StylingProps & Masking
|
|
|
17
17
|
* automatically taken care of and you can start working on your app without
|
|
18
18
|
* further ado.
|
|
19
19
|
*/
|
|
20
|
-
export declare const AppRoot:
|
|
20
|
+
export declare const AppRoot: (props: DataTestId & StylingProps & MaskingProps & {
|
|
21
21
|
children?: React.ReactNode;
|
|
22
|
-
} & React.RefAttributes<HTMLDivElement
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that checks if the initially loaded fonts were updated.
|
|
3
|
+
* Used to trigger remeasuring in the DataTable (autoWidth) and TextEllipsis once all fonts are loaded.
|
|
4
|
+
*
|
|
5
|
+
* @param callback - optionally pass a function to be executed once when the fonts were updated
|
|
6
|
+
* @returns boolean whether the fonts have changed
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function _useFontsUpdated(callback?: () => void): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var useFontsUpdated_exports = {};
|
|
19
|
+
__export(useFontsUpdated_exports, {
|
|
20
|
+
_useFontsUpdated: () => _useFontsUpdated
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(useFontsUpdated_exports);
|
|
23
|
+
var import_lodash_es = require("lodash");
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
function _useFontsUpdated(callback) {
|
|
26
|
+
const [fontsUpdated, setFontsUpdated] = (0, import_react.useState)(false);
|
|
27
|
+
const prevFontFamilies = (0, import_react.useRef)();
|
|
28
|
+
const fontFamilies = [];
|
|
29
|
+
const firstRender = (0, import_react.useRef)(true);
|
|
30
|
+
if (document.fonts) {
|
|
31
|
+
if (firstRender.current) {
|
|
32
|
+
const loadedFontFamilies = [];
|
|
33
|
+
document.fonts.forEach(
|
|
34
|
+
(fontFace) => loadedFontFamilies.push(`${fontFace.family} ${fontFace.weight}`)
|
|
35
|
+
);
|
|
36
|
+
prevFontFamilies.current = loadedFontFamilies;
|
|
37
|
+
firstRender.current = false;
|
|
38
|
+
}
|
|
39
|
+
document.fonts.ready.then((fontFaceSet) => {
|
|
40
|
+
fontFaceSet.forEach(
|
|
41
|
+
(fontFace) => fontFamilies.push(`${fontFace.family} ${fontFace.weight}`)
|
|
42
|
+
);
|
|
43
|
+
if (!(0, import_lodash_es.isEqual)(prevFontFamilies.current, fontFamilies)) {
|
|
44
|
+
prevFontFamilies.current = fontFamilies;
|
|
45
|
+
callback?.();
|
|
46
|
+
setFontsUpdated(true);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return fontsUpdated;
|
|
51
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* If you have multiple references (e.g. from different hooks) you need to apply to
|
|
4
|
+
* the same element, you can use the `useMergeRefs` hook to combine them into one
|
|
5
|
+
* reference.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMergeRefs<T = unknown>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T> | React.Dispatch<React.SetStateAction<T | null>> | undefined>): React.RefCallback<T>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var useMergeRefs_exports = {};
|
|
19
|
+
__export(useMergeRefs_exports, {
|
|
20
|
+
useMergeRefs: () => useMergeRefs
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(useMergeRefs_exports);
|
|
23
|
+
var import_react = require("react");
|
|
24
|
+
function useMergeRefs(refs) {
|
|
25
|
+
return (0, import_react.useCallback)((value) => {
|
|
26
|
+
for (const ref of refs) {
|
|
27
|
+
if (typeof ref === "function") {
|
|
28
|
+
ref(value);
|
|
29
|
+
} else if (ref !== void 0 && ref !== null) {
|
|
30
|
+
ref.current = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, refs);
|
|
34
|
+
}
|
package/core/index.d.ts
CHANGED
|
@@ -15,3 +15,7 @@ export { getLastFocusableChild as _getLastFocusableChild } from './utils/focus-m
|
|
|
15
15
|
export { isFocusable as _isFocusable } from './utils/focus-management/is-focusable.js';
|
|
16
16
|
export { isBrowser as _isBrowser } from './utils/isBrowser.js';
|
|
17
17
|
export { mergeProps as _mergeProps, type NullToObject as _NullToObject, type TupleTypes as _TupleTypes, type UnionToIntersection as _UnionToIntersection, } from './utils/merge-props.js';
|
|
18
|
+
export type { AriaLabelingProps } from './types/a11y-props.js';
|
|
19
|
+
export type { DOMProps } from './types/dom.js';
|
|
20
|
+
export type { PolymorphicComponentProps, PolymorphProps, PolymorphOwnProps, } from './types/polymorph.js';
|
|
21
|
+
export { type _HeadingLevel, type _HeadingTag } from './types/heading.js';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.focusRing_focusRingCSS__z2r50s3 {
|
|
2
|
+
outline: none;
|
|
3
|
+
}
|
|
4
|
+
.focusRing_focusRingCSS__z2r50s3:focus-visible {
|
|
5
|
+
outline: none;
|
|
6
|
+
}
|
|
7
|
+
.focusRing_focusRingCSS_minimal_true__z2r50s4 {
|
|
8
|
+
border-radius: calc(var(--dt-borders-radius-field-subdued, 4px) / 2);
|
|
9
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--outerShadow__z2r50s0);
|
|
10
|
+
background-color: var(--backgroundColor__z2r50s2);
|
|
11
|
+
}
|
|
12
|
+
.focusRing_focusRingCSS_minimal_false__z2r50s5.focusRing_focusRingCSS_minimal_false__z2r50s5 {
|
|
13
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--outerShadow__z2r50s0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--innerShadow__z2r50s1);
|
|
14
|
+
}
|
|
15
|
+
.focusRing_focusRingCSS_variant_neutral__z2r50s6 {
|
|
16
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-neutral-accent, #545587);
|
|
17
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
18
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
|
|
19
|
+
}
|
|
20
|
+
.focusRing_focusRingCSS_variant_primary__z2r50s7 {
|
|
21
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-primary-accent, #454cc9);
|
|
22
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
23
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
|
|
24
|
+
}
|
|
25
|
+
.focusRing_focusRingCSS_variant_success__z2r50s8 {
|
|
26
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-success-accent, #2c6360);
|
|
27
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-success-default, #cad6d7);
|
|
28
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-success-emphasized, #d4dddf);
|
|
29
|
+
}
|
|
30
|
+
.focusRing_focusRingCSS_variant_warning__z2r50s9 {
|
|
31
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-warning-accent, #805100);
|
|
32
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
33
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
|
|
34
|
+
}
|
|
35
|
+
.focusRing_focusRingCSS_variant_critical__z2r50sa {
|
|
36
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-critical-accent, #b80031);
|
|
37
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
38
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
|
|
39
|
+
}
|
|
40
|
+
.focusRing_focusRingCSS_variant_onAccent__z2r50sb {
|
|
41
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-on-accent-default, #f3f3f7);
|
|
42
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-on-accent-default, #f3f3f7);
|
|
43
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-on-accent-emphasized, #f3f3f733);
|
|
44
|
+
}
|
|
45
|
+
.focusRing_focusRingFocusWithinCSS__z2r50sc:focus-within {
|
|
46
|
+
outline: none;
|
|
47
|
+
:focus-visible {
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.focusRing_focusRingFocusWithinCSS_minimal_true__z2r50sd:focus-within {
|
|
52
|
+
border-radius: calc(var(--dt-borders-radius-field-subdued, 4px) / 2);
|
|
53
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--outerShadow__z2r50s0);
|
|
54
|
+
background-color: var(--backgroundColor__z2r50s2);
|
|
55
|
+
}
|
|
56
|
+
.focusRing_focusRingFocusWithinCSS_minimal_false__z2r50se:focus-within {
|
|
57
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--outerShadow__z2r50s0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--innerShadow__z2r50s1);
|
|
58
|
+
}
|
|
59
|
+
.focusRing_focusRingFocusWithinCSS_variant_neutral__z2r50sf {
|
|
60
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-neutral-accent, #545587);
|
|
61
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
62
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
|
|
63
|
+
}
|
|
64
|
+
.focusRing_focusRingFocusWithinCSS_variant_primary__z2r50sg {
|
|
65
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-primary-accent, #454cc9);
|
|
66
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
67
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
|
|
68
|
+
}
|
|
69
|
+
.focusRing_focusRingFocusWithinCSS_variant_success__z2r50sh {
|
|
70
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-success-accent, #2c6360);
|
|
71
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-success-default, #cad6d7);
|
|
72
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-success-emphasized, #d4dddf);
|
|
73
|
+
}
|
|
74
|
+
.focusRing_focusRingFocusWithinCSS_variant_warning__z2r50si {
|
|
75
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-warning-accent, #805100);
|
|
76
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
77
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
|
|
78
|
+
}
|
|
79
|
+
.focusRing_focusRingFocusWithinCSS_variant_critical__z2r50sj {
|
|
80
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-critical-accent, #b80031);
|
|
81
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
82
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
|
|
83
|
+
}
|
|
84
|
+
.focusRing_focusRingFocusWithinCSS_variant_onAccent__z2r50sk {
|
|
85
|
+
--outerShadow__z2r50s0: var(--dt-colors-border-on-accent-default, #f3f3f7);
|
|
86
|
+
--innerShadow__z2r50s1: var(--dt-colors-border-on-accent-default, #f3f3f7);
|
|
87
|
+
--backgroundColor__z2r50s2: var(--dt-colors-background-field-on-accent-emphasized, #f3f3f733);
|
|
88
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const focusRingCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
minimal: {
|
|
3
|
+
true: {
|
|
4
|
+
borderRadius: string;
|
|
5
|
+
boxShadow: string;
|
|
6
|
+
backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
7
|
+
};
|
|
8
|
+
false: {
|
|
9
|
+
selectors: {
|
|
10
|
+
'&&': {
|
|
11
|
+
boxShadow: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
variant: {
|
|
17
|
+
neutral: {
|
|
18
|
+
vars: {
|
|
19
|
+
[x: string]: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
primary: {
|
|
23
|
+
vars: {
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
success: {
|
|
28
|
+
vars: {
|
|
29
|
+
[x: string]: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
warning: {
|
|
33
|
+
vars: {
|
|
34
|
+
[x: string]: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
critical: {
|
|
38
|
+
vars: {
|
|
39
|
+
[x: string]: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
onAccent: {
|
|
43
|
+
vars: {
|
|
44
|
+
[x: string]: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
export declare const focusRingFocusWithinCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
50
|
+
minimal: {
|
|
51
|
+
true: {
|
|
52
|
+
':focus-within': {
|
|
53
|
+
borderRadius: string;
|
|
54
|
+
boxShadow: string;
|
|
55
|
+
backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
false: {
|
|
59
|
+
':focus-within': {
|
|
60
|
+
boxShadow: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
variant: {
|
|
65
|
+
neutral: {
|
|
66
|
+
vars: {
|
|
67
|
+
[x: string]: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
primary: {
|
|
71
|
+
vars: {
|
|
72
|
+
[x: string]: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
success: {
|
|
76
|
+
vars: {
|
|
77
|
+
[x: string]: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
warning: {
|
|
81
|
+
vars: {
|
|
82
|
+
[x: string]: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
critical: {
|
|
86
|
+
vars: {
|
|
87
|
+
[x: string]: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
onAccent: {
|
|
91
|
+
vars: {
|
|
92
|
+
[x: string]: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var focusRing_css_exports = {};
|
|
19
|
+
__export(focusRing_css_exports, {
|
|
20
|
+
focusRingCSS: () => focusRingCSS,
|
|
21
|
+
focusRingFocusWithinCSS: () => focusRingFocusWithinCSS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(focusRing_css_exports);
|
|
24
|
+
var import_focusRing_css_ts_vanilla = require("./focusRing.css");
|
|
25
|
+
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
26
|
+
var focusRingCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "focusRing_focusRingCSS__z2r50s3", variantClassNames: { minimal: { true: "focusRing_focusRingCSS_minimal_true__z2r50s4", false: "focusRing_focusRingCSS_minimal_false__z2r50s5" }, variant: { neutral: "focusRing_focusRingCSS_variant_neutral__z2r50s6", primary: "focusRing_focusRingCSS_variant_primary__z2r50s7", success: "focusRing_focusRingCSS_variant_success__z2r50s8", warning: "focusRing_focusRingCSS_variant_warning__z2r50s9", critical: "focusRing_focusRingCSS_variant_critical__z2r50sa", onAccent: "focusRing_focusRingCSS_variant_onAccent__z2r50sb" } }, defaultVariants: {}, compoundVariants: [] });
|
|
27
|
+
var focusRingFocusWithinCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "focusRing_focusRingFocusWithinCSS__z2r50sc", variantClassNames: { minimal: { true: "focusRing_focusRingFocusWithinCSS_minimal_true__z2r50sd", false: "focusRing_focusRingFocusWithinCSS_minimal_false__z2r50se" }, variant: { neutral: "focusRing_focusRingFocusWithinCSS_variant_neutral__z2r50sf", primary: "focusRing_focusRingFocusWithinCSS_variant_primary__z2r50sg", success: "focusRing_focusRingFocusWithinCSS_variant_success__z2r50sh", warning: "focusRing_focusRingFocusWithinCSS_variant_warning__z2r50si", critical: "focusRing_focusRingFocusWithinCSS_variant_critical__z2r50sj", onAccent: "focusRing_focusRingFocusWithinCSS_variant_onAccent__z2r50sk" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FocusEvent } from 'react';
|
|
2
|
+
export type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare const variants: readonly ["neutral", "primary", "success", "warning", "critical", "onAccent"];
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type VariantType = (typeof variants)[number];
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type UseFocusRingProps = {
|
|
9
|
+
/**
|
|
10
|
+
* A minimal focus outline is available for smaller content elements like links. This variant is applied when set to true.
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*/
|
|
13
|
+
isMinimal?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not the modality should be ignored, so that the focus ring is also present if users clicks the element (not just by tabbing to it).
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
ignoreModality?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The styling variant of the element.
|
|
21
|
+
* @defaultValue neutral
|
|
22
|
+
*/
|
|
23
|
+
variant?: VariantType;
|
|
24
|
+
/**
|
|
25
|
+
* Apply the focus ring styling if an embedded element gains the focus
|
|
26
|
+
*/
|
|
27
|
+
focusWithin?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the element is disabled. If disabled changes to true, the focus will be removed.
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type FocusRingProps = {
|
|
34
|
+
/** The focus styles that depend on modality. */
|
|
35
|
+
focusClassName: string;
|
|
36
|
+
/** Focus handlers used to manage the focus state. Must be applied to the element that receives the focus.*/
|
|
37
|
+
focusProps: {
|
|
38
|
+
onFocus: (e: FocusEvent) => void;
|
|
39
|
+
onBlur: (e: FocusEvent) => void;
|
|
40
|
+
};
|
|
41
|
+
/** Whether or not the element got focus via keyboard. */
|
|
42
|
+
isFocusVisible: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Custom hook used to determine focus styling depending on modality.
|
|
46
|
+
* Returns the css classes (vanilla) that can be applied to the component in order to show the correct focus outline.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function useFocusRing(props?: UseFocusRingProps): FocusRingProps;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var useFocusRing_exports = {};
|
|
19
|
+
__export(useFocusRing_exports, {
|
|
20
|
+
useFocusRing: () => useFocusRing,
|
|
21
|
+
variants: () => variants
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useFocusRing_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
var import_focusRing_css = require("./focusRing.sty.js");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const variants = [
|
|
28
|
+
"neutral",
|
|
29
|
+
"primary",
|
|
30
|
+
"success",
|
|
31
|
+
"warning",
|
|
32
|
+
"critical",
|
|
33
|
+
"onAccent"
|
|
34
|
+
];
|
|
35
|
+
function useFocusRing(props = {}) {
|
|
36
|
+
const {
|
|
37
|
+
variant = "neutral",
|
|
38
|
+
ignoreModality = false,
|
|
39
|
+
isMinimal = false,
|
|
40
|
+
focusWithin = false,
|
|
41
|
+
disabled = false
|
|
42
|
+
} = props;
|
|
43
|
+
const [isFocused, setIsFocused] = (0, import_react.useState)(false);
|
|
44
|
+
const { modality } = (0, import__._useFocusContext)();
|
|
45
|
+
(0, import_react.useEffect)(() => {
|
|
46
|
+
if (disabled) {
|
|
47
|
+
setIsFocused(false);
|
|
48
|
+
}
|
|
49
|
+
}, [disabled]);
|
|
50
|
+
const onBlur = (0, import_react.useCallback)((e) => {
|
|
51
|
+
if (e.currentTarget === e.target) {
|
|
52
|
+
setIsFocused(false);
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
55
|
+
const onFocus = (0, import_react.useCallback)((e) => {
|
|
56
|
+
if (e.currentTarget === e.target) {
|
|
57
|
+
setIsFocused(true);
|
|
58
|
+
}
|
|
59
|
+
}, []);
|
|
60
|
+
const focusProps = {
|
|
61
|
+
onFocus,
|
|
62
|
+
onBlur
|
|
63
|
+
};
|
|
64
|
+
if ((ignoreModality || modality === "keyboard") && isFocused || focusWithin) {
|
|
65
|
+
if (isMinimal) {
|
|
66
|
+
return {
|
|
67
|
+
focusClassName: focusWithin ? (0, import_focusRing_css.focusRingFocusWithinCSS)({ minimal: true, variant }) : (0, import_focusRing_css.focusRingCSS)({ minimal: true, variant }),
|
|
68
|
+
isFocusVisible: !focusWithin,
|
|
69
|
+
focusProps
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
focusClassName: focusWithin ? (0, import_focusRing_css.focusRingFocusWithinCSS)({ minimal: false, variant }) : (0, import_focusRing_css.focusRingCSS)({ minimal: false, variant }),
|
|
74
|
+
isFocusVisible: !focusWithin,
|
|
75
|
+
focusProps
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
focusClassName: focusWithin ? (0, import_focusRing_css.focusRingFocusWithinCSS)() : (0, import_focusRing_css.focusRingCSS)(),
|
|
80
|
+
isFocusVisible: false,
|
|
81
|
+
focusProps
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AriaAttributes } from 'react';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface AriaLabelingProps {
|
|
4
|
+
/** Labels the current element. */
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
/** Identifies the element (or elements) that label(s) the current element. */
|
|
7
|
+
'aria-labelledby'?: string;
|
|
8
|
+
/** Identifies the element (or elements) that describe(s) the object. */
|
|
9
|
+
'aria-describedby'?: string;
|
|
10
|
+
/** Identifies the element (or elements) that provide(s) a detailed, extended description for the object. */
|
|
11
|
+
'aria-details'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type AriaDisabledProps = {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the element and all focusable descendants are disabled.
|
|
16
|
+
* `aria-disabled="true"` only semantically exposes these elements as being disabled.
|
|
17
|
+
*/
|
|
18
|
+
'aria-disabled'?: AriaAttributes['aria-disabled'];
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var a11y_props_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(a11y_props_exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AriaAttributes, AriaRole, CSSProperties, DOMAttributes as ReactDOMAttributes } from 'react';
|
|
2
|
+
import type { FocusableElement } from './focusable-element.js';
|
|
3
|
+
export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, ReactDOMAttributes<T> {
|
|
4
|
+
id?: string | undefined;
|
|
5
|
+
role?: AriaRole | undefined;
|
|
6
|
+
tabIndex?: number | undefined;
|
|
7
|
+
style?: CSSProperties | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The props of a DOM Element.
|
|
12
|
+
* @public
|
|
13
|
+
* */
|
|
14
|
+
export interface DOMProps {
|
|
15
|
+
/**
|
|
16
|
+
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var dom_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(dom_exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var focusable_element_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(focusable_element_exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var heading_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(heading_exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps, ElementType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* Props type to use with your own to add the as polymorphing prop */
|
|
5
|
+
export type PolymorphOwnProps<E extends ElementType = ElementType> = {
|
|
6
|
+
/**
|
|
7
|
+
* The element type / component used to render
|
|
8
|
+
* e.g. when `a` is used an anchor tag is created and the component
|
|
9
|
+
* accepts all props a native anchor also accepts, e.g. a `href` tag.
|
|
10
|
+
* Custom components with their own props are also supported, e.g. a `Link`
|
|
11
|
+
* from a router.
|
|
12
|
+
*/
|
|
13
|
+
as?: E;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
* Combine the props that come from the underlying ElementType and from your own types and omit naming duplicates */
|
|
18
|
+
export type PolymorphProps<E extends ElementType> = PolymorphOwnProps<E> & Omit<ComponentProps<E>, keyof PolymorphOwnProps>;
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
* Uniontype for the elementtypes polymorph props and your own props P */
|
|
22
|
+
export type PolymorphicComponentProps<E extends ElementType, P> = P & PolymorphProps<E>;
|
|
23
|
+
declare module 'react' {
|
|
24
|
+
function forwardRef<T, P = unknown>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var polymorph_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(polymorph_exports);
|