@dynatrace/strato-components 1.6.0 → 1.6.2
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/buttons/button/Button.css +16 -16
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/button/Label.js +2 -2
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.js +2 -2
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +2 -2
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +6 -6
- package/content/skeleton/Skeleton.sty.js +1 -1
- package/core/components/focus-scope/FocusScope.js +1 -1
- package/core/contexts/FocusContext.d.ts +1 -0
- package/core/contexts/FocusContext.js +2 -1
- package/core/index.d.ts +2 -1
- package/core/index.js +3 -1
- package/core/providers/FocusProvider.js +30 -4
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.js +2 -2
- package/core/utils/can-receive-default-text-format.d.ts +9 -0
- package/core/utils/can-receive-default-text-format.js +31 -0
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/core/utils/get-inert-value.d.ts +8 -0
- package/core/utils/get-inert-value.js +31 -0
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/buttons/button/Label.js +2 -2
- package/esm/buttons/button/Label.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.js +2 -2
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.js +2 -2
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +6 -6
- package/esm/content/skeleton/Skeleton.sty.js +1 -1
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/core/components/focus-scope/FocusScope.js +1 -1
- package/esm/core/components/focus-scope/FocusScope.js.map +2 -2
- package/esm/core/contexts/FocusContext.js +2 -1
- package/esm/core/contexts/FocusContext.js.map +2 -2
- package/esm/core/index.js +3 -1
- package/esm/core/index.js.map +2 -2
- package/esm/core/providers/FocusProvider.js +31 -5
- package/esm/core/providers/FocusProvider.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/utils/can-receive-default-text-format.js +15 -0
- package/esm/core/utils/can-receive-default-text-format.js.map +7 -0
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/core/utils/get-inert-value.js +12 -0
- package/esm/core/utils/get-inert-value.js.map +7 -0
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +1 -1
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +1 -1
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +1 -1
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -6
- package/esm/typography/external-link/ExternalLink.sty.js +1 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +1 -1
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/link/Link.css +4 -4
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +1 -1
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +6 -6
- package/typography/external-link/ExternalLink.sty.js +1 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +1 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/link/Link.css +4 -4
- package/typography/link/Link.sty.js +1 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@keyframes _1a1ozfd0-1-6-
|
|
1
|
+
@keyframes _1a1ozfd0-1-6-2 {
|
|
2
2
|
0% {
|
|
3
3
|
transform: translateX(-100%) scaleX(0);
|
|
4
4
|
}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
transform: translateX(100%) scaleX(1.5);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
._1a1ozfd1-1-6-
|
|
9
|
+
._1a1ozfd1-1-6-2 {
|
|
10
10
|
position: relative;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
background-color: var(--dt-colors-background-field-neutral-disabled, #dadbe780);
|
|
13
13
|
}
|
|
14
|
-
._1a1ozfd1-1-6-
|
|
14
|
+
._1a1ozfd1-1-6-2:after {
|
|
15
15
|
content: "";
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 0;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
background-color: var(--dt-colors-background-field-neutral-disabled, #dadbe780);
|
|
22
22
|
animation-iteration-count: infinite;
|
|
23
23
|
transform-origin: left center;
|
|
24
|
-
animation-name: _1a1ozfd0-1-6-
|
|
24
|
+
animation-name: _1a1ozfd0-1-6-2;
|
|
25
25
|
animation-duration: var(--dt-timings-slow-gentle, 800ms);
|
|
26
26
|
animation-timing-function: var(--dt-easings-fast-in-slow-out, cubic-bezier(0.4, 0, 0.2, 1));
|
|
27
27
|
}
|
|
28
|
-
._1a1ozfd2-1-6-
|
|
28
|
+
._1a1ozfd2-1-6-2 {
|
|
29
29
|
border-radius: var(--dt-borders-radius-container-subdued, 8px);
|
|
30
30
|
}
|
|
31
|
-
._1a1ozfd3-1-6-
|
|
31
|
+
._1a1ozfd3-1-6-2 {
|
|
32
32
|
border-radius: 9999px;
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Skeleton.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var skeletonPlaceholderCSS = _7a468({ defaultClassName: "_1a1ozfd1-1-6-
|
|
3
|
+
var skeletonPlaceholderCSS = _7a468({ defaultClassName: "_1a1ozfd1-1-6-2", variantClassNames: { variant: { "default": "_1a1ozfd2-1-6-2", rounded: "_1a1ozfd3-1-6-2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
4
|
export {
|
|
5
5
|
skeletonPlaceholderCSS
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/skeleton/Skeleton.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Skeleton.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var skeletonPlaceholderCSS = _7a468({defaultClassName:'_1a1ozfd1-1-6-
|
|
4
|
+
"sourcesContent": ["import './Skeleton.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var skeletonPlaceholderCSS = _7a468({defaultClassName:'_1a1ozfd1-1-6-2',variantClassNames:{variant:{'default':'_1a1ozfd2-1-6-2',rounded:'_1a1ozfd3-1-6-2'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,yBAAyB,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,SAAQ,EAAC,WAAU,mBAAkB,SAAQ,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ const FocusScope = (props) => {
|
|
|
18
18
|
const triggerElementCopy2 = triggerElement.current;
|
|
19
19
|
return () => {
|
|
20
20
|
focusContext.setBackgroundInertness(false);
|
|
21
|
-
|
|
21
|
+
focusContext.focusTriggerElement(triggerElementCopy2);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
if (!autoFocus && !contain) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/core/components/focus-scope/FocusScope.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useRef } from 'react';\n\nimport { useActiveElement } from '../../hooks/useActiveElement.js';\nimport { useFocusContext } from '../../hooks/useFocusContext.js';\nimport type { WithChildren } from '../../types/with-children.js';\nimport { focusFirstDescendant } from '../../utils/focus-management/focus-first-descendant.js';\n\n// #region Types\n\n/**\n * Prop definition of the `FocusScope` component.\n * @public\n */\nexport interface FocusScopeProps extends WithChildren {\n /**\n * If set to true, the focus scope automatically focuses the first focusable element inside.\n * @defaultValue false\n */\n autoFocus?: boolean;\n /**\n * If set to true, the focus scope traps the focus inside.\n * @defaultValue false\n */\n contain?: boolean;\n}\n// #endregion Types\n\n/**\n * The `FocusScope` helps you manage the focus when opening any overlay. If you\n * want to create a custom overlay, you can wrap the content of your overlay in the\n * `FocusScope` to help you make the overlay accessible and handle focus\n * appropriately.\n * @public\n */\nexport const FocusScope = (props: FocusScopeProps) => {\n const { autoFocus, contain, children } = props;\n const focusContext = useFocusContext();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const focusedElement = useActiveElement();\n const triggerElement = useRef(focusedElement);\n\n useEffect(() => {\n if (contain || autoFocus) {\n focusFirstDescendant(wrapperRef.current);\n }\n\n if (contain) {\n focusContext.setBackgroundInertness(true);\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n focusContext.setBackgroundInertness(false);\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { useEffect, useRef } from 'react';\n\nimport { useActiveElement } from '../../hooks/useActiveElement.js';\nimport { useFocusContext } from '../../hooks/useFocusContext.js';\nimport type { WithChildren } from '../../types/with-children.js';\nimport { focusFirstDescendant } from '../../utils/focus-management/focus-first-descendant.js';\n\n// #region Types\n\n/**\n * Prop definition of the `FocusScope` component.\n * @public\n */\nexport interface FocusScopeProps extends WithChildren {\n /**\n * If set to true, the focus scope automatically focuses the first focusable element inside.\n * @defaultValue false\n */\n autoFocus?: boolean;\n /**\n * If set to true, the focus scope traps the focus inside.\n * @defaultValue false\n */\n contain?: boolean;\n}\n// #endregion Types\n\n/**\n * The `FocusScope` helps you manage the focus when opening any overlay. If you\n * want to create a custom overlay, you can wrap the content of your overlay in the\n * `FocusScope` to help you make the overlay accessible and handle focus\n * appropriately.\n * @public\n */\nexport const FocusScope = (props: FocusScopeProps) => {\n const { autoFocus, contain, children } = props;\n const focusContext = useFocusContext();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const focusedElement = useActiveElement();\n const triggerElement = useRef(focusedElement);\n\n useEffect(() => {\n if (contain || autoFocus) {\n focusFirstDescendant(wrapperRef.current);\n }\n\n if (contain) {\n focusContext.setBackgroundInertness(true);\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n focusContext.setBackgroundInertness(false);\n\n focusContext.focusTriggerElement(triggerElementCopy);\n };\n }\n\n if (!autoFocus && !contain) {\n document.addEventListener('keydown', (e) => {\n if (e.key !== 'Tab') {\n return;\n }\n\n if (e.target === triggerElement.current) {\n e.preventDefault();\n focusFirstDescendant(wrapperRef.current);\n }\n });\n }\n\n const triggerElementCopy = triggerElement.current;\n\n return () => {\n // restore focus on trigger when unmounting the focusscope\n triggerElementCopy.focus();\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contain, autoFocus]);\n\n return (\n <div\n style={{ display: 'contents' }}\n ref={wrapperRef}\n aria-labelledby={triggerElement.current.id}\n // Prevents that focus is lost when clicking on non-focusable items inside (atm used in the internal Drawer).\n // Probably worth considering moving that to the focusScope when redoing the overlays.\n // tabIndex={-1}\n >\n {children}\n </div>\n );\n};\n\nFocusScope.displayName = 'FocusScope';\n"],
|
|
5
|
+
"mappings": "AAiFI;AAjFJ,SAAS,WAAW,cAAc;AAElC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,SAAS,4BAA4B;AA6B9B,MAAM,aAAa,CAAC,UAA2B;AACpD,QAAM,EAAE,WAAW,SAAS,SAAS,IAAI;AACzC,QAAM,eAAe,gBAAgB;AACrC,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,iBAAiB,iBAAiB;AACxC,QAAM,iBAAiB,OAAO,cAAc;AAE5C,YAAU,MAAM;AACd,QAAI,WAAW,WAAW;AACxB,2BAAqB,WAAW,OAAO;AAAA,IACzC;AAEA,QAAI,SAAS;AACX,mBAAa,uBAAuB,IAAI;AACxC,YAAMA,sBAAqB,eAAe;AAE1C,aAAO,MAAM;AACX,qBAAa,uBAAuB,KAAK;AAEzC,qBAAa,oBAAoBA,mBAAkB;AAAA,MACrD;AAAA,IACF;AAEA,QAAI,CAAC,aAAa,CAAC,SAAS;AAC1B,eAAS,iBAAiB,WAAW,CAAC,MAAM;AAC1C,YAAI,EAAE,QAAQ,OAAO;AACnB;AAAA,QACF;AAEA,YAAI,EAAE,WAAW,eAAe,SAAS;AACvC,YAAE,eAAe;AACjB,+BAAqB,WAAW,OAAO;AAAA,QACzC;AAAA,MACF,CAAC;AAAA,IACH;AAEA,UAAM,qBAAqB,eAAe;AAE1C,WAAO,MAAM;AAEX,yBAAmB,MAAM;AAAA,IAC3B;AAAA,EAGF,GAAG,CAAC,SAAS,SAAS,CAAC;AAEvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,SAAS,WAAW;AAAA,MAC7B,KAAK;AAAA,MACL,mBAAiB,eAAe,QAAQ;AAAA,MAKvC;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;",
|
|
6
6
|
"names": ["triggerElementCopy"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,8 @@ import { createContext } from "react";
|
|
|
2
2
|
const FocusContext = createContext({
|
|
3
3
|
modality: "unknown",
|
|
4
4
|
backgroundInertness: void 0,
|
|
5
|
-
setBackgroundInertness: (value) => null
|
|
5
|
+
setBackgroundInertness: (value) => null,
|
|
6
|
+
focusTriggerElement: (value) => null
|
|
6
7
|
});
|
|
7
8
|
export {
|
|
8
9
|
FocusContext
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/contexts/FocusContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react';\n\nimport type { Modality } from '../providers/FocusProvider.js';\n\n/**\n * Defines the contents of the FocusContext.\n * @internal\n */\nexport type FocusContextProps = {\n backgroundInertness?: boolean;\n modality: Modality;\n setBackgroundInertness: (value: boolean) => void;\n};\n\n/**\n * This context keeps all information needed for proper focus management.\n * @param modality - currently used pointer device\n * @param backgroundInertness - if the background (behind overlays) is currently inert (inactive)\n * @param setBackgroundInertness - updates the backgrounds active status\n * @internal\n */\nexport const FocusContext = createContext<FocusContextProps>({\n modality: 'unknown',\n backgroundInertness: undefined,\n setBackgroundInertness: (value) => null,\n});\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,qBAAqB;
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\n\nimport type { Modality } from '../providers/FocusProvider.js';\n\n/**\n * Defines the contents of the FocusContext.\n * @internal\n */\nexport type FocusContextProps = {\n backgroundInertness?: boolean;\n modality: Modality;\n setBackgroundInertness: (value: boolean) => void;\n focusTriggerElement: (value: HTMLElement | undefined) => void;\n};\n\n/**\n * This context keeps all information needed for proper focus management.\n * @param modality - currently used pointer device\n * @param backgroundInertness - if the background (behind overlays) is currently inert (inactive)\n * @param setBackgroundInertness - updates the backgrounds active status\n * @internal\n */\nexport const FocusContext = createContext<FocusContextProps>({\n modality: 'unknown',\n backgroundInertness: undefined,\n setBackgroundInertness: (value) => null,\n focusTriggerElement: (value) => null,\n});\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAsBvB,MAAM,eAAe,cAAiC;AAAA,EAC3D,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,wBAAwB,CAAC,UAAU;AAAA,EACnC,qBAAqB,CAAC,UAAU;AAClC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esm/core/index.js
CHANGED
|
@@ -16,10 +16,11 @@ import { isBrowser } from "./utils/isBrowser.js";
|
|
|
16
16
|
import {
|
|
17
17
|
mergeProps
|
|
18
18
|
} from "./utils/merge-props.js";
|
|
19
|
-
import { useAriaLabelingProps } from "./hooks/useAriaLabelingProps.js";
|
|
20
19
|
import { useId } from "./hooks/useId.js";
|
|
20
|
+
import { useAriaLabelingProps } from "./hooks/useAriaLabelingProps.js";
|
|
21
21
|
import { useSafeForwardProps } from "./hooks/useSafeForwardProps.js";
|
|
22
22
|
import { uuidv4 } from "./utils/uuidv4.js";
|
|
23
|
+
import { canReceiveDefaultTextFormat } from "./utils/can-receive-default-text-format.js";
|
|
23
24
|
import { isStringChildren } from "./utils/_is-string-children.js";
|
|
24
25
|
import { parseBoolean } from "./utils/parse-boolean.js";
|
|
25
26
|
import { mulberry32 } from "./utils/seed-random.js";
|
|
@@ -28,6 +29,7 @@ export {
|
|
|
28
29
|
FocusScope,
|
|
29
30
|
FocusProvider as _FocusProvider,
|
|
30
31
|
attemptFocus as _attemptFocus,
|
|
32
|
+
canReceiveDefaultTextFormat as _canReceiveDefaultTextFormat,
|
|
31
33
|
focusFirstDescendant as _focusFirstDescendant,
|
|
32
34
|
getFirstFocusableChild as _getFirstFocusableChild,
|
|
33
35
|
getLastFocusableChild as _getLastFocusableChild,
|
package/esm/core/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/core/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { AppRoot, type AppRootProps } from './components/app-root/AppRoot.js';\nexport {\n FocusScope,\n type FocusScopeProps,\n} from './components/focus-scope/FocusScope.js';\n\nexport { type FocusContextProps as _FocusContextProps } from './contexts/FocusContext.js';\n\nexport { useCurrentTheme } from './hooks/useCurrentTheme.js';\nexport { useFocusContext as _useFocusContext } from './hooks/useFocusContext.js';\nexport {\n FocusProvider as _FocusProvider,\n type Modality as _Modality,\n} from './providers/FocusProvider.js';\nexport type { MaskingProps } from './types/masking-props.js';\nexport type { DataTestId } from './types/data-props.js';\nexport type { StylingProps } from './types/styling-props.js';\nexport type { WithChildren } from './types/with-children.js';\nexport type {\n PolymorphOwnProps,\n PolymorphProps,\n PolymorphicComponentProps,\n} from './types/polymorph.js';\nexport { attemptFocus as _attemptFocus } from './utils/focus-management/attempt-focus.js';\nexport { focusFirstDescendant as _focusFirstDescendant } from './utils/focus-management/focus-first-descendant.js';\nexport { getFirstFocusableChild as _getFirstFocusableChild } from './utils/focus-management/get-first-focusable-child.js';\nexport { getLastFocusableChild as _getLastFocusableChild } from './utils/focus-management/get-last-focusable-child.js';\nexport { isFocusable as _isFocusable } from './utils/focus-management/is-focusable.js';\nexport { isBrowser as _isBrowser } from './utils/isBrowser.js';\nexport {\n mergeProps as _mergeProps,\n type NullToObject as _NullToObject,\n type TupleTypes as _TupleTypes,\n type UnionToIntersection as _UnionToIntersection,\n} from './utils/merge-props.js';\nexport { type _HeadingLevel, type _HeadingTag } from './types/heading.js';\nexport {
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EACmB;AAAA,OAEZ;AAUP,SAAyB,oBAAqB;AAC9C,SAAiC,4BAA6B;AAC9D,SAAmC,8BAA+B;AAClE,SAAkC,6BAA8B;AAChE,SAAwB,mBAAoB;AAC5C,SAAsB,iBAAkB;AACxC;AAAA,EACgB;AAAA,OAIT;AAEP,SAAiC,4BAA6B;AAC9D,
|
|
4
|
+
"sourcesContent": ["export { AppRoot, type AppRootProps } from './components/app-root/AppRoot.js';\nexport {\n FocusScope,\n type FocusScopeProps,\n} from './components/focus-scope/FocusScope.js';\n\nexport { type FocusContextProps as _FocusContextProps } from './contexts/FocusContext.js';\n\nexport { useCurrentTheme } from './hooks/useCurrentTheme.js';\nexport { useFocusContext as _useFocusContext } from './hooks/useFocusContext.js';\nexport {\n FocusProvider as _FocusProvider,\n type Modality as _Modality,\n} from './providers/FocusProvider.js';\nexport type { MaskingProps } from './types/masking-props.js';\nexport type { DataTestId } from './types/data-props.js';\nexport type { StylingProps } from './types/styling-props.js';\nexport type { WithChildren } from './types/with-children.js';\nexport type {\n PolymorphOwnProps,\n PolymorphProps,\n PolymorphicComponentProps,\n} from './types/polymorph.js';\nexport { attemptFocus as _attemptFocus } from './utils/focus-management/attempt-focus.js';\nexport { focusFirstDescendant as _focusFirstDescendant } from './utils/focus-management/focus-first-descendant.js';\nexport { getFirstFocusableChild as _getFirstFocusableChild } from './utils/focus-management/get-first-focusable-child.js';\nexport { getLastFocusableChild as _getLastFocusableChild } from './utils/focus-management/get-last-focusable-child.js';\nexport { isFocusable as _isFocusable } from './utils/focus-management/is-focusable.js';\nexport { isBrowser as _isBrowser } from './utils/isBrowser.js';\nexport {\n mergeProps as _mergeProps,\n type NullToObject as _NullToObject,\n type TupleTypes as _TupleTypes,\n type UnionToIntersection as _UnionToIntersection,\n} from './utils/merge-props.js';\nexport { type _HeadingLevel, type _HeadingTag } from './types/heading.js';\nexport { useId as _useId } from './hooks/useId.js';\nexport { useAriaLabelingProps as _useAriaLabelingProps } from './hooks/useAriaLabelingProps.js';\nexport { useSafeForwardProps as _useSafeForwardProps } from './hooks/useSafeForwardProps.js';\nexport type { UseSafeForwardReturnProps as _UseSafeForwardReturnProps } from './hooks/useSafeForwardProps.js';\nexport type {\n AriaDisabledProps,\n AriaLabelingProps,\n} from './types/a11y-props.js';\nexport type { DOMProps } from './types/dom.js';\nexport { uuidv4 as _uuidv4 } from './utils/uuidv4.js';\nexport { canReceiveDefaultTextFormat as _canReceiveDefaultTextFormat } from './utils/can-receive-default-text-format.js';\nexport { isStringChildren as _isStringChildren } from './utils/_is-string-children.js';\nexport { parseBoolean as _parseBoolean } from './utils/parse-boolean.js';\nexport { mulberry32 as _mulberry32 } from './utils/seed-random.js';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EACmB;AAAA,OAEZ;AAUP,SAAyB,oBAAqB;AAC9C,SAAiC,4BAA6B;AAC9D,SAAmC,8BAA+B;AAClE,SAAkC,6BAA8B;AAChE,SAAwB,mBAAoB;AAC5C,SAAsB,iBAAkB;AACxC;AAAA,EACgB;AAAA,OAIT;AAEP,SAAkB,aAAc;AAChC,SAAiC,4BAA6B;AAC9D,SAAgC,2BAA4B;AAO5D,SAAmB,cAAe;AAClC,SAAwC,mCAAoC;AAC5E,SAA6B,wBAAyB;AACtD,SAAyB,oBAAqB;AAC9C,SAAuB,kBAAmB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { FocusContext } from "../contexts/FocusContext.js";
|
|
4
4
|
import { useFocusContext } from "../hooks/useFocusContext.js";
|
|
5
|
+
import { getProperInertValue } from "../utils/get-inert-value.js";
|
|
5
6
|
import { mergeProps } from "../utils/merge-props.js";
|
|
6
7
|
const ignoreMap = [
|
|
7
8
|
"Alt",
|
|
8
9
|
"AltGraph",
|
|
9
10
|
"CapsLock",
|
|
10
11
|
"Control",
|
|
11
|
-
"Fn",
|
|
12
12
|
"FnLock",
|
|
13
|
+
"Fn",
|
|
13
14
|
"Hyper",
|
|
14
15
|
"Meta",
|
|
15
16
|
// Command (Mac), in some browsers also Windows-key
|
|
@@ -57,6 +58,7 @@ const FocusProvider = ({ children }) => {
|
|
|
57
58
|
const [backgroundInertness, setBackgroundInertness] = useState(false);
|
|
58
59
|
const focusContext = useFocusContext();
|
|
59
60
|
const [modality, setModality] = useState("unknown");
|
|
61
|
+
const wrapperRef = useRef(null);
|
|
60
62
|
const setKeyboardInputModality = useCallback((event) => {
|
|
61
63
|
if (ignoreMap.includes(event.key)) {
|
|
62
64
|
setModality("pointer");
|
|
@@ -66,6 +68,29 @@ const FocusProvider = ({ children }) => {
|
|
|
66
68
|
setModality("keyboard");
|
|
67
69
|
}
|
|
68
70
|
}, []);
|
|
71
|
+
const focusTriggerElement = useCallback((ref) => {
|
|
72
|
+
if (wrapperRef.current?.getAttribute("inert") === null) {
|
|
73
|
+
ref?.focus();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const observer = new MutationObserver((mutations) => {
|
|
77
|
+
for (const mutation of mutations) {
|
|
78
|
+
if (mutation.type === "attributes" && mutation.attributeName === "inert") {
|
|
79
|
+
if (wrapperRef.current?.getAttribute("inert") === null) {
|
|
80
|
+
ref?.focus();
|
|
81
|
+
observer.disconnect();
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (wrapperRef.current !== null) {
|
|
88
|
+
observer.observe(wrapperRef.current, { attributes: true });
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
observer.disconnect();
|
|
91
|
+
}, 5e3);
|
|
92
|
+
}
|
|
93
|
+
}, []);
|
|
69
94
|
const setMouseInputModality = useCallback((event) => {
|
|
70
95
|
switch (eventTypeMap[event.type]) {
|
|
71
96
|
case "touch":
|
|
@@ -94,7 +119,7 @@ const FocusProvider = ({ children }) => {
|
|
|
94
119
|
};
|
|
95
120
|
}, [setKeyboardInputModality, setMouseInputModality]);
|
|
96
121
|
const focusProps = backgroundInertness ? {
|
|
97
|
-
inert:
|
|
122
|
+
inert: getProperInertValue(true),
|
|
98
123
|
tabIndex: -1,
|
|
99
124
|
"aria-hidden": true
|
|
100
125
|
} : { inert: void 0, tabIndex: void 0, "aria-hidden": false };
|
|
@@ -105,10 +130,11 @@ const FocusProvider = ({ children }) => {
|
|
|
105
130
|
...mergeProps(focusContext, {
|
|
106
131
|
backgroundInertness,
|
|
107
132
|
setBackgroundInertness,
|
|
108
|
-
modality
|
|
133
|
+
modality,
|
|
134
|
+
focusTriggerElement
|
|
109
135
|
})
|
|
110
136
|
},
|
|
111
|
-
children: /* @__PURE__ */ jsx("div", { ...focusProps, children })
|
|
137
|
+
children: /* @__PURE__ */ jsx("div", { ref: wrapperRef, ...focusProps, children })
|
|
112
138
|
}
|
|
113
139
|
);
|
|
114
140
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/providers/FocusProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react';\n\nimport { FocusContext } from '../contexts/FocusContext.js';\nimport { useFocusContext } from '../hooks/useFocusContext.js';\nimport type { WithChildren } from '../types/with-children.js';\nimport { mergeProps } from '../utils/merge-props.js';\n\n// list of modifier keys commonly used in a mouse or keyboard combination,\n// see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#modifier_keys.\nconst ignoreMap = [\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n '
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { FocusContext } from '../contexts/FocusContext.js';\nimport { useFocusContext } from '../hooks/useFocusContext.js';\nimport type { WithChildren } from '../types/with-children.js';\nimport { getProperInertValue } from '../utils/get-inert-value.js';\nimport { mergeProps } from '../utils/merge-props.js';\n\n// list of modifier keys commonly used in a mouse or keyboard combination,\n// see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#modifier_keys.\nconst ignoreMap = [\n 'Alt',\n 'AltGraph',\n 'CapsLock',\n 'Control',\n 'FnLock',\n 'Fn',\n 'Hyper',\n 'Meta', // Command (Mac), in some browsers also Windows-key\n 'NumLock',\n 'OS', // Windows-key\n 'ScrollLock',\n 'Super', // Virtual keyboard key\n 'Symbol',\n 'SymbolLock',\n];\n\n/** Look-up map of all event types and the corresponding modalities. */\nconst eventTypeMap: Record<string, string> = {\n keydown: 'keyboard',\n keyup: 'keyboard',\n mousedown: 'mouse',\n mousemove: 'mouse',\n MSPointerDown: 'pointer',\n MSPointerMove: 'pointer',\n pointerdown: 'pointer',\n pointermove: 'pointer',\n touchstart: 'touch',\n touchend: 'touch',\n wheel: 'wheel',\n};\n\n/**\n * Type defining the modality options for the focus handling.\n * @internal\n */\nexport type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';\n\n/**\n * All navigational keys that should be considered keyboard users,\n * see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#navigation_keys\n */\nconst navigationalKeys = [\n 'Tab',\n 'Esc',\n 'Escape',\n ' ',\n 'ArrowDown',\n 'Down',\n 'ArrowUp',\n 'Up',\n 'ArrowLeft',\n 'Left',\n 'ArrowRight',\n 'Right',\n 'End',\n 'Home',\n 'PageDown',\n 'PageUp',\n];\n\n/**\n * Provider that can be reused in components for storing the focus context props.\n * Loosely inspired by [what-input-js](https://github.com/ten1seven/what-input/blob/main/src/scripts/what-input.js).\n * @internal\n */\nexport const FocusProvider = ({ children }: WithChildren) => {\n const [backgroundInertness, setBackgroundInertness] = useState(false);\n const focusContext = useFocusContext();\n const [modality, setModality] = useState<Modality>('unknown');\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const setKeyboardInputModality = useCallback((event: KeyboardEvent) => {\n if (ignoreMap.includes(event.key)) {\n setModality('pointer');\n return;\n }\n\n if (!event.target || navigationalKeys.includes(event.key)) {\n setModality('keyboard');\n }\n }, []);\n\n const focusTriggerElement = useCallback((ref: HTMLElement | undefined) => {\n if (wrapperRef.current?.getAttribute('inert') === null) {\n ref?.focus();\n return;\n }\n\n // We want to focus the trigger element after the inert prop got removed.\n // Otherwise, we sometimes lose the focus on slow computers.\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'inert'\n ) {\n if (wrapperRef.current?.getAttribute('inert') === null) {\n ref?.focus();\n observer.disconnect();\n break;\n }\n }\n }\n });\n\n if (wrapperRef.current !== null) {\n observer.observe(wrapperRef.current, { attributes: true });\n\n setTimeout(() => {\n observer.disconnect();\n }, 5000);\n }\n }, []);\n\n const setMouseInputModality = useCallback((event: MouseEvent) => {\n switch (eventTypeMap[event.type]) {\n case 'touch':\n case 'pen':\n return setModality('touch');\n case 'mouse':\n case 'pointer':\n case 'wheel':\n return setModality('pointer');\n default:\n return 'unknown';\n }\n }, []);\n\n useEffect(() => {\n window.addEventListener('pointerdown', setMouseInputModality);\n // we need to rely on the keydown event (already in the capture phase) here so we don't break usages where the event default behavior is prevented or propagation is stopped,\n // which would otherwise get the wrong, initial, modality (unknown); by using the capture phase, we can ensure we set the modality correctly before the other events occur\n window.addEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.addEventListener('wheel', setMouseInputModality);\n\n return () => {\n window.removeEventListener('pointerdown', setMouseInputModality);\n window.removeEventListener('keydown', setKeyboardInputModality, {\n capture: true,\n });\n window.removeEventListener('wheel', setMouseInputModality);\n };\n }, [setKeyboardInputModality, setMouseInputModality]);\n\n const focusProps = backgroundInertness\n ? {\n inert: getProperInertValue(true),\n tabIndex: -1,\n 'aria-hidden': true,\n }\n : { inert: undefined, tabIndex: undefined, 'aria-hidden': false };\n\n return (\n <FocusContext.Provider\n value={{\n ...mergeProps(focusContext, {\n backgroundInertness,\n setBackgroundInertness,\n modality,\n focusTriggerElement,\n }),\n }}\n >\n <div ref={wrapperRef} {...focusProps}>\n {children}\n </div>\n </FocusContext.Provider>\n );\n};\n\nFocusProvider['displayName'] = 'FocusProvider';\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
._z2r50s3-1-6-
|
|
1
|
+
._z2r50s3-1-6-2 {
|
|
2
2
|
outline: none;
|
|
3
3
|
}
|
|
4
|
-
._z2r50s3-1-6-
|
|
4
|
+
._z2r50s3-1-6-2:focus-visible {
|
|
5
5
|
outline: none;
|
|
6
6
|
}
|
|
7
|
-
._z2r50s4-1-6-
|
|
7
|
+
._z2r50s4-1-6-2 {
|
|
8
8
|
border-radius: var(--dt-borders-radius-field-subdued, 4px);
|
|
9
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-
|
|
10
|
-
background-color: var(--_z2r50s2-1-6-
|
|
11
|
-
}
|
|
12
|
-
._z2r50s5-1-6-
|
|
13
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-
|
|
14
|
-
}
|
|
15
|
-
._z2r50s6-1-6-
|
|
16
|
-
--_z2r50s0-1-6-
|
|
17
|
-
--_z2r50s1-1-6-
|
|
18
|
-
--_z2r50s2-1-6-
|
|
19
|
-
}
|
|
20
|
-
._z2r50s7-1-6-
|
|
21
|
-
--_z2r50s0-1-6-
|
|
22
|
-
--_z2r50s1-1-6-
|
|
23
|
-
--_z2r50s2-1-6-
|
|
24
|
-
}
|
|
25
|
-
._z2r50s8-1-6-
|
|
26
|
-
--_z2r50s0-1-6-
|
|
27
|
-
--_z2r50s1-1-6-
|
|
28
|
-
--_z2r50s2-1-6-
|
|
29
|
-
}
|
|
30
|
-
._z2r50s9-1-6-
|
|
31
|
-
--_z2r50s0-1-6-
|
|
32
|
-
--_z2r50s1-1-6-
|
|
33
|
-
--_z2r50s2-1-6-
|
|
34
|
-
}
|
|
35
|
-
._z2r50sa-1-6-
|
|
36
|
-
--_z2r50s0-1-6-
|
|
37
|
-
--_z2r50s1-1-6-
|
|
38
|
-
--_z2r50s2-1-6-
|
|
39
|
-
}
|
|
40
|
-
._z2r50sb-1-6-
|
|
9
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-2);
|
|
10
|
+
background-color: var(--_z2r50s2-1-6-2);
|
|
11
|
+
}
|
|
12
|
+
._z2r50s5-1-6-2._z2r50s5-1-6-2 {
|
|
13
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-2), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-6-2);
|
|
14
|
+
}
|
|
15
|
+
._z2r50s6-1-6-2 {
|
|
16
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-neutral-accent, #545587);
|
|
17
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
18
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
|
|
19
|
+
}
|
|
20
|
+
._z2r50s7-1-6-2 {
|
|
21
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-primary-accent, #454cc9);
|
|
22
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
23
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
|
|
24
|
+
}
|
|
25
|
+
._z2r50s8-1-6-2 {
|
|
26
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-success-accent, #2c6360);
|
|
27
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-success-default, #cad6d7);
|
|
28
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-success-emphasized, #d4dddf);
|
|
29
|
+
}
|
|
30
|
+
._z2r50s9-1-6-2 {
|
|
31
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-warning-accent, #805100);
|
|
32
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
33
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
|
|
34
|
+
}
|
|
35
|
+
._z2r50sa-1-6-2 {
|
|
36
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-critical-accent, #b80031);
|
|
37
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
38
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
|
|
39
|
+
}
|
|
40
|
+
._z2r50sb-1-6-2:focus-within {
|
|
41
41
|
outline: none;
|
|
42
42
|
}
|
|
43
|
-
._z2r50sc-1-6-
|
|
43
|
+
._z2r50sc-1-6-2:focus-within {
|
|
44
44
|
border-radius: var(--dt-borders-radius-field-subdued, 4px);
|
|
45
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-
|
|
46
|
-
background-color: var(--_z2r50s2-1-6-
|
|
47
|
-
}
|
|
48
|
-
._z2r50sd-1-6-
|
|
49
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-
|
|
50
|
-
}
|
|
51
|
-
._z2r50se-1-6-
|
|
52
|
-
--_z2r50s0-1-6-
|
|
53
|
-
--_z2r50s1-1-6-
|
|
54
|
-
--_z2r50s2-1-6-
|
|
55
|
-
}
|
|
56
|
-
._z2r50sf-1-6-
|
|
57
|
-
--_z2r50s0-1-6-
|
|
58
|
-
--_z2r50s1-1-6-
|
|
59
|
-
--_z2r50s2-1-6-
|
|
60
|
-
}
|
|
61
|
-
._z2r50sg-1-6-
|
|
62
|
-
--_z2r50s0-1-6-
|
|
63
|
-
--_z2r50s1-1-6-
|
|
64
|
-
--_z2r50s2-1-6-
|
|
65
|
-
}
|
|
66
|
-
._z2r50sh-1-6-
|
|
67
|
-
--_z2r50s0-1-6-
|
|
68
|
-
--_z2r50s1-1-6-
|
|
69
|
-
--_z2r50s2-1-6-
|
|
70
|
-
}
|
|
71
|
-
._z2r50si-1-6-
|
|
72
|
-
--_z2r50s0-1-6-
|
|
73
|
-
--_z2r50s1-1-6-
|
|
74
|
-
--_z2r50s2-1-6-
|
|
45
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-6-2);
|
|
46
|
+
background-color: var(--_z2r50s2-1-6-2);
|
|
47
|
+
}
|
|
48
|
+
._z2r50sd-1-6-2:focus-within {
|
|
49
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-6-2), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-6-2);
|
|
50
|
+
}
|
|
51
|
+
._z2r50se-1-6-2 {
|
|
52
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-neutral-accent, #545587);
|
|
53
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
54
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-neutral-emphasized, #dadbe7);
|
|
55
|
+
}
|
|
56
|
+
._z2r50sf-1-6-2 {
|
|
57
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-primary-accent, #454cc9);
|
|
58
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
59
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-primary-emphasized, #d6dbf4);
|
|
60
|
+
}
|
|
61
|
+
._z2r50sg-1-6-2 {
|
|
62
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-success-accent, #2c6360);
|
|
63
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-success-default, #cad6d7);
|
|
64
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-success-emphasized, #d4dddf);
|
|
65
|
+
}
|
|
66
|
+
._z2r50sh-1-6-2 {
|
|
67
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-warning-accent, #805100);
|
|
68
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
69
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-warning-emphasized, #f4e8de);
|
|
70
|
+
}
|
|
71
|
+
._z2r50si-1-6-2 {
|
|
72
|
+
--_z2r50s0-1-6-2: var(--dt-colors-border-critical-accent, #b80031);
|
|
73
|
+
--_z2r50s1-1-6-2: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
74
|
+
--_z2r50s2-1-6-2: var(--dt-colors-background-field-critical-emphasized, #f2d7d9);
|
|
75
75
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./focusRing.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-6-
|
|
4
|
-
var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-6-
|
|
3
|
+
var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-6-2", variantClassNames: { minimal: { true: "_z2r50s4-1-6-2", false: "_z2r50s5-1-6-2" }, variant: { neutral: "_z2r50s6-1-6-2", primary: "_z2r50s7-1-6-2", success: "_z2r50s8-1-6-2", warning: "_z2r50s9-1-6-2", critical: "_z2r50sa-1-6-2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-6-2", variantClassNames: { minimal: { true: "_z2r50sc-1-6-2", false: "_z2r50sd-1-6-2" }, variant: { neutral: "_z2r50se-1-6-2", primary: "_z2r50sf-1-6-2", success: "_z2r50sg-1-6-2", warning: "_z2r50sh-1-6-2", critical: "_z2r50si-1-6-2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5
5
|
export {
|
|
6
6
|
focusRingCSS,
|
|
7
7
|
focusRingFocusWithinCSS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/styles/focusRing.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-6-
|
|
4
|
+
"sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-6-2',variantClassNames:{minimal:{true:'_z2r50s4-1-6-2',false:'_z2r50s5-1-6-2'},variant:{neutral:'_z2r50s6-1-6-2',primary:'_z2r50s7-1-6-2',success:'_z2r50s8-1-6-2',warning:'_z2r50s9-1-6-2',critical:'_z2r50sa-1-6-2'}},defaultVariants:{},compoundVariants:[]});\nexport var focusRingFocusWithinCSS = _7a468({defaultClassName:'_z2r50sb-1-6-2',variantClassNames:{minimal:{true:'_z2r50sc-1-6-2',false:'_z2r50sd-1-6-2'},variant:{neutral:'_z2r50se-1-6-2',primary:'_z2r50sf-1-6-2',success:'_z2r50sg-1-6-2',warning:'_z2r50sh-1-6-2',critical:'_z2r50si-1-6-2'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,kBAAiB,OAAM,iBAAgB,GAAE,SAAQ,EAAC,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,UAAS,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACvT,IAAI,0BAA0B,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,kBAAiB,OAAM,iBAAgB,GAAE,SAAQ,EAAC,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,SAAQ,kBAAiB,UAAS,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
isValidElement
|
|
4
|
+
} from "react";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
function canReceiveDefaultTextFormat(children) {
|
|
7
|
+
const childrenArray = Children.toArray(children);
|
|
8
|
+
return childrenArray.every(
|
|
9
|
+
(child) => typeof child === "string" || typeof child === "number" || typeof child === "boolean" || child === null || child === void 0 || isValidElement(child) && child.type && child.type === FormattedMessage
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
canReceiveDefaultTextFormat
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=can-receive-default-text-format.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/utils/can-receive-default-text-format.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type ReactElement,\n type ReactNode,\n Children,\n isValidElement,\n} from 'react';\nimport { FormattedMessage, type MessageDescriptor } from 'react-intl';\n\n/**\n * Returns whether children only consists of stringifiable children, that can receive standard text formatting.\n * @internal\n */\nexport function canReceiveDefaultTextFormat(children: ReactNode): children is\n | string\n | number\n | boolean\n | null\n | undefined\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | ReactElement<MessageDescriptor & { values: Record<string, any> }> {\n const childrenArray = Children.toArray(children);\n\n return childrenArray.every(\n (child) =>\n typeof child === 'string' ||\n typeof child === 'number' ||\n typeof child === 'boolean' ||\n child === null ||\n child === undefined ||\n (isValidElement(child) && child.type && child.type === FormattedMessage),\n );\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAgD;AAMlD,SAAS,4BAA4B,UAO0B;AACpE,QAAM,gBAAgB,SAAS,QAAQ,QAAQ;AAE/C,SAAO,cAAc;AAAA,IACnB,CAAC,UACC,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU,aACjB,UAAU,QACV,UAAU,UACT,eAAe,KAAK,KAAK,MAAM,QAAQ,MAAM,SAAS;AAAA,EAC3D;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|