@hashicorp/mds-react 0.9.13 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/index.d.ts +15 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/item/button.d.ts +7 -0
- package/dist/components/accordion/item/button.d.ts.map +1 -0
- package/dist/components/accordion/item/index.d.ts +25 -0
- package/dist/components/accordion/item/index.d.ts.map +1 -0
- package/dist/components/accordion/item/index.js.map +1 -0
- package/dist/components/accordion/style.module.scss +110 -0
- package/dist/components/alert/alert.module.scss +227 -0
- package/dist/components/alert/icon.d.ts +10 -0
- package/dist/components/alert/icon.d.ts.map +1 -0
- package/dist/components/alert/index.d.ts +63 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +32 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/badge/style.module.scss +108 -0
- package/dist/components/badge-count/index.d.ts +16 -0
- package/dist/components/badge-count/index.d.ts.map +1 -0
- package/dist/components/badge-count/index.js.map +1 -0
- package/dist/components/badge-count/style.module.scss +86 -0
- package/dist/components/breadcrumbs/index.d.ts +8 -0
- package/dist/components/breadcrumbs/index.d.ts.map +1 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/breadcrumbs/item/index.d.ts +3 -0
- package/dist/components/breadcrumbs/item/index.d.ts.map +1 -0
- package/dist/components/breadcrumbs/style.module.scss +183 -0
- package/dist/components/breadcrumbs/truncation-button/index.d.ts +4 -0
- package/dist/components/breadcrumbs/truncation-button/index.d.ts.map +1 -0
- package/dist/components/breadcrumbs/types/index.d.ts +52 -0
- package/dist/components/breadcrumbs/types/index.d.ts.map +1 -0
- package/dist/components/button/button-primitive.d.ts +6 -0
- package/dist/components/button/button-primitive.d.ts.map +1 -0
- package/dist/components/button/button-primitive.js.map +1 -0
- package/dist/components/button/index.d.ts +31 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/styles.module.scss +217 -0
- package/dist/components/card/card-thumbnail/index.d.ts +3 -0
- package/dist/components/card/card-thumbnail/index.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +5 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/card/types.d.ts +54 -0
- package/dist/components/card/types.d.ts.map +1 -0
- package/dist/components/code-block/code-block.module.scss +505 -0
- package/dist/components/code-block/code-lines/index.d.ts +20 -0
- package/dist/components/code-block/code-lines/index.d.ts.map +1 -0
- package/dist/components/code-block/code-lines/utils/split-html-into-lines.d.ts +20 -0
- package/dist/components/code-block/code-lines/utils/split-html-into-lines.d.ts.map +1 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts +22 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts.map +1 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -0
- package/dist/components/code-block/hidden-copy-content/index.d.ts +6 -0
- package/dist/components/code-block/hidden-copy-content/index.d.ts.map +1 -0
- package/dist/components/code-block/hidden-copy-content/index.js.map +1 -0
- package/dist/components/code-block/index.d.ts +56 -0
- package/dist/components/code-block/index.d.ts.map +1 -0
- package/dist/components/code-block/index.js.map +1 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.d.ts +3 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.d.ts.map +1 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.js.map +1 -0
- package/dist/components/code-block/utils/process-snippet.d.ts +13 -0
- package/dist/components/code-block/utils/process-snippet.d.ts.map +1 -0
- package/dist/components/code-block/utils/shellwords.d.ts +15 -0
- package/dist/components/code-block/utils/shellwords.d.ts.map +1 -0
- package/dist/components/code-block/utils/shellwords.js.map +1 -0
- package/dist/components/combo-box-primitive/index.d.ts +69 -0
- package/dist/components/combo-box-primitive/index.d.ts.map +1 -0
- package/dist/components/combo-box-primitive/index.js.map +1 -0
- package/dist/components/dialog-primitive/index.d.ts +13 -0
- package/dist/components/dialog-primitive/index.d.ts.map +1 -0
- package/dist/components/dialog-primitive/index.js.map +1 -0
- package/dist/components/disclosure-primitive/index.d.ts +20 -0
- package/dist/components/disclosure-primitive/index.d.ts.map +1 -0
- package/dist/components/disclosure-primitive/index.js.map +1 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.d.ts +12 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.d.ts.map +1 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -0
- package/dist/components/dismiss-button/index.d.ts +9 -0
- package/dist/components/dismiss-button/index.d.ts.map +1 -0
- package/dist/components/dismiss-button/styles.module.scss +26 -0
- package/dist/components/dropdown/index.d.ts +73 -0
- package/dist/components/dropdown/index.d.ts.map +1 -0
- package/dist/components/dropdown/index.js.map +1 -0
- package/dist/components/dropdown/list-item/custom.d.ts +11 -0
- package/dist/components/dropdown/list-item/custom.d.ts.map +1 -0
- package/dist/components/dropdown/list-item/index.d.ts +20 -0
- package/dist/components/dropdown/list-item/index.d.ts.map +1 -0
- package/dist/components/dropdown/list-item/interactive.d.ts +30 -0
- package/dist/components/dropdown/list-item/interactive.d.ts.map +1 -0
- package/dist/components/dropdown/list-item/separator.d.ts +9 -0
- package/dist/components/dropdown/list-item/separator.d.ts.map +1 -0
- package/dist/components/dropdown/list-item/styles.module.css +218 -0
- package/dist/components/dropdown/list-item/title.d.ts +11 -0
- package/dist/components/dropdown/list-item/title.d.ts.map +1 -0
- package/dist/components/dropdown/list-item/title.js.map +1 -0
- package/dist/components/dropdown/toggle-button/index.d.ts +31 -0
- package/dist/components/dropdown/toggle-button/index.d.ts.map +1 -0
- package/dist/components/dropdown/toggle-button/index.js.map +1 -0
- package/dist/components/dropdown/toggle-button/styles.module.scss +54 -0
- package/dist/components/flight-icon/index.d.ts +45 -0
- package/dist/components/flight-icon/index.d.ts.map +1 -0
- package/dist/components/flight-icon/index.js.map +1 -0
- package/dist/components/form/checkbox/form-checkbox.module.css +81 -0
- package/dist/components/form/checkbox/index.d.ts +46 -0
- package/dist/components/form/checkbox/index.d.ts.map +1 -0
- package/dist/components/form/error/index.d.ts +17 -0
- package/dist/components/form/error/index.d.ts.map +1 -0
- package/dist/components/form/field/index.d.ts +20 -0
- package/dist/components/form/field/index.d.ts.map +1 -0
- package/dist/components/form/fieldset/index.d.ts +19 -0
- package/dist/components/form/fieldset/index.d.ts.map +1 -0
- package/dist/components/form/file-input/form-file-input.module.scss +81 -0
- package/dist/components/form/file-input/index.d.ts +28 -0
- package/dist/components/form/file-input/index.d.ts.map +1 -0
- package/dist/components/form/helper-text/index.d.ts +12 -0
- package/dist/components/form/helper-text/index.d.ts.map +1 -0
- package/dist/components/form/indicator/index.d.ts +10 -0
- package/dist/components/form/indicator/index.d.ts.map +1 -0
- package/dist/components/form/label/index.d.ts +15 -0
- package/dist/components/form/label/index.d.ts.map +1 -0
- package/dist/components/form/legend/index.d.ts +13 -0
- package/dist/components/form/legend/index.d.ts.map +1 -0
- package/dist/components/form/radio/form-radio.module.scss +71 -0
- package/dist/components/form/radio/index.d.ts +43 -0
- package/dist/components/form/radio/index.d.ts.map +1 -0
- package/dist/components/form/radio-card/description.d.ts +4 -0
- package/dist/components/form/radio-card/description.d.ts.map +1 -0
- package/dist/components/form/radio-card/form-radio-card.module.css +152 -0
- package/dist/components/form/radio-card/group.d.ts +12 -0
- package/dist/components/form/radio-card/group.d.ts.map +1 -0
- package/dist/components/form/radio-card/index.d.ts +49 -0
- package/dist/components/form/radio-card/index.d.ts.map +1 -0
- package/dist/components/form/radio-card/index.js.map +1 -0
- package/dist/components/form/radio-card/label.d.ts +4 -0
- package/dist/components/form/radio-card/label.d.ts.map +1 -0
- package/dist/components/form/select/form-select.module.css +81 -0
- package/dist/components/form/select/index.d.ts +23 -0
- package/dist/components/form/select/index.d.ts.map +1 -0
- package/dist/components/form/select/index.js.map +1 -0
- package/dist/components/form/super-select/form-super-select.module.css +149 -0
- package/dist/components/form/super-select/index.d.ts +56 -0
- package/dist/components/form/super-select/index.d.ts.map +1 -0
- package/dist/components/form/super-select/index.js.map +1 -0
- package/dist/components/form/text-input/index.d.ts +99 -0
- package/dist/components/form/text-input/index.d.ts.map +1 -0
- package/dist/components/form/text-input/index.js.map +1 -0
- package/dist/components/form/text-input/styles.module.css +144 -0
- package/dist/components/form/textarea/form-textarea.module.css +87 -0
- package/dist/components/form/textarea/index.d.ts +20 -0
- package/dist/components/form/textarea/index.d.ts.map +1 -0
- package/dist/components/form/textarea/index.js.map +1 -0
- package/dist/components/form/toggle/form-toggle.module.scss +151 -0
- package/dist/components/form/toggle/index.d.ts +79 -0
- package/dist/components/form/toggle/index.d.ts.map +1 -0
- package/dist/components/hds/wrappers/tooltip.d.ts +15 -0
- package/dist/components/hds/wrappers/tooltip.d.ts.map +1 -0
- package/dist/components/icon-tile/index.d.ts +22 -0
- package/dist/components/icon-tile/index.d.ts.map +1 -0
- package/dist/components/icon-tile/index.js.map +1 -0
- package/dist/components/icon-tile/style.module.scss +123 -0
- package/dist/components/index.d.ts +63 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +124 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/inline-link/index.d.ts +41 -0
- package/dist/components/inline-link/index.d.ts.map +1 -0
- package/dist/components/interactive/index.d.ts +27 -0
- package/dist/components/interactive/index.d.ts.map +1 -0
- package/dist/components/interactive/index.js.map +1 -0
- package/dist/components/legacy-button/index.d.ts +6 -0
- package/dist/components/legacy-button/index.d.ts.map +1 -0
- package/dist/components/legacy-button/index.js.map +1 -0
- package/dist/components/legacy-button/types.d.ts +38 -0
- package/dist/components/legacy-button/types.d.ts.map +1 -0
- package/dist/components/legacy-button/utils.d.ts +10 -0
- package/dist/components/legacy-button/utils.d.ts.map +1 -0
- package/dist/components/legacy-button/utils.js.map +1 -0
- package/dist/components/menu-primitive/index.d.ts +15 -0
- package/dist/components/menu-primitive/index.d.ts.map +1 -0
- package/dist/components/menu-primitive/index.js.map +1 -0
- package/dist/components/menu-primitive/use-menu-primitive.d.ts +10 -0
- package/dist/components/menu-primitive/use-menu-primitive.d.ts.map +1 -0
- package/dist/components/menu-primitive/use-menu-primitive.js.map +1 -0
- package/dist/components/modal/index.d.ts +14 -0
- package/dist/components/modal/index.d.ts.map +1 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/use-modal.d.ts +9 -0
- package/dist/components/modal/use-modal.d.ts.map +1 -0
- package/dist/components/modal/use-modal.js.map +1 -0
- package/dist/components/separator/index.d.ts +11 -0
- package/dist/components/separator/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +14 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +30 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/skeleton-form/index.d.ts +8 -0
- package/dist/components/skeleton/skeleton-form/index.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-form/index.js +19 -0
- package/dist/components/skeleton/skeleton-form/index.js.map +1 -0
- package/dist/components/skeleton/skeleton-form/skeleton-form.module.css +32 -0
- package/dist/components/skeleton/skeleton-form/skeleton-form.module.css.js +11 -0
- package/dist/components/skeleton/skeleton-form/skeleton-form.module.css.js.map +1 -0
- package/dist/components/skeleton/skeleton.module.css +87 -0
- package/dist/components/skeleton/skeleton.module.css.js +19 -0
- package/dist/components/skeleton/skeleton.module.css.js.map +1 -0
- package/dist/components/standalone-link/index.d.ts +24 -0
- package/dist/components/standalone-link/index.d.ts.map +1 -0
- package/dist/components/standalone-link/index.js.map +1 -0
- package/dist/components/standalone-link/styles.module.scss +164 -0
- package/dist/components/table/index.d.ts +59 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/td.d.ts +18 -0
- package/dist/components/table/td.d.ts.map +1 -0
- package/dist/components/table/td.js.map +1 -0
- package/dist/components/table/th-button-tooltip.d.ts +7 -0
- package/dist/components/table/th-button-tooltip.d.ts.map +1 -0
- package/dist/components/table/th.d.ts +35 -0
- package/dist/components/table/th.d.ts.map +1 -0
- package/dist/components/table/th.js.map +1 -0
- package/dist/components/table/tr.d.ts +13 -0
- package/dist/components/table/tr.d.ts.map +1 -0
- package/dist/components/table/utils.d.ts +17 -0
- package/dist/components/table/utils.d.ts.map +1 -0
- package/dist/components/table/utils.js.map +1 -0
- package/dist/components/tabs/index.d.ts +22 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tab-panel.d.ts +6 -0
- package/dist/components/tabs/tab-panel.d.ts.map +1 -0
- package/dist/components/tabs/tab-panel.js.map +1 -0
- package/dist/components/tabs/tab.d.ts +25 -0
- package/dist/components/tabs/tab.d.ts.map +1 -0
- package/dist/components/tabs/tab.js.map +1 -0
- package/dist/components/tabs/tabs.module.scss +120 -0
- package/dist/components/tabs/use-tabs-context.d.ts +16 -0
- package/dist/components/tabs/use-tabs-context.d.ts.map +1 -0
- package/dist/components/tabs/use-tabs-context.js.map +1 -0
- package/dist/components/text/index.d.ts +70 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.d.ts +9 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.d.ts.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +63 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.d.ts +44 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.d.ts.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.js +104 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.d.ts +11 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.d.ts.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css +76 -0
- package/dist/components/visualizations/bar-chart/index.d.ts +14 -0
- package/dist/components/visualizations/bar-chart/index.d.ts.map +1 -0
- package/dist/components/visualizations/bar-chart/style.module.css +37 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts +4 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts.map +1 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/index.d.ts +4 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/index.d.ts.map +1 -0
- package/dist/components/visualizations/donut-chart/components/index.d.ts +4 -0
- package/dist/components/visualizations/donut-chart/components/index.d.ts.map +1 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts +4 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts.map +1 -0
- package/dist/components/visualizations/donut-chart/index.d.ts +11 -0
- package/dist/components/visualizations/donut-chart/index.d.ts.map +1 -0
- package/dist/components/visualizations/donut-chart/index.js +91 -0
- package/dist/components/visualizations/donut-chart/index.js.map +1 -0
- package/dist/components/visualizations/donut-chart/styles.module.css +71 -0
- package/dist/components/visualizations/donut-chart/types.d.ts +17 -0
- package/dist/components/visualizations/donut-chart/types.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns/card/index.d.ts +6 -0
- package/dist/patterns/card/index.d.ts.map +1 -0
- package/dist/patterns/card/newsroom-card/index.d.ts +16 -0
- package/dist/patterns/card/newsroom-card/index.d.ts.map +1 -0
- package/dist/patterns/card/partner-card/index.d.ts +19 -0
- package/dist/patterns/card/partner-card/index.d.ts.map +1 -0
- package/dist/patterns/card/person-card/index.d.ts +16 -0
- package/dist/patterns/card/person-card/index.d.ts.map +1 -0
- package/dist/patterns/card/primitives.d.ts +38 -0
- package/dist/patterns/card/primitives.d.ts.map +1 -0
- package/dist/patterns/card/promo-card/index.d.ts +19 -0
- package/dist/patterns/card/promo-card/index.d.ts.map +1 -0
- package/dist/patterns/card/resource-card/index.d.ts +17 -0
- package/dist/patterns/card/resource-card/index.d.ts.map +1 -0
- package/dist/patterns/card/style.module.css +119 -0
- package/dist/patterns/card/thumbnails/index.d.ts +14 -0
- package/dist/patterns/card/thumbnails/index.d.ts.map +1 -0
- package/dist/patterns/card/types.d.ts +42 -0
- package/dist/patterns/card/types.d.ts.map +1 -0
- package/dist/patterns/card/unified-card/index.d.ts +11 -0
- package/dist/patterns/card/unified-card/index.d.ts.map +1 -0
- package/dist/patterns/card/unified-card/index.js.map +1 -0
- package/dist/patterns/copy-button/index.d.ts +20 -0
- package/dist/patterns/copy-button/index.d.ts.map +1 -0
- package/dist/patterns/copy-button/index.js +57 -0
- package/dist/patterns/copy-button/index.js.map +1 -0
- package/dist/patterns/index.d.ts +16 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/layout/index.d.ts +70 -0
- package/dist/patterns/layout/index.d.ts.map +1 -0
- package/dist/patterns/layout/layout.module.css +66 -0
- package/dist/patterns/product-badge/index.d.ts +12 -0
- package/dist/patterns/product-badge/index.d.ts.map +1 -0
- package/dist/patterns/product-badge/style.module.css +3 -0
- package/dist/patterns/product-logo/index.d.ts +49 -0
- package/dist/patterns/product-logo/index.d.ts.map +1 -0
- package/dist/patterns/related-content/index.d.ts +7 -0
- package/dist/patterns/related-content/index.d.ts.map +1 -0
- package/dist/patterns/related-content/style.module.css +74 -0
- package/dist/patterns/related-content/types.d.ts +15 -0
- package/dist/patterns/related-content/types.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/styles/mixins/button.scss +224 -0
- package/dist/styles/mixins/focus-ring.scss +68 -0
- package/dist/utils/clipboard.d.ts +17 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +78 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/get-contrast-yiq.d.ts +21 -0
- package/dist/utils/get-contrast-yiq.d.ts.map +1 -0
- package/dist/utils/get-contrast-yiq.js.map +1 -0
- package/dist/utils/hooks/use-media-query/index.d.ts +2 -0
- package/dist/utils/hooks/use-media-query/index.d.ts.map +1 -0
- package/dist/utils/hooks/use-media-query/index.js +16 -0
- package/dist/utils/hooks/use-media-query/index.js.map +1 -0
- package/dist/utils/hooks/use-screen-size/index.d.ts +6 -0
- package/dist/utils/hooks/use-screen-size/index.d.ts.map +1 -0
- package/dist/utils/hooks/use-screen-size/index.js +10 -0
- package/dist/utils/hooks/use-screen-size/index.js.map +1 -0
- package/dist/utils/i18n/constants/index.d.ts +15 -0
- package/dist/utils/i18n/constants/index.d.ts.map +1 -0
- package/dist/utils/i18n/constants/index.js.map +1 -0
- package/dist/utils/i18n/helpers/index.d.ts +6 -0
- package/dist/utils/i18n/helpers/index.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/is-supported-local.d.ts +3 -0
- package/dist/utils/i18n/helpers/is-supported-local.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/is-supported-local.js +8 -0
- package/dist/utils/i18n/helpers/is-supported-local.js.map +1 -0
- package/dist/utils/i18n/helpers/locale-provider.d.ts +15 -0
- package/dist/utils/i18n/helpers/locale-provider.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/locale-provider.js +19 -0
- package/dist/utils/i18n/helpers/locale-provider.js.map +1 -0
- package/dist/utils/i18n/helpers/to-smart-sentence-case.d.ts +3 -0
- package/dist/utils/i18n/helpers/to-smart-sentence-case.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/to-smart-sentence-case.js.map +1 -0
- package/dist/utils/i18n/helpers/to-smart-title-case.d.ts +3 -0
- package/dist/utils/i18n/helpers/to-smart-title-case.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/to-smart-title-case.js.map +1 -0
- package/dist/utils/i18n/helpers/use-locale.d.ts +3 -0
- package/dist/utils/i18n/helpers/use-locale.d.ts.map +1 -0
- package/dist/utils/i18n/helpers/use-locale.js +14 -0
- package/dist/utils/i18n/helpers/use-locale.js.map +1 -0
- package/dist/utils/i18n/index.d.ts +12 -0
- package/dist/utils/i18n/index.d.ts.map +1 -0
- package/dist/utils/i18n/index.js.map +1 -0
- package/dist/utils/i18n/types.d.ts +3 -0
- package/dist/utils/i18n/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/make-normalizer/index.d.ts +31 -0
- package/dist/utils/make-normalizer/index.d.ts.map +1 -0
- package/dist/utils/make-normalizer/index.js.map +1 -0
- package/dist/utils/mds-context/index.d.ts +60 -0
- package/dist/utils/mds-context/index.d.ts.map +1 -0
- package/dist/utils/mds-context/index.js.map +1 -0
- package/package.json +116 -75
- package/components/accordion/index.d.ts +0 -14
- package/components/accordion/item/button.d.ts +0 -6
- package/components/accordion/item/index.d.ts +0 -24
- package/components/accordion/item/index.js.map +0 -1
- package/components/accordion/style.module.scss +0 -110
- package/components/alert/alert.module.scss +0 -229
- package/components/alert/icon.d.ts +0 -9
- package/components/alert/index.d.ts +0 -62
- package/components/alert/index.js.map +0 -1
- package/components/badge/index.d.ts +0 -31
- package/components/badge/index.js.map +0 -1
- package/components/badge/style.module.scss +0 -113
- package/components/badge-count/index.d.ts +0 -15
- package/components/badge-count/index.js.map +0 -1
- package/components/badge-count/style.module.scss +0 -91
- package/components/breadcrumbs/index.d.ts +0 -7
- package/components/breadcrumbs/index.js.map +0 -1
- package/components/breadcrumbs/item/index.d.ts +0 -2
- package/components/breadcrumbs/style.module.scss +0 -183
- package/components/breadcrumbs/truncation-button/index.d.ts +0 -3
- package/components/breadcrumbs/types/index.d.ts +0 -51
- package/components/button/button-primitive.d.ts +0 -5
- package/components/button/button-primitive.js.map +0 -1
- package/components/button/index.d.ts +0 -30
- package/components/button/styles.module.scss +0 -221
- package/components/card/card-thumbnail/index.d.ts +0 -2
- package/components/card/index.d.ts +0 -4
- package/components/card/index.js.map +0 -1
- package/components/card/types.d.ts +0 -53
- package/components/code-block/code-block.module.scss +0 -511
- package/components/code-block/code-lines/index.d.ts +0 -12
- package/components/code-block/code-lines/utils/split-html-into-lines.d.ts +0 -19
- package/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts +0 -21
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +0 -1
- package/components/code-block/hidden-copy-content/index.d.ts +0 -5
- package/components/code-block/hidden-copy-content/index.js.map +0 -1
- package/components/code-block/index.d.ts +0 -55
- package/components/code-block/index.js.map +0 -1
- package/components/code-block/utils/parse-highlighted-lines.d.ts +0 -2
- package/components/code-block/utils/parse-highlighted-lines.js.map +0 -1
- package/components/code-block/utils/process-snippet.d.ts +0 -12
- package/components/code-block/utils/shellwords.d.ts +0 -14
- package/components/code-block/utils/shellwords.js.map +0 -1
- package/components/combo-box-primitive/index.d.ts +0 -69
- package/components/combo-box-primitive/index.js.map +0 -1
- package/components/dialog-primitive/index.d.ts +0 -12
- package/components/dialog-primitive/index.js.map +0 -1
- package/components/disclosure-primitive/index.d.ts +0 -19
- package/components/disclosure-primitive/index.js.map +0 -1
- package/components/disclosure-primitive/use-disclosure-primitive.d.ts +0 -11
- package/components/disclosure-primitive/use-disclosure-primitive.js.map +0 -1
- package/components/dismiss-button/index.d.ts +0 -9
- package/components/dismiss-button/styles.module.scss +0 -31
- package/components/dropdown/index.d.ts +0 -72
- package/components/dropdown/index.js.map +0 -1
- package/components/dropdown/list-item/custom.d.ts +0 -10
- package/components/dropdown/list-item/index.d.ts +0 -19
- package/components/dropdown/list-item/interactive.d.ts +0 -29
- package/components/dropdown/list-item/separator.d.ts +0 -8
- package/components/dropdown/list-item/styles.module.css +0 -222
- package/components/dropdown/list-item/title.d.ts +0 -10
- package/components/dropdown/list-item/title.js.map +0 -1
- package/components/dropdown/toggle-button/index.d.ts +0 -30
- package/components/dropdown/toggle-button/index.js.map +0 -1
- package/components/dropdown/toggle-button/styles.module.scss +0 -54
- package/components/flight-icon/index.d.ts +0 -44
- package/components/flight-icon/index.js.map +0 -1
- package/components/form/checkbox/form-checkbox.module.css +0 -88
- package/components/form/checkbox/index.d.ts +0 -45
- package/components/form/error/index.d.ts +0 -16
- package/components/form/field/index.d.ts +0 -19
- package/components/form/fieldset/index.d.ts +0 -18
- package/components/form/file-input/form-file-input.module.scss +0 -81
- package/components/form/file-input/index.d.ts +0 -27
- package/components/form/helper-text/index.d.ts +0 -11
- package/components/form/indicator/index.d.ts +0 -9
- package/components/form/label/index.d.ts +0 -14
- package/components/form/legend/index.d.ts +0 -12
- package/components/form/radio/form-radio.module.scss +0 -74
- package/components/form/radio/index.d.ts +0 -42
- package/components/form/radio-card/description.d.ts +0 -3
- package/components/form/radio-card/form-radio-card.module.css +0 -153
- package/components/form/radio-card/group.d.ts +0 -11
- package/components/form/radio-card/index.d.ts +0 -48
- package/components/form/radio-card/index.js.map +0 -1
- package/components/form/radio-card/label.d.ts +0 -3
- package/components/form/select/form-select.module.css +0 -89
- package/components/form/select/index.d.ts +0 -22
- package/components/form/select/index.js.map +0 -1
- package/components/form/super-select/form-super-select.module.css +0 -155
- package/components/form/super-select/index.d.ts +0 -55
- package/components/form/super-select/index.js.map +0 -1
- package/components/form/text-input/index.d.ts +0 -98
- package/components/form/text-input/index.js.map +0 -1
- package/components/form/text-input/styles.module.css +0 -158
- package/components/form/textarea/form-textarea.module.css +0 -88
- package/components/form/textarea/index.d.ts +0 -19
- package/components/form/textarea/index.js.map +0 -1
- package/components/form/toggle/form-toggle.module.scss +0 -164
- package/components/form/toggle/index.d.ts +0 -78
- package/components/hds/wrappers/tooltip.d.ts +0 -13
- package/components/icon-tile/index.d.ts +0 -21
- package/components/icon-tile/index.js.map +0 -1
- package/components/icon-tile/style.module.scss +0 -138
- package/components/index.d.ts +0 -60
- package/components/index.js +0 -120
- package/components/index.js.map +0 -1
- package/components/inline-link/index.d.ts +0 -40
- package/components/interactive/index.d.ts +0 -26
- package/components/interactive/index.js.map +0 -1
- package/components/legacy-button/index.d.ts +0 -5
- package/components/legacy-button/index.js.map +0 -1
- package/components/legacy-button/types.d.ts +0 -37
- package/components/legacy-button/utils.d.ts +0 -9
- package/components/legacy-button/utils.js.map +0 -1
- package/components/menu-primitive/index.d.ts +0 -14
- package/components/menu-primitive/index.js.map +0 -1
- package/components/menu-primitive/use-menu-primitive.d.ts +0 -9
- package/components/menu-primitive/use-menu-primitive.js.map +0 -1
- package/components/modal/index.d.ts +0 -13
- package/components/modal/index.js.map +0 -1
- package/components/modal/use-modal.d.ts +0 -8
- package/components/modal/use-modal.js.map +0 -1
- package/components/separator/index.d.ts +0 -10
- package/components/standalone-link/index.d.ts +0 -23
- package/components/standalone-link/index.js.map +0 -1
- package/components/standalone-link/styles.module.scss +0 -166
- package/components/table/index.d.ts +0 -58
- package/components/table/index.js.map +0 -1
- package/components/table/td.d.ts +0 -17
- package/components/table/td.js.map +0 -1
- package/components/table/th-button-tooltip.d.ts +0 -6
- package/components/table/th.d.ts +0 -34
- package/components/table/th.js.map +0 -1
- package/components/table/tr.d.ts +0 -12
- package/components/table/utils.d.ts +0 -16
- package/components/table/utils.js.map +0 -1
- package/components/tabs/index.d.ts +0 -21
- package/components/tabs/index.js.map +0 -1
- package/components/tabs/tab-panel.d.ts +0 -5
- package/components/tabs/tab-panel.js.map +0 -1
- package/components/tabs/tab.d.ts +0 -24
- package/components/tabs/tab.js.map +0 -1
- package/components/tabs/tabs.module.scss +0 -163
- package/components/tabs/use-tabs-context.d.ts +0 -15
- package/components/tabs/use-tabs-context.js.map +0 -1
- package/components/text/index.d.ts +0 -69
- package/components/text/index.js.map +0 -1
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.d.ts +0 -8
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +0 -62
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +0 -1
- package/components/visualizations/bar-chart/horizontal-chart/index.d.ts +0 -44
- package/components/visualizations/bar-chart/horizontal-chart/index.js +0 -104
- package/components/visualizations/bar-chart/horizontal-chart/index.js.map +0 -1
- package/components/visualizations/bar-chart/horizontal-chart/legend/index.d.ts +0 -10
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css +0 -76
- package/components/visualizations/bar-chart/index.d.ts +0 -13
- package/components/visualizations/bar-chart/style.module.css +0 -39
- package/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts +0 -3
- package/components/visualizations/donut-chart/components/external-arc-label/index.d.ts +0 -3
- package/components/visualizations/donut-chart/components/index.d.ts +0 -3
- package/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts +0 -3
- package/components/visualizations/donut-chart/index.d.ts +0 -10
- package/components/visualizations/donut-chart/index.js +0 -90
- package/components/visualizations/donut-chart/index.js.map +0 -1
- package/components/visualizations/donut-chart/styles.module.css +0 -73
- package/components/visualizations/donut-chart/types.d.ts +0 -16
- package/hooks/use-media-query/index.js +0 -16
- package/hooks/use-media-query/index.js.map +0 -1
- package/index.d.ts +0 -3
- package/index.js +0 -163
- package/index.js.map +0 -1
- package/patterns/card/index.d.ts +0 -5
- package/patterns/card/newsroom-card/index.d.ts +0 -15
- package/patterns/card/partner-card/index.d.ts +0 -18
- package/patterns/card/person-card/index.d.ts +0 -15
- package/patterns/card/primitives.d.ts +0 -37
- package/patterns/card/promo-card/index.d.ts +0 -18
- package/patterns/card/resource-card/index.d.ts +0 -16
- package/patterns/card/style.module.css +0 -121
- package/patterns/card/thumbnails/index.d.ts +0 -13
- package/patterns/card/types.d.ts +0 -41
- package/patterns/card/unified-card/index.d.ts +0 -10
- package/patterns/card/unified-card/index.js.map +0 -1
- package/patterns/copy-button/clipboard.d.ts +0 -16
- package/patterns/copy-button/clipboard.js +0 -78
- package/patterns/copy-button/clipboard.js.map +0 -1
- package/patterns/copy-button/index.d.ts +0 -19
- package/patterns/copy-button/index.js +0 -57
- package/patterns/copy-button/index.js.map +0 -1
- package/patterns/index.d.ts +0 -15
- package/patterns/layout/index.d.ts +0 -69
- package/patterns/layout/layout.module.css +0 -72
- package/patterns/product-badge/index.d.ts +0 -11
- package/patterns/product-badge/style.module.css +0 -3
- package/patterns/product-logo/index.d.ts +0 -48
- package/patterns/related-content/index.d.ts +0 -6
- package/patterns/related-content/style.module.css +0 -74
- package/patterns/related-content/types.d.ts +0 -14
- package/style.css +0 -1
- package/styles/mixins/button.scss +0 -279
- package/styles/mixins/focus-ring.scss +0 -75
- package/utils/get-contrast-yiq.d.ts +0 -20
- package/utils/get-contrast-yiq.js.map +0 -1
- package/utils/hooks/use-screen-size.d.ts +0 -5
- package/utils/hooks/use-screen-size.js +0 -10
- package/utils/hooks/use-screen-size.js.map +0 -1
- package/utils/i18n/constants/index.js.map +0 -1
- package/utils/i18n/helpers/index.d.ts +0 -4
- package/utils/i18n/helpers/index.js +0 -8
- package/utils/i18n/helpers/index.js.map +0 -1
- package/utils/i18n/helpers/locale-provider.d.ts +0 -14
- package/utils/i18n/helpers/locale-provider.js +0 -19
- package/utils/i18n/helpers/locale-provider.js.map +0 -1
- package/utils/i18n/helpers/to-smart-sentence-case.d.ts +0 -2
- package/utils/i18n/helpers/to-smart-sentence-case.js.map +0 -1
- package/utils/i18n/helpers/to-smart-title-case.d.ts +0 -2
- package/utils/i18n/helpers/to-smart-title-case.js.map +0 -1
- package/utils/i18n/helpers/use-locale.d.ts +0 -2
- package/utils/i18n/helpers/use-locale.js +0 -14
- package/utils/i18n/helpers/use-locale.js.map +0 -1
- package/utils/i18n/index.d.ts +0 -11
- package/utils/i18n/index.js.map +0 -1
- package/utils/index.d.ts +0 -4
- package/utils/index.js +0 -14
- package/utils/index.js.map +0 -1
- package/utils/make-normalizer/index.d.ts +0 -30
- package/utils/make-normalizer/index.js.map +0 -1
- package/utils/mds-context/index.d.ts +0 -59
- package/utils/mds-context/index.js.map +0 -1
- /package/{components → dist/components}/accordion/index.js +0 -0
- /package/{components → dist/components}/accordion/index.js.map +0 -0
- /package/{components → dist/components}/accordion/item/button.js +0 -0
- /package/{components → dist/components}/accordion/item/button.js.map +0 -0
- /package/{components → dist/components}/accordion/item/index.js +0 -0
- /package/{components → dist/components}/accordion/style.module.scss.js +0 -0
- /package/{components → dist/components}/accordion/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/alert/alert.module.scss.js +0 -0
- /package/{components → dist/components}/alert/alert.module.scss.js.map +0 -0
- /package/{components → dist/components}/alert/icon.js +0 -0
- /package/{components → dist/components}/alert/icon.js.map +0 -0
- /package/{components → dist/components}/alert/index.js +0 -0
- /package/{components → dist/components}/badge/index.js +0 -0
- /package/{components → dist/components}/badge/style.module.scss.js +0 -0
- /package/{components → dist/components}/badge/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/badge-count/index.js +0 -0
- /package/{components → dist/components}/badge-count/style.module.scss.js +0 -0
- /package/{components → dist/components}/badge-count/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/breadcrumbs/index.js +0 -0
- /package/{components → dist/components}/breadcrumbs/item/index.js +0 -0
- /package/{components → dist/components}/breadcrumbs/item/index.js.map +0 -0
- /package/{components → dist/components}/breadcrumbs/style.module.scss.js +0 -0
- /package/{components → dist/components}/breadcrumbs/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/breadcrumbs/truncation-button/index.js +0 -0
- /package/{components → dist/components}/breadcrumbs/truncation-button/index.js.map +0 -0
- /package/{components → dist/components}/button/button-primitive.js +0 -0
- /package/{components → dist/components}/button/index.js +0 -0
- /package/{components → dist/components}/button/index.js.map +0 -0
- /package/{components → dist/components}/button/styles.module.scss.js +0 -0
- /package/{components → dist/components}/button/styles.module.scss.js.map +0 -0
- /package/{components → dist/components}/card/card-thumbnail/card-thumbnail.module.css +0 -0
- /package/{components → dist/components}/card/card-thumbnail/card-thumbnail.module.css.js +0 -0
- /package/{components → dist/components}/card/card-thumbnail/card-thumbnail.module.css.js.map +0 -0
- /package/{components → dist/components}/card/card-thumbnail/index.js +0 -0
- /package/{components → dist/components}/card/card-thumbnail/index.js.map +0 -0
- /package/{components → dist/components}/card/index.js +0 -0
- /package/{components → dist/components}/card/styles.module.css +0 -0
- /package/{components → dist/components}/card/styles.module.css.js +0 -0
- /package/{components → dist/components}/card/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/code-block/code-block.module.scss.js +0 -0
- /package/{components → dist/components}/code-block/code-block.module.scss.js.map +0 -0
- /package/{components → dist/components}/code-block/code-lines/index.js +0 -0
- /package/{components → dist/components}/code-block/code-lines/index.js.map +0 -0
- /package/{components → dist/components}/code-block/code-lines/utils/split-html-into-lines.js +0 -0
- /package/{components → dist/components}/code-block/code-lines/utils/split-html-into-lines.js.map +0 -0
- /package/{components → dist/components}/code-block/code-lines/utils/split-jsx-into-lines.js +0 -0
- /package/{components → dist/components}/code-block/hidden-copy-content/index.js +0 -0
- /package/{components → dist/components}/code-block/index.js +0 -0
- /package/{components → dist/components}/code-block/utils/parse-highlighted-lines.js +0 -0
- /package/{components → dist/components}/code-block/utils/process-snippet.js +0 -0
- /package/{components → dist/components}/code-block/utils/process-snippet.js.map +0 -0
- /package/{components → dist/components}/code-block/utils/shellwords.js +0 -0
- /package/{components → dist/components}/combo-box-primitive/index.js +0 -0
- /package/{components → dist/components}/dialog-primitive/dialog.module.scss +0 -0
- /package/{components → dist/components}/dialog-primitive/dialog.module.scss.js +0 -0
- /package/{components → dist/components}/dialog-primitive/dialog.module.scss.js.map +0 -0
- /package/{components → dist/components}/dialog-primitive/index.js +0 -0
- /package/{components → dist/components}/disclosure-primitive/index.js +0 -0
- /package/{components → dist/components}/disclosure-primitive/styles.module.css +0 -0
- /package/{components → dist/components}/disclosure-primitive/styles.module.css.js +0 -0
- /package/{components → dist/components}/disclosure-primitive/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/disclosure-primitive/use-disclosure-primitive.js +0 -0
- /package/{components → dist/components}/dismiss-button/index.js +0 -0
- /package/{components → dist/components}/dismiss-button/index.js.map +0 -0
- /package/{components → dist/components}/dismiss-button/styles.module.scss.js +0 -0
- /package/{components → dist/components}/dismiss-button/styles.module.scss.js.map +0 -0
- /package/{components → dist/components}/dropdown/index.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/custom.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/custom.js.map +0 -0
- /package/{components → dist/components}/dropdown/list-item/index.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/index.js.map +0 -0
- /package/{components → dist/components}/dropdown/list-item/interactive.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/interactive.js.map +0 -0
- /package/{components → dist/components}/dropdown/list-item/separator.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/separator.js.map +0 -0
- /package/{components → dist/components}/dropdown/list-item/styles.module.css.js +0 -0
- /package/{components → dist/components}/dropdown/list-item/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/dropdown/list-item/title.js +0 -0
- /package/{components → dist/components}/dropdown/styles.module.css +0 -0
- /package/{components → dist/components}/dropdown/styles.module.css.js +0 -0
- /package/{components → dist/components}/dropdown/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/dropdown/toggle-button/index.js +0 -0
- /package/{components → dist/components}/dropdown/toggle-button/styles.module.scss.js +0 -0
- /package/{components → dist/components}/dropdown/toggle-button/styles.module.scss.js.map +0 -0
- /package/{components → dist/components}/flight-icon/flight-icon.module.css +0 -0
- /package/{components → dist/components}/flight-icon/flight-icon.module.css.js +0 -0
- /package/{components → dist/components}/flight-icon/flight-icon.module.css.js.map +0 -0
- /package/{components → dist/components}/flight-icon/index.js +0 -0
- /package/{components → dist/components}/form/checkbox/form-checkbox.module.css.js +0 -0
- /package/{components → dist/components}/form/checkbox/form-checkbox.module.css.js.map +0 -0
- /package/{components → dist/components}/form/checkbox/index.js +0 -0
- /package/{components → dist/components}/form/checkbox/index.js.map +0 -0
- /package/{components → dist/components}/form/error/form-error.module.css +0 -0
- /package/{components → dist/components}/form/error/form-error.module.css.js +0 -0
- /package/{components → dist/components}/form/error/form-error.module.css.js.map +0 -0
- /package/{components → dist/components}/form/error/index.js +0 -0
- /package/{components → dist/components}/form/error/index.js.map +0 -0
- /package/{components → dist/components}/form/field/form-field.module.css +0 -0
- /package/{components → dist/components}/form/field/form-field.module.css.js +0 -0
- /package/{components → dist/components}/form/field/form-field.module.css.js.map +0 -0
- /package/{components → dist/components}/form/field/index.js +0 -0
- /package/{components → dist/components}/form/field/index.js.map +0 -0
- /package/{components → dist/components}/form/fieldset/form-fieldset.module.css +0 -0
- /package/{components → dist/components}/form/fieldset/form-fieldset.module.css.js +0 -0
- /package/{components → dist/components}/form/fieldset/form-fieldset.module.css.js.map +0 -0
- /package/{components → dist/components}/form/fieldset/index.js +0 -0
- /package/{components → dist/components}/form/fieldset/index.js.map +0 -0
- /package/{components → dist/components}/form/file-input/form-file-input.module.scss.js +0 -0
- /package/{components → dist/components}/form/file-input/form-file-input.module.scss.js.map +0 -0
- /package/{components → dist/components}/form/file-input/index.js +0 -0
- /package/{components → dist/components}/form/file-input/index.js.map +0 -0
- /package/{components → dist/components}/form/helper-text/form-helper-text.module.css +0 -0
- /package/{components → dist/components}/form/helper-text/form-helper-text.module.css.js +0 -0
- /package/{components → dist/components}/form/helper-text/form-helper-text.module.css.js.map +0 -0
- /package/{components → dist/components}/form/helper-text/index.js +0 -0
- /package/{components → dist/components}/form/helper-text/index.js.map +0 -0
- /package/{components → dist/components}/form/indicator/form-indicator.module.css +0 -0
- /package/{components → dist/components}/form/indicator/form-indicator.module.css.js +0 -0
- /package/{components → dist/components}/form/indicator/form-indicator.module.css.js.map +0 -0
- /package/{components → dist/components}/form/indicator/index.js +0 -0
- /package/{components → dist/components}/form/indicator/index.js.map +0 -0
- /package/{components → dist/components}/form/label/form-label.module.css +0 -0
- /package/{components → dist/components}/form/label/form-label.module.css.js +0 -0
- /package/{components → dist/components}/form/label/form-label.module.css.js.map +0 -0
- /package/{components → dist/components}/form/label/index.js +0 -0
- /package/{components → dist/components}/form/label/index.js.map +0 -0
- /package/{components → dist/components}/form/legend/form-legend.module.css +0 -0
- /package/{components → dist/components}/form/legend/form-legend.module.css.js +0 -0
- /package/{components → dist/components}/form/legend/form-legend.module.css.js.map +0 -0
- /package/{components → dist/components}/form/legend/index.js +0 -0
- /package/{components → dist/components}/form/legend/index.js.map +0 -0
- /package/{components → dist/components}/form/radio/form-radio.module.scss.js +0 -0
- /package/{components → dist/components}/form/radio/form-radio.module.scss.js.map +0 -0
- /package/{components → dist/components}/form/radio/index.js +0 -0
- /package/{components → dist/components}/form/radio/index.js.map +0 -0
- /package/{components → dist/components}/form/radio-card/RadioCardStory.css +0 -0
- /package/{components → dist/components}/form/radio-card/description.js +0 -0
- /package/{components → dist/components}/form/radio-card/description.js.map +0 -0
- /package/{components → dist/components}/form/radio-card/form-radio-card.module.css.js +0 -0
- /package/{components → dist/components}/form/radio-card/form-radio-card.module.css.js.map +0 -0
- /package/{components → dist/components}/form/radio-card/group.js +0 -0
- /package/{components → dist/components}/form/radio-card/group.js.map +0 -0
- /package/{components → dist/components}/form/radio-card/index.js +0 -0
- /package/{components → dist/components}/form/radio-card/label.js +0 -0
- /package/{components → dist/components}/form/radio-card/label.js.map +0 -0
- /package/{components → dist/components}/form/select/form-select.module.css.js +0 -0
- /package/{components → dist/components}/form/select/form-select.module.css.js.map +0 -0
- /package/{components → dist/components}/form/select/index.js +0 -0
- /package/{components → dist/components}/form/super-select/form-super-select.module.css.js +0 -0
- /package/{components → dist/components}/form/super-select/form-super-select.module.css.js.map +0 -0
- /package/{components → dist/components}/form/super-select/index.js +0 -0
- /package/{components → dist/components}/form/text-input/index.js +0 -0
- /package/{components → dist/components}/form/text-input/styles.module.css.js +0 -0
- /package/{components → dist/components}/form/text-input/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/form/textarea/form-textarea.module.css.js +0 -0
- /package/{components → dist/components}/form/textarea/form-textarea.module.css.js.map +0 -0
- /package/{components → dist/components}/form/textarea/index.js +0 -0
- /package/{components → dist/components}/form/toggle/form-toggle.module.scss.js +0 -0
- /package/{components → dist/components}/form/toggle/form-toggle.module.scss.js.map +0 -0
- /package/{components → dist/components}/form/toggle/index.js +0 -0
- /package/{components → dist/components}/form/toggle/index.js.map +0 -0
- /package/{components → dist/components}/hds/wrappers/tooltip.js +0 -0
- /package/{components → dist/components}/hds/wrappers/tooltip.js.map +0 -0
- /package/{components → dist/components}/icon-tile/index.js +0 -0
- /package/{components → dist/components}/icon-tile/style.module.scss.js +0 -0
- /package/{components → dist/components}/icon-tile/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/inline-link/index.js +0 -0
- /package/{components → dist/components}/inline-link/index.js.map +0 -0
- /package/{components → dist/components}/inline-link/inline-link.module.css +0 -0
- /package/{components → dist/components}/inline-link/inline-link.module.css.js +0 -0
- /package/{components → dist/components}/inline-link/inline-link.module.css.js.map +0 -0
- /package/{components → dist/components}/interactive/index.js +0 -0
- /package/{components → dist/components}/legacy-button/index.js +0 -0
- /package/{components → dist/components}/legacy-button/utils.js +0 -0
- /package/{components → dist/components}/menu-primitive/index.js +0 -0
- /package/{components → dist/components}/menu-primitive/styles.module.css +0 -0
- /package/{components → dist/components}/menu-primitive/styles.module.css.js +0 -0
- /package/{components → dist/components}/menu-primitive/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/menu-primitive/use-menu-primitive.js +0 -0
- /package/{components → dist/components}/modal/index.js +0 -0
- /package/{components → dist/components}/modal/modal.module.css +0 -0
- /package/{components → dist/components}/modal/modal.module.css.js +0 -0
- /package/{components → dist/components}/modal/modal.module.css.js.map +0 -0
- /package/{components → dist/components}/modal/use-modal.js +0 -0
- /package/{components → dist/components}/separator/index.js +0 -0
- /package/{components → dist/components}/separator/index.js.map +0 -0
- /package/{components → dist/components}/separator/separator.module.css +0 -0
- /package/{components → dist/components}/separator/separator.module.css.js +0 -0
- /package/{components → dist/components}/separator/separator.module.css.js.map +0 -0
- /package/{components → dist/components}/standalone-link/index.js +0 -0
- /package/{components → dist/components}/standalone-link/styles.module.scss.js +0 -0
- /package/{components → dist/components}/standalone-link/styles.module.scss.js.map +0 -0
- /package/{components → dist/components}/table/index.js +0 -0
- /package/{components → dist/components}/table/table.module.scss +0 -0
- /package/{components → dist/components}/table/table.module.scss.js +0 -0
- /package/{components → dist/components}/table/table.module.scss.js.map +0 -0
- /package/{components → dist/components}/table/td.js +0 -0
- /package/{components → dist/components}/table/th-button-tooltip.js +0 -0
- /package/{components → dist/components}/table/th-button-tooltip.js.map +0 -0
- /package/{components → dist/components}/table/th.js +0 -0
- /package/{components → dist/components}/table/tr.js +0 -0
- /package/{components → dist/components}/table/tr.js.map +0 -0
- /package/{components → dist/components}/table/utils.js +0 -0
- /package/{components → dist/components}/tabs/index.js +0 -0
- /package/{components → dist/components}/tabs/tab-panel.js +0 -0
- /package/{components → dist/components}/tabs/tab.js +0 -0
- /package/{components → dist/components}/tabs/tabs.module.scss.js +0 -0
- /package/{components → dist/components}/tabs/tabs.module.scss.js.map +0 -0
- /package/{components → dist/components}/tabs/use-tabs-context.js +0 -0
- /package/{components → dist/components}/text/index.js +0 -0
- /package/{components → dist/components}/text/style.module.scss +0 -0
- /package/{components → dist/components}/text/style.module.scss.js +0 -0
- /package/{components → dist/components}/text/style.module.scss.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/legend/index.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/legend/index.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/legend/style.module.css +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/style.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/horizontal-chart/style.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/index.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/index.js.map +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/style.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/bar-chart/style.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/arc-tooltip/index.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/arc-tooltip/index.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/arc-tooltip/styles.module.css +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/external-arc-label/index.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/external-arc-label/index.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/external-arc-label/styles.module.css +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/external-arc-label/styles.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/external-arc-label/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/internal-arc-label/index.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/internal-arc-label/index.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/internal-arc-label/styles.module.css +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js.map +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/styles.module.css.js +0 -0
- /package/{components → dist/components}/visualizations/donut-chart/styles.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/card/newsroom-card/index.js +0 -0
- /package/{patterns → dist/patterns}/card/newsroom-card/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/newsroom-card/style.module.css +0 -0
- /package/{patterns → dist/patterns}/card/newsroom-card/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/card/newsroom-card/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/card/partner-card/index.js +0 -0
- /package/{patterns → dist/patterns}/card/partner-card/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/partner-card/style.module.css +0 -0
- /package/{patterns → dist/patterns}/card/partner-card/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/card/partner-card/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/card/person-card/index.js +0 -0
- /package/{patterns → dist/patterns}/card/person-card/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/person-card/style.module.css +0 -0
- /package/{patterns → dist/patterns}/card/person-card/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/card/person-card/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/card/primitives.js +0 -0
- /package/{patterns → dist/patterns}/card/primitives.js.map +0 -0
- /package/{patterns → dist/patterns}/card/promo-card/index.js +0 -0
- /package/{patterns → dist/patterns}/card/promo-card/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/resource-card/index.js +0 -0
- /package/{patterns → dist/patterns}/card/resource-card/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/card/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/card/thumbnails/index.js +0 -0
- /package/{patterns → dist/patterns}/card/thumbnails/index.js.map +0 -0
- /package/{patterns → dist/patterns}/card/unified-card/index.js +0 -0
- /package/{patterns → dist/patterns}/copy-button/style.module.css +0 -0
- /package/{patterns → dist/patterns}/copy-button/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/copy-button/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/index.js +0 -0
- /package/{patterns → dist/patterns}/index.js.map +0 -0
- /package/{patterns → dist/patterns}/layout/index.js +0 -0
- /package/{patterns → dist/patterns}/layout/index.js.map +0 -0
- /package/{patterns → dist/patterns}/layout/layout.module.css.js +0 -0
- /package/{patterns → dist/patterns}/layout/layout.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/product-badge/index.js +0 -0
- /package/{patterns → dist/patterns}/product-badge/index.js.map +0 -0
- /package/{patterns → dist/patterns}/product-badge/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/product-badge/style.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/product-logo/index.js +0 -0
- /package/{patterns → dist/patterns}/product-logo/index.js.map +0 -0
- /package/{patterns → dist/patterns}/product-logo/product-logo.module.css +0 -0
- /package/{patterns → dist/patterns}/product-logo/product-logo.module.css.js +0 -0
- /package/{patterns → dist/patterns}/product-logo/product-logo.module.css.js.map +0 -0
- /package/{patterns → dist/patterns}/related-content/index.js +0 -0
- /package/{patterns → dist/patterns}/related-content/index.js.map +0 -0
- /package/{patterns → dist/patterns}/related-content/style.module.css.js +0 -0
- /package/{patterns → dist/patterns}/related-content/style.module.css.js.map +0 -0
- /package/{utils → dist/utils}/get-contrast-yiq.js +0 -0
- /package/{utils → dist/utils}/i18n/constants/index.js +0 -0
- /package/{utils → dist/utils}/i18n/helpers/to-smart-sentence-case.js +0 -0
- /package/{utils → dist/utils}/i18n/helpers/to-smart-title-case.js +0 -0
- /package/{utils → dist/utils}/i18n/index.js +0 -0
- /package/{utils → dist/utils}/make-normalizer/index.js +0 -0
- /package/{utils → dist/utils}/mds-context/index.js +0 -0
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CODE-BLOCK
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
@use 'styles/mixins/focus-ring' as *;
|
|
6
|
-
|
|
7
|
-
// CODE-BLOCK PARENT/WRAPPER
|
|
8
|
-
.code-block {
|
|
9
|
-
--code-block-code-padding: 16px;
|
|
10
|
-
|
|
11
|
-
position: relative;
|
|
12
|
-
color: var(--code-block-color-foreground-primary);
|
|
13
|
-
background-color: var(--code-block-color-surface-primary);
|
|
14
|
-
border: 1px solid var(--code-block-color-border-strong);
|
|
15
|
-
|
|
16
|
-
pre,
|
|
17
|
-
code {
|
|
18
|
-
line-height: 1.4286;
|
|
19
|
-
white-space: pre;
|
|
20
|
-
text-align: left;
|
|
21
|
-
text-shadow: none;
|
|
22
|
-
word-wrap: normal;
|
|
23
|
-
word-break: normal;
|
|
24
|
-
word-spacing: normal;
|
|
25
|
-
tab-size: 4;
|
|
26
|
-
hyphens: none;
|
|
27
|
-
|
|
28
|
-
@media print {
|
|
29
|
-
text-shadow: none;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@media print {
|
|
34
|
-
.line-highlight {
|
|
35
|
-
/*
|
|
36
|
-
* This will prevent browsers from replacing the background color with white.
|
|
37
|
-
* It's necessary because the element is layered on top of the displayed code.
|
|
38
|
-
*/
|
|
39
|
-
-webkit-print-color-adjust: exact;
|
|
40
|
-
print-color-adjust: exact;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.dark {
|
|
46
|
-
// COLORS
|
|
47
|
-
|
|
48
|
-
// Descriptive color names:
|
|
49
|
-
|
|
50
|
-
--code-block-color-blue: #2d8eff;
|
|
51
|
-
--code-block-color-cyan: #32fff7;
|
|
52
|
-
--code-block-color-green: #86ff13;
|
|
53
|
-
--code-block-color-orange: #ffa800;
|
|
54
|
-
--code-block-color-purple: #c76cff;
|
|
55
|
-
--code-block-color-red: #ff3b20;
|
|
56
|
-
|
|
57
|
-
// Semantic color names:
|
|
58
|
-
|
|
59
|
-
// Base UI colors:
|
|
60
|
-
--code-block-color-foreground-primary: #d5d7db;
|
|
61
|
-
--code-block-color-foreground-faint: #b2b6bd;
|
|
62
|
-
--code-block-color-surface-primary: #0d0e12;
|
|
63
|
-
--code-block-color-surface-faint: #15181e;
|
|
64
|
-
// status ----
|
|
65
|
-
--code-block-color-foreground-success: #009241;
|
|
66
|
-
--code-block-color-foreground-critical: #ef3016;
|
|
67
|
-
// interactive ---
|
|
68
|
-
--code-block-color-foreground-interactive: #dedfe3;
|
|
69
|
-
--code-block-color-foreground-interactive-hover: #fff;
|
|
70
|
-
--code-block-color-foreground-interactive-active: #f1f2f3;
|
|
71
|
-
--code-block-color-surface-interactive-active: #2b303c;
|
|
72
|
-
// actions ---
|
|
73
|
-
--code-block-color-foreground-action: #2b89ff;
|
|
74
|
-
--code-block-color-foreground-action-hover: #389aff;
|
|
75
|
-
--code-block-color-foreground-action-active: #4ca1ff;
|
|
76
|
-
// borders
|
|
77
|
-
--code-block-color-border-strong: rgba(178, 182, 189, 40%); // #b2b6bd66
|
|
78
|
-
--code-block-color-border-primary: rgba(178, 182, 189, 20%); // #b2b6bd33
|
|
79
|
-
// selection
|
|
80
|
-
--code-block-color-foreground-selection: #0d0e12;
|
|
81
|
-
--code-block-color-surface-selection: #86ff13;
|
|
82
|
-
|
|
83
|
-
// CodeBlock UI:
|
|
84
|
-
// lines of code - highlighted ----
|
|
85
|
-
--code-block-color-line-highlight: rgba(0, 74, 222, 20%);
|
|
86
|
-
--code-block-color-line-highlight-border: #1555d4;
|
|
87
|
-
|
|
88
|
-
// Syntax highlighting tokens:
|
|
89
|
-
// general ----
|
|
90
|
-
--code-block-color-token: var(--code-block-color-foreground-primary);
|
|
91
|
-
// specific ----
|
|
92
|
-
--code-block-color-atrule: var(--code-block-color-blue);
|
|
93
|
-
--code-block-color-code-block-attr-name: var(--code-block-color-blue);
|
|
94
|
-
--code-block-color-attr-value: var(--code-block-color-blue);
|
|
95
|
-
--code-block-color-boolean: var(--code-block-color-purple);
|
|
96
|
-
--code-block-color-builtin: var(--code-block-color-orange);
|
|
97
|
-
--code-block-color-char: var(--code-block-color-orange);
|
|
98
|
-
--code-block-color-class-name: var(--code-block-color-blue);
|
|
99
|
-
--code-block-color-comment: var(--code-block-color-foreground-faint);
|
|
100
|
-
--code-block-color-control: var(--code-block-color-cyan);
|
|
101
|
-
--code-block-color-constant: var(--code-block-color-purple);
|
|
102
|
-
--code-block-color-deleted: var(--code-block-color-red);
|
|
103
|
-
--code-block-color-entity: var(--code-block-color-green);
|
|
104
|
-
--code-block-color-function: var(--code-block-color-blue);
|
|
105
|
-
--code-block-color-important: var(--code-block-color-red);
|
|
106
|
-
--code-block-color-keyword: var(--code-block-color-green);
|
|
107
|
-
--code-block-color-namespace: var(--code-block-color-red);
|
|
108
|
-
--code-block-color-number: var(--code-block-color-purple);
|
|
109
|
-
--code-block-color-operator: var(--code-block-color-cyan);
|
|
110
|
-
--code-block-color-prolog: var(--code-block-color-foreground-primary);
|
|
111
|
-
--code-block-color-property: var(--code-block-color-blue);
|
|
112
|
-
--code-block-color-punctuation: var(--code-block-color-foreground-primary);
|
|
113
|
-
--code-block-color-regex: var(--code-block-color-orange);
|
|
114
|
-
--code-block-color-script: var(--code-block-color-foreground-primary);
|
|
115
|
-
--code-block-color-selector: var(--code-block-color-green);
|
|
116
|
-
--code-block-color-string: var(--code-block-color-orange);
|
|
117
|
-
--code-block-color-symbol: var(--code-block-color-orange);
|
|
118
|
-
--code-block-color-tag: var(--code-block-color-green);
|
|
119
|
-
--code-block-color-url: var(--code-block-color-cyan);
|
|
120
|
-
// language-scoped:
|
|
121
|
-
// css ----
|
|
122
|
-
--code-block-color-lang-css: var(--code-block-color-purple);
|
|
123
|
-
--code-block-color-lang-css-token: var(--code-block-color-green);
|
|
124
|
-
--code-block-color-lang-css-atrule: var(--code-block-color-purple);
|
|
125
|
-
--code-block-color-lang-css-entity: var(--code-block-color-blue);
|
|
126
|
-
--code-block-color-lang-css-function: var(--code-block-color-cyan);
|
|
127
|
-
--code-block-color-lang-css-property: var(--code-block-color-cyan);
|
|
128
|
-
--code-block-color-lang-css-punctuation: var(--code-block-color-orange);
|
|
129
|
-
--code-block-color-lang-css-not-atrule: var(
|
|
130
|
-
--code-block-color-foreground-primary
|
|
131
|
-
);
|
|
132
|
-
--code-block-color-lang-css-selector: var(--code-block-color-blue);
|
|
133
|
-
--code-block-color-lang-css-url: var(--code-block-color-orange);
|
|
134
|
-
// javascript ----
|
|
135
|
-
--code-block-color-lang-js-constant: var(--code-block-color-orange);
|
|
136
|
-
// markup/html ----
|
|
137
|
-
--code-block-color-lang-markup-attr-value: var(--code-block-color-yellow);
|
|
138
|
-
--code-block-color-lang-markup-entity-named: var(--code-block-color-purple);
|
|
139
|
-
--code-block-color-lang-markup-entity-not-named: var(
|
|
140
|
-
--code-block-color-green
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Syntax highlighting ----
|
|
145
|
-
// General
|
|
146
|
-
.code-block {
|
|
147
|
-
// Common tokens
|
|
148
|
-
:global(.token.bold) {
|
|
149
|
-
font-weight: bold;
|
|
150
|
-
}
|
|
151
|
-
:global(.token.italic) {
|
|
152
|
-
font-style: italic;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// General tokens
|
|
156
|
-
:global(.token) {
|
|
157
|
-
color: var(--code-block-color-token);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
:global(.token.atrule) {
|
|
161
|
-
color: var(--code-block-color-atrule);
|
|
162
|
-
}
|
|
163
|
-
:global(.token.attr-name) {
|
|
164
|
-
color: var(--code-block-color-attr-name);
|
|
165
|
-
}
|
|
166
|
-
:global(.token.attr-value) {
|
|
167
|
-
color: var(--code-block-color-attr-value);
|
|
168
|
-
}
|
|
169
|
-
:global(.token.boolean) {
|
|
170
|
-
color: var(--code-block-color-boolean);
|
|
171
|
-
}
|
|
172
|
-
:global(.token.builtin) {
|
|
173
|
-
color: var(--code-block-color-builtin);
|
|
174
|
-
}
|
|
175
|
-
:global(.token.char) {
|
|
176
|
-
color: var(--code-block-color-char);
|
|
177
|
-
}
|
|
178
|
-
:global(.token.class-name) {
|
|
179
|
-
color: var(--code-block-color-class-name);
|
|
180
|
-
}
|
|
181
|
-
:global(.token.comment) {
|
|
182
|
-
color: var(--code-block-color-comment);
|
|
183
|
-
}
|
|
184
|
-
:global(.token.constant) {
|
|
185
|
-
color: var(--code-block-color-constant);
|
|
186
|
-
}
|
|
187
|
-
:global(.token.deleted) {
|
|
188
|
-
color: var(--code-block-color-deleted);
|
|
189
|
-
}
|
|
190
|
-
:global(.token.entity) {
|
|
191
|
-
color: var(--code-block-color-entity);
|
|
192
|
-
}
|
|
193
|
-
:global(.token.function) {
|
|
194
|
-
color: var(--code-block-color-function);
|
|
195
|
-
}
|
|
196
|
-
:global(.token.important) {
|
|
197
|
-
color: var(--code-block-color-important);
|
|
198
|
-
}
|
|
199
|
-
:global(.token.keyword) {
|
|
200
|
-
color: var(--code-block-color-keyword);
|
|
201
|
-
}
|
|
202
|
-
:global(.token.namespace) {
|
|
203
|
-
color: var(--code-block-color-namespace);
|
|
204
|
-
}
|
|
205
|
-
:global(.token.number) {
|
|
206
|
-
color: var(--code-block-color-number);
|
|
207
|
-
}
|
|
208
|
-
:global(.token.operator) {
|
|
209
|
-
color: var(--code-block-color-operator);
|
|
210
|
-
}
|
|
211
|
-
:global(.token.punctuation) {
|
|
212
|
-
color: var(--code-block-color-punctuation);
|
|
213
|
-
}
|
|
214
|
-
:global(.token.prolog) {
|
|
215
|
-
color: var(--code-block-color-prolog);
|
|
216
|
-
}
|
|
217
|
-
:global(.token.property) {
|
|
218
|
-
color: var(--code-block-color-property);
|
|
219
|
-
}
|
|
220
|
-
:global(.token.regex) {
|
|
221
|
-
color: var(--code-block-color-regex);
|
|
222
|
-
}
|
|
223
|
-
:global(.token.script) {
|
|
224
|
-
color: var(--code-block-color-script);
|
|
225
|
-
}
|
|
226
|
-
:global(.token.selector) {
|
|
227
|
-
color: var(--code-block-color-selector);
|
|
228
|
-
}
|
|
229
|
-
:global(.token.string) {
|
|
230
|
-
color: var(--code-block-color-string);
|
|
231
|
-
}
|
|
232
|
-
:global(.token.symbol) {
|
|
233
|
-
color: var(--code-block-color-symbol);
|
|
234
|
-
}
|
|
235
|
-
:global(.token.tag) {
|
|
236
|
-
color: var(--code-block-color-tag);
|
|
237
|
-
}
|
|
238
|
-
:global(.token.url) {
|
|
239
|
-
color: var(--code-block-color-url);
|
|
240
|
-
}
|
|
241
|
-
:global(.token.variable) {
|
|
242
|
-
color: var(--code-block-color-comment);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
// Language-specific
|
|
246
|
-
.language-css {
|
|
247
|
-
color: var(--code-block-color-lang-css);
|
|
248
|
-
|
|
249
|
-
.token {
|
|
250
|
-
color: var(--code-block-color-lang-css-token);
|
|
251
|
-
}
|
|
252
|
-
:global(.token.atrule) {
|
|
253
|
-
color: var(--code-block-color-lang-css-atrule);
|
|
254
|
-
}
|
|
255
|
-
:global(.token.rule:not(.atrule)) {
|
|
256
|
-
color: var(--code-block-color-lang-css-not-atrule);
|
|
257
|
-
}
|
|
258
|
-
:global(.token.entity) {
|
|
259
|
-
color: var(--code-block-color-lang-css-entity);
|
|
260
|
-
}
|
|
261
|
-
:global(.token.function) {
|
|
262
|
-
color: var(--code-block-color-lang-css-function);
|
|
263
|
-
}
|
|
264
|
-
:global(.token.property) {
|
|
265
|
-
color: var(--code-block-color-lang-css-property);
|
|
266
|
-
}
|
|
267
|
-
:global(.token.punctuation) {
|
|
268
|
-
color: var(--code-block-color-lang-css-punctuatione);
|
|
269
|
-
}
|
|
270
|
-
:global(.token.selector) {
|
|
271
|
-
color: var(--code-block-color-lang-css-selector);
|
|
272
|
-
}
|
|
273
|
-
:global(.token.url) {
|
|
274
|
-
color: var(--code-block-color-lang-css-url);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
.language-javascript {
|
|
278
|
-
:global(.token.constant) {
|
|
279
|
-
color: var(--code-block-color-lang-js-constant);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
.language-markup,
|
|
283
|
-
.language-html {
|
|
284
|
-
:global(.token.attr-value) {
|
|
285
|
-
color: var(--code-block-color-lang-markup-attr-value);
|
|
286
|
-
}
|
|
287
|
-
:global(.token.entity.named-entity) {
|
|
288
|
-
color: var(--code-block-color-lang-markup-entity-named);
|
|
289
|
-
}
|
|
290
|
-
:global(.token.entity:not(.named-entity)) {
|
|
291
|
-
color: var(--code-block-color-lang-markup-entity-not-named);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// isStandalone
|
|
296
|
-
.is-standalone {
|
|
297
|
-
border-radius: 6px;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// CHILD COMPONENTS / ELEMENTS
|
|
301
|
-
|
|
302
|
-
// Header (contains title & description)
|
|
303
|
-
|
|
304
|
-
.title {
|
|
305
|
-
color: var(--code-block-color-foreground-primary);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.description {
|
|
309
|
-
color: var(--code-block-color-foreground-faint);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.header {
|
|
313
|
-
display: flex;
|
|
314
|
-
flex-direction: column;
|
|
315
|
-
gap: 4px;
|
|
316
|
-
padding: 8px var(--code-block-code-padding);
|
|
317
|
-
background-color: var(--code-block-color-surface-faint);
|
|
318
|
-
border-bottom: 1px solid var(--code-block-color-border-primary);
|
|
319
|
-
border-top-left-radius: inherit;
|
|
320
|
-
border-top-right-radius: inherit;
|
|
321
|
-
|
|
322
|
-
&:empty {
|
|
323
|
-
display: none;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// we add very basic styling for elements that may be yielded in the "title"/"description" elements
|
|
327
|
-
|
|
328
|
-
strong {
|
|
329
|
-
font-weight: var(--mds-typography-font-weight-semibold);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
code,
|
|
333
|
-
pre {
|
|
334
|
-
display: inline;
|
|
335
|
-
font-size: 0.9em; // as discussed with designers, we reduce the size for optical/visual balance
|
|
336
|
-
font-family: var(--mds-typography-font-stack-mono);
|
|
337
|
-
line-height: 1em;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
a {
|
|
341
|
-
color: var(--code-block-color-foreground-action);
|
|
342
|
-
|
|
343
|
-
&:focus,
|
|
344
|
-
&:focus-visible {
|
|
345
|
-
text-decoration: none;
|
|
346
|
-
outline: 2px solid var(--mds-color-focus-action-internal);
|
|
347
|
-
outline-offset: 1px;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
&:hover {
|
|
351
|
-
color: var(--mds-color-foreground-action-hover);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
&:active {
|
|
355
|
-
color: var(--mds-color-foreground-action-active);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.body {
|
|
361
|
-
position: relative;
|
|
362
|
-
border-radius: inherit;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Code
|
|
366
|
-
.code {
|
|
367
|
-
@include hds-focus-ring-basic();
|
|
368
|
-
display: block;
|
|
369
|
-
margin: 0;
|
|
370
|
-
padding: var(--code-block-code-padding) 0;
|
|
371
|
-
overflow: auto;
|
|
372
|
-
font-size: 0.8125rem;
|
|
373
|
-
font-family: var(--mds-typography-font-stack-mono);
|
|
374
|
-
border-radius: inherit;
|
|
375
|
-
|
|
376
|
-
::selection {
|
|
377
|
-
color: var(--code-block-color-foreground-selection);
|
|
378
|
-
background-color: var(--code-block-color-surface-selection);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// CopyButton
|
|
383
|
-
.copy-button {
|
|
384
|
-
--copy-button-token-idle: var(--code-block-color-foreground-primary) !important;
|
|
385
|
-
--copy-button-token-success: var(--code-block-color-foreground-success) !important;
|
|
386
|
-
--copy-button-token-error: var(--code-block-color-foreground-critical) !important;
|
|
387
|
-
|
|
388
|
-
position: absolute !important;
|
|
389
|
-
top: 11px; // 12px -1px accounting for border
|
|
390
|
-
right: 12px; // 12px -1px accounting for border
|
|
391
|
-
// Overriding default colors must have !important due to style modules
|
|
392
|
-
color: var(--code-block-color-foreground-primary) !important;
|
|
393
|
-
background-color: var(--code-block-color-surface-faint) !important;
|
|
394
|
-
border: 1px solid var(--code-block-color-border-strong) !important;
|
|
395
|
-
|
|
396
|
-
&:hover {
|
|
397
|
-
background-color: var(--code-block-color-surface-primary) !important;
|
|
398
|
-
border-color: var(--code-block-color-border-strong) !important;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
&:active {
|
|
402
|
-
background-color: var(
|
|
403
|
-
--code-block-color-surface-interactive-active
|
|
404
|
-
) !important;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
&:focus,
|
|
408
|
-
&:focus-visible {
|
|
409
|
-
background-color: var(--code-block-color-surface-faint) !important;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Highlighted Lines
|
|
414
|
-
.line-highlight {
|
|
415
|
-
right: 0;
|
|
416
|
-
left: 0;
|
|
417
|
-
margin-top: 0px;
|
|
418
|
-
background-color: var(--code-block-color-line-highlight);
|
|
419
|
-
border: solid var(--code-block-color-line-highlight-border);
|
|
420
|
-
border-width: 0 0 0 4px;
|
|
421
|
-
mix-blend-mode: screen;
|
|
422
|
-
pointer-events: none;
|
|
423
|
-
|
|
424
|
-
// Enable the top border if this is the first line in a group of lines
|
|
425
|
-
&.line-highlight-first {
|
|
426
|
-
border-top-width: 1px;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
// Enable the bottom border if this is the last line in a group of lines
|
|
430
|
-
&.line-highlight-last {
|
|
431
|
-
border-bottom-width: 1px;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.line-numbers {
|
|
436
|
-
counter-reset: linenumber;
|
|
437
|
-
|
|
438
|
-
.code {
|
|
439
|
-
position: relative;
|
|
440
|
-
padding-left: 49px;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.line-numbers-rows {
|
|
444
|
-
position: absolute;
|
|
445
|
-
top: 0;
|
|
446
|
-
left: 0;
|
|
447
|
-
min-width: 49px;
|
|
448
|
-
min-height: 100%;
|
|
449
|
-
padding: var(--code-block-code-padding) 0;
|
|
450
|
-
border-right: 1px solid var(--code-block-color-border-primary);
|
|
451
|
-
user-select: none;
|
|
452
|
-
pointer-events: none;
|
|
453
|
-
|
|
454
|
-
> span {
|
|
455
|
-
display: block;
|
|
456
|
-
counter-increment: linenumber;
|
|
457
|
-
|
|
458
|
-
&::before {
|
|
459
|
-
display: block;
|
|
460
|
-
padding-right: var(--code-block-code-padding);
|
|
461
|
-
text-align: right;
|
|
462
|
-
content: counter(linenumber);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.line-of-code.line-highlight {
|
|
468
|
-
// This disables the thicker left border on highlighted lines.
|
|
469
|
-
border-width: 0;
|
|
470
|
-
|
|
471
|
-
// This resets the left padding to the original value.
|
|
472
|
-
padding-left: var(--mds-spacing-05);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.line-of-code {
|
|
477
|
-
// Lines of code are <span> elements which are inline by default, but
|
|
478
|
-
// we want them to take up the full width of the code block.
|
|
479
|
-
display: block;
|
|
480
|
-
|
|
481
|
-
// When we're rendering line numbers, we need to add padding to the
|
|
482
|
-
// left of lines of code to make room for the line numbers.
|
|
483
|
-
padding-left: var(--mds-spacing-05);
|
|
484
|
-
|
|
485
|
-
&.line-highlight {
|
|
486
|
-
// This accounts for the 4px margin on the left side so the content
|
|
487
|
-
// does not get moved by the margin.
|
|
488
|
-
padding-left: var(--mds-spacing-04);
|
|
489
|
-
|
|
490
|
-
// Enable the top border if this is the first line in a group of lines
|
|
491
|
-
&.line-highlight-first {
|
|
492
|
-
border-top-width: 1px;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
// Enable the bottom border if this is the last line in a group of lines
|
|
496
|
-
&.line-highlight-last {
|
|
497
|
-
border-bottom-width: 1px;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
& > span {
|
|
502
|
-
padding-right: var(--mds-spacing-09);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.line-number {
|
|
507
|
-
// Line numbers are <span> elements which are inline by default, but we
|
|
508
|
-
// want them to behave like block elements.
|
|
509
|
-
display: block;
|
|
510
|
-
color: #999;
|
|
511
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface CodeLinesProps {
|
|
3
|
-
value: ReactNode;
|
|
4
|
-
hasLineNumbers?: boolean;
|
|
5
|
-
highlightLines?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Render the provided code into separate line elements,
|
|
9
|
-
* accounting for all provided options.
|
|
10
|
-
*/
|
|
11
|
-
declare const CodeLines: ({ value, hasLineNumbers: lineNumbers, highlightLines: highlight, }: CodeLinesProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export { CodeLines };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Given a string of HTML, split it on newlines,
|
|
4
|
-
* and return an array of React <span> elements,
|
|
5
|
-
* each of which will contain a single line.
|
|
6
|
-
*
|
|
7
|
-
* Note that HTML tokens should not be multi-line,
|
|
8
|
-
* ie, all newline characters should be surfaced
|
|
9
|
-
* to the top level rather than nested in syntax
|
|
10
|
-
* highlighting tokens (otherwise the line-by-line
|
|
11
|
-
* markup we render would be invalid). We have
|
|
12
|
-
* a rehype plugin we use with our highlightString()
|
|
13
|
-
* utility to ensure newlines are surfaced in this way.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} codeHtml String of HTML
|
|
16
|
-
* @returns Array of JSX <span> elements
|
|
17
|
-
*/
|
|
18
|
-
declare function splitHtmlIntoLines(codeHtml: string): (ReactNode | null)[];
|
|
19
|
-
export default splitHtmlIntoLines;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Given an array of React children,
|
|
4
|
-
* split the array on newlines, grouping consecutive
|
|
5
|
-
* non-newline tokens in individual line elements,
|
|
6
|
-
* and return an array of React <span> elements,
|
|
7
|
-
* each of which will contain a single line.
|
|
8
|
-
*
|
|
9
|
-
* Note that JSX tokens should not be multi-line,
|
|
10
|
-
* ie, all newline characters should be surfaced
|
|
11
|
-
* to the top level rather than nested in syntax
|
|
12
|
-
* highlighting tokens (otherwise the line-by-line
|
|
13
|
-
* markup we render would be invalid). We have
|
|
14
|
-
* a rehype plugin we include with our markdown defaults
|
|
15
|
-
* to ensure newlines are surfaced in this way.
|
|
16
|
-
*
|
|
17
|
-
* @param {*} codeJsx Array of JSX elements, some of which may be newline strings
|
|
18
|
-
* @returns Array of JSX <span> elements representing individual lines
|
|
19
|
-
*/
|
|
20
|
-
declare function splitJsxIntoLines(codeJsx: React.ReactNode | React.ReactNode[]): ReactNode[];
|
|
21
|
-
export default splitJsxIntoLines;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"split-jsx-into-lines.js","sources":["../../../../../src/components/code-block/code-lines/utils/split-jsx-into-lines.ts"],"sourcesContent":["import { Children, type ReactNode } from 'react'\n\n/**\n * Given an array of React children,\n * split the array on newlines, grouping consecutive\n * non-newline tokens in individual line elements,\n * and return an array of React <span> elements,\n * each of which will contain a single line.\n *\n * Note that JSX tokens should not be multi-line,\n * ie, all newline characters should be surfaced\n * to the top level rather than nested in syntax\n * highlighting tokens (otherwise the line-by-line\n * markup we render would be invalid). We have\n * a rehype plugin we include with our markdown defaults\n * to ensure newlines are surfaced in this way.\n *\n * @param {*} codeJsx Array of JSX elements, some of which may be newline strings\n * @returns Array of JSX <span> elements representing individual lines\n */\nfunction splitJsxIntoLines(codeJsx: React.ReactNode | React.ReactNode[]) {\n\tconst linesArray = Children.toArray(codeJsx)\n\t/**\n\t * Many newlines take the form of a literal newline string, `\\n`.\n\t * However, some newlines take different forms. We expect these to be tagged\n\t * with an `empty-line` className by our rehype code plugins.\n\t * Here we detect the latter types of newline, and convert them to the former.\n\t */\n\tconst withNormalizedNewlines = linesArray.map((token) => {\n\t\t// If our token has an `empty-line` className, use a literal newline\n\t\t// rather than the token itself (which would render, but with zero height)\n\t\tif (typeof token === 'object' && 'props' in token) {\n\t\t\tif (token.props.className?.includes('empty-line')) {\n\t\t\t\treturn '\\n'\n\t\t\t}\n\t\t}\n\t\t// Otherwise, return the token unmodified\n\t\treturn token\n\t})\n\t// Filter out any surfaces newlines, that are \"in between\"\n\t// other lines of code. Special exceptions should be made for:\n\t// 1. newlines at start or end of array - should be rendered as blank lines\n\t// 2. consecutive newlines - \"n\" consecutive newlines should be rendered\n\t// as \"n - 1\" blank lines.\n\tconst accumulatedLines = withNormalizedNewlines.reduce(\n\t\t(acc, token, idx) => {\n\t\t\tconst isLastLine = idx === withNormalizedNewlines.length - 1\n\t\t\tconst isNewline = token === '\\n'\n\t\t\tconst isInlineToken = token !== '\\n'\n\t\t\t// For newlines, increment the consecutive newline counter\n\t\t\tif (isNewline) acc.consecutiveNewlines++\n\t\t\t// If this token is an inline token, and we have\n\t\t\t// pending newlines, then start a new line,\n\t\t\t// adding blank lines for consecutive newlines as needed\n\t\t\tconst isFinalNewline = isNewline && isLastLine\n\t\t\tconst hasNewlines = acc.consecutiveNewlines > 0\n\t\t\tconst needsNewlines = (isInlineToken || isFinalNewline) && hasNewlines\n\t\t\tif (needsNewlines) {\n\t\t\t\t// If there are any tokens in the current line, add them as a new line\n\t\t\t\tif (acc.currentLine.length > 0) {\n\t\t\t\t\tacc.lines.push(acc.currentLine)\n\t\t\t\t\tacc.currentLine = []\n\t\t\t\t}\n\t\t\t\t// Add blank lines for each consecutive newline, then reset the counter\n\t\t\t\tfor (let i = 1; i < acc.consecutiveNewlines; i++) {\n\t\t\t\t\tacc.lines.push('')\n\t\t\t\t}\n\t\t\t\tacc.consecutiveNewlines = 0\n\t\t\t}\n\t\t\t// If this token is an inline token,\n\t\t\t// append it to the current line\n\t\t\tif (isInlineToken) {\n\t\t\t\tacc.currentLine.push(token)\n\t\t\t\t// If this is the last line,\n\t\t\t\t// then ensure the current line\n\t\t\t\t// has been pushed to the lines array\n\t\t\t\tif (isLastLine) acc.lines.push(acc.currentLine)\n\t\t\t}\n\t\t\treturn acc\n\t\t},\n\t\t{\n\t\t\tlines: [] as ReactNode[],\n\t\t\tcurrentLine: [] as ReactNode[],\n\t\t\tconsecutiveNewlines: 1, // Start at 1 to handle leading newlines\n\t\t}\n\t)\n\treturn accumulatedLines.lines\n}\n\nexport default splitJsxIntoLines\n"],"names":["splitJsxIntoLines","codeJsx","withNormalizedNewlines","Children","token","acc","idx","isLastLine","isNewline","isInlineToken","isFinalNewline","hasNewlines","i"],"mappings":";AAoBA,SAASA,EAAkBC,GAA8C;AAQxE,QAAMC,IAPaC,EAAS,QAAQF,CAAO,EAOD,IAAI,CAACG,MAG1C,OAAOA,KAAU,YAAY,WAAWA,KACvCA,EAAM,MAAM,WAAW,SAAS,YAAY,IACxC;AAAA,IAIFA,CACP;AAgDD,SA1CyBF,EAAuB;AAAA,IAC/C,CAACG,GAAKD,GAAOE,MAAQ;AACpB,YAAMC,IAAaD,MAAQJ,EAAuB,SAAS,GACrDM,IAAYJ,MAAU;AAAA,GACtBK,IAAgBL,MAAU;AAAA;AAEhC,MAAII,KAAWH,EAAI;AAInB,YAAMK,IAAiBF,KAAaD,GAC9BI,IAAcN,EAAI,sBAAsB;AAE9C,WADuBI,KAAiBC,MAAmBC,GACxC;AAElB,QAAIN,EAAI,YAAY,SAAS,MAC5BA,EAAI,MAAM,KAAKA,EAAI,WAAW,GAC9BA,EAAI,cAAc,CAAA;AAGnB,iBAASO,IAAI,GAAGA,IAAIP,EAAI,qBAAqBO;AAC5C,UAAAP,EAAI,MAAM,KAAK,EAAE;AAElB,QAAAA,EAAI,sBAAsB;AAAA,MAC3B;AAGA,aAAII,MACHJ,EAAI,YAAY,KAAKD,CAAK,GAItBG,KAAYF,EAAI,MAAM,KAAKA,EAAI,WAAW,IAExCA;AAAA,IACR;AAAA,IACA;AAAA,MACC,OAAO,CAAA;AAAA,MACP,aAAa,CAAA;AAAA,MACb,qBAAqB;AAAA;AAAA,IAAA;AAAA,EACtB,EAEuB;AACzB;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/code-block/hidden-copy-content/index.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, useEffect, useState, type ReactNode } from 'react'\n\n/**\n * This hidden element acts solely as a container\n * that we can fetch textContent to copy to clipboard.\n * This allows to ignore the \"how will we copy this cleanly\"\n * concern when splitting code into lines, and adding\n * line numbers and so on in other parts of code-block.\n */\nconst HiddenCopyContentComponent = (\n\t{ code }: { code: ReactNode },\n\tcopyRef: React.ForwardedRef<HTMLPreElement>\n) => {\n\tconst [isClient, setIsClient] = useState(false)\n\n\tuseEffect(() => {\n\t\tsetIsClient(true)\n\t}, [])\n\n\t/**\n\t * We are avoiding SSR here as this component is only used for the copy-to-clipboard interaction, and so rendering\n\t * the text content of the code introduces duplicate markup and some difficult-to-debug hydration mismatches.\n\t * By the time someone interacts with the copy-to-clipboard functionality, this should be rendered.\n\t */\n\tif (!isClient) return null\n\n\treturn (\n\t\t<pre ref={copyRef} style={{ display: 'none' }}>\n\t\t\t{typeof code === 'string' ? (\n\t\t\t\t<span dangerouslySetInnerHTML={{ __html: code }} />\n\t\t\t) : (\n\t\t\t\tcode\n\t\t\t)}\n\t\t</pre>\n\t)\n}\n\nconst HiddenCopyContent = forwardRef(HiddenCopyContentComponent)\n\nexport { HiddenCopyContent }\n"],"names":["HiddenCopyContentComponent","code","copyRef","isClient","setIsClient","useState","useEffect","jsx"],"mappings":";;;AAeC,MAAAA,IAAgC,CAAA,EAAA,MAAAC,EAAS,GAAAC,MAAK;AAE9C,QAAA,CAAAC,GAAgBC,CAAA,IAAAC,EAAA,EAAA;AAWhB,SAVCC,EAAA,MAAY;AACb,IAAAF,EAAK,EAAA;AAAA,EAOL,GAAA,CAAI,CAAC,OAWN,gBAAAG,EAAA,OAAA,EAAA,KAAAL,GAAA,OAAA,EAAA,SAAA,OAAA,GAAA,UAAA,OAAAD,KAAA,WAAA,gBAAAM,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAAN,EAAA,EAAA,CAAA,IAAAA,EAAA,CAAA;AAEA;"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* ALERT: This component is a combination of logic from the official HashiCorp
|
|
4
|
-
* Design System CodeBlock component and the CodeBlock component written by the
|
|
5
|
-
* Web Presence Team. The official component relies on client-side rendering
|
|
6
|
-
* for the calculation of line-heights for line numbers, but this is something
|
|
7
|
-
* we want to be able to achieve without client-side rendering.
|
|
8
|
-
*/
|
|
9
|
-
interface CodeBlockProps {
|
|
10
|
-
/**
|
|
11
|
-
* The text/code content for the CodeBlock. The component encodes this
|
|
12
|
-
* argument before displaying it. Should be a pre-highlighted string
|
|
13
|
-
* generated by Prism.js or Shiki.
|
|
14
|
-
*/
|
|
15
|
-
value: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* The coding language to use for syntax highlighting. If you need
|
|
18
|
-
* additional languages contact the Design Systems Team.
|
|
19
|
-
*/
|
|
20
|
-
language?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Applies rounded borders to the component. When used within another
|
|
23
|
-
* component or when the context requires it, you can turn it off.
|
|
24
|
-
*/
|
|
25
|
-
isStandalone?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Used to control whether a copy button for copying the code/text content
|
|
28
|
-
* will be displayed.
|
|
29
|
-
*/
|
|
30
|
-
hasCopyButton?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Used to control display of line numbers.
|
|
33
|
-
*/
|
|
34
|
-
hasLineNumbers?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Accepts a list or range of line numbers to highlight.
|
|
37
|
-
* (Examples: `2, 4`,`6-10`)
|
|
38
|
-
*/
|
|
39
|
-
highlightLines?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Accepts any valid CSS unit. If the CodeBlock content exceeds the maximum
|
|
42
|
-
* height a vertical scrollbar is enabled. This value applies to the code
|
|
43
|
-
* content only and does not include the header element (title and/or description).
|
|
44
|
-
*/
|
|
45
|
-
maxHeight?: string;
|
|
46
|
-
title?: ReactNode;
|
|
47
|
-
description?: ReactNode;
|
|
48
|
-
className?: string;
|
|
49
|
-
}
|
|
50
|
-
declare const CodeBlock: {
|
|
51
|
-
({ title, description, language, value, isStandalone, hasCopyButton, hasLineNumbers, highlightLines, maxHeight, className, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
-
displayName: string;
|
|
53
|
-
};
|
|
54
|
-
export type { CodeBlockProps };
|
|
55
|
-
export { CodeBlock };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/code-block/index.tsx"],"sourcesContent":["'use client'\n\nimport { useId, useRef, type ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { Text } from '../text'\nimport { CodeLines } from './code-lines'\nimport { HiddenCopyContent } from './hidden-copy-content'\nimport processSnippet from './utils/process-snippet'\nimport { CopyButton } from '../../patterns/copy-button'\nimport s from './code-block.module.scss'\n\n/**\n * ALERT: This component is a combination of logic from the official HashiCorp\n * Design System CodeBlock component and the CodeBlock component written by the\n * Web Presence Team. The official component relies on client-side rendering\n * for the calculation of line-heights for line numbers, but this is something\n * we want to be able to achieve without client-side rendering.\n */\n\ninterface CodeBlockProps {\n\t/**\n\t * The text/code content for the CodeBlock. The component encodes this\n\t * argument before displaying it. Should be a pre-highlighted string\n\t * generated by Prism.js or Shiki.\n\t */\n\tvalue: ReactNode\n\n\t/**\n\t * The coding language to use for syntax highlighting. If you need\n\t * additional languages contact the Design Systems Team.\n\t */\n\tlanguage?: string\n\n\t/**\n\t * Applies rounded borders to the component. When used within another\n\t * component or when the context requires it, you can turn it off.\n\t */\n\tisStandalone?: boolean\n\n\t/**\n\t * Used to control whether a copy button for copying the code/text content\n\t * will be displayed.\n\t */\n\thasCopyButton?: boolean\n\n\t/**\n\t * Used to control display of line numbers.\n\t */\n\thasLineNumbers?: boolean\n\n\t/**\n\t * Accepts a list or range of line numbers to highlight.\n\t * (Examples: `2, 4`,`6-10`)\n\t */\n\thighlightLines?: string\n\n\t/**\n\t * Accepts any valid CSS unit. If the CodeBlock content exceeds the maximum\n\t * height a vertical scrollbar is enabled. This value applies to the code\n\t * content only and does not include the header element (title and/or description).\n\t */\n\tmaxHeight?: string\n\ttitle?: ReactNode\n\tdescription?: ReactNode\n\tclassName?: string\n}\n\nconst CodeBlock = ({\n\ttitle,\n\tdescription,\n\tlanguage,\n\tvalue,\n\tisStandalone = true,\n\thasCopyButton,\n\thasLineNumbers = true,\n\thighlightLines,\n\tmaxHeight = 'auto',\n\tclassName,\n}: CodeBlockProps) => {\n\tconst copyRef = useRef<HTMLPreElement>(null)\n\tconst preCodeId = useId()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\ts['code-block'],\n\t\t\t\ts.dark,\n\t\t\t\t{\n\t\t\t\t\t[s[`language-${language}`]]: language,\n\t\t\t\t\t[s['is-standalone']]: isStandalone,\n\t\t\t\t\t[s['line-numbers']]: hasLineNumbers,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t<div className={s.header}>\n\t\t\t\t{title && (\n\t\t\t\t\t<Text.HDSBody\n\t\t\t\t\t\tsize=\"200\"\n\t\t\t\t\t\ttag=\"p\"\n\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\tclassName={s.title}\n\t\t\t\t\t>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</Text.HDSBody>\n\t\t\t\t)}\n\t\t\t\t{description && (\n\t\t\t\t\t<Text.HDSBody tag=\"p\" size=\"100\" className={s.description}>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Text.HDSBody>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<div className={s.body}>\n\t\t\t\t{/**\n\t\t\t\t * NOTE: ideally we'd keep the markup of this component in lockstep\n\t\t\t\t * with the markup of the Helios code block. However, we also need\n\t\t\t\t * to support \"clever\" copying of snippets, parsing out shell\n\t\t\t\t * prompt characters like `$` from output, as this is a common\n\t\t\t\t * practice in our tutorial and documentation content. So, this\n\t\t\t\t * HiddenCopyContent component is one divergence from the markup\n\t\t\t\t * of the Helios code block.\n\t\t\t\t */}\n\t\t\t\t<HiddenCopyContent code={value} ref={copyRef} />\n\t\t\t\t<pre className={s.code} id={preCodeId} style={{ maxHeight }}>\n\t\t\t\t\t<code>\n\t\t\t\t\t\t<CodeLines\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\thighlightLines={highlightLines}\n\t\t\t\t\t\t\thasLineNumbers={hasLineNumbers}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</code>\n\t\t\t\t</pre>\n\t\t\t\t{hasCopyButton && (\n\t\t\t\t\t<CopyButton\n\t\t\t\t\t\tclassName={s['copy-button']}\n\t\t\t\t\t\taria-describedby={preCodeId}\n\t\t\t\t\t\tgetTextFn={() => {\n\t\t\t\t\t\t\tconst rawSnippet = copyRef.current?.textContent\n\t\t\t\t\t\t\tif (!rawSnippet) {\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\"`code-block` - Couldn't find text content to copy.\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn processSnippet(rawSnippet)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ttext=\"Copy\"\n\t\t\t\t\t\tisIconOnly\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nCodeBlock.displayName = 'CodeBlock'\n\nexport type { CodeBlockProps }\nexport { CodeBlock }\n"],"names":["CodeBlock","title","description","language","value","isStandalone","hasCopyButton","hasLineNumbers","highlightLines","maxHeight","className","copyRef","jsxs","classNames","s","jsx","Text","HiddenCopyContent","preCodeId","CodeLines","CopyButton","rawSnippet","processSnippet"],"mappings":";;;;;;;;;;AAmEmB,MAClBA,IAAA,CAAA;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAA;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC,IAAA;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC,IAAA;AAAA,EACD,WAAAC;AACC;AACA,QAAMC,MAAY,IAAM,SAGvB;AAAA,SAAC,gBAAAC;AAAA,IAAA;AAAA,IAAA;AAAA,MACW,WACRC;AAAA,QACFC,EAAE,YAAA;AAAA,QACFA,EAAA;AAAA,QAAA;AAAA,UAEC,CAACA,EAAE,YAAAX,CAAmB,EAAA,CAAA,GAAAA;AAAA,UACtB,CAACW,EAAE,eAAe,CAAA,GAAGT;AAAA,UACtB,CAAAS,EAAA,cAAA,CAAA,GAAAP;AAAA,QACA;AAAA,QACDG;AAAA,MAEA;AAAA,MAAA,UAAA;AAAA,iCAEE,EAAA,WAAAI,EAAA,QAAA,UAAA;AAAA,UAAAb,KAAM,gBAAAc;AAAA,YAALC,EAAA;AAAA,YAAA;AAAA,cAEA,MAAI;AAAA,cACJ,KAAA;AAAA,cACA,QAAA;AAAA,cAEC,WAAAF,EAAA;AAAA,cAAA,UAAAb;AAAA,YACF;AAAA,UAEA;AAAA,eAKF,gBAAAc,EAAAC,EAAA,SAAA,EAAA,KAAA,KAAA,MAAA,OAAA,WAAAF,EAAA,aAAA,UAAAZ,EAAA,CAAA;AAAA,QAAA,EAAA,CAAA;AAAA,QAWC,gBAAAU,EAAA,OAAC,EAAA,WAAAE,EAAkB,MAAM,UAAO;AAAA,UAChC,gBAAAC,EAACE,GAAI,EAAW,MAAEb,GAAU,KAAAO,EAAW,CAAA;AAAA,UAEpC,gBAAAI,EAAA,OAAA,EAAA,WAAAD,EAAA,MAAA,IAAAI,GAAA,OAAA,EAAA,WAAAT,EAAA,GAAA,UAAA,gBAAAM,EAAA,QAAA,EAAA,UAAA,gBAAAA;AAAA,YAAAI;AAAA,YAAA;AAAA,cAEA,OAAAf;AAAA,cACA,gBAAAI;AAAA,cAAA,gBAAAD;AAAA;UAIF,EAAA,CAAA,EAAA,CAAA;AAAA,UACAD,KAAC,gBAAAS;AAAA,YAAAK;AAAA,YAAA;AAAA,cAEA,WAAAN,EAAA,aAAkB;AAAA,cAClB,oBAAiBI;AAAA,cAChB,WAAM,MAAA;AACN,sBAAKG,IAAYV,EAAA,SAAA;AAChB,oBAAA,CAAAU;AAAU,wBACT,IAAA;AAAA,oBACD;AAAA,kBACD;AAED,uBAAAC,EAAAD,CAAA;AAAA,cACA;AAAA,cACA,MAAA;AAAA,cACA,YAAK;AAAA,cAAA,MAAA;AAAA,YAAA;AAAA,UACN;AAAA,QAEF,EAAA,CAAA;AAAA,MAAA;AAAA,IACD;AAAA,EAEF;AAEA;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-highlighted-lines.js","sources":["../../../../src/components/code-block/utils/parse-highlighted-lines.ts"],"sourcesContent":["function parseHighlightedLines(string?: string | boolean) {\n\tif (typeof string == 'undefined' || string === false || string === '') {\n\t\treturn []\n\t}\n\n\tif (typeof string !== 'string') {\n\t\tthrow new Error(\n\t\t\t`The highlight prop must be a string. Received a value of type \"${typeof string}\" instead.`\n\t\t)\n\t}\n\n\tconst hasValidChars = /^[-,0-9\\s]+$/.test(string)\n\tif (!hasValidChars) {\n\t\tthrow new Error(\n\t\t\t`The highlight prop must be a comma-separated list of single integers or ranges with a single dash between two integers. Found invalid characters: \"${string}\".`\n\t\t)\n\t}\n\n\tconst parts = string.split(',')\n\treturn parts.reduce((acc, part) => {\n\t\treturn acc.concat(parsePart(part))\n\t}, [] as number[])\n}\n\nfunction parsePart(string: string): number[] {\n\tconst dashParts = string.split('-')\n\tif (dashParts.length > 2) {\n\t\tthrow new Error(\n\t\t\t`Each comma-separated value in the highlight prop must be either a single integer, or a range with a single dash between two integers. Found a value with multiple dashes: \"${string}\".`\n\t\t)\n\t}\n\t// Single integers are easy, just parse and return\n\tconst isSingle = dashParts.length == 1\n\tif (isSingle) {\n\t\tconst parsedInt = parseInt(string)\n\t\tconst isNaN = parsedInt !== parsedInt\n\t\tif (isNaN) {\n\t\t\tthrow new Error(\n\t\t\t\t`Each comma-separated value in the highlight prop must be either a single integer, or a range with a single dash between two integers. Found a value that parsed to NaN: \"${\n\t\t\t\t\tstring === '' ? '<empty string>' : string\n\t\t\t\t}\".`\n\t\t\t)\n\t\t}\n\t\treturn [parsedInt]\n\t}\n\t// Ranges require a little more logic\n\tconst [startVal, endVal] = dashParts.map((v) => parseInt(v))\n\tconst hasNaNStart = startVal !== startVal\n\tconst hasNaNEnd = endVal !== endVal\n\tif (hasNaNStart || hasNaNEnd) {\n\t\tthrow new Error(\n\t\t\t`Each comma-separated value in the highlight prop must be either a single integer, or a range with a single dash between two integers. Found a range that produced a NaN: \"${string}\".`\n\t\t)\n\t}\n\tconst length = endVal - startVal + 1\n\tconst values = [...Array(length).keys()].map((int) => int + startVal)\n\treturn values\n}\n\nexport default parseHighlightedLines\n"],"names":["parseHighlightedLines","string","acc","part","parsePart","dashParts","parsedInt","startVal","endVal","v","length","int"],"mappings":"AAAA,SAASA,EAAsBC,GAA2B;AACzD,MAAI,OAAOA,IAAU,OAAeA,MAAW,MAASA,MAAW;AAClE,WAAO,CAAA;AAGR,MAAI,OAAOA,KAAW;AACrB,UAAM,IAAI;AAAA,MACT,kEAAkE,OAAOA,CAAM;AAAA,IAAA;AAKjF,MAAI,CADkB,eAAe,KAAKA,CAAM;AAE/C,UAAM,IAAI;AAAA,MACT,sJAAsJA,CAAM;AAAA,IAAA;AAK9J,SADcA,EAAO,MAAM,GAAG,EACjB,OAAO,CAACC,GAAKC,MAClBD,EAAI,OAAOE,EAAUD,CAAI,CAAC,GAC/B,CAAA,CAAc;AAClB;AAEA,SAASC,EAAUH,GAA0B;AAC5C,QAAMI,IAAYJ,EAAO,MAAM,GAAG;AAClC,MAAII,EAAU,SAAS;AACtB,UAAM,IAAI;AAAA,MACT,8KAA8KJ,CAAM;AAAA,IAAA;AAKtL,MADiBI,EAAU,UAAU,GACvB;AACb,UAAMC,IAAY,SAASL,CAAM;AAEjC,QADcK,MAAcA;AAE3B,YAAM,IAAI;AAAA,QACT,4KACCL,MAAW,KAAK,mBAAmBA,CACpC;AAAA,MAAA;AAGF,WAAO,CAACK,CAAS;AAAA,EAClB;AAEA,QAAM,CAACC,GAAUC,CAAM,IAAIH,EAAU,IAAI,CAACI,MAAM,SAASA,CAAC,CAAC;AAG3D,MAFoBF,MAAaA,KACfC,MAAWA;AAE5B,UAAM,IAAI;AAAA,MACT,6KAA6KP,CAAM;AAAA,IAAA;AAGrL,QAAMS,IAASF,IAASD,IAAW;AAEnC,SADe,CAAC,GAAG,MAAMG,CAAM,EAAE,MAAM,EAAE,IAAI,CAACC,MAAQA,IAAMJ,CAAQ;AAErE;"}
|