@dynatrace/strato-components 0.84.31 → 0.84.51
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/content/index.d.ts +7 -0
- package/content/index.js +25 -0
- package/content/progress/ProgressBar.css +52 -0
- package/content/progress/ProgressBar.d.ts +56 -0
- package/content/progress/ProgressBar.js +191 -0
- package/content/progress/ProgressBar.sty.d.ts +42 -0
- package/content/progress/ProgressBar.sty.js +28 -0
- package/content/progress/ProgressBarIcon.css +5 -0
- package/content/progress/ProgressBarIcon.d.ts +15 -0
- package/content/progress/ProgressBarIcon.js +68 -0
- package/content/progress/ProgressBarIcon.sty.d.ts +1 -0
- package/content/progress/ProgressBarIcon.sty.js +25 -0
- package/content/progress/ProgressBarLabel.css +9 -0
- package/content/progress/ProgressBarLabel.d.ts +15 -0
- package/content/progress/ProgressBarLabel.js +75 -0
- package/content/progress/ProgressBarLabel.sty.d.ts +13 -0
- package/content/progress/ProgressBarLabel.sty.js +26 -0
- package/content/progress/ProgressBarValue.css +28 -0
- package/content/progress/ProgressBarValue.d.ts +15 -0
- package/content/progress/ProgressBarValue.js +72 -0
- package/content/progress/ProgressBarValue.sty.d.ts +34 -0
- package/content/progress/ProgressBarValue.sty.js +26 -0
- package/content/progress/ProgressCircle.css +52 -0
- package/content/progress/ProgressCircle.d.ts +51 -0
- package/content/progress/ProgressCircle.js +174 -0
- package/content/progress/ProgressCircle.sty.d.ts +41 -0
- package/content/progress/ProgressCircle.sty.js +37 -0
- package/content/progress/contexts/SharedProgressBarPropsContext.d.ts +9 -0
- package/content/progress/contexts/SharedProgressBarPropsContext.js +38 -0
- package/content/progress/hooks/useProgressAriaProps.d.ts +38 -0
- package/content/progress/hooks/useProgressAriaProps.js +63 -0
- package/content/progress/hooks/useProgressBarPropsContext.d.ts +2 -0
- package/content/progress/hooks/useProgressBarPropsContext.js +32 -0
- package/content/progress/utils.d.ts +2 -0
- package/content/progress/utils.js +50 -0
- package/core/components/app-root/AppRoot.d.ts +4 -4
- package/core/hooks/useAriaLabelingProps.d.ts +6 -0
- package/core/hooks/useAriaLabelingProps.js +30 -0
- package/core/hooks/useCurrentTheme.d.ts +1 -1
- package/core/hooks/useFontsUpdated.d.ts +9 -0
- package/core/hooks/useFontsUpdated.js +51 -0
- package/core/hooks/useId.d.ts +12 -0
- package/core/hooks/useId.js +32 -0
- package/core/hooks/useMergeRefs.d.ts +7 -0
- package/core/hooks/useMergeRefs.js +34 -0
- package/core/hooks/useSafeForwardProps.d.ts +10 -0
- package/core/hooks/useSafeForwardProps.js +34 -0
- package/core/index.d.ts +12 -0
- package/core/index.js +12 -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 +26 -0
- package/core/types/a11y-props.js +15 -0
- package/core/types/data-props.d.ts +1 -1
- package/core/types/dom.d.ts +8 -0
- package/core/types/dom.js +15 -0
- package/core/types/heading.d.ts +9 -0
- package/core/types/heading.js +15 -0
- package/core/types/masking-props.d.ts +2 -1
- package/core/types/polymorph.d.ts +28 -0
- package/core/types/polymorph.js +15 -0
- package/core/types/role-variant.d.ts +10 -0
- package/core/types/role-variant.js +30 -0
- package/core/types/styling-props.d.ts +1 -1
- package/core/types/with-children.d.ts +1 -1
- package/core/utils/_is-string-children.d.ts +6 -0
- package/core/utils/_is-string-children.js +44 -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/core/utils/isBrowser.d.ts +1 -1
- package/core/utils/merge-props.d.ts +4 -5
- package/core/utils/seed-random.d.ts +5 -0
- package/core/utils/seed-random.js +34 -0
- package/core/utils/uuidv4.d.ts +5 -0
- package/core/utils/uuidv4.js +31 -0
- package/esm/content/index.js +7 -0
- package/esm/content/index.js.map +7 -0
- package/esm/content/progress/ProgressBar.css +52 -0
- package/esm/content/progress/ProgressBar.js +163 -0
- package/esm/content/progress/ProgressBar.js.map +7 -0
- package/esm/content/progress/ProgressBar.sty.js +10 -0
- package/esm/content/progress/ProgressBar.sty.js.map +7 -0
- package/esm/content/progress/ProgressBarIcon.css +5 -0
- package/esm/content/progress/ProgressBarIcon.js +40 -0
- package/esm/content/progress/ProgressBarIcon.js.map +7 -0
- package/esm/content/progress/ProgressBarIcon.sty.js +7 -0
- package/esm/content/progress/ProgressBarIcon.sty.js.map +7 -0
- package/esm/content/progress/ProgressBarLabel.css +9 -0
- package/esm/content/progress/ProgressBarLabel.js +47 -0
- package/esm/content/progress/ProgressBarLabel.js.map +7 -0
- package/esm/content/progress/ProgressBarLabel.sty.js +8 -0
- package/esm/content/progress/ProgressBarLabel.sty.js.map +7 -0
- package/esm/content/progress/ProgressBarValue.css +28 -0
- package/esm/content/progress/ProgressBarValue.js +44 -0
- package/esm/content/progress/ProgressBarValue.js.map +7 -0
- package/esm/content/progress/ProgressBarValue.sty.js +8 -0
- package/esm/content/progress/ProgressBarValue.sty.js.map +7 -0
- package/esm/content/progress/ProgressCircle.css +52 -0
- package/esm/content/progress/ProgressCircle.js +153 -0
- package/esm/content/progress/ProgressCircle.js.map +7 -0
- package/esm/content/progress/ProgressCircle.sty.js +19 -0
- package/esm/content/progress/ProgressCircle.sty.js.map +7 -0
- package/esm/content/progress/contexts/SharedProgressBarPropsContext.js +10 -0
- package/esm/content/progress/contexts/SharedProgressBarPropsContext.js.map +7 -0
- package/esm/content/progress/hooks/useProgressAriaProps.js +45 -0
- package/esm/content/progress/hooks/useProgressAriaProps.js.map +7 -0
- package/esm/content/progress/hooks/useProgressBarPropsContext.js +16 -0
- package/esm/content/progress/hooks/useProgressBarPropsContext.js.map +7 -0
- package/esm/content/progress/utils.js +22 -0
- package/esm/content/progress/utils.js.map +7 -0
- package/esm/core/components/app-root/AppRoot.js.map +1 -1
- package/esm/core/hooks/useAriaLabelingProps.js +12 -0
- package/esm/core/hooks/useAriaLabelingProps.js.map +7 -0
- package/esm/core/hooks/useCurrentTheme.js.map +1 -1
- package/esm/core/hooks/useFontsUpdated.js +33 -0
- package/esm/core/hooks/useFontsUpdated.js.map +7 -0
- package/esm/core/hooks/useId.js +14 -0
- package/esm/core/hooks/useId.js.map +7 -0
- package/esm/core/hooks/useMergeRefs.js +16 -0
- package/esm/core/hooks/useMergeRefs.js.map +7 -0
- package/esm/core/hooks/useSafeForwardProps.js +16 -0
- package/esm/core/hooks/useSafeForwardProps.js.map +7 -0
- package/esm/core/index.js +12 -0
- package/esm/core/index.js.map +2 -2
- 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/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/types/role-variant.js +12 -0
- package/esm/core/types/role-variant.js.map +7 -0
- package/esm/core/utils/_is-string-children.js +16 -0
- package/esm/core/utils/_is-string-children.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/core/utils/isBrowser.js.map +1 -1
- package/esm/core/utils/merge-props.js.map +2 -2
- package/esm/core/utils/seed-random.js +16 -0
- package/esm/core/utils/seed-random.js.map +7 -0
- package/esm/core/utils/uuidv4.js +13 -0
- package/esm/core/utils/uuidv4.js.map +7 -0
- package/esm/index.js +4 -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/container/Container.css +8 -0
- package/esm/layouts/container/Container.js +55 -0
- package/esm/layouts/container/Container.js.map +7 -0
- package/esm/layouts/container/Container.sty.js +7 -0
- package/esm/layouts/container/Container.sty.js.map +7 -0
- package/esm/layouts/flex/Flex.js +46 -0
- package/esm/layouts/flex/Flex.js.map +7 -0
- package/esm/layouts/grid/Grid.js +46 -0
- package/esm/layouts/grid/Grid.js.map +7 -0
- package/esm/layouts/index.js +11 -0
- package/esm/layouts/index.js.map +7 -0
- package/esm/styles/colorUtils.css +80 -0
- package/esm/styles/colorUtils.sty.js +9 -0
- package/esm/styles/colorUtils.sty.js.map +7 -0
- package/esm/styles/container.css +64 -0
- package/esm/styles/container.sty.js +9 -0
- package/esm/styles/container.sty.js.map +7 -0
- package/esm/styles/ellipsis.css +5 -0
- package/esm/styles/ellipsis.sty.js +6 -0
- package/esm/styles/ellipsis.sty.js.map +7 -0
- package/esm/styles/extract-util.js +15 -0
- package/esm/styles/extract-util.js.map +7 -0
- package/esm/styles/getFlexStyles.js +69 -0
- package/esm/styles/getFlexStyles.js.map +7 -0
- package/esm/styles/getGapSprinkles.js +18 -0
- package/esm/styles/getGapSprinkles.js.map +7 -0
- package/esm/styles/getGridFlexPositionSprinkles.js +25 -0
- package/esm/styles/getGridFlexPositionSprinkles.js.map +7 -0
- package/esm/styles/getGridStyles.js +78 -0
- package/esm/styles/getGridStyles.js.map +7 -0
- package/esm/styles/getLayoutSizeStyles.js +21 -0
- package/esm/styles/getLayoutSizeStyles.js.map +7 -0
- package/esm/styles/getSpacingSprinkles.js +50 -0
- package/esm/styles/getSpacingSprinkles.js.map +7 -0
- package/esm/styles/index.js +49 -0
- package/esm/styles/index.js.map +7 -0
- package/esm/styles/safe-sprinkles.js +17 -0
- package/esm/styles/safe-sprinkles.js.map +7 -0
- package/esm/styles/sprinkle-properties.js +137 -0
- package/esm/styles/sprinkle-properties.js.map +7 -0
- package/esm/styles/sprinkles.css +786 -0
- package/esm/styles/sprinkles.sty.js +9 -0
- package/esm/styles/sprinkles.sty.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 +4 -0
- package/index.js +4 -0
- package/lang/en.json +12 -0
- package/lang/uncompiled/en.json +10 -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/container/Container.css +8 -0
- package/layouts/container/Container.d.ts +34 -0
- package/layouts/container/Container.js +80 -0
- package/layouts/container/Container.sty.d.ts +1 -0
- package/layouts/container/Container.sty.js +25 -0
- package/layouts/flex/Flex.d.ts +23 -0
- package/layouts/flex/Flex.js +72 -0
- package/layouts/grid/Grid.d.ts +23 -0
- package/layouts/grid/Grid.js +72 -0
- package/layouts/index.d.ts +6 -0
- package/layouts/index.js +29 -0
- package/package.json +34 -4
- package/styles/colorUtils.css +80 -0
- package/styles/colorUtils.sty.d.ts +56 -0
- package/styles/colorUtils.sty.js +27 -0
- package/styles/container.css +64 -0
- package/styles/container.sty.d.ts +54 -0
- package/styles/container.sty.js +27 -0
- package/styles/ellipsis.css +5 -0
- package/styles/ellipsis.sty.d.ts +5 -0
- package/styles/ellipsis.sty.js +24 -0
- package/styles/extract-util.d.ts +9 -0
- package/styles/extract-util.js +33 -0
- package/styles/getFlexStyles.d.ts +64 -0
- package/styles/getFlexStyles.js +95 -0
- package/styles/getGapSprinkles.d.ts +19 -0
- package/styles/getGapSprinkles.js +36 -0
- package/styles/getGridFlexPositionSprinkles.d.ts +35 -0
- package/styles/getGridFlexPositionSprinkles.js +43 -0
- package/styles/getGridStyles.d.ts +74 -0
- package/styles/getGridStyles.js +100 -0
- package/styles/getLayoutSizeStyles.d.ts +29 -0
- package/styles/getLayoutSizeStyles.js +39 -0
- package/styles/getSpacingSprinkles.d.ts +74 -0
- package/styles/getSpacingSprinkles.js +68 -0
- package/styles/index.d.ts +11 -0
- package/styles/index.js +47 -0
- package/styles/safe-sprinkles.d.ts +6 -0
- package/styles/safe-sprinkles.js +35 -0
- package/styles/sprinkle-properties.d.ts +257 -0
- package/styles/sprinkle-properties.js +165 -0
- package/styles/sprinkles.css +786 -0
- package/styles/sprinkles.sty.d.ts +913 -0
- package/styles/sprinkles.sty.js +27 -0
- package/styles/textStyle.css +64 -0
- package/styles/textStyle.sty.d.ts +13 -0
- package/styles/textStyle.sty.js +25 -0
- package/testing/mocks/canvas-mock.js +6 -1
- 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 +16 -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
package/esm/core/index.js
CHANGED
|
@@ -16,6 +16,12 @@ 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
|
+
import { useId } from "./hooks/useId.js";
|
|
21
|
+
import { useSafeForwardProps } from "./hooks/useSafeForwardProps.js";
|
|
22
|
+
import { roleVariants } from "./types/role-variant.js";
|
|
23
|
+
import { uuidv4 } from "./utils/uuidv4.js";
|
|
24
|
+
import { isStringChildren } from "./utils/_is-string-children.js";
|
|
19
25
|
export {
|
|
20
26
|
AppRoot,
|
|
21
27
|
FocusProvider as _FocusProvider,
|
|
@@ -26,8 +32,14 @@ export {
|
|
|
26
32
|
getLastFocusableChild as _getLastFocusableChild,
|
|
27
33
|
isBrowser as _isBrowser,
|
|
28
34
|
isFocusable as _isFocusable,
|
|
35
|
+
isStringChildren as _isStringChildren,
|
|
29
36
|
mergeProps as _mergeProps,
|
|
37
|
+
useAriaLabelingProps as _useAriaLabelingProps,
|
|
30
38
|
useFocusContext as _useFocusContext,
|
|
39
|
+
useId as _useId,
|
|
40
|
+
useSafeForwardProps as _useSafeForwardProps,
|
|
41
|
+
uuidv4 as _uuidv4,
|
|
42
|
+
roleVariants,
|
|
31
43
|
useCurrentTheme
|
|
32
44
|
};
|
|
33
45
|
//# sourceMappingURL=index.js.map
|
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 as _FocusScope,\n type FocusScopeProps as _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';\n\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';\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACgB;AAAA,OAET;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EACmB;AAAA,OAEZ;
|
|
4
|
+
"sourcesContent": ["export { AppRoot, type AppRootProps } from './components/app-root/AppRoot.js';\nexport {\n FocusScope as _FocusScope,\n type FocusScopeProps as _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';\n\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 { useAriaLabelingProps as _useAriaLabelingProps } from './hooks/useAriaLabelingProps.js';\nexport { useId as _useId } from './hooks/useId.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 { roleVariants } from './types/role-variant.js';\nexport type { RoleVariantType } from './types/role-variant.js';\nexport { uuidv4 as _uuidv4 } from './utils/uuidv4.js';\nexport { isStringChildren as _isStringChildren } from './utils/_is-string-children.js';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACgB;AAAA,OAET;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EACmB;AAAA,OAEZ;AAWP,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,SAAkB,aAAc;AAChC,SAAgC,2BAA4B;AAO5D,SAAS,oBAAoB;AAE7B,SAAmB,cAAe;AAClC,SAA6B,wBAAyB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import "./focusRing.css";
|
|
2
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
var focusRingCSS = _7a468({ 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: [] });
|
|
4
|
+
var focusRingFocusWithinCSS = _7a468({ 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: [] });
|
|
5
|
+
export {
|
|
6
|
+
focusRingCSS,
|
|
7
|
+
focusRingFocusWithinCSS
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=focusRing.sty.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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:'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:[]});\nexport var focusRingFocusWithinCSS = _7a468({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:[]});"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,mCAAkC,mBAAkB,EAAC,SAAQ,EAAC,MAAK,gDAA+C,OAAM,gDAA+C,GAAE,SAAQ,EAAC,SAAQ,mDAAkD,SAAQ,mDAAkD,SAAQ,mDAAkD,SAAQ,mDAAkD,UAAS,oDAAmD,UAAS,mDAAkD,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACvmB,IAAI,0BAA0B,OAAO,EAAC,kBAAiB,8CAA6C,mBAAkB,EAAC,SAAQ,EAAC,MAAK,2DAA0D,OAAM,2DAA0D,GAAE,SAAQ,EAAC,SAAQ,8DAA6D,SAAQ,8DAA6D,SAAQ,8DAA6D,SAAQ,8DAA6D,UAAS,+DAA8D,UAAS,8DAA6D,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCallback,
|
|
3
|
+
useEffect,
|
|
4
|
+
useState
|
|
5
|
+
} from "react";
|
|
6
|
+
import { focusRingCSS, focusRingFocusWithinCSS } from "./focusRing.sty.js";
|
|
7
|
+
import { _useFocusContext } from "../index.js";
|
|
8
|
+
const variants = [
|
|
9
|
+
"neutral",
|
|
10
|
+
"primary",
|
|
11
|
+
"success",
|
|
12
|
+
"warning",
|
|
13
|
+
"critical",
|
|
14
|
+
"onAccent"
|
|
15
|
+
];
|
|
16
|
+
function useFocusRing(props = {}) {
|
|
17
|
+
const {
|
|
18
|
+
variant = "neutral",
|
|
19
|
+
ignoreModality = false,
|
|
20
|
+
isMinimal = false,
|
|
21
|
+
focusWithin = false,
|
|
22
|
+
disabled = false
|
|
23
|
+
} = props;
|
|
24
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
25
|
+
const { modality } = _useFocusContext();
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (disabled) {
|
|
28
|
+
setIsFocused(false);
|
|
29
|
+
}
|
|
30
|
+
}, [disabled]);
|
|
31
|
+
const onBlur = useCallback((e) => {
|
|
32
|
+
if (e.currentTarget === e.target) {
|
|
33
|
+
setIsFocused(false);
|
|
34
|
+
}
|
|
35
|
+
}, []);
|
|
36
|
+
const onFocus = useCallback((e) => {
|
|
37
|
+
if (e.currentTarget === e.target) {
|
|
38
|
+
setIsFocused(true);
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
const focusProps = {
|
|
42
|
+
onFocus,
|
|
43
|
+
onBlur
|
|
44
|
+
};
|
|
45
|
+
if ((ignoreModality || modality === "keyboard") && isFocused || focusWithin) {
|
|
46
|
+
if (isMinimal) {
|
|
47
|
+
return {
|
|
48
|
+
focusClassName: focusWithin ? focusRingFocusWithinCSS({ minimal: true, variant }) : focusRingCSS({ minimal: true, variant }),
|
|
49
|
+
isFocusVisible: !focusWithin,
|
|
50
|
+
focusProps
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
focusClassName: focusWithin ? focusRingFocusWithinCSS({ minimal: false, variant }) : focusRingCSS({ minimal: false, variant }),
|
|
55
|
+
isFocusVisible: !focusWithin,
|
|
56
|
+
focusProps
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
focusClassName: focusWithin ? focusRingFocusWithinCSS() : focusRingCSS(),
|
|
61
|
+
isFocusVisible: false,
|
|
62
|
+
focusProps
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
useFocusRing,
|
|
67
|
+
variants
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=useFocusRing.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/styles/useFocusRing.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n FocusEvent,\n FocusEventHandler,\n useCallback,\n useEffect,\n useState,\n} from 'react';\n\nimport { focusRingCSS, focusRingFocusWithinCSS } from './focusRing.sty.js';\nimport { _useFocusContext } from '../index.js';\n\nexport type Modality = 'keyboard' | 'pointer' | 'touch' | 'unknown';\n\n/** @internal */\nexport const variants = [\n 'neutral',\n 'primary',\n 'success',\n 'warning',\n 'critical',\n 'onAccent',\n] as const;\n/** @internal */\nexport type VariantType = (typeof variants)[number];\n/** @internal */\nexport type UseFocusRingProps = {\n /**\n * A minimal focus outline is available for smaller content elements like links. This variant is applied when set to true.\n * @defaultValue false\n */\n isMinimal?: boolean;\n\n /**\n * 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).\n * @defaultValue false\n */\n ignoreModality?: boolean;\n\n /**\n * The styling variant of the element.\n * @defaultValue neutral\n */\n variant?: VariantType;\n\n /**\n * Apply the focus ring styling if an embedded element gains the focus\n */\n focusWithin?: boolean;\n\n /**\n * Whether the element is disabled. If disabled changes to true, the focus will be removed.\n */\n disabled?: boolean;\n};\n\nexport type FocusRingProps = {\n /** The focus styles that depend on modality. */\n focusClassName: string;\n /** Focus handlers used to manage the focus state. Must be applied to the element that receives the focus.*/\n focusProps: {\n onFocus: (e: FocusEvent) => void;\n onBlur: (e: FocusEvent) => void;\n };\n /** Whether or not the element got focus via keyboard. */\n isFocusVisible: boolean;\n};\n\n/**\n * Custom hook used to determine focus styling depending on modality.\n * Returns the css classes (vanilla) that can be applied to the component in order to show the correct focus outline.\n * @internal\n */\nexport function useFocusRing(props: UseFocusRingProps = {}): FocusRingProps {\n const {\n variant = 'neutral',\n ignoreModality = false,\n isMinimal = false,\n focusWithin = false,\n disabled = false,\n } = props;\n const [isFocused, setIsFocused] = useState(false);\n const { modality } = _useFocusContext();\n\n useEffect(() => {\n if (disabled) {\n setIsFocused(false);\n }\n }, [disabled]);\n\n const onBlur = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is unfocused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(false);\n }\n }, []);\n\n const onFocus = useCallback<FocusEventHandler>((e) => {\n // trigger only when the self element is focused (stopPropagation)\n if (e.currentTarget === e.target) {\n setIsFocused(true);\n }\n }, []);\n\n const focusProps = {\n onFocus,\n onBlur,\n };\n\n if (\n ((ignoreModality || modality === 'keyboard') && isFocused) ||\n focusWithin\n ) {\n if (isMinimal) {\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: true, variant })\n : focusRingCSS({ minimal: true, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin\n ? focusRingFocusWithinCSS({ minimal: false, variant })\n : focusRingCSS({ minimal: false, variant }),\n isFocusVisible: !focusWithin,\n focusProps,\n };\n }\n\n return {\n focusClassName: focusWithin ? focusRingFocusWithinCSS() : focusRingCSS(),\n isFocusVisible: false,\n focusProps,\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,cAAc,+BAA+B;AACtD,SAAS,wBAAwB;AAK1B,MAAM,WAAW;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAmDO,SAAS,aAAa,QAA2B,CAAC,GAAmB;AAC1E,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,WAAW;AAAA,EACb,IAAI;AACJ,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,EAAE,SAAS,IAAI,iBAAiB;AAEtC,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,QAAM,SAAS,YAA+B,CAAC,MAAM;AAEnD,QAAI,EAAE,kBAAkB,EAAE,QAAQ;AAChC,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,YAA+B,CAAC,MAAM;AAEpD,QAAI,EAAE,kBAAkB,EAAE,QAAQ;AAChC,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,EACF;AAEA,OACI,kBAAkB,aAAa,eAAe,aAChD,aACA;AACA,QAAI,WAAW;AACb,aAAO;AAAA,QACL,gBAAgB,cACZ,wBAAwB,EAAE,SAAS,MAAM,QAAQ,CAAC,IAClD,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC;AAAA,QAC3C,gBAAgB,CAAC;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,MACL,gBAAgB,cACZ,wBAAwB,EAAE,SAAS,OAAO,QAAQ,CAAC,IACnD,aAAa,EAAE,SAAS,OAAO,QAAQ,CAAC;AAAA,MAC5C,gBAAgB,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,gBAAgB,cAAc,wBAAwB,IAAI,aAAa;AAAA,IACvE,gBAAgB;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=a11y-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=polymorph.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/types/role-variant.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * Defines role / color variants\n * @public\n */\nexport const roleVariants = [\n 'neutral',\n 'primary',\n 'success',\n 'warning',\n 'critical',\n 'onAccent',\n] as const;\n\n/**\n * Defines the types of role variants\n * @public\n */\nexport type RoleVariantType = (typeof roleVariants)[number];\n"],
|
|
5
|
+
"mappings": "AAIO,MAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import { isElement } from "react-is";
|
|
4
|
+
function isStringChildren(children) {
|
|
5
|
+
const childrenArray = React.Children.toArray(children);
|
|
6
|
+
if (!childrenArray.some(isElement)) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
return childrenArray.every(
|
|
10
|
+
(child) => !isElement(child) || isElement(child) && child.type && child.type === FormattedMessage
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
isStringChildren
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=_is-string-children.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/utils/_is-string-children.ts"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { isElement } from 'react-is';\n\n/**\n * Returns whether children only consist of text nodes.\n * @internal\n */\nexport function isStringChildren(children: React.ReactNode): boolean {\n const childrenArray = React.Children.toArray(children);\n\n if (!childrenArray.some(isElement)) {\n return true; // All children are strings\n }\n\n return childrenArray.every(\n (child) =>\n !isElement(child) ||\n (isElement(child) && child.type && child.type === FormattedMessage),\n );\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAMnB,SAAS,iBAAiB,UAAoC;AACnE,QAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;AAErD,MAAI,CAAC,cAAc,KAAK,SAAS,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,cAAc;AAAA,IACnB,CAAC,UACC,CAAC,UAAU,KAAK,KACf,UAAU,KAAK,KAAK,MAAM,QAAQ,MAAM,SAAS;AAAA,EACtD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.colorUtils_colorUtilsCSS_color_critical__k096v44 {
|
|
2
|
+
--vars_text__k096v40: var(--dt-colors-text-critical-default, #b80031);
|
|
3
|
+
--vars_icon__k096v41: var(--dt-colors-icon-critical-default, #b80031);
|
|
4
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
5
|
+
}
|
|
6
|
+
.colorUtils_colorUtilsCSS_color_neutral__k096v45 {
|
|
7
|
+
--vars_text__k096v40: var(--dt-colors-text-neutral-default, #2b2a58);
|
|
8
|
+
--vars_icon__k096v41: var(--dt-colors-icon-neutral-default, #2b2a58);
|
|
9
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
10
|
+
}
|
|
11
|
+
.colorUtils_colorUtilsCSS_color_primary__k096v46 {
|
|
12
|
+
--vars_text__k096v40: var(--dt-colors-text-primary-default, #454cc9);
|
|
13
|
+
--vars_icon__k096v41: var(--dt-colors-icon-primary-default, #454cc9);
|
|
14
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
15
|
+
}
|
|
16
|
+
.colorUtils_colorUtilsCSS_color_success__k096v47 {
|
|
17
|
+
--vars_text__k096v40: var(--dt-colors-text-success-default, #2c6360);
|
|
18
|
+
--vars_icon__k096v41: var(--dt-colors-icon-success-default, #2c6360);
|
|
19
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-success-default, #cad6d7);
|
|
20
|
+
}
|
|
21
|
+
.colorUtils_colorUtilsCSS_color_warning__k096v48 {
|
|
22
|
+
--vars_text__k096v40: var(--dt-colors-text-warning-default, #805100);
|
|
23
|
+
--vars_icon__k096v41: var(--dt-colors-icon-warning-default, #805100);
|
|
24
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
25
|
+
}
|
|
26
|
+
.colorUtils_colorUtilsCSS_color_onAccent__k096v49 {
|
|
27
|
+
--vars_text__k096v40: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
|
|
28
|
+
--vars_icon__k096v41: var(--dt-colors-icon-neutral-on-accent-default, #f3f3f6);
|
|
29
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-neutral-on-accent-default, #f3f3f6);
|
|
30
|
+
}
|
|
31
|
+
.colorUtils_colorUtilsCSS_compound_0__k096v4e {
|
|
32
|
+
--vars_text__k096v40: var(--dt-colors-text-primary-on-accent-default, #f4f4fb);
|
|
33
|
+
--vars_icon__k096v41: var(--dt-colors-icon-primary-on-accent-default, #f4f4fb);
|
|
34
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-primary-accent, #454cc9);
|
|
35
|
+
}
|
|
36
|
+
.colorUtils_colorUtilsCSS_compound_1__k096v4f {
|
|
37
|
+
--vars_text__k096v40: var(--dt-colors-text-success-on-accent-default, #f1f4f4);
|
|
38
|
+
--vars_icon__k096v41: var(--dt-colors-icon-success-on-accent-default, #f1f4f4);
|
|
39
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-success-accent, #2c6360);
|
|
40
|
+
}
|
|
41
|
+
.colorUtils_colorUtilsCSS_compound_2__k096v4g {
|
|
42
|
+
--vars_text__k096v40: var(--dt-colors-text-warning-on-accent-default, #272025);
|
|
43
|
+
--vars_icon__k096v41: var(--dt-colors-icon-warning-on-accent-default, #272025);
|
|
44
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-warning-accent, #805100);
|
|
45
|
+
}
|
|
46
|
+
.colorUtils_colorUtilsCSS_compound_3__k096v4h {
|
|
47
|
+
--vars_text__k096v40: var(--dt-colors-text-critical-on-accent-default, #f9f1f3);
|
|
48
|
+
--vars_icon__k096v41: var(--dt-colors-icon-critical-on-accent-default, #f9f1f3);
|
|
49
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-critical-accent, #b80031);
|
|
50
|
+
}
|
|
51
|
+
.colorUtils_colorUtilsCSS_compound_4__k096v4i {
|
|
52
|
+
--vars_text__k096v40: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
|
|
53
|
+
--vars_icon__k096v41: var(--dt-colors-icon-neutral-on-accent-default, #f3f3f6);
|
|
54
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-neutral-accent, #545587);
|
|
55
|
+
}
|
|
56
|
+
.colorUtils_colorUtilsCSS_compound_5__k096v4j {
|
|
57
|
+
--vars_text__k096v40: var(--dt-colors-text-primary-disabled, #54558780);
|
|
58
|
+
--vars_icon__k096v41: var(--dt-colors-icon-primary-disabled, #54558780);
|
|
59
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-primary-disabled, #d2d3e180);
|
|
60
|
+
}
|
|
61
|
+
.colorUtils_colorUtilsCSS_compound_6__k096v4k {
|
|
62
|
+
--vars_text__k096v40: var(--dt-colors-text-success-disabled, #54558780);
|
|
63
|
+
--vars_icon__k096v41: var(--dt-colors-icon-success-disabled, #54558780);
|
|
64
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-success-disabled, #d2d3e180);
|
|
65
|
+
}
|
|
66
|
+
.colorUtils_colorUtilsCSS_compound_7__k096v4l {
|
|
67
|
+
--vars_text__k096v40: var(--dt-colors-text-warning-disabled, #54558780);
|
|
68
|
+
--vars_icon__k096v41: var(--dt-colors-icon-warning-disabled, #54558780);
|
|
69
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-warning-disabled, #d2d3e180);
|
|
70
|
+
}
|
|
71
|
+
.colorUtils_colorUtilsCSS_compound_8__k096v4m {
|
|
72
|
+
--vars_text__k096v40: var(--dt-colors-text-critical-disabled, #54558780);
|
|
73
|
+
--vars_icon__k096v41: var(--dt-colors-icon-critical-disabled, #54558780);
|
|
74
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-critical-disabled, #d2d3e180);
|
|
75
|
+
}
|
|
76
|
+
.colorUtils_colorUtilsCSS_compound_9__k096v4n {
|
|
77
|
+
--vars_text__k096v40: var(--dt-colors-text-neutral-disabled, #54558780);
|
|
78
|
+
--vars_icon__k096v41: var(--dt-colors-icon-neutral-disabled, #54558780);
|
|
79
|
+
--vars_borderColor__k096v42: var(--dt-colors-border-neutral-disabled, #d2d3e180);
|
|
80
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./colorUtils.css";
|
|
2
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
var colorUtilsCSS = _7a468({ defaultClassName: "colorUtils__k096v43", variantClassNames: { color: { critical: "colorUtils_colorUtilsCSS_color_critical__k096v44", neutral: "colorUtils_colorUtilsCSS_color_neutral__k096v45", primary: "colorUtils_colorUtilsCSS_color_primary__k096v46", success: "colorUtils_colorUtilsCSS_color_success__k096v47", warning: "colorUtils_colorUtilsCSS_color_warning__k096v48", onAccent: "colorUtils_colorUtilsCSS_color_onAccent__k096v49" }, variant: { "default": "colorUtils_colorUtilsCSS_variant_default__k096v4a", accent: "colorUtils_colorUtilsCSS_variant_accent__k096v4b" }, disabled: { true: "colorUtils_colorUtilsCSS_disabled_true__k096v4c", false: "colorUtils_colorUtilsCSS_disabled_false__k096v4d" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "colorUtils_colorUtilsCSS_compound_0__k096v4e"], [{ color: "success", variant: "accent" }, "colorUtils_colorUtilsCSS_compound_1__k096v4f"], [{ color: "warning", variant: "accent" }, "colorUtils_colorUtilsCSS_compound_2__k096v4g"], [{ color: "critical", variant: "accent" }, "colorUtils_colorUtilsCSS_compound_3__k096v4h"], [{ color: "neutral", variant: "accent" }, "colorUtils_colorUtilsCSS_compound_4__k096v4i"], [{ color: "primary", disabled: true }, "colorUtils_colorUtilsCSS_compound_5__k096v4j"], [{ color: "success", disabled: true }, "colorUtils_colorUtilsCSS_compound_6__k096v4k"], [{ color: "warning", disabled: true }, "colorUtils_colorUtilsCSS_compound_7__k096v4l"], [{ color: "critical", disabled: true }, "colorUtils_colorUtilsCSS_compound_8__k096v4m"], [{ color: "neutral", disabled: true }, "colorUtils_colorUtilsCSS_compound_9__k096v4n"]] });
|
|
4
|
+
var colorUtilsVars = { text: "var(--vars_text__k096v40)", icon: "var(--vars_icon__k096v41)", borderColor: "var(--vars_borderColor__k096v42)" };
|
|
5
|
+
export {
|
|
6
|
+
colorUtilsCSS,
|
|
7
|
+
colorUtilsVars
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=colorUtils.sty.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/utils/colorUtils.css.ts"],
|
|
4
|
+
"sourcesContent": ["import './colorUtils.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var colorUtilsCSS = _7a468({defaultClassName:'colorUtils__k096v43',variantClassNames:{color:{critical:'colorUtils_colorUtilsCSS_color_critical__k096v44',neutral:'colorUtils_colorUtilsCSS_color_neutral__k096v45',primary:'colorUtils_colorUtilsCSS_color_primary__k096v46',success:'colorUtils_colorUtilsCSS_color_success__k096v47',warning:'colorUtils_colorUtilsCSS_color_warning__k096v48',onAccent:'colorUtils_colorUtilsCSS_color_onAccent__k096v49'},variant:{'default':'colorUtils_colorUtilsCSS_variant_default__k096v4a',accent:'colorUtils_colorUtilsCSS_variant_accent__k096v4b'},disabled:{true:'colorUtils_colorUtilsCSS_disabled_true__k096v4c',false:'colorUtils_colorUtilsCSS_disabled_false__k096v4d'}},defaultVariants:{},compoundVariants:[[{color:'primary',variant:'accent'},'colorUtils_colorUtilsCSS_compound_0__k096v4e'],[{color:'success',variant:'accent'},'colorUtils_colorUtilsCSS_compound_1__k096v4f'],[{color:'warning',variant:'accent'},'colorUtils_colorUtilsCSS_compound_2__k096v4g'],[{color:'critical',variant:'accent'},'colorUtils_colorUtilsCSS_compound_3__k096v4h'],[{color:'neutral',variant:'accent'},'colorUtils_colorUtilsCSS_compound_4__k096v4i'],[{color:'primary',disabled:true},'colorUtils_colorUtilsCSS_compound_5__k096v4j'],[{color:'success',disabled:true},'colorUtils_colorUtilsCSS_compound_6__k096v4k'],[{color:'warning',disabled:true},'colorUtils_colorUtilsCSS_compound_7__k096v4l'],[{color:'critical',disabled:true},'colorUtils_colorUtilsCSS_compound_8__k096v4m'],[{color:'neutral',disabled:true},'colorUtils_colorUtilsCSS_compound_9__k096v4n']]});\nexport var colorUtilsVars = {text:'var(--vars_text__k096v40)',icon:'var(--vars_icon__k096v41)',borderColor:'var(--vars_borderColor__k096v42)'};"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,gBAAgB,OAAO,EAAC,kBAAiB,uBAAsB,mBAAkB,EAAC,OAAM,EAAC,UAAS,oDAAmD,SAAQ,mDAAkD,SAAQ,mDAAkD,SAAQ,mDAAkD,SAAQ,mDAAkD,UAAS,mDAAkD,GAAE,SAAQ,EAAC,WAAU,qDAAoD,QAAO,mDAAkD,GAAE,UAAS,EAAC,MAAK,mDAAkD,OAAM,mDAAkD,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,YAAW,SAAQ,SAAQ,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,UAAS,KAAI,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,UAAS,KAAI,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,UAAS,KAAI,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,YAAW,UAAS,KAAI,GAAE,8CAA8C,GAAE,CAAC,EAAC,OAAM,WAAU,UAAS,KAAI,GAAE,8CAA8C,CAAC,EAAC,CAAC;AAC7hD,IAAI,iBAAiB,EAAC,MAAK,6BAA4B,MAAK,6BAA4B,aAAY,mCAAkC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/utils/isBrowser.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @internal\n *\n * Whether the code is currently executed in a browser\n * @see https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src/dom.ts\n */\nexport const isBrowser = (() => {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n );\n})();\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @internal\n *\n * Whether the code is currently executed in a browser\n * @see {@link https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src/dom.ts}\n */\nexport const isBrowser = (() => {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n );\n})();\n"],
|
|
5
5
|
"mappings": "AAMO,MAAM,aAAa,MAAM;AAC9B,SAAO,CAAC,EACN,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAEpB,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/utils/merge-props.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nfunction chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (const callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\n/**\n *
|
|
5
|
-
"mappings": "AAKA,SAAS,SAAS,WAA4C;AAC5D,SAAO,IAAI,SAAgB;AACzB,eAAW,YAAY,WAAW;AAChC,UAAI,OAAO,aAAa,YAAY;AAClC,iBAAS,GAAG,IAAI;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nfunction chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (const callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\n/**\n * Internal helper mapper type for mergeProps.\n * @internal\n */\nexport type TupleTypes<T> = { [P in keyof T]: T[P] } extends {\n [key: number]: infer V;\n}\n ? NullToObject<V>\n : never;\n\n/**\n * Internal helper mapper type for mergeProps.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type NullToObject<T> = T extends null | undefined ? {} : T;\n\n/**\n * Internal helper mapper type for mergeProps.\n * @internal\n */\n// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars\nexport type UnionToIntersection<U> = (\n U extends any ? (k: U) => void : never\n) extends (k: infer I) => void\n ? I\n : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated - different ids\n * will trigger a side-effect and re-render components hooked up with `useId`.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n * @internal\n */\nexport function mergeProps<\n T extends (\n | {\n [key: string]: any;\n }\n | null\n | undefined\n )[],\n>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n const result = { ...args[0] };\n for (let i = 1; i < args.length; i++) {\n const props = args[i];\n for (const key in props) {\n const a = result[key];\n const b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],
|
|
5
|
+
"mappings": "AAKA,SAAS,SAAS,WAA4C;AAC5D,SAAO,IAAI,SAAgB;AACzB,eAAW,YAAY,WAAW;AAChC,UAAI,OAAO,aAAa,YAAY;AAClC,iBAAS,GAAG,IAAI;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AACF;AAuCO,SAAS,cAQX,MAA6C;AAGhD,QAAM,SAAS,EAAE,GAAG,KAAK,CAAC,EAAE;AAC5B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,QAAQ,KAAK,CAAC;AACpB,eAAW,OAAO,OAAO;AACvB,YAAM,IAAI,OAAO,GAAG;AACpB,YAAM,IAAI,MAAM,GAAG;AAGnB,UACE,OAAO,MAAM,cACb,OAAO,MAAM;AAAA,MAEb,IAAI,CAAC,MAAM,OACX,IAAI,CAAC,MAAM,OACX,IAAI,WAAW,CAAC;AAAA,MAAe,MAC/B,IAAI,WAAW,CAAC;AAAA,MAAe,IAC/B;AACA,eAAO,GAAG,IAAI,MAAM,GAAG,CAAC;AAAA,MAC1B,OAAO;AACL,eAAO,GAAG,IAAI,MAAM,SAAY,IAAI;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const memoizedRandomGenerators = {};
|
|
2
|
+
function mulberry32(seed) {
|
|
3
|
+
if (memoizedRandomGenerators[seed] === void 0) {
|
|
4
|
+
memoizedRandomGenerators[seed] = () => {
|
|
5
|
+
let t = seed += 1831565813;
|
|
6
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
7
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
8
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return memoizedRandomGenerators[seed];
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
mulberry32
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=seed-random.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/utils/seed-random.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-mixed-operators */\n\n/** Memoize currified mulberry32 generators to ensure that sequences are honored for the same seed */\nconst memoizedRandomGenerators: Record<number, () => number> = {};\n\n/**\n * Generate a random seed function based on the mulberry32 algorithm\n * @internal\n */\nexport function mulberry32(seed: number) {\n if (memoizedRandomGenerators[seed] === void 0) {\n memoizedRandomGenerators[seed] = () => {\n let t = (seed += 0x6d2b79f5);\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n }\n\n return memoizedRandomGenerators[seed];\n}\n"],
|
|
5
|
+
"mappings": "AAGA,MAAM,2BAAyD,CAAC;AAMzD,SAAS,WAAW,MAAc;AACvC,MAAI,yBAAyB,IAAI,MAAM,QAAQ;AAC7C,6BAAyB,IAAI,IAAI,MAAM;AACrC,UAAI,IAAK,QAAQ;AACjB,UAAI,KAAK,KAAK,IAAK,MAAM,IAAK,IAAI,CAAC;AACnC,WAAK,IAAI,KAAK,KAAK,IAAK,MAAM,GAAI,IAAI,EAAE;AACxC,eAAS,IAAK,MAAM,QAAS,KAAK;AAAA,IACpC;AAAA,EACF;AAEA,SAAO,yBAAyB,IAAI;AACtC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { mulberry32 } from "./seed-random.js";
|
|
2
|
+
function uuidv4(seed) {
|
|
3
|
+
const random = seed !== void 0 ? mulberry32(seed) : Math.random;
|
|
4
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
|
|
5
|
+
const randomNumber = random() * 16 | 0;
|
|
6
|
+
const value = char === "x" ? randomNumber : randomNumber & 3 | 8;
|
|
7
|
+
return value.toString(16);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
uuidv4
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=uuidv4.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/utils/uuidv4.ts"],
|
|
4
|
+
"sourcesContent": ["import { mulberry32 } from './seed-random.js';\n\n/**\n * Generates a uuidv4\n * @internal\n */\nexport function uuidv4(seed?: number) {\n // If a seed is given, use a seeded random function to generate the uuid.\n const random = seed !== void 0 ? mulberry32(seed) : Math.random;\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (char) => {\n // eslint-disable-next-line no-mixed-operators\n const randomNumber = (random() * 16) | 0;\n const value = char === 'x' ? randomNumber : (randomNumber & 0x3) | 0x8;\n return value.toString(16);\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAMpB,SAAS,OAAO,MAAe;AAEpC,QAAM,SAAS,SAAS,SAAS,WAAW,IAAI,IAAI,KAAK;AACzD,SAAO,uCAAuC,QAAQ,SAAS,CAAC,SAAS;AAEvE,UAAM,eAAgB,OAAO,IAAI,KAAM;AACvC,UAAM,QAAQ,SAAS,MAAM,eAAgB,eAAe,IAAO;AACnE,WAAO,MAAM,SAAS,EAAE;AAAA,EAC1B,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
package/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './core/index.js';\n"],
|
|
5
|
-
"mappings": "AAAA,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './core/index.js';\nexport * from './content/index.js';\nexport * from './layouts/index.js';\nexport * from './styles/index.js';\nexport * from './typography/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.Divider_dividerCSS__1ljcfp90 {
|
|
2
|
+
border: none;
|
|
3
|
+
margin: 0;
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
background-color: var(--vars_borderColor__k096v42);
|
|
6
|
+
}
|
|
7
|
+
.Divider_dividerCSS_orientation_horizontal__1ljcfp91 {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--dt-borders-width-default, 1px);
|
|
10
|
+
}
|
|
11
|
+
.Divider_dividerCSS_orientation_vertical__1ljcfp92 {
|
|
12
|
+
width: var(--dt-borders-width-default, 1px);
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
.Divider_dividerCSS_compound_0__1ljcfp95 {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
}
|
|
18
|
+
.Divider_dividerCSS_compound_1__1ljcfp96 {
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
width: var(--dt-borders-width-default, 1px);
|
|
21
|
+
height: auto;
|
|
22
|
+
align-self: stretch;
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { dividerCSS } from "./Divider.sty.js";
|
|
4
|
+
import { colorUtilsCSS } from "../../core/utils/colorUtils.sty.js";
|
|
5
|
+
const Divider = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
6
|
+
const {
|
|
7
|
+
orientation = "horizontal",
|
|
8
|
+
flexItem = true,
|
|
9
|
+
as = "div",
|
|
10
|
+
color = "neutral",
|
|
11
|
+
variant = "default",
|
|
12
|
+
"data-testid": dataTestId,
|
|
13
|
+
className: consumerClassName,
|
|
14
|
+
style: consumerStyle,
|
|
15
|
+
...remainingProps
|
|
16
|
+
} = props;
|
|
17
|
+
const DividerTag = as;
|
|
18
|
+
return /* @__PURE__ */ React.createElement(
|
|
19
|
+
DividerTag,
|
|
20
|
+
{
|
|
21
|
+
role: "separator",
|
|
22
|
+
"aria-orientation": orientation === "vertical" ? orientation : void 0,
|
|
23
|
+
ref,
|
|
24
|
+
"data-testid": dataTestId,
|
|
25
|
+
className: clsx(
|
|
26
|
+
colorUtilsCSS({ color, variant }),
|
|
27
|
+
dividerCSS({ orientation, flexItem }),
|
|
28
|
+
consumerClassName
|
|
29
|
+
),
|
|
30
|
+
style: consumerStyle,
|
|
31
|
+
...remainingProps
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
Divider.displayName = "Divider";
|
|
36
|
+
export {
|
|
37
|
+
Divider
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=Divider.js.map
|