@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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CardContentProps, CardProps } from './types';
|
|
2
|
+
declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const CardContent: ({ badges, description, eyebrow, heading, thumbnail, subheading, cta, children, showArrow, }: CardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Card };
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAgB,MAAM,SAAS,CAAA;AAUxE,QAAA,MAAM,IAAI,sGAyET,CAAA;AAID,eAAO,MAAM,WAAW,GAAI,6FAUzB,gBAAgB,4CA4BlB,CAAA;AAsHD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/card/index.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, type PropsWithChildren } from 'react'\nimport type { CardContentProps, CardProps, CardCtaProps } from './types'\nimport { CardThumbnail } from './card-thumbnail'\nimport { useMDSLink } from '../../utils/mds-context'\nimport { Text } from '../text'\nimport classNames from 'classnames'\nimport { Badge } from '../badge'\nimport { StandaloneLink } from '../standalone-link'\nimport { FlightIcon } from '../flight-icon'\nimport s from './styles.module.css'\n\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tcontent,\n\t\t\tctaLabel,\n\t\t\thref,\n\t\t\tstandaloneLink,\n\t\t\tisExternal,\n\t\t\tonClickCapture,\n\t\t\t'aria-label': ariaLabel,\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst Link = useMDSLink()\n\n\t\tconst isCardLink = href && !ctaLabel\n\n\t\tconst linkProps = isExternal\n\t\t\t? { target: '_blank', rel: 'noopener noreferrer' }\n\t\t\t: {}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\ts.card,\n\t\t\t\t\t{ [s.interactive]: isCardLink },\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{isCardLink && (\n\t\t\t\t\t<Link\n\t\t\t\t\t\thref={href}\n\t\t\t\t\t\tclassName={s.link}\n\t\t\t\t\t\tdraggable=\"false\"\n\t\t\t\t\t\tonClickCapture={onClickCapture}\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\t{...linkProps}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{content && (\n\t\t\t\t\t<CardContent\n\t\t\t\t\t\tbadges={content.badges}\n\t\t\t\t\t\tdescription={content.description}\n\t\t\t\t\t\teyebrow={content.eyebrow}\n\t\t\t\t\t\theading={content.heading}\n\t\t\t\t\t\tsubheading={content.subheading}\n\t\t\t\t\t\tthumbnail={content.thumbnail}\n\t\t\t\t\t\tshowArrow={content.showArrow && !!isCardLink}\n\t\t\t\t\t\tcta={{\n\t\t\t\t\t\t\tctaLabel,\n\t\t\t\t\t\t\thref,\n\t\t\t\t\t\t\tstandaloneLink,\n\t\t\t\t\t\t\tonClickCapture,\n\t\t\t\t\t\t\tisExternal,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t\t{children && (\n\t\t\t\t\t<CardCta\n\t\t\t\t\t\tctaLabel={ctaLabel}\n\t\t\t\t\t\thref={href}\n\t\t\t\t\t\tstandaloneLink={standaloneLink}\n\t\t\t\t\t\tonClickCapture={onClickCapture}\n\t\t\t\t\t\tisExternal={isExternal}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t)\n\t},\n)\n\nCard.displayName = 'Card'\n\nexport const CardContent = ({\n\tbadges,\n\tdescription,\n\teyebrow,\n\theading,\n\tthumbnail,\n\tsubheading,\n\tcta,\n\tchildren,\n\tshowArrow,\n}: CardContentProps) => {\n\treturn (\n\t\t<div className={classNames(s.content, { [s['has-thumbnail']]: thumbnail })}>\n\t\t\t{thumbnail && <CardThumbnail {...thumbnail} />}\n\t\t\t<div className={s.contentLockup}>\n\t\t\t\t<CardEyebrow>{eyebrow}</CardEyebrow>\n\t\t\t\t<CardHeading>{heading}</CardHeading>\n\t\t\t\t<CardSubheading>{subheading}</CardSubheading>\n\t\t\t\t<CardDescription>{description}</CardDescription>\n\t\t\t\t<Badges badges={badges} />\n\t\t\t\t{cta && (\n\t\t\t\t\t<CardCta\n\t\t\t\t\t\tctaLabel={cta.ctaLabel}\n\t\t\t\t\t\thref={cta.href}\n\t\t\t\t\t\tstandaloneLink={cta.standaloneLink}\n\t\t\t\t\t\tisExternal={cta.isExternal}\n\t\t\t\t\t\tonClickCapture={cta.onClickCapture}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{showArrow ? (\n\t\t\t\t\t<div className={s.arrow}>\n\t\t\t\t\t\t<FlightIcon name=\"arrow-right\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nconst CardCta = ({\n\thref,\n\tctaLabel,\n\tstandaloneLink,\n\tisExternal,\n\tonClickCapture,\n}: CardCtaProps) => {\n\tconst isCardLink = href && !ctaLabel\n\n\tif (standaloneLink) {\n\t\tconst standaloneLinkProps = {\n\t\t\t...standaloneLink,\n\t\t\ticon: standaloneLink.icon || 'chevron-right',\n\t\t\ticonPosition: standaloneLink.iconPosition || 'trailing',\n\t\t}\n\n\t\treturn <StandaloneLink className={s.cta} {...standaloneLinkProps} />\n\t}\n\n\tif (href && !isCardLink && ctaLabel) {\n\t\treturn (\n\t\t\t<StandaloneLink\n\t\t\t\tclassName={s.cta}\n\t\t\t\ttext={ctaLabel}\n\t\t\t\thref={href}\n\t\t\t\ticon=\"chevron-right\"\n\t\t\t\ticonPosition=\"trailing\"\n\t\t\t\tcolor=\"secondary\"\n\t\t\t\tonClickCapture={onClickCapture}\n\t\t\t\tisHrefExternal={isExternal}\n\t\t\t/>\n\t\t)\n\t}\n\n\treturn null\n}\n\nconst CardEyebrow = ({ children }: PropsWithChildren) => {\n\tif (!children) {\n\t\treturn null\n\t}\n\n\tif (Array.isArray(children)) {\n\t\treturn <CardEyebrowList items={Array.from(children)} />\n\t}\n\n\treturn <CardEyebrowText>{children}</CardEyebrowText>\n}\n\nconst CardEyebrowList = ({ items }: { items: string[] }) => (\n\t<ul className={s.meta}>\n\t\t{items.map((item, idx) => (\n\t\t\t<li key={item}>\n\t\t\t\t<CardEyebrowText>{item}</CardEyebrowText>\n\t\t\t\t{idx < items.length - 1 ? (\n\t\t\t\t\t<span className={s.metaSeparator} aria-hidden={true}>\n\t\t\t\t\t\t|\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\t\t\t</li>\n\t\t))}\n\t</ul>\n)\n\nconst CardEyebrowText = ({ children }: PropsWithChildren) =>\n\tchildren ? (\n\t\t<Text.Label color=\"faint\" weight=\"medium\">\n\t\t\t{children}\n\t\t</Text.Label>\n\t) : null\n\nconst CardHeading = ({ children }: PropsWithChildren) =>\n\tchildren ? (\n\t\t<Text.DisplayExpressive\n\t\t\ttag=\"span\"\n\t\t\tsize=\"200\"\n\t\t\tweight=\"semibold\"\n\t\t\tcolor=\"strong\"\n\t\t>\n\t\t\t{children}\n\t\t</Text.DisplayExpressive>\n\t) : null\n\nconst CardSubheading = ({ children }: PropsWithChildren) =>\n\tchildren ? (\n\t\t<Text.Body tag=\"span\" size=\"200\" className={s.subheading} color=\"primary\">\n\t\t\t{children}\n\t\t</Text.Body>\n\t) : null\n\nconst CardDescription = ({ children }: PropsWithChildren) => {\n\tif (!children) {\n\t\treturn null\n\t}\n\n\tif (typeof children === 'string') {\n\t\treturn (\n\t\t\t<Text.Body tag=\"span\" size=\"200\" color=\"primary\">\n\t\t\t\t{children}\n\t\t\t</Text.Body>\n\t\t)\n\t}\n\n\treturn <>{children}</>\n}\n\nconst Badges = ({ badges }: { badges: CardContentProps['badges'] }) =>\n\tbadges && badges.length > 0 ? (\n\t\t<div className={s.badges}>\n\t\t\t{badges.map((badge) => (\n\t\t\t\t<Badge key={badge.text} {...badge} />\n\t\t\t))}\n\t\t</div>\n\t) : null\n\nCard.displayName = 'Card'\nexport { Card }\n"],"names":["Card","forwardRef","children","className","content","ctaLabel","href","standaloneLink","isExternal","onClickCapture","ariaLabel","ref","Link","useMDSLink","isCardLink","jsxs","classNames","s","jsx","linkProps","CardContent","CardCta","badges","description","eyebrow","heading","thumbnail","subheading","cta","showArrow","CardThumbnail","CardEyebrow","CardHeading","CardSubheading","CardDescription","FlightIcon","standaloneLinkProps","StandaloneLink","CardEyebrowList","CardEyebrowText","items","item","idx","Text","Fragment","Badges","badge","Badge"],"mappings":";;;;;;;;;;;AAaa,MAEXA,IAAAC;AAAA,EAAA,CAAA;AAAA,IAEC,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,kBAGGC;AAAA,EACJ,GAAAC,MAAM;AAEN,UAAMC,IAAAC,KAEAC,IAAYR,KAAA,YAKjB,EAAA,QAAA,UAAA,KAAA,sBAAA,IAAA,CAAA;AAAA,WAAC,gBAAAS;AAAA,MAAA;AAAA,MAAA;AAAA,QAEA,KAAAJ;AAAA,QAAW,WACRK;AAAA,UACFC,EAAE;AAAA,UACF,EAAA,CAAAA,EAAA,WAAA,GAAAH,EAAA;AAAA,UACDX;AAAA,QAEC;AAAA,QAAA,UAAA;AAAA,UACAW,KAAC,gBAAAI;AAAA,YAAAN;AAAA,YAAA;AAAA,cAEA,MAAAN;AAAA,cACA,WAAUW,EAAA;AAAA,cACV,WAAA;AAAA,cACA,gBAAAR;AAAA,cACC,cAAGC;AAAA,cAAA,GAAAS;AAAA,YACL;AAAA,UAEA;AAAA,UACAf,KAAC,gBAAAc;AAAA,YAAAE;AAAA,YAAA;AAAA,cAEA,QAAAhB,EAAa;AAAA,cACb,aAASA,EAAQ;AAAA,cACjB,SAASA,EAAQ;AAAA,cACjB,SAAAA,EAAY;AAAA,cACZ,YAAWA,EAAQ;AAAA,cACnB,WAAWA,EAAQ;AAAA,cACnB,WAAKA,EAAA,aAAA,CAAA,CAAAU;AAAA,cAAA,KACJ;AAAA,gBACA,UAAAT;AAAA,gBACA,MAAAC;AAAA,gBACA,gBAAAC;AAAA,gBACA,gBAAAE;AAAA,gBAAA,YAAAD;AAAA,cACD;AAAA,YACD;AAAA,UAEA;AAAA,UACAN;AAAA,UACAA,KAAC,gBAAAgB;AAAA,YAAAG;AAAA,YAAA;AAAA,cAEA,UAAAhB;AAAA,cACA,MAAAC;AAAA,cACA,gBAAAC;AAAA,cACA,gBAAAE;AAAA,cAAA,YAAAD;AAAA,YAAA;AAAA,UACD;AAAA,QAAA;AAAA,MAEF;AAAA,IAEF;AAAA,EACD;AAEA;AAEOR,EAAA;AAAqB,MAC3BoB,IAAA,CAAA;AAAA,EACA,QAAAE;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,KAAAC;AAAA,EACA,UAAA1B;AAAA,EACD,WAAA2B;AACC,MAEG,gBAAAd,EAAA,OAAc,EAAA,WAAAC,EAAkBC,EAAA,SAAW,EAAA,CAAAA,EAAA,eAAA,CAAA,GAAAS,EAAA,CAAA,GAAA,UAAA;AAAA,EAAAA,KAC3C,gBAAAR,EAAIY,GAAa,EAAA,GAAAJ,EACjB,CAAA;AAAA,EAAA,gBAAAX,EAAA,OAAC,EAAA,WAAaE,EAAA,eAAQ,UAAA;AAAA,IACtB,gBAAAC,EAACa,KAAa,UAAAP,EAAA,CAAQ;AAAA,IACtB,gBAAAN,EAACc,GAAA,YAAgBP,EAAA,CAAA;AAAA,IACjB,gBAAAP,EAACe,eAAiBN,EAAA,CAAA;AAAA,IAClB,gBAAAT,EAACgB,KAAuB,UAAAX,EAAA,CAAA;AAAA,yBAEvB,EAAA,QAAAD,EAAA,CAAA;AAAA,IAAAM,KAAC,gBAAAV;AAAA,MAAAG;AAAA,MAAA;AAAA,QAEA,UAAUO,EAAA;AAAA,QACV,MAAAA,EAAA;AAAA,QACA,gBAAgBA,EAAA;AAAA,QAChB,YAAAA,EAAgB;AAAA,QAAI,gBAAAA,EAAA;AAAA,MACrB;AAAA,IAEA;AAAA,IAKAC,IAAA,gBAAAX,EAAA,OAAA,EAAA,WAAAD,EAAA,OAAA,UAAA,gBAAAC,EAAAiB,GAAA,EAAA,MAAA,cAAA,CAAA,EAAA,CAAA,IAAA;AAAA,IAAAjC;AAAA,IAEH,CAAA;AAEF,EAAA,CAAA,GAGCmB,IAAA,CAAA;AAAA,EACA,MAAAf;AAAA,EACA,UAAAD;AAAA,EACA,gBAAAE;AAAA,EACA,YAAAC;AAAA,EACD,gBAAAC;AACC;AAEA,YAAIH,KAAgB,CAAAD;AACnB,MAAAE;AAA4B,UACxB6B,IAAA;AAAA,MACH;MACA,MAAA7B,EAAc,QAAe;AAAA,MAC9B,cAAAA,EAAA,gBAAA;AAAA,IAEA;AACD,WAAA,gBAAAW,EAAAmB,GAAA,EAAA,WAAApB,EAAA,KAAA,GAAAmB,EAAA,CAAA;AAAA,EAEA;AACC,oBACC/B,IAAC,gBAAAa;AAAA,IAAAmB;AAAA,IAAA;AAAA,MAEA,WAAMpB,EAAA;AAAA,MACN,MAAAZ;AAAA,MACA,MAAAC;AAAA,MACA,MAAA;AAAA,MACA,cAAM;AAAA,MACN,OAAA;AAAA,MACA,gBAAAG;AAAA,MAAgB,gBAAAD;AAAA,IACjB;AAAA,EAEF,IAGD;AAEA,GACKuB,IAAW,CAAA,EAAA,UAAA7B,EAAA,UAKd,MAAA,QAAAA,KACD,gBAAAgB,EAAAoB,GAAA,EAAA,OAAA,MAAA,KAAApC,CAAA,EAAA,CAAA,IAGD,gBAAAgB,EAAAqB,GAAA,EAAA,UAAArC,EAAA,CAAA,IAPC,MAaGoC,IAAC,CAAA,EAAA,OAAAE,EAAA,MAAiB,gBAAAtB,EAAK,MAAA,EAAA,WAAAD,EAAA,MAAA,UAAAuB,EAAA,IAAA,CAAAC,GAAAC,MAAA,gBAAA3B,EAAA,MAAA,EAAA,UAAA;AAAA,EACV,gBAAAG,EAAAqB,GAAS,EAAA,UACpBE,EAAA,CAAK;AAAA,MAHCD,EASX,SAAA,IAAA,gBAAAtB,EAAA,QAAA,EAAA,WAAAD,EAAA,eAAA,eAAA,IAAA,UAAA,IAAA,CAAA,IAAA;AAGD,EAAA,GAAAwB,CAAM,CAAA,EAAA,CAAA,GAOAF,yBACLrC,IACC,gBAAAgB,EAAAyB,EAAA,OAAA,EAAA,OAAA,SAAA,QAAA,UAAA,UAAAzC,EAAA,CAAA,IAAA,MAAC8B,IAAK,CAAA,EAAA,UAAA9B,EAAA,MAAAA,IAAA,gBAAAgB;AAAA,EAALyB,EAAA;AAAA,EAAA;AAAA,IAEA;IACA,MAAA;AAAA,IACA,QAAM;AAAA,IAEL,OAAA;AAAA,IAAA,UAAAzC;AAAA;AAIJ,IAAA,MAOM+B,IAAA,CAAkB,EAAC,UAAA/B,EAAE,MAASA,IAAyB,gBAAAgB,EAAAyB,EAAA,MAAA,EAAA,KAAA,QAAA,MAAA,OAAA,WAAA1B,EAAA,YAAA,OAAA,WAAA,UAAAf,EAAA,CAAA,IAAA,MACxDgC,IAAW,CAAA,EAAA,UAAAhC,EAAA,UAKd,OAAAA,KAAA,WAKD,gBAAAgB,EAAAyB,EAAA,MAAA,EAAA,KAAA,QAAA,MAAA,OAAA,OAAA,WAAA,UAAAzC,EAAA,CAAA,IAGD,gBAAAgB,EAAA0B,GAAA,EAAA,UAAA1C,EAAA,CAAA,IAXC,MAsBI2C,IAAA,CAAA,EAAA,QAAAvB,EAAc,MAAAA,KAAAA,EAAA,SAAA,IAAA,gBAAAJ,EAAA,OAAA,EAAA,WAAAD,EAAA,QAAA,UAAAK,EAAA,IAAA,CAAAwB,MAAA,gBAAA5B,EAAA6B,GAAA,EAAA,GAAAD,EAAA,GAAAA,EAAA,IAAA,CAAA,EAAA,CAAA,IAAA;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { BadgeProps } from '../badge';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { StandaloneLinkProps } from '../standalone-link';
|
|
4
|
+
interface CardPropsBase {
|
|
5
|
+
className?: string;
|
|
6
|
+
ctaLabel?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
standaloneLink?: StandaloneLinkProps;
|
|
9
|
+
onClickCapture?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
10
|
+
isExternal?: boolean;
|
|
11
|
+
'aria-label'?: string;
|
|
12
|
+
}
|
|
13
|
+
export type CardProps = (CardPropsBase & {
|
|
14
|
+
content: CardContentProps;
|
|
15
|
+
children?: never;
|
|
16
|
+
}) | (CardPropsBase & {
|
|
17
|
+
content?: never;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
});
|
|
20
|
+
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
21
|
+
type NonZeroDigit = Exclude<Digit, '0'>;
|
|
22
|
+
type CardThumbnailAspectRatio = `${NonZeroDigit}/${NonZeroDigit}` | `${NonZeroDigit}/${NonZeroDigit}${Digit}` | `${NonZeroDigit}${Digit}/${NonZeroDigit}` | `${NonZeroDigit}${Digit}/${NonZeroDigit}${Digit}`;
|
|
23
|
+
export interface CardThumbnailProps {
|
|
24
|
+
src: string;
|
|
25
|
+
alt: string;
|
|
26
|
+
/**
|
|
27
|
+
* The aspect ratio of the image, specified as a string in the format `width/height`.
|
|
28
|
+
* This follows the same format as the CSS `aspect-ratio` property.
|
|
29
|
+
*
|
|
30
|
+
* @example "16/9" - This would represent an aspect ratio of 16:9.
|
|
31
|
+
* @example "4/3" - This would represent an aspect ratio of 4:3.
|
|
32
|
+
*/
|
|
33
|
+
aspectRatio: CardThumbnailAspectRatio;
|
|
34
|
+
}
|
|
35
|
+
export interface CardContentProps {
|
|
36
|
+
badges?: BadgeProps[];
|
|
37
|
+
cta?: CardCtaProps;
|
|
38
|
+
eyebrow?: ReactNode;
|
|
39
|
+
heading?: string;
|
|
40
|
+
subheading?: string;
|
|
41
|
+
description?: React.ReactNode;
|
|
42
|
+
thumbnail?: CardThumbnailProps;
|
|
43
|
+
showArrow?: boolean;
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface CardCtaProps {
|
|
47
|
+
href?: string;
|
|
48
|
+
ctaLabel?: string;
|
|
49
|
+
standaloneLink?: StandaloneLinkProps;
|
|
50
|
+
onClickCapture?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
51
|
+
isExternal?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,UAAU,aAAa;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC,cAAc,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,SAAS,GAClB,CAAC,aAAa,GAAG;IAAE,OAAO,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GACjE,CAAC,aAAa,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAA;AAEnE,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AACtE,KAAK,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAEvC,KAAK,wBAAwB,GAC1B,GAAG,YAAY,IAAI,YAAY,EAAE,GACjC,GAAG,YAAY,IAAI,YAAY,GAAG,KAAK,EAAE,GACzC,GAAG,YAAY,GAAG,KAAK,IAAI,YAAY,EAAE,GACzC,GAAG,YAAY,GAAG,KAAK,IAAI,YAAY,GAAG,KAAK,EAAE,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;OAMG;IACH,WAAW,EAAE,wBAAwB,CAAA;CACrC;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;IACrB,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC,cAAc,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
|
@@ -0,0 +1,505 @@
|
|
|
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
|
+
overflow-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(--code-block-color-foreground-primary);
|
|
130
|
+
--code-block-color-lang-css-selector: var(--code-block-color-blue);
|
|
131
|
+
--code-block-color-lang-css-url: var(--code-block-color-orange);
|
|
132
|
+
// javascript ----
|
|
133
|
+
--code-block-color-lang-js-constant: var(--code-block-color-orange);
|
|
134
|
+
// markup/html ----
|
|
135
|
+
--code-block-color-lang-markup-attr-value: var(--code-block-color-yellow);
|
|
136
|
+
--code-block-color-lang-markup-entity-named: var(--code-block-color-purple);
|
|
137
|
+
--code-block-color-lang-markup-entity-not-named: var(--code-block-color-green);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Syntax highlighting ----
|
|
141
|
+
// General
|
|
142
|
+
.code-block {
|
|
143
|
+
// Common tokens
|
|
144
|
+
:global(.token.bold) {
|
|
145
|
+
font-weight: bold;
|
|
146
|
+
}
|
|
147
|
+
:global(.token.italic) {
|
|
148
|
+
font-style: italic;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// General tokens
|
|
152
|
+
:global(.token) {
|
|
153
|
+
color: var(--code-block-color-token);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:global(.token.atrule) {
|
|
157
|
+
color: var(--code-block-color-atrule);
|
|
158
|
+
}
|
|
159
|
+
:global(.token.attr-name) {
|
|
160
|
+
color: var(--code-block-color-attr-name);
|
|
161
|
+
}
|
|
162
|
+
:global(.token.attr-value) {
|
|
163
|
+
color: var(--code-block-color-attr-value);
|
|
164
|
+
}
|
|
165
|
+
:global(.token.boolean) {
|
|
166
|
+
color: var(--code-block-color-boolean);
|
|
167
|
+
}
|
|
168
|
+
:global(.token.builtin) {
|
|
169
|
+
color: var(--code-block-color-builtin);
|
|
170
|
+
}
|
|
171
|
+
:global(.token.char) {
|
|
172
|
+
color: var(--code-block-color-char);
|
|
173
|
+
}
|
|
174
|
+
:global(.token.class-name) {
|
|
175
|
+
color: var(--code-block-color-class-name);
|
|
176
|
+
}
|
|
177
|
+
:global(.token.comment) {
|
|
178
|
+
color: var(--code-block-color-comment);
|
|
179
|
+
}
|
|
180
|
+
:global(.token.constant) {
|
|
181
|
+
color: var(--code-block-color-constant);
|
|
182
|
+
}
|
|
183
|
+
:global(.token.deleted) {
|
|
184
|
+
color: var(--code-block-color-deleted);
|
|
185
|
+
}
|
|
186
|
+
:global(.token.entity) {
|
|
187
|
+
color: var(--code-block-color-entity);
|
|
188
|
+
}
|
|
189
|
+
:global(.token.function) {
|
|
190
|
+
color: var(--code-block-color-function);
|
|
191
|
+
}
|
|
192
|
+
:global(.token.important) {
|
|
193
|
+
color: var(--code-block-color-important);
|
|
194
|
+
}
|
|
195
|
+
:global(.token.keyword) {
|
|
196
|
+
color: var(--code-block-color-keyword);
|
|
197
|
+
}
|
|
198
|
+
:global(.token.namespace) {
|
|
199
|
+
color: var(--code-block-color-namespace);
|
|
200
|
+
}
|
|
201
|
+
:global(.token.number) {
|
|
202
|
+
color: var(--code-block-color-number);
|
|
203
|
+
}
|
|
204
|
+
:global(.token.operator) {
|
|
205
|
+
color: var(--code-block-color-operator);
|
|
206
|
+
}
|
|
207
|
+
:global(.token.punctuation) {
|
|
208
|
+
color: var(--code-block-color-punctuation);
|
|
209
|
+
}
|
|
210
|
+
:global(.token.prolog) {
|
|
211
|
+
color: var(--code-block-color-prolog);
|
|
212
|
+
}
|
|
213
|
+
:global(.token.property) {
|
|
214
|
+
color: var(--code-block-color-property);
|
|
215
|
+
}
|
|
216
|
+
:global(.token.regex) {
|
|
217
|
+
color: var(--code-block-color-regex);
|
|
218
|
+
}
|
|
219
|
+
:global(.token.script) {
|
|
220
|
+
color: var(--code-block-color-script);
|
|
221
|
+
}
|
|
222
|
+
:global(.token.selector) {
|
|
223
|
+
color: var(--code-block-color-selector);
|
|
224
|
+
}
|
|
225
|
+
:global(.token.string) {
|
|
226
|
+
color: var(--code-block-color-string);
|
|
227
|
+
}
|
|
228
|
+
:global(.token.symbol) {
|
|
229
|
+
color: var(--code-block-color-symbol);
|
|
230
|
+
}
|
|
231
|
+
:global(.token.tag) {
|
|
232
|
+
color: var(--code-block-color-tag);
|
|
233
|
+
}
|
|
234
|
+
:global(.token.url) {
|
|
235
|
+
color: var(--code-block-color-url);
|
|
236
|
+
}
|
|
237
|
+
:global(.token.variable) {
|
|
238
|
+
color: var(--code-block-color-comment);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Language-specific
|
|
242
|
+
.language-css {
|
|
243
|
+
color: var(--code-block-color-lang-css);
|
|
244
|
+
|
|
245
|
+
.token {
|
|
246
|
+
color: var(--code-block-color-lang-css-token);
|
|
247
|
+
}
|
|
248
|
+
:global(.token.atrule) {
|
|
249
|
+
color: var(--code-block-color-lang-css-atrule);
|
|
250
|
+
}
|
|
251
|
+
:global(.token.rule:not(.atrule)) {
|
|
252
|
+
color: var(--code-block-color-lang-css-not-atrule);
|
|
253
|
+
}
|
|
254
|
+
:global(.token.entity) {
|
|
255
|
+
color: var(--code-block-color-lang-css-entity);
|
|
256
|
+
}
|
|
257
|
+
:global(.token.function) {
|
|
258
|
+
color: var(--code-block-color-lang-css-function);
|
|
259
|
+
}
|
|
260
|
+
:global(.token.property) {
|
|
261
|
+
color: var(--code-block-color-lang-css-property);
|
|
262
|
+
}
|
|
263
|
+
:global(.token.punctuation) {
|
|
264
|
+
color: var(--code-block-color-lang-css-punctuatione);
|
|
265
|
+
}
|
|
266
|
+
:global(.token.selector) {
|
|
267
|
+
color: var(--code-block-color-lang-css-selector);
|
|
268
|
+
}
|
|
269
|
+
:global(.token.url) {
|
|
270
|
+
color: var(--code-block-color-lang-css-url);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
.language-javascript {
|
|
274
|
+
:global(.token.constant) {
|
|
275
|
+
color: var(--code-block-color-lang-js-constant);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
.language-markup,
|
|
279
|
+
.language-html {
|
|
280
|
+
:global(.token.attr-value) {
|
|
281
|
+
color: var(--code-block-color-lang-markup-attr-value);
|
|
282
|
+
}
|
|
283
|
+
:global(.token.entity.named-entity) {
|
|
284
|
+
color: var(--code-block-color-lang-markup-entity-named);
|
|
285
|
+
}
|
|
286
|
+
:global(.token.entity:not(.named-entity)) {
|
|
287
|
+
color: var(--code-block-color-lang-markup-entity-not-named);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// isStandalone
|
|
292
|
+
.is-standalone {
|
|
293
|
+
border-radius: 6px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// CHILD COMPONENTS / ELEMENTS
|
|
297
|
+
|
|
298
|
+
// Header (contains title & description)
|
|
299
|
+
|
|
300
|
+
.title {
|
|
301
|
+
color: var(--code-block-color-foreground-primary);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.description {
|
|
305
|
+
color: var(--code-block-color-foreground-faint);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.header {
|
|
309
|
+
display: flex;
|
|
310
|
+
flex-direction: column;
|
|
311
|
+
gap: 4px;
|
|
312
|
+
padding: 8px var(--code-block-code-padding);
|
|
313
|
+
background-color: var(--code-block-color-surface-faint);
|
|
314
|
+
border-bottom: 1px solid var(--code-block-color-border-primary);
|
|
315
|
+
border-top-left-radius: inherit;
|
|
316
|
+
border-top-right-radius: inherit;
|
|
317
|
+
|
|
318
|
+
&:empty {
|
|
319
|
+
display: none;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// we add very basic styling for elements that may be yielded in the "title"/"description" elements
|
|
323
|
+
|
|
324
|
+
strong {
|
|
325
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
code,
|
|
329
|
+
pre {
|
|
330
|
+
display: inline;
|
|
331
|
+
font-size: 0.9em; // as discussed with designers, we reduce the size for optical/visual balance
|
|
332
|
+
font-family: var(--mds-typography-font-stack-mono);
|
|
333
|
+
line-height: 1em;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
a {
|
|
337
|
+
color: var(--code-block-color-foreground-action);
|
|
338
|
+
|
|
339
|
+
&:focus,
|
|
340
|
+
&:focus-visible {
|
|
341
|
+
text-decoration: none;
|
|
342
|
+
outline: 2px solid var(--mds-color-focus-action-internal);
|
|
343
|
+
outline-offset: 1px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&:hover {
|
|
347
|
+
color: var(--mds-color-foreground-action-hover);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&:active {
|
|
351
|
+
color: var(--mds-color-foreground-action-active);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.body {
|
|
357
|
+
position: relative;
|
|
358
|
+
border-radius: inherit;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Code
|
|
362
|
+
.code {
|
|
363
|
+
@include hds-focus-ring-basic;
|
|
364
|
+
display: block;
|
|
365
|
+
margin: 0;
|
|
366
|
+
padding: var(--code-block-code-padding) 0;
|
|
367
|
+
overflow: auto;
|
|
368
|
+
font-size: 0.8125rem;
|
|
369
|
+
font-family: var(--mds-typography-font-stack-mono);
|
|
370
|
+
border-radius: inherit;
|
|
371
|
+
|
|
372
|
+
::selection {
|
|
373
|
+
color: var(--code-block-color-foreground-selection);
|
|
374
|
+
background-color: var(--code-block-color-surface-selection);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// CopyButton
|
|
379
|
+
.copy-button {
|
|
380
|
+
--copy-button-token-idle: var(--code-block-color-foreground-primary) !important;
|
|
381
|
+
--copy-button-token-success: var(--code-block-color-foreground-success) !important;
|
|
382
|
+
--copy-button-token-error: var(--code-block-color-foreground-critical) !important;
|
|
383
|
+
|
|
384
|
+
position: absolute !important;
|
|
385
|
+
top: 11px; // 12px -1px accounting for border
|
|
386
|
+
right: 12px; // 12px -1px accounting for border
|
|
387
|
+
// Overriding default colors must have !important due to style modules
|
|
388
|
+
color: var(--code-block-color-foreground-primary) !important;
|
|
389
|
+
background-color: var(--code-block-color-surface-faint) !important;
|
|
390
|
+
border: 1px solid var(--code-block-color-border-strong) !important;
|
|
391
|
+
|
|
392
|
+
&:hover {
|
|
393
|
+
background-color: var(--code-block-color-surface-primary) !important;
|
|
394
|
+
border-color: var(--code-block-color-border-strong) !important;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
&:active {
|
|
398
|
+
background-color: var(--code-block-color-surface-interactive-active) !important;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
&:focus,
|
|
402
|
+
&:focus-visible {
|
|
403
|
+
background-color: var(--code-block-color-surface-faint) !important;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Highlighted Lines
|
|
408
|
+
.line-highlight {
|
|
409
|
+
right: 0;
|
|
410
|
+
left: 0;
|
|
411
|
+
margin-top: 0px;
|
|
412
|
+
background-color: var(--code-block-color-line-highlight);
|
|
413
|
+
border: solid var(--code-block-color-line-highlight-border);
|
|
414
|
+
border-width: 0 0 0 4px;
|
|
415
|
+
mix-blend-mode: screen;
|
|
416
|
+
pointer-events: none;
|
|
417
|
+
|
|
418
|
+
// Enable the top border if this is the first line in a group of lines
|
|
419
|
+
&.line-highlight-first {
|
|
420
|
+
border-top-width: 1px;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Enable the bottom border if this is the last line in a group of lines
|
|
424
|
+
&.line-highlight-last {
|
|
425
|
+
border-bottom-width: 1px;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.line-numbers {
|
|
430
|
+
counter-reset: linenumber;
|
|
431
|
+
|
|
432
|
+
.code {
|
|
433
|
+
position: relative;
|
|
434
|
+
padding-left: 49px;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.line-numbers-rows {
|
|
438
|
+
position: absolute;
|
|
439
|
+
top: 0;
|
|
440
|
+
left: 0;
|
|
441
|
+
min-width: 49px;
|
|
442
|
+
min-height: 100%;
|
|
443
|
+
padding: var(--code-block-code-padding) 0;
|
|
444
|
+
border-right: 1px solid var(--code-block-color-border-primary);
|
|
445
|
+
user-select: none;
|
|
446
|
+
pointer-events: none;
|
|
447
|
+
|
|
448
|
+
> span {
|
|
449
|
+
display: block;
|
|
450
|
+
counter-increment: linenumber;
|
|
451
|
+
|
|
452
|
+
&::before {
|
|
453
|
+
display: block;
|
|
454
|
+
padding-right: var(--code-block-code-padding);
|
|
455
|
+
text-align: right;
|
|
456
|
+
content: counter(linenumber);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.line-of-code.line-highlight {
|
|
462
|
+
// This disables the thicker left border on highlighted lines.
|
|
463
|
+
border-width: 0;
|
|
464
|
+
|
|
465
|
+
// This resets the left padding to the original value.
|
|
466
|
+
padding-left: var(--mds-spacing-05);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.line-of-code {
|
|
471
|
+
// Lines of code are <span> elements which are inline by default, but
|
|
472
|
+
// we want them to take up the full width of the code block.
|
|
473
|
+
display: block;
|
|
474
|
+
|
|
475
|
+
// When we're rendering line numbers, we need to add padding to the
|
|
476
|
+
// left of lines of code to make room for the line numbers.
|
|
477
|
+
padding-left: var(--mds-spacing-05);
|
|
478
|
+
|
|
479
|
+
&.line-highlight {
|
|
480
|
+
// This accounts for the 4px margin on the left side so the content
|
|
481
|
+
// does not get moved by the margin.
|
|
482
|
+
padding-left: var(--mds-spacing-04);
|
|
483
|
+
|
|
484
|
+
// Enable the top border if this is the first line in a group of lines
|
|
485
|
+
&.line-highlight-first {
|
|
486
|
+
border-top-width: 1px;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Enable the bottom border if this is the last line in a group of lines
|
|
490
|
+
&.line-highlight-last {
|
|
491
|
+
border-bottom-width: 1px;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
& > span {
|
|
496
|
+
padding-right: var(--mds-spacing-09);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.line-number {
|
|
501
|
+
// Line numbers are <span> elements which are inline by default, but we
|
|
502
|
+
// want them to behave like block elements.
|
|
503
|
+
display: block;
|
|
504
|
+
color: #999;
|
|
505
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note: lines of code are expected to be stable. If we need to work with
|
|
3
|
+
* dynamic code blocks in the future, we could assign random unique IDs
|
|
4
|
+
* to each line during the `linesOfCode` `useMemo` function.
|
|
5
|
+
*
|
|
6
|
+
* For now, we disable react/no-array-index key for the entire file.
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from 'react';
|
|
9
|
+
interface CodeLinesProps {
|
|
10
|
+
value: ReactNode;
|
|
11
|
+
hasLineNumbers?: boolean;
|
|
12
|
+
highlightLines?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Render the provided code into separate line elements,
|
|
16
|
+
* accounting for all provided options.
|
|
17
|
+
*/
|
|
18
|
+
declare const CodeLines: ({ value, hasLineNumbers: lineNumbers, highlightLines: highlight, }: CodeLinesProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { CodeLines };
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/code-block/code-lines/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAGH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAO/C,UAAU,cAAc;IACvB,KAAK,EAAE,SAAS,CAAA;IAChB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,SAAS,GAAI,oEAIhB,cAAc,4CA+EhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { 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;
|
|
20
|
+
//# sourceMappingURL=split-html-into-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-html-into-lines.d.ts","sourceRoot":"","sources":["../../../../../src/components/code-block/code-lines/utils/split-html-into-lines.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAsBlE;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type 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;
|
|
22
|
+
//# sourceMappingURL=split-jsx-into-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-jsx-into-lines.d.ts","sourceRoot":"","sources":["../../../../../src/components/code-block/code-lines/utils/split-jsx-into-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,eAmEtE;AAED,eAAe,iBAAiB,CAAA"}
|